1
0
Fork 0
mirror of https://git.rip/DMCA_FUCKER/re3.git synced 2024-12-23 14:50:00 +00:00

lcs particle

This commit is contained in:
Fire-Head 2021-01-13 00:07:24 +03:00
parent 2ce925caba
commit 3648ef4687
17 changed files with 464 additions and 648 deletions

View file

@ -393,7 +393,7 @@ CGameLogic::RestorePlayerStuffDuringResurrection(CPlayerPed *pPlayerPed, CVector
CWorld::Add(pPlayerPed); CWorld::Add(pPlayerPed);
CHud::ResetWastedText(); CHud::ResetWastedText();
CStreaming::StreamZoneModels(pos); CStreaming::StreamZoneModels(pos);
clearWaterDrop = true; //clearWaterDrop = true;
} }
void void

View file

@ -76,7 +76,7 @@
GlobalScene Scene; GlobalScene Scene;
uint8 work_buff[55000]; uint8 work_buff[102400];
char gString[256]; char gString[256];
char gString2[512]; char gString2[512];
wchar gUString[256]; wchar gUString[256];
@ -102,6 +102,7 @@ float NumberOfChunksLoaded;
bool g_SlowMode = false; bool g_SlowMode = false;
char version_name[64]; char version_name[64];
bool gMakeResources = true;
void GameInit(void); void GameInit(void);
void SystemInit(void); void SystemInit(void);

View file

@ -7,7 +7,7 @@ struct GlobalScene
}; };
extern GlobalScene Scene; extern GlobalScene Scene;
extern uint8 work_buff[55000]; extern uint8 work_buff[102400];
extern char gString[256]; extern char gString[256];
extern char gString2[512]; extern char gString2[512];
extern wchar gUString[256]; extern wchar gUString[256];
@ -24,6 +24,8 @@ extern bool gbShowTimebars;
extern bool gbPrintMemoryUsage; extern bool gbPrintMemoryUsage;
#endif #endif
extern bool gMakeResources;
class CSprite2d; class CSprite2d;
bool DoRWStuffStartOfFrame(int16 TopRed, int16 TopGreen, int16 TopBlue, int16 BottomRed, int16 BottomGreen, int16 BottomBlue, int16 Alpha); bool DoRWStuffStartOfFrame(int16 TopRed, int16 TopGreen, int16 TopBlue, int16 BottomRed, int16 BottomGreen, int16 BottomBlue, int16 Alpha);

View file

@ -1139,11 +1139,11 @@ CVehicleModelInfo::LoadEnvironmentMaps(void)
txdslot = CTxdStore::FindTxdSlot("particle"); txdslot = CTxdStore::FindTxdSlot("particle");
CTxdStore::PushCurrentTxd(); CTxdStore::PushCurrentTxd();
CTxdStore::SetCurrentTxd(txdslot); CTxdStore::SetCurrentTxd(txdslot);
if(gpWhiteTexture == nil){ /*if(gpWhiteTexture == nil){
gpWhiteTexture = RwTextureRead("white", nil); gpWhiteTexture = RwTextureRead("white", nil);
RwTextureGetName(gpWhiteTexture)[0] = '@'; RwTextureGetName(gpWhiteTexture)[0] = '@';
RwTextureSetFilterMode(gpWhiteTexture, rwFILTERLINEAR); RwTextureSetFilterMode(gpWhiteTexture, rwFILTERLINEAR);
} }*/
CTxdStore::PopCurrentTxd(); CTxdStore::PopCurrentTxd();
} }

View file

@ -591,6 +591,8 @@ CMBlur::AddRenderFx(RwCamera *cam, RwRect *rect, float z, FxType type)
void void
CMBlur::OverlayRenderFx(RwCamera *cam, RwRaster *frontBuf) CMBlur::OverlayRenderFx(RwCamera *cam, RwRaster *frontBuf)
{ {
//TODO(LCS)
#if 0
bool drawWaterDrops = false; bool drawWaterDrops = false;
RwIm2DVertex verts[4]; RwIm2DVertex verts[4];
int red = (0.75f*CTimeCycle::GetDirectionalRed() + CTimeCycle::GetAmbientRed())*0.55f * 255; int red = (0.75f*CTimeCycle::GetDirectionalRed() + CTimeCycle::GetAmbientRed())*0.55f * 255;
@ -796,4 +798,5 @@ CMBlur::OverlayRenderFx(RwCamera *cam, RwRaster *frontBuf)
RwRenderStateSet(rwRENDERSTATEZTESTENABLE, (void*)FALSE); RwRenderStateSet(rwRENDERSTATEZTESTENABLE, (void*)FALSE);
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)FALSE); RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)FALSE);
pBufVertCount = 0; pBufVertCount = 0;
#endif
} }

