mirror of
https://github.com/halpz/re3.git
synced 2025-07-23 15:59:45 +00:00
extended postfx and sniper hud fix
This commit is contained in:
@ -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.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.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;
|
||||
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.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.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.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;
|
||||
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);
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Reference in New Issue
Block a user