[Super-tux-commit] supertux/src button.cpp,1.34,1.35 leveleditor.cpp,1.130,1.131
Brought to you by:
wkendrick
From: Ricardo C. <rm...@us...> - 2004-06-03 10:41:16
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32303/src Modified Files: button.cpp leveleditor.cpp Log Message: Made these two compilable. Were accessing text's w and h variables. Index: button.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/button.cpp,v retrieving revision 1.34 retrieving revision 1.35 diff -u -d -r1.34 -r1.35 --- button.cpp 2 Jun 2004 23:33:34 -0000 1.34 +++ button.cpp 3 Jun 2004 10:41:06 -0000 1.35 @@ -119,13 +119,13 @@ char str[80]; int i = -32; - if(0 > rect.x - (int)strlen(info.c_str()) * white_small_text->w) - i = rect.w + strlen(info.c_str()) * white_small_text->w; + if(0 > rect.x - white_small_text->get_text_width(info)) + i = rect.w + (int)white_small_text->get_text_width(info); if(!info.empty()) - context.draw_text(white_small_text, info.c_str(), Vector(i + rect.x - strlen(info.c_str()) * white_small_text->w, rect.y), LAYER_GUI); + context.draw_text(white_small_text, info, Vector(i + rect.x - white_small_text->get_text_width(info), rect.y), LAYER_GUI); sprintf(str,"(%s)", SDL_GetKeyName(shortcut)); - context.draw_text(white_small_text, str, Vector(i + rect.x - strlen(str) * white_small_text->w, rect.y + white_small_text->h+2), LAYER_GUI); + context.draw_text(white_small_text, str, Vector(i + rect.x - white_small_text->get_text_width(str), rect.y + white_small_text->get_height()+2), LAYER_GUI); } if(state == BUTTON_PRESSED || state == BUTTON_DEACTIVE) fillrect(rect.x,rect.y,rect.w,rect.h,75,75,75,200); Index: leveleditor.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/leveleditor.cpp,v retrieving revision 1.130 retrieving revision 1.131 diff -u -d -r1.130 -r1.131 --- leveleditor.cpp 2 Jun 2004 23:33:35 -0000 1.130 +++ leveleditor.cpp 3 Jun 2004 10:41:07 -0000 1.131 @@ -1880,7 +1880,7 @@ context.draw_text_center(blue_text, "- Help -", Vector(0, 30), LAYER_GUI); for(unsigned int t = 0; t < sizeof(text[i])/sizeof(char *); t++) - context.draw_text(white_text, text[i][t], Vector(5, 80+(t*white_text->h)), LAYER_GUI); + context.draw_text(white_text, text[i][t], Vector(5, 80+(t*white_text->get_height())), LAYER_GUI); sprintf(str,"Press any key to continue - Page %d/%d?", i, sizeof(text)); context.draw_text(gold_text, str, Vector(0, 0), LAYER_GUI); |