File diff suppressed because it is too large Load diff

View file

@ -18,11 +18,6 @@ public:
uint32 m_nTimeWhenWillBeDestroyed; uint32 m_nTimeWhenWillBeDestroyed;
uint32 m_nTimeWhenColorWillBeChanged; uint32 m_nTimeWhenColorWillBeChanged;
float m_fZGround; float m_fZGround;
CVector m_vecParticleMovementOffset;
int16 m_nCurrentZRotation;
uint16 m_nZRotationTimer;
float m_fCurrentZRadius;
uint16 m_nZRadiusTimer;
uint8 m_nColorIntensity; uint8 m_nColorIntensity;
uint8 m_nAlpha; uint8 m_nAlpha;
float m_fSize; float m_fSize;
@ -35,12 +30,20 @@ public:
uint8 m_nCurrentFrame; uint8 m_nCurrentFrame;
RwRGBA m_Color; RwRGBA m_Color;
CParticle *m_pNext; CParticle *m_pNext;
//CVector m_vecParticleMovementOffset;
//int16 m_nCurrentZRotation;
//uint16 m_nZRotationTimer;
//float m_fCurrentZRadius;
//uint16 m_nZRadiusTimer;
int32 field_4C;
CParticle() CParticle()
{ {
; ;
} }
~CParticle() ~CParticle()
{ {
; ;
@ -97,12 +100,9 @@ public:
static void HandleShootableBirdsStuff(CEntity *entity, CVector const&camPos); static void HandleShootableBirdsStuff(CEntity *entity, CVector const&camPos);
}; };
extern bool clearWaterDrop;
extern int32 numWaterDropOnScreen;
extern RwRaster *gpCarSplashRaster[]; extern RwRaster *gpCarSplashRaster[];
extern RwRaster *gpHeatHazeRaster; extern RwRaster *gpHeatHazeRaster;
extern RwRaster *gpDotRaster;
extern RwRaster *gpRainDripRaster[]; extern RwRaster *gpRainDripRaster[];
extern RwRaster *gpRainDripDarkRaster[]; extern RwRaster *gpRainDripDarkRaster[];
VALIDATE_SIZE(CParticle, 0x58); VALIDATE_SIZE(CParticle, 0x50);

View file

