projects
/
supertux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
some cleanups memory leak fixes and moving of source files
[supertux.git]
/
src
/
gameloop.cpp
diff --git
a/src/gameloop.cpp
b/src/gameloop.cpp
index
89776b0
..
a5933de
100644
(file)
--- a/
src/gameloop.cpp
+++ b/
src/gameloop.cpp
@@
-47,20
+47,19
@@
#include "high_scores.h"
#include "gui/menu.h"
#include "sector.h"
#include "high_scores.h"
#include "gui/menu.h"
#include "sector.h"
-#include "player.h"
#include "level.h"
#include "scene.h"
#include "level.h"
#include "scene.h"
-#include "collision.h"
#include "tile.h"
#include "tile.h"
-#include "particlesystem.h"
+#include "object/particlesystem.h"
+#include "object/background.h"
+#include "object/tilemap.h"
+#include "object/camera.h"
+#include "object/player.h"
#include "resources.h"
#include "resources.h"
-#include "background.h"
-#include "tilemap.h"
#include "app/gettext.h"
#include "worldmap.h"
#include "intro.h"
#include "misc.h"
#include "app/gettext.h"
#include "worldmap.h"
#include "intro.h"
#include "misc.h"
-#include "camera.h"
#include "statistics.h"
#include "timer.h"
#include "object/fireworks.h"
#include "statistics.h"
#include "timer.h"
#include "object/fireworks.h"
@@
-80,11
+79,11
@@
bool compare_last(std::string& haystack, std::string needle)
return false;
}
return false;
}
-GameSession::GameSession(const std::string& level
nam
e_, int mode,
+GameSession::GameSession(const std::string& level
fil
e_, int mode,
bool flip_level_, Statistics* statistics)
: level(0), currentsector(0), st_gl_mode(mode),
bool flip_level_, Statistics* statistics)
: level(0), currentsector(0), st_gl_mode(mode),
- end_sequence(NO_ENDSEQUENCE), level
name(levelname_), flip_level(flip_level
_),
- best_level_statistics(statistics)
+ end_sequence(NO_ENDSEQUENCE), level
file(levelfile
_),
+
flip_level(flip_level_),
best_level_statistics(statistics)
{
current_ = this;
{
current_ = this;
@@
-124,7
+123,7
@@
GameSession::restart_level()
currentsector = 0;
level = new Level;
currentsector = 0;
level = new Level;
- level->load(level
nam
e);
+ level->load(level
fil
e);
if(flip_level)
level->do_vertical_flip();
if(flip_level)
level->do_vertical_flip();
@@
-463,6
+462,11
@@
GameSession::process_events()
tux.kill(tux.KILL);
last_keys.clear();
}
tux.kill(tux.KILL);
last_keys.clear();
}
+ if(compare_last(last_keys, "grid"))
+ { // toggle debug grid
+ debug_grid = !debug_grid;
+ last_keys.clear();
+ }
if(compare_last(last_keys, "hover"))
{ // toggle hover ability on/off
tux.enable_hover = !tux.enable_hover;
if(compare_last(last_keys, "hover"))
{ // toggle hover ability on/off
tux.enable_hover = !tux.enable_hover;
@@
-721,7
+725,8
@@
GameSession::run()
while (exit_status == ES_NONE) {
Uint32 ticks = SDL_GetTicks();
float elapsed_time = float(ticks - lastticks) / 1000.;
while (exit_status == ES_NONE) {
Uint32 ticks = SDL_GetTicks();
float elapsed_time = float(ticks - lastticks) / 1000.;
- global_time += elapsed_time;
+ if(!game_pause)
+ global_time += elapsed_time;
lastticks = ticks;
// 40fps is minimum
lastticks = ticks;
// 40fps is minimum