diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/Camera.cpp | 4 | ||||
-rw-r--r-- | src/core/Fire.cpp | 7 | ||||
-rw-r--r-- | src/core/Frontend.cpp | 4 | ||||
-rw-r--r-- | src/core/Game.cpp | 18 | ||||
-rw-r--r-- | src/core/Pad.cpp | 33 | ||||
-rw-r--r-- | src/core/Pad.h | 1 | ||||
-rw-r--r-- | src/core/config.h | 5 |
7 files changed, 59 insertions, 13 deletions
diff --git a/src/core/Camera.cpp b/src/core/Camera.cpp index 9f3646e2..2f977a20 100644 --- a/src/core/Camera.cpp +++ b/src/core/Camera.cpp @@ -3995,8 +3995,8 @@ CCamera::CalculateDerivedValues(void) m_cameraMatrix = Invert(m_matrix); float hfov = DEGTORAD(CDraw::GetScaledFOV()/2.0f); - float c = cos(hfov); - float s = sin(hfov); + float c = Cos(hfov); + float s = Sin(hfov); // right plane m_vecFrustumNormals[0] = CVector(c, -s, 0.0f); diff --git a/src/core/Fire.cpp b/src/core/Fire.cpp index 3752f1ba..a6928def 100644 --- a/src/core/Fire.cpp +++ b/src/core/Fire.cpp @@ -141,11 +141,8 @@ CFire::ProcessFire(void) lightpos.z = m_vecPos.z + 5.0f; if (!m_pEntity) { - CShadows::StoreStaticShadow((uintptr)this, SHADOWTYPE_ADDITIVE, gpShadowExplosionTex, &lightpos, - 7.0f, 0.0f, 0.0f, -7.0f, - 255, // this is 0 on PC which results in no shadow - nRandNumber / 2, nRandNumber / 2, 0, - 10.0f, 1.0f, 40.0f, 0, 0.0f); + CShadows::StoreStaticShadow((uintptr)this, SHADOWTYPE_ADDITIVE, gpShadowExplosionTex, &lightpos, 7.0f, 0.0f, 0.0f, -7.0f, 0, nRandNumber / 2, + nRandNumber / 2, 0, 10.0f, 1.0f, 40.0f, 0, 0.0f); } fGreen = nRandNumber / 128; fRed = nRandNumber / 128; diff --git a/src/core/Frontend.cpp b/src/core/Frontend.cpp index 06744ac2..ccb89fbd 100644 --- a/src/core/Frontend.cpp +++ b/src/core/Frontend.cpp @@ -3409,9 +3409,9 @@ CMenuManager::SmallMessageScreen(const char* text) CFont::SetPropOn(); CFont::SetJustifyOn(); CFont::SetBackGroundOnlyTextOn(); - CSprite2d::DrawRect(CRect(SCREEN_SCALE_X(95.0f), SCREEN_SCALE_FROM_BOTTOM(165.0f), SCREEN_SCALE_FROM_RIGHT(95.0f), SCREEN_SCALE_Y(115.0f)), CRGBA(50, 50, 50, FadeIn(210))); + 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_SCALE_X(430.0f)); + CFont::SetCentreSize(SCREEN_STRETCH_X(430.0f)); CFont::SetCentreOn(); CFont::SetColor(CRGBA(LABEL_COLOR.r, LABEL_COLOR.g, LABEL_COLOR.b, FadeIn(255))); CFont::SetDropShadowPosition(2); diff --git a/src/core/Game.cpp b/src/core/Game.cpp index 39bbd364..7700d321 100644 --- a/src/core/Game.cpp +++ b/src/core/Game.cpp @@ -152,9 +152,14 @@ CGame::InitialiseOnceBeforeRW(void) return true; } -#if !defined(LIBRW) && defined(PS2_MATFX) +#ifndef LIBRW +#ifdef PS2_MATFX void ReplaceMatFxCallback(); -#endif +#endif // PS2_MATFX +#ifdef PS2_ALPHA_TEST +void ReplaceAtomicPipeCallback(); +#endif // PS2_ALPHA_TEST +#endif // !LIBRW bool CGame::InitialiseRenderWare(void) @@ -206,9 +211,14 @@ CGame::InitialiseRenderWare(void) #else rw::MatFX::modulateEnvMap = false; #endif -#elif defined(PS2_MATFX) +#else +#ifdef PS2_MATFX ReplaceMatFxCallback(); -#endif +#endif // PS2_MATFX +#ifdef PS2_ALPHA_TEST + ReplaceAtomicPipeCallback(); +#endif // PS2_ALPHA_TEST +#endif // LIBRW CFont::Initialise(); CHud::Initialise(); diff --git a/src/core/Pad.cpp b/src/core/Pad.cpp index 8043bb6c..c1016bdd 100644 --- a/src/core/Pad.cpp +++ b/src/core/Pad.cpp @@ -8,6 +8,7 @@ #include "common.h" #include "crossplatform.h" +#include "platform.h" #ifdef XINPUT #include <xinput.h> #pragma comment( lib, "Xinput9_1_0.lib" ) @@ -2643,6 +2644,38 @@ bool CPad::TargetJustDown(void) return false; } +bool CPad::CollectPickupJustDown(void) +{ + if ( ArePlayerControlsDisabled() ) + return false; + + switch (CURMODE) + { + case 0: + case 1: + { + return !!(NewState.LeftShoulder1 && !OldState.LeftShoulder1); + + break; + } + case 2: + { + return !!(NewState.Triangle && !OldState.Triangle); + + break; + } + + case 3: + { + return !!(NewState.Circle && !OldState.Circle); + + break; + } + } + + return false; +} + bool CPad::DuckJustDown(void) { if (ArePlayerControlsDisabled()) diff --git a/src/core/Pad.h b/src/core/Pad.h index f76d7b5d..2a0bb7d3 100644 --- a/src/core/Pad.h +++ b/src/core/Pad.h @@ -238,6 +238,7 @@ public: bool GetTarget(void); bool TargetJustDown(void); bool DuckJustDown(void); + bool CollectPickupJustDown(void); bool JumpJustDown(void); bool GetSprint(void); bool ShiftTargetLeftJustDown(void); diff --git a/src/core/config.h b/src/core/config.h index c9c65051..4cd4cbe1 100644 --- a/src/core/config.h +++ b/src/core/config.h @@ -135,6 +135,7 @@ enum Config { NUM_GARAGE_STORED_CARS = 4, NUM_CRANES = 8, + NUM_ESCALATORS = 22, NUM_EXPLOSIONS = 48, @@ -214,6 +215,7 @@ enum Config { #define ASPECT_RATIO_SCALE // Not just makes everything scale with aspect ratio, also adds support for all aspect ratios #define DEFAULT_NATIVE_RESOLUTION // Set default video mode to your native resolution (fixes Windows 10 launch) #define USE_TXD_CDIMAGE // generate and load textures from txd.img +#define PS2_ALPHA_TEST // emulate ps2 alpha test #define IMPROVED_VIDEOMODE // save and load videomode parameters instead of a magic number //#define DISABLE_LOADING_SCREEN // disable the loading screen which vastly improves the loading time //#define NO_ISLAND_LOADING // disable loadscreen between islands via loading all island data at once, consumes more memory and CPU @@ -292,4 +294,7 @@ enum Config { #define FREE_CAM // Rotating cam // Audio +#ifndef AUDIO_OAL // is not working yet for openal #define AUDIO_CACHE // cache sound lengths to speed up the cold boot +#endif +//#define PS2_AUDIO // changes audio paths for cutscenes and radio to PS2 paths, needs vbdec to support VB with MSS
\ No newline at end of file |