Merge pull request #574 from Xinerki/miami

many additions
This commit is contained in:
erorcun 2020-05-22 15:49:37 +03:00 committed by GitHub
commit 8b82e9c40f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 204 additions and 31 deletions

View file

@ -29,7 +29,7 @@ bool PrintDebugCode = false;
int16 DebugCamMode;
#ifdef FREE_CAM
bool CCamera::bFreeCam = true;
bool CCamera::bFreeCam;
int nPreviousMode = -1;
#endif

View file

@ -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));

View file

@ -328,7 +328,10 @@ enum eMenuAction
MENUACTION_LANG_JAP,
#endif
#ifdef IMPROVED_VIDEOMODE
MENUACTION_SCREENMODE
MENUACTION_SCREENMODE,
#endif
#ifdef FREE_CAM
MENUACTION_FREECAM
#endif
};

View file

@ -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)
{

View file

@ -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);

View file

@ -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,

View file

@ -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") )
@ -906,9 +906,45 @@ void CPad::AddToPCCheatString(char c)
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") )

View file

@ -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;

View file

@ -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;
}

View file

@ -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)

View file

@ -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

View file

@ -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

View file

@ -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);

View file

@ -38,7 +38,7 @@ CRGBA COUNTER_COLOR(97, 194, 247, 255);
CRGBA PAGER_COLOR(32, 162, 66, 205);
CRGBA RADARDISC_COLOR(255, 255, 255, 255);
CRGBA BIGMESSAGE_COLOR(85, 119, 133, 255);
CRGBA WASTEDBUSTED_COLOR(170, 123, 87, 255);
CRGBA WASTEDBUSTED_COLOR(255, 150, 225, 255);
CRGBA ODDJOB_COLOR(89, 115, 150, 255);
CRGBA ODDJOB2_COLOR(156, 91, 40, 255);
CRGBA MISSIONTITLE_COLOR(220, 172, 2, 255);
@ -923,7 +923,17 @@ void CHud::Draw()
#else
rect.Translate(RADAR_LEFT, SCREEN_SCALE_FROM_BOTTOM(RADAR_BOTTOM + RADAR_HEIGHT));
#endif
rect.Grow(4.0f);
// shadow, might not be exactly accurate numbers
rect.Translate(0.f, 4.f);
rect.Grow(6.0f);
rect.top += 2.f;
rect.bottom -= 2.f;
Sprites[HUD_RADARDISC].Draw(rect, CRGBA(0, 0, 0, 255));
rect.Translate(0.f, -4.f);
rect.top -= 2.f;
rect.bottom += 2.f;
Sprites[HUD_RADARDISC].Draw(rect, RADARDISC_COLOR);
CRadar::DrawBlips();
}
@ -1480,6 +1490,30 @@ void CHud::GetRidOfAllHudMessages()
}
}
#ifdef RELOADABLES
void CHud::ReloadTXD()
{
for (int i = 0; i < NUM_HUD_SPRITES; ++i) {
Sprites[i].Delete();
}
int HudTXD = CTxdStore::FindTxdSlot("hud");
CTxdStore::RemoveTxdSlot(HudTXD);
debug("Reloading HUD.TXD...\n");
HudTXD = CTxdStore::AddTxdSlot("hud");
CTxdStore::LoadTxd(HudTXD, "MODELS/HUD.TXD");
CTxdStore::AddRef(HudTXD);
CTxdStore::PopCurrentTxd();
CTxdStore::SetCurrentTxd(HudTXD);
for (int i = 0; i < NUM_HUD_SPRITES; i++) {
Sprites[i].SetTexture(WeaponFilenames[i].name, WeaponFilenames[i].mask);
}
}
#endif
void CHud::Initialise()
{
m_Wants_To_Draw_Hud = true;

View file

@ -125,6 +125,9 @@ public:
static void Draw();
static void DrawAfterFade();
static void GetRidOfAllHudMessages();
#ifdef RELOADABLES
static void ReloadTXD();
#endif
static void Initialise();
static void ReInitialise();
static void SetBigMessage(wchar *message, int16 style);

View file

@ -1222,6 +1222,16 @@ MainWndProc(HWND window, UINT message, WPARAM wParam, LPARAM lParam)
break;
}
#ifdef FIX_BUGS // game turns on menu when focus is re-gained rather than lost
case WM_KILLFOCUS:
#else
case WM_SETFOCUS:
#endif
{
CGame::InitAfterFocusLoss();
break;
}
}
/*