summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/Cam.cpp2
-rw-r--r--src/core/Frontend.cpp16
-rw-r--r--src/core/Frontend.h5
-rw-r--r--src/core/Game.cpp16
-rw-r--r--src/core/Game.h2
-rw-r--r--src/core/MenuScreens.h3
-rw-r--r--src/core/Pad.cpp74
-rw-r--r--src/core/Pad.h2
-rw-r--r--src/core/Radar.cpp8
-rw-r--r--src/core/Radar.h20
-rw-r--r--src/core/config.h3
-rw-r--r--src/core/main.cpp22
-rw-r--r--src/core/re3.cpp11
13 files changed, 155 insertions, 29 deletions
diff --git a/src/core/Cam.cpp b/src/core/Cam.cpp
index 871b6dba..0daecad1 100644
--- a/src/core/Cam.cpp
+++ b/src/core/Cam.cpp
@@ -29,7 +29,7 @@ bool PrintDebugCode = false;
int16 DebugCamMode;
#ifdef FREE_CAM
-bool CCamera::bFreeCam = true;
+bool CCamera::bFreeCam;
int nPreviousMode = -1;
#endif
diff --git a/src/core/Frontend.cpp b/src/core/Frontend.cpp
index 8149a201..c5e0d6ad 100644
--- a/src/core/Frontend.cpp
+++ b/src/core/Frontend.cpp
@@ -48,6 +48,7 @@ CRGBA HEADER_COLOR(255, 150, 255, 255);
CRGBA DARKMENUOPTION_COLOR(195, 90, 165, 255);
CRGBA SLIDERON_COLOR(97, 194, 247, 255);
CRGBA SLIDEROFF_COLOR(27, 89, 130, 255);
+CRGBA MAPINFOBOX_COLOR(255, 150, 225, 150);
#define TIDY_UP_PBP // ProcessButtonPresses
#define MAX_VISIBLE_LIST_ROW 30
@@ -2928,6 +2929,9 @@ CMenuManager::LoadSettings()
CFileMgr::Read(fileHandle, m_PrefsSkinFile, 256);
CFileMgr::Read(fileHandle, (char*)&m_ControlMethod, 1);
CFileMgr::Read(fileHandle, (char*)&m_PrefsLanguage, 1);
+#ifdef FREE_CAM
+ CFileMgr::Read(fileHandle, (char*)&TheCamera.bFreeCam, 1);
+#endif
}
}
@@ -3018,6 +3022,9 @@ CMenuManager::SaveSettings()
CFileMgr::Write(fileHandle, m_PrefsSkinFile, 256);
CFileMgr::Write(fileHandle, (char*)&m_ControlMethod, 1);
CFileMgr::Write(fileHandle, (char*)&m_PrefsLanguage, 1);
+#ifdef FREE_CAM
+ CFileMgr::Write(fileHandle, (char*)&TheCamera.bFreeCam, 1);
+#endif
}
CFileMgr::CloseFile(fileHandle);
@@ -4641,6 +4648,13 @@ CMenuManager::ProcessOnOffMenuOptions()
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_SUCCESS, 0);
SaveSettings();
break;
+#ifdef FREE_CAM
+ case MENUACTION_FREECAM:
+ TheCamera.bFreeCam = !TheCamera.bFreeCam;
+ DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_SUCCESS, 0);
+ SaveSettings();
+ break;
+#endif
}
}
@@ -5086,7 +5100,7 @@ CMenuManager::PrintMap(void)
CSprite2d::DrawRect(CRect(MENU_X(14.0f), SCREEN_STRETCH_FROM_BOTTOM(95.0f),
SCREEN_STRETCH_FROM_RIGHT(11.0f), SCREEN_STRETCH_FROM_BOTTOM(59.0f)),
- CRGBA(235, 170, 50, 255));
+ CRGBA(MAPINFOBOX_COLOR.r, MAPINFOBOX_COLOR.g, MAPINFOBOX_COLOR.b, MAPINFOBOX_COLOR.a));
CFont::SetScale(MENU_X(0.4f), MENU_Y(0.7f));
CFont::SetFontStyle(FONT_LOCALE(FONT_BANK));
diff --git a/src/core/Frontend.h b/src/core/Frontend.h
index a867e4c8..4e1d0edf 100644
--- a/src/core/Frontend.h
+++ b/src/core/Frontend.h
@@ -328,7 +328,10 @@ enum eMenuAction
MENUACTION_LANG_JAP,
#endif
#ifdef IMPROVED_VIDEOMODE
- MENUACTION_SCREENMODE
+ MENUACTION_SCREENMODE,
+#endif
+#ifdef FREE_CAM
+ MENUACTION_FREECAM
#endif
};
diff --git a/src/core/Game.cpp b/src/core/Game.cpp
index 385b3892..09e19ffc 100644
--- a/src/core/Game.cpp
+++ b/src/core/Game.cpp
@@ -664,6 +664,22 @@ void CGame::Process(void)
}
}
+void
+CGame::InitAfterFocusLoss()
+{
+ /*
+ byte_869656 = byte_86969D;
+ result = cDMAudio::SetCurrent3DProvider(byte_86969D);
+ if ( !bGameStarted && !bMenuVisible )
+ byte_869642 = 1;
+ */
+
+ //cDMAudio::SetCurrent3DProvider( ? ? ? );
+
+ if (!FrontEndMenuManager.m_bGameNotLoaded && !FrontEndMenuManager.m_bMenuActive)
+ CMenuManager::m_bStartUpFrontEndRequested = true;
+}
+
bool
CGame::CanSeeOutSideFromCurrArea(void)
{
diff --git a/src/core/Game.h b/src/core/Game.h
index 6efacf8d..7ad8d55e 100644
--- a/src/core/Game.h
+++ b/src/core/Game.h
@@ -59,6 +59,8 @@ public:
static void InitialiseWhenRestarting(void);
static void Process(void);
+ static void InitAfterFocusLoss(void);
+
static bool IsInInterior(void) { return currArea != AREA_MAIN_MAP; }
static bool CanSeeOutSideFromCurrArea(void);
diff --git a/src/core/MenuScreens.h b/src/core/MenuScreens.h
index e9e37a9b..805a5aff 100644
--- a/src/core/MenuScreens.h
+++ b/src/core/MenuScreens.h
@@ -276,6 +276,9 @@ const CMenuScreen aScreens[] = {
// MENUPAGE_CONTROLLER_PC = 35
{ "FET_CTL", 1, MENUPAGE_OPTIONS, MENUPAGE_OPTIONS, 0, 0,
MENUACTION_CTRLMETHOD, "FET_CME", SAVESLOT_NONE, MENUPAGE_CONTROLLER_PC,
+#ifdef FREE_CAM
+ MENUACTION_FREECAM, "FREECAM", SAVESLOT_NONE, MENUPAGE_CONTROLLER_PC,
+#endif
MENUACTION_CHANGEMENU, "FET_RDK", SAVESLOT_NONE, MENUPAGE_KEYBOARD_CONTROLS,
MENUACTION_CHANGEMENU, "FET_AMS", SAVESLOT_NONE, MENUPAGE_MOUSE_CONTROLS,
MENUACTION_RESTOREDEF, "FET_DEF", SAVESLOT_NONE, MENUPAGE_CONTROLLER_PC,
diff --git a/src/core/Pad.cpp b/src/core/Pad.cpp
index c3fb69d6..dc849a46 100644
--- a/src/core/Pad.cpp
+++ b/src/core/Pad.cpp
@@ -49,7 +49,7 @@ CKeyboardState CPad::OldKeyState;
CKeyboardState CPad::NewKeyState;
CKeyboardState CPad::TempKeyState;
-char CPad::KeyBoardCheatString[20];
+char CPad::KeyBoardCheatString[30];
CMouseControllerState CPad::OldMouseControllerState;
CMouseControllerState CPad::NewMouseControllerState;
@@ -108,31 +108,31 @@ void HealthCheat()
}
}
-void TankCheat()
+void VehicleCheat(bool something, int model)
{
CHud::SetHelpMessage(TheText.Get("CHEAT1"), true);
- CStreaming::RequestModel(MI_RHINO, 0);
- CStreaming::LoadAllRequestedModels(false);
- if (CStreaming::ms_aInfoForModel[MI_RHINO].m_loadState == STREAMSTATE_LOADED) {
+ CStreaming::RequestModel(model, 0);
+ CStreaming::LoadAllRequestedModels(something);
+ if (CStreaming::ms_aInfoForModel[model].m_loadState == STREAMSTATE_LOADED) {
CHud::SetHelpMessage(TheText.Get("CHEAT1"), true);
int32 node = ThePaths.FindNodeClosestToCoors(FindPlayerCoors(), PATH_CAR, 100.0f);
if (node < 0) return;
-
+
#ifdef FIX_BUGS
- CAutomobile* tank = new CAutomobile(MI_RHINO, RANDOM_VEHICLE);
+ CAutomobile* vehicle = new CAutomobile(model, RANDOM_VEHICLE);
#else
- CAutomobile *tank = new CAutomobile(MI_RHINO, MISSION_VEHICLE);
+ CAutomobile* vehicle = new CAutomobile(MI_RHINO, MISSION_VEHICLE);
#endif
- if (tank != nil) {
+ if (vehicle != nil) {
CVector pos = ThePaths.m_pathNodes[node].GetPosition();
pos.z += 4.0f;
- tank->SetPosition(pos);
- tank->SetOrientation(0.0f, 0.0f, DEGTORAD(200.0f));
+ vehicle->SetPosition(pos);
+ vehicle->SetOrientation(0.0f, 0.0f, DEGTORAD(200.0f));
- tank->SetStatus(STATUS_ABANDONED);
- tank->m_nDoorLock = CARLOCK_UNLOCKED;
- CWorld::Add(tank);
+ vehicle->SetStatus(STATUS_ABANDONED);
+ vehicle->m_nDoorLock = CARLOCK_UNLOCKED;
+ CWorld::Add(vehicle);
}
}
}
@@ -824,7 +824,7 @@ void CPad::AddToCheatString(char c)
// "CCCCCC321TCT" - CIRCLE CIRCLE CIRCLE CIRCLE CIRCLE CIRCLE R1 L2 L1 TRIANGLE CIRCLE TRIANGLE
else if ( !_CHEATCMP("TCT123CCCCCC") )
- TankCheat();
+ VehicleCheat(true, MI_RHINO);
// "CCCSSSSS1TCT" - CIRCLE CIRCLE CIRCLE SQUARE SQUARE SQUARE SQUARE SQUARE L1 TRIANGLE CIRCLE TRIANGLE
else if ( !_CHEATCMP("TCT1SSSSSCCC") )
@@ -905,10 +905,46 @@ void CPad::AddToPCCheatString(char c)
// "NOPOLICEPLEASE"
if ( !_CHEATCMP("ESAELPECILOPON") )
WantedLevelDownCheat();
-
- // "GIVEUSATANK"
- if ( !_CHEATCMP("KNATASUEVIG") )
- TankCheat();
+
+ // "PANZER"
+ if ( !_CHEATCMP("REZNAP") )
+ VehicleCheat(true, MI_RHINO);
+
+ // "TRAVELINSTYLE"
+ if ( !_CHEATCMP("ELYTSNILEVART") )
+ VehicleCheat(true, MI_BLOODRA);
+
+ // "GETTHEREQUICKLY"
+ if ( !_CHEATCMP("YLKCIUQEREHTTEG") )
+ VehicleCheat(true, MI_BLOODRB);
+
+ // "GETTHEREFAST"
+ if ( !_CHEATCMP("TSAFEREHTTEG") )
+ VehicleCheat(true, MI_SABRETUR);
+
+ // "GETTHEREVERYFASTINDEED"
+ if ( !_CHEATCMP("DEEDNITSAFYREVEREHTTEG") )
+ VehicleCheat(true, MI_HOTRINA);
+
+ // "GETTHEREAMAZINGLYFAST"
+ if ( !_CHEATCMP("TSAFYLGNIZAMAEREHTTEG") )
+ VehicleCheat(true, MI_HOTRINB);
+
+ // "THELASTRIDE"
+ if ( !_CHEATCMP("EDIRTSALEHT") )
+ VehicleCheat(true, MI_ROMERO);
+
+ // "ROCKANDROLLCAR"
+ if ( !_CHEATCMP("RACLLORDNAKCOR") )
+ VehicleCheat(true, MI_LOVEFIST);
+
+ // "RUBBISHCAR"
+ if ( !_CHEATCMP("RACHSIBBUR") )
+ VehicleCheat(true, MI_TRASH);
+
+ // "BETTERTHANWALKING"
+ if ( !_CHEATCMP("GNIKLAWNAHTRETTEB") )
+ VehicleCheat(true, MI_CADDY);
// "BANGBANGBANG"
if ( !_CHEATCMP("GNABGNABGNAB") )
diff --git a/src/core/Pad.h b/src/core/Pad.h
index ea771f81..ad93fb49 100644
--- a/src/core/Pad.h
+++ b/src/core/Pad.h
@@ -176,7 +176,7 @@ public:
static CKeyboardState OldKeyState;
static CKeyboardState NewKeyState;
static CKeyboardState TempKeyState;
- static char KeyBoardCheatString[20];
+ static char KeyBoardCheatString[30];
static CMouseControllerState OldMouseControllerState;
static CMouseControllerState NewMouseControllerState;
static CMouseControllerState PCTempMouseControllerState;
diff --git a/src/core/Radar.cpp b/src/core/Radar.cpp
index 95ae62a0..475ca4d3 100644
--- a/src/core/Radar.cpp
+++ b/src/core/Radar.cpp
@@ -431,7 +431,7 @@ void CRadar::Draw3dMarkers()
if (ms_RadarTrace[i].m_eBlipDisplay == BLIP_DISPLAY_BOTH || ms_RadarTrace[i].m_eBlipDisplay == BLIP_DISPLAY_MARKER_ONLY) {
CVector pos = entity->GetPosition();
pos.z += 1.2f * CModelInfo::GetModelInfo(entity->GetModelIndex())->GetColModel()->boundingBox.max.z + 2.5f;
- C3dMarkers::PlaceMarker(i | (ms_RadarTrace[i].m_BlipIndex << 16), 1, pos, 2.5f, 0, 128, 255, 255, 1024, 0.2f, 5);
+ C3dMarkers::PlaceMarker(i | (ms_RadarTrace[i].m_BlipIndex << 16), 1, pos, 2.5f, CARBLIP_MARKER_COLOR_R, CARBLIP_MARKER_COLOR_G, CARBLIP_MARKER_COLOR_B, CARBLIP_MARKER_COLOR_A, 1024, 0.2f, 5);
}
break;
}
@@ -445,7 +445,7 @@ void CRadar::Draw3dMarkers()
if (ms_RadarTrace[i].m_eBlipDisplay == BLIP_DISPLAY_BOTH || ms_RadarTrace[i].m_eBlipDisplay == BLIP_DISPLAY_MARKER_ONLY) {
CVector pos = entity->GetPosition();
pos.z += 3.0f;
- C3dMarkers::PlaceMarker(i | (ms_RadarTrace[i].m_BlipIndex << 16), 1, pos, 1.5f, 0, 128, 255, 255, 1024, 0.2f, 5);
+ C3dMarkers::PlaceMarker(i | (ms_RadarTrace[i].m_BlipIndex << 16), 1, pos, 1.5f, CHARBLIP_MARKER_COLOR_R, CHARBLIP_MARKER_COLOR_G, CHARBLIP_MARKER_COLOR_B, CHARBLIP_MARKER_COLOR_A, 1024, 0.2f, 5);
}
break;
}
@@ -455,7 +455,7 @@ void CRadar::Draw3dMarkers()
if (ms_RadarTrace[i].m_eBlipDisplay == BLIP_DISPLAY_BOTH || ms_RadarTrace[i].m_eBlipDisplay == BLIP_DISPLAY_MARKER_ONLY) {
CVector pos = entity->GetPosition();
pos.z += CModelInfo::GetModelInfo(entity->GetModelIndex())->GetColModel()->boundingBox.max.z + 1.0f + 1.0f;
- C3dMarkers::PlaceMarker(i | (ms_RadarTrace[i].m_BlipIndex << 16), 1, pos, 1.0f, 0, 128, 255, 255, 1024, 0.2f, 5);
+ C3dMarkers::PlaceMarker(i | (ms_RadarTrace[i].m_BlipIndex << 16), 1, pos, 1.0f, OBJECTBLIP_MARKER_COLOR_R, OBJECTBLIP_MARKER_COLOR_G, OBJECTBLIP_MARKER_COLOR_B, OBJECTBLIP_MARKER_COLOR_A, 1024, 0.2f, 5);
}
break;
}
@@ -464,7 +464,7 @@ void CRadar::Draw3dMarkers()
case BLIP_CONTACT_POINT:
if (!CTheScripts::IsPlayerOnAMission()) {
if (ms_RadarTrace[i].m_eBlipDisplay == BLIP_DISPLAY_BOTH || ms_RadarTrace[i].m_eBlipDisplay == BLIP_DISPLAY_MARKER_ONLY)
- C3dMarkers::PlaceMarkerSet(i | (ms_RadarTrace[i].m_BlipIndex << 16), 4, ms_RadarTrace[i].m_vecPos, 2.0f, 0, 128, 255, 128, 2048, 0.2f, 0);
+ C3dMarkers::PlaceMarkerSet(i | (ms_RadarTrace[i].m_BlipIndex << 16), 4, ms_RadarTrace[i].m_vecPos, 2.0f, COORDBLIP_MARKER_COLOR_R, COORDBLIP_MARKER_COLOR_G, COORDBLIP_MARKER_COLOR_B, COORDBLIP_MARKER_COLOR_A, 2048, 0.2f, 0);
}
break;
}
diff --git a/src/core/Radar.h b/src/core/Radar.h
index f68d290c..61d94d05 100644
--- a/src/core/Radar.h
+++ b/src/core/Radar.h
@@ -1,6 +1,26 @@
#pragma once
#include "Sprite2d.h"
+#define CARBLIP_MARKER_COLOR_R 252
+#define CARBLIP_MARKER_COLOR_G 138
+#define CARBLIP_MARKER_COLOR_B 242
+#define CARBLIP_MARKER_COLOR_A 255
+
+#define CHARBLIP_MARKER_COLOR_R 252
+#define CHARBLIP_MARKER_COLOR_G 138
+#define CHARBLIP_MARKER_COLOR_B 242
+#define CHARBLIP_MARKER_COLOR_A 255
+
+#define OBJECTBLIP_MARKER_COLOR_R 252
+#define OBJECTBLIP_MARKER_COLOR_G 138
+#define OBJECTBLIP_MARKER_COLOR_B 242
+#define OBJECTBLIP_MARKER_COLOR_A 255
+
+#define COORDBLIP_MARKER_COLOR_R 252
+#define COORDBLIP_MARKER_COLOR_G 138
+#define COORDBLIP_MARKER_COLOR_B 242
+#define COORDBLIP_MARKER_COLOR_A 255
+
#define MENU_MAP_LENGTH_UNIT 1190.0f // in game unit
#define MENU_MAP_WIDTH_SCALE 1.112f // in game unit (originally 1.112494151260504f)
#define MENU_MAP_HEIGHT_SCALE 1.119f // in game unit (originally 1.118714268907563f)
diff --git a/src/core/config.h b/src/core/config.h
index c7ce5016..f0025dfa 100644
--- a/src/core/config.h
+++ b/src/core/config.h
@@ -204,6 +204,9 @@ enum Config {
#else
#define AUDIO_OAL
#endif
+#ifdef DEBUGMENU
+#define RELOADABLES // some debug menu options to reload TXD files
+#endif
// Particle
//#define PC_PARTICLE
diff --git a/src/core/main.cpp b/src/core/main.cpp
index ecae127a..f06733f2 100644
--- a/src/core/main.cpp
+++ b/src/core/main.cpp
@@ -689,11 +689,13 @@ DisplayGameDebugText()
{
static bool bDisplayPosn = false;
static bool bDisplayRate = false;
+ static bool bDisplayCheatStr = false;
{
SETTWEAKPATH("GameDebugText");
TWEAKBOOL(bDisplayPosn);
TWEAKBOOL(bDisplayRate);
+ TWEAKBOOL(bDisplayCheatStr);
}
@@ -781,6 +783,26 @@ DisplayGameDebugText()
CFont::SetColor(CRGBA(255, 108, 0, 255));
CFont::PrintString(40.0f, 40.0f, ustr);
}
+
+ if (bDisplayCheatStr)
+ {
+ sprintf(str, "%s", CPad::KeyBoardCheatString);
+ AsciiToUnicode(str, ustr);
+
+ CFont::SetPropOff();
+ CFont::SetBackgroundOff();
+ CFont::SetScale(0.7f, 1.5f);
+ CFont::SetCentreOn();
+ CFont::SetBackGroundOnlyTextOff();
+ CFont::SetWrapx(640.0f);
+ CFont::SetFontStyle(FONT_HEADING);
+
+ CFont::SetColor(CRGBA(0, 0, 0, 255));
+ CFont::PrintString(SCREEN_SCALE_X(DEFAULT_SCREEN_WIDTH * 0.5f)+2.f, SCREEN_SCALE_FROM_BOTTOM(20.0f)+2.f, ustr);
+
+ CFont::SetColor(CRGBA(255, 150, 225, 255));
+ CFont::PrintString(SCREEN_SCALE_X(DEFAULT_SCREEN_WIDTH * 0.5f), SCREEN_SCALE_FROM_BOTTOM(20.0f), ustr);
+ }
}
#endif
diff --git a/src/core/re3.cpp b/src/core/re3.cpp
index 0e62f3a5..8f808b61 100644
--- a/src/core/re3.cpp
+++ b/src/core/re3.cpp
@@ -69,7 +69,7 @@ mysrand(unsigned int seed)
#ifdef DEBUGMENU
void WeaponCheat();
void HealthCheat();
-void TankCheat();
+void VehicleCheat(bool something, int model);
void BlowUpCarsCheat();
void ChangePlayerCheat();
void MayhemCheat();
@@ -293,7 +293,7 @@ DebugMenuPopulate(void)
DebugMenuAddCmd("Cheats", "Health", HealthCheat);
DebugMenuAddCmd("Cheats", "Wanted level up", WantedLevelUpCheat);
DebugMenuAddCmd("Cheats", "Wanted level down", WantedLevelDownCheat);
- DebugMenuAddCmd("Cheats", "Tank", TankCheat);
+ DebugMenuAddCmd("Cheats", "Tank", []() { VehicleCheat(true, MI_TAXI); });
DebugMenuAddCmd("Cheats", "Blow up cars", BlowUpCarsCheat);
DebugMenuAddCmd("Cheats", "Change player", ChangePlayerCheat);
DebugMenuAddCmd("Cheats", "Mayhem", MayhemCheat);
@@ -385,6 +385,13 @@ DebugMenuPopulate(void)
DebugMenuAddCmd("Debug", "Start Credits", CCredits::Start);
DebugMenuAddCmd("Debug", "Stop Credits", CCredits::Stop);
+#ifdef RELOADABLES
+ DebugMenuAddCmd("Reload", "HUD.TXD", CHud::ReloadTXD);
+ DebugMenuAddCmd("Reload", "FONTS.TXD", NULL);
+ DebugMenuAddCmd("Reload", "FRONTEN1.TXD", NULL);
+ DebugMenuAddCmd("Reload", "FRONTEN2.TXD", NULL);
+#endif
+
extern bool PrintDebugCode;
extern int16 DebugCamMode;
DebugMenuAddVarBool8("Cam", "Use mouse Cam", &CCamera::m_bUseMouse3rdPerson, nil);