From f0dfaac838fdbb90783609bf4e45518ccf853708 Mon Sep 17 00:00:00 2001 From: aap Date: Thu, 26 Mar 2020 14:16:06 +0100 Subject: Finished CCam; various smaller things --- src/core/re3.cpp | 35 ++++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) (limited to 'src/core/re3.cpp') diff --git a/src/core/re3.cpp b/src/core/re3.cpp index 6f0a4682..ae64913e 100644 --- a/src/core/re3.cpp +++ b/src/core/re3.cpp @@ -20,6 +20,7 @@ #include "debugmenu_public.h" #include "Particle.h" #include "Console.h" +#include "Debug.h" #include #include @@ -114,13 +115,16 @@ SpawnCar(int id) CStreaming::LoadAllRequestedModels(false); if(CStreaming::HasModelLoaded(id)){ playerpos = FindPlayerCoors(); - int node = ThePaths.FindNodeClosestToCoors(playerpos, 0, 100.0f, false, false); - if(node < 0) - return; + int node; + if(!CModelInfo::IsBoatModel(id)){ + node = ThePaths.FindNodeClosestToCoors(playerpos, 0, 100.0f, false, false); + if(node < 0) + return; + } CVehicle *v; if(CModelInfo::IsBoatModel(id)) - return; + v = new CBoat(id, RANDOM_VEHICLE); else v = new CAutomobile(id, RANDOM_VEHICLE); @@ -130,7 +134,11 @@ SpawnCar(int id) if(carCol2) DebugMenuEntrySetAddress(carCol2, &v->m_currentColour2); - v->GetPosition() = ThePaths.m_pathNodes[node].pos; + if(CModelInfo::IsBoatModel(id)) + v->GetPosition() = TheCamera.GetPosition() + TheCamera.GetForward()*15.0f; + else + v->GetPosition() = ThePaths.m_pathNodes[node].pos; + v->GetPosition().z += 4.0f; v->SetOrientation(0.0f, 0.0f, 3.49f); v->m_status = STATUS_ABANDONED; @@ -197,6 +205,12 @@ PlaceOnRoad(void) ((CAutomobile*)veh)->PlaceOnRoadProperly(); } +static void +ResetCamStatics(void) +{ + TheCamera.Cams[TheCamera.ActiveCam].ResetStatics = true; +} + static const char *carnames[] = { "landstal", "idaho", "stinger", "linerun", "peren", "sentinel", "patriot", "firetruk", "trash", "stretch", "manana", "infernus", "blista", "pony", "mule", "cheetah", "ambulan", "fbicar", "moonbeam", "esperant", "taxi", "kuruma", "bobcat", "mrwhoop", "bfinject", "corpse", "police", "enforcer", @@ -358,7 +372,13 @@ DebugMenuPopulate(void) DebugMenuAddCmd("Debug", "Start Credits", CCredits::Start); DebugMenuAddCmd("Debug", "Stop Credits", CCredits::Stop); - + + extern bool PrintDebugCode; + extern int16 &DebugCamMode; + DebugMenuAddVarBool8("Cam", "Print Debug Code", (int8*)&PrintDebugCode, nil); + DebugMenuAddVar("Cam", "Cam Mode", &DebugCamMode, nil, 1, 0, CCam::MODE_EDITOR, nil); + DebugMenuAddCmd("Cam", "Reset Statics", ResetCamStatics); + CTweakVars::AddDBG("Debug"); } } @@ -433,7 +453,8 @@ void re3_debug(const char *format, ...) vsprintf_s(re3_buff, re3_buffsize, format, va); va_end(va); - printf("%s", re3_buff); +// printf("%s", re3_buff); + CDebug::DebugAddText(re3_buff); } void re3_trace(const char *filename, unsigned int lineno, const char *func, const char *format, ...) -- cgit v1.2.3 From 22e022cc9f71bf08027ac37e17e5dafd5173858b Mon Sep 17 00:00:00 2001 From: aap Date: Fri, 27 Mar 2020 18:19:08 +0100 Subject: implemented some unused PS2 cams --- src/core/re3.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/core/re3.cpp') diff --git a/src/core/re3.cpp b/src/core/re3.cpp index ae64913e..0301a98a 100644 --- a/src/core/re3.cpp +++ b/src/core/re3.cpp @@ -377,6 +377,10 @@ DebugMenuPopulate(void) extern int16 &DebugCamMode; DebugMenuAddVarBool8("Cam", "Print Debug Code", (int8*)&PrintDebugCode, nil); DebugMenuAddVar("Cam", "Cam Mode", &DebugCamMode, nil, 1, 0, CCam::MODE_EDITOR, nil); + DebugMenuAddCmd("Cam", "Normal", []() { DebugCamMode = 0; }); + DebugMenuAddCmd("Cam", "Follow Ped With Bind", []() { DebugCamMode = CCam::MODE_FOLLOW_PED_WITH_BIND; }); + DebugMenuAddCmd("Cam", "Reaction", []() { DebugCamMode = CCam::MODE_REACTION; }); + DebugMenuAddCmd("Cam", "Chris", []() { DebugCamMode = CCam::MODE_CHRIS; }); DebugMenuAddCmd("Cam", "Reset Statics", ResetCamStatics); CTweakVars::AddDBG("Debug"); -- cgit v1.2.3