font size was wrong in the chat window..

origin
stpohle 23 years ago
parent 7874c516ab
commit 5e870aa465

@ -67,12 +67,12 @@ chat_drawbox ()
src.x = chat.window.x + 2; src.x = chat.window.x + 2;
src.y = chat.window.y + 2; src.y = chat.window.y + 2;
src.w = src.x + chat.window.w - 4; src.w = src.x + chat.window.w - 4;
src.h = src.y + chat.window.h - 4 - 16; src.h = src.y + chat.window.h - 4 - font[0].size.y;
draw_shadefield (gfx.screen, &src, CHAT_BG_SHADE_DARK); draw_shadefield (gfx.screen, &src, CHAT_BG_SHADE_DARK);
src.x = chat.window.x + 2; src.x = chat.window.x + 2;
src.y = chat.window.y + chat.window.h - 18; src.y = chat.window.y + chat.window.h - 18;
src.w = src.x + chat.window.w - 4; src.w = src.x + chat.window.w - 4;
src.h = src.y + 16; src.h = src.y + font[0].size.y;
draw_shadefield (gfx.screen, &src, CHAT_BG_SHADE_DARK >> 1); draw_shadefield (gfx.screen, &src, CHAT_BG_SHADE_DARK >> 1);
gfx_AddUpdateRect (chat.window.x, chat.window.y, chat.window.w, chat.window.h); gfx_AddUpdateRect (chat.window.x, chat.window.y, chat.window.w, chat.window.h);
}; };
@ -144,7 +144,7 @@ chat_clearscreen (signed char all)
dest.x = chat.window.x + 2; dest.x = chat.window.x + 2;
dest.y = chat.window.y + chat.window.h - 18; dest.y = chat.window.y + chat.window.h - 18;
dest.w = src.w = chat.window.w - 4; dest.w = src.w = chat.window.w - 4;
dest.h = src.h = 16; dest.h = src.h = font[0].size.y;
src.x = 2; src.x = 2;
src.y = chat.window.h - 18; src.y = chat.window.h - 18;
@ -153,14 +153,14 @@ chat_clearscreen (signed char all)
if (all == 1) { if (all == 1) {
dest.w = dest.x + chat.window.w - 4; dest.w = dest.x + chat.window.w - 4;
dest.h = dest.y + chat.window.h - 4 - 16; dest.h = dest.y + chat.window.h - 4 - font[0].size.y;
draw_shadefield (gfx.screen, &dest, CHAT_BG_SHADE_DARK); draw_shadefield (gfx.screen, &dest, CHAT_BG_SHADE_DARK);
} }
src.x = chat.window.x + 2; src.x = chat.window.x + 2;
src.y = chat.window.y + chat.window.h - 18; src.y = chat.window.y + chat.window.h - 18;
src.w = src.x + chat.window.w - 4; src.w = src.x + chat.window.w - 4;
src.h = src.y + 16; src.h = src.y + font[0].size.y;
draw_shadefield (gfx.screen, &src, CHAT_BG_SHADE_DARK >> 1); draw_shadefield (gfx.screen, &src, CHAT_BG_SHADE_DARK >> 1);
gfx_AddUpdateRect (chat.window.x, chat.window.y, chat.window.w, chat.window.h); gfx_AddUpdateRect (chat.window.x, chat.window.y, chat.window.w, chat.window.h);
@ -192,8 +192,9 @@ chat_loop (SDL_Event * event)
/* draw the new field */ /* draw the new field */
chat_clearscreen (chat.lineschanged); chat_clearscreen (chat.lineschanged);
p1 = p2 = 0; p1 = p2 = 0;
maxchar = (chat.window.w - 4) / (font[0].size.x - 4); maxchar = (chat.window.w - 4) / font[0].size.x;
if (chat.lineschanged) { if (chat.lineschanged) {
font_setcolor (255,255,255,0);
y = chat.window.y + 4; y = chat.window.y + 4;
l = chat.startline; l = chat.startline;
while (y < (chat.window.y + chat.window.h - 32) && chat.lines[l][0] != 0) { while (y < (chat.window.y + chat.window.h - 32) && chat.lines[l][0] != 0) {

Loading…
Cancel
Save