From af2e764d81d6a5981bab0a0d1fd0c79cf2465f69 Mon Sep 17 00:00:00 2001 From: aap Date: Sun, 30 Jun 2019 21:06:55 +0200 Subject: finished CEntity --- src/render/2dEffect.h | 34 ++++++++++++++++++++++++++++++---- src/render/Glass.cpp | 2 ++ src/render/Glass.h | 1 + src/render/PointLights.cpp | 6 ++---- src/render/PointLights.h | 6 ++++-- src/render/Shadows.cpp | 12 +++++++++++- src/render/Shadows.h | 12 +++++++++++- src/render/SpecialFX.cpp | 2 ++ src/render/SpecialFX.h | 6 ++++++ 9 files changed, 69 insertions(+), 12 deletions(-) (limited to 'src/render') diff --git a/src/render/2dEffect.h b/src/render/2dEffect.h index 780d9b4f..1610f908 100644 --- a/src/render/2dEffect.h +++ b/src/render/2dEffect.h @@ -4,19 +4,45 @@ enum { EFFECT_ATTRACTOR }; +enum { + LIGHT_ON, + LIGHT_ON_NIGHT, + LIGHT_FLICKER, + LIGHT_FLICKER_NIGHT, + LIGHT_FLASH1, + LIGHT_FLASH1_NIGHT, + LIGHT_FLASH2, + LIGHT_FLASH2_NIGHT, + LIGHT_FLASH3, + LIGHT_FLASH3_NIGHT, + LIGHT_RANDOM_FLICKER, + LIGHT_RANDOM_FLICKER_NIGHT, + LIGHT_SPECIAL, + LIGHT_BRIDGE_FLASH1, + LIGHT_BRIDGE_FLASH2, +}; + +enum { + LIGHTFLAG_LOSCHECK = 1, + // same order as CPointLights flags, must start at 2 + LIGHTFLAG_FOG_NORMAL = 2, // can have light and fog + LIGHTFLAG_FOG_ALWAYS = 4, // fog only + LIGHTFLAG_FOG = (LIGHTFLAG_FOG_NORMAL|LIGHTFLAG_FOG_ALWAYS) +}; + class C2dEffect { public: struct Light { float dist; - float outerRange; + float range; // of pointlight float size; - float innerRange; - uint8 flash; + float shadowRange; + uint8 lightType; // LIGHT_ uint8 roadReflection; uint8 flareType; uint8 shadowIntensity; - uint8 flags; + uint8 flags; // LIGHTFLAG_ RwTexture *corona; RwTexture *shadow; }; diff --git a/src/render/Glass.cpp b/src/render/Glass.cpp index aba8f9e0..9a233584 100644 --- a/src/render/Glass.cpp +++ b/src/render/Glass.cpp @@ -2,6 +2,8 @@ #include "patcher.h" #include "Glass.h" +WRAPPER void CGlass::AskForObjectToBeRenderedInGlass(CEntity *ent) { EAXJMP(0x5033F0); } + WRAPPER void CGlass::WindowRespondsToCollision(CEntity *ent, float amount, CVector speed, CVector point, bool foo) { diff --git a/src/render/Glass.h b/src/render/Glass.h index 460c4548..60592c39 100644 --- a/src/render/Glass.h +++ b/src/render/Glass.h @@ -5,6 +5,7 @@ class CEntity; class CGlass { public: + static void AskForObjectToBeRenderedInGlass(CEntity *ent); static void WindowRespondsToCollision(CEntity *ent, float amount, CVector speed, CVector point, bool foo); static void WindowRespondsToSoftCollision(CEntity *ent, float amount); static void Render(void); diff --git a/src/render/PointLights.cpp b/src/render/PointLights.cpp index 2b840314..9e98a327 100644 --- a/src/render/PointLights.cpp +++ b/src/render/PointLights.cpp @@ -13,8 +13,6 @@ int16 &CPointLights::NumLights = *(int16*)0x95CC3E; CRegisteredPointLight *CPointLights::aLights = (CRegisteredPointLight*)0x7096D0; -//WRAPPER void CPointLights::RenderFogEffect(void) { EAXJMP(0x510C30); } - void CPointLights::InitPerFrame(void) { @@ -69,7 +67,7 @@ CPointLights::GenerateLightsAffectingObject(CVector *objCoors) ret = 1.0f; for(i = 0; i < NumLights; i++){ - if(aLights[i].type == LIGHT_FOGONLY_3 || aLights[i].type == LIGHT_FOGONLY_4) + if(aLights[i].type == LIGHT_FOGONLY || aLights[i].type == LIGHT_FOGONLY_ALWAYS) continue; // same weird distance calculation. simplified here @@ -235,7 +233,7 @@ CPointLights::RenderFogEffect(void) } } - }else if(aLights[i].type == LIGHT_POINT || aLights[i].type == LIGHT_FOGONLY_3 || aLights[i].type == LIGHT_FOGONLY_4){ + }else if(aLights[i].type == LIGHT_POINT || aLights[i].type == LIGHT_FOGONLY || aLights[i].type == LIGHT_FOGONLY_ALWAYS){ if(CWorld::ProcessVerticalLine(aLights[i].coors, aLights[i].coors.z - 20.0f, point, entity, true, false, false, false, true, false, nil)){ diff --git a/src/render/PointLights.h b/src/render/PointLights.h index 288571d0..c350e4c8 100644 --- a/src/render/PointLights.h +++ b/src/render/PointLights.h @@ -26,8 +26,10 @@ public: LIGHT_DIRECTIONAL, LIGHT_DARKEN, // no effects at all // these have only fog, otherwise no difference? - LIGHT_FOGONLY_3, - LIGHT_FOGONLY_4, + // only used by CEntity::ProcessLightsForEntity it seems + // and there used together with fog type + LIGHT_FOGONLY_ALWAYS, + LIGHT_FOGONLY, }; enum { FOG_NONE, diff --git a/src/render/Shadows.cpp b/src/render/Shadows.cpp index cb5cedfb..0852938f 100644 --- a/src/render/Shadows.cpp +++ b/src/render/Shadows.cpp @@ -7,6 +7,16 @@ 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::StoreShadowForPole(CEntity *ent, float offsetX, float offsetY, float offsetZ, float poleHeight, float poleWidth, uint32 subId) { EAXJMP(0x513E10); } WRAPPER void CShadows::StoreShadowForPedObject(CEntity *ent, float dispX, float dispY, float frontX, float frontY, float sideX, float sideY) { EAXJMP(0x513CB0); } +WRAPPER void CShadows::StoreStaticShadow(uint32 id, uint8 type, RwTexture *texture, CVector *coors, float frontX, float frontY, float sideX, float sideY, int16 intensity, uint8 red, uint8 green, uint8 blue, float zDistance, float scale, float drawDistance, bool temporaryShadow, float upDistance) { EAXJMP(0x5130A0); } +WRAPPER void CShadows::StoreShadowToBeRendered(uint8 type, RwTexture *texture, CVector *coors, float frontX, float frontY, float sideX, float sideY, int16 intensity, uint8 red, uint8 green, uint8 blue, float zDistance, bool drawOnWater, float upDistance) { EAXJMP(0x513750); } -RwTexture*& gpBloodPoolTex = *(RwTexture * *)0x9415F8; \ No newline at end of file +RwTexture *&gpBloodPoolTex = *(RwTexture**)0x9415F8; +RwTexture *&gpShadowExplosionTex = *(RwTexture**)0x8F2A00; + +void +CShadows::StoreShadowForTree(CEntity *ent) +{ + // empty +} diff --git a/src/render/Shadows.h b/src/render/Shadows.h index 2a41f81e..37749de4 100644 --- a/src/render/Shadows.h +++ b/src/render/Shadows.h @@ -3,6 +3,11 @@ struct RwTexture; class CEntity; +enum +{ + SHADOWTYPE_2 = 2 +}; + class CShadows { public: @@ -11,7 +16,12 @@ 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 StoreShadowForTree(CEntity *ent); + static void StoreShadowForPole(CEntity *ent, float offsetX, float offsetY, float offsetZ, float poleHeight, float poleWidth, uint32 subId); static void StoreShadowForPedObject(CEntity *ent, float dispX, float dispY, float frontX, float frontY, float sideX, float sideY); + static void StoreStaticShadow(uint32 id, uint8 type, RwTexture *texture, CVector *coors, float frontX, float frontY, float sideX, float sideY, int16 intensity, uint8 red, uint8 green, uint8 blue, float zDistance, float scale, float drawDistance, bool temporaryShadow, float upDistance);; + static void StoreShadowToBeRendered(uint8 type, RwTexture *texture, CVector *coors, float frontX, float frontY, float sideX, float sideY, int16 intensity, uint8 red, uint8 green, uint8 blue, float zDistance, bool drawOnWater, float upDistance); }; -extern RwTexture*& gpBloodPoolTex; +extern RwTexture *&gpBloodPoolTex; +extern RwTexture *&gpShadowExplosionTex; diff --git a/src/render/SpecialFX.cpp b/src/render/SpecialFX.cpp index 3aa60f2f..32923b12 100644 --- a/src/render/SpecialFX.cpp +++ b/src/render/SpecialFX.cpp @@ -3,3 +3,5 @@ #include "SpecialFX.h" WRAPPER void CSpecialFX::Render(void) { EAXJMP(0x518DC0); } + +WRAPPER void CMotionBlurStreaks::RegisterStreak(int32 id, uint8 r, uint8 g, uint8 b, CVector p1, CVector p2) { EAXJMP(0x519460); } diff --git a/src/render/SpecialFX.h b/src/render/SpecialFX.h index ffa2a90a..1a1a4c1e 100644 --- a/src/render/SpecialFX.h +++ b/src/render/SpecialFX.h @@ -5,3 +5,9 @@ class CSpecialFX public: static void Render(void); }; + +class CMotionBlurStreaks +{ +public: + static void RegisterStreak(int32 id, uint8 r, uint8 g, uint8 b, CVector p1, CVector p2); +}; -- cgit v1.2.3