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 
28 #include "common/event.h"
29 #include "common/singleton.h"
30 
31 #include "graphics/core/color.h"
32 #include "graphics/core/material.h"
33 #include "graphics/core/texture.h"
34 #include "graphics/core/vertex.h"
35 
37 
38 #include "math/intpoint.h"
39 #include "math/matrix.h"
40 #include "math/point.h"
41 #include "math/vector.h"
42 
43 
44 #include <string>
45 #include <vector>
46 #include <map>
47 #include <set>
48 
49 
50 class CApplication;
51 class CObject;
52 class CSoundInterface;
53 class CImage;
54 
55 
56 // Graphics module namespace
57 namespace Gfx {
58 
59 
60 class CDevice;
61 class CLightManager;
62 class CText;
63 class CParticle;
64 class CWater;
65 class CCloud;
66 class CLightning;
67 class CPlanet;
68 class CTerrain;
69 
70 
79 {
89  ENG_RSTATE_WRAP = (1<<3),
91  ENG_RSTATE_CLAMP = (1<<4),
93  ENG_RSTATE_LIGHT = (1<<5),
99  ENG_RSTATE_PART1 = (1<<8),
103  ENG_RSTATE_PART3 = (1<<10),
105  ENG_RSTATE_PART4 = (1<<11),
107  ENG_RSTATE_2FACE = (1<<12),
109  ENG_RSTATE_ALPHA = (1<<13),
111  ENG_RSTATE_SECOND = (1<<14),
113  ENG_RSTATE_FOG = (1<<15),
119  ENG_RSTATE_TEXT = (1<<18),
124 };
125 
126 
132 {
137 };
138 
144 {
150  int state;
152  std::string tex1Name;
154  std::string tex2Name;
155 
156  inline EngineTriangle()
157  {
159  }
160 };
161 
166 {
181 };
182 
183 
189 {
190  EngineTriangleType type;
191  Material material;
192  int state;
193  std::vector<VertexTex2> vertices;
194  unsigned int staticBufferId;
195  bool updateStaticBuffer;
196 
198  const Material& _material = Material(),
199  int _state = ENG_RSTATE_NORMAL)
200  : type(_type)
201  , material(_material)
202  , state(_state)
203  , staticBufferId(0)
204  , updateStaticBuffer(false)
205  {}
206 };
207 
213 {
214  LODLevel lodLevel;
215  std::vector<EngineBaseObjDataTier> next;
216 
217  inline EngineBaseObjLODTier(LODLevel _lodLevel = LOD_Constant)
218  : lodLevel(_lodLevel)
219  {}
220 };
221 
227 {
228  std::string tex1Name;
229  Texture tex1;
230  std::string tex2Name;
231  Texture tex2;
232  std::vector<EngineBaseObjLODTier> next;
233 
234  inline EngineBaseObjTexTier(const std::string& _tex1Name = "", const std::string& _tex2Name = "")
235  : tex1Name(_tex1Name)
236  , tex2Name(_tex2Name)
237  {}
238 };
239 
247 {
249  bool used;
257  float radius;
259  std::vector<EngineBaseObjTexTier> next;
260 
261  inline EngineBaseObject()
262  {
263  LoadDefault();
264  }
265 
266  inline void LoadDefault()
267  {
268  used = false;
269  totalTriangles = 0;
270  bboxMax.LoadZero();
271  bboxMin.LoadZero();
272  radius = 0.0f;
273  }
274 };
275 
281 {
283  bool used;
287  bool visible;
289  bool drawWorld;
291  bool drawFront;
297  float distance;
302 
304  inline EngineObject()
305  {
306  LoadDefault();
307  }
308 
310  inline void LoadDefault()
311  {
312  used = false;
313  baseObjRank = -1;
314  visible = false;
315  drawWorld = false;
316  drawFront = false;
319  distance = 0.0f;
320  shadowRank = -1;
321  transparency = 0.0f;
322  }
323 };
324 
330 {
335 };
336 
342 {
344  bool used;
346  bool hide;
348  int objRank;
356  float angle;
358  float radius;
360  float intensity;
362  float height;
363 
364  inline EngineShadow()
365  {
366  LoadDefault();
367  }
368 
369  inline void LoadDefault()
370  {
371  used = false;
372  hide = false;
373  objRank = 0;
375  pos.LoadZero();
376  normal.LoadZero();
377  angle = radius = intensity = height = 0.0f;
378  }
379 };
380 
386 {
388  bool used;
392  float min;
394  float max;
396  float smooth;
400  float radius;
404  float drawRadius;
405 
406  inline EngineGroundSpot()
407  {
408  LoadDefault();
409  }
410 
411  inline void LoadDefault()
412  {
413  used = false;
414  color = Color();
415  pos.LoadZero();
416  drawPos.LoadZero();
417  min = max = smooth = radius = drawRadius = 0.0f;
418  }
419 };
420 
426 {
435 };
436 
442 {
444  bool draw;
448  float delay[3];
450  float fix;
454  float radius;
456  float intensity;
460  float drawRadius;
464  int dx;
466  int dy;
468  char* table;
469 
470  inline EngineGroundMark()
471  {
472  LoadDefault();
473  }
474 
475  inline void LoadDefault()
476  {
477  draw = false;
479  pos = Math::Vector();
480  drawPos = Math::Vector();
481  delay[0] = delay[1] = delay[2] = 0.0f;
483  dx = dy = 0;
484  table = nullptr;
485  }
486 };
487 
493 {
494  ENG_TEX_MAPPING_X = 1,
495  ENG_TEX_MAPPING_Y = 2,
496  ENG_TEX_MAPPING_Z = 3,
497  ENG_TEX_MAPPING_1X = 4,
498  ENG_TEX_MAPPING_1Y = 5,
499  ENG_TEX_MAPPING_1Z = 6
500 };
501 
502 
508 {
543 
546 };
547 
553 {
555  int icon1;
557  int icon2;
566 
567  inline EngineMouse(int _icon1 = -1, int _icon2 = -1, int _iconShadow = -1,
570  Math::Point _hotPoint = Math::Point())
571  : icon1(_icon1)
572  , icon2(_icon2)
573  , iconShadow(_iconShadow)
574  , mode1(_mode1)
575  , mode2(_mode2)
576  , hotPoint(_hotPoint)
577  {}
578 };
579 
580 
681 class CEngine : public CSingleton<CEngine>
682 {
683 public:
684  CEngine(CApplication* app);
685  ~CEngine();
686 
688  void SetDevice(CDevice* device);
690  CDevice* GetDevice();
691 
693  CText* GetText();
699  CTerrain* GetTerrain();
701  CWater* GetWater();
705  CPlanet* GetPlanet();
707  CCloud* GetCloud();
708 
710  void SetTerrain(CTerrain* terrain);
711 
712 
714  bool Create();
716  void Destroy();
717 
720 
721 
723  void Render();
724 
725 
727  bool ProcessEvent(const Event& event);
728 
730  void FrameUpdate();
731 
732 
734  bool WriteScreenShot(const std::string& fileName, int width, int height);
735 
736 
738  void SetPause(bool pause);
740  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 
781 
782  /* *************** Object management *************** */
783 
784  // Base objects
785 
787  int CreateBaseObject();
789  void DeleteBaseObject(int baseObjRank);
791  void DeleteAllBaseObjects();
792 
794  void CopyBaseObject(int sourceBaseObjRank, int destBaseObjRank);
795 
797  void AddBaseObjTriangles(int baseObjRank, const std::vector<VertexTex2>& vertices,
798  EngineTriangleType triangleType,
799  const Material& material, int state,
800  std::string tex1Name, std::string tex2Name,
801  LODLevel lodLevel, bool globalUpdate);
802 
804  void AddBaseObjQuick(int baseObjRank, const EngineBaseObjDataTier& buffer,
805  std::string tex1Name, std::string tex2Name,
806  LODLevel lodLevel, bool globalUpdate);
807 
808  // Objects
809 
811  void DebugObject(int rank);
812 
814  int CreateObject();
816  void DeleteAllObjects();
818  void DeleteObject(int objRank);
819 
821  void SetObjectBaseRank(int objRank, int baseObjRank);
823  int GetObjectBaseRank(int objRank);
825 
827  void SetObjectType(int objRank, EngineObjectType type);
829  EngineObjectType GetObjectType(int objRank);
831 
833  void SetObjectTransform(int objRank, const Math::Matrix& transform);
835  void GetObjectTransform(int objRank, Math::Matrix& transform);
837 
839  void SetObjectDrawWorld(int objRank, bool draw);
841  void SetObjectDrawFront(int objRank, bool draw);
842 
844  void SetObjectTransparency(int objRank, float value);
845 
847  void GetObjectBBox(int objRank, Math::Vector& min, Math::Vector& max);
848 
850  int GetObjectTotalTriangles(int objRank);
851 
853  EngineBaseObjDataTier* FindTriangles(int objRank, const Material& material,
854  int state, std::string tex1Name, std::string tex2Name,
855  int lodLevelMask);
856 
858  int GetPartialTriangles(int objRank, int lodLevelMask, float percent, int maxCount,
859  std::vector<EngineTriangle>& triangles);
860 
862  void ChangeSecondTexture(int objRank, const std::string& tex2Name);
863 
865  void ChangeTextureMapping(int objRank, const Material& mat, int state,
866  const std::string& tex1Name, const std::string& tex2Name,
867  int lodLevelMask, EngineTextureMapping mode,
868  float au, float bu, float av, float bv);
869 
871  void TrackTextureMapping(int objRank, const Material& mat, int state,
872  const std::string& tex1Name, const std::string& tex2Name,
873  int lodLevelMask, EngineTextureMapping mode,
874  float pos, float factor, float tl, float ts, float tt);
875 
877 
878  int DetectObject(Math::Point mouse);
879 
881  void CreateShadow(int objRank);
883  void DeleteShadow(int objRank);
884 
886  void SetObjectShadowHide(int objRank, bool hide);
888  void SetObjectShadowType(int objRank, EngineShadowType type);
889  void SetObjectShadowPos(int objRank, const Math::Vector& pos);
890  void SetObjectShadowNormal(int objRank, const Math::Vector& normal);
891  void SetObjectShadowAngle(int objRank, float angle);
892  void SetObjectShadowRadius(int objRank, float radius);
893  void SetObjectShadowIntensity(int objRank, float intensity);
894  void SetObjectShadowHeight(int objRank, float height);
895  float GetObjectShadowRadius(int objRank);
897 
899  void SetHighlightRank(int* rankList);
901  bool GetHighlight(Math::Point& p1, Math::Point& p2);
902 
904  void DeleteAllGroundSpots();
906  int CreateGroundSpot();
908  void DeleteGroundSpot(int rank);
909 
911  void SetObjectGroundSpotPos(int rank, const Math::Vector& pos);
913  void SetObjectGroundSpotRadius(int rank, float radius);
914  void SetObjectGroundSpotColor(int rank, const Color& color);
915  void SetObjectGroundSpotMinMax(int rank, float min, float max);
916  void SetObjectGroundSpotSmooth(int rank, float smooth);
918 
920  void CreateGroundMark(Math::Vector pos, float radius,
921  float delay1, float delay2, float delay3,
922  int dx, int dy, char* table);
924  void DeleteGroundMark(int rank);
925 
927  void Update();
928 
929 
930  /* *************** Mode setting *************** */
931 
933  void SetState(int state, const Color& color = Color(1.0f, 1.0f, 1.0f, 1.0f));
934 
936  void SetMaterial(const Material& mat);
937 
939  void SetViewParams(const Math::Vector& eyePt, const Math::Vector& lookatPt,
940  const Math::Vector& upVec, float eyeDistance);
941 
943  Texture LoadTexture(const std::string& name);
945  Texture LoadTexture(const std::string& name, CImage* image);
947  Texture LoadTexture(const std::string& name, const TextureCreateParams& params);
949  bool LoadAllTextures();
950 
952  bool ChangeTextureColor(const std::string& texName,
953  Color colorRef1, Color colorNew1,
954  Color colorRef2, Color colorNew2,
955  float tolerance1, float tolerance2,
956  Math::Point ts, Math::Point ti,
957  Math::Point *exclude = nullptr,
958  float shift = 0.0f, bool hsv = false);
959 
961 
962  bool SetTexture(const std::string& name, int stage = 0);
964  void SetTexture(const Texture& tex, int stage = 0);
965 
967  void DeleteTexture(const std::string& name);
969  void DeleteTexture(const Texture& tex);
970 
972  void FlushTextureCache();
973 
975  void SetTerrainVision(float vision);
976 
978 
982  void SetFocus(float focus);
983  float GetFocus();
985 
987  void SetGroundSpot(bool mode);
989  bool GetGroundSpot();
991 
993  void SetShadow(bool mode);
995  bool GetShadow();
997 
999  void SetDirty(bool mode);
1001  bool GetDirty();
1003 
1005  void SetFog(bool mode);
1007  bool GetFog();
1009 
1011  void SetSecondTexture(int texNum);
1013  int GetSecondTexture();
1015 
1017  void SetRankView(int rank);
1019  int GetRankView();
1021 
1023  void SetDrawWorld(bool draw);
1024 
1026  void SetDrawFront(bool draw);
1027 
1029  void SetAmbientColor(const Color& color, int rank = 0);
1031  Color GetAmbientColor(int rank = 0);
1033 
1035  void SetWaterAddColor(const Color& color);
1037  Color GetWaterAddColor();
1039 
1041  void SetFogColor(const Color& color, int rank = 0);
1043  Color GetFogColor(int rank = 0);
1045 
1047 
1050  void SetDeepView(float length, int rank = 0, bool ref=false);
1051  float GetDeepView(int rank = 0);
1053 
1054 
1056 
1059  void SetFogStart(float start, int rank = 0);
1060  float GetFogStart(int rank = 0);
1062 
1064  void SetBackground(const std::string& name, Color up = Color(), Color down = Color(),
1066  Color cloudUp = Color(), Color cloudDown = Color(),
1067  bool full = false);
1068  void GetBackground(std::string& name, Color& up, Color& down,
1069  Color& cloudUp, Color& cloudDown,
1070  bool& full);
1072 
1074  void SetForegroundName(const std::string& name);
1076  void SetOverFront(bool front);
1078  void SetOverColor(const Color& color = Color(), int mode = ENG_RSTATE_TCOLOR_BLACK);
1079 
1081  void SetParticleDensity(float value);
1083  float GetParticleDensity();
1085 
1087  float ParticleAdapt(float factor);
1088 
1090  void SetClippingDistance(float value);
1092  float GetClippingDistance();
1094 
1096  void SetObjectDetail(float value);
1098  float GetObjectDetail();
1100 
1102  void SetGadgetQuantity(float value);
1104  float GetGadgetQuantity();
1106 
1108  void SetTextureQuality(int value);
1110  int GetTextureQuality();
1112 
1114  void SetTotoMode(bool present);
1116  bool GetTotoMode();
1118 
1120  void SetLensMode(bool present);
1122  bool GetLensMode();
1124 
1126  void SetWaterMode(bool present);
1128  bool GetWaterMode();
1130 
1131  void SetLightingMode(bool present);
1132  bool GetLightingMode();
1133 
1135  void SetSkyMode(bool present);
1137  bool GetSkyMode();
1139 
1141  void SetBackForce(bool present);
1143  bool GetBackForce();
1145 
1147  void SetPlanetMode(bool present);
1149  bool GetPlanetMode();
1151 
1153  void SetLightMode(bool present);
1155  bool GetLightMode();
1157 
1159  // TODO: move to more appropriate class ?
1161  void SetEditIndentMode(bool autoIndent);
1162  bool GetEditIndentMode();
1164 
1166  // TODO: move to more appropriate class ?
1168  void SetEditIndentValue(int value);
1169  int GetEditIndentValue();
1171 
1173  void SetTracePrecision(float factor);
1175  float GetTracePrecision();
1177 
1179  void SetMouseType(EngineMouseType type);
1181  EngineMouseType GetMouseType();
1183 
1185  const Math::Matrix& GetMatView();
1187  TEST_VIRTUAL Math::Vector GetEyePt();
1189  TEST_VIRTUAL Math::Vector GetLookatPt();
1191  float GetEyeDirH();
1193  float GetEyeDirV();
1195  bool IsVisiblePoint(const Math::Vector& pos);
1196 
1198  void UpdateMatProj();
1199 
1201  void ApplyChange();
1202 
1203 protected:
1205  void Draw3DScene();
1207  void DrawObject(const EngineBaseObjDataTier& p4);
1209  void DrawInterface();
1210 
1212  void UpdateGroundSpotTextures();
1213 
1215  void DrawShadow();
1217  void DrawBackground();
1219  void DrawBackgroundGradient(const Color& up, const Color& down);
1221  void DrawBackgroundImage();
1223  void DrawPlanet();
1225  void DrawForegroundImage();
1227  void DrawOverColor();
1229  void DrawHighlight();
1231  void DrawMouse();
1233  void DrawMouseSprite(Math::Point pos, Math::Point dim, int icon);
1235  void DrawStats();
1236 
1238  EngineBaseObjTexTier& AddLevel2(EngineBaseObject& p1, const std::string& tex1Name, const std::string& tex2Name);
1243  const Material& mat, int state);
1244 
1246  Texture CreateTexture(const std::string &texName, const TextureCreateParams &params, CImage* image = nullptr);
1247 
1249  bool IsVisible(int objRank);
1250 
1252  bool IsWithinLODLimit(float distance, LODLevel lodLevel);
1253 
1255  bool DetectBBox(int objRank, Math::Point mouse);
1256 
1258  bool GetBBox2D(int objRank, Math::Point& min, Math::Point& max);
1259 
1261  bool DetectTriangle(Math::Point mouse, VertexTex2* triangle, int objRank, float& dist);
1262 
1264 
1265  bool TransformPoint(Math::Vector& p2D, int objRank, Math::Vector p3D);
1266 
1268  void ComputeDistance();
1269 
1271  void UpdateGeometry();
1272 
1275 
1277  void UpdateStaticBuffers();
1278 
1279 protected:
1280  CApplication* m_app;
1281  CSoundInterface* m_sound;
1282  CDevice* m_device;
1283  CText* m_text;
1284  CLightManager* m_lightMan;
1285  CParticle* m_particle;
1286  CWater* m_water;
1287  CCloud* m_cloud;
1288  CLightning* m_lightning;
1289  CPlanet* m_planet;
1290  CTerrain* m_terrain;
1291 
1293  std::string m_error;
1294 
1295  SystemTimeStamp* m_lastFrameTime;
1296  SystemTimeStamp* m_currentFrameTime;
1297  int m_fpsCounter;
1298  float m_fps;
1299 
1302  std::string m_fpsText;
1303 
1305  bool m_pause;
1307  bool m_render;
1310 
1316  float m_focus;
1317 
1324 
1327 
1329  std::vector<EngineBaseObject> m_baseObjects;
1331  std::vector<EngineObject> m_objects;
1333  std::vector<EngineShadow> m_shadows;
1335  std::vector<EngineGroundSpot> m_groundSpots;
1338 
1343  float m_eyeDirH;
1344  float m_eyeDirV;
1345  int m_rankView;
1346  Color m_ambientColor[2];
1347  Color m_backColor[2];
1348  Color m_fogColor[2];
1349  float m_deepView[2];
1350  float m_fogStart[2];
1351  Color m_waterAddColor;
1352  int m_statisticTriangle;
1353  bool m_updateGeometry;
1354  bool m_updateStaticBuffers;
1355  int m_alphaMode;
1356  bool m_groundSpotVisible;
1357  bool m_shadowVisible;
1358  bool m_dirty;
1359  bool m_fog;
1360  bool m_firstGroundSpot;
1361  int m_secondTexNum;
1362  bool m_backgroundFull;
1363  std::string m_backgroundName;
1364  Texture m_backgroundTex;
1365  Color m_backgroundColorUp;
1366  Color m_backgroundColorDown;
1367  Color m_backgroundCloudUp;
1368  Color m_backgroundCloudDown;
1369  bool m_overFront;
1370  Color m_overColor;
1371  int m_overMode;
1372  std::string m_foregroundName;
1373  Texture m_foregroundTex;
1374  bool m_drawWorld;
1375  bool m_drawFront;
1376  float m_particleDensity;
1377  float m_clippingDistance;
1378  float m_lastClippingDistance;
1379  float m_objectDetail;
1380  float m_terrainVision;
1381  float m_gadgetQuantity;
1382  int m_textureQuality;
1383  bool m_totoMode;
1384  bool m_lensMode;
1385  bool m_waterMode;
1386  bool m_skyMode;
1387  bool m_backForce;
1388  bool m_planetMode;
1389  bool m_lightMode;
1390  bool m_editIndentMode;
1391  int m_editIndentValue;
1392  float m_tracePrecision;
1393 
1403  Math::Point m_highlightP2;
1405 
1410 
1412  std::map<std::string, Texture> m_texNameMap;
1414  std::map<Texture, std::string> m_revTexNameMap;
1416 
1418  std::set<std::string> m_texBlacklist;
1419 
1428 
1434  std::string m_lastTexture[2];
1437 
1440 
1441  bool m_debugLights;
1442  bool m_debugDumpLights;
1443 };
1444 
1445 
1446 } // namespace Gfx
1447 
void SetWaterMode(bool present)
Management the mode of water.
Definition: engine.cpp:2921
bool m_highlight
Highlight visible?
Definition: engine.h:1397
int DetectObject(Math::Point mouse)
Detects the target object that is selected with the mouse.
Definition: engine.cpp:1784
bool m_movieLock
Lock for duration of movie?
Definition: engine.h:1309
void SetFog(bool mode)
Management of the global mode of horizontal fog patches.
Definition: engine.cpp:2664
std::string tex1Name
1st texture
Definition: engine.h:152
void SetLensMode(bool present)
Management the mode of foreground.
Definition: engine.cpp:2911
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:934
Edit (I-beam)
Definition: engine.h:514
EngineMouse m_mice[ENG_MOUSE_COUNT]
Mouse cursor definitions.
Definition: engine.h:1421
Normal shadow.
Definition: engine.h:332
float drawIntensity
Draw intensity for marks.
Definition: engine.h:462
float intensity
Color intensity.
Definition: engine.h:456
bool GetHighlight(Math::Point &p1, Math::Point &p2)
Returns the highlighted rectangle.
Definition: engine.cpp:1445
bool used
If true, ground spot is valid.
Definition: engine.h:388
void AddStatisticTriangle(int nb)
Increments the triangle counter for the current frame.
Definition: engine.cpp:493
Resize horizontally.
Definition: engine.h:526
void SetPlanetMode(bool present)
Management the mode of planets.
Definition: engine.cpp:2961
CSingleton base class for singletons.
Math::Matrix m_matProj
Projection matrix for 3D scene.
Definition: engine.h:1312
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:2584
Light texture (ambient max)
Definition: engine.h:93
void SetBackForce(bool present)
Management the mode of background.
Definition: engine.cpp:2951
float transparency
Transparency of the object [0, 1].
Definition: engine.h:301
float delay[3]
Times for 3 life phases.
Definition: engine.h:448
void SetMovieLock(bool lock)
Management of lock for the duration of movie sequence.
Definition: engine.cpp:439
Small cross.
Definition: engine.h:518
Fixed.
Definition: engine.h:432
float ParticleAdapt(float factor)
Adapts particle factor according to particle density.
Definition: engine.cpp:2838
Busy.
Definition: engine.h:512
void ChangeSecondTexture(int objRank, const std::string &tex2Name)
Changes the 2nd texure for given object.
Definition: engine.cpp:1095
void SetRankView(int rank)
Management of view mode.
Definition: engine.cpp:2684
EngineObjectType type
Type of object.
Definition: engine.h:293
Material struct.
Math::Point WindowToInterfaceCoords(Math::IntPoint pos)
Conversion functions between window and interface coordinates.
Definition: engine.cpp:469
Math::Matrix m_matProjInterface
Projection matrix for 2D interface.
Definition: engine.h:1321
void SetSecondTexture(int texNum)
Management of the global mode of secondary texturing.
Definition: engine.cpp:2674
Terrain.
Definition: engine.h:170
int totalTriangles
Number of triangles.
Definition: engine.h:251
void DeleteObject(int objRank)
Deletes the given object.
Definition: engine.cpp:859
void CreateShadow(int objRank)
Creates a shadow for the given object.
Definition: engine.cpp:1284
Math::Point hotPoint
Hot point.
Definition: engine.h:565
Math::Vector pos
Position for the shadow.
Definition: engine.h:398
Scroll down.
Definition: engine.h:540
EngineRenderState mode2
Mode to render 2nd image in.
Definition: engine.h:563
void DeleteBaseObject(int baseObjRank)
Deletes a base object.
Definition: engine.cpp:569
void SetObjectType(int objRank, EngineObjectType type)
Management of engine object type.
Definition: engine.cpp:884
Vertex with secondary texture coordinates.
Definition: vertex.h:107
void LoadDefault()
Loads default values.
Definition: engine.h:310
bool IsWithinLODLimit(float distance, LODLevel lodLevel)
Checks whether the given distance is within LOD min & max limit.
Definition: engine.cpp:1931
void SetObjectDetail(float value)
Management of objects detals.
Definition: engine.cpp:2859
Material m_lastMaterial
Last material.
Definition: engine.h:1436
std::vector< EngineBaseObjTexTier > next
Next tier (LOD)
Definition: engine.h:259
Object doesn't exist.
Definition: engine.h:168
void SetObjectTransparency(int objRank, float value)
Sets the transparency level for given object.
Definition: engine.cpp:927
Tier 2 of base object tree (textures)
Definition: engine.h:226
void DrawHighlight()
Draws the rectangle of the object highlighted.
Definition: engine.cpp:4179
void CopyBaseObject(int sourceBaseObjRank, int destBaseObjRank)
Copies geometry between two base objects.
Definition: engine.cpp:631
void DrawBackground()
Draws the gradient background.
Definition: engine.cpp:3985
void SetObjectGroundSpotPos(int rank, const Math::Vector &pos)
Management of different ground spot params.
Definition: engine.cpp:1560
Crossed out sign.
Definition: engine.h:522
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:1125
void SetTracePrecision(float factor)
Management of precision of robot tracks.
Definition: engine.cpp:3001
bool used
If true, shadow is valid.
Definition: engine.h:344
Double-sided face.
Definition: engine.h:107
Math::Vector m_lookatPt
Camera target.
Definition: engine.h:1342
TextureCreateParams m_terrainTexParams
Create params for terrain textures.
Definition: engine.h:1409
void SetObjectShadowHide(int objRank, bool hide)
Management of different shadow params.
Definition: engine.cpp:1328
Math::Vector drawPos
Position of the shadow drawn.
Definition: engine.h:402
float m_highlightTime
Time counter for highlight animation.
Definition: engine.h:1399
void SetParticleDensity(float value)
Management of the particle density.
Definition: engine.cpp:2826
EngineObjectType
Class of graphics engine object.
Definition: engine.h:165
float radius
Radius of marks.
Definition: engine.h:454
Number of items in enum.
Definition: engine.h:545
std::vector< EngineShadow > m_shadows
Shadow list.
Definition: engine.h:1333
void DrawMouse()
Draws the mouse cursor.
Definition: engine.cpp:4270
int m_highlightRank[100]
Ranks of highlighted objects.
Definition: engine.h:1395
Point struct and related functions.
4x4 matrix
Definition: matrix.h:63
Tier 3 of base object tree (LOD)
Definition: engine.h:212
void DrawOverColor()
Draws the foreground color.
Definition: engine.cpp:4145
void DeleteAllGroundSpots()
Deletes all ground spots.
Definition: engine.cpp:1509
LODLevel
Level-of-detail.
Definition: modelfile.h:47
Larger crosshair.
Definition: engine.h:542
void SetRenderEnable(bool enable)
Enables/disables rendering.
Definition: engine.cpp:459
void DrawMouseSprite(Math::Point pos, Math::Point dim, int icon)
Draw part of mouse cursor sprite.
Definition: engine.cpp:4303
Math::Vector bboxMin
Bounding box min (origin 0,0,0 always included)
Definition: engine.h:253
Part 4.
Definition: engine.h:105
std::string m_error
Last encountered error.
Definition: engine.h:1293
void SetState(int state, const Color &color=Color(1.0f, 1.0f, 1.0f, 1.0f))
Sets the current rendering state.
Definition: engine.cpp:1996
TextureCreateParams m_defaultTexParams
Default texture create params.
Definition: engine.h:1407
float min
Min altitude.
Definition: engine.h:392
int shadowRank
Rank of the associated shadow.
Definition: engine.h:299
std::string m_lastTexture[2]
Last texture names for 2 used texture stages.
Definition: engine.h:1434
void DrawInterface()
Draws the user interface over the scene.
Definition: engine.cpp:3393
int GetStatisticTriangle()
Returns the number of triangles in current frame.
Definition: engine.cpp:498
float GetEyeDirV()
Returns the vertical direction angle of view.
Definition: engine.cpp:3041
void SetSkyMode(bool present)
Management the mode of sky.
Definition: engine.cpp:2941
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:2766
Texture LoadTexture(const std::string &name)
Loads texture, creating it if not already present.
Definition: engine.cpp:2299
Always use 2nd floor texturing.
Definition: engine.h:111
float max
Max altitude.
Definition: engine.h:394
void SetFogStart(float start, int rank=0)
Management the start of fog.
Definition: engine.cpp:2756
Definition: singleton.h:27
Increase.
Definition: engine.h:430
Fixed object type metal.
Definition: engine.h:180
int CreateGroundSpot()
Creates a new ground spot and returns its rank.
Definition: engine.cpp:1532
Texture m_miceTexture
Texture with mouse cursors.
Definition: engine.h:1423
Math::Vector m_eyePt
Location of camera.
Definition: engine.h:1340
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:1187
EngineRenderState
Render state of graphics engine.
Definition: engine.h:78
Math::Point m_mouseSize
Size of mouse cursor.
Definition: engine.h:1425
int icon1
Index of texture element for 1st image.
Definition: engine.h:555
Normal opaque materials.
Definition: engine.h:81
std::set< std::string > m_texBlacklist
Blacklist map of textures.
Definition: engine.h:1418
void SetLightMode(bool present)
Managing the mode of dynamic lights.
Definition: engine.cpp:2971
TEST_VIRTUAL Math::Vector GetLookatPt()
Returns the camera target point.
Definition: engine.cpp:3031
float radius
Radius of the shadow.
Definition: engine.h:400
void ApplyChange()
Updates the scene after a change of parameters.
Definition: engine.cpp:3056
const Math::Matrix & GetMatView()
Returns the view matrix.
Definition: engine.cpp:3021
bool LoadAllTextures()
Loads all necessary textures.
Definition: engine.cpp:2322
Scroll to the left.
Definition: engine.h:534
void SetFogColor(const Color &color, int rank=0)
Management of the fog color.
Definition: engine.cpp:2733
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:1857
bool m_render
Rendering enabled?
Definition: engine.h:1307
float height
Height from the ground.
Definition: engine.h:362
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:2222
Mode for rendering text.
Definition: engine.h:119
float drawRadius
Radius of the shadow drawn.
Definition: engine.h:404
Resize vertically.
Definition: engine.h:528
void SetTextureQuality(int value)
Management the quality of textures.
Definition: engine.cpp:2884
triangle is always visible, no matter at what distance
Definition: modelfile.h:49
A triangle drawn by the graphics engine.
Definition: engine.h:143
bool Create()
Performs the initialization; must be called after device was set.
Definition: engine.cpp:244
bool DetectBBox(int objRank, Math::Point mouse)
Detects whether an object is affected by the mouse.
Definition: engine.cpp:1739
Fixed object.
Definition: engine.h:172
bool drawFront
If true, the shape is before the 2D interface.
Definition: engine.h:291
Color color
Color of the shadow.
Definition: engine.h:390
void SetOverFront(bool front)
Specifies whether to draw the foreground.
Definition: engine.cpp:2815
CLightning * GetLightning()
Returns the lighting manager.
Definition: engine.cpp:224
Math::Vector pos
Position of the shadow.
Definition: engine.h:352
EngineGroundMarkPhase phase
Phase of life.
Definition: engine.h:446
void SetTerrainVision(float vision)
Defines of the distance field of vision.
Definition: engine.cpp:2615
Cloud layer renderer.
Definition: cloud.h:76
void DeleteAllBaseObjects()
Deletes all base objects.
Definition: engine.cpp:601
Lightning effect renderer.
Definition: lightning.h:52
void SetPause(bool pause)
Management of game pause mode.
Definition: engine.cpp:429
Fixed object type quartz.
Definition: engine.h:178
void DeleteShadow(int objRank)
Deletes the shadow for given object.
Definition: engine.cpp:1312
float m_focus
Camera angle for 3D scene.
Definition: engine.h:1316
void SetMouseType(EngineMouseType type)
Management of mouse cursor type.
Definition: engine.cpp:3011
Particle engine.
Definition: particle.h:266
Math::Vector drawPos
Draw position for marks.
Definition: engine.h:458
bool WriteScreenShot(const std::string &fileName, int width, int height)
Writes a screenshot containing the current frame.
Definition: engine.cpp:422
float radius
Radius of the sphere at the origin.
Definition: engine.h:257
Color m_lastColor
Last color set with render state.
Definition: engine.h:1432
void ResetAfterDeviceChanged()
Resets some states and flushes textures after device was changed (e.g. resoulution changed) ...
Definition: engine.cpp:317
void FrameUpdate()
Called once per frame, the call is the entry point for animating the scene.
Definition: engine.cpp:353
The transparent texture (black = no)
Definition: engine.h:83
Type of shadow drawn by the graphics engine.
Math::Point WindowToInterfaceSize(Math::IntPoint size)
Conversion functions between window and interface sizes.
Definition: engine.cpp:481
A spot (large shadow) drawn on the ground by the graphics engine.
Definition: engine.h:385
The transparent color (white = no)
Definition: engine.h:117
Math::Vector pos
Position for marks.
Definition: engine.h:452
Color structs and related functions.
float fix
Fixed time.
Definition: engine.h:450
TODO: ?
Definition: engine.h:334
Decrease.
Definition: engine.h:434
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:1968
Resize diagonally bottom-left to top-right.
Definition: engine.h:530
Scroll to the right.
Definition: engine.h:536
void SetAmbientColor(const Color &color, int rank=0)
Ambient color management.
Definition: engine.cpp:2713
The transparent color (black = no)
Definition: engine.h:115
void Destroy()
Frees all resources before exit.
Definition: engine.cpp:291
float angle
Angle of the shadow.
Definition: engine.h:356
Part 2.
Definition: engine.h:101
Only opaque color, no texture, blending, etc.
Definition: engine.h:123
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:2743
void DrawShadow()
Draws shadows.
Definition: engine.cpp:3784
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:660
void Draw3DScene()
Prepares the interface for 3D scene.
Definition: engine.cpp:3112
Material material
Material.
Definition: engine.h:148
std::string tex2Name
2nd texture
Definition: engine.h:154
void SetTotoMode(bool present)
Management mode of toto.
Definition: engine.cpp:2901
Vertex structs.
void SetWaterAddColor(const Color &color)
Color management under water.
Definition: engine.cpp:2723
Hand.
Definition: engine.h:516
Matrix struct and related functions.
int state
Render state.
Definition: engine.h:150
void SetMaterial(const Material &mat)
Sets the current material.
Definition: engine.cpp:2216
Math::Point m_highlightP1
Highlight rectangle points.
Definition: engine.h:1402
EngineShadowType type
Type of shadow.
Definition: engine.h:350
void SetShowStats(bool show)
Management of displaying statistic information.
Definition: engine.cpp:449
EngineBaseObjLODTier & AddLevel3(EngineBaseObjTexTier &p2, LODLevel lodLevel)
Creates a new tier 3 object (LOD)
Definition: engine.cpp:521
void SetDrawFront(bool draw)
Whether to draw the world on the interface.
Definition: engine.cpp:2708
void SetEditIndentMode(bool autoIndent)
Management of the indentation mode while editing (CEdit)
Definition: engine.cpp:2981
VertexTex2 triangle[3]
Triangle vertices.
Definition: engine.h:146
2D point
Definition: point.h:46
int icon2
Index of texture element for 2nd image.
Definition: engine.h:557
bool used
If true, object is valid in objects vector.
Definition: engine.h:283
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:962
Image loaded from file.
Definition: image.h:54
bool hide
If true, shadow is invisible (object being carried for example)
Definition: engine.h:346
Main application.
Definition: app.h:200
void Render()
Called once per frame, the call is the entry point for rendering.
Definition: engine.cpp:3078
Model loading - CModelFile class (aka modfile)
void DebugObject(int rank)
Print debug info about an object.
Definition: engine.cpp:744
EngineBaseObjTexTier & AddLevel2(EngineBaseObject &p1, const std::string &tex1Name, const std::string &tex2Name)
Creates a new tier 2 object (texture)
Definition: engine.cpp:509
void DrawForegroundImage()
Draws the image foreground.
Definition: engine.cpp:4109
Math::Matrix m_matViewInterface
View matrix for 2D interface.
Definition: engine.h:1323
CTerrain * GetTerrain()
Returns the terrain manager.
Definition: engine.cpp:214
Shadow drawn by the graphics engine.
Definition: engine.h:341
void SetGroundSpot(bool mode)
Management of the global mode of marking.
Definition: engine.cpp:2634
void SetEditIndentValue(int value)
Management of tab indent when editing (CEdit)
Definition: engine.cpp:2991
void SetObjectBaseRank(int objRank, int baseObjRank)
Management of the base object rank for engine object.
Definition: engine.cpp:870
Math::Vector bboxMax
bounding box max (origin 0,0,0 always included)
Definition: engine.h:255
TEST_VIRTUAL Math::Vector GetEyePt()
Returns the camera center point.
Definition: engine.cpp:3026
CWater * GetWater()
Returns the water manager.
Definition: engine.cpp:219
float smooth
Transition area.
Definition: engine.h:396
Null phase.
Definition: engine.h:428
Texture CreateTexture(const std::string &texName, const TextureCreateParams &params, CImage *image=nullptr)
Create texture and add it to cache.
Definition: engine.cpp:2239
EngineGroundMark m_groundMark
Ground mark.
Definition: engine.h:1337
CText * GetText()
Returns the text rendering engine.
Definition: engine.cpp:199
Math::IntPoint m_size
Current size of viewport window.
Definition: engine.h:1326
Part 3.
Definition: engine.h:103
Terrain loader/generator and manager.
Definition: terrain.h:220
std::vector< EngineObject > m_objects
Object parameters.
Definition: engine.h:1331
void SetObjectDrawFront(int objRank, bool draw)
Sets drawFront for given object.
Definition: engine.cpp:920
Resize diagonally top-left to bottom-right.
Definition: engine.h:532
bool visible
If true, the object is drawn.
Definition: engine.h:287
The transparent diffuse color.
Definition: engine.h:87
EngineObject()
Calls LoadDefault()
Definition: engine.h:304
EngineMouseType
Type of mouse cursor displayed in-game.
Definition: engine.h:507
void DrawPlanet()
Draws all the planets.
Definition: engine.cpp:4093
int CreateObject()
Creates a new object and returns its rank.
Definition: engine.cpp:821
void SetTerrain(CTerrain *terrain)
Sets the terrain object.
Definition: engine.cpp:239
void SetForegroundName(const std::string &name)
Specifies the name of foreground texture.
Definition: engine.cpp:2801
void SetGadgetQuantity(float value)
The amount of management objects gadgets.
Definition: engine.cpp:2871
float drawRadius
Radius for marks.
Definition: engine.h:460
float radius
Radius of the shadow.
Definition: engine.h:358
EngineRenderState mode1
Mode to render 1st image in.
Definition: engine.h:561
Vector struct and related functions.
The graphics engine.
Definition: engine.h:681
int dx
X dimension of table.
Definition: engine.h:464
void SetObjectTransform(int objRank, const Math::Matrix &transform)
Management of object transform.
Definition: engine.cpp:899
Normal cursor (arrow)
Definition: engine.h:510
Double white texturing.
Definition: engine.h:97
Object drawn by the graphics engine.
Definition: engine.h:280
float GetEyeDirH()
Returns the horizontal direction angle of view.
Definition: engine.cpp:3036
EngineBaseObjDataTier & AddLevel4(EngineBaseObjLODTier &p3, EngineTriangleType type, const Material &mat, int state)
Creates a new tier 4 object (data)
Definition: engine.cpp:533
EngineMouseType m_mouseType
Type of mouse cursor.
Definition: engine.h:1427
void Update()
Updates the state after creating objects.
Definition: engine.cpp:1732
Event types, structs and event queue.
void UpdateGroundSpotTextures()
Updates the textures used for drawing ground spot.
Definition: engine.cpp:3516
EngineTriangleType
Type of triangles drawn for engine objects.
Definition: engine.h:131
void DeleteGroundSpot(int rank)
Deletes the given ground spot.
Definition: engine.cpp:1552
int dy
Y dimension of table.
Definition: engine.h:466
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:703
void SetHighlightRank(int *rankList)
Lists the ranks of objects and subobjects selected.
Definition: engine.cpp:1452
System functions: time stamps, info dialogs, etc.
Math::Vector normal
Normal to the terrain.
Definition: engine.h:354
Math::Matrix m_matWorldInterface
World matrix for 2D interface.
Definition: engine.h:1319
void ComputeDistance()
Calculates the distances between the viewpoint and the origin of different objects.
Definition: engine.cpp:1620
void SetShadow(bool mode)
Management of the global mode of shading.
Definition: engine.cpp:2644
int m_lastState
Last engine render state (-1 at the beginning of frame)
Definition: engine.h:1430
void SetOverColor(const Color &color=Color(), int mode=ENG_RSTATE_TCOLOR_BLACK)
Sets the foreground overlay color.
Definition: engine.cpp:2820
Information about mouse cursor.
Definition: engine.h:552
void SetDirty(bool mode)
Management of the global mode of contamination.
Definition: engine.cpp:2654
Math::Matrix transform
Transformation matrix.
Definition: engine.h:295
void DrawBackgroundImage()
Draws the image background.
Definition: engine.cpp:4034
bool m_interfaceMode
True when drawing 2D UI.
Definition: engine.h:1439
Moving object.
Definition: engine.h:174
Image using alpha channel.
Definition: engine.h:109
bool draw
If true, draw mark.
Definition: engine.h:444
Water manager/renderer.
Definition: water.h:116
Only opaque texture, no blending, etc.
Definition: engine.h:121
bool IsVisiblePoint(const Math::Vector &pos)
Indicates whether a point is visible.
Definition: engine.cpp:3046
void SetClippingDistance(float value)
Management of the distance of clipping.
Definition: engine.cpp:2846
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:1412
Resize.
Definition: engine.h:524
EngineTextureMapping
Type of texture mapping.
Definition: engine.h:492
Text rendering engine.
Definition: text.h:237
3D (3x1) vector
Definition: vector.h:49
int iconShadow
Shadow texture part.
Definition: engine.h:559
bool drawWorld
If true, object is behind the 2D interface.
Definition: engine.h:289
Tier 4 of object tree (data)
Definition: engine.h:188
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:1596
Math::Matrix m_matView
View matrix for 3D scene.
Definition: engine.h:1314
std::vector< EngineGroundSpot > m_groundSpots
Ground spot list.
Definition: engine.h:1335
Definition: system_linux.h:28
Part of a moving object.
Definition: engine.h:176
Surfaces.
Definition: engine.h:136
int CreateBaseObject()
Creates a base object and returns its rank.
Definition: engine.cpp:546
A mark on ground drawn by the graphics engine.
Definition: engine.h:441
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:1462
void UpdateStaticBuffer(EngineBaseObjDataTier &p4)
Updates a given static buffer.
Definition: engine.cpp:1681
CLightManager * GetLightManager()
Returns the light manager.
Definition: engine.cpp:204
CParticle * GetParticle()
Returns the particle manager.
Definition: engine.cpp:209
std::map< Texture, std::string > m_revTexNameMap
Reverse map of loaded textures (by texture)
Definition: engine.h:1414
RGBA color.
Definition: color.h:35
void UpdateStaticBuffers()
Updates static buffers of changed objects.
Definition: engine.cpp:1697
Triangles.
Definition: engine.h:134
void DrawStats()
Draw statistic texts.
Definition: engine.cpp:4336
void DeleteTexture(const std::string &name)
Deletes the given texture, unloading it and removing from cache.
Definition: engine.cpp:2546
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:2421
void DrawObject(const EngineBaseObjDataTier &p4)
Draw 3D object.
Definition: engine.cpp:3367
bool m_showStats
Whether to show stats (FPS, etc)
Definition: engine.h:1301
void UpdateGeometry()
Updates geometric parameters of objects (bounding box and radius)
Definition: engine.cpp:1635
void SetDevice(CDevice *device)
Sets the device to be used.
Definition: engine.cpp:189
std::vector< EngineBaseObject > m_baseObjects
Base objects (also level 1 tier list)
Definition: engine.h:1329
float distance
Distance to object from eye point.
Definition: engine.h:297
Scroll up.
Definition: engine.h:538
Event sent by system, interface or game.
Definition: event.h:687
float intensity
Intensity of the shadow.
Definition: engine.h:360
IntPoint struct.
CPlanet * GetPlanet()
Returns the planet manager.
Definition: engine.cpp:229
void DeleteGroundMark(int rank)
Deletes the ground mark.
Definition: engine.cpp:1615
void SetObjectDrawWorld(int objRank, bool draw)
Sets drawWorld for given object.
Definition: engine.cpp:913
int baseObjRank
Rank of associated base engine object.
Definition: engine.h:285
char * table
Pointer to the table.
Definition: engine.h:468
bool m_pause
Pause mode.
Definition: engine.h:1305
Definition: object.h:372
Math::IntPoint GetWindowSize()
Returns current size of viewport window.
Definition: engine.cpp:464
Texture borders with solid color.
Definition: engine.h:91
The transparent texture (white = no)
Definition: engine.h:85
void SetDrawWorld(bool draw)
Whether to draw the world.
Definition: engine.cpp:2703
CDevice * GetDevice()
Returns the current device.
Definition: engine.cpp:194
int GetObjectTotalTriangles(int objRank)
Returns the total number of triangles of given object.
Definition: engine.cpp:949
TODO: ?
Definition: engine.h:520
bool used
If true, base object is valid in objects vector.
Definition: engine.h:249
EngineGroundMarkPhase
Phase of life of an EngineGroundMark.
Definition: engine.h:425
Sound plugin interface.
Definition: sound.h:149
Causes the fog.
Definition: engine.h:113
Part 1 (no change in. MOD!)
Definition: engine.h:99
void DeleteAllObjects()
Deletes all objects, shadows and ground spots.
Definition: engine.cpp:851
void UpdateMatProj()
Resets the projection matrix after changes.
Definition: engine.cpp:3051
Abstract interface of graphics device.
Definition: device.h:235
bool IsVisible(int objRank)
Tests whether the given object is visible.
Definition: engine.cpp:1909
Double black texturing.
Definition: engine.h:95
int objRank
Rank of the associated object.
Definition: engine.h:348
bool ProcessEvent(const Event &event)
Processes incoming event.
Definition: engine.cpp:326
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:1006
Texture wrap.
Definition: engine.h:89
Definition: engine.h:246
void DrawBackgroundGradient(const Color &up, const Color &down)
Draws the gradient background.
Definition: engine.cpp:4004
void FlushTextureCache()
Empties the texture cache.
Definition: engine.cpp:2577
void SetFocus(float focus)
Management of camera angle.
Definition: engine.cpp:2620
CCloud * GetCloud()
Returns the fog manager.
Definition: engine.cpp:234