Colobot
engine.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-2016, Daniel Roux, EPSITEC SA & TerranovaTeam
4  * http://epsitec.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 #include "common/singleton.h"
28 
29 #include "graphics/core/color.h"
30 #include "graphics/core/material.h"
31 #include "graphics/core/texture.h"
32 #include "graphics/core/vertex.h"
33 
34 #include "math/intpoint.h"
35 #include "math/matrix.h"
36 #include "math/point.h"
37 #include "math/sphere.h"
38 #include "math/vector.h"
39 
40 
41 #include <string>
42 #include <vector>
43 #include <map>
44 #include <set>
45 #include <memory>
46 #include <unordered_map>
47 
48 
49 class CApplication;
50 class CSoundInterface;
51 class CImage;
52 class CSystemUtils;
53 struct SystemTimeStamp;
54 struct Event;
55 
56 
57 // Graphics module namespace
58 namespace Gfx
59 {
60 
61 
62 class CDevice;
63 class COldModelManager;
64 class CLightManager;
65 class CText;
66 class CParticle;
67 class CWater;
68 class CCloud;
69 class CLightning;
70 class CPlanet;
71 class CTerrain;
72 class CPyroManager;
73 class CModelMesh;
74 struct ModelShadowSpot;
75 struct ModelTriangle;
76 
77 
86 {
96  ENG_RSTATE_WRAP = (1<<3),
98  ENG_RSTATE_CLAMP = (1<<4),
110  ENG_RSTATE_PART3 = (1<<10),
112  ENG_RSTATE_PART4 = (1<<11),
114  ENG_RSTATE_2FACE = (1<<12),
116  ENG_RSTATE_ALPHA = (1<<13),
118  ENG_RSTATE_SECOND = (1<<14),
120  ENG_RSTATE_FOG = (1<<15),
126  ENG_RSTATE_TEXT = (1<<18),
135 };
136 
137 
143 {
148 };
149 
155 {
163  std::string tex1Name;
165  std::string tex2Name;
166 };
167 
172 {
187 };
188 
189 
195 {
196  EngineTriangleType type;
198  int state;
199  std::vector<VertexTex2> vertices;
200  unsigned int staticBufferId;
201  bool updateStaticBuffer;
202 
204  const Material& material = Material(),
205  int state = ENG_RSTATE_NORMAL)
206  : type(type)
207  , material(material)
208  , state(state)
209  , staticBufferId(0)
210  , updateStaticBuffer(false)
211  {}
212 };
213 
219 {
220  std::string tex1Name;
221  Texture tex1;
222  std::string tex2Name;
223  Texture tex2;
224  std::vector<EngineBaseObjDataTier> next;
225 
226  inline EngineBaseObjTexTier(const std::string& tex1Name = "",
227  const std::string& tex2Name = "")
228  : tex1Name(tex1Name)
229  , tex2Name(tex2Name)
230  {}
231 };
232 
240 {
242  bool used = false;
244  int totalTriangles = 0;
250  float radius = 0.0f;
252  std::vector<EngineBaseObjTexTier> next;
253 
254  inline void LoadDefault()
255  {
256  *this = EngineBaseObject();
257  }
258 };
259 
265 {
267  bool used = false;
269  int baseObjRank = -1;
271  bool visible = false;
273  bool drawWorld = false;
275  bool drawFront = false;
281  float distance = 0.0f;
283  int shadowRank = -1;
285  float transparency = 0.0f;
286 
288  inline void LoadDefault()
289  {
290  *this = EngineObject();
291  }
292 };
293 
299 {
304 };
305 
311 {
313  bool used = false;
315  bool hide = false;
317  int objRank = -1;
325  float angle = 0.0f;
327  float radius = 0.0f;
329  float intensity = 0.0f;
331  float height = 0.0f;
332 
333  void LoadDefault()
334  {
335  *this = EngineShadow();
336  }
337 };
338 
344 {
346  bool used = false;
350  float min = 0.0f;
352  float max = 0.0f;
354  float smooth = 0.0f;
358  float radius = 0.0f;
362  float drawRadius = 0.0f;
363 
364  void LoadDefault()
365  {
366  *this = EngineGroundSpot();
367  }
368 };
369 
375 {
384 };
385 
391 {
393  bool draw = false;
397  float delay[3] = {};
399  float fix = 0.0f;
403  float radius = 0.0f;
405  float intensity = 0.0f;
409  float drawRadius = 0.0f;
411  float drawIntensity = 0.0f;
413  int dx = 0;
415  int dy = 0;
417  char* table = nullptr;
418 
419  void LoadDefault()
420  {
421  *this = EngineGroundMark();
422  }
423 };
424 
430 {
431  ENG_TEX_MAPPING_X = 1,
432  ENG_TEX_MAPPING_Y = 2,
433  ENG_TEX_MAPPING_Z = 3,
434  ENG_TEX_MAPPING_1X = 4,
435  ENG_TEX_MAPPING_1Y = 5,
436  ENG_TEX_MAPPING_1Z = 6
437 };
438 
439 
445 {
480 
483 };
484 
490 {
492  int icon1;
494  int icon2;
503 
504  EngineMouse(int icon1 = -1,
505  int icon2 = -1,
506  int iconShadow = -1,
509  Math::Point hotPoint = Math::Point())
510  : icon1(icon1)
511  , icon2(icon2)
512  , iconShadow(iconShadow)
513  , mode1(mode1)
514  , mode2(mode2)
515  , hotPoint(hotPoint)
516  {}
517 };
518 
519 
619 class CEngine : public CSingleton<CEngine>
620 {
621 public:
622  CEngine(CApplication* app, CSystemUtils* systemUtils);
623  ~CEngine();
624 
626  void SetDevice(CDevice* device);
628  CDevice* GetDevice();
629 
631  CText* GetText();
632  COldModelManager* GetModelManager();
633  CPyroManager* GetPyroManager();
635  CLightManager* GetLightManager();
637  CParticle* GetParticle();
639  CTerrain* GetTerrain();
641  CWater* GetWater();
643  CLightning* GetLightning();
645  CPlanet* GetPlanet();
647  CCloud* GetCloud();
648 
650  void SetTerrain(CTerrain* terrain);
651 
652 
654  bool Create();
656  void Destroy();
657 
659  void ResetAfterVideoConfigChanged();
660 
661 
663  void Render();
664 
665 
667  bool ProcessEvent(const Event& event);
668 
670  void FrameUpdate();
671 
672 
674  void WriteScreenShot(const std::string& fileName);
675 
676 
678  void SetPause(bool pause);
680  bool GetPause();
682 
684  void SetShowStats(bool show);
686  bool GetShowStats();
688 
690  void SetRenderEnable(bool enable);
691 
692  void SetRenderInterface(bool enable);
693  bool GetRenderInterface();
694 
696 
697  void SetScreenshotMode(bool screenshotMode);
698  bool GetScreenshotMode();
700 
702  Math::IntPoint GetWindowSize();
703 
705 
708  Math::Point WindowToInterfaceCoords(Math::IntPoint pos);
709  Math::IntPoint InterfaceToWindowCoords(Math::Point pos);
711 
713 
715  Math::Point WindowToInterfaceSize(Math::IntPoint size);
716  Math::IntPoint InterfaceToWindowSize(Math::Point size);
718 
720  void AddStatisticTriangle(int count);
722  int GetStatisticTriangle();
723 
725  void SetStatisticPos(Math::Vector pos);
726 
728  void SetTimerDisplay(const std::string& text);
729 
730 
731  /* *************** New mesh interface *************** */
733 
741  int AddStaticMesh(const std::string& key, const Gfx::CModelMesh* mesh, const Math::Matrix& worldMatrix);
742 
744  void DeleteStaticMesh(int meshHandle);
745 
747  void AddStaticMeshShadowSpot(int meshHandle, const Gfx::ModelShadowSpot& shadowSpot);
748 
750  const Math::Matrix& GetStaticMeshWorldMatrix(int meshHandle);
751 
753  void SetStaticMeshTransparency(int meshHandle, float value);
754 
755 
756  /* *************** Object management *************** */
757 
758  // Base objects
759 
761  int CreateBaseObject();
763  void DeleteBaseObject(int baseObjRank);
765  void DeleteAllBaseObjects();
766 
768  void CopyBaseObject(int sourceBaseObjRank, int destBaseObjRank);
769 
771  void AddBaseObjTriangles(int baseObjRank, const std::vector<Gfx::ModelTriangle>& triangles);
772 
774  void AddBaseObjQuick(int baseObjRank, const EngineBaseObjDataTier& buffer,
775  std::string tex1Name, std::string tex2Name,
776  bool globalUpdate);
777 
778  // Objects
779 
781  void DebugObject(int objRank);
782 
784  int CreateObject();
786  void DeleteAllObjects();
788  void DeleteObject(int objRank);
789 
791  void SetObjectBaseRank(int objRank, int baseObjRank);
793  int GetObjectBaseRank(int objRank);
795 
797  void SetObjectType(int objRank, EngineObjectType type);
799  EngineObjectType GetObjectType(int objRank);
801 
803  void SetObjectTransform(int objRank, const Math::Matrix& transform);
805  void GetObjectTransform(int objRank, Math::Matrix& transform);
807 
809  void SetObjectDrawWorld(int objRank, bool draw);
811  void SetObjectDrawFront(int objRank, bool draw);
812 
814  void SetObjectTransparency(int objRank, float value);
815 
817  void GetObjectBBox(int objRank, Math::Vector& min, Math::Vector& max);
818 
820  int GetObjectTotalTriangles(int objRank);
821 
823  EngineBaseObjDataTier* FindTriangles(int objRank, const Material& material,
824  int state, std::string tex1Name, std::string tex2Name);
825 
827  int GetPartialTriangles(int objRank, float percent, int maxCount,
828  std::vector<EngineTriangle>& triangles);
829 
831  void ChangeSecondTexture(int objRank, const std::string& tex2Name);
832 
834  void ChangeTextureMapping(int objRank, const Material& mat, int state,
835  const std::string& tex1Name, const std::string& tex2Name,
837  float au, float bu, float av, float bv);
838 
840  void TrackTextureMapping(int objRank, const Material& mat, int state,
841  const std::string& tex1Name, const std::string& tex2Name,
843  float pos, float factor, float tl, float ts, float tt);
844 
846 
847  int DetectObject(Math::Point mouse);
848 
850  void CreateShadowSpot(int objRank);
852  void DeleteShadowSpot(int objRank);
853 
855  void SetObjectShadowSpotHide(int objRank, bool hide);
857  void SetObjectShadowSpotType(int objRank, EngineShadowType type);
858  void SetObjectShadowSpotPos(int objRank, const Math::Vector& pos);
859  void SetObjectShadowSpotAngle(int objRank, float angle);
860  void SetObjectShadowSpotRadius(int objRank, float radius);
861  void SetObjectShadowSpotIntensity(int objRank, float intensity);
862  void SetObjectShadowSpotHeight(int objRank, float height);
863  void UpdateObjectShadowSpotNormal(int objRank);
865 
867  void SetHighlightRank(int* rankList);
869  bool GetHighlight(Math::Point& p1, Math::Point& p2);
870 
872  void DeleteAllGroundSpots();
874  int CreateGroundSpot();
876  void DeleteGroundSpot(int rank);
877 
879  void SetObjectGroundSpotPos(int rank, const Math::Vector& pos);
881  void SetObjectGroundSpotRadius(int rank, float radius);
882  void SetObjectGroundSpotColor(int rank, const Color& color);
883  void SetObjectGroundSpotMinMax(int rank, float min, float max);
884  void SetObjectGroundSpotSmooth(int rank, float smooth);
886 
888  void CreateGroundMark(Math::Vector pos, float radius,
889  float delay1, float delay2, float delay3,
890  int dx, int dy, char* table);
892  void DeleteGroundMark(int rank);
893 
895  void Update();
896 
897 
898  /* *************** Mode setting *************** */
899 
901  void SetState(int state, const Color& color = Color(1.0f, 1.0f, 1.0f, 1.0f));
902 
904  void SetMaterial(const Material& mat);
905 
907  void SetViewParams(const Math::Vector& eyePt, const Math::Vector& lookatPt,
908  const Math::Vector& upVec, float eyeDistance);
909 
911  Texture LoadTexture(const std::string& name);
913  Texture LoadTexture(const std::string& name, CImage* image);
915  Texture LoadTexture(const std::string& name, const TextureCreateParams& params);
917  bool LoadAllTextures();
918 
920 
921  bool ChangeTextureColor(const std::string& texName,
922  const std::string& srcName,
923  Color colorRef1, Color colorNew1,
924  Color colorRef2, Color colorNew2,
925  float tolerance1, float tolerance2,
926  Math::Point ts, Math::Point ti,
927  Math::Point *exclude = nullptr,
928  float shift = 0.0f, bool hsv = false);
929  bool ChangeTextureColor(const std::string& texName,
930  Color colorRef1, Color colorNew1,
931  Color colorRef2, Color colorNew2,
932  float tolerance1, float tolerance2,
933  Math::Point ts, Math::Point ti,
934  Math::Point *exclude = nullptr,
935  float shift = 0.0f, bool hsv = false);
937 
939 
940  bool SetTexture(const std::string& name, int stage = 0);
942  void SetTexture(const Texture& tex, int stage = 0);
943 
945  void DeleteTexture(const std::string& texName);
947  void DeleteTexture(const Texture& tex);
948 
950  void CreateOrUpdateTexture(const std::string& texName, CImage* img);
951 
953  void FlushTextureCache();
954 
956  void SetTerrainVision(float vision);
957 
959 
963  void SetFocus(float focus);
964  float GetFocus();
966 
968  // NOTE: This is an user configuration setting
970  void SetDirty(bool mode);
971  bool GetDirty();
973 
975  // NOTE: This is an user configuration setting
977  void SetFog(bool mode);
978  bool GetFog();
980 
982  void SetSecondTexture(const std::string& texNum);
984  const std::string& GetSecondTexture();
986 
988  void SetRankView(int rank);
990  int GetRankView();
992 
994  void SetDrawWorld(bool draw);
995 
997  void SetDrawFront(bool draw);
998 
1000  void SetAmbientColor(const Color& color, int rank = 0);
1002  Color GetAmbientColor(int rank = 0);
1004 
1006  void SetWaterAddColor(const Color& color);
1008  Color GetWaterAddColor();
1010 
1012  void SetFogColor(const Color& color, int rank = 0);
1014  Color GetFogColor(int rank = 0);
1016 
1018 
1021  void SetDeepView(float length, int rank = 0, bool ref=false);
1022  float GetDeepView(int rank = 0);
1024 
1025 
1027 
1030  void SetFogStart(float start, int rank = 0);
1031  float GetFogStart(int rank = 0);
1033 
1035  void SetBackground(const std::string& name, Color up = Color(), Color down = Color(),
1037  Color cloudUp = Color(), Color cloudDown = Color(),
1038  bool full = false, bool scale = false);
1039  void GetBackground(std::string& name, Color& up, Color& down,
1040  Color& cloudUp, Color& cloudDown,
1041  bool& full, bool& scale);
1043 
1045  void SetForegroundName(const std::string& name);
1047  void SetOverFront(bool front);
1049  void SetOverColor(const Color& color = Color(), int mode = ENG_RSTATE_TCOLOR_BLACK);
1050 
1052  // NOTE: This is an user configuration setting
1054  void SetParticleDensity(float value);
1055  float GetParticleDensity();
1057 
1059  float ParticleAdapt(float factor);
1060 
1062  // NOTE: This is an user configuration setting
1064  void SetClippingDistance(float value);
1065  float GetClippingDistance();
1067 
1069  // NOTE: This is an user configuration setting
1071  void SetTextureFilterMode(TexFilter value);
1072  TexFilter GetTextureFilterMode();
1074 
1076  // NOTE: This is an user configuration setting
1078  void SetTextureMipmapLevel(int value);
1079  int GetTextureMipmapLevel();
1081 
1083  // NOTE: This is an user configuration setting
1085  void SetTextureAnisotropyLevel(int value);
1086  int GetTextureAnisotropyLevel();
1088 
1090  // NOTE: These are user configuration settings
1092  bool IsShadowMappingSupported();
1093  void SetShadowMapping(bool value);
1094  bool GetShadowMapping();
1095  void SetShadowMappingOffscreen(bool value);
1096  bool GetShadowMappingOffscreen();
1097  void SetShadowMappingOffscreenResolution(int resolution);
1098  int GetShadowMappingOffscreenResolution();
1099  bool IsShadowMappingQualitySupported();
1100  void SetShadowMappingQuality(bool value);
1101  bool GetShadowMappingQuality();
1102  void SetTerrainShadows(bool value);
1103  bool GetTerrainShadows();
1105 
1107  // NOTE: This is a setting configurable only in INI file
1109  void SetShadowColor(float value);
1110  float GetShadowColor();
1112 
1114  // NOTE: This is a setting configurable only in INI file
1116  void SetShadowRange(float value);
1117  float GetShadowRange();
1119 
1121  // NOTE: This is an user configuration setting
1123  void SetMultiSample(int value);
1124  int GetMultiSample();
1126 
1128  void SetBackForce(bool present);
1130  bool GetBackForce();
1132 
1134  // NOTE: This is an user configuration setting
1136  void SetLightMode(bool present);
1137  bool GetLightMode();
1139 
1141  // NOTE: This is an user configuration setting
1143  // TODO: Move to CSettings
1144  void SetEditIndentMode(bool autoIndent);
1145  bool GetEditIndentMode();
1147 
1149  // NOTE: This is an user configuration setting
1151  // TODO: Move to CSettings
1152  void SetEditIndentValue(int value);
1153  int GetEditIndentValue();
1155 
1157  void SetTracePrecision(float factor);
1159  float GetTracePrecision();
1161 
1163  void SetMouseType(EngineMouseType type);
1165  EngineMouseType GetMouseType();
1167 
1169  const Math::Matrix& GetMatView();
1171  TEST_VIRTUAL Math::Vector GetEyePt();
1173  TEST_VIRTUAL Math::Vector GetLookatPt();
1175  float GetEyeDirH();
1177  float GetEyeDirV();
1179  bool IsVisiblePoint(const Math::Vector& pos);
1180 
1182  void UpdateMatProj();
1183 
1185  void ApplyChange();
1186 
1187  void ClearDisplayCrashSpheres();
1188  void AddDisplayCrashSpheres(const std::vector<Math::Sphere>& crashSpheres);
1189 
1190 protected:
1192  void Draw3DScene();
1194  void RenderShadowMap();
1196  void UseShadowMapping(bool enable);
1198  void UseMSAA(bool enable);
1200  void DrawObject(const EngineBaseObjDataTier& p4);
1202  void DrawInterface();
1203 
1205  void UpdateGroundSpotTextures();
1206 
1208  void DrawShadowSpots();
1210  void DrawBackground();
1212  void DrawBackgroundGradient(const Color& up, const Color& down);
1214  void DrawBackgroundImage();
1216  void DrawPlanet();
1218  void DrawForegroundImage();
1220  void DrawOverColor();
1222  void DrawHighlight();
1224  void DrawMouse();
1226  void DrawMouseSprite(Math::Point pos, Math::Point size, int icon);
1228  void DrawStats();
1230  void DrawTimer();
1231  void DrawCrashSpheres();
1232 
1234  EngineBaseObjTexTier& AddLevel2(EngineBaseObject& p1, const std::string& tex1Name, const std::string& tex2Name);
1237  const Material& material, int state);
1238 
1240  Texture CreateTexture(const std::string &texName, const TextureCreateParams &params, CImage* image = nullptr);
1241 
1243  bool IsVisible(int objRank);
1244 
1246  bool DetectBBox(int objRank, Math::Point mouse);
1247 
1249  bool GetBBox2D(int objRank, Math::Point& min, Math::Point& max);
1250 
1252  bool DetectTriangle(Math::Point mouse, VertexTex2* triangle, int objRank, float& dist);
1253 
1255 
1256  bool TransformPoint(Math::Vector& p2D, int objRank, Math::Vector p3D);
1257 
1259  void ComputeDistance();
1260 
1262  void UpdateGeometry();
1263 
1265  void UpdateStaticBuffer(EngineBaseObjDataTier& p4);
1266 
1268  void UpdateStaticBuffers();
1269 
1270  void AddBaseObjTriangles(int baseObjRank, const std::vector<VertexTex2>& vertices,
1271  const Material& material, int state,
1272  std::string tex1Name, std::string tex2Name);
1273 
1274  int GetEngineState(const ModelTriangle& triangle);
1275 
1277  {
1278  std::unique_ptr<CImage> img;
1279  std::string fileName;
1280  };
1281  static void WriteScreenShotThread(std::unique_ptr<WriteScreenShotData> data);
1282 
1284  void ReloadAllTextures();
1285 
1286 protected:
1287  CApplication* m_app;
1288  CSystemUtils* m_systemUtils;
1289  CSoundInterface* m_sound;
1290  CDevice* m_device;
1291  CTerrain* m_terrain;
1292  std::unique_ptr<COldModelManager> m_modelManager;
1293  std::unique_ptr<CText> m_text;
1294  std::unique_ptr<CLightManager> m_lightMan;
1295  std::unique_ptr<CParticle> m_particle;
1296  std::unique_ptr<CWater> m_water;
1297  std::unique_ptr<CCloud> m_cloud;
1298  std::unique_ptr<CLightning> m_lightning;
1299  std::unique_ptr<CPlanet> m_planet;
1300  std::unique_ptr<CPyroManager> m_pyroManager;
1301 
1303  std::string m_error;
1304 
1305  SystemTimeStamp* m_lastFrameTime;
1306  SystemTimeStamp* m_currentFrameTime;
1307  int m_fpsCounter;
1308  float m_fps;
1309 
1313  bool m_render;
1316 
1319 
1325  float m_focus;
1326 
1335 
1342 
1345 
1347  std::vector<EngineBaseObject> m_baseObjects;
1349  std::vector<EngineObject> m_objects;
1351  std::vector<EngineShadow> m_shadowSpots;
1353  std::vector<EngineGroundSpot> m_groundSpots;
1356 
1361  float m_eyeDirH;
1362  float m_eyeDirV;
1363  int m_rankView;
1364  Color m_ambientColor[2];
1365  Color m_backColor[2];
1366  Color m_fogColor[2];
1367  float m_deepView[2];
1368  float m_fogStart[2];
1369  Color m_waterAddColor;
1370  int m_statisticTriangle;
1371  Math::Vector m_statisticPos;
1372  bool m_updateGeometry;
1373  bool m_updateStaticBuffers;
1374  bool m_firstGroundSpot;
1375  std::string m_secondTex;
1376  bool m_backgroundFull;
1377  bool m_backgroundScale;
1378  std::string m_backgroundName;
1379  Texture m_backgroundTex;
1380  Color m_backgroundColorUp;
1381  Color m_backgroundColorDown;
1382  Color m_backgroundCloudUp;
1383  Color m_backgroundCloudDown;
1384  bool m_overFront;
1385  Color m_overColor;
1386  int m_overMode;
1387  std::string m_foregroundName;
1388  Texture m_foregroundTex;
1389  bool m_drawWorld;
1390  bool m_drawFront;
1391  float m_terrainVision;
1392  bool m_backForce;
1393  float m_tracePrecision;
1394 
1395  bool m_dirty;
1396  bool m_fog;
1397  float m_particleDensity;
1398  float m_clippingDistance;
1399  bool m_lightMode;
1400  bool m_editIndentMode;
1401  int m_editIndentValue;
1402 
1403  Texture m_shadowMap;
1404 
1406  int m_highlightRank[100];
1412  Math::Point m_highlightP1;
1414  Math::Point m_highlightP2;
1416 
1441 
1443  std::map<std::string, Texture> m_texNameMap;
1445  std::map<Texture, std::string> m_revTexNameMap;
1447 
1449  std::set<std::string> m_texBlacklist;
1450 
1459 
1465  std::string m_lastTexture[2];
1468 
1471 
1472  bool m_debugLights;
1473  bool m_debugDumpLights;
1474  bool m_debugCrashSpheres = false;
1475 
1476  std::string m_timerText;
1477 
1478  std::unordered_map<std::string, int> m_staticMeshBaseObjects;
1479 
1480  std::vector<Math::Sphere> m_displayCrashSpheres;
1481 
1483  bool m_pause = false;
1484 };
1485 
1486 
1487 } // namespace Gfx
bool m_highlight
Highlight visible?
Definition: engine.h:1408
std::string tex1Name
1st texture
Definition: engine.h:163
Edit (I-beam)
Definition: engine.h:451
Normal shadow.
Definition: engine.h:301
Resize horizontally.
Definition: engine.h:463
CSingleton base class for singletons.
Math::Matrix m_matProj
Projection matrix for 3D scene.
Definition: engine.h:1321
Light texture (ambient max)
Definition: engine.h:100
Small cross.
Definition: engine.h:455
Fixed.
Definition: engine.h:381
Busy.
Definition: engine.h:449
Material struct.
Math::Matrix m_matProjInterface
Projection matrix for 2D interface.
Definition: engine.h:1339
Terrain.
Definition: engine.h:176
Math::Point hotPoint
Hot point.
Definition: engine.h:502
Math::Vector pos
Position for the shadow.
Definition: engine.h:356
Scroll down.
Definition: engine.h:477
EngineRenderState mode2
Mode to render 2nd image in.
Definition: engine.h:500
int m_multisample
Number of samples for multisample rendering.
Definition: engine.h:1440
Vertex with secondary texture coordinates.
Definition: vertex.h:113
void LoadDefault()
Loads default values.
Definition: engine.h:288
Material m_lastMaterial
Last material.
Definition: engine.h:1467
float m_shadowRange
Shadow range.
Definition: engine.h:1438
std::vector< EngineBaseObjTexTier > next
Next tier (Tex)
Definition: engine.h:252
Object doesn&#39;t exist.
Definition: engine.h:174
Tier 2 of base object tree (textures)
Definition: engine.h:218
Texture using alpha channel.
Definition: engine.h:132
Crossed out sign.
Definition: engine.h:459
int m_textureMipmapLevel
Requested texture mipmap level.
Definition: engine.h:1422
Double-sided face.
Definition: engine.h:114
Math::Vector m_lookatPt
Camera target.
Definition: engine.h:1360
TextureCreateParams m_terrainTexParams
Create params for terrain textures.
Definition: engine.h:1420
Math::Vector drawPos
Position of the shadow drawn.
Definition: engine.h:360
float m_highlightTime
Time counter for highlight animation.
Definition: engine.h:1410
EngineObjectType
Class of graphics engine object.
Definition: engine.h:171
bool m_qualityShadows
true enables higher quality shadows
Definition: engine.h:1432
Definition: engine.h:1276
Number of items in enum.
Definition: engine.h:482
Point struct and related functions.
4x4 matrix
Definition: matrix.h:65
Larger crosshair.
Definition: engine.h:479
Math::Vector bboxMin
Bounding box min (origin 0,0,0 always included)
Definition: engine.h:246
Part 4.
Definition: engine.h:112
std::string m_error
Last encountered error.
Definition: engine.h:1303
TextureCreateParams m_defaultTexParams
Default texture create params.
Definition: engine.h:1418
Math::Matrix m_shadowBias
Texture bias for sampling shadow maps.
Definition: engine.h:1334
std::vector< EngineShadow > m_shadowSpots
Shadow list.
Definition: engine.h:1351
Always use 2nd floor texturing.
Definition: engine.h:118
bool m_renderInterface
Render / hide the UI?
Definition: engine.h:1315
Definition: singleton.h:30
Increase.
Definition: engine.h:379
Manager for static models.
Definition: oldmodelmanager.h:54
Fixed object type metal.
Definition: engine.h:186
Texture m_miceTexture
Texture with mouse cursors.
Definition: engine.h:1454
Math::Vector m_eyePt
Location of camera.
Definition: engine.h:1358
Texture struct and related enums.
EngineRenderState
Render state of graphics engine.
Definition: engine.h:85
Math::Point m_mouseSize
Size of mouse cursor.
Definition: engine.h:1456
int icon1
Index of texture element for 1st image.
Definition: engine.h:492
Normal opaque materials.
Definition: engine.h:88
std::set< std::string > m_texBlacklist
Blacklist map of textures.
Definition: engine.h:1449
Scroll to the left.
Definition: engine.h:471
Manager for dynamic lights in 3D scene.
Definition: lightman.h:146
bool m_render
Rendering enabled?
Definition: engine.h:1313
Material of a surface.
Definition: material.h:45
bool m_shadowMapping
true if shadow mapping enabled
Definition: engine.h:1426
Mode for rendering text.
Definition: engine.h:126
Resize vertically.
Definition: engine.h:465
A triangle drawn by the graphics engine.
Definition: engine.h:154
float m_shadowColor
Shadow color.
Definition: engine.h:1436
Fixed object.
Definition: engine.h:178
Color color
Color of the shadow.
Definition: engine.h:348
Math::Vector pos
Position of the shadow.
Definition: engine.h:321
Mesh data saved in model file.
Definition: model_mesh.h:35
Cloud layer renderer.
Definition: cloud.h:54
Lightning effect renderer.
Definition: lightning.h:55
Fixed object type quartz.
Definition: engine.h:184
float m_focus
Camera angle for 3D scene.
Definition: engine.h:1325
Particle engine.
Definition: particle.h:223
Math::Vector drawPos
Draw position for marks.
Definition: engine.h:407
Color m_lastColor
Last color set with render state.
Definition: engine.h:1463
The transparent texture (black = no)
Definition: engine.h:90
Type of shadow drawn by the graphics engine.
A spot (large shadow) drawn on the ground by the graphics engine.
Definition: engine.h:343
The transparent color (white = no)
Definition: engine.h:124
Math::Vector pos
Position for marks.
Definition: engine.h:401
Definition: pyro_manager.h:41
Color structs and related functions.
TODO: ?
Definition: engine.h:303
Decrease.
Definition: engine.h:383
Planet manager.
Definition: planet.h:49
Resize diagonally bottom-left to top-right.
Definition: engine.h:467
Scroll to the right.
Definition: engine.h:473
The transparent color (black = no)
Definition: engine.h:122
Part 2.
Definition: engine.h:108
Only opaque color, no texture, blending, etc.
Definition: engine.h:130
Parameters for texture creation.
Definition: texture.h:155
Material material
Material.
Definition: engine.h:159
std::string tex2Name
2nd texture
Definition: engine.h:165
Vertex structs.
Hand.
Definition: engine.h:453
Matrix struct and related functions.
int state
Render state.
Definition: engine.h:161
VertexTex2 triangle[3]
Triangle vertices.
Definition: engine.h:157
2D point
Definition: point.h:50
int icon2
Index of texture element for 2nd image.
Definition: engine.h:494
Image loaded from file.
Definition: image.h:54
bool m_offscreenShadowRendering
true enables offscreen shadow rendering
Definition: engine.h:1428
Main application.
Definition: app.h:180
Math::Matrix m_matViewInterface
View matrix for 2D interface.
Definition: engine.h:1341
Shadow drawn by the graphics engine.
Definition: engine.h:310
bool m_terrainShadows
true enables casting shadows by terrain
Definition: engine.h:1434
Math::Vector bboxMax
bounding box max (origin 0,0,0 always included)
Definition: engine.h:248
Null phase.
Definition: engine.h:377
EngineGroundMark m_groundMark
Ground mark.
Definition: engine.h:1355
Math::IntPoint m_size
Current size of viewport window.
Definition: engine.h:1344
Part 3.
Definition: engine.h:110
Terrain loader/generator and manager.
Definition: terrain.h:145
std::vector< EngineObject > m_objects
Object parameters.
Definition: engine.h:1349
Resize diagonally top-left to bottom-right.
Definition: engine.h:469
The transparent diffuse color.
Definition: engine.h:94
EngineMouseType
Type of mouse cursor displayed in-game.
Definition: engine.h:444
Namespace for (new) graphics code.
Definition: app.h:49
EngineRenderState mode1
Mode to render 1st image in.
Definition: engine.h:498
Vector struct and related functions.
The graphics engine.
Definition: engine.h:619
Normal cursor (arrow)
Definition: engine.h:447
Math::Matrix m_shadowViewMat
View matrix for rendering shadow maps.
Definition: engine.h:1330
Double white texturing.
Definition: engine.h:104
Object drawn by the graphics engine.
Definition: engine.h:264
Math::Matrix m_shadowTextureMat
Texture matrix for rendering shadow maps.
Definition: engine.h:1332
EngineMouseType m_mouseType
Type of mouse cursor.
Definition: engine.h:1458
EngineTriangleType
Type of triangles drawn for engine objects.
Definition: engine.h:142
Info about a texture.
Definition: texture.h:256
bool m_screenshotMode
Screenshot mode?
Definition: engine.h:1318
Math::Vector normal
Normal to the terrain.
Definition: engine.h:323
Math::Matrix m_shadowProjMat
Projection matrix for rendering shadow maps.
Definition: engine.h:1328
Math::Matrix m_matWorldInterface
World matrix for 2D interface.
Definition: engine.h:1337
int m_lastState
Last engine render state (-1 at the beginning of frame)
Definition: engine.h:1461
Information about mouse cursor.
Definition: engine.h:489
A single triangle in mesh as saved in model file.
Definition: model_triangle.h:60
Math::Matrix transform
Transformation matrix.
Definition: engine.h:279
bool m_interfaceMode
True when drawing 2D UI.
Definition: engine.h:1470
Moving object.
Definition: engine.h:180
Image using alpha channel.
Definition: engine.h:116
Water manager/renderer.
Definition: water.h:72
Only opaque texture, no blending, etc.
Definition: engine.h:128
TexFilter
General texture filtering mode.
Definition: texture.h:62
std::map< std::string, Texture > m_texNameMap
Map of loaded textures (by name)
Definition: engine.h:1443
Resize.
Definition: engine.h:461
EngineTextureMapping
Type of texture mapping.
Definition: engine.h:429
Text rendering engine.
Definition: text.h:233
3D (3x1) vector
Definition: vector.h:53
int iconShadow
Shadow texture part.
Definition: engine.h:496
Tier 3 of object tree (data)
Definition: engine.h:194
Math::Matrix m_matView
View matrix for 3D scene.
Definition: engine.h:1323
Platform-specific utils.
Definition: system.h:91
std::vector< EngineGroundSpot > m_groundSpots
Ground spot list.
Definition: engine.h:1353
Definition: system_linux.h:31
Part of a moving object.
Definition: engine.h:182
Surfaces.
Definition: engine.h:147
A mark on ground drawn by the graphics engine.
Definition: engine.h:390
2D Point with integer coords
Definition: intpoint.h:39
Color with transparency.
Definition: engine.h:134
std::map< Texture, std::string > m_revTexNameMap
Reverse map of loaded textures (by texture)
Definition: engine.h:1445
RGBA color.
Definition: color.h:39
Triangles.
Definition: engine.h:145
bool m_showStats
Whether to show stats (FPS, etc)
Definition: engine.h:1311
std::vector< EngineBaseObject > m_baseObjects
Base objects (also level 1 tier list)
Definition: engine.h:1347
Scroll up.
Definition: engine.h:475
Shadow spot data as saved in model file.
Definition: model_shadow_spot.h:29
Event sent by system, interface or game.
Definition: event.h:699
IntPoint struct.
int m_textureAnisotropy
Requested texture anisotropy level.
Definition: engine.h:1424
Texture borders with solid color.
Definition: engine.h:98
The transparent texture (white = no)
Definition: engine.h:92
TODO: ?
Definition: engine.h:457
EngineGroundMarkPhase
Phase of life of an EngineGroundMark.
Definition: engine.h:374
Sound plugin interface.
Definition: sound.h:60
Causes the fog.
Definition: engine.h:120
Part 1 (no change in. MOD!)
Definition: engine.h:106
Abstract interface of graphics device.
Definition: device.h:323
Double black texturing.
Definition: engine.h:102
Texture wrap.
Definition: engine.h:96
Definition: engine.h:239
int m_offscreenShadowRenderingResolution
Offscreen shadow rendering resolution.
Definition: engine.h:1430