mod_sim_gui.hh

Go to the documentation of this file.
00001 /*
00008  * LEGAL:   COPYRIGHT (C) 2004 JIM E. BROOKS
00009  *          THIS SOURCE CODE IS RELEASED UNDER THE TERMS
00010  *          OF THE GNU GENERAL PUBLIC LICENSE VERSION 2 (GPL 2).
00011  *****************************************************************************/
00012 
00013 #if COMPILING_MODULE //_SIM
00014 #ifndef MOD_SIM_GUI_HH
00015 #define MOD_SIM_GUI_HH 1
00016 
00017 #include "gfx_font.hh"
00018 #include "gfx_gui.hh"
00019 using namespace gfx;
00020 
00021 namespace mod_sim {
00022 
00023 #if MOD_SIM_GUI_CC
00024 void ModuleSimGui_GuiButtonCallback( GuiObject* obj, uint buttons ); // Gui button clicked
00025 #endif
00026 
00035 class ModuleSimGui
00036 {
00037 
00038 public:
00039     // This must be a single PERSISTENT object!
00040     // This NOP constructor relies on the object being PERSISTENT to auto-zero all members.
00041                     ModuleSimGui( void );
00042                     ~ModuleSimGui();
00043     void            Init( void );
00044     void            Delete( void );
00045     void            Reset( void );
00046     void            Draw( void );
00047     void            Reshape( const Rect<int>& viewport, const Rect<int>& window );
00048     void            SplashOff( void );
00049     void            SetZoom( const fp zoom );
00050     fp              GetZoom( void );
00051     void            IncZoom( void );
00052     void            DecZoom( void );
00053     void            ToggleBlend( void );
00054     void            ToggleMenu( void );
00055     void            PrintStatus( const char* str );
00056     void            Update( void );
00057     void            UpdatePause( void );
00058     void            UpdateInputDevice( void );
00059     void            UpdateJoystickAxis3( void );
00060     void            UpdateJoycal( void );
00061     void            UpdatePerspective( void );
00062     void            UpdateFogDensity( void );
00063     void            UpdateCollisions( void );
00064     void            UpdateControlResponse( void );
00065     void            UpdateLod( void );
00066     void            UpdateGuiZoom( void );
00067     bool            IfAnyMouseButtonPressed( void ) { return mMouseButtonWasPressed; }
00068     void            TimerOneSecond( void );
00069     void            MouseMotionHandler( fp x, fp y );
00070     void            MouseButtonHandler( eMouseEvent button, bool down );
00071 
00072 private:
00073     void            StartStopListeners( bool start );
00074     void            InitScreens( void );
00075     void            InitScreenMain( void );
00076     void            InitScreenMenu( void );
00077     void            InitScreenHelp( void );
00078     void            InitScreenAbout( void );
00079     void            InitScreenJoycal( void );
00080     void            DrawScreens( void );
00081     void            DrawScreenMain( void );
00082     void            DrawScreenMenu( void );
00083     void            DrawScreenHelp( void );
00084     void            DrawScreenAbout( void );
00085     void            DrawScreenJoycal( void );
00086     void            DrawEasterEgg( void );
00087     void            GuiButtonCallback( GuiObject* obj, uint buttons );
00088     void            WriteJoycalConfig( GuiButton* button, const char* str, int val, const string& key );
00089     void            ResetJoycalConfig( void );
00090     void            TurnScreensOff( GuiScreen* notme );
00091 
00092 #if DEBUG
00093     void            UpdateDebug( void );
00094     void            UpdateDebugWireframe( void );
00095     void            UpdateDebugNormals( void );
00096     void            UpdateDebugDrawBSPVolume( void );
00097     void            UpdateDebugDrawObjectVolume( void );
00098     void            InitScreenDebug( void );
00099     void            DrawScreenDebug( void );
00100     void            ToggleDebug( void );
00101 #endif
00102 
00103 private:
00104     bool                mInit;
00105     bool                mReady;
00106     bool                mAfterSplash;  // after splash was shown
00107     bool                mMouseButtonWasPressed;
00108     bool                mAboutButtonWasToggled;
00109     Gui*                mGui;
00110     GuiScreen*          mScreenMain;
00111     GuiScreen*          mScreenMenu;
00112     GuiScreen*          mScreenHelp;
00113     GuiScreen*          mScreenAbout;
00114     GuiScreen*          mScreenJoycal;
00115     // Main screen:
00116     GuiButton*          mButtonMenu;
00117     GuiButton*          mButtonPause;
00118     // Menu screen:
00119     GuiButton*          mButtonExit;
00120     GuiButton*          mButtonSave;
00121     GuiButton*          mButtonHelp;
00122     GuiButton*          mButtonAbout;
00123     GuiButton*          mButtonCollisions;
00124     GuiButton*          mButtonLod;
00125     GuiButton*          mButtonGuiZoomPlus;
00126     GuiButton*          mButtonGuiZoomMinus;
00127     GuiButton*          mButtonPerspectivePlus;
00128     GuiButton*          mButtonPerspectiveMinus;
00129     GuiButton*          mButtonFogDensityPlus;
00130     GuiButton*          mButtonFogDensityMinus;
00131     GuiButton*          mButtonResponsePlus;
00132     GuiButton*          mButtonResponseMinus;
00133     GuiButton*          mButtonInputDevice;
00134     GuiButton*          mButtonJoyaxis3;
00135     GuiButton*          mButtonJoycal;
00136     // Joystick calibration screen:
00137     GuiButton*          mButtonJoycalReset;
00138     GuiButton*          mButtonJoycalLeftMax;
00139     GuiButton*          mButtonJoycalLeftMin;
00140     GuiButton*          mButtonJoycalRightMax;
00141     GuiButton*          mButtonJoycalRightMin;
00142     GuiButton*          mButtonJoycalUpMax;
00143     GuiButton*          mButtonJoycalUpMin;
00144     GuiButton*          mButtonJoycalDownMax;
00145     GuiButton*          mButtonJoycalDownMin;
00146     GuiButton*          mButtonJoycalSlowMax;
00147     GuiButton*          mButtonJoycalSlowMin;
00148     GuiButton*          mButtonJoycalFastMax;
00149     GuiButton*          mButtonJoycalFastMin;
00150 
00151 #if DEBUG
00152     GuiScreen*          mScreenDebug;
00153     GuiButton*          mButtonDebug;
00154     GuiButton*          mButtonDebugWireframe;
00155     GuiButton*          mButtonDebugNormals;
00156     GuiButton*          mButtonDebugDrawBSPVolume;
00157     GuiButton*          mButtonDebugDrawObjectVolume;
00158     vector<fp>          mDrawNormalScales;
00159 #endif
00160 
00161 friend void ModuleSimGui_GuiButtonCallback( GuiObject* obj, uint buttons ); // Gui button clicked
00162 };
00163 
00164 } // namespace mod_sim
00165 
00166 #endif // MOD_SIM_GUI_HH
00167 #endif // COMPILING_MODULE //_SIM
Palomino 3D Engine documents generated by doxygen 1.5.3 on Fri Nov 23 11:26:12 2007