[Super-tux-commit] supertux/src level.cpp,1.37,1.38 level.h,1.31,1.32 player.cpp,1.43,1.44
Brought to you by:
wkendrick
From: Ingo R. <gr...@us...> - 2004-04-18 22:36:12
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22217 Modified Files: level.cpp level.h player.cpp Log Message: - commited start_pos patch from sik0fewl Index: player.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/player.cpp,v retrieving revision 1.43 retrieving revision 1.44 diff -u -d -r1.43 -r1.44 --- player.cpp 18 Apr 2004 21:16:53 -0000 1.43 +++ player.cpp 18 Apr 2004 22:36:03 -0000 1.44 @@ -64,15 +64,16 @@ void Player::init() { + Level* plevel = World::current()->get_level(); + base.width = 32; base.height = 32; size = SMALL; got_coffee = false; - // FIXME: Make the start position configurable via the levelfile - base.x = 100; - base.y = 170; + base.x = plevel->start_pos_x; + base.y = plevel->start_pos_y; base.xm = 0; base.ym = 0; previous_base = old_base = base; Index: level.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/level.cpp,v retrieving revision 1.37 retrieving revision 1.38 diff -u -d -r1.37 -r1.38 --- level.cpp 18 Apr 2004 21:16:53 -0000 1.37 +++ level.cpp 18 Apr 2004 22:36:03 -0000 1.38 @@ -213,6 +213,8 @@ song_title = "Mortimers_chipdisko.mod"; bkgd_image = "arctis.png"; width = 21; + start_pos_x = 100; + start_pos_y = 170; time_left = 100; gravity = 10.; bkgd_top.red = 0; @@ -285,9 +287,10 @@ if (strcmp(lisp_symbol(lisp_car(root_obj)), "supertux-level") == 0) { LispReader reader(lisp_cdr(root_obj)); - reader.read_int("version", &version); reader.read_int("width", &width); + if (!reader.read_int("start_pos_x", &start_pos_x)) start_pos_x = 100; + if (!reader.read_int("start_pos_y", &start_pos_y)) start_pos_y = 170; reader.read_int("time", &time_left); reader.read_int("bkgd_top_red", &bkgd_top.red); Index: level.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/level.h,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- level.h 18 Apr 2004 13:42:15 -0000 1.31 +++ level.h 18 Apr 2004 22:36:03 -0000 1.32 @@ -68,6 +68,8 @@ Color bkgd_top; Color bkgd_bottom; int width; + int start_pos_x; + int start_pos_y; int endpos; float gravity; |