aboutsummaryrefslogtreecommitdiffstats
path: root/src/renderer/Renderer.h
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2021-07-18 00:05:51 +0300
committerSergeanur <s.anureev@yandex.ua>2021-07-18 00:05:51 +0300
commit7a034142c99e577b0339aefd9599cb7f373c495e (patch)
tree722b1946daf2b24374c7fcfab0face06af5eefba /src/renderer/Renderer.h
parentec5a07b049ac8ca05c051aa22a16186a298adadf (diff)
parentc937bdbfea8f522d14d7a41f24372bddf5bdafcc (diff)
Merge branch 'miami' into lcs
# Conflicts: # premake5.lua
Diffstat (limited to 'src/renderer/Renderer.h')
-rw-r--r--src/renderer/Renderer.h107
1 files changed, 107 insertions, 0 deletions
diff --git a/src/renderer/Renderer.h b/src/renderer/Renderer.h
new file mode 100644
index 00000000..a4b6b0b8
--- /dev/null
+++ b/src/renderer/Renderer.h
@@ -0,0 +1,107 @@
+#pragma once
+
+class CEntity;
+
+#ifdef FIX_BUGS
+#define LOD_DISTANCE (300.0f*TheCamera.LODDistMultiplier)
+#else
+#define LOD_DISTANCE 300.0f
+#endif
+#define FADE_DISTANCE 20.0f
+#define STREAM_DISTANCE 30.0f
+
+extern bool gbShowPedRoadGroups;
+extern bool gbShowCarRoadGroups;
+extern bool gbShowCollisionPolys;
+extern bool gbShowCollisionLines;
+extern bool gbBigWhiteDebugLightSwitchedOn;
+
+extern bool gbDontRenderBuildings;
+extern bool gbDontRenderBigBuildings;
+extern bool gbDontRenderPeds;
+extern bool gbDontRenderObjects;
+extern bool gbDontRenderVehicles;
+
+class CVehicle;
+class CPtrList;
+
+// unused
+struct BlockedRange
+{
+ float a, b; // unknown
+ BlockedRange *prev, *next;
+};
+
+class CRenderer
+{
+ static int32 ms_nNoOfVisibleEntities;
+ static CEntity *ms_aVisibleEntityPtrs[NUMVISIBLEENTITIES];
+ static int32 ms_nNoOfInVisibleEntities;
+ static CEntity *ms_aInVisibleEntityPtrs[NUMINVISIBLEENTITIES];
+#ifdef NEW_RENDERER
+ static int32 ms_nNoOfVisibleVehicles;
+ static CEntity *ms_aVisibleVehiclePtrs[NUMVISIBLEENTITIES];
+ // for cWorldStream emulation
+ static int32 ms_nNoOfVisibleBuildings;
+ static CEntity *ms_aVisibleBuildingPtrs[NUMVISIBLEENTITIES];
+#endif
+
+ static CVector ms_vecCameraPosition;
+ static CVehicle *m_pFirstPersonVehicle;
+
+ // unused
+ static BlockedRange aBlockedRanges[16];
+ static BlockedRange *pFullBlockedRanges;
+ static BlockedRange *pEmptyBlockedRanges;
+public:
+ static float ms_lodDistScale;
+ static bool m_loadingPriority;
+
+ static void Init(void);
+ static void Shutdown(void);
+ static void PreRender(void);
+
+ static void RenderRoads(void);
+ static void RenderFadingInEntities(void);
+ static void RenderFadingInUnderwaterEntities(void);
+ static void RenderEverythingBarRoads(void);
+ static void RenderBoats(void);
+ static void RenderOneRoad(CEntity *);
+ static void RenderOneNonRoad(CEntity *);
+ static void RenderFirstPersonVehicle(void);
+
+ static void RenderCollisionLines(void);
+
+ static int32 SetupEntityVisibility(CEntity *ent);
+ static int32 SetupBigBuildingVisibility(CEntity *ent);
+
+ static void ConstructRenderList(void);
+ static void ScanWorld(void);
+ static void RequestObjectsInFrustum(void);
+ static void ScanSectorPoly(RwV2d *poly, int32 numVertices, void (*scanfunc)(CPtrList *));
+ static void ScanBigBuildingList(CPtrList &list);
+ static void ScanSectorList(CPtrList *lists);
+ static void ScanSectorList_Priority(CPtrList *lists);
+ static void ScanSectorList_Subway(CPtrList *lists);
+ static void ScanSectorList_RequestModels(CPtrList *lists);
+
+ static void SortBIGBuildings(void);
+ static void SortBIGBuildingsForSectorList(CPtrList *list);
+
+ static bool ShouldModelBeStreamed(CEntity *ent, const CVector &campos);
+
+ static void RemoveVehiclePedLights(CEntity *ent, bool reset);
+
+
+#ifdef NEW_RENDERER
+ static void ClearForFrame(void);
+ static void RenderPeds(void);
+ static void RenderVehicles(void); // also renders peds in LCS
+ static void RenderOneBuilding(CEntity *ent, float camdist = 0.0f);
+ static void RenderWorld(int pass); // like cWorldStream::Render(int)
+ static void RenderTransparentWater(void); // keep-out polys and transparent water
+#endif
+ static void InsertEntityIntoList(CEntity *ent);
+
+ static void GenerateEnvironmentMap(void);
+};