[Super-tux-commit] supertux/src gameloop.cpp,1.126,1.127 level.cpp,1.70,1.71 level.h,1.47,1.48 scree
Brought to you by:
wkendrick
From: Ryan F. <sik...@us...> - 2004-05-14 21:49:41
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12763 Modified Files: gameloop.cpp level.cpp level.h screen.cpp title.cpp world.cpp Log Message: - more resolution fixes Index: level.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/level.cpp,v retrieving revision 1.70 retrieving revision 1.71 diff -u -d -r1.70 -r1.71 --- level.cpp 12 May 2004 14:54:04 -0000 1.70 +++ level.cpp 14 May 2004 21:49:30 -0000 1.71 @@ -739,6 +739,16 @@ } } +void Level::draw_bg() +{ + // Tile background horizontally + int sx = (int)((float)scroll_x * ((float)bkgd_speed/100.0f)) % img_bkgd->w; + for (int i = 0; (i-1)*img_bkgd->w <= screen->w; i++) + img_bkgd->draw_part(i == 0 ? sx : 0, 0, + i == 0 ? 0 : (img_bkgd->w * i) - sx, 0, + i == 0 ? img_bkgd->w - sx : img_bkgd->w, img_bkgd->h); +} + void Level::load_song() { Index: level.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/level.h,v retrieving revision 1.47 retrieving revision 1.48 diff -u -d -r1.47 -r1.48 --- level.h 11 May 2004 18:26:27 -0000 1.47 +++ level.h 14 May 2004 21:49:30 -0000 1.48 @@ -136,6 +136,9 @@ void change_width (int new_width); void change_height (int new_height); + /* Draw background */ + void draw_bg(); + /** Return the id of the tile at position x/y */ unsigned int gettileid(float x, float y) const; /** returns the id of the tile at position x,y Index: title.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/title.cpp,v retrieving revision 1.82 retrieving revision 1.83 diff -u -d -r1.82 -r1.83 --- title.cpp 14 May 2004 07:42:29 -0000 1.82 +++ title.cpp 14 May 2004 21:49:30 -0000 1.83 @@ -271,7 +271,7 @@ draw_demo(&session, frame_ratio); if (Menu::current() == main_menu) - logo->draw( 160, 30); + logo->draw(screen->w/2 - logo->w/2, 30); white_small_text->draw(" SuperTux " VERSION "\n" "Copyright (c) 2003 SuperTux Devel Team\n" Index: world.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/world.cpp,v retrieving revision 1.88 retrieving revision 1.89 diff -u -d -r1.88 -r1.89 --- world.cpp 14 May 2004 20:50:22 -0000 1.88 +++ world.cpp 14 May 2004 21:49:30 -0000 1.89 @@ -178,21 +178,10 @@ int y,x; /* Draw the real background */ + drawgradient(level->bkgd_top, level->bkgd_bottom); if(level->img_bkgd) - { - // Tile background horizontally - int sx = (int)((float)scroll_x * ((float)level->bkgd_speed/100.0f)) % level->img_bkgd->w; - for (int i = 0; (i-1)*level->img_bkgd->w <= screen->w; i++) - { - level->img_bkgd->draw_part(i == 0 ? sx : 0, 0, - i == 0 ? 0 : (level->img_bkgd->w * i) - sx, 0, - i == 0 ? level->img_bkgd->w - sx : level->img_bkgd->w, level->img_bkgd->h); - } - } - else - { - drawgradient(level->bkgd_top, level->bkgd_bottom); - } + level->draw_bg(); + /* Draw particle systems (background) */ std::vector<ParticleSystem*>::iterator p; Index: gameloop.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/gameloop.cpp,v retrieving revision 1.126 retrieving revision 1.127 diff -u -d -r1.126 -r1.127 --- gameloop.cpp 12 May 2004 17:56:33 -0000 1.126 +++ gameloop.cpp 14 May 2004 21:49:30 -0000 1.127 @@ -146,7 +146,7 @@ char str[60]; if (get_level()->img_bkgd) - get_level()->img_bkgd->draw(0, 0); + get_level()->draw_bg(); else drawgradient(get_level()->bkgd_top, get_level()->bkgd_bottom); @@ -721,7 +721,7 @@ char str[80]; if (get_level()->img_bkgd) - get_level()->img_bkgd->draw(0, 0); + get_level()->draw_bg(); else drawgradient(get_level()->bkgd_top, get_level()->bkgd_bottom); @@ -745,7 +745,7 @@ char str[80]; if (get_level()->img_bkgd) - get_level()->img_bkgd->draw(0, 0); + get_level()->draw_bg(); else drawgradient(get_level()->bkgd_top, get_level()->bkgd_bottom); Index: screen.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/screen.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- screen.cpp 1 May 2004 11:25:45 -0000 1.12 +++ screen.cpp 14 May 2004 21:49:30 -0000 1.13 @@ -72,10 +72,10 @@ glBegin(GL_QUADS); glColor3ub(top_clr.red, top_clr.green, top_clr.blue); glVertex2f(0, 0); - glVertex2f(640, 0); + glVertex2f(screen->w, 0); glColor3ub(bot_clr.red, bot_clr.green, bot_clr.blue); - glVertex2f(640, 480); - glVertex2f(0, 480); + glVertex2f(screen->w, screen->h); + glVertex2f(0, screen->h); glEnd(); } else |