@ -4,18 +4,31 @@
#include "FileMgr.h" #include "FileMgr.h"
#include "ParticleMgr.h" #include "ParticleMgr.h"
// --LCS: File done
cParticleSystemMgr mod_ParticleSystemManager; cParticleSystemMgr mod_ParticleSystemManager;
const char *ParticleFilename = "PARTICLE.CFG"; const char *ParticleFilename = "PARTICLE.CFG";
cParticleSystemMgr::cParticleSystemMgr() cParticleSystemMgr::cParticleSystemMgr()
{ {
memset(this, 0, sizeof(*this)); #ifdef FIX_BUGS
m_aParticles = nil;
#endif
}
cParticleSystemMgr::~cParticleSystemMgr()
{
#ifdef FIX_BUGS
if ( m_aParticles )
delete [] m_aParticles;
#endif
} }
void cParticleSystemMgr::Initialise() void cParticleSystemMgr::Initialise()
{ {
LoadParticleData(); if ( gMakeResources )
LoadParticleData();
for ( int32 i = 0; i < MAX_PARTICLES; i++ ) for ( int32 i = 0; i < MAX_PARTICLES; i++ )
m_aParticles[i].m_pParticles = nil; m_aParticles[i].m_pParticles = nil;
@ -23,20 +36,31 @@ void cParticleSystemMgr::Initialise()
void cParticleSystemMgr::LoadParticleData() void cParticleSystemMgr::LoadParticleData()
{ {
CFileMgr::SetDir("DATA"); #ifdef FIX_BUGS
CFileMgr::LoadFile(ParticleFilename, work_buff, ARRAY_SIZE(work_buff), "r"); if ( m_aParticles )
delete [] m_aParticles;
#endif
m_aParticles = new tParticleSystemData[MAX_PARTICLES];
memset(m_aParticles, 0, sizeof(tParticleSystemData)*MAX_PARTICLES);
CFileMgr::SetDir("Data");
ssize_t len = CFileMgr::LoadFile(ParticleFilename, work_buff, ARRAY_SIZE(work_buff), "r");
CFileMgr::SetDir(""); CFileMgr::SetDir("");
ASSERT(!(len <= 0));
tParticleSystemData *entry = nil; tParticleSystemData *entry = nil;
int32 type = PARTICLE_FIRST; int32 type = PARTICLE_FIRST;
char *buffEnd = (char *)&work_buff[len];
char *lineStart = (char *)work_buff; char *lineStart = (char *)work_buff;
char *lineEnd = lineStart + 1; char *lineEnd = lineStart + 1;
char line[500]; char line[500];
char delims[4]; char delims[4];
while ( true ) while ( lineStart < buffEnd )
{ {
ASSERT(lineStart != nil); ASSERT(lineStart != nil);
ASSERT(lineEnd != nil); ASSERT(lineEnd != nil);

View file

@ -124,15 +124,18 @@ class cParticleSystemMgr
}; };
public: public:
tParticleSystemData m_aParticles[MAX_PARTICLES]; tParticleSystemData *m_aParticles;//[MAX_PARTICLES];
cParticleSystemMgr(); cParticleSystemMgr();
#ifdef FIX_BUGS
~cParticleSystemMgr();
#endif
void Initialise(); void Initialise();
void LoadParticleData(); void LoadParticleData();
void RangeCheck(tParticleSystemData *pData) { } void RangeCheck(tParticleSystemData *pData) { }
}; };
VALIDATE_SIZE(cParticleSystemMgr, 0x2FFC); VALIDATE_SIZE(cParticleSystemMgr, 0x4);
extern cParticleSystemMgr mod_ParticleSystemManager; extern cParticleSystemMgr mod_ParticleSystemManager;

View file

@ -42,8 +42,6 @@ enum tParticleType
PARTICLE_RAIN_SPLASH_BIGGROW, PARTICLE_RAIN_SPLASH_BIGGROW,
PARTICLE_RAIN_SPLASHUP, PARTICLE_RAIN_SPLASHUP,
PARTICLE_WATERSPRAY, PARTICLE_WATERSPRAY,
PARTICLE_WATERDROP,
PARTICLE_BLOODDROP,
PARTICLE_EXPLOSION_MEDIUM, PARTICLE_EXPLOSION_MEDIUM,
PARTICLE_EXPLOSION_LARGE, PARTICLE_EXPLOSION_LARGE,
PARTICLE_EXPLOSION_MFAST, PARTICLE_EXPLOSION_MFAST,
@ -83,10 +81,11 @@ enum tParticleType
PARTICLE_SHIP_SIDE, PARTICLE_SHIP_SIDE,
PARTICLE_BEASTIE, PARTICLE_BEASTIE,
PARTICLE_RAINDROP_2D, PARTICLE_RAINDROP_2D,
PARTICLE_HEATHAZE, PARTICLE_FERRY_CHIM_SMOKE,
PARTICLE_HEATHAZE_IN_DIST, PARTICLE_MULTIPLAYER_HIT,
PARTICLE_HYDRANT_STEAM,
MAX_PARTICLES, MAX_PARTICLES,
PARTICLE_FIRST = PARTICLE_SPARK, PARTICLE_FIRST = PARTICLE_SPARK,
PARTICLE_LAST = PARTICLE_RAINDROP_2D PARTICLE_LAST = PARTICLE_HYDRANT_STEAM
}; };

View file

@ -10,6 +10,19 @@ float CSprite::m_f2DFarScreenZ;
float CSprite::m_fRecipNearClipPlane; float CSprite::m_fRecipNearClipPlane;
int32 CSprite::m_bFlushSpriteBufferSwitchZTest; int32 CSprite::m_bFlushSpriteBufferSwitchZTest;
float CalcScreenZ(float z)
{
// LCS TODO: check
if ( z == 0.0f )
return CSprite::GetNearScreenZ();
return (z - CDraw::GetNearClipZ())
* (CSprite::GetFarScreenZ() - CSprite::GetNearScreenZ()) * CDraw::GetFarClipZ()
/ ( (CDraw::GetFarClipZ() - CDraw::GetNearClipZ()) * z )
+ CSprite::GetNearScreenZ();
}
float float
CSprite::CalcHorizonCoors(void) CSprite::CalcHorizonCoors(void)
{ {

View file

@ -29,3 +29,5 @@ public:
static void RenderBufferedOneXLUSprite2D_Rotate_Dimension(float x, float y, float w, float h, const RwRGBA &colour, int16 intens, float rotation, uint8 alpha); static void RenderBufferedOneXLUSprite2D_Rotate_Dimension(float x, float y, float w, float h, const RwRGBA &colour, int16 intens, float rotation, uint8 alpha);
}; };
extern float CalcScreenZ(float z);

View file

