summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2019-07-08 21:37:47 +0200
committeraap <aap@papnet.eu>2019-07-08 21:37:47 +0200
commit2ae112fdf6b90bb4435dba34bcc2a23604e1e158 (patch)
tree5137e9ee1d2b01cd1a125409f1cb23a92a142d9f /src/core
parentedf5ac2626ce17b74037281aa3c9730902b4b1d4 (diff)
more CAutomobile
Diffstat (limited to 'src/core')
-rw-r--r--src/core/Frontend.cpp8
-rw-r--r--src/core/Placeable.h5
-rw-r--r--src/core/config.h2
-rw-r--r--src/core/re3.cpp10
4 files changed, 21 insertions, 4 deletions
diff --git a/src/core/Frontend.cpp b/src/core/Frontend.cpp
index fdb2420b..2fa9d8ea 100644
--- a/src/core/Frontend.cpp
+++ b/src/core/Frontend.cpp
@@ -2261,7 +2261,7 @@ bool GetPadMoveUp()
return
(CPad::GetPad(0)->NewState.DPadUp && !CPad::GetPad(0)->OldState.DPadUp) ||
(CPad::GetPad(0)->NewKeyState.UP && !CPad::GetPad(0)->OldKeyState.UP) ||
- (CPad::GetPad(0)->NewState.LeftStickY < 0 && !CPad::GetPad(0)->OldState.LeftStickY < 0);
+ (CPad::GetPad(0)->NewState.LeftStickY < 0 && !(CPad::GetPad(0)->OldState.LeftStickY < 0));
}
bool GetPadMoveDown()
@@ -2269,7 +2269,7 @@ bool GetPadMoveDown()
return
(CPad::GetPad(0)->NewState.DPadDown && !CPad::GetPad(0)->OldState.DPadDown) ||
(CPad::GetPad(0)->NewKeyState.DOWN && !CPad::GetPad(0)->OldKeyState.DOWN) ||
- (CPad::GetPad(0)->NewState.LeftStickY > 0 && !CPad::GetPad(0)->OldState.LeftStickY > 0);
+ (CPad::GetPad(0)->NewState.LeftStickY > 0 && !(CPad::GetPad(0)->OldState.LeftStickY > 0));
}
bool GetPadMoveLeft()
@@ -2277,7 +2277,7 @@ bool GetPadMoveLeft()
return
(CPad::GetPad(0)->NewState.DPadLeft && !CPad::GetPad(0)->OldState.DPadLeft) ||
(CPad::GetPad(0)->NewKeyState.LEFT && !CPad::GetPad(0)->OldKeyState.LEFT) ||
- (CPad::GetPad(0)->NewState.LeftStickX < 0 && !CPad::GetPad(0)->OldState.LeftStickX < 0);
+ (CPad::GetPad(0)->NewState.LeftStickX < 0 && !(CPad::GetPad(0)->OldState.LeftStickX < 0));
}
bool GetPadMoveRight()
@@ -2285,7 +2285,7 @@ bool GetPadMoveRight()
return
(CPad::GetPad(0)->NewState.DPadRight && !CPad::GetPad(0)->OldState.DPadRight) ||
(CPad::GetPad(0)->NewKeyState.RIGHT && !CPad::GetPad(0)->OldKeyState.RIGHT) ||
- (CPad::GetPad(0)->NewState.LeftStickX > 0 && !CPad::GetPad(0)->OldState.LeftStickX > 0);
+ (CPad::GetPad(0)->NewState.LeftStickX > 0 && !(CPad::GetPad(0)->OldState.LeftStickX > 0));
}
bool GetMouseForward()
diff --git a/src/core/Placeable.h b/src/core/Placeable.h
index 1dfece69..648b315c 100644
--- a/src/core/Placeable.h
+++ b/src/core/Placeable.h
@@ -17,6 +17,11 @@ public:
CMatrix &GetMatrix(void) { return m_matrix; }
void SetTransform(RwMatrix *m) { m_matrix = CMatrix(m, false); }
void SetHeading(float angle);
+ void SetOrientation(float x, float y, float z){
+ CVector pos = m_matrix.GetPosition();
+ m_matrix.SetRotate(x, y, z);
+ m_matrix.Translate(pos);
+ }
bool IsWithinArea(float x1, float y1, float x2, float y2);
bool IsWithinArea(float x1, float y1, float z1, float x2, float y2, float z2);
};
diff --git a/src/core/config.h b/src/core/config.h
index c3b66ff7..b1efd4b6 100644
--- a/src/core/config.h
+++ b/src/core/config.h
@@ -30,6 +30,8 @@ enum Config {
NUMDUMMIES = 2802, // 2368 on PS2
NUMAUDIOSCRIPTOBJECTS = 256,
+ NUMTEMPOBJECTS = 30,
+
// Link list lengths
// TODO: alpha list
NUMCOLCACHELINKS = 200,
diff --git a/src/core/re3.cpp b/src/core/re3.cpp
index d6e81214..f266ffab 100644
--- a/src/core/re3.cpp
+++ b/src/core/re3.cpp
@@ -155,6 +155,15 @@ spawnCar(int id)
#endif
void
+FixCar(void)
+{
+ CVehicle *veh = FindPlayerVehicle();
+ if(veh == nil || !veh->IsCar())
+ return;
+ ((CAutomobile*)veh)->Fix();
+}
+
+void
DebugMenuPopulate(void)
{
if(DebugMenuLoad()){
@@ -198,6 +207,7 @@ DebugMenuPopulate(void)
DebugMenuAddCmd("Cheats", "Strong grip", StrongGripCheat);
DebugMenuAddCmd("Cheats", "Nasty limbs", NastyLimbsCheat);
+ DebugMenuAddCmd("Debug", "Fix Car", FixCar);
DebugMenuAddVarBool8("Debug", "Show Ped Road Groups", (int8*)&gbShowPedRoadGroups, nil);
DebugMenuAddVarBool8("Debug", "Show Car Road Groups", (int8*)&gbShowCarRoadGroups, nil);
DebugMenuAddVarBool8("Debug", "Show Collision Polys", (int8*)&gbShowCollisionPolys, nil);