diff options
Diffstat (limited to 'src/object/robotmain.h')
-rw-r--r-- | src/object/robotmain.h | 343 |
1 files changed, 174 insertions, 169 deletions
diff --git a/src/object/robotmain.h b/src/object/robotmain.h index 559453b..fead48d 100644 --- a/src/object/robotmain.h +++ b/src/object/robotmain.h @@ -18,16 +18,13 @@ #pragma once - -#include <stdio.h> - +#include "common/global.h" #include "common/misc.h" -#include "old/d3dengine.h" +#include "graphics/engine/particle.h" #include "object/object.h" #include "object/mainmovie.h" -#include "old/camera.h" -#include "old/particule.h" +#include <stdio.h> enum Phase { @@ -69,36 +66,41 @@ enum Phase class CInstanceManager; -class CMainDialog; -class CMainShort; -class CMainMap; -class CEvent; -class CD3DEngine; -class CLight; +class CEventQueue; +class CSoundInterface; + +namespace Gfx +{ +class CEngine; +class CLightManager; class CWater; class CCloud; -class CBlitz; +class CLightning; class CPlanet; class CTerrain; -class CModel; +}; + +namespace Ui +{ +class CMainDialog; +class CMainShort; +class CMainMap; class CInterface; -class CWindow; -class CControl; class CDisplayText; class CDisplayInfo; -class CSound; +}; struct EndTake { - Math::Vector pos; - float dist; - ObjectType type; - int min; // wins if> - int max; // wins if < - int lost; // lost if <= - bool bImmediat; - char message[100]; + Math::Vector pos; + float dist; + ObjectType type; + int min; // wins if> + int max; // wins if < + int lost; // lost if <= + bool immediat; + char message[100]; }; @@ -106,7 +108,7 @@ const int MAXNEWSCRIPTNAME = 20; struct NewScriptName { - bool bUsed; + bool used; ObjectType type; char name[40]; }; @@ -118,8 +120,8 @@ const float SHOWLIMITTIME = 20.0f; struct ShowLimit { - bool bUsed; - Math::Vector pos; + bool used; + Math::Vector pos; float radius; int total; int parti[MAXSHOWPARTI]; @@ -142,7 +144,7 @@ const int SATCOM_MAX = 6; class CRobotMain { public: - CRobotMain(CInstanceManager* iMan); + CRobotMain(CInstanceManager* iMan, CApplication* app); ~CRobotMain(); void CreateIni(); @@ -153,102 +155,102 @@ public: bool CreateShortcuts(); void ScenePerso(); - void SetMovieLock(bool bLock); - bool RetMovieLock(); - bool RetInfoLock(); - void SetSatComLock(bool bLock); - bool RetSatComLock(); - void SetEditLock(bool bLock, bool bEdit); - bool RetEditLock(); - void SetEditFull(bool bFull); - bool RetEditFull(); - bool RetFreePhoto(); - void SetFriendAim(bool bFriend); - bool RetFriendAim(); + void SetMovieLock(bool lock); + bool GetMovieLock(); + bool GetInfoLock(); + void SetSatComLock(bool lock); + bool GetSatComLock(); + void SetEditLock(bool lock, bool edit); + bool GetEditLock(); + void SetEditFull(bool full); + bool GetEditFull(); + bool GetFreePhoto(); + void SetFriendAim(bool friendAim); + bool GetFriendAim(); void SetTracePrecision(float factor); - float RetTracePrecision(); + float GetTracePrecision(); - void ChangePause(bool bPause); + void ChangePause(bool pause); void SetSpeed(float speed); - float RetSpeed(); + float GetSpeed(); void UpdateShortcuts(); void SelectHuman(); CObject* SearchHuman(); CObject* SearchToto(); CObject* SearchNearest(Math::Vector pos, CObject* pExclu); - bool SelectObject(CObject* pObj, bool bDisplayError=true); - CObject* RetSelectObject(); + bool SelectObject(CObject* pObj, bool displayError=true); + CObject* GetSelectObject(); CObject* DeselectAll(); bool DeleteObject(); void ResetObject(); void ResetCreate(); - Error CheckEndMission(bool bFrame); - void CheckEndMessage(char *message); - int RetObligatoryToken(); - char* RetObligatoryToken(int i); - int IsObligatoryToken(char *token); - bool IsProhibitedToken(char *token); + Error CheckEndMission(bool frame); + void CheckEndMessage(const char* message); + int GetObligatoryToken(); + char* GetObligatoryToken(int i); + int IsObligatoryToken(const char* token); + bool IsProhibitedToken(const char* token); void UpdateMap(); - bool RetShowMap(); + bool GetShowMap(); - MainMovieType RetMainMovie(); + MainMovieType GetMainMovie(); void FlushDisplayInfo(); - void StartDisplayInfo(int index, bool bMovie); + void StartDisplayInfo(int index, bool movie); void StartDisplayInfo(char *filename, int index); void StopDisplayInfo(); - char* RetDisplayInfoName(int index); - int RetDisplayInfoPosition(int index); + char* GetDisplayInfoName(int index); + int GetDisplayInfoPosition(int index); void SetDisplayInfoPosition(int index, int pos); void StartSuspend(); void StopSuspend(); - float RetGameTime(); + float GetGameTime(); void SetFontSize(float size); - float RetFontSize(); + float GetFontSize(); void SetWindowPos(Math::Point pos); - Math::Point RetWindowPos(); + Math::Point GetWindowPos(); void SetWindowDim(Math::Point dim); - Math::Point RetWindowDim(); + Math::Point GetWindowDim(); - void SetIOPublic(bool bMode); - bool RetIOPublic(); + void SetIOPublic(bool mode); + bool GetIOPublic(); void SetIOPos(Math::Point pos); - Math::Point RetIOPos(); + Math::Point GetIOPos(); void SetIODim(Math::Point dim); - Math::Point RetIODim(); - - char* RetTitle(); - char* RetResume(); - char* RetScriptName(); - char* RetScriptFile(); - bool RetTrainerPilot(); - bool RetFixScene(); - bool RetGlint(); - bool RetSoluce4(); - bool RetMovies(); - bool RetNiceReset(); - bool RetHimselfDamage(); - bool RetShowSoluce(); - bool RetSceneSoluce(); - bool RetShowAll(); - bool RetCheatRadar(); - char* RetSavegameDir(); - char* RetPublicDir(); - char* RetFilesDir(); + Math::Point GetIODim(); + + char* GetTitle(); + char* GetResume(); + char* GetScriptName(); + char* GetScriptFile(); + bool GetTrainerPilot(); + bool GetFixScene(); + bool GetGlint(); + bool GetSoluce4(); + bool GetMovies(); + bool GetNiceReset(); + bool GetHimselfDamage(); + bool GetShowSoluce(); + bool GetSceneSoluce(); + bool GetShowAll(); + bool GetCheatRadar(); + char* GetSavegameDir(); + char* GetPublicDir(); + char* GetFilesDir(); void SetGamerName(char *name); - char* RetGamerName(); - int RetGamerFace(); - int RetGamerGlasses(); - bool RetGamerOnlyHead(); - float RetPersoAngle(); + char* GetGamerName(); + int GetGamerFace(); + int GetGamerGlasses(); + bool GetGamerOnlyHead(); + float GetPersoAngle(); void StartMusic(); void ClearInterface(); @@ -256,18 +258,19 @@ public: float SearchNearestObject(Math::Vector center, CObject *exclu); bool FreeSpace(Math::Vector ¢er, float minRadius, float maxRadius, float space, CObject *exclu); - float RetFlatZoneRadius(Math::Vector center, float maxRadius, CObject *exclu); + float GetFlatZoneRadius(Math::Vector center, float maxRadius, CObject *exclu); void HideDropZone(CObject* metal); void ShowDropZone(CObject* metal, CObject* truck); void FlushShowLimit(int i); - void SetShowLimit(int i, ParticuleType parti, CObject *pObj, Math::Vector pos, float radius, float duration=SHOWLIMITTIME); + void SetShowLimit(int i, Gfx::ParticleType parti, CObject *pObj, Math::Vector pos, + float radius, float duration=SHOWLIMITTIME); void AdjustShowLimit(int i, Math::Vector pos); void StartShowLimit(); void FrameShowLimit(float rTime); - void CompileScript(bool bSoluce); - void LoadOneScript(CObject *pObj, int &nbError); - void LoadFileScript(CObject *pObj, char* filename, int objRank, int &nbError); + void CompileScript(bool soluce); + void LoadOneScript(CObject *pObj, int &nerror); + void LoadFileScript(CObject *pObj, char* filename, int objRank, int &nerror); void SaveAllScript(); void SaveOneScript(CObject *pObj); void SaveFileScript(CObject *pObj, char* filename, int objRank); @@ -276,7 +279,7 @@ public: bool FlushNewScriptName(); bool AddNewScriptName(ObjectType type, char *name); - char* RetNewScriptName(ObjectType type, int rank); + char* GetNewScriptName(ObjectType type, int rank); void WriteFreeParam(); void ReadFreeParam(); @@ -287,7 +290,7 @@ public: void IOWriteObject(FILE *file, CObject* pObj, char *cmd); CObject* IOReadObject(char *line, char* filename, int objRank); - int CreateSpot(Math::Vector pos, D3DCOLORVALUE color); + int CreateSpot(Math::Vector pos, Gfx::Color color); protected: bool EventFrame(const Event &event); @@ -295,12 +298,14 @@ protected: void InitEye(); void Convert(); - void CreateScene(bool bSoluce, bool bFixScene, bool bResetObject); + void CreateScene(bool soluce, bool fixScene, bool resetObject); void CreateModel(); - Math::Vector LookatPoint( Math::Vector eye, float angleH, float angleV, float length ); - CObject* CreateObject(Math::Vector pos, float angle, float zoom, float height, ObjectType type, float power=1.0f, bool bTrainer=false, bool bToy=false, int option=0); - int CreateLight(Math::Vector direction, D3DCOLORVALUE color); + Math::Vector LookatPoint(Math::Vector eye, float angleH, float angleV, float length); + CObject* CreateObject(Math::Vector pos, float angle, float zoom, + float height, ObjectType type, float power=1.0f, + bool trainer=false, bool toy=false, int option=0); + int CreateLight(Math::Vector direction, Gfx::Color color); void HiliteClear(); void HiliteObject(Math::Point pos); void HiliteFrame(float rTime); @@ -309,87 +314,87 @@ protected: CObject* DetectObject(Math::Point pos); void ChangeCamera(); void RemoteCamera(float pan, float zoom, float rTime); - void KeyCamera(EventMsg event, long param); + void KeyCamera(EventType event, long key); void AbortMovie(); bool IsSelectable(CObject* pObj); - void SelectOneObject(CObject* pObj, bool bDisplayError=true); + void SelectOneObject(CObject* pObj, bool displayError=true); void HelpObject(); bool DeselectObject(); void DeleteAllObjects(); void UpdateInfoText(); CObject* SearchObject(ObjectType type); - CObject* RetSelect(); - void StartDisplayVisit(EventMsg event); + CObject* GetSelect(); + void StartDisplayVisit(EventType event); void FrameVisit(float rTime); void StopDisplayVisit(); void ExecuteCmd(char *cmd); bool TestGadgetQuantity(int rank); protected: - CInstanceManager* m_iMan; - CMainMovie* m_movie; - CMainDialog* m_dialog; - CMainShort* m_short; - CMainMap* m_map; - CEvent* m_event; - CD3DEngine* m_engine; - CParticule* m_particule; - CWater* m_water; - CCloud* m_cloud; - CBlitz* m_blitz; - CPlanet* m_planet; - CLight* m_light; - CTerrain* m_terrain; - CModel* m_model; - CInterface* m_interface; - CCamera* m_camera; - CDisplayText* m_displayText; - CDisplayInfo* m_displayInfo; - CSound* m_sound; + CInstanceManager* m_iMan; + CApplication* m_app; + CEventQueue* m_eventQueue; + CMainMovie* m_movie; + Gfx::CEngine* m_engine; + Gfx::CParticle* m_particle; + Gfx::CWater* m_water; + Gfx::CCloud* m_cloud; + Gfx::CLightning* m_lightning; + Gfx::CPlanet* m_planet; + Gfx::CLightManager* m_lightMan; + Gfx::CTerrain* m_terrain; + Gfx::CCamera* m_camera; + Ui::CMainDialog* m_dialog; + Ui::CMainShort* m_short; + Ui::CMainMap* m_map; + Ui::CInterface* m_interface; + Ui::CDisplayText* m_displayText; + Ui::CDisplayInfo* m_displayInfo; + CSoundInterface* m_sound; float m_time; float m_gameTime; float m_checkEndTime; float m_winDelay; float m_lostDelay; - bool m_bFixScene; // scene fixed, no interraction - bool m_bBase; // OBJECT_BASE exists in mission - Math::Point m_lastMousePos; + bool m_fixScene; // scene fixed, no interraction + bool m_base; // OBJECT_BASE exists in mission + Math::Point m_lastMousePos; CObject* m_selectObject; Phase m_phase; int m_cameraRank; - D3DCOLORVALUE m_color; - bool m_bFreePhoto; - bool m_bCmdEdit; - bool m_bShowPos; - bool m_bSelectInsect; - bool m_bShowSoluce; - bool m_bShowAll; - bool m_bCheatRadar; - bool m_bAudioRepeat; - bool m_bShortCut; + Gfx::Color m_color; + bool m_freePhoto; + bool m_cmdEdit; + bool m_showPos; + bool m_selectInsect; + bool m_showSoluce; + bool m_showAll; + bool m_cheatRadar; + bool m_audioRepeat; + bool m_shortCut; int m_audioTrack; int m_delayWriteMessage; int m_movieInfoIndex; - bool m_bImmediatSatCom; // SatCom immediately? - bool m_bBeginSatCom; // messages SatCom poster? - bool m_bMovieLock; // movie in progress? - bool m_bSatComLock; // call of SatCom is possible? - bool m_bEditLock; // edition in progress? - bool m_bEditFull; // edition in full screen? - bool m_bPause; // simulation paused - bool m_bHilite; - bool m_bTrainerPilot; // remote trainer? - bool m_bSuspend; - bool m_bFriendAim; - bool m_bResetCreate; - bool m_bMapShow; - bool m_bMapImage; + bool m_immediatSatCom; // SatCom immediately? + bool m_beginSatCom; // messages SatCom poster? + bool m_movieLock; // movie in progress? + bool m_satComLock; // call of SatCom is possible? + bool m_editLock; // edition in progress? + bool m_editFull; // edition in full screen? + bool m_pause; // simulation paused + bool m_hilite; + bool m_trainerPilot; // remote trainer? + bool m_suspend; + bool m_friendAim; + bool m_resetCreate; + bool m_mapShow; + bool m_mapImage; char m_mapFilename[100]; - Math::Point m_tooltipPos; + Math::Point m_tooltipPos; char m_tooltipName[100]; float m_tooltipTime; @@ -405,28 +410,28 @@ protected: char m_scriptFile[100]; int m_endingWinRank; int m_endingLostRank; - bool m_bWinTerminate; + bool m_winTerminate; float m_fontSize; - Math::Point m_windowPos; - Math::Point m_windowDim; + Math::Point m_windowPos; + Math::Point m_windowDim; bool m_IOPublic; - Math::Point m_IOPos; - Math::Point m_IODim; + Math::Point m_IOPos; + Math::Point m_IODim; NewScriptName m_newScriptName[MAXNEWSCRIPTNAME]; float m_cameraPan; float m_cameraZoom; - EventMsg m_visitLast; + EventType m_visitLast; CObject* m_visitObject; CObject* m_visitArrow; float m_visitTime; - float m_visitParticule; - Math::Vector m_visitPos; - Math::Vector m_visitPosArrow; + float m_visitParticle; + Math::Vector m_visitPos; + Math::Vector m_visitPosArrow; int m_endTakeTotal; EndTake m_endTake[10]; @@ -446,14 +451,14 @@ protected: ShowLimit m_showLimit[MAXSHOWLIMIT]; - D3DCOLORVALUE m_colorRefBot; - D3DCOLORVALUE m_colorNewBot; - D3DCOLORVALUE m_colorRefAlien; - D3DCOLORVALUE m_colorNewAlien; - D3DCOLORVALUE m_colorRefGreen; - D3DCOLORVALUE m_colorNewGreen; - D3DCOLORVALUE m_colorRefWater; - D3DCOLORVALUE m_colorNewWater; + Gfx::Color m_colorRefBot; + Gfx::Color m_colorNewBot; + Gfx::Color m_colorRefAlien; + Gfx::Color m_colorNewAlien; + Gfx::Color m_colorRefGreen; + Gfx::Color m_colorNewGreen; + Gfx::Color m_colorRefWater; + Gfx::Color m_colorNewWater; float m_colorShiftWater; }; |