implemented CutsceneObject; little fixes

This commit is contained in:
aap
2019-06-12 21:17:02 +02:00
parent a9517c01af
commit 9703ef9b59
12 changed files with 137 additions and 12 deletions

View File

@ -16,6 +16,7 @@
#include "ModelIndices.h"
#include "Streaming.h"
#include "Shadows.h"
#include "PointLights.h"
#include "Renderer.h"
bool gbShowPedRoadGroups;
@ -1153,6 +1154,16 @@ CRenderer::IsVehicleCullZoneVisible(CEntity *ent)
return true;
}
void
CRenderer::RemoveVehiclePedLights(CEntity *ent, bool reset)
{
if(ent->bRenderScorched)
WorldReplaceScorchedLightsWithNormal(Scene.world);
CPointLights::RemoveLightsAffectingObject();
if(reset)
ReSetAmbientAndDirectionalColours();
}
STARTPATCHES
InjectHook(0x4A7680, CRenderer::Init, PATCH_JUMP);
@ -1185,4 +1196,6 @@ STARTPATCHES
InjectHook(0x4A9840, CRenderer::ShouldModelBeStreamed, PATCH_JUMP);
InjectHook(0x4AAA00, CRenderer::IsEntityCullZoneVisible, PATCH_JUMP);
InjectHook(0x4AAAA0, CRenderer::IsVehicleCullZoneVisible, PATCH_JUMP);
InjectHook(0x4A7CF0, CRenderer::RemoveVehiclePedLights, PATCH_JUMP);
ENDPATCHES

View File

@ -56,4 +56,6 @@ public:
static bool ShouldModelBeStreamed(CEntity *ent);
static bool IsEntityCullZoneVisible(CEntity *ent);
static bool IsVehicleCullZoneVisible(CEntity *ent);
static void RemoveVehiclePedLights(CEntity *ent, bool reset);
};

View File

@ -6,4 +6,5 @@ WRAPPER void CShadows::AddPermanentShadow(unsigned char ShadowType, RwTexture* p
WRAPPER void CShadows::RenderStaticShadows(void) { EAXJMP(0x5145F0); }
WRAPPER void CShadows::RenderStoredShadows(void) { EAXJMP(0x514010); }
WRAPPER void CShadows::RenderExtraPlayerShadows(void) { EAXJMP(0x516F90); }
WRAPPER void CShadows::CalcPedShadowValues(CVector light, float *frontX, float *frontY, float *sideX, float *sideY, float *dispX, float *dispY) { EAXJMP(0x516EB0); }
WRAPPER void CShadows::CalcPedShadowValues(CVector light, float *frontX, float *frontY, float *sideX, float *sideY, float *dispX, float *dispY) { EAXJMP(0x516EB0); }
WRAPPER void CShadows::StoreShadowForPedObject(CEntity *ent, float dispX, float dispY, float frontX, float frontY, float sideX, float sideY) { EAXJMP(0x513CB0); }

View File

@ -1,6 +1,7 @@
#pragma once
struct RwTexture;
class CEntity;
class CShadows
{
@ -10,4 +11,5 @@ public:
static void RenderStoredShadows(void);
static void RenderExtraPlayerShadows(void);
static void CalcPedShadowValues(CVector light, float *frontX, float *frontY, float *sideX, float *sideY, float *dispX, float *dispY);
static void StoreShadowForPedObject(CEntity *ent, float dispX, float dispY, float frontX, float frontY, float sideX, float sideY);
};

View File

@ -145,7 +145,7 @@ CSprite2d::Draw(const CRect &rect, const CRGBA &c0, const CRGBA &c1, const CRGBA
void
CSprite2d::Draw(float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4, const CRGBA &col)
{
SetVertices(x1, y2, x2, y2, x3, y3, x4, y4, col, col, col, col);
SetVertices(x1, y1, x2, y2, x3, y3, x4, y4, col, col, col, col);
SetRenderState();
RwIm2DRenderPrimitive(rwPRIMTYPETRIFAN, CSprite2d::maVertices, 4);
}