summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/CdStream.cpp4
-rw-r--r--src/core/ControllerConfig.cpp5
-rw-r--r--src/core/EventList.cpp4
-rw-r--r--src/core/Frontend.cpp25
-rw-r--r--src/core/Frontend.h2
-rw-r--r--src/core/Pad.cpp18
-rw-r--r--src/core/Pad.h8
-rw-r--r--src/core/Radar.cpp12
-rw-r--r--src/core/common.h2
-rw-r--r--src/core/config.h5
-rw-r--r--src/core/main.cpp3
-rw-r--r--src/core/timebars.cpp4
-rw-r--r--src/core/timebars.h4
13 files changed, 61 insertions, 35 deletions
diff --git a/src/core/CdStream.cpp b/src/core/CdStream.cpp
index d9978040..c11fb72a 100644
--- a/src/core/CdStream.cpp
+++ b/src/core/CdStream.cpp
@@ -106,12 +106,14 @@ CdStreamInit(int32 numChannels)
GetDiskFreeSpace(nil, &SectorsPerCluster, &BytesPerSector, &NumberOfFreeClusters, &TotalNumberOfClusters);
_gdwCdStreamFlags = 0;
-
+
+#ifndef FIX_BUGS // this just slows down streaming
if ( BytesPerSector <= CDSTREAM_SECTOR_SIZE )
{
_gdwCdStreamFlags |= FILE_FLAG_NO_BUFFERING;
debug("Using no buffered loading for streaming\n");
}
+#endif
_gbCdStreamOverlapped = TRUE;
diff --git a/src/core/ControllerConfig.cpp b/src/core/ControllerConfig.cpp
index b0e04e2b..bdfab34c 100644
--- a/src/core/ControllerConfig.cpp
+++ b/src/core/ControllerConfig.cpp
@@ -732,10 +732,7 @@ void CControllerConfigManager::AffectControllerStateOn_ButtonDown_Driving(int32
if (FindPlayerVehicle() && (FindPlayerVehicle()->IsVehicle() && (
FindPlayerVehicle()->GetModelIndex() == MI_DODO
#ifdef FIX_BUGS
- || CVehicle::bAllDodosCheat
-#ifdef ALLCARSHELI_CHEAT
- || bAllCarCheat
-#endif
+ || (CVehicle::bAllDodosCheat && !FindPlayerVehicle()->IsRealHeli())
#endif
)))
{
diff --git a/src/core/EventList.cpp b/src/core/EventList.cpp
index da0a5967..7eb1e186 100644
--- a/src/core/EventList.cpp
+++ b/src/core/EventList.cpp
@@ -230,7 +230,11 @@ CEventList::ReportCrimeForEvent(eEventType type, size_t crimeId, bool copsDontCa
if(crime == CRIME_NONE)
return;
+#ifdef FIX_BUGS
+ CVector playerPedCoors = FindPlayerCoors();
+#else
CVector playerPedCoors = FindPlayerPed()->GetPosition();
+#endif
CVector playerCoors = FindPlayerCoors();
if(CWanted::WorkOutPolicePresence(playerCoors, 14.0f) != 0 ||
diff --git a/src/core/Frontend.cpp b/src/core/Frontend.cpp
index 9c33d48a..6768b901 100644
--- a/src/core/Frontend.cpp
+++ b/src/core/Frontend.cpp
@@ -812,7 +812,7 @@ CMenuManager::DoSettingsBeforeStartingAGame()
}
void
-CMenuManager::DrawStandardMenus(bool drawCurrScreen)
+CMenuManager::DrawStandardMenus(bool activeScreen)
{
float nextYToUse = 0.0f; // III leftover, set but unused in VC
#ifdef PS2_LIKE_MENU
@@ -1182,7 +1182,7 @@ CMenuManager::DrawStandardMenus(bool drawCurrScreen)
}
// Highlight trapezoid
- if (drawCurrScreen && i == m_nCurrOption && itemsAreSelectable && section == 0) {
+ if (activeScreen && i == m_nCurrOption && itemsAreSelectable && section == 0) {
int leftXMax, rightXMin;
@@ -2460,16 +2460,16 @@ CMenuManager::DrawBackground(bool transitionCall)
m_nMenuFadeAlpha = 255 - m_nMenuFadeAlpha;
switch (m_nCurrScreen) {
case MENUPAGE_SKIN_SELECT:
- CMenuManager::DrawPlayerSetupScreen();
+ DrawPlayerSetupScreen(false);
break;
case MENUPAGE_KEYBOARD_CONTROLS:
- CMenuManager::DrawControllerSetupScreen();
+ DrawControllerSetupScreen();
break;
case MENUPAGE_OUTRO:
- CMenuManager::DrawQuitGameScreen();
+ DrawQuitGameScreen();
break;
default:
- CMenuManager::DrawStandardMenus(false);
+ DrawStandardMenus(false);
break;
}
m_nCurrScreen = actualScreen;
@@ -2479,7 +2479,7 @@ CMenuManager::DrawBackground(bool transitionCall)
switch (m_nCurrScreen) {
case MENUPAGE_SKIN_SELECT:
- DrawPlayerSetupScreen();
+ DrawPlayerSetupScreen(true);
break;
case MENUPAGE_KEYBOARD_CONTROLS:
DrawControllerSetupScreen();
@@ -2530,7 +2530,7 @@ CMenuManager::DrawBackground(bool transitionCall)
#endif
void
-CMenuManager::DrawPlayerSetupScreen()
+CMenuManager::DrawPlayerSetupScreen(bool activeScreen)
{
CFont::SetBackgroundOff();
CFont::SetScale(MENU_X(MENUACTION_SCALE_MULT), MENU_Y(MENUACTION_SCALE_MULT));
@@ -2807,7 +2807,8 @@ CMenuManager::DrawPlayerSetupScreen()
#endif
}
- CPlayerSkin::RenderFrontendSkinEdit();
+ if (activeScreen)
+ CPlayerSkin::RenderFrontendSkinEdit();
// Big apply button
if (strcmp(m_aSkinName, m_PrefsSkinFile) != 0) {
@@ -4112,6 +4113,9 @@ CMenuManager::ProcessButtonPresses(uint8 goDown, uint8 goUp, uint8 optionSelecte
int oldOption = m_nCurrOption;
if (goDown) {
+ if (m_nCurrScreen != MENUPAGE_MAP)
+ DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_NEW_PAGE, 0);
+
m_nCurrOption++;
if (m_nCurrOption == NUM_MENUROWS || (aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_Action == MENUACTION_NOTHING)) {
m_nCurrOption = 0;
@@ -4120,6 +4124,9 @@ CMenuManager::ProcessButtonPresses(uint8 goDown, uint8 goUp, uint8 optionSelecte
m_nOptionHighlightTransitionBlend = 0;
}
if (goUp) {
+ if (m_nCurrScreen != MENUPAGE_MAP)
+ DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_NEW_PAGE, 0);
+
if (m_nCurrOption == (aScreens[m_nCurrScreen].m_aEntries[0].m_Action == MENUACTION_LABEL)) {
while (m_nCurrOption != NUM_MENUROWS - 1
&& aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption + 1].m_Action != MENUACTION_NOTHING) {
diff --git a/src/core/Frontend.h b/src/core/Frontend.h
index 858ad1f3..456e9bd0 100644
--- a/src/core/Frontend.h
+++ b/src/core/Frontend.h
@@ -663,7 +663,7 @@ public:
void DrawQuitGameScreen();
void DrawFrontEnd();
void DrawBackground(bool transitionCall);
- void DrawPlayerSetupScreen();
+ void DrawPlayerSetupScreen(bool);
int FadeIn(int alpha);
void FilterOutColorMarkersFromString(wchar*);
int GetStartOptionsCntrlConfigScreens();
diff --git a/src/core/Pad.cpp b/src/core/Pad.cpp
index 03d209cd..36e14e55 100644
--- a/src/core/Pad.cpp
+++ b/src/core/Pad.cpp
@@ -526,7 +526,7 @@ void KangarooCheat()
}
#endif
-#ifdef ALLCARSHELI_CHEAT
+#ifdef RESTORE_ALLCARSHELI_CHEAT
void AllCarsHeliCheat(void)
{
wchar* string;
@@ -1438,7 +1438,7 @@ void CPad::AddToPCCheatString(char c)
CPed::SwitchDebugDisplay();
#endif
-#ifdef ALLCARSHELI_CHEAT
+#ifdef RESTORE_ALLCARSHELI_CHEAT
// "CARSAREHELI"
if (!_CHEATCMP("ILEHERASRAC"))
AllCarsHeliCheat();
@@ -3105,10 +3105,11 @@ void CPad::PrintErrorMessage(void)
{
if ( bDisplayNoControllerMessage && !CGame::playingIntro && !FrontEndMenuManager.m_bMenuActive )
{
- CFont::SetScale(0.85f, 1.0f);
+ CSprite2d::DrawRect(CRect(SCREEN_STRETCH_X(20.0f), SCREEN_SCALE_FROM_BOTTOM(130.0f), SCREEN_STRETCH_FROM_RIGHT(20.0f), SCREEN_SCALE_Y(140.0f)), CRGBA(50, 50, 50, 210));
+ CFont::SetScale(SCREEN_SCALE_X(0.85f), SCREEN_SCALE_Y(1.0f));
CFont::SetJustifyOff();
CFont::SetBackgroundOff();
- CFont::SetCentreSize(SCREEN_WIDTH - 20);
+ CFont::SetCentreSize(SCREEN_STRETCH_FROM_RIGHT(50.0f));
CFont::SetCentreOn();
CFont::SetPropOn();
CFont::SetColor(CRGBA(255, 255, 200, 200));
@@ -3116,16 +3117,17 @@ void CPad::PrintErrorMessage(void)
CFont::PrintString
(
SCREEN_WIDTH / 2,
- SCREEN_HEIGHT / 2,
+ SCREEN_HEIGHT / 2 - SCREEN_SCALE_Y(40.0f),
TheText.Get("NOCONT") // Please reconnect an analog controller (DUALSHOCK@) or analog controller (DUALSHOCK@2). to controller port 1 to continue
);
}
else if ( bObsoleteControllerMessage )
{
- CFont::SetScale(0.85f, 1.0f);
+ CSprite2d::DrawRect(CRect(SCREEN_STRETCH_X(20.0f), SCREEN_SCALE_FROM_BOTTOM(130.0f), SCREEN_STRETCH_FROM_RIGHT(20.0f), SCREEN_SCALE_Y(140.0f)), CRGBA(50, 50, 50, 210));
+ CFont::SetScale(SCREEN_SCALE_X(0.85f), SCREEN_SCALE_Y(1.0f));
CFont::SetJustifyOff();
CFont::SetBackgroundOff();
- CFont::SetCentreSize(SCREEN_WIDTH - 20);
+ CFont::SetCentreSize(SCREEN_STRETCH_FROM_RIGHT(50.0f));
CFont::SetCentreOn();
CFont::SetPropOn();
CFont::SetColor(CRGBA(255, 255, 200, 200));
@@ -3133,7 +3135,7 @@ void CPad::PrintErrorMessage(void)
CFont::PrintString
(
SCREEN_WIDTH / 2,
- SCREEN_HEIGHT / 2,
+ SCREEN_HEIGHT / 2 - SCREEN_SCALE_Y(40.0f),
TheText.Get("WRCONT") // The controller connected to controller port 1 is an unsupported controller. Grand Theft Auto III requires an analog controller (DUALSHOCK@) or analog controller (DUALSHOCK@2).
);
}
diff --git a/src/core/Pad.h b/src/core/Pad.h
index 72851317..cde2d3c5 100644
--- a/src/core/Pad.h
+++ b/src/core/Pad.h
@@ -286,6 +286,8 @@ public:
bool GetMiddleMouseJustUp() { return !!(!NewMouseControllerState.MMB && OldMouseControllerState.MMB); }
bool GetMouseWheelUpJustUp() { return !!(!NewMouseControllerState.WHEELUP && OldMouseControllerState.WHEELUP); }
bool GetMouseWheelDownJustUp() { return !!(!NewMouseControllerState.WHEELDN && OldMouseControllerState.WHEELDN); }
+ bool GetMouseX1JustUp() { return !!(!NewMouseControllerState.MXB1 && OldMouseControllerState.MXB1); }
+ bool GetMouseX2JustUp() { return !!(!NewMouseControllerState.MXB2 && OldMouseControllerState.MXB2); }
bool GetLeftMouse() { return NewMouseControllerState.LMB; }
bool GetRightMouse() { return NewMouseControllerState.RMB; }
@@ -469,8 +471,4 @@ public:
};
VALIDATE_SIZE(CPad, 0xFC);
-extern CPad Pads[MAX_PADS];
-
-#ifdef ALLCARSHELI_CHEAT
-extern bool bAllCarCheat;
-#endif
+extern CPad Pads[MAX_PADS]; \ No newline at end of file
diff --git a/src/core/Radar.cpp b/src/core/Radar.cpp
index 559a8cd6..b9fc369d 100644
--- a/src/core/Radar.cpp
+++ b/src/core/Radar.cpp
@@ -1151,6 +1151,10 @@ int CRadar::SetCoordBlip(eBlipType type, CVector pos, int32 color, eBlipDisplay
if (!ms_RadarTrace[nextBlip].m_bInUse)
break;
}
+#ifdef FIX_BUGS
+ if (nextBlip == NUMRADARBLIPS)
+ return -1;
+#endif
ms_RadarTrace[nextBlip].m_eBlipType = type;
ms_RadarTrace[nextBlip].m_nColor = color;
ms_RadarTrace[nextBlip].m_bDim = true;
@@ -1182,6 +1186,10 @@ int CRadar::SetEntityBlip(eBlipType type, int32 handle, int32 color, eBlipDispla
if (!ms_RadarTrace[nextBlip].m_bInUse)
break;
}
+#ifdef FIX_BUGS
+ if (nextBlip == NUMRADARBLIPS)
+ return -1;
+#endif
ms_RadarTrace[nextBlip].m_eBlipType = type;
ms_RadarTrace[nextBlip].m_nColor = color;
ms_RadarTrace[nextBlip].m_bDim = true;
@@ -1526,6 +1534,10 @@ CRadar::ToggleTargetMarker(float x, float y)
if (!ms_RadarTrace[nextBlip].m_bInUse)
break;
}
+#ifdef FIX_BUGS
+ if (nextBlip == NUMRADARBLIPS)
+ return;
+#endif
ms_RadarTrace[nextBlip].m_eBlipType = BLIP_COORD;
ms_RadarTrace[nextBlip].m_nColor = 0x333333FF;
ms_RadarTrace[nextBlip].m_bDim = 1;
diff --git a/src/core/common.h b/src/core/common.h
index ba1d24ef..0a2a236e 100644
--- a/src/core/common.h
+++ b/src/core/common.h
@@ -219,6 +219,8 @@ extern int strncasecmp(const char *str1, const char *str2, size_t len);
#define clamp(v, low, high) ((v)<(low) ? (low) : (v)>(high) ? (high) : (v))
+#define clamp2(v, center, radius) ((v) < (center) ? Max(v, center - radius) : Min(v, center + radius))
+
inline float sq(float x) { return x*x; }
#define SQR(x) ((x) * (x))
diff --git a/src/core/config.h b/src/core/config.h
index 82044f75..327230d0 100644
--- a/src/core/config.h
+++ b/src/core/config.h
@@ -250,7 +250,7 @@ enum Config {
#endif
#define DETECT_PAD_INPUT_SWITCH // Adds automatic switch of pad related stuff between controller and kb/m
#define KANGAROO_CHEAT
-#define ALLCARSHELI_CHEAT
+#define RESTORE_ALLCARSHELI_CHEAT
#define ALT_DODO_CHEAT
#define WALLCLIMB_CHEAT
#define REGISTER_START_BUTTON
@@ -258,14 +258,13 @@ enum Config {
// Hud, frontend and radar
#define HUD_ENHANCEMENTS // Adjusts some aspects to make the HUD look/behave a little bit better.
-#define BETA_SLIDING_TEXT
+//#define BETA_SLIDING_TEXT
#define TRIANGULAR_BLIPS // height indicating triangular radar blips, as in VC
#define PC_MENU
#ifndef PC_MENU
# define PS2_MENU
//# define PS2_MENU_USEALLPAGEICONS
-//# define PS2_LIKE_MENU // An effort to recreate PS2 menu, cycling through tabs, different bg etc.
#else
# define MAP_ENHANCEMENTS // Adding waypoint etc.
# define TRIANGLE_BACK_BUTTON
diff --git a/src/core/main.cpp b/src/core/main.cpp
index 5a31ad22..b39a9c8b 100644
--- a/src/core/main.cpp
+++ b/src/core/main.cpp
@@ -740,12 +740,14 @@ DisplayGameDebugText()
static bool bDisplayRate = false;
static bool bDisplayCheatStr = false;
+#ifndef FINAL
{
SETTWEAKPATH("GameDebugText");
TWEAKBOOL(bDisplayPosn);
TWEAKBOOL(bDisplayRate);
TWEAKBOOL(bDisplayCheatStr);
}
+#endif
char str[200];
@@ -1091,6 +1093,7 @@ Idle(void *arg)
#endif
#ifdef FIX_BUGS
+ RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void *)FALSE); // TODO: temp? this fixes OpenGL render but there should be a better place for this
// This has to be done BEFORE RwCameraBeginUpdate
RwCameraSetFarClipPlane(Scene.camera, CTimeCycle::GetFarClip());
RwCameraSetFogDistance(Scene.camera, CTimeCycle::GetFogStart());
diff --git a/src/core/timebars.cpp b/src/core/timebars.cpp
index 884feffd..31949009 100644
--- a/src/core/timebars.cpp
+++ b/src/core/timebars.cpp
@@ -50,7 +50,7 @@ void tbInit()
#endif
}
-void tbStartTimer(int32 unk, char *name)
+void tbStartTimer(int32 unk, Const char *name)
{
strcpy(TimerBar.Timers[TimerBar.count].name, name);
TimerBar.Timers[TimerBar.count].unk = unk;
@@ -58,7 +58,7 @@ void tbStartTimer(int32 unk, char *name)
TimerBar.count++;
}
-void tbEndTimer(char* name)
+void tbEndTimer(Const char* name)
{
uint32 n = 1500;
for (uint32 i = 0; i < TimerBar.count; i++) {
diff --git a/src/core/timebars.h b/src/core/timebars.h
index 6d3b853e..3871b61c 100644
--- a/src/core/timebars.h
+++ b/src/core/timebars.h
@@ -1,6 +1,6 @@
#pragma once
void tbInit();
-void tbStartTimer(int32, char*);
-void tbEndTimer(char*);
+void tbStartTimer(int32, Const char*);
+void tbEndTimer(Const char*);
void tbDisplay(); \ No newline at end of file