mod_sim_class.hh

Go to the documentation of this file.
00001 /*
00009  * LEGAL:   COPYRIGHT (C) 2004 JIM E. BROOKS
00010  *          THIS SOURCE CODE IS RELEASED UNDER THE TERMS
00011  *          OF THE GNU GENERAL PUBLIC LICENSE VERSION 2 (GPL 2).
00012  *****************************************************************************/
00013 
00014 #if COMPILING_MODULE
00015 #ifndef MOD_SIM_CLASS_HH
00016 #define MOD_SIM_CLASS_HH 1
00017 
00018 #include "inp.hh"
00019 using namespace inp;
00020 #include "mod_base_mode.hh"
00021 using namespace mod_base;
00022 #include "mod_sim_settings.hh"
00023 
00024 namespace mod_sim {
00025 
00026 namespace game { class Game; }
00027 
00033 class ModuleSim : public Module
00034 {
00035 
00036 private: typedef Module Parent;
00037 
00038 //------------------------------------------------------------------------------
00039 // Initialization:
00040 //------------------------------------------------------------------------------
00041 public:                     ModuleSim( void );
00042 public:                     ~ModuleSim();
00043 public:  void               Init( int argc, char** argv, const string& programName );
00044 public:  void               Start( void );
00045 private: void               Start2( void );
00046 private: void               Start3( void );
00047 public:  void               End( void );
00048 private: void               InitPreCmdarg( void );
00049 private: void               InitCmdarg( int argc, char** argv );
00050 private: void               InitPostCmdarg( int argc, char** argv );
00051 private: void               StartStopListeners( bool start );
00052 
00053 private:
00055     class StartupIdleFunctor : public Event<>::ListenerFunctor
00056     {
00057     public:
00058         void operator()( Void nothing );
00059     };
00060     friend class StartupIdleFunctor;
00061 
00062 //------------------------------------------------------------------------------
00063 // Interface:
00064 //------------------------------------------------------------------------------
00065 public:  ModuleMode&        GetModuleMode( void ) { return *mModuleMode; }
00066 public:  game::Game&        GetGame( void ) { return *mGame; }
00067 public:  bool               IfEyeMode( void ) { return mModuleMode->IfEyeMode(); }
00068 
00069 //------------------------------------------------------------------------------
00070 // Reset scene:
00071 //------------------------------------------------------------------------------
00072 private:
00074     struct SceneState
00075     {
00076         Matrix      mViewMatrix;
00077         GFX::Light  mGlobalLight;
00078     };
00079 public:  void               SaveScene( void );
00080 public:  void               ResetScene( void );  // restore scene (Backspace)
00081 
00082 //------------------------------------------------------------------------------
00083 // Configuration:
00084 //------------------------------------------------------------------------------
00085 public:  ConfigFile&        GetConfigFile( void );  // may return a dummy ConfigFile similar to a bad-but-safe C++ stream
00086 public:  bool               SaveState( bool saveView );
00087 private: bool               LoadState( void );
00088 
00089 //------------------------------------------------------------------------------
00090 // Misc:
00091 //------------------------------------------------------------------------------
00092 private: void               SelfCheck( void );
00093 
00094 //------------------------------------------------------------------------------
00095 // Data members:
00096 //------------------------------------------------------------------------------
00097 private:    shptr<ModuleMode>   mModuleMode;    // ptrs to speed compiling
00098 private:    SharedPtr<game::Game>   mGame;
00099 public:     SceneState          mSceneState;    // state to reset scene
00100 };
00101 
00102 } // namespace mod_sim
00103 
00104 #endif // MOD_SIM_CLASS_HH
00105 #endif // COMPILING_MODULE
Palomino 3D Engine documents generated by doxygen 1.5.3 on Fri Nov 23 11:26:12 2007