X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fgame_session.h;h=3357fd18a8836d83fda08fcac7dbd6f92288840c;hb=2c60d146e19529ed9037539a12abb6001f850c60;hp=ab0a777b449a67cb1ec3b28832ad3194b7d16e22;hpb=c0093d25093395cb62fc2526ab42be65a9f015b8;p=supertux.git diff --git a/src/game_session.h b/src/game_session.h index ab0a777b4..3357fd18a 100644 --- a/src/game_session.h +++ b/src/game_session.h @@ -21,14 +21,13 @@ #ifndef SUPERTUX_GAMELOOP_H #define SUPERTUX_GAMELOOP_H +#include #include #include "timer.h" #include "statistics.h" - -using namespace SuperTux; +#include "math/vector.h" /* GameLoop modes */ - enum GameSessionMode { ST_GL_PLAY, ST_GL_TEST, @@ -60,7 +59,7 @@ public: public: DrawingContext* context; - Timer2 time_left; + Timer time_left; GameSession(const std::string& levelfile, GameSessionMode mode, Statistics* statistics=0); @@ -69,6 +68,8 @@ public: /** Enter the busy loop */ ExitStatus run(); + void record_demo(const std::string& filename); + void play_demo(const std::string& filename); void draw(); void action(float frame_ratio); @@ -76,6 +77,8 @@ public: { current_ = this; } static GameSession* current() { return current_; } + /// ends the level as finished + void finish(); void respawn(const std::string& sectorname, const std::string& spawnpointname); void set_reset_point(const std::string& sectorname, @@ -94,6 +97,7 @@ private: void check_end_conditions(); void start_timers(); void process_events(); + void capture_demo_step(); void levelintro(); void drawstatus(DrawingContext& context); @@ -104,8 +108,7 @@ private: void on_escape_press(); void process_menu(); - Uint32 fps_ticks; - Timer2 endsequence_timer; + Timer endsequence_timer; Level* level; Sector* currentsector; @@ -139,12 +142,13 @@ private: static GameSession* current_; - // for cheating - std::string last_keys; - Statistics* best_level_statistics; - ExitStatus exit_status; + + std::ostream* capture_demo_stream; + std::string capture_file; + std::istream* playback_demo_stream; + CodeController* demo_controller; }; std::string slotinfo(int slot);