finished CEntity

This commit is contained in:
aap
2019-06-30 21:06:55 +02:00
parent 6e4df804f7
commit af2e764d81
27 changed files with 665 additions and 76 deletions

View File

@ -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;
};

View File

@ -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)
{

View File

@ -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);

View File

@ -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)){

View File

@ -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,

View File

@ -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;
RwTexture *&gpBloodPoolTex = *(RwTexture**)0x9415F8;
RwTexture *&gpShadowExplosionTex = *(RwTexture**)0x8F2A00;
void
CShadows::StoreShadowForTree(CEntity *ent)
{
// empty
}

View File

@ -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;

View File

@ -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); }

View File

@ -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);
};