summaryrefslogtreecommitdiffstats
path: root/src/render
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2020-08-15 17:56:52 +0200
committerNikolay Korolev <nickvnuk@gmail.com>2020-08-15 17:56:52 +0200
commit1d5e3c74256038c763bbe8d1369715bc47f99dd8 (patch)
treeee2a1dac538b95ddb92d7744a6821917e7dd3056 /src/render
parentsubmodules (diff)
parentDon't react if player's targeting with melee (diff)
downloadre3-1d5e3c74256038c763bbe8d1369715bc47f99dd8.tar
re3-1d5e3c74256038c763bbe8d1369715bc47f99dd8.tar.gz
re3-1d5e3c74256038c763bbe8d1369715bc47f99dd8.tar.bz2
re3-1d5e3c74256038c763bbe8d1369715bc47f99dd8.tar.lz
re3-1d5e3c74256038c763bbe8d1369715bc47f99dd8.tar.xz
re3-1d5e3c74256038c763bbe8d1369715bc47f99dd8.tar.zst
re3-1d5e3c74256038c763bbe8d1369715bc47f99dd8.zip
Diffstat (limited to 'src/render')
-rw-r--r--src/render/Clouds.cpp84
-rw-r--r--src/render/Coronas.cpp41
-rw-r--r--src/render/Hud.cpp63
-rw-r--r--src/render/MBlur.cpp16
-rw-r--r--src/render/PointLights.cpp13
-rw-r--r--src/render/Renderer.cpp9
-rw-r--r--src/render/Sprite2d.cpp17
-rw-r--r--src/render/Timecycle.cpp120
-rw-r--r--src/render/Timecycle.h172
9 files changed, 282 insertions, 253 deletions
diff --git a/src/render/Clouds.cpp b/src/render/Clouds.cpp
index 60450213..05ddbcdc 100644
--- a/src/render/Clouds.cpp
+++ b/src/render/Clouds.cpp
@@ -78,6 +78,43 @@ CClouds::Update(void)
#endif
}
+float StarCoorsX[9] = { 0.0f, 0.05f, 0.12f, 0.5f, 0.8f, 0.6f, 0.27f, 0.55f, 0.75f };
+float StarCoorsY[9] = { 0.0f, 0.45f, 0.9f, 1.0f, 0.85f, 0.52f, 0.48f, 0.35f, 0.2f };
+float StarSizes[9] = { 1.0f, 1.4f, 0.9f, 1.0f, 0.6f, 1.5f, 1.3f, 1.0f, 0.8f };
+
+float LowCloudsX[12] = { 1.0f, 0.7f, 0.0f, -0.7f, -1.0f, -0.7f, 0.0f, 0.7f, 0.8f, -0.8f, 0.4f, -0.4f };
+float LowCloudsY[12] = { 0.0f, -0.7f, -1.0f, -0.7f, 0.0f, 0.7f, 1.0f, 0.7f, 0.4f, 0.4f, -0.8f, -0.8f };
+float LowCloudsZ[12] = { 0.0f, 1.0f, 0.5f, 0.0f, 1.0f, 0.3f, 0.9f, 0.4f, 1.3f, 1.4f, 1.2f, 1.7f };
+
+float CoorsOffsetX[37] = {
+ 0.0f, 60.0f, 72.0f, 48.0f, 21.0f, 12.0f,
+ 9.0f, -3.0f, -8.4f, -18.0f, -15.0f, -36.0f,
+ -40.0f, -48.0f, -60.0f, -24.0f, 100.0f, 100.0f,
+ 100.0f, 100.0f, 100.0f, 100.0f, 100.0f, 100.0f,
+ 100.0f, 100.0f, -30.0f, -20.0f, 10.0f, 30.0f,
+ 0.0f, -100.0f, -100.0f, -100.0f, -100.0f, -100.0f, -100.0f
+};
+float CoorsOffsetY[37] = {
+ 100.0f, 100.0f, 100.0f, 100.0f, 100.0f, 100.0f,
+ 100.0f, 100.0f, 100.0f, 100.0f, 100.0f, 100.0f,
+ 100.0f, 100.0f, 100.0f, 100.0f, -30.0f, 10.0f,
+ -25.0f, -5.0f, 28.0f, -10.0f, 10.0f, 0.0f,
+ 15.0f, 40.0f, -100.0f, -100.0f, -100.0f, -100.0f,
+ -100.0f, -40.0f, -20.0f, 0.0f, 10.0f, 30.0f, 35.0f
+};
+float CoorsOffsetZ[37] = {
+ 2.0f, 1.0f, 0.0f, 0.3f, 0.7f, 1.4f,
+ 1.7f, 0.24f, 0.7f, 1.3f, 1.6f, 1.0f,
+ 1.2f, 0.3f, 0.7f, 1.4f, 0.0f, 0.1f,
+ 0.5f, 0.4f, 0.55f, 0.75f, 1.0f, 1.4f,
+ 1.7f, 2.0f, 2.0f, 2.3f, 1.9f, 2.4f,
+ 2.0f, 2.0f, 1.5f, 1.2f, 1.7f, 1.5f, 2.1f
+};
+
+uint8 BowRed[6] = { 30, 30, 30, 10, 0, 15 };
+uint8 BowGreen[6] = { 0, 15, 30, 30, 0, 0 };
+uint8 BowBlue[6] = { 0, 0, 0, 10, 30, 30 };
+
void
CClouds::Render(void)
{
@@ -98,11 +135,10 @@ CClouds::Render(void)
int minute = CClock::GetHours()*60 + CClock::GetMinutes();
RwV3d campos = *(RwV3d*)&TheCamera.GetPosition();
- float coverage = Max(CWeather::Foggyness, CWeather::Foggyness);
-
// Moon
int moonfadeout = Abs(minute - 180); // fully visible at 3AM
if(moonfadeout < 180){ // fade in/out 3 hours
+ float coverage = Max(CWeather::Foggyness, CWeather::CloudCoverage);
int brightness = (1.0f - coverage) * (180 - moonfadeout);
RwV3d pos = { 0.0f, -100.0f, 15.0f };
RwV3dAdd(&worldpos, &campos, &pos);
@@ -131,11 +167,10 @@ CClouds::Render(void)
else if(CClock::GetHours() == 5)
starintens = 255 * (60 - CClock::GetMinutes())/60.0f;
if(starintens != 0){
- // R
- static float StarCoorsX[9] = { 0.0f, 0.05f, 0.12f, 0.5f, 0.8f, 0.6f, 0.27f, 0.55f, 0.75f };
- 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 };
+ float coverage = Max(CWeather::Foggyness, CWeather::CloudCoverage);
int brightness = (1.0f - coverage) * starintens;
+
+ // R
RwRenderStateSet(rwRENDERSTATETEXTURERASTER, RwTextureGetRaster(gpCoronaTexture[0]));
for(i = 0; i < 11; i++){
RwV3d pos = { 100.0f, 0.0f, 10.0f };
@@ -164,13 +199,7 @@ CClouds::Render(void)
}
// Low clouds
- static float LowCloudsX[12] = { 1.0f, 0.7f, 0.0f, -0.7f, -1.0f, -0.7f,
- 0.0f, 0.7f, 0.8f, -0.8f, 0.4f, -0.4f };
- static float LowCloudsY[12] = { 0.0f, -0.7f, -1.0f, -0.7f, 0.0f, 0.7f,
- 1.0f, 0.7f, 0.4f, 0.4f, -0.8f, -0.8f };
- static float LowCloudsZ[12] = { 0.0f, 1.0f, 0.5f, 0.0f, 1.0f, 0.3f,
- 0.9f, 0.4f, 1.3f, 1.4f, 1.2f, 1.7f };
- float lowcloudintensity = 1.0f - coverage;
+ float lowcloudintensity = 1.0f - Max(CWeather::Foggyness, CWeather::CloudCoverage);
int r = CTimeCycle::GetLowCloudsRed() * lowcloudintensity;
int g = CTimeCycle::GetLowCloudsGreen() * lowcloudintensity;
int b = CTimeCycle::GetLowCloudsBlue() * lowcloudintensity;
@@ -193,30 +222,6 @@ CClouds::Render(void)
float rot_cos = Cos(CloudRotation);
int fluffyalpha = 160 * (1.0f - CWeather::Foggyness);
if(fluffyalpha != 0){
- static float CoorsOffsetX[37] = {
- 0.0f, 60.0f, 72.0f, 48.0f, 21.0f, 12.0f,
- 9.0f, -3.0f, -8.4f, -18.0f, -15.0f, -36.0f,
- -40.0f, -48.0f, -60.0f, -24.0f, 100.0f, 100.0f,
- 100.0f, 100.0f, 100.0f, 100.0f, 100.0f, 100.0f,
- 100.0f, 100.0f, -30.0f, -20.0f, 10.0f, 30.0f,
- 0.0f, -100.0f, -100.0f, -100.0f, -100.0f, -100.0f, -100.0f
- };
- static float CoorsOffsetY[37] = {
- 100.0f, 100.0f, 100.0f, 100.0f, 100.0f, 100.0f,
- 100.0f, 100.0f, 100.0f, 100.0f, 100.0f, 100.0f,
- 100.0f, 100.0f, 100.0f, 100.0f, -30.0f, 10.0f,
- -25.0f, -5.0f, 28.0f, -10.0f, 10.0f, 0.0f,
- 15.0f, 40.0f, -100.0f, -100.0f, -100.0f, -100.0f,
- -100.0f, -40.0f, -20.0f, 0.0f, 10.0f, 30.0f, 35.0f
- };
- static float CoorsOffsetZ[37] = {
- 2.0f, 1.0f, 0.0f, 0.3f, 0.7f, 1.4f,
- 1.7f, 0.24f, 0.7f, 1.3f, 1.6f, 1.0f,
- 1.2f, 0.3f, 0.7f, 1.4f, 0.0f, 0.1f,
- 0.5f, 0.4f, 0.55f, 0.75f, 1.0f, 1.4f,
- 1.7f, 2.0f, 2.0f, 2.3f, 1.9f, 2.4f,
- 2.0f, 2.0f, 1.5f, 1.2f, 1.7f, 1.5f, 2.1f
- };
static bool bCloudOnScreen[37];
float hilight;
@@ -238,7 +243,7 @@ CClouds::Render(void)
int bg = CTimeCycle::GetFluffyCloudsBottomGreen();
int bb = CTimeCycle::GetFluffyCloudsBottomBlue();
if(sundist < SCREEN_WIDTH/2){
- hilight = (1.0f - coverage) * (1.0f - sundist/(SCREEN_WIDTH/2));
+ hilight = (1.0f - Max(CWeather::Foggyness, CWeather::CloudCoverage)) * (1.0f - sundist/(SCREEN_WIDTH/2));
tr = tr*(1.0f-hilight) + 255*hilight;
tg = tg*(1.0f-hilight) + 190*hilight;
tb = tb*(1.0f-hilight) + 190*hilight;
@@ -286,9 +291,6 @@ CClouds::Render(void)
// Rainbow
if(CWeather::Rainbow != 0.0f){
- static uint8 BowRed[6] = { 30, 30, 30, 10, 0, 15 };
- static uint8 BowGreen[6] = { 0, 15, 30, 30, 0, 0 };
- static uint8 BowBlue[6] = { 0, 0, 0, 10, 30, 30 };
RwRenderStateSet(rwRENDERSTATETEXTURERASTER, RwTextureGetRaster(gpCoronaTexture[0]));
for(i = 0; i < 6; i++){
RwV3d pos = { i*1.5f, 100.0f, 5.0f };
diff --git a/src/render/Coronas.cpp b/src/render/Coronas.cpp
index 5bf89403..d2d229f9 100644
--- a/src/render/Coronas.cpp
+++ b/src/render/Coronas.cpp
@@ -255,7 +255,10 @@ CCoronas::Render(void)
CVector spriteCoors;
float spritew, spriteh;
- if(CSprite::CalcScreenCoors(aCoronas[i].coors, spriteCoors, &spritew, &spriteh, true)){
+ if(!CSprite::CalcScreenCoors(aCoronas[i].coors, spriteCoors, &spritew, &spriteh, true)){
+ aCoronas[i].offScreen = true;
+ aCoronas[i].sightClear = false;
+ }else{
aCoronas[i].offScreen = false;
if(spriteCoors.x < 0.0f || spriteCoors.y < 0.0f ||
@@ -289,10 +292,7 @@ CCoronas::Render(void)
}
- if(aCoronas[i].fadeAlpha == 0)
- continue;
-
- if(spriteCoors.z < aCoronas[i].drawDist){
+ if(aCoronas[i].fadeAlpha && spriteCoors.z < aCoronas[i].drawDist){
float recipz = 1.0f/spriteCoors.z;
float fadeDistance = aCoronas[i].drawDist / 2.0f;
float distanceFade = spriteCoors.z < fadeDistance ? 1.0f : 1.0f - (spriteCoors.z - fadeDistance)/fadeDistance;
@@ -367,9 +367,6 @@ CCoronas::Render(void)
recipz, 255);
}
}
- }else{
- aCoronas[i].offScreen = true;
- aCoronas[i].sightClear = false;
}
}
}
@@ -390,23 +387,24 @@ CCoronas::Render(void)
if(!aCoronas[i].hasValue[j] || !aCoronas[i].hasValue[j+1])
continue;
- int mod1 = (float)(6 - j) / 6 * 128;
- int mod2 = (float)(6 - (j+1)) / 6 * 128;
+ int alpha1 = (float)(6 - j) / 6 * 128;
+ int alpha2 = (float)(6 - (j+1)) / 6 * 128;
RwIm2DVertexSetScreenX(&vertexbufferX[0], aCoronas[i].prevX[j]);
RwIm2DVertexSetScreenY(&vertexbufferX[0], aCoronas[i].prevY[j]);
- RwIm2DVertexSetIntRGBA(&vertexbufferX[0], aCoronas[i].prevRed[j] * mod1 / 256, aCoronas[i].prevGreen[j] * mod1 / 256, aCoronas[i].prevBlue[j] * mod1 / 256, 255);
+ RwIm2DVertexSetIntRGBA(&vertexbufferX[0], aCoronas[i].prevRed[j] * alpha1 / 256, aCoronas[i].prevGreen[j] * alpha1 / 256, aCoronas[i].prevBlue[j] * alpha1 / 256, 255);
RwIm2DVertexSetScreenX(&vertexbufferX[1], aCoronas[i].prevX[j+1]);
RwIm2DVertexSetScreenY(&vertexbufferX[1], aCoronas[i].prevY[j+1]);
- RwIm2DVertexSetIntRGBA(&vertexbufferX[1], aCoronas[i].prevRed[j+1] * mod2 / 256, aCoronas[i].prevGreen[j+1] * mod2 / 256, aCoronas[i].prevBlue[j+1] * mod2 / 256, 255);
+ RwIm2DVertexSetIntRGBA(&vertexbufferX[1], aCoronas[i].prevRed[j+1] * alpha2 / 256, aCoronas[i].prevGreen[j+1] * alpha2 / 256, aCoronas[i].prevBlue[j+1] * alpha2 / 256, 255);
- // BUG: game doesn't do this
+#ifdef FIX_BUGS
RwIm2DVertexSetScreenZ(&vertexbufferX[0], RwIm2DGetNearScreenZ());
RwIm2DVertexSetCameraZ(&vertexbufferX[0], RwCameraGetNearClipPlane(Scene.camera));
RwIm2DVertexSetRecipCameraZ(&vertexbufferX[0], 1.0f/RwCameraGetNearClipPlane(Scene.camera));
RwIm2DVertexSetScreenZ(&vertexbufferX[1], RwIm2DGetNearScreenZ());
RwIm2DVertexSetCameraZ(&vertexbufferX[1], RwCameraGetNearClipPlane(Scene.camera));
RwIm2DVertexSetRecipCameraZ(&vertexbufferX[1], 1.0f/RwCameraGetNearClipPlane(Scene.camera));
+#endif
RwIm2DRenderLine(vertexbufferX, 2, 0, 1);
}
@@ -425,6 +423,10 @@ CCoronas::RenderReflections(void)
CEntity *entity;
if(CWeather::WetRoads > 0.0f){
+#ifdef FIX_BUGS
+ CSprite::InitSpriteBuffer();
+#endif
+
RwRenderStateSet(rwRENDERSTATEFOGENABLE, (void*)FALSE);
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)FALSE);
RwRenderStateSet(rwRENDERSTATEZTESTENABLE, (void*)FALSE);
@@ -435,7 +437,8 @@ CCoronas::RenderReflections(void)
for(i = 0; i < NUMCORONAS; i++){
if(aCoronas[i].id == 0 ||
- aCoronas[i].fadeAlpha == 0 && aCoronas[i].alpha == 0)
+ aCoronas[i].fadeAlpha == 0 && aCoronas[i].alpha == 0 ||
+ aCoronas[i].reflection == 0)
continue;
// check if we want a reflection on this corona
@@ -450,11 +453,8 @@ CCoronas::RenderReflections(void)
}
}
- if(!aCoronas[i].renderReflection)
- continue;
-
// Don't draw if reflection is too high
- if(aCoronas[i].heightAboveRoad < 20.0f){
+ if(aCoronas[i].renderReflection && aCoronas[i].heightAboveRoad < 20.0f){
// don't draw if camera is below road
if(CCoronas::aCoronas[i].coors.z - aCoronas[i].heightAboveRoad > TheCamera.GetPosition().z)
continue;
@@ -466,13 +466,14 @@ CCoronas::RenderReflections(void)
float spritew, spriteh;
if(CSprite::CalcScreenCoors(coors, spriteCoors, &spritew, &spriteh, true)){
float drawDist = 0.75f * aCoronas[i].drawDist;
- drawDist = Min(drawDist, 50.0f);
+ drawDist = Min(drawDist, 55.0f);
if(spriteCoors.z < drawDist){
float fadeDistance = drawDist / 2.0f;
float distanceFade = spriteCoors.z < fadeDistance ? 1.0f : 1.0f - (spriteCoors.z - fadeDistance)/fadeDistance;
distanceFade = clamp(distanceFade, 0.0f, 1.0f);
float recipz = 1.0f/RwCameraGetNearClipPlane(Scene.camera);
- int intensity = (20.0f - aCoronas[i].heightAboveRoad) * 230.0 * distanceFade*CWeather::WetRoads * 0.05f;
+ float heightFade = (20.0f - aCoronas[i].heightAboveRoad)/20.0f;
+ int intensity = distanceFade*heightFade * 230.0 * CWeather::WetRoads;
CSprite::RenderBufferedOneXLUSprite(
spriteCoors.x, spriteCoors.y, RwIm2DGetNearScreenZ(),
diff --git a/src/render/Hud.cpp b/src/render/Hud.cpp
index 1e536382..08c0cb85 100644
--- a/src/render/Hud.cpp
+++ b/src/render/Hud.cpp
@@ -175,7 +175,8 @@ void CHud::Draw()
rect.right = f3rdX + SCREEN_SCALE_X(32.0f * 0.6f);
rect.bottom = f3rdY + SCREEN_SCALE_Y(32.0f * 0.6f);
- Sprites[HUD_SITEM16].Draw(CRect(rect), CRGBA(255, 255, 255, 255));
+ Sprites[HUD_SITEM16].Draw(CRect(rect), CRGBA(255, 255, 255, 255),
+ 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f);
}
else {
rect.left = f3rdX - SCREEN_SCALE_X(32.0f * 0.4f);
@@ -183,7 +184,8 @@ void CHud::Draw()
rect.right = f3rdX + SCREEN_SCALE_X(32.0f * 0.4f);
rect.bottom = f3rdY + SCREEN_SCALE_Y(32.0f * 0.4f);
- Sprites[HUD_SITEM16].Draw(CRect(rect), CRGBA(255, 255, 255, 255));
+ Sprites[HUD_SITEM16].Draw(CRect(rect), CRGBA(255, 255, 255, 255),
+ 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f);
}
}
else {
@@ -194,7 +196,9 @@ void CHud::Draw()
rect.top = (SCREEN_HEIGHT / 2) - SCREEN_SCALE_Y(32.0f);
rect.right = (SCREEN_WIDTH / 2) + SCREEN_SCALE_X(32.0f);
rect.bottom = (SCREEN_HEIGHT / 2) + SCREEN_SCALE_Y(32.0f);
- Sprites[HUD_SITEM16].Draw(CRect(rect), CRGBA(255, 255, 255, 255));
+ Sprites[HUD_SITEM16].Draw(CRect(rect), CRGBA(255, 255, 255, 255),
+ 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f);
+
}
else if (Mode == CCam::MODE_1STPERSON_RUNABOUT) {
rect.left = (SCREEN_WIDTH / 2) - SCREEN_SCALE_X(32.0f * 0.7f);
@@ -202,7 +206,8 @@ void CHud::Draw()
rect.right = (SCREEN_WIDTH / 2) + SCREEN_SCALE_X(32.0f * 0.7f);
rect.bottom = (SCREEN_HEIGHT / 2) + SCREEN_SCALE_Y(32.0f * 0.7f);
- Sprites[HUD_SITEM16].Draw(CRect(rect), CRGBA(255, 255, 255, 255));
+ Sprites[HUD_SITEM16].Draw(CRect(rect), CRGBA(255, 255, 255, 255),
+ 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, 1.0f);
}
else if (Mode == CCam::MODE_ROCKETLAUNCHER || Mode == CCam::MODE_ROCKETLAUNCHER_RUNABOUT) {
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void *)TRUE);
@@ -216,29 +221,33 @@ void CHud::Draw()
}
else {
// Sniper
- rect.left = (SCREEN_WIDTH / 2) - SCREEN_SCALE_X(210.0f);
- rect.top = (SCREEN_HEIGHT / 2) - SCREEN_SCALE_Y(210.0f);
- rect.right = SCREEN_WIDTH / 2;
- rect.bottom = SCREEN_HEIGHT / 2;
- Sprites[HUD_SITESNIPER].Draw(CRect(rect), CRGBA(255, 255, 255, 255));
-
- rect.right = (SCREEN_WIDTH / 2);
- rect.top = (SCREEN_HEIGHT / 2) - SCREEN_SCALE_Y(210.0f);
- rect.left = SCREEN_SCALE_X(210.0f) + (SCREEN_WIDTH / 2);
- rect.bottom = SCREEN_HEIGHT / 2;
- Sprites[HUD_SITESNIPER].Draw(CRect(rect), CRGBA(255, 255, 255, 255));
-
- rect.left = (SCREEN_WIDTH / 2) - SCREEN_SCALE_X(210.0f);
- rect.bottom = (SCREEN_HEIGHT / 2);
- rect.right = (SCREEN_WIDTH / 2);
- rect.top = SCREEN_SCALE_Y(210.0f) + (SCREEN_HEIGHT / 2);
- Sprites[HUD_SITESNIPER].Draw(CRect(rect), CRGBA(255, 255, 255, 255));
-
- rect.right = (SCREEN_WIDTH / 2);
- rect.bottom = (SCREEN_HEIGHT / 2);
- rect.left = SCREEN_SCALE_X(210.0f) + (SCREEN_WIDTH / 2);
- rect.top = SCREEN_SCALE_Y(210.0f) + (SCREEN_HEIGHT / 2);
- Sprites[HUD_SITESNIPER].Draw(CRect(rect), CRGBA(255, 255, 255, 255));
+ rect.left = SCREEN_WIDTH/2 - SCREEN_SCALE_X(210.0f);
+ rect.top = SCREEN_HEIGHT/2 - SCREEN_SCALE_Y(210.0f);
+ rect.right = SCREEN_WIDTH/2;
+ rect.bottom = SCREEN_HEIGHT/2;
+ Sprites[HUD_SITESNIPER].Draw(CRect(rect), CRGBA(255, 255, 255, 255),
+ 0.01f, 0.01f, 1.0f, 0.0f, 0.01f, 1.0f, 1.0f, 1.0f);
+
+ rect.left = SCREEN_WIDTH/2;
+ rect.top = SCREEN_HEIGHT/2 - SCREEN_SCALE_Y(210.0f);
+ rect.right = SCREEN_WIDTH/2 + SCREEN_SCALE_X(210.0f);
+ rect.bottom = SCREEN_HEIGHT/2;
+ Sprites[HUD_SITESNIPER].Draw(CRect(rect), CRGBA(255, 255, 255, 255),
+ 0.99f, 0.0f, 0.01f, 0.01f, 0.99f, 1.0f, 0.01f, 1.0f);
+
+ rect.left = SCREEN_WIDTH/2 - SCREEN_SCALE_X(210.0f);
+ rect.top = SCREEN_HEIGHT/2;
+ rect.right = SCREEN_WIDTH/2;
+ rect.bottom = SCREEN_HEIGHT/2 + SCREEN_SCALE_Y(210.0f);
+ Sprites[HUD_SITESNIPER].Draw(CRect(rect), CRGBA(255, 255, 255, 255),
+ 0.01f, 0.99f, 1.0f, 0.99f, 0.01f, 0.01f, 1.0f, 0.01f);
+
+ rect.left = SCREEN_WIDTH/2;
+ rect.top = SCREEN_HEIGHT/2;
+ rect.right = SCREEN_WIDTH/2 + SCREEN_SCALE_X(210.0f);
+ rect.bottom = SCREEN_HEIGHT/2 + SCREEN_SCALE_Y(210.0f);
+ Sprites[HUD_SITESNIPER].Draw(CRect(rect), CRGBA(255, 255, 255, 255),
+ 0.99f, 0.99f, 0.01f, 0.99f, 0.99f, 0.01f, 0.1f, 0.01f);
}
}
RwRenderStateSet(rwRENDERSTATETEXTUREFILTER, (void *)rwFILTERLINEAR);
diff --git a/src/render/MBlur.cpp b/src/render/MBlur.cpp
index ec811e56..de15358e 100644
--- a/src/render/MBlur.cpp
+++ b/src/render/MBlur.cpp
@@ -10,6 +10,7 @@
#include "RwHelper.h"
#include "Camera.h"
#include "MBlur.h"
+#include "postfx.h"
// Originally taken from RW example 'mblur'
@@ -27,6 +28,10 @@ extern "C" D3DCAPS8 _RwD3D8DeviceCaps;
RwBool
CMBlur::MotionBlurOpen(RwCamera *cam)
{
+#ifdef EXTENDED_COLOURFILTER
+ CPostFX::Open(cam);
+ return TRUE;
+#else
#ifdef GTA_PS2
RwRect rect = {0, 0, 0, 0};
@@ -127,18 +132,22 @@ CMBlur::MotionBlurOpen(RwCamera *cam)
return TRUE;
#endif
+#endif
}
RwBool
CMBlur::MotionBlurClose(void)
{
+#ifdef EXTENDED_COLOURFILTER
+ CPostFX::Close();
+#else
if(pFrontBuffer){
RwRasterDestroy(pFrontBuffer);
pFrontBuffer = nil;
return TRUE;
}
-
+#endif
return FALSE;
}
@@ -192,12 +201,14 @@ CMBlur::CreateImmediateModeData(RwCamera *cam, RwRect *rect)
RwIm2DVertexSetU(&Vertex[3], 1.0f, 1.0f/RwCameraGetNearClipPlane(cam));
RwIm2DVertexSetV(&Vertex[3], 0.0f, 1.0f/RwCameraGetNearClipPlane(cam));
RwIm2DVertexSetIntRGBA(&Vertex[3], 255, 255, 255, 255);
-
}
void
CMBlur::MotionBlurRender(RwCamera *cam, uint32 red, uint32 green, uint32 blue, uint32 blur, int32 type, uint32 bluralpha)
{
+#ifdef EXTENDED_COLOURFILTER
+ CPostFX::Render(cam, red, green, blue, blur, type, bluralpha);
+#else
RwRGBA color = { (RwUInt8)red, (RwUInt8)green, (RwUInt8)blue, (RwUInt8)blur };
#ifdef GTA_PS2
if( pFrontBuffer )
@@ -217,6 +228,7 @@ CMBlur::MotionBlurRender(RwCamera *cam, uint32 red, uint32 green, uint32 blue, u
OverlayRender(cam, nil, color, type, bluralpha);
}
#endif
+#endif
}
void
diff --git a/src/render/PointLights.cpp b/src/render/PointLights.cpp
index 88b9aaea..0713dc6d 100644
--- a/src/render/PointLights.cpp
+++ b/src/render/PointLights.cpp
@@ -86,12 +86,11 @@ CPointLights::GenerateLightsAffectingObject(Const CVector *objCoors)
ret *= distNorm;
}else{
float intensity;
+ // distance fade
if(distNorm < 0.5f)
- // near enough
intensity = 1.0f;
else
- // attenuate
- intensity = 1.0f - (distNorm - 0.5f)*2.0f;
+ intensity = 1.0f - (distNorm - 0.5f)/(1.0f - 0.5f);
if(distance != 0.0f){
CVector dir = dist / distance;
@@ -153,7 +152,7 @@ CPointLights::RenderFogEffect(void)
if(aLights[i].fogType != FOG_NORMAL && aLights[i].fogType != FOG_ALWAYS)
continue;
- fogginess = aLights[i].fogType == FOG_ALWAYS ? 1.0f : CWeather::Foggyness;
+ fogginess = aLights[i].fogType == FOG_NORMAL ? CWeather::Foggyness : 1.0f;
if(fogginess == 0.0f)
continue;
@@ -198,7 +197,7 @@ CPointLights::RenderFogEffect(void)
float distsq = sq(dx) + sq(dy);
float linedistsq = distsq - sq(dot);
if(dot > 0.0f && dot < FOG_AREA_LENGTH && linedistsq < sq(FOG_AREA_WIDTH)){
- CVector fogcoors(xi, yi, aLights[i].coors.z + 1.0f);
+ CVector fogcoors(xi, yi, aLights[i].coors.z + 10.0f);
if(CWorld::ProcessVerticalLine(fogcoors, fogcoors.z - 20.0f,
point, entity, true, false, false, false, true, false, nil)){
// Now same check again in xyz
@@ -220,7 +219,7 @@ CPointLights::RenderFogEffect(void)
intensity *= 1.0f - sq(Sqrt(linedistsq) / FOG_AREA_WIDTH);
if(CSprite::CalcScreenCoors(fogcoors, spriteCoors, &spritew, &spriteh, true)){
- float rotation = (CTimer::GetTimeInMilliseconds()&0x1FFF) * 2*3.14f / 0x1FFF;
+ float rotation = (CTimer::GetTimeInMilliseconds()&0x1FFF) * 2*3.14f / 0x2000;
float size = FogSizes[r>>1];
CSprite::RenderOneXLUSprite_Rotate_Aspect(spriteCoors.x, spriteCoors.y, spriteCoors.z,
spritew * size, spriteh * size,
@@ -269,7 +268,7 @@ CPointLights::RenderFogEffect(void)
CVector fogcoors(xi, yi, point.point.z + 1.6f);
if(CSprite::CalcScreenCoors(fogcoors, spriteCoors, &spritew, &spriteh, true)){
- float rotation = (CTimer::GetTimeInMilliseconds()&0x3FFF) * 2*3.14f / 0x3FFF;
+ float rotation = (CTimer::GetTimeInMilliseconds()&0x3FFF) * 2*3.14f / 0x4000;
float size = FogSizes[r>>1];
CSprite::RenderOneXLUSprite_Rotate_Aspect(spriteCoors.x, spriteCoors.y, spriteCoors.z,
spritew * size, spriteh * size,
diff --git a/src/render/Renderer.cpp b/src/render/Renderer.cpp
index 717021a7..7ae29a2f 100644
--- a/src/render/Renderer.cpp
+++ b/src/render/Renderer.cpp
@@ -836,8 +836,13 @@ CRenderer::ScanSectorPoly(RwV2d *poly, int32 numVertices, void (*scanfunc)(CPtrL
a2 = i;
}
}
+#ifdef FIX_BUGS
+ y = Floor(miny);
+ yend = Floor(maxy);
+#else
y = miny;
yend = maxy;
+#endif
// Go left in poly to find first edge b
b2 = a2;
@@ -875,8 +880,8 @@ CRenderer::ScanSectorPoly(RwV2d *poly, int32 numVertices, void (*scanfunc)(CPtrL
while(y <= yend && y < NUMSECTORS_Y){
// scan one x-line
if(y >= 0 && xstart < NUMSECTORS_X)
- for(x = xstart; x <= xend; x++)
- if(x >= 0 && x != NUMSECTORS_X)
+ for(x = xstart; x <= xend && x != NUMSECTORS_X; x++)
+ if(x >= 0)
scanfunc(CWorld::GetSector(x, y)->m_lists);
// advance one scan line
diff --git a/src/render/Sprite2d.cpp b/src/render/Sprite2d.cpp
index 453ed004..98bb6eb2 100644
--- a/src/render/Sprite2d.cpp
+++ b/src/render/Sprite2d.cpp
@@ -178,6 +178,7 @@ CSprite2d::SetVertices(const CRect &r, const CRGBA &c0, const CRGBA &c1, const C
z = 1.0f/RecipNearClip;
}
recipz = 1.0f/z;
+ float offset = 1.0f/1024.0f;
// This is what we draw:
// 0---1
@@ -189,8 +190,8 @@ CSprite2d::SetVertices(const CRect &r, const CRGBA &c0, const CRGBA &c1, const C
RwIm2DVertexSetCameraZ(&maVertices[0], z);
RwIm2DVertexSetRecipCameraZ(&maVertices[0], recipz);
RwIm2DVertexSetIntRGBA(&maVertices[0], c2.r, c2.g, c2.b, c2.a);
- RwIm2DVertexSetU(&maVertices[0], 0.0f, recipz);
- RwIm2DVertexSetV(&maVertices[0], 0.0f, recipz);
+ RwIm2DVertexSetU(&maVertices[0], 0.0f+offset, recipz);
+ RwIm2DVertexSetV(&maVertices[0], 0.0f+offset, recipz);
RwIm2DVertexSetScreenX(&maVertices[1], r.right);
RwIm2DVertexSetScreenY(&maVertices[1], r.top);
@@ -198,8 +199,8 @@ CSprite2d::SetVertices(const CRect &r, const CRGBA &c0, const CRGBA &c1, const C
RwIm2DVertexSetCameraZ(&maVertices[1], z);
RwIm2DVertexSetRecipCameraZ(&maVertices[1], recipz);
RwIm2DVertexSetIntRGBA(&maVertices[1], c3.r, c3.g, c3.b, c3.a);
- RwIm2DVertexSetU(&maVertices[1], 1.0f, recipz);
- RwIm2DVertexSetV(&maVertices[1], 0.0f, recipz);
+ RwIm2DVertexSetU(&maVertices[1], 1.0f+offset, recipz);
+ RwIm2DVertexSetV(&maVertices[1], 0.0f+offset, recipz);
RwIm2DVertexSetScreenX(&maVertices[2], r.right);
RwIm2DVertexSetScreenY(&maVertices[2], r.bottom);
@@ -207,8 +208,8 @@ CSprite2d::SetVertices(const CRect &r, const CRGBA &c0, const CRGBA &c1, const C
RwIm2DVertexSetCameraZ(&maVertices[2], z);
RwIm2DVertexSetRecipCameraZ(&maVertices[2], recipz);
RwIm2DVertexSetIntRGBA(&maVertices[2], c1.r, c1.g, c1.b, c1.a);
- RwIm2DVertexSetU(&maVertices[2], 1.0f, recipz);
- RwIm2DVertexSetV(&maVertices[2], 1.0f, recipz);
+ RwIm2DVertexSetU(&maVertices[2], 1.0f+offset, recipz);
+ RwIm2DVertexSetV(&maVertices[2], 1.0f+offset, recipz);
RwIm2DVertexSetScreenX(&maVertices[3], r.left);
RwIm2DVertexSetScreenY(&maVertices[3], r.bottom);
@@ -216,8 +217,8 @@ CSprite2d::SetVertices(const CRect &r, const CRGBA &c0, const CRGBA &c1, const C
RwIm2DVertexSetCameraZ(&maVertices[3], z);
RwIm2DVertexSetRecipCameraZ(&maVertices[3], recipz);
RwIm2DVertexSetIntRGBA(&maVertices[3], c0.r, c0.g, c0.b, c0.a);
- RwIm2DVertexSetU(&maVertices[3], 0.0f, recipz);
- RwIm2DVertexSetV(&maVertices[3], 1.0f, recipz);
+ RwIm2DVertexSetU(&maVertices[3], 0.0f+offset, recipz);
+ RwIm2DVertexSetV(&maVertices[3], 1.0f+offset, recipz);
}
void
diff --git a/src/render/Timecycle.cpp b/src/render/Timecycle.cpp
index 162983dd..0d94dbd6 100644
--- a/src/render/Timecycle.cpp
+++ b/src/render/Timecycle.cpp
@@ -10,42 +10,42 @@
#include "FileMgr.h"
#include "Timecycle.h"
-int CTimeCycle::m_nAmbientRed[NUMHOURS][NUMWEATHERS];
-int CTimeCycle::m_nAmbientGreen[NUMHOURS][NUMWEATHERS];
-int CTimeCycle::m_nAmbientBlue[NUMHOURS][NUMWEATHERS];
-int CTimeCycle::m_nDirectionalRed[NUMHOURS][NUMWEATHERS];
-int CTimeCycle::m_nDirectionalGreen[NUMHOURS][NUMWEATHERS];
-int CTimeCycle::m_nDirectionalBlue[NUMHOURS][NUMWEATHERS];
-int CTimeCycle::m_nSkyTopRed[NUMHOURS][NUMWEATHERS];
-int CTimeCycle::m_nSkyTopGreen[NUMHOURS][NUMWEATHERS];
-int CTimeCycle::m_nSkyTopBlue[NUMHOURS][NUMWEATHERS];
-int CTimeCycle::m_nSkyBottomRed[NUMHOURS][NUMWEATHERS];
-int CTimeCycle::m_nSkyBottomGreen[NUMHOURS][NUMWEATHERS];
-int CTimeCycle::m_nSkyBottomBlue[NUMHOURS][NUMWEATHERS];
-int CTimeCycle::m_nSunCoreRed[NUMHOURS][NUMWEATHERS];
-int CTimeCycle::m_nSunCoreGreen[NUMHOURS][NUMWEATHERS];
-int CTimeCycle::m_nSunCoreBlue[NUMHOURS][NUMWEATHERS];
-int CTimeCycle::m_nSunCoronaRed[NUMHOURS][NUMWEATHERS];
-int CTimeCycle::m_nSunCoronaGreen[NUMHOURS][NUMWEATHERS];
-int CTimeCycle::m_nSunCoronaBlue[NUMHOURS][NUMWEATHERS];
+int32 CTimeCycle::m_nAmbientRed[NUMHOURS][NUMWEATHERS];
+int32 CTimeCycle::m_nAmbientGreen[NUMHOURS][NUMWEATHERS];
+int32 CTimeCycle::m_nAmbientBlue[NUMHOURS][NUMWEATHERS];
+int32 CTimeCycle::m_nDirectionalRed[NUMHOURS][NUMWEATHERS];
+int32 CTimeCycle::m_nDirectionalGreen[NUMHOURS][NUMWEATHERS];
+int32 CTimeCycle::m_nDirectionalBlue[NUMHOURS][NUMWEATHERS];
+int32 CTimeCycle::m_nSkyTopRed[NUMHOURS][NUMWEATHERS];
+int32 CTimeCycle::m_nSkyTopGreen[NUMHOURS][NUMWEATHERS];
+int32 CTimeCycle::m_nSkyTopBlue[NUMHOURS][NUMWEATHERS];
+int32 CTimeCycle::m_nSkyBottomRed[NUMHOURS][NUMWEATHERS];
+int32 CTimeCycle::m_nSkyBottomGreen[NUMHOURS][NUMWEATHERS];
+int32 CTimeCycle::m_nSkyBottomBlue[NUMHOURS][NUMWEATHERS];
+int32 CTimeCycle::m_nSunCoreRed[NUMHOURS][NUMWEATHERS];
+int32 CTimeCycle::m_nSunCoreGreen[NUMHOURS][NUMWEATHERS];
+int32 CTimeCycle::m_nSunCoreBlue[NUMHOURS][NUMWEATHERS];
+int32 CTimeCycle::m_nSunCoronaRed[NUMHOURS][NUMWEATHERS];
+int32 CTimeCycle::m_nSunCoronaGreen[NUMHOURS][NUMWEATHERS];
+int32 CTimeCycle::m_nSunCoronaBlue[NUMHOURS][NUMWEATHERS];
float CTimeCycle::m_fSunSize[NUMHOURS][NUMWEATHERS];
float CTimeCycle::m_fSpriteSize[NUMHOURS][NUMWEATHERS];
float CTimeCycle::m_fSpriteBrightness[NUMHOURS][NUMWEATHERS];
-short CTimeCycle::m_nShadowStrength[NUMHOURS][NUMWEATHERS];
-short CTimeCycle::m_nLightShadowStrength[NUMHOURS][NUMWEATHERS];
-short CTimeCycle::m_nTreeShadowStrength[NUMHOURS][NUMWEATHERS];
+int16 CTimeCycle::m_nShadowStrength[NUMHOURS][NUMWEATHERS];
+int16 CTimeCycle::m_nLightShadowStrength[NUMHOURS][NUMWEATHERS];
+int16 CTimeCycle::m_nTreeShadowStrength[NUMHOURS][NUMWEATHERS];
float CTimeCycle::m_fFogStart[NUMHOURS][NUMWEATHERS];
float CTimeCycle::m_fFarClip[NUMHOURS][NUMWEATHERS];
float CTimeCycle::m_fLightsOnGroundBrightness[NUMHOURS][NUMWEATHERS];
-int CTimeCycle::m_nLowCloudsRed[NUMHOURS][NUMWEATHERS];
-int CTimeCycle::m_nLowCloudsGreen[NUMHOURS][NUMWEATHERS];
-int CTimeCycle::m_nLowCloudsBlue[NUMHOURS][NUMWEATHERS];
-int CTimeCycle::m_nFluffyCloudsTopRed[NUMHOURS][NUMWEATHERS];
-int CTimeCycle::m_nFluffyCloudsTopGreen[NUMHOURS][NUMWEATHERS];
-int CTimeCycle::m_nFluffyCloudsTopBlue[NUMHOURS][NUMWEATHERS];
-int CTimeCycle::m_nFluffyCloudsBottomRed[NUMHOURS][NUMWEATHERS];
-int CTimeCycle::m_nFluffyCloudsBottomGreen[NUMHOURS][NUMWEATHERS];
-int CTimeCycle::m_nFluffyCloudsBottomBlue[NUMHOURS][NUMWEATHERS];
+int32 CTimeCycle::m_nLowCloudsRed[NUMHOURS][NUMWEATHERS];
+int32 CTimeCycle::m_nLowCloudsGreen[NUMHOURS][NUMWEATHERS];
+int32 CTimeCycle::m_nLowCloudsBlue[NUMHOURS][NUMWEATHERS];
+int32 CTimeCycle::m_nFluffyCloudsTopRed[NUMHOURS][NUMWEATHERS];
+int32 CTimeCycle::m_nFluffyCloudsTopGreen[NUMHOURS][NUMWEATHERS];
+int32 CTimeCycle::m_nFluffyCloudsTopBlue[NUMHOURS][NUMWEATHERS];
+int32 CTimeCycle::m_nFluffyCloudsBottomRed[NUMHOURS][NUMWEATHERS];
+int32 CTimeCycle::m_nFluffyCloudsBottomGreen[NUMHOURS][NUMWEATHERS];
+int32 CTimeCycle::m_nFluffyCloudsBottomBlue[NUMHOURS][NUMWEATHERS];
float CTimeCycle::m_fBlurRed[NUMHOURS][NUMWEATHERS];
float CTimeCycle::m_fBlurGreen[NUMHOURS][NUMWEATHERS];
float CTimeCycle::m_fBlurBlue[NUMHOURS][NUMWEATHERS];
@@ -57,47 +57,47 @@ float CTimeCycle::m_fCurrentAmbientBlue;
float CTimeCycle::m_fCurrentDirectionalRed;
float CTimeCycle::m_fCurrentDirectionalGreen;
float CTimeCycle::m_fCurrentDirectionalBlue;
-int CTimeCycle::m_nCurrentSkyTopRed;
-int CTimeCycle::m_nCurrentSkyTopGreen;
-int CTimeCycle::m_nCurrentSkyTopBlue;
-int CTimeCycle::m_nCurrentSkyBottomRed;
-int CTimeCycle::m_nCurrentSkyBottomGreen;
-int CTimeCycle::m_nCurrentSkyBottomBlue;
-int CTimeCycle::m_nCurrentSunCoreRed;
-int CTimeCycle::m_nCurrentSunCoreGreen;
-int CTimeCycle::m_nCurrentSunCoreBlue;
-int CTimeCycle::m_nCurrentSunCoronaRed;
-int CTimeCycle::m_nCurrentSunCoronaGreen;
-int CTimeCycle::m_nCurrentSunCoronaBlue;
+int32 CTimeCycle::m_nCurrentSkyTopRed;
+int32 CTimeCycle::m_nCurrentSkyTopGreen;
+int32 CTimeCycle::m_nCurrentSkyTopBlue;
+int32 CTimeCycle::m_nCurrentSkyBottomRed;
+int32 CTimeCycle::m_nCurrentSkyBottomGreen;
+int32 CTimeCycle::m_nCurrentSkyBottomBlue;
+int32 CTimeCycle::m_nCurrentSunCoreRed;
+int32 CTimeCycle::m_nCurrentSunCoreGreen;
+int32 CTimeCycle::m_nCurrentSunCoreBlue;
+int32 CTimeCycle::m_nCurrentSunCoronaRed;
+int32 CTimeCycle::m_nCurrentSunCoronaGreen;
+int32 CTimeCycle::m_nCurrentSunCoronaBlue;
float CTimeCycle::m_fCurrentSunSize;
float CTimeCycle::m_fCurrentSpriteSize;
float CTimeCycle::m_fCurrentSpriteBrightness;
-int CTimeCycle::m_nCurrentShadowStrength;
-int CTimeCycle::m_nCurrentLightShadowStrength;
-int CTimeCycle::m_nCurrentTreeShadowStrength;
+int32 CTimeCycle::m_nCurrentShadowStrength;
+int32 CTimeCycle::m_nCurrentLightShadowStrength;
+int32 CTimeCycle::m_nCurrentTreeShadowStrength;
float CTimeCycle::m_fCurrentFogStart;
float CTimeCycle::m_fCurrentFarClip;
float CTimeCycle::m_fCurrentLightsOnGroundBrightness;
-int CTimeCycle::m_nCurrentLowCloudsRed;
-int CTimeCycle::m_nCurrentLowCloudsGreen;
-int CTimeCycle::m_nCurrentLowCloudsBlue;
-int CTimeCycle::m_nCurrentFluffyCloudsTopRed;
-int CTimeCycle::m_nCurrentFluffyCloudsTopGreen;
-int CTimeCycle::m_nCurrentFluffyCloudsTopBlue;
-int CTimeCycle::m_nCurrentFluffyCloudsBottomRed;
-int CTimeCycle::m_nCurrentFluffyCloudsBottomGreen;
-int CTimeCycle::m_nCurrentFluffyCloudsBottomBlue;
+int32 CTimeCycle::m_nCurrentLowCloudsRed;
+int32 CTimeCycle::m_nCurrentLowCloudsGreen;
+int32 CTimeCycle::m_nCurrentLowCloudsBlue;
+int32 CTimeCycle::m_nCurrentFluffyCloudsTopRed;
+int32 CTimeCycle::m_nCurrentFluffyCloudsTopGreen;
+int32 CTimeCycle::m_nCurrentFluffyCloudsTopBlue;
+int32 CTimeCycle::m_nCurrentFluffyCloudsBottomRed;
+int32 CTimeCycle::m_nCurrentFluffyCloudsBottomGreen;
+int32 CTimeCycle::m_nCurrentFluffyCloudsBottomBlue;
float CTimeCycle::m_fCurrentBlurRed;
float CTimeCycle::m_fCurrentBlurGreen;
float CTimeCycle::m_fCurrentBlurBlue;
float CTimeCycle::m_fCurrentBlurAlpha;
-int CTimeCycle::m_nCurrentFogColourRed;
-int CTimeCycle::m_nCurrentFogColourGreen;
-int CTimeCycle::m_nCurrentFogColourBlue;
+int32 CTimeCycle::m_nCurrentFogColourRed;
+int32 CTimeCycle::m_nCurrentFogColourGreen;
+int32 CTimeCycle::m_nCurrentFogColourBlue;
-int CTimeCycle::m_FogReduction;
+int32 CTimeCycle::m_FogReduction;
-int CTimeCycle::m_CurrentStoredValue;
+int32 CTimeCycle::m_CurrentStoredValue;
CVector CTimeCycle::m_VectorToSun[16];
float CTimeCycle::m_fShadowFrontX[16];
float CTimeCycle::m_fShadowFrontY[16];
@@ -227,7 +227,7 @@ CTimeCycle::Update(void)
float c2 = (1.0f-timeInterp) * CWeather::InterpolationValue;
float c3 = timeInterp * CWeather::InterpolationValue;
-#define INTERP(v) v[h1][w1]*c0 + v[h2][w1]*c1 + v[h1][w2]*c2 + v[h2][w2]*c3;
+#define INTERP(v) v[h1][w1]*c0 + v[h2][w1]*c1 + v[h1][w2]*c2 + v[h2][w2]*c3
m_nCurrentSkyTopRed = INTERP(m_nSkyTopRed);
m_nCurrentSkyTopGreen = INTERP(m_nSkyTopGreen);
diff --git a/src/render/Timecycle.h b/src/render/Timecycle.h
index 0cb02b67..d5d7b67a 100644
--- a/src/render/Timecycle.h
+++ b/src/render/Timecycle.h
@@ -2,42 +2,42 @@
class CTimeCycle
{
- static int m_nAmbientRed[NUMHOURS][NUMWEATHERS];
- static int m_nAmbientGreen[NUMHOURS][NUMWEATHERS];
- static int m_nAmbientBlue[NUMHOURS][NUMWEATHERS];
- static int m_nDirectionalRed[NUMHOURS][NUMWEATHERS];
- static int m_nDirectionalGreen[NUMHOURS][NUMWEATHERS];
- static int m_nDirectionalBlue[NUMHOURS][NUMWEATHERS];
- static int m_nSkyTopRed[NUMHOURS][NUMWEATHERS];
- static int m_nSkyTopGreen[NUMHOURS][NUMWEATHERS];
- static int m_nSkyTopBlue[NUMHOURS][NUMWEATHERS];
- static int m_nSkyBottomRed[NUMHOURS][NUMWEATHERS];
- static int m_nSkyBottomGreen[NUMHOURS][NUMWEATHERS];
- static int m_nSkyBottomBlue[NUMHOURS][NUMWEATHERS];
- static int m_nSunCoreRed[NUMHOURS][NUMWEATHERS];
- static int m_nSunCoreGreen[NUMHOURS][NUMWEATHERS];
- static int m_nSunCoreBlue[NUMHOURS][NUMWEATHERS];
- static int m_nSunCoronaRed[NUMHOURS][NUMWEATHERS];
- static int m_nSunCoronaGreen[NUMHOURS][NUMWEATHERS];
- static int m_nSunCoronaBlue[NUMHOURS][NUMWEATHERS];
+ static int32 m_nAmbientRed[NUMHOURS][NUMWEATHERS];
+ static int32 m_nAmbientGreen[NUMHOURS][NUMWEATHERS];
+ static int32 m_nAmbientBlue[NUMHOURS][NUMWEATHERS];
+ static int32 m_nDirectionalRed[NUMHOURS][NUMWEATHERS];
+ static int32 m_nDirectionalGreen[NUMHOURS][NUMWEATHERS];
+ static int32 m_nDirectionalBlue[NUMHOURS][NUMWEATHERS];
+ static int32 m_nSkyTopRed[NUMHOURS][NUMWEATHERS];
+ static int32 m_nSkyTopGreen[NUMHOURS][NUMWEATHERS];
+ static int32 m_nSkyTopBlue[NUMHOURS][NUMWEATHERS];
+ static int32 m_nSkyBottomRed[NUMHOURS][NUMWEATHERS];
+ static int32 m_nSkyBottomGreen[NUMHOURS][NUMWEATHERS];
+ static int32 m_nSkyBottomBlue[NUMHOURS][NUMWEATHERS];
+ static int32 m_nSunCoreRed[NUMHOURS][NUMWEATHERS];
+ static int32 m_nSunCoreGreen[NUMHOURS][NUMWEATHERS];
+ static int32 m_nSunCoreBlue[NUMHOURS][NUMWEATHERS];
+ static int32 m_nSunCoronaRed[NUMHOURS][NUMWEATHERS];
+ static int32 m_nSunCoronaGreen[NUMHOURS][NUMWEATHERS];
+ static int32 m_nSunCoronaBlue[NUMHOURS][NUMWEATHERS];
static float m_fSunSize[NUMHOURS][NUMWEATHERS];
static float m_fSpriteSize[NUMHOURS][NUMWEATHERS];
static float m_fSpriteBrightness[NUMHOURS][NUMWEATHERS];
- static short m_nShadowStrength[NUMHOURS][NUMWEATHERS];
- static short m_nLightShadowStrength[NUMHOURS][NUMWEATHERS];
- static short m_nTreeShadowStrength[NUMHOURS][NUMWEATHERS];
+ static int16 m_nShadowStrength[NUMHOURS][NUMWEATHERS];
+ static int16 m_nLightShadowStrength[NUMHOURS][NUMWEATHERS];
+ static int16 m_nTreeShadowStrength[NUMHOURS][NUMWEATHERS];
static float m_fFogStart[NUMHOURS][NUMWEATHERS];
static float m_fFarClip[NUMHOURS][NUMWEATHERS];
static float m_fLightsOnGroundBrightness[NUMHOURS][NUMWEATHERS];
- static int m_nLowCloudsRed[NUMHOURS][NUMWEATHERS];
- static int m_nLowCloudsGreen[NUMHOURS][NUMWEATHERS];
- static int m_nLowCloudsBlue[NUMHOURS][NUMWEATHERS];
- static int m_nFluffyCloudsTopRed[NUMHOURS][NUMWEATHERS];
- static int m_nFluffyCloudsTopGreen[NUMHOURS][NUMWEATHERS];
- static int m_nFluffyCloudsTopBlue[NUMHOURS][NUMWEATHERS];
- static int m_nFluffyCloudsBottomRed[NUMHOURS][NUMWEATHERS];
- static int m_nFluffyCloudsBottomGreen[NUMHOURS][NUMWEATHERS];
- static int m_nFluffyCloudsBottomBlue[NUMHOURS][NUMWEATHERS];
+ static int32 m_nLowCloudsRed[NUMHOURS][NUMWEATHERS];
+ static int32 m_nLowCloudsGreen[NUMHOURS][NUMWEATHERS];
+ static int32 m_nLowCloudsBlue[NUMHOURS][NUMWEATHERS];
+ static int32 m_nFluffyCloudsTopRed[NUMHOURS][NUMWEATHERS];
+ static int32 m_nFluffyCloudsTopGreen[NUMHOURS][NUMWEATHERS];
+ static int32 m_nFluffyCloudsTopBlue[NUMHOURS][NUMWEATHERS];
+ static int32 m_nFluffyCloudsBottomRed[NUMHOURS][NUMWEATHERS];
+ static int32 m_nFluffyCloudsBottomGreen[NUMHOURS][NUMWEATHERS];
+ static int32 m_nFluffyCloudsBottomBlue[NUMHOURS][NUMWEATHERS];
static float m_fBlurRed[NUMHOURS][NUMWEATHERS];
static float m_fBlurGreen[NUMHOURS][NUMWEATHERS];
static float m_fBlurBlue[NUMHOURS][NUMWEATHERS];
@@ -49,48 +49,48 @@ class CTimeCycle
static float m_fCurrentDirectionalRed;
static float m_fCurrentDirectionalGreen;
static float m_fCurrentDirectionalBlue;
- static int m_nCurrentSkyTopRed;
- static int m_nCurrentSkyTopGreen;
- static int m_nCurrentSkyTopBlue;
- static int m_nCurrentSkyBottomRed;
- static int m_nCurrentSkyBottomGreen;
- static int m_nCurrentSkyBottomBlue;
- static int m_nCurrentSunCoreRed;
- static int m_nCurrentSunCoreGreen;
- static int m_nCurrentSunCoreBlue;
- static int m_nCurrentSunCoronaRed;
- static int m_nCurrentSunCoronaGreen;
- static int m_nCurrentSunCoronaBlue;
+ static int32 m_nCurrentSkyTopRed;
+ static int32 m_nCurrentSkyTopGreen;
+ static int32 m_nCurrentSkyTopBlue;
+ static int32 m_nCurrentSkyBottomRed;
+ static int32 m_nCurrentSkyBottomGreen;
+ static int32 m_nCurrentSkyBottomBlue;
+ static int32 m_nCurrentSunCoreRed;
+ static int32 m_nCurrentSunCoreGreen;
+ static int32 m_nCurrentSunCoreBlue;
+ static int32 m_nCurrentSunCoronaRed;
+ static int32 m_nCurrentSunCoronaGreen;
+ static int32 m_nCurrentSunCoronaBlue;
static float m_fCurrentSunSize;
static float m_fCurrentSpriteSize;
static float m_fCurrentSpriteBrightness;
- static int m_nCurrentShadowStrength;
- static int m_nCurrentLightShadowStrength;
- static int m_nCurrentTreeShadowStrength;
+ static int32 m_nCurrentShadowStrength;
+ static int32 m_nCurrentLightShadowStrength;
+ static int32 m_nCurrentTreeShadowStrength;
static float m_fCurrentFogStart;
static float m_fCurrentFarClip;
static float m_fCurrentLightsOnGroundBrightness;
- static int m_nCurrentLowCloudsRed;
- static int m_nCurrentLowCloudsGreen;
- static int m_nCurrentLowCloudsBlue;
- static int m_nCurrentFluffyCloudsTopRed;
- static int m_nCurrentFluffyCloudsTopGreen;
- static int m_nCurrentFluffyCloudsTopBlue;
- static int m_nCurrentFluffyCloudsBottomRed;
- static int m_nCurrentFluffyCloudsBottomGreen;
- static int m_nCurrentFluffyCloudsBottomBlue;
+ static int32 m_nCurrentLowCloudsRed;
+ static int32 m_nCurrentLowCloudsGreen;
+ static int32 m_nCurrentLowCloudsBlue;
+ static int32 m_nCurrentFluffyCloudsTopRed;
+ static int32 m_nCurrentFluffyCloudsTopGreen;
+ static int32 m_nCurrentFluffyCloudsTopBlue;
+ static int32 m_nCurrentFluffyCloudsBottomRed;
+ static int32 m_nCurrentFluffyCloudsBottomGreen;
+ static int32 m_nCurrentFluffyCloudsBottomBlue;
static float m_fCurrentBlurRed;
static float m_fCurrentBlurGreen;
static float m_fCurrentBlurBlue;
static float m_fCurrentBlurAlpha;
- static int m_nCurrentFogColourRed;
- static int m_nCurrentFogColourGreen;
- static int m_nCurrentFogColourBlue;
+ static int32 m_nCurrentFogColourRed;
+ static int32 m_nCurrentFogColourGreen;
+ static int32 m_nCurrentFogColourBlue;
- static int m_FogReduction;
+ static int32 m_FogReduction;
public:
- static int m_CurrentStoredValue;
+ static int32 m_CurrentStoredValue;
static CVector m_VectorToSun[16];
static float m_fShadowFrontX[16];
static float m_fShadowFrontY[16];
@@ -105,40 +105,40 @@ public:
static float GetDirectionalRed(void) { return m_fCurrentDirectionalRed; }
static float GetDirectionalGreen(void) { return m_fCurrentDirectionalGreen; }
static float GetDirectionalBlue(void) { return m_fCurrentDirectionalBlue; }
- static int GetSkyTopRed(void) { return m_nCurrentSkyTopRed; }
- static int GetSkyTopGreen(void) { return m_nCurrentSkyTopGreen; }
- static int GetSkyTopBlue(void) { return m_nCurrentSkyTopBlue; }
- static int GetSkyBottomRed(void) { return m_nCurrentSkyBottomRed; }
- static int GetSkyBottomGreen(void) { return m_nCurrentSkyBottomGreen; }
- static int GetSkyBottomBlue(void) { return m_nCurrentSkyBottomBlue; }
- static int GetSunCoreRed(void) { return m_nCurrentSunCoreRed; }
- static int GetSunCoreGreen(void) { return m_nCurrentSunCoreGreen; }
- static int GetSunCoreBlue(void) { return m_nCurrentSunCoreBlue; }
- static int GetSunCoronaRed(void) { return m_nCurrentSunCoronaRed; }
- static int GetSunCoronaGreen(void) { return m_nCurrentSunCoronaGreen; }
- static int GetSunCoronaBlue(void) { return m_nCurrentSunCoronaBlue; }
+ static int32 GetSkyTopRed(void) { return m_nCurrentSkyTopRed; }
+ static int32 GetSkyTopGreen(void) { return m_nCurrentSkyTopGreen; }
+ static int32 GetSkyTopBlue(void) { return m_nCurrentSkyTopBlue; }
+ static int32 GetSkyBottomRed(void) { return m_nCurrentSkyBottomRed; }
+ static int32 GetSkyBottomGreen(void) { return m_nCurrentSkyBottomGreen; }
+ static int32 GetSkyBottomBlue(void) { return m_nCurrentSkyBottomBlue; }
+ static int32 GetSunCoreRed(void) { return m_nCurrentSunCoreRed; }
+ static int32 GetSunCoreGreen(void) { return m_nCurrentSunCoreGreen; }
+ static int32 GetSunCoreBlue(void) { return m_nCurrentSunCoreBlue; }
+ static int32 GetSunCoronaRed(void) { return m_nCurrentSunCoronaRed; }
+ static int32 GetSunCoronaGreen(void) { return m_nCurrentSunCoronaGreen; }
+ static int32 GetSunCoronaBlue(void) { return m_nCurrentSunCoronaBlue; }
static float GetSunSize(void) { return m_fCurrentSunSize; }
static float GetSpriteBrightness(void) { return m_fCurrentSpriteBrightness; }
static float GetSpriteSize(void) { return m_fCurrentSpriteSize; }
- static int GetShadowStrength(void) { return m_nCurrentShadowStrength; }
- static int GetLightShadowStrength(void) { return m_nCurrentLightShadowStrength; }
+ static int32 GetShadowStrength(void) { return m_nCurrentShadowStrength; }
+ static int32 GetLightShadowStrength(void) { return m_nCurrentLightShadowStrength; }
static float GetLightOnGroundBrightness(void) { return m_fCurrentLightsOnGroundBrightness; }
static float GetFarClip(void) { return m_fCurrentFarClip; }
static float GetFogStart(void) { return m_fCurrentFogStart; }
- static int GetLowCloudsRed(void) { return m_nCurrentLowCloudsRed; }
- static int GetLowCloudsGreen(void) { return m_nCurrentLowCloudsGreen; }
- static int GetLowCloudsBlue(void) { return m_nCurrentLowCloudsBlue; }
- static int GetFluffyCloudsTopRed(void) { return m_nCurrentFluffyCloudsTopRed; }
- static int GetFluffyCloudsTopGreen(void) { return m_nCurrentFluffyCloudsTopGreen; }
- static int GetFluffyCloudsTopBlue(void) { return m_nCurrentFluffyCloudsTopBlue; }
- static int GetFluffyCloudsBottomRed(void) { return m_nCurrentFluffyCloudsBottomRed; }
- static int GetFluffyCloudsBottomGreen(void) { return m_nCurrentFluffyCloudsBottomGreen; }
- static int GetFluffyCloudsBottomBlue(void) { return m_nCurrentFluffyCloudsBottomBlue; }
- static int GetFogRed(void) { return m_nCurrentFogColourRed; }
- static int GetFogGreen(void) { return m_nCurrentFogColourGreen; }
- static int GetFogBlue(void) { return m_nCurrentFogColourBlue; }
- static int GetFogReduction(void) { return m_FogReduction; }
+ static int32 GetLowCloudsRed(void) { return m_nCurrentLowCloudsRed; }
+ static int32 GetLowCloudsGreen(void) { return m_nCurrentLowCloudsGreen; }
+ static int32 GetLowCloudsBlue(void) { return m_nCurrentLowCloudsBlue; }
+ static int32 GetFluffyCloudsTopRed(void) { return m_nCurrentFluffyCloudsTopRed; }
+ static int32 GetFluffyCloudsTopGreen(void) { return m_nCurrentFluffyCloudsTopGreen; }
+ static int32 GetFluffyCloudsTopBlue(void) { return m_nCurrentFluffyCloudsTopBlue; }
+ static int32 GetFluffyCloudsBottomRed(void) { return m_nCurrentFluffyCloudsBottomRed; }
+ static int32 GetFluffyCloudsBottomGreen(void) { return m_nCurrentFluffyCloudsBottomGreen; }
+ static int32 GetFluffyCloudsBottomBlue(void) { return m_nCurrentFluffyCloudsBottomBlue; }
+ static int32 GetFogRed(void) { return m_nCurrentFogColourRed; }
+ static int32 GetFogGreen(void) { return m_nCurrentFogColourGreen; }
+ static int32 GetFogBlue(void) { return m_nCurrentFogColourBlue; }
+ static int32 GetFogReduction(void) { return m_FogReduction; }
static void Initialise(void);
static void Update(void);