Colobot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
robotmain.h
Go to the documentation of this file.
1 // * This file is part of the COLOBOT source code
2 // * Copyright (C) 2001-2008, Daniel ROUX & EPSITEC SA, www.epsitec.ch
3 // *
4 // * This program is free software: you can redistribute it and/or modify
5 // * it under the terms of the GNU General Public License as published by
6 // * the Free Software Foundation, either version 3 of the License, or
7 // * (at your option) any later version.
8 // *
9 // * This program is distributed in the hope that it will be useful,
10 // * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // * GNU General Public License for more details.
13 // *
14 // * You should have received a copy of the GNU General Public License
15 // * along with this program. If not, see http://www.gnu.org/licenses/.
16 
22 #pragma once
23 
24 
25 #include "common/global.h"
26 #include "common/singleton.h"
27 
29 
30 #include "object/object.h"
31 #include "object/mainmovie.h"
32 
33 #include <stdio.h>
34 
35 enum Phase
36 {
37  PHASE_INIT,
38  PHASE_TERM,
39  PHASE_NAME,
40  PHASE_PERSO,
41  PHASE_TRAINER,
42  PHASE_DEFI,
43  PHASE_MISSION,
44  PHASE_FREE,
45  PHASE_TEEN,
46  PHASE_USER,
47  PHASE_PROTO,
48  PHASE_LOADING,
49  PHASE_SIMUL,
50  PHASE_MODEL,
51  PHASE_SETUPd,
52  PHASE_SETUPg,
53  PHASE_SETUPp,
54  PHASE_SETUPc,
55  PHASE_SETUPs,
56  PHASE_SETUPds,
57  PHASE_SETUPgs,
58  PHASE_SETUPps,
59  PHASE_SETUPcs,
60  PHASE_SETUPss,
61  PHASE_WRITE,
62  PHASE_READ,
63  PHASE_WRITEs,
64  PHASE_READs,
65  PHASE_WIN,
66  PHASE_LOST,
67  PHASE_WELCOME1,
68  PHASE_WELCOME2,
69  PHASE_WELCOME3,
70  PHASE_GENERIC,
71 };
72 
73 
74 class CEventQueue;
75 class CSoundInterface;
76 
77 namespace Gfx {
78 class CEngine;
79 class CLightManager;
80 class CWater;
81 class CCloud;
82 class CLightning;
83 class CPlanet;
84 class CTerrain;
85 }
86 
87 namespace Ui {
88 class CMainDialog;
89 class CMainShort;
90 class CMainMap;
91 class CInterface;
92 class CDisplayText;
93 class CDisplayInfo;
94 }
95 
96 
97 struct EndTake
98 {
99  Math::Vector pos;
100  float dist;
101  ObjectType type;
102  int min; // wins if >
103  int max; // wins if <
104  int lost; // lost if <=
105  float powermin; // wins if energy cell >=
106  float powermax; // wins if energy cell <=
107  bool immediat;
108  char message[100];
109 };
110 
112 {
113  Math::Vector pos;
114  float dist;
115  ObjectType type;
116  int min; // change if >
117  int max; // change if <
118  float powermin; // change if energy cell >=
119  float powermax; // change if energy cell <=
120  char music[100];
121  bool repeat;
122  bool changed;
123 };
124 
125 
126 const int MAXNEWSCRIPTNAME = 20;
127 
129 {
130  bool used;
131  ObjectType type;
132  char name[40];
133 };
134 
135 
136 const int MAXSHOWLIMIT = 5;
137 const int MAXSHOWPARTI = 200;
138 const float SHOWLIMITTIME = 20.0f;
139 
140 struct ShowLimit
141 {
142  bool used;
143  Math::Vector pos;
144  float radius;
145  int total;
146  int parti[MAXSHOWPARTI];
147  CObject* link;
148  float duration;
149  float time;
150 };
151 
152 
153 const int SATCOM_HUSTON = 0;
154 const int SATCOM_SAT = 1;
155 const int SATCOM_OBJECT = 2;
156 const int SATCOM_LOADING = 3;
157 const int SATCOM_PROG = 4;
158 const int SATCOM_SOLUCE = 5;
159 const int SATCOM_MAX = 6;
160 
161 
167 {
170  unsigned int primary, secondary;
171 
172  InputBinding(unsigned int p = KEY_INVALID, unsigned int s = KEY_INVALID)
173  : primary(p), secondary(s) {}
174 };
175 
181 {
183  int axis;
185  bool invert;
186 };
187 
189 const int AXIS_INVALID = -1;
190 
191 class CRobotMain : public CSingleton<CRobotMain>
192 {
193 public:
194  CRobotMain(CApplication* app, bool loadProfile);
195  virtual ~CRobotMain();
196 
197  Gfx::CCamera* GetCamera();
198  Gfx::CTerrain* GetTerrain();
199  Ui::CInterface* GetInterface();
200  Ui::CDisplayText* GetDisplayText();
201 
203  void LoadSceneOnStart(const std::string& name, int rank);
204 
205  void CreateIni();
206 
209 
211 
212  void SetInputBinding(InputSlot slot, InputBinding binding);
213  const InputBinding& GetInputBinding(InputSlot slot);
215 
217 
218  void SetJoyAxisBinding(JoyAxisSlot slot, JoyAxisBinding binding);
219  const JoyAxisBinding& GetJoyAxisBinding(JoyAxisSlot slot);
221 
223 
224  void SetJoystickDeadzone(float zone);
225  float GetJoystickDeadzone();
227 
229  void ResetKeyStates();
230 
231  void ChangePhase(Phase phase);
232  bool ProcessEvent(Event &event);
233 
234  bool CreateShortcuts();
235  void ScenePerso();
236 
237  void SetMovieLock(bool lock);
238  bool GetMovieLock();
239  bool GetInfoLock();
240  void SetSatComLock(bool lock);
241  bool GetSatComLock();
242  void SetEditLock(bool lock, bool edit);
243  bool GetEditLock();
244  void SetEditFull(bool full);
245  bool GetEditFull();
246  bool GetFreePhoto();
247  void SetFriendAim(bool friendAim);
248  bool GetFriendAim();
249 
250  void SetTracePrecision(float factor);
251  float GetTracePrecision();
252 
253  void ChangePause(bool pause);
254 
255  void SetSpeed(float speed);
256  float GetSpeed();
257 
258  void UpdateShortcuts();
259  void SelectHuman();
260  CObject* SearchHuman();
261  CObject* SearchToto();
262  CObject* SearchNearest(Math::Vector pos, CObject* pExclu);
263  bool SelectObject(CObject* pObj, bool displayError=true);
265  CObject* DeselectAll();
266  bool DeleteObject();
267 
268  void ResetObject();
269  void ResetCreate();
270  void UpdateAudio(bool frame);
271  void SetEndMission(Error result, float delay);
272  Error CheckEndMission(bool frame);
273  void CheckEndMessage(const char* message);
274  int GetObligatoryToken();
275  char* GetObligatoryToken(int i);
276  int IsObligatoryToken(const char* token);
277  bool IsProhibitedToken(const char* token);
278  void UpdateMap();
279  bool GetShowMap();
280 
281  MainMovieType GetMainMovie();
282 
283  void FlushDisplayInfo();
284  void StartDisplayInfo(int index, bool movie);
285  void StartDisplayInfo(const char *filename, int index);
286  void StopDisplayInfo();
287  char* GetDisplayInfoName(int index);
288  int GetDisplayInfoPosition(int index);
289  void SetDisplayInfoPosition(int index, int pos);
290 
291  void StartSuspend();
292  void StopSuspend();
293 
294  float GetGameTime();
295 
296  void SetFontSize(float size);
297  float GetFontSize();
298  void SetWindowPos(Math::Point pos);
299  Math::Point GetWindowPos();
300  void SetWindowDim(Math::Point dim);
301  Math::Point GetWindowDim();
302 
303  void SetIOPublic(bool mode);
304  bool GetIOPublic();
305  void SetIOPos(Math::Point pos);
306  Math::Point GetIOPos();
307  void SetIODim(Math::Point dim);
308  Math::Point GetIODim();
309 
310  char* GetTitle();
311  char* GetResume();
312  char* GetScriptName();
313  char* GetScriptFile();
314  bool GetTrainerPilot();
315  bool GetFixScene();
316  bool GetGlint();
317  bool GetSoluce4();
318  bool GetMovies();
319  bool GetNiceReset();
320  bool GetHimselfDamage();
321  bool GetShowSoluce();
322  bool GetSceneSoluce();
323  bool GetShowAll();
324  bool GetRadar();
325  const char* GetSavegameDir();
326  const char* GetPublicDir();
327  const char* GetFilesDir();
328  bool GetRetroMode();
329 
330  void SetGamerName(const char *name);
331  char* GetGamerName();
332  int GetGamerFace();
333  int GetGamerGlasses();
334  bool GetGamerOnlyHead();
335  float GetPersoAngle();
336 
337  void StartMusic();
338  void ClearInterface();
339  void ChangeColor();
340 
341  float SearchNearestObject(Math::Vector center, CObject *exclu);
342  bool FreeSpace(Math::Vector &center, float minRadius, float maxRadius, float space, CObject *exclu);
343  float GetFlatZoneRadius(Math::Vector center, float maxRadius, CObject *exclu);
344  void HideDropZone(CObject* metal);
345  void ShowDropZone(CObject* metal, CObject* truck);
346  void FlushShowLimit(int i);
347  void SetShowLimit(int i, Gfx::ParticleType parti, CObject *pObj, Math::Vector pos,
348  float radius, float duration=SHOWLIMITTIME);
349  void AdjustShowLimit(int i, Math::Vector pos);
350  void StartShowLimit();
351  void FrameShowLimit(float rTime);
352 
353  void CompileScript(bool soluce);
354  void LoadOneScript(CObject *pObj, int &nerror);
355  void LoadFileScript(CObject *pObj, const char* filename, int objRank, int &nerror);
356  void SaveAllScript();
357  void SaveOneScript(CObject *pObj);
358  void SaveFileScript(CObject *pObj, const char* filename, int objRank);
359  bool SaveFileStack(CObject *pObj, FILE *file, int objRank);
360  bool ReadFileStack(CObject *pObj, FILE *file, int objRank);
361 
362  bool FlushNewScriptName();
363  bool AddNewScriptName(ObjectType type, char *name);
364  char* GetNewScriptName(ObjectType type, int rank);
365 
366  void WriteFreeParam();
367  void ReadFreeParam();
368 
369  bool IsBusy();
370  bool IOWriteScene(const char *filename, const char *filecbot, char *info);
371  CObject* IOReadScene(const char *filename, const char *filecbot);
372  void IOWriteObject(FILE *file, CObject* pObj, const char *cmd);
373  CObject* IOReadObject(char *line, const char* filename, int objRank);
374 
375  int CreateSpot(Math::Vector pos, Gfx::Color color);
376 
377  void SetNumericLocale();
378  void RestoreNumericLocale();
379 
380  CObject* GetSelect();
381 
382  void DisplayError(Error err, CObject* pObj, float time=10.0f);
383  void DisplayError(Error err, Math::Vector goal, float height=15.0f, float dist=60.0f, float time=10.0f);
384 
385 protected:
386  bool EventFrame(const Event &event);
387  bool EventObject(const Event &event);
388  void InitEye();
389 
390  void Convert();
391  void CreateScene(bool soluce, bool fixScene, bool resetObject);
392 
393  Math::Vector LookatPoint(Math::Vector eye, float angleH, float angleV, float length);
394  CObject* CreateObject(Math::Vector pos, float angle, float zoom,
395  float height, ObjectType type, float power=1.0f,
396  bool trainer=false, bool toy=false, int option=0);
397  int CreateLight(Math::Vector direction, Gfx::Color color);
398  void HiliteClear();
399  void HiliteObject(Math::Point pos);
400  void HiliteFrame(float rTime);
401  void CreateTooltip(Math::Point pos, const char* text);
402  void ClearTooltip();
404  void ChangeCamera();
405  void RemoteCamera(float pan, float zoom, float rTime);
406  void KeyCamera(EventType event, unsigned int key);
407  void AbortMovie();
408  bool IsSelectable(CObject* pObj);
409  void SelectOneObject(CObject* pObj, bool displayError=true);
410  void HelpObject();
411  bool DeselectObject();
412  void DeleteAllObjects();
413  void UpdateInfoText();
414  CObject* SearchObject(ObjectType type);
415  void StartDisplayVisit(EventType event);
416  void FrameVisit(float rTime);
417  void StopDisplayVisit();
418  void ExecuteCmd(char *cmd);
419  bool TestGadgetQuantity(int rank);
420  void UpdateSpeedLabel();
421 
422 
423 protected:
424  CApplication* m_app;
425  CEventQueue* m_eventQueue;
426  CMainMovie* m_movie;
427  Gfx::CEngine* m_engine;
428  Gfx::CParticle* m_particle;
429  Gfx::CWater* m_water;
430  Gfx::CCloud* m_cloud;
431  Gfx::CLightning* m_lightning;
432  Gfx::CPlanet* m_planet;
433  Gfx::CLightManager* m_lightMan;
434  Gfx::CTerrain* m_terrain;
435  Gfx::CCamera* m_camera;
436  Ui::CMainDialog* m_dialog;
437  Ui::CMainShort* m_short;
438  Ui::CMainMap* m_map;
439  Ui::CInterface* m_interface;
440  Ui::CDisplayText* m_displayText;
441  Ui::CDisplayInfo* m_displayInfo;
442  CSoundInterface* m_sound;
443 
445  InputBinding m_inputBindings[INPUT_SLOT_MAX];
446  JoyAxisBinding m_joyAxisBindings[JOY_AXIS_SLOT_MAX];
447  float m_joystickDeadzone;
452 
453 
454  float m_time;
455  float m_gameTime;
456  float m_checkEndTime;
457  float m_winDelay;
458  float m_lostDelay;
459  bool m_fixScene; // scene fixed, no interraction
460  bool m_base; // OBJECT_BASE exists in mission
461  Math::Point m_lastMousePos;
462  CObject* m_selectObject;
463 
464  Phase m_phase;
465  int m_cameraRank;
466  Gfx::Color m_color;
467  bool m_freePhoto;
468  bool m_cmdEdit;
469  bool m_showPos;
470  bool m_selectInsect;
471  bool m_showSoluce;
472  bool m_showAll;
473  bool m_cheatRadar;
474  bool m_audioRepeat;
475  bool m_shortCut;
476  std::string m_audioTrack;
477  int m_delayWriteMessage;
478  int m_movieInfoIndex;
479 
480  CObject* m_controller;
481 
482  //Level Checker flags
483  bool m_beginObject;
484  bool m_terrainGenerate;
485  bool m_terrainInitTextures;
486  bool m_terrainInit;
487  bool m_terrainCreate;
488 
489  int m_version; // Mission file version
490  bool m_retroStyle; // Retro
491  bool m_immediatSatCom; // SatCom immediately?
492  bool m_beginSatCom; // messages SatCom poster?
493  bool m_lockedSatCom; // SatCom locked?
494  bool m_movieLock; // movie in progress?
495  bool m_satComLock; // call of SatCom is possible?
496  bool m_editLock; // edition in progress?
497  bool m_editFull; // edition in full screen?
498  bool m_pause; // simulation paused
499  bool m_hilite;
500  bool m_trainerPilot; // remote trainer?
501  bool m_suspend;
502  bool m_friendAim;
503  bool m_resetCreate;
504  bool m_mapShow;
505  bool m_mapImage;
506  char m_mapFilename[100];
507 
508  Math::Point m_tooltipPos;
509  char m_tooltipName[100];
510  float m_tooltipTime;
511 
512  char m_infoFilename[SATCOM_MAX][100]; // names of text files
513  CObject* m_infoObject;
514  int m_infoIndex;
515  int m_infoPos[SATCOM_MAX];
516  int m_infoUsed;
517 
518  char m_title[100];
519  char m_resume[500];
520  char m_scriptName[100];
521  char m_scriptFile[100];
522  int m_endingWinRank;
523  int m_endingLostRank;
524  bool m_winTerminate;
525 
526  float m_fontSize;
527  Math::Point m_windowPos;
528  Math::Point m_windowDim;
529 
530  bool m_IOPublic;
531  Math::Point m_IOPos;
532  Math::Point m_IODim;
533 
534  NewScriptName m_newScriptName[MAXNEWSCRIPTNAME];
535 
536  float m_cameraPan;
537  float m_cameraZoom;
538 
539  EventType m_visitLast;
540  CObject* m_visitObject;
541  CObject* m_visitArrow;
542  float m_visitTime;
543  float m_visitParticle;
544  Math::Vector m_visitPos;
545  Math::Vector m_visitPosArrow;
546 
547  int m_endTakeTotal;
548  EndTake m_endTake[10];
549  long m_endTakeResearch;
550  bool m_endTakeNever;
551  float m_endTakeWinDelay;
552  float m_endTakeLostDelay;
553 
554  int m_audioChangeTotal;
555  AudioChange m_audioChange[10];
556 
557  int m_obligatoryTotal;
558  char m_obligatoryToken[100][20];
559  int m_prohibitedTotal;
560  char m_prohibitedToken[100][20];
561 
562  std::string m_gamerName;
563 
564  int m_freeBuild; // constructible buildings
565  int m_freeResearch; // researches possible
566 
567  Error m_missionResult;
568 
569  ShowLimit m_showLimit[MAXSHOWLIMIT];
570 
571  Gfx::Color m_colorRefBot;
572  Gfx::Color m_colorNewBot;
573  Gfx::Color m_colorRefAlien;
574  Gfx::Color m_colorNewAlien;
575  Gfx::Color m_colorRefGreen;
576  Gfx::Color m_colorNewGreen;
577  Gfx::Color m_colorRefWater;
578  Gfx::Color m_colorNewWater;
579  float m_colorShiftWater;
580 
581  std::string m_oldLocale;
582 };
583 
void StartDisplayVisit(EventType event)
Start of the visit instead of an error.
Definition: robotmain.cpp:2376
void SetFriendAim(bool friendAim)
Indicates whether mouse is on an friend object, on which we should not shoot.
Definition: robotmain.cpp:7469
CSingleton base class for singletons.
void StartMusic()
Starts music with a mission.
Definition: robotmain.cpp:7493
Definition: maindialog.h:70
float SearchNearestObject(Math::Vector center, CObject *exclu)
Calculates the distance to the nearest object.
Definition: robotmain.cpp:5617
void StopSuspend()
End of dialogue during the game.
Definition: robotmain.cpp:2277
bool FreeSpace(Math::Vector &center, float minRadius, float maxRadius, float space, CObject *exclu)
Calculates a free space.
Definition: robotmain.cpp:5670
ParticleType
Definition: particle.h:58
void SetSpeed(float speed)
Changes game speed.
Definition: robotmain.cpp:7333
Math::Vector m_joyMotion
Motion vector set by joystick axes.
Definition: robotmain.h:451
Definition: displaytext.h:52
bool GetShowMap()
Indicates whether the mini-map is visible.
Definition: robotmain.cpp:7382
void ReadFreeParam()
Reads the global parameters for free play.
Definition: robotmain.cpp:6722
JoyAxisSlot
Slots for joystick axes inputs.
Definition: global.h:285
void SetInputBinding(InputSlot slot, InputBinding binding)
Management of input bindings.
Definition: robotmain.cpp:1020
void SetTracePrecision(float factor)
Management of the precision of drawing the ground.
Definition: robotmain.cpp:7481
MainMovieType GetMainMovie()
Returns the type of current movie.
Definition: robotmain.cpp:2127
void StopDisplayInfo()
End of displaying of instructions.
Definition: robotmain.cpp:2211
void CreateTooltip(Math::Point pos, const char *text)
Creates a tooltip.
Definition: robotmain.cpp:3128
void SetIOPublic(bool mode)
Managing windows open/save.
Definition: robotmain.cpp:2338
Definition: robotmain.h:140
void CompileScript(bool soluce)
Compiles all scripts of robots.
Definition: robotmain.cpp:5990
void InitEye()
Initializes the view.
Definition: robotmain.cpp:3392
Definition: robotmain.h:111
bool DeselectObject()
Deselects the selected object.
Definition: robotmain.cpp:2630
void RemoteCamera(float pan, float zoom, float rTime)
Panned with the camera if a button is pressed.
Definition: robotmain.cpp:3335
void CreateIni()
Creates the file colobot.ini at the first time.
Definition: robotmain.cpp:955
void SelectOneObject(CObject *pObj, bool displayError=true)
Selects an object, without attending to deselect the rest.
Definition: robotmain.cpp:2557
const unsigned int KEY_INVALID
Special value for invalid key bindings.
Definition: key.h:63
void KeyCamera(EventType event, unsigned int key)
Remote control the camera using the arrow keys.
Definition: robotmain.cpp:3267
void StartDisplayInfo(int index, bool movie)
Definition: robotmain.cpp:2147
void ChangePause(bool pause)
Changes on the pause mode.
Definition: robotmain.cpp:7321
void HiliteClear()
Removes setting evidence of the object with the mouse hovers over.
Definition: robotmain.cpp:3025
bool IsBusy()
Seeks if an object occupies in a spot, to prevent a backup of the game.
Definition: robotmain.cpp:6260
int CreateSpot(Math::Vector pos, Gfx::Color color)
Creates a light spot.
Definition: robotmain.cpp:5434
bool IsSelectable(CObject *pObj)
Indicates whether an object is selectable.
Definition: robotmain.cpp:2934
Definition: robotmain.h:97
void FrameVisit(float rTime)
Move the arrow to visit.
Definition: robotmain.cpp:2467
Definition: singleton.h:27
void ClearInterface()
Removes hilite and tooltip.
Definition: robotmain.cpp:7504
int GetGamerFace()
Returns the representation to use for the player.
Definition: robotmain.cpp:7296
int axis
Axis index or AXIS_INVALID.
Definition: robotmain.h:183
Some common, global definitions.
void CheckEndMessage(const char *message)
Checks if the mission is finished after displaying a message.
Definition: robotmain.cpp:7115
bool TestGadgetQuantity(int rank)
Updates the number of unnecessary objects.
Definition: robotmain.cpp:5584
bool CreateShortcuts()
Creates interface shortcuts to the units.
Definition: robotmain.cpp:7368
void SetJoyAxisBinding(JoyAxisSlot slot, JoyAxisBinding binding)
Management of joystick axis bindings.
Definition: robotmain.cpp:1032
void SetEditLock(bool lock, bool edit)
Management of the lock mode for the edition.
Definition: robotmain.cpp:7426
Math::Vector m_keyMotion
Motion vector set by keyboard or joystick buttons.
Definition: robotmain.h:449
char * GetGamerName()
Gets the player&#39;s name.
Definition: robotmain.cpp:7289
Definition: mainmovie.h:47
void IOWriteObject(FILE *file, CObject *pObj, const char *cmd)
Writes an object into the backup file.
Definition: robotmain.cpp:6281
CObject * GetSelectObject()
Returns the object that default was select after the creation of a scene.
Definition: robotmain.cpp:2534
void SetWindowPos(Math::Point pos)
Managing the size of the default window.
Definition: robotmain.cpp:2312
Global event queue.
Definition: event.h:765
Manager for dynamic lights in 3D scene.
Definition: lightman.h:142
void ExecuteCmd(char *cmd)
Executes a command.
Definition: robotmain.cpp:1797
int GetObligatoryToken()
Returns the number of instructions required.
Definition: robotmain.cpp:7132
InputSlot
Available slots for input bindings.
Definition: global.h:251
void Convert()
Conversion of units.
Definition: robotmain.cpp:3650
void ChangeCamera()
Change the mode of the camera.
Definition: robotmain.cpp:3197
InputBinding m_inputBindings[INPUT_SLOT_MAX]
Bindings for user inputs.
Definition: robotmain.h:445
Definition: robotmain.h:191
CRobotMain(CApplication *app, bool loadProfile)
Constructor of robot application.
Definition: robotmain.cpp:607
Cloud layer renderer.
Definition: cloud.h:76
Lightning effect renderer.
Definition: lightning.h:52
int CreateLight(Math::Vector direction, Gfx::Color color)
Creates a directional light.
Definition: robotmain.cpp:5413
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:5866
void SetFontSize(float size)
Managing the size of the default fonts.
Definition: robotmain.cpp:2300
Particle engine.
Definition: particle.h:266
void AdjustShowLimit(int i, Math::Vector pos)
Adjusts the boundaries to show.
Definition: robotmain.cpp:5902
void UpdateMap()
Updates the map.
Definition: robotmain.cpp:7376
bool FlushNewScriptName()
Empty the list.
Definition: robotmain.cpp:6217
bool AddNewScriptName(ObjectType type, char *name)
Adds a script name.
Definition: robotmain.cpp:6226
char * GetNewScriptName(ObjectType type, int rank)
Seeks a script name for a given type.
Definition: robotmain.cpp:6242
float GetPersoAngle()
Returns the angle of presentation.
Definition: robotmain.cpp:7314
CObject * DeselectAll()
Deselects everything, and returns the object that was selected.
Definition: robotmain.cpp:2541
CObject * SearchNearest(Math::Vector pos, CObject *pExclu)
Returns the nearest selectable object from a given position.
Definition: robotmain.cpp:2727
virtual ~CRobotMain()
Destructor of robot application.
Definition: robotmain.cpp:893
float GetFlatZoneRadius(Math::Vector center, float maxRadius, CObject *exclu)
Calculates the maximum radius of a free space.
Definition: robotmain.cpp:5735
void LoadFileScript(CObject *pObj, const char *filename, int objRank, int &nerror)
Load all programs of the robot.
Definition: robotmain.cpp:6095
Planet manager.
Definition: planet.h:80
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:6188
ObjectType
Type of game object.
Definition: object.h:46
void SetDefaultInputBindings()
Sets the default input bindings (key and axes)
Definition: robotmain.cpp:973
bool invert
True to invert axis value.
Definition: robotmain.h:185
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)
Creates an object of decoration mobile or stationary.
Definition: robotmain.cpp:5080
void ScenePerso()
Load the scene for the character.
Definition: robotmain.cpp:3843
bool IOWriteScene(const char *filename, const char *filecbot, char *info)
Saves the current game.
Definition: robotmain.cpp:6378
Definition: mainshort.h:35
bool GetGamerOnlyHead()
Returns the mode with just the head.
Definition: robotmain.cpp:7308
bool DeleteObject()
Deletes the selected object.
Definition: robotmain.cpp:3007
CObject * SearchToto()
Returns the object toto.
Definition: robotmain.cpp:2711
void FlushShowLimit(int i)
Erases the boundaries shown.
Definition: robotmain.cpp:5845
2D point
Definition: point.h:46
Binding for joystick axis.
Definition: robotmain.h:180
void ResetKeyStates()
Resets tracked key states (motion vectors)
Definition: robotmain.cpp:1054
bool IsProhibitedToken(const char *token)
Checks if an instruction is not part of the banned list.
Definition: robotmain.cpp:7155
void SelectHuman()
Selects the human.
Definition: robotmain.cpp:2689
Main application.
Definition: app.h:200
void SetGamerName(const char *name)
Change the player&#39;s name.
Definition: robotmain.cpp:7281
void UpdateInfoText()
Updates the text information.
Definition: robotmain.cpp:3375
void HiliteObject(Math::Point pos)
Highlights the object with the mouse hovers over.
Definition: robotmain.cpp:3051
int GetDisplayInfoPosition(int index)
Returns the name of the text display.
Definition: robotmain.cpp:2250
void StartSuspend()
Beginning of a dialogue during the game.
Definition: robotmain.cpp:2263
void ChangePhase(Phase phase)
Changes phase.
Definition: robotmain.cpp:1061
void SetSatComLock(bool lock)
Management of the blocking of the call of SatCom.
Definition: robotmain.cpp:7415
Camera moving in 3D scene.
Definition: camera.h:130
void ResetCreate()
Resets all objects to their original position.
Definition: robotmain.cpp:6840
Terrain loader/generator and manager.
Definition: terrain.h:220
Error CheckEndMission(bool frame)
Checks if the mission is over.
Definition: robotmain.cpp:6960
void SetJoystickDeadzone(float zone)
Management of joystick deadzone.
Definition: robotmain.cpp:1044
void FrameShowLimit(float rTime)
Advances the boundaries shown.
Definition: robotmain.cpp:5917
CObject - base class for all game objects.
The graphics engine.
Definition: engine.h:681
bool ProcessEvent(Event &event)
Processes an event.
Definition: robotmain.cpp:1310
bool GetTrainerPilot()
Indicates whether it is possible to control a driving robot.
Definition: robotmain.cpp:7167
CObject * DetectObject(Math::Point pos)
Detects the object aimed by the mouse.
Definition: robotmain.cpp:2784
CObject * SearchHuman()
Returns the object human.
Definition: robotmain.cpp:2695
CObject * IOReadScene(const char *filename, const char *filecbot)
Resumes some part of the game.
Definition: robotmain.cpp:6566
void SaveFileScript(CObject *pObj, const char *filename, int objRank)
Definition: robotmain.cpp:6165
bool EventObject(const Event &event)
Makes the event for all robots.
Definition: robotmain.cpp:3604
void HiliteFrame(float rTime)
Highlights the object with the mouse hovers over.
Definition: robotmain.cpp:3110
Error
Type of error or info message.
Definition: global.h:29
void SetMovieLock(bool lock)
Management of the lock mode for movies.
Definition: robotmain.cpp:7389
void StartShowLimit()
Mount the boundaries of the selected object.
Definition: robotmain.cpp:5908
void AbortMovie()
Cancels the current movie.
Definition: robotmain.cpp:3355
void HelpObject()
Displays help for an object.
Definition: robotmain.cpp:3184
Water manager/renderer.
Definition: water.h:116
CObject * GetSelect()
Returns the selected object.
Definition: robotmain.cpp:2755
void CreateScene(bool soluce, bool fixScene, bool resetObject)
Creates the whole scene.
Definition: robotmain.cpp:3878
void HideDropZone(CObject *metal)
Hides buildable area when a cube of metal is taken up.
Definition: robotmain.cpp:5748
Particle rendering - CParticle class (aka particle)
3D (3x1) vector
Definition: vector.h:49
void ResetObject()
Resets all objects to their original position.
Definition: robotmain.cpp:6743
bool SelectObject(CObject *pObj, bool displayError=true)
Selects the object aimed by the mouse.
Definition: robotmain.cpp:2610
void SaveAllScript()
Saves all programs of all the robots.
Definition: robotmain.cpp:6123
Definition: displayinfo.h:44
Definition: mainmap.h:35
void UpdateAudio(bool frame)
Updates the audiotracks.
Definition: robotmain.cpp:6882
bool ReadFileStack(CObject *pObj, FILE *file, int objRank)
Resumes the execution stack of the program in a robot.
Definition: robotmain.cpp:6202
unsigned int primary
Definition: robotmain.h:170
Binding for input slot.
Definition: robotmain.h:166
void LoadSceneOnStart(const std::string &name, int rank)
Caused the given mission to be loaded immediately after start.
Definition: robotmain.cpp:945
RGBA color.
Definition: color.h:35
CObject * IOReadObject(char *line, const char *filename, int objRank)
Resumes the game.
Definition: robotmain.cpp:6482
void SaveOneScript(CObject *pObj)
Definition: robotmain.cpp:6138
void WriteFreeParam()
Writes the global parameters for free play.
Definition: robotmain.cpp:6703
void StopDisplayVisit()
End of the visit instead of an error.
Definition: robotmain.cpp:2497
EventType
Type of event message.
Definition: event.h:35
int IsObligatoryToken(const char *token)
Checks if an instruction is part of the obligatory list.
Definition: robotmain.cpp:7144
void ChangeColor()
Change the colors and textures.
Definition: robotmain.cpp:5459
Event sent by system, interface or game.
Definition: event.h:687
char * GetDisplayInfoName(int index)
Returns the name of the text display.
Definition: robotmain.cpp:2244
void SetDisplayInfoPosition(int index, int pos)
Returns the name of the text display.
Definition: robotmain.cpp:2256
Definition: interface.h:56
Definition: object.h:372
float GetGameTime()
Returns the absolute time of the game.
Definition: robotmain.cpp:2292
void DeleteAllObjects()
Quickly removes all objects.
Definition: robotmain.cpp:2653
bool EventFrame(const Event &event)
Advances the entire scene.
Definition: robotmain.cpp:3400
int GetGamerGlasses()
Returns the representation to use for the player.
Definition: robotmain.cpp:7302
Sound plugin interface.
Definition: sound.h:149
void ShowDropZone(CObject *metal, CObject *truck)
Shows the buildable area when a cube of metal is deposited.
Definition: robotmain.cpp:5764
void FlushDisplayInfo()
Clears the display of instructions.
Definition: robotmain.cpp:2134
void SetEditFull(bool full)
Management of the fullscreen mode during editing.
Definition: robotmain.cpp:7451
bool GetFixScene()
Indicates whether the scene is fixed, without interaction.
Definition: robotmain.cpp:7173
Definition: robotmain.h:128
Math::Vector LookatPoint(Math::Vector eye, float angleH, float angleV, float length)
Calculates the point of arrival of the camera.
Definition: robotmain.cpp:3628
const int AXIS_INVALID
Invalid value for axis binding (no axis assigned)
Definition: robotmain.h:189
void ClearTooltip()
Clears the previous tooltip.
Definition: robotmain.cpp:3177
void UpdateShortcuts()
Updates all the shortcuts.
Definition: robotmain.cpp:2528
void LoadOneScript(CObject *pObj, int &nerror)
Load all programs of the robot.
Definition: robotmain.cpp:6066