From 0d55b6182af41cf555ed026c7d0ffb5ebb18e431 Mon Sep 17 00:00:00 2001 From: aap Date: Thu, 5 Nov 2020 10:59:02 +0100 Subject: Merge pull request #795 from withmorten/master enable static runtime for all windows builds; fast floating point for x86/x64 builds; no sized dealloc for windows builds # Conflicts: # premake5.lua # src/core/config.h --- src/core/config.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/core') diff --git a/src/core/config.h b/src/core/config.h index ce77391c..6e0a17f7 100644 --- a/src/core/config.h +++ b/src/core/config.h @@ -243,8 +243,10 @@ enum Config { //#define NO_ISLAND_LOADING // disable loadscreen between islands via loading all island data at once, consumes more memory and CPU //#define USE_TEXTURE_POOL //#define CUTSCENE_BORDERS_SWITCH +#ifdef LIBRW //#define EXTENDED_COLOURFILTER // more options for colour filter (replaces mblur) //#define EXTENDED_PIPELINES // custom render pipelines (includes Neo) +#endif //#define MULTISAMPLING // adds MSAA option TODO #ifdef LIBRW -- cgit v1.2.3 From 5a59542679d1b3d230392fe5c0147659818d3ab8 Mon Sep 17 00:00:00 2001 From: Sergeanur Date: Thu, 5 Nov 2020 16:38:41 +0200 Subject: Fix inverted vertical camera --- src/core/Cam.cpp | 2 +- src/core/Pad.cpp | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'src/core') diff --git a/src/core/Cam.cpp b/src/core/Cam.cpp index 7af652ad..7560a86e 100644 --- a/src/core/Cam.cpp +++ b/src/core/Cam.cpp @@ -4626,7 +4626,7 @@ CCam::Process_FollowPed_Rotation(const CVector &CameraTarget, float TargetOrient */ { LookLeftRight = -CPad::GetPad(0)->LookAroundLeftRight(); - LookUpDown = -CPad::GetPad(0)->LookAroundUpDown(); + LookUpDown = CPad::GetPad(0)->LookAroundUpDown(); } float AlphaOffset, BetaOffset; if(UseMouse){ diff --git a/src/core/Pad.cpp b/src/core/Pad.cpp index b723eb1d..6752c1c5 100644 --- a/src/core/Pad.cpp +++ b/src/core/Pad.cpp @@ -3222,6 +3222,9 @@ int16 CPad::SniperModeLookUpDown(void) int16 axis = NewState.LeftStickY; int16 dpad; +#ifdef FIX_BUGS + axis = -axis; +#endif if (CPad::bInvertLook4Pad) { axis = -axis; dpad = (NewState.DPadDown - NewState.DPadUp) / 2; @@ -3257,7 +3260,9 @@ int16 CPad::LookAroundLeftRight(void) int16 CPad::LookAroundUpDown(void) { int16 axis = GetPad(0)->NewState.RightStickY; - +#ifdef FIX_BUGS + axis = -axis; +#endif if (CPad::bInvertLook4Pad) axis = -axis; -- cgit v1.2.3 From fe5d0c9cdf582026960c87988adcad31d6e67e13 Mon Sep 17 00:00:00 2001 From: erorcun Date: Sun, 8 Nov 2020 20:49:47 +0300 Subject: Font: Hud: Use orig. text dimensions, fix right-align calculations --- src/core/Frontend.cpp | 35 +++++++++++++++++++---------------- src/core/Frontend.h | 2 -- src/core/Game.cpp | 2 +- src/core/Pad.cpp | 4 ++-- 4 files changed, 22 insertions(+), 21 deletions(-) (limited to 'src/core') diff --git a/src/core/Frontend.cpp b/src/core/Frontend.cpp index eba0ca18..a52b9bfc 100644 --- a/src/core/Frontend.cpp +++ b/src/core/Frontend.cpp @@ -767,8 +767,8 @@ CMenuManager::DrawStandardMenus(bool activeScreen) CFont::SetBackGroundOnlyTextOff(); CFont::SetWrapx(MENU_X_RIGHT_ALIGNED(MENU_UNK_X_MARGIN)); - CFont::SetRightJustifyWrap(SCREEN_SCALE_X(MENU_UNK_WIDTH)); - CFont::SetCentreSize(SCREEN_WIDTH); + CFont::SetRightJustifyWrap(MENU_X_LEFT_ALIGNED(MENU_UNK_X_MARGIN)); + CFont::SetCentreSize(SCREEN_SCALE_X(DEFAULT_SCREEN_WIDTH)); switch (m_nCurrScreen) { case MENUPAGE_CHOOSE_LOAD_SLOT: @@ -808,7 +808,7 @@ CMenuManager::DrawStandardMenus(bool activeScreen) wchar *str; if (aScreens[m_nCurrScreen].m_aEntries[0].m_Action == MENUACTION_LABEL) { CFont::SetWrapx(MENU_X_RIGHT_ALIGNED(MENULABEL_X_MARGIN)); - CFont::SetRightJustifyWrap(SCREEN_SCALE_X(MENULABEL_WIDTH)); + CFont::SetRightJustifyWrap(MENU_X_LEFT_ALIGNED(MENULABEL_X_MARGIN)); CFont::SetFontStyle(FONT_LOCALE(FONT_STANDARD)); CFont::SetScale(MENU_X(BIGTEXT2_X_SCALE), MENU_Y(BIGTEXT2_Y_SCALE)); CFont::SetRightJustifyOff(); @@ -848,7 +848,7 @@ CMenuManager::DrawStandardMenus(bool activeScreen) CFont::PrintString(MENU_X_LEFT_ALIGNED(100.0f), MENU_Y(97.0f), str); CFont::SetWrapx(MENU_X_RIGHT_ALIGNED(MENU_UNK_X_MARGIN)); - CFont::SetRightJustifyWrap(SCREEN_SCALE_X(MENU_UNK_WIDTH)); + CFont::SetRightJustifyWrap(MENU_X_LEFT_ALIGNED(MENU_UNK_X_MARGIN)); } if (m_nCurrScreen == MENUPAGE_KEYBOARD_CONTROLS) { @@ -1300,14 +1300,17 @@ CMenuManager::DrawStandardMenus(bool activeScreen) ProcessSlider(TheCamera.m_fMouseAccelHorzntl * 200.0f, 170.0f, HOVEROPTION_INCREASE_MOUSESENS, HOVEROPTION_DECREASE_MOUSESENS, MENU_X_LEFT_ALIGNED(200.0f), SCREEN_WIDTH); break; } - - nextYToUse = MENU_Y(150.f); // TODO(Miami): Temp - + + // Not just unused, but also collides with the bug fix in Font.cpp. Yikes. +#ifndef FIX_BUGS nextYToUse += MENU_DEFAULT_LINE_HEIGHT * CFont::GetNumberLines(MENU_X_LEFT_ALIGNED(60.0f), MENU_Y(nextYToUse), leftText); +#endif - // TODO(Miami): Remove here after audio page is done + nextYToUse = 300.0f; // TODO(Miami): temp // Radio icons if (aScreens[m_nCurrScreen].m_aEntries[i].m_Action == MENUACTION_RADIO) { + + // TODO(Miami): Remove those after audio page is done ProcessRadioIcon(m_aFrontEndSprites[MENUSPRITE_WILDSTYLE], MENU_X_LEFT_ALIGNED(30.0f), MENU_Y(nextYToUse), 0, HOVEROPTION_RADIO_0); ProcessRadioIcon(m_aFrontEndSprites[MENUSPRITE_FLASH], MENU_X_LEFT_ALIGNED(90.0f), MENU_Y(nextYToUse), 1, HOVEROPTION_RADIO_1); ProcessRadioIcon(m_aFrontEndSprites[MENUSPRITE_KCHAT], MENU_X_LEFT_ALIGNED(150.0f), MENU_Y(nextYToUse), 2, HOVEROPTION_RADIO_2); @@ -1804,7 +1807,7 @@ CMenuManager::DrawControllerSetupScreen() CFont::SetRightJustifyOff(); CFont::SetBackGroundOnlyTextOn(); CFont::SetWrapx(MENU_X_RIGHT_ALIGNED(MENU_UNK_X_MARGIN)); - CFont::SetRightJustifyWrap(SCREEN_SCALE_X(MENU_UNK_WIDTH)); + CFont::SetRightJustifyWrap(MENU_X_LEFT_ALIGNED(MENU_UNK_X_MARGIN)); PREPARE_MENU_HEADER switch (m_ControlMethod) { @@ -2256,7 +2259,7 @@ CMenuManager::DrawPlayerSetupScreen(bool activeScreen) CFont::SetRightJustifyOff(); CFont::SetBackGroundOnlyTextOn(); CFont::SetWrapx(MENU_X_RIGHT_ALIGNED(MENU_UNK_X_MARGIN)); - CFont::SetRightJustifyWrap(SCREEN_SCALE_X(MENU_UNK_WIDTH)); + CFont::SetRightJustifyWrap(MENU_X_LEFT_ALIGNED(MENU_UNK_X_MARGIN)); // lstrcpy's changed with strcpy if (!m_bSkinsEnumerated) { @@ -3042,7 +3045,7 @@ CMenuManager::SmallMessageScreen(const char* text) CFont::SetBackGroundOnlyTextOn(); CSprite2d::DrawRect(CRect(SCREEN_STRETCH_X(95.0f), SCREEN_SCALE_FROM_BOTTOM(165.0f), SCREEN_STRETCH_FROM_RIGHT(95.0f), SCREEN_SCALE_Y(115.0f)), CRGBA(50, 50, 50, FadeIn(210))); CFont::SetFontStyle(FONT_LOCALE(FONT_STANDARD)); - CFont::SetCentreSize(SCREEN_STRETCH_X(430.0f)); + CFont::SetCentreSize(SCREEN_SCALE_X(430.0f)); CFont::SetCentreOn(); CFont::SetColor(CRGBA(LABEL_COLOR.r, LABEL_COLOR.g, LABEL_COLOR.b, FadeIn(255))); CFont::SetDropShadowPosition(2); @@ -4702,8 +4705,8 @@ CMenuManager::PrintMap(void) CRadar::DrawBlips(); if (m_PrefsShowLegends) { - CFont::SetWrapx(SCREEN_SCALE_FROM_RIGHT(40.0f)); - CFont::SetRightJustifyWrap(SCREEN_SCALE_X(84.0f)); + CFont::SetWrapx(MENU_X_RIGHT_ALIGNED(40.0f)); + CFont::SetRightJustifyWrap(MENU_X_LEFT_ALIGNED(84.0f)); CFont::SetBackGroundOnlyTextOff(); CFont::SetColor(CRGBA(LABEL_COLOR.r, LABEL_COLOR.g, LABEL_COLOR.b, FadeIn(255))); CFont::SetDropShadowPosition(2); @@ -4826,8 +4829,8 @@ CMenuManager::PrintMap(void) #endif m_bMenuMapActive = false; - CFont::SetWrapx(MENU_X_RIGHT_ALIGNED(10.0f)); - CFont::SetRightJustifyWrap(SCREEN_SCALE_X(10.0f)); + CFont::SetWrapx(MENU_X_RIGHT_ALIGNED(MENU_UNK_X_MARGIN)); + CFont::SetRightJustifyWrap(MENU_X_LEFT_ALIGNED(MENU_UNK_X_MARGIN)); DisplayHelperText("FEH_MPH"); } @@ -5049,4 +5052,4 @@ uint8 CMenuManager::GetNumberOfMenuOptions() #undef GetBackJustUp #undef GetBackJustDown -#endif \ No newline at end of file +#endif diff --git a/src/core/Frontend.h b/src/core/Frontend.h index 4c44e5e6..d2091a52 100644 --- a/src/core/Frontend.h +++ b/src/core/Frontend.h @@ -11,12 +11,10 @@ #define MENUHEADER_WIDTH 1.0f #define MENU_UNK_X_MARGIN 10.0f -#define MENU_UNK_WIDTH 10.0f #define MENUACTION_SCALE_MULT 0.9f #define MENULABEL_X_MARGIN 80.0f -#define MENULABEL_WIDTH 80.0f #define MENULABEL_POS_X 100.0f #define MENULABEL_POS_Y 97.0f diff --git a/src/core/Game.cpp b/src/core/Game.cpp index a8637980..4034c4b6 100644 --- a/src/core/Game.cpp +++ b/src/core/Game.cpp @@ -137,7 +137,7 @@ void MessageScreen(char *msg) CFont::SetWrapx(SCREEN_SCALE_FROM_RIGHT(190.0f)); // 450.0f CFont::SetScale(SCREEN_SCALE_X(1.0f), SCREEN_SCALE_Y(1.0f)); CFont::SetCentreOn(); - CFont::SetCentreSize(SCREEN_SCALE_FROM_RIGHT(190.0f)); // 450.0f + CFont::SetCentreSize(SCREEN_SCALE_X(450.0f)); CFont::SetJustifyOff(); CFont::SetColor(CRGBA(255, 255, 255, 255)); CFont::SetDropColor(CRGBA(32, 32, 32, 255)); diff --git a/src/core/Pad.cpp b/src/core/Pad.cpp index 6752c1c5..983fc588 100644 --- a/src/core/Pad.cpp +++ b/src/core/Pad.cpp @@ -3294,7 +3294,7 @@ void CPad::PrintErrorMessage(void) CFont::SetScale(SCREEN_SCALE_X(0.85f), SCREEN_SCALE_Y(1.0f)); CFont::SetJustifyOff(); CFont::SetBackgroundOff(); - CFont::SetCentreSize(SCREEN_STRETCH_FROM_RIGHT(50.0f)); + CFont::SetCentreSize(SCREEN_SCALE_X(590.0f)); CFont::SetCentreOn(); CFont::SetPropOn(); CFont::SetColor(CRGBA(255, 255, 200, 200)); @@ -3312,7 +3312,7 @@ void CPad::PrintErrorMessage(void) CFont::SetScale(SCREEN_SCALE_X(0.85f), SCREEN_SCALE_Y(1.0f)); CFont::SetJustifyOff(); CFont::SetBackgroundOff(); - CFont::SetCentreSize(SCREEN_STRETCH_FROM_RIGHT(50.0f)); + CFont::SetCentreSize(SCREEN_SCALE_X(590.0f)); CFont::SetCentreOn(); CFont::SetPropOn(); CFont::SetColor(CRGBA(255, 255, 200, 200)); -- cgit v1.2.3