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-2015, 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/vector.h"
38 
39 
40 #include <string>
41 #include <vector>
42 #include <map>
43 #include <set>
44 #include <memory>
45 #include <unordered_map>
46 
47 
48 class CApplication;
49 class CObject;
50 class CSoundInterface;
51 class CImage;
52 class CPauseManager;
53 class CSystemUtils;
54 struct SystemTimeStamp;
55 struct Event;
56 
57 
58 // Graphics module namespace
59 namespace Gfx
60 {
61 
62 
63 class CDevice;
64 class COldModelManager;
65 class CLightManager;
66 class CText;
67 class CParticle;
68 class CWater;
69 class CCloud;
70 class CLightning;
71 class CPlanet;
72 class CTerrain;
73 class CPyroManager;
74 class CModelMesh;
75 struct ModelShadowSpot;
76 struct ModelTriangle;
77 
78 
87 {
97  ENG_RSTATE_WRAP = (1<<3),
99  ENG_RSTATE_CLAMP = (1<<4),
111  ENG_RSTATE_PART3 = (1<<10),
113  ENG_RSTATE_PART4 = (1<<11),
115  ENG_RSTATE_2FACE = (1<<12),
117  ENG_RSTATE_ALPHA = (1<<13),
119  ENG_RSTATE_SECOND = (1<<14),
121  ENG_RSTATE_FOG = (1<<15),
127  ENG_RSTATE_TEXT = (1<<18),
136 };
137 
138 
144 {
149 };
150 
156 {
164  std::string tex1Name;
166  std::string tex2Name;
167 };
168 
173 {
188 };
189 
190 
196 {
197  EngineTriangleType type;
198  Material material;
199  int state;
200  std::vector<VertexTex2> vertices;
201  unsigned int staticBufferId;
202  bool updateStaticBuffer;
203 
205  const Material& material = Material(),
206  int state = ENG_RSTATE_NORMAL)
207  : type(type)
208  , material(material)
209  , state(state)
210  , staticBufferId(0)
211  , updateStaticBuffer(false)
212  {}
213 };
214 
220 {
221  std::string tex1Name;
222  Texture tex1;
223  std::string tex2Name;
224  Texture tex2;
225  std::vector<EngineBaseObjDataTier> next;
226 
227  inline EngineBaseObjTexTier(const std::string& tex1Name = "",
228  const std::string& tex2Name = "")
229  : tex1Name(tex1Name)
230  , tex2Name(tex2Name)
231  {}
232 };
233 
241 {
243  bool used = false;
245  int totalTriangles = 0;
251  float radius = 0.0f;
253  std::vector<EngineBaseObjTexTier> next;
254 
255  inline void LoadDefault()
256  {
257  *this = EngineBaseObject();
258  }
259 };
260 
266 {
268  bool used = false;
270  int baseObjRank = -1;
272  bool visible = false;
274  bool drawWorld = false;
276  bool drawFront = false;
282  float distance = 0.0f;
284  int shadowRank = -1;
286  float transparency = 0.0f;
287 
289  inline void LoadDefault()
290  {
291  *this = EngineObject();
292  }
293 };
294 
300 {
305 };
306 
312 {
314  bool used = false;
316  bool hide = false;
318  int objRank = -1;
326  float angle = 0.0f;
328  float radius = 0.0f;
330  float intensity = 0.0f;
332  float height = 0.0f;
333 
334  void LoadDefault()
335  {
336  *this = EngineShadow();
337  }
338 };
339 
345 {
347  bool used = false;
351  float min = 0.0f;
353  float max = 0.0f;
355  float smooth = 0.0f;
359  float radius = 0.0f;
363  float drawRadius = 0.0f;
364 
365  void LoadDefault()
366  {
367  *this = EngineGroundSpot();
368  }
369 };
370 
376 {
385 };
386 
392 {
394  bool draw = false;
398  float delay[3] = {};
400  float fix = 0.0f;
404  float radius = 0.0f;
406  float intensity = 0.0f;
410  float drawRadius = 0.0f;
412  float drawIntensity = 0.0f;
414  int dx = 0;
416  int dy = 0;
418  char* table = nullptr;
419 
420  void LoadDefault()
421  {
422  *this = EngineGroundMark();
423  }
424 };
425 
431 {
432  ENG_TEX_MAPPING_X = 1,
433  ENG_TEX_MAPPING_Y = 2,
434  ENG_TEX_MAPPING_Z = 3,
435  ENG_TEX_MAPPING_1X = 4,
436  ENG_TEX_MAPPING_1Y = 5,
437  ENG_TEX_MAPPING_1Z = 6
438 };
439 
440 
446 {
481 
484 };
485 
491 {
493  int icon1;
495  int icon2;
504 
505  EngineMouse(int icon1 = -1,
506  int icon2 = -1,
507  int iconShadow = -1,
510  Math::Point hotPoint = Math::Point())
511  : icon1(icon1)
512  , icon2(icon2)
513  , iconShadow(iconShadow)
514  , mode1(mode1)
515  , mode2(mode2)
516  , hotPoint(hotPoint)
517  {}
518 };
519 
520 
620 class CEngine : public CSingleton<CEngine>
621 {
622 public:
623  CEngine(CApplication* app, CSystemUtils* systemUtils);
624  ~CEngine();
625 
627  void SetDevice(CDevice* device);
629  CDevice* GetDevice();
630 
632  CText* GetText();
633  COldModelManager* GetModelManager();
634  CPyroManager* GetPyroManager();
640  CTerrain* GetTerrain();
642  CWater* GetWater();
646  CPlanet* GetPlanet();
648  CCloud* GetCloud();
651 
653  void SetTerrain(CTerrain* terrain);
654 
655 
657  bool Create();
659  void Destroy();
660 
663 
664 
666  void Render();
667 
668 
670  bool ProcessEvent(const Event& event);
671 
673  void FrameUpdate();
674 
675 
677  void WriteScreenShot(const std::string& fileName);
678 
679 
681  TEST_VIRTUAL 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 
703 
705 
709  Math::IntPoint InterfaceToWindowCoords(Math::Point pos);
711 
713 
716  Math::IntPoint InterfaceToWindowSize(Math::Point size);
718 
720  void AddStatisticTriangle(int nb);
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 rank);
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& name);
947  void DeleteTexture(const Texture& tex);
948 
950  void FlushTextureCache();
951 
953  void SetTerrainVision(float vision);
954 
956 
960  void SetFocus(float focus);
961  float GetFocus();
963 
965  // NOTE: This is an user configuration setting
967  void SetDirty(bool mode);
968  bool GetDirty();
970 
972  // NOTE: This is an user configuration setting
974  void SetFog(bool mode);
975  bool GetFog();
977 
979  void SetSecondTexture(const std::string& texNum);
981  const std::string& GetSecondTexture();
983 
985  void SetRankView(int rank);
987  int GetRankView();
989 
991  void SetDrawWorld(bool draw);
992 
994  void SetDrawFront(bool draw);
995 
997  void SetAmbientColor(const Color& color, int rank = 0);
999  Color GetAmbientColor(int rank = 0);
1001 
1003  void SetWaterAddColor(const Color& color);
1005  Color GetWaterAddColor();
1007 
1009  void SetFogColor(const Color& color, int rank = 0);
1011  Color GetFogColor(int rank = 0);
1013 
1015 
1018  void SetDeepView(float length, int rank = 0, bool ref=false);
1019  float GetDeepView(int rank = 0);
1021 
1022 
1024 
1027  void SetFogStart(float start, int rank = 0);
1028  float GetFogStart(int rank = 0);
1030 
1032  void SetBackground(const std::string& name, Color up = Color(), Color down = Color(),
1034  Color cloudUp = Color(), Color cloudDown = Color(),
1035  bool full = false, bool scale = false);
1036  void GetBackground(std::string& name, Color& up, Color& down,
1037  Color& cloudUp, Color& cloudDown,
1038  bool& full, bool& scale);
1040 
1042  void SetForegroundName(const std::string& name);
1044  void SetOverFront(bool front);
1046  void SetOverColor(const Color& color = Color(), int mode = ENG_RSTATE_TCOLOR_BLACK);
1047 
1049  // NOTE: This is an user configuration setting
1051  void SetParticleDensity(float value);
1052  float GetParticleDensity();
1054 
1056  float ParticleAdapt(float factor);
1057 
1059  // NOTE: This is an user configuration setting
1061  void SetClippingDistance(float value);
1062  float GetClippingDistance();
1064 
1066  // NOTE: This is an user configuration setting
1068  void SetTextureFilterMode(TexFilter value);
1069  TexFilter GetTextureFilterMode();
1071 
1073  // NOTE: This is an user configuration setting
1075  void SetTextureMipmapLevel(int value);
1076  int GetTextureMipmapLevel();
1078 
1080  // NOTE: This is an user configuration setting
1082  void SetTextureAnisotropyLevel(int value);
1083  int GetTextureAnisotropyLevel();
1085 
1087  // NOTE: These are user configuration settings
1089  bool IsShadowMappingSupported();
1090  void SetShadowMapping(bool value);
1091  bool GetShadowMapping();
1092  void SetShadowMappingOffscreen(bool value);
1093  bool GetShadowMappingOffscreen();
1094  void SetShadowMappingOffscreenResolution(int resolution);
1095  int GetShadowMappingOffscreenResolution();
1096  bool IsShadowMappingQualitySupported();
1097  void SetShadowMappingQuality(bool value);
1098  bool GetShadowMappingQuality();
1100 
1102  // NOTE: This is a setting configurable only in INI file
1104  void SetShadowColor(float value);
1105  float GetShadowColor();
1107 
1109  // NOTE: This is a setting configurable only in INI file
1111  void SetShadowRange(float value);
1112  float GetShadowRange();
1114 
1116  // NOTE: This is an user configuration setting
1118  void SetMultiSample(int value);
1119  int GetMultiSample();
1121 
1123  void SetBackForce(bool present);
1125  bool GetBackForce();
1127 
1129  // NOTE: This is an user configuration setting
1131  void SetLightMode(bool present);
1132  bool GetLightMode();
1134 
1136  // NOTE: This is an user configuration setting
1138  // TODO: Move to CSettings
1139  void SetEditIndentMode(bool autoIndent);
1140  bool GetEditIndentMode();
1142 
1144  // NOTE: This is an user configuration setting
1146  // TODO: Move to CSettings
1147  void SetEditIndentValue(int value);
1148  int GetEditIndentValue();
1150 
1152  void SetTracePrecision(float factor);
1154  float GetTracePrecision();
1156 
1158  void SetMouseType(EngineMouseType type);
1160  EngineMouseType GetMouseType();
1162 
1164  const Math::Matrix& GetMatView();
1166  TEST_VIRTUAL Math::Vector GetEyePt();
1168  TEST_VIRTUAL Math::Vector GetLookatPt();
1170  float GetEyeDirH();
1172  float GetEyeDirV();
1174  bool IsVisiblePoint(const Math::Vector& pos);
1175 
1177  void UpdateMatProj();
1178 
1180  void ApplyChange();
1181 
1182 protected:
1184  void Draw3DScene();
1186  void RenderShadowMap();
1188  void UseShadowMapping(bool enable);
1190  void UseMSAA(bool enable);
1192  void DrawObject(const EngineBaseObjDataTier& p4);
1194  void DrawInterface();
1195 
1197  void UpdateGroundSpotTextures();
1198 
1200  void DrawShadowSpots();
1202  void DrawBackground();
1204  void DrawBackgroundGradient(const Color& up, const Color& down);
1206  void DrawBackgroundImage();
1208  void DrawPlanet();
1210  void DrawForegroundImage();
1212  void DrawOverColor();
1214  void DrawHighlight();
1216  void DrawMouse();
1218  void DrawMouseSprite(Math::Point pos, Math::Point dim, int icon);
1220  void DrawStats();
1222  void DrawTimer();
1223 
1225  EngineBaseObjTexTier& AddLevel2(EngineBaseObject& p1, const std::string& tex1Name, const std::string& tex2Name);
1228  const Material& mat, int state);
1229 
1231  Texture CreateTexture(const std::string &texName, const TextureCreateParams &params, CImage* image = nullptr);
1232 
1234  bool IsVisible(int objRank);
1235 
1237  bool DetectBBox(int objRank, Math::Point mouse);
1238 
1240  bool GetBBox2D(int objRank, Math::Point& min, Math::Point& max);
1241 
1243  bool DetectTriangle(Math::Point mouse, VertexTex2* triangle, int objRank, float& dist);
1244 
1246 
1247  bool TransformPoint(Math::Vector& p2D, int objRank, Math::Vector p3D);
1248 
1250  void ComputeDistance();
1251 
1253  void UpdateGeometry();
1254 
1257 
1259  void UpdateStaticBuffers();
1260 
1261  void AddBaseObjTriangles(int baseObjRank, const std::vector<VertexTex2>& vertices,
1262  const Material& material, int state,
1263  std::string tex1Name, std::string tex2Name);
1264 
1265  int GetEngineState(const ModelTriangle& triangle);
1266 
1268  {
1269  std::unique_ptr<CImage> img;
1270  std::string fileName;
1271  };
1272  static void WriteScreenShotThread(std::unique_ptr<WriteScreenShotData> data);
1273 
1274 protected:
1275  CApplication* m_app;
1276  CSystemUtils* m_systemUtils;
1277  CSoundInterface* m_sound;
1278  CDevice* m_device;
1279  CTerrain* m_terrain;
1280  std::unique_ptr<COldModelManager> m_modelManager;
1281  std::unique_ptr<CText> m_text;
1282  std::unique_ptr<CLightManager> m_lightMan;
1283  std::unique_ptr<CParticle> m_particle;
1284  std::unique_ptr<CWater> m_water;
1285  std::unique_ptr<CCloud> m_cloud;
1286  std::unique_ptr<CLightning> m_lightning;
1287  std::unique_ptr<CPlanet> m_planet;
1288  std::unique_ptr<CPauseManager> m_pause;
1289  std::unique_ptr<CPyroManager> m_pyroManager;
1290 
1292  std::string m_error;
1293 
1294  SystemTimeStamp* m_lastFrameTime;
1295  SystemTimeStamp* m_currentFrameTime;
1296  int m_fpsCounter;
1297  float m_fps;
1298 
1302  bool m_render;
1305 
1308 
1314  float m_focus;
1315 
1324 
1331 
1334 
1336  std::vector<EngineBaseObject> m_baseObjects;
1338  std::vector<EngineObject> m_objects;
1340  std::vector<EngineShadow> m_shadowSpots;
1342  std::vector<EngineGroundSpot> m_groundSpots;
1345 
1350  float m_eyeDirH;
1351  float m_eyeDirV;
1352  int m_rankView;
1353  Color m_ambientColor[2];
1354  Color m_backColor[2];
1355  Color m_fogColor[2];
1356  float m_deepView[2];
1357  float m_fogStart[2];
1358  Color m_waterAddColor;
1359  int m_statisticTriangle;
1360  Math::Vector m_statisticPos;
1361  bool m_updateGeometry;
1362  bool m_updateStaticBuffers;
1363  bool m_firstGroundSpot;
1364  std::string m_secondTex;
1365  bool m_backgroundFull;
1366  bool m_backgroundScale;
1367  std::string m_backgroundName;
1368  Texture m_backgroundTex;
1369  Color m_backgroundColorUp;
1370  Color m_backgroundColorDown;
1371  Color m_backgroundCloudUp;
1372  Color m_backgroundCloudDown;
1373  bool m_overFront;
1374  Color m_overColor;
1375  int m_overMode;
1376  std::string m_foregroundName;
1377  Texture m_foregroundTex;
1378  bool m_drawWorld;
1379  bool m_drawFront;
1380  float m_terrainVision;
1381  bool m_backForce;
1382  float m_tracePrecision;
1383 
1384  bool m_dirty;
1385  bool m_fog;
1386  float m_particleDensity;
1387  float m_clippingDistance;
1388  float m_lastClippingDistance;
1389  bool m_lightMode;
1390  bool m_editIndentMode;
1391  int m_editIndentValue;
1392 
1393  Texture m_shadowMap;
1394 
1404  Math::Point m_highlightP2;
1406 
1429 
1431  std::map<std::string, Texture> m_texNameMap;
1433  std::map<Texture, std::string> m_revTexNameMap;
1435 
1437  std::set<std::string> m_texBlacklist;
1438 
1447 
1453  std::string m_lastTexture[2];
1456 
1459 
1460  bool m_debugLights;
1461  bool m_debugDumpLights;
1462 
1463  std::string m_timerText;
1464 
1465  std::unordered_map<std::string, int> m_staticMeshBaseObjects;
1466 };
1467 
1468 
1469 } // namespace Gfx
bool m_highlight
Highlight visible?
Definition: engine.h:1398
int DetectObject(Math::Point mouse)
Detects the target object that is selected with the mouse.
Definition: engine.cpp:1788
void SetFog(bool mode)
Management of the global mode of horizontal fog patches.
Definition: engine.cpp:2675
std::string tex1Name
1st texture
Definition: engine.h:164
CPauseManager * GetPauseManager()
Returns the pause manager.
Definition: engine.cpp:274
void GetObjectBBox(int objRank, Math::Vector &min, Math::Vector &max)
Returns the bounding box for an object.
Definition: engine.cpp:990
Edit (I-beam)
Definition: engine.h:452
EngineMouse m_mice[ENG_MOUSE_COUNT]
Mouse cursor definitions.
Definition: engine.h:1440
Normal shadow.
Definition: engine.h:302
void SetTimerDisplay(const std::string &text)
Sets text to display as mission timer.
Definition: engine.cpp:605
float drawIntensity
Draw intensity for marks.
Definition: engine.h:412
float intensity
Color intensity.
Definition: engine.h:406
void SetTextureAnisotropyLevel(int value)
Management the anisotropy level for textures.
Definition: engine.cpp:2901
bool GetHighlight(Math::Point &p1, Math::Point &p2)
Returns the highlighted rectangle.
Definition: engine.cpp:1459
bool used
If true, ground spot is valid.
Definition: engine.h:347
void AddStatisticTriangle(int nb)
Increments the triangle counter for the current frame.
Definition: engine.cpp:590
Resize horizontally.
Definition: engine.h:464
void DrawShadowSpots()
Draws old-style shadow spots.
Definition: engine.cpp:4203
CSingleton base class for singletons.
void SetTextureMipmapLevel(int value)
Management the mipmap level for textures.
Definition: engine.cpp:2886
Math::Matrix m_matProj
Projection matrix for 3D scene.
Definition: engine.h:1310
bool SetTexture(const std::string &name, int stage=0)
Sets texture for given stage; if not present in cache, the texture is loaded.
Definition: engine.cpp:2583
Light texture (ambient max)
Definition: engine.h:101
void SetBackForce(bool present)
Management the mode of background.
Definition: engine.cpp:2992
bool IsShadowMappingSupported()
Management of shadow mapping.
Definition: engine.cpp:2917
float transparency
Transparency of the object [0, 1].
Definition: engine.h:286
float delay[3]
Times for 3 life phases.
Definition: engine.h:398
Small cross.
Definition: engine.h:456
Fixed.
Definition: engine.h:382
float ParticleAdapt(float factor)
Adapts particle factor according to particle density.
Definition: engine.cpp:2851
Busy.
Definition: engine.h:450
void ChangeSecondTexture(int objRank, const std::string &tex2Name)
Changes the 2nd texure for given object.
Definition: engine.cpp:1135
void SetRankView(int rank)
Management of view mode.
Definition: engine.cpp:2695
EngineObjectType type
Type of object.
Definition: engine.h:278
Material struct.
Math::Point WindowToInterfaceCoords(Math::IntPoint pos)
Conversion functions between window and interface coordinates.
Definition: engine.cpp:566
Math::Matrix m_matProjInterface
Projection matrix for 2D interface.
Definition: engine.h:1328
void SetStaticMeshTransparency(int meshHandle, float value)
Sets transparency for static mesh.
Definition: engine.cpp:5103
Terrain.
Definition: engine.h:177
int AddStaticMesh(const std::string &key, const Gfx::CModelMesh *mesh, const Math::Matrix &worldMatrix)
Add new instance of static mesh.
Definition: engine.cpp:5052
int totalTriangles
Number of triangles.
Definition: engine.h:245
void DeleteObject(int objRank)
Deletes the given object.
Definition: engine.cpp:915
Math::Point hotPoint
Hot point.
Definition: engine.h:503
Math::Vector pos
Position for the shadow.
Definition: engine.h:357
Scroll down.
Definition: engine.h:478
EngineRenderState mode2
Mode to render 2nd image in.
Definition: engine.h:501
void DeleteBaseObject(int baseObjRank)
Deletes a base object.
Definition: engine.cpp:664
void SetObjectType(int objRank, EngineObjectType type)
Management of engine object type.
Definition: engine.cpp:940
EngineBaseObjDataTier & AddLevel3(EngineBaseObjTexTier &p3, EngineTriangleType type, const Material &mat, int state)
Creates a new tier 3 object (data)
Definition: engine.cpp:628
int m_multisample
Number of samples for multisample rendering.
Definition: engine.h:1428
Vertex with secondary texture coordinates.
Definition: vertex.h:113
void LoadDefault()
Loads default values.
Definition: engine.h:289
void SetObjectShadowSpotHide(int objRank, bool hide)
Management of different shadow params.
Definition: engine.cpp:1368
void TrackTextureMapping(int objRank, const Material &mat, int state, const std::string &tex1Name, const std::string &tex2Name, EngineTextureMapping mode, float pos, float factor, float tl, float ts, float tt)
Changes texture mapping for robot tracks.
Definition: engine.cpp:1227
Material m_lastMaterial
Last material.
Definition: engine.h:1455
float m_shadowRange
Shadow range.
Definition: engine.h:1426
std::vector< EngineBaseObjTexTier > next
Next tier (Tex)
Definition: engine.h:253
Object doesn't exist.
Definition: engine.h:175
void SetObjectTransparency(int objRank, float value)
Sets the transparency level for given object.
Definition: engine.cpp:983
Tier 2 of base object tree (textures)
Definition: engine.h:219
Texture using alpha channel.
Definition: engine.h:133
void DrawHighlight()
Draws the rectangle of the object highlighted.
Definition: engine.cpp:4623
void CopyBaseObject(int sourceBaseObjRank, int destBaseObjRank)
Copies geometry between two base objects.
Definition: engine.cpp:714
void DrawBackground()
Draws the gradient background.
Definition: engine.cpp:4404
void SetObjectGroundSpotPos(int rank, const Math::Vector &pos)
Management of different ground spot params.
Definition: engine.cpp:1574
Crossed out sign.
Definition: engine.h:460
int m_textureMipmapLevel
Requested texture mipmap level.
Definition: engine.h:1412
void SetTracePrecision(float factor)
Management of precision of robot tracks.
Definition: engine.cpp:3032
bool used
If true, shadow is valid.
Definition: engine.h:314
Double-sided face.
Definition: engine.h:115
Math::Vector m_lookatPt
Camera target.
Definition: engine.h:1349
TextureCreateParams m_terrainTexParams
Create params for terrain textures.
Definition: engine.h:1410
Math::Vector drawPos
Position of the shadow drawn.
Definition: engine.h:361
float m_highlightTime
Time counter for highlight animation.
Definition: engine.h:1400
void SetParticleDensity(float value)
Management of the particle density.
Definition: engine.cpp:2839
EngineObjectType
Class of graphics engine object.
Definition: engine.h:172
bool m_qualityShadows
true enables higher quality shadows
Definition: engine.h:1422
void SetScreenshotMode(bool screenshotMode)
Management of "screenshot mode" (disables interface particle rendering)
Definition: engine.cpp:551
Definition: engine.h:1267
float radius
Radius of marks.
Definition: engine.h:404
Number of items in enum.
Definition: engine.h:483
void CreateShadowSpot(int objRank)
Creates a shadow for the given object.
Definition: engine.cpp:1324
void DrawMouse()
Draws the mouse cursor.
Definition: engine.cpp:4714
int m_highlightRank[100]
Ranks of highlighted objects.
Definition: engine.h:1396
Point struct and related functions.
4x4 matrix
Definition: matrix.h:65
bool ChangeTextureColor(const std::string &texName, const std::string &srcName, Color colorRef1, Color colorNew1, Color colorRef2, Color colorNew2, float tolerance1, float tolerance2, Math::Point ts, Math::Point ti, Math::Point *exclude=nullptr, float shift=0.0f, bool hsv=false)
Changes colors in a texture.
Definition: engine.cpp:2397
void DrawOverColor()
Draws the foreground color.
Definition: engine.cpp:4589
void DeleteAllGroundSpots()
Deletes all ground spots.
Definition: engine.cpp:1523
Larger crosshair.
Definition: engine.h:480
void SetRenderEnable(bool enable)
Enables/disables rendering.
Definition: engine.cpp:536
void DrawMouseSprite(Math::Point pos, Math::Point dim, int icon)
Draw part of mouse cursor sprite.
Definition: engine.cpp:4747
Math::Vector bboxMin
Bounding box min (origin 0,0,0 always included)
Definition: engine.h:247
Part 4.
Definition: engine.h:113
std::string m_error
Last encountered error.
Definition: engine.h:1292
void SetState(int state, const Color &color=Color(1.0f, 1.0f, 1.0f, 1.0f))
Sets the current rendering state.
Definition: engine.cpp:1955
TextureCreateParams m_defaultTexParams
Default texture create params.
Definition: engine.h:1408
float min
Min altitude.
Definition: engine.h:351
int shadowRank
Rank of the associated shadow.
Definition: engine.h:284
std::string m_lastTexture[2]
Last texture names for 2 used texture stages.
Definition: engine.h:1453
void DrawInterface()
Draws the user interface over the scene.
Definition: engine.cpp:3814
int GetStatisticTriangle()
Returns the number of triangles in current frame.
Definition: engine.cpp:595
float GetEyeDirV()
Returns the vertical direction angle of view.
Definition: engine.cpp:3072
Math::Matrix m_shadowBias
Texture bias for sampling shadow maps.
Definition: engine.h:1323
TEST_VIRTUAL bool GetPause()
Get pause mode.
Definition: engine.cpp:521
std::vector< EngineShadow > m_shadowSpots
Shadow list.
Definition: engine.h:1340
Texture LoadTexture(const std::string &name)
Loads texture, creating it if not already present.
Definition: engine.cpp:2271
Always use 2nd floor texturing.
Definition: engine.h:119
bool m_renderInterface
Render / hide the UI?
Definition: engine.h:1304
float max
Max altitude.
Definition: engine.h:353
void SetFogStart(float start, int rank=0)
Management the start of fog.
Definition: engine.cpp:2767
Definition: singleton.h:30
Increase.
Definition: engine.h:380
Manager for static models.
Definition: oldmodelmanager.h:55
Fixed object type metal.
Definition: engine.h:187
int CreateGroundSpot()
Creates a new ground spot and returns its rank.
Definition: engine.cpp:1546
void AddBaseObjQuick(int baseObjRank, const EngineBaseObjDataTier &buffer, std::string tex1Name, std::string tex2Name, bool globalUpdate)
Adds a tier 4 engine object directly.
Definition: engine.cpp:768
Texture m_miceTexture
Texture with mouse cursors.
Definition: engine.h:1442
Math::Vector m_eyePt
Location of camera.
Definition: engine.h:1347
Texture struct and related enums.
EngineRenderState
Render state of graphics engine.
Definition: engine.h:86
Math::Point m_mouseSize
Size of mouse cursor.
Definition: engine.h:1444
int icon1
Index of texture element for 1st image.
Definition: engine.h:493
Normal opaque materials.
Definition: engine.h:89
std::set< std::string > m_texBlacklist
Blacklist map of textures.
Definition: engine.h:1437
void SetLightMode(bool present)
Managing the mode of dynamic lights.
Definition: engine.cpp:3002
TEST_VIRTUAL Math::Vector GetLookatPt()
Returns the camera target point.
Definition: engine.cpp:3062
float radius
Radius of the shadow.
Definition: engine.h:359
void ApplyChange()
Updates the scene after a change of parameters.
Definition: engine.cpp:3087
const Math::Matrix & GetMatView()
Returns the view matrix.
Definition: engine.cpp:3052
bool LoadAllTextures()
Loads all necessary textures.
Definition: engine.cpp:2294
Scroll to the left.
Definition: engine.h:472
void SetFogColor(const Color &color, int rank=0)
Management of the fog color.
Definition: engine.cpp:2744
Manager for dynamic lights in 3D scene.
Definition: lightman.h:146
bool DetectTriangle(Math::Point mouse, VertexTex2 *triangle, int objRank, float &dist)
Detects whether the mouse is in a triangle.
Definition: engine.cpp:1853
bool m_render
Rendering enabled?
Definition: engine.h:1302
float height
Height from the ground.
Definition: engine.h:332
Material of a surface.
Definition: material.h:45
void SetViewParams(const Math::Vector &eyePt, const Math::Vector &lookatPt, const Math::Vector &upVec, float eyeDistance)
Specifies the location and direction of view.
Definition: engine.cpp:2215
bool m_shadowMapping
true if shadow mapping enabled
Definition: engine.h:1416
Mode for rendering text.
Definition: engine.h:127
float drawRadius
Radius of the shadow drawn.
Definition: engine.h:363
Resize vertically.
Definition: engine.h:466
void RenderShadowMap()
Renders shadow map.
Definition: engine.cpp:3405
A triangle drawn by the graphics engine.
Definition: engine.h:155
bool Create()
Performs the initialization; must be called after device was set.
Definition: engine.cpp:284
bool DetectBBox(int objRank, Math::Point mouse)
Detects whether an object is affected by the mouse.
Definition: engine.cpp:1743
float m_shadowColor
Shadow color.
Definition: engine.h:1424
Fixed object.
Definition: engine.h:179
void AddStaticMeshShadowSpot(int meshHandle, const Gfx::ModelShadowSpot &shadowSpot)
Adds a shadow spot to mesh.
Definition: engine.cpp:5076
bool drawFront
If true, the shape is before the 2D interface.
Definition: engine.h:276
Color color
Color of the shadow.
Definition: engine.h:349
void SetOverFront(bool front)
Specifies whether to draw the foreground.
Definition: engine.cpp:2828
CLightning * GetLightning()
Returns the lighting manager.
Definition: engine.cpp:259
Math::Vector pos
Position of the shadow.
Definition: engine.h:322
EngineGroundMarkPhase phase
Phase of life.
Definition: engine.h:396
Mesh data saved in model file.
Definition: model_mesh.h:37
void SetTerrainVision(float vision)
Defines of the distance field of vision.
Definition: engine.cpp:2614
Cloud layer renderer.
Definition: cloud.h:54
void DeleteAllBaseObjects()
Deletes all base objects.
Definition: engine.cpp:690
Lightning effect renderer.
Definition: lightning.h:55
Fixed object type quartz.
Definition: engine.h:185
float m_focus
Camera angle for 3D scene.
Definition: engine.h:1314
void SetMouseType(EngineMouseType type)
Management of mouse cursor type.
Definition: engine.cpp:3042
Particle engine.
Definition: particle.h:223
Math::Vector drawPos
Draw position for marks.
Definition: engine.h:408
float radius
Radius of the sphere at the origin.
Definition: engine.h:251
Color m_lastColor
Last color set with render state.
Definition: engine.h:1451
void SetShadowColor(float value)
Management of shadow color.
Definition: engine.cpp:2633
void ResetAfterDeviceChanged()
Resets some states and flushes textures after device was changed (e.g. resoulution changed) ...
Definition: engine.cpp:365
void FrameUpdate()
Called once per frame, the call is the entry point for animating the scene.
Definition: engine.cpp:445
The transparent texture (black = no)
Definition: engine.h:91
Type of shadow drawn by the graphics engine.
Math::Point WindowToInterfaceSize(Math::IntPoint size)
Conversion functions between window and interface sizes.
Definition: engine.cpp:578
A spot (large shadow) drawn on the ground by the graphics engine.
Definition: engine.h:344
void DeleteStaticMesh(int meshHandle)
Removes given static mesh.
Definition: engine.cpp:5089
The transparent color (white = no)
Definition: engine.h:125
Math::Vector pos
Position for marks.
Definition: engine.h:402
Definition: pyro_manager.h:41
Color structs and related functions.
float fix
Fixed time.
Definition: engine.h:400
TODO: ?
Definition: engine.h:304
Decrease.
Definition: engine.h:384
Planet manager.
Definition: planet.h:49
bool TransformPoint(Math::Vector &p2D, int objRank, Math::Vector p3D)
Transforms a 3D point (x, y, z) in 2D space (x, y, -) of the window.
Definition: engine.cpp:1927
Resize diagonally bottom-left to top-right.
Definition: engine.h:468
Scroll to the right.
Definition: engine.h:474
void SetShadowRange(float value)
Management of shadow range.
Definition: engine.cpp:2643
void SetAmbientColor(const Color &color, int rank=0)
Ambient color management.
Definition: engine.cpp:2724
The transparent color (black = no)
Definition: engine.h:123
void Destroy()
Frees all resources before exit.
Definition: engine.cpp:341
float angle
Angle of the shadow.
Definition: engine.h:326
Part 2.
Definition: engine.h:109
Only opaque color, no texture, blending, etc.
Definition: engine.h:131
Parameters for texture creation.
Definition: texture.h:155
void SetDeepView(float length, int rank=0, bool ref=false)
Management of the depth of field.
Definition: engine.cpp:2754
void Draw3DScene()
Prepares the interface for 3D scene.
Definition: engine.cpp:3166
Material material
Material.
Definition: engine.h:160
std::string tex2Name
2nd texture
Definition: engine.h:166
Vertex structs.
void SetWaterAddColor(const Color &color)
Color management under water.
Definition: engine.cpp:2734
Hand.
Definition: engine.h:454
Matrix struct and related functions.
int state
Render state.
Definition: engine.h:162
void SetMaterial(const Material &mat)
Sets the current material.
Definition: engine.cpp:2209
Math::Point m_highlightP1
Highlight rectangle points.
Definition: engine.h:1403
EngineShadowType type
Type of shadow.
Definition: engine.h:320
void SetShowStats(bool show)
Management of displaying statistic information.
Definition: engine.cpp:526
void SetDrawFront(bool draw)
Whether to draw the world on the interface.
Definition: engine.cpp:2719
void SetEditIndentMode(bool autoIndent)
Management of the indentation mode while editing (CEdit)
Definition: engine.cpp:3012
VertexTex2 triangle[3]
Triangle vertices.
Definition: engine.h:158
2D point
Definition: point.h:50
int icon2
Index of texture element for 2nd image.
Definition: engine.h:495
bool used
If true, object is valid in objects vector.
Definition: engine.h:268
void SetStatisticPos(Math::Vector pos)
Sets the coordinates to display in stats window.
Definition: engine.cpp:600
Image loaded from file.
Definition: image.h:54
bool hide
If true, shadow is invisible (object being carried for example)
Definition: engine.h:316
bool m_offscreenShadowRendering
true enables offscreen shadow rendering
Definition: engine.h:1418
Main application.
Definition: app.h:191
void DeleteShadowSpot(int objRank)
Deletes the shadow for given object.
Definition: engine.cpp:1352
void Render()
Called once per frame, the call is the entry point for rendering.
Definition: engine.cpp:3109
void DebugObject(int rank)
Print debug info about an object.
Definition: engine.cpp:808
EngineBaseObjTexTier & AddLevel2(EngineBaseObject &p1, const std::string &tex1Name, const std::string &tex2Name)
Creates a new tier 2 object (texture)
Definition: engine.cpp:616
void DrawForegroundImage()
Draws the image foreground.
Definition: engine.cpp:4553
Math::Matrix m_matViewInterface
View matrix for 2D interface.
Definition: engine.h:1330
CTerrain * GetTerrain()
Returns the terrain manager.
Definition: engine.cpp:249
Shadow drawn by the graphics engine.
Definition: engine.h:311
void SetEditIndentValue(int value)
Management of tab indent when editing (CEdit)
Definition: engine.cpp:3022
void SetObjectBaseRank(int objRank, int baseObjRank)
Management of the base object rank for engine object.
Definition: engine.cpp:926
Math::Vector bboxMax
bounding box max (origin 0,0,0 always included)
Definition: engine.h:249
TEST_VIRTUAL Math::Vector GetEyePt()
Returns the camera center point.
Definition: engine.cpp:3057
CWater * GetWater()
Returns the water manager.
Definition: engine.cpp:254
float smooth
Transition area.
Definition: engine.h:355
Null phase.
Definition: engine.h:378
Texture CreateTexture(const std::string &texName, const TextureCreateParams &params, CImage *image=nullptr)
Create texture and add it to cache.
Definition: engine.cpp:2232
EngineGroundMark m_groundMark
Ground mark.
Definition: engine.h:1344
void ChangeTextureMapping(int objRank, const Material &mat, int state, const std::string &tex1Name, const std::string &tex2Name, EngineTextureMapping mode, float au, float bu, float av, float bv)
Changes (recalculates) texture mapping for given object.
Definition: engine.cpp:1165
CText * GetText()
Returns the text rendering engine.
Definition: engine.cpp:234
Math::IntPoint m_size
Current size of viewport window.
Definition: engine.h:1333
Part 3.
Definition: engine.h:111
Terrain loader/generator and manager.
Definition: terrain.h:145
std::vector< EngineObject > m_objects
Object parameters.
Definition: engine.h:1338
void SetObjectDrawFront(int objRank, bool draw)
Sets drawFront for given object.
Definition: engine.cpp:976
Resize diagonally top-left to bottom-right.
Definition: engine.h:470
bool visible
If true, the object is drawn.
Definition: engine.h:272
The transparent diffuse color.
Definition: engine.h:95
EngineMouseType
Type of mouse cursor displayed in-game.
Definition: engine.h:445
void DrawPlanet()
Draws all the planets.
Definition: engine.cpp:4537
EngineBaseObjDataTier * FindTriangles(int objRank, const Material &material, int state, std::string tex1Name, std::string tex2Name)
Returns the first found tier 4 engine object for the given params or nullptr if not found...
Definition: engine.cpp:1018
Namespace for (new) graphics code.
Definition: app.h:49
int CreateObject()
Creates a new object and returns its rank.
Definition: engine.cpp:877
void SetTerrain(CTerrain *terrain)
Sets the terrain object.
Definition: engine.cpp:279
void SetForegroundName(const std::string &name)
Specifies the name of foreground texture.
Definition: engine.cpp:2814
float drawRadius
Radius for marks.
Definition: engine.h:410
float radius
Radius of the shadow.
Definition: engine.h:328
EngineRenderState mode1
Mode to render 1st image in.
Definition: engine.h:499
Vector struct and related functions.
The graphics engine.
Definition: engine.h:620
int dx
X dimension of table.
Definition: engine.h:414
void SetObjectTransform(int objRank, const Math::Matrix &transform)
Management of object transform.
Definition: engine.cpp:955
Normal cursor (arrow)
Definition: engine.h:448
Math::Matrix m_shadowViewMat
View matrix for rendering shadow maps.
Definition: engine.h:1319
Double white texturing.
Definition: engine.h:105
Object drawn by the graphics engine.
Definition: engine.h:265
Math::Matrix m_shadowTextureMat
Texture matrix for rendering shadow maps.
Definition: engine.h:1321
float GetEyeDirH()
Returns the horizontal direction angle of view.
Definition: engine.cpp:3067
void UseMSAA(bool enable)
Enables or disables MSAA.
Definition: engine.cpp:3739
EngineMouseType m_mouseType
Type of mouse cursor.
Definition: engine.h:1446
void Update()
Updates the state after creating objects.
Definition: engine.cpp:1736
void UpdateGroundSpotTextures()
Updates the textures used for drawing ground spot.
Definition: engine.cpp:3935
EngineTriangleType
Type of triangles drawn for engine objects.
Definition: engine.h:143
int GetPartialTriangles(int objRank, float percent, int maxCount, std::vector< EngineTriangle > &triangles)
Returns a partial list of triangles for given object.
Definition: engine.cpp:1054
void DeleteGroundSpot(int rank)
Deletes the given ground spot.
Definition: engine.cpp:1566
void SetMultiSample(int value)
Management of shadow range.
Definition: engine.cpp:2653
void WriteScreenShot(const std::string &fileName)
Writes a screenshot containing the current frame.
Definition: engine.cpp:492
int dy
Y dimension of table.
Definition: engine.h:416
Info about a texture.
Definition: texture.h:256
bool m_screenshotMode
Screenshot mode?
Definition: engine.h:1307
void SetHighlightRank(int *rankList)
Lists the ranks of objects and subobjects selected.
Definition: engine.cpp:1466
Math::Vector normal
Normal to the terrain.
Definition: engine.h:324
Math::Matrix m_shadowProjMat
Projection matrix for rendering shadow maps.
Definition: engine.h:1317
Math::Matrix m_matWorldInterface
World matrix for 2D interface.
Definition: engine.h:1326
void ComputeDistance()
Calculates the distances between the viewpoint and the origin of different objects.
Definition: engine.cpp:1634
int m_lastState
Last engine render state (-1 at the beginning of frame)
Definition: engine.h:1449
void SetOverColor(const Color &color=Color(), int mode=ENG_RSTATE_TCOLOR_BLACK)
Sets the foreground overlay color.
Definition: engine.cpp:2833
Information about mouse cursor.
Definition: engine.h:490
void SetDirty(bool mode)
Management of the global mode of contamination.
Definition: engine.cpp:2665
A single triangle in mesh as saved in model file.
Definition: model_triangle.h:60
Math::Matrix transform
Transformation matrix.
Definition: engine.h:280
void DrawBackgroundImage()
Draws the image background.
Definition: engine.cpp:4453
bool m_interfaceMode
True when drawing 2D UI.
Definition: engine.h:1458
Moving object.
Definition: engine.h:181
Image using alpha channel.
Definition: engine.h:117
bool draw
If true, draw mark.
Definition: engine.h:394
Water manager/renderer.
Definition: water.h:74
Only opaque texture, no blending, etc.
Definition: engine.h:129
bool IsVisiblePoint(const Math::Vector &pos)
Indicates whether a point is visible.
Definition: engine.cpp:3077
TexFilter
General texture filtering mode.
Definition: texture.h:62
void SetClippingDistance(float value)
Management of the distance of clipping.
Definition: engine.cpp:2859
std::map< std::string, Texture > m_texNameMap
Map of loaded textures (by name)
Definition: engine.h:1431
Resize.
Definition: engine.h:462
EngineTextureMapping
Type of texture mapping.
Definition: engine.h:430
Text rendering engine.
Definition: text.h:230
void UseShadowMapping(bool enable)
Enables or disables shadow mapping.
Definition: engine.cpp:3586
void SetTextureFilterMode(TexFilter value)
Management the texture filter mode.
Definition: engine.cpp:2872
3D (3x1) vector
Definition: vector.h:53
int iconShadow
Shadow texture part.
Definition: engine.h:497
bool drawWorld
If true, object is behind the 2D interface.
Definition: engine.h:274
Tier 3 of object tree (data)
Definition: engine.h:195
void CreateGroundMark(Math::Vector pos, float radius, float delay1, float delay2, float delay3, int dx, int dy, char *table)
Creates the ground mark with the given params.
Definition: engine.cpp:1610
Math::Matrix m_matView
View matrix for 3D scene.
Definition: engine.h:1312
Platform-specific utils.
Definition: system.h:91
std::vector< EngineGroundSpot > m_groundSpots
Ground spot list.
Definition: engine.h:1342
Definition: system_linux.h:30
Part of a moving object.
Definition: engine.h:183
Surfaces.
Definition: engine.h:148
int CreateBaseObject()
Creates a base object and returns its rank.
Definition: engine.cpp:641
A mark on ground drawn by the graphics engine.
Definition: engine.h:391
2D Point with integer coords
Definition: intpoint.h:39
bool GetBBox2D(int objRank, Math::Point &min, Math::Point &max)
Compute and return the 2D box on screen of any object.
Definition: engine.cpp:1476
void UpdateStaticBuffer(EngineBaseObjDataTier &p4)
Updates a given static buffer.
Definition: engine.cpp:1690
CLightManager * GetLightManager()
Returns the light manager.
Definition: engine.cpp:239
Color with transparency.
Definition: engine.h:135
void SetSecondTexture(const std::string &texNum)
Management of the global mode of secondary texturing.
Definition: engine.cpp:2685
CParticle * GetParticle()
Returns the particle manager.
Definition: engine.cpp:244
std::map< Texture, std::string > m_revTexNameMap
Reverse map of loaded textures (by texture)
Definition: engine.h:1433
RGBA color.
Definition: color.h:39
void UpdateStaticBuffers()
Updates static buffers of changed objects.
Definition: engine.cpp:1706
Triangles.
Definition: engine.h:146
void DrawStats()
Draw statistic texts.
Definition: engine.cpp:4780
void DeleteTexture(const std::string &name)
Deletes the given texture, unloading it and removing from cache.
Definition: engine.cpp:2538
void DrawObject(const EngineBaseObjDataTier &p4)
Draw 3D object.
Definition: engine.cpp:3788
bool m_showStats
Whether to show stats (FPS, etc)
Definition: engine.h:1300
void UpdateGeometry()
Updates geometric parameters of objects (bounding box and radius)
Definition: engine.cpp:1649
void SetDevice(CDevice *device)
Sets the device to be used.
Definition: engine.cpp:214
std::vector< EngineBaseObject > m_baseObjects
Base objects (also level 1 tier list)
Definition: engine.h:1336
float distance
Distance to object from eye point.
Definition: engine.h:282
Scroll up.
Definition: engine.h:476
Shadow spot data as saved in model file.
Definition: model_shadow_spot.h:29
Event sent by system, interface or game.
Definition: event.h:709
float intensity
Intensity of the shadow.
Definition: engine.h:330
Definition: pausemanager.h:60
IntPoint struct.
void AddBaseObjTriangles(int baseObjRank, const std::vector< Gfx::ModelTriangle > &triangles)
Adds triangles to given object with the specified params.
Definition: engine.cpp:4885
CPlanet * GetPlanet()
Returns the planet manager.
Definition: engine.cpp:264
void DrawTimer()
Draw mission timer.
Definition: engine.cpp:4877
void DeleteGroundMark(int rank)
Deletes the ground mark.
Definition: engine.cpp:1629
void SetObjectDrawWorld(int objRank, bool draw)
Sets drawWorld for given object.
Definition: engine.cpp:969
int baseObjRank
Rank of associated base engine object.
Definition: engine.h:270
char * table
Pointer to the table.
Definition: engine.h:418
int m_textureAnisotropy
Requested texture anisotropy level.
Definition: engine.h:1414
Base class for all 3D in-game objects.
Definition: object.h:59
Math::IntPoint GetWindowSize()
Returns current size of viewport window.
Definition: engine.cpp:561
Texture borders with solid color.
Definition: engine.h:99
void SetBackground(const std::string &name, Color up=Color(), Color down=Color(), Color cloudUp=Color(), Color cloudDown=Color(), bool full=false, bool scale=false)
Management of the background image to use.
Definition: engine.cpp:2777
The transparent texture (white = no)
Definition: engine.h:93
void SetDrawWorld(bool draw)
Whether to draw the world.
Definition: engine.cpp:2714
CDevice * GetDevice()
Returns the current device.
Definition: engine.cpp:219
int GetObjectTotalTriangles(int objRank)
Returns the total number of triangles of given object.
Definition: engine.cpp:1005
TODO: ?
Definition: engine.h:458
bool used
If true, base object is valid in objects vector.
Definition: engine.h:243
EngineGroundMarkPhase
Phase of life of an EngineGroundMark.
Definition: engine.h:375
Sound plugin interface.
Definition: sound.h:57
Causes the fog.
Definition: engine.h:121
Part 1 (no change in. MOD!)
Definition: engine.h:107
void DeleteAllObjects()
Deletes all objects, shadows and ground spots.
Definition: engine.cpp:907
void UpdateMatProj()
Resets the projection matrix after changes.
Definition: engine.cpp:3082
Abstract interface of graphics device.
Definition: device.h:268
bool IsVisible(int objRank)
Tests whether the given object is visible.
Definition: engine.cpp:1905
Double black texturing.
Definition: engine.h:103
int objRank
Rank of the associated object.
Definition: engine.h:318
const Math::Matrix & GetStaticMeshWorldMatrix(int meshHandle)
Returns static mesh world matrix.
Definition: engine.cpp:5097
bool ProcessEvent(const Event &event)
Processes incoming event.
Definition: engine.cpp:416
Texture wrap.
Definition: engine.h:97
Definition: engine.h:240
void DrawBackgroundGradient(const Color &up, const Color &down)
Draws the gradient background.
Definition: engine.cpp:4423
void FlushTextureCache()
Empties the texture cache.
Definition: engine.cpp:2569
int m_offscreenShadowRenderingResolution
Offscreen shadow rendering resolution.
Definition: engine.h:1420
void SetFocus(float focus)
Management of camera angle.
Definition: engine.cpp:2619
CCloud * GetCloud()
Returns the fog manager.
Definition: engine.cpp:269