This commit is contained in:
Fire-Head 2021-01-05 04:17:18 +03:00
parent bc7161754f
commit 11de714d9d
11 changed files with 36 additions and 38 deletions

Binary file not shown.

View file

@ -141,10 +141,6 @@ int8 CMenuManager::m_nPrefsMSAALevel = 0;
int8 CMenuManager::m_nDisplayMSAALevel = 0;
#endif
#ifdef ASPECT_RATIO_SCALE
int32 CMenuManager::m_PrefsSpriteScalingMode = SCL_AUTO;
#endif
#ifdef NO_ISLAND_LOADING
int8 CMenuManager::m_PrefsIslandLoading = ISLAND_LOADING_LOW;
#endif

View file

@ -636,9 +636,6 @@ public:
static int8 m_nDisplayMSAALevel;
#endif
#ifdef ASPECT_RATIO_SCALE
static int32 m_PrefsSpriteScalingMode;
#endif
enum LANGUAGE
{
LANGUAGE_AMERICAN,

View file

@ -73,12 +73,6 @@
#define INVERT_PAD_SELECTOR
#endif
#ifdef ASPECT_RATIO_SCALE
#define HUD_ASPECT_RATIO_SELECTOR MENUACTION_CFO_SELECT, "FEC_SCL", { new CCFOSelect((int8*)&CMenuManager::m_PrefsSpriteScalingMode, "SpriteScaling", SpriteScalingModes, ARRAY_SIZE(SpriteScalingModes), false, nil) },
#else
#define HUD_ASPECT_RATIO_SELECTOR
#endif
const char *filterNames[] = { "FEM_NON", "FEM_SIM", "FEM_NRM", "FEM_MOB" };
const char *off_on[] = { "FEM_OFF", "FEM_ON" };
@ -337,15 +331,6 @@ wchar* DetectJoystickDraw(bool* disabled, bool userHovering) {
}
#endif
#ifdef ASPECT_RATIO_SCALE
const char* SpriteScalingModes[] =
{
"FEM_PC",
"FEM_PS2",
"FEM_AUT"
};
#endif
CMenuScreenCustom aScreens[MENUPAGES] = {
// MENUPAGE_NONE = 0
{ "", MENUPAGE_DISABLED, MENUPAGE_DISABLED, nil, nil, },
@ -400,7 +385,6 @@ CMenuScreenCustom aScreens[MENUPAGES] = {
#endif
MENUACTION_SUBTITLES, "FED_SUB", { nil, SAVESLOT_NONE, MENUPAGE_DISPLAY_SETTINGS },
MENUACTION_WIDESCREEN, "FED_WIS", { nil, SAVESLOT_NONE, MENUPAGE_DISPLAY_SETTINGS },
HUD_ASPECT_RATIO_SELECTOR
MENUACTION_SCREENRES, "FED_RES", { nil, SAVESLOT_NONE, MENUPAGE_DISPLAY_SETTINGS },
VIDEOMODE_SELECTOR
MULTISAMPLING_SELECTOR
@ -832,7 +816,6 @@ CMenuScreenCustom aScreens[MENUPAGES] = {
MENUACTION_SCREENRES, "FED_RES", { nil, SAVESLOT_NONE, MENUPAGE_GRAPHICS_SETTINGS },
MENUACTION_WIDESCREEN, "FED_WIS", { nil, SAVESLOT_NONE, MENUPAGE_GRAPHICS_SETTINGS },
HUD_ASPECT_RATIO_SELECTOR
VIDEOMODE_SELECTOR
MENUACTION_FRAMESYNC, "FEM_VSC", { nil, SAVESLOT_NONE, MENUPAGE_DISPLAY_SETTINGS },
MENUACTION_FRAMELIMIT, "FEM_FRM", { nil, SAVESLOT_NONE, MENUPAGE_DISPLAY_SETTINGS },

View file

@ -1298,9 +1298,12 @@ void CRadar::TransformRadarPointToScreenSpace(CVector2D &out, const CVector2D &i
#endif
{
#ifdef ASPECT_RATIO_SCALE
#define _RADAR_WIDTH ((CMenuManager::m_PrefsSpriteScalingMode==SCL_AUTO) ? (RADAR_HEIGHT) : (RADAR_WIDTH))
// The values are from from an early screenshot taken before R* broke radar
#define _RADAR_WIDTH ((CDraw::ms_bFixRadar) ? (82.0f) : (RADAR_WIDTH))
#define _RADAR_HEIGHT ((CDraw::ms_bFixRadar) ? (82.0f) : (RADAR_HEIGHT))
#else
#define _RADAR_WIDTH RADAR_WIDTH
#define _RADAR_HEIGHT RADAR_HEIGHT
#endif
#ifdef FIX_BUGS
@ -1308,7 +1311,7 @@ void CRadar::TransformRadarPointToScreenSpace(CVector2D &out, const CVector2D &i
#else
out.x = (in.x + 1.0f) * 0.5f * SCREEN_SCALE_X(_RADAR_WIDTH) + RADAR_LEFT;
#endif
out.y = (1.0f - in.y) * 0.5f * SCREEN_SCALE_Y(RADAR_HEIGHT) + SCREEN_SCALE_FROM_BOTTOM(RADAR_BOTTOM + RADAR_HEIGHT);
out.y = (1.0f - in.y) * 0.5f * SCREEN_SCALE_Y(_RADAR_HEIGHT) + SCREEN_SCALE_FROM_BOTTOM(RADAR_BOTTOM + _RADAR_HEIGHT);
}
}

View file

@ -214,6 +214,12 @@ void LoadINISettings()
CustomPipes::LightmapMult = CheckAndReadIniFloat("CustomPipesValues", "LightmapMult", CustomPipes::LightmapMult);
CustomPipes::GlossMult = CheckAndReadIniFloat("CustomPipesValues", "GlossMult", CustomPipes::GlossMult);
#endif
#ifdef ASPECT_RATIO_SCALE
CDraw::ms_nScalingMode = CheckAndReadIniInt("Draw", "ScalingMode", CDraw::ms_nScalingMode);
CDraw::ms_bFixRadar = CheckAndReadIniInt("Draw", "FixRadar", CDraw::ms_bFixRadar);
CDraw::ms_bFixSprites = CheckAndReadIniInt("Draw", "FixSpritesAspectRatio", CDraw::ms_bFixSprites);
#endif
}
void SaveINISettings()
@ -253,6 +259,12 @@ void SaveINISettings()
CheckAndSaveIniFloat("CustomPipesValues", "GlossMult", CustomPipes::GlossMult, changed);
#endif
#ifdef ASPECT_RATIO_SCALE
CheckAndSaveIniInt("Draw", "ScalingMode", CDraw::ms_nScalingMode, changed);
CheckAndSaveIniInt("Draw", "FixRadar", CDraw::ms_bFixRadar, changed);
CheckAndSaveIniInt("Draw", "FixSpritesAspectRatio", CDraw::ms_bFixSprites, changed);
#endif
if (changed)
cfg.write_file("re3.ini");
}

View file

@ -20,6 +20,12 @@ uint8 CDraw::FadeRed;
uint8 CDraw::FadeGreen;
uint8 CDraw::FadeBlue;
#ifdef ASPECT_RATIO_SCALE
int32 CDraw::ms_nScalingMode = SCL_PS2;
int32 CDraw::ms_bFixRadar = true;
int32 CDraw::ms_bFixSprites = true;
#endif
float
CDraw::FindAspectRatio(void)
{
@ -80,7 +86,7 @@ CDraw::SetFOV(float fov)
#ifdef ASPECT_RATIO_SCALE
float CDraw::ScaleY(float y)
{
switch ( CMenuManager::m_PrefsSpriteScalingMode )
switch ( ms_nScalingMode )
{
case SCL_PC: return y * ((float)DEFAULT_SCREEN_HEIGHT/SCREEN_HEIGHT_NTSC);
default:

View file

@ -18,7 +18,6 @@ enum eSpriteScalingMode
{
SCL_PC,
SCL_PS2,
SCL_AUTO,
};
class CDraw
@ -41,6 +40,11 @@ public:
static uint8 FadeRed;
static uint8 FadeGreen;
static uint8 FadeBlue;
#ifdef ASPECT_RATIO_SCALE
static int32 ms_nScalingMode;
static int32 ms_bFixRadar;
static int32 ms_bFixSprites;
#endif
static void SetNearClipZ(float nearclip) { ms_fNearClipZ = nearclip; }
static float GetNearClipZ(void) { return ms_fNearClipZ; }

View file

@ -1060,14 +1060,17 @@ void CHud::Draw()
DrawRadar
*/
#ifdef ASPECT_RATIO_SCALE
#define _RADAR_WIDTH ((CMenuManager::m_PrefsSpriteScalingMode==SCL_AUTO) ? (RADAR_HEIGHT) : (RADAR_WIDTH))
// The values are from from an early screenshot taken before R* broke radar
#define _RADAR_WIDTH ((CDraw::ms_bFixRadar) ? (82.0f) : (RADAR_WIDTH))
#define _RADAR_HEIGHT ((CDraw::ms_bFixRadar) ? (82.0f) : (RADAR_HEIGHT))
#else
#define _RADAR_WIDTH RADAR_WIDTH
#define _RADAR_HEIGHT RADAR_HEIGHT
#endif
if (m_ItemToFlash == ITEM_RADAR && CTimer::GetFrameCounter() & 8 || m_ItemToFlash != ITEM_RADAR) {
CRadar::DrawMap();
CRect rect(0.0f, 0.0f, SCREEN_SCALE_X(_RADAR_WIDTH), SCREEN_SCALE_Y(RADAR_HEIGHT));
rect.Translate(SCREEN_SCALE_X_FIX(RADAR_LEFT), SCREEN_SCALE_FROM_BOTTOM(RADAR_BOTTOM + RADAR_HEIGHT));
CRect rect(0.0f, 0.0f, SCREEN_SCALE_X(_RADAR_WIDTH), SCREEN_SCALE_Y(_RADAR_HEIGHT));
rect.Translate(SCREEN_SCALE_X_FIX(RADAR_LEFT), SCREEN_SCALE_FROM_BOTTOM(RADAR_BOTTOM + _RADAR_HEIGHT));
#ifdef PS2_HUD
#ifdef FIX_BUGS

View file

@ -41,7 +41,7 @@ CSprite::CalcScreenCoors(const RwV3d &in, RwV3d *out, float *outw, float *outh,
*outh = fovScale * recip * SCREEN_HEIGHT;
#ifdef ASPECT_RATIO_SCALE
if ( CMenuManager::m_PrefsSpriteScalingMode==SCL_AUTO )
if ( CDraw::ms_bFixSprites )
*outw = fovScale * recip * SCREEN_HEIGHT;
#endif

View file

@ -8058,9 +8058,6 @@ NEO
[FEM_PS2]
PS2
[FEM_PC]
PC
[FEM_XBX]
XBOX
@ -8073,9 +8070,6 @@ INVERT PAD VERTICALLY
[FEM_TWP]
Toggle Waypoint
[FEC_SCL]
SPRITE SCALING MODE
{ end of file }
[DUMMY]