2019-05-15 14:52:37 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
class CEntity;
|
|
|
|
|
2020-12-13 11:53:19 +00:00
|
|
|
#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
|
|
|
|
|
2019-05-15 14:52:37 +00:00
|
|
|
extern bool gbShowPedRoadGroups;
|
|
|
|
extern bool gbShowCarRoadGroups;
|
|
|
|
extern bool gbShowCollisionPolys;
|
2019-07-19 11:58:19 +00:00
|
|
|
extern bool gbShowCollisionLines;
|
2019-11-09 15:17:54 +00:00
|
|
|
extern bool gbBigWhiteDebugLightSwitchedOn;
|
2019-05-15 14:52:37 +00:00
|
|
|
|
|
|
|
extern bool gbDontRenderBuildings;
|
|
|
|
extern bool gbDontRenderBigBuildings;
|
|
|
|
extern bool gbDontRenderPeds;
|
|
|
|
extern bool gbDontRenderObjects;
|
2019-07-19 11:58:19 +00:00
|
|
|
extern bool gbDontRenderVehicles;
|
2019-05-15 14:52:37 +00:00
|
|
|
|
|
|
|
class CVehicle;
|
|
|
|
class CPtrList;
|
|
|
|
|
2020-11-21 23:13:07 +00:00
|
|
|
// unused
|
|
|
|
struct BlockedRange
|
|
|
|
{
|
|
|
|
float a, b; // unknown
|
|
|
|
BlockedRange *prev, *next;
|
|
|
|
};
|
|
|
|
|
2019-05-15 14:52:37 +00:00
|
|
|
class CRenderer
|
|
|
|
{
|
2020-04-15 16:19:45 +00:00
|
|
|
static int32 ms_nNoOfVisibleEntities;
|
|
|
|
static CEntity *ms_aVisibleEntityPtrs[NUMVISIBLEENTITIES];
|
|
|
|
static int32 ms_nNoOfInVisibleEntities;
|
|
|
|
static CEntity *ms_aInVisibleEntityPtrs[NUMINVISIBLEENTITIES];
|
2020-11-03 19:33:07 +00:00
|
|
|
#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
|
2019-05-15 14:52:37 +00:00
|
|
|
|
2020-04-15 16:19:45 +00:00
|
|
|
static CVector ms_vecCameraPosition;
|
|
|
|
static CVehicle *m_pFirstPersonVehicle;
|
2019-07-14 10:46:36 +00:00
|
|
|
|
2020-11-21 23:13:07 +00:00
|
|
|
// unused
|
|
|
|
static BlockedRange aBlockedRanges[16];
|
|
|
|
static BlockedRange *pFullBlockedRanges;
|
|
|
|
static BlockedRange *pEmptyBlockedRanges;
|
2019-05-15 14:52:37 +00:00
|
|
|
public:
|
2020-04-15 16:19:45 +00:00
|
|
|
static float ms_lodDistScale;
|
|
|
|
static bool m_loadingPriority;
|
2019-06-26 22:12:58 +00:00
|
|
|
|
2019-05-15 14:52:37 +00:00
|
|
|
static void Init(void);
|
2019-07-06 10:27:21 +00:00
|
|
|
static void Shutdown(void);
|
2019-05-31 09:44:43 +00:00
|
|
|
static void PreRender(void);
|
2019-05-15 14:52:37 +00:00
|
|
|
|
|
|
|
static void RenderRoads(void);
|
|
|
|
static void RenderFadingInEntities(void);
|
2020-05-11 15:03:32 +00:00
|
|
|
static void RenderFadingInUnderwaterEntities(void);
|
2019-05-15 14:52:37 +00:00
|
|
|
static void RenderEverythingBarRoads(void);
|
|
|
|
static void RenderBoats(void);
|
|
|
|
static void RenderOneRoad(CEntity *);
|
|
|
|
static void RenderOneNonRoad(CEntity *);
|
|
|
|
static void RenderFirstPersonVehicle(void);
|
|
|
|
|
2019-07-19 11:58:19 +00:00
|
|
|
static void RenderCollisionLines(void);
|
|
|
|
|
2019-05-15 14:52:37 +00:00
|
|
|
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);
|
|
|
|
|
2020-05-11 15:03:32 +00:00
|
|
|
static bool ShouldModelBeStreamed(CEntity *ent, const CVector &campos);
|
2019-06-12 19:17:02 +00:00
|
|
|
|
|
|
|
static void RemoveVehiclePedLights(CEntity *ent, bool reset);
|
2020-11-03 19:33:07 +00:00
|
|
|
|
|
|
|
|
|
|
|
#ifdef NEW_RENDERER
|
|
|
|
static void ClearForFrame(void);
|
2020-11-04 22:11:27 +00:00
|
|
|
static void RenderPeds(void);
|
|
|
|
static void RenderVehicles(void); // also renders peds in LCS
|
2020-11-03 19:33:07 +00:00
|
|
|
static void RenderOneBuilding(CEntity *ent, float camdist = 0.0f);
|
|
|
|
static void RenderWorld(int pass); // like cWorldStream::Render(int)
|
2020-11-04 15:22:15 +00:00
|
|
|
static void RenderTransparentWater(void); // keep-out polys and transparent water
|
2020-11-03 19:33:07 +00:00
|
|
|
#endif
|
2020-11-04 15:22:15 +00:00
|
|
|
static void InsertEntityIntoList(CEntity *ent);
|
2021-01-10 10:59:51 +00:00
|
|
|
|
|
|
|
static void GenerateEnvironmentMap(void);
|
2019-05-15 14:52:37 +00:00
|
|
|
};
|