Remove some instances of Lara global usage in motorbike.cpp; cleanup

This commit is contained in:
Sezz 2022-06-16 23:44:16 +10:00
parent 4b381fa048
commit e30eba578f
5 changed files with 1259 additions and 1272 deletions

View file

@ -93,7 +93,7 @@ bool HandleLaraVehicle(ItemInfo* item, CollisionInfo* coll)
break;
case ID_MOTORBIKE:
MotorbikeControl();
MotorbikeControl(item, coll);
break;
case ID_KAYAK:

File diff suppressed because it is too large Load diff

View file

@ -2,8 +2,6 @@
#include "Game/items.h"
#include "Game/collision/collide_room.h"
void InitialiseMotorbike(short itemNumber);
void MotorbikeCollision(short itemNumber, ItemInfo* laraitem, CollisionInfo* coll);
int MotorbikeControl(void);
void MotorbikeCollision(short itemNumber, ItemInfo* laraItem, CollisionInfo* coll);
bool MotorbikeControl(ItemInfo* laraItem, CollisionInfo* coll);

View file

@ -1,15 +1,21 @@
#pragma once
struct MotorbikeInfo {
short wheelRight; // (two wheel: front and back)
short wheelLeft; // (one wheel: left)
int velocity;
int revs;
int engineRevs;
short momentumAngle;
short extraRotation;
short wallShiftRotation;
int bikeTurn;
int pitch;
short flags;
short lightPower;
struct MotorbikeInfo
{
short TurnRate;
short MomentumAngle;
short ExtraRotation;
short WallShiftRotation;
int Velocity;
int Revs;
int EngineRevs;
int Pitch;
short RightWheelsRotation;
short LeftWheelRotation;
short LightPower;
short Flags;
};

View file

@ -238,10 +238,10 @@ namespace TEN::Renderer
{
case 2:
case 4:
currentBone->ExtraRotation.x = TO_RAD(bike.wheelRight);
currentBone->ExtraRotation.x = TO_RAD(bike.RightWheelsRotation);
break;
case 8:
currentBone->ExtraRotation.x = TO_RAD(bike.wheelLeft);
currentBone->ExtraRotation.x = TO_RAD(bike.LeftWheelRotation);
break;
}
},