mirror of
https://github.com/halpz/re3.git
synced 2025-07-21 17:59:46 +00:00
Menu borders and weapon fixes
This commit is contained in:
@ -19,24 +19,23 @@ uint8 CDraw::FadeGreen;
|
||||
uint8 CDraw::FadeBlue;
|
||||
|
||||
float
|
||||
CDraw::FindAspectRatio(void)
|
||||
CDraw::CalculateAspectRatio(void)
|
||||
{
|
||||
#ifndef ASPECT_RATIO_SCALE
|
||||
if(FrontEndMenuManager.m_PrefsUseWideScreen)
|
||||
return 16.0f/9.0f;
|
||||
else
|
||||
return 4.0f/3.0f;
|
||||
if (FrontEndMenuManager.m_PrefsUseWideScreen) {
|
||||
if (TheCamera.m_WideScreenOn)
|
||||
CDraw::ms_fAspectRatio = 5.f / 3.f; // It's used on theatrical showings according to Wiki
|
||||
else
|
||||
#ifdef ASPECT_RATIO_SCALE
|
||||
CDraw::ms_fAspectRatio = FrontEndMenuManager.m_PrefsUseWideScreen == AR_AUTO ? SCREEN_WIDTH / SCREEN_HEIGHT : 16.f / 9.f;
|
||||
#else
|
||||
switch (FrontEndMenuManager.m_PrefsUseWideScreen) {
|
||||
case AR_AUTO:
|
||||
return SCREEN_WIDTH / SCREEN_HEIGHT;
|
||||
default:
|
||||
case AR_4_3:
|
||||
return 4.0f / 3.0f;
|
||||
case AR_16_9:
|
||||
return 16.0f / 9.0f;
|
||||
};
|
||||
CDraw::ms_fAspectRatio = 16.f / 9.f;
|
||||
#endif
|
||||
} else if (TheCamera.m_WideScreenOn) {
|
||||
CDraw::ms_fAspectRatio = 5.f/4.f;
|
||||
} else {
|
||||
CDraw::ms_fAspectRatio = 4.f/3.f;
|
||||
}
|
||||
return CDraw::ms_fAspectRatio;
|
||||
}
|
||||
|
||||
#ifdef ASPECT_RATIO_SCALE
|
||||
|
@ -38,12 +38,10 @@ public:
|
||||
static void SetFOV(float fov);
|
||||
static float GetFOV(void) { return ms_fFOV; }
|
||||
|
||||
static float FindAspectRatio(void);
|
||||
static float CalculateAspectRatio(void);
|
||||
#ifdef ASPECT_RATIO_SCALE
|
||||
static float ConvertFOV(float fov);
|
||||
#endif
|
||||
static float GetAspectRatio(void) { return ms_fAspectRatio; }
|
||||
static void SetAspectRatio(float ratio) { ms_fAspectRatio = ratio; }
|
||||
#else
|
||||
static float GetAspectRatio(void) { return FindAspectRatio(); }
|
||||
#endif
|
||||
};
|
||||
|
@ -68,8 +68,8 @@ class CFont
|
||||
static int16 Size[MAX_FONTS][193];
|
||||
#endif
|
||||
static int16 NewLine;
|
||||
static CSprite2d Sprite[MAX_FONTS];
|
||||
public:
|
||||
static CSprite2d Sprite[MAX_FONTS];
|
||||
static CFontDetails Details;
|
||||
|
||||
static void Initialise(void);
|
||||
|
@ -4,11 +4,11 @@
|
||||
#include "Draw.h"
|
||||
#include "Camera.h"
|
||||
#include "Sprite2d.h"
|
||||
#include "Font.h"
|
||||
|
||||
RwIm2DVertex CSprite2d::maVertices[8];
|
||||
float CSprite2d::RecipNearClip;
|
||||
int32 CSprite2d::mCurrentBank;
|
||||
RwTexture *CSprite2d::mpBankTextures[10];
|
||||
int32 CSprite2d::mCurrentSprite[10];
|
||||
int32 CSprite2d::mBankStart[10];
|
||||
RwIm2DVertex CSprite2d::maBankVertices[500];
|
||||
@ -16,7 +16,7 @@ RwIm2DVertex CSprite2d::maBankVertices[500];
|
||||
void
|
||||
CSprite2d::SetRecipNearClip(void)
|
||||
{
|
||||
RecipNearClip = 1.0f / RwCameraGetNearClipPlane(Scene.camera);
|
||||
// Used but empty in VC, instead they set in InitPerFrame. Isn't that great?
|
||||
}
|
||||
|
||||
void
|
||||
@ -24,17 +24,15 @@ CSprite2d::InitPerFrame(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
RecipNearClip = 1.0f / RwCameraGetNearClipPlane(Scene.camera);
|
||||
mCurrentBank = 0;
|
||||
for(i = 0; i < 10; i++)
|
||||
mCurrentSprite[i] = 0;
|
||||
for(i = 0; i < 10; i++)
|
||||
mpBankTextures[i] = nil;
|
||||
}
|
||||
|
||||
int32
|
||||
CSprite2d::GetBank(int32 n, RwTexture *tex)
|
||||
{
|
||||
mpBankTextures[mCurrentBank] = tex;
|
||||
mCurrentSprite[mCurrentBank] = 0;
|
||||
mBankStart[mCurrentBank+1] = mBankStart[mCurrentBank] + n;
|
||||
return mCurrentBank++;
|
||||
@ -59,13 +57,14 @@ CSprite2d::DrawBank(int32 bank)
|
||||
{
|
||||
if(mCurrentSprite[bank] == 0)
|
||||
return;
|
||||
RwRenderStateSet(rwRENDERSTATETEXTURERASTER,
|
||||
mpBankTextures[bank] ? RwTextureGetRaster(mpBankTextures[bank]) : nil);
|
||||
|
||||
// This is hacked III function to make it work with VC frontend.
|
||||
CFont::Sprite[bank].SetRenderState();
|
||||
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE);
|
||||
RwRenderStateSet(rwRENDERSTATETEXTUREFILTER, (void*)rwFILTERLINEAR);
|
||||
RwIm2DRenderPrimitive(rwPRIMTYPETRILIST, &maBankVertices[6*mBankStart[bank]], 6*mCurrentSprite[bank]);
|
||||
mCurrentSprite[bank] = 0;
|
||||
RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)FALSE);
|
||||
//RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)FALSE);
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user