- move many types from dr2types.h to corresponding files

This commit is contained in:
InspirationByte 2022-01-25 22:58:58 +03:00
parent 8dea78101d
commit 44cf1e011c
40 changed files with 743 additions and 812 deletions

View File

@ -1,7 +1,6 @@
#ifndef AI_H
#define AI_H
extern void StoreGameFlags(); // 0x0001BBB8
extern int TannerCanEnterCar(CAR_DATA *cp, int distToCarSq); // 0x0001BBE8
extern int TannerStuckInCar(int doSpeedCheck, int player_id); // 0x0001BA90

View File

@ -20,6 +20,20 @@
#include "glaunch.h"
#include "ASM/rndrasm.h"
struct plotCarGlobals
{
u_char* primptr;
OTTYPE* ot;
u_int intensity;
u_short* pciv_clut;
u_int ShineyTPageASL16;
u_int ShineyClutASL16;
u_char* damageLevel;
u_char* shineyTable;
int ghost;
};
#ifndef PSX
#define CAR_LOD_SWITCH_DISTANCE switch_detail_distance
#else

View File

@ -1,6 +1,17 @@
#ifndef CIV_AI_H
#define CIV_AI_H
typedef struct _EXTRA_CIV_DATA
{
int surfInd;
int distAlongSegment;
short angle;
u_short ctrlState;
int thrustState;
u_char palette;
u_char controlFlags;
} EXTRA_CIV_DATA;
extern const u_char speedLimits[3];
extern unsigned char reservedSlots[MAX_CARS];
extern int frameStart;

View File

