- better demo content support

This commit is contained in:
Ilya Shurumov 2021-04-11 18:42:27 +06:00
parent 3b9aab5002
commit 1e0e80d68f
3 changed files with 50 additions and 6 deletions

View File

@ -287,7 +287,7 @@ void ProcessLumps(char* lump_ptr, int lump_size)
cnt++;
}
gDemoLevel = false; // [A]
gDemoLevel = 0; // [A]
}
else if (lump_type == LUMP_JUNCTIONS2)
{
@ -306,6 +306,7 @@ void ProcessLumps(char* lump_ptr, int lump_size)
}
gDemoLevel = 1; // [A]
gLoadedMotionCapture = 0;
}
else if (lump_type == LUMP_JUNCTIONS)
{

View File

@ -1,5 +1,6 @@
#include "driver2.h"
#include "mission.h"
#include "system.h"
#include "mgeneric.h"
#include "debris.h"
@ -2693,7 +2694,7 @@ int MRCreateCar(MS_TARGET *target)
{
playerid = 0xFF;
InitPlayer((PLAYER *)(player + 1), &car_data[curslot],
InitPlayer(&player[1], &car_data[curslot],
CONTROL_TYPE_LEAD_AI, target->s.car.rotation, &pos,
target->s.car.model, target->s.car.palette, (char *)&playerid);

View File

@ -45,9 +45,9 @@ struct PSXBUTTON
struct PSXSCREEN
{
unsigned char index;
unsigned char numButtons;
unsigned char userFunctionNum;
u_char index;
u_char numButtons;
u_char userFunctionNum;
PSXBUTTON buttons[8];
};
@ -118,6 +118,7 @@ extern int GameNameScreen(int bSetup); // 0x001C60A0
extern int CheatNumlayerSelect(int bSetup); // 0x001C6724
extern int UserReplaySelectScreen(int bSetup);
extern int TimeOfDaySelectScreen(int bSetup);
extern int DemoScreen(int bSetup);
screenFunc fpUserFunctions[] = {
CentreScreen,
@ -142,6 +143,7 @@ screenFunc fpUserFunctions[] = {
CheatNumlayerSelect,
UserReplaySelectScreen,
TimeOfDaySelectScreen,
DemoScreen,
};
char* gfxNames[4] = {
@ -637,7 +639,7 @@ void SetupScreenSprts(PSXSCREEN *pScr)
pNewScreen = NULL;
pCurrScreen = pScr;
if (pScr->userFunctionNum == 0)
if (pScr->userFunctionNum == 0 || pScr->userFunctionNum == 128)
{
if (pNewButton != NULL)
{
@ -1122,6 +1124,11 @@ void LoadFrontendScreens(int full)
}
#ifndef PSX
if(PsxScreens[0].userFunctionNum == 128)
{
PsxScreens[0].userFunctionNum = 23;
}
// [A] SCREEN HACKS
// replay theater
// use screen 39 for it
@ -3873,5 +3880,40 @@ int TimeOfDaySelectScreen(int bSetup)
dir = 0;
}
return 0;
}
int DemoScreen(int bSetup)
{
if (bSetup)
return 0;
if (feNewPad & 0x40)
{
FESound(2);
GameType = GAME_PURSUIT;
GameLevel = 1;
gWantNight = 0;
gSubGameNumber = 0;
GameStart();
return 0;
}
if(mainScreenLoaded)
{
if (feNewPad & 0x20)
{
LoadBackgroundFile(contNames[0]);
FESound(2);
}
}
else if(bQuitToSystem)
{
bQuitToSystem = 0;
LoadBackgroundFile("DATA\\GFX.RAW");
}
return 0;
}