Colobot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
engine.h
Go to the documentation of this file.
1 // * This file is part of the COLOBOT source code
2 // * Copyright (C) 2001-2008, Daniel ROUX& EPSITEC SA, www.epsitec.ch
3 // * Copyright (C) 2012, Polish Portal of Colobot (PPC)
4 // *
5 // * This program is free software: you can redistribute it and/or modify
6 // * it under the terms of the GNU General Public License as published by
7 // * the Free Software Foundation, either version 3 of the License, or
8 // * (at your option) any later version.
9 // *
10 // * This program is distributed in the hope that it will be useful,
11 // * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // * GNU General Public License for more details.
14 // *
15 // * You should have received a copy of the GNU General Public License
16 // * along with this program. If not, see http://www.gnu.org/licenses/.
17 
23 #pragma once
24 
25 
26 #include "app/system.h"
27 #include "app/pausemanager.h"
28 
29 #include "common/event.h"
30 #include "common/singleton.h"
31 
32 #include "graphics/core/color.h"
33 #include "graphics/core/material.h"
34 #include "graphics/core/texture.h"
35 #include "graphics/core/vertex.h"
36 
38 
39 #include "math/intpoint.h"
40 #include "math/matrix.h"
41 #include "math/point.h"
42 #include "math/vector.h"
43 
44 
45 #include <string>
46 #include <vector>
47 #include <map>
48 #include <set>
49 
50 
51 class CApplication;
52 class CObject;
53 class CSoundInterface;
54 class CImage;
55 
56 
57 // Graphics module namespace
58 namespace Gfx {
59 
60 
61 class CDevice;
62 class CLightManager;
63 class CText;
64 class CParticle;
65 class CWater;
66 class CCloud;
67 class CLightning;
68 class CPlanet;
69 class CTerrain;
70 
71 
80 {
90  ENG_RSTATE_WRAP = (1<<3),
92  ENG_RSTATE_CLAMP = (1<<4),
94  ENG_RSTATE_LIGHT = (1<<5),
104  ENG_RSTATE_PART3 = (1<<10),
106  ENG_RSTATE_PART4 = (1<<11),
108  ENG_RSTATE_2FACE = (1<<12),
110  ENG_RSTATE_ALPHA = (1<<13),
112  ENG_RSTATE_SECOND = (1<<14),
114  ENG_RSTATE_FOG = (1<<15),
120  ENG_RSTATE_TEXT = (1<<18),
125 };
126 
127 
133 {
138 };
139 
145 {
151  int state;
153  std::string tex1Name;
155  std::string tex2Name;
156 
157  inline EngineTriangle()
158  {
160  }
161 };
162 
167 {
182 };
183 
184 
190 {
191  EngineTriangleType type;
192  Material material;
193  int state;
194  std::vector<VertexTex2> vertices;
195  unsigned int staticBufferId;
196  bool updateStaticBuffer;
197 
199  const Material& _material = Material(),
200  int _state = ENG_RSTATE_NORMAL)
201  : type(_type)
202  , material(_material)
203  , state(_state)
204  , staticBufferId(0)
205  , updateStaticBuffer(false)
206  {}
207 };
208 
214 {
215  LODLevel lodLevel;
216  std::vector<EngineBaseObjDataTier> next;
217 
218  inline EngineBaseObjLODTier(LODLevel _lodLevel = LOD_Constant)
219  : lodLevel(_lodLevel)
220  {}
221 };
222 
228 {
229  std::string tex1Name;
230  Texture tex1;
231  std::string tex2Name;
232  Texture tex2;
233  std::vector<EngineBaseObjLODTier> next;
234 
235  inline EngineBaseObjTexTier(const std::string& _tex1Name = "", const std::string& _tex2Name = "")
236  : tex1Name(_tex1Name)
237  , tex2Name(_tex2Name)
238  {}
239 };
240 
248 {
250  bool used;
258  float radius;
260  std::vector<EngineBaseObjTexTier> next;
261 
262  inline EngineBaseObject()
263  {
264  LoadDefault();
265  }
266 
267  inline void LoadDefault()
268  {
269  used = false;
270  totalTriangles = 0;
271  bboxMax.LoadZero();
272  bboxMin.LoadZero();
273  radius = 0.0f;
274  }
275 };
276 
282 {
284  bool used;
288  bool visible;
290  bool drawWorld;
292  bool drawFront;
298  float distance;
303 
305  inline EngineObject()
306  {
307  LoadDefault();
308  }
309 
311  inline void LoadDefault()
312  {
313  used = false;
314  baseObjRank = -1;
315  visible = false;
316  drawWorld = false;
317  drawFront = false;
320  distance = 0.0f;
321  shadowRank = -1;
322  transparency = 0.0f;
323  }
324 };
325 
331 {
336 };
337 
343 {
345  bool used;
347  bool hide;
349  int objRank;
357  float angle;
359  float radius;
361  float intensity;
363  float height;
364 
365  inline EngineShadow()
366  {
367  LoadDefault();
368  }
369 
370  inline void LoadDefault()
371  {
372  used = false;
373  hide = false;
374  objRank = 0;
376  pos.LoadZero();
377  normal.LoadZero();
378  angle = radius = intensity = height = 0.0f;
379  }
380 };
381 
387 {
389  bool used;
393  float min;
395  float max;
397  float smooth;
401  float radius;
405  float drawRadius;
406 
407  inline EngineGroundSpot()
408  {
409  LoadDefault();
410  }
411 
412  inline void LoadDefault()
413  {
414  used = false;
415  color = Color();
416  pos.LoadZero();
417  drawPos.LoadZero();
418  min = max = smooth = radius = drawRadius = 0.0f;
419  }
420 };
421 
427 {
436 };
437 
443 {
445  bool draw;
449  float delay[3];
451  float fix;
455  float radius;
457  float intensity;
461  float drawRadius;
465  int dx;
467  int dy;
469  char* table;
470 
471  inline EngineGroundMark()
472  {
473  LoadDefault();
474  }
475 
476  inline void LoadDefault()
477  {
478  draw = false;
480  pos = Math::Vector();
481  drawPos = Math::Vector();
482  delay[0] = delay[1] = delay[2] = 0.0f;
484  dx = dy = 0;
485  table = nullptr;
486  }
487 };
488 
494 {
495  ENG_TEX_MAPPING_X = 1,
496  ENG_TEX_MAPPING_Y = 2,
497  ENG_TEX_MAPPING_Z = 3,
498  ENG_TEX_MAPPING_1X = 4,
499  ENG_TEX_MAPPING_1Y = 5,
500  ENG_TEX_MAPPING_1Z = 6
501 };
502 
503 
509 {
544 
547 };
548 
554 {
556  int icon1;
558  int icon2;
567 
568  inline EngineMouse(int _icon1 = -1, int _icon2 = -1, int _iconShadow = -1,
571  Math::Point _hotPoint = Math::Point())
572  : icon1(_icon1)
573  , icon2(_icon2)
574  , iconShadow(_iconShadow)
575  , mode1(_mode1)
576  , mode2(_mode2)
577  , hotPoint(_hotPoint)
578  {}
579 };
580 
581 
682 class CEngine : public CSingleton<CEngine>
683 {
684 public:
685  CEngine(CApplication* app);
686  ~CEngine();
687 
689  void SetDevice(CDevice* device);
691  CDevice* GetDevice();
692 
694  CText* GetText();
700  CTerrain* GetTerrain();
702  CWater* GetWater();
706  CPlanet* GetPlanet();
708  CCloud* GetCloud();
709 
711  void SetTerrain(CTerrain* terrain);
712 
713 
715  bool Create();
717  void Destroy();
718 
721 
722 
724  void Render();
725 
726 
728  bool ProcessEvent(const Event& event);
729 
731  void FrameUpdate();
732 
733 
735  bool WriteScreenShot(const std::string& fileName, int width, int height);
736 
737 
739  TEST_VIRTUAL bool GetPause();
740 
742  void SetMovieLock(bool lock);
744  bool GetMovieLock();
746 
748  void SetShowStats(bool show);
750  bool GetShowStats();
752 
754  void SetRenderEnable(bool enable);
755 
758 
760 
764  Math::IntPoint InterfaceToWindowCoords(Math::Point pos);
766 
768 
771  Math::IntPoint InterfaceToWindowSize(Math::Point size);
773 
775  void AddStatisticTriangle(int nb);
777  int GetStatisticTriangle();
778 
779 
780  /* *************** Object management *************** */
781 
782  // Base objects
783 
785  int CreateBaseObject();
787  void DeleteBaseObject(int baseObjRank);
789  void DeleteAllBaseObjects();
790 
792  void CopyBaseObject(int sourceBaseObjRank, int destBaseObjRank);
793 
795  void AddBaseObjTriangles(int baseObjRank, const std::vector<VertexTex2>& vertices,
796  EngineTriangleType triangleType,
797  const Material& material, int state,
798  std::string tex1Name, std::string tex2Name,
799  LODLevel lodLevel, bool globalUpdate);
800 
802  void AddBaseObjQuick(int baseObjRank, const EngineBaseObjDataTier& buffer,
803  std::string tex1Name, std::string tex2Name,
804  LODLevel lodLevel, bool globalUpdate);
805 
806  // Objects
807 
809  void DebugObject(int rank);
810 
812  int CreateObject();
814  void DeleteAllObjects();
816  void DeleteObject(int objRank);
817 
819  void SetObjectBaseRank(int objRank, int baseObjRank);
821  int GetObjectBaseRank(int objRank);
823 
825  void SetObjectType(int objRank, EngineObjectType type);
827  EngineObjectType GetObjectType(int objRank);
829 
831  void SetObjectTransform(int objRank, const Math::Matrix& transform);
833  void GetObjectTransform(int objRank, Math::Matrix& transform);
835 
837  void SetObjectDrawWorld(int objRank, bool draw);
839  void SetObjectDrawFront(int objRank, bool draw);
840 
842  void SetObjectTransparency(int objRank, float value);
843 
845  void GetObjectBBox(int objRank, Math::Vector& min, Math::Vector& max);
846 
848  int GetObjectTotalTriangles(int objRank);
849 
851  EngineBaseObjDataTier* FindTriangles(int objRank, const Material& material,
852  int state, std::string tex1Name, std::string tex2Name,
853  int lodLevelMask);
854 
856  int GetPartialTriangles(int objRank, int lodLevelMask, float percent, int maxCount,
857  std::vector<EngineTriangle>& triangles);
858 
860  void ChangeSecondTexture(int objRank, const std::string& tex2Name);
861 
863  void ChangeTextureMapping(int objRank, const Material& mat, int state,
864  const std::string& tex1Name, const std::string& tex2Name,
865  int lodLevelMask, EngineTextureMapping mode,
866  float au, float bu, float av, float bv);
867 
869  void TrackTextureMapping(int objRank, const Material& mat, int state,
870  const std::string& tex1Name, const std::string& tex2Name,
871  int lodLevelMask, EngineTextureMapping mode,
872  float pos, float factor, float tl, float ts, float tt);
873 
875 
876  int DetectObject(Math::Point mouse);
877 
879  void CreateShadow(int objRank);
881  void DeleteShadow(int objRank);
882 
884  void SetObjectShadowHide(int objRank, bool hide);
886  void SetObjectShadowType(int objRank, EngineShadowType type);
887  void SetObjectShadowPos(int objRank, const Math::Vector& pos);
888  void SetObjectShadowNormal(int objRank, const Math::Vector& normal);
889  void SetObjectShadowAngle(int objRank, float angle);
890  void SetObjectShadowRadius(int objRank, float radius);
891  void SetObjectShadowIntensity(int objRank, float intensity);
892  void SetObjectShadowHeight(int objRank, float height);
893  float GetObjectShadowRadius(int objRank);
895 
897  void SetHighlightRank(int* rankList);
899  bool GetHighlight(Math::Point& p1, Math::Point& p2);
900 
902  void DeleteAllGroundSpots();
904  int CreateGroundSpot();
906  void DeleteGroundSpot(int rank);
907 
909  void SetObjectGroundSpotPos(int rank, const Math::Vector& pos);
911  void SetObjectGroundSpotRadius(int rank, float radius);
912  void SetObjectGroundSpotColor(int rank, const Color& color);
913  void SetObjectGroundSpotMinMax(int rank, float min, float max);
914  void SetObjectGroundSpotSmooth(int rank, float smooth);
916 
918  void CreateGroundMark(Math::Vector pos, float radius,
919  float delay1, float delay2, float delay3,
920  int dx, int dy, char* table);
922  void DeleteGroundMark(int rank);
923 
925  void Update();
926 
927 
928  /* *************** Mode setting *************** */
929 
931  void SetState(int state, const Color& color = Color(1.0f, 1.0f, 1.0f, 1.0f));
932 
934  void SetMaterial(const Material& mat);
935 
937  void SetViewParams(const Math::Vector& eyePt, const Math::Vector& lookatPt,
938  const Math::Vector& upVec, float eyeDistance);
939 
941  Texture LoadTexture(const std::string& name);
943  Texture LoadTexture(const std::string& name, CImage* image);
945  Texture LoadTexture(const std::string& name, const TextureCreateParams& params);
947  bool LoadAllTextures();
948 
950  bool ChangeTextureColor(const std::string& texName,
951  Color colorRef1, Color colorNew1,
952  Color colorRef2, Color colorNew2,
953  float tolerance1, float tolerance2,
954  Math::Point ts, Math::Point ti,
955  Math::Point *exclude = nullptr,
956  float shift = 0.0f, bool hsv = false);
957 
959 
960  bool SetTexture(const std::string& name, int stage = 0);
962  void SetTexture(const Texture& tex, int stage = 0);
963 
965  void DeleteTexture(const std::string& name);
967  void DeleteTexture(const Texture& tex);
968 
970  void FlushTextureCache();
971 
973  void SetTerrainVision(float vision);
974 
976 
980  void SetFocus(float focus);
981  float GetFocus();
983 
985  void SetGroundSpot(bool mode);
987  bool GetGroundSpot();
989 
991  void SetShadow(bool mode);
993  bool GetShadow();
995 
997  void SetDirty(bool mode);
999  bool GetDirty();
1001 
1003  void SetFog(bool mode);
1005  bool GetFog();
1007 
1009  void SetSecondTexture(int texNum);
1011  int GetSecondTexture();
1013 
1015  void SetRankView(int rank);
1017  int GetRankView();
1019 
1021  void SetDrawWorld(bool draw);
1022 
1024  void SetDrawFront(bool draw);
1025 
1027  void SetAmbientColor(const Color& color, int rank = 0);
1029  Color GetAmbientColor(int rank = 0);
1031 
1033  void SetWaterAddColor(const Color& color);
1035  Color GetWaterAddColor();
1037 
1039  void SetFogColor(const Color& color, int rank = 0);
1041  Color GetFogColor(int rank = 0);
1043 
1045 
1048  void SetDeepView(float length, int rank = 0, bool ref=false);
1049  float GetDeepView(int rank = 0);
1051 
1052 
1054 
1057  void SetFogStart(float start, int rank = 0);
1058  float GetFogStart(int rank = 0);
1060 
1062  void SetBackground(const std::string& name, Color up = Color(), Color down = Color(),
1064  Color cloudUp = Color(), Color cloudDown = Color(),
1065  bool full = false);
1066  void GetBackground(std::string& name, Color& up, Color& down,
1067  Color& cloudUp, Color& cloudDown,
1068  bool& full);
1070 
1072  void SetForegroundName(const std::string& name);
1074  void SetOverFront(bool front);
1076  void SetOverColor(const Color& color = Color(), int mode = ENG_RSTATE_TCOLOR_BLACK);
1077 
1079  void SetParticleDensity(float value);
1081  float GetParticleDensity();
1083 
1085  float ParticleAdapt(float factor);
1086 
1088  void SetClippingDistance(float value);
1090  float GetClippingDistance();
1092 
1094  void SetObjectDetail(float value);
1096  float GetObjectDetail();
1098 
1100  void SetGadgetQuantity(float value);
1102  float GetGadgetQuantity();
1104 
1106  void SetTextureQuality(int value);
1108  int GetTextureQuality();
1110 
1112  void SetTotoMode(bool present);
1114  bool GetTotoMode();
1116 
1118  void SetLensMode(bool present);
1120  bool GetLensMode();
1122 
1124  void SetWaterMode(bool present);
1126  bool GetWaterMode();
1128 
1129  void SetLightingMode(bool present);
1130  bool GetLightingMode();
1131 
1133  void SetSkyMode(bool present);
1135  bool GetSkyMode();
1137 
1139  void SetBackForce(bool present);
1141  bool GetBackForce();
1143 
1145  void SetPlanetMode(bool present);
1147  bool GetPlanetMode();
1149 
1151  void SetLightMode(bool present);
1153  bool GetLightMode();
1155 
1157  // TODO: move to more appropriate class ?
1159  void SetEditIndentMode(bool autoIndent);
1160  bool GetEditIndentMode();
1162 
1164  // TODO: move to more appropriate class ?
1166  void SetEditIndentValue(int value);
1167  int GetEditIndentValue();
1169 
1171  void SetTracePrecision(float factor);
1173  float GetTracePrecision();
1175 
1177  void SetMouseType(EngineMouseType type);
1179  EngineMouseType GetMouseType();
1181 
1183  const Math::Matrix& GetMatView();
1185  TEST_VIRTUAL Math::Vector GetEyePt();
1187  TEST_VIRTUAL Math::Vector GetLookatPt();
1189  float GetEyeDirH();
1191  float GetEyeDirV();
1193  bool IsVisiblePoint(const Math::Vector& pos);
1194 
1196  void UpdateMatProj();
1197 
1199  void ApplyChange();
1200 
1201 protected:
1203  void Draw3DScene();
1205  void DrawObject(const EngineBaseObjDataTier& p4);
1207  void DrawInterface();
1208 
1210  void UpdateGroundSpotTextures();
1211 
1213  void DrawShadow();
1215  void DrawBackground();
1217  void DrawBackgroundGradient(const Color& up, const Color& down);
1219  void DrawBackgroundImage();
1221  void DrawPlanet();
1223  void DrawForegroundImage();
1225  void DrawOverColor();
1227  void DrawHighlight();
1229  void DrawMouse();
1231  void DrawMouseSprite(Math::Point pos, Math::Point dim, int icon);
1233  void DrawStats();
1234 
1236  EngineBaseObjTexTier& AddLevel2(EngineBaseObject& p1, const std::string& tex1Name, const std::string& tex2Name);
1241  const Material& mat, int state);
1242 
1244  Texture CreateTexture(const std::string &texName, const TextureCreateParams &params, CImage* image = nullptr);
1245 
1247  bool IsVisible(int objRank);
1248 
1250  bool IsWithinLODLimit(float distance, LODLevel lodLevel);
1251 
1253  bool DetectBBox(int objRank, Math::Point mouse);
1254 
1256  bool GetBBox2D(int objRank, Math::Point& min, Math::Point& max);
1257 
1259  bool DetectTriangle(Math::Point mouse, VertexTex2* triangle, int objRank, float& dist);
1260 
1262 
1263  bool TransformPoint(Math::Vector& p2D, int objRank, Math::Vector p3D);
1264 
1266  void ComputeDistance();
1267 
1269  void UpdateGeometry();
1270 
1273 
1275  void UpdateStaticBuffers();
1276 
1277 protected:
1278  CApplication* m_app;
1279  CSoundInterface* m_sound;
1280  CDevice* m_device;
1281  CText* m_text;
1282  CLightManager* m_lightMan;
1283  CParticle* m_particle;
1284  CWater* m_water;
1285  CCloud* m_cloud;
1286  CLightning* m_lightning;
1287  CPlanet* m_planet;
1288  CTerrain* m_terrain;
1289  CPauseManager* m_pause;
1290 
1292  std::string m_error;
1293 
1294  SystemTimeStamp* m_lastFrameTime;
1295  SystemTimeStamp* m_currentFrameTime;
1296  int m_fpsCounter;
1297  float m_fps;
1298 
1301  std::string m_fpsText;
1303  bool m_render;
1306 
1312  float m_focus;
1313 
1320 
1323 
1325  std::vector<EngineBaseObject> m_baseObjects;
1327  std::vector<EngineObject> m_objects;
1329  std::vector<EngineShadow> m_shadows;
1331  std::vector<EngineGroundSpot> m_groundSpots;
1334 
1339  float m_eyeDirH;
1340  float m_eyeDirV;
1341  int m_rankView;
1342  Color m_ambientColor[2];
1343  Color m_backColor[2];
1344  Color m_fogColor[2];
1345  float m_deepView[2];
1346  float m_fogStart[2];
1347  Color m_waterAddColor;
1348  int m_statisticTriangle;
1349  bool m_updateGeometry;
1350  bool m_updateStaticBuffers;
1351  int m_alphaMode;
1352  bool m_groundSpotVisible;
1353  bool m_shadowVisible;
1354  bool m_dirty;
1355  bool m_fog;
1356  bool m_firstGroundSpot;
1357  int m_secondTexNum;
1358  bool m_backgroundFull;
1359  std::string m_backgroundName;
1360  Texture m_backgroundTex;
1361  Color m_backgroundColorUp;
1362  Color m_backgroundColorDown;
1363  Color m_backgroundCloudUp;
1364  Color m_backgroundCloudDown;
1365  bool m_overFront;
1366  Color m_overColor;
1367  int m_overMode;
1368  std::string m_foregroundName;
1369  Texture m_foregroundTex;
1370  bool m_drawWorld;
1371  bool m_drawFront;
1372  float m_particleDensity;
1373  float m_clippingDistance;
1374  float m_lastClippingDistance;
1375  float m_objectDetail;
1376  float m_terrainVision;
1377  float m_gadgetQuantity;
1378  int m_textureQuality;
1379  bool m_totoMode;
1380  bool m_lensMode;
1381  bool m_waterMode;
1382  bool m_skyMode;
1383  bool m_backForce;
1384  bool m_planetMode;
1385  bool m_lightMode;
1386  bool m_editIndentMode;
1387  int m_editIndentValue;
1388  float m_tracePrecision;
1389 
1399  Math::Point m_highlightP2;
1401 
1406 
1408  std::map<std::string, Texture> m_texNameMap;
1410  std::map<Texture, std::string> m_revTexNameMap;
1412 
1414  std::set<std::string> m_texBlacklist;
1415 
1424 
1430  std::string m_lastTexture[2];
1433 
1436 
1437  bool m_debugLights;
1438  bool m_debugDumpLights;
1439 };
1440 
1441 
1442 } // namespace Gfx
1443 
void SetWaterMode(bool present)
Management the mode of water.
Definition: engine.cpp:2909
bool m_highlight
Highlight visible?
Definition: engine.h:1393
int DetectObject(Math::Point mouse)
Detects the target object that is selected with the mouse.
Definition: engine.cpp:1793
bool m_movieLock
Lock for duration of movie?
Definition: engine.h:1305
void SetFog(bool mode)
Management of the global mode of horizontal fog patches.
Definition: engine.cpp:2652
std::string tex1Name
1st texture
Definition: engine.h:153
void SetLensMode(bool present)
Management the mode of foreground.
Definition: engine.cpp:2899
void LoadIdentity()
Loads the identity matrix.
Definition: matrix.h:128
void GetObjectBBox(int objRank, Math::Vector &min, Math::Vector &max)
Returns the bounding box for an object.
Definition: engine.cpp:943
Edit (I-beam)
Definition: engine.h:515
EngineMouse m_mice[ENG_MOUSE_COUNT]
Mouse cursor definitions.
Definition: engine.h:1417
Normal shadow.
Definition: engine.h:333
float drawIntensity
Draw intensity for marks.
Definition: engine.h:463
float intensity
Color intensity.
Definition: engine.h:457
bool GetHighlight(Math::Point &p1, Math::Point &p2)
Returns the highlighted rectangle.
Definition: engine.cpp:1454
bool used
If true, ground spot is valid.
Definition: engine.h:389
void AddStatisticTriangle(int nb)
Increments the triangle counter for the current frame.
Definition: engine.cpp:502
Resize horizontally.
Definition: engine.h:527
void SetPlanetMode(bool present)
Management the mode of planets.
Definition: engine.cpp:2949
CSingleton base class for singletons.
Math::Matrix m_matProj
Projection matrix for 3D scene.
Definition: engine.h:1308
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:2572
Light texture (ambient max)
Definition: engine.h:94
void SetBackForce(bool present)
Management the mode of background.
Definition: engine.cpp:2939
float transparency
Transparency of the object [0, 1].
Definition: engine.h:302
float delay[3]
Times for 3 life phases.
Definition: engine.h:449
void SetMovieLock(bool lock)
Management of lock for the duration of movie sequence.
Definition: engine.cpp:448
Small cross.
Definition: engine.h:519
Fixed.
Definition: engine.h:433
float ParticleAdapt(float factor)
Adapts particle factor according to particle density.
Definition: engine.cpp:2826
Busy.
Definition: engine.h:513
void ChangeSecondTexture(int objRank, const std::string &tex2Name)
Changes the 2nd texure for given object.
Definition: engine.cpp:1104
void SetRankView(int rank)
Management of view mode.
Definition: engine.cpp:2672
EngineObjectType type
Type of object.
Definition: engine.h:294
Material struct.
Math::Point WindowToInterfaceCoords(Math::IntPoint pos)
Conversion functions between window and interface coordinates.
Definition: engine.cpp:478
Math::Matrix m_matProjInterface
Projection matrix for 2D interface.
Definition: engine.h:1317
void SetSecondTexture(int texNum)
Management of the global mode of secondary texturing.
Definition: engine.cpp:2662
Terrain.
Definition: engine.h:171
int totalTriangles
Number of triangles.
Definition: engine.h:252
void DeleteObject(int objRank)
Deletes the given object.
Definition: engine.cpp:868
void CreateShadow(int objRank)
Creates a shadow for the given object.
Definition: engine.cpp:1293
Math::Point hotPoint
Hot point.
Definition: engine.h:566
Math::Vector pos
Position for the shadow.
Definition: engine.h:399
Scroll down.
Definition: engine.h:541
EngineRenderState mode2
Mode to render 2nd image in.
Definition: engine.h:564
void DeleteBaseObject(int baseObjRank)
Deletes a base object.
Definition: engine.cpp:578
void SetObjectType(int objRank, EngineObjectType type)
Management of engine object type.
Definition: engine.cpp:893
Vertex with secondary texture coordinates.
Definition: vertex.h:109
void LoadDefault()
Loads default values.
Definition: engine.h:311
bool IsWithinLODLimit(float distance, LODLevel lodLevel)
Checks whether the given distance is within LOD min & max limit.
Definition: engine.cpp:1940
void SetObjectDetail(float value)
Management of objects detals.
Definition: engine.cpp:2847
Material m_lastMaterial
Last material.
Definition: engine.h:1432
std::vector< EngineBaseObjTexTier > next
Next tier (LOD)
Definition: engine.h:260
Object doesn't exist.
Definition: engine.h:169
void SetObjectTransparency(int objRank, float value)
Sets the transparency level for given object.
Definition: engine.cpp:936
Tier 2 of base object tree (textures)
Definition: engine.h:227
void DrawHighlight()
Draws the rectangle of the object highlighted.
Definition: engine.cpp:4167
void CopyBaseObject(int sourceBaseObjRank, int destBaseObjRank)
Copies geometry between two base objects.
Definition: engine.cpp:640
void DrawBackground()
Draws the gradient background.
Definition: engine.cpp:3973
void SetObjectGroundSpotPos(int rank, const Math::Vector &pos)
Management of different ground spot params.
Definition: engine.cpp:1569
Crossed out sign.
Definition: engine.h:523
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:1134
void SetTracePrecision(float factor)
Management of precision of robot tracks.
Definition: engine.cpp:2989
bool used
If true, shadow is valid.
Definition: engine.h:345
Double-sided face.
Definition: engine.h:108
Math::Vector m_lookatPt
Camera target.
Definition: engine.h:1338
TextureCreateParams m_terrainTexParams
Create params for terrain textures.
Definition: engine.h:1405
void SetObjectShadowHide(int objRank, bool hide)
Management of different shadow params.
Definition: engine.cpp:1337
Math::Vector drawPos
Position of the shadow drawn.
Definition: engine.h:403
float m_highlightTime
Time counter for highlight animation.
Definition: engine.h:1395
void SetParticleDensity(float value)
Management of the particle density.
Definition: engine.cpp:2814
EngineObjectType
Class of graphics engine object.
Definition: engine.h:166
float radius
Radius of marks.
Definition: engine.h:455
Number of items in enum.
Definition: engine.h:546
std::vector< EngineShadow > m_shadows
Shadow list.
Definition: engine.h:1329
void DrawMouse()
Draws the mouse cursor.
Definition: engine.cpp:4258
int m_highlightRank[100]
Ranks of highlighted objects.
Definition: engine.h:1391
Point struct and related functions.
4x4 matrix
Definition: matrix.h:63
Tier 3 of base object tree (LOD)
Definition: engine.h:213
void DrawOverColor()
Draws the foreground color.
Definition: engine.cpp:4133
void DeleteAllGroundSpots()
Deletes all ground spots.
Definition: engine.cpp:1518
LODLevel
Level-of-detail.
Definition: modelfile.h:47
Larger crosshair.
Definition: engine.h:543
void SetRenderEnable(bool enable)
Enables/disables rendering.
Definition: engine.cpp:468
void DrawMouseSprite(Math::Point pos, Math::Point dim, int icon)
Draw part of mouse cursor sprite.
Definition: engine.cpp:4291
Math::Vector bboxMin
Bounding box min (origin 0,0,0 always included)
Definition: engine.h:254
Part 4.
Definition: engine.h:106
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:2005
TextureCreateParams m_defaultTexParams
Default texture create params.
Definition: engine.h:1403
float min
Min altitude.
Definition: engine.h:393
int shadowRank
Rank of the associated shadow.
Definition: engine.h:300
std::string m_lastTexture[2]
Last texture names for 2 used texture stages.
Definition: engine.h:1430
void DrawInterface()
Draws the user interface over the scene.
Definition: engine.cpp:3381
int GetStatisticTriangle()
Returns the number of triangles in current frame.
Definition: engine.cpp:507
float GetEyeDirV()
Returns the vertical direction angle of view.
Definition: engine.cpp:3029
void SetSkyMode(bool present)
Management the mode of sky.
Definition: engine.cpp:2929
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:2754
TEST_VIRTUAL bool GetPause()
Get pause mode.
Definition: engine.cpp:443
Texture LoadTexture(const std::string &name)
Loads texture, creating it if not already present.
Definition: engine.cpp:2287
Always use 2nd floor texturing.
Definition: engine.h:112
float max
Max altitude.
Definition: engine.h:395
void SetFogStart(float start, int rank=0)
Management the start of fog.
Definition: engine.cpp:2744
Definition: singleton.h:27
Increase.
Definition: engine.h:431
Fixed object type metal.
Definition: engine.h:181
int CreateGroundSpot()
Creates a new ground spot and returns its rank.
Definition: engine.cpp:1541
Texture m_miceTexture
Texture with mouse cursors.
Definition: engine.h:1419
Math::Vector m_eyePt
Location of camera.
Definition: engine.h:1336
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:1196
EngineRenderState
Render state of graphics engine.
Definition: engine.h:79
Math::Point m_mouseSize
Size of mouse cursor.
Definition: engine.h:1421
int icon1
Index of texture element for 1st image.
Definition: engine.h:556
Normal opaque materials.
Definition: engine.h:82
std::set< std::string > m_texBlacklist
Blacklist map of textures.
Definition: engine.h:1414
void SetLightMode(bool present)
Managing the mode of dynamic lights.
Definition: engine.cpp:2959
TEST_VIRTUAL Math::Vector GetLookatPt()
Returns the camera target point.
Definition: engine.cpp:3019
float radius
Radius of the shadow.
Definition: engine.h:401
void ApplyChange()
Updates the scene after a change of parameters.
Definition: engine.cpp:3044
const Math::Matrix & GetMatView()
Returns the view matrix.
Definition: engine.cpp:3009
bool LoadAllTextures()
Loads all necessary textures.
Definition: engine.cpp:2310
Scroll to the left.
Definition: engine.h:535
void SetFogColor(const Color &color, int rank=0)
Management of the fog color.
Definition: engine.cpp:2721
Manager for dynamic lights in 3D scene.
Definition: lightman.h:142
bool DetectTriangle(Math::Point mouse, VertexTex2 *triangle, int objRank, float &dist)
Detects whether the mouse is in a triangle.
Definition: engine.cpp:1866
bool m_render
Rendering enabled?
Definition: engine.h:1303
float height
Height from the ground.
Definition: engine.h:363
Material of a surface.
Definition: material.h:41
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:2231
Mode for rendering text.
Definition: engine.h:120
float drawRadius
Radius of the shadow drawn.
Definition: engine.h:405
Resize vertically.
Definition: engine.h:529
void SetTextureQuality(int value)
Management the quality of textures.
Definition: engine.cpp:2872
triangle is always visible, no matter at what distance
Definition: modelfile.h:49
A triangle drawn by the graphics engine.
Definition: engine.h:144
bool Create()
Performs the initialization; must be called after device was set.
Definition: engine.cpp:246
bool DetectBBox(int objRank, Math::Point mouse)
Detects whether an object is affected by the mouse.
Definition: engine.cpp:1748
Fixed object.
Definition: engine.h:173
bool drawFront
If true, the shape is before the 2D interface.
Definition: engine.h:292
Color color
Color of the shadow.
Definition: engine.h:391
void SetOverFront(bool front)
Specifies whether to draw the foreground.
Definition: engine.cpp:2803
CLightning * GetLightning()
Returns the lighting manager.
Definition: engine.cpp:226
Math::Vector pos
Position of the shadow.
Definition: engine.h:353
EngineGroundMarkPhase phase
Phase of life.
Definition: engine.h:447
void SetTerrainVision(float vision)
Defines of the distance field of vision.
Definition: engine.cpp:2603
Cloud layer renderer.
Definition: cloud.h:76
void DeleteAllBaseObjects()
Deletes all base objects.
Definition: engine.cpp:610
Lightning effect renderer.
Definition: lightning.h:52
Fixed object type quartz.
Definition: engine.h:179
void DeleteShadow(int objRank)
Deletes the shadow for given object.
Definition: engine.cpp:1321
float m_focus
Camera angle for 3D scene.
Definition: engine.h:1312
void SetMouseType(EngineMouseType type)
Management of mouse cursor type.
Definition: engine.cpp:2999
Particle engine.
Definition: particle.h:266
Math::Vector drawPos
Draw position for marks.
Definition: engine.h:459
bool WriteScreenShot(const std::string &fileName, int width, int height)
Writes a screenshot containing the current frame.
Definition: engine.cpp:425
float radius
Radius of the sphere at the origin.
Definition: engine.h:258
Color m_lastColor
Last color set with render state.
Definition: engine.h:1428
void ResetAfterDeviceChanged()
Resets some states and flushes textures after device was changed (e.g. resoulution changed) ...
Definition: engine.cpp:320
void FrameUpdate()
Called once per frame, the call is the entry point for animating the scene.
Definition: engine.cpp:356
The transparent texture (black = no)
Definition: engine.h:84
Type of shadow drawn by the graphics engine.
Math::Point WindowToInterfaceSize(Math::IntPoint size)
Conversion functions between window and interface sizes.
Definition: engine.cpp:490
A spot (large shadow) drawn on the ground by the graphics engine.
Definition: engine.h:386
The transparent color (white = no)
Definition: engine.h:118
Math::Vector pos
Position for marks.
Definition: engine.h:453
Color structs and related functions.
float fix
Fixed time.
Definition: engine.h:451
TODO: ?
Definition: engine.h:335
Decrease.
Definition: engine.h:435
Planet manager.
Definition: planet.h:80
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:1977
Resize diagonally bottom-left to top-right.
Definition: engine.h:531
Scroll to the right.
Definition: engine.h:537
void SetAmbientColor(const Color &color, int rank=0)
Ambient color management.
Definition: engine.cpp:2701
The transparent color (black = no)
Definition: engine.h:116
void Destroy()
Frees all resources before exit.
Definition: engine.cpp:294
float angle
Angle of the shadow.
Definition: engine.h:357
Part 2.
Definition: engine.h:102
Only opaque color, no texture, blending, etc.
Definition: engine.h:124
Parameters for texture creation.
Definition: texture.h:129
void SetDeepView(float length, int rank=0, bool ref=false)
Management of the depth of field.
Definition: engine.cpp:2731
void DrawShadow()
Draws shadows.
Definition: engine.cpp:3772
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:669
void Draw3DScene()
Prepares the interface for 3D scene.
Definition: engine.cpp:3100
Material material
Material.
Definition: engine.h:149
std::string tex2Name
2nd texture
Definition: engine.h:155
void SetTotoMode(bool present)
Management mode of toto.
Definition: engine.cpp:2889
Vertex structs.
void SetWaterAddColor(const Color &color)
Color management under water.
Definition: engine.cpp:2711
Hand.
Definition: engine.h:517
Matrix struct and related functions.
int state
Render state.
Definition: engine.h:151
void SetMaterial(const Material &mat)
Sets the current material.
Definition: engine.cpp:2225
Math::Point m_highlightP1
Highlight rectangle points.
Definition: engine.h:1398
EngineShadowType type
Type of shadow.
Definition: engine.h:351
void SetShowStats(bool show)
Management of displaying statistic information.
Definition: engine.cpp:458
EngineBaseObjLODTier & AddLevel3(EngineBaseObjTexTier &p2, LODLevel lodLevel)
Creates a new tier 3 object (LOD)
Definition: engine.cpp:530
void SetDrawFront(bool draw)
Whether to draw the world on the interface.
Definition: engine.cpp:2696
void SetEditIndentMode(bool autoIndent)
Management of the indentation mode while editing (CEdit)
Definition: engine.cpp:2969
VertexTex2 triangle[3]
Triangle vertices.
Definition: engine.h:147
2D point
Definition: point.h:46
int icon2
Index of texture element for 2nd image.
Definition: engine.h:558
bool used
If true, object is valid in objects vector.
Definition: engine.h:284
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:971
Image loaded from file.
Definition: image.h:54
bool hide
If true, shadow is invisible (object being carried for example)
Definition: engine.h:347
Main application.
Definition: app.h:201
void Render()
Called once per frame, the call is the entry point for rendering.
Definition: engine.cpp:3066
Model loading - CModelFile class (aka modfile)
void DebugObject(int rank)
Print debug info about an object.
Definition: engine.cpp:753
EngineBaseObjTexTier & AddLevel2(EngineBaseObject &p1, const std::string &tex1Name, const std::string &tex2Name)
Creates a new tier 2 object (texture)
Definition: engine.cpp:518
void DrawForegroundImage()
Draws the image foreground.
Definition: engine.cpp:4097
Math::Matrix m_matViewInterface
View matrix for 2D interface.
Definition: engine.h:1319
CTerrain * GetTerrain()
Returns the terrain manager.
Definition: engine.cpp:216
Shadow drawn by the graphics engine.
Definition: engine.h:342
void SetGroundSpot(bool mode)
Management of the global mode of marking.
Definition: engine.cpp:2622
void SetEditIndentValue(int value)
Management of tab indent when editing (CEdit)
Definition: engine.cpp:2979
void SetObjectBaseRank(int objRank, int baseObjRank)
Management of the base object rank for engine object.
Definition: engine.cpp:879
Math::Vector bboxMax
bounding box max (origin 0,0,0 always included)
Definition: engine.h:256
TEST_VIRTUAL Math::Vector GetEyePt()
Returns the camera center point.
Definition: engine.cpp:3014
CWater * GetWater()
Returns the water manager.
Definition: engine.cpp:221
float smooth
Transition area.
Definition: engine.h:397
Null phase.
Definition: engine.h:429
Texture CreateTexture(const std::string &texName, const TextureCreateParams &params, CImage *image=nullptr)
Create texture and add it to cache.
Definition: engine.cpp:2248
EngineGroundMark m_groundMark
Ground mark.
Definition: engine.h:1333
Management of pause modes.
CText * GetText()
Returns the text rendering engine.
Definition: engine.cpp:201
Math::IntPoint m_size
Current size of viewport window.
Definition: engine.h:1322
Part 3.
Definition: engine.h:104
Terrain loader/generator and manager.
Definition: terrain.h:220
std::vector< EngineObject > m_objects
Object parameters.
Definition: engine.h:1327
void SetObjectDrawFront(int objRank, bool draw)
Sets drawFront for given object.
Definition: engine.cpp:929
Resize diagonally top-left to bottom-right.
Definition: engine.h:533
bool visible
If true, the object is drawn.
Definition: engine.h:288
The transparent diffuse color.
Definition: engine.h:88
EngineObject()
Calls LoadDefault()
Definition: engine.h:305
EngineMouseType
Type of mouse cursor displayed in-game.
Definition: engine.h:508
void DrawPlanet()
Draws all the planets.
Definition: engine.cpp:4081
int CreateObject()
Creates a new object and returns its rank.
Definition: engine.cpp:830
void SetTerrain(CTerrain *terrain)
Sets the terrain object.
Definition: engine.cpp:241
void SetForegroundName(const std::string &name)
Specifies the name of foreground texture.
Definition: engine.cpp:2789
void SetGadgetQuantity(float value)
The amount of management objects gadgets.
Definition: engine.cpp:2859
float drawRadius
Radius for marks.
Definition: engine.h:461
float radius
Radius of the shadow.
Definition: engine.h:359
EngineRenderState mode1
Mode to render 1st image in.
Definition: engine.h:562
Vector struct and related functions.
The graphics engine.
Definition: engine.h:682
int dx
X dimension of table.
Definition: engine.h:465
void SetObjectTransform(int objRank, const Math::Matrix &transform)
Management of object transform.
Definition: engine.cpp:908
Normal cursor (arrow)
Definition: engine.h:511
Double white texturing.
Definition: engine.h:98
Object drawn by the graphics engine.
Definition: engine.h:281
float GetEyeDirH()
Returns the horizontal direction angle of view.
Definition: engine.cpp:3024
EngineBaseObjDataTier & AddLevel4(EngineBaseObjLODTier &p3, EngineTriangleType type, const Material &mat, int state)
Creates a new tier 4 object (data)
Definition: engine.cpp:542
EngineMouseType m_mouseType
Type of mouse cursor.
Definition: engine.h:1423
void Update()
Updates the state after creating objects.
Definition: engine.cpp:1741
Event types, structs and event queue.
void UpdateGroundSpotTextures()
Updates the textures used for drawing ground spot.
Definition: engine.cpp:3504
EngineTriangleType
Type of triangles drawn for engine objects.
Definition: engine.h:132
void DeleteGroundSpot(int rank)
Deletes the given ground spot.
Definition: engine.cpp:1561
int dy
Y dimension of table.
Definition: engine.h:467
Info about a texture.
Definition: texture.h:212
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:712
void SetHighlightRank(int *rankList)
Lists the ranks of objects and subobjects selected.
Definition: engine.cpp:1461
System functions: time stamps, info dialogs, etc.
Math::Vector normal
Normal to the terrain.
Definition: engine.h:355
Math::Matrix m_matWorldInterface
World matrix for 2D interface.
Definition: engine.h:1315
void ComputeDistance()
Calculates the distances between the viewpoint and the origin of different objects.
Definition: engine.cpp:1629
void SetShadow(bool mode)
Management of the global mode of shading.
Definition: engine.cpp:2632
int m_lastState
Last engine render state (-1 at the beginning of frame)
Definition: engine.h:1426
void SetOverColor(const Color &color=Color(), int mode=ENG_RSTATE_TCOLOR_BLACK)
Sets the foreground overlay color.
Definition: engine.cpp:2808
Information about mouse cursor.
Definition: engine.h:553
void SetDirty(bool mode)
Management of the global mode of contamination.
Definition: engine.cpp:2642
Math::Matrix transform
Transformation matrix.
Definition: engine.h:296
void DrawBackgroundImage()
Draws the image background.
Definition: engine.cpp:4022
bool m_interfaceMode
True when drawing 2D UI.
Definition: engine.h:1435
Moving object.
Definition: engine.h:175
Image using alpha channel.
Definition: engine.h:110
bool draw
If true, draw mark.
Definition: engine.h:445
Water manager/renderer.
Definition: water.h:116
Only opaque texture, no blending, etc.
Definition: engine.h:122
bool IsVisiblePoint(const Math::Vector &pos)
Indicates whether a point is visible.
Definition: engine.cpp:3034
void SetClippingDistance(float value)
Management of the distance of clipping.
Definition: engine.cpp:2834
void LoadZero()
Loads the zero vector (0, 0, 0)
Definition: vector.h:73
std::map< std::string, Texture > m_texNameMap
Map of loaded textures (by name)
Definition: engine.h:1408
Resize.
Definition: engine.h:525
EngineTextureMapping
Type of texture mapping.
Definition: engine.h:493
Text rendering engine.
Definition: text.h:237
3D (3x1) vector
Definition: vector.h:49
int iconShadow
Shadow texture part.
Definition: engine.h:560
bool drawWorld
If true, object is behind the 2D interface.
Definition: engine.h:290
Tier 4 of object tree (data)
Definition: engine.h:189
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:1605
Math::Matrix m_matView
View matrix for 3D scene.
Definition: engine.h:1310
std::vector< EngineGroundSpot > m_groundSpots
Ground spot list.
Definition: engine.h:1331
Definition: system_linux.h:28
Part of a moving object.
Definition: engine.h:177
Surfaces.
Definition: engine.h:137
int CreateBaseObject()
Creates a base object and returns its rank.
Definition: engine.cpp:555
A mark on ground drawn by the graphics engine.
Definition: engine.h:442
2D Point with integer coords
Definition: intpoint.h:35
bool GetBBox2D(int objRank, Math::Point &min, Math::Point &max)
Compute and return the 2D box on screen of any object.
Definition: engine.cpp:1471
void UpdateStaticBuffer(EngineBaseObjDataTier &p4)
Updates a given static buffer.
Definition: engine.cpp:1690
CLightManager * GetLightManager()
Returns the light manager.
Definition: engine.cpp:206
CParticle * GetParticle()
Returns the particle manager.
Definition: engine.cpp:211
std::map< Texture, std::string > m_revTexNameMap
Reverse map of loaded textures (by texture)
Definition: engine.h:1410
RGBA color.
Definition: color.h:35
void UpdateStaticBuffers()
Updates static buffers of changed objects.
Definition: engine.cpp:1706
Triangles.
Definition: engine.h:135
void DrawStats()
Draw statistic texts.
Definition: engine.cpp:4324
void DeleteTexture(const std::string &name)
Deletes the given texture, unloading it and removing from cache.
Definition: engine.cpp:2534
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:2409
void DrawObject(const EngineBaseObjDataTier &p4)
Draw 3D object.
Definition: engine.cpp:3355
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:1644
void SetDevice(CDevice *device)
Sets the device to be used.
Definition: engine.cpp:191
std::vector< EngineBaseObject > m_baseObjects
Base objects (also level 1 tier list)
Definition: engine.h:1325
float distance
Distance to object from eye point.
Definition: engine.h:298
Scroll up.
Definition: engine.h:539
Event sent by system, interface or game.
Definition: event.h:686
float intensity
Intensity of the shadow.
Definition: engine.h:361
Definition: pausemanager.h:42
IntPoint struct.
CPlanet * GetPlanet()
Returns the planet manager.
Definition: engine.cpp:231
void DeleteGroundMark(int rank)
Deletes the ground mark.
Definition: engine.cpp:1624
void SetObjectDrawWorld(int objRank, bool draw)
Sets drawWorld for given object.
Definition: engine.cpp:922
int baseObjRank
Rank of associated base engine object.
Definition: engine.h:286
char * table
Pointer to the table.
Definition: engine.h:469
Definition: object.h:352
Math::IntPoint GetWindowSize()
Returns current size of viewport window.
Definition: engine.cpp:473
Texture borders with solid color.
Definition: engine.h:92
The transparent texture (white = no)
Definition: engine.h:86
void SetDrawWorld(bool draw)
Whether to draw the world.
Definition: engine.cpp:2691
CDevice * GetDevice()
Returns the current device.
Definition: engine.cpp:196
int GetObjectTotalTriangles(int objRank)
Returns the total number of triangles of given object.
Definition: engine.cpp:958
TODO: ?
Definition: engine.h:521
bool used
If true, base object is valid in objects vector.
Definition: engine.h:250
EngineGroundMarkPhase
Phase of life of an EngineGroundMark.
Definition: engine.h:426
Sound plugin interface.
Definition: sound.h:149
Causes the fog.
Definition: engine.h:114
Part 1 (no change in. MOD!)
Definition: engine.h:100
void DeleteAllObjects()
Deletes all objects, shadows and ground spots.
Definition: engine.cpp:860
void UpdateMatProj()
Resets the projection matrix after changes.
Definition: engine.cpp:3039
Abstract interface of graphics device.
Definition: device.h:235
bool IsVisible(int objRank)
Tests whether the given object is visible.
Definition: engine.cpp:1918
Double black texturing.
Definition: engine.h:96
int objRank
Rank of the associated object.
Definition: engine.h:349
bool ProcessEvent(const Event &event)
Processes incoming event.
Definition: engine.cpp:329
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:1015
Texture wrap.
Definition: engine.h:90
Definition: engine.h:247
void DrawBackgroundGradient(const Color &up, const Color &down)
Draws the gradient background.
Definition: engine.cpp:3992
void FlushTextureCache()
Empties the texture cache.
Definition: engine.cpp:2565
void SetFocus(float focus)
Management of camera angle.
Definition: engine.cpp:2608
CCloud * GetCloud()
Returns the fog manager.
Definition: engine.cpp:236