@ -19,6 +19,14 @@
#include "pedest.h"
#include "pres.h"
enum AIZone
{
zoneFrnt = 0,
zoneBack = 1,
zoneLeft = 2,
zoneRght = 3,
};
struct iVectNT
{
int n;

View File

@ -1,6 +1,13 @@
#ifndef COP_AI_H
#define COP_AI_H
struct COP_SIGHT_DATA
{
short surroundViewDistance;
short frontViewDistance;
short frontViewAngle;
};
extern COP_DATA gCopData;
extern COP_SIGHT_DATA copSightData;
extern VECTOR roadblockLoc;

View File

@ -23,6 +23,20 @@
#include "xaplay.h"
#include "overlay.h"
struct CUTSCENE_BUFFER
{
int numResident;
u_char residentCutscenes[4];
char(*residentPointers[4]);
char* buffer;
char* currentPointer;
int bytesFree;
int reservedSize;
// char buffer[32*1024]; // was 8192, but we have some free mem now even for PSX. Using malloc.
};
int gSkipInGameCutscene = 0;
int gInGameCutsceneActive = 0;

View File

@ -1,6 +1,18 @@
#ifndef CUTSCENE_H
#define CUTSCENE_H
struct CUTSCENE_INFO
{
u_short offset;
u_short size;
};
struct CUTSCENE_HEADER
{
int maxsize;
CUTSCENE_INFO data[15];
};
#ifndef PSX
#define MAX_USER_REPLAYS 16
@ -9,9 +21,7 @@ extern int gNumUserChases;
extern void InitUserReplays(const char* str);
#endif
extern CUTSCENE_BUFFER CutsceneBuffer;
#endif // PSX
extern int NumCutsceneStreams;
extern int gSkipInGameCutscene;

View File

@ -116,6 +116,11 @@ int gDrawDistance = 441;
_pct& plotContext = *(_pct*)((u_char*)getScratchAddr(0) + 1024 - sizeof(_pct)); // orig offset: 0x1f800020
#endif
struct MVERTEX5x5
{
MVERTEX verts[5][5];
};
// [D] [T] [A]
void addSubdivSpriteShadow(POLYFT4* src, SVECTOR* verts, int z)
{

View File

@ -1,6 +1,26 @@
#ifndef DRAW_H
#define DRAW_H
// Primitive plot context used in scratchpad
struct _pct
{
struct DB* current;
u_short(*ptexture_pages)[128];
u_short(*ptexture_cluts)[128][32];
int f4colourTable[32];
int* polySizes;
char* primptr;
OTTYPE* ot;
u_int clut;
u_int tpage;
u_int colour;
int flags;
SVECTOR* verts;
u_int lastTexInfo;
int scribble[8];
int model;
};
extern SVECTOR day_vectors[4];
extern SVECTOR night_vectors[4];
extern SVECTOR day_colours[4];

View File

@ -23,6 +23,102 @@
#include "ASM/rndrasm.h"
#include "cutrecorder.h"
struct FixedEvent // same as EVENT but different fields
{
VECTOR position;
short rotation;
short active;
u_short initialRotation;
u_short finalRotation;
u_short minSpeed;
u_short maxSpeed;
short flags;
short radius;
int model;
EVENT* next;
char* modelName;
};
struct MissionTrain
{
EVENT* engine;
int* node;
int cornerSpeed;
int initialStraightSpeed;
int finalStraightSpeed;
int start;
int startDir;
};
struct Foam
{
MODEL* model;
int rotate;
};
struct EventCarriage
{
short rotation;
short vel;
};
struct MultiCar
{
EVENT* event;
int count;
};
struct Helicopter
{
int speed;
short pitch;
short dp;
short roll;
short dr;
int lastX;
int lastZ;
TEXTURE_DETAILS rotorTexture;
short rotorrot;
short rotorvel;
int cleanModel;
int deadModel;
};
struct Detonator
{
int timer;
int count;
};
struct CameraDelay
{
int delay;
int type;
};
enum VisType
{
VIS_INIT = 0,
VIS_SORT = 1,
VIS_ADD = 2,
VIS_NEXT = 3,
};
struct EventCamera
{
VECTOR position;
short yAng;
MATRIX matrix;
int rotate;
};
enum Station
{
EVENT_NO_STATION = 0,
EVENT_APPROACHING = 1,
EVENT_LEAVING = 2,
};
#define PATH_NODE_WRAP 0x80000000 // go back to first node without interpolation
#define PATH_NODE_CYCLE 0x80000001 // cycle nodes with interpolation
#define PATH_NODE_STATION 0x80000002 // stop point
@ -458,6 +554,8 @@ EVENT* event;
static EventCamera eventCamera;
void MakeEventTrackable(EVENT* ev);
// [D] [T]
int GetVisValue(int index, int zDir)
{

View File

@ -1,6 +1,37 @@
#ifndef EVENT_H
#define EVENT_H
enum SpecialCamera
{
SPECIAL_CAMERA_SET = 0,
SPECIAL_CAMERA_SET2 = 1,
SPECIAL_CAMERA_RESET = 2,
SPECIAL_CAMERA_WAIT = 3,
};
typedef struct _EVENT EVENT;
struct _EVENT
{
VECTOR position;
short rotation;
short timer;
int* data;
int* node;
short flags;
short radius;
int model;
EVENT* next;
};
struct EventGlobal
{
int camera;
int draw;
EVENT** track;
EVENT* cameraEvent;
};
extern EventGlobal events;
extern CELL_OBJECT *EventCop;
@ -12,11 +43,6 @@ extern void InitEvents(); // 0x0004BBD4
extern void SetUpEvents(int full); // 0x00046258
extern VECTOR* TriggerEvent(int i);
extern void InitEventCamera(); // 0x0004BF54
extern void ResetEventCamera(); // 0x0004C014
extern void SetCamera(EVENT *ev); // 0x00047538
extern void EventCollisions(CAR_DATA *cp, int type); // 0x0004BC50
extern void StepEvents(); // 0x00048A60
@ -27,14 +53,10 @@ extern void EventCameraOffset(SVECTOR* offset);
extern sdPlane* EventSurface(VECTOR *pos, sdPlane *plane); // 0x0004A688
extern void MakeEventTrackable(EVENT *ev); // 0x0004BD6C
extern void OffsetTarget(VECTOR *target); // 0x0004BD2C
extern void SetSpecialCamera(SpecialCamera type, int change); // 0x0004B29C
extern void ScreenShake(int count, SVECTOR *ang); // 0x0004C280
extern int DetonatorTimer(); // 0x0004B5FC
extern void MultiCarEvent(MS_TARGET *target); // 0x0004BAB0

View File

@ -1,6 +1,22 @@
#ifndef FMVPLAY_H
#define FMVPLAY_H
struct RENDER_ARG
{
u_char render;
u_char credits;
u_short recap;
};
struct RENDER_ARGS
{
u_char nRenders;
u_char subtitle;
char screenx;
char screeny;
RENDER_ARG Args[4];
};
extern int gSubtitles;
extern int gNoFMV;

View File

@ -24,6 +24,51 @@
#include "debris.h"
#include "felony.h"
typedef struct __othercarsound
{
int car;
int chan;
char in_use;
char stopped;
char idle;
} othercarsound;
typedef struct __bitfield64
{
int h;
int l;
} bitfield64;
typedef struct __envsound
{
u_char type;
u_char flags;
VECTOR pos;
VECTOR pos2;
int bank;
int sample;
int vol;
} envsound;
typedef struct __envsoundtags
{
int frame_cnt;
int func_cnt;
int num_envsnds;
int envsnd_cnt;
} envsoundtags;
typedef struct __envsoundinfo
{
VECTOR eff_pos[4];
VECTOR cam_pos;
float g[4];
int thisS[4];
int playing_sound[4];
int chan[4];
u_int flags;
} envsoundinfo;
typedef void(*envsoundfunc)(envsound* ep /*$s1*/, envsoundinfo* E /*$a1*/, int pl /*$a2*/);
void IdentifyZone(envsound* ep, envsoundinfo* E, int pl);

View File

@ -58,6 +58,16 @@ enum SoundBankIds
SBK_COP_SIREN_START = 69,
};
struct SPEECH_QUEUE
{
char allowed;
char chan;
char is_playing;
int count;
char reverb;
int slot[7];
};
extern int gDriver1Music;
extern int TimeSinceLastSpeech;

View File

@ -18,6 +18,14 @@
#include "Frontend/FEmain.h"
struct MISSION_STEP
{
u_char flags : 3;
u_char recap : 5;
u_char data : 7;
u_char disc : 1;
};
MISSION_STEP MissionLadder[68] =
{
{ 1, 0, 1, 0 },

View File

@ -17,6 +17,37 @@
#include <stdlib.h> // getenv
#endif // PSX
struct GAME_SAVE_HEADER
{
u_int magic;
u_char gMissionLadderPos;
u_char pad1;
u_char pad2;
u_char pad3;
MISSION_DATA SavedData;
int reserved[8];
};
struct CONFIG_SAVE_HEADER
{
u_int magic;
int gMasterVolume;
int gMusicVolume;
int gSoundMode;
int gVibration;
int gCopDifficultyLevel;
int gFurthestMission;
MAPPING PadMapping[2];
SCORE_TABLES ScoreTables;
int PALAdjustX;
int PALAdjustY;
int NTSCAdjustX;
int NTSCAdjustY;
int gSubtitles;
ACTIVE_CHEATS AvailableCheats;
int reserved[6];
};
// [A]
void ShowSavingWaitMessage(char *message, int height)
{

View File

@ -464,14 +464,14 @@ void ProcessMotionLump(char* lump_ptr, int lump_size)
}
// [D] [T]
void SetupPedMotionData(PEDESTRIAN* pPed)
void SetupPedMotionData(LPPEDESTRIAN pPed)
{
pPed->motion = MotionCaptureData[pPed->type];
}
// [D] [T]
void SetupPedestrian(PEDESTRIAN* pedptr)
void SetupPedestrian(LPPEDESTRIAN pedptr)
{
pedptr->velocity.vy = 10;
pedptr->speed = 10;
@ -487,7 +487,7 @@ int bDoingShadow = 0;
int gCurrentZ;
// [D] [T] [A]
void DrawBodySprite(PEDESTRIAN* pDrawingPed, int boneId, VERTTYPE v1[2], VERTTYPE v2[2], int sz, int sy)
void DrawBodySprite(LPPEDESTRIAN pDrawingPed, int boneId, VERTTYPE v1[2], VERTTYPE v2[2], int sz, int sy)
{
#if 0
// debug code
@ -890,7 +890,7 @@ int bodyShiftValue = BODY_OFFSET;
int torsoShiftValue = TORSO_OFFSET;
// [D] [T]
void SetupTannerSkeleton(PEDESTRIAN* pDrawingPed)
void SetupTannerSkeleton(LPPEDESTRIAN pDrawingPed)
{
int i;
BONE* pBone;
@ -1003,7 +1003,7 @@ void SetupTannerSkeleton(PEDESTRIAN* pDrawingPed)
}
// [A] - was inlined in newShowTanner
void DrawSprite(PEDESTRIAN* pDrawingPed, BONE* pBone, VECTOR* vJPos)
void DrawSprite(LPPEDESTRIAN pDrawingPed, BONE* pBone, VECTOR* vJPos)
{
VERTTYPE t0[2], t1[2]; // [A] was two longs
int z, z1, z2;
@ -1040,7 +1040,7 @@ void DrawSprite(PEDESTRIAN* pDrawingPed, BONE* pBone, VECTOR* vJPos)
int bAllreadyRotated = 0;
// [D] [T]
void newShowTanner(PEDESTRIAN* pDrawingPed)
void newShowTanner(LPPEDESTRIAN pDrawingPed)
{
int i, j;
int draw;
@ -1253,7 +1253,7 @@ void newShowTanner(PEDESTRIAN* pDrawingPed)
}
// [D] [T]
SVECTOR* GetModelVertPtr(PEDESTRIAN* pDrawingPed, int boneId, int modelType)
SVECTOR* GetModelVertPtr(LPPEDESTRIAN pDrawingPed, int boneId, int modelType)
{
int startVertex;
@ -1293,7 +1293,7 @@ SVECTOR* GetModelVertPtr(PEDESTRIAN* pDrawingPed, int boneId, int modelType)
}
// [D] [T]
void newRotateBones(PEDESTRIAN* pDrawingPed, BONE* poBone)
void newRotateBones(LPPEDESTRIAN pDrawingPed, BONE* poBone)
{
SVECTOR* pVerts;
MODEL* pModel;
@ -1420,7 +1420,7 @@ void newRotateBones(PEDESTRIAN* pDrawingPed, BONE* poBone)
// [D] [T]
void DrawCiv(PEDESTRIAN* pPed)
void DrawCiv(LPPEDESTRIAN pPed)
{
SVECTOR* vert2;
SVECTOR* vert1;
@ -1612,7 +1612,7 @@ void SetSkelModelPointers(int type)
int iCurrBone = 0;
// [D] [T]
void DrawTanner(PEDESTRIAN* pPed)
void DrawTanner(LPPEDESTRIAN pPed)
{
int iVar1;
VECTOR v;
@ -1664,7 +1664,7 @@ void DrawTanner(PEDESTRIAN* pPed)
}
// [D] [T]
int DrawCharacter(PEDESTRIAN* pPed)
int DrawCharacter(LPPEDESTRIAN pPed)
{
int fr;
short size;
@ -1800,7 +1800,7 @@ void InitTannerShadow(void)
}
// [D] [T]
void TannerShadow(PEDESTRIAN* pDrawingPed, VECTOR* pPedPos, SVECTOR* pLightPos, CVECTOR* col, short angle)
void TannerShadow(LPPEDESTRIAN pDrawingPed, VECTOR* pPedPos, SVECTOR* pLightPos, CVECTOR* col, short angle)
{
DR_ENV* dr_env;
SVECTOR vert[4];
@ -1956,7 +1956,7 @@ void TannerShadow(PEDESTRIAN* pDrawingPed, VECTOR* pPedPos, SVECTOR* pLightPos,
}
// [A] - totally custom function but it works pretty much same as original
void DoCivHead(PEDESTRIAN* pPed, SVECTOR* vert1, SVECTOR* vert2)
void DoCivHead(LPPEDESTRIAN pPed, SVECTOR* vert1, SVECTOR* vert2)
{
SVECTOR spos;
VECTOR pos;

View File

@ -16,21 +16,21 @@ extern int ThisMotion;
extern void ProcessMotionLump(char *lump_ptr, int lump_size); // 0x00069A38
extern void SetupPedMotionData(PEDESTRIAN *pPed); // 0x00069AB8
extern void SetupPedestrian(PEDESTRIAN *pedptr); // 0x00069B6C
extern void SetupPedMotionData(LPPEDESTRIAN pPed); // 0x00069AB8
extern void SetupPedestrian(LPPEDESTRIAN pedptr); // 0x00069B6C
extern void StoreVertexLists(); // 0x0006594C
extern void DrawCiv(PEDESTRIAN *pPed); // 0x000670CC
extern void DrawCiv(LPPEDESTRIAN pPed); // 0x000670CC
extern void SetSkelModelPointers(int type); // 0x00069AD8
extern void DrawTanner(PEDESTRIAN *pPed); // 0x000678D0
extern int DrawCharacter(PEDESTRIAN *pPed); // 0x00067D44
extern void DrawTanner(LPPEDESTRIAN pPed); // 0x000678D0
extern int DrawCharacter(LPPEDESTRIAN pPed); // 0x00067D44
extern void InitTannerShadow(); // 0x000681EC
extern void TannerShadow(PEDESTRIAN *pDrawingPed, VECTOR *pPedPos, SVECTOR *pLightPos, CVECTOR *col, short angle); // 0x00068358
extern void TannerShadow(LPPEDESTRIAN pDrawingPed, VECTOR *pPedPos, SVECTOR *pLightPos, CVECTOR *col, short angle); // 0x00068358
extern void DoCivHead(PEDESTRIAN *pPed, SVECTOR *vert1, SVECTOR *vert2); // 0x00068B2C
extern void DoCivHead(LPPEDESTRIAN pPed, SVECTOR *vert1, SVECTOR *vert2); // 0x00068B2C
#endif

View File

@ -32,6 +32,13 @@ struct GARAGE_DOOR
char yang;
};
struct CYCLE_OBJECT
{
char* name;
short vx, vy;
short start1, stop1, speed1;
short start2, stop2, speed2;
};
CYCLE_OBJECT Lev0[2] =
{

View File

@ -1,6 +1,24 @@
#ifndef OVERLAY_H
#define OVERLAY_H
struct COLOUR_BAND
{
CVECTOR colour;
int value;
int flags;
};
typedef struct _PERCENTAGE_BAR
{
char* tag;
short xpos, ypos;
short width, height;
u_short position;
u_short max;
COLOUR_BAND* pColourBand;
int flags, active;
} PERCENTAGE_BAR, * LPPERCENTAGE_BAR;
extern PERCENTAGE_BAR PlayerDamageBar;
extern PERCENTAGE_BAR Player2DamageBar;
extern PERCENTAGE_BAR DamageBar;

View File

@ -17,6 +17,20 @@
#include "pad.h"
#include "ASM/rnc_2.h"
struct MAPTEX
{
short u, w, v, h;
};
struct OVERMAP
{
int x_offset, y_offset;
int width, height;
u_char toptile;
u_char dummy;
int scale;
};
OVERMAP overlaidmaps[4] =
{
{ 197, 318, 384, 672, 252, 0x99, 2145 },

View File

@ -61,6 +61,46 @@ enum ECarPads
CAR_PAD_LEAVECAR = (MPAD_D_UP | MPAD_TRIANGLE),
};
struct DUPLICATION
{
char* buffer;
int size;
};
typedef struct MAPPING
{
u_short button_lookup[16];
u_short swap_analog;
u_short reserved1;
} *LPMAPPING;
typedef struct PAD
{
u_char active;
u_char type;
u_char dualshock;
u_char reserved1;
u_short direct;
u_short dirnew;
char diranalog[4];
u_short mapped;
u_short mapnew;
char mapanalog[4];
MAPPING mappings;
u_char alarmShakeCounter;
u_char asd;
u_char sdf;
u_char dfg;
u_char delay;
u_char port;
u_char state;
u_char dsactive;
u_char* shakeptr;
u_char motors[2];
u_char shake_type;
u_char vibrate;
} *LPPAD;
extern int pad_connected;
extern int numPadsConnected;
extern int gVibration;

View File

@ -43,6 +43,29 @@ struct MENU_MESSAGE
int show;
} gDisplayedMessage = { NULL, NULL, 0 };
typedef void(*pauseFunc)(int dir);
struct MENU_ITEM;
struct MENU_HEADER;
struct MENU_ITEM
{
char* Text;
u_char Type;
u_char Justify;
pauseFunc func;
EXIT_VALUE ExitValue;
MENU_HEADER* SubMenu;
};
struct MENU_HEADER
{
char* Title;
XYWH Bound;
u_char NumItems;
MENU_ITEM* MenuItems;
};
static MENU_ITEM* ActiveItem[PAUSE_MENU_LEVELS];
static MENU_HEADER* VisibleMenus[PAUSE_MENU_LEVELS];
static MENU_HEADER* ActiveMenu;

View File

@ -1,6 +1,18 @@
#ifndef PAUSE_H
#define PAUSE_H
enum EXIT_VALUE
{
MENU_QUIT_NONE = 0,
MENU_QUIT_CONTINUE = 1,
MENU_QUIT_QUIT = 2,
MENU_QUIT_RESTART = 3,
MENU_QUIT_DIRECTOR = 4,
MENU_QUIT_QUICKREPLAY = 5,
MENU_QUIT_BACKMENU = 6,
MENU_QUIT_NEXTMISSION = 7,
};
extern int gShowMap;
extern int gDrawPauseMenus;
extern int pauseflag;

View File

@ -27,23 +27,38 @@
#include "ASM/rndrasm.h"
struct CAR_COLLISION_BOX
{
int min_x, max_x;
int min_z, max_z;
};
typedef struct SEATED_PEDESTRIANS
{
int x;
int z;
short rotation;
char index;
char pad;
} *SEATEDPTR;
MODEL* pmTannerModels[17] = { 0 };
MODEL* pmJerichoModels[6] = { 0 };
void PedDoNothing(PEDESTRIAN* pPed);
void PedUserWalker(PEDESTRIAN* pPed);
void PedUserRunner(PEDESTRIAN* pPed);
void PedGetInCar(PEDESTRIAN* pPed);
void PedGetOutCar(PEDESTRIAN* pPed);
void PedCarryOutAnimation(PEDESTRIAN* pPed);
void CivPedDoNothing(PEDESTRIAN* pPed);
void CivPedWalk(PEDESTRIAN* pPed);
void CivPedSit(PEDESTRIAN* pPed);
void CivPedJump(PEDESTRIAN* pPed);
void PedPressButton(PEDESTRIAN* pPed);
void TannerSitDown(PEDESTRIAN* pPed);
void CopStand(PEDESTRIAN* pPed);
void CivGetIn(PEDESTRIAN* pPed);
void PedDoNothing(LPPEDESTRIAN pPed);
void PedUserWalker(LPPEDESTRIAN pPed);
void PedUserRunner(LPPEDESTRIAN pPed);
void PedGetInCar(LPPEDESTRIAN pPed);
void PedGetOutCar(LPPEDESTRIAN pPed);
void PedCarryOutAnimation(LPPEDESTRIAN pPed);
void CivPedDoNothing(LPPEDESTRIAN pPed);
void CivPedWalk(LPPEDESTRIAN pPed);
void CivPedSit(LPPEDESTRIAN pPed);
void CivPedJump(LPPEDESTRIAN pPed);
void PedPressButton(LPPEDESTRIAN pPed);
void TannerSitDown(LPPEDESTRIAN pPed);
void CopStand(LPPEDESTRIAN pPed);
void CivGetIn(LPPEDESTRIAN pPed);
pedFunc fpPedPersonalityFunctions[] = {
PedDoNothing,
@ -72,7 +87,7 @@ const int tannerTurnStep = 4;
int bKillTanner = 0;
SEATED_PEDESTRIANS* seated_pedestrian; // lump
SEATEDPTR seated_pedestrian; // lump
int seated_count;
int maxSeated;
static int numTannerPeds = 0;
@ -81,9 +96,9 @@ int pinginPedAngle = 0;
PEDESTRIAN pedestrians[MAX_PEDESTRIANS];
PEDESTRIAN* pUsedPeds = NULL; // linked list of pedestrians
PEDESTRIAN* pFreePeds = NULL;
PEDESTRIAN* pHold = NULL;
LPPEDESTRIAN pUsedPeds = NULL; // linked list of pedestrians
LPPEDESTRIAN pFreePeds = NULL;
LPPEDESTRIAN pHold = NULL;
int max_pedestrians;
int num_pedestrians;
@ -103,6 +118,11 @@ int bPower = 0;
int oldWeather = 0;
int powerCounter = 0;
extern int CheckForPlayerCar(LPPEDESTRIAN pedestrian, CAR_COLLISION_BOX* collision_box); // 0x000732C0
extern SEATEDPTR FindSeated(); // 0x00072644
extern SEATEDPTR FindTannerASeat(LPPEDESTRIAN pPed); // 0x000717AC
extern void add_seated(SEATEDPTR seatedptr, int seat_index); // 0x000718C8
// [D] [T]
void InitTanner(void)
{
@ -142,7 +162,7 @@ void InitTanner(void)
// [D] [T]
void SetTannerPosition(VECTOR* pVec)
{
PEDESTRIAN* pPed;
LPPEDESTRIAN pPed;
pPed = pUsedPeds;
while (pPed)
@ -166,18 +186,18 @@ void SetTannerPosition(VECTOR* pVec)
void InitPedestrians(void)
{
int loop;
SEATED_PEDESTRIANS* seatedptr;
SEATEDPTR seatedptr;
memset((u_char*)pedestrians, 0, sizeof(pedestrians));
DestroyPedestrians();
PEDESTRIAN* lastPed = &pedestrians[0];
LPPEDESTRIAN lastPed = &pedestrians[0];
lastPed->pPrev = NULL;
for (loop = 1; loop < MAX_PEDESTRIANS; loop++)
{
PEDESTRIAN* currPed = &pedestrians[loop];
LPPEDESTRIAN currPed = &pedestrians[loop];
lastPed->pNext = currPed;
currPed->pPrev = lastPed++;
@ -227,8 +247,8 @@ void DestroyPedestrians(void)
// [D] [T]
void DestroyCivPedestrians(void)
{
PEDESTRIAN* pPed;
PEDESTRIAN* pHPed;
LPPEDESTRIAN pPed;
LPPEDESTRIAN pHPed;
pPed = pUsedPeds;
while (pPed != NULL)
@ -247,7 +267,7 @@ void DestroyCivPedestrians(void)
// [D] [T]
void DestroyPedestrian(PEDESTRIAN* pPed)
void DestroyPedestrian(LPPEDESTRIAN pPed)
{
if (pPed->flags & 8)
numCopPeds--; // or road block pedestrians
@ -306,9 +326,9 @@ int PedSurfaceType(VECTOR* ped_pos)
}
// [D] [T]
PEDESTRIAN* CreatePedestrian(void)
LPPEDESTRIAN CreatePedestrian(void)
{
PEDESTRIAN* pNewPed;
LPPEDESTRIAN pNewPed;
pNewPed = pFreePeds;
if (pFreePeds != NULL)
@ -400,7 +420,7 @@ void PlaceRoadBlockCops(void)
// [D] [T]
int CreatePedAtLocation(LONGVECTOR4* pPos, int pedType)
{
PEDESTRIAN* pPed;
LPPEDESTRIAN pPed;
if (num_pedestrians >= MAX_PLACED_PEDS)
return 0;
@ -456,7 +476,7 @@ int CreatePedAtLocation(LONGVECTOR4* pPos, int pedType)
// [D] [T]
void DrawAllPedestrians(void)
{
PEDESTRIAN* pPed;
LPPEDESTRIAN pPed;
pPed = pUsedPeds;
while (pPed != NULL)
@ -504,7 +524,7 @@ void DrawAllPedestrians(void)
// [D] [T]
int TannerActionHappening(void)
{
PEDESTRIAN* pPed = player[0].pPed;
LPPEDESTRIAN pPed = player[0].pPed;
if (pPed && pPed->type == PED_ACTION_PRESSBUTTON)
return pPed->frame1 == 14;
@ -519,8 +539,8 @@ int bAvoidBomb = -1;
void ControlPedestrians(void)
{
CAR_DATA* pCar;
PEDESTRIAN* pPed;
PEDESTRIAN* pPedNext;
LPPEDESTRIAN pPed;
LPPEDESTRIAN pPedNext;
pPed = pUsedPeds;
@ -583,7 +603,7 @@ void ControlPedestrians(void)
// [D] [T]
void AnimatePed(PEDESTRIAN* pPed)
void AnimatePed(LPPEDESTRIAN pPed)
{
int dir;
VECTOR vec;
@ -673,7 +693,7 @@ void AnimatePed(PEDESTRIAN* pPed)
// [D] [T]
void SetupDoNowt(PEDESTRIAN* pPed)
void SetupDoNowt(LPPEDESTRIAN pPed)
{
pPed->speed = 0;
pPed->dir.vz = 0;
@ -685,7 +705,7 @@ void SetupDoNowt(PEDESTRIAN* pPed)
}
// [D] [T]
void SetupWalker(PEDESTRIAN* pPed)
void SetupWalker(LPPEDESTRIAN pPed)
{
pPed->type = PED_ACTION_WALK;
pPed->speed = 14;
@ -695,7 +715,7 @@ void SetupWalker(PEDESTRIAN* pPed)
}
// [D] [T]
void SetupRunner(PEDESTRIAN* pPed)
void SetupRunner(LPPEDESTRIAN pPed)
{
pPed->type = PED_ACTION_RUN;
pPed->frame1 = 0;
@ -706,7 +726,7 @@ void SetupRunner(PEDESTRIAN* pPed)
}
// [D] [T]
void SetupBack(PEDESTRIAN* pPed)
void SetupBack(LPPEDESTRIAN pPed)
{
pPed->type = PED_ACTION_WALK;
pPed->frame1 = 0;
@ -719,7 +739,7 @@ void SetupBack(PEDESTRIAN* pPed)
CAR_DATA* pCivCarToGetIn = NULL;
// [D] [T]
void CivGetIn(PEDESTRIAN* pPed) // [A] UNUSED
void CivGetIn(LPPEDESTRIAN pPed) // [A] UNUSED
{
u_int padid;
DRIVER2_CURVE* curve;
@ -741,7 +761,7 @@ void CivGetIn(PEDESTRIAN* pPed) // [A] UNUSED
}
// [D] [T]
void CopStand(PEDESTRIAN* pPed)
void CopStand(LPPEDESTRIAN pPed)
{
VECTOR v;
v.vx = pPed->position.vx - player[0].pos[0];
@ -754,7 +774,7 @@ void CopStand(PEDESTRIAN* pPed)
int iAllowWatch = 0;
// [D] [T]
void PedDoNothing(PEDESTRIAN* pPed)
void PedDoNothing(LPPEDESTRIAN pPed)
{
pPed->speed = 0;
@ -868,7 +888,7 @@ void PedDoNothing(PEDESTRIAN* pPed)
}
// [D] [T]
void PedUserRunner(PEDESTRIAN* pPed)
void PedUserRunner(LPPEDESTRIAN pPed)
{
if ((pPed->flags & 0x10U) == 0)
{
@ -946,7 +966,7 @@ void PedUserRunner(PEDESTRIAN* pPed)
}
// [D] [T]
void PedUserWalker(PEDESTRIAN* pPed)
void PedUserWalker(LPPEDESTRIAN pPed)
{
if ((pPed->flags & 0x10) == 0)
{
@ -986,7 +1006,7 @@ int bFreezeAnimation = 0;
int allreadydone = 0;
// [D] [T]
void PedCarryOutAnimation(PEDESTRIAN* pPed)
void PedCarryOutAnimation(LPPEDESTRIAN pPed)
{
pPed->speed = 0;
@ -1050,7 +1070,7 @@ CAR_DATA* carToGetIn;
int bReverseYRotation = 0;
// [D] [T]
void PedGetOutCar(PEDESTRIAN* pPed)
void PedGetOutCar(LPPEDESTRIAN pPed)
{
int playerId;
@ -1080,7 +1100,7 @@ void PedGetOutCar(PEDESTRIAN* pPed)
int lastCarCameraView = 0;
// [D] [T]
void SetupGetOutCar(PEDESTRIAN* pPed, CAR_DATA* pCar, int side)
void SetupGetOutCar(LPPEDESTRIAN pPed, CAR_DATA* pCar, int side)
{
bool entrySide;
int sn, cs;
@ -1127,7 +1147,7 @@ void SetupGetOutCar(PEDESTRIAN* pPed, CAR_DATA* pCar, int side)
// [D] [T]
void SetupGetInCar(PEDESTRIAN* pPed)
void SetupGetInCar(LPPEDESTRIAN pPed)
{
int sn, cs;
int carDir;
@ -1190,7 +1210,7 @@ void SetupGetInCar(PEDESTRIAN* pPed)
}
// [D] [T]
void PedGetInCar(PEDESTRIAN* pPed)
void PedGetInCar(LPPEDESTRIAN pPed)
{
int playerID;
@ -1217,7 +1237,7 @@ void PedGetInCar(PEDESTRIAN* pPed)
}
// [D] [T]
void SetupPressButton(PEDESTRIAN* pPed)
void SetupPressButton(LPPEDESTRIAN pPed)
{
pPed->type = PED_ACTION_PRESSBUTTON;
SetupPedMotionData(pPed);
@ -1229,7 +1249,7 @@ void SetupPressButton(PEDESTRIAN* pPed)
}
// [D] [T]
void PedPressButton(PEDESTRIAN* pPed)
void PedPressButton(LPPEDESTRIAN pPed)
{
if (pPed->frame1 < 15)
{
@ -1247,7 +1267,7 @@ void PedPressButton(PEDESTRIAN* pPed)
// [D] [T]
void SetupTannerSitDown(PEDESTRIAN* pPed)
void SetupTannerSitDown(LPPEDESTRIAN pPed)
{
pPed->type = PED_ACTION_SIT;
SetupPedMotionData(pPed);
@ -1259,7 +1279,7 @@ void SetupTannerSitDown(PEDESTRIAN* pPed)
}
// [D] [T]
void TannerCameraHandler(PEDESTRIAN* pPed)
void TannerCameraHandler(LPPEDESTRIAN pPed)
{
int value;
int padSteer;
@ -1308,7 +1328,7 @@ void TannerCameraHandler(PEDESTRIAN* pPed)
// [D] [T]
void TannerSitDown(PEDESTRIAN* pPed)
void TannerSitDown(LPPEDESTRIAN pPed)
{
if (oldCamView != 2 && player[pPed->padId].cameraView == 2)
{
@ -1362,7 +1382,7 @@ void TannerSitDown(PEDESTRIAN* pPed)
}
// [D] [T]
void CivPedDoNothing(PEDESTRIAN* pPed)
void CivPedDoNothing(LPPEDESTRIAN pPed)
{
}
@ -1395,7 +1415,7 @@ void SetupCivPedRouteData(VECTOR* pPos)
void PingInPedestrians(void)
{
int bFound;
PEDESTRIAN* pPed;
LPPEDESTRIAN pPed;
int rnd;
int pingInDist;
int i;
@ -1515,7 +1535,7 @@ void PingInPedestrians(void)
}
// [D] [T]
void TannerCollision(PEDESTRIAN* pPed)
void TannerCollision(LPPEDESTRIAN pPed)
{
CAR_DATA* pcdTanner;
@ -1552,7 +1572,7 @@ void TannerCollision(PEDESTRIAN* pPed)
}
// [D] [T]
int FindPointOfCollision(CAR_DATA* pCar, PEDESTRIAN* pPed)
int FindPointOfCollision(CAR_DATA* pCar, LPPEDESTRIAN pPed)
{
int dx, dz;
int minZ;
@ -1744,7 +1764,7 @@ int TannerCarCollisionCheck(VECTOR* pPos, int dir, int bQuick)
}
// [D] [T]
int PingOutPed(PEDESTRIAN* pPed)
int PingOutPed(LPPEDESTRIAN pPed)
{
int pz;
int px;
@ -1762,7 +1782,7 @@ int PingOutPed(PEDESTRIAN* pPed)
}
// [D] [T]
void SetupCivJump(PEDESTRIAN* pPed, CAR_DATA* cp)
void SetupCivJump(LPPEDESTRIAN pPed, CAR_DATA* cp)
{
int dz;
short scale;
@ -1842,7 +1862,7 @@ void SetupCivJump(PEDESTRIAN* pPed, CAR_DATA* cp)
}
// [D] [T]
void CivPedJump(PEDESTRIAN* pPed)
void CivPedJump(LPPEDESTRIAN pPed)
{
if (pPed->frame1 == 2)
pPed->speed *= 2;
@ -1865,7 +1885,7 @@ void CivPedJump(PEDESTRIAN* pPed)
}
// [D] [T]
void SetupCivPedWalk(PEDESTRIAN* pPed)
void SetupCivPedWalk(LPPEDESTRIAN pPed)
{
pPed->flags |= 0x10;
@ -1880,7 +1900,7 @@ void SetupCivPedWalk(PEDESTRIAN* pPed)
}
// [D] [T]
void CivPedWalk(PEDESTRIAN* pPed)
void CivPedWalk(LPPEDESTRIAN pPed)
{
int dir;
int turn;
@ -1960,7 +1980,7 @@ void CivPedWalk(PEDESTRIAN* pPed)
}
// [D] [T]
void CivPedSit(PEDESTRIAN* pPed)
void CivPedSit(LPPEDESTRIAN pPed)
{
pPed->frame1 = 0;
}
@ -1977,7 +1997,7 @@ void HandlePedestrians(void)
}
// [D] [T]
void PedestrianActionInit_WalkToTarget(PEDESTRIAN* pPed)
void PedestrianActionInit_WalkToTarget(LPPEDESTRIAN pPed)
{
int dir;
dir = CalcPedestrianDirection(0, (pPed->position).vx, (pPed->position).vz, &pPed->target);
@ -2000,7 +2020,7 @@ void PedestrianActionInit_WalkToTarget(PEDESTRIAN* pPed)
}
// [D] [T]
void CorrectPathPosition(PEDESTRIAN* pedestrian, VECTOR* position)
void CorrectPathPosition(LPPEDESTRIAN pedestrian, VECTOR* position)
{
}
@ -2092,7 +2112,7 @@ int CalcPedestrianDirection(int last_dir, int wx, int wz, VECTOR* target)
}
// [D] [T]
int IsPavement(int x, int y, int z, PEDESTRIAN* pPed)
int IsPavement(int x, int y, int z, LPPEDESTRIAN pPed)
{
int r;
VECTOR v;
@ -2117,7 +2137,7 @@ int IsPavement(int x, int y, int z, PEDESTRIAN* pPed)
}
// [D] [T]
void SetPedestrianTurn(PEDESTRIAN* pedestrian, int turn)
void SetPedestrianTurn(LPPEDESTRIAN pedestrian, int turn)
{
int speed;
int dir;
@ -2138,12 +2158,12 @@ void SetPedestrianTurn(PEDESTRIAN* pedestrian, int turn)
}
// [D] [T]
SEATED_PEDESTRIANS* FindSeated(void)
SEATEDPTR FindSeated(void)
{
int dz;
int dx;
int count1;
SEATED_PEDESTRIANS* seatedptr;
SEATEDPTR seatedptr;
if (!seated_pedestrian)
return NULL;
@ -2184,13 +2204,13 @@ SEATED_PEDESTRIANS* FindSeated(void)
}
// [D] [T]
SEATED_PEDESTRIANS* FindTannerASeat(PEDESTRIAN* pPed)
SEATEDPTR FindTannerASeat(LPPEDESTRIAN pPed)
{
int dx, dz;
int distSqr;
int bestSqr;
SEATED_PEDESTRIANS* seatedptr;
SEATED_PEDESTRIANS* theOne;
SEATEDPTR seatedptr;
SEATEDPTR theOne;
theOne = NULL;
bestSqr = 4096;
@ -2236,9 +2256,9 @@ SEATED_PEDESTRIANS* FindTannerASeat(PEDESTRIAN* pPed)
}
// [D] [T]
void add_seated(SEATED_PEDESTRIANS* seatedptr, int seat_index)
void add_seated(SEATEDPTR seatedptr, int seat_index)
{
PEDESTRIAN* pedptr;
LPPEDESTRIAN pedptr;
int rnd;
if (num_pedestrians < MAX_SEATED_PEDS)
@ -2393,7 +2413,7 @@ void BuildCarCollisionBox(void)
}
// [D] [T]
CAR_DATA* CheckForCar(PEDESTRIAN* pedestrian)
CAR_DATA* CheckForCar(LPPEDESTRIAN pedestrian)
{
int count;
@ -2427,7 +2447,7 @@ CAR_DATA* CheckForCar(PEDESTRIAN* pedestrian)
}
// [D] [T]
int CheckForPlayerCar(PEDESTRIAN* pedestrian, CAR_COLLISION_BOX* collision_box)
int CheckForPlayerCar(LPPEDESTRIAN pedestrian, CAR_COLLISION_BOX* collision_box)
{
if (pedestrian->position.vx >= collision_box->min_x &&
pedestrian->position.vx <= collision_box->max_x &&
@ -2443,7 +2463,7 @@ int CheckForPlayerCar(PEDESTRIAN* pedestrian, CAR_COLLISION_BOX* collision_box)
int basic_car_interest;
// [D] [T]
void CalculatePedestrianInterest(PEDESTRIAN* pPed)
void CalculatePedestrianInterest(LPPEDESTRIAN pPed)
{
CAR_DATA* pCar;
int carId;
@ -2497,7 +2517,7 @@ void CalculatePedestrianInterest(PEDESTRIAN* pPed)
// [D] [T]
void ProcessChairLump(char* lump_file, int lump_size)
{
seated_pedestrian = (SEATED_PEDESTRIANS*)lump_file;
seated_pedestrian = (SEATEDPTR)lump_file;
}
// [D] [T]
@ -2562,7 +2582,7 @@ void IHaveThePower(void)
}
// [D] [T]
void ProcessTannerPad(PEDESTRIAN* pPed, u_int pad, char PadSteer, char use_analogue)
void ProcessTannerPad(LPPEDESTRIAN pPed, u_int pad, char PadSteer, char use_analogue)
{
sdPlane* SurfacePtr;
int direction;
@ -2757,7 +2777,7 @@ int ActivatePlayerPedestrian(CAR_DATA* pCar, char* padId, int direction, LONGVEC
int wbody;
int side;
int dir;
PEDESTRIAN* pedptr;
LPPEDESTRIAN pedptr;
int playerId;
VECTOR* pos;
VECTOR v;
@ -2958,7 +2978,7 @@ int ActivatePlayerPedestrian(CAR_DATA* pCar, char* padId, int direction, LONGVEC
}
// [D] [T]
void DeActivatePlayerPedestrian(PEDESTRIAN* pPed)
void DeActivatePlayerPedestrian(LPPEDESTRIAN pPed)
{
CAR_DATA* cp;
int playerId;

View File

@ -3,33 +3,35 @@
#define TANNER_COLLIDER_CARID (MAX_CARS)
typedef struct SEATED_PEDESTRIANS* SEATEDPTR;
extern SVECTOR tannerLookAngle;
extern MODEL* pmTannerModels[17];
extern MODEL* pmJerichoModels[6];
extern SEATED_PEDESTRIANS *seated_pedestrian;
extern SEATEDPTR seated_pedestrian;
extern int bKillTanner;
extern int bReverseYRotation;
extern PEDESTRIAN *pUsedPeds;
extern LPPEDESTRIAN pUsedPeds;
extern void ProcessChairLump(char *lump_file, int lump_size); // 0x00073328
extern void InitTanner(); // 0x0006E408
extern void SetTannerPosition(VECTOR *pVec); // 0x00072478
extern void ProcessTannerPad(PEDESTRIAN *pPed, u_int pad, char PadSteer, char use_analogue); // 0x0006DF54
extern void ProcessTannerPad(LPPEDESTRIAN pPed, u_int pad, char PadSteer, char use_analogue); // 0x0006DF54
extern void InitPedestrians(); // 0x0006E5C4
extern void DestroyPedestrians(); // 0x00071F54
extern void DestroyCivPedestrians(); // 0x00072FD0
extern void DestroyPedestrian(PEDESTRIAN *pPed); // 0x00071FB4
extern void DestroyPedestrian(LPPEDESTRIAN pPed); // 0x00071FB4
extern int ActivatePlayerPedestrian(CAR_DATA *pCar, char *padId, int direction, LONGVECTOR4* position, PED_MODEL_TYPES playerType); // 0x0006E6C4
extern PEDESTRIAN * CreatePedestrian(); // 0x000720AC
extern LPPEDESTRIAN CreatePedestrian(); // 0x000720AC
extern void PlaceRoadBlockCops(); // 0x0006EC88
extern int CreatePedAtLocation(LONGVECTOR4* pPos, int pedType); // 0x0006F00C
@ -39,50 +41,42 @@ extern int TannerActionHappening(); // 0x00072430
extern void ControlPedestrians(); // 0x0006F16C
extern void DeActivatePlayerPedestrian(PEDESTRIAN *pPed); // 0x0007216C
extern void DeActivatePlayerPedestrian(LPPEDESTRIAN pPed); // 0x0007216C
extern void SetupCivPedRouteData(VECTOR *pPos); // 0x0007313C
extern void PingInPedestrians(); // 0x0007047C
extern void TannerCollision(PEDESTRIAN *pPed); // 0x00072EE4
extern void TannerCollision(LPPEDESTRIAN pPed); // 0x00072EE4
extern int FindPointOfCollision(CAR_DATA *pCar, PEDESTRIAN* pPed); // 0x00070878
extern int FindPointOfCollision(CAR_DATA *pCar, LPPEDESTRIAN pPed); // 0x00070878
extern int TannerCarCollisionCheck(VECTOR *pPos, int dir, int bQuick); // 0x00070A9C
extern int PingOutPed(PEDESTRIAN *pPed); // 0x000731F8
extern int PingOutPed(LPPEDESTRIAN pPed); // 0x000731F8
extern void SetupCivJump(PEDESTRIAN *pPed, CAR_DATA *cp); // 0x00071054
extern void SetupCivJump(LPPEDESTRIAN pPed, CAR_DATA *cp); // 0x00071054
extern void SetupCivPedWalk(PEDESTRIAN *pPed); // 0x00073270
extern void SetupCivPedWalk(LPPEDESTRIAN pPed); // 0x00073270
extern void HandlePedestrians(); // 0x0007211C
extern void PedestrianActionInit_WalkToTarget(PEDESTRIAN *pPed); // 0x0007283C
extern void PedestrianActionInit_WalkToTarget(LPPEDESTRIAN pPed); // 0x0007283C
extern void CorrectPathPosition(PEDESTRIAN *pedestrian, VECTOR *position); // 0x000715FC
extern void CorrectPathPosition(LPPEDESTRIAN pedestrian, VECTOR *position); // 0x000715FC
extern int CalcPedestrianDirection(int last_dir, int wx, int wz, VECTOR *target); // 0x00071608
extern int IsPavement(int x, int y, int z, PEDESTRIAN *pPed); // 0x000725B8
extern int IsPavement(int x, int y, int z, LPPEDESTRIAN pPed); // 0x000725B8
extern void SetPedestrianTurn(PEDESTRIAN *pedestrian, int turn); // 0x00072500
extern SEATED_PEDESTRIANS * FindSeated(); // 0x00072644
extern SEATED_PEDESTRIANS * FindTannerASeat(PEDESTRIAN *pPed); // 0x000717AC
extern void add_seated(SEATED_PEDESTRIANS *seatedptr, int seat_index); // 0x000718C8
extern void SetPedestrianTurn(LPPEDESTRIAN pedestrian, int turn); // 0x00072500
extern void set_coll_box(int index, CAR_DATA *cp, int offset); // 0x00071A5C
extern void BuildCarCollisionBox(); // 0x00071B7C
extern CAR_DATA * CheckForCar(PEDESTRIAN *pedestrian); // 0x00072738
extern CAR_DATA* CheckForCar(LPPEDESTRIAN pedestrian); // 0x00072738
extern int CheckForPlayerCar(PEDESTRIAN *pedestrian, CAR_COLLISION_BOX *collision_box); // 0x000732C0
extern void CalculatePedestrianInterest(PEDESTRIAN *pPed); // 0x00071E0C
extern void CalculatePedestrianInterest(LPPEDESTRIAN pPed); // 0x00071E0C
#endif

View File

@ -247,7 +247,7 @@ void ChangePedPlayerToCar(int playerID, CAR_DATA *newCar)
void UpdatePlayers(void)
{
int i, carId;
PEDESTRIAN* ped;
LPPEDESTRIAN ped;
PLAYER* locPlayer;
CAR_DATA* cp;

View File

@ -5,6 +5,12 @@
extern TEXTURE_DETAILS digit_texture;
struct FONT_DIGIT
{
char xOffset;
char width;
};
FONT_DIGIT fontDigit[] = {
{ 2, 14 },
{ 17, 14},

View File

@ -1,6 +1,17 @@
#ifndef PRES_H
#define PRES_H
struct OUT_FONTINFO
{
u_char x;
u_char y;
char offx;
char offy;
u_char width;
u_char height;
u_short pad;
};
extern short fonttpage;
extern void InitButtonTextures(); // 0x00074E54

View File

@ -14,6 +14,18 @@
#include "mission.h"
#include "tile.h"
struct TYRE_TRACK
{
u_char type;
u_char shade;
u_char shade_type;
u_char surface;
SVECTOR_NOPAD p1;
SVECTOR_NOPAD p2;
SVECTOR_NOPAD p3;
SVECTOR_NOPAD p4;
};
int gShadowTexturePage;
int gShadowTextureNum;

View File

@ -24,6 +24,45 @@
#include "camera.h"
#include "dr2roads.h"
struct SPOOLQ
{
u_char type;
u_char data;
u_short nsectors;
u_int sector;
char* addr;
void (*func)();
#ifdef _DEBUG
const char* requestby;
int requestbyline;
#endif
};
struct SPL_REGIONINFO
{
u_short region_to_unpack;
u_short target_barrel_region;
int nsectors;
char* cell_addr;
char* roadm_addr;
};
struct AreaDataStr
{
u_short gfx_offset;
u_short model_offset;
u_short music_offset;
u_short ambient_offset;
u_char model_size;
u_char pad;
u_char num_tpages;
u_char ambient_size;
u_char music_size;
u_char music_samples_size;
u_char music_id;
u_char ambient_id;
};
int date_date = 0xA11;
int date_time = 0x27220B;

View File

@ -1,6 +1,18 @@
#ifndef SPOOL_H
#define SPOOL_H
struct Spool
{
u_short offset;
u_char connected_areas[2];
u_char pvs_size;
u_char cell_data_size[3];
u_char super_region;
u_char num_connected_areas;
u_char roadm_size;
u_char roadh_size;
};
extern int cell_objects_add[5];
extern int cell_slots_add[5];

View File

@ -1,6 +1,32 @@
#ifndef SYSTEM_H
#define SYSTEM_H
struct DRAW_MODE
{
short x1, y1;
short x2, y2;
short width, height;
short framex, framey;
};
enum CDTYPE
{
CDTYPE_NODISC = 0,
CDTYPE_SHELLOPEN = 1,
CDTYPE_DISCERROR = 2,
CDTYPE_WRONGDISC = 3,
CDTYPE_CORRECTDISC = 4,
};
enum CITYTYPE
{
CITYTYPE_DAY = 0,
CITYTYPE_NIGHT = 1,
CITYTYPE_MULTI_DAY = 2,
CITYTYPE_MULTI_NIGHT = 3,
};
extern volatile char* _overlay_buffer; // 0x1C0000
extern volatile char* _frontend_buffer; // 0xFB400
extern volatile char* _other_buffer; // 0xF3000

View File

@ -1,10 +1,10 @@
#include "driver2.h"
#include "tile.h"
#include "models.h"
#include "system.h"
#include "mission.h"
#include "draw.h"
#include "texture.h"
#include "tile.h"
#include "ASM/rndrasm.h"

View File

@ -1,6 +1,27 @@
#ifndef TILE_H
#define TILE_H
struct MVERTEX
{
short vx;
short vy;
short vz;
union {
short val;
struct {
u_char u0;
u_char v0;
}s;
}uv;
};
struct VERTEX
{
DVECTOR coord;
UV_INFO uv_coord;
u_char pad[2];
};
extern void DrawTILES(PACKED_CELL_OBJECT** tiles, int tile_amount); // 0x00041D7C
extern void Tile1x1(MODEL *model); // 0x00041B10

View File

@ -1,5 +1,6 @@
#include "driver2.h"
#include "C/system.h"
#include "C/pres.h"
#include "platform.h"
#ifndef PSX
@ -7,6 +8,7 @@
#include <malloc.h>
#endif
int gUserLanguage = 0;
char* gMisssionLanguageBuffer = NULL;

View File

@ -3,6 +3,13 @@
#include <abs.h>
struct MATRIX2
{
short m[3][3];
short computed;
char null[12];
};
#if defined(_LANGUAGE_C_PLUS_PLUS)||defined(__cplusplus)||defined(c_plusplus)
extern "C" {
#endif

View File

@ -260,19 +260,6 @@ struct CAR_MODEL
SVECTOR* nlist;
};
struct plotCarGlobals
{
u_char* primptr;
OTTYPE* ot;
u_int intensity;
u_short* pciv_clut;
u_int ShineyTPageASL16;
u_int ShineyClutASL16;
u_char* damageLevel;
u_char* shineyTable;
int ghost;
};
// UNUSED
struct TEX_INFO
{
@ -564,136 +551,6 @@ struct LEAD_PARAMETERS
int hWidth80Mul;
};
//---------------------------------------------------------------------------------------
// TODO: DR2EVENTS.H
typedef struct _EVENT EVENT;
struct _EVENT
{
VECTOR position;
short rotation;
short timer;
int* data;
int* node;
short flags;
short radius;
int model;
EVENT* next;
};
struct FixedEvent // same as EVENT but different fields
{
VECTOR position;
short rotation;
short active;
u_short initialRotation;
u_short finalRotation;
u_short minSpeed;
u_short maxSpeed;
short flags;
short radius;
int model;
EVENT* next;
char* modelName;
};
struct EventGlobal
{
int camera;
int draw;
EVENT** track;
EVENT* cameraEvent;
};
enum SpecialCamera
{
SPECIAL_CAMERA_SET = 0,
SPECIAL_CAMERA_SET2 = 1,
SPECIAL_CAMERA_RESET = 2,
SPECIAL_CAMERA_WAIT = 3,
};
struct MissionTrain
{
EVENT* engine;
int* node;
int cornerSpeed;
int initialStraightSpeed;
int finalStraightSpeed;
int start;
int startDir;
};
struct Foam
{
MODEL* model;
int rotate;
};
struct EventCarriage
{
short rotation;
short vel;
};
struct MultiCar
{
EVENT* event;
int count;
};
struct Helicopter
{
int speed;
short pitch;
short dp;
short roll;
short dr;
int lastX;
int lastZ;
TEXTURE_DETAILS rotorTexture;
short rotorrot;
short rotorvel;
int cleanModel;
int deadModel;
};
struct Detonator
{
int timer;
int count;
};
struct CameraDelay
{
int delay;
int type;
};
enum VisType
{
VIS_INIT = 0,
VIS_SORT = 1,
VIS_ADD = 2,
VIS_NEXT = 3,
};
struct EventCamera
{
VECTOR position;
short yAng;
MATRIX matrix;
int rotate;
};
enum Station
{
EVENT_NO_STATION = 0,
EVENT_APPROACHING = 1,
EVENT_LEAVING = 2,
};
//---------------------------------------------------------------------------------------
// TODO: MISSION.H
@ -957,12 +814,9 @@ enum MissionTimerFlags
struct MR_TIMER
{
short x;
short y;
short x, y;
u_char flags;
u_char min;
u_char sec;
u_char frac;
u_char min, sec, frac;
int count;
};
@ -1073,12 +927,14 @@ enum PED_MODEL_TYPES //: char
CIVILIAN = 3,
};
typedef void(*pedFunc)(struct PEDESTRIAN* pPed);
typedef struct PEDESTRIAN *LPPEDESTRIAN;
typedef void(*pedFunc)(LPPEDESTRIAN pPed);
typedef struct PEDESTRIAN
{
PEDESTRIAN* pNext;
PEDESTRIAN* pPrev;
LPPEDESTRIAN pNext;
LPPEDESTRIAN pPrev;
pedFunc fpRestState;
pedFunc fpAgitatedState;
char padId;
@ -1103,23 +959,6 @@ typedef struct PEDESTRIAN
char type;
} *LPPEDESTRIAN;
struct CAR_COLLISION_BOX
{
int min_x;
int max_x;
int min_z;
int max_z;
};
typedef struct SEATED_PEDESTRIANS
{
int x;
int z;
short rotation;
char index;
char pad;
} *SEATEDPTR;
typedef struct PEDESTRIAN_ROADS
{
short pos;
@ -1132,61 +971,6 @@ typedef struct PEDESTRIAN_ROADS
//---------------------------------------------------------------------------------------
// TODO: GAMESND.H
typedef struct __envsound
{
u_char type;
u_char flags;
VECTOR pos;
VECTOR pos2;
int bank;
int sample;
int vol;
} envsound;
typedef struct __envsoundtags
{
int frame_cnt;
int func_cnt;
int num_envsnds;
int envsnd_cnt;
} envsoundtags;
typedef struct __envsoundinfo
{
VECTOR eff_pos[4];
VECTOR cam_pos;
float g[4];
int thisS[4];
int playing_sound[4];
int chan[4];
u_int flags;
} envsoundinfo;
struct SPEECH_QUEUE
{
char allowed;
char chan;
char is_playing;
int count;
char reverb;
int slot[7];
};
typedef struct __othercarsound
{
int car;
int chan;
char in_use;
char stopped;
char idle;
} othercarsound;
typedef struct __bitfield64
{
int h;
int l;
} bitfield64;
typedef struct __skidinfo
{
char chan;
@ -1200,75 +984,6 @@ typedef struct __horninfo
char request;
} horninfo;
//---------------------------------------------------------------------------------------
// TODO: ANIMOBJ.H
struct CYCLE_OBJECT
{
char* name;
short vx;
short vy;
short start1;
short stop1;
short speed1;
short start2;
short stop2;
short speed2;
};
//---------------------------------------------------------------------------------------
// TODO: OVERLAY.H
struct COLOUR_BAND
{
CVECTOR colour;
int value;
int flags;
};
typedef struct _PERCENTAGE_BAR
{
char* tag;
short xpos;
short ypos;
short width;
short height;
u_short position;
u_short max;
COLOUR_BAND* pColourBand;
int flags;
int active;
} PERCENTAGE_BAR, *LPPERCENTAGE_BAR;
//---------------------------------------------------------------------------------------
// TODO: OVERMAP.H
struct COP_SIGHT_DATA
{
short surroundViewDistance;
short frontViewDistance;
short frontViewAngle;
};
struct MAPTEX
{
short u;
short w;
short v;
short h;
};
struct OVERMAP
{
int x_offset;
int y_offset;
int width;
int height;
u_char toptile;
u_char dummy;
int scale;
};
//---------------------------------------------------------------------------------------
// TODO: CHEATS.H
@ -1399,35 +1114,6 @@ struct PLAYBACKCAMERA
u_char idx;
};
//---------------------------------------------------------------------------------------
// TODO: CUTSCENE.H
struct CUTSCENE_BUFFER
{
int numResident;
u_char residentCutscenes[4];
char(*residentPointers[4]);
char* buffer;
char* currentPointer;
int bytesFree;
int reservedSize;
// char buffer[32*1024]; // was 8192, but we have some free mem now even for PSX. Using malloc.
};
struct CUTSCENE_INFO
{
u_short offset;
u_short size;
};
struct CUTSCENE_HEADER
{
int maxsize;
CUTSCENE_INFO data[15];
};
//---------------------------------------------------------------------------------------
// TODO: COP_AI.H
@ -1450,7 +1136,7 @@ struct ADJACENT_ROAD_INFO
};
// only "status" is used
struct ROADBLOCK // [A] causes undefined behaviour
struct ROADBLOCK
{
VECTOR position;
ADJACENT_ROAD_INFO adjacentRoadInfo;
@ -1613,17 +1299,6 @@ typedef struct _PLAYER
//---------------------------------------------------------------------------------------
// TODO: AI.H
typedef struct _EXTRA_CIV_DATA
{
int surfInd;
int distAlongSegment;
short angle;
u_short ctrlState;
int thrustState;
u_char palette;
u_char controlFlags;
} EXTRA_CIV_DATA;
struct COP_DATA
{
int autoMaxPowerScaleLimit;
@ -1637,143 +1312,6 @@ struct COP_DATA
short trigger[5];
};
enum AIZone
{
zoneFrnt = 0,
zoneBack = 1,
zoneLeft = 2,
zoneRght = 3,
};
//---------------------------------------------------------------------------------------
// TODO: DRAW.H
// Primitive plot context used in scratchpad
struct _pct
{
struct DB* current;
u_short(*ptexture_pages)[128];
u_short(*ptexture_cluts)[128][32];
int f4colourTable[32];
int* polySizes;
char* primptr;
OTTYPE* ot;
u_int clut;
u_int tpage;
u_int colour;
int flags;
SVECTOR* verts;
u_int lastTexInfo;
int scribble[8];
int model;
};
struct MATRIX2
{
short m[3][3];
short computed;
char null[12];
};
struct MVERTEX
{
short vx;
short vy;
short vz;
union {
short val;
struct {
u_char u0;
u_char v0;
}s;
}uv;
};
struct MVERTEX5x5
{
MVERTEX verts[5][5];
};
struct VERTEX
{
DVECTOR coord;
UV_INFO uv_coord;
u_char pad[2];
};
//---------------------------------------------------------------------------------------
// TODO: SPOOL.H
struct Spool
{
u_short offset;
u_char connected_areas[2];
u_char pvs_size;
u_char cell_data_size[3];
u_char super_region;
u_char num_connected_areas;
u_char roadm_size;
u_char roadh_size;
};
struct SPOOLQ
{
u_char type;
u_char data;
u_short nsectors;
u_int sector;
char* addr;
void (*func)();
#ifdef _DEBUG
const char* requestby;
int requestbyline;
#endif
};
struct SPL_REGIONINFO
{
u_short region_to_unpack;
u_short target_barrel_region;
int nsectors;
char* cell_addr;
char* roadm_addr;
};
struct AreaDataStr
{
u_short gfx_offset;
u_short model_offset;
u_short music_offset;
u_short ambient_offset;
u_char model_size;
u_char pad;
u_char num_tpages;
u_char ambient_size;
u_char music_size;
u_char music_samples_size;
u_char music_id;
u_char ambient_id;
};
//---------------------------------------------------------------------------------------
// TODO: FMV.H
struct RENDER_ARG
{
u_char render;
u_char credits;
u_short recap;
};
struct RENDER_ARGS
{
u_char nRenders;
u_char subtitle;
char screenx;
char screeny;
RENDER_ARG Args[4];
};
//---------------------------------------------------------------------------------------
// TODO: GLAUNCH.H
@ -1808,206 +1346,4 @@ enum GAMEMODE
GAMEMODE_DEMO = 6,
};
struct MISSION_STEP
{
u_char flags : 3;
u_char recap : 5;
u_char data : 7;
u_char disc : 1;
};
//---------------------------------------------------------------------------------------
// TODO: PAUSE.H
enum EXIT_VALUE
{
MENU_QUIT_NONE = 0,
MENU_QUIT_CONTINUE = 1,
MENU_QUIT_QUIT = 2,
MENU_QUIT_RESTART = 3,
MENU_QUIT_DIRECTOR = 4,
MENU_QUIT_QUICKREPLAY = 5,
MENU_QUIT_BACKMENU = 6,
MENU_QUIT_NEXTMISSION = 7,
};
typedef void(*pauseFunc)(int dir);
struct MENU_ITEM;
struct MENU_HEADER;
struct MENU_ITEM
{
char* Text;
u_char Type;
u_char Justify;
pauseFunc func;
EXIT_VALUE ExitValue;
MENU_HEADER* SubMenu;
};
struct MENU_HEADER
{
char* Title;
XYWH Bound;
u_char NumItems;
MENU_ITEM* MenuItems;
};
//---------------------------------------------------------------------------------------
// TODO: PRES.H
struct OUT_FONTINFO
{
u_char x;
u_char y;
char offx;
char offy;
u_char width;
u_char height;
u_short pad;
};
struct FONT_DIGIT
{
char xOffset;
char width;
};
struct SHADOWHDR
{
u_int num_common_verts;
u_short num_verts_total;
u_short num_polys_total;
u_short vert_offsets[4];
u_short nverts[4];
u_short npolys[4];
u_int(*poly_block[4]);
SVECTOR* vertices;
};
//---------------------------------------------------------------------------------------
// TODO: SHADOW.H
struct TYRE_TRACK
{
u_char type;
u_char shade;
u_char shade_type;
u_char surface;
SVECTOR_NOPAD p1;
SVECTOR_NOPAD p2;
SVECTOR_NOPAD p3;
SVECTOR_NOPAD p4;
};
//---------------------------------------------------------------------------------------
// TODO: SYSTEM.H
struct DRAW_MODE
{
short x1;
short y1;
short x2;
short y2;
short width;
short height;
short framex;
short framey;
};
enum CDTYPE
{
CDTYPE_NODISC = 0,
CDTYPE_SHELLOPEN = 1,
CDTYPE_DISCERROR = 2,
CDTYPE_WRONGDISC = 3,
CDTYPE_CORRECTDISC = 4,
};
enum CITYTYPE
{
CITYTYPE_DAY = 0,
CITYTYPE_NIGHT = 1,
CITYTYPE_MULTI_DAY = 2,
CITYTYPE_MULTI_NIGHT = 3,
};
//---------------------------------------------------------------------------------------
// TODO: PAD.H
struct DUPLICATION
{
char* buffer;
int size;
};
typedef struct MAPPING
{
u_short button_lookup[16];
u_short swap_analog;
u_short reserved1;
} *LPMAPPING;
typedef struct PAD
{
u_char active;
u_char type;
u_char dualshock;
u_char reserved1;
u_short direct;
u_short dirnew;
char diranalog[4];
u_short mapped;
u_short mapnew;
char mapanalog[4];
MAPPING mappings;
u_char alarmShakeCounter;
u_char asd;
u_char sdf;
u_char dfg;
u_char delay;
u_char port;
u_char state;
u_char dsactive;
u_char* shakeptr;
u_char motors[2];
u_char shake_type;
u_char vibrate;
} *LPPAD;
//---------------------------------------------------------------------------------------
// TODO: LOADSAVE.H
struct GAME_SAVE_HEADER
{
u_int magic;
u_char gMissionLadderPos;
u_char pad1;
u_char pad2;
u_char pad3;
MISSION_DATA SavedData;
int reserved[8];
};
struct CONFIG_SAVE_HEADER
{
u_int magic;
int gMasterVolume;
int gMusicVolume;
int gSoundMode;
int gVibration;
int gCopDifficultyLevel;
int gFurthestMission;
MAPPING PadMapping[2];
SCORE_TABLES ScoreTables;
int PALAdjustX;
int PALAdjustY;
int NTSCAdjustX;
int NTSCAdjustY;
int gSubtitles;
ACTIVE_CHEATS AvailableCheats;
int reserved[6];
};
#endif // DR2TYPES_H

View File

@ -62,6 +62,18 @@ struct COLLISION_PACKET
short xsize, ysize, zsize;
};
struct SHADOWHDR
{
u_int num_common_verts;
u_short num_verts_total;
u_short num_polys_total;
u_short vert_offsets[4];
u_short nverts[4];
u_short npolys[4];
u_int(*poly_block[4]);
SVECTOR* vertices;
};
struct RGB // almost same as CVECTOR
{
u_char r;

View File

@ -10,6 +10,7 @@
#include "C/system.h"
#include "C/E3stuff.h"
#include "C/fmv_font.h"
#include "C/fmvplay.h"
#include <AL/al.h>
#include <jpeglib.h>