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 "app/pausemanager.h"
34 
35 #include <stdio.h>
36 
37 enum Phase
38 {
39  PHASE_INIT,
40  PHASE_TERM,
41  PHASE_NAME,
42  PHASE_PERSO,
43  PHASE_TRAINER,
44  PHASE_DEFI,
45  PHASE_MISSION,
46  PHASE_FREE,
47  PHASE_TEEN,
48  PHASE_USER,
49  PHASE_LOADING,
50  PHASE_SIMUL,
51  PHASE_MODEL,
52  PHASE_SETUPd,
53  PHASE_SETUPg,
54  PHASE_SETUPp,
55  PHASE_SETUPc,
56  PHASE_SETUPs,
57  PHASE_SETUPds,
58  PHASE_SETUPgs,
59  PHASE_SETUPps,
60  PHASE_SETUPcs,
61  PHASE_SETUPss,
62  PHASE_WRITE,
63  PHASE_READ,
64  PHASE_WRITEs,
65  PHASE_READs,
66  PHASE_WIN,
67  PHASE_LOST,
68  PHASE_WELCOME1,
69  PHASE_WELCOME2,
70  PHASE_WELCOME3,
71  PHASE_GENERIC,
72 };
73 
74 
75 class CEventQueue;
76 class CSoundInterface;
77 
78 namespace Gfx {
79 class CEngine;
80 class CLightManager;
81 class CWater;
82 class CCloud;
83 class CLightning;
84 class CPlanet;
85 class CTerrain;
86 }
87 
88 namespace Ui {
89 class CMainDialog;
90 class CMainShort;
91 class CMainMap;
92 class CInterface;
93 class CDisplayText;
94 class CDisplayInfo;
95 }
96 
97 
98 struct EndTake
99 {
100  Math::Vector pos;
101  float dist;
102  ObjectType type;
103  int min; // wins if >
104  int max; // wins if <
105  int lost; // lost if <=
106  float powermin; // wins if energy cell >=
107  float powermax; // wins if energy cell <=
108  ToolType tool;
109  DriveType drive;
110  bool immediat;
111  char message[100];
112 };
113 
115 {
116  Math::Vector pos;
117  float dist;
118  ObjectType type;
119  int min; // change if >
120  int max; // change if <
121  float powermin; // change if energy cell >=
122  float powermax; // change if energy cell <=
123  ToolType tool;
124  DriveType drive;
125  char music[100];
126  bool repeat;
127  bool changed;
128 };
129 
130 
131 const int MAXNEWSCRIPTNAME = 20;
132 
134 {
135  bool used;
136  ObjectType type;
137  char name[40];
138 };
139 
140 
141 const int MAXSHOWLIMIT = 5;
142 const int MAXSHOWPARTI = 200;
143 const float SHOWLIMITTIME = 20.0f;
144 
145 struct ShowLimit
146 {
147  bool used;
148  Math::Vector pos;
149  float radius;
150  int total;
151  int parti[MAXSHOWPARTI];
152  CObject* link;
153  float duration;
154  float time;
155 };
156 
157 
158 const int SATCOM_HUSTON = 0;
159 const int SATCOM_SAT = 1;
160 const int SATCOM_OBJECT = 2;
161 const int SATCOM_LOADING = 3;
162 const int SATCOM_PROG = 4;
163 const int SATCOM_SOLUCE = 5;
164 const int SATCOM_MAX = 6;
165 
166 
172 {
175  unsigned int primary, secondary;
176 
177  InputBinding(unsigned int p = KEY_INVALID, unsigned int s = KEY_INVALID)
178  : primary(p), secondary(s) {}
179 };
180 
186 {
188  int axis;
190  bool invert;
191 };
192 
194 const int AXIS_INVALID = -1;
195 
196 class CRobotMain : public CSingleton<CRobotMain>
197 {
198 public:
199  CRobotMain(CApplication* app, bool loadProfile);
200  virtual ~CRobotMain();
201 
202  Gfx::CCamera* GetCamera();
203  Gfx::CTerrain* GetTerrain();
204  Ui::CInterface* GetInterface();
205  Ui::CDisplayText* GetDisplayText();
206 
208  void LoadSceneOnStart(const std::string& name, int rank);
209 
210  void CreateIni();
211 
214 
216 
217  void SetInputBinding(InputSlot slot, InputBinding binding);
218  const InputBinding& GetInputBinding(InputSlot slot);
220 
222 
223  void SetJoyAxisBinding(JoyAxisSlot slot, JoyAxisBinding binding);
224  const JoyAxisBinding& GetJoyAxisBinding(JoyAxisSlot slot);
226 
228 
229  void SetJoystickDeadzone(float zone);
230  float GetJoystickDeadzone();
232 
234  void ResetKeyStates();
235 
236  void ChangePhase(Phase phase);
237  bool ProcessEvent(Event &event);
238 
239  bool CreateShortcuts();
240  void ScenePerso();
241 
242  void SetMovieLock(bool lock);
243  bool GetMovieLock();
244  bool GetInfoLock();
245  void SetSatComLock(bool lock);
246  bool GetSatComLock();
247  void SetEditLock(bool lock, bool edit);
248  bool GetEditLock();
249  void SetEditFull(bool full);
250  bool GetEditFull();
251  bool GetFreePhoto();
252  void SetFriendAim(bool friendAim);
253  bool GetFriendAim();
254 
255  void SetTracePrecision(float factor);
256  float GetTracePrecision();
257 
258  void ChangePause(PauseType pause);
259 
260  void SetSpeed(float speed);
261  float GetSpeed();
262 
263  void UpdateShortcuts();
264  void SelectHuman();
265  CObject* SearchHuman();
266  CObject* SearchToto();
267  CObject* SearchNearest(Math::Vector pos, CObject* pExclu);
268  bool SelectObject(CObject* pObj, bool displayError=true);
270  CObject* DeselectAll();
271  bool DeleteObject();
272 
273  void ResetObject();
274  void ResetCreate();
275  void UpdateAudio(bool frame);
276  void SetEndMission(Error result, float delay);
277  Error CheckEndMission(bool frame);
278  void CheckEndMessage(const char* message);
279  int GetObligatoryToken();
280  char* GetObligatoryToken(int i);
281  int IsObligatoryToken(const char* token);
282  bool IsProhibitedToken(const char* token);
283  void UpdateMap();
284  bool GetShowMap();
285 
286  MainMovieType GetMainMovie();
287 
288  void FlushDisplayInfo();
289  void StartDisplayInfo(int index, bool movie);
290  void StartDisplayInfo(const char *filename, int index);
291  void StopDisplayInfo();
292  char* GetDisplayInfoName(int index);
293  int GetDisplayInfoPosition(int index);
294  void SetDisplayInfoPosition(int index, int pos);
295 
296  void StartSuspend();
297  void StopSuspend();
298 
299  float GetGameTime();
300 
301  void SetFontSize(float size);
302  float GetFontSize();
303  void SetWindowPos(Math::Point pos);
304  Math::Point GetWindowPos();
305  void SetWindowDim(Math::Point dim);
306  Math::Point GetWindowDim();
307 
308  void SetIOPublic(bool mode);
309  bool GetIOPublic();
310  void SetIOPos(Math::Point pos);
311  Math::Point GetIOPos();
312  void SetIODim(Math::Point dim);
313  Math::Point GetIODim();
314 
315  char* GetTitle();
316  char* GetResume();
317  char* GetScriptName();
318  char* GetScriptFile();
319  bool GetTrainerPilot();
320  bool GetFixScene();
321  bool GetGlint();
322  bool GetSoluce4();
323  bool GetMovies();
324  bool GetNiceReset();
325  bool GetHimselfDamage();
326  bool GetShowSoluce();
327  bool GetSceneSoluce();
328  bool GetShowAll();
329  bool GetRadar();
330  const char* GetSavegameDir();
331  const char* GetPublicDir();
332  const char* GetFilesDir();
333  bool GetRetroMode();
334 
335  void SetGamerName(const char *name);
336  char* GetGamerName();
337  int GetGamerFace();
338  int GetGamerGlasses();
339  bool GetGamerOnlyHead();
340  float GetPersoAngle();
341 
342  void StartMusic();
343  void StartPauseMusic(PauseType pause);
344  void ClearInterface();
345  void ChangeColor();
346 
347  float SearchNearestObject(Math::Vector center, CObject *exclu);
348  bool FreeSpace(Math::Vector &center, float minRadius, float maxRadius, float space, CObject *exclu);
349  float GetFlatZoneRadius(Math::Vector center, float maxRadius, CObject *exclu);
350  void HideDropZone(CObject* metal);
351  void ShowDropZone(CObject* metal, CObject* truck);
352  void FlushShowLimit(int i);
353  void SetShowLimit(int i, Gfx::ParticleType parti, CObject *pObj, Math::Vector pos,
354  float radius, float duration=SHOWLIMITTIME);
355  void AdjustShowLimit(int i, Math::Vector pos);
356  void StartShowLimit();
357  void FrameShowLimit(float rTime);
358 
359  void CompileScript(bool soluce);
360  void LoadOneScript(CObject *pObj, int &nerror);
361  void LoadFileScript(CObject *pObj, const char* filename, int objRank, int &nerror);
362  void SaveAllScript();
363  void SaveOneScript(CObject *pObj);
364  void SaveFileScript(CObject *pObj, const char* filename, int objRank);
365  bool SaveFileStack(CObject *pObj, FILE *file, int objRank);
366  bool ReadFileStack(CObject *pObj, FILE *file, int objRank);
367 
368  bool FlushNewScriptName();
369  bool AddNewScriptName(ObjectType type, char *name);
370  char* GetNewScriptName(ObjectType type, int rank);
371 
372  void WriteFreeParam();
373  void ReadFreeParam();
374 
375  bool IsBusy();
376  bool IOWriteScene(const char *filename, const char *filecbot, char *info);
377  CObject* IOReadScene(const char *filename, const char *filecbot);
378  void IOWriteObject(FILE *file, CObject* pObj, const char *cmd);
379  CObject* IOReadObject(char *line, const char* filename, int objRank);
380 
381  int CreateSpot(Math::Vector pos, Gfx::Color color);
382 
383  void SetNumericLocale();
384  void RestoreNumericLocale();
385 
386  CObject* GetSelect();
387 
388  void DisplayError(Error err, CObject* pObj, float time=10.0f);
389  void DisplayError(Error err, Math::Vector goal, float height=15.0f, float dist=60.0f, float time=10.0f);
390 
391 protected:
392  bool EventFrame(const Event &event);
393  bool EventObject(const Event &event);
394  void InitEye();
395 
396  void Convert();
397  void CreateScene(bool soluce, bool fixScene, bool resetObject);
398 
399  Math::Vector LookatPoint(Math::Vector eye, float angleH, float angleV, float length);
400  int CreateLight(Math::Vector direction, Gfx::Color color);
401  void HiliteClear();
402  void HiliteObject(Math::Point pos);
403  void HiliteFrame(float rTime);
404  void CreateTooltip(Math::Point pos, const std::string& text);
405  void ClearTooltip();
407  void ChangeCamera();
408  void RemoteCamera(float pan, float zoom, float rTime);
409  void KeyCamera(EventType event, unsigned int key);
410  void AbortMovie();
411  bool IsSelectable(CObject* pObj);
412  void SelectOneObject(CObject* pObj, bool displayError=true);
413  void HelpObject();
414  bool DeselectObject();
415  void DeleteAllObjects();
416  void UpdateInfoText();
417  CObject* SearchObject(ObjectType type);
418  void StartDisplayVisit(EventType event);
419  void FrameVisit(float rTime);
420  void StopDisplayVisit();
421  void ExecuteCmd(char *cmd);
422  bool TestGadgetQuantity(int rank);
423  void UpdateSpeedLabel();
424 
425 
426 protected:
427  CApplication* m_app;
428  CEventQueue* m_eventQueue;
429  CMainMovie* m_movie;
430  Gfx::CEngine* m_engine;
431  Gfx::CParticle* m_particle;
432  Gfx::CWater* m_water;
433  Gfx::CCloud* m_cloud;
434  Gfx::CLightning* m_lightning;
435  Gfx::CPlanet* m_planet;
436  Gfx::CLightManager* m_lightMan;
437  Gfx::CTerrain* m_terrain;
438  Gfx::CCamera* m_camera;
439  Ui::CMainDialog* m_dialog;
440  Ui::CMainShort* m_short;
441  Ui::CMainMap* m_map;
442  Ui::CInterface* m_interface;
443  Ui::CDisplayText* m_displayText;
444  Ui::CDisplayInfo* m_displayInfo;
445  CSoundInterface* m_sound;
446  CPauseManager* m_pause;
447 
449  InputBinding m_inputBindings[INPUT_SLOT_MAX];
450  JoyAxisBinding m_joyAxisBindings[JOY_AXIS_SLOT_MAX];
451  float m_joystickDeadzone;
456 
457 
458  float m_time;
459  float m_gameTime;
460  float m_checkEndTime;
461  float m_winDelay;
462  float m_lostDelay;
463  bool m_fixScene; // scene fixed, no interraction
464  bool m_base; // OBJECT_BASE exists in mission
465  Math::Point m_lastMousePos;
466  CObject* m_selectObject;
467 
468  Phase m_phase;
469  int m_cameraRank;
470  Gfx::Color m_color;
471  bool m_freePhoto;
472  bool m_cmdEdit;
473  bool m_showPos;
474  bool m_selectInsect;
475  bool m_showSoluce;
476  bool m_showAll;
477  bool m_cheatRadar;
478  bool m_shortCut;
479  std::string m_audioTrack;
480  bool m_audioRepeat;
481  std::string m_satcomTrack;
482  bool m_satcomRepeat;
483  std::string m_editorTrack;
484  bool m_editorRepeat;
485  int m_delayWriteMessage;
486  int m_movieInfoIndex;
487 
488  CObject* m_controller;
489 
490  // Level Checker flags
491  bool m_beginObject;
492  bool m_terrainGenerate;
493  bool m_terrainInitTextures;
494  bool m_terrainInit;
495  bool m_terrainCreate;
496 
497  int m_version; // Mission file version
498  bool m_retroStyle; // Retro
499  bool m_immediatSatCom; // SatCom immediately?
500  bool m_beginSatCom; // messages SatCom poster?
501  bool m_lockedSatCom; // SatCom locked?
502  bool m_movieLock; // movie in progress?
503  bool m_satComLock; // call of SatCom is possible?
504  bool m_editLock; // edition in progress?
505  bool m_editFull; // edition in full screen?
506  bool m_hilite;
507  bool m_trainerPilot; // remote trainer?
508  bool m_suspend;
509  bool m_friendAim;
510  bool m_resetCreate;
511  bool m_mapShow;
512  bool m_mapImage;
513  char m_mapFilename[100];
514 
515  Math::Point m_tooltipPos;
516  std::string m_tooltipName;
517  float m_tooltipTime;
518 
519  char m_infoFilename[SATCOM_MAX][100]; // names of text files
520  CObject* m_infoObject;
521  int m_infoIndex;
522  int m_infoPos[SATCOM_MAX];
523  int m_infoUsed;
524 
525  char m_title[100];
526  char m_resume[500];
527  char m_scriptName[100];
528  char m_scriptFile[100];
529  int m_endingWinRank;
530  int m_endingLostRank;
531  bool m_winTerminate;
532 
533  bool m_exitAfterMission;
534 
535  float m_fontSize;
536  Math::Point m_windowPos;
537  Math::Point m_windowDim;
538 
539  bool m_IOPublic;
540  Math::Point m_IOPos;
541  Math::Point m_IODim;
542 
543  NewScriptName m_newScriptName[MAXNEWSCRIPTNAME];
544 
545  float m_cameraPan;
546  float m_cameraZoom;
547 
548  EventType m_visitLast;
549  CObject* m_visitObject;
550  CObject* m_visitArrow;
551  float m_visitTime;
552  float m_visitParticle;
553  Math::Vector m_visitPos;
554  Math::Vector m_visitPosArrow;
555 
556  int m_endTakeTotal;
557  EndTake m_endTake[10];
558  long m_endTakeResearch;
559  bool m_endTakeNever;
560  float m_endTakeWinDelay;
561  float m_endTakeLostDelay;
562 
563  int m_audioChangeTotal;
564  AudioChange m_audioChange[10];
565 
566  int m_obligatoryTotal;
567  char m_obligatoryToken[100][20];
568  int m_prohibitedTotal;
569  char m_prohibitedToken[100][20];
570 
571  std::string m_gamerName;
572 
573  int m_freeBuild; // constructible buildings
574  int m_freeResearch; // researches possible
575 
576  Error m_missionResult;
577 
578  ShowLimit m_showLimit[MAXSHOWLIMIT];
579 
580  Gfx::Color m_colorRefBot;
581  Gfx::Color m_colorNewBot;
582  Gfx::Color m_colorRefAlien;
583  Gfx::Color m_colorNewAlien;
584  Gfx::Color m_colorRefGreen;
585  Gfx::Color m_colorNewGreen;
586  Gfx::Color m_colorRefWater;
587  Gfx::Color m_colorNewWater;
588  float m_colorShiftWater;
589 
590  std::string m_oldLocale;
591 };
592 
void StartDisplayVisit(EventType event)
Start of the visit instead of an error.
Definition: robotmain.cpp:2374
void SetFriendAim(bool friendAim)
Indicates whether mouse is on an friend object, on which we should not shoot.
Definition: robotmain.cpp:7196
CSingleton base class for singletons.
void StartMusic()
Starts music with a mission.
Definition: robotmain.cpp:7220
Definition: maindialog.h:72
float SearchNearestObject(Math::Vector center, CObject *exclu)
Calculates the distance to the nearest object.
Definition: robotmain.cpp:5324
void StopSuspend()
End of dialogue during the game.
Definition: robotmain.cpp:2275
bool FreeSpace(Math::Vector &center, float minRadius, float maxRadius, float space, CObject *exclu)
Calculates a free space.
Definition: robotmain.cpp:5377
ParticleType
Definition: particle.h:58
void SetSpeed(float speed)
Changes game speed.
Definition: robotmain.cpp:7060
Math::Vector m_joyMotion
Motion vector set by joystick axes.
Definition: robotmain.h:455
Definition: displaytext.h:52
bool GetShowMap()
Indicates whether the mini-map is visible.
Definition: robotmain.cpp:7109
void ReadFreeParam()
Reads the global parameters for free play.
Definition: robotmain.cpp:6435
JoyAxisSlot
Slots for joystick axes inputs.
Definition: global.h:267
void SetInputBinding(InputSlot slot, InputBinding binding)
Management of input bindings.
Definition: robotmain.cpp:1037
void SetTracePrecision(float factor)
Management of the precision of drawing the ground.
Definition: robotmain.cpp:7208
MainMovieType GetMainMovie()
Returns the type of current movie.
Definition: robotmain.cpp:2125
void StopDisplayInfo()
End of displaying of instructions.
Definition: robotmain.cpp:2209
void SetIOPublic(bool mode)
Managing windows open/save.
Definition: robotmain.cpp:2336
Definition: robotmain.h:145
void CompileScript(bool soluce)
Compiles all scripts of robots.
Definition: robotmain.cpp:5697
void InitEye()
Initializes the view.
Definition: robotmain.cpp:3389
Definition: robotmain.h:114
bool DeselectObject()
Deselects the selected object.
Definition: robotmain.cpp:2628
void RemoteCamera(float pan, float zoom, float rTime)
Panned with the camera if a button is pressed.
Definition: robotmain.cpp:3332
void CreateIni()
Creates the file colobot.ini at the first time.
Definition: robotmain.cpp:967
void SelectOneObject(CObject *pObj, bool displayError=true)
Selects an object, without attending to deselect the rest.
Definition: robotmain.cpp:2555
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:3264
void StartDisplayInfo(int index, bool movie)
Definition: robotmain.cpp:2145
void HiliteClear()
Removes setting evidence of the object with the mouse hovers over.
Definition: robotmain.cpp:3023
bool IsBusy()
Seeks if an object occupies in a spot, to prevent a backup of the game.
Definition: robotmain.cpp:5969
int CreateSpot(Math::Vector pos, Gfx::Color color)
Creates a light spot.
Definition: robotmain.cpp:5141
bool IsSelectable(CObject *pObj)
Indicates whether an object is selectable.
Definition: robotmain.cpp:2932
Definition: robotmain.h:98
void FrameVisit(float rTime)
Move the arrow to visit.
Definition: robotmain.cpp:2465
Definition: singleton.h:27
void ClearInterface()
Removes hilite and tooltip.
Definition: robotmain.cpp:7250
int GetGamerFace()
Returns the representation to use for the player.
Definition: robotmain.cpp:7021
void CreateTooltip(Math::Point pos, const std::string &text)
Creates a tooltip.
Definition: robotmain.cpp:3125
void StartPauseMusic(PauseType pause)
Starts pause music.
Definition: robotmain.cpp:7230
int axis
Axis index or AXIS_INVALID.
Definition: robotmain.h:188
Some common, global definitions.
void CheckEndMessage(const char *message)
Checks if the mission is finished after displaying a message.
Definition: robotmain.cpp:6840
bool TestGadgetQuantity(int rank)
Updates the number of unnecessary objects.
Definition: robotmain.cpp:5291
bool CreateShortcuts()
Creates interface shortcuts to the units.
Definition: robotmain.cpp:7095
void SetJoyAxisBinding(JoyAxisSlot slot, JoyAxisBinding binding)
Management of joystick axis bindings.
Definition: robotmain.cpp:1049
void SetEditLock(bool lock, bool edit)
Management of the lock mode for the edition.
Definition: robotmain.cpp:7153
Math::Vector m_keyMotion
Motion vector set by keyboard or joystick buttons.
Definition: robotmain.h:453
char * GetGamerName()
Gets the player's name.
Definition: robotmain.cpp:7014
Definition: mainmovie.h:47
void IOWriteObject(FILE *file, CObject *pObj, const char *cmd)
Writes an object into the backup file.
Definition: robotmain.cpp:5990
CObject * GetSelectObject()
Returns the object that default was select after the creation of a scene.
Definition: robotmain.cpp:2532
void SetWindowPos(Math::Point pos)
Managing the size of the default window.
Definition: robotmain.cpp:2310
Global event queue.
Definition: event.h:764
Manager for dynamic lights in 3D scene.
Definition: lightman.h:142
void ExecuteCmd(char *cmd)
Executes a command.
Definition: robotmain.cpp:1798
int GetObligatoryToken()
Returns the number of instructions required.
Definition: robotmain.cpp:6857
InputSlot
Available slots for input bindings.
Definition: global.h:233
void Convert()
Conversion of units.
Definition: robotmain.cpp:3647
void ChangeCamera()
Change the mode of the camera.
Definition: robotmain.cpp:3194
InputBinding m_inputBindings[INPUT_SLOT_MAX]
Bindings for user inputs.
Definition: robotmain.h:449
Definition: robotmain.h:196
CRobotMain(CApplication *app, bool loadProfile)
Constructor of robot application.
Definition: robotmain.cpp:611
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:5120
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:5573
void SetFontSize(float size)
Managing the size of the default fonts.
Definition: robotmain.cpp:2298
Particle engine.
Definition: particle.h:266
void AdjustShowLimit(int i, Math::Vector pos)
Adjusts the boundaries to show.
Definition: robotmain.cpp:5609
void UpdateMap()
Updates the map.
Definition: robotmain.cpp:7103
bool FlushNewScriptName()
Empty the list.
Definition: robotmain.cpp:5926
bool AddNewScriptName(ObjectType type, char *name)
Adds a script name.
Definition: robotmain.cpp:5935
char * GetNewScriptName(ObjectType type, int rank)
Seeks a script name for a given type.
Definition: robotmain.cpp:5951
float GetPersoAngle()
Returns the angle of presentation.
Definition: robotmain.cpp:7039
CObject * DeselectAll()
Deselects everything, and returns the object that was selected.
Definition: robotmain.cpp:2539
CObject * SearchNearest(Math::Vector pos, CObject *pExclu)
Returns the nearest selectable object from a given position.
Definition: robotmain.cpp:2725
virtual ~CRobotMain()
Destructor of robot application.
Definition: robotmain.cpp:904
float GetFlatZoneRadius(Math::Vector center, float maxRadius, CObject *exclu)
Calculates the maximum radius of a free space.
Definition: robotmain.cpp:5442
void LoadFileScript(CObject *pObj, const char *filename, int objRank, int &nerror)
Load all programs of the robot.
Definition: robotmain.cpp:5804
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:5897
ObjectType
Type of game object.
Definition: object.h:46
void SetDefaultInputBindings()
Sets the default input bindings (key and axes)
Definition: robotmain.cpp:985
bool invert
True to invert axis value.
Definition: robotmain.h:190
void ScenePerso()
Load the scene for the character.
Definition: robotmain.cpp:3840
bool IOWriteScene(const char *filename, const char *filecbot, char *info)
Saves the current game.
Definition: robotmain.cpp:6090
Definition: mainshort.h:35
bool GetGamerOnlyHead()
Returns the mode with just the head.
Definition: robotmain.cpp:7033
bool DeleteObject()
Deletes the selected object.
Definition: robotmain.cpp:3005
CObject * SearchToto()
Returns the object toto.
Definition: robotmain.cpp:2709
void FlushShowLimit(int i)
Erases the boundaries shown.
Definition: robotmain.cpp:5552
2D point
Definition: point.h:46
Binding for joystick axis.
Definition: robotmain.h:185
void ResetKeyStates()
Resets tracked key states (motion vectors)
Definition: robotmain.cpp:1071
bool IsProhibitedToken(const char *token)
Checks if an instruction is not part of the banned list.
Definition: robotmain.cpp:6880
void SelectHuman()
Selects the human.
Definition: robotmain.cpp:2687
Main application.
Definition: app.h:201
void SetGamerName(const char *name)
Change the player's name.
Definition: robotmain.cpp:7006
void UpdateInfoText()
Updates the text information.
Definition: robotmain.cpp:3372
void HiliteObject(Math::Point pos)
Highlights the object with the mouse hovers over.
Definition: robotmain.cpp:3049
int GetDisplayInfoPosition(int index)
Returns the name of the text display.
Definition: robotmain.cpp:2248
void StartSuspend()
Beginning of a dialogue during the game.
Definition: robotmain.cpp:2261
void ChangePhase(Phase phase)
Changes phase.
Definition: robotmain.cpp:1078
void SetSatComLock(bool lock)
Management of the blocking of the call of SatCom.
Definition: robotmain.cpp:7142
Camera moving in 3D scene.
Definition: camera.h:130
void ResetCreate()
Resets all objects to their original position.
Definition: robotmain.cpp:6553
Management of pause modes.
Terrain loader/generator and manager.
Definition: terrain.h:220
Error CheckEndMission(bool frame)
Checks if the mission is over.
Definition: robotmain.cpp:6680
void SetJoystickDeadzone(float zone)
Management of joystick deadzone.
Definition: robotmain.cpp:1061
void FrameShowLimit(float rTime)
Advances the boundaries shown.
Definition: robotmain.cpp:5624
CObject - base class for all game objects.
The graphics engine.
Definition: engine.h:682
bool ProcessEvent(Event &event)
Processes an event.
Definition: robotmain.cpp:1306
bool GetTrainerPilot()
Indicates whether it is possible to control a driving robot.
Definition: robotmain.cpp:6892
CObject * DetectObject(Math::Point pos)
Detects the object aimed by the mouse.
Definition: robotmain.cpp:2782
CObject * SearchHuman()
Returns the object human.
Definition: robotmain.cpp:2693
CObject * IOReadScene(const char *filename, const char *filecbot)
Resumes some part of the game.
Definition: robotmain.cpp:6279
void SaveFileScript(CObject *pObj, const char *filename, int objRank)
Definition: robotmain.cpp:5874
bool EventObject(const Event &event)
Makes the event for all robots.
Definition: robotmain.cpp:3601
void HiliteFrame(float rTime)
Highlights the object with the mouse hovers over.
Definition: robotmain.cpp:3108
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:7116
void StartShowLimit()
Mount the boundaries of the selected object.
Definition: robotmain.cpp:5615
void ChangePause(PauseType pause)
Changes on the pause mode.
Definition: robotmain.cpp:7046
void AbortMovie()
Cancels the current movie.
Definition: robotmain.cpp:3352
void HelpObject()
Displays help for an object.
Definition: robotmain.cpp:3181
Water manager/renderer.
Definition: water.h:116
CObject * GetSelect()
Returns the selected object.
Definition: robotmain.cpp:2753
void CreateScene(bool soluce, bool fixScene, bool resetObject)
Creates the whole scene.
Definition: robotmain.cpp:3877
void HideDropZone(CObject *metal)
Hides buildable area when a cube of metal is taken up.
Definition: robotmain.cpp:5455
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:6456
bool SelectObject(CObject *pObj, bool displayError=true)
Selects the object aimed by the mouse.
Definition: robotmain.cpp:2608
void SaveAllScript()
Saves all programs of all the robots.
Definition: robotmain.cpp:5832
Definition: displayinfo.h:46
Definition: mainmap.h:35
void UpdateAudio(bool frame)
Updates the audiotracks.
Definition: robotmain.cpp:6597
bool ReadFileStack(CObject *pObj, FILE *file, int objRank)
Resumes the execution stack of the program in a robot.
Definition: robotmain.cpp:5911
unsigned int primary
Definition: robotmain.h:175
Binding for input slot.
Definition: robotmain.h:171
void LoadSceneOnStart(const std::string &name, int rank)
Caused the given mission to be loaded immediately after start.
Definition: robotmain.cpp:956
RGBA color.
Definition: color.h:35
CObject * IOReadObject(char *line, const char *filename, int objRank)
Resumes the game.
Definition: robotmain.cpp:6194
void SaveOneScript(CObject *pObj)
Definition: robotmain.cpp:5847
void WriteFreeParam()
Writes the global parameters for free play.
Definition: robotmain.cpp:6416
void StopDisplayVisit()
End of the visit instead of an error.
Definition: robotmain.cpp:2495
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:6869
void ChangeColor()
Change the colors and textures.
Definition: robotmain.cpp:5166
Event sent by system, interface or game.
Definition: event.h:686
Definition: pausemanager.h:42
char * GetDisplayInfoName(int index)
Returns the name of the text display.
Definition: robotmain.cpp:2242
void SetDisplayInfoPosition(int index, int pos)
Returns the name of the text display.
Definition: robotmain.cpp:2254
Definition: interface.h:56
Definition: object.h:352
float GetGameTime()
Returns the absolute time of the game.
Definition: robotmain.cpp:2290
void DeleteAllObjects()
Quickly removes all objects.
Definition: robotmain.cpp:2651
bool EventFrame(const Event &event)
Advances the entire scene.
Definition: robotmain.cpp:3397
int GetGamerGlasses()
Returns the representation to use for the player.
Definition: robotmain.cpp:7027
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:5471
void FlushDisplayInfo()
Clears the display of instructions.
Definition: robotmain.cpp:2132
void SetEditFull(bool full)
Management of the fullscreen mode during editing.
Definition: robotmain.cpp:7178
bool GetFixScene()
Indicates whether the scene is fixed, without interaction.
Definition: robotmain.cpp:6898
Definition: robotmain.h:133
Math::Vector LookatPoint(Math::Vector eye, float angleH, float angleV, float length)
Calculates the point of arrival of the camera.
Definition: robotmain.cpp:3625
const int AXIS_INVALID
Invalid value for axis binding (no axis assigned)
Definition: robotmain.h:194
void ClearTooltip()
Clears the previous tooltip.
Definition: robotmain.cpp:3174
void UpdateShortcuts()
Updates all the shortcuts.
Definition: robotmain.cpp:2526
void LoadOneScript(CObject *pObj, int &nerror)
Load all programs of the robot.
Definition: robotmain.cpp:5775