mirror of
https://gitlab.com/GaryOderNichts/re3-wiiu.git
synced 2024-12-25 01:01:49 +01:00
rubbish done
This commit is contained in:
parent
6514bc6b39
commit
0bb46f3f8c
@ -61,6 +61,7 @@ int32 CStats::FastestTimes[CStats::TOTAL_FASTEST_TIMES];
|
|||||||
int32 CStats::HighestScores[CStats::TOTAL_HIGHEST_SCORES];
|
int32 CStats::HighestScores[CStats::TOTAL_HIGHEST_SCORES];
|
||||||
int32 CStats::BestPositions[CStats::TOTAL_BEST_POSITIONS];
|
int32 CStats::BestPositions[CStats::TOTAL_BEST_POSITIONS];
|
||||||
int32 CStats::PropertyDestroyed;
|
int32 CStats::PropertyDestroyed;
|
||||||
|
int32 CStats::PamphletMissionPassed;
|
||||||
|
|
||||||
int32 CStats::Sprayings;
|
int32 CStats::Sprayings;
|
||||||
float CStats::AutoPaintingBudget;
|
float CStats::AutoPaintingBudget;
|
||||||
|
@ -65,6 +65,7 @@ public:
|
|||||||
static int32 HighestScores[TOTAL_HIGHEST_SCORES];
|
static int32 HighestScores[TOTAL_HIGHEST_SCORES];
|
||||||
static int32 BestPositions[TOTAL_BEST_POSITIONS];
|
static int32 BestPositions[TOTAL_BEST_POSITIONS];
|
||||||
static int32 PropertyDestroyed;
|
static int32 PropertyDestroyed;
|
||||||
|
static int32 PamphletMissionPassed;
|
||||||
static int32 Sprayings;
|
static int32 Sprayings;
|
||||||
static float AutoPaintingBudget;
|
static float AutoPaintingBudget;
|
||||||
static int32 NoMoreHurricanes;
|
static int32 NoMoreHurricanes;
|
||||||
|
@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
#include "Antennas.h"
|
#include "Antennas.h"
|
||||||
|
|
||||||
|
//--MIAMI: file done
|
||||||
|
|
||||||
CAntenna CAntennas::aAntennas[NUMANTENNAS];
|
CAntenna CAntennas::aAntennas[NUMANTENNAS];
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -8,17 +8,18 @@
|
|||||||
#include "World.h"
|
#include "World.h"
|
||||||
#include "Vehicle.h"
|
#include "Vehicle.h"
|
||||||
#include "ZoneCull.h"
|
#include "ZoneCull.h"
|
||||||
|
#include "Stats.h"
|
||||||
#include "TxdStore.h"
|
#include "TxdStore.h"
|
||||||
#include "RenderBuffer.h"
|
#include "RenderBuffer.h"
|
||||||
#include "Rubbish.h"
|
#include "Rubbish.h"
|
||||||
|
|
||||||
#define RUBBISH_MAX_DIST (18.0f)
|
//--MIAMI: file done
|
||||||
#define RUBBISH_FADE_DIST (16.5f)
|
|
||||||
|
#define RUBBISH_MAX_DIST (23.0f)
|
||||||
|
#define RUBBISH_FADE_DIST (20.0f)
|
||||||
|
|
||||||
RwTexture *gpRubbishTexture[4];
|
RwTexture *gpRubbishTexture[4];
|
||||||
RwImVertexIndex RubbishIndexList[6];
|
RwImVertexIndex RubbishIndexList[6];
|
||||||
RwImVertexIndex RubbishIndexList2[6]; // unused
|
|
||||||
RwIm3DVertex RubbishVertices[4];
|
|
||||||
bool CRubbish::bRubbishInvisible;
|
bool CRubbish::bRubbishInvisible;
|
||||||
int CRubbish::RubbishVisibility;
|
int CRubbish::RubbishVisibility;
|
||||||
COneSheet CRubbish::aSheets[NUM_RUBBISH_SHEETS];
|
COneSheet CRubbish::aSheets[NUM_RUBBISH_SHEETS];
|
||||||
@ -52,12 +53,16 @@ CRubbish::Render(void)
|
|||||||
{
|
{
|
||||||
int type;
|
int type;
|
||||||
|
|
||||||
|
if(RubbishVisibility == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)FALSE);
|
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)FALSE);
|
||||||
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE);
|
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE);
|
||||||
RwRenderStateSet(rwRENDERSTATEFOGENABLE, (void*)TRUE);
|
RwRenderStateSet(rwRENDERSTATEFOGENABLE, (void*)TRUE);
|
||||||
|
|
||||||
for(type = 0; type < 4; type++){
|
for(type = 0; type < 4; type++){
|
||||||
RwRenderStateSet(rwRENDERSTATETEXTURERASTER, RwTextureGetRaster(gpRubbishTexture[type]));
|
if(type < 3 || CStats::PamphletMissionPassed)
|
||||||
|
RwRenderStateSet(rwRENDERSTATETEXTURERASTER, RwTextureGetRaster(gpRubbishTexture[type]));
|
||||||
|
|
||||||
TempBufferIndicesStored = 0;
|
TempBufferIndicesStored = 0;
|
||||||
TempBufferVerticesStored = 0;
|
TempBufferVerticesStored = 0;
|
||||||
@ -69,7 +74,7 @@ CRubbish::Render(void)
|
|||||||
if(sheet->m_state == 0)
|
if(sheet->m_state == 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
uint32 alpha = 128;
|
uint32 alpha = 100;
|
||||||
CVector pos;
|
CVector pos;
|
||||||
if(sheet->m_state == 1){
|
if(sheet->m_state == 1){
|
||||||
pos = sheet->m_basePos;
|
pos = sheet->m_basePos;
|
||||||
@ -82,7 +87,7 @@ CRubbish::Render(void)
|
|||||||
float t = (float)(CTimer::GetTimeInMilliseconds() - sheet->m_moveStart)/sheet->m_moveDuration;
|
float t = (float)(CTimer::GetTimeInMilliseconds() - sheet->m_moveStart)/sheet->m_moveDuration;
|
||||||
float f1 = sheet->m_isVisible ? 1.0f-t : 0.0f;
|
float f1 = sheet->m_isVisible ? 1.0f-t : 0.0f;
|
||||||
float f2 = sheet->m_targetIsVisible ? t : 0.0f;
|
float f2 = sheet->m_targetIsVisible ? t : 0.0f;
|
||||||
alpha = 128 * (f1+f2);
|
alpha = 100 * (f1+f2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -92,17 +97,27 @@ CRubbish::Render(void)
|
|||||||
alpha -= alpha*(camDist-RUBBISH_FADE_DIST)/(RUBBISH_MAX_DIST-RUBBISH_FADE_DIST);
|
alpha -= alpha*(camDist-RUBBISH_FADE_DIST)/(RUBBISH_MAX_DIST-RUBBISH_FADE_DIST);
|
||||||
alpha = (RubbishVisibility*alpha)/256;
|
alpha = (RubbishVisibility*alpha)/256;
|
||||||
|
|
||||||
float vx = Sin(sheet->m_angle) * 0.4f;
|
float vx1, vy1, vx2, vy2;
|
||||||
float vy = Cos(sheet->m_angle) * 0.4f;
|
if(type == 0 || type == 1){
|
||||||
|
vx1 = 0.9f*Sin(sheet->m_angle);
|
||||||
|
vy1 = 0.9f*Cos(sheet->m_angle);
|
||||||
|
vx2 = 0.3f*Cos(sheet->m_angle);
|
||||||
|
vy2 = -0.3f*Sin(sheet->m_angle);
|
||||||
|
}else{
|
||||||
|
vx1 = 0.3f*Sin(sheet->m_angle);
|
||||||
|
vy1 = 0.3f*Cos(sheet->m_angle);
|
||||||
|
vx2 = 0.3f*Cos(sheet->m_angle);
|
||||||
|
vy2 = -0.3f*Sin(sheet->m_angle);
|
||||||
|
}
|
||||||
|
|
||||||
int v = TempBufferVerticesStored;
|
int v = TempBufferVerticesStored;
|
||||||
RwIm3DVertexSetPos(&TempBufferRenderVertices[v+0], pos.x + vx, pos.y + vy, pos.z);
|
RwIm3DVertexSetPos(&TempBufferRenderVertices[v+0], pos.x + vx1 + vx2, pos.y + vy1 + vy2, pos.z);
|
||||||
|
RwIm3DVertexSetPos(&TempBufferRenderVertices[v+1], pos.x + vx1 - vx2, pos.y + vy1 - vy2, pos.z);
|
||||||
|
RwIm3DVertexSetPos(&TempBufferRenderVertices[v+2], pos.x - vx1 + vx2, pos.y - vy1 + vy2, pos.z);
|
||||||
|
RwIm3DVertexSetPos(&TempBufferRenderVertices[v+3], pos.x - vx1 - vx2, pos.y - vy1 - vy2, pos.z);
|
||||||
RwIm3DVertexSetRGBA(&TempBufferRenderVertices[v+0], 255, 255, 255, alpha);
|
RwIm3DVertexSetRGBA(&TempBufferRenderVertices[v+0], 255, 255, 255, alpha);
|
||||||
RwIm3DVertexSetPos(&TempBufferRenderVertices[v+1], pos.x - vy, pos.y + vx, pos.z);
|
|
||||||
RwIm3DVertexSetRGBA(&TempBufferRenderVertices[v+1], 255, 255, 255, alpha);
|
RwIm3DVertexSetRGBA(&TempBufferRenderVertices[v+1], 255, 255, 255, alpha);
|
||||||
RwIm3DVertexSetPos(&TempBufferRenderVertices[v+2], pos.x + vy, pos.y - vx, pos.z);
|
|
||||||
RwIm3DVertexSetRGBA(&TempBufferRenderVertices[v+2], 255, 255, 255, alpha);
|
RwIm3DVertexSetRGBA(&TempBufferRenderVertices[v+2], 255, 255, 255, alpha);
|
||||||
RwIm3DVertexSetPos(&TempBufferRenderVertices[v+3], pos.x - vx, pos.y - vy, pos.z);
|
|
||||||
RwIm3DVertexSetRGBA(&TempBufferRenderVertices[v+3], 255, 255, 255, alpha);
|
RwIm3DVertexSetRGBA(&TempBufferRenderVertices[v+3], 255, 255, 255, alpha);
|
||||||
RwIm3DVertexSetU(&TempBufferRenderVertices[v+0], 0.0f);
|
RwIm3DVertexSetU(&TempBufferRenderVertices[v+0], 0.0f);
|
||||||
RwIm3DVertexSetV(&TempBufferRenderVertices[v+0], 0.0f);
|
RwIm3DVertexSetV(&TempBufferRenderVertices[v+0], 0.0f);
|
||||||
@ -373,24 +388,6 @@ CRubbish::Init(void)
|
|||||||
EndMoversList.m_next = nil;
|
EndMoversList.m_next = nil;
|
||||||
EndMoversList.m_prev = &StartMoversList;
|
EndMoversList.m_prev = &StartMoversList;
|
||||||
|
|
||||||
// unused
|
|
||||||
RwIm3DVertexSetU(&RubbishVertices[0], 0.0f);
|
|
||||||
RwIm3DVertexSetV(&RubbishVertices[0], 0.0f);
|
|
||||||
RwIm3DVertexSetU(&RubbishVertices[1], 1.0f);
|
|
||||||
RwIm3DVertexSetV(&RubbishVertices[1], 0.0f);
|
|
||||||
RwIm3DVertexSetU(&RubbishVertices[2], 0.0f);
|
|
||||||
RwIm3DVertexSetV(&RubbishVertices[2], 1.0f);
|
|
||||||
RwIm3DVertexSetU(&RubbishVertices[3], 1.0f);
|
|
||||||
RwIm3DVertexSetV(&RubbishVertices[3], 1.0f);
|
|
||||||
|
|
||||||
// unused
|
|
||||||
RubbishIndexList2[0] = 0;
|
|
||||||
RubbishIndexList2[1] = 2;
|
|
||||||
RubbishIndexList2[2] = 1;
|
|
||||||
RubbishIndexList2[3] = 1;
|
|
||||||
RubbishIndexList2[4] = 2;
|
|
||||||
RubbishIndexList2[5] = 3;
|
|
||||||
|
|
||||||
RubbishIndexList[0] = 0;
|
RubbishIndexList[0] = 0;
|
||||||
RubbishIndexList[1] = 1;
|
RubbishIndexList[1] = 1;
|
||||||
RubbishIndexList[2] = 2;
|
RubbishIndexList[2] = 2;
|
||||||
@ -414,19 +411,11 @@ void
|
|||||||
CRubbish::Shutdown(void)
|
CRubbish::Shutdown(void)
|
||||||
{
|
{
|
||||||
RwTextureDestroy(gpRubbishTexture[0]);
|
RwTextureDestroy(gpRubbishTexture[0]);
|
||||||
#ifdef GTA3_1_1_PATCH
|
|
||||||
gpRubbishTexture[0] = nil;
|
gpRubbishTexture[0] = nil;
|
||||||
#endif
|
|
||||||
RwTextureDestroy(gpRubbishTexture[1]);
|
RwTextureDestroy(gpRubbishTexture[1]);
|
||||||
#ifdef GTA3_1_1_PATCH
|
|
||||||
gpRubbishTexture[1] = nil;
|
gpRubbishTexture[1] = nil;
|
||||||
#endif
|
|
||||||
RwTextureDestroy(gpRubbishTexture[2]);
|
RwTextureDestroy(gpRubbishTexture[2]);
|
||||||
#ifdef GTA3_1_1_PATCH
|
|
||||||
gpRubbishTexture[2] = nil;
|
gpRubbishTexture[2] = nil;
|
||||||
#endif
|
|
||||||
RwTextureDestroy(gpRubbishTexture[3]);
|
RwTextureDestroy(gpRubbishTexture[3]);
|
||||||
#ifdef GTA3_1_1_PATCH
|
|
||||||
gpRubbishTexture[3] = nil;
|
gpRubbishTexture[3] = nil;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user