@ -325,6 +325,7 @@ void CWeather::Update(void)
void CWeather::AddHeatHaze() void CWeather::AddHeatHaze()
{ {
/*
if(TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_TOPDOWN || if(TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_TOPDOWN ||
TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_TOP_DOWN_PED) TheCamera.Cams[TheCamera.ActiveCam].Mode == CCam::MODE_TOP_DOWN_PED)
return; return;
@ -336,6 +337,7 @@ void CWeather::AddHeatHaze()
pos.y = CGeneral::GetRandomNumberInRange(SCREEN_HEIGHT*0.4f, SCREEN_HEIGHT*0.9f); pos.y = CGeneral::GetRandomNumberInRange(SCREEN_HEIGHT*0.4f, SCREEN_HEIGHT*0.9f);
pos.z = 100.0f; pos.z = 100.0f;
CParticle::AddParticle(PARTICLE_HEATHAZE_IN_DIST, pos, CVector(0.0f, 0.0f, 0.0f)); CParticle::AddParticle(PARTICLE_HEATHAZE_IN_DIST, pos, CVector(0.0f, 0.0f, 0.0f));
*/
} }
void CWeather::AddBeastie() void CWeather::AddBeastie()

View file

@ -2037,6 +2037,7 @@ CAutomobile::PreRender(void)
if(DotProduct(GetForward(), camDist) > 0.0f || if(DotProduct(GetForward(), camDist) > 0.0f ||
TheCamera.GetLookDirection() == LOOKING_LEFT || TheCamera.GetLookDirection() == LOOKING_LEFT ||
TheCamera.GetLookDirection() == LOOKING_RIGHT){ TheCamera.GetLookDirection() == LOOKING_RIGHT){
/*
CParticle::AddParticle(PARTICLE_HEATHAZE, pos1, CVector(0.0f, 0.0f, 0.0f)); CParticle::AddParticle(PARTICLE_HEATHAZE, pos1, CVector(0.0f, 0.0f, 0.0f));
if(pHandling->Flags & HANDLING_DBL_EXHAUST) if(pHandling->Flags & HANDLING_DBL_EXHAUST)
CParticle::AddParticle(PARTICLE_HEATHAZE, pos2, CVector(0.0f, 0.0f, 0.0f)); CParticle::AddParticle(PARTICLE_HEATHAZE, pos2, CVector(0.0f, 0.0f, 0.0f));
@ -2044,6 +2045,7 @@ CAutomobile::PreRender(void)
CParticle::AddParticle(PARTICLE_HEATHAZE, pos1, CVector(0.0f, 0.0f, 0.0f)); CParticle::AddParticle(PARTICLE_HEATHAZE, pos1, CVector(0.0f, 0.0f, 0.0f));
if(pHandling->Flags & HANDLING_DBL_EXHAUST) if(pHandling->Flags & HANDLING_DBL_EXHAUST)
CParticle::AddParticle(PARTICLE_HEATHAZE, pos2, CVector(0.0f, 0.0f, 0.0f)); CParticle::AddParticle(PARTICLE_HEATHAZE, pos2, CVector(0.0f, 0.0f, 0.0f));
*/
} }
} }

View file

@ -1724,7 +1724,7 @@ CBike::PreRender(void)
TheCamera.GetLookDirection() == LOOKING_RIGHT) TheCamera.GetLookDirection() == LOOKING_RIGHT)
pos1 -= 0.2f*GetForward(); pos1 -= 0.2f*GetForward();
CParticle::AddParticle(PARTICLE_HEATHAZE, pos1, CVector(0.0f, 0.0f, 0.0f)); //CParticle::AddParticle(PARTICLE_HEATHAZE, pos1, CVector(0.0f, 0.0f, 0.0f));
} }
} }
} }

View file

