Colobot
robotmain.h
Go to the documentation of this file.
1 /*
2  * This file is part of the Colobot: Gold Edition source code
3  * Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
4  * http://epsiteс.ch; http://colobot.info; http://github.com/colobot
5  *
6  * This program is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14  * See the GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see http://gnu.org/licenses
18  */
19 
25 #pragma once
26 
27 
28 #include "common/global.h"
29 #include "common/singleton.h"
30 
32 
33 #include "object/object.h"
34 #include "object/mainmovie.h"
35 
36 #include "app/pausemanager.h"
37 
38 #include <stdio.h>
39 
40 enum Phase
41 {
42  PHASE_INIT,
43  PHASE_TERM,
44  PHASE_NAME,
45  PHASE_PERSO,
46  PHASE_TRAINER,
47  PHASE_DEFI,
48  PHASE_MISSION,
49  PHASE_FREE,
50  PHASE_USER,
51  PHASE_LOADING,
52  PHASE_SIMUL,
53  PHASE_MODEL,
54  PHASE_SETUPd,
55  PHASE_SETUPg,
56  PHASE_SETUPp,
57  PHASE_SETUPc,
58  PHASE_SETUPs,
59  PHASE_SETUPds,
60  PHASE_SETUPgs,
61  PHASE_SETUPps,
62  PHASE_SETUPcs,
63  PHASE_SETUPss,
64  PHASE_WRITE,
65  PHASE_READ,
66  PHASE_WRITEs,
67  PHASE_READs,
68  PHASE_WIN,
69  PHASE_LOST,
70  PHASE_WELCOME1,
71  PHASE_WELCOME2,
72  PHASE_WELCOME3,
73  PHASE_GENERIC,
74 };
75 
76 
77 class CController;
78 class CEventQueue;
79 class CSoundInterface;
80 class CLevelParserLine;
81 class CInput;
82 
83 namespace Gfx {
84 class CEngine;
85 class CLightManager;
86 class CWater;
87 class CCloud;
88 class CLightning;
89 class CPlanet;
90 class CTerrain;
91 }
92 
93 namespace Ui {
94 class CMainDialog;
95 class CMainShort;
96 class CMainMap;
97 class CInterface;
98 class CDisplayText;
99 class CDisplayInfo;
100 }
101 
102 
103 struct EndTake
104 {
105  Math::Vector pos;
106  float dist;
107  ObjectType type;
108  int min; // wins if >
109  int max; // wins if <
110  int lost; // lost if <=
111  float powermin; // wins if energy cell >=
112  float powermax; // wins if energy cell <=
113  ToolType tool;
114  DriveType drive;
115  bool immediat;
116  bool countTransported;
117  char message[100];
118 };
119 
121 {
122  Math::Vector pos;
123  float dist;
124  ObjectType type;
125  int min; // change if >
126  int max; // change if <
127  float powermin; // change if energy cell >=
128  float powermax; // change if energy cell <=
129  ToolType tool;
130  DriveType drive;
131  char music[100];
132  bool repeat;
133  bool changed;
134 };
135 
136 
137 const int MAXNEWSCRIPTNAME = 20;
138 
140 {
141  bool used;
142  ObjectType type;
143  char name[40];
144 };
145 
146 
147 const int MAXSHOWLIMIT = 5;
148 const int MAXSHOWPARTI = 200;
149 const float SHOWLIMITTIME = 20.0f;
150 
151 struct ShowLimit
152 {
153  bool used;
154  Math::Vector pos;
155  float radius;
156  int total;
157  int parti[MAXSHOWPARTI];
158  CObject* link;
159  float duration;
160  float time;
161 };
162 
163 
164 const int SATCOM_HUSTON = 0;
165 const int SATCOM_SAT = 1;
166 const int SATCOM_OBJECT = 2;
167 const int SATCOM_LOADING = 3;
168 const int SATCOM_PROG = 4;
169 const int SATCOM_SOLUCE = 5;
170 const int SATCOM_MAX = 6;
171 
172 class CRobotMain : public CSingleton<CRobotMain>
173 {
174 public:
175  CRobotMain(CController* controller);
176  virtual ~CRobotMain();
177 
178  void Create(bool loadProfile = true);
179 
180  Gfx::CCamera* GetCamera();
181  Gfx::CTerrain* GetTerrain();
182  Ui::CInterface* GetInterface();
183  Ui::CDisplayText* GetDisplayText();
184 
185  void CreateIni();
186  void LoadIni();
187 
188  void ResetAfterDeviceChanged();
189 
190  void ChangePhase(Phase phase);
191  bool ProcessEvent(Event &event);
192 
193  bool CreateShortcuts();
194  void ScenePerso();
195 
196  void SetMovieLock(bool lock);
197  bool GetMovieLock();
198  bool GetInfoLock();
199  void SetSatComLock(bool lock);
200  bool GetSatComLock();
201  void SetEditLock(bool lock, bool edit);
202  bool GetEditLock();
203  void SetEditFull(bool full);
204  bool GetEditFull();
205  bool GetFreePhoto();
206  void SetFriendAim(bool friendAim);
207  bool GetFriendAim();
208 
209  void SetTracePrecision(float factor);
210  float GetTracePrecision();
211 
212  void ChangePause(PauseType pause);
213 
214  void SetSpeed(float speed);
215  float GetSpeed();
216 
217  void UpdateShortcuts();
218  void SelectHuman();
219  CObject* SearchHuman();
220  CObject* SearchToto();
221  CObject* SearchNearest(Math::Vector pos, CObject* pExclu);
222  bool SelectObject(CObject* pObj, bool displayError=true);
224  CObject* DeselectAll();
225  bool DeleteObject();
226 
227  void ResetObject();
228  void ResetCreate();
229  void UpdateAudio(bool frame);
230  void SetEndMission(Error result, float delay);
231  Error CheckEndMission(bool frame);
232  void CheckEndMessage(const char* message);
233  int GetObligatoryToken();
234  char* GetObligatoryToken(int i);
235  int IsObligatoryToken(const char* token);
236  bool IsProhibitedToken(const char* token);
237  void UpdateMap();
238  bool GetShowMap();
239 
240  MainMovieType GetMainMovie();
241 
242  void FlushDisplayInfo();
243  void StartDisplayInfo(int index, bool movie);
244  void StartDisplayInfo(const char *filename, int index);
245  void StopDisplayInfo();
246  char* GetDisplayInfoName(int index);
247  int GetDisplayInfoPosition(int index);
248  void SetDisplayInfoPosition(int index, int pos);
249 
250  void StartSuspend();
251  void StopSuspend();
252 
253  float GetGameTime();
254 
255  void SetFontSize(float size);
256  float GetFontSize();
257  void SetWindowPos(Math::Point pos);
258  Math::Point GetWindowPos();
259  void SetWindowDim(Math::Point dim);
260  Math::Point GetWindowDim();
261 
262  void SetIOPublic(bool mode);
263  bool GetIOPublic();
264  void SetIOPos(Math::Point pos);
265  Math::Point GetIOPos();
266  void SetIODim(Math::Point dim);
267  Math::Point GetIODim();
268 
269  char* GetTitle();
270  char* GetResume();
271  char* GetScriptName();
272  char* GetScriptFile();
273  bool GetTrainerPilot();
274  bool GetFixScene();
275  bool GetGlint();
276  bool GetSoluce4();
277  bool GetMovies();
278  bool GetNiceReset();
279  bool GetHimselfDamage();
280  bool GetShowSoluce();
281  bool GetSceneSoluce();
282  bool GetShowAll();
283  bool GetRadar();
284  const char* GetSavegameDir();
285  const char* GetPublicDir();
286  const char* GetFilesDir();
287  bool GetRetroMode();
288 
289  void SetGamerName(const char *name);
290  char* GetGamerName();
291  int GetGamerFace();
292  int GetGamerGlasses();
293  bool GetGamerOnlyHead();
294  float GetPersoAngle();
295  char* GetSceneName();
296  int GetSceneRank();
297 
298  void StartMusic();
299  void StartPauseMusic(PauseType pause);
300  void ClearInterface();
301  void ChangeColor();
302 
303  float SearchNearestObject(Math::Vector center, CObject *exclu);
304  bool FreeSpace(Math::Vector &center, float minRadius, float maxRadius, float space, CObject *exclu);
305  float GetFlatZoneRadius(Math::Vector center, float maxRadius, CObject *exclu);
306  void HideDropZone(CObject* metal);
307  void ShowDropZone(CObject* metal, CObject* truck);
308  void FlushShowLimit(int i);
309  void SetShowLimit(int i, Gfx::ParticleType parti, CObject *pObj, Math::Vector pos,
310  float radius, float duration=SHOWLIMITTIME);
311  void AdjustShowLimit(int i, Math::Vector pos);
312  void StartShowLimit();
313  void FrameShowLimit(float rTime);
314 
315  void CompileScript(bool soluce);
316  void LoadOneScript(CObject *pObj, int &nerror);
317  void LoadFileScript(CObject *pObj, const char* filename, int objRank, int &nerror);
318  void SaveAllScript();
319  void SaveOneScript(CObject *pObj);
320  void SaveFileScript(CObject *pObj, const char* filename, int objRank);
321  bool SaveFileStack(CObject *pObj, FILE *file, int objRank);
322  bool ReadFileStack(CObject *pObj, FILE *file, int objRank);
323 
324  bool FlushNewScriptName();
325  bool AddNewScriptName(ObjectType type, char *name);
326  char* GetNewScriptName(ObjectType type, int rank);
327 
328  void WriteFreeParam();
329  void ReadFreeParam();
330 
331  bool IsBusy();
332  bool IOWriteScene(const char *filename, const char *filecbot, char *info);
333  CObject* IOReadScene(const char *filename, const char *filecbot);
334  void IOWriteObject(CLevelParserLine *line, CObject* obj);
335  CObject* IOReadObject(CLevelParserLine *line, const char* filename, int objRank);
336 
337  int CreateSpot(Math::Vector pos, Gfx::Color color);
338 
339  CObject* GetSelect();
340 
341  void DisplayError(Error err, CObject* pObj, float time=10.0f);
342  void DisplayError(Error err, Math::Vector goal, float height=15.0f, float dist=60.0f, float time=10.0f);
343 
344  std::string& GetUserLevelName(int id);
345 
346  void StartMissionTimer();
347 
348  void SetAutosave(bool enable);
349  bool GetAutosave();
350  void SetAutosaveInterval(int interval);
351  int GetAutosaveInterval();
352  void SetAutosaveSlots(int slots);
353  int GetAutosaveSlots();
354 
356  void SetExitAfterMission(bool exit);
357 
358 protected:
359  bool EventFrame(const Event &event);
360  bool EventObject(const Event &event);
361  void InitEye();
362 
363  void CreateScene(bool soluce, bool fixScene, bool resetObject);
364 
365  Math::Vector LookatPoint(Math::Vector eye, float angleH, float angleV, float length);
366  int CreateLight(Math::Vector direction, Gfx::Color color);
367  void HiliteClear();
368  void HiliteObject(Math::Point pos);
369  void HiliteFrame(float rTime);
370  void CreateTooltip(Math::Point pos, const std::string& text);
371  void ClearTooltip();
373  void ChangeCamera();
374  void RemoteCamera(float pan, float zoom, float rTime);
375  void KeyCamera(EventType event, InputSlot key);
376  void AbortMovie();
377  bool IsSelectable(CObject* pObj);
378  void SelectOneObject(CObject* pObj, bool displayError=true);
379  void HelpObject();
380  bool DeselectObject();
381  void DeleteAllObjects();
382  void UpdateInfoText();
383  CObject* SearchObject(ObjectType type);
384  void StartDisplayVisit(EventType event);
385  void FrameVisit(float rTime);
386  void StopDisplayVisit();
387  void ExecuteCmd(char *cmd);
388  bool TestGadgetQuantity(int rank);
389  void UpdateSpeedLabel();
390 
391  int AutosaveRotate(bool freeOne);
392  void Autosave();
393 
394 
395 protected:
396  CController* m_ctrl;
397  CApplication* m_app;
398  CEventQueue* m_eventQueue;
399  CMainMovie* m_movie;
400  Gfx::CEngine* m_engine;
401  Gfx::CParticle* m_particle;
402  Gfx::CWater* m_water;
403  Gfx::CCloud* m_cloud;
404  Gfx::CLightning* m_lightning;
405  Gfx::CPlanet* m_planet;
406  Gfx::CLightManager* m_lightMan;
407  Gfx::CTerrain* m_terrain;
408  Gfx::CCamera* m_camera;
409  Ui::CMainDialog* m_dialog;
410  Ui::CMainShort* m_short;
411  Ui::CMainMap* m_map;
412  Ui::CInterface* m_interface;
413  Ui::CDisplayText* m_displayText;
414  Ui::CDisplayInfo* m_displayInfo;
415  CSoundInterface* m_sound;
416  CPauseManager* m_pause;
417  CInput* m_input;
418 
419 
420  float m_time;
421  float m_gameTime;
422  float m_winDelay;
423  float m_lostDelay;
424  bool m_fixScene; // scene fixed, no interraction
425  CObject* m_base; // OBJECT_BASE exists in mission
426  Math::Point m_lastMousePos;
427  CObject* m_selectObject;
428 
429  Phase m_phase;
430  int m_cameraRank;
431  Gfx::Color m_color;
432  bool m_freePhoto;
433  bool m_cmdEdit;
434  bool m_selectInsect;
435  bool m_showSoluce;
436  bool m_showAll;
437  bool m_cheatRadar;
438  bool m_shortCut;
439  std::string m_audioTrack;
440  bool m_audioRepeat;
441  std::string m_satcomTrack;
442  bool m_satcomRepeat;
443  std::string m_editorTrack;
444  bool m_editorRepeat;
445  int m_delayWriteMessage;
446  int m_movieInfoIndex;
447 
448  CObject* m_controller;
449 
450  bool m_retroStyle; // Retro
451  bool m_immediatSatCom; // SatCom immediately?
452  bool m_beginSatCom; // messages SatCom poster?
453  bool m_lockedSatCom; // SatCom locked?
454  bool m_movieLock; // movie in progress?
455  bool m_satComLock; // call of SatCom is possible?
456  bool m_editLock; // edition in progress?
457  bool m_editFull; // edition in full screen?
458  bool m_hilite;
459  bool m_trainerPilot; // remote trainer?
460  bool m_suspend;
461  bool m_friendAim;
462  bool m_resetCreate;
463  bool m_mapShow;
464  bool m_mapImage;
465  char m_mapFilename[100];
466 
467  Math::Point m_tooltipPos;
468  std::string m_tooltipName;
469  float m_tooltipTime;
470 
471  char m_infoFilename[SATCOM_MAX][100]; // names of text files
472  CObject* m_infoObject;
473  int m_infoIndex;
474  int m_infoPos[SATCOM_MAX];
475  int m_infoUsed;
476 
477  char m_title[100];
478  char m_resume[500];
479  char m_scriptName[100];
480  char m_scriptFile[100];
481  int m_endingWinRank;
482  int m_endingLostRank;
483  bool m_winTerminate;
484 
485  bool m_exitAfterMission;
486 
487  float m_fontSize;
488  Math::Point m_windowPos;
489  Math::Point m_windowDim;
490 
491  bool m_IOPublic;
492  Math::Point m_IOPos;
493  Math::Point m_IODim;
494 
495  NewScriptName m_newScriptName[MAXNEWSCRIPTNAME];
496 
497  float m_cameraPan;
498  float m_cameraZoom;
499 
500  EventType m_visitLast;
501  CObject* m_visitObject;
502  CObject* m_visitArrow;
503  float m_visitTime;
504  float m_visitParticle;
505  Math::Vector m_visitPos;
506  Math::Vector m_visitPosArrow;
507 
508  int m_endTakeTotal;
509  EndTake m_endTake[10];
510  long m_endTakeResearch;
511  bool m_endTakeNever;
512  float m_endTakeWinDelay;
513  float m_endTakeLostDelay;
514 
515  int m_audioChangeTotal;
516  AudioChange m_audioChange[10];
517 
518  int m_obligatoryTotal;
519  char m_obligatoryToken[100][20];
520  int m_prohibitedTotal;
521  char m_prohibitedToken[100][20];
522 
523  std::string m_gamerName;
524 
525  int m_freeBuild; // constructible buildings
526  int m_freeResearch; // researches possible
527 
528  Error m_missionResult;
529 
530  ShowLimit m_showLimit[MAXSHOWLIMIT];
531 
532  Gfx::Color m_colorRefBot;
533  Gfx::Color m_colorNewBot;
534  Gfx::Color m_colorRefAlien;
535  Gfx::Color m_colorNewAlien;
536  Gfx::Color m_colorRefGreen;
537  Gfx::Color m_colorNewGreen;
538  Gfx::Color m_colorRefWater;
539  Gfx::Color m_colorNewWater;
540  float m_colorShiftWater;
541 
542  bool m_missionTimerEnabled;
543  bool m_missionTimerStarted;
544  float m_missionTimer;
545 
546  bool m_autosave;
547  int m_autosaveInterval;
548  int m_autosaveSlots;
549  float m_autosaveLast;
550 };
551 
void StartDisplayVisit(EventType event)
Start of the visit instead of an error.
Definition: robotmain.cpp:1634
void SetFriendAim(bool friendAim)
Indicates whether mouse is on an friend object, on which we should not shoot.
Definition: robotmain.cpp:6114
CSingleton base class for singletons.
void StartMusic()
Starts music with a mission.
Definition: robotmain.cpp:6138
Definition: maindialog.h:70
float SearchNearestObject(Math::Vector center, CObject *exclu)
Calculates the distance to the nearest object.
Definition: robotmain.cpp:4211
void StopSuspend()
End of dialogue during the game.
Definition: robotmain.cpp:1539
bool FreeSpace(Math::Vector &center, float minRadius, float maxRadius, float space, CObject *exclu)
Calculates a free space.
Definition: robotmain.cpp:4261
ParticleType
Definition: particle.h:60
void SetSpeed(float speed)
Changes game speed.
Definition: robotmain.cpp:5978
Definition: displaytext.h:54
bool GetShowMap()
Indicates whether the mini-map is visible.
Definition: robotmain.cpp:6027
void ReadFreeParam()
Reads the global parameters for free play.
Definition: robotmain.cpp:5290
void SetTracePrecision(float factor)
Management of the precision of drawing the ground.
Definition: robotmain.cpp:6126
MainMovieType GetMainMovie()
Returns the type of current movie.
Definition: robotmain.cpp:1403
void StopDisplayInfo()
End of displaying of instructions.
Definition: robotmain.cpp:1481
void SetIOPublic(bool mode)
Managing windows open/save.
Definition: robotmain.cpp:1596
Definition: robotmain.h:151
void CompileScript(bool soluce)
Compiles all scripts of robots.
Definition: robotmain.cpp:4561
void InitEye()
Initializes the view.
Definition: robotmain.cpp:2586
InputSlot
Available slots for input bindings NOTE: When adding new values, remember to also update keyTable in ...
Definition: key.h:76
Definition: robotmain.h:120
bool DeselectObject()
Deselects the selected object.
Definition: robotmain.cpp:1886
void RemoteCamera(float pan, float zoom, float rTime)
Panned with the camera if a button is pressed.
Definition: robotmain.cpp:2533
Definition: controller.h:32
void CreateIni()
Creates the file colobot.ini at the first time.
Definition: robotmain.cpp:388
void SelectOneObject(CObject *pObj, bool displayError=true)
Selects an object, without attending to deselect the rest.
Definition: robotmain.cpp:1813
void StartDisplayInfo(int index, bool movie)
Definition: robotmain.cpp:1423
void HiliteClear()
Removes setting evidence of the object with the mouse hovers over.
Definition: robotmain.cpp:2240
bool IsBusy()
Seeks if an object occupies in a spot, to prevent a backup of the game.
Definition: robotmain.cpp:4847
CRobotMain(CController *controller)
Constructor of robot application.
Definition: robotmain.cpp:126
int CreateSpot(Math::Vector pos, Gfx::Color color)
Creates a light spot.
Definition: robotmain.cpp:4028
bool IsSelectable(CObject *pObj)
Indicates whether an object is selectable.
Definition: robotmain.cpp:2149
Definition: robotmain.h:103
void KeyCamera(EventType event, InputSlot key)
Remote control the camera using the arrow keys.
Definition: robotmain.cpp:2475
void FrameVisit(float rTime)
Move the arrow to visit.
Definition: robotmain.cpp:1725
Definition: singleton.h:30
void ClearInterface()
Removes hilite and tooltip.
Definition: robotmain.cpp:6168
int GetGamerFace()
Returns the representation to use for the player.
Definition: robotmain.cpp:5929
void CreateTooltip(Math::Point pos, const std::string &text)
Creates a tooltip.
Definition: robotmain.cpp:2339
void StartPauseMusic(PauseType pause)
Starts pause music.
Definition: robotmain.cpp:6148
Some common, global definitions.
void CheckEndMessage(const char *message)
Checks if the mission is finished after displaying a message.
Definition: robotmain.cpp:5751
bool TestGadgetQuantity(int rank)
Updates the number of unnecessary objects.
Definition: robotmain.cpp:4178
bool CreateShortcuts()
Creates interface shortcuts to the units.
Definition: robotmain.cpp:6013
void SetEditLock(bool lock, bool edit)
Management of the lock mode for the edition.
Definition: robotmain.cpp:6071
char * GetGamerName()
Gets the player's name.
Definition: robotmain.cpp:5922
Definition: mainmovie.h:50
CObject * GetSelectObject()
Returns the object that default was select after the creation of a scene.
Definition: robotmain.cpp:1792
void SetWindowPos(Math::Point pos)
Managing the size of the default window.
Definition: robotmain.cpp:1570
Global event queue.
Definition: event.h:751
Manager for dynamic lights in 3D scene.
Definition: lightman.h:144
void ExecuteCmd(char *cmd)
Executes a command.
Definition: robotmain.cpp:1082
Definition: parserline.h:33
int GetObligatoryToken()
Returns the number of instructions required.
Definition: robotmain.cpp:5768
void ChangeCamera()
Change the mode of the camera.
Definition: robotmain.cpp:2408
Definition: robotmain.h:172
Cloud layer renderer.
Definition: cloud.h:78
Lightning effect renderer.
Definition: lightning.h:54
int CreateLight(Math::Vector direction, Gfx::Color color)
Creates a directional light.
Definition: robotmain.cpp:4007
void SetShowLimit(int i, Gfx::ParticleType parti, CObject *pObj, Math::Vector pos, float radius, float duration=SHOWLIMITTIME)
Specifies the boundaries to show.
Definition: robotmain.cpp:4454
void SetFontSize(float size)
Managing the size of the default fonts.
Definition: robotmain.cpp:1558
Particle engine.
Definition: particle.h:268
void AdjustShowLimit(int i, Math::Vector pos)
Adjusts the boundaries to show.
Definition: robotmain.cpp:4490
void UpdateMap()
Updates the map.
Definition: robotmain.cpp:6021
bool FlushNewScriptName()
Empty the list.
Definition: robotmain.cpp:4804
bool AddNewScriptName(ObjectType type, char *name)
Adds a script name.
Definition: robotmain.cpp:4813
char * GetNewScriptName(ObjectType type, int rank)
Seeks a script name for a given type.
Definition: robotmain.cpp:4829
float GetPersoAngle()
Returns the angle of presentation.
Definition: robotmain.cpp:5947
CObject * DeselectAll()
Deselects everything, and returns the object that was selected.
Definition: robotmain.cpp:1799
CObject * SearchNearest(Math::Vector pos, CObject *pExclu)
Returns the nearest selectable object from a given position.
Definition: robotmain.cpp:1962
virtual ~CRobotMain()
Destructor of robot application.
Definition: robotmain.cpp:319
float GetFlatZoneRadius(Math::Vector center, float maxRadius, CObject *exclu)
Calculates the maximum radius of a free space.
Definition: robotmain.cpp:4326
void LoadFileScript(CObject *pObj, const char *filename, int objRank, int &nerror)
Load all programs of the robot.
Definition: robotmain.cpp:4668
Planet manager.
Definition: planet.h:82
CMainMovie - control over movie sequences.
bool SaveFileStack(CObject *pObj, FILE *file, int objRank)
Saves the stack of the program in execution of a robot.
Definition: robotmain.cpp:4775
ObjectType
Type of game object.
Definition: object.h:51
void ScenePerso()
Load the scene for the character.
Definition: robotmain.cpp:2841
bool IOWriteScene(const char *filename, const char *filecbot, char *info)
Saves the current game.
Definition: robotmain.cpp:4933
Definition: mainshort.h:37
bool GetGamerOnlyHead()
Returns the mode with just the head.
Definition: robotmain.cpp:5941
bool DeleteObject()
Deletes the selected object.
Definition: robotmain.cpp:2222
CObject * SearchToto()
Returns the object toto.
Definition: robotmain.cpp:1956
void IOWriteObject(CLevelParserLine *line, CObject *obj)
Writes an object into the backup file.
Definition: robotmain.cpp:4865
void FlushShowLimit(int i)
Erases the boundaries shown.
Definition: robotmain.cpp:4433
2D point
Definition: point.h:49
bool IsProhibitedToken(const char *token)
Checks if an instruction is not part of the banned list.
Definition: robotmain.cpp:5791
void SelectHuman()
Selects the human.
Definition: robotmain.cpp:1944
Main application.
Definition: app.h:187
CObject * IOReadObject(CLevelParserLine *line, const char *filename, int objRank)
Resumes the game.
Definition: robotmain.cpp:5053
void SetGamerName(const char *name)
Change the player's name.
Definition: robotmain.cpp:5914
void UpdateInfoText()
Updates the text information.
Definition: robotmain.cpp:2570
void HiliteObject(Math::Point pos)
Highlights the object with the mouse hovers over.
Definition: robotmain.cpp:2263
int GetDisplayInfoPosition(int index)
Returns the name of the text display.
Definition: robotmain.cpp:1516
void StartSuspend()
Beginning of a dialogue during the game.
Definition: robotmain.cpp:1529
void ChangePhase(Phase phase)
Changes phase.
Definition: robotmain.cpp:412
Entry point into CRobotMain and CMainDialog.
Definition: controller.h:40
void SetSatComLock(bool lock)
Management of the blocking of the call of SatCom.
Definition: robotmain.cpp:6060
Camera moving in 3D scene.
Definition: camera.h:133
void ResetCreate()
Resets all objects to their original position.
Definition: robotmain.cpp:5415
void SetExitAfterMission(bool exit)
Enable mode where completing mission closes the game.
Definition: robotmain.cpp:6315
Management of pause modes.
Terrain loader/generator and manager.
Definition: terrain.h:222
Error CheckEndMission(bool frame)
Checks if the mission is over.
Definition: robotmain.cpp:5551
Namespace for (new) graphics code.
Definition: app.h:49
void FrameShowLimit(float rTime)
Advances the boundaries shown.
Definition: robotmain.cpp:4505
CObject - base class for all game objects.
The graphics engine.
Definition: engine.h:684
bool ProcessEvent(Event &event)
Processes an event.
Definition: robotmain.cpp:659
bool GetTrainerPilot()
Indicates whether it is possible to control a driving robot.
Definition: robotmain.cpp:5803
CObject * DetectObject(Math::Point pos)
Detects the object aimed by the mouse.
Definition: robotmain.cpp:2006
CObject * SearchHuman()
Returns the object human.
Definition: robotmain.cpp:1950
CObject * IOReadScene(const char *filename, const char *filecbot)
Resumes some part of the game.
Definition: robotmain.cpp:5135
void SaveFileScript(CObject *pObj, const char *filename, int objRank)
Definition: robotmain.cpp:4744
bool EventObject(const Event &event)
Makes the event for all robots.
Definition: robotmain.cpp:2809
void HiliteFrame(float rTime)
Highlights the object with the mouse hovers over.
Definition: robotmain.cpp:2322
Error
Type of error or info message.
Definition: global.h:32
void SetMovieLock(bool lock)
Management of the lock mode for movies.
Definition: robotmain.cpp:6034
void StartShowLimit()
Mount the boundaries of the selected object.
Definition: robotmain.cpp:4496
void ChangePause(PauseType pause)
Changes on the pause mode.
Definition: robotmain.cpp:5964
void AbortMovie()
Cancels the current movie.
Definition: robotmain.cpp:2553
void HelpObject()
Displays help for an object.
Definition: robotmain.cpp:2395
Water manager/renderer.
Definition: water.h:118
CObject * GetSelect()
Returns the selected object.
Definition: robotmain.cpp:1988
void CreateScene(bool soluce, bool fixScene, bool resetObject)
Creates the whole scene.
Definition: robotmain.cpp:2888
void HideDropZone(CObject *metal)
Hides buildable area when a cube of metal is taken up.
Definition: robotmain.cpp:4339
Particle rendering - CParticle class (aka particle)
3D (3x1) vector
Definition: vector.h:52
void ResetObject()
Resets all objects to their original position.
Definition: robotmain.cpp:5318
bool SelectObject(CObject *pObj, bool displayError=true)
Selects the object aimed by the mouse.
Definition: robotmain.cpp:1866
void SaveAllScript()
Saves all programs of all the robots.
Definition: robotmain.cpp:4696
Definition: displayinfo.h:48
Definition: mainmap.h:37
void UpdateAudio(bool frame)
Updates the audiotracks.
Definition: robotmain.cpp:5465
bool ReadFileStack(CObject *pObj, FILE *file, int objRank)
Resumes the execution stack of the program in a robot.
Definition: robotmain.cpp:4789
RGBA color.
Definition: color.h:38
void SaveOneScript(CObject *pObj)
Definition: robotmain.cpp:4708
void WriteFreeParam()
Writes the global parameters for free play.
Definition: robotmain.cpp:5269
void StopDisplayVisit()
End of the visit instead of an error.
Definition: robotmain.cpp:1755
EventType
Type of event message.
Definition: event.h:38
int IsObligatoryToken(const char *token)
Checks if an instruction is part of the obligatory list.
Definition: robotmain.cpp:5780
void ChangeColor()
Change the colors and textures.
Definition: robotmain.cpp:4053
Event sent by system, interface or game.
Definition: event.h:678
Definition: pausemanager.h:44
char * GetDisplayInfoName(int index)
Returns the name of the text display.
Definition: robotmain.cpp:1510
void SetDisplayInfoPosition(int index, int pos)
Returns the name of the text display.
Definition: robotmain.cpp:1522
Definition: interface.h:58
Definition: object.h:357
float GetGameTime()
Returns the absolute time of the game.
Definition: robotmain.cpp:1550
void DeleteAllObjects()
Quickly removes all objects.
Definition: robotmain.cpp:1909
bool EventFrame(const Event &event)
Advances the entire scene.
Definition: robotmain.cpp:2594
int GetGamerGlasses()
Returns the representation to use for the player.
Definition: robotmain.cpp:5935
Sound plugin interface.
Definition: sound.h:151
void ShowDropZone(CObject *metal, CObject *truck)
Shows the buildable area when a cube of metal is deposited.
Definition: robotmain.cpp:4355
void FlushDisplayInfo()
Clears the display of instructions.
Definition: robotmain.cpp:1410
void SetEditFull(bool full)
Management of the fullscreen mode during editing.
Definition: robotmain.cpp:6096
bool GetFixScene()
Indicates whether the scene is fixed, without interaction.
Definition: robotmain.cpp:5809
Definition: robotmain.h:139
Math::Vector LookatPoint(Math::Vector eye, float angleH, float angleV, float length)
Calculates the point of arrival of the camera.
Definition: robotmain.cpp:2830
Management of mouse, keyboard and joystick.
Definition: input.h:68
void ClearTooltip()
Clears the previous tooltip.
Definition: robotmain.cpp:2388
void UpdateShortcuts()
Updates all the shortcuts.
Definition: robotmain.cpp:1786
void LoadOneScript(CObject *pObj, int &nerror)
Load all programs of the robot.
Definition: robotmain.cpp:4634