This commit is contained in:
Fire-Head 2019-07-24 20:30:09 +03:00
parent b4ecb3e3da
commit 0c0e564019
7 changed files with 20 additions and 41 deletions

View file

@ -441,7 +441,7 @@ int m_iModeObbeCamIsInForCar;
static bool &m_bUseMouse3rdPerson;
CMatrix &GetCameraMatrix(void) { return m_cameraMatrix; }
inline const CMatrix GetCameraMatrix(void) { return m_cameraMatrix; }
CVector &GetGameCamPosition(void) { return m_vecGameCamPos; }
bool IsPointVisible(const CVector &center, const CMatrix *mat);
bool IsSphereVisible(const CVector &center, float radius, const CMatrix *mat);

View file

@ -501,7 +501,7 @@ void
DisplayGameDebugText()
{
static bool bDisplayPosn = false;
static bool bDisplayRate = false;
static bool bDisplayRate = false;
{
SETTWEAKPATH("GameDebugText");

View file

@ -190,21 +190,6 @@ void CTweakVars::AddDBG(const char *path)
bAddTweakVarsNow = true;
}
//inline DebugMenuEntry * DebugMenuAddVar (const char *path , name, ptr, trig, step, lowerBound, upperBound, const char **strings)
/*
inline DebugMenuEntry *
DebugMenuAddVar
(const char *path,
const char *name,
int8_t *ptr,
TriggerFunc triggerFunc,
int8_t step,
int8_t lowerBound,
int8_t upperBound,
const char **strings)
*/
void CTweakSwitch::AddDBG(const char *path)
{
DebugMenuEntry *e = DebugMenuAddVar(m_pPath == NULL ? path : m_pPath, m_pVarName, (int32_t *)m_pIntVar, m_pFunc, 1, m_nMin, m_nMax, m_aStr);
@ -232,7 +217,7 @@ TWEAKSWITCH(CWeather::NewWeatherType, 0, 3, wt, NULL);
void
DebugMenuPopulate(void)
{
{
if(DebugMenuLoad()){
static const char *weathers[] = {
"Sunny", "Cloudy", "Rainy", "Foggy"

View file

@ -405,7 +405,7 @@ CEntity::PreRender(void)
}else if(GetModelIndex() == MI_MISSILE){
CVector pos = GetPosition();
float flicker = (CGeneral::GetRandomNumber() & 0xF)/(float)0x10;
CShadows::StoreShadowToBeRendered(SHADOWTYPE_2,
CShadows::StoreShadowToBeRendered(SHADOWTYPE_ADDITIVE,
gpShadowExplosionTex, &pos,
8.0f, 0.0f, 0.0f, -8.0f,
255, 200.0f*flicker, 160.0f*flicker, 120.0f*flicker,
@ -758,7 +758,7 @@ CEntity::ProcessLightsForEntity(void)
// Light shadow
if(effect->light.shadowRange != 0.0f){
if(lightOn){
CShadows::StoreStaticShadow((uintptr)this + i, SHADOWTYPE_2,
CShadows::StoreStaticShadow((uintptr)this + i, SHADOWTYPE_ADDITIVE,
effect->light.shadow, &pos,
effect->light.shadowRange, 0.0f,
0.0f, -effect->light.shadowRange,
@ -768,7 +768,7 @@ CEntity::ProcessLightsForEntity(void)
effect->col.b*CTimeCycle::GetSpriteBrightness()*effect->light.shadowIntensity/255.0f,
15.0f, 1.0f, 40.0f, false, 0.0f);
}else if(lightFlickering){
CShadows::StoreStaticShadow((uintptr)this + i, SHADOWTYPE_2,
CShadows::StoreStaticShadow((uintptr)this + i, SHADOWTYPE_ADDITIVE,
effect->light.shadow, &pos,
effect->light.shadowRange, 0.0f,
0.0f, -effect->light.shadowRange,

View file

@ -9,17 +9,12 @@
struct RwTexture;
class CEntity;
enum
{
SHADOWTYPE_2 = 2
};
enum eShadowType
{
SHADOWTYPE_NONE = 0,
SHADOWTYPE_DARK,
SHADOWTYPE_ADDITIVE,
SHADOWTYPE_INVCOLOR
SHADOWTYPE_DARK,
SHADOWTYPE_ADDITIVE,
SHADOWTYPE_INVCOLOR
};
enum eShadowTextureType

View file

@ -323,7 +323,7 @@ _GetCamBounds(bool *bUseCamStartY, bool *bUseCamEndY, bool *bUseCamStartX, bool
}
}
float
inline float
SectorRadius(float fSize)
{
return Sqrt(Pow(fSize, 2) + Pow(fSize, 2));
@ -424,7 +424,7 @@ CWaterLevel::RenderWater()
if ( fHugeSectorMaxRenderDistSqr > fHugeSectorDistToCamSqr )
{
if ( TheCamera.IsSphereVisible(CVector(vecHugeSectorCentre.x, vecHugeSectorCentre.y, 0.0f), SectorRadius(HUGE_SECTOR_SIZE),
&CMatrix(TheCamera.GetCameraMatrix())) )
&TheCamera.GetCameraMatrix()) )
{
if ( fHugeSectorDistToCamSqr >= SQR(500.0f) /*fHugeSectorNearDist*/ )
{
@ -466,7 +466,7 @@ CWaterLevel::RenderWater()
if ( fLargeSectorDistToCamSqr < fHugeSectorMaxRenderDistSqr )
{
if ( TheCamera.IsSphereVisible(CVector(vecLargeSectorCentre.x, vecLargeSectorCentre.y, 0.0f), SectorRadius(LARGE_SECTOR_SIZE), //90.879997f,
&CMatrix(TheCamera.GetCameraMatrix())) )
&TheCamera.GetCameraMatrix()) )
{
// Render four small(32x32) sectors, or one large(64x64).
@ -629,7 +629,7 @@ CWaterLevel::RenderWater()
if ( fCamDistToSector < fHugeSectorMaxRenderDistSqr )
{
if ( TheCamera.IsSphereVisible(CVector(vecExtraHugeSectorCentre.x, vecExtraHugeSectorCentre.y, 0.0f), SectorRadius(EXTRAHUGE_SECTOR_SIZE),
&CMatrix(TheCamera.GetCameraMatrix())) )
&TheCamera.GetCameraMatrix()) )
{
RenderOneFlatExtraHugeWaterPoly(
vecExtraHugeSectorCentre.x - EXTRAHUGE_SECTOR_SIZE/2,
@ -663,7 +663,7 @@ CWaterLevel::RenderWater()
if ( fCamDistToSector < fHugeSectorMaxRenderDistSqr )
{
if ( TheCamera.IsSphereVisible(CVector(vecExtraHugeSectorCentre.x, vecExtraHugeSectorCentre.y, 0.0f), SectorRadius(EXTRAHUGE_SECTOR_SIZE),
&CMatrix(TheCamera.GetCameraMatrix())) )
&TheCamera.GetCameraMatrix()) )
{
RenderOneFlatExtraHugeWaterPoly(
vecExtraHugeSectorCentre.x - EXTRAHUGE_SECTOR_SIZE/2,
@ -687,7 +687,7 @@ CWaterLevel::RenderWater()
if ( fCamDistToSector < fHugeSectorMaxRenderDistSqr )
{
if ( TheCamera.IsSphereVisible(CVector(vecExtraHugeSectorCentre.x, vecExtraHugeSectorCentre.y, 0.0f), SectorRadius(EXTRAHUGE_SECTOR_SIZE),
&CMatrix(TheCamera.GetCameraMatrix())) )
&TheCamera.GetCameraMatrix()) )
{
RenderOneFlatExtraHugeWaterPoly(
vecExtraHugeSectorCentre.x - EXTRAHUGE_SECTOR_SIZE/2,

View file

@ -37,8 +37,8 @@ bool CBoat::IsSectorAffectedByWake(CVector2D sector, float fSize, CBoat **apBoat
{
float fDist = (WAKE_LIFETIME - pBoat->m_afWakePointLifeTime[j]) * fShapeTime + float(j) * fShapeLength + fSize;
if ( fabs(pBoat->m_avec2dWakePoints[j].x - sector.x) < fDist
&& fabs(pBoat->m_avec2dWakePoints[i].y - sector.y) < fDist )
if ( Abs(pBoat->m_avec2dWakePoints[j].x - sector.x) < fDist
&& Abs(pBoat->m_avec2dWakePoints[i].y - sector.y) < fDist )
{
apBoats[numVerts] = pBoat;
numVerts = 1; // += ?
@ -56,13 +56,12 @@ float CBoat::IsVertexAffectedByWake(CVector vecVertex, CBoat *pBoat)
{
float fMaxDist = (WAKE_LIFETIME - pBoat->m_afWakePointLifeTime[i]) * fShapeTime + float(i) * fShapeLength;
float fX = pBoat->m_avec2dWakePoints[i].x - vecVertex.x;
float fY = pBoat->m_avec2dWakePoints[i].y - vecVertex.y;
CVector2D vecDist = pBoat->m_avec2dWakePoints[i] - CVector2D(vecVertex);
float fDist = fY * fY + fX * fX;
float fDist = vecDist.MagnitudeSqr();
if ( fDist < SQR(fMaxDist) )
return 1.0f - min(fRangeMult * sqrt(fDist / SQR(fMaxDist)) + (WAKE_LIFETIME - pBoat->m_afWakePointLifeTime[i]) * fTimeMult, 1.0f);
return 1.0f - min(fRangeMult * Sqrt(fDist / SQR(fMaxDist)) + (WAKE_LIFETIME - pBoat->m_afWakePointLifeTime[i]) * fTimeMult, 1.0f);
}
return 0.0f;