summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2021-01-12 11:45:56 +0100
committerSergeanur <s.anureev@yandex.ua>2021-01-12 11:55:07 +0100
commitcb4b4d584c4d08791207ff92870b400a84faa742 (patch)
treefc740c000f1283fb695de5556cdd59efcf71e65b
parentMerge branch 'lcs-dev' into lcs (diff)
parentpremake: add startrpoject; add lto option; fix copying of binary to gamedir; update premake5.exe (diff)
downloadre3-cb4b4d584c4d08791207ff92870b400a84faa742.tar
re3-cb4b4d584c4d08791207ff92870b400a84faa742.tar.gz
re3-cb4b4d584c4d08791207ff92870b400a84faa742.tar.bz2
re3-cb4b4d584c4d08791207ff92870b400a84faa742.tar.lz
re3-cb4b4d584c4d08791207ff92870b400a84faa742.tar.xz
re3-cb4b4d584c4d08791207ff92870b400a84faa742.tar.zst
re3-cb4b4d584c4d08791207ff92870b400a84faa742.zip
Diffstat (limited to '')
-rw-r--r--premake5.exebin1362432 -> 1395712 bytes
-rw-r--r--premake5.lua13
-rwxr-xr-xpremake5Linuxbin2035312 -> 2035312 bytes
-rw-r--r--src/control/CarCtrl.cpp2
-rw-r--r--src/control/Pickups.cpp6
-rw-r--r--src/control/SceneEdit.cpp4
-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/Wanted.h1
-rw-r--r--src/core/common.h45
-rw-r--r--src/core/config.h5
-rw-r--r--src/core/re3.cpp30
-rw-r--r--src/peds/Ped.h7
-rw-r--r--src/render/Draw.cpp22
-rw-r--r--src/render/Draw.h13
-rw-r--r--src/render/Font.cpp8
-rw-r--r--src/render/Hud.cpp23
-rw-r--r--src/render/Particle.cpp6
-rw-r--r--src/render/ParticleType.h2
-rw-r--r--src/render/Sprite.cpp4
-rw-r--r--src/vehicles/Automobile.cpp20
-rw-r--r--src/vehicles/Boat.cpp10
m---------vendor/librw0
25 files changed, 192 insertions, 54 deletions
diff --git a/premake5.exe b/premake5.exe
index 9048d51e..a8483721 100644
--- a/premake5.exe
+++ b/premake5.exe
Binary files differ
diff --git a/premake5.lua b/premake5.lua
index 7634ccdf..6c26732c 100644
--- a/premake5.lua
+++ b/premake5.lua
@@ -34,6 +34,11 @@ newoption {
description = "Build with opus"
}
+newoption {
+ trigger = "lto",
+ description = "Use link time optimization"
+}
+
if(_OPTIONS["with-librw"]) then
Librw = "vendor/librw"
else
@@ -61,6 +66,7 @@ end
workspace "reLCS"
language "C++"
configurations { "Debug", "Release" }
+ startproject "reLCS"
location "build"
symbols "Full"
staticruntime "off"
@@ -109,7 +115,10 @@ workspace "reLCS"
filter "configurations:Release"
defines { "NDEBUG" }
- optimize "On"
+ optimize "Speed"
+ if(_OPTIONS["lto"]) then
+ flags { "LinkTimeOptimization" }
+ end
filter { "platforms:win*" }
system "windows"
@@ -167,7 +176,7 @@ workspace "reLCS"
scriptspath = scriptspath or ""
if (gamepath) then
postbuildcommands {
- '{COPY} "%{cfg.buildtarget.abspath}" "' .. gamepath .. scriptspath .. '%{cfg.buildtarget.name}"'
+ '{COPYFILE} "%{cfg.buildtarget.abspath}" "' .. gamepath .. scriptspath .. '%{cfg.buildtarget.name}"'
}
debugdir (gamepath)
if (exepath) then
diff --git a/premake5Linux b/premake5Linux
index 2fd412da..1ca75167 100755
--- a/premake5Linux
+++ b/premake5Linux
Binary files differ
diff --git a/src/control/CarCtrl.cpp b/src/control/CarCtrl.cpp
index f171485f..faee574c 100644
--- a/src/control/CarCtrl.cpp
+++ b/src/control/CarCtrl.cpp
@@ -2961,7 +2961,7 @@ void CCarCtrl::SteerAICarWithPhysicsHeadingForTarget(CVehicle* pVehicle, CPhysic
*pHandbrake = true;
float maxAngle = FindMaxSteerAngle(pVehicle);
steerAngle = Min(maxAngle, Max(-maxAngle, steerAngle));
- float speedMultiplier = FindSpeedMultiplier(angleToTarget - angleForward,
+ float speedMultiplier = FindSpeedMultiplier(CGeneral::GetATanOfXY(targetX - pVehicle->GetPosition().x, targetY - pVehicle->GetPosition().y) - angleForward,
MIN_ANGLE_FOR_SPEED_LIMITING, MAX_ANGLE_FOR_SPEED_LIMITING, MIN_LOWERING_SPEED_COEFFICIENT);
float speedTarget = pVehicle->AutoPilot.m_nCruiseSpeed * speedMultiplier;
float currentSpeed = pVehicle->GetMoveSpeed().Magnitude() * GAME_SPEED_TO_CARAI_SPEED;
diff --git a/src/control/Pickups.cpp b/src/control/Pickups.cpp
index 3470e475..5186a8d2 100644
--- a/src/control/Pickups.cpp
+++ b/src/control/Pickups.cpp
@@ -1186,7 +1186,9 @@ CPickups::DoPickUpEffects(CEntity *entity)
CCoronas::REFLECTION_OFF,
CCoronas::LOSCHECK_OFF,
CCoronas::STREAK_OFF,
- 0.0f);
+ 0.0f,
+ false,
+ -0.5f);
}
}
@@ -1253,7 +1255,7 @@ CPickups::DoCollectableEffects(CEntity *entity)
int32 color = (MAXDIST - dist) * (0.5f * s + 0.5f) / MAXDIST * 255.0f;
CShadows::StoreStaticShadow((uintptr)entity, SHADOWTYPE_ADDITIVE, gpShadowExplosionTex, &pos, 2.0f, 0.0f, 0.0f, -2.0f, 0, color, color, color, 4.0f,
1.0f, 40.0f, false, 0.0f);
- CCoronas::RegisterCorona((uintptr)entity, color, color, color, 255, pos, 0.6f, 40.0f, CCoronas::TYPE_RING, CCoronas::FLARE_NONE, CCoronas::REFLECTION_OFF, CCoronas::LOSCHECK_OFF, CCoronas::STREAK_OFF, 0.0f);
+ CCoronas::RegisterCorona((uintptr)entity, color, color, color, 255, pos, 0.6f, 40.0f, CCoronas::TYPE_HEX, CCoronas::FLARE_NONE, CCoronas::REFLECTION_OFF, CCoronas::LOSCHECK_OFF, CCoronas::STREAK_OFF, 0.0f);
}
entity->GetMatrix().SetRotateZOnly((float)(CTimer::GetTimeInMilliseconds() & 0xFFF) * DEGTORAD(360.0f / 0x1000));
diff --git a/src/control/SceneEdit.cpp b/src/control/SceneEdit.cpp
index 20f09cb4..c793e027 100644
--- a/src/control/SceneEdit.cpp
+++ b/src/control/SceneEdit.cpp
@@ -331,7 +331,7 @@ void CSceneEdit::Draw(void)
#ifdef FIX_BUGS
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(COMMAND_NAME_X_RIGHT - SHADOW_OFFSET), SCREEN_SCALE_Y(COMMAND_NAME_Y + SHADOW_OFFSET + i * COMMAND_NAME_HEIGHT), wstr);
#else
- CFont::PrintString(SCREEN_SCALE_X(DEFAULT_SCREEN_WIDTH-COMMAND_NAME_X_RIGHT) + SHADOW_OFFSET, SCREEN_SCALE_FROM_BOTTOM(DEFAULT_SCREEN_HEIGHT-COMMAND_NAME_Y) + SHADOW_OFFSET + i * COMMAND_NAME_HEIGHT), wstr);
+ CFont::PrintString(SCREEN_SCALE_X(DEFAULT_SCREEN_WIDTH-COMMAND_NAME_X_RIGHT) + SHADOW_OFFSET, SCREEN_SCALE_FROM_BOTTOM(DEFAULT_SCREEN_HEIGHT-COMMAND_NAME_Y) + SHADOW_OFFSET + i * COMMAND_NAME_HEIGHT, wstr);
#endif
if (nCommandDrawn == m_nCurrentCommand)
CFont::SetColor(CRGBA(156, 91, 40, 255));
@@ -340,7 +340,7 @@ void CSceneEdit::Draw(void)
#ifdef FIX_BUGS
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(COMMAND_NAME_X_RIGHT), SCREEN_SCALE_Y(COMMAND_NAME_Y + i * COMMAND_NAME_HEIGHT), wstr);
#else
- CFont::PrintString(SCREEN_SCALE_X(DEFAULT_SCREEN_WIDTH-COMMAND_NAME_X_RIGHT), SCREEN_SCALE_FROM_BOTTOM(DEFAULT_SCREEN_HEIGHT-COMMAND_NAME_Y) + i * COMMAND_NAME_HEIGHT), wstr);
+ CFont::PrintString(SCREEN_SCALE_X(DEFAULT_SCREEN_WIDTH-COMMAND_NAME_X_RIGHT), SCREEN_SCALE_FROM_BOTTOM(DEFAULT_SCREEN_HEIGHT-COMMAND_NAME_Y) + i * COMMAND_NAME_HEIGHT, wstr);
#endif
}
}
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/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 ed95f6d3..3e919ab6 100644
--- a/src/core/common.h
+++ b/src/core/common.h
@@ -124,17 +124,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)))
@@ -152,8 +178,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 2886e674..711e119a 100644
--- a/src/core/config.h
+++ b/src/core/config.h
@@ -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/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);
diff --git a/src/peds/Ped.h b/src/peds/Ped.h
index 573d8083..4056898e 100644
--- a/src/peds/Ped.h
+++ b/src/peds/Ped.h
@@ -529,10 +529,15 @@ public:
uint32 b1A1_10 : 1;
uint32 b1A1_20 : 1;
+#ifdef KANGAROO_CHEAT
// our own flags
uint32 m_ped_flagI80 : 1; // KANGAROO_CHEAT define makes use of this as cheat toggle
+#endif
uint8 m_gangFlags;
+ uint8 m_unused15D; // these 3 can't be padding but had to actually have been members ...
+ uint8 m_unused15E;
+ uint8 m_unused15F;
uint8 CharCreatedBy;
eObjective m_objective;
eObjective m_prevObjective;
@@ -573,7 +578,7 @@ public:
uint32 m_pathNodeTimer;
CPathNode m_pathNodeObjPool[8];
CPathNode* m_pCurPathNode;
- char m_nPathDir;
+ int8 m_nPathDir;
CPathNode* m_pLastPathNode;
CPathNode* m_pNextPathNode;
CVector m_followPathDestPos;
diff --git a/src/render/Draw.cpp b/src/render/Draw.cpp
index 912399c9..507653f6 100644
--- a/src/render/Draw.cpp
+++ b/src/render/Draw.cpp
@@ -20,6 +20,16 @@ uint8 CDraw::FadeRed;
uint8 CDraw::FadeGreen;
uint8 CDraw::FadeBlue;
+#ifdef PROPER_SCALING
+bool CDraw::ms_bProperScaling = true;
+#endif
+#ifdef FIX_RADAR
+bool CDraw::ms_bFixRadar = true;
+#endif
+#ifdef FIX_SPRITES
+bool CDraw::ms_bFixSprites = true;
+#endif
+
float
CDraw::CalculateAspectRatio(void)
{
@@ -75,13 +85,9 @@ CDraw::SetFOV(float fov)
ms_fFOV = fov;
}
-#ifdef ASPECT_RATIO_SCALE
-float
-ScaleAndCenterX(float x)
+#ifdef PROPER_SCALING
+float CDraw::ScaleY(float y)
{
- if (SCREEN_WIDTH == DEFAULT_SCREEN_WIDTH)
- return x;
- else
- return (SCREEN_WIDTH - SCREEN_SCALE_X(DEFAULT_SCREEN_WIDTH)) / 2 + SCREEN_SCALE_X(x);
+ return ms_bProperScaling ? y : y * ((float)DEFAULT_SCREEN_HEIGHT/SCREEN_HEIGHT_NTSC);
}
-#endif \ No newline at end of file
+#endif \ No newline at end of file
diff --git a/src/render/Draw.h b/src/render/Draw.h
index 2976dc34..1a63c980 100644
--- a/src/render/Draw.h
+++ b/src/render/Draw.h
@@ -30,6 +30,16 @@ public:
static uint8 FadeRed;
static uint8 FadeGreen;
static uint8 FadeBlue;
+
+#ifdef PROPER_SCALING
+ static bool ms_bProperScaling;
+#endif
+#ifdef FIX_RADAR
+ static bool ms_bFixRadar;
+#endif
+#ifdef FIX_SPRITES
+ static bool ms_bFixSprites;
+#endif
static void SetNearClipZ(float nearclip) { ms_fNearClipZ = nearclip; }
static float GetNearClipZ(void) { return ms_fNearClipZ; }
@@ -50,4 +60,7 @@ public:
#endif
static float GetAspectRatio(void) { return ms_fAspectRatio; }
static void SetAspectRatio(float ratio) { ms_fAspectRatio = ratio; }
+#ifdef PROPER_SCALING
+ static float ScaleY(float y);
+#endif
};
diff --git a/src/render/Font.cpp b/src/render/Font.cpp
index 3517031d..6d569591 100644
--- a/src/render/Font.cpp
+++ b/src/render/Font.cpp
@@ -444,7 +444,7 @@ CFont::PrintChar(float x, float y, wchar c)
}
#endif
- if(Details.style == FONT_BANK || Details.style == FONT_STANDARD){
+ if(RenderState.style == FONT_BANK || RenderState.style == FONT_STANDARD){
if (bDontPrint) return;
if (RenderState.slant == 0.0f) {
#ifdef FIX_BUGS
@@ -1051,10 +1051,10 @@ CFont::GetCharacterWidth(wchar c)
return Size[LanguageSet][Details.style][192];
#else
- if (Details.proportional)
- return Size[Details.style][c];
+ if (RenderState.proportional)
+ return Size[RenderState.style][c];
else
- return Size[Details.style][209];
+ return Size[RenderState.style][209];
#endif // MORE_LANGUAGES
}
diff --git a/src/render/Hud.cpp b/src/render/Hud.cpp
index 1c870fd2..d7a9d75d 100644
--- a/src/render/Hud.cpp
+++ b/src/render/Hud.cpp
@@ -28,6 +28,16 @@
// --MIAMI: file done
+#if defined(FIX_BUGS)
+ #define SCREEN_SCALE_X_FIX(a) SCREEN_SCALE_X(a)
+ #define SCREEN_SCALE_Y_FIX(a) SCREEN_SCALE_Y(a)
+ #define SCALE_AND_CENTER_X_FIX(a) SCALE_AND_CENTER_X(a)
+#else
+ #define SCREEN_SCALE_X_FIX(a) (a)
+ #define SCREEN_SCALE_Y_FIX(a) (a)
+ #define SCALE_AND_CENTER_X_FIX(a) (a)
+#endif
+
// Game has colors inlined in code.
// For easier modification we collect them here:
CRGBA MONEY_COLOR(0, 207, 133, 255);
@@ -1052,16 +1062,17 @@ void CHud::Draw()
CRadar::DrawMap();
if (FrontEndMenuManager.m_PrefsRadarMode != 1) {
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 FIX_BUGS
- rect.Translate(SCREEN_SCALE_X(RADAR_LEFT), SCREEN_SCALE_FROM_BOTTOM(RADAR_BOTTOM + RADAR_HEIGHT));
+ rect.Grow(SCREEN_SCALE_X(6.0f), SCREEN_SCALE_X(6.0f), SCREEN_SCALE_Y(6.0f), SCREEN_SCALE_Y(6.0f));
#else
- rect.Translate(RADAR_LEFT, SCREEN_SCALE_FROM_BOTTOM(RADAR_BOTTOM + RADAR_HEIGHT));
-#endif
-
rect.Grow(6.0f);
- rect.Translate(0.0f, 2.0f);
+#endif
+ rect.Translate(SCREEN_SCALE_X_FIX(0.0f), SCREEN_SCALE_Y_FIX(2.0f));
Sprites[HUD_RADARDISC].Draw(rect, CRGBA(0, 0, 0, 255));
- rect.Translate(0.0f, -2.0f);
+ rect.Translate(SCREEN_SCALE_X_FIX(0.0f), SCREEN_SCALE_Y_FIX(-2.0f));
Sprites[HUD_RADARDISC].Draw(rect, RADARDISC_COLOR);
}
CRadar::DrawBlips();
diff --git a/src/render/Particle.cpp b/src/render/Particle.cpp
index 0ad4681d..51249844 100644
--- a/src/render/Particle.cpp
+++ b/src/render/Particle.cpp
@@ -2331,9 +2331,9 @@ void CParticle::AddJetExplosion(CVector const &vecPos, float fPower, float fSize
vecStepPos,
CVector
(
- CGeneral::GetRandomNumberInRange(-0.2f, 0.2f),
- CGeneral::GetRandomNumberInRange(-0.2f, 0.2f),
- CGeneral::GetRandomNumberInRange(-0.2f, 0.0f)
+ CGeneral::GetRandomNumberInRange(-0.02f, 0.02f),
+ CGeneral::GetRandomNumberInRange(-0.02f, 0.02f),
+ CGeneral::GetRandomNumberInRange(-0.02f, 0.0f)
),
nil,
fSize, color, 0, 0, 0, 0);
diff --git a/src/render/ParticleType.h b/src/render/ParticleType.h
index 0af9a1e1..9578083d 100644
--- a/src/render/ParticleType.h
+++ b/src/render/ParticleType.h
@@ -88,5 +88,5 @@ enum tParticleType
MAX_PARTICLES,
PARTICLE_FIRST = PARTICLE_SPARK,
- PARTICLE_LAST = PARTICLE_RAINDROP_2D
+ PARTICLE_LAST = PARTICLE_HEATHAZE_IN_DIST
}; \ No newline at end of file
diff --git a/src/render/Sprite.cpp b/src/render/Sprite.cpp
index 401eebd0..ba6ab291 100644
--- a/src/render/Sprite.cpp
+++ b/src/render/Sprite.cpp
@@ -33,7 +33,11 @@ CSprite::CalcScreenCoors(const RwV3d &in, RwV3d *out, float *outw, float *outh,
// this is used to scale correctly if you zoom in with sniper rifle
float fovScale = fov / CDraw::GetFOV();
+#ifdef FIX_SPRITES
+ *outw = CDraw::ms_bFixSprites ? (fovScale * recip * SCREEN_HEIGHT) : (fovScale * SCREEN_SCALE_AR(recip) * SCREEN_WIDTH);
+#else
*outw = fovScale * SCREEN_SCALE_AR(recip) * SCREEN_WIDTH;
+#endif
*outh = fovScale * recip * SCREEN_HEIGHT;
return true;
diff --git a/src/vehicles/Automobile.cpp b/src/vehicles/Automobile.cpp
index 6db4313d..15cbf231 100644
--- a/src/vehicles/Automobile.cpp
+++ b/src/vehicles/Automobile.cpp
@@ -288,17 +288,17 @@ CAutomobile::ProcessControl(void)
// Improve grip of vehicles in certain cases
bool strongGrip1 = false;
bool strongGrip2 = false;
- if(FindPlayerVehicle() && this != FindPlayerVehicle() &&
+ if(FindPlayerVehicle() && this != FindPlayerVehicle() && FindPlayerPed()->m_pWanted->GetWantedLevel() > 3 &&
(AutoPilot.m_nCarMission == MISSION_RAMPLAYER_FARAWAY || AutoPilot.m_nCarMission == MISSION_RAMPLAYER_CLOSE ||
- AutoPilot.m_nCarMission == MISSION_BLOCKPLAYER_FARAWAY || AutoPilot.m_nCarMission == MISSION_BLOCKPLAYER_CLOSE)){
- if(FindPlayerSpeed().Magnitude() > 0.3f){
- strongGrip1 = true;
- if(FindPlayerSpeed().Magnitude() > 0.4f &&
- m_vecMoveSpeed.Magnitude() < 0.3f)
- strongGrip2 = true;
- else if((GetPosition() - FindPlayerCoors()).Magnitude() > 50.0f)
- strongGrip2 = true;
- }
+ AutoPilot.m_nCarMission == MISSION_BLOCKPLAYER_FARAWAY || AutoPilot.m_nCarMission == MISSION_BLOCKPLAYER_CLOSE) &&
+ FindPlayerSpeed().Magnitude() > 0.3f){
+
+ strongGrip1 = true;
+ if(FindPlayerSpeed().Magnitude() > 0.4f &&
+ m_vecMoveSpeed.Magnitude() < 0.3f)
+ strongGrip2 = true;
+ else if((GetPosition() - FindPlayerCoors()).Magnitude() > 50.0f)
+ strongGrip2 = true;
}else if(GetModelIndex() == MI_RCBANDIT && GetStatus() != STATUS_PLAYER_REMOTE)
strongGrip1 = true;
diff --git a/src/vehicles/Boat.cpp b/src/vehicles/Boat.cpp
index 695d380f..8dec0f89 100644
--- a/src/vehicles/Boat.cpp
+++ b/src/vehicles/Boat.cpp
@@ -32,15 +32,15 @@
#define INVALID_ORIENTATION (-9999.99f)
-float fShapeLength = 0.4f;
-float fShapeTime = 0.05f;
-float fRangeMult = 0.6f;
-float fTimeMult;
-
float CBoat::MAX_WAKE_LENGTH = 50.0f;
float CBoat::MIN_WAKE_INTERVAL = 2.0f;
float CBoat::WAKE_LIFETIME = 150.0f;
+float fShapeLength = 0.4f;
+float fShapeTime = 0.05f;
+float fRangeMult = 0.6f;
+float fTimeMult = 1.2f/CBoat::WAKE_LIFETIME;
+
CBoat *CBoat::apFrameWakeGeneratingBoats[4];
const uint32 CBoat::nSaveStructSize =
diff --git a/vendor/librw b/vendor/librw
-Subproject 78d540fce0ca090b07377cee40d73eadfb7a699
+Subproject 61b288a9fe72ae4073c0ac5fd2a5815ed510c8c