9,7 → 9,7 |
dword buf_data=0; |
|
|
struct CANVAS { |
struct DrawBufer { |
dword bufx, bufy, bufw, bufh; |
dword fill_color; |
|
25,10 → 25,10 |
}; |
|
char draw_buf_not_enaught_ram[] = |
"'CANVAS requested %i MB more memory than the system has. |
"'DrawBufer requested %i MB more memory than the system has. |
Application could be unstable.' -E"; |
|
bool CANVAS::Init(dword i_bufx, i_bufy, i_bufw, i_bufh) |
bool DrawBufer::Init(dword i_bufx, i_bufy, i_bufw, i_bufh) |
{ |
bufx = i_bufx; |
bufy = i_bufy; |
42,7 → 42,7 |
return true; |
} |
|
void CANVAS::Fill(dword start_pointer, i_fill_color) |
void DrawBufer::Fill(dword start_pointer, i_fill_color) |
{ |
dword max_i = bufw * bufh * 4 - start_pointer/4; |
fill_color = i_fill_color; |
49,7 → 49,7 |
@MEMSETD(buf_data+start_pointer+8, max_i, fill_color); |
} |
|
void CANVAS::DrawBar(dword x, y, w, h, color) |
void DrawBufer::DrawBar(dword x, y, w, h, color) |
{ |
dword i, j; |
if (y + h >= bufh) IncreaseBufSize(); |
60,7 → 60,7 |
} |
} |
|
void CANVAS::WriteText(dword x, y, byte fontType, dword color, str_offset, strlen) |
void DrawBufer::WriteText(dword x, y, byte fontType, dword color, str_offset, strlen) |
{ |
#define BUGFIX_32000 32000 |
dword ydiv=0; |
89,13 → 89,13 |
} |
} |
|
void CANVAS::PutPixel(dword x, y, color) |
void DrawBufer::PutPixel(dword x, y, color) |
{ |
dword pos = y*bufw+x*4+8+buf_data; |
ESDWORD[pos] = color; |
} |
|
void CANVAS::AlignRight(dword x,y,w,h, content_width) |
void DrawBufer::AlignRight(dword x,y,w,h, content_width) |
{ |
dword i, j, l; |
dword content_left = w - content_width / 2; |
108,7 → 108,7 |
} |
} |
|
void CANVAS::AlignCenter(dword x,y,w,h, content_width) |
void DrawBufer::AlignCenter(dword x,y,w,h, content_width) |
{ |
dword i, j, l; |
dword content_left = w - content_width / 2; |
121,12 → 121,12 |
} |
} |
|
void CANVAS::Show(dword _y_offset, _h) |
void DrawBufer::Show(dword _y_offset, _h) |
{ |
PutPaletteImage(_y_offset * bufw * 4 + buf_data+8, bufw, _h, bufx, bufy, 32, 0); |
} |
|
void CANVAS::IncreaseBufSize() |
void DrawBufer::IncreaseBufSize() |
{ |
static dword bufh_initial; |
dword alloc_size; |