mirror of
https://github.com/halpz/re3.git
synced 2025-03-04 03:39:41 +00:00
CVisibilityPlugins, CRenderer, some fixes
This commit is contained in:
parent
b77d93ba4a
commit
3f3e258d77
|
@ -1931,6 +1931,7 @@ CWorld::Process(void)
|
||||||
if(movingEnt->GetIsStatic()) { movingEnt->RemoveFromMovingList(); }
|
if(movingEnt->GetIsStatic()) { movingEnt->RemoveFromMovingList(); }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#ifdef VIS_DISTANCE_ALPHA
|
||||||
for(int y = 0; y < NUMSECTORS_Y; y++)
|
for(int y = 0; y < NUMSECTORS_Y; y++)
|
||||||
for(int x = 0; x < NUMSECTORS_X; x++){
|
for(int x = 0; x < NUMSECTORS_X; x++){
|
||||||
CPtrNode *node;
|
CPtrNode *node;
|
||||||
|
@ -1952,6 +1953,7 @@ CWorld::Process(void)
|
||||||
for(node = sect->m_lists[ENTITYLIST_DUMMIES_OVERLAP].first; node; node = node->next)
|
for(node = sect->m_lists[ENTITYLIST_DUMMIES_OVERLAP].first; node; node = node->next)
|
||||||
((CEntity*)node->item)->UpdateDistanceFade();
|
((CEntity*)node->item)->UpdateDistanceFade();
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
bForceProcessControl = true;
|
bForceProcessControl = true;
|
||||||
for(CPtrNode *node = ms_listMovingEntityPtrs.first; node; node = node->next) {
|
for(CPtrNode *node = ms_listMovingEntityPtrs.first; node; node = node->next) {
|
||||||
CPhysical *movingEnt = (CPhysical *)node->item;
|
CPhysical *movingEnt = (CPhysical *)node->item;
|
||||||
|
|
|
@ -248,6 +248,11 @@ enum Config {
|
||||||
# define PS2_MATFX
|
# define PS2_MATFX
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
// Mobile only.
|
||||||
|
// Looks like they tried to fix fading but it still sucks
|
||||||
|
// do not use this
|
||||||
|
//#define VIS_DISTANCE_ALPHA
|
||||||
|
|
||||||
#ifdef VU_COLLISION
|
#ifdef VU_COLLISION
|
||||||
#define COMPRESSED_COL_VECTORS // currently need compressed vectors in this code
|
#define COMPRESSED_COL_VECTORS // currently need compressed vectors in this code
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -94,6 +94,7 @@ bool gSecondExportPass;
|
||||||
bool gUseModelResources;
|
bool gUseModelResources;
|
||||||
bool gUseResources;
|
bool gUseResources;
|
||||||
bool gNASTY_NASTY_MEM_SHUTDOWN_HACK; // rather unused
|
bool gNASTY_NASTY_MEM_SHUTDOWN_HACK; // rather unused
|
||||||
|
bool gbPreviewCity; // don't do worldstream-style rendering but traditional method
|
||||||
|
|
||||||
float FramesPerSecond = 30.0f;
|
float FramesPerSecond = 30.0f;
|
||||||
|
|
||||||
|
@ -1228,7 +1229,6 @@ DisplayGameDebugText()
|
||||||
#ifdef NEW_RENDERER
|
#ifdef NEW_RENDERER
|
||||||
bool gbRenderRoads = true;
|
bool gbRenderRoads = true;
|
||||||
bool gbRenderEverythingBarRoads = true;
|
bool gbRenderEverythingBarRoads = true;
|
||||||
bool gbRenderFadingInUnderwaterEntities = true;
|
|
||||||
bool gbRenderFadingInEntities = true;
|
bool gbRenderFadingInEntities = true;
|
||||||
bool gbRenderWater = true;
|
bool gbRenderWater = true;
|
||||||
bool gbRenderBoats = true;
|
bool gbRenderBoats = true;
|
||||||
|
@ -1246,7 +1246,8 @@ MattRenderScene(void)
|
||||||
/// CRenderer::ClearForFrame(); // before ConstructRenderList
|
/// CRenderer::ClearForFrame(); // before ConstructRenderList
|
||||||
CClock::CalcEnvMapTimeMultiplicator();
|
CClock::CalcEnvMapTimeMultiplicator();
|
||||||
RwRenderStateSet(rwRENDERSTATECULLMODE, (void*)rwCULLMODECULLNONE);
|
RwRenderStateSet(rwRENDERSTATECULLMODE, (void*)rwCULLMODECULLNONE);
|
||||||
CWaterLevel::RenderWater(); // actually CMattRenderer::RenderWater
|
if(gbRenderWater)
|
||||||
|
CRenderer::RenderWater(); // actually CMattRenderer::RenderWater
|
||||||
CClock::ms_EnvMapTimeMultiplicator = 1.0f;
|
CClock::ms_EnvMapTimeMultiplicator = 1.0f;
|
||||||
// cWorldStream::ClearDynamics
|
// cWorldStream::ClearDynamics
|
||||||
/// CRenderer::ConstructRenderList(); // before PreRender
|
/// CRenderer::ConstructRenderList(); // before PreRender
|
||||||
|
@ -1260,24 +1261,14 @@ if(gbRenderWorld1)
|
||||||
if(gbRenderRoads)
|
if(gbRenderRoads)
|
||||||
CRenderer::RenderRoads();
|
CRenderer::RenderRoads();
|
||||||
|
|
||||||
CRenderer::GenerateEnvironmentMap(); // should be after static shadows, but that's weird
|
|
||||||
|
|
||||||
CRenderer::RenderPeds();
|
|
||||||
|
|
||||||
// not sure where to put these since LCS has no underwater entities
|
|
||||||
if(gbRenderBoats)
|
|
||||||
CRenderer::RenderBoats();
|
|
||||||
if(gbRenderFadingInUnderwaterEntities)
|
|
||||||
CRenderer::RenderFadingInUnderwaterEntities();
|
|
||||||
RwRenderStateSet(rwRENDERSTATECULLMODE, (void*)rwCULLMODECULLNONE);
|
RwRenderStateSet(rwRENDERSTATECULLMODE, (void*)rwCULLMODECULLNONE);
|
||||||
if(gbRenderWater)
|
|
||||||
CRenderer::RenderTransparentWater();
|
|
||||||
|
|
||||||
if(gbRenderEverythingBarRoads)
|
if(gbRenderEverythingBarRoads)
|
||||||
CRenderer::RenderEverythingBarRoads();
|
CRenderer::RenderEverythingBarRoads();
|
||||||
// seam fixer
|
// TODO: seam fixer
|
||||||
// moved this:
|
// these aren't very transparent. just objects
|
||||||
// CRenderer::RenderFadingInEntities();
|
if(gbRenderFadingInEntities)
|
||||||
|
CRenderer::RenderFadingInEntities();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -1290,7 +1281,8 @@ RenderScene_new(void)
|
||||||
MattRenderScene();
|
MattRenderScene();
|
||||||
DefinedState();
|
DefinedState();
|
||||||
// CMattRenderer::ResetRenderStates
|
// CMattRenderer::ResetRenderStates
|
||||||
// moved CRenderer::RenderBoats to before transparent water
|
if(gbRenderBoats)
|
||||||
|
CRenderer::RenderBoats();
|
||||||
POP_RENDERGROUP();
|
POP_RENDERGROUP();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1300,12 +1292,12 @@ void
|
||||||
RenderEffects_new(void)
|
RenderEffects_new(void)
|
||||||
{
|
{
|
||||||
PUSH_RENDERGROUP("RenderEffects_new");
|
PUSH_RENDERGROUP("RenderEffects_new");
|
||||||
/* // stupid to do this before the whole world is drawn!
|
// stupid to do this before the whole world is drawn!
|
||||||
CShadows::RenderStaticShadows();
|
// CShadows::RenderStaticShadows();
|
||||||
CShadows::RenderStoredShadows();
|
CRenderer::GenerateEnvironmentMap();
|
||||||
CSkidmarks::Render();
|
// CShadows::RenderStoredShadows();
|
||||||
CRubbish::Render();
|
// CSkidmarks::Render();
|
||||||
*/
|
// CRubbish::Render();
|
||||||
|
|
||||||
// these aren't really effects
|
// these aren't really effects
|
||||||
DefinedState();
|
DefinedState();
|
||||||
|
@ -1323,9 +1315,6 @@ if(gbRenderWorld2)
|
||||||
if(gbRenderVehicles)
|
if(gbRenderVehicles)
|
||||||
CRenderer::RenderVehicles();
|
CRenderer::RenderVehicles();
|
||||||
}
|
}
|
||||||
// better render these after transparent world
|
|
||||||
if(gbRenderFadingInEntities)
|
|
||||||
CRenderer::RenderFadingInEntities();
|
|
||||||
|
|
||||||
// actual effects here
|
// actual effects here
|
||||||
|
|
||||||
|
@ -1592,12 +1581,8 @@ Idle(void *arg)
|
||||||
#ifdef PC_WATER
|
#ifdef PC_WATER
|
||||||
CWaterLevel::PreCalcWaterGeometry();
|
CWaterLevel::PreCalcWaterGeometry();
|
||||||
#endif
|
#endif
|
||||||
#ifdef NEW_RENDERER
|
CWorld::AdvanceCurrentScanCode();
|
||||||
if(gbNewRenderer){
|
CRenderer::ClearForFrame();
|
||||||
CWorld::AdvanceCurrentScanCode(); // don't think this is even necessary
|
|
||||||
CRenderer::ClearForFrame();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
CRenderer::ConstructRenderList();
|
CRenderer::ConstructRenderList();
|
||||||
tbEndTimer("CnstrRenderList");
|
tbEndTimer("CnstrRenderList");
|
||||||
|
|
||||||
|
|
|
@ -42,6 +42,7 @@ extern bool gSecondExportPass;
|
||||||
extern bool gUseModelResources;
|
extern bool gUseModelResources;
|
||||||
extern bool gUseResources;
|
extern bool gUseResources;
|
||||||
extern bool gNASTY_NASTY_MEM_SHUTDOWN_HACK;
|
extern bool gNASTY_NASTY_MEM_SHUTDOWN_HACK;
|
||||||
|
extern bool gbPreviewCity;
|
||||||
|
|
||||||
class CSprite2d;
|
class CSprite2d;
|
||||||
|
|
||||||
|
|
|
@ -629,9 +629,6 @@ void SaveINISettings()
|
||||||
StoreIni("CustomPipesValues", "GlossMult", CustomPipes::GlossMult);
|
StoreIni("CustomPipesValues", "GlossMult", CustomPipes::GlossMult);
|
||||||
#endif
|
#endif
|
||||||
StoreIni("Rendering", "BackfaceCulling", gBackfaceCulling);
|
StoreIni("Rendering", "BackfaceCulling", gBackfaceCulling);
|
||||||
#ifdef NEW_RENDERER
|
|
||||||
StoreIni("Rendering", "NewRenderer", gbNewRenderer);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef PROPER_SCALING
|
#ifdef PROPER_SCALING
|
||||||
StoreIni("Draw", "ProperScaling", CDraw::ms_bProperScaling);
|
StoreIni("Draw", "ProperScaling", CDraw::ms_bProperScaling);
|
||||||
|
@ -1005,10 +1002,8 @@ DebugMenuPopulate(void)
|
||||||
DebugMenuAddVarBool8("Render", "VSynch", &FrontEndMenuManager.m_PrefsVsync, nil);
|
DebugMenuAddVarBool8("Render", "VSynch", &FrontEndMenuManager.m_PrefsVsync, nil);
|
||||||
DebugMenuAddVar("Render", "Max FPS", &RsGlobal.maxFPS, nil, 1, 1, 1000, nil);
|
DebugMenuAddVar("Render", "Max FPS", &RsGlobal.maxFPS, nil, 1, 1, 1000, nil);
|
||||||
#ifdef NEW_RENDERER
|
#ifdef NEW_RENDERER
|
||||||
DebugMenuAddVarBool8("Render", "New Renderer", &gbNewRenderer, nil);
|
|
||||||
extern bool gbRenderRoads;
|
extern bool gbRenderRoads;
|
||||||
extern bool gbRenderEverythingBarRoads;
|
extern bool gbRenderEverythingBarRoads;
|
||||||
extern bool gbRenderFadingInUnderwaterEntities;
|
|
||||||
extern bool gbRenderFadingInEntities;
|
extern bool gbRenderFadingInEntities;
|
||||||
extern bool gbRenderWater;
|
extern bool gbRenderWater;
|
||||||
extern bool gbRenderBoats;
|
extern bool gbRenderBoats;
|
||||||
|
@ -1018,7 +1013,6 @@ extern bool gbRenderWorld1;
|
||||||
extern bool gbRenderWorld2;
|
extern bool gbRenderWorld2;
|
||||||
DebugMenuAddVarBool8("Debug Render", "gbRenderRoads", &gbRenderRoads, nil);
|
DebugMenuAddVarBool8("Debug Render", "gbRenderRoads", &gbRenderRoads, nil);
|
||||||
DebugMenuAddVarBool8("Debug Render", "gbRenderEverythingBarRoads", &gbRenderEverythingBarRoads, nil);
|
DebugMenuAddVarBool8("Debug Render", "gbRenderEverythingBarRoads", &gbRenderEverythingBarRoads, nil);
|
||||||
DebugMenuAddVarBool8("Debug Render", "gbRenderFadingInUnderwaterEntities", &gbRenderFadingInUnderwaterEntities, nil);
|
|
||||||
DebugMenuAddVarBool8("Debug Render", "gbRenderFadingInEntities", &gbRenderFadingInEntities, nil);
|
DebugMenuAddVarBool8("Debug Render", "gbRenderFadingInEntities", &gbRenderFadingInEntities, nil);
|
||||||
DebugMenuAddVarBool8("Debug Render", "gbRenderWater", &gbRenderWater, nil);
|
DebugMenuAddVarBool8("Debug Render", "gbRenderWater", &gbRenderWater, nil);
|
||||||
DebugMenuAddVarBool8("Debug Render", "gbRenderBoats", &gbRenderBoats, nil);
|
DebugMenuAddVarBool8("Debug Render", "gbRenderBoats", &gbRenderBoats, nil);
|
||||||
|
@ -1026,6 +1020,7 @@ extern bool gbRenderWorld2;
|
||||||
DebugMenuAddVarBool8("Debug Render", "gbRenderWorld0", &gbRenderWorld0, nil);
|
DebugMenuAddVarBool8("Debug Render", "gbRenderWorld0", &gbRenderWorld0, nil);
|
||||||
DebugMenuAddVarBool8("Debug Render", "gbRenderWorld1", &gbRenderWorld1, nil);
|
DebugMenuAddVarBool8("Debug Render", "gbRenderWorld1", &gbRenderWorld1, nil);
|
||||||
DebugMenuAddVarBool8("Debug Render", "gbRenderWorld2", &gbRenderWorld2, nil);
|
DebugMenuAddVarBool8("Debug Render", "gbRenderWorld2", &gbRenderWorld2, nil);
|
||||||
|
DebugMenuAddVarBool8("Debug Render", "gbPreviewCity", &gbPreviewCity, nil);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef EXTENDED_COLOURFILTER
|
#ifdef EXTENDED_COLOURFILTER
|
||||||
|
|
|
@ -86,9 +86,9 @@ CEntity::CEntity(void)
|
||||||
bHasPreRenderEffects = false;
|
bHasPreRenderEffects = false;
|
||||||
|
|
||||||
bIsTreeModel = false;
|
bIsTreeModel = false;
|
||||||
m_flagG2 = false;
|
bIsVehicle = false;
|
||||||
m_flagG4 = false;
|
bIsPed = false;
|
||||||
m_flagG8 = false;
|
bMakeVisible = false;
|
||||||
|
|
||||||
m_scanCode = 0;
|
m_scanCode = 0;
|
||||||
m_modelIndex = -1;
|
m_modelIndex = -1;
|
||||||
|
@ -444,8 +444,11 @@ void
|
||||||
CEntity::Render(void)
|
CEntity::Render(void)
|
||||||
{
|
{
|
||||||
if(m_rwObject){
|
if(m_rwObject){
|
||||||
if(CVisibilityPlugins::GetObjectDistanceAlpha(m_rwObject) != 0){
|
#ifdef VIS_DISTANCE_ALPHA
|
||||||
// NB: LCS does not use bImBeingRendered here,
|
if(CVisibilityPlugins::GetObjectDistanceAlpha(m_rwObject) != 0)
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
// TODO(LCS): LCS does not use bImBeingRendered here,
|
||||||
// but that may be due to the streamed world. better keep it for safety
|
// but that may be due to the streamed world. better keep it for safety
|
||||||
bImBeingRendered = true;
|
bImBeingRendered = true;
|
||||||
if(RwObjectGetType(m_rwObject) == rpATOMIC)
|
if(RwObjectGetType(m_rwObject) == rpATOMIC)
|
||||||
|
@ -457,13 +460,12 @@ CEntity::Render(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef VIS_DISTANCE_ALPHA
|
||||||
void
|
void
|
||||||
CEntity::UpdateDistanceFade(void)
|
CEntity::UpdateDistanceFade(void)
|
||||||
{
|
{
|
||||||
// TODO(LCS):
|
// bDistanceFade is only valid when entity is in alpha list
|
||||||
// increasing and decreasing alpha depending on bDistanceFade doesn't make any sense
|
// but we're always checking it here, see fix in CRenderer
|
||||||
// so disable this whole thing until it does.
|
|
||||||
return;
|
|
||||||
int alpha = CVisibilityPlugins::GetObjectDistanceAlpha(m_rwObject);
|
int alpha = CVisibilityPlugins::GetObjectDistanceAlpha(m_rwObject);
|
||||||
if(CCutsceneMgr::IsRunning() || TheCamera.WorldViewerBeingUsed)
|
if(CCutsceneMgr::IsRunning() || TheCamera.WorldViewerBeingUsed)
|
||||||
alpha = 255;
|
alpha = 255;
|
||||||
|
@ -473,6 +475,7 @@ return;
|
||||||
alpha = Min(alpha+32, 255);
|
alpha = Min(alpha+32, 255);
|
||||||
CVisibilityPlugins::SetObjectDistanceAlpha(m_rwObject, alpha);
|
CVisibilityPlugins::SetObjectDistanceAlpha(m_rwObject, alpha);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void
|
void
|
||||||
CEntity::UpdateAnim(void)
|
CEntity::UpdateAnim(void)
|
||||||
|
|
|
@ -100,9 +100,9 @@ public:
|
||||||
|
|
||||||
// LCS flagsG
|
// LCS flagsG
|
||||||
uint32 bIsTreeModel : 1;
|
uint32 bIsTreeModel : 1;
|
||||||
uint32 m_flagG2 : 1;
|
uint32 bIsVehicle : 1; // not sure what exactly these two are for
|
||||||
uint32 m_flagG4 : 1;
|
uint32 bIsPed : 1;
|
||||||
uint32 m_flagG8 : 1;
|
uint32 bMakeVisible : 1;
|
||||||
|
|
||||||
uint16 m_scanCode;
|
uint16 m_scanCode;
|
||||||
uint16 m_randomSeed;
|
uint16 m_randomSeed;
|
||||||
|
@ -163,7 +163,9 @@ public:
|
||||||
return (RpClump*)m_rwObject;
|
return (RpClump*)m_rwObject;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef VIS_DISTANCE_ALPHA
|
||||||
void UpdateDistanceFade(void);
|
void UpdateDistanceFade(void);
|
||||||
|
#endif
|
||||||
void GetBoundCentre(CVUVECTOR &out);
|
void GetBoundCentre(CVUVECTOR &out);
|
||||||
CVector GetBoundCentre(void);
|
CVector GetBoundCentre(void);
|
||||||
float GetBoundRadius(void);
|
float GetBoundRadius(void);
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
#include "TxdStore.h"
|
#include "TxdStore.h"
|
||||||
#include "Renderer.h"
|
#include "Renderer.h"
|
||||||
#include "World.h"
|
#include "World.h"
|
||||||
|
#include "VisibilityPlugins.h"
|
||||||
#include "custompipes.h"
|
#include "custompipes.h"
|
||||||
|
|
||||||
#ifndef LIBRW
|
#ifndef LIBRW
|
||||||
|
@ -464,9 +465,13 @@ worldRenderCB(rw::Atomic *atomic, rw::d3d9::InstanceDataHeader *header)
|
||||||
else
|
else
|
||||||
d3d::setTexture(0, gpWhiteTexture); // actually we don't even render this
|
d3d::setTexture(0, gpWhiteTexture); // actually we don't even render this
|
||||||
|
|
||||||
setMaterial(m->color, m->surfaceProps, WorldPipeSwitch == WORLDPIPE_PS2 ? 0.5f : 1.0f);
|
rw::RGBA color = m->color;
|
||||||
|
#ifdef VIS_DISTANCE_ALPHA
|
||||||
|
color.alpha = (color.alpha * CVisibilityPlugins::GetObjectDistanceAlpha((RwObject*)atomic))/255.0f;
|
||||||
|
#endif
|
||||||
|
setMaterial(color, m->surfaceProps, WorldPipeSwitch == WORLDPIPE_PS2 ? 0.5f : 1.0f);
|
||||||
|
|
||||||
SetRenderState(VERTEXALPHA, inst->vertexAlpha || m->color.alpha != 255);
|
SetRenderState(VERTEXALPHA, inst->vertexAlpha || color.alpha != 255);
|
||||||
|
|
||||||
drawInst(header, inst);
|
drawInst(header, inst);
|
||||||
inst++;
|
inst++;
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
#include "TxdStore.h"
|
#include "TxdStore.h"
|
||||||
#include "Renderer.h"
|
#include "Renderer.h"
|
||||||
#include "World.h"
|
#include "World.h"
|
||||||
|
#include "VisibilityPlugins.h"
|
||||||
#include "custompipes.h"
|
#include "custompipes.h"
|
||||||
|
|
||||||
#ifndef LIBRW
|
#ifndef LIBRW
|
||||||
|
@ -457,9 +458,13 @@ worldRenderCB(rw::Atomic *atomic, rw::gl3::InstanceDataHeader *header)
|
||||||
|
|
||||||
setTexture(0, m->texture);
|
setTexture(0, m->texture);
|
||||||
|
|
||||||
setMaterial(m->color, m->surfaceProps, CustomPipes::WorldPipeSwitch == CustomPipes::WORLDPIPE_PS2 ? 0.5f : 1.0f);
|
rw::RGBA color = m->color;
|
||||||
|
#ifdef VIS_DISTANCE_ALPHA
|
||||||
|
color.alpha = (color.alpha * CVisibilityPlugins::GetObjectDistanceAlpha((RwObject*)atomic))/255.0f;
|
||||||
|
#endif
|
||||||
|
setMaterial(color, m->surfaceProps, CustomPipes::WorldPipeSwitch == CustomPipes::WORLDPIPE_PS2 ? 0.5f : 1.0f);
|
||||||
|
|
||||||
rw::SetRenderState(VERTEXALPHA, inst->vertexAlpha || m->color.alpha != 0xFF);
|
rw::SetRenderState(VERTEXALPHA, inst->vertexAlpha || color.alpha != 0xFF);
|
||||||
|
|
||||||
drawInst(header, inst);
|
drawInst(header, inst);
|
||||||
inst++;
|
inst++;
|
||||||
|
|
|
@ -33,4 +33,6 @@ namespace base
|
||||||
|
|
||||||
void cRelocatableChunkWriter::Save(const char* filename, uint32 a3, uint32 a4, bool a5) {}
|
void cRelocatableChunkWriter::Save(const char* filename, uint32 a3, uint32 a4, bool a5) {}
|
||||||
void cRelocatableChunkWriter::Save(void* file, uint32 a3, uint32 a4, bool a5, sChunkHeader* pHeader) {}
|
void cRelocatableChunkWriter::Save(void* file, uint32 a3, uint32 a4, bool a5, sChunkHeader* pHeader) {}
|
||||||
|
|
||||||
|
void RegisterRelocatableChunkFunc(const void *func) {}
|
||||||
};
|
};
|
|
@ -50,4 +50,6 @@ namespace base
|
||||||
void Save(const char* filename, uint32 a3, uint32 a4, bool a5);
|
void Save(const char* filename, uint32 a3, uint32 a4, bool a5);
|
||||||
void Save(void* file, uint32 a3, uint32 a4, bool a5, sChunkHeader* pHeader);
|
void Save(void* file, uint32 a3, uint32 a4, bool a5, sChunkHeader* pHeader);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
void RegisterRelocatableChunkFunc(const void *func);
|
||||||
};
|
};
|
58
src/modelinfo/MloModelInfo.cpp
Normal file
58
src/modelinfo/MloModelInfo.cpp
Normal file
|
@ -0,0 +1,58 @@
|
||||||
|
#include "common.h"
|
||||||
|
|
||||||
|
#include "VisibilityPlugins.h"
|
||||||
|
#include "ModelInfo.h"
|
||||||
|
|
||||||
|
base::cRelocatableChunkClassInfo CMloModelInfo::msClassInfo("CMloModelInfo", VTABLE_ADDR(&msClassInstance), sizeof(msClassInstance));
|
||||||
|
CMloModelInfo CMloModelInfo::msClassInstance;
|
||||||
|
|
||||||
|
void
|
||||||
|
CMloModelInfo::ConstructClump()
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
m_clump = RpClumpCreate();
|
||||||
|
RwFrame *mainFrame = RwFrameCreate();
|
||||||
|
RwFrameSetIdentity(mainFrame);
|
||||||
|
RpClumpSetFrame(m_clump, mainFrame);
|
||||||
|
|
||||||
|
for (int i = firstInstance; i < lastInstance; i++) {
|
||||||
|
int modelId = CModelInfo::GetMloInstanceStore().store[i].m_modelIndex;
|
||||||
|
RwMatrix *attMat = CModelInfo::GetMloInstanceStore().store[i].GetMatrix().m_attachment;
|
||||||
|
CSimpleModelInfo *minfo = (CSimpleModelInfo*)CModelInfo::GetModelInfo(modelId);
|
||||||
|
|
||||||
|
if (minfo->m_atomics[0] != nil) {
|
||||||
|
RpAtomic *newAtomic = RpAtomicClone(minfo->m_atomics[0]);
|
||||||
|
RwFrame *newFrame = RwFrameCreate();
|
||||||
|
if (newAtomic != nil && newFrame != nil) {
|
||||||
|
*RwFrameGetMatrix(newFrame) = *attMat;
|
||||||
|
RpAtomicSetFrame(newAtomic, newFrame);
|
||||||
|
RwFrameAddChild(mainFrame, newFrame);
|
||||||
|
RpClumpAddAtomic(m_clump, newAtomic);
|
||||||
|
} else {
|
||||||
|
debug("Failed to allocate memory while creating template MLO.\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (RpClumpGetNumAtomics(m_clump) != 0) {
|
||||||
|
CVisibilityPlugins::SetClumpModelInfo(m_clump, this);
|
||||||
|
} else {
|
||||||
|
RpClumpDestroy(m_clump);
|
||||||
|
m_clump = nil;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
CMloModelInfo::RcWriteThis(base::cRelocatableChunkWriter &writer)
|
||||||
|
{
|
||||||
|
writer.AllocateRaw(this, sizeof(*this), sizeof(void*), false, true);
|
||||||
|
writer.Class(VTABLE_ADDR(this), msClassInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
CMloModelInfo::RcWriteEmpty(base::cRelocatableChunkWriter &writer)
|
||||||
|
{
|
||||||
|
writer.AllocateRaw(this, sizeof(*this), sizeof(void*), false, true);
|
||||||
|
writer.Class(VTABLE_ADDR(this), msClassInfo);
|
||||||
|
}
|
20
src/modelinfo/MloModelInfo.h
Normal file
20
src/modelinfo/MloModelInfo.h
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "ClumpModelInfo.h"
|
||||||
|
|
||||||
|
class CMloModelInfo : public CClumpModelInfo
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
float drawDist;
|
||||||
|
int firstInstance;
|
||||||
|
int lastInstance;
|
||||||
|
public:
|
||||||
|
CMloModelInfo(void) : CClumpModelInfo(MITYPE_MLO) {}
|
||||||
|
void ConstructClump();
|
||||||
|
|
||||||
|
virtual void RcWriteThis(base::cRelocatableChunkWriter &writer);
|
||||||
|
virtual void RcWriteEmpty(base::cRelocatableChunkWriter &writer);
|
||||||
|
|
||||||
|
static base::cRelocatableChunkClassInfo msClassInfo;
|
||||||
|
static CMloModelInfo msClassInstance;
|
||||||
|
};
|
|
@ -2,11 +2,13 @@
|
||||||
|
|
||||||
#include "2dEffect.h"
|
#include "2dEffect.h"
|
||||||
#include "SimpleModelInfo.h"
|
#include "SimpleModelInfo.h"
|
||||||
|
#include "MloModelInfo.h"
|
||||||
#include "TimeModelInfo.h"
|
#include "TimeModelInfo.h"
|
||||||
#include "WeaponModelInfo.h"
|
#include "WeaponModelInfo.h"
|
||||||
#include "ClumpModelInfo.h"
|
#include "ClumpModelInfo.h"
|
||||||
#include "PedModelInfo.h"
|
#include "PedModelInfo.h"
|
||||||
#include "VehicleModelInfo.h"
|
#include "VehicleModelInfo.h"
|
||||||
|
#include "XtraCompsModelInfo.h"
|
||||||
#include "templates.h"
|
#include "templates.h"
|
||||||
|
|
||||||
class CModelInfo
|
class CModelInfo
|
||||||
|
|
|
@ -206,8 +206,8 @@ CSimpleModelInfo::GetAtomicFromDistance(float dist)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
i = 0;
|
i = 0;
|
||||||
// HACk until we figure out what's going on
|
if(m_atomics == nil)
|
||||||
if(m_atomics == nil) return nil;
|
return nil;
|
||||||
if(m_isDamaged)
|
if(m_isDamaged)
|
||||||
i = m_firstDamaged;
|
i = m_firstDamaged;
|
||||||
for(; i < m_numAtomics; i++)
|
for(; i < m_numAtomics; i++)
|
||||||
|
@ -219,8 +219,8 @@ if(m_atomics == nil) return nil;
|
||||||
RpAtomic*
|
RpAtomic*
|
||||||
CSimpleModelInfo::GetFirstAtomicFromDistance(float dist)
|
CSimpleModelInfo::GetFirstAtomicFromDistance(float dist)
|
||||||
{
|
{
|
||||||
// HACk until we figure out what's going on
|
if(m_atomics == nil)
|
||||||
if(m_atomics == nil) return nil;
|
return nil;
|
||||||
if(dist < m_lodDistances[0] * TheCamera.LODDistMultiplier)
|
if(dist < m_lodDistances[0] * TheCamera.LODDistMultiplier)
|
||||||
return m_atomics[0];
|
return m_atomics[0];
|
||||||
return nil;
|
return nil;
|
||||||
|
|
21
src/modelinfo/XtraCompsModelInfo.cpp
Normal file
21
src/modelinfo/XtraCompsModelInfo.cpp
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
#include "common.h"
|
||||||
|
|
||||||
|
#include "VisibilityPlugins.h"
|
||||||
|
#include "ModelInfo.h"
|
||||||
|
|
||||||
|
base::cRelocatableChunkClassInfo CXtraCompsModelInfo::msClassInfo("CXtraCompsModelInfo", VTABLE_ADDR(&msClassInstance), sizeof(msClassInstance));
|
||||||
|
CXtraCompsModelInfo CXtraCompsModelInfo::msClassInstance;
|
||||||
|
|
||||||
|
void
|
||||||
|
CXtraCompsModelInfo::RcWriteThis(base::cRelocatableChunkWriter &writer)
|
||||||
|
{
|
||||||
|
writer.AllocateRaw(this, sizeof(*this), sizeof(void*), false, true);
|
||||||
|
writer.Class(VTABLE_ADDR(this), msClassInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
CXtraCompsModelInfo::RcWriteEmpty(base::cRelocatableChunkWriter &writer)
|
||||||
|
{
|
||||||
|
writer.AllocateRaw(this, sizeof(*this), sizeof(void*), false, true);
|
||||||
|
writer.Class(VTABLE_ADDR(this), msClassInfo);
|
||||||
|
}
|
19
src/modelinfo/XtraCompsModelInfo.h
Normal file
19
src/modelinfo/XtraCompsModelInfo.h
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "ClumpModelInfo.h"
|
||||||
|
|
||||||
|
class CXtraCompsModelInfo : public CClumpModelInfo
|
||||||
|
{
|
||||||
|
int field_34;
|
||||||
|
public:
|
||||||
|
CXtraCompsModelInfo(void) : CClumpModelInfo(MITYPE_XTRACOMPS) { field_34 = 0; }
|
||||||
|
void Shutdown(void) {};
|
||||||
|
RwObject *CreateInstance(void) { return nil; }
|
||||||
|
void SetClump(RpClump*) {};
|
||||||
|
|
||||||
|
virtual void RcWriteThis(base::cRelocatableChunkWriter &writer);
|
||||||
|
virtual void RcWriteEmpty(base::cRelocatableChunkWriter &writer);
|
||||||
|
|
||||||
|
static base::cRelocatableChunkClassInfo msClassInfo;
|
||||||
|
static CXtraCompsModelInfo msClassInstance;
|
||||||
|
};
|
|
@ -124,7 +124,7 @@ void
|
||||||
CPlayerSkin::BeginFrontendSkinEdit(void)
|
CPlayerSkin::BeginFrontendSkinEdit(void)
|
||||||
{
|
{
|
||||||
LoadPlayerDff();
|
LoadPlayerDff();
|
||||||
RpClumpForAllAtomics(gpPlayerClump, CClumpModelInfo::SetAtomicRendererCB, (void*)CVisibilityPlugins::RenderPlayerCB);
|
// RpClumpForAllAtomics(gpPlayerClump, CClumpModelInfo::SetAtomicRendererCB, (void*)CVisibilityPlugins::RenderPlayerCB);
|
||||||
CWorld::Players[0].LoadPlayerSkin();
|
CWorld::Players[0].LoadPlayerSkin();
|
||||||
gOldFov = CDraw::GetFOV();
|
gOldFov = CDraw::GetFOV();
|
||||||
CDraw::SetFOV(30.0f);
|
CDraw::SetFOV(30.0f);
|
||||||
|
|
|
@ -28,10 +28,17 @@
|
||||||
#include "custompipes.h"
|
#include "custompipes.h"
|
||||||
#include "Frontend.h"
|
#include "Frontend.h"
|
||||||
#include "Ferry.h"
|
#include "Ferry.h"
|
||||||
|
#include "Plane.h"
|
||||||
|
#include "WaterLevel.h"
|
||||||
|
|
||||||
|
// maybe some day...
|
||||||
|
//#define GTA_WORLDSTREAM
|
||||||
|
|
||||||
bool gbShowPedRoadGroups;
|
bool gbShowPedRoadGroups;
|
||||||
bool gbShowCarRoadGroups;
|
bool gbShowCarRoadGroups;
|
||||||
bool gbShowCollisionPolys;
|
bool gbShowCollisionPolys;
|
||||||
|
bool gbShowCollisionPolysReflections;
|
||||||
|
bool gbShowCollisionPolysNoShadows;
|
||||||
bool gbShowCollisionLines;
|
bool gbShowCollisionLines;
|
||||||
bool gbBigWhiteDebugLightSwitchedOn;
|
bool gbBigWhiteDebugLightSwitchedOn;
|
||||||
|
|
||||||
|
@ -43,6 +50,9 @@ bool gbDontRenderVehicles;
|
||||||
|
|
||||||
bool gbRenderDebugEnvMap;
|
bool gbRenderDebugEnvMap;
|
||||||
|
|
||||||
|
// unused
|
||||||
|
bool gbLighting;
|
||||||
|
|
||||||
// unused
|
// unused
|
||||||
int16 TestCloseThings;
|
int16 TestCloseThings;
|
||||||
int16 TestBigThings;
|
int16 TestBigThings;
|
||||||
|
@ -59,9 +69,9 @@ int32 CRenderer::ms_nNoOfVisibleEntities;
|
||||||
CEntity *CRenderer::ms_aVisibleEntityPtrs[NUMVISIBLEENTITIES];
|
CEntity *CRenderer::ms_aVisibleEntityPtrs[NUMVISIBLEENTITIES];
|
||||||
CEntity *CRenderer::ms_aInVisibleEntityPtrs[NUMINVISIBLEENTITIES];
|
CEntity *CRenderer::ms_aInVisibleEntityPtrs[NUMINVISIBLEENTITIES];
|
||||||
int32 CRenderer::ms_nNoOfInVisibleEntities;
|
int32 CRenderer::ms_nNoOfInVisibleEntities;
|
||||||
#ifdef NEW_RENDERER
|
|
||||||
int32 CRenderer::ms_nNoOfVisibleVehicles;
|
int32 CRenderer::ms_nNoOfVisibleVehicles;
|
||||||
CEntity *CRenderer::ms_aVisibleVehiclePtrs[NUMVISIBLEENTITIES];
|
CEntity *CRenderer::ms_aVisibleVehiclePtrs[NUMVISIBLEENTITIES];
|
||||||
|
#ifdef NEW_RENDERER
|
||||||
int32 CRenderer::ms_nNoOfVisibleBuildings;
|
int32 CRenderer::ms_nNoOfVisibleBuildings;
|
||||||
CEntity *CRenderer::ms_aVisibleBuildingPtrs[NUMVISIBLEENTITIES];
|
CEntity *CRenderer::ms_aVisibleBuildingPtrs[NUMVISIBLEENTITIES];
|
||||||
#endif
|
#endif
|
||||||
|
@ -71,16 +81,12 @@ CVehicle *CRenderer::m_pFirstPersonVehicle;
|
||||||
bool CRenderer::m_loadingPriority;
|
bool CRenderer::m_loadingPriority;
|
||||||
float CRenderer::ms_lodDistScale = 1.2f;
|
float CRenderer::ms_lodDistScale = 1.2f;
|
||||||
|
|
||||||
// unused
|
|
||||||
BlockedRange CRenderer::aBlockedRanges[16];
|
|
||||||
BlockedRange* CRenderer::pFullBlockedRanges;
|
|
||||||
BlockedRange* CRenderer::pEmptyBlockedRanges;
|
|
||||||
|
|
||||||
void
|
void
|
||||||
CRenderer::Init(void)
|
CRenderer::Init(void)
|
||||||
{
|
{
|
||||||
gSortedVehiclesAndPeds.Init(40);
|
gSortedVehiclesAndPeds.Init(40);
|
||||||
SortBIGBuildings();
|
if(gMakeResources)
|
||||||
|
SortBIGBuildings();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -98,10 +104,10 @@ CRenderer::PreRender(void)
|
||||||
for(i = 0; i < ms_nNoOfVisibleEntities; i++)
|
for(i = 0; i < ms_nNoOfVisibleEntities; i++)
|
||||||
ms_aVisibleEntityPtrs[i]->PreRender();
|
ms_aVisibleEntityPtrs[i]->PreRender();
|
||||||
|
|
||||||
|
for(i = 0; i < ms_nNoOfVisibleVehicles; i++)
|
||||||
|
ms_aVisibleVehiclePtrs[i]->PreRender();
|
||||||
#ifdef NEW_RENDERER
|
#ifdef NEW_RENDERER
|
||||||
if(gbNewRenderer){
|
if(gbNewRenderer){
|
||||||
for(i = 0; i < ms_nNoOfVisibleVehicles; i++)
|
|
||||||
ms_aVisibleVehiclePtrs[i]->PreRender();
|
|
||||||
// How is this done with cWorldStream?
|
// How is this done with cWorldStream?
|
||||||
for(i = 0; i < ms_nNoOfVisibleBuildings; i++)
|
for(i = 0; i < ms_nNoOfVisibleBuildings; i++)
|
||||||
ms_aVisibleBuildingPtrs[i]->PreRender();
|
ms_aVisibleBuildingPtrs[i]->PreRender();
|
||||||
|
@ -131,11 +137,14 @@ CRenderer::PreRender(void)
|
||||||
void
|
void
|
||||||
CRenderer::RenderOneRoad(CEntity *e)
|
CRenderer::RenderOneRoad(CEntity *e)
|
||||||
{
|
{
|
||||||
|
#ifndef MASTER
|
||||||
if(gbDontRenderBuildings)
|
if(gbDontRenderBuildings)
|
||||||
return;
|
return;
|
||||||
if(gbShowCollisionPolys)
|
if(gbShowCollisionPolys || gbShowCollisionPolysReflections || gbShowCollisionPolysNoShadows)
|
||||||
CCollision::DrawColModel_Coloured(e->GetMatrix(), *CModelInfo::GetModelInfo(e->GetModelIndex())->GetColModel(), e->GetModelIndex());
|
CCollision::DrawColModel_Coloured(e->GetMatrix(), *CModelInfo::GetModelInfo(e->GetModelIndex())->GetColModel(), e->GetModelIndex());
|
||||||
else{
|
else
|
||||||
|
#endif
|
||||||
|
{
|
||||||
PUSH_RENDERGROUP(CModelInfo::GetModelInfo(e->GetModelIndex())->GetModelName());
|
PUSH_RENDERGROUP(CModelInfo::GetModelInfo(e->GetModelIndex())->GetModelName());
|
||||||
|
|
||||||
e->Render();
|
e->Render();
|
||||||
|
@ -153,12 +162,15 @@ CRenderer::RenderOneNonRoad(CEntity *e)
|
||||||
bool resetLights;
|
bool resetLights;
|
||||||
|
|
||||||
#ifndef MASTER
|
#ifndef MASTER
|
||||||
if(gbShowCollisionPolys){
|
if(gbShowCollisionPolys || gbShowCollisionPolysReflections || gbShowCollisionPolysNoShadows){
|
||||||
if(!e->IsVehicle()){
|
if(!e->IsVehicle()){
|
||||||
CCollision::DrawColModel_Coloured(e->GetMatrix(), *CModelInfo::GetModelInfo(e->GetModelIndex())->GetColModel(), e->GetModelIndex());
|
CCollision::DrawColModel_Coloured(e->GetMatrix(), *CModelInfo::GetModelInfo(e->GetModelIndex())->GetColModel(), e->GetModelIndex());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}else if(e->IsBuilding()){
|
}else
|
||||||
|
#endif
|
||||||
|
#ifndef FINAL
|
||||||
|
if(e->IsBuilding()){
|
||||||
if(e->bIsBIGBuilding){
|
if(e->bIsBIGBuilding){
|
||||||
if(gbDontRenderBigBuildings)
|
if(gbDontRenderBigBuildings)
|
||||||
return;
|
return;
|
||||||
|
@ -169,7 +181,7 @@ CRenderer::RenderOneNonRoad(CEntity *e)
|
||||||
}else
|
}else
|
||||||
#endif
|
#endif
|
||||||
if(e->IsPed()){
|
if(e->IsPed()){
|
||||||
#ifndef MASTER
|
#ifndef FINAL
|
||||||
if(gbDontRenderPeds)
|
if(gbDontRenderPeds)
|
||||||
return;
|
return;
|
||||||
#endif
|
#endif
|
||||||
|
@ -177,7 +189,7 @@ CRenderer::RenderOneNonRoad(CEntity *e)
|
||||||
if(ped->m_nPedState == PED_DRIVING)
|
if(ped->m_nPedState == PED_DRIVING)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#ifndef MASTER
|
#ifndef FINAL
|
||||||
else if(e->IsObject() || e->IsDummy()){
|
else if(e->IsObject() || e->IsDummy()){
|
||||||
if(gbDontRenderObjects)
|
if(gbDontRenderObjects)
|
||||||
return;
|
return;
|
||||||
|
@ -201,16 +213,36 @@ CRenderer::RenderOneNonRoad(CEntity *e)
|
||||||
// Render Peds in vehicle before vehicle itself
|
// Render Peds in vehicle before vehicle itself
|
||||||
if(e->IsVehicle()){
|
if(e->IsVehicle()){
|
||||||
veh = (CVehicle*)e;
|
veh = (CVehicle*)e;
|
||||||
if(veh->pDriver && veh->pDriver->m_nPedState == PED_DRIVING)
|
#ifdef VIS_DISTANCE_ALPHA
|
||||||
|
int vehalpha = CVisibilityPlugins::GetObjectDistanceAlpha(veh->m_rwObject);
|
||||||
|
#endif
|
||||||
|
if(veh->pDriver && veh->pDriver->m_nPedState == PED_DRIVING){
|
||||||
|
#ifdef VIS_DISTANCE_ALPHA
|
||||||
|
int alpha = CVisibilityPlugins::GetObjectDistanceAlpha(veh->pDriver->m_rwObject);
|
||||||
|
CVisibilityPlugins::SetObjectDistanceAlpha(veh->pDriver->m_rwObject, vehalpha);
|
||||||
veh->pDriver->Render();
|
veh->pDriver->Render();
|
||||||
|
CVisibilityPlugins::SetObjectDistanceAlpha(veh->pDriver->m_rwObject, alpha);
|
||||||
|
#else
|
||||||
|
veh->pDriver->Render();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
for(i = 0; i < 8; i++)
|
for(i = 0; i < 8; i++)
|
||||||
if(veh->pPassengers[i] && veh->pPassengers[i]->m_nPedState == PED_DRIVING)
|
if(veh->pPassengers[i] && veh->pPassengers[i]->m_nPedState == PED_DRIVING){
|
||||||
|
#ifdef VIS_DISTANCE_ALPHA
|
||||||
|
int alpha = CVisibilityPlugins::GetObjectDistanceAlpha(veh->pPassengers[i]->m_rwObject);
|
||||||
|
CVisibilityPlugins::SetObjectDistanceAlpha(veh->pPassengers[i]->m_rwObject, vehalpha);
|
||||||
veh->pPassengers[i]->Render();
|
veh->pPassengers[i]->Render();
|
||||||
|
CVisibilityPlugins::SetObjectDistanceAlpha(veh->pPassengers[i]->m_rwObject, alpha);
|
||||||
|
#else
|
||||||
|
veh->pPassengers[i]->Render();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
SetCullMode(rwCULLMODECULLNONE);
|
SetCullMode(rwCULLMODECULLNONE);
|
||||||
}
|
}
|
||||||
e->Render();
|
e->Render();
|
||||||
|
|
||||||
if(e->IsVehicle()){
|
if(e->IsVehicle()){
|
||||||
|
// TODO(LCS): LCS does not use bImBeingRendered, keeping it for safety
|
||||||
e->bImBeingRendered = true;
|
e->bImBeingRendered = true;
|
||||||
CVisibilityPlugins::RenderAlphaAtomics();
|
CVisibilityPlugins::RenderAlphaAtomics();
|
||||||
e->bImBeingRendered = false;
|
e->bImBeingRendered = false;
|
||||||
|
@ -247,7 +279,7 @@ CRenderer::RenderRoads(void)
|
||||||
|
|
||||||
PUSH_RENDERGROUP("CRenderer::RenderRoads");
|
PUSH_RENDERGROUP("CRenderer::RenderRoads");
|
||||||
RwRenderStateSet(rwRENDERSTATEFOGENABLE, (void*)TRUE);
|
RwRenderStateSet(rwRENDERSTATEFOGENABLE, (void*)TRUE);
|
||||||
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE);
|
// RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE);
|
||||||
SetCullMode(rwCULLMODECULLBACK);
|
SetCullMode(rwCULLMODECULLBACK);
|
||||||
DeActivateDirectional();
|
DeActivateDirectional();
|
||||||
SetAmbientColours();
|
SetAmbientColours();
|
||||||
|
@ -273,18 +305,18 @@ inline bool PutIntoSortedVehicleList(CVehicle *veh)
|
||||||
return veh->bTouchingWater;
|
return veh->bTouchingWater;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// this only renders objects in LCS
|
||||||
void
|
void
|
||||||
CRenderer::RenderEverythingBarRoads(void)
|
CRenderer::RenderEverythingBarRoads(void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
CEntity *e;
|
CEntity *e;
|
||||||
EntityInfo ei;
|
|
||||||
|
|
||||||
PUSH_RENDERGROUP("CRenderer::RenderEverythingBarRoads");
|
PUSH_RENDERGROUP("CRenderer::RenderEverythingBarRoads");
|
||||||
RwRenderStateSet(rwRENDERSTATEFOGENABLE, (void*)TRUE);
|
// RwRenderStateSet(rwRENDERSTATEFOGENABLE, (void*)TRUE);
|
||||||
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE);
|
// RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE);
|
||||||
SetCullMode(rwCULLMODECULLBACK);
|
SetCullMode(rwCULLMODECULLBACK);
|
||||||
gSortedVehiclesAndPeds.Clear();
|
// gSortedVehiclesAndPeds.Clear();
|
||||||
|
|
||||||
for(i = 0; i < ms_nNoOfVisibleEntities; i++){
|
for(i = 0; i < ms_nNoOfVisibleEntities; i++){
|
||||||
e = ms_aVisibleEntityPtrs[i];
|
e = ms_aVisibleEntityPtrs[i];
|
||||||
|
@ -297,17 +329,19 @@ CRenderer::RenderEverythingBarRoads(void)
|
||||||
continue;
|
continue;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(e->IsVehicle() ||
|
// we're not even rendering peds here....
|
||||||
e->IsPed() && CVisibilityPlugins::GetClumpAlpha((RpClump*)e->m_rwObject) != 255){
|
#ifdef VIS_DISTANCE_ALPHA
|
||||||
if(e->IsVehicle() && PutIntoSortedVehicleList((CVehicle*)e)){
|
// this looks like a fix for objects just popping in
|
||||||
ei.ent = e;
|
int distAlpha = CVisibilityPlugins::GetObjectDistanceAlpha(e->m_rwObject);
|
||||||
ei.sort = (ms_vecCameraPosition - e->GetPosition()).MagnitudeSqr();
|
if(e->IsPed() && CVisibilityPlugins::GetClumpAlpha((RpClump*)e->m_rwObject) != 255 ||
|
||||||
gSortedVehiclesAndPeds.InsertSorted(ei);
|
distAlpha != 255){
|
||||||
}else{
|
if(distAlpha != 0 && !CVisibilityPlugins::InsertEntityIntoSortedList(e, (ms_vecCameraPosition - e->GetPosition()).Magnitude())){
|
||||||
if(!CVisibilityPlugins::InsertEntityIntoSortedList(e, (ms_vecCameraPosition - e->GetPosition()).Magnitude())){
|
#else
|
||||||
printf("Ran out of space in alpha entity list");
|
if(e->IsPed() && CVisibilityPlugins::GetClumpAlpha((RpClump*)e->m_rwObject) != 255){
|
||||||
RenderOneNonRoad(e);
|
if(!CVisibilityPlugins::InsertEntityIntoSortedList(e, (ms_vecCameraPosition - e->GetPosition()).Magnitude())){
|
||||||
}
|
#endif
|
||||||
|
printf("Ran out of space in alpha entity list");
|
||||||
|
RenderOneNonRoad(e);
|
||||||
}
|
}
|
||||||
}else
|
}else
|
||||||
RenderOneNonRoad(e);
|
RenderOneNonRoad(e);
|
||||||
|
@ -318,30 +352,26 @@ CRenderer::RenderEverythingBarRoads(void)
|
||||||
void
|
void
|
||||||
CRenderer::RenderBoats(void)
|
CRenderer::RenderBoats(void)
|
||||||
{
|
{
|
||||||
CLink<EntityInfo> *node;
|
|
||||||
|
|
||||||
PUSH_RENDERGROUP("CRenderer::RenderBoats");
|
|
||||||
RwRenderStateSet(rwRENDERSTATEFOGENABLE, (void*)TRUE);
|
|
||||||
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE);
|
|
||||||
SetCullMode(rwCULLMODECULLBACK);
|
|
||||||
|
|
||||||
#ifdef NEW_RENDERER
|
|
||||||
int i;
|
int i;
|
||||||
CEntity *e;
|
CEntity *e;
|
||||||
EntityInfo ei;
|
EntityInfo ei;
|
||||||
if(gbNewRenderer){
|
CLink<EntityInfo> *node;
|
||||||
gSortedVehiclesAndPeds.Clear();
|
|
||||||
// not the real thing
|
PUSH_RENDERGROUP("CRenderer::RenderBoats");
|
||||||
for(i = 0; i < ms_nNoOfVisibleVehicles; i++){
|
gbLighting = true;
|
||||||
e = ms_aVisibleVehiclePtrs[i];
|
RwRenderStateSet(rwRENDERSTATEFOGENABLE, (void*)TRUE);
|
||||||
if(e->IsVehicle() && PutIntoSortedVehicleList((CVehicle*)e)){
|
// RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE);
|
||||||
ei.ent = e;
|
SetCullMode(rwCULLMODECULLBACK);
|
||||||
ei.sort = (ms_vecCameraPosition - e->GetPosition()).MagnitudeSqr();
|
|
||||||
gSortedVehiclesAndPeds.InsertSorted(ei);
|
gSortedVehiclesAndPeds.Clear();
|
||||||
}
|
for(i = 0; i < ms_nNoOfVisibleVehicles; i++){
|
||||||
|
e = ms_aVisibleVehiclePtrs[i];
|
||||||
|
if(e->IsVehicle() && PutIntoSortedVehicleList((CVehicle*)e)){
|
||||||
|
ei.ent = e;
|
||||||
|
ei.sort = (ms_vecCameraPosition - e->GetPosition()).MagnitudeSqr();
|
||||||
|
gSortedVehiclesAndPeds.InsertSorted(ei);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
for(node = gSortedVehiclesAndPeds.tail.prev;
|
for(node = gSortedVehiclesAndPeds.tail.prev;
|
||||||
node != &gSortedVehiclesAndPeds.head;
|
node != &gSortedVehiclesAndPeds.head;
|
||||||
|
@ -349,6 +379,69 @@ CRenderer::RenderBoats(void)
|
||||||
CVehicle *v = (CVehicle*)node->item.ent;
|
CVehicle *v = (CVehicle*)node->item.ent;
|
||||||
RenderOneNonRoad(v);
|
RenderOneNonRoad(v);
|
||||||
}
|
}
|
||||||
|
RwRenderStateSet(rwRENDERSTATEFOGENABLE, (void*)FALSE);
|
||||||
|
gbLighting = false;
|
||||||
|
POP_RENDERGROUP();
|
||||||
|
}
|
||||||
|
|
||||||
|
// also renders peds
|
||||||
|
void
|
||||||
|
CRenderer::RenderVehicles(void)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
CEntity *e;
|
||||||
|
|
||||||
|
PUSH_RENDERGROUP("CRenderer::RenderVehicles");
|
||||||
|
// LCS: not on android
|
||||||
|
RwRenderStateSet(rwRENDERSTATESRCBLEND, (void*)rwBLENDSRCALPHA);
|
||||||
|
RwRenderStateSet(rwRENDERSTATEDESTBLEND, (void*)rwBLENDINVSRCALPHA);
|
||||||
|
// TODO(LCS): PS2VehicleAlphaFunc();
|
||||||
|
|
||||||
|
gbLighting = true;
|
||||||
|
RwRenderStateSet(rwRENDERSTATEFOGENABLE, (void*)TRUE);
|
||||||
|
|
||||||
|
CVisibilityPlugins::InitAlphaEntityList();
|
||||||
|
for(i = 0; i < ms_nNoOfVisibleVehicles; i++){
|
||||||
|
e = ms_aVisibleVehiclePtrs[i];
|
||||||
|
#ifdef VIS_DISTANCE_ALPHA
|
||||||
|
if(CVisibilityPlugins::GetClumpAlpha((RpClump*)e->m_rwObject) == 0 ||
|
||||||
|
CVisibilityPlugins::GetObjectDistanceAlpha(e->m_rwObject) == 0)
|
||||||
|
continue;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
int behindDriver = e->bIsPed && ((CPed*)e)->m_nPedState == PED_DRIVING &&
|
||||||
|
TheCamera.GetLookDirection() == LOOKING_FORWARD;
|
||||||
|
// what is going on here? !behindDriver will always be true because we're checking for !PED_DRIVING
|
||||||
|
if(!e->bDistanceFade && (e->IsPed() || e->bIsPed) && ((CPed*)e)->m_nPedState != PED_DRIVING && !behindDriver){
|
||||||
|
#ifdef VIS_DISTANCE_ALPHA
|
||||||
|
if(CVisibilityPlugins::GetClumpAlpha((RpClump*)e->m_rwObject) != 255 ||
|
||||||
|
CVisibilityPlugins::GetObjectDistanceAlpha(e->m_rwObject) != 255)
|
||||||
|
; // set blend render states
|
||||||
|
else
|
||||||
|
; // set default render states
|
||||||
|
#endif
|
||||||
|
RenderOneNonRoad(e);
|
||||||
|
}else if(!PutIntoSortedVehicleList((CVehicle*)e) && // boats handled elsewhere
|
||||||
|
!CVisibilityPlugins::InsertEntityIntoSortedList(e, (ms_vecCameraPosition - e->GetPosition()).Magnitude())){
|
||||||
|
#ifdef VIS_DISTANCE_ALPHA
|
||||||
|
if(CVisibilityPlugins::GetClumpAlpha((RpClump*)e->m_rwObject) != 255 ||
|
||||||
|
CVisibilityPlugins::GetObjectDistanceAlpha(e->m_rwObject) != 255)
|
||||||
|
; // set blend render states
|
||||||
|
else
|
||||||
|
; // set default render states
|
||||||
|
#endif
|
||||||
|
printf("Ran out of space in alpha entity list");
|
||||||
|
RenderOneNonRoad(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
CVisibilityPlugins::RenderFadingEntities();
|
||||||
|
|
||||||
|
CFerry::RenderAllRemaning();
|
||||||
|
CPlane::RenderAllRemaning();
|
||||||
|
// TODO(LCS): gpGlobalEnvironmentMap = nil;
|
||||||
|
// TODO(LCS): CMattRenderer::Get().ResetRenderStates();
|
||||||
|
RwRenderStateSet(rwRENDERSTATEFOGENABLE, (void*)FALSE);
|
||||||
|
gbLighting = false;
|
||||||
POP_RENDERGROUP();
|
POP_RENDERGROUP();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -356,7 +449,6 @@ CRenderer::RenderBoats(void)
|
||||||
#ifndef LIBRW
|
#ifndef LIBRW
|
||||||
#error "Need librw for EXTENDED_PIPELINES"
|
#error "Need librw for EXTENDED_PIPELINES"
|
||||||
#endif
|
#endif
|
||||||
#include "WaterLevel.h"
|
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
// blend passes
|
// blend passes
|
||||||
|
@ -437,12 +529,16 @@ CRenderer::RenderOneBuilding(CEntity *ent, float camdist)
|
||||||
ent->bImBeingRendered = false; // TODO: this seems wrong, but do we even need it?
|
ent->bImBeingRendered = false; // TODO: this seems wrong, but do we even need it?
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// our replacement for cWorldStream::Render
|
||||||
void
|
void
|
||||||
CRenderer::RenderWorld(int pass)
|
CRenderer::RenderWorld(int pass)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
CEntity *e;
|
CEntity *e;
|
||||||
CLink<CVisibilityPlugins::AlphaObjectInfo> *node;
|
CLink<CVisibilityPlugins::AlphaObjectInfo> *node;
|
||||||
|
// use old renderer
|
||||||
|
if(gbPreviewCity)
|
||||||
|
return;
|
||||||
|
|
||||||
RwRenderStateSet(rwRENDERSTATEFOGENABLE, (void*)TRUE);
|
RwRenderStateSet(rwRENDERSTATEFOGENABLE, (void*)TRUE);
|
||||||
SetCullMode(rwCULLMODECULLBACK);
|
SetCullMode(rwCULLMODECULLBACK);
|
||||||
|
@ -506,59 +602,21 @@ CRenderer::RenderWorld(int pass)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// actually CMattRenderer::RenderWater
|
||||||
|
// adapted slightly
|
||||||
void
|
void
|
||||||
CRenderer::RenderPeds(void)
|
CRenderer::RenderWater(void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
CEntity *e;
|
CEntity *e;
|
||||||
|
|
||||||
PUSH_RENDERGROUP("CRenderer::RenderPeds");
|
PUSH_RENDERGROUP("CRenderer::RenderWater");
|
||||||
for(i = 0; i < ms_nNoOfVisibleVehicles; i++){
|
|
||||||
e = ms_aVisibleVehiclePtrs[i];
|
|
||||||
if(e->IsPed())
|
|
||||||
RenderOneNonRoad(e);
|
|
||||||
}
|
|
||||||
POP_RENDERGROUP();
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
gbLighting = false;
|
||||||
CRenderer::RenderVehicles(void)
|
CWaterLevel::RenderWater();
|
||||||
{
|
|
||||||
int i;
|
|
||||||
CEntity *e;
|
|
||||||
EntityInfo ei;
|
|
||||||
CLink<EntityInfo> *node;
|
|
||||||
|
|
||||||
PUSH_RENDERGROUP("CRenderer::RenderVehicles");
|
|
||||||
// not the real thing
|
|
||||||
for(i = 0; i < ms_nNoOfVisibleVehicles; i++){
|
|
||||||
e = ms_aVisibleVehiclePtrs[i];
|
|
||||||
if(!e->IsVehicle())
|
|
||||||
continue;
|
|
||||||
if(PutIntoSortedVehicleList((CVehicle*)e))
|
|
||||||
continue; // boats handled elsewhere
|
|
||||||
ei.ent = e;
|
|
||||||
ei.sort = (ms_vecCameraPosition - e->GetPosition()).MagnitudeSqr();
|
|
||||||
gSortedVehiclesAndPeds.InsertSorted(ei);
|
|
||||||
}
|
|
||||||
|
|
||||||
for(node = gSortedVehiclesAndPeds.tail.prev;
|
|
||||||
node != &gSortedVehiclesAndPeds.head;
|
|
||||||
node = node->prev)
|
|
||||||
RenderOneNonRoad(node->item.ent);
|
|
||||||
|
|
||||||
CFerry::RenderAllRemaning();
|
|
||||||
POP_RENDERGROUP();
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
CRenderer::RenderTransparentWater(void)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
CEntity *e;
|
|
||||||
|
|
||||||
PUSH_RENDERGROUP("CRenderer::RenderTransparentWater");
|
|
||||||
RwRenderStateSet(rwRENDERSTATETEXTURERASTER, nil);
|
RwRenderStateSet(rwRENDERSTATETEXTURERASTER, nil);
|
||||||
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE);
|
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE);
|
||||||
RwRenderStateSet(rwRENDERSTATEFOGENABLE, (void*)FALSE);
|
RwRenderStateSet(rwRENDERSTATEFOGENABLE, (void*)FALSE);
|
||||||
|
@ -582,6 +640,7 @@ CRenderer::RenderTransparentWater(void)
|
||||||
CWaterLevel::RenderTransparentWater();
|
CWaterLevel::RenderTransparentWater();
|
||||||
|
|
||||||
SetStencilState(0);
|
SetStencilState(0);
|
||||||
|
gbLighting = true;
|
||||||
POP_RENDERGROUP();
|
POP_RENDERGROUP();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -590,22 +649,23 @@ CRenderer::ClearForFrame(void)
|
||||||
{
|
{
|
||||||
ms_nNoOfVisibleEntities = 0;
|
ms_nNoOfVisibleEntities = 0;
|
||||||
ms_nNoOfVisibleVehicles = 0;
|
ms_nNoOfVisibleVehicles = 0;
|
||||||
ms_nNoOfVisibleBuildings = 0;
|
|
||||||
ms_nNoOfInVisibleEntities = 0;
|
ms_nNoOfInVisibleEntities = 0;
|
||||||
gSortedVehiclesAndPeds.Clear();
|
gSortedVehiclesAndPeds.Clear();
|
||||||
|
|
||||||
|
#ifdef NEW_RENDERER
|
||||||
|
ms_nNoOfVisibleBuildings = 0;
|
||||||
WorldRender::numBlendInsts[PASS_NOZ] = 0;
|
WorldRender::numBlendInsts[PASS_NOZ] = 0;
|
||||||
WorldRender::numBlendInsts[PASS_ADD] = 0;
|
WorldRender::numBlendInsts[PASS_ADD] = 0;
|
||||||
WorldRender::numBlendInsts[PASS_BLEND] = 0;
|
WorldRender::numBlendInsts[PASS_BLEND] = 0;
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
CRenderer::RenderFadingInEntities(void)
|
CRenderer::RenderFadingInEntities(void)
|
||||||
{
|
{
|
||||||
PUSH_RENDERGROUP("CRenderer::RenderFadingInEntities");
|
PUSH_RENDERGROUP("CRenderer::RenderFadingInEntities");
|
||||||
RwRenderStateSet(rwRENDERSTATEFOGENABLE, (void*)TRUE);
|
RwRenderStateSet(rwRENDERSTATEFOGENABLE, (void*)TRUE);
|
||||||
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE);
|
// RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE);
|
||||||
SetCullMode(rwCULLMODECULLBACK);
|
SetCullMode(rwCULLMODECULLBACK);
|
||||||
DeActivateDirectional();
|
DeActivateDirectional();
|
||||||
SetAmbientColours();
|
SetAmbientColours();
|
||||||
|
@ -617,6 +677,9 @@ void
|
||||||
CRenderer::RenderFadingInUnderwaterEntities(void)
|
CRenderer::RenderFadingInUnderwaterEntities(void)
|
||||||
{
|
{
|
||||||
PUSH_RENDERGROUP("CRenderer::RenderFadingInUnderwaterEntities");
|
PUSH_RENDERGROUP("CRenderer::RenderFadingInUnderwaterEntities");
|
||||||
|
RwRenderStateSet(rwRENDERSTATEFOGENABLE, (void*)TRUE);
|
||||||
|
// RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE);
|
||||||
|
SetCullMode(rwCULLMODECULLBACK);
|
||||||
DeActivateDirectional();
|
DeActivateDirectional();
|
||||||
SetAmbientColours();
|
SetAmbientColours();
|
||||||
CVisibilityPlugins::RenderFadingUnderwaterEntities();
|
CVisibilityPlugins::RenderFadingUnderwaterEntities();
|
||||||
|
@ -663,6 +726,9 @@ CRenderer::SetupEntityVisibility(CEntity *ent)
|
||||||
float dist;
|
float dist;
|
||||||
|
|
||||||
bool request = true;
|
bool request = true;
|
||||||
|
if(mi->GetModelType() == MITYPE_SIMPLE){
|
||||||
|
// TODO(LCS): some cWorldStream dynamics stuff
|
||||||
|
}
|
||||||
if(mi->GetModelType() == MITYPE_TIME){
|
if(mi->GetModelType() == MITYPE_TIME){
|
||||||
ti = (CTimeModelInfo*)mi;
|
ti = (CTimeModelInfo*)mi;
|
||||||
other = ti->GetOtherTimeModel();
|
other = ti->GetOtherTimeModel();
|
||||||
|
@ -672,8 +738,10 @@ CRenderer::SetupEntityVisibility(CEntity *ent)
|
||||||
ti->m_alpha = 255;
|
ti->m_alpha = 255;
|
||||||
}else{
|
}else{
|
||||||
// Hide if possible
|
// Hide if possible
|
||||||
if(CANTIMECULL)
|
if(CANTIMECULL){
|
||||||
|
ent->DeleteRwObject();
|
||||||
return VIS_INVISIBLE;
|
return VIS_INVISIBLE;
|
||||||
|
}
|
||||||
// can't cull, so we'll try to draw this one, but don't request
|
// can't cull, so we'll try to draw this one, but don't request
|
||||||
// it since what we really want is the other one.
|
// it since what we really want is the other one.
|
||||||
request = false;
|
request = false;
|
||||||
|
@ -682,6 +750,7 @@ CRenderer::SetupEntityVisibility(CEntity *ent)
|
||||||
if(mi->GetModelType() != MITYPE_SIMPLE && mi->GetModelType() != MITYPE_WEAPON){
|
if(mi->GetModelType() != MITYPE_SIMPLE && mi->GetModelType() != MITYPE_WEAPON){
|
||||||
if(FindPlayerVehicle() == ent &&
|
if(FindPlayerVehicle() == ent &&
|
||||||
TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_1STPERSON &&
|
TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_1STPERSON &&
|
||||||
|
// TODO(LCS): something in CWorld::Players...
|
||||||
!(FindPlayerVehicle()->IsBike() && ((CBike*)FindPlayerVehicle())->bWheelieCam)){
|
!(FindPlayerVehicle()->IsBike() && ((CBike*)FindPlayerVehicle())->bWheelieCam)){
|
||||||
// Player's vehicle in first person mode
|
// Player's vehicle in first person mode
|
||||||
CVehicle *veh = (CVehicle*)ent;
|
CVehicle *veh = (CVehicle*)ent;
|
||||||
|
@ -689,6 +758,7 @@ CRenderer::SetupEntityVisibility(CEntity *ent)
|
||||||
int direction = TheCamera.Cams[TheCamera.ActiveCam].DirectionWasLooking;
|
int direction = TheCamera.Cams[TheCamera.ActiveCam].DirectionWasLooking;
|
||||||
if(direction == LOOKING_FORWARD ||
|
if(direction == LOOKING_FORWARD ||
|
||||||
ent->GetModelIndex() == MI_RHINO ||
|
ent->GetModelIndex() == MI_RHINO ||
|
||||||
|
ent->GetModelIndex() == MI_BUS ||
|
||||||
ent->GetModelIndex() == MI_COACH ||
|
ent->GetModelIndex() == MI_COACH ||
|
||||||
TheCamera.m_bInATunnelAndABigVehicle ||
|
TheCamera.m_bInATunnelAndABigVehicle ||
|
||||||
direction == LOOKING_BEHIND && veh->pHandling->Flags & HANDLING_UNKNOWN){
|
direction == LOOKING_BEHIND && veh->pHandling->Flags & HANDLING_UNKNOWN){
|
||||||
|
@ -697,7 +767,7 @@ CRenderer::SetupEntityVisibility(CEntity *ent)
|
||||||
}
|
}
|
||||||
|
|
||||||
if(direction != LOOKING_BEHIND ||
|
if(direction != LOOKING_BEHIND ||
|
||||||
!veh->IsBoat() || model == MI_REEFER || model == MI_TROPIC || model == MI_PREDATOR || model == MI_SKIMMER){
|
!veh->IsBoat() || model == MI_REEFER || model == MI_PREDATOR){
|
||||||
m_pFirstPersonVehicle = (CVehicle*)ent;
|
m_pFirstPersonVehicle = (CVehicle*)ent;
|
||||||
ent->bNoBrightHeadLights = false;
|
ent->bNoBrightHeadLights = false;
|
||||||
return VIS_OFFSCREEN;
|
return VIS_OFFSCREEN;
|
||||||
|
@ -739,7 +809,8 @@ CRenderer::SetupEntityVisibility(CEntity *ent)
|
||||||
|
|
||||||
dist = (ent->GetPosition() - ms_vecCameraPosition).Magnitude();
|
dist = (ent->GetPosition() - ms_vecCameraPosition).Magnitude();
|
||||||
|
|
||||||
#ifndef FIX_BUGS
|
//#ifndef FIX_BUGS
|
||||||
|
#if 0
|
||||||
// Whatever this is supposed to do, it breaks fading for objects
|
// Whatever this is supposed to do, it breaks fading for objects
|
||||||
// whose draw dist is > LOD_DISTANCE-FADE_DISTANCE, i.e. 280
|
// whose draw dist is > LOD_DISTANCE-FADE_DISTANCE, i.e. 280
|
||||||
// because decreasing dist here makes the object visible above LOD_DISTANCE
|
// because decreasing dist here makes the object visible above LOD_DISTANCE
|
||||||
|
@ -749,6 +820,9 @@ CRenderer::SetupEntityVisibility(CEntity *ent)
|
||||||
if(LOD_DISTANCE < dist && dist < mi->GetLargestLodDistance() + FADE_DISTANCE)
|
if(LOD_DISTANCE < dist && dist < mi->GetLargestLodDistance() + FADE_DISTANCE)
|
||||||
dist += mi->GetLargestLodDistance() - LOD_DISTANCE;
|
dist += mi->GetLargestLodDistance() - LOD_DISTANCE;
|
||||||
#endif
|
#endif
|
||||||
|
// LCS has this now, wonder if it's any better:
|
||||||
|
if(LOD_DISTANCE + STREAM_DISTANCE < dist && dist < mi->GetLargestLodDistance())
|
||||||
|
dist = mi->GetLargestLodDistance();
|
||||||
|
|
||||||
if(ent->IsObject() && ent->bRenderDamaged)
|
if(ent->IsObject() && ent->bRenderDamaged)
|
||||||
mi->m_isDamaged = true;
|
mi->m_isDamaged = true;
|
||||||
|
@ -800,7 +874,7 @@ CRenderer::SetupEntityVisibility(CEntity *ent)
|
||||||
|
|
||||||
// We might be fading
|
// We might be fading
|
||||||
|
|
||||||
a = mi->GetAtomicFromDistance(dist - FADE_DISTANCE);
|
a = mi->GetLastAtomic(dist - FADE_DISTANCE);
|
||||||
mi->m_isDamaged = false;
|
mi->m_isDamaged = false;
|
||||||
if(a == nil){
|
if(a == nil){
|
||||||
// request model
|
// request model
|
||||||
|
@ -866,7 +940,7 @@ CRenderer::SetupBigBuildingVisibility(CEntity *ent)
|
||||||
// Find out whether to draw below near distance.
|
// Find out whether to draw below near distance.
|
||||||
// This is only the case if there is a non-LOD which is either not
|
// This is only the case if there is a non-LOD which is either not
|
||||||
// loaded or not completely faded in yet.
|
// loaded or not completely faded in yet.
|
||||||
if(dist < mi->GetNearDistance() && dist < LOD_DISTANCE){
|
if(dist < mi->GetNearDistance() && dist < LOD_DISTANCE + STREAM_DISTANCE){
|
||||||
// No non-LOD or non-LOD is completely visible.
|
// No non-LOD or non-LOD is completely visible.
|
||||||
if(nonLOD == nil ||
|
if(nonLOD == nil ||
|
||||||
nonLOD->GetRwObject() && nonLOD->m_alpha == 255)
|
nonLOD->GetRwObject() && nonLOD->m_alpha == 255)
|
||||||
|
@ -922,7 +996,7 @@ CRenderer::SetupBigBuildingVisibility(CEntity *ent)
|
||||||
// get faded atomic
|
// get faded atomic
|
||||||
a = mi->GetFirstAtomicFromDistance(dist - FADE_DISTANCE);
|
a = mi->GetFirstAtomicFromDistance(dist - FADE_DISTANCE);
|
||||||
if(a == nil){
|
if(a == nil){
|
||||||
if(ent->bStreamBIGBuilding && dist-STREAM_DISTANCE < mi->GetLodDistance(0) && request){
|
if(ent->bStreamBIGBuilding && dist-STREAM_DISTANCE-FADE_DISTANCE < mi->GetLodDistance(0) && request){
|
||||||
return ent->GetIsOnScreen() ? VIS_STREAMME : VIS_INVISIBLE;
|
return ent->GetIsOnScreen() ? VIS_STREAMME : VIS_INVISIBLE;
|
||||||
}else{
|
}else{
|
||||||
ent->DeleteRwObject();
|
ent->DeleteRwObject();
|
||||||
|
@ -951,30 +1025,15 @@ void
|
||||||
CRenderer::ConstructRenderList(void)
|
CRenderer::ConstructRenderList(void)
|
||||||
{
|
{
|
||||||
COcclusion::ProcessBeforeRendering();
|
COcclusion::ProcessBeforeRendering();
|
||||||
#ifdef NEW_RENDERER
|
|
||||||
if(!gbNewRenderer)
|
|
||||||
#endif
|
|
||||||
{
|
|
||||||
ms_nNoOfVisibleEntities = 0;
|
|
||||||
ms_nNoOfInVisibleEntities = 0;
|
|
||||||
}
|
|
||||||
ms_vecCameraPosition = TheCamera.GetPosition();
|
ms_vecCameraPosition = TheCamera.GetPosition();
|
||||||
|
|
||||||
// unused
|
|
||||||
pFullBlockedRanges = nil;
|
|
||||||
pEmptyBlockedRanges = aBlockedRanges;
|
|
||||||
for(int i = 0; i < 16; i++){
|
|
||||||
aBlockedRanges[i].prev = &aBlockedRanges[i-1];
|
|
||||||
aBlockedRanges[i].next = &aBlockedRanges[i+1];
|
|
||||||
}
|
|
||||||
aBlockedRanges[0].prev = nil;
|
|
||||||
aBlockedRanges[15].next = nil;
|
|
||||||
|
|
||||||
// unused
|
// unused
|
||||||
TestCloseThings = 0;
|
TestCloseThings = 0;
|
||||||
TestBigThings = 0;
|
TestBigThings = 0;
|
||||||
|
|
||||||
ScanWorld();
|
ScanWorld();
|
||||||
|
|
||||||
|
// LCS: mobile has a bunch of code after this,
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -1123,7 +1182,9 @@ CRenderer::ScanWorld(void)
|
||||||
poly[2].y = CWorld::GetSectorY(vectors[CORNER_FAR_TOPRIGHT].y);
|
poly[2].y = CWorld::GetSectorY(vectors[CORNER_FAR_TOPRIGHT].y);
|
||||||
ScanSectorPoly(poly, 3, ScanSectorList);
|
ScanSectorPoly(poly, 3, ScanSectorList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef GTA_WORLDSTREAM
|
||||||
|
// TODO(LCS): may be better to have this code with gbPreviewCity
|
||||||
#ifdef NO_ISLAND_LOADING
|
#ifdef NO_ISLAND_LOADING
|
||||||
if (FrontEndMenuManager.m_PrefsIslandLoading == CMenuManager::ISLAND_LOADING_HIGH) {
|
if (FrontEndMenuManager.m_PrefsIslandLoading == CMenuManager::ISLAND_LOADING_HIGH) {
|
||||||
ScanBigBuildingList(CWorld::GetBigBuildingList(LEVEL_BEACH));
|
ScanBigBuildingList(CWorld::GetBigBuildingList(LEVEL_BEACH));
|
||||||
|
@ -1137,6 +1198,7 @@ CRenderer::ScanWorld(void)
|
||||||
ScanBigBuildingList(CWorld::GetBigBuildingList(CGame::currLevel));
|
ScanBigBuildingList(CWorld::GetBigBuildingList(CGame::currLevel));
|
||||||
}
|
}
|
||||||
ScanBigBuildingList(CWorld::GetBigBuildingList(LEVEL_GENERIC));
|
ScanBigBuildingList(CWorld::GetBigBuildingList(LEVEL_GENERIC));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1429,6 +1491,7 @@ CRenderer::ScanSectorPoly(RwV2d *poly, int32 numVertices, void (*scanfunc)(CPtrL
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// probably didn't exist as a separate function in LCS
|
||||||
void
|
void
|
||||||
CRenderer::InsertEntityIntoList(CEntity *ent)
|
CRenderer::InsertEntityIntoList(CEntity *ent)
|
||||||
{
|
{
|
||||||
|
@ -1436,15 +1499,32 @@ CRenderer::InsertEntityIntoList(CEntity *ent)
|
||||||
if (!ent->m_rwObject) return;
|
if (!ent->m_rwObject) return;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef NEW_RENDERER
|
if(ent->IsVehicle() || ent->bIsVehicle || ent->IsPed() || ent->bIsPed)
|
||||||
// TODO: there are more flags being checked here
|
|
||||||
if(gbNewRenderer && (ent->IsVehicle() || ent->IsPed()))
|
|
||||||
ms_aVisibleVehiclePtrs[ms_nNoOfVisibleVehicles++] = ent;
|
ms_aVisibleVehiclePtrs[ms_nNoOfVisibleVehicles++] = ent;
|
||||||
else if(gbNewRenderer && ent->IsBuilding())
|
#ifdef NEW_RENDERER
|
||||||
|
else if(!gbPreviewCity && ent->IsBuilding())
|
||||||
|
ms_aVisibleBuildingPtrs[ms_nNoOfVisibleBuildings++] = ent;
|
||||||
|
#endif
|
||||||
|
else
|
||||||
|
ms_aVisibleEntityPtrs[ms_nNoOfVisibleEntities++] = ent;
|
||||||
|
#if defined(VIS_DISTANCE_ALPHA) && defined(FIX_BUGS)
|
||||||
|
// this flag can only be trusted if entity is in alpha list
|
||||||
|
// unfortunately we're checking it in other cases too, which is bad.
|
||||||
|
// no idea why this isn't a problem on android
|
||||||
|
ent->bDistanceFade = false;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
CRenderer::AddVisibleEntity(CEntity *ent)
|
||||||
|
{
|
||||||
|
#ifdef NEW_RENDERER
|
||||||
|
if(!gbPreviewCity && ent->IsBuilding())
|
||||||
ms_aVisibleBuildingPtrs[ms_nNoOfVisibleBuildings++] = ent;
|
ms_aVisibleBuildingPtrs[ms_nNoOfVisibleBuildings++] = ent;
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
ms_aVisibleEntityPtrs[ms_nNoOfVisibleEntities++] = ent;
|
ms_aVisibleEntityPtrs[ms_nNoOfVisibleEntities++] = ent;
|
||||||
|
ent->bOffscreen = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -1454,18 +1534,21 @@ CRenderer::ScanBigBuildingList(CPtrList &list)
|
||||||
CEntity *ent;
|
CEntity *ent;
|
||||||
int vis;
|
int vis;
|
||||||
|
|
||||||
int f = CTimer::GetFrameCounter() & 3;
|
int f = CTimer::GetFrameCounter() & 6;
|
||||||
for(node = list.first; node; node = node->next){
|
for(node = list.first; node; node = node->next){
|
||||||
ent = (CEntity*)node->item;
|
ent = (CEntity*)node->item;
|
||||||
if(ent->bOffscreen || (ent->m_randomSeed&3) != f){
|
if(ent->bOffscreen || (ent->m_randomSeed&6) != f){
|
||||||
ent->bOffscreen = true;
|
ent->bOffscreen = true;
|
||||||
vis = SetupBigBuildingVisibility(ent);
|
vis = SetupBigBuildingVisibility(ent);
|
||||||
}else
|
}else
|
||||||
vis = VIS_VISIBLE;
|
vis = ent->bOffscreen ? VIS_INVISIBLE : VIS_VISIBLE;
|
||||||
|
if(ent->bMakeVisible){
|
||||||
|
ent->bMakeVisible = false;
|
||||||
|
ent->bIsVisible = true;
|
||||||
|
}
|
||||||
switch(vis){
|
switch(vis){
|
||||||
case VIS_VISIBLE:
|
case VIS_VISIBLE:
|
||||||
InsertEntityIntoList(ent);
|
AddVisibleEntity(ent);
|
||||||
ent->bOffscreen = false;
|
|
||||||
break;
|
break;
|
||||||
case VIS_STREAMME:
|
case VIS_STREAMME:
|
||||||
if(!CStreaming::ms_disableStreaming)
|
if(!CStreaming::ms_disableStreaming)
|
||||||
|
@ -1484,7 +1567,15 @@ CRenderer::ScanSectorList(CPtrList *lists)
|
||||||
int i;
|
int i;
|
||||||
float dx, dy;
|
float dx, dy;
|
||||||
|
|
||||||
for(i = 0; i < NUMSECTORENTITYLISTS; i++){
|
int numLists = NUMSECTORENTITYLISTS;
|
||||||
|
#ifdef GTA_WORLDSTREAM
|
||||||
|
if(gbPreviewCity){
|
||||||
|
numLists -= ENTITYLIST_UNKNOWN;
|
||||||
|
lists += ENTITYLIST_UNKNOWN;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
for(i = 0; i < numLists; i++){
|
||||||
list = &lists[i];
|
list = &lists[i];
|
||||||
for(node = list->first; node; node = node->next){
|
for(node = list->first; node; node = node->next){
|
||||||
ent = (CEntity*)node->item;
|
ent = (CEntity*)node->item;
|
||||||
|
@ -1493,7 +1584,12 @@ CRenderer::ScanSectorList(CPtrList *lists)
|
||||||
ent->m_scanCode = CWorld::GetCurrentScanCode();
|
ent->m_scanCode = CWorld::GetCurrentScanCode();
|
||||||
ent->bOffscreen = false;
|
ent->bOffscreen = false;
|
||||||
|
|
||||||
switch(SetupEntityVisibility(ent)){
|
int vis = SetupEntityVisibility(ent);
|
||||||
|
if(ent->bMakeVisible){
|
||||||
|
ent->bMakeVisible = false;
|
||||||
|
ent->bIsVisible = true;
|
||||||
|
}
|
||||||
|
switch(vis){
|
||||||
case VIS_VISIBLE:
|
case VIS_VISIBLE:
|
||||||
InsertEntityIntoList(ent);
|
InsertEntityIntoList(ent);
|
||||||
break;
|
break;
|
||||||
|
@ -1529,7 +1625,15 @@ CRenderer::ScanSectorList_Priority(CPtrList *lists)
|
||||||
int i;
|
int i;
|
||||||
float dx, dy;
|
float dx, dy;
|
||||||
|
|
||||||
for(i = 0; i < NUMSECTORENTITYLISTS; i++){
|
int numLists = NUMSECTORENTITYLISTS;
|
||||||
|
#ifdef GTA_WORLDSTREAM
|
||||||
|
if(gbPreviewCity){
|
||||||
|
numLists -= ENTITYLIST_UNKNOWN;
|
||||||
|
lists += ENTITYLIST_UNKNOWN;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
for(i = 0; i < numLists; i++){
|
||||||
list = &lists[i];
|
list = &lists[i];
|
||||||
for(node = list->first; node; node = node->next){
|
for(node = list->first; node; node = node->next){
|
||||||
ent = (CEntity*)node->item;
|
ent = (CEntity*)node->item;
|
||||||
|
@ -1538,7 +1642,12 @@ CRenderer::ScanSectorList_Priority(CPtrList *lists)
|
||||||
ent->m_scanCode = CWorld::GetCurrentScanCode();
|
ent->m_scanCode = CWorld::GetCurrentScanCode();
|
||||||
ent->bOffscreen = false;
|
ent->bOffscreen = false;
|
||||||
|
|
||||||
switch(SetupEntityVisibility(ent)){
|
int vis = SetupEntityVisibility(ent);
|
||||||
|
if(ent->bMakeVisible){
|
||||||
|
ent->bMakeVisible = false;
|
||||||
|
ent->bIsVisible = true;
|
||||||
|
}
|
||||||
|
switch(vis){
|
||||||
case VIS_VISIBLE:
|
case VIS_VISIBLE:
|
||||||
InsertEntityIntoList(ent);
|
InsertEntityIntoList(ent);
|
||||||
break;
|
break;
|
||||||
|
@ -1577,7 +1686,15 @@ CRenderer::ScanSectorList_Subway(CPtrList *lists)
|
||||||
int i;
|
int i;
|
||||||
float dx, dy;
|
float dx, dy;
|
||||||
|
|
||||||
for(i = 0; i < NUMSECTORENTITYLISTS; i++){
|
int numLists = NUMSECTORENTITYLISTS;
|
||||||
|
#ifdef GTA_WORLDSTREAM
|
||||||
|
if(gbPreviewCity){
|
||||||
|
numLists -= ENTITYLIST_UNKNOWN;
|
||||||
|
lists += ENTITYLIST_UNKNOWN;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
for(i = 0; i < numLists; i++){
|
||||||
list = &lists[i];
|
list = &lists[i];
|
||||||
for(node = list->first; node; node = node->next){
|
for(node = list->first; node; node = node->next){
|
||||||
ent = (CEntity*)node->item;
|
ent = (CEntity*)node->item;
|
||||||
|
@ -1612,7 +1729,15 @@ CRenderer::ScanSectorList_RequestModels(CPtrList *lists)
|
||||||
CEntity *ent;
|
CEntity *ent;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for(i = 0; i < NUMSECTORENTITYLISTS; i++){
|
int numLists = NUMSECTORENTITYLISTS;
|
||||||
|
#ifdef GTA_WORLDSTREAM
|
||||||
|
if(gbPreviewCity){
|
||||||
|
numLists -= ENTITYLIST_UNKNOWN;
|
||||||
|
lists += ENTITYLIST_UNKNOWN;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
for(i = 0; i < numLists; i++){
|
||||||
list = &lists[i];
|
list = &lists[i];
|
||||||
for(node = list->first; node; node = node->next){
|
for(node = list->first; node; node = node->next){
|
||||||
ent = (CEntity*)node->item;
|
ent = (CEntity*)node->item;
|
||||||
|
@ -1659,9 +1784,12 @@ CRenderer::ShouldModelBeStreamed(CEntity *ent, const CVector &campos)
|
||||||
if(!IsAreaVisible(ent->m_area))
|
if(!IsAreaVisible(ent->m_area))
|
||||||
return false;
|
return false;
|
||||||
CTimeModelInfo *mi = (CTimeModelInfo *)CModelInfo::GetModelInfo(ent->GetModelIndex());
|
CTimeModelInfo *mi = (CTimeModelInfo *)CModelInfo::GetModelInfo(ent->GetModelIndex());
|
||||||
if(mi->GetModelType() == MITYPE_TIME)
|
if(!ent->IsObject() && !ent->IsDummy()){
|
||||||
if(!CClock::GetIsTimeInRange(mi->GetTimeOn(), mi->GetTimeOff()))
|
if(mi->GetModelType() == MITYPE_TIME)
|
||||||
return false;
|
if(!CClock::GetIsTimeInRange(mi->GetTimeOn(), mi->GetTimeOff()))
|
||||||
|
return false;
|
||||||
|
// LCS(TODO): cWorldStream::pDynamic, but just returns 0 anyway
|
||||||
|
}
|
||||||
float dist = (ent->GetPosition() - campos).Magnitude();
|
float dist = (ent->GetPosition() - campos).Magnitude();
|
||||||
if(mi->m_noFade)
|
if(mi->m_noFade)
|
||||||
return dist - STREAM_DISTANCE < mi->GetLargestLodDistance();
|
return dist - STREAM_DISTANCE < mi->GetLargestLodDistance();
|
||||||
|
@ -1677,8 +1805,8 @@ CRenderer::RemoveVehiclePedLights(CEntity *ent, bool reset)
|
||||||
if(reset)
|
if(reset)
|
||||||
ReSetAmbientAndDirectionalColours();
|
ReSetAmbientAndDirectionalColours();
|
||||||
}
|
}
|
||||||
SetAmbientColours();
|
// SetAmbientColours();
|
||||||
DeActivateDirectional();
|
// DeActivateDirectional();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1799,7 +1927,6 @@ AddCorona(float x, float y, float sz)
|
||||||
coronaIndices[numCoronaIndices++] = numCoronaVerts + 3;
|
coronaIndices[numCoronaIndices++] = numCoronaVerts + 3;
|
||||||
numCoronaVerts += 4;
|
numCoronaVerts += 4;
|
||||||
}
|
}
|
||||||
#include "Debug.h"
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
DrawEnvMapCoronas(float heading)
|
DrawEnvMapCoronas(float heading)
|
||||||
|
|
|
@ -25,13 +25,6 @@ extern bool gbDontRenderVehicles;
|
||||||
class CVehicle;
|
class CVehicle;
|
||||||
class CPtrList;
|
class CPtrList;
|
||||||
|
|
||||||
// unused
|
|
||||||
struct BlockedRange
|
|
||||||
{
|
|
||||||
float a, b; // unknown
|
|
||||||
BlockedRange *prev, *next;
|
|
||||||
};
|
|
||||||
|
|
||||||
class CRenderer
|
class CRenderer
|
||||||
{
|
{
|
||||||
static int32 ms_nNoOfVisibleEntities;
|
static int32 ms_nNoOfVisibleEntities;
|
||||||
|
@ -49,10 +42,6 @@ class CRenderer
|
||||||
static CVector ms_vecCameraPosition;
|
static CVector ms_vecCameraPosition;
|
||||||
static CVehicle *m_pFirstPersonVehicle;
|
static CVehicle *m_pFirstPersonVehicle;
|
||||||
|
|
||||||
// unused
|
|
||||||
static BlockedRange aBlockedRanges[16];
|
|
||||||
static BlockedRange *pFullBlockedRanges;
|
|
||||||
static BlockedRange *pEmptyBlockedRanges;
|
|
||||||
public:
|
public:
|
||||||
static float ms_lodDistScale;
|
static float ms_lodDistScale;
|
||||||
static bool m_loadingPriority;
|
static bool m_loadingPriority;
|
||||||
|
@ -93,15 +82,15 @@ public:
|
||||||
static void RemoveVehiclePedLights(CEntity *ent, bool reset);
|
static void RemoveVehiclePedLights(CEntity *ent, bool reset);
|
||||||
|
|
||||||
|
|
||||||
#ifdef NEW_RENDERER
|
|
||||||
static void ClearForFrame(void);
|
static void ClearForFrame(void);
|
||||||
static void RenderPeds(void);
|
|
||||||
static void RenderVehicles(void); // also renders peds in LCS
|
static void RenderVehicles(void); // also renders peds in LCS
|
||||||
|
static void RenderWater(void); // keep-out polys and transparent water
|
||||||
|
#ifdef NEW_RENDERER
|
||||||
static void RenderOneBuilding(CEntity *ent, float camdist = 0.0f);
|
static void RenderOneBuilding(CEntity *ent, float camdist = 0.0f);
|
||||||
static void RenderWorld(int pass); // like cWorldStream::Render(int)
|
static void RenderWorld(int pass); // like cWorldStream::Render(int)
|
||||||
static void RenderTransparentWater(void); // keep-out polys and transparent water
|
|
||||||
#endif
|
#endif
|
||||||
static void InsertEntityIntoList(CEntity *ent);
|
static void InsertEntityIntoList(CEntity *ent);
|
||||||
|
static void AddVisibleEntity(CEntity *ent);
|
||||||
|
|
||||||
static void GenerateEnvironmentMap(void);
|
static void GenerateEnvironmentMap(void);
|
||||||
};
|
};
|
||||||
|
|
|
@ -374,7 +374,7 @@ CWaterLevel::CreateWavyAtomic()
|
||||||
{
|
{
|
||||||
wavyMaterial = RpMaterialCreate();
|
wavyMaterial = RpMaterialCreate();
|
||||||
RpMaterialSetTexture(wavyMaterial, gpWaterTex);
|
RpMaterialSetTexture(wavyMaterial, gpWaterTex);
|
||||||
RwRGBA watercolor = { 255, 255, 255, 192 };
|
RwRGBA watercolor = { 255, 255, 255, 255 /*192*/ };
|
||||||
RpMaterialSetColor(wavyMaterial, &watercolor);
|
RpMaterialSetColor(wavyMaterial, &watercolor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1227,7 +1227,7 @@ CWaterLevel::RenderTransparentWater(void)
|
||||||
colorTrans.red = CTimeCycle::GetWaterRed();
|
colorTrans.red = CTimeCycle::GetWaterRed();
|
||||||
colorTrans.green = CTimeCycle::GetWaterGreen();
|
colorTrans.green = CTimeCycle::GetWaterGreen();
|
||||||
colorTrans.blue = CTimeCycle::GetWaterBlue();
|
colorTrans.blue = CTimeCycle::GetWaterBlue();
|
||||||
colorTrans.alpha = CTimeCycle::GetWaterAlpha();
|
colorTrans.alpha = 255; //CTimeCycle::GetWaterAlpha();
|
||||||
|
|
||||||
TempBufferVerticesStored = 0;
|
TempBufferVerticesStored = 0;
|
||||||
TempBufferIndicesStored = 0;
|
TempBufferIndicesStored = 0;
|
||||||
|
@ -1676,7 +1676,6 @@ void
|
||||||
CWaterLevel::RenderOneWavySector(float fX, float fY, float fZ, RwRGBA const &color, bool bDontRender)
|
CWaterLevel::RenderOneWavySector(float fX, float fY, float fZ, RwRGBA const &color, bool bDontRender)
|
||||||
{
|
{
|
||||||
CVector vecSectorPos(fX + (SMALL_SECTOR_SIZE/2), fY + (SMALL_SECTOR_SIZE/2), fZ + 2.0f);
|
CVector vecSectorPos(fX + (SMALL_SECTOR_SIZE/2), fY + (SMALL_SECTOR_SIZE/2), fZ + 2.0f);
|
||||||
|
|
||||||
if ( COcclusion::IsAABoxOccluded(vecSectorPos, SMALL_SECTOR_SIZE, SMALL_SECTOR_SIZE, 4.0f) )
|
if ( COcclusion::IsAABoxOccluded(vecSectorPos, SMALL_SECTOR_SIZE, SMALL_SECTOR_SIZE, 4.0f) )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -1815,6 +1814,7 @@ CWaterLevel::RenderWavyMask(float fX, float fY, float fZ,
|
||||||
int32 nCamDirX, int32 nCamDirY, RwRGBA const&color)
|
int32 nCamDirX, int32 nCamDirY, RwRGBA const&color)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
|
return; // LCS
|
||||||
#ifndef PC_WATER
|
#ifndef PC_WATER
|
||||||
bool bRender = true;
|
bool bRender = true;
|
||||||
if (m_nRenderWaterLayers != 0 && m_nRenderWaterLayers != 2 && m_nRenderWaterLayers != 3)
|
if (m_nRenderWaterLayers != 0 && m_nRenderWaterLayers != 2 && m_nRenderWaterLayers != 3)
|
||||||
|
@ -2531,7 +2531,7 @@ CWaterLevel::RenderBoatWakes(void)
|
||||||
|
|
||||||
CBoat::FillBoatList();
|
CBoat::FillBoatList();
|
||||||
|
|
||||||
float fWakeZ = 5.97f;
|
float fWakeZ = 0.0f;//5.97f;
|
||||||
float fWakeLifeTimeMult = 0.01f / CBoat::WAKE_LIFETIME;
|
float fWakeLifeTimeMult = 0.01f / CBoat::WAKE_LIFETIME;
|
||||||
|
|
||||||
for ( int32 idx = 0; idx < ARRAY_SIZE(CBoat::apFrameWakeGeneratingBoats); idx++ )
|
for ( int32 idx = 0; idx < ARRAY_SIZE(CBoat::apFrameWakeGeneratingBoats); idx++ )
|
||||||
|
|
|
@ -95,6 +95,7 @@ DefinedState(void)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//LCS: remove this
|
||||||
void
|
void
|
||||||
SetCullMode(uint32 mode)
|
SetCullMode(uint32 mode)
|
||||||
{
|
{
|
||||||
|
|
|
@ -14,10 +14,13 @@
|
||||||
#include "custompipes.h"
|
#include "custompipes.h"
|
||||||
#include "MemoryHeap.h"
|
#include "MemoryHeap.h"
|
||||||
|
|
||||||
|
//--LCS: file done
|
||||||
|
// LCS: no transparent water in LCS so no need for alpha boat and alpha underwater lists
|
||||||
|
|
||||||
CLinkList<CVisibilityPlugins::AlphaObjectInfo> CVisibilityPlugins::m_alphaList;
|
CLinkList<CVisibilityPlugins::AlphaObjectInfo> CVisibilityPlugins::m_alphaList;
|
||||||
CLinkList<CVisibilityPlugins::AlphaObjectInfo> CVisibilityPlugins::m_alphaBoatAtomicList;
|
//CLinkList<CVisibilityPlugins::AlphaObjectInfo> CVisibilityPlugins::m_alphaBoatAtomicList;
|
||||||
CLinkList<CVisibilityPlugins::AlphaObjectInfo> CVisibilityPlugins::m_alphaEntityList;
|
CLinkList<CVisibilityPlugins::AlphaObjectInfo> CVisibilityPlugins::m_alphaEntityList;
|
||||||
CLinkList<CVisibilityPlugins::AlphaObjectInfo> CVisibilityPlugins::m_alphaUnderwaterEntityList;
|
//CLinkList<CVisibilityPlugins::AlphaObjectInfo> CVisibilityPlugins::m_alphaUnderwaterEntityList;
|
||||||
#ifdef NEW_RENDERER
|
#ifdef NEW_RENDERER
|
||||||
CLinkList<CVisibilityPlugins::AlphaObjectInfo> CVisibilityPlugins::m_alphaBuildingList;
|
CLinkList<CVisibilityPlugins::AlphaObjectInfo> CVisibilityPlugins::m_alphaBuildingList;
|
||||||
#endif
|
#endif
|
||||||
|
@ -34,7 +37,7 @@ float CVisibilityPlugins::ms_vehicleLod1Dist;
|
||||||
float CVisibilityPlugins::ms_vehicleFadeDist;
|
float CVisibilityPlugins::ms_vehicleFadeDist;
|
||||||
float CVisibilityPlugins::ms_bigVehicleLod0Dist;
|
float CVisibilityPlugins::ms_bigVehicleLod0Dist;
|
||||||
float CVisibilityPlugins::ms_bigVehicleLod1Dist;
|
float CVisibilityPlugins::ms_bigVehicleLod1Dist;
|
||||||
float CVisibilityPlugins::ms_pedLod1Dist;
|
float CVisibilityPlugins::ms_pedLodDist;
|
||||||
float CVisibilityPlugins::ms_pedFadeDist;
|
float CVisibilityPlugins::ms_pedFadeDist;
|
||||||
|
|
||||||
#define RENDERCALLBACK AtomicDefaultRenderCallBack
|
#define RENDERCALLBACK AtomicDefaultRenderCallBack
|
||||||
|
@ -46,12 +49,12 @@ CVisibilityPlugins::Initialise(void)
|
||||||
m_alphaList.head.item.sort = 0.0f;
|
m_alphaList.head.item.sort = 0.0f;
|
||||||
m_alphaList.tail.item.sort = 100000000.0f;
|
m_alphaList.tail.item.sort = 100000000.0f;
|
||||||
|
|
||||||
m_alphaBoatAtomicList.Init(NUMBOATALPHALIST);
|
// m_alphaBoatAtomicList.Init(NUMBOATALPHALIST);
|
||||||
m_alphaBoatAtomicList.head.item.sort = 0.0f;
|
// m_alphaBoatAtomicList.head.item.sort = 0.0f;
|
||||||
m_alphaBoatAtomicList.tail.item.sort = 100000000.0f;
|
// m_alphaBoatAtomicList.tail.item.sort = 100000000.0f;
|
||||||
|
|
||||||
#ifdef ASPECT_RATIO_SCALE
|
#ifdef ASPECT_RATIO_SCALE
|
||||||
// default 150 if not enough for bigger FOVs
|
// default 150 is not enough for bigger FOVs
|
||||||
m_alphaEntityList.Init(NUMALPHAENTITYLIST * 3);
|
m_alphaEntityList.Init(NUMALPHAENTITYLIST * 3);
|
||||||
#else
|
#else
|
||||||
m_alphaEntityList.Init(NUMALPHAENTITYLIST);
|
m_alphaEntityList.Init(NUMALPHAENTITYLIST);
|
||||||
|
@ -59,24 +62,44 @@ CVisibilityPlugins::Initialise(void)
|
||||||
m_alphaEntityList.head.item.sort = 0.0f;
|
m_alphaEntityList.head.item.sort = 0.0f;
|
||||||
m_alphaEntityList.tail.item.sort = 100000000.0f;
|
m_alphaEntityList.tail.item.sort = 100000000.0f;
|
||||||
|
|
||||||
m_alphaUnderwaterEntityList.Init(NUMALPHAUNTERWATERENTITYLIST);
|
// m_alphaUnderwaterEntityList.Init(NUMALPHAUNTERWATERENTITYLIST);
|
||||||
m_alphaUnderwaterEntityList.head.item.sort = 0.0f;
|
// m_alphaUnderwaterEntityList.head.item.sort = 0.0f;
|
||||||
m_alphaUnderwaterEntityList.tail.item.sort = 100000000.0f;
|
// m_alphaUnderwaterEntityList.tail.item.sort = 100000000.0f;
|
||||||
|
|
||||||
#ifdef NEW_RENDERER
|
#ifdef NEW_RENDERER
|
||||||
m_alphaBuildingList.Init(NUMALPHAENTITYLIST);
|
m_alphaBuildingList.Init(NUMALPHAENTITYLIST);
|
||||||
m_alphaBuildingList.head.item.sort = 0.0f;
|
m_alphaBuildingList.head.item.sort = 0.0f;
|
||||||
m_alphaBuildingList.tail.item.sort = 100000000.0f;
|
m_alphaBuildingList.tail.item.sort = 100000000.0f;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
base::RegisterRelocatableChunkFunc((void*)RENDERCALLBACK);
|
||||||
|
base::RegisterRelocatableChunkFunc((void*)RenderVehicleReallyLowDetailCB);
|
||||||
|
base::RegisterRelocatableChunkFunc((void*)RenderVehicleHiDetailCB);
|
||||||
|
base::RegisterRelocatableChunkFunc((void*)RenderVehicleHiDetailAlphaCB);
|
||||||
|
base::RegisterRelocatableChunkFunc((void*)RenderTrainHiDetailCB);
|
||||||
|
base::RegisterRelocatableChunkFunc((void*)RenderTrainHiDetailAlphaCB);
|
||||||
|
base::RegisterRelocatableChunkFunc((void*)RenderWheelAtomicCB);
|
||||||
|
base::RegisterRelocatableChunkFunc((void*)RenderVehicleRotorAlphaCB);
|
||||||
|
base::RegisterRelocatableChunkFunc((void*)RenderVehicleTailRotorAlphaCB);
|
||||||
|
base::RegisterRelocatableChunkFunc((void*)RenderVehicleReallyLowDetailCB_BigVehicle);
|
||||||
|
base::RegisterRelocatableChunkFunc((void*)RenderVehicleLowDetailCB_BigVehicle);
|
||||||
|
base::RegisterRelocatableChunkFunc((void*)RenderVehicleHiDetailCB_BigVehicle);
|
||||||
|
base::RegisterRelocatableChunkFunc((void*)RenderVehicleLowDetailAlphaCB_BigVehicle);
|
||||||
|
base::RegisterRelocatableChunkFunc((void*)RenderVehicleHiDetailAlphaCB_BigVehicle);
|
||||||
|
base::RegisterRelocatableChunkFunc((void*)RenderVehicleHiDetailCB_Boat);
|
||||||
|
base::RegisterRelocatableChunkFunc((void*)RenderVehicleLoDetailCB_Boat);
|
||||||
|
base::RegisterRelocatableChunkFunc((void*)RenderVehicleHiDetailCB_Boat_Far);
|
||||||
|
base::RegisterRelocatableChunkFunc((void*)RenderVehicleLoDetailCB_Boat_Far);
|
||||||
|
base::RegisterRelocatableChunkFunc((void*)RenderPedCB);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
CVisibilityPlugins::Shutdown(void)
|
CVisibilityPlugins::Shutdown(void)
|
||||||
{
|
{
|
||||||
m_alphaList.Shutdown();
|
m_alphaList.Shutdown();
|
||||||
m_alphaBoatAtomicList.Shutdown();
|
// m_alphaBoatAtomicList.Shutdown();
|
||||||
m_alphaEntityList.Shutdown();
|
m_alphaEntityList.Shutdown();
|
||||||
m_alphaUnderwaterEntityList.Shutdown();
|
// m_alphaUnderwaterEntityList.Shutdown();
|
||||||
#ifdef NEW_RENDERER
|
#ifdef NEW_RENDERER
|
||||||
m_alphaBuildingList.Shutdown();
|
m_alphaBuildingList.Shutdown();
|
||||||
#endif
|
#endif
|
||||||
|
@ -86,8 +109,8 @@ void
|
||||||
CVisibilityPlugins::InitAlphaEntityList(void)
|
CVisibilityPlugins::InitAlphaEntityList(void)
|
||||||
{
|
{
|
||||||
m_alphaEntityList.Clear();
|
m_alphaEntityList.Clear();
|
||||||
m_alphaBoatAtomicList.Clear();
|
// m_alphaBoatAtomicList.Clear();
|
||||||
m_alphaUnderwaterEntityList.Clear();
|
// m_alphaUnderwaterEntityList.Clear();
|
||||||
#ifdef NEW_RENDERER
|
#ifdef NEW_RENDERER
|
||||||
m_alphaBuildingList.Clear();
|
m_alphaBuildingList.Clear();
|
||||||
#endif
|
#endif
|
||||||
|
@ -104,11 +127,11 @@ CVisibilityPlugins::InsertEntityIntoSortedList(CEntity *e, float dist)
|
||||||
item.entity = e;
|
item.entity = e;
|
||||||
item.sort = dist;
|
item.sort = dist;
|
||||||
#ifdef NEW_RENDERER
|
#ifdef NEW_RENDERER
|
||||||
if(gbNewRenderer && e->IsBuilding())
|
if(!gbPreviewCity && e->IsBuilding())
|
||||||
return !!m_alphaBuildingList.InsertSorted(item);
|
return !!m_alphaBuildingList.InsertSorted(item);
|
||||||
#endif
|
#endif
|
||||||
if(e->bUnderwater && m_alphaUnderwaterEntityList.InsertSorted(item))
|
// if(e->bUnderwater && m_alphaUnderwaterEntityList.InsertSorted(item))
|
||||||
return true;
|
// return true;
|
||||||
return !!m_alphaEntityList.InsertSorted(item);
|
return !!m_alphaEntityList.InsertSorted(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -127,6 +150,7 @@ CVisibilityPlugins::InsertAtomicIntoSortedList(RpAtomic *a, float dist)
|
||||||
return !!m_alphaList.InsertSorted(item);
|
return !!m_alphaList.InsertSorted(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
bool
|
bool
|
||||||
CVisibilityPlugins::InsertAtomicIntoBoatSortedList(RpAtomic *a, float dist)
|
CVisibilityPlugins::InsertAtomicIntoBoatSortedList(RpAtomic *a, float dist)
|
||||||
{
|
{
|
||||||
|
@ -135,9 +159,11 @@ CVisibilityPlugins::InsertAtomicIntoBoatSortedList(RpAtomic *a, float dist)
|
||||||
item.sort = dist;
|
item.sort = dist;
|
||||||
return !!m_alphaBoatAtomicList.InsertSorted(item);
|
return !!m_alphaBoatAtomicList.InsertSorted(item);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
// can't increase this yet unfortunately...
|
// can't increase this yet unfortunately...
|
||||||
// probably have to fix fading for this so material alpha isn't overwritten
|
// probably have to fix fading for this so material alpha isn't overwritten
|
||||||
|
// LCS: VIS_DISTANCE_ALPHA will probably take care of this
|
||||||
#define VEHICLE_LODDIST_MULTIPLIER (TheCamera.GenerationDistMultiplier)
|
#define VEHICLE_LODDIST_MULTIPLIER (TheCamera.GenerationDistMultiplier)
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -157,7 +183,7 @@ CVisibilityPlugins::SetRenderWareCamera(RwCamera *camera)
|
||||||
ms_vehicleFadeDist = sq(100.0f * VEHICLE_LODDIST_MULTIPLIER);
|
ms_vehicleFadeDist = sq(100.0f * VEHICLE_LODDIST_MULTIPLIER);
|
||||||
ms_bigVehicleLod0Dist = sq(60.0f * VEHICLE_LODDIST_MULTIPLIER);
|
ms_bigVehicleLod0Dist = sq(60.0f * VEHICLE_LODDIST_MULTIPLIER);
|
||||||
ms_bigVehicleLod1Dist = sq(150.0f * VEHICLE_LODDIST_MULTIPLIER);
|
ms_bigVehicleLod1Dist = sq(150.0f * VEHICLE_LODDIST_MULTIPLIER);
|
||||||
ms_pedLod1Dist = sq(60.0f * TheCamera.LODDistMultiplier);
|
ms_pedLodDist = sq(70.0f * TheCamera.LODDistMultiplier);
|
||||||
ms_pedFadeDist = sq(70.0f * TheCamera.LODDistMultiplier);
|
ms_pedFadeDist = sq(70.0f * TheCamera.LODDistMultiplier);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -173,7 +199,10 @@ CVisibilityPlugins::SetupVehicleVariables(RpClump *vehicle)
|
||||||
RwV3d distToCam;
|
RwV3d distToCam;
|
||||||
RwV3dSub(&distToCam, ms_pCameraPosn, &RwFrameGetMatrix(RpClumpGetFrame(vehicle))->pos);
|
RwV3dSub(&distToCam, ms_pCameraPosn, &RwFrameGetMatrix(RpClumpGetFrame(vehicle))->pos);
|
||||||
float dist2d = Sqrt(SQR(distToCam.x) + SQR(distToCam.y));
|
float dist2d = Sqrt(SQR(distToCam.x) + SQR(distToCam.y));
|
||||||
PitchToCamera = Atan2(distToCam.z, dist2d);
|
if(distToCam.z == 0.0f && dist2d == 0.0f)
|
||||||
|
PitchToCamera = 0.0f;
|
||||||
|
else
|
||||||
|
PitchToCamera = Atan2(distToCam.z, dist2d);
|
||||||
}
|
}
|
||||||
|
|
||||||
RpMaterial*
|
RpMaterial*
|
||||||
|
@ -204,6 +233,8 @@ CVisibilityPlugins::RenderAlphaAtomics(void)
|
||||||
RenderAtomicList(m_alphaList);
|
RenderAtomicList(m_alphaList);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
//LCS: removed
|
||||||
void
|
void
|
||||||
CVisibilityPlugins::RenderBoatAlphaAtomics(void)
|
CVisibilityPlugins::RenderBoatAlphaAtomics(void)
|
||||||
{
|
{
|
||||||
|
@ -211,6 +242,7 @@ CVisibilityPlugins::RenderBoatAlphaAtomics(void)
|
||||||
RenderAtomicList(m_alphaBoatAtomicList);
|
RenderAtomicList(m_alphaBoatAtomicList);
|
||||||
SetCullMode(rwCULLMODECULLBACK);
|
SetCullMode(rwCULLMODECULLBACK);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
void
|
void
|
||||||
CVisibilityPlugins::RenderFadingEntities(CLinkList<AlphaObjectInfo> &list)
|
CVisibilityPlugins::RenderFadingEntities(CLinkList<AlphaObjectInfo> &list)
|
||||||
|
@ -229,6 +261,8 @@ CVisibilityPlugins::RenderFadingEntities(CLinkList<AlphaObjectInfo> &list)
|
||||||
if(mi->GetModelType() == MITYPE_SIMPLE && mi->m_noZwrite)
|
if(mi->GetModelType() == MITYPE_SIMPLE && mi->m_noZwrite)
|
||||||
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, FALSE);
|
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, FALSE);
|
||||||
|
|
||||||
|
#if defined(FIX_BUGS) && !defined(VIS_DISTANCE_ALPHA)
|
||||||
|
//LCS: removed, but that's dumb cause it breaks distance fading
|
||||||
if(e->bDistanceFade){
|
if(e->bDistanceFade){
|
||||||
DeActivateDirectional();
|
DeActivateDirectional();
|
||||||
SetAmbientColours();
|
SetAmbientColours();
|
||||||
|
@ -238,7 +272,18 @@ CVisibilityPlugins::RenderFadingEntities(CLinkList<AlphaObjectInfo> &list)
|
||||||
POP_RENDERGROUP();
|
POP_RENDERGROUP();
|
||||||
e->bImBeingRendered = false;
|
e->bImBeingRendered = false;
|
||||||
}else
|
}else
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
#ifdef VIS_DISTANCE_ALPHA
|
||||||
|
// BUG: we don't even know if this is a clump
|
||||||
|
if(GetClumpAlpha((RpClump*)e->m_rwObject) != 255 ||
|
||||||
|
GetObjectDistanceAlpha(e->m_rwObject) != 255)
|
||||||
|
; // set blend render states
|
||||||
|
else
|
||||||
|
; // set default render states
|
||||||
|
#endif
|
||||||
CRenderer::RenderOneNonRoad(e);
|
CRenderer::RenderOneNonRoad(e);
|
||||||
|
}
|
||||||
|
|
||||||
if(mi->GetModelType() == MITYPE_SIMPLE && mi->m_noZwrite)
|
if(mi->GetModelType() == MITYPE_SIMPLE && mi->m_noZwrite)
|
||||||
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)TRUE);
|
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)TRUE);
|
||||||
|
@ -249,13 +294,13 @@ void
|
||||||
CVisibilityPlugins::RenderFadingEntities(void)
|
CVisibilityPlugins::RenderFadingEntities(void)
|
||||||
{
|
{
|
||||||
RenderFadingEntities(m_alphaEntityList);
|
RenderFadingEntities(m_alphaEntityList);
|
||||||
RenderBoatAlphaAtomics();
|
// RenderBoatAlphaAtomics();
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
CVisibilityPlugins::RenderFadingUnderwaterEntities(void)
|
CVisibilityPlugins::RenderFadingUnderwaterEntities(void)
|
||||||
{
|
{
|
||||||
RenderFadingEntities(m_alphaUnderwaterEntityList);
|
// RenderFadingEntities(m_alphaUnderwaterEntityList);
|
||||||
}
|
}
|
||||||
|
|
||||||
RpAtomic*
|
RpAtomic*
|
||||||
|
@ -267,8 +312,12 @@ CVisibilityPlugins::RenderWheelAtomicCB(RpAtomic *atomic)
|
||||||
|
|
||||||
mi = GetAtomicModelInfo(atomic);
|
mi = GetAtomicModelInfo(atomic);
|
||||||
len = Sqrt(DistToCameraSq);
|
len = Sqrt(DistToCameraSq);
|
||||||
|
#ifdef FIX_BUGS
|
||||||
len *= 0.5f; // HACK HACK, LOD wheels look shite
|
len *= 0.5f; // HACK HACK, LOD wheels look shite
|
||||||
lodatm = mi->GetAtomicFromDistance(len * TheCamera.LODDistMultiplier / VEHICLE_LODDIST_MULTIPLIER);
|
lodatm = mi->GetAtomicFromDistance(len * TheCamera.LODDistMultiplier / VEHICLE_LODDIST_MULTIPLIER);
|
||||||
|
#else
|
||||||
|
lodatm = mi->GetAtomicFromDistance(len);
|
||||||
|
#endif
|
||||||
if(lodatm){
|
if(lodatm){
|
||||||
if(RpAtomicGetGeometry(lodatm) != RpAtomicGetGeometry(atomic))
|
if(RpAtomicGetGeometry(lodatm) != RpAtomicGetGeometry(atomic))
|
||||||
RpAtomicSetGeometry(atomic, RpAtomicGetGeometry(lodatm), rpATOMICSAMEBOUNDINGSPHERE);
|
RpAtomicSetGeometry(atomic, RpAtomicGetGeometry(lodatm), rpATOMICSAMEBOUNDINGSPHERE);
|
||||||
|
@ -309,6 +358,8 @@ CVisibilityPlugins::RenderAlphaAtomic(RpAtomic *atomic, int alpha)
|
||||||
return atomic;
|
return atomic;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
//LCS: removed
|
||||||
RpAtomic*
|
RpAtomic*
|
||||||
CVisibilityPlugins::RenderWeaponCB(RpAtomic *atomic)
|
CVisibilityPlugins::RenderWeaponCB(RpAtomic *atomic)
|
||||||
{
|
{
|
||||||
|
@ -326,7 +377,9 @@ CVisibilityPlugins::RenderWeaponCB(RpAtomic *atomic)
|
||||||
RENDERCALLBACK(atomic);
|
RENDERCALLBACK(atomic);
|
||||||
return atomic;
|
return atomic;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
//LCS: removed, but we want it
|
||||||
RpAtomic*
|
RpAtomic*
|
||||||
CVisibilityPlugins::RenderFadingAtomic(RpAtomic *atomic, float camdist)
|
CVisibilityPlugins::RenderFadingAtomic(RpAtomic *atomic, float camdist)
|
||||||
{
|
{
|
||||||
|
@ -365,7 +418,6 @@ CVisibilityPlugins::RenderFadingAtomic(RpAtomic *atomic, float camdist)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
RpAtomic*
|
RpAtomic*
|
||||||
CVisibilityPlugins::RenderVehicleHiDetailCB(RpAtomic *atomic)
|
CVisibilityPlugins::RenderVehicleHiDetailCB(RpAtomic *atomic)
|
||||||
{
|
{
|
||||||
|
@ -382,6 +434,10 @@ CVisibilityPlugins::RenderVehicleHiDetailCB(RpAtomic *atomic)
|
||||||
if(dot > 0.0f && ((flags & ATOMIC_FLAG_ANGLECULL) || 0.1f*DistToCameraSq < dot*dot))
|
if(dot > 0.0f && ((flags & ATOMIC_FLAG_ANGLECULL) || 0.1f*DistToCameraSq < dot*dot))
|
||||||
return atomic;
|
return atomic;
|
||||||
}
|
}
|
||||||
|
#ifdef VIS_DISTANCE_ALPHA
|
||||||
|
if(GetObjectDistanceAlpha((RwObject*)RpAtomicGetClump(atomic)) == 255 ||
|
||||||
|
!InsertAtomicIntoSortedList(atomic, DistToCameraSq))
|
||||||
|
#endif
|
||||||
RENDERCALLBACK(atomic);
|
RENDERCALLBACK(atomic);
|
||||||
}
|
}
|
||||||
return atomic;
|
return atomic;
|
||||||
|
@ -474,6 +530,8 @@ CVisibilityPlugins::RenderVehicleHiDetailCB_Boat_Far(RpAtomic *atomic)
|
||||||
return atomic;
|
return atomic;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
//LCS: removed
|
||||||
RpAtomic*
|
RpAtomic*
|
||||||
CVisibilityPlugins::RenderVehicleHiDetailAlphaCB_Boat(RpAtomic *atomic)
|
CVisibilityPlugins::RenderVehicleHiDetailAlphaCB_Boat(RpAtomic *atomic)
|
||||||
{
|
{
|
||||||
|
@ -486,6 +544,7 @@ CVisibilityPlugins::RenderVehicleHiDetailAlphaCB_Boat(RpAtomic *atomic)
|
||||||
}
|
}
|
||||||
return atomic;
|
return atomic;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
RpAtomic*
|
RpAtomic*
|
||||||
CVisibilityPlugins::RenderVehicleLoDetailCB_Boat(RpAtomic *atomic)
|
CVisibilityPlugins::RenderVehicleLoDetailCB_Boat(RpAtomic *atomic)
|
||||||
|
@ -496,9 +555,9 @@ CVisibilityPlugins::RenderVehicleLoDetailCB_Boat(RpAtomic *atomic)
|
||||||
clump = RpAtomicGetClump(atomic);
|
clump = RpAtomicGetClump(atomic);
|
||||||
if(DistToCameraSq >= ms_vehicleLod0Dist){
|
if(DistToCameraSq >= ms_vehicleLod0Dist){
|
||||||
alpha = GetClumpAlpha(clump);
|
alpha = GetClumpAlpha(clump);
|
||||||
if(alpha == 255)
|
// if(alpha == 255)
|
||||||
RENDERCALLBACK(atomic);
|
// RENDERCALLBACK(atomic);
|
||||||
else
|
// else
|
||||||
RenderAlphaAtomic(atomic, alpha);
|
RenderAlphaAtomic(atomic, alpha);
|
||||||
}
|
}
|
||||||
return atomic;
|
return atomic;
|
||||||
|
@ -513,9 +572,9 @@ CVisibilityPlugins::RenderVehicleLoDetailCB_Boat_Far(RpAtomic *atomic)
|
||||||
clump = RpAtomicGetClump(atomic);
|
clump = RpAtomicGetClump(atomic);
|
||||||
if(DistToCameraSq >= ms_bigVehicleLod1Dist){
|
if(DistToCameraSq >= ms_bigVehicleLod1Dist){
|
||||||
alpha = GetClumpAlpha(clump);
|
alpha = GetClumpAlpha(clump);
|
||||||
if(alpha == 255)
|
// if(alpha == 255)
|
||||||
RENDERCALLBACK(atomic);
|
// RENDERCALLBACK(atomic);
|
||||||
else
|
// else
|
||||||
RenderAlphaAtomic(atomic, alpha);
|
RenderAlphaAtomic(atomic, alpha);
|
||||||
}
|
}
|
||||||
return atomic;
|
return atomic;
|
||||||
|
@ -575,9 +634,9 @@ CVisibilityPlugins::RenderVehicleReallyLowDetailCB(RpAtomic *atomic)
|
||||||
clump = RpAtomicGetClump(atomic);
|
clump = RpAtomicGetClump(atomic);
|
||||||
if(DistToCameraSq >= ms_vehicleLod0Dist){
|
if(DistToCameraSq >= ms_vehicleLod0Dist){
|
||||||
alpha = GetClumpAlpha(clump);
|
alpha = GetClumpAlpha(clump);
|
||||||
if(alpha == 255)
|
// if(alpha == 255)
|
||||||
RENDERCALLBACK(atomic);
|
// RENDERCALLBACK(atomic);
|
||||||
else
|
// else
|
||||||
RenderAlphaAtomic(atomic, alpha);
|
RenderAlphaAtomic(atomic, alpha);
|
||||||
}
|
}
|
||||||
return atomic;
|
return atomic;
|
||||||
|
@ -630,8 +689,7 @@ CVisibilityPlugins::RenderTrainHiDetailAlphaCB(RpAtomic *atomic)
|
||||||
return atomic;
|
return atomic;
|
||||||
|
|
||||||
if(flags & ATOMIC_FLAG_DRAWLAST){
|
if(flags & ATOMIC_FLAG_DRAWLAST){
|
||||||
// sort before clump
|
if(!InsertAtomicIntoSortedList(atomic, DistToCameraSq))
|
||||||
if(!InsertAtomicIntoSortedList(atomic, DistToCameraSq - 0.0001f))
|
|
||||||
RENDERCALLBACK(atomic);
|
RENDERCALLBACK(atomic);
|
||||||
}else{
|
}else{
|
||||||
if(!InsertAtomicIntoSortedList(atomic, DistToCameraSq + dot))
|
if(!InsertAtomicIntoSortedList(atomic, DistToCameraSq + dot))
|
||||||
|
@ -676,28 +734,31 @@ CVisibilityPlugins::RenderVehicleTailRotorAlphaCB(RpAtomic *atomic)
|
||||||
return atomic;
|
return atomic;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
RpAtomic*
|
RpAtomic*
|
||||||
CVisibilityPlugins::RenderPlayerCB(RpAtomic *atomic)
|
CVisibilityPlugins::RenderPlayerCB(RpAtomic *atomic)
|
||||||
{
|
{
|
||||||
// LCS: removed
|
if(CWorld::Players[0].m_pSkinTexture)
|
||||||
// if(CWorld::Players[0].m_pSkinTexture)
|
RpGeometryForAllMaterials(RpAtomicGetGeometry(atomic), SetTextureCB, CWorld::Players[0].m_pSkinTexture);
|
||||||
// RpGeometryForAllMaterials(RpAtomicGetGeometry(atomic), SetTextureCB, CWorld::Players[0].m_pSkinTexture);
|
|
||||||
RENDERCALLBACK(atomic);
|
RENDERCALLBACK(atomic);
|
||||||
return atomic;
|
return atomic;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
RpAtomic*
|
RpAtomic*
|
||||||
CVisibilityPlugins::RenderPedCB(RpAtomic *atomic)
|
CVisibilityPlugins::RenderPedCB(RpAtomic *atomic)
|
||||||
{
|
{
|
||||||
|
RpClump *clump;
|
||||||
|
float dist;
|
||||||
int32 alpha;
|
int32 alpha;
|
||||||
RwV3d cam2atm;
|
|
||||||
|
|
||||||
RwV3dSub(&cam2atm, &RwFrameGetLTM(RpAtomicGetFrame(atomic))->pos, ms_pCameraPosn);
|
clump = RpAtomicGetClump(atomic);
|
||||||
if(RwV3dDotProduct(&cam2atm, &cam2atm) < ms_pedLod1Dist){
|
dist = GetDistanceSquaredFromCamera(RpClumpGetFrame(clump));
|
||||||
alpha = GetClumpAlpha(RpAtomicGetClump(atomic));
|
if(dist < ms_pedLodDist){
|
||||||
if(alpha == 255)
|
alpha = GetClumpAlpha(clump);
|
||||||
RENDERCALLBACK(atomic);
|
// if(alpha == 255)
|
||||||
else
|
// RENDERCALLBACK(atomic);
|
||||||
|
// else
|
||||||
RenderAlphaAtomic(atomic, alpha);
|
RenderAlphaAtomic(atomic, alpha);
|
||||||
}
|
}
|
||||||
return atomic;
|
return atomic;
|
||||||
|
@ -770,24 +831,26 @@ CVisibilityPlugins::DefaultVisibilityCB(RpClump *clump)
|
||||||
bool
|
bool
|
||||||
CVisibilityPlugins::FrustumSphereCB(RpClump *clump)
|
CVisibilityPlugins::FrustumSphereCB(RpClump *clump)
|
||||||
{
|
{
|
||||||
RwSphere sphere;
|
return true;
|
||||||
RwFrame *frame = RpClumpGetFrame(clump);
|
}
|
||||||
|
|
||||||
CClumpModelInfo *modelInfo = (CClumpModelInfo*)GetFrameHierarchyId(frame);
|
bool
|
||||||
sphere.radius = modelInfo->GetColModel()->boundingSphere.radius;
|
CVisibilityPlugins::MloVisibilityCB(RpClump *clump)
|
||||||
sphere.center.x = modelInfo->GetColModel()->boundingSphere.center.x;
|
{
|
||||||
sphere.center.y = modelInfo->GetColModel()->boundingSphere.center.y;
|
RwFrame *frame = RpClumpGetFrame(clump);
|
||||||
sphere.center.z = modelInfo->GetColModel()->boundingSphere.center.z;
|
CMloModelInfo *modelInfo = (CMloModelInfo*)GetFrameHierarchyId(frame);
|
||||||
RwV3dTransformPoints(&sphere.center, &sphere.center, 1, RwFrameGetLTM(frame));
|
if (SQR(modelInfo->drawDist) < GetDistanceSquaredFromCamera(frame))
|
||||||
return RwCameraFrustumTestSphere(ms_pCamera, &sphere) != rwSPHEREOUTSIDE;
|
return false;
|
||||||
|
return CVisibilityPlugins::FrustumSphereCB(clump);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
CVisibilityPlugins::VehicleVisibilityCB(RpClump *clump)
|
CVisibilityPlugins::VehicleVisibilityCB(RpClump *clump)
|
||||||
{
|
{
|
||||||
if (GetDistanceSquaredFromCamera(RpClumpGetFrame(clump)) <= ms_vehicleLod1Dist)
|
RwFrame *frame = RpClumpGetFrame(clump);
|
||||||
return FrustumSphereCB(clump);
|
if (ms_vehicleLod1Dist < GetDistanceSquaredFromCamera(frame))
|
||||||
return false;
|
return false;
|
||||||
|
return FrustumSphereCB(clump);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
bool
|
||||||
|
@ -838,8 +901,12 @@ CVisibilityPlugins::PluginAttach(void)
|
||||||
void*
|
void*
|
||||||
CVisibilityPlugins::AtomicConstructor(void *object, int32, int32)
|
CVisibilityPlugins::AtomicConstructor(void *object, int32, int32)
|
||||||
{
|
{
|
||||||
ATOMICEXT(object)->modelInfo = nil;
|
ATOMICEXT(object)->modelId = -1;
|
||||||
|
#ifdef VIS_DISTANCE_ALPHA
|
||||||
|
// This seems strange, want to start out invisible before fading in
|
||||||
|
// but maybe it's set elsewhere?
|
||||||
ATOMICEXT(object)->distanceAlpha = 255;
|
ATOMICEXT(object)->distanceAlpha = 255;
|
||||||
|
#endif
|
||||||
return object;
|
return object;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -860,14 +927,29 @@ void
|
||||||
CVisibilityPlugins::SetAtomicModelInfo(RpAtomic *atomic,
|
CVisibilityPlugins::SetAtomicModelInfo(RpAtomic *atomic,
|
||||||
CSimpleModelInfo *modelInfo)
|
CSimpleModelInfo *modelInfo)
|
||||||
{
|
{
|
||||||
AtomicExt *ext = ATOMICEXT(atomic);
|
int id;
|
||||||
ext->modelInfo = modelInfo;
|
|
||||||
|
for(id = 0; id < MODELINFOSIZE; id++)
|
||||||
|
if(CModelInfo::GetModelInfo(id) == modelInfo){
|
||||||
|
ATOMICEXT(atomic)->modelId = id;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ATOMICEXT(atomic)->modelId = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
CVisibilityPlugins::SetAtomicModelIndex(RpAtomic *atomic, int modelId)
|
||||||
|
{
|
||||||
|
ATOMICEXT(atomic)->modelId = modelId;
|
||||||
}
|
}
|
||||||
|
|
||||||
CSimpleModelInfo*
|
CSimpleModelInfo*
|
||||||
CVisibilityPlugins::GetAtomicModelInfo(RpAtomic *atomic)
|
CVisibilityPlugins::GetAtomicModelInfo(RpAtomic *atomic)
|
||||||
{
|
{
|
||||||
return ATOMICEXT(atomic)->modelInfo;
|
int id = ATOMICEXT(atomic)->modelId;
|
||||||
|
if(id == -1)
|
||||||
|
return nil;
|
||||||
|
return (CSimpleModelInfo*)CModelInfo::GetModelInfo(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -882,6 +964,12 @@ CVisibilityPlugins::ClearAtomicFlag(RpAtomic *atomic, int f)
|
||||||
ATOMICEXT(atomic)->flags &= ~f;
|
ATOMICEXT(atomic)->flags &= ~f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
CVisibilityPlugins::SetAtomicId(RpAtomic *atomic, int id)
|
||||||
|
{
|
||||||
|
ATOMICEXT(atomic)->flags = id;
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
CVisibilityPlugins::GetAtomicId(RpAtomic *atomic)
|
CVisibilityPlugins::GetAtomicId(RpAtomic *atomic)
|
||||||
{
|
{
|
||||||
|
@ -967,7 +1055,9 @@ CVisibilityPlugins::SetClumpModelInfo(RpClump *clump, CClumpModelInfo *modelInfo
|
||||||
|
|
||||||
// Unused
|
// Unused
|
||||||
switch (modelInfo->GetModelType()) {
|
switch (modelInfo->GetModelType()) {
|
||||||
// ignore MLO
|
case MITYPE_MLO:
|
||||||
|
CLUMPEXT(clump)->visibilityCB = MloVisibilityCB;
|
||||||
|
break;
|
||||||
case MITYPE_VEHICLE:
|
case MITYPE_VEHICLE:
|
||||||
vmi = (CVehicleModelInfo*)modelInfo;
|
vmi = (CVehicleModelInfo*)modelInfo;
|
||||||
if(vmi->m_vehicleType == VEHICLE_TYPE_TRAIN ||
|
if(vmi->m_vehicleType == VEHICLE_TYPE_TRAIN ||
|
||||||
|
@ -981,6 +1071,12 @@ CVisibilityPlugins::SetClumpModelInfo(RpClump *clump, CClumpModelInfo *modelInfo
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CClumpModelInfo*
|
||||||
|
CVisibilityPlugins::GetClumpModelInfo(RpClump *clump)
|
||||||
|
{
|
||||||
|
return (CClumpModelInfo*)GetFrameHierarchyId(RpClumpGetFrame(clump));
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
CVisibilityPlugins::SetClumpAlpha(RpClump *clump, int alpha)
|
CVisibilityPlugins::SetClumpAlpha(RpClump *clump, int alpha)
|
||||||
{
|
{
|
||||||
|
@ -993,6 +1089,13 @@ CVisibilityPlugins::GetClumpAlpha(RpClump *clump)
|
||||||
return CLUMPEXT(clump)->alpha;
|
return CLUMPEXT(clump)->alpha;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
CVisibilityPlugins::IsClumpVisible(RpClump *clump)
|
||||||
|
{
|
||||||
|
return CLUMPEXT(clump)->visibilityCB(clump);
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef VIS_DISTANCE_ALPHA
|
||||||
// LCS walks the atomic list manually but we want to be compatible with both RW and librw,
|
// LCS walks the atomic list manually but we want to be compatible with both RW and librw,
|
||||||
// so this code isn't quite original and uses callbacks instead.
|
// so this code isn't quite original and uses callbacks instead.
|
||||||
static RpAtomic*
|
static RpAtomic*
|
||||||
|
@ -1045,3 +1148,4 @@ CVisibilityPlugins::GetObjectDistanceAlpha(RwObject *object)
|
||||||
else
|
else
|
||||||
return GetClumpDistanceAlpha((RpClump*)object);
|
return GetClumpDistanceAlpha((RpClump*)object);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
|
@ -21,9 +21,9 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
static CLinkList<AlphaObjectInfo> m_alphaList;
|
static CLinkList<AlphaObjectInfo> m_alphaList;
|
||||||
static CLinkList<AlphaObjectInfo> m_alphaBoatAtomicList;
|
//static CLinkList<AlphaObjectInfo> m_alphaBoatAtomicList;
|
||||||
static CLinkList<AlphaObjectInfo> m_alphaEntityList;
|
static CLinkList<AlphaObjectInfo> m_alphaEntityList;
|
||||||
static CLinkList<AlphaObjectInfo> m_alphaUnderwaterEntityList;
|
//static CLinkList<AlphaObjectInfo> m_alphaUnderwaterEntityList;
|
||||||
#ifdef NEW_RENDERER
|
#ifdef NEW_RENDERER
|
||||||
static CLinkList<AlphaObjectInfo> m_alphaBuildingList;
|
static CLinkList<AlphaObjectInfo> m_alphaBuildingList;
|
||||||
#endif
|
#endif
|
||||||
|
@ -35,7 +35,7 @@ public:
|
||||||
static float ms_vehicleFadeDist;
|
static float ms_vehicleFadeDist;
|
||||||
static float ms_bigVehicleLod0Dist;
|
static float ms_bigVehicleLod0Dist;
|
||||||
static float ms_bigVehicleLod1Dist;
|
static float ms_bigVehicleLod1Dist;
|
||||||
static float ms_pedLod1Dist;
|
static float ms_pedLodDist;
|
||||||
static float ms_pedFadeDist;
|
static float ms_pedFadeDist;
|
||||||
|
|
||||||
static void Initialise(void);
|
static void Initialise(void);
|
||||||
|
@ -44,7 +44,7 @@ public:
|
||||||
static bool InsertEntityIntoSortedList(CEntity *e, float dist);
|
static bool InsertEntityIntoSortedList(CEntity *e, float dist);
|
||||||
static void InitAlphaAtomicList(void);
|
static void InitAlphaAtomicList(void);
|
||||||
static bool InsertAtomicIntoSortedList(RpAtomic *a, float dist);
|
static bool InsertAtomicIntoSortedList(RpAtomic *a, float dist);
|
||||||
static bool InsertAtomicIntoBoatSortedList(RpAtomic *a, float dist);
|
// static bool InsertAtomicIntoBoatSortedList(RpAtomic *a, float dist);
|
||||||
|
|
||||||
static void SetRenderWareCamera(RwCamera *camera);
|
static void SetRenderWareCamera(RwCamera *camera);
|
||||||
static void SetupVehicleVariables(RpClump *vehicle);
|
static void SetupVehicleVariables(RpClump *vehicle);
|
||||||
|
@ -52,7 +52,7 @@ public:
|
||||||
static RpAtomic *RenderWheelAtomicCB(RpAtomic *atomic);
|
static RpAtomic *RenderWheelAtomicCB(RpAtomic *atomic);
|
||||||
static RpAtomic *RenderObjNormalAtomic(RpAtomic *atomic);
|
static RpAtomic *RenderObjNormalAtomic(RpAtomic *atomic);
|
||||||
static RpAtomic *RenderAlphaAtomic(RpAtomic *atomic, int alpha);
|
static RpAtomic *RenderAlphaAtomic(RpAtomic *atomic, int alpha);
|
||||||
static RpAtomic *RenderWeaponCB(RpAtomic *atomic);
|
// static RpAtomic *RenderWeaponCB(RpAtomic *atomic);
|
||||||
static RpAtomic *RenderFadingAtomic(RpAtomic *atm, float dist);
|
static RpAtomic *RenderFadingAtomic(RpAtomic *atm, float dist);
|
||||||
|
|
||||||
static RpAtomic *RenderVehicleHiDetailCB(RpAtomic *atomic);
|
static RpAtomic *RenderVehicleHiDetailCB(RpAtomic *atomic);
|
||||||
|
@ -60,7 +60,7 @@ public:
|
||||||
static RpAtomic *RenderVehicleHiDetailCB_BigVehicle(RpAtomic *atomic);
|
static RpAtomic *RenderVehicleHiDetailCB_BigVehicle(RpAtomic *atomic);
|
||||||
static RpAtomic *RenderVehicleHiDetailAlphaCB_BigVehicle(RpAtomic *atomic);
|
static RpAtomic *RenderVehicleHiDetailAlphaCB_BigVehicle(RpAtomic *atomic);
|
||||||
static RpAtomic *RenderVehicleHiDetailCB_Boat(RpAtomic *atomic);
|
static RpAtomic *RenderVehicleHiDetailCB_Boat(RpAtomic *atomic);
|
||||||
static RpAtomic *RenderVehicleHiDetailAlphaCB_Boat(RpAtomic *atomic);
|
// static RpAtomic *RenderVehicleHiDetailAlphaCB_Boat(RpAtomic *atomic);
|
||||||
static RpAtomic *RenderVehicleHiDetailCB_Boat_Far(RpAtomic *atomic);
|
static RpAtomic *RenderVehicleHiDetailCB_Boat_Far(RpAtomic *atomic);
|
||||||
static RpAtomic *RenderVehicleLoDetailCB_Boat(RpAtomic *atomic);
|
static RpAtomic *RenderVehicleLoDetailCB_Boat(RpAtomic *atomic);
|
||||||
static RpAtomic *RenderVehicleLoDetailCB_Boat_Far(RpAtomic *atomic);
|
static RpAtomic *RenderVehicleLoDetailCB_Boat_Far(RpAtomic *atomic);
|
||||||
|
@ -73,12 +73,12 @@ public:
|
||||||
static RpAtomic *RenderVehicleRotorAlphaCB(RpAtomic *atomic);
|
static RpAtomic *RenderVehicleRotorAlphaCB(RpAtomic *atomic);
|
||||||
static RpAtomic *RenderVehicleTailRotorAlphaCB(RpAtomic *atomic);
|
static RpAtomic *RenderVehicleTailRotorAlphaCB(RpAtomic *atomic);
|
||||||
|
|
||||||
static RpAtomic *RenderPlayerCB(RpAtomic *atomic);
|
// static RpAtomic *RenderPlayerCB(RpAtomic *atomic);
|
||||||
static RpAtomic *RenderPedCB(RpAtomic *atomic); // for skinned models with only one clump
|
static RpAtomic *RenderPedCB(RpAtomic *atomic); // for skinned models with only one clump
|
||||||
|
|
||||||
static void RenderAtomicList(CLinkList<AlphaObjectInfo> &list);
|
static void RenderAtomicList(CLinkList<AlphaObjectInfo> &list);
|
||||||
static void RenderAlphaAtomics(void);
|
static void RenderAlphaAtomics(void);
|
||||||
static void RenderBoatAlphaAtomics(void);
|
// static void RenderBoatAlphaAtomics(void);
|
||||||
static void RenderFadingEntities(CLinkList<AlphaObjectInfo> &list);
|
static void RenderFadingEntities(CLinkList<AlphaObjectInfo> &list);
|
||||||
static void RenderFadingEntities(void);
|
static void RenderFadingEntities(void);
|
||||||
static void RenderFadingUnderwaterEntities(void);
|
static void RenderFadingUnderwaterEntities(void);
|
||||||
|
@ -86,6 +86,7 @@ public:
|
||||||
// All actually unused
|
// All actually unused
|
||||||
static bool DefaultVisibilityCB(RpClump *clump);
|
static bool DefaultVisibilityCB(RpClump *clump);
|
||||||
static bool FrustumSphereCB(RpClump *clump);
|
static bool FrustumSphereCB(RpClump *clump);
|
||||||
|
static bool MloVisibilityCB(RpClump *clump);
|
||||||
static bool VehicleVisibilityCB(RpClump *clump);
|
static bool VehicleVisibilityCB(RpClump *clump);
|
||||||
static bool VehicleVisibilityCB_BigVehicle(RpClump *clump);
|
static bool VehicleVisibilityCB_BigVehicle(RpClump *clump);
|
||||||
|
|
||||||
|
@ -100,15 +101,19 @@ public:
|
||||||
struct AtomicExt
|
struct AtomicExt
|
||||||
{
|
{
|
||||||
union {
|
union {
|
||||||
CSimpleModelInfo *modelInfo; // used by SimpleModelInfo
|
int16 modelId; // used by SimpleModelInfo
|
||||||
int flags; // used by ClumpModelInfo
|
int flags; // used by ClumpModelInfo
|
||||||
};
|
};
|
||||||
int distanceAlpha; // not sure where this is in PS2/PSP LCS
|
#ifdef VIS_DISTANCE_ALPHA
|
||||||
|
int distanceAlpha;
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
static void SetAtomicModelInfo(RpAtomic*, CSimpleModelInfo*);
|
static void SetAtomicModelInfo(RpAtomic*, CSimpleModelInfo*);
|
||||||
|
static void SetAtomicModelIndex(RpAtomic *atomic, int modelId);
|
||||||
static CSimpleModelInfo *GetAtomicModelInfo(RpAtomic *atomic);
|
static CSimpleModelInfo *GetAtomicModelInfo(RpAtomic *atomic);
|
||||||
static void SetAtomicFlag(RpAtomic*, int);
|
static void SetAtomicFlag(RpAtomic*, int);
|
||||||
static void ClearAtomicFlag(RpAtomic*, int);
|
static void ClearAtomicFlag(RpAtomic*, int);
|
||||||
|
static void SetAtomicId(RpAtomic *atomic, int);
|
||||||
static int GetAtomicId(RpAtomic *atomic);
|
static int GetAtomicId(RpAtomic *atomic);
|
||||||
static void SetAtomicRenderCallback(RpAtomic*, RpAtomicCallBackRender);
|
static void SetAtomicRenderCallback(RpAtomic*, RpAtomicCallBackRender);
|
||||||
|
|
||||||
|
@ -138,8 +143,10 @@ public:
|
||||||
int alpha;
|
int alpha;
|
||||||
};
|
};
|
||||||
static void SetClumpModelInfo(RpClump*, CClumpModelInfo*);
|
static void SetClumpModelInfo(RpClump*, CClumpModelInfo*);
|
||||||
|
static CClumpModelInfo *GetClumpModelInfo(RpClump*);
|
||||||
static void SetClumpAlpha(RpClump*, int);
|
static void SetClumpAlpha(RpClump*, int);
|
||||||
static int GetClumpAlpha(RpClump*);
|
static int GetClumpAlpha(RpClump*);
|
||||||
|
static bool IsClumpVisible(RpClump*);
|
||||||
static void SetClumpDistanceAlpha(RpClump*, int);
|
static void SetClumpDistanceAlpha(RpClump*, int);
|
||||||
static int GetClumpDistanceAlpha(RpClump*);
|
static int GetClumpDistanceAlpha(RpClump*);
|
||||||
|
|
||||||
|
@ -149,8 +156,10 @@ public:
|
||||||
int32 offset, int32 len);
|
int32 offset, int32 len);
|
||||||
static int32 ms_clumpPluginOffset;
|
static int32 ms_clumpPluginOffset;
|
||||||
|
|
||||||
|
#ifdef VIS_DISTANCE_ALPHA
|
||||||
static void SetObjectDistanceAlpha(RwObject *object, int alpha);
|
static void SetObjectDistanceAlpha(RwObject *object, int alpha);
|
||||||
static int GetObjectDistanceAlpha(RwObject *object);
|
static int GetObjectDistanceAlpha(RwObject *object);
|
||||||
|
#endif
|
||||||
|
|
||||||
static bool PluginAttach(void);
|
static bool PluginAttach(void);
|
||||||
};
|
};
|
||||||
|
|
|
@ -681,6 +681,12 @@ CPlane::Render(void)
|
||||||
CEntity::Render();
|
CEntity::Render();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
CPlane::RenderAllRemaning(void)
|
||||||
|
{
|
||||||
|
// TODO(LCS)
|
||||||
|
}
|
||||||
|
|
||||||
#define CRUISE_SPEED (50.0f)
|
#define CRUISE_SPEED (50.0f)
|
||||||
#define TAXI_SPEED (5.0f)
|
#define TAXI_SPEED (5.0f)
|
||||||
|
|
||||||
|
|
|
@ -59,6 +59,7 @@ public:
|
||||||
void Render(void);
|
void Render(void);
|
||||||
void FlagToDestroyWhenNextProcessed() { bRemoveFromWorld = true; }
|
void FlagToDestroyWhenNextProcessed() { bRemoveFromWorld = true; }
|
||||||
|
|
||||||
|
static void RenderAllRemaning(void);
|
||||||
static void InitPlanes(void);
|
static void InitPlanes(void);
|
||||||
static void Shutdown(void);
|
static void Shutdown(void);
|
||||||
static CPlaneNode *LoadPath(char const *filename, int32 &numNodes, float &totalLength, bool loop);
|
static CPlaneNode *LoadPath(char const *filename, int32 &numNodes, float &totalLength, bool loop);
|
||||||
|
|
Loading…
Reference in a new issue