2014-10-14 13:11:37 +00:00
|
|
|
|
/*
|
|
|
|
|
* This file is part of the Colobot: Gold Edition source code
|
|
|
|
|
* Copyright (C) 2001-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
|
|
|
|
|
* http://epsiteс.ch; http://colobot.info; http://github.com/colobot
|
|
|
|
|
*
|
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
|
* See the GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program. If not, see http://gnu.org/licenses
|
|
|
|
|
*/
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
2012-10-17 19:55:45 +00:00
|
|
|
|
/**
|
2015-08-13 09:47:32 +00:00
|
|
|
|
* \file level/robotmain.h
|
2012-10-17 19:55:45 +00:00
|
|
|
|
* \brief CRobotMain - main class of Colobot game engine
|
|
|
|
|
*/
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2015-08-02 11:09:48 +00:00
|
|
|
|
#include "app/pausemanager.h"
|
2012-10-17 19:55:45 +00:00
|
|
|
|
|
2012-09-15 13:33:08 +00:00
|
|
|
|
#include "common/global.h"
|
2012-09-19 16:32:18 +00:00
|
|
|
|
#include "common/singleton.h"
|
|
|
|
|
|
2015-08-13 09:47:32 +00:00
|
|
|
|
#include "level/level_category.h"
|
|
|
|
|
#include "level/mainmovie.h"
|
|
|
|
|
|
2015-08-04 21:28:58 +00:00
|
|
|
|
#include "graphics/engine/camera.h"
|
2012-09-15 13:33:08 +00:00
|
|
|
|
#include "graphics/engine/particle.h"
|
2012-09-19 16:32:18 +00:00
|
|
|
|
|
2015-06-25 17:05:56 +00:00
|
|
|
|
#include "object/drive_type.h"
|
2015-06-26 20:07:55 +00:00
|
|
|
|
#include "object/mission_type.h"
|
2015-08-02 11:09:48 +00:00
|
|
|
|
#include "object/object_type.h"
|
|
|
|
|
#include "object/tool_type.h"
|
2013-12-31 11:58:45 +00:00
|
|
|
|
|
2015-07-14 20:05:12 +00:00
|
|
|
|
#include <deque>
|
|
|
|
|
|
2012-06-26 20:23:05 +00:00
|
|
|
|
enum Phase
|
|
|
|
|
{
|
2015-07-19 21:11:41 +00:00
|
|
|
|
PHASE_WELCOME1,
|
|
|
|
|
PHASE_WELCOME2,
|
|
|
|
|
PHASE_WELCOME3,
|
|
|
|
|
PHASE_PLAYER_SELECT,
|
|
|
|
|
PHASE_APPERANCE,
|
|
|
|
|
PHASE_MAIN_MENU,
|
2015-07-19 21:07:36 +00:00
|
|
|
|
PHASE_LEVEL_LIST,
|
2012-06-26 20:23:05 +00:00
|
|
|
|
PHASE_SIMUL,
|
|
|
|
|
PHASE_SETUPd,
|
|
|
|
|
PHASE_SETUPg,
|
|
|
|
|
PHASE_SETUPp,
|
|
|
|
|
PHASE_SETUPc,
|
|
|
|
|
PHASE_SETUPs,
|
|
|
|
|
PHASE_SETUPds,
|
|
|
|
|
PHASE_SETUPgs,
|
|
|
|
|
PHASE_SETUPps,
|
|
|
|
|
PHASE_SETUPcs,
|
|
|
|
|
PHASE_SETUPss,
|
|
|
|
|
PHASE_WRITEs,
|
2015-08-04 21:28:58 +00:00
|
|
|
|
PHASE_READ,
|
2012-06-26 20:23:05 +00:00
|
|
|
|
PHASE_READs,
|
|
|
|
|
PHASE_WIN,
|
|
|
|
|
PHASE_LOST,
|
2015-07-19 21:11:41 +00:00
|
|
|
|
PHASE_QUIT_SCREEN,
|
2012-06-26 20:23:05 +00:00
|
|
|
|
};
|
2015-08-04 21:28:58 +00:00
|
|
|
|
bool IsInSimulationConfigPhase(Phase phase);
|
|
|
|
|
bool IsPhaseWithWorld(Phase phase);
|
2015-08-06 12:03:07 +00:00
|
|
|
|
bool IsMainMenuPhase(Phase phase);
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
|
|
|
|
|
2014-12-22 09:35:05 +00:00
|
|
|
|
class CController;
|
2012-09-15 13:33:08 +00:00
|
|
|
|
class CEventQueue;
|
|
|
|
|
class CSoundInterface;
|
2014-11-10 13:16:32 +00:00
|
|
|
|
class CLevelParserLine;
|
2014-12-11 18:01:57 +00:00
|
|
|
|
class CInput;
|
2015-06-20 17:27:43 +00:00
|
|
|
|
class CObjectManager;
|
2015-07-07 14:17:19 +00:00
|
|
|
|
class CSceneEndCondition;
|
|
|
|
|
class CAudioChangeCondition;
|
2015-07-19 13:34:49 +00:00
|
|
|
|
class CPlayerProfile;
|
2015-08-04 10:45:52 +00:00
|
|
|
|
class CSettings;
|
2015-08-11 21:13:57 +00:00
|
|
|
|
class COldObject;
|
2012-09-15 13:33:08 +00:00
|
|
|
|
|
2015-08-02 09:40:47 +00:00
|
|
|
|
namespace Gfx
|
|
|
|
|
{
|
2012-09-15 13:33:08 +00:00
|
|
|
|
class CEngine;
|
|
|
|
|
class CLightManager;
|
2012-06-26 20:23:05 +00:00
|
|
|
|
class CWater;
|
|
|
|
|
class CCloud;
|
2012-09-15 13:33:08 +00:00
|
|
|
|
class CLightning;
|
2012-06-26 20:23:05 +00:00
|
|
|
|
class CPlanet;
|
|
|
|
|
class CTerrain;
|
2015-07-11 17:48:37 +00:00
|
|
|
|
class CModelManager;
|
2013-02-16 21:37:43 +00:00
|
|
|
|
}
|
2012-09-15 13:33:08 +00:00
|
|
|
|
|
2015-08-02 09:40:47 +00:00
|
|
|
|
namespace Ui
|
|
|
|
|
{
|
2015-08-06 10:59:09 +00:00
|
|
|
|
class CMainUserInterface;
|
2012-09-15 13:33:08 +00:00
|
|
|
|
class CMainShort;
|
|
|
|
|
class CMainMap;
|
2012-06-26 20:23:05 +00:00
|
|
|
|
class CInterface;
|
|
|
|
|
class CDisplayText;
|
|
|
|
|
class CDisplayInfo;
|
2013-02-16 21:37:43 +00:00
|
|
|
|
}
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
|
|
|
|
const int MAXNEWSCRIPTNAME = 20;
|
|
|
|
|
|
|
|
|
|
struct NewScriptName
|
|
|
|
|
{
|
2012-09-15 13:33:08 +00:00
|
|
|
|
bool used;
|
2012-06-26 20:23:05 +00:00
|
|
|
|
ObjectType type;
|
|
|
|
|
char name[40];
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const int MAXSHOWLIMIT = 5;
|
|
|
|
|
const int MAXSHOWPARTI = 200;
|
|
|
|
|
const float SHOWLIMITTIME = 20.0f;
|
|
|
|
|
|
2015-07-18 21:14:20 +00:00
|
|
|
|
const int MAXSCENE = 999;
|
|
|
|
|
|
2012-06-26 20:23:05 +00:00
|
|
|
|
struct ShowLimit
|
|
|
|
|
{
|
2012-09-15 13:33:08 +00:00
|
|
|
|
bool used;
|
|
|
|
|
Math::Vector pos;
|
2012-06-26 20:23:05 +00:00
|
|
|
|
float radius;
|
|
|
|
|
int total;
|
|
|
|
|
int parti[MAXSHOWPARTI];
|
|
|
|
|
CObject* link;
|
|
|
|
|
float duration;
|
|
|
|
|
float time;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const int SATCOM_HUSTON = 0;
|
|
|
|
|
const int SATCOM_SAT = 1;
|
|
|
|
|
const int SATCOM_OBJECT = 2;
|
|
|
|
|
const int SATCOM_LOADING = 3;
|
|
|
|
|
const int SATCOM_PROG = 4;
|
|
|
|
|
const int SATCOM_SOLUCE = 5;
|
|
|
|
|
const int SATCOM_MAX = 6;
|
|
|
|
|
|
2012-09-19 16:32:18 +00:00
|
|
|
|
class CRobotMain : public CSingleton<CRobotMain>
|
2012-06-26 20:23:05 +00:00
|
|
|
|
{
|
|
|
|
|
public:
|
2015-08-06 10:59:09 +00:00
|
|
|
|
CRobotMain();
|
2013-06-21 23:11:37 +00:00
|
|
|
|
virtual ~CRobotMain();
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
2013-02-16 21:37:43 +00:00
|
|
|
|
Gfx::CCamera* GetCamera();
|
|
|
|
|
Gfx::CTerrain* GetTerrain();
|
|
|
|
|
Ui::CInterface* GetInterface();
|
|
|
|
|
Ui::CDisplayText* GetDisplayText();
|
|
|
|
|
|
2015-07-19 13:30:30 +00:00
|
|
|
|
void CreateConfigFile();
|
|
|
|
|
void LoadConfigFile();
|
2015-06-25 17:05:56 +00:00
|
|
|
|
|
2014-10-20 19:54:52 +00:00
|
|
|
|
void ResetAfterDeviceChanged();
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
|
|
|
|
void ChangePhase(Phase phase);
|
2013-06-16 19:39:21 +00:00
|
|
|
|
bool ProcessEvent(Event &event);
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
|
|
|
|
bool CreateShortcuts();
|
|
|
|
|
void ScenePerso();
|
|
|
|
|
|
2012-09-15 13:33:08 +00:00
|
|
|
|
void SetMovieLock(bool lock);
|
2012-09-10 21:29:38 +00:00
|
|
|
|
bool GetMovieLock();
|
|
|
|
|
bool GetInfoLock();
|
2012-09-15 13:33:08 +00:00
|
|
|
|
void SetSatComLock(bool lock);
|
2012-09-10 21:29:38 +00:00
|
|
|
|
bool GetSatComLock();
|
2012-09-15 13:33:08 +00:00
|
|
|
|
void SetEditLock(bool lock, bool edit);
|
2012-09-10 21:29:38 +00:00
|
|
|
|
bool GetEditLock();
|
2012-09-15 13:33:08 +00:00
|
|
|
|
void SetEditFull(bool full);
|
2012-09-10 21:29:38 +00:00
|
|
|
|
bool GetEditFull();
|
|
|
|
|
bool GetFreePhoto();
|
2012-09-15 13:33:08 +00:00
|
|
|
|
void SetFriendAim(bool friendAim);
|
2012-09-10 21:29:38 +00:00
|
|
|
|
bool GetFriendAim();
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
|
|
|
|
void SetTracePrecision(float factor);
|
2012-09-10 21:29:38 +00:00
|
|
|
|
float GetTracePrecision();
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
2013-12-31 11:58:45 +00:00
|
|
|
|
void ChangePause(PauseType pause);
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
|
|
|
|
void SetSpeed(float speed);
|
2012-09-10 21:29:38 +00:00
|
|
|
|
float GetSpeed();
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
|
|
|
|
void UpdateShortcuts();
|
|
|
|
|
void SelectHuman();
|
|
|
|
|
CObject* SearchHuman();
|
|
|
|
|
CObject* SearchToto();
|
|
|
|
|
CObject* SearchNearest(Math::Vector pos, CObject* pExclu);
|
2012-09-15 13:33:08 +00:00
|
|
|
|
bool SelectObject(CObject* pObj, bool displayError=true);
|
2012-09-10 21:29:38 +00:00
|
|
|
|
CObject* GetSelectObject();
|
2012-06-26 20:23:05 +00:00
|
|
|
|
CObject* DeselectAll();
|
|
|
|
|
bool DeleteObject();
|
|
|
|
|
|
|
|
|
|
void ResetObject();
|
2013-04-13 09:44:16 +00:00
|
|
|
|
void UpdateAudio(bool frame);
|
2013-04-30 19:43:59 +00:00
|
|
|
|
void SetEndMission(Error result, float delay);
|
2012-09-15 13:33:08 +00:00
|
|
|
|
Error CheckEndMission(bool frame);
|
2015-07-07 15:48:49 +00:00
|
|
|
|
Error CheckEndMissionForGroup(std::vector<CSceneEndCondition*>& endTakes);
|
2012-09-10 21:29:38 +00:00
|
|
|
|
int GetObligatoryToken();
|
|
|
|
|
char* GetObligatoryToken(int i);
|
2012-09-15 16:50:51 +00:00
|
|
|
|
int IsObligatoryToken(const char* token);
|
|
|
|
|
bool IsProhibitedToken(const char* token);
|
2012-06-26 20:23:05 +00:00
|
|
|
|
void UpdateMap();
|
2012-09-10 21:29:38 +00:00
|
|
|
|
bool GetShowMap();
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
2012-09-10 21:29:38 +00:00
|
|
|
|
MainMovieType GetMainMovie();
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
|
|
|
|
void FlushDisplayInfo();
|
2012-09-15 13:33:08 +00:00
|
|
|
|
void StartDisplayInfo(int index, bool movie);
|
2015-08-11 20:47:07 +00:00
|
|
|
|
void StartDisplayInfo(const std::string& filename, int index);
|
2012-06-26 20:23:05 +00:00
|
|
|
|
void StopDisplayInfo();
|
2012-09-10 21:29:38 +00:00
|
|
|
|
char* GetDisplayInfoName(int index);
|
|
|
|
|
int GetDisplayInfoPosition(int index);
|
2012-06-26 20:23:05 +00:00
|
|
|
|
void SetDisplayInfoPosition(int index, int pos);
|
|
|
|
|
|
|
|
|
|
void StartSuspend();
|
|
|
|
|
void StopSuspend();
|
|
|
|
|
|
2012-09-10 21:29:38 +00:00
|
|
|
|
float GetGameTime();
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
2012-09-10 21:29:38 +00:00
|
|
|
|
char* GetTitle();
|
|
|
|
|
char* GetResume();
|
|
|
|
|
char* GetScriptName();
|
|
|
|
|
char* GetScriptFile();
|
|
|
|
|
bool GetTrainerPilot();
|
|
|
|
|
bool GetFixScene();
|
2015-08-04 10:45:52 +00:00
|
|
|
|
bool GetInterfaceGlint();
|
2012-09-10 21:29:38 +00:00
|
|
|
|
bool GetSoluce4();
|
|
|
|
|
bool GetMovies();
|
|
|
|
|
bool GetShowSoluce();
|
|
|
|
|
bool GetSceneSoluce();
|
|
|
|
|
bool GetShowAll();
|
2012-09-29 23:51:37 +00:00
|
|
|
|
bool GetRadar();
|
2015-06-26 20:07:55 +00:00
|
|
|
|
MissionType GetMissionType();
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
2012-09-10 21:29:38 +00:00
|
|
|
|
int GetGamerFace();
|
|
|
|
|
int GetGamerGlasses();
|
|
|
|
|
bool GetGamerOnlyHead();
|
|
|
|
|
float GetPersoAngle();
|
2015-07-18 21:14:20 +00:00
|
|
|
|
|
2015-08-04 07:55:39 +00:00
|
|
|
|
void SetLevel(LevelCategory cat, int chap, int rank);
|
2015-07-18 16:52:37 +00:00
|
|
|
|
LevelCategory GetLevelCategory();
|
2015-07-18 17:43:22 +00:00
|
|
|
|
int GetLevelChap();
|
2015-07-18 16:52:37 +00:00
|
|
|
|
int GetLevelRank();
|
2015-08-04 08:52:10 +00:00
|
|
|
|
std::string GetCustomLevelDir();
|
|
|
|
|
void SetReadScene(std::string path);
|
2015-07-18 21:14:20 +00:00
|
|
|
|
void UpdateChapterPassed();
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
|
|
|
|
void StartMusic();
|
2014-02-21 13:19:58 +00:00
|
|
|
|
void StartPauseMusic(PauseType pause);
|
2012-06-26 20:23:05 +00:00
|
|
|
|
void ClearInterface();
|
|
|
|
|
void ChangeColor();
|
|
|
|
|
|
|
|
|
|
float SearchNearestObject(Math::Vector center, CObject *exclu);
|
|
|
|
|
bool FreeSpace(Math::Vector ¢er, float minRadius, float maxRadius, float space, CObject *exclu);
|
2015-07-22 16:26:05 +00:00
|
|
|
|
bool FlatFreeSpace(Math::Vector ¢er, float minFlat, float minRadius, float maxRadius, float space, CObject *exclu);
|
2012-09-10 21:29:38 +00:00
|
|
|
|
float GetFlatZoneRadius(Math::Vector center, float maxRadius, CObject *exclu);
|
2012-06-26 20:23:05 +00:00
|
|
|
|
void HideDropZone(CObject* metal);
|
2015-06-29 21:05:31 +00:00
|
|
|
|
void ShowDropZone(CObject* metal, CObject* transporter);
|
2012-06-26 20:23:05 +00:00
|
|
|
|
void FlushShowLimit(int i);
|
2012-09-15 13:33:08 +00:00
|
|
|
|
void SetShowLimit(int i, Gfx::ParticleType parti, CObject *pObj, Math::Vector pos,
|
|
|
|
|
float radius, float duration=SHOWLIMITTIME);
|
2012-06-26 20:23:05 +00:00
|
|
|
|
void StartShowLimit();
|
|
|
|
|
void FrameShowLimit(float rTime);
|
|
|
|
|
|
2012-09-15 13:33:08 +00:00
|
|
|
|
void CompileScript(bool soluce);
|
2015-08-07 18:48:55 +00:00
|
|
|
|
void LoadOneScript(CObject *pObj);
|
|
|
|
|
void LoadFileScript(CObject *pObj, const char* filename, int objRank);
|
2012-06-26 20:23:05 +00:00
|
|
|
|
void SaveAllScript();
|
|
|
|
|
void SaveOneScript(CObject *pObj);
|
2012-09-26 20:57:43 +00:00
|
|
|
|
void SaveFileScript(CObject *pObj, const char* filename, int objRank);
|
2012-06-26 20:23:05 +00:00
|
|
|
|
bool SaveFileStack(CObject *pObj, FILE *file, int objRank);
|
|
|
|
|
bool ReadFileStack(CObject *pObj, FILE *file, int objRank);
|
|
|
|
|
|
|
|
|
|
bool FlushNewScriptName();
|
|
|
|
|
bool AddNewScriptName(ObjectType type, char *name);
|
2012-09-10 21:29:38 +00:00
|
|
|
|
char* GetNewScriptName(ObjectType type, int rank);
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
2015-07-18 21:14:20 +00:00
|
|
|
|
void SelectPlayer(std::string playerName);
|
2015-07-19 13:34:49 +00:00
|
|
|
|
CPlayerProfile* GetPlayerProfile();
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
2015-08-13 22:21:18 +00:00
|
|
|
|
bool IOIsBusy();
|
2015-08-06 18:15:17 +00:00
|
|
|
|
bool IOWriteScene(std::string filename, std::string filecbot, std::string filescreenshot, char *info);
|
2015-08-03 19:40:30 +00:00
|
|
|
|
void IOWriteSceneFinished();
|
2015-08-04 08:52:10 +00:00
|
|
|
|
CObject* IOReadScene(std::string filename, std::string filecbot);
|
2014-11-10 16:15:34 +00:00
|
|
|
|
void IOWriteObject(CLevelParserLine *line, CObject* obj);
|
2015-08-07 18:48:55 +00:00
|
|
|
|
CObject* IOReadObject(CLevelParserLine *line, const char* filename, const std::string& objCounterText, float objectProgress, int objRank);
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
2012-09-10 21:29:38 +00:00
|
|
|
|
int CreateSpot(Math::Vector pos, Gfx::Color color);
|
2013-05-26 15:47:54 +00:00
|
|
|
|
|
2013-05-02 16:07:20 +00:00
|
|
|
|
CObject* GetSelect();
|
|
|
|
|
|
2013-06-24 20:09:39 +00:00
|
|
|
|
void DisplayError(Error err, CObject* pObj, float time=10.0f);
|
|
|
|
|
void DisplayError(Error err, Math::Vector goal, float height=15.0f, float dist=60.0f, float time=10.0f);
|
2015-06-25 17:05:56 +00:00
|
|
|
|
|
2015-08-04 07:55:39 +00:00
|
|
|
|
void UpdateCustomLevelList();
|
2015-07-19 21:07:36 +00:00
|
|
|
|
std::string GetCustomLevelName(int id);
|
2015-08-04 07:55:39 +00:00
|
|
|
|
const std::vector<std::string>& GetCustomLevelList();
|
2015-06-25 17:05:56 +00:00
|
|
|
|
|
2014-10-29 16:53:46 +00:00
|
|
|
|
void StartMissionTimer();
|
2015-06-25 17:05:56 +00:00
|
|
|
|
|
2014-11-11 13:50:44 +00:00
|
|
|
|
void SetAutosave(bool enable);
|
|
|
|
|
bool GetAutosave();
|
|
|
|
|
void SetAutosaveInterval(int interval);
|
|
|
|
|
int GetAutosaveInterval();
|
|
|
|
|
void SetAutosaveSlots(int slots);
|
|
|
|
|
int GetAutosaveSlots();
|
2015-06-25 17:05:56 +00:00
|
|
|
|
|
2014-12-22 09:35:05 +00:00
|
|
|
|
//! Enable mode where completing mission closes the game
|
|
|
|
|
void SetExitAfterMission(bool exit);
|
2013-06-24 20:09:39 +00:00
|
|
|
|
|
2015-06-26 20:07:55 +00:00
|
|
|
|
//! Returns true if player can interact with things manually
|
|
|
|
|
bool CanPlayerInteract();
|
|
|
|
|
|
2015-07-07 19:25:13 +00:00
|
|
|
|
//! Returns team name for the given team id
|
|
|
|
|
const std::string& GetTeamName(int id);
|
|
|
|
|
|
2015-07-22 10:45:50 +00:00
|
|
|
|
//! Returns true if team-specific colored texture is available
|
|
|
|
|
bool IsTeamColorDefined(int id);
|
|
|
|
|
|
2015-07-13 15:38:19 +00:00
|
|
|
|
//! Get/set enabled buildings
|
|
|
|
|
//@{
|
|
|
|
|
int GetEnableBuild();
|
|
|
|
|
void SetEnableBuild(int enableBuild);
|
|
|
|
|
//@}
|
|
|
|
|
//! Get/set enabled researches
|
|
|
|
|
//@{
|
|
|
|
|
int GetEnableResearch();
|
|
|
|
|
void SetEnableResearch(int enableResearch);
|
|
|
|
|
//@}
|
|
|
|
|
//! Get/set done researches
|
|
|
|
|
//@{
|
2015-07-13 16:13:28 +00:00
|
|
|
|
int GetDoneResearch(int team);
|
|
|
|
|
void SetDoneResearch(int doneResearch, int team);
|
2015-07-13 15:38:19 +00:00
|
|
|
|
//@}
|
|
|
|
|
|
|
|
|
|
//! Returns true if the given building is enabled
|
|
|
|
|
//@{
|
|
|
|
|
bool IsBuildingEnabled(BuildType type);
|
|
|
|
|
bool IsBuildingEnabled(ObjectType type);
|
|
|
|
|
//@}
|
|
|
|
|
//! Returns true if the given research is enabled
|
|
|
|
|
bool IsResearchEnabled(ResearchType type);
|
|
|
|
|
//! Returns true if the given research is done
|
2015-07-13 16:13:28 +00:00
|
|
|
|
bool IsResearchDone(ResearchType type, int team);
|
2015-07-13 15:38:19 +00:00
|
|
|
|
//! Marks research as done
|
2015-07-13 16:13:28 +00:00
|
|
|
|
void MarkResearchDone(ResearchType type, int team);
|
2015-07-13 15:38:19 +00:00
|
|
|
|
|
|
|
|
|
//! Retruns true if all requirements to build this object are met (EnableBuild + DoneResearch)
|
|
|
|
|
//@{
|
2015-07-13 16:13:28 +00:00
|
|
|
|
bool CanBuild(ObjectType type, int team);
|
|
|
|
|
Error CanBuildError(ObjectType type, int team);
|
2015-07-13 15:38:19 +00:00
|
|
|
|
//@}
|
|
|
|
|
|
|
|
|
|
//! Retruns true if all requirements to create this object in BotFactory are met (DoneResearch)
|
|
|
|
|
//@{
|
2015-07-13 16:13:28 +00:00
|
|
|
|
bool CanFactory(ObjectType type, int team);
|
|
|
|
|
Error CanFactoryError(ObjectType type, int team);
|
2015-07-13 15:38:19 +00:00
|
|
|
|
//@}
|
|
|
|
|
|
2015-07-14 20:05:12 +00:00
|
|
|
|
void RemoveFromSelectionHistory(CObject* object);
|
|
|
|
|
|
2015-07-15 16:10:49 +00:00
|
|
|
|
//! Returns global magnifyDamage setting
|
|
|
|
|
float GetGlobalMagnifyDamage();
|
|
|
|
|
|
2015-08-11 21:13:57 +00:00
|
|
|
|
void StartDetectEffect(COldObject* object, CObject* target);
|
|
|
|
|
|
2012-06-26 20:23:05 +00:00
|
|
|
|
protected:
|
|
|
|
|
bool EventFrame(const Event &event);
|
|
|
|
|
bool EventObject(const Event &event);
|
|
|
|
|
void InitEye();
|
|
|
|
|
|
2015-08-07 13:59:05 +00:00
|
|
|
|
void ShowSaveIndicator(bool show);
|
|
|
|
|
|
2012-09-15 13:33:08 +00:00
|
|
|
|
void CreateScene(bool soluce, bool fixScene, bool resetObject);
|
2015-07-13 19:51:18 +00:00
|
|
|
|
void ResetCreate();
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
2015-08-06 16:19:01 +00:00
|
|
|
|
void LevelLoadingError(const std::string& error, const std::runtime_error& exception, Phase exitPhase = PHASE_LEVEL_LIST);
|
|
|
|
|
|
2012-09-15 13:33:08 +00:00
|
|
|
|
Math::Vector LookatPoint(Math::Vector eye, float angleH, float angleV, float length);
|
2012-09-10 21:29:38 +00:00
|
|
|
|
int CreateLight(Math::Vector direction, Gfx::Color color);
|
2012-06-26 20:23:05 +00:00
|
|
|
|
void HiliteClear();
|
|
|
|
|
void HiliteObject(Math::Point pos);
|
|
|
|
|
void HiliteFrame(float rTime);
|
2013-12-02 23:11:26 +00:00
|
|
|
|
void CreateTooltip(Math::Point pos, const std::string& text);
|
2012-06-26 20:23:05 +00:00
|
|
|
|
void ClearTooltip();
|
|
|
|
|
CObject* DetectObject(Math::Point pos);
|
|
|
|
|
void ChangeCamera();
|
|
|
|
|
void RemoteCamera(float pan, float zoom, float rTime);
|
2014-12-11 18:01:57 +00:00
|
|
|
|
void KeyCamera(EventType event, InputSlot key);
|
2012-06-26 20:23:05 +00:00
|
|
|
|
void AbortMovie();
|
|
|
|
|
bool IsSelectable(CObject* pObj);
|
2012-09-15 13:33:08 +00:00
|
|
|
|
void SelectOneObject(CObject* pObj, bool displayError=true);
|
2012-06-26 20:23:05 +00:00
|
|
|
|
void HelpObject();
|
|
|
|
|
bool DeselectObject();
|
|
|
|
|
void DeleteAllObjects();
|
|
|
|
|
void UpdateInfoText();
|
|
|
|
|
CObject* SearchObject(ObjectType type);
|
2012-09-10 21:29:38 +00:00
|
|
|
|
void StartDisplayVisit(EventType event);
|
2012-06-26 20:23:05 +00:00
|
|
|
|
void FrameVisit(float rTime);
|
|
|
|
|
void StopDisplayVisit();
|
|
|
|
|
void ExecuteCmd(char *cmd);
|
2012-10-06 21:35:27 +00:00
|
|
|
|
void UpdateSpeedLabel();
|
2015-06-25 17:05:56 +00:00
|
|
|
|
|
2014-11-11 13:50:44 +00:00
|
|
|
|
int AutosaveRotate(bool freeOne);
|
|
|
|
|
void Autosave();
|
2015-07-14 20:05:12 +00:00
|
|
|
|
void PushToSelectionHistory(CObject* obj);
|
|
|
|
|
CObject* PopFromSelectionHistory();
|
2013-05-26 15:47:54 +00:00
|
|
|
|
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
|
|
|
|
protected:
|
2014-12-22 09:35:05 +00:00
|
|
|
|
CController* m_ctrl;
|
2012-09-15 13:33:08 +00:00
|
|
|
|
CApplication* m_app;
|
2015-06-20 17:27:43 +00:00
|
|
|
|
CObjectManager* m_objMan;
|
2012-09-15 13:33:08 +00:00
|
|
|
|
CEventQueue* m_eventQueue;
|
|
|
|
|
CMainMovie* m_movie;
|
|
|
|
|
Gfx::CEngine* m_engine;
|
2012-09-10 21:29:38 +00:00
|
|
|
|
Gfx::CParticle* m_particle;
|
2012-09-15 13:33:08 +00:00
|
|
|
|
Gfx::CWater* m_water;
|
|
|
|
|
Gfx::CCloud* m_cloud;
|
|
|
|
|
Gfx::CLightning* m_lightning;
|
|
|
|
|
Gfx::CPlanet* m_planet;
|
2015-07-11 17:48:37 +00:00
|
|
|
|
Gfx::COldModelManager* m_oldModelManager;
|
|
|
|
|
std::unique_ptr<Gfx::CModelManager> m_modelManager;
|
2012-09-15 13:33:08 +00:00
|
|
|
|
Gfx::CLightManager* m_lightMan;
|
|
|
|
|
Gfx::CTerrain* m_terrain;
|
|
|
|
|
Gfx::CCamera* m_camera;
|
2015-08-06 10:59:09 +00:00
|
|
|
|
std::unique_ptr<Ui::CMainUserInterface> m_ui;
|
2012-09-15 13:33:08 +00:00
|
|
|
|
Ui::CMainShort* m_short;
|
|
|
|
|
Ui::CMainMap* m_map;
|
|
|
|
|
Ui::CInterface* m_interface;
|
|
|
|
|
Ui::CDisplayText* m_displayText;
|
|
|
|
|
Ui::CDisplayInfo* m_displayInfo;
|
|
|
|
|
CSoundInterface* m_sound;
|
2013-12-31 11:58:45 +00:00
|
|
|
|
CPauseManager* m_pause;
|
2014-12-11 18:01:57 +00:00
|
|
|
|
CInput* m_input;
|
2015-08-04 10:45:52 +00:00
|
|
|
|
CSettings* m_settings;
|
2012-09-19 19:23:42 +00:00
|
|
|
|
|
2015-07-18 21:14:20 +00:00
|
|
|
|
//! Progress of loaded player
|
2015-07-19 13:34:49 +00:00
|
|
|
|
std::unique_ptr<CPlayerProfile> m_playerProfile;
|
2015-07-18 21:14:20 +00:00
|
|
|
|
|
2012-09-19 16:32:18 +00:00
|
|
|
|
|
2015-07-09 21:15:30 +00:00
|
|
|
|
//! Time since level start, including pause and intro movie
|
2012-06-26 20:23:05 +00:00
|
|
|
|
float m_time;
|
2015-07-09 21:15:30 +00:00
|
|
|
|
//! Playing time since level start
|
2012-06-26 20:23:05 +00:00
|
|
|
|
float m_gameTime;
|
2015-07-09 21:15:30 +00:00
|
|
|
|
//! Playing time since level start, not dependent on simulation speed
|
|
|
|
|
float m_gameTimeAbsolute;
|
2015-07-12 10:13:19 +00:00
|
|
|
|
|
2015-08-04 08:52:10 +00:00
|
|
|
|
LevelCategory m_levelCategory;
|
|
|
|
|
int m_levelChap;
|
|
|
|
|
int m_levelRank;
|
|
|
|
|
std::string m_sceneReadPath;
|
|
|
|
|
|
2012-06-26 20:23:05 +00:00
|
|
|
|
float m_winDelay;
|
|
|
|
|
float m_lostDelay;
|
2012-09-15 13:33:08 +00:00
|
|
|
|
bool m_fixScene; // scene fixed, no interraction
|
2014-11-09 18:26:36 +00:00
|
|
|
|
CObject* m_base; // OBJECT_BASE exists in mission
|
2012-09-15 13:33:08 +00:00
|
|
|
|
Math::Point m_lastMousePos;
|
2012-06-26 20:23:05 +00:00
|
|
|
|
CObject* m_selectObject;
|
|
|
|
|
|
|
|
|
|
Phase m_phase;
|
|
|
|
|
int m_cameraRank;
|
2012-09-10 21:29:38 +00:00
|
|
|
|
Gfx::Color m_color;
|
2012-09-15 13:33:08 +00:00
|
|
|
|
bool m_freePhoto;
|
|
|
|
|
bool m_cmdEdit;
|
|
|
|
|
bool m_selectInsect;
|
|
|
|
|
bool m_showSoluce;
|
|
|
|
|
bool m_showAll;
|
|
|
|
|
bool m_cheatRadar;
|
|
|
|
|
bool m_shortCut;
|
2013-04-13 14:35:35 +00:00
|
|
|
|
std::string m_audioTrack;
|
2014-02-21 13:19:58 +00:00
|
|
|
|
bool m_audioRepeat;
|
|
|
|
|
std::string m_satcomTrack;
|
|
|
|
|
bool m_satcomRepeat;
|
|
|
|
|
std::string m_editorTrack;
|
|
|
|
|
bool m_editorRepeat;
|
2012-06-26 20:23:05 +00:00
|
|
|
|
int m_movieInfoIndex;
|
|
|
|
|
|
2013-04-29 15:26:32 +00:00
|
|
|
|
CObject* m_controller;
|
|
|
|
|
|
2015-06-26 20:07:55 +00:00
|
|
|
|
MissionType m_missionType;
|
2012-09-15 13:33:08 +00:00
|
|
|
|
bool m_immediatSatCom; // SatCom immediately?
|
|
|
|
|
bool m_beginSatCom; // messages SatCom poster?
|
2013-03-27 21:20:50 +00:00
|
|
|
|
bool m_lockedSatCom; // SatCom locked?
|
2012-09-15 13:33:08 +00:00
|
|
|
|
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_hilite;
|
|
|
|
|
bool m_trainerPilot; // remote trainer?
|
|
|
|
|
bool m_friendAim;
|
|
|
|
|
bool m_resetCreate;
|
|
|
|
|
bool m_mapShow;
|
|
|
|
|
bool m_mapImage;
|
2012-06-26 20:23:05 +00:00
|
|
|
|
char m_mapFilename[100];
|
|
|
|
|
|
2015-08-04 21:28:58 +00:00
|
|
|
|
bool m_suspend;
|
|
|
|
|
PauseType m_suspendInitPause;
|
|
|
|
|
Gfx::CameraType m_suspendInitCamera;
|
|
|
|
|
|
2012-09-15 13:33:08 +00:00
|
|
|
|
Math::Point m_tooltipPos;
|
2013-12-02 23:11:26 +00:00
|
|
|
|
std::string m_tooltipName;
|
2012-06-26 20:23:05 +00:00
|
|
|
|
float m_tooltipTime;
|
|
|
|
|
|
|
|
|
|
char m_infoFilename[SATCOM_MAX][100]; // names of text files
|
|
|
|
|
CObject* m_infoObject;
|
|
|
|
|
int m_infoIndex;
|
|
|
|
|
int m_infoPos[SATCOM_MAX];
|
|
|
|
|
int m_infoUsed;
|
|
|
|
|
|
|
|
|
|
char m_title[100];
|
|
|
|
|
char m_resume[500];
|
|
|
|
|
char m_scriptName[100];
|
|
|
|
|
char m_scriptFile[100];
|
|
|
|
|
int m_endingWinRank;
|
|
|
|
|
int m_endingLostRank;
|
2012-09-15 13:33:08 +00:00
|
|
|
|
bool m_winTerminate;
|
2015-06-25 17:05:56 +00:00
|
|
|
|
|
2015-07-15 16:10:49 +00:00
|
|
|
|
float m_globalMagnifyDamage;
|
|
|
|
|
|
2013-12-26 20:54:05 +00:00
|
|
|
|
bool m_exitAfterMission;
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
2015-06-26 20:07:55 +00:00
|
|
|
|
bool m_codeBattleInit;
|
|
|
|
|
bool m_codeBattleStarted;
|
|
|
|
|
|
2015-07-07 19:25:13 +00:00
|
|
|
|
std::map<int, std::string> m_teamNames;
|
|
|
|
|
|
2012-06-26 20:23:05 +00:00
|
|
|
|
NewScriptName m_newScriptName[MAXNEWSCRIPTNAME];
|
|
|
|
|
|
|
|
|
|
float m_cameraPan;
|
|
|
|
|
float m_cameraZoom;
|
|
|
|
|
|
2012-09-15 13:33:08 +00:00
|
|
|
|
EventType m_visitLast;
|
2012-06-26 20:23:05 +00:00
|
|
|
|
CObject* m_visitObject;
|
|
|
|
|
CObject* m_visitArrow;
|
|
|
|
|
float m_visitTime;
|
2012-09-15 13:33:08 +00:00
|
|
|
|
float m_visitParticle;
|
|
|
|
|
Math::Vector m_visitPos;
|
|
|
|
|
Math::Vector m_visitPosArrow;
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
2015-07-07 14:17:19 +00:00
|
|
|
|
std::vector<std::unique_ptr<CSceneEndCondition>> m_endTake;
|
2012-06-26 20:23:05 +00:00
|
|
|
|
long m_endTakeResearch;
|
|
|
|
|
float m_endTakeWinDelay;
|
|
|
|
|
float m_endTakeLostDelay;
|
2013-05-26 15:47:54 +00:00
|
|
|
|
|
2015-07-07 14:17:19 +00:00
|
|
|
|
std::vector<std::unique_ptr<CAudioChangeCondition>> m_audioChange;
|
2012-06-26 20:23:05 +00:00
|
|
|
|
|
|
|
|
|
int m_obligatoryTotal;
|
|
|
|
|
char m_obligatoryToken[100][20];
|
|
|
|
|
int m_prohibitedTotal;
|
|
|
|
|
char m_prohibitedToken[100][20];
|
|
|
|
|
|
2015-07-13 16:13:28 +00:00
|
|
|
|
//! Enabled buildings
|
|
|
|
|
int m_build;
|
|
|
|
|
//! Available researches
|
|
|
|
|
long m_researchEnable;
|
|
|
|
|
//! Done researches for each team
|
|
|
|
|
std::map<int, int> m_researchDone;
|
|
|
|
|
|
2013-04-30 19:43:59 +00:00
|
|
|
|
Error m_missionResult;
|
|
|
|
|
|
2012-06-26 20:23:05 +00:00
|
|
|
|
ShowLimit m_showLimit[MAXSHOWLIMIT];
|
|
|
|
|
|
2012-09-15 13:33:08 +00:00
|
|
|
|
Gfx::Color m_colorRefBot;
|
2015-07-22 10:45:50 +00:00
|
|
|
|
std::map<int, Gfx::Color> m_colorNewBot;
|
2012-09-15 13:33:08 +00:00
|
|
|
|
Gfx::Color m_colorRefAlien;
|
|
|
|
|
Gfx::Color m_colorNewAlien;
|
|
|
|
|
Gfx::Color m_colorRefGreen;
|
|
|
|
|
Gfx::Color m_colorNewGreen;
|
|
|
|
|
Gfx::Color m_colorRefWater;
|
|
|
|
|
Gfx::Color m_colorNewWater;
|
2012-06-26 20:23:05 +00:00
|
|
|
|
float m_colorShiftWater;
|
2015-06-25 17:05:56 +00:00
|
|
|
|
|
2014-10-29 16:53:46 +00:00
|
|
|
|
bool m_missionTimerEnabled;
|
|
|
|
|
bool m_missionTimerStarted;
|
|
|
|
|
float m_missionTimer;
|
2015-06-25 17:05:56 +00:00
|
|
|
|
|
2014-11-11 13:50:44 +00:00
|
|
|
|
bool m_autosave;
|
|
|
|
|
int m_autosaveInterval;
|
|
|
|
|
int m_autosaveSlots;
|
|
|
|
|
float m_autosaveLast;
|
2015-07-14 20:05:12 +00:00
|
|
|
|
|
2015-08-07 13:59:05 +00:00
|
|
|
|
int m_shotSaving;
|
2015-08-06 18:15:17 +00:00
|
|
|
|
|
2015-07-14 20:05:12 +00:00
|
|
|
|
std::deque<CObject*> m_selectionHistory;
|
2012-06-26 20:23:05 +00:00
|
|
|
|
};
|