mirror of
https://git.rip/DMCA_FUCKER/re3.git
synced 2024-12-23 12:30:00 +00:00
Merge pull request #395 from aap/master
fixed questionable RW usage; changed radar mask to PS2 technique
This commit is contained in:
commit
d8cf6258b7
|
@ -3269,7 +3269,7 @@ void
|
||||||
CCamera::SetRwCamera(RwCamera *cam)
|
CCamera::SetRwCamera(RwCamera *cam)
|
||||||
{
|
{
|
||||||
m_pRwCamera = cam;
|
m_pRwCamera = cam;
|
||||||
m_viewMatrix.Attach(&m_pRwCamera->viewMatrix, false);
|
m_viewMatrix.Attach(RwCameraGetViewMatrix(m_pRwCamera), false);
|
||||||
CMBlur::MotionBlurOpen(m_pRwCamera);
|
CMBlur::MotionBlurOpen(m_pRwCamera);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -134,8 +134,8 @@ uint32 &CCutsceneMgr::ms_cutsceneLoadStatus = *(uint32*)0x95CB40;
|
||||||
RpAtomic *
|
RpAtomic *
|
||||||
CalculateBoundingSphereRadiusCB(RpAtomic *atomic, void *data)
|
CalculateBoundingSphereRadiusCB(RpAtomic *atomic, void *data)
|
||||||
{
|
{
|
||||||
float radius = RpAtomicGetBoundingSphereMacro(atomic)->radius;
|
float radius = RpAtomicGetBoundingSphere(atomic)->radius;
|
||||||
RwV3d center = RpAtomicGetBoundingSphereMacro(atomic)->center;
|
RwV3d center = RpAtomicGetBoundingSphere(atomic)->center;
|
||||||
|
|
||||||
for (RwFrame *frame = RpAtomicGetFrame(atomic); RwFrameGetParent(frame); frame = RwFrameGetParent(frame))
|
for (RwFrame *frame = RpAtomicGetFrame(atomic); RwFrameGetParent(frame); frame = RwFrameGetParent(frame))
|
||||||
RwV3dTransformPoints(¢er, ¢er, 1, RwFrameGetMatrix(frame));
|
RwV3dTransformPoints(¢er, ¢er, 1, RwFrameGetMatrix(frame));
|
||||||
|
@ -326,7 +326,7 @@ CCutsceneMgr::CreateCutsceneObject(int modelId)
|
||||||
|
|
||||||
pModelInfo->SetColModel(pColModel);
|
pModelInfo->SetColModel(pColModel);
|
||||||
clump = (RpClump*)pModelInfo->GetRwObject();
|
clump = (RpClump*)pModelInfo->GetRwObject();
|
||||||
assert(RwObjectGetType(clump) == rpCLUMP);
|
assert(RwObjectGetType((RwObject*)clump) == rpCLUMP);
|
||||||
RpClumpForAllAtomics(clump, CalculateBoundingSphereRadiusCB, &radius);
|
RpClumpForAllAtomics(clump, CalculateBoundingSphereRadiusCB, &radius);
|
||||||
|
|
||||||
pColModel->boundingSphere.radius = radius;
|
pColModel->boundingSphere.radius = radius;
|
||||||
|
|
|
@ -311,7 +311,7 @@ CFileLoader::FindRelatedModelInfoCB(RpAtomic *atomic, void *data)
|
||||||
int n;
|
int n;
|
||||||
RpClump *clump = (RpClump*)data;
|
RpClump *clump = (RpClump*)data;
|
||||||
|
|
||||||
nodename = GetFrameNodeName(RpClumpGetFrame(atomic));
|
nodename = GetFrameNodeName(RpAtomicGetFrame(atomic));
|
||||||
GetNameAndLOD(nodename, name, &n);
|
GetNameAndLOD(nodename, name, &n);
|
||||||
mi = (CSimpleModelInfo*)CModelInfo::GetModelInfo(name, nil);
|
mi = (CSimpleModelInfo*)CModelInfo::GetModelInfo(name, nil);
|
||||||
if(mi){
|
if(mi){
|
||||||
|
|
3001
src/core/Radar.cpp
3001
src/core/Radar.cpp
File diff suppressed because it is too large
Load diff
|
@ -275,9 +275,9 @@ CEntity::CreateRwObject(void)
|
||||||
if(IsBuilding())
|
if(IsBuilding())
|
||||||
gBuildings++;
|
gBuildings++;
|
||||||
if(RwObjectGetType(m_rwObject) == rpATOMIC)
|
if(RwObjectGetType(m_rwObject) == rpATOMIC)
|
||||||
m_matrix.AttachRW(RwFrameGetMatrix(RpAtomicGetFrame(m_rwObject)), false);
|
m_matrix.AttachRW(RwFrameGetMatrix(RpAtomicGetFrame((RpAtomic*)m_rwObject)), false);
|
||||||
else if(RwObjectGetType(m_rwObject) == rpCLUMP)
|
else if(RwObjectGetType(m_rwObject) == rpCLUMP)
|
||||||
m_matrix.AttachRW(RwFrameGetMatrix(RpClumpGetFrame(m_rwObject)), false);
|
m_matrix.AttachRW(RwFrameGetMatrix(RpClumpGetFrame((RpClump*)m_rwObject)), false);
|
||||||
mi->AddRef();
|
mi->AddRef();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -290,7 +290,7 @@ CEntity::DeleteRwObject(void)
|
||||||
m_matrix.Detach();
|
m_matrix.Detach();
|
||||||
if(m_rwObject){
|
if(m_rwObject){
|
||||||
if(RwObjectGetType(m_rwObject) == rpATOMIC){
|
if(RwObjectGetType(m_rwObject) == rpATOMIC){
|
||||||
f = RpAtomicGetFrame(m_rwObject);
|
f = RpAtomicGetFrame((RpAtomic*)m_rwObject);
|
||||||
RpAtomicDestroy((RpAtomic*)m_rwObject);
|
RpAtomicDestroy((RpAtomic*)m_rwObject);
|
||||||
RwFrameDestroy(f);
|
RwFrameDestroy(f);
|
||||||
}else if(RwObjectGetType(m_rwObject) == rpCLUMP)
|
}else if(RwObjectGetType(m_rwObject) == rpCLUMP)
|
||||||
|
@ -307,9 +307,9 @@ CEntity::UpdateRwFrame(void)
|
||||||
{
|
{
|
||||||
if(m_rwObject){
|
if(m_rwObject){
|
||||||
if(RwObjectGetType(m_rwObject) == rpATOMIC)
|
if(RwObjectGetType(m_rwObject) == rpATOMIC)
|
||||||
RwFrameUpdateObjects(RpAtomicGetFrame(m_rwObject));
|
RwFrameUpdateObjects(RpAtomicGetFrame((RpAtomic*)m_rwObject));
|
||||||
else if(RwObjectGetType(m_rwObject) == rpCLUMP)
|
else if(RwObjectGetType(m_rwObject) == rpCLUMP)
|
||||||
RwFrameUpdateObjects(RpClumpGetFrame(m_rwObject));
|
RwFrameUpdateObjects(RpClumpGetFrame((RpClump*)m_rwObject));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -482,9 +482,9 @@ CEntity::AttachToRwObject(RwObject *obj)
|
||||||
m_rwObject = obj;
|
m_rwObject = obj;
|
||||||
if(m_rwObject){
|
if(m_rwObject){
|
||||||
if(RwObjectGetType(m_rwObject) == rpATOMIC)
|
if(RwObjectGetType(m_rwObject) == rpATOMIC)
|
||||||
m_matrix.Attach(RwFrameGetMatrix(RpAtomicGetFrame(m_rwObject)), false);
|
m_matrix.Attach(RwFrameGetMatrix(RpAtomicGetFrame((RpAtomic*)m_rwObject)), false);
|
||||||
else if(RwObjectGetType(m_rwObject) == rpCLUMP)
|
else if(RwObjectGetType(m_rwObject) == rpCLUMP)
|
||||||
m_matrix.Attach(RwFrameGetMatrix(RpClumpGetFrame(m_rwObject)), false);
|
m_matrix.Attach(RwFrameGetMatrix(RpClumpGetFrame((RpClump*)m_rwObject)), false);
|
||||||
CModelInfo::GetModelInfo(m_modelIndex)->AddRef();
|
CModelInfo::GetModelInfo(m_modelIndex)->AddRef();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -216,7 +216,7 @@ CPedModelInfo::AnimatePedColModel(CColModel* colmodel, RwFrame* frame)
|
||||||
RwMatrixCopy(mat, RwFrameGetMatrix(f));
|
RwMatrixCopy(mat, RwFrameGetMatrix(f));
|
||||||
|
|
||||||
for (f = RwFrameGetParent(f); f; f = RwFrameGetParent(f)) {
|
for (f = RwFrameGetParent(f); f; f = RwFrameGetParent(f)) {
|
||||||
RwMatrixTransform(mat, &f->modelling, rwCOMBINEPOSTCONCAT);
|
RwMatrixTransform(mat, RwFrameGetMatrix(f), rwCOMBINEPOSTCONCAT);
|
||||||
if (RwFrameGetParent(f) == frame)
|
if (RwFrameGetParent(f) == frame)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -707,7 +707,7 @@ RpMaterial*
|
||||||
CVehicleModelInfo::GetEditableMaterialListCB(RpMaterial *material, void *data)
|
CVehicleModelInfo::GetEditableMaterialListCB(RpMaterial *material, void *data)
|
||||||
{
|
{
|
||||||
static RwRGBA white = { 255, 255, 255, 255 };
|
static RwRGBA white = { 255, 255, 255, 255 };
|
||||||
RwRGBA *col;
|
const RwRGBA *col;
|
||||||
editableMatCBData *cbdata;
|
editableMatCBData *cbdata;
|
||||||
|
|
||||||
cbdata = (editableMatCBData*)data;
|
cbdata = (editableMatCBData*)data;
|
||||||
|
@ -758,8 +758,8 @@ CVehicleModelInfo::SetVehicleColour(uint8 c1, uint8 c2)
|
||||||
col = ms_vehicleColourTable[c1];
|
col = ms_vehicleColourTable[c1];
|
||||||
coltex = ms_colourTextureTable[c1];
|
coltex = ms_colourTextureTable[c1];
|
||||||
for(matp = m_materials1; *matp; matp++){
|
for(matp = m_materials1; *matp; matp++){
|
||||||
if(RpMaterialGetTexture(*matp) && RpMaterialGetTexture(*matp)->name[0] != '@'){
|
if(RpMaterialGetTexture(*matp) && RwTextureGetName(RpMaterialGetTexture(*matp))[0] != '@'){
|
||||||
colp = RpMaterialGetColor(*matp);
|
colp = (RwRGBA*)RpMaterialGetColor(*matp); // get rid of const
|
||||||
colp->red = col.red;
|
colp->red = col.red;
|
||||||
colp->green = col.green;
|
colp->green = col.green;
|
||||||
colp->blue = col.blue;
|
colp->blue = col.blue;
|
||||||
|
@ -773,8 +773,8 @@ CVehicleModelInfo::SetVehicleColour(uint8 c1, uint8 c2)
|
||||||
col = ms_vehicleColourTable[c2];
|
col = ms_vehicleColourTable[c2];
|
||||||
coltex = ms_colourTextureTable[c2];
|
coltex = ms_colourTextureTable[c2];
|
||||||
for(matp = m_materials2; *matp; matp++){
|
for(matp = m_materials2; *matp; matp++){
|
||||||
if(RpMaterialGetTexture(*matp) && RpMaterialGetTexture(*matp)->name[0] != '@'){
|
if(RpMaterialGetTexture(*matp) && RwTextureGetName(RpMaterialGetTexture(*matp))[0] != '@'){
|
||||||
colp = RpMaterialGetColor(*matp);
|
colp = (RwRGBA*)RpMaterialGetColor(*matp); // get rid of const
|
||||||
colp->red = col.red;
|
colp->red = col.red;
|
||||||
colp->green = col.green;
|
colp->green = col.green;
|
||||||
colp->blue = col.blue;
|
colp->blue = col.blue;
|
||||||
|
@ -861,7 +861,7 @@ CreateCarColourTexture(uint8 r, uint8 g, uint8 b)
|
||||||
RwImageDestroy(img);
|
RwImageDestroy(img);
|
||||||
RwFree(pixels);
|
RwFree(pixels);
|
||||||
tex = RwTextureCreate(ras);
|
tex = RwTextureCreate(ras);
|
||||||
tex->name[0] = '@';
|
RwTextureGetName(tex)[0] = '@';
|
||||||
return tex;
|
return tex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1058,7 +1058,7 @@ CVehicleModelInfo::LoadEnvironmentMaps(void)
|
||||||
}
|
}
|
||||||
if(gpWhiteTexture == nil){
|
if(gpWhiteTexture == nil){
|
||||||
gpWhiteTexture = RwTextureRead("white", nil);
|
gpWhiteTexture = RwTextureRead("white", nil);
|
||||||
gpWhiteTexture->name[0] = '@';
|
RwTextureGetName(gpWhiteTexture)[0] = '@';
|
||||||
RwTextureSetFilterMode(gpWhiteTexture, rwFILTERLINEAR);
|
RwTextureSetFilterMode(gpWhiteTexture, rwFILTERLINEAR);
|
||||||
}
|
}
|
||||||
CTxdStore::PopCurrentTxd();
|
CTxdStore::PopCurrentTxd();
|
||||||
|
|
|
@ -20,7 +20,7 @@ CCutsceneHead::CCutsceneHead(CObject *obj)
|
||||||
m_pHeadNode = RpAnimBlendClumpFindFrame((RpClump*)obj->m_rwObject, "Shead")->frame;
|
m_pHeadNode = RpAnimBlendClumpFindFrame((RpClump*)obj->m_rwObject, "Shead")->frame;
|
||||||
atm = (RpAtomic*)GetFirstObject(m_pHeadNode);
|
atm = (RpAtomic*)GetFirstObject(m_pHeadNode);
|
||||||
if(atm){
|
if(atm){
|
||||||
assert(RwObjectGetType(atm) == rpATOMIC);
|
assert(RwObjectGetType((RwObject*)atm) == rpATOMIC);
|
||||||
RpAtomicSetFlags(atm, RpAtomicGetFlags(atm) & ~rpATOMICRENDER);
|
RpAtomicSetFlags(atm, RpAtomicGetFlags(atm) & ~rpATOMICRENDER);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -154,7 +154,7 @@ CParticleObject::AddObject(uint16 type, CVector const &pos, CVector const &targe
|
||||||
pobj->m_nRemoveTimer = 0;
|
pobj->m_nRemoveTimer = 0;
|
||||||
|
|
||||||
if ( color.alpha != 0 )
|
if ( color.alpha != 0 )
|
||||||
RwRGBAAssign(&pobj->m_Color, &color);
|
pobj->m_Color, color;
|
||||||
else
|
else
|
||||||
pobj->m_Color.alpha = 0;
|
pobj->m_Color.alpha = 0;
|
||||||
|
|
||||||
|
|
|
@ -676,7 +676,7 @@ RemoveAllModelCB(RwObject *object, void *data)
|
||||||
{
|
{
|
||||||
RpAtomic *atomic = (RpAtomic*)object;
|
RpAtomic *atomic = (RpAtomic*)object;
|
||||||
if (CVisibilityPlugins::GetAtomicModelInfo(atomic)) {
|
if (CVisibilityPlugins::GetAtomicModelInfo(atomic)) {
|
||||||
RpClumpRemoveAtomic(atomic->clump, atomic);
|
RpClumpRemoveAtomic(RpAtomicGetClump(atomic), atomic);
|
||||||
RpAtomicDestroy(atomic);
|
RpAtomicDestroy(atomic);
|
||||||
}
|
}
|
||||||
return object;
|
return object;
|
||||||
|
@ -902,7 +902,7 @@ static RwObject*
|
||||||
SetPedAtomicVisibilityCB(RwObject* object, void* data)
|
SetPedAtomicVisibilityCB(RwObject* object, void* data)
|
||||||
{
|
{
|
||||||
if (data == nil)
|
if (data == nil)
|
||||||
RpAtomicSetFlags(object, 0);
|
RpAtomicSetFlags((RpAtomic*)object, 0);
|
||||||
return object;
|
return object;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -340,7 +340,7 @@ CPedIK::RestoreLookAt(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
CPedIK::ExtractYawAndPitchWorld(RwMatrixTag *mat, float *yaw, float *pitch)
|
CPedIK::ExtractYawAndPitchWorld(RwMatrix *mat, float *yaw, float *pitch)
|
||||||
{
|
{
|
||||||
float f = clamp(DotProduct(mat->up, CVector(0.0f, 1.0f, 0.0f)), -1.0f, 1.0f);
|
float f = clamp(DotProduct(mat->up, CVector(0.0f, 1.0f, 0.0f)), -1.0f, 1.0f);
|
||||||
*yaw = Acos(f);
|
*yaw = Acos(f);
|
||||||
|
@ -352,7 +352,7 @@ CPedIK::ExtractYawAndPitchWorld(RwMatrixTag *mat, float *yaw, float *pitch)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
CPedIK::ExtractYawAndPitchLocal(RwMatrixTag *mat, float *yaw, float *pitch)
|
CPedIK::ExtractYawAndPitchLocal(RwMatrix *mat, float *yaw, float *pitch)
|
||||||
{
|
{
|
||||||
float f = clamp(DotProduct(mat->at, CVector(0.0f, 0.0f, 1.0f)), -1.0f, 1.0f);
|
float f = clamp(DotProduct(mat->at, CVector(0.0f, 0.0f, 1.0f)), -1.0f, 1.0f);
|
||||||
*yaw = Acos(f);
|
*yaw = Acos(f);
|
||||||
|
|
|
@ -54,8 +54,8 @@ public:
|
||||||
void GetComponentPosition(RwV3d *pos, uint32 node);
|
void GetComponentPosition(RwV3d *pos, uint32 node);
|
||||||
static RwMatrix *GetWorldMatrix(RwFrame *source, RwMatrix *destination);
|
static RwMatrix *GetWorldMatrix(RwFrame *source, RwMatrix *destination);
|
||||||
void RotateTorso(AnimBlendFrameData* animBlend, LimbOrientation* limb, bool changeRoll);
|
void RotateTorso(AnimBlendFrameData* animBlend, LimbOrientation* limb, bool changeRoll);
|
||||||
void ExtractYawAndPitchLocal(RwMatrixTag *mat, float *yaw, float *pitch);
|
void ExtractYawAndPitchLocal(RwMatrix *mat, float *yaw, float *pitch);
|
||||||
void ExtractYawAndPitchWorld(RwMatrixTag *mat, float *yaw, float *pitch);
|
void ExtractYawAndPitchWorld(RwMatrix *mat, float *yaw, float *pitch);
|
||||||
LimbMoveStatus MoveLimb(LimbOrientation &limb, float approxPhi, float approxTheta, LimbMovementInfo &moveInfo);
|
LimbMoveStatus MoveLimb(LimbOrientation &limb, float approxPhi, float approxTheta, LimbMovementInfo &moveInfo);
|
||||||
bool RestoreGunPosn(void);
|
bool RestoreGunPosn(void);
|
||||||
bool LookInDirection(float phi, float theta);
|
bool LookInDirection(float phi, float theta);
|
||||||
|
|
|
@ -87,7 +87,7 @@ CClouds::Render(void)
|
||||||
RwV3d pos = { 0.0f, -100.0f, 15.0f };
|
RwV3d pos = { 0.0f, -100.0f, 15.0f };
|
||||||
RwV3dAdd(&worldpos, &campos, &pos);
|
RwV3dAdd(&worldpos, &campos, &pos);
|
||||||
if(CSprite::CalcScreenCoors(worldpos, &screenpos, &szx, &szy, false)){
|
if(CSprite::CalcScreenCoors(worldpos, &screenpos, &szx, &szy, false)){
|
||||||
RwRenderStateSet(rwRENDERSTATETEXTURERASTER, gpCoronaTexture[2]->raster);
|
RwRenderStateSet(rwRENDERSTATETEXTURERASTER, RwTextureGetRaster(gpCoronaTexture[2]));
|
||||||
if(CCoronas::bSmallMoon){
|
if(CCoronas::bSmallMoon){
|
||||||
szx *= 4.0f;
|
szx *= 4.0f;
|
||||||
szy *= 4.0f;
|
szy *= 4.0f;
|
||||||
|
@ -116,7 +116,7 @@ CClouds::Render(void)
|
||||||
static float StarCoorsY[9] = { 0.0f, 0.45f, 0.9f, 1.0f, 0.85f, 0.52f, 0.48f, 0.35f, 0.2f };
|
static float StarCoorsY[9] = { 0.0f, 0.45f, 0.9f, 1.0f, 0.85f, 0.52f, 0.48f, 0.35f, 0.2f };
|
||||||
static float StarSizes[9] = { 1.0f, 1.4f, 0.9f, 1.0f, 0.6f, 1.5f, 1.3f, 1.0f, 0.8f };
|
static float StarSizes[9] = { 1.0f, 1.4f, 0.9f, 1.0f, 0.6f, 1.5f, 1.3f, 1.0f, 0.8f };
|
||||||
int brightness = (1.0f - coverage) * starintens;
|
int brightness = (1.0f - coverage) * starintens;
|
||||||
RwRenderStateSet(rwRENDERSTATETEXTURERASTER, gpCoronaTexture[0]->raster);
|
RwRenderStateSet(rwRENDERSTATETEXTURERASTER, RwTextureGetRaster(gpCoronaTexture[0]));
|
||||||
for(i = 0; i < 11; i++){
|
for(i = 0; i < 11; i++){
|
||||||
RwV3d pos = { 100.0f, 0.0f, 10.0f };
|
RwV3d pos = { 100.0f, 0.0f, 10.0f };
|
||||||
if(i >= 9) pos.x = -pos.x;
|
if(i >= 9) pos.x = -pos.x;
|
||||||
|
@ -132,7 +132,7 @@ CClouds::Render(void)
|
||||||
CSprite::FlushSpriteBuffer();
|
CSprite::FlushSpriteBuffer();
|
||||||
|
|
||||||
// *
|
// *
|
||||||
RwRenderStateSet(rwRENDERSTATETEXTURERASTER, gpCoronaTexture[0]->raster);
|
RwRenderStateSet(rwRENDERSTATETEXTURERASTER, RwTextureGetRaster(gpCoronaTexture[0]));
|
||||||
RwV3d pos = { 100.0f, 0.0f, 10.0f };
|
RwV3d pos = { 100.0f, 0.0f, 10.0f };
|
||||||
RwV3dAdd(&worldpos, &campos, &pos);
|
RwV3dAdd(&worldpos, &campos, &pos);
|
||||||
worldpos.y -= 90.0f;
|
worldpos.y -= 90.0f;
|
||||||
|
@ -156,7 +156,7 @@ CClouds::Render(void)
|
||||||
int b = CTimeCycle::GetLowCloudsBlue() * lowcloudintensity;
|
int b = CTimeCycle::GetLowCloudsBlue() * lowcloudintensity;
|
||||||
for(int cloudtype = 0; cloudtype < 3; cloudtype++){
|
for(int cloudtype = 0; cloudtype < 3; cloudtype++){
|
||||||
for(i = cloudtype; i < 12; i += 3){
|
for(i = cloudtype; i < 12; i += 3){
|
||||||
RwRenderStateSet(rwRENDERSTATETEXTURERASTER, gpCloudTex[cloudtype]->raster);
|
RwRenderStateSet(rwRENDERSTATETEXTURERASTER, RwTextureGetRaster(gpCloudTex[cloudtype]));
|
||||||
RwV3d pos = { 800.0f*LowCloudsX[i], 800.0f*LowCloudsY[i], 60.0f*LowCloudsZ[i] };
|
RwV3d pos = { 800.0f*LowCloudsX[i], 800.0f*LowCloudsY[i], 60.0f*LowCloudsZ[i] };
|
||||||
worldpos.x = campos.x + pos.x;
|
worldpos.x = campos.x + pos.x;
|
||||||
worldpos.y = campos.y + pos.y;
|
worldpos.y = campos.y + pos.y;
|
||||||
|
@ -202,7 +202,7 @@ CClouds::Render(void)
|
||||||
|
|
||||||
RwRenderStateSet(rwRENDERSTATESRCBLEND, (void*)rwBLENDSRCALPHA);
|
RwRenderStateSet(rwRENDERSTATESRCBLEND, (void*)rwBLENDSRCALPHA);
|
||||||
RwRenderStateSet(rwRENDERSTATEDESTBLEND, (void*)rwBLENDINVSRCALPHA);
|
RwRenderStateSet(rwRENDERSTATEDESTBLEND, (void*)rwBLENDINVSRCALPHA);
|
||||||
RwRenderStateSet(rwRENDERSTATETEXTURERASTER, gpCloudTex[4]->raster);
|
RwRenderStateSet(rwRENDERSTATETEXTURERASTER, RwTextureGetRaster(gpCloudTex[4]));
|
||||||
for(i = 0; i < 37; i++){
|
for(i = 0; i < 37; i++){
|
||||||
RwV3d pos = { 2.0f*CoorsOffsetX[i], 2.0f*CoorsOffsetY[i], 40.0f*CoorsOffsetZ[i] + 40.0f };
|
RwV3d pos = { 2.0f*CoorsOffsetX[i], 2.0f*CoorsOffsetY[i], 40.0f*CoorsOffsetZ[i] + 40.0f };
|
||||||
worldpos.x = pos.x*rot_cos + pos.y*rot_sin + campos.x;
|
worldpos.x = pos.x*rot_cos + pos.y*rot_sin + campos.x;
|
||||||
|
@ -244,7 +244,7 @@ CClouds::Render(void)
|
||||||
// Highlights
|
// Highlights
|
||||||
RwRenderStateSet(rwRENDERSTATESRCBLEND, (void*)rwBLENDONE);
|
RwRenderStateSet(rwRENDERSTATESRCBLEND, (void*)rwBLENDONE);
|
||||||
RwRenderStateSet(rwRENDERSTATEDESTBLEND, (void*)rwBLENDONE);
|
RwRenderStateSet(rwRENDERSTATEDESTBLEND, (void*)rwBLENDONE);
|
||||||
RwRenderStateSet(rwRENDERSTATETEXTURERASTER, gpCloudTex[3]->raster);
|
RwRenderStateSet(rwRENDERSTATETEXTURERASTER, RwTextureGetRaster(gpCloudTex[3]));
|
||||||
|
|
||||||
for(i = 0; i < 37; i++){
|
for(i = 0; i < 37; i++){
|
||||||
RwV3d pos = { 2.0f*CoorsOffsetX[i], 2.0f*CoorsOffsetY[i], 40.0f*CoorsOffsetZ[i] + 40.0f };
|
RwV3d pos = { 2.0f*CoorsOffsetX[i], 2.0f*CoorsOffsetY[i], 40.0f*CoorsOffsetZ[i] + 40.0f };
|
||||||
|
@ -269,7 +269,7 @@ CClouds::Render(void)
|
||||||
static uint8 BowRed[6] = { 30, 30, 30, 10, 0, 15 };
|
static uint8 BowRed[6] = { 30, 30, 30, 10, 0, 15 };
|
||||||
static uint8 BowGreen[6] = { 0, 15, 30, 30, 0, 0 };
|
static uint8 BowGreen[6] = { 0, 15, 30, 30, 0, 0 };
|
||||||
static uint8 BowBlue[6] = { 0, 0, 0, 10, 30, 30 };
|
static uint8 BowBlue[6] = { 0, 0, 0, 10, 30, 30 };
|
||||||
RwRenderStateSet(rwRENDERSTATETEXTURERASTER, gpCoronaTexture[0]->raster);
|
RwRenderStateSet(rwRENDERSTATETEXTURERASTER, RwTextureGetRaster(gpCoronaTexture[0]));
|
||||||
for(i = 0; i < 6; i++){
|
for(i = 0; i < 6; i++){
|
||||||
RwV3d pos = { i*1.5f, 100.0f, 5.0f };
|
RwV3d pos = { i*1.5f, 100.0f, 5.0f };
|
||||||
RwV3dAdd(&worldpos, &campos, &pos);
|
RwV3dAdd(&worldpos, &campos, &pos);
|
||||||
|
|
|
@ -755,14 +755,14 @@ void CTowerClock::Render()
|
||||||
&TempV[1],
|
&TempV[1],
|
||||||
m_Position.x + Sin(angleMinute) * m_fScale * m_Size.x,
|
m_Position.x + Sin(angleMinute) * m_fScale * m_Size.x,
|
||||||
m_Position.y + Sin(angleMinute) * m_fScale * m_Size.y,
|
m_Position.y + Sin(angleMinute) * m_fScale * m_Size.y,
|
||||||
m_Position.z + Cos(angleMinute) * m_fScale;
|
m_Position.z + Cos(angleMinute) * m_fScale
|
||||||
);
|
);
|
||||||
RwIm3DVertexSetPos(&TempV[2], m_Position.x, m_Position.y, m_Position.z);
|
RwIm3DVertexSetPos(&TempV[2], m_Position.x, m_Position.y, m_Position.z);
|
||||||
RwIm3DVertexSetPos(
|
RwIm3DVertexSetPos(
|
||||||
&TempV[3],
|
&TempV[3],
|
||||||
m_Position.x + Sin(angleHour) * 0.75f * m_fScale * m_Size.x,
|
m_Position.x + Sin(angleHour) * 0.75f * m_fScale * m_Size.x,
|
||||||
m_Position.y + Sin(angleHour) * 0.75f * m_fScale * m_Size.y,
|
m_Position.y + Sin(angleHour) * 0.75f * m_fScale * m_Size.y,
|
||||||
m_Position.z + Cos(angleHour) * 0.75f * m_fScale;
|
m_Position.z + Cos(angleHour) * 0.75f * m_fScale
|
||||||
);
|
);
|
||||||
|
|
||||||
LittleTest();
|
LittleTest();
|
||||||
|
|
|
@ -4,12 +4,13 @@
|
||||||
#include "Camera.h"
|
#include "Camera.h"
|
||||||
#include "MBlur.h"
|
#include "MBlur.h"
|
||||||
|
|
||||||
|
// Originally taken from RW example 'mblur'
|
||||||
|
|
||||||
RwRaster *&CMBlur::pFrontBuffer = *(RwRaster**)0x8E2C48;
|
RwRaster *&CMBlur::pFrontBuffer = *(RwRaster**)0x8E2C48;
|
||||||
bool &CMBlur::ms_bJustInitialised = *(bool*)0x95CDAB;
|
bool &CMBlur::ms_bJustInitialised = *(bool*)0x95CDAB;
|
||||||
bool &CMBlur::BlurOn = *(bool*)0x95CDAD;
|
bool &CMBlur::BlurOn = *(bool*)0x95CDAD;
|
||||||
|
|
||||||
static RwIm2DVertex Vertex[4];
|
static RwIm2DVertex Vertex[4];
|
||||||
//static RwIm2DVertex *Vertex = (RwIm2DVertex*)0x62F780;
|
|
||||||
static RwImVertexIndex Index[6] = { 0, 1, 2, 0, 2, 3 };
|
static RwImVertexIndex Index[6] = { 0, 1, 2, 0, 2, 3 };
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
|
@ -22,10 +22,10 @@
|
||||||
#include "Shadows.h"
|
#include "Shadows.h"
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
|
|
||||||
RxObjSpace3DVertex StreakVertices[4];
|
RwIm3DVertex StreakVertices[4];
|
||||||
RwImVertexIndex StreakIndexList[12];
|
RwImVertexIndex StreakIndexList[12];
|
||||||
|
|
||||||
RxObjSpace3DVertex TraceVertices[6];
|
RwIm3DVertex TraceVertices[6];
|
||||||
RwImVertexIndex TraceIndexList[12];
|
RwImVertexIndex TraceIndexList[12];
|
||||||
|
|
||||||
|
|
||||||
|
@ -34,60 +34,60 @@ CSpecialFX::Init(void)
|
||||||
{
|
{
|
||||||
CBulletTraces::Init();
|
CBulletTraces::Init();
|
||||||
|
|
||||||
RwIm3DVertexSetU(&StreakVertices[0], 0.0f);
|
RwIm3DVertexSetU(&StreakVertices[0], 0.0f);
|
||||||
RwIm3DVertexSetV(&StreakVertices[0], 0.0f);
|
RwIm3DVertexSetV(&StreakVertices[0], 0.0f);
|
||||||
RwIm3DVertexSetU(&StreakVertices[1], 1.0f);
|
RwIm3DVertexSetU(&StreakVertices[1], 1.0f);
|
||||||
RwIm3DVertexSetV(&StreakVertices[1], 0.0f);
|
RwIm3DVertexSetV(&StreakVertices[1], 0.0f);
|
||||||
RwIm3DVertexSetU(&StreakVertices[2], 0.0f);
|
RwIm3DVertexSetU(&StreakVertices[2], 0.0f);
|
||||||
RwIm3DVertexSetV(&StreakVertices[2], 0.0f);
|
RwIm3DVertexSetV(&StreakVertices[2], 0.0f);
|
||||||
RwIm3DVertexSetU(&StreakVertices[3], 1.0f);
|
RwIm3DVertexSetU(&StreakVertices[3], 1.0f);
|
||||||
RwIm3DVertexSetV(&StreakVertices[3], 0.0f);
|
RwIm3DVertexSetV(&StreakVertices[3], 0.0f);
|
||||||
|
|
||||||
StreakIndexList[0] = 0;
|
StreakIndexList[0] = 0;
|
||||||
StreakIndexList[1] = 1;
|
StreakIndexList[1] = 1;
|
||||||
StreakIndexList[2] = 2;
|
StreakIndexList[2] = 2;
|
||||||
StreakIndexList[3] = 1;
|
StreakIndexList[3] = 1;
|
||||||
StreakIndexList[4] = 3;
|
StreakIndexList[4] = 3;
|
||||||
StreakIndexList[5] = 2;
|
StreakIndexList[5] = 2;
|
||||||
StreakIndexList[6] = 0;
|
StreakIndexList[6] = 0;
|
||||||
StreakIndexList[7] = 2;
|
StreakIndexList[7] = 2;
|
||||||
StreakIndexList[8] = 1;
|
StreakIndexList[8] = 1;
|
||||||
StreakIndexList[9] = 1;
|
StreakIndexList[9] = 1;
|
||||||
StreakIndexList[10] = 2;
|
StreakIndexList[10] = 2;
|
||||||
StreakIndexList[11] = 3;
|
StreakIndexList[11] = 3;
|
||||||
|
|
||||||
RwIm3DVertexSetRGBA(&TraceVertices[0], 20, 20, 20, 255);
|
RwIm3DVertexSetRGBA(&TraceVertices[0], 20, 20, 20, 255);
|
||||||
RwIm3DVertexSetRGBA(&TraceVertices[1], 20, 20, 20, 255);
|
RwIm3DVertexSetRGBA(&TraceVertices[1], 20, 20, 20, 255);
|
||||||
RwIm3DVertexSetRGBA(&TraceVertices[2], 70, 70, 70, 255);
|
RwIm3DVertexSetRGBA(&TraceVertices[2], 70, 70, 70, 255);
|
||||||
RwIm3DVertexSetRGBA(&TraceVertices[3], 70, 70, 70, 255);
|
RwIm3DVertexSetRGBA(&TraceVertices[3], 70, 70, 70, 255);
|
||||||
RwIm3DVertexSetRGBA(&TraceVertices[4], 10, 10, 10, 255);
|
RwIm3DVertexSetRGBA(&TraceVertices[4], 10, 10, 10, 255);
|
||||||
RwIm3DVertexSetRGBA(&TraceVertices[5], 10, 10, 10, 255);
|
RwIm3DVertexSetRGBA(&TraceVertices[5], 10, 10, 10, 255);
|
||||||
RwIm3DVertexSetU(&TraceVertices[0], 0.0);
|
RwIm3DVertexSetU(&TraceVertices[0], 0.0);
|
||||||
RwIm3DVertexSetV(&TraceVertices[0], 0.0);
|
RwIm3DVertexSetV(&TraceVertices[0], 0.0);
|
||||||
RwIm3DVertexSetU(&TraceVertices[1], 1.0);
|
RwIm3DVertexSetU(&TraceVertices[1], 1.0);
|
||||||
RwIm3DVertexSetV(&TraceVertices[1], 0.0);
|
RwIm3DVertexSetV(&TraceVertices[1], 0.0);
|
||||||
RwIm3DVertexSetU(&TraceVertices[2], 0.0);
|
RwIm3DVertexSetU(&TraceVertices[2], 0.0);
|
||||||
RwIm3DVertexSetV(&TraceVertices[2], 0.5);
|
RwIm3DVertexSetV(&TraceVertices[2], 0.5);
|
||||||
RwIm3DVertexSetU(&TraceVertices[3], 1.0);
|
RwIm3DVertexSetU(&TraceVertices[3], 1.0);
|
||||||
RwIm3DVertexSetV(&TraceVertices[3], 0.5);
|
RwIm3DVertexSetV(&TraceVertices[3], 0.5);
|
||||||
RwIm3DVertexSetU(&TraceVertices[4], 0.0);
|
RwIm3DVertexSetU(&TraceVertices[4], 0.0);
|
||||||
RwIm3DVertexSetV(&TraceVertices[4], 1.0);
|
RwIm3DVertexSetV(&TraceVertices[4], 1.0);
|
||||||
RwIm3DVertexSetU(&TraceVertices[5], 1.0);
|
RwIm3DVertexSetU(&TraceVertices[5], 1.0);
|
||||||
RwIm3DVertexSetV(&TraceVertices[5], 1.0);
|
RwIm3DVertexSetV(&TraceVertices[5], 1.0);
|
||||||
|
|
||||||
|
TraceIndexList[0] = 0;
|
||||||
|
TraceIndexList[1] = 2;
|
||||||
|
TraceIndexList[2] = 1;
|
||||||
|
TraceIndexList[3] = 1;
|
||||||
|
TraceIndexList[4] = 2;
|
||||||
|
TraceIndexList[5] = 3;
|
||||||
|
TraceIndexList[6] = 2;
|
||||||
|
TraceIndexList[7] = 4;
|
||||||
|
TraceIndexList[8] = 3;
|
||||||
|
TraceIndexList[9] = 3;
|
||||||
|
TraceIndexList[10] = 4;
|
||||||
|
TraceIndexList[11] = 5;
|
||||||
|
|
||||||
TraceIndexList[0] = 0;
|
|
||||||
TraceIndexList[1] = 2;
|
|
||||||
TraceIndexList[2] = 1;
|
|
||||||
TraceIndexList[3] = 1;
|
|
||||||
TraceIndexList[4] = 2;
|
|
||||||
TraceIndexList[5] = 3;
|
|
||||||
TraceIndexList[6] = 2;
|
|
||||||
TraceIndexList[7] = 4;
|
|
||||||
TraceIndexList[8] = 3;
|
|
||||||
TraceIndexList[9] = 3;
|
|
||||||
TraceIndexList[10] = 4;
|
|
||||||
TraceIndexList[11] = 5;
|
|
||||||
|
|
||||||
CMotionBlurStreaks::Init();
|
CMotionBlurStreaks::Init();
|
||||||
CBrightLights::Init();
|
CBrightLights::Init();
|
||||||
CShinyTexts::Init();
|
CShinyTexts::Init();
|
||||||
|
@ -112,13 +112,13 @@ LookForBatCB(RwObject *object, void *data)
|
||||||
void
|
void
|
||||||
CSpecialFX::Update(void)
|
CSpecialFX::Update(void)
|
||||||
{
|
{
|
||||||
CMotionBlurStreaks::Update();
|
CMotionBlurStreaks::Update();
|
||||||
CBulletTraces::Update();
|
CBulletTraces::Update();
|
||||||
|
|
||||||
if(FindPlayerPed() &&
|
if(FindPlayerPed() &&
|
||||||
FindPlayerPed()->GetWeapon()->m_eWeaponType == WEAPONTYPE_BASEBALLBAT &&
|
FindPlayerPed()->GetWeapon()->m_eWeaponType == WEAPONTYPE_BASEBALLBAT &&
|
||||||
FindPlayerPed()->GetWeapon()->m_eWeaponState == WEAPONSTATE_FIRING)
|
FindPlayerPed()->GetWeapon()->m_eWeaponState == WEAPONSTATE_FIRING)
|
||||||
RwFrameForAllObjects(FindPlayerPed()->GetNodeFrame(PED_HANDR), LookForBatCB, CModelInfo::GetModelInfo(MI_BASEBALL_BAT));
|
RwFrameForAllObjects(FindPlayerPed()->GetNodeFrame(PED_HANDR), LookForBatCB, CModelInfo::GetModelInfo(MI_BASEBALL_BAT));
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -130,78 +130,78 @@ CSpecialFX::Shutdown(void)
|
||||||
void
|
void
|
||||||
CSpecialFX::Render(void)
|
CSpecialFX::Render(void)
|
||||||
{
|
{
|
||||||
CMotionBlurStreaks::Render();
|
CMotionBlurStreaks::Render();
|
||||||
CBulletTraces::Render();
|
CBulletTraces::Render();
|
||||||
CBrightLights::Render();
|
CBrightLights::Render();
|
||||||
CShinyTexts::Render();
|
CShinyTexts::Render();
|
||||||
CMoneyMessages::Render();
|
CMoneyMessages::Render();
|
||||||
C3dMarkers::Render();
|
C3dMarkers::Render();
|
||||||
}
|
}
|
||||||
|
|
||||||
CRegisteredMotionBlurStreak CMotionBlurStreaks::aStreaks[NUMMBLURSTREAKS];
|
CRegisteredMotionBlurStreak CMotionBlurStreaks::aStreaks[NUMMBLURSTREAKS];
|
||||||
|
|
||||||
void
|
void
|
||||||
CRegisteredMotionBlurStreak::Update(void)
|
CRegisteredMotionBlurStreak::Update(void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
bool wasUpdated;
|
bool wasUpdated;
|
||||||
bool lastWasUpdated = false;
|
bool lastWasUpdated = false;
|
||||||
for(i = 2; i > 0; i--){
|
for(i = 2; i > 0; i--){
|
||||||
m_pos1[i] = m_pos1[i-1];
|
m_pos1[i] = m_pos1[i-1];
|
||||||
m_pos2[i] = m_pos2[i-1];
|
m_pos2[i] = m_pos2[i-1];
|
||||||
m_isValid[i] = m_isValid[i-1];
|
m_isValid[i] = m_isValid[i-1];
|
||||||
wasUpdated = true;
|
wasUpdated = true;
|
||||||
if(!lastWasUpdated && !m_isValid[i])
|
if(!lastWasUpdated && !m_isValid[i])
|
||||||
wasUpdated = false;
|
wasUpdated = false;
|
||||||
lastWasUpdated = wasUpdated;
|
lastWasUpdated = wasUpdated;
|
||||||
}
|
}
|
||||||
m_isValid[0] = false;
|
m_isValid[0] = false;
|
||||||
if(!wasUpdated)
|
if(!wasUpdated)
|
||||||
m_id = 0;
|
m_id = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
CRegisteredMotionBlurStreak::Render(void)
|
CRegisteredMotionBlurStreak::Render(void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
int a1, a2;
|
int a1, a2;
|
||||||
for(i = 0; i < 2; i++)
|
for(i = 0; i < 2; i++)
|
||||||
if(m_isValid[i] && m_isValid[i+1]){
|
if(m_isValid[i] && m_isValid[i+1]){
|
||||||
a1 = (255/3)*(3-i)/3;
|
a1 = (255/3)*(3-i)/3;
|
||||||
RwIm3DVertexSetRGBA(&StreakVertices[0], m_red, m_green, m_blue, a1);
|
RwIm3DVertexSetRGBA(&StreakVertices[0], m_red, m_green, m_blue, a1);
|
||||||
RwIm3DVertexSetRGBA(&StreakVertices[1], m_red, m_green, m_blue, a1);
|
RwIm3DVertexSetRGBA(&StreakVertices[1], m_red, m_green, m_blue, a1);
|
||||||
a2 = (255/3)*(3-(i+1))/3;
|
a2 = (255/3)*(3-(i+1))/3;
|
||||||
RwIm3DVertexSetRGBA(&StreakVertices[2], m_red, m_green, m_blue, a2);
|
RwIm3DVertexSetRGBA(&StreakVertices[2], m_red, m_green, m_blue, a2);
|
||||||
RwIm3DVertexSetRGBA(&StreakVertices[3], m_red, m_green, m_blue, a2);
|
RwIm3DVertexSetRGBA(&StreakVertices[3], m_red, m_green, m_blue, a2);
|
||||||
RwIm3DVertexSetPos(&StreakVertices[0], m_pos1[i].x, m_pos1[i].y, m_pos1[i].z);
|
RwIm3DVertexSetPos(&StreakVertices[0], m_pos1[i].x, m_pos1[i].y, m_pos1[i].z);
|
||||||
RwIm3DVertexSetPos(&StreakVertices[1], m_pos2[i].x, m_pos2[i].y, m_pos2[i].z);
|
RwIm3DVertexSetPos(&StreakVertices[1], m_pos2[i].x, m_pos2[i].y, m_pos2[i].z);
|
||||||
RwIm3DVertexSetPos(&StreakVertices[2], m_pos1[i+1].x, m_pos1[i+1].y, m_pos1[i+1].z);
|
RwIm3DVertexSetPos(&StreakVertices[2], m_pos1[i+1].x, m_pos1[i+1].y, m_pos1[i+1].z);
|
||||||
RwIm3DVertexSetPos(&StreakVertices[3], m_pos2[i+1].x, m_pos2[i+1].y, m_pos2[i+1].z);
|
RwIm3DVertexSetPos(&StreakVertices[3], m_pos2[i+1].x, m_pos2[i+1].y, m_pos2[i+1].z);
|
||||||
LittleTest();
|
LittleTest();
|
||||||
if(RwIm3DTransform(StreakVertices, 4, nil, rwIM3D_VERTEXUV)){
|
if(RwIm3DTransform(StreakVertices, 4, nil, rwIM3D_VERTEXUV)){
|
||||||
RwIm3DRenderIndexedPrimitive(rwPRIMTYPETRILIST, StreakIndexList, 12);
|
RwIm3DRenderIndexedPrimitive(rwPRIMTYPETRILIST, StreakIndexList, 12);
|
||||||
RwIm3DEnd();
|
RwIm3DEnd();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
CMotionBlurStreaks::Init(void)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
for(i = 0; i < NUMMBLURSTREAKS; i++)
|
||||||
|
aStreaks[i].m_id = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
CMotionBlurStreaks::Update(void)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
for(i = 0; i < NUMMBLURSTREAKS; i++)
|
||||||
|
if(aStreaks[i].m_id)
|
||||||
|
aStreaks[i].Update();
|
||||||
|
}
|
||||||
|
|
||||||
void
|
|
||||||
CMotionBlurStreaks::Init(void)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
for(i = 0; i < NUMMBLURSTREAKS; i++)
|
|
||||||
aStreaks[i].m_id = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
CMotionBlurStreaks::Update(void)
|
|
||||||
{
|
|
||||||
int i;
|
|
||||||
for(i = 0; i < NUMMBLURSTREAKS; i++)
|
|
||||||
if(aStreaks[i].m_id)
|
|
||||||
aStreaks[i].Update();
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
CMotionBlurStreaks::RegisterStreak(uintptr id, uint8 r, uint8 g, uint8 b, CVector p1, CVector p2)
|
CMotionBlurStreaks::RegisterStreak(uintptr id, uint8 r, uint8 g, uint8 b, CVector p1, CVector p2)
|
||||||
{
|
{
|
||||||
|
@ -234,32 +234,32 @@ CMotionBlurStreaks::RegisterStreak(uintptr id, uint8 r, uint8 g, uint8 b, CVecto
|
||||||
aStreaks[i].m_isValid[2] = false;
|
aStreaks[i].m_isValid[2] = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
CMotionBlurStreaks::Render(void)
|
CMotionBlurStreaks::Render(void)
|
||||||
{
|
{
|
||||||
bool setRenderStates = false;
|
bool setRenderStates = false;
|
||||||
int i;
|
int i;
|
||||||
for(i = 0; i < NUMMBLURSTREAKS; i++)
|
for(i = 0; i < NUMMBLURSTREAKS; i++)
|
||||||
if(aStreaks[i].m_id){
|
if(aStreaks[i].m_id){
|
||||||
if(!setRenderStates){
|
if(!setRenderStates){
|
||||||
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)FALSE);
|
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)FALSE);
|
||||||
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE);
|
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE);
|
||||||
RwRenderStateSet(rwRENDERSTATEFOGENABLE, (void *)TRUE);
|
RwRenderStateSet(rwRENDERSTATEFOGENABLE, (void *)TRUE);
|
||||||
RwRenderStateSet(rwRENDERSTATEFOGCOLOR,
|
RwRenderStateSet(rwRENDERSTATEFOGCOLOR,
|
||||||
(void*)RWRGBALONG(CTimeCycle::GetFogRed(), CTimeCycle::GetFogGreen(), CTimeCycle::GetFogBlue(), 255));
|
(void*)RWRGBALONG(CTimeCycle::GetFogRed(), CTimeCycle::GetFogGreen(), CTimeCycle::GetFogBlue(), 255));
|
||||||
RwRenderStateSet(rwRENDERSTATESRCBLEND, (void*)rwBLENDSRCALPHA);
|
RwRenderStateSet(rwRENDERSTATESRCBLEND, (void*)rwBLENDSRCALPHA);
|
||||||
RwRenderStateSet(rwRENDERSTATEDESTBLEND, (void*)rwBLENDINVSRCALPHA);
|
RwRenderStateSet(rwRENDERSTATEDESTBLEND, (void*)rwBLENDINVSRCALPHA);
|
||||||
RwRenderStateSet(rwRENDERSTATETEXTURERASTER, (void*)FALSE);
|
RwRenderStateSet(rwRENDERSTATETEXTURERASTER, (void*)FALSE);
|
||||||
setRenderStates = true;
|
setRenderStates = true;
|
||||||
}
|
}
|
||||||
aStreaks[i].Render();
|
aStreaks[i].Render();
|
||||||
}
|
}
|
||||||
if(setRenderStates){
|
if(setRenderStates){
|
||||||
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)TRUE);
|
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)TRUE);
|
||||||
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)FALSE);
|
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)FALSE);
|
||||||
RwRenderStateSet(rwRENDERSTATEFOGENABLE, (void *)FALSE);
|
RwRenderStateSet(rwRENDERSTATEFOGENABLE, (void *)FALSE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
CBulletTrace CBulletTraces::aTraces[NUMBULLETTRACES];
|
CBulletTrace CBulletTraces::aTraces[NUMBULLETTRACES];
|
||||||
|
@ -291,10 +291,10 @@ void CBulletTraces::Render(void)
|
||||||
for (int i = 0; i < NUMBULLETTRACES; i++) {
|
for (int i = 0; i < NUMBULLETTRACES; i++) {
|
||||||
if (!aTraces[i].m_bInUse)
|
if (!aTraces[i].m_bInUse)
|
||||||
continue;
|
continue;
|
||||||
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)0);
|
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)FALSE);
|
||||||
RwRenderStateSet(rwRENDERSTATESRCBLEND, (void*)2);
|
RwRenderStateSet(rwRENDERSTATESRCBLEND, (void*)rwBLENDONE);
|
||||||
RwRenderStateSet(rwRENDERSTATEDESTBLEND, (void*)2);
|
RwRenderStateSet(rwRENDERSTATEDESTBLEND, (void*)rwBLENDONE);
|
||||||
RwRenderStateSet(rwRENDERSTATETEXTURERASTER, gpShadowExplosionTex->raster);
|
RwRenderStateSet(rwRENDERSTATETEXTURERASTER, RwTextureGetRaster(gpShadowExplosionTex));
|
||||||
CVector inf = aTraces[i].m_vecCurrentPos;
|
CVector inf = aTraces[i].m_vecCurrentPos;
|
||||||
CVector sup = aTraces[i].m_vecTargetPos;
|
CVector sup = aTraces[i].m_vecTargetPos;
|
||||||
CVector center = (inf + sup) / 2;
|
CVector center = (inf + sup) / 2;
|
||||||
|
@ -316,9 +316,9 @@ void CBulletTraces::Render(void)
|
||||||
RwIm3DEnd();
|
RwIm3DEnd();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)1);
|
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)TRUE);
|
||||||
RwRenderStateSet(rwRENDERSTATESRCBLEND, (void*)5);
|
RwRenderStateSet(rwRENDERSTATESRCBLEND, (void*)rwBLENDSRCALPHA);
|
||||||
RwRenderStateSet(rwRENDERSTATEDESTBLEND, (void*)6);
|
RwRenderStateSet(rwRENDERSTATEDESTBLEND, (void*)rwBLENDINVSRCALPHA);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CBulletTraces::Update(void)
|
void CBulletTraces::Update(void)
|
||||||
|
@ -414,8 +414,7 @@ C3dMarker::Render()
|
||||||
{
|
{
|
||||||
if (m_pAtomic == nil) return;
|
if (m_pAtomic == nil) return;
|
||||||
|
|
||||||
RwRGBA *color = RpMaterialGetColor(m_pMaterial);
|
RpMaterialSetColor(m_pMaterial, &m_Color);
|
||||||
*color = m_Color;
|
|
||||||
|
|
||||||
m_Matrix.UpdateRW();
|
m_Matrix.UpdateRW();
|
||||||
|
|
||||||
|
@ -643,13 +642,13 @@ C3dMarkers::Update()
|
||||||
|
|
||||||
int CBrightLights::NumBrightLights;
|
int CBrightLights::NumBrightLights;
|
||||||
CBrightLight CBrightLights::aBrightLights[NUMBRIGHTLIGHTS];
|
CBrightLight CBrightLights::aBrightLights[NUMBRIGHTLIGHTS];
|
||||||
|
|
||||||
void
|
void
|
||||||
CBrightLights::Init(void)
|
CBrightLights::Init(void)
|
||||||
{
|
{
|
||||||
NumBrightLights = 0;
|
NumBrightLights = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
CBrightLights::RegisterOne(CVector pos, CVector up, CVector side, CVector front,
|
CBrightLights::RegisterOne(CVector pos, CVector up, CVector side, CVector front,
|
||||||
uint8 type, uint8 red, uint8 green, uint8 blue)
|
uint8 type, uint8 red, uint8 green, uint8 blue)
|
||||||
|
@ -661,13 +660,13 @@ CBrightLights::RegisterOne(CVector pos, CVector up, CVector side, CVector front,
|
||||||
if(aBrightLights[NumBrightLights].m_camDist > BRIGHTLIGHTS_MAX_DIST)
|
if(aBrightLights[NumBrightLights].m_camDist > BRIGHTLIGHTS_MAX_DIST)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
aBrightLights[NumBrightLights].m_pos = pos;
|
aBrightLights[NumBrightLights].m_pos = pos;
|
||||||
aBrightLights[NumBrightLights].m_up = up;
|
aBrightLights[NumBrightLights].m_up = up;
|
||||||
aBrightLights[NumBrightLights].m_side = side;
|
aBrightLights[NumBrightLights].m_side = side;
|
||||||
aBrightLights[NumBrightLights].m_front = front;
|
aBrightLights[NumBrightLights].m_front = front;
|
||||||
aBrightLights[NumBrightLights].m_type = type;
|
aBrightLights[NumBrightLights].m_type = type;
|
||||||
aBrightLights[NumBrightLights].m_red = red;
|
aBrightLights[NumBrightLights].m_red = red;
|
||||||
aBrightLights[NumBrightLights].m_green = green;
|
aBrightLights[NumBrightLights].m_green = green;
|
||||||
aBrightLights[NumBrightLights].m_blue = blue;
|
aBrightLights[NumBrightLights].m_blue = blue;
|
||||||
|
|
||||||
NumBrightLights++;
|
NumBrightLights++;
|
||||||
|
@ -696,22 +695,22 @@ static RwImVertexIndex CubeIndices[12*3] = {
|
||||||
6, 0, 4, 6, 2, 0, 6, 5, 7, 6, 4, 5
|
6, 0, 4, 6, 2, 0, 6, 5, 7, 6, 4, 5
|
||||||
};
|
};
|
||||||
|
|
||||||
void
|
void
|
||||||
CBrightLights::Render(void)
|
CBrightLights::Render(void)
|
||||||
{
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
CVector pos;
|
CVector pos;
|
||||||
|
|
||||||
if(NumBrightLights == 0)
|
if(NumBrightLights == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE);
|
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE);
|
||||||
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)TRUE);
|
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)TRUE);
|
||||||
RwRenderStateSet(rwRENDERSTATESRCBLEND, (void*)rwBLENDSRCALPHA);
|
RwRenderStateSet(rwRENDERSTATESRCBLEND, (void*)rwBLENDSRCALPHA);
|
||||||
RwRenderStateSet(rwRENDERSTATEDESTBLEND, (void*)rwBLENDINVSRCALPHA);
|
RwRenderStateSet(rwRENDERSTATEDESTBLEND, (void*)rwBLENDINVSRCALPHA);
|
||||||
RwRenderStateSet(rwRENDERSTATETEXTURERASTER, nil);
|
RwRenderStateSet(rwRENDERSTATETEXTURERASTER, nil);
|
||||||
|
|
||||||
for(i = 0; i < NumBrightLights; i++){
|
for(i = 0; i < NumBrightLights; i++){
|
||||||
if(TempBufferIndicesStored > TEMPBUFFERINDEXSIZE-40 || TempBufferVerticesStored > TEMPBUFFERVERTSIZE-40)
|
if(TempBufferIndicesStored > TEMPBUFFERINDEXSIZE-40 || TempBufferVerticesStored > TEMPBUFFERVERTSIZE-40)
|
||||||
RenderOutGeometryBuffer();
|
RenderOutGeometryBuffer();
|
||||||
|
|
||||||
|
@ -753,14 +752,14 @@ CBrightLights::Render(void)
|
||||||
a = 255;
|
a = 255;
|
||||||
else
|
else
|
||||||
a = 255*(1.0f - (aBrightLights[i].m_camDist-BRIGHTLIGHTS_FADE_DIST)/(BRIGHTLIGHTS_MAX_DIST-BRIGHTLIGHTS_FADE_DIST));
|
a = 255*(1.0f - (aBrightLights[i].m_camDist-BRIGHTLIGHTS_FADE_DIST)/(BRIGHTLIGHTS_MAX_DIST-BRIGHTLIGHTS_FADE_DIST));
|
||||||
// fade car lights down to 31 as they come near
|
// fade car lights down to 31 as they come near
|
||||||
if(aBrightLights[i].m_type >= BRIGHTLIGHT_FRONT_LONG && aBrightLights[i].m_type <= BRIGHTLIGHT_REAR_TALL){
|
if(aBrightLights[i].m_type >= BRIGHTLIGHT_FRONT_LONG && aBrightLights[i].m_type <= BRIGHTLIGHT_REAR_TALL){
|
||||||
if(aBrightLights[i].m_camDist < CARLIGHTS_FADE_DIST)
|
if(aBrightLights[i].m_camDist < CARLIGHTS_FADE_DIST)
|
||||||
a = 31;
|
a = 31;
|
||||||
else if(aBrightLights[i].m_camDist < CARLIGHTS_MAX_DIST)
|
else if(aBrightLights[i].m_camDist < CARLIGHTS_MAX_DIST)
|
||||||
a = 31 + (255-31)*((aBrightLights[i].m_camDist-CARLIGHTS_FADE_DIST)/(CARLIGHTS_MAX_DIST-CARLIGHTS_FADE_DIST));
|
a = 31 + (255-31)*((aBrightLights[i].m_camDist-CARLIGHTS_FADE_DIST)/(CARLIGHTS_MAX_DIST-CARLIGHTS_FADE_DIST));
|
||||||
}
|
}
|
||||||
|
|
||||||
switch(aBrightLights[i].m_type){
|
switch(aBrightLights[i].m_type){
|
||||||
case BRIGHTLIGHT_TRAFFIC_GREEN:
|
case BRIGHTLIGHT_TRAFFIC_GREEN:
|
||||||
case BRIGHTLIGHT_TRAFFIC_YELLOW:
|
case BRIGHTLIGHT_TRAFFIC_YELLOW:
|
||||||
|
@ -793,7 +792,7 @@ CBrightLights::Render(void)
|
||||||
TempBufferVerticesStored += 8;
|
TempBufferVerticesStored += 8;
|
||||||
TempBufferIndicesStored += 12*3;
|
TempBufferIndicesStored += 12*3;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BRIGHTLIGHT_FRONT_SMALL:
|
case BRIGHTLIGHT_FRONT_SMALL:
|
||||||
case BRIGHTLIGHT_REAR_SMALL:
|
case BRIGHTLIGHT_REAR_SMALL:
|
||||||
for(j = 0; j < 8; j++){
|
for(j = 0; j < 8; j++){
|
||||||
|
@ -809,7 +808,7 @@ CBrightLights::Render(void)
|
||||||
TempBufferVerticesStored += 8;
|
TempBufferVerticesStored += 8;
|
||||||
TempBufferIndicesStored += 12*3;
|
TempBufferIndicesStored += 12*3;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case BRIGHTLIGHT_FRONT_TALL:
|
case BRIGHTLIGHT_FRONT_TALL:
|
||||||
case BRIGHTLIGHT_REAR_TALL:
|
case BRIGHTLIGHT_REAR_TALL:
|
||||||
for(j = 0; j < 8; j++){
|
for(j = 0; j < 8; j++){
|
||||||
|
@ -840,17 +839,17 @@ CBrightLights::Render(void)
|
||||||
TempBufferIndicesStored += 4*3;
|
TempBufferIndicesStored += 4*3;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RenderOutGeometryBuffer();
|
RenderOutGeometryBuffer();
|
||||||
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)FALSE);
|
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)FALSE);
|
||||||
NumBrightLights = 0;
|
NumBrightLights = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
CBrightLights::RenderOutGeometryBuffer(void)
|
CBrightLights::RenderOutGeometryBuffer(void)
|
||||||
{
|
{
|
||||||
if(TempBufferIndicesStored != 0){
|
if(TempBufferIndicesStored != 0){
|
||||||
LittleTest();
|
LittleTest();
|
||||||
if(RwIm3DTransform(TempBufferRenderVertices, TempBufferVerticesStored, nil, rwIM3D_VERTEXUV)){
|
if(RwIm3DTransform(TempBufferRenderVertices, TempBufferVerticesStored, nil, rwIM3D_VERTEXUV)){
|
||||||
|
@ -864,13 +863,13 @@ CBrightLights::RenderOutGeometryBuffer(void)
|
||||||
|
|
||||||
int CShinyTexts::NumShinyTexts;
|
int CShinyTexts::NumShinyTexts;
|
||||||
CShinyText CShinyTexts::aShinyTexts[NUMSHINYTEXTS];
|
CShinyText CShinyTexts::aShinyTexts[NUMSHINYTEXTS];
|
||||||
|
|
||||||
void
|
void
|
||||||
CShinyTexts::Init(void)
|
CShinyTexts::Init(void)
|
||||||
{
|
{
|
||||||
NumShinyTexts = 0;
|
NumShinyTexts = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
CShinyTexts::RegisterOne(CVector p0, CVector p1, CVector p2, CVector p3,
|
CShinyTexts::RegisterOne(CVector p0, CVector p1, CVector p2, CVector p3,
|
||||||
float u0, float v0, float u1, float v1, float u2, float v2, float u3, float v3,
|
float u0, float v0, float u1, float v1, float u2, float v2, float u3, float v3,
|
||||||
|
@ -910,20 +909,20 @@ CShinyTexts::RegisterOne(CVector p0, CVector p1, CVector p2, CVector p3,
|
||||||
NumShinyTexts++;
|
NumShinyTexts++;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
CShinyTexts::Render(void)
|
CShinyTexts::Render(void)
|
||||||
{
|
{
|
||||||
int i, ix, v;
|
int i, ix, v;
|
||||||
RwTexture *lastTex = nil;
|
RwTexture *lastTex = nil;
|
||||||
|
|
||||||
if(NumShinyTexts == 0)
|
if(NumShinyTexts == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE);
|
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE);
|
||||||
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)FALSE);
|
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)FALSE);
|
||||||
RwRenderStateSet(rwRENDERSTATESRCBLEND, (void*)rwBLENDONE);
|
RwRenderStateSet(rwRENDERSTATESRCBLEND, (void*)rwBLENDONE);
|
||||||
RwRenderStateSet(rwRENDERSTATEDESTBLEND, (void*)rwBLENDONE);
|
RwRenderStateSet(rwRENDERSTATEDESTBLEND, (void*)rwBLENDONE);
|
||||||
|
|
||||||
TempBufferVerticesStored = 0;
|
TempBufferVerticesStored = 0;
|
||||||
TempBufferIndicesStored = 0;
|
TempBufferIndicesStored = 0;
|
||||||
|
|
||||||
|
@ -984,15 +983,15 @@ CShinyTexts::Render(void)
|
||||||
RenderOutGeometryBuffer();
|
RenderOutGeometryBuffer();
|
||||||
NumShinyTexts = 0;
|
NumShinyTexts = 0;
|
||||||
|
|
||||||
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)FALSE);
|
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)FALSE);
|
||||||
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)TRUE);
|
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)TRUE);
|
||||||
RwRenderStateSet(rwRENDERSTATESRCBLEND, (void*)rwBLENDSRCALPHA);
|
RwRenderStateSet(rwRENDERSTATESRCBLEND, (void*)rwBLENDSRCALPHA);
|
||||||
RwRenderStateSet(rwRENDERSTATEDESTBLEND, (void*)rwBLENDINVSRCALPHA);
|
RwRenderStateSet(rwRENDERSTATEDESTBLEND, (void*)rwBLENDINVSRCALPHA);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
CShinyTexts::RenderOutGeometryBuffer(void)
|
CShinyTexts::RenderOutGeometryBuffer(void)
|
||||||
{
|
{
|
||||||
if(TempBufferIndicesStored != 0){
|
if(TempBufferIndicesStored != 0){
|
||||||
LittleTest();
|
LittleTest();
|
||||||
if(RwIm3DTransform(TempBufferRenderVertices, TempBufferVerticesStored, nil, rwIM3D_VERTEXUV)){
|
if(RwIm3DTransform(TempBufferRenderVertices, TempBufferVerticesStored, nil, rwIM3D_VERTEXUV)){
|
||||||
|
@ -1002,8 +1001,8 @@ CShinyTexts::RenderOutGeometryBuffer(void)
|
||||||
TempBufferVerticesStored = 0;
|
TempBufferVerticesStored = 0;
|
||||||
TempBufferIndicesStored = 0;
|
TempBufferIndicesStored = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define MONEY_MESSAGE_LIFETIME_MS 2000
|
#define MONEY_MESSAGE_LIFETIME_MS 2000
|
||||||
|
|
|
@ -432,6 +432,7 @@ void
|
||||||
CSprite::Set6Vertices2D(RwIm2DVertex *verts, const CRect &r, const CRGBA &c0, const CRGBA &c1, const CRGBA &c2, const CRGBA &c3)
|
CSprite::Set6Vertices2D(RwIm2DVertex *verts, const CRect &r, const CRGBA &c0, const CRGBA &c1, const CRGBA &c2, const CRGBA &c3)
|
||||||
{
|
{
|
||||||
float screenz, recipz;
|
float screenz, recipz;
|
||||||
|
float z = RwCameraGetNearClipPlane(Scene.camera); // not done by game
|
||||||
|
|
||||||
screenz = m_f2DNearScreenZ;
|
screenz = m_f2DNearScreenZ;
|
||||||
recipz = m_fRecipNearClipPlane;
|
recipz = m_fRecipNearClipPlane;
|
||||||
|
@ -496,6 +497,7 @@ CSprite::Set6Vertices2D(RwIm2DVertex *verts, float x1, float y1, float x2, float
|
||||||
const CRGBA &c0, const CRGBA &c1, const CRGBA &c2, const CRGBA &c3)
|
const CRGBA &c0, const CRGBA &c1, const CRGBA &c2, const CRGBA &c3)
|
||||||
{
|
{
|
||||||
float screenz, recipz;
|
float screenz, recipz;
|
||||||
|
float z = RwCameraGetNearClipPlane(Scene.camera); // not done by game
|
||||||
|
|
||||||
screenz = m_f2DNearScreenZ;
|
screenz = m_f2DNearScreenZ;
|
||||||
recipz = m_fRecipNearClipPlane;
|
recipz = m_fRecipNearClipPlane;
|
||||||
|
|
|
@ -267,6 +267,7 @@ CSprite2d::SetVertices(float x1, float y1, float x2, float y2, float x3, float y
|
||||||
const CRGBA &c0, const CRGBA &c1, const CRGBA &c2, const CRGBA &c3)
|
const CRGBA &c0, const CRGBA &c1, const CRGBA &c2, const CRGBA &c3)
|
||||||
{
|
{
|
||||||
float screenz, recipz;
|
float screenz, recipz;
|
||||||
|
float z = RwCameraGetNearClipPlane(Scene.camera); // not done by game
|
||||||
|
|
||||||
screenz = RwIm2DGetNearScreenZ();
|
screenz = RwIm2DGetNearScreenZ();
|
||||||
recipz = RecipNearClip;
|
recipz = RecipNearClip;
|
||||||
|
@ -312,10 +313,11 @@ void
|
||||||
CSprite2d::SetVertices(int n, float *positions, float *uvs, const CRGBA &col)
|
CSprite2d::SetVertices(int n, float *positions, float *uvs, const CRGBA &col)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
float screenz, recipz;
|
float screenz, recipz, z;
|
||||||
|
|
||||||
screenz = RwIm2DGetNearScreenZ();
|
screenz = RwIm2DGetNearScreenZ();
|
||||||
recipz = RecipNearClip;
|
recipz = RecipNearClip;
|
||||||
|
z = RwCameraGetNearClipPlane(Scene.camera); // not done by game
|
||||||
|
|
||||||
|
|
||||||
for(i = 0; i < n; i++){
|
for(i = 0; i < n; i++){
|
||||||
|
@ -334,10 +336,11 @@ void
|
||||||
CSprite2d::SetMaskVertices(int n, float *positions)
|
CSprite2d::SetMaskVertices(int n, float *positions)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
float screenz, recipz;
|
float screenz, recipz, z;
|
||||||
|
|
||||||
screenz = RwIm2DGetNearScreenZ();
|
screenz = RwIm2DGetNearScreenZ();
|
||||||
recipz = RecipNearClip;
|
recipz = RecipNearClip;
|
||||||
|
z = RwCameraGetNearClipPlane(Scene.camera); // not done by game
|
||||||
|
|
||||||
for(i = 0; i < n; i++){
|
for(i = 0; i < n; i++){
|
||||||
RwIm2DVertexSetScreenX(&maVertices[i], positions[i*2 + 0]);
|
RwIm2DVertexSetScreenX(&maVertices[i], positions[i*2 + 0]);
|
||||||
|
@ -345,7 +348,7 @@ CSprite2d::SetMaskVertices(int n, float *positions)
|
||||||
RwIm2DVertexSetScreenZ(&maVertices[i], screenz);
|
RwIm2DVertexSetScreenZ(&maVertices[i], screenz);
|
||||||
RwIm2DVertexSetCameraZ(&maVertices[i], z);
|
RwIm2DVertexSetCameraZ(&maVertices[i], z);
|
||||||
RwIm2DVertexSetRecipCameraZ(&maVertices[i], recipz);
|
RwIm2DVertexSetRecipCameraZ(&maVertices[i], recipz);
|
||||||
RwIm2DVertexSetIntRGBA(&maVertices[i], 0, 0, 0, 0);
|
RwIm2DVertexSetIntRGBA(&maVertices[i], 255, 255, 255, 255); // 0, 0, 0, 0 on PC
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -353,10 +356,11 @@ void
|
||||||
CSprite2d::SetVertices(RwIm2DVertex *verts, const CRect &r, const CRGBA &c0, const CRGBA &c1, const CRGBA &c2, const CRGBA &c3,
|
CSprite2d::SetVertices(RwIm2DVertex *verts, const CRect &r, const CRGBA &c0, const CRGBA &c1, const CRGBA &c2, const CRGBA &c3,
|
||||||
float u0, float v0, float u1, float v1, float u3, float v3, float u2, float v2)
|
float u0, float v0, float u1, float v1, float u3, float v3, float u2, float v2)
|
||||||
{
|
{
|
||||||
float screenz, recipz;
|
float screenz, recipz, z;
|
||||||
|
|
||||||
screenz = RwIm2DGetNearScreenZ();
|
screenz = RwIm2DGetNearScreenZ();
|
||||||
recipz = RecipNearClip;
|
recipz = RecipNearClip;
|
||||||
|
z = RwCameraGetNearClipPlane(Scene.camera); // not done by game
|
||||||
|
|
||||||
RwIm2DVertexSetScreenX(&verts[0], r.left);
|
RwIm2DVertexSetScreenX(&verts[0], r.left);
|
||||||
RwIm2DVertexSetScreenY(&verts[0], r.top);
|
RwIm2DVertexSetScreenY(&verts[0], r.top);
|
||||||
|
@ -459,15 +463,15 @@ CSprite2d::DrawRectXLU(const CRect &r, const CRGBA &c0, const CRGBA &c1, const C
|
||||||
|
|
||||||
void CSprite2d::Draw2DPolygon(float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4, const CRGBA &color)
|
void CSprite2d::Draw2DPolygon(float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4, const CRGBA &color)
|
||||||
{
|
{
|
||||||
SetVertices(x1, y1, x2, y2, x3, y3, x4, y4, color, color, color, color);
|
SetVertices(x1, y1, x2, y2, x3, y3, x4, y4, color, color, color, color);
|
||||||
RwRenderStateSet(rwRENDERSTATETEXTURERASTER, 0);
|
RwRenderStateSet(rwRENDERSTATETEXTURERASTER, 0);
|
||||||
RwRenderStateSet(rwRENDERSTATESHADEMODE, (void*)rwSHADEMODEFLAT);
|
RwRenderStateSet(rwRENDERSTATESHADEMODE, (void*)rwSHADEMODEFLAT);
|
||||||
RwRenderStateSet(rwRENDERSTATEZTESTENABLE, (void*)FALSE);
|
RwRenderStateSet(rwRENDERSTATEZTESTENABLE, (void*)FALSE);
|
||||||
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)FALSE);
|
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)FALSE);
|
||||||
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)(color.a != 255));
|
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)(color.a != 255));
|
||||||
RwIm2DRenderPrimitive(rwPRIMTYPETRIFAN, CSprite2d::maVertices, 4);
|
RwIm2DRenderPrimitive(rwPRIMTYPETRIFAN, CSprite2d::maVertices, 4);
|
||||||
RwRenderStateSet(rwRENDERSTATEZTESTENABLE, (void*)TRUE);
|
RwRenderStateSet(rwRENDERSTATEZTESTENABLE, (void*)TRUE);
|
||||||
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)TRUE);
|
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)TRUE);
|
||||||
RwRenderStateSet(rwRENDERSTATESHADEMODE, (void*)rwSHADEMODEGOURAUD);
|
RwRenderStateSet(rwRENDERSTATESHADEMODE, (void*)rwSHADEMODEGOURAUD);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -117,7 +117,7 @@ CVisibilityPlugins::SetRenderWareCamera(RwCamera *camera)
|
||||||
RpMaterial*
|
RpMaterial*
|
||||||
SetAlphaCB(RpMaterial *material, void *data)
|
SetAlphaCB(RpMaterial *material, void *data)
|
||||||
{
|
{
|
||||||
material->color.alpha = (uint8)(uint32)data;
|
((RwRGBA*)RpMaterialGetColor(material))->alpha = (uint8)(uint32)data;
|
||||||
return material;
|
return material;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -182,17 +182,17 @@ CAutomobile::CAutomobile(int32 id, uint8 CreatedBy)
|
||||||
m_weaponDoorTimerRight = m_weaponDoorTimerLeft;
|
m_weaponDoorTimerRight = m_weaponDoorTimerLeft;
|
||||||
|
|
||||||
if(GetModelIndex() == MI_DODO){
|
if(GetModelIndex() == MI_DODO){
|
||||||
RpAtomicSetFlags(GetFirstObject(m_aCarNodes[CAR_WHEEL_LF]), 0);
|
RpAtomicSetFlags((RpAtomic*)GetFirstObject(m_aCarNodes[CAR_WHEEL_LF]), 0);
|
||||||
CMatrix mat1;
|
CMatrix mat1;
|
||||||
mat1.Attach(RwFrameGetMatrix(m_aCarNodes[CAR_WHEEL_RF]));
|
mat1.Attach(RwFrameGetMatrix(m_aCarNodes[CAR_WHEEL_RF]));
|
||||||
CMatrix mat2(RwFrameGetMatrix(m_aCarNodes[CAR_WHEEL_LF]));
|
CMatrix mat2(RwFrameGetMatrix(m_aCarNodes[CAR_WHEEL_LF]));
|
||||||
mat1.GetPosition() += CVector(mat2.GetPosition().x + 0.1f, 0.0f, mat2.GetPosition().z);
|
mat1.GetPosition() += CVector(mat2.GetPosition().x + 0.1f, 0.0f, mat2.GetPosition().z);
|
||||||
mat1.UpdateRW();
|
mat1.UpdateRW();
|
||||||
}else if(GetModelIndex() == MI_MIAMI_SPARROW || GetModelIndex() == MI_MIAMI_RCRAIDER){
|
}else if(GetModelIndex() == MI_MIAMI_SPARROW || GetModelIndex() == MI_MIAMI_RCRAIDER){
|
||||||
RpAtomicSetFlags(GetFirstObject(m_aCarNodes[CAR_WHEEL_LF]), 0);
|
RpAtomicSetFlags((RpAtomic*)GetFirstObject(m_aCarNodes[CAR_WHEEL_LF]), 0);
|
||||||
RpAtomicSetFlags(GetFirstObject(m_aCarNodes[CAR_WHEEL_RF]), 0);
|
RpAtomicSetFlags((RpAtomic*)GetFirstObject(m_aCarNodes[CAR_WHEEL_RF]), 0);
|
||||||
RpAtomicSetFlags(GetFirstObject(m_aCarNodes[CAR_WHEEL_LB]), 0);
|
RpAtomicSetFlags((RpAtomic*)GetFirstObject(m_aCarNodes[CAR_WHEEL_LB]), 0);
|
||||||
RpAtomicSetFlags(GetFirstObject(m_aCarNodes[CAR_WHEEL_RB]), 0);
|
RpAtomicSetFlags((RpAtomic*)GetFirstObject(m_aCarNodes[CAR_WHEEL_RB]), 0);
|
||||||
}else if(GetModelIndex() == MI_RHINO){
|
}else if(GetModelIndex() == MI_RHINO){
|
||||||
bExplosionProof = true;
|
bExplosionProof = true;
|
||||||
bBulletProof = true;
|
bBulletProof = true;
|
||||||
|
|
|
@ -94,7 +94,7 @@ CBoat::GetComponentWorldPosition(int32 component, CVector &pos)
|
||||||
pos = *RwMatrixGetPos(RwFrameGetLTM(m_aBoatNodes[component]));
|
pos = *RwMatrixGetPos(RwFrameGetLTM(m_aBoatNodes[component]));
|
||||||
}
|
}
|
||||||
|
|
||||||
RxObjSpace3DVertex KeepWaterOutVertices[4];
|
RwIm3DVertex KeepWaterOutVertices[4];
|
||||||
RwImVertexIndex KeepWaterOutIndices[6];
|
RwImVertexIndex KeepWaterOutIndices[6];
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -103,7 +103,7 @@ CBoat::Render()
|
||||||
CMatrix matrix;
|
CMatrix matrix;
|
||||||
|
|
||||||
if (m_aBoatNodes[1] != nil) {
|
if (m_aBoatNodes[1] != nil) {
|
||||||
matrix.Attach(&m_aBoatNodes[1]->modelling);
|
matrix.Attach(RwFrameGetMatrix(m_aBoatNodes[1]));
|
||||||
|
|
||||||
CVector pos = matrix.GetPosition();
|
CVector pos = matrix.GetPosition();
|
||||||
matrix.SetRotateZ(m_fMovingHiRotation);
|
matrix.SetRotateZ(m_fMovingHiRotation);
|
||||||
|
@ -111,7 +111,7 @@ CBoat::Render()
|
||||||
|
|
||||||
matrix.UpdateRW();
|
matrix.UpdateRW();
|
||||||
if (CVehicle::bWheelsOnlyCheat) {
|
if (CVehicle::bWheelsOnlyCheat) {
|
||||||
RpAtomicRenderMacro((RpAtomic*)GetFirstObject(m_aBoatNodes[1]));
|
RpAtomicRender((RpAtomic*)GetFirstObject(m_aBoatNodes[1]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
m_fMovingHiRotation += 0.05f;
|
m_fMovingHiRotation += 0.05f;
|
||||||
|
@ -130,47 +130,23 @@ CBoat::Render()
|
||||||
KeepWaterOutIndices[5] = 3;
|
KeepWaterOutIndices[5] = 3;
|
||||||
switch (GetModelIndex()) {
|
switch (GetModelIndex()) {
|
||||||
case MI_SPEEDER:
|
case MI_SPEEDER:
|
||||||
KeepWaterOutVertices[0].objVertex.x = -1.15f;
|
RwIm3DVertexSetPos(&KeepWaterOutVertices[0], -1.15f, 3.61f, 1.03f);
|
||||||
KeepWaterOutVertices[0].objVertex.y = 3.61f;
|
RwIm3DVertexSetPos(&KeepWaterOutVertices[1], 1.15f, 3.61f, 1.03f);
|
||||||
KeepWaterOutVertices[0].objVertex.z = 1.03f;
|
RwIm3DVertexSetPos(&KeepWaterOutVertices[2], -1.15f, 0.06f, 1.03f);
|
||||||
KeepWaterOutVertices[1].objVertex.x = 1.15f;
|
RwIm3DVertexSetPos(&KeepWaterOutVertices[3], 1.15f, 0.06f, 1.03f);
|
||||||
KeepWaterOutVertices[1].objVertex.y = 3.61f;
|
|
||||||
KeepWaterOutVertices[1].objVertex.z = 1.03f;
|
|
||||||
KeepWaterOutVertices[2].objVertex.x = -1.15f;
|
|
||||||
KeepWaterOutVertices[2].objVertex.y = 0.06f;
|
|
||||||
KeepWaterOutVertices[2].objVertex.z = 1.03f;
|
|
||||||
KeepWaterOutVertices[3].objVertex.x = 1.15f;
|
|
||||||
KeepWaterOutVertices[3].objVertex.y = 0.06f;
|
|
||||||
KeepWaterOutVertices[3].objVertex.z = 1.03f;
|
|
||||||
break;
|
break;
|
||||||
case MI_REEFER:
|
case MI_REEFER:
|
||||||
KeepWaterOutVertices[2].objVertex.x = -1.9f;
|
RwIm3DVertexSetPos(&KeepWaterOutVertices[0], -1.9f, 2.83f, 1.0f);
|
||||||
KeepWaterOutVertices[2].objVertex.y = 2.83f;
|
RwIm3DVertexSetPos(&KeepWaterOutVertices[1], 1.9f, 2.83f, 1.0f);
|
||||||
KeepWaterOutVertices[2].objVertex.z = 1.0f;
|
RwIm3DVertexSetPos(&KeepWaterOutVertices[2], -1.66f, -4.48f, 0.83f);
|
||||||
KeepWaterOutVertices[3].objVertex.x = 1.9f;
|
RwIm3DVertexSetPos(&KeepWaterOutVertices[3], 1.66f, -4.48f, 0.83f);
|
||||||
KeepWaterOutVertices[3].objVertex.y = 2.83f;
|
|
||||||
KeepWaterOutVertices[3].objVertex.z = 1.0f;
|
|
||||||
KeepWaterOutVertices[0].objVertex.x = -1.66f;
|
|
||||||
KeepWaterOutVertices[0].objVertex.y = -4.48f;
|
|
||||||
KeepWaterOutVertices[0].objVertex.z = 0.83f;
|
|
||||||
KeepWaterOutVertices[1].objVertex.x = 1.66f;
|
|
||||||
KeepWaterOutVertices[1].objVertex.y = -4.48f;
|
|
||||||
KeepWaterOutVertices[1].objVertex.z = 0.83f;
|
|
||||||
break;
|
break;
|
||||||
case MI_PREDATOR:
|
case MI_PREDATOR:
|
||||||
default:
|
default:
|
||||||
KeepWaterOutVertices[0].objVertex.x = -1.45f;
|
RwIm3DVertexSetPos(&KeepWaterOutVertices[0], -1.45f, 1.9f, 0.96f);
|
||||||
KeepWaterOutVertices[0].objVertex.y = 1.9f;
|
RwIm3DVertexSetPos(&KeepWaterOutVertices[1], 1.45f, 1.9f, 0.96f);
|
||||||
KeepWaterOutVertices[0].objVertex.z = 0.96f;
|
RwIm3DVertexSetPos(&KeepWaterOutVertices[2], -1.45f, -3.75f, 0.96f);
|
||||||
KeepWaterOutVertices[1].objVertex.x = 1.45f;
|
RwIm3DVertexSetPos(&KeepWaterOutVertices[3], 1.45f, -3.75f, 0.96f);
|
||||||
KeepWaterOutVertices[1].objVertex.y = 1.9f;
|
|
||||||
KeepWaterOutVertices[1].objVertex.z = 0.96f;
|
|
||||||
KeepWaterOutVertices[2].objVertex.x = -1.45f;
|
|
||||||
KeepWaterOutVertices[2].objVertex.y = -3.75f;
|
|
||||||
KeepWaterOutVertices[2].objVertex.z = 0.96f;
|
|
||||||
KeepWaterOutVertices[3].objVertex.x = 1.45f;
|
|
||||||
KeepWaterOutVertices[3].objVertex.y = -3.75f;
|
|
||||||
KeepWaterOutVertices[3].objVertex.z = 0.96f;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
KeepWaterOutVertices[0].u = 0.0f;
|
KeepWaterOutVertices[0].u = 0.0f;
|
||||||
|
|
Loading…
Reference in a new issue