mirror of
https://github.com/OpenDriver2/REDRIVER2.git
synced 2024-11-22 10:22:48 +01:00
- support randomized attract replays
- don't forget to init user replays
This commit is contained in:
parent
44355fd68a
commit
dd4daea020
@ -12,6 +12,7 @@
|
||||
#include "CIV_AI.H"
|
||||
|
||||
#include "STRINGS.H"
|
||||
#include "RAND.H"
|
||||
|
||||
char AnalogueUnpack[16] = {
|
||||
0, -51, -63, -75, -87, -99, -111, -123,
|
||||
@ -616,7 +617,34 @@ int LoadAttractReplay(int mission)
|
||||
{
|
||||
char filename[32];
|
||||
|
||||
#ifndef PSX
|
||||
int userFolderId;
|
||||
|
||||
// [A] REDRIVER2 PC - custom attract replays
|
||||
if (gNumUserChases)
|
||||
{
|
||||
userFolderId = rand() % (gNumUserChases + 1);
|
||||
|
||||
if (userFolderId == gNumUserChases)
|
||||
userFolderId = -1;
|
||||
|
||||
if (userFolderId >= 0)
|
||||
{
|
||||
// optional randomization
|
||||
sprintf(filename, "REPLAYS\\ATTRACT.%d.%s", mission, gUserReplayFolderList[userFolderId]);
|
||||
|
||||
if (!FileExists(filename))
|
||||
userFolderId = -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
userFolderId = -1;
|
||||
|
||||
if(userFolderId == -1)
|
||||
sprintf(filename,"REPLAYS\\ATTRACT.%d", mission);
|
||||
#else
|
||||
sprintf(filename,"REPLAYS\\ATTRACT.%d", mission);
|
||||
#endif
|
||||
|
||||
if (!FileExists(filename))
|
||||
return 0;
|
||||
|
@ -15,6 +15,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <SDL_scancode.h>
|
||||
|
||||
#include "C/CUTSCENE.H"
|
||||
|
||||
|
||||
// eq engine console output
|
||||
@ -412,6 +413,9 @@ int main(int argc, char** argv)
|
||||
if (config)
|
||||
{
|
||||
const char* dataFolderStr = ini_get(config, "fs", "dataFolder");
|
||||
const char* userReplaysStr = ini_get(config, "game", "userChases");
|
||||
|
||||
InitUserReplays(userReplaysStr);
|
||||
|
||||
ini_sget(config, "render", "windowWidth", "%d", &windowWidth);
|
||||
ini_sget(config, "render", "windowHeight", "%d", &windowHeight);
|
||||
@ -422,7 +426,6 @@ int main(int argc, char** argv)
|
||||
ini_sget(config, "game", "drawDistance", "%d", &gDrawDistance);
|
||||
ini_sget(config, "game", "freeCamera", "%d", &enableFreecamera);
|
||||
ini_sget(config, "game", "driver1music", "%d", &gDriver1Music);
|
||||
|
||||
|
||||
if (dataFolderStr)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user