summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/Clock.cpp9
-rw-r--r--src/core/Clock.h3
-rw-r--r--src/core/FrontEndControls.cpp2
-rw-r--r--src/core/Frontend.cpp1
-rw-r--r--src/core/Frontend_PS2.cpp2
-rw-r--r--src/core/Radar.h20
-rw-r--r--src/core/Streaming.h2
-rw-r--r--src/core/Wanted.h1
-rw-r--r--src/core/common.h45
-rw-r--r--src/core/config.h7
-rw-r--r--src/core/main.cpp4
-rw-r--r--src/core/re3.cpp30
12 files changed, 114 insertions, 12 deletions
diff --git a/src/core/Clock.cpp b/src/core/Clock.cpp
index b391e508..b0f0b34f 100644
--- a/src/core/Clock.cpp
+++ b/src/core/Clock.cpp
@@ -20,6 +20,7 @@ uint16 CClock::ms_Stored_nGameClockSeconds;
uint32 CClock::ms_nMillisecondsPerGameMinute;
uint32 CClock::ms_nLastClockTick;
bool CClock::ms_bClockHasBeenStored;
+float CClock::ms_EnvMapTimeMultiplicator;
#ifndef MASTER
bool gbFreezeTime;
@@ -35,6 +36,7 @@ CClock::Initialise(uint32 scale)
ms_nMillisecondsPerGameMinute = scale;
ms_nLastClockTick = CTimer::GetTimeInMilliseconds();
ms_bClockHasBeenStored = false;
+ ms_EnvMapTimeMultiplicator = 1.0f;
debug("CClock ready\n");
#ifndef MASTER
VarConsole.Add("Time (hour of day)", &ms_nGameClockHours, 1, 0, 23, true);
@@ -136,3 +138,10 @@ CClock::RestoreClock(void)
ms_nGameClockMinutes = ms_Stored_nGameClockMinutes;
ms_nGameClockSeconds = ms_Stored_nGameClockSeconds;
}
+
+void
+CClock::CalcEnvMapTimeMultiplicator(void)
+{
+ float nightness = Abs(ms_nGameClockHours/24.0f - 0.5f);
+ ms_EnvMapTimeMultiplicator = SQR(1.0f - nightness);;
+}
diff --git a/src/core/Clock.h b/src/core/Clock.h
index a611cd50..808e61f4 100644
--- a/src/core/Clock.h
+++ b/src/core/Clock.h
@@ -12,6 +12,7 @@ public:
static uint32 ms_nMillisecondsPerGameMinute;
static uint32 ms_nLastClockTick;
static bool ms_bClockHasBeenStored;
+ static float ms_EnvMapTimeMultiplicator;
static void Initialise(uint32 scale);
static void Update(void);
@@ -21,6 +22,8 @@ public:
static void StoreClock(void);
static void RestoreClock(void);
+ static void CalcEnvMapTimeMultiplicator(void);
+
static uint8 GetHours(void) { return ms_nGameClockHours; }
static uint8 GetMinutes(void) { return ms_nGameClockMinutes; }
static int16 GetSeconds(void) { return ms_nGameClockSeconds; }
diff --git a/src/core/FrontEndControls.cpp b/src/core/FrontEndControls.cpp
index 68992e16..18f6b3b2 100644
--- a/src/core/FrontEndControls.cpp
+++ b/src/core/FrontEndControls.cpp
@@ -7,7 +7,7 @@
#include "FrontEndControls.h"
#define X SCREEN_SCALE_X
-#define Y(x) SCREEN_SCALE_Y(float(x)*(float(DEFAULT_SCREEN_HEIGHT)/float(DEFAULT_SCREEN_HEIGHT_PAL)))
+#define Y(x) SCREEN_SCALE_Y(float(x)*(float(DEFAULT_SCREEN_HEIGHT)/float(SCREEN_HEIGHT_PAL)))
void
CPlaceableShText::Draw(float x, float y)
diff --git a/src/core/Frontend.cpp b/src/core/Frontend.cpp
index e0428fcf..62e2e65f 100644
--- a/src/core/Frontend.cpp
+++ b/src/core/Frontend.cpp
@@ -3,6 +3,7 @@
#include <dinput.h>
#endif
+#define FORCE_PC_SCALING
#define WITHWINDOWS
#include "common.h"
#ifndef PS2_MENU
diff --git a/src/core/Frontend_PS2.cpp b/src/core/Frontend_PS2.cpp
index 1ccb658b..c0fcc652 100644
--- a/src/core/Frontend_PS2.cpp
+++ b/src/core/Frontend_PS2.cpp
@@ -43,7 +43,7 @@ void DoRWStuffEndOfFrame(void);
#define X SCREEN_SCALE_X
#define Y SCREEN_SCALE_Y
-#define YF(x) Y(float(x)*(float(DEFAULT_SCREEN_HEIGHT)/float(DEFAULT_SCREEN_HEIGHT_PAL)))
+#define YF(x) Y(float(x)*(float(DEFAULT_SCREEN_HEIGHT)/float(SCREEN_HEIGHT_PAL)))
//#define X(x) ((x)/640.0f*SCRW)
//#define Y(y) ((y)/448.0f*SCRH)
diff --git a/src/core/Radar.h b/src/core/Radar.h
index ec047b74..6e0f36f8 100644
--- a/src/core/Radar.h
+++ b/src/core/Radar.h
@@ -161,8 +161,28 @@ struct sRadarTraceSave
// Values for screen space
#define RADAR_LEFT (40.0f)
#define RADAR_BOTTOM (40.0f)
+
+#ifdef FIX_RADAR
+/*
+ The values are from an early screenshot taken before R* broke radar
+ #define RADAR_WIDTH (82.0f)
+ #define RADAR_HEIGHT (82.0f)
+*/
+#define RADAR_WIDTH ((CDraw::ms_bFixRadar) ? (82.0f) : (94.0f))
+#define RADAR_HEIGHT ((CDraw::ms_bFixRadar) ? (82.0f) : (76.0f))
+#else
+/*
+ broken since forever, someone tried to fix size for 640x512(PAL)
+ http://aap.rockstarvision.com/pics/gta3/ps2screens/gta3_interface.jpg
+ but failed:
+ http://aap.rockstarvision.com/pics/gta3/artwork/gta3_artwork_16.jpg
+ most likely the guy used something like this:
+ int y = 82 * (640.0/512.0)/(640.0/480.0);
+ int x = y * (640.0/512.0);
+*/
#define RADAR_WIDTH (94.0f)
#define RADAR_HEIGHT (76.0f)
+#endif
class CRadar
{
diff --git a/src/core/Streaming.h b/src/core/Streaming.h
index 31786dfb..66262721 100644
--- a/src/core/Streaming.h
+++ b/src/core/Streaming.h
@@ -17,6 +17,8 @@ enum StreamFlags
STREAMFLAGS_PRIORITY = 0x08,
STREAMFLAGS_NOFADE = 0x10,
STREAMFLAGS_20 = 0x20, // TODO(MIAMI): what's this
+ STREAMFLAGS_40 = 0x40, // TODO(LCS): what's this
+ STREAMFLAGS_AMBIENT_SCRIPT_OWNED = 0x80,
STREAMFLAGS_CANT_REMOVE = STREAMFLAGS_DONT_REMOVE|STREAMFLAGS_SCRIPTOWNED,
STREAMFLAGS_KEEP_IN_MEMORY = STREAMFLAGS_DONT_REMOVE|STREAMFLAGS_SCRIPTOWNED|STREAMFLAGS_DEPENDENCY,
diff --git a/src/core/Wanted.h b/src/core/Wanted.h
index 057b5407..f2da23e3 100644
--- a/src/core/Wanted.h
+++ b/src/core/Wanted.h
@@ -41,6 +41,7 @@ public:
int32 NumOfHelisRequired();
void SetWantedLevel(int32);
void SetWantedLevelNoDrop(int32 level);
+ int32 GetWantedLevel() { return m_nWantedLevel; }
void CheatWantedLevel(int32 level);
void RegisterCrime(eCrimeType type, const CVector &coors, uint32 id, bool policeDoesntCare);
void RegisterCrime_Immediately(eCrimeType type, const CVector &coors, uint32 id, bool policeDoesntCare);
diff --git a/src/core/common.h b/src/core/common.h
index 9500e26f..ace15ee1 100644
--- a/src/core/common.h
+++ b/src/core/common.h
@@ -125,17 +125,43 @@ inline uint32 ldb(uint32 p, uint32 s, uint32 w)
#include "skeleton.h"
#include "Draw.h"
-#define DEFAULT_SCREEN_WIDTH (640)
-#define DEFAULT_SCREEN_HEIGHT (448)
-#define DEFAULT_SCREEN_HEIGHT_PAL (512)
-#define DEFAULT_SCREEN_HEIGHT_NTSC (448)
+#if defined(PROPER_SCALING)
+ #ifdef FORCE_PC_SCALING
+ #define DEFAULT_SCREEN_WIDTH (640)
+ #define DEFAULT_SCREEN_HEIGHT (448)
+ #else
+ #define DEFAULT_SCREEN_WIDTH (640)
+ #define DEFAULT_SCREEN_HEIGHT (480)
+ #endif
+#elif defined(GTA_PS2)
+ #define DEFAULT_SCREEN_WIDTH (640)
+ #define DEFAULT_SCREEN_HEIGHT (480)
+#else //elif defined(GTA_PC)
+ #define DEFAULT_SCREEN_WIDTH (640)
+ #define DEFAULT_SCREEN_HEIGHT (448)
+#endif
+
#define DEFAULT_ASPECT_RATIO (4.0f/3.0f)
#define DEFAULT_VIEWWINDOW (0.7f)
// game uses maximumWidth/Height, but this probably won't work
// with RW windowed mode
-#define SCREEN_WIDTH ((float)RsGlobal.width)
+#ifdef GTA_PS2
+ #ifdef GTA_PAL
+ #define SCREEN_WIDTH ((float)640)
+ #define SCREEN_HEIGHT ((float)512)
+ #else
+ #define SCREEN_WIDTH ((float)640)
+ #define SCREEN_HEIGHT ((float)448)
+ #endif
+#else
+#define SCREEN_WIDTH ((float)RsGlobal.width)
#define SCREEN_HEIGHT ((float)RsGlobal.height)
+#endif
+
+#define SCREEN_HEIGHT_PAL ((float)512)
+#define SCREEN_HEIGHT_NTSC ((float)448)
+
#define SCREEN_ASPECT_RATIO (CDraw::GetAspectRatio())
#define SCREEN_VIEWWINDOW (Tan(DEGTORAD(CDraw::GetScaledFOV() * 0.5f)))
@@ -153,8 +179,13 @@ inline uint32 ldb(uint32 p, uint32 s, uint32 w)
#ifdef ASPECT_RATIO_SCALE
#define SCREEN_SCALE_AR(a) ((a) * DEFAULT_ASPECT_RATIO / SCREEN_ASPECT_RATIO)
-extern float ScaleAndCenterX(float x);
-#define SCALE_AND_CENTER_X(x) ScaleAndCenterX(x)
+#define SCALE_AND_CENTER_X(x) ((SCREEN_WIDTH == DEFAULT_SCREEN_WIDTH) ? (x) : (SCREEN_WIDTH - SCREEN_SCALE_X(DEFAULT_SCREEN_WIDTH)) / 2 + SCREEN_SCALE_X((x)))
+#ifdef PROPER_SCALING
+ #ifndef FORCE_PC_SCALING
+ #undef SCREEN_SCALE_Y
+ #define SCREEN_SCALE_Y(a) CDraw::ScaleY(SCREEN_STRETCH_Y(a))
+ #endif
+#endif
#else
#define SCREEN_SCALE_AR(a) (a)
#define SCALE_AND_CENTER_X(x) SCREEN_STRETCH_X(x)
diff --git a/src/core/config.h b/src/core/config.h
index b6d03be6..225863f3 100644
--- a/src/core/config.h
+++ b/src/core/config.h
@@ -136,7 +136,7 @@ enum Config {
NUM_GARAGE_STORED_CARS = 4,
- NUM_CRANES = 8,
+ NUM_CRANES = 11,
NUM_ESCALATORS = 22,
NUM_WATER_CREATURES = 8,
@@ -254,6 +254,7 @@ enum Config {
// Rendering/display
#define ASPECT_RATIO_SCALE // Not just makes everything scale with aspect ratio, also adds support for all aspect ratios
+#define PROPER_SCALING // use original DEFAULT_SCREEN_WIDTH/DEFAULT_SCREEN_HEIGHT from PS2 instead of PC(R* changed HEIGHT here to make radar look better, but broke other hud elements aspect ratio).
#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
@@ -268,6 +269,8 @@ enum Config {
#define NEW_RENDERER // leeds-like world rendering, needs librw
#endif
+#define FIX_SPRITES // fix sprites aspect ratio(moon, coronas, particle etc)
+
#ifndef EXTENDED_COLOURFILTER
#undef SCREEN_DROPLETS // we need the backbuffer for this effect
#endif
@@ -298,6 +301,8 @@ enum Config {
// Hud, frontend and radar
#define PC_MENU
+#define FIX_RADAR // use radar size from early version before R* broke it
+
#ifndef PC_MENU
# define PS2_MENU
//# define PS2_MENU_USEALLPAGEICONS
diff --git a/src/core/main.cpp b/src/core/main.cpp
index 57c6a1a0..c516cd84 100644
--- a/src/core/main.cpp
+++ b/src/core/main.cpp
@@ -1147,10 +1147,10 @@ MattRenderScene(void)
/// CWorld::AdvanceCurrentScanCode();
// CMattRenderer::ResetRenderStates
/// CRenderer::ClearForFrame(); // before ConstructRenderList
- // CClock::CalcEnvMapTimeMultiplicator
+ CClock::CalcEnvMapTimeMultiplicator();
RwRenderStateSet(rwRENDERSTATECULLMODE, (void*)rwCULLMODECULLNONE);
CWaterLevel::RenderWater(); // actually CMattRenderer::RenderWater
- // CClock::ms_EnvMapTimeMultiplicator = 1.0f;
+ CClock::ms_EnvMapTimeMultiplicator = 1.0f;
// cWorldStream::ClearDynamics
/// CRenderer::ConstructRenderList(); // before PreRender
if(gbRenderWorld0)
diff --git a/src/core/re3.cpp b/src/core/re3.cpp
index fcf43409..4bc3bc30 100644
--- a/src/core/re3.cpp
+++ b/src/core/re3.cpp
@@ -220,6 +220,16 @@ void LoadINISettings()
CustomPipes::GlossMult = CheckAndReadIniFloat("CustomPipesValues", "GlossMult", CustomPipes::GlossMult);
#endif
gBackfaceCulling = CheckAndReadIniInt("Rendering", "BackfaceCulling", gBackfaceCulling);
+
+#ifdef PROPER_SCALING
+ CDraw::ms_bProperScaling = CheckAndReadIniInt("Draw", "ProperScaling", CDraw::ms_bProperScaling);
+#endif
+#ifdef FIX_RADAR
+ CDraw::ms_bFixRadar = CheckAndReadIniInt("Draw", "FixRadar", CDraw::ms_bFixRadar);
+#endif
+#ifdef FIX_SPRITES
+ CDraw::ms_bFixSprites = CheckAndReadIniInt("Draw", "FixSprites", CDraw::ms_bFixSprites);
+#endif
}
void SaveINISettings()
@@ -259,6 +269,16 @@ void SaveINISettings()
#endif
CheckAndSaveIniInt("Rendering", "BackfaceCulling", gBackfaceCulling, changed);
+#ifdef PROPER_SCALING
+ CheckAndSaveIniInt("Draw", "ProperScaling", CDraw::ms_bProperScaling, changed);
+#endif
+#ifdef FIX_RADAR
+ CheckAndSaveIniInt("Draw", "FixRadar", CDraw::ms_bFixRadar, changed);
+#endif
+#ifdef FIX_SPRITES
+ CheckAndSaveIniInt("Draw", "FixSprites", CDraw::ms_bFixSprites, changed);
+#endif
+
if (changed)
cfg.write_file("reLCS.ini");
}
@@ -672,6 +692,16 @@ extern bool gbRenderDebugEnvMap;
DebugMenuAddVarBool8("Render", "Don't render Vehicles", &gbDontRenderVehicles, nil);
DebugMenuAddVarBool8("Render", "Don't render Objects", &gbDontRenderObjects, nil);
DebugMenuAddVarBool8("Render", "Don't Render Water", &gbDontRenderWater, nil);
+
+#ifdef PROPER_SCALING
+ DebugMenuAddVarBool8("Draw", "Proper Scaling", &CDraw::ms_bProperScaling, nil);
+#endif
+#ifdef FIX_RADAR
+ DebugMenuAddVarBool8("Draw", "Fix Radar", &CDraw::ms_bFixRadar, nil);
+#endif
+#ifdef FIX_SPRITES
+ DebugMenuAddVarBool8("Draw", "Fix Sprites", &CDraw::ms_bFixSprites, nil);
+#endif
#ifndef FINAL
DebugMenuAddVarBool8("Debug", "Print Memory Usage", &gbPrintMemoryUsage, nil);