@ -682,6 +682,7 @@ CBoat::ProcessControl(void)
} }
// Spray waterdrops on screen // Spray waterdrops on screen
/*
if(TheCamera.GetLookingForwardFirstPerson() && FindPlayerVehicle() && FindPlayerVehicle()->IsBoat() && if(TheCamera.GetLookingForwardFirstPerson() && FindPlayerVehicle() && FindPlayerVehicle()->IsBoat() &&
m_nDeltaVolumeUnderWater > 0 && numWaterDropOnScreen < 20){ m_nDeltaVolumeUnderWater > 0 && numWaterDropOnScreen < 20){
CVector dropPos; CVector dropPos;
@ -712,7 +713,7 @@ CBoat::ProcessControl(void)
if(CParticle::AddParticle(PARTICLE_WATERDROP, dropPos, dropDir, nil, if(CParticle::AddParticle(PARTICLE_WATERDROP, dropPos, dropDir, nil,
CGeneral::GetRandomNumberInRange(0.1f, 0.15f), dropColor, 0, 0, frm)) CGeneral::GetRandomNumberInRange(0.1f, 0.15f), dropColor, 0, 0, frm))
numWaterDropOnScreen++; numWaterDropOnScreen++;
} }*/
if(m_fPrevVolumeUnderWater == 0.0f && m_fVolumeUnderWater > 0.0f && GetModelIndex() == MI_SKIMMER){ if(m_fPrevVolumeUnderWater == 0.0f && m_fVolumeUnderWater > 0.0f && GetModelIndex() == MI_SKIMMER){
CVector splashDir(0.0f, 0.0f, 0.25f*speed); CVector splashDir(0.0f, 0.0f, 0.25f*speed);

View file

@ -645,9 +645,9 @@ CWeapon::FireMelee(CEntity *shooter, CVector &fireSource)
CVector dropDir(CGeneral::GetRandomNumberInRange(-0.15f, 0.15f), CGeneral::GetRandomNumberInRange(0.1f, 0.35f), 0.f); CVector dropDir(CGeneral::GetRandomNumberInRange(-0.15f, 0.15f), CGeneral::GetRandomNumberInRange(0.1f, 0.35f), 0.f);
CVector dropPos(CGeneral::GetRandomNumberInRange(SCREEN_STRETCH_X(50.0f), SCREEN_STRETCH_FROM_RIGHT(50.0f)), CVector dropPos(CGeneral::GetRandomNumberInRange(SCREEN_STRETCH_X(50.0f), SCREEN_STRETCH_FROM_RIGHT(50.0f)),
CGeneral::GetRandomNumberInRange(SCREEN_STRETCH_Y(50.0f), SCREEN_STRETCH_FROM_BOTTOM(50.0f)), 1.f); CGeneral::GetRandomNumberInRange(SCREEN_STRETCH_Y(50.0f), SCREEN_STRETCH_FROM_BOTTOM(50.0f)), 1.f);
CParticle::AddParticle(PARTICLE_BLOODDROP, dropPos, dropDir, nil, CGeneral::GetRandomNumberInRange(0.1f, 0.15f), /*CParticle::AddParticle(PARTICLE_BLOODDROP, dropPos, dropDir, nil, CGeneral::GetRandomNumberInRange(0.1f, 0.15f),
CRGBA(0, 0, 0, 0), 0, 0, CGeneral::GetRandomNumber() & 1, 0); CRGBA(0, 0, 0, 0), 0, 0, CGeneral::GetRandomNumber() & 1, 0);
*/
} }
if (info->m_AnimToPlay == ASSOCGRP_KNIFE) if (info->m_AnimToPlay == ASSOCGRP_KNIFE)
{ {
@ -737,7 +737,7 @@ CWeapon::FireMelee(CEntity *shooter, CVector &fireSource)
{ {
nearCar->VehicleDamage(info->m_nDamage * (0.00075f * nearCar->pHandling->fMass), gaTempSphereColPoints[0].pieceB); nearCar->VehicleDamage(info->m_nDamage * (0.00075f * nearCar->pHandling->fMass), gaTempSphereColPoints[0].pieceB);
CParticle::AddParticle(PARTICLE_HEATHAZE, gaTempSphereColPoints[0].point, CVector(0.0f, 0.0f, 0.0f), 0, 0.0f, 0, 0, 0, 0); //CParticle::AddParticle(PARTICLE_HEATHAZE, gaTempSphereColPoints[0].point, CVector(0.0f, 0.0f, 0.0f), 0, 0.0f, 0, 0, 0, 0);
} }
else else
{ {
@ -814,7 +814,7 @@ CWeapon::FireMelee(CEntity *shooter, CVector &fireSource)
CParticle::AddParticle(PARTICLE_SPARK, gaTempSphereColPoints[0].point, 0.1f * gaTempSphereColPoints[0].normal, 0, 0.0f, 0, 0, 0, 0); CParticle::AddParticle(PARTICLE_SPARK, gaTempSphereColPoints[0].point, 0.1f * gaTempSphereColPoints[0].normal, 0, 0.0f, 0, 0, 0, 0);
} }
CParticle::AddParticle(PARTICLE_HEATHAZE, gaTempSphereColPoints[0].point, CVector(0.0f, 0.0f, 0.0f), 0, 0.0f, 0, 0, 0, 0); //CParticle::AddParticle(PARTICLE_HEATHAZE, gaTempSphereColPoints[0].point, CVector(0.0f, 0.0f, 0.0f), 0, 0.0f, 0, 0, 0, 0);
if (!damageEntityRegistered) if (!damageEntityRegistered)
{ {