summaryrefslogtreecommitdiffstats
path: root/src/core/re3.cpp
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2020-03-27 18:41:22 +0100
committerGitHub <noreply@github.com>2020-03-27 18:41:22 +0100
commit29f69f6216fa629786415e8062ceab3d671ac912 (patch)
treea59a5d54c5a33cdc1c5bd91535331ec2b5955472 /src/core/re3.cpp
parentMerge pull request #356 from blingu/master (diff)
parentimplemented some unused PS2 cams (diff)
downloadre3-29f69f6216fa629786415e8062ceab3d671ac912.tar
re3-29f69f6216fa629786415e8062ceab3d671ac912.tar.gz
re3-29f69f6216fa629786415e8062ceab3d671ac912.tar.bz2
re3-29f69f6216fa629786415e8062ceab3d671ac912.tar.lz
re3-29f69f6216fa629786415e8062ceab3d671ac912.tar.xz
re3-29f69f6216fa629786415e8062ceab3d671ac912.tar.zst
re3-29f69f6216fa629786415e8062ceab3d671ac912.zip
Diffstat (limited to 'src/core/re3.cpp')
-rw-r--r--src/core/re3.cpp39
1 files changed, 32 insertions, 7 deletions
diff --git a/src/core/re3.cpp b/src/core/re3.cpp
index 6f0a4682..0301a98a 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 <vector>
#include <list>
@@ -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,17 @@ 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", "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");
}
}
@@ -433,7 +457,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, ...)