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-2014, Daniel Roux, EPSITEC SA & TerranovaTeam
4  * http://epsiteс.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 
28 #include "app/system.h"
29 #include "app/pausemanager.h"
30 
31 #include "common/event.h"
32 #include "common/singleton.h"
33 
34 #include "graphics/core/color.h"
35 #include "graphics/core/material.h"
36 #include "graphics/core/texture.h"
37 #include "graphics/core/vertex.h"
38 
40 
41 #include "math/intpoint.h"
42 #include "math/matrix.h"
43 #include "math/point.h"
44 #include "math/vector.h"
45 
46 
47 #include <string>
48 #include <vector>
49 #include <map>
50 #include <set>
51 
52 
53 class CApplication;
54 class CObject;
55 class CSoundInterface;
56 class CImage;
57 
58 
59 // Graphics module namespace
60 namespace Gfx {
61 
62 
63 class CDevice;
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 
73 
82 {
92  ENG_RSTATE_WRAP = (1<<3),
94  ENG_RSTATE_CLAMP = (1<<4),
96  ENG_RSTATE_LIGHT = (1<<5),
106  ENG_RSTATE_PART3 = (1<<10),
108  ENG_RSTATE_PART4 = (1<<11),
110  ENG_RSTATE_2FACE = (1<<12),
112  ENG_RSTATE_ALPHA = (1<<13),
114  ENG_RSTATE_SECOND = (1<<14),
116  ENG_RSTATE_FOG = (1<<15),
122  ENG_RSTATE_TEXT = (1<<18),
127 };
128 
129 
135 {
140 };
141 
147 {
153  int state;
155  std::string tex1Name;
157  std::string tex2Name;
158 
159  inline EngineTriangle()
160  {
161  state = ENG_RSTATE_NORMAL;
162  }
163 };
164 
169 {
184 };
185 
186 
192 {
193  EngineTriangleType type;
194  Material material;
195  int state;
196  std::vector<VertexTex2> vertices;
197  unsigned int staticBufferId;
198  bool updateStaticBuffer;
199 
201  const Material& _material = Material(),
202  int _state = ENG_RSTATE_NORMAL)
203  : type(_type)
204  , material(_material)
205  , state(_state)
206  , staticBufferId(0)
207  , updateStaticBuffer(false)
208  {}
209 };
210 
216 {
217  LODLevel lodLevel;
218  std::vector<EngineBaseObjDataTier> next;
219 
220  inline EngineBaseObjLODTier(LODLevel _lodLevel = LOD_Constant)
221  : lodLevel(_lodLevel)
222  {}
223 };
224 
230 {
231  std::string tex1Name;
232  Texture tex1;
233  std::string tex2Name;
234  Texture tex2;
235  std::vector<EngineBaseObjLODTier> next;
236 
237  inline EngineBaseObjTexTier(const std::string& _tex1Name = "", const std::string& _tex2Name = "")
238  : tex1Name(_tex1Name)
239  , tex2Name(_tex2Name)
240  {}
241 };
242 
250 {
252  bool used;
260  float radius;
262  std::vector<EngineBaseObjTexTier> next;
263 
264  inline EngineBaseObject()
265  {
266  LoadDefault();
267  }
268 
269  inline void LoadDefault()
270  {
271  used = false;
272  totalTriangles = 0;
273  bboxMax.LoadZero();
274  bboxMin.LoadZero();
275  radius = 0.0f;
276  }
277 };
278 
284 {
286  bool used;
290  bool visible;
292  bool drawWorld;
294  bool drawFront;
300  float distance;
305 
307  inline EngineObject()
308  {
309  LoadDefault();
310  }
311 
313  inline void LoadDefault()
314  {
315  used = false;
316  baseObjRank = -1;
317  visible = false;
318  drawWorld = false;
319  drawFront = false;
320  type = ENG_OBJTYPE_NULL;
321  transform.LoadIdentity();
322  distance = 0.0f;
323  shadowRank = -1;
324  transparency = 0.0f;
325  }
326 };
327 
333 {
338 };
339 
345 {
347  bool used;
349  bool hide;
351  int objRank;
359  float angle;
361  float radius;
363  float intensity;
365  float height;
366 
367  inline EngineShadow()
368  {
369  LoadDefault();
370  }
371 
372  inline void LoadDefault()
373  {
374  used = false;
375  hide = false;
376  objRank = 0;
377  type = ENG_SHADOW_NORM;
378  pos.LoadZero();
379  normal.LoadZero();
380  angle = radius = intensity = height = 0.0f;
381  }
382 };
383 
389 {
391  bool used;
395  float min;
397  float max;
399  float smooth;
403  float radius;
407  float drawRadius;
408 
409  inline EngineGroundSpot()
410  {
411  LoadDefault();
412  }
413 
414  inline void LoadDefault()
415  {
416  used = false;
417  color = Color();
418  pos.LoadZero();
419  drawPos.LoadZero();
420  min = max = smooth = radius = drawRadius = 0.0f;
421  }
422 };
423 
429 {
438 };
439 
445 {
447  bool draw;
451  float delay[3];
453  float fix;
457  float radius;
459  float intensity;
463  float drawRadius;
467  int dx;
469  int dy;
471  char* table;
472 
473  inline EngineGroundMark()
474  {
475  LoadDefault();
476  }
477 
478  inline void LoadDefault()
479  {
480  draw = false;
481  phase = ENG_GR_MARK_PHASE_NULL;
482  pos = Math::Vector();
483  drawPos = Math::Vector();
484  delay[0] = delay[1] = delay[2] = 0.0f;
485  fix = radius = intensity = drawRadius = drawIntensity = 0.0f;
486  dx = dy = 0;
487  table = nullptr;
488  }
489 };
490 
496 {
497  ENG_TEX_MAPPING_X = 1,
498  ENG_TEX_MAPPING_Y = 2,
499  ENG_TEX_MAPPING_Z = 3,
500  ENG_TEX_MAPPING_1X = 4,
501  ENG_TEX_MAPPING_1Y = 5,
502  ENG_TEX_MAPPING_1Z = 6
503 };
504 
505 
511 {
546 
549 };
550 
556 {
558  int icon1;
560  int icon2;
569 
570  inline EngineMouse(int _icon1 = -1, int _icon2 = -1, int _iconShadow = -1,
573  Math::Point _hotPoint = Math::Point())
574  : icon1(_icon1)
575  , icon2(_icon2)
576  , iconShadow(_iconShadow)
577  , mode1(_mode1)
578  , mode2(_mode2)
579  , hotPoint(_hotPoint)
580  {}
581 };
582 
583 
684 class CEngine : public CSingleton<CEngine>
685 {
686 public:
687  CEngine(CApplication* app);
688  ~CEngine();
689 
691  void SetDevice(CDevice* device);
693  CDevice* GetDevice();
694 
696  CText* GetText();
702  CTerrain* GetTerrain();
704  CWater* GetWater();
708  CPlanet* GetPlanet();
710  CCloud* GetCloud();
711 
713  void SetTerrain(CTerrain* terrain);
714 
715 
717  bool Create();
719  void Destroy();
720 
723 
724 
726  void Render();
727 
728 
730  bool ProcessEvent(const Event& event);
731 
733  void FrameUpdate();
734 
735 
737  bool WriteScreenShot(const std::string& fileName, int width, int height);
738 
739 
741  TEST_VIRTUAL bool GetPause();
742 
744  void SetMovieLock(bool lock);
746  bool GetMovieLock();
748 
750  void SetShowStats(bool show);
752  bool GetShowStats();
754 
756  void SetRenderEnable(bool enable);
757 
760 
762 
766  Math::IntPoint InterfaceToWindowCoords(Math::Point pos);
768 
770 
773  Math::IntPoint InterfaceToWindowSize(Math::Point size);
775 
777  void AddStatisticTriangle(int nb);
779  int GetStatisticTriangle();
780 
782  void SetStatisticPos(Math::Vector pos);
783 
785  void SetTimerDisplay(const std::string& text);
786 
787 
788  /* *************** Object management *************** */
789 
790  // Base objects
791 
793  int CreateBaseObject();
795  void DeleteBaseObject(int baseObjRank);
797  void DeleteAllBaseObjects();
798 
800  void CopyBaseObject(int sourceBaseObjRank, int destBaseObjRank);
801 
803  void AddBaseObjTriangles(int baseObjRank, const std::vector<VertexTex2>& vertices,
804  EngineTriangleType triangleType,
805  const Material& material, int state,
806  std::string tex1Name, std::string tex2Name,
807  LODLevel lodLevel, bool globalUpdate);
808 
810  void AddBaseObjQuick(int baseObjRank, const EngineBaseObjDataTier& buffer,
811  std::string tex1Name, std::string tex2Name,
812  LODLevel lodLevel, bool globalUpdate);
813 
814  // Objects
815 
817  void DebugObject(int rank);
818 
820  int CreateObject();
822  void DeleteAllObjects();
824  void DeleteObject(int objRank);
825 
827  void SetObjectBaseRank(int objRank, int baseObjRank);
829  int GetObjectBaseRank(int objRank);
831 
833  void SetObjectType(int objRank, EngineObjectType type);
835  EngineObjectType GetObjectType(int objRank);
837 
839  void SetObjectTransform(int objRank, const Math::Matrix& transform);
841  void GetObjectTransform(int objRank, Math::Matrix& transform);
843 
845  void SetObjectDrawWorld(int objRank, bool draw);
847  void SetObjectDrawFront(int objRank, bool draw);
848 
850  void SetObjectTransparency(int objRank, float value);
851 
853  void GetObjectBBox(int objRank, Math::Vector& min, Math::Vector& max);
854 
856  int GetObjectTotalTriangles(int objRank);
857 
859  EngineBaseObjDataTier* FindTriangles(int objRank, const Material& material,
860  int state, std::string tex1Name, std::string tex2Name,
861  int lodLevelMask);
862 
864  int GetPartialTriangles(int objRank, int lodLevelMask, float percent, int maxCount,
865  std::vector<EngineTriangle>& triangles);
866 
868  void ChangeSecondTexture(int objRank, const std::string& tex2Name);
869 
871  void ChangeTextureMapping(int objRank, const Material& mat, int state,
872  const std::string& tex1Name, const std::string& tex2Name,
873  int lodLevelMask, EngineTextureMapping mode,
874  float au, float bu, float av, float bv);
875 
877  void TrackTextureMapping(int objRank, const Material& mat, int state,
878  const std::string& tex1Name, const std::string& tex2Name,
879  int lodLevelMask, EngineTextureMapping mode,
880  float pos, float factor, float tl, float ts, float tt);
881 
883 
884  int DetectObject(Math::Point mouse);
885 
887  void CreateShadow(int objRank);
889  void DeleteShadow(int objRank);
890 
892  void SetObjectShadowHide(int objRank, bool hide);
894  void SetObjectShadowType(int objRank, EngineShadowType type);
895  void SetObjectShadowPos(int objRank, const Math::Vector& pos);
896  void SetObjectShadowNormal(int objRank, const Math::Vector& normal);
897  void SetObjectShadowAngle(int objRank, float angle);
898  void SetObjectShadowRadius(int objRank, float radius);
899  void SetObjectShadowIntensity(int objRank, float intensity);
900  void SetObjectShadowHeight(int objRank, float height);
901  float GetObjectShadowRadius(int objRank);
903 
905  void SetHighlightRank(int* rankList);
907  bool GetHighlight(Math::Point& p1, Math::Point& p2);
908 
910  void DeleteAllGroundSpots();
912  int CreateGroundSpot();
914  void DeleteGroundSpot(int rank);
915 
917  void SetObjectGroundSpotPos(int rank, const Math::Vector& pos);
919  void SetObjectGroundSpotRadius(int rank, float radius);
920  void SetObjectGroundSpotColor(int rank, const Color& color);
921  void SetObjectGroundSpotMinMax(int rank, float min, float max);
922  void SetObjectGroundSpotSmooth(int rank, float smooth);
924 
926  void CreateGroundMark(Math::Vector pos, float radius,
927  float delay1, float delay2, float delay3,
928  int dx, int dy, char* table);
930  void DeleteGroundMark(int rank);
931 
933  void Update();
934 
935 
936  /* *************** Mode setting *************** */
937 
939  void SetState(int state, const Color& color = Color(1.0f, 1.0f, 1.0f, 1.0f));
940 
942  void SetMaterial(const Material& mat);
943 
945  void SetViewParams(const Math::Vector& eyePt, const Math::Vector& lookatPt,
946  const Math::Vector& upVec, float eyeDistance);
947 
949  Texture LoadTexture(const std::string& name);
951  Texture LoadTexture(const std::string& name, CImage* image);
953  Texture LoadTexture(const std::string& name, const TextureCreateParams& params);
955  bool LoadAllTextures();
956 
958  bool ChangeTextureColor(const std::string& texName,
959  Color colorRef1, Color colorNew1,
960  Color colorRef2, Color colorNew2,
961  float tolerance1, float tolerance2,
962  Math::Point ts, Math::Point ti,
963  Math::Point *exclude = nullptr,
964  float shift = 0.0f, bool hsv = false);
965 
967 
968  bool SetTexture(const std::string& name, int stage = 0);
970  void SetTexture(const Texture& tex, int stage = 0);
971 
973  void DeleteTexture(const std::string& name);
975  void DeleteTexture(const Texture& tex);
976 
978  void FlushTextureCache();
979 
981  void SetTerrainVision(float vision);
982 
984 
988  void SetFocus(float focus);
989  float GetFocus();
991 
993  void SetGroundSpot(bool mode);
995  bool GetGroundSpot();
997 
999  void SetShadow(bool mode);
1001  bool GetShadow();
1003 
1005  void SetDirty(bool mode);
1007  bool GetDirty();
1009 
1011  void SetFog(bool mode);
1013  bool GetFog();
1015 
1017  void SetSecondTexture(const std::string& texNum);
1019  const std::string& GetSecondTexture();
1021 
1023  void SetRankView(int rank);
1025  int GetRankView();
1027 
1029  void SetDrawWorld(bool draw);
1030 
1032  void SetDrawFront(bool draw);
1033 
1035  void SetAmbientColor(const Color& color, int rank = 0);
1037  Color GetAmbientColor(int rank = 0);
1039 
1041  void SetWaterAddColor(const Color& color);
1043  Color GetWaterAddColor();
1045 
1047  void SetFogColor(const Color& color, int rank = 0);
1049  Color GetFogColor(int rank = 0);
1051 
1053 
1056  void SetDeepView(float length, int rank = 0, bool ref=false);
1057  float GetDeepView(int rank = 0);
1059 
1060 
1062 
1065  void SetFogStart(float start, int rank = 0);
1066  float GetFogStart(int rank = 0);
1068 
1070  void SetBackground(const std::string& name, Color up = Color(), Color down = Color(),
1072  Color cloudUp = Color(), Color cloudDown = Color(),
1073  bool full = false);
1074  void GetBackground(std::string& name, Color& up, Color& down,
1075  Color& cloudUp, Color& cloudDown,
1076  bool& full);
1078 
1080  void SetForegroundName(const std::string& name);
1082  void SetOverFront(bool front);
1084  void SetOverColor(const Color& color = Color(), int mode = ENG_RSTATE_TCOLOR_BLACK);
1085 
1087  void SetParticleDensity(float value);
1089  float GetParticleDensity();
1091 
1093  float ParticleAdapt(float factor);
1094 
1096  void SetClippingDistance(float value);
1098  float GetClippingDistance();
1100 
1102  void SetObjectDetail(float value);
1104  float GetObjectDetail();
1106 
1108  void SetGadgetQuantity(float value);
1110  float GetGadgetQuantity();
1112 
1114  void SetTextureQuality(int value);
1116  int GetTextureQuality();
1118 
1120  void SetTextureFilterMode(TexFilter value);
1122  TexFilter GetTextureFilterMode();
1124 
1126  void SetTextureMipmapLevel(int value);
1128  int GetTextureMipmapLevel();
1130 
1132  void SetTextureAnisotropyLevel(int value);
1134  int GetTextureAnisotropyLevel();
1136 
1138  void SetShadowMapping(bool value);
1140  bool GetShadowMapping();
1142 
1144  void SetShadowColor(float value);
1146  bool GetShadowColor();
1148 
1150  void SetTotoMode(bool present);
1152  bool GetTotoMode();
1154 
1156  void SetLensMode(bool present);
1158  bool GetLensMode();
1160 
1162  void SetWaterMode(bool present);
1164  bool GetWaterMode();
1166 
1167  void SetLightingMode(bool present);
1168  bool GetLightingMode();
1169 
1171  void SetSkyMode(bool present);
1173  bool GetSkyMode();
1175 
1177  void SetBackForce(bool present);
1179  bool GetBackForce();
1181 
1183  void SetPlanetMode(bool present);
1185  bool GetPlanetMode();
1187 
1189  void SetLightMode(bool present);
1191  bool GetLightMode();
1193 
1195  // TODO: move to more appropriate class ?
1197  void SetEditIndentMode(bool autoIndent);
1198  bool GetEditIndentMode();
1200 
1202  // TODO: move to more appropriate class ?
1204  void SetEditIndentValue(int value);
1205  int GetEditIndentValue();
1207 
1209  void SetTracePrecision(float factor);
1211  float GetTracePrecision();
1213 
1215  void SetMouseType(EngineMouseType type);
1217  EngineMouseType GetMouseType();
1219 
1221  const Math::Matrix& GetMatView();
1223  TEST_VIRTUAL Math::Vector GetEyePt();
1225  TEST_VIRTUAL Math::Vector GetLookatPt();
1227  float GetEyeDirH();
1229  float GetEyeDirV();
1231  bool IsVisiblePoint(const Math::Vector& pos);
1232 
1234  void UpdateMatProj();
1235 
1237  void ApplyChange();
1238 
1239 protected:
1241  void Draw3DScene();
1243  void RenderShadowMap();
1245  void UseShadowMapping(bool enable);
1247  void DrawObject(const EngineBaseObjDataTier& p4);
1249  void DrawInterface();
1250 
1252  void UpdateGroundSpotTextures();
1253 
1255  void DrawShadow();
1257  void DrawBackground();
1259  void DrawBackgroundGradient(const Color& up, const Color& down);
1261  void DrawBackgroundImage();
1263  void DrawPlanet();
1265  void DrawForegroundImage();
1267  void DrawOverColor();
1269  void DrawHighlight();
1271  void DrawMouse();
1273  void DrawMouseSprite(Math::Point pos, Math::Point dim, int icon);
1275  void DrawStats();
1277  void DrawTimer();
1278 
1280  EngineBaseObjTexTier& AddLevel2(EngineBaseObject& p1, const std::string& tex1Name, const std::string& tex2Name);
1285  const Material& mat, int state);
1286 
1288  Texture CreateTexture(const std::string &texName, const TextureCreateParams &params, CImage* image = nullptr);
1289 
1291  bool IsVisible(int objRank);
1292 
1294  bool IsWithinLODLimit(float distance, LODLevel lodLevel);
1295 
1297  bool DetectBBox(int objRank, Math::Point mouse);
1298 
1300  bool GetBBox2D(int objRank, Math::Point& min, Math::Point& max);
1301 
1303  bool DetectTriangle(Math::Point mouse, VertexTex2* triangle, int objRank, float& dist);
1304 
1306 
1307  bool TransformPoint(Math::Vector& p2D, int objRank, Math::Vector p3D);
1308 
1310  void ComputeDistance();
1311 
1313  void UpdateGeometry();
1314 
1317 
1319  void UpdateStaticBuffers();
1320 
1321 protected:
1322  CApplication* m_app;
1323  CSoundInterface* m_sound;
1324  CDevice* m_device;
1325  CText* m_text;
1326  CLightManager* m_lightMan;
1327  CParticle* m_particle;
1328  CWater* m_water;
1329  CCloud* m_cloud;
1330  CLightning* m_lightning;
1331  CPlanet* m_planet;
1332  CTerrain* m_terrain;
1333  CPauseManager* m_pause;
1334 
1336  std::string m_error;
1337 
1338  SystemTimeStamp* m_lastFrameTime;
1339  SystemTimeStamp* m_currentFrameTime;
1340  int m_fpsCounter;
1341  float m_fps;
1342 
1345  std::string m_fpsText;
1347  bool m_render;
1350 
1356  float m_focus;
1357 
1366 
1373 
1376 
1378  std::vector<EngineBaseObject> m_baseObjects;
1380  std::vector<EngineObject> m_objects;
1382  std::vector<EngineShadow> m_shadows;
1384  std::vector<EngineGroundSpot> m_groundSpots;
1387 
1392  float m_eyeDirH;
1393  float m_eyeDirV;
1394  int m_rankView;
1395  Color m_ambientColor[2];
1396  Color m_backColor[2];
1397  Color m_fogColor[2];
1398  float m_deepView[2];
1399  float m_fogStart[2];
1400  Color m_waterAddColor;
1401  int m_statisticTriangle;
1402  Math::Vector m_statisticPos;
1403  bool m_updateGeometry;
1404  bool m_updateStaticBuffers;
1405  int m_alphaMode;
1406  bool m_groundSpotVisible;
1407  bool m_shadowVisible;
1408  bool m_dirty;
1409  bool m_fog;
1410  bool m_firstGroundSpot;
1411  std::string m_secondTex;
1412  bool m_backgroundFull;
1413  std::string m_backgroundName;
1414  Texture m_backgroundTex;
1415  Color m_backgroundColorUp;
1416  Color m_backgroundColorDown;
1417  Color m_backgroundCloudUp;
1418  Color m_backgroundCloudDown;
1419  bool m_overFront;
1420  Color m_overColor;
1421  int m_overMode;
1422  std::string m_foregroundName;
1423  Texture m_foregroundTex;
1424  bool m_drawWorld;
1425  bool m_drawFront;
1426  float m_particleDensity;
1427  float m_clippingDistance;
1428  float m_lastClippingDistance;
1429  float m_objectDetail;
1430  float m_terrainVision;
1431  float m_gadgetQuantity;
1432  int m_textureQuality;
1433  bool m_totoMode;
1434  bool m_lensMode;
1435  bool m_waterMode;
1436  bool m_skyMode;
1437  bool m_backForce;
1438  bool m_planetMode;
1439  bool m_lightMode;
1440  bool m_editIndentMode;
1441  int m_editIndentValue;
1442  float m_tracePrecision;
1443 
1444  Texture m_shadowMap;
1445 
1455  Math::Point m_highlightP2;
1457 
1474 
1476  std::map<std::string, Texture> m_texNameMap;
1478  std::map<Texture, std::string> m_revTexNameMap;
1480 
1482  std::set<std::string> m_texBlacklist;
1483 
1492 
1498  std::string m_lastTexture[2];
1501 
1504 
1505  bool m_debugLights;
1506  bool m_debugDumpLights;
1507 
1508  std::string m_timerText;
1509 };
1510 
1511 
1512 } // namespace Gfx
1513 
void SetWaterMode(bool present)
Management the mode of water.
Definition: engine.cpp:3031
bool m_highlight
Highlight visible?
Definition: engine.h:1449
int DetectObject(Math::Point mouse)
Detects the target object that is selected with the mouse.
Definition: engine.cpp:1853
bool m_movieLock
Lock for duration of movie?
Definition: engine.h:1349
void SetFog(bool mode)
Management of the global mode of horizontal fog patches.
Definition: engine.cpp:2727
std::string tex1Name
1st texture
Definition: engine.h:155
void SetLensMode(bool present)
Management the mode of foreground.
Definition: engine.cpp:3021
void LoadIdentity()
Loads the identity matrix.
Definition: matrix.h:131
void GetObjectBBox(int objRank, Math::Vector &min, Math::Vector &max)
Returns the bounding box for an object.
Definition: engine.cpp:1003
Edit (I-beam)
Definition: engine.h:517
EngineMouse m_mice[ENG_MOUSE_COUNT]
Mouse cursor definitions.
Definition: engine.h:1485
Normal shadow.
Definition: engine.h:335
void SetTimerDisplay(const std::string &text)
Sets text to display as mission timer.
Definition: engine.cpp:567
float drawIntensity
Draw intensity for marks.
Definition: engine.h:465
float intensity
Color intensity.
Definition: engine.h:459
void SetTextureAnisotropyLevel(int value)
Management the anisotropy level for textures.
Definition: engine.cpp:2988
bool GetHighlight(Math::Point &p1, Math::Point &p2)
Returns the highlighted rectangle.
Definition: engine.cpp:1514
bool used
If true, ground spot is valid.
Definition: engine.h:391
void AddStatisticTriangle(int nb)
Increments the triangle counter for the current frame.
Definition: engine.cpp:552
Resize horizontally.
Definition: engine.h:529
void SetPlanetMode(bool present)
Management the mode of planets.
Definition: engine.cpp:3071
CSingleton base class for singletons.
void SetTextureMipmapLevel(int value)
Management the mipmap level for textures.
Definition: engine.cpp:2975
Math::Matrix m_matProj
Projection matrix for 3D scene.
Definition: engine.h:1352
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:2637
Light texture (ambient max)
Definition: engine.h:96
void SetBackForce(bool present)
Management the mode of background.
Definition: engine.cpp:3061
float transparency
Transparency of the object [0, 1].
Definition: engine.h:304
float delay[3]
Times for 3 life phases.
Definition: engine.h:451
void SetMovieLock(bool lock)
Management of lock for the duration of movie sequence.
Definition: engine.cpp:498
Small cross.
Definition: engine.h:521
Fixed.
Definition: engine.h:435
float ParticleAdapt(float factor)
Adapts particle factor according to particle density.
Definition: engine.cpp:2901
Busy.
Definition: engine.h:515
void ChangeSecondTexture(int objRank, const std::string &tex2Name)
Changes the 2nd texure for given object.
Definition: engine.cpp:1164
void SetRankView(int rank)
Management of view mode.
Definition: engine.cpp:2747
EngineObjectType type
Type of object.
Definition: engine.h:296
Material struct.
Math::Point WindowToInterfaceCoords(Math::IntPoint pos)
Conversion functions between window and interface coordinates.
Definition: engine.cpp:528
Math::Matrix m_matProjInterface
Projection matrix for 2D interface.
Definition: engine.h:1370
Terrain.
Definition: engine.h:173
int totalTriangles
Number of triangles.
Definition: engine.h:254
void DeleteObject(int objRank)
Deletes the given object.
Definition: engine.cpp:928
void CreateShadow(int objRank)
Creates a shadow for the given object.
Definition: engine.cpp:1353
Math::Point hotPoint
Hot point.
Definition: engine.h:568
Math::Vector pos
Position for the shadow.
Definition: engine.h:401
Scroll down.
Definition: engine.h:543
EngineRenderState mode2
Mode to render 2nd image in.
Definition: engine.h:566
void DeleteBaseObject(int baseObjRank)
Deletes a base object.
Definition: engine.cpp:638
void SetObjectType(int objRank, EngineObjectType type)
Management of engine object type.
Definition: engine.cpp:953
Vertex with secondary texture coordinates.
Definition: vertex.h:112
void LoadDefault()
Loads default values.
Definition: engine.h:313
bool IsWithinLODLimit(float distance, LODLevel lodLevel)
Checks whether the given distance is within LOD min & max limit.
Definition: engine.cpp:2000
void SetObjectDetail(float value)
Management of objects detals.
Definition: engine.cpp:2922
Material m_lastMaterial
Last material.
Definition: engine.h:1500
std::vector< EngineBaseObjTexTier > next
Next tier (LOD)
Definition: engine.h:262
Object doesn't exist.
Definition: engine.h:171
void SetObjectTransparency(int objRank, float value)
Sets the transparency level for given object.
Definition: engine.cpp:996
Tier 2 of base object tree (textures)
Definition: engine.h:229
void DrawHighlight()
Draws the rectangle of the object highlighted.
Definition: engine.cpp:4658
void CopyBaseObject(int sourceBaseObjRank, int destBaseObjRank)
Copies geometry between two base objects.
Definition: engine.cpp:700
void DrawBackground()
Draws the gradient background.
Definition: engine.cpp:4464
void SetObjectGroundSpotPos(int rank, const Math::Vector &pos)
Management of different ground spot params.
Definition: engine.cpp:1629
Crossed out sign.
Definition: engine.h:525
int m_textureMipmapLevel
Requested texture mipmap level.
Definition: engine.h:1463
void ChangeTextureMapping(int objRank, const Material &mat, int state, const std::string &tex1Name, const std::string &tex2Name, int lodLevelMask, EngineTextureMapping mode, float au, float bu, float av, float bv)
Changes (recalculates) texture mapping for given object.
Definition: engine.cpp:1194
void SetTracePrecision(float factor)
Management of precision of robot tracks.
Definition: engine.cpp:3111
bool used
If true, shadow is valid.
Definition: engine.h:347
Double-sided face.
Definition: engine.h:110
Math::Vector m_lookatPt
Camera target.
Definition: engine.h:1391
TextureCreateParams m_terrainTexParams
Create params for terrain textures.
Definition: engine.h:1461
void SetObjectShadowHide(int objRank, bool hide)
Management of different shadow params.
Definition: engine.cpp:1397
Math::Vector drawPos
Position of the shadow drawn.
Definition: engine.h:405
float m_highlightTime
Time counter for highlight animation.
Definition: engine.h:1451
void SetParticleDensity(float value)
Management of the particle density.
Definition: engine.cpp:2889
EngineObjectType
Class of graphics engine object.
Definition: engine.h:168
bool m_qualityShadows
true enables higher quality shadows
Definition: engine.h:1471
float radius
Radius of marks.
Definition: engine.h:457
Number of items in enum.
Definition: engine.h:548
std::vector< EngineShadow > m_shadows
Shadow list.
Definition: engine.h:1382
void DrawMouse()
Draws the mouse cursor.
Definition: engine.cpp:4749
int m_highlightRank[100]
Ranks of highlighted objects.
Definition: engine.h:1447
Point struct and related functions.
4x4 matrix
Definition: matrix.h:66
Tier 3 of base object tree (LOD)
Definition: engine.h:215
void DrawOverColor()
Draws the foreground color.
Definition: engine.cpp:4624
void DeleteAllGroundSpots()
Deletes all ground spots.
Definition: engine.cpp:1578
LODLevel
Level-of-detail.
Definition: modelfile.h:49
Larger crosshair.
Definition: engine.h:545
void SetRenderEnable(bool enable)
Enables/disables rendering.
Definition: engine.cpp:518
void DrawMouseSprite(Math::Point pos, Math::Point dim, int icon)
Draw part of mouse cursor sprite.
Definition: engine.cpp:4782
Math::Vector bboxMin
Bounding box min (origin 0,0,0 always included)
Definition: engine.h:256
Part 4.
Definition: engine.h:108
std::string m_error
Last encountered error.
Definition: engine.h:1336
void SetState(int state, const Color &color=Color(1.0f, 1.0f, 1.0f, 1.0f))
Sets the current rendering state.
Definition: engine.cpp:2065
TextureCreateParams m_defaultTexParams
Default texture create params.
Definition: engine.h:1459
float min
Min altitude.
Definition: engine.h:395
int shadowRank
Rank of the associated shadow.
Definition: engine.h:302
std::string m_lastTexture[2]
Last texture names for 2 used texture stages.
Definition: engine.h:1498
void DrawInterface()
Draws the user interface over the scene.
Definition: engine.cpp:3871
int GetStatisticTriangle()
Returns the number of triangles in current frame.
Definition: engine.cpp:557
float GetEyeDirV()
Returns the vertical direction angle of view.
Definition: engine.cpp:3151
Math::Matrix m_shadowBias
Texture bias for sampling shadow maps.
Definition: engine.h:1365
void SetSkyMode(bool present)
Management the mode of sky.
Definition: engine.cpp:3051
void SetBackground(const std::string &name, Color up=Color(), Color down=Color(), Color cloudUp=Color(), Color cloudDown=Color(), bool full=false)
Management of the background image to use.
Definition: engine.cpp:2829
TEST_VIRTUAL bool GetPause()
Get pause mode.
Definition: engine.cpp:493
Texture LoadTexture(const std::string &name)
Loads texture, creating it if not already present.
Definition: engine.cpp:2347
Always use 2nd floor texturing.
Definition: engine.h:114
float max
Max altitude.
Definition: engine.h:397
void SetFogStart(float start, int rank=0)
Management the start of fog.
Definition: engine.cpp:2819
Definition: singleton.h:30
Increase.
Definition: engine.h:433
Fixed object type metal.
Definition: engine.h:183
int CreateGroundSpot()
Creates a new ground spot and returns its rank.
Definition: engine.cpp:1601
Texture m_miceTexture
Texture with mouse cursors.
Definition: engine.h:1487
Math::Vector m_eyePt
Location of camera.
Definition: engine.h:1389
Texture struct and related enums.
void TrackTextureMapping(int objRank, const Material &mat, int state, const std::string &tex1Name, const std::string &tex2Name, int lodLevelMask, EngineTextureMapping mode, float pos, float factor, float tl, float ts, float tt)
Changes texture mapping for robot tracks.
Definition: engine.cpp:1256
EngineRenderState
Render state of graphics engine.
Definition: engine.h:81
Math::Point m_mouseSize
Size of mouse cursor.
Definition: engine.h:1489
int icon1
Index of texture element for 1st image.
Definition: engine.h:558
Normal opaque materials.
Definition: engine.h:84
std::set< std::string > m_texBlacklist
Blacklist map of textures.
Definition: engine.h:1482
void SetLightMode(bool present)
Managing the mode of dynamic lights.
Definition: engine.cpp:3081
TEST_VIRTUAL Math::Vector GetLookatPt()
Returns the camera target point.
Definition: engine.cpp:3141
float radius
Radius of the shadow.
Definition: engine.h:403
void ApplyChange()
Updates the scene after a change of parameters.
Definition: engine.cpp:3166
const Math::Matrix & GetMatView()
Returns the view matrix.
Definition: engine.cpp:3131
bool LoadAllTextures()
Loads all necessary textures.
Definition: engine.cpp:2370
Scroll to the left.
Definition: engine.h:537
void SetFogColor(const Color &color, int rank=0)
Management of the fog color.
Definition: engine.cpp:2796
Manager for dynamic lights in 3D scene.
Definition: lightman.h:144
bool DetectTriangle(Math::Point mouse, VertexTex2 *triangle, int objRank, float &dist)
Detects whether the mouse is in a triangle.
Definition: engine.cpp:1926
bool m_render
Rendering enabled?
Definition: engine.h:1347
float height
Height from the ground.
Definition: engine.h:365
Material of a surface.
Definition: material.h:44
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:2291
bool m_shadowMapping
true if shadow mapping enabled
Definition: engine.h:1467
Mode for rendering text.
Definition: engine.h:122
float drawRadius
Radius of the shadow drawn.
Definition: engine.h:407
Resize vertically.
Definition: engine.h:531
void SetTextureQuality(int value)
Management the quality of textures.
Definition: engine.cpp:2947
triangle is always visible, no matter at what distance
Definition: modelfile.h:51
void RenderShadowMap()
Renders shadow map.
Definition: engine.cpp:3493
A triangle drawn by the graphics engine.
Definition: engine.h:146
bool Create()
Performs the initialization; must be called after device was set.
Definition: engine.cpp:292
bool DetectBBox(int objRank, Math::Point mouse)
Detects whether an object is affected by the mouse.
Definition: engine.cpp:1808
float m_shadowColor
Shadow color.
Definition: engine.h:1473
Fixed object.
Definition: engine.h:175
bool drawFront
If true, the shape is before the 2D interface.
Definition: engine.h:294
Color color
Color of the shadow.
Definition: engine.h:393
void SetOverFront(bool front)
Specifies whether to draw the foreground.
Definition: engine.cpp:2878
CLightning * GetLightning()
Returns the lighting manager.
Definition: engine.cpp:272
Math::Vector pos
Position of the shadow.
Definition: engine.h:355
EngineGroundMarkPhase phase
Phase of life.
Definition: engine.h:449
void SetTerrainVision(float vision)
Defines of the distance field of vision.
Definition: engine.cpp:2668
Cloud layer renderer.
Definition: cloud.h:78
void DeleteAllBaseObjects()
Deletes all base objects.
Definition: engine.cpp:670
Lightning effect renderer.
Definition: lightning.h:54
Fixed object type quartz.
Definition: engine.h:181
void DeleteShadow(int objRank)
Deletes the shadow for given object.
Definition: engine.cpp:1381
float m_focus
Camera angle for 3D scene.
Definition: engine.h:1356
void SetMouseType(EngineMouseType type)
Management of mouse cursor type.
Definition: engine.cpp:3121
Particle engine.
Definition: particle.h:268
Math::Vector drawPos
Draw position for marks.
Definition: engine.h:461
bool WriteScreenShot(const std::string &fileName, int width, int height)
Writes a screenshot containing the current frame.
Definition: engine.cpp:475
float radius
Radius of the sphere at the origin.
Definition: engine.h:260
Color m_lastColor
Last color set with render state.
Definition: engine.h:1496
void SetShadowColor(float value)
Management of shadow mapping.
Definition: engine.cpp:2707
void ResetAfterDeviceChanged()
Resets some states and flushes textures after device was changed (e.g. resoulution changed) ...
Definition: engine.cpp:368
void FrameUpdate()
Called once per frame, the call is the entry point for animating the scene.
Definition: engine.cpp:406
The transparent texture (black = no)
Definition: engine.h:86
Type of shadow drawn by the graphics engine.
Math::Point WindowToInterfaceSize(Math::IntPoint size)
Conversion functions between window and interface sizes.
Definition: engine.cpp:540
A spot (large shadow) drawn on the ground by the graphics engine.
Definition: engine.h:388
The transparent color (white = no)
Definition: engine.h:120
Math::Vector pos
Position for marks.
Definition: engine.h:455
Color structs and related functions.
float fix
Fixed time.
Definition: engine.h:453
TODO: ?
Definition: engine.h:337
Decrease.
Definition: engine.h:437
Planet manager.
Definition: planet.h:82
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:2037
Resize diagonally bottom-left to top-right.
Definition: engine.h:533
Scroll to the right.
Definition: engine.h:539
void SetAmbientColor(const Color &color, int rank=0)
Ambient color management.
Definition: engine.cpp:2776
The transparent color (black = no)
Definition: engine.h:118
void Destroy()
Frees all resources before exit.
Definition: engine.cpp:339
float angle
Angle of the shadow.
Definition: engine.h:359
Part 2.
Definition: engine.h:104
Only opaque color, no texture, blending, etc.
Definition: engine.h:126
Parameters for texture creation.
Definition: texture.h:154
void SetDeepView(float length, int rank=0, bool ref=false)
Management of the depth of field.
Definition: engine.cpp:2806
void DrawShadow()
Draws shadows.
Definition: engine.cpp:4263
void AddBaseObjTriangles(int baseObjRank, const std::vector< VertexTex2 > &vertices, EngineTriangleType triangleType, const Material &material, int state, std::string tex1Name, std::string tex2Name, LODLevel lodLevel, bool globalUpdate)
Adds triangles to given object with the specified params.
Definition: engine.cpp:729
void Draw3DScene()
Prepares the interface for 3D scene.
Definition: engine.cpp:3227
Material material
Material.
Definition: engine.h:151
std::string tex2Name
2nd texture
Definition: engine.h:157
void SetTotoMode(bool present)
Management mode of toto.
Definition: engine.cpp:3011
Vertex structs.
void SetWaterAddColor(const Color &color)
Color management under water.
Definition: engine.cpp:2786
Hand.
Definition: engine.h:519
Matrix struct and related functions.
int state
Render state.
Definition: engine.h:153
void SetMaterial(const Material &mat)
Sets the current material.
Definition: engine.cpp:2285
Math::Point m_highlightP1
Highlight rectangle points.
Definition: engine.h:1454
EngineShadowType type
Type of shadow.
Definition: engine.h:353
void SetShowStats(bool show)
Management of displaying statistic information.
Definition: engine.cpp:508
EngineBaseObjLODTier & AddLevel3(EngineBaseObjTexTier &p2, LODLevel lodLevel)
Creates a new tier 3 object (LOD)
Definition: engine.cpp:590
void SetDrawFront(bool draw)
Whether to draw the world on the interface.
Definition: engine.cpp:2771
void SetEditIndentMode(bool autoIndent)
Management of the indentation mode while editing (CEdit)
Definition: engine.cpp:3091
VertexTex2 triangle[3]
Triangle vertices.
Definition: engine.h:149
2D point
Definition: point.h:49
int icon2
Index of texture element for 2nd image.
Definition: engine.h:560
bool used
If true, object is valid in objects vector.
Definition: engine.h:286
EngineBaseObjDataTier * FindTriangles(int objRank, const Material &material, int state, std::string tex1Name, std::string tex2Name, int lodLevelMask)
Returns the first found tier 4 engine object for the given params or nullptr if not found...
Definition: engine.cpp:1031
void SetStatisticPos(Math::Vector pos)
Sets the coordinates to display in stats window.
Definition: engine.cpp:562
Image loaded from file.
Definition: image.h:57
bool hide
If true, shadow is invisible (object being carried for example)
Definition: engine.h:349
bool m_offscreenShadowRendering
true enables offscreen shadow rendering
Definition: engine.h:1469
Main application.
Definition: app.h:187
void Render()
Called once per frame, the call is the entry point for rendering.
Definition: engine.cpp:3188
Model loading - CModelFile class (aka modfile)
void DebugObject(int rank)
Print debug info about an object.
Definition: engine.cpp:813
EngineBaseObjTexTier & AddLevel2(EngineBaseObject &p1, const std::string &tex1Name, const std::string &tex2Name)
Creates a new tier 2 object (texture)
Definition: engine.cpp:578
void DrawForegroundImage()
Draws the image foreground.
Definition: engine.cpp:4588
Math::Matrix m_matViewInterface
View matrix for 2D interface.
Definition: engine.h:1372
CTerrain * GetTerrain()
Returns the terrain manager.
Definition: engine.cpp:262
Shadow drawn by the graphics engine.
Definition: engine.h:344
void SetGroundSpot(bool mode)
Management of the global mode of marking.
Definition: engine.cpp:2687
void SetEditIndentValue(int value)
Management of tab indent when editing (CEdit)
Definition: engine.cpp:3101
void SetObjectBaseRank(int objRank, int baseObjRank)
Management of the base object rank for engine object.
Definition: engine.cpp:939
Math::Vector bboxMax
bounding box max (origin 0,0,0 always included)
Definition: engine.h:258
TEST_VIRTUAL Math::Vector GetEyePt()
Returns the camera center point.
Definition: engine.cpp:3136
CWater * GetWater()
Returns the water manager.
Definition: engine.cpp:267
float smooth
Transition area.
Definition: engine.h:399
Null phase.
Definition: engine.h:431
Texture CreateTexture(const std::string &texName, const TextureCreateParams &params, CImage *image=nullptr)
Create texture and add it to cache.
Definition: engine.cpp:2308
EngineGroundMark m_groundMark
Ground mark.
Definition: engine.h:1386
Management of pause modes.
CText * GetText()
Returns the text rendering engine.
Definition: engine.cpp:247
Math::IntPoint m_size
Current size of viewport window.
Definition: engine.h:1375
Part 3.
Definition: engine.h:106
Terrain loader/generator and manager.
Definition: terrain.h:222
std::vector< EngineObject > m_objects
Object parameters.
Definition: engine.h:1380
void SetObjectDrawFront(int objRank, bool draw)
Sets drawFront for given object.
Definition: engine.cpp:989
Resize diagonally top-left to bottom-right.
Definition: engine.h:535
bool visible
If true, the object is drawn.
Definition: engine.h:290
The transparent diffuse color.
Definition: engine.h:90
EngineObject()
Calls LoadDefault()
Definition: engine.h:307
EngineMouseType
Type of mouse cursor displayed in-game.
Definition: engine.h:510
void DrawPlanet()
Draws all the planets.
Definition: engine.cpp:4572
Namespace for (new) graphics code.
Definition: app.h:49
int CreateObject()
Creates a new object and returns its rank.
Definition: engine.cpp:890
void SetTerrain(CTerrain *terrain)
Sets the terrain object.
Definition: engine.cpp:287
void SetForegroundName(const std::string &name)
Specifies the name of foreground texture.
Definition: engine.cpp:2864
void SetGadgetQuantity(float value)
The amount of management objects gadgets.
Definition: engine.cpp:2934
float drawRadius
Radius for marks.
Definition: engine.h:463
float radius
Radius of the shadow.
Definition: engine.h:361
EngineRenderState mode1
Mode to render 1st image in.
Definition: engine.h:564
Vector struct and related functions.
The graphics engine.
Definition: engine.h:684
int dx
X dimension of table.
Definition: engine.h:467
void SetObjectTransform(int objRank, const Math::Matrix &transform)
Management of object transform.
Definition: engine.cpp:968
Normal cursor (arrow)
Definition: engine.h:513
Math::Matrix m_shadowViewMat
View matrix for rendering shadow maps.
Definition: engine.h:1361
Double white texturing.
Definition: engine.h:100
Object drawn by the graphics engine.
Definition: engine.h:283
Math::Matrix m_shadowTextureMat
Texture matrix for rendering shadow maps.
Definition: engine.h:1363
float GetEyeDirH()
Returns the horizontal direction angle of view.
Definition: engine.cpp:3146
EngineBaseObjDataTier & AddLevel4(EngineBaseObjLODTier &p3, EngineTriangleType type, const Material &mat, int state)
Creates a new tier 4 object (data)
Definition: engine.cpp:602
EngineMouseType m_mouseType
Type of mouse cursor.
Definition: engine.h:1491
void Update()
Updates the state after creating objects.
Definition: engine.cpp:1801
Event types, structs and event queue.
void UpdateGroundSpotTextures()
Updates the textures used for drawing ground spot.
Definition: engine.cpp:3995
EngineTriangleType
Type of triangles drawn for engine objects.
Definition: engine.h:134
void DeleteGroundSpot(int rank)
Deletes the given ground spot.
Definition: engine.cpp:1621
int dy
Y dimension of table.
Definition: engine.h:469
Info about a texture.
Definition: texture.h:282
void AddBaseObjQuick(int baseObjRank, const EngineBaseObjDataTier &buffer, std::string tex1Name, std::string tex2Name, LODLevel lodLevel, bool globalUpdate)
Adds a tier 4 engine object directly.
Definition: engine.cpp:772
void SetHighlightRank(int *rankList)
Lists the ranks of objects and subobjects selected.
Definition: engine.cpp:1521
System functions: time stamps, info dialogs, etc.
Math::Vector normal
Normal to the terrain.
Definition: engine.h:357
Math::Matrix m_shadowProjMat
Projection matrix for rendering shadow maps.
Definition: engine.h:1359
Math::Matrix m_matWorldInterface
World matrix for 2D interface.
Definition: engine.h:1368
void ComputeDistance()
Calculates the distances between the viewpoint and the origin of different objects.
Definition: engine.cpp:1689
void SetShadow(bool mode)
Management of the global mode of shading.
Definition: engine.cpp:2697
int m_lastState
Last engine render state (-1 at the beginning of frame)
Definition: engine.h:1494
void SetOverColor(const Color &color=Color(), int mode=ENG_RSTATE_TCOLOR_BLACK)
Sets the foreground overlay color.
Definition: engine.cpp:2883
Information about mouse cursor.
Definition: engine.h:555
void SetDirty(bool mode)
Management of the global mode of contamination.
Definition: engine.cpp:2717
Math::Matrix transform
Transformation matrix.
Definition: engine.h:298
void DrawBackgroundImage()
Draws the image background.
Definition: engine.cpp:4513
bool m_interfaceMode
True when drawing 2D UI.
Definition: engine.h:1503
Moving object.
Definition: engine.h:177
Image using alpha channel.
Definition: engine.h:112
bool draw
If true, draw mark.
Definition: engine.h:447
Water manager/renderer.
Definition: water.h:118
Only opaque texture, no blending, etc.
Definition: engine.h:124
bool IsVisiblePoint(const Math::Vector &pos)
Indicates whether a point is visible.
Definition: engine.cpp:3156
TexFilter
General texture filtering mode.
Definition: texture.h:61
void SetClippingDistance(float value)
Management of the distance of clipping.
Definition: engine.cpp:2909
void LoadZero()
Loads the zero vector (0, 0, 0)
Definition: vector.h:76
std::map< std::string, Texture > m_texNameMap
Map of loaded textures (by name)
Definition: engine.h:1476
Resize.
Definition: engine.h:527
EngineTextureMapping
Type of texture mapping.
Definition: engine.h:495
Text rendering engine.
Definition: text.h:239
void UseShadowMapping(bool enable)
Enables or disables shadow mapping.
Definition: engine.cpp:3684
void SetTextureFilterMode(TexFilter value)
Management the texture filter mode.
Definition: engine.cpp:2964
3D (3x1) vector
Definition: vector.h:52
int iconShadow
Shadow texture part.
Definition: engine.h:562
bool drawWorld
If true, object is behind the 2D interface.
Definition: engine.h:292
Tier 4 of object tree (data)
Definition: engine.h:191
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:1665
Math::Matrix m_matView
View matrix for 3D scene.
Definition: engine.h:1354
std::vector< EngineGroundSpot > m_groundSpots
Ground spot list.
Definition: engine.h:1384
Definition: system_linux.h:30
Part of a moving object.
Definition: engine.h:179
void SetShadowMapping(bool value)
Management of shadow mapping.
Definition: engine.cpp:3001
Surfaces.
Definition: engine.h:139
int CreateBaseObject()
Creates a base object and returns its rank.
Definition: engine.cpp:615
A mark on ground drawn by the graphics engine.
Definition: engine.h:444
2D Point with integer coords
Definition: intpoint.h:38
bool GetBBox2D(int objRank, Math::Point &min, Math::Point &max)
Compute and return the 2D box on screen of any object.
Definition: engine.cpp:1531
void UpdateStaticBuffer(EngineBaseObjDataTier &p4)
Updates a given static buffer.
Definition: engine.cpp:1750
CLightManager * GetLightManager()
Returns the light manager.
Definition: engine.cpp:252
void SetSecondTexture(const std::string &texNum)
Management of the global mode of secondary texturing.
Definition: engine.cpp:2737
CParticle * GetParticle()
Returns the particle manager.
Definition: engine.cpp:257
std::map< Texture, std::string > m_revTexNameMap
Reverse map of loaded textures (by texture)
Definition: engine.h:1478
RGBA color.
Definition: color.h:38
void UpdateStaticBuffers()
Updates static buffers of changed objects.
Definition: engine.cpp:1766
Triangles.
Definition: engine.h:137
void DrawStats()
Draw statistic texts.
Definition: engine.cpp:4815
void DeleteTexture(const std::string &name)
Deletes the given texture, unloading it and removing from cache.
Definition: engine.cpp:2599
bool ChangeTextureColor(const std::string &texName, 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:2469
void DrawObject(const EngineBaseObjDataTier &p4)
Draw 3D object.
Definition: engine.cpp:3845
bool m_showStats
Whether to show stats (FPS, etc)
Definition: engine.h:1344
void UpdateGeometry()
Updates geometric parameters of objects (bounding box and radius)
Definition: engine.cpp:1704
void SetDevice(CDevice *device)
Sets the device to be used.
Definition: engine.cpp:237
std::vector< EngineBaseObject > m_baseObjects
Base objects (also level 1 tier list)
Definition: engine.h:1378
float distance
Distance to object from eye point.
Definition: engine.h:300
Scroll up.
Definition: engine.h:541
Event sent by system, interface or game.
Definition: event.h:678
float intensity
Intensity of the shadow.
Definition: engine.h:363
Definition: pausemanager.h:44
IntPoint struct.
CPlanet * GetPlanet()
Returns the planet manager.
Definition: engine.cpp:277
void DrawTimer()
Draw mission timer.
Definition: engine.cpp:4969
void DeleteGroundMark(int rank)
Deletes the ground mark.
Definition: engine.cpp:1684
void SetObjectDrawWorld(int objRank, bool draw)
Sets drawWorld for given object.
Definition: engine.cpp:982
int baseObjRank
Rank of associated base engine object.
Definition: engine.h:288
char * table
Pointer to the table.
Definition: engine.h:471
int m_textureAnisotropy
Requested texture anisotropy level.
Definition: engine.h:1465
Definition: object.h:357
Math::IntPoint GetWindowSize()
Returns current size of viewport window.
Definition: engine.cpp:523
Texture borders with solid color.
Definition: engine.h:94
The transparent texture (white = no)
Definition: engine.h:88
void SetDrawWorld(bool draw)
Whether to draw the world.
Definition: engine.cpp:2766
CDevice * GetDevice()
Returns the current device.
Definition: engine.cpp:242
int GetObjectTotalTriangles(int objRank)
Returns the total number of triangles of given object.
Definition: engine.cpp:1018
TODO: ?
Definition: engine.h:523
bool used
If true, base object is valid in objects vector.
Definition: engine.h:252
EngineGroundMarkPhase
Phase of life of an EngineGroundMark.
Definition: engine.h:428
Sound plugin interface.
Definition: sound.h:151
Causes the fog.
Definition: engine.h:116
Part 1 (no change in. MOD!)
Definition: engine.h:102
void DeleteAllObjects()
Deletes all objects, shadows and ground spots.
Definition: engine.cpp:920
void UpdateMatProj()
Resets the projection matrix after changes.
Definition: engine.cpp:3161
Abstract interface of graphics device.
Definition: device.h:251
bool IsVisible(int objRank)
Tests whether the given object is visible.
Definition: engine.cpp:1978
Double black texturing.
Definition: engine.h:98
int objRank
Rank of the associated object.
Definition: engine.h:351
bool ProcessEvent(const Event &event)
Processes incoming event.
Definition: engine.cpp:379
int GetPartialTriangles(int objRank, int lodLevelMask, float percent, int maxCount, std::vector< EngineTriangle > &triangles)
Returns a partial list of triangles for given object.
Definition: engine.cpp:1075
Texture wrap.
Definition: engine.h:92
Definition: engine.h:249
void DrawBackgroundGradient(const Color &up, const Color &down)
Draws the gradient background.
Definition: engine.cpp:4483
void FlushTextureCache()
Empties the texture cache.
Definition: engine.cpp:2630
void SetFocus(float focus)
Management of camera angle.
Definition: engine.cpp:2673
CCloud * GetCloud()
Returns the fog manager.
Definition: engine.cpp:282