mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-12 11:10:39 +00:00
- various initialization related changes
* reroute several error conditions to I_Error. * removed some soon-to-be obsolete GRP loading code. * explicitly trigger the SetDefaults script events which depended on side effects from the config implementation. * removed the nonsensical file system switch. All this does is create instabilities because it is non-obvious from where data is loaded. If a resource is mounted, it should be checked for content no matter what. While this may affect the stray weird mod out there it is a necessity if we want to allow transparent project repackaging.
This commit is contained in:
parent
39bfd64fe9
commit
8d5e665caa
20 changed files with 24 additions and 272 deletions
|
@ -459,9 +459,6 @@ void ParseScript(const char *scriptFileName)
|
||||||
char inp[BMAX_PATH];
|
char inp[BMAX_PATH];
|
||||||
char zScriptDirectory[BMAX_PATH], zTemp1[BMAX_PATH], zTemp2[BMAX_PATH];
|
char zScriptDirectory[BMAX_PATH], zTemp1[BMAX_PATH], zTemp2[BMAX_PATH];
|
||||||
|
|
||||||
int const bakpathsearchmode = pathsearchmode;
|
|
||||||
pathsearchmode = 1;
|
|
||||||
|
|
||||||
SplitPath(scriptFileName, zScriptDirectory, zTemp1, zTemp2);
|
SplitPath(scriptFileName, zScriptDirectory, zTemp1, zTemp2);
|
||||||
|
|
||||||
RFS rfs;
|
RFS rfs;
|
||||||
|
@ -469,7 +466,6 @@ void ParseScript(const char *scriptFileName)
|
||||||
// AddExtension(name, ".RFS");
|
// AddExtension(name, ".RFS");
|
||||||
if (rfs.Open(scriptFileName))
|
if (rfs.Open(scriptFileName))
|
||||||
{
|
{
|
||||||
pathsearchmode = bakpathsearchmode;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -882,7 +878,6 @@ void ParseScript(const char *scriptFileName)
|
||||||
|
|
||||||
//CreateHeader();
|
//CreateHeader();
|
||||||
rfs.Close();
|
rfs.Close();
|
||||||
pathsearchmode = bakpathsearchmode;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void sub_11C10(char *pzScriptDir, char *fileName, char flags, int ID)
|
void sub_11C10(char *pzScriptDir, char *fileName, char flags, int ID)
|
||||||
|
|
|
@ -1253,17 +1253,11 @@ int app_main()
|
||||||
bQuickStart = userConfig.nologo;
|
bQuickStart = userConfig.nologo;
|
||||||
ParseOptions();
|
ParseOptions();
|
||||||
|
|
||||||
#ifdef STARTUP_SETUP_WINDOW
|
|
||||||
int const readSetup =
|
|
||||||
#endif
|
|
||||||
CONFIG_ReadSetup();
|
CONFIG_ReadSetup();
|
||||||
|
|
||||||
if (enginePreInit())
|
if (enginePreInit())
|
||||||
{
|
{
|
||||||
wm_msgbox("Build Engine Initialization Error",
|
I_Error("app_main: There was a problem initializing the Build engine: %s\n", engineerrstr);
|
||||||
"There was a problem initializing the Build engine: %s", engineerrstr);
|
|
||||||
ERRprintf("app_main: There was a problem initializing the Build engine: %s\n", engineerrstr);
|
|
||||||
Bexit(2);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ScanINIFiles();
|
ScanINIFiles();
|
||||||
|
@ -1784,21 +1778,11 @@ static int parsedefinitions_game(scriptfile *pScript, int firstPass)
|
||||||
{
|
{
|
||||||
char *fileName;
|
char *fileName;
|
||||||
|
|
||||||
pathsearchmode = 1;
|
|
||||||
if (!scriptfile_getstring(pScript,&fileName) && firstPass)
|
if (!scriptfile_getstring(pScript,&fileName) && firstPass)
|
||||||
{
|
{
|
||||||
if (initgroupfile(fileName) == -1)
|
fileSystem.AddAdditionalFile(fileName);
|
||||||
initprintf("Could not find file \"%s\".\n", fileName);
|
|
||||||
else
|
|
||||||
{
|
|
||||||
initprintf("Using file \"%s\" as game data.\n", fileName);
|
|
||||||
if (G_AllowAutoload())
|
|
||||||
G_DoAutoload(fileName);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pathsearchmode = 0;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case T_CACHESIZE:
|
case T_CACHESIZE:
|
||||||
{
|
{
|
||||||
|
|
|
@ -170,33 +170,6 @@ void G_LoadGroups()
|
||||||
|
|
||||||
loaddefinitions_game(BLOODWIDESCREENDEF, TRUE);
|
loaddefinitions_game(BLOODWIDESCREENDEF, TRUE);
|
||||||
loaddefinitions_game(G_DefFile(), TRUE);
|
loaddefinitions_game(G_DefFile(), TRUE);
|
||||||
|
|
||||||
struct strllist *s;
|
|
||||||
|
|
||||||
int const bakpathsearchmode = pathsearchmode;
|
|
||||||
pathsearchmode = 1;
|
|
||||||
|
|
||||||
while (CommandGrps)
|
|
||||||
{
|
|
||||||
int32_t j;
|
|
||||||
|
|
||||||
s = CommandGrps->next;
|
|
||||||
|
|
||||||
if ((j = initgroupfile(CommandGrps->str)) == -1)
|
|
||||||
initprintf("Could not find file \"%s\".\n", CommandGrps->str);
|
|
||||||
else
|
|
||||||
{
|
|
||||||
g_groupFileHandle = j;
|
|
||||||
initprintf("Using file \"%s\" as game data.\n", CommandGrps->str);
|
|
||||||
if (G_AllowAutoload())
|
|
||||||
G_DoAutoload(CommandGrps->str);
|
|
||||||
}
|
|
||||||
|
|
||||||
Bfree(CommandGrps->str);
|
|
||||||
Bfree(CommandGrps);
|
|
||||||
CommandGrps = s;
|
|
||||||
}
|
|
||||||
pathsearchmode = bakpathsearchmode;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////
|
//////////
|
||||||
|
|
|
@ -50,7 +50,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
BEGIN_BLD_NS
|
BEGIN_BLD_NS
|
||||||
|
|
||||||
|
|
||||||
int32_t setupread;
|
|
||||||
int32_t mus_restartonload;
|
int32_t mus_restartonload;
|
||||||
int32_t gTurnSpeed;
|
int32_t gTurnSpeed;
|
||||||
int32_t gDetail;
|
int32_t gDetail;
|
||||||
|
@ -127,15 +126,7 @@ void CONFIG_SetDefaults(void)
|
||||||
int CONFIG_ReadSetup(void)
|
int CONFIG_ReadSetup(void)
|
||||||
{
|
{
|
||||||
CONFIG_SetDefaults();
|
CONFIG_SetDefaults();
|
||||||
|
|
||||||
setupread = 1;
|
|
||||||
pathsearchmode = 1;
|
|
||||||
|
|
||||||
pathsearchmode = 0;
|
|
||||||
|
|
||||||
if (ScreenBPP < 8) ScreenBPP = 32;
|
if (ScreenBPP < 8) ScreenBPP = 32;
|
||||||
|
|
||||||
setupread = 1;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,6 @@ BEGIN_BLD_NS
|
||||||
|
|
||||||
#define MAXPLAYERNAME 16
|
#define MAXPLAYERNAME 16
|
||||||
|
|
||||||
extern int32_t setupread;
|
|
||||||
extern int32_t gTurnSpeed;
|
extern int32_t gTurnSpeed;
|
||||||
extern int32_t gDetail;
|
extern int32_t gDetail;
|
||||||
extern int32_t gAutoRun;
|
extern int32_t gAutoRun;
|
||||||
|
|
|
@ -645,9 +645,6 @@ unsigned int dbReadMapCRC(const char *pPath)
|
||||||
byte_1A76C7 = 0;
|
byte_1A76C7 = 0;
|
||||||
byte_1A76C8 = 0;
|
byte_1A76C8 = 0;
|
||||||
|
|
||||||
int const bakpathsearchmode = pathsearchmode;
|
|
||||||
pathsearchmode = 1;
|
|
||||||
|
|
||||||
Bstrncpy(name2, pPath, BMAX_PATH);
|
Bstrncpy(name2, pPath, BMAX_PATH);
|
||||||
Bstrupr(name2);
|
Bstrupr(name2);
|
||||||
DICTNODE* pNode;
|
DICTNODE* pNode;
|
||||||
|
@ -663,11 +660,9 @@ unsigned int dbReadMapCRC(const char *pPath)
|
||||||
if (!pNode)
|
if (!pNode)
|
||||||
{
|
{
|
||||||
initprintf("Error opening map file %s", pPath);
|
initprintf("Error opening map file %s", pPath);
|
||||||
pathsearchmode = bakpathsearchmode;
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
char *pData = (char*)gSysRes.Lock(pNode);
|
char *pData = (char*)gSysRes.Lock(pNode);
|
||||||
pathsearchmode = bakpathsearchmode;
|
|
||||||
|
|
||||||
int nSize = pNode->Size();
|
int nSize = pNode->Size();
|
||||||
MAPSIGNATURE header;
|
MAPSIGNATURE header;
|
||||||
|
@ -712,9 +707,6 @@ int dbLoadMap(const char *pPath, int *pX, int *pY, int *pZ, short *pAngle, short
|
||||||
Polymost_prepare_loadboard();
|
Polymost_prepare_loadboard();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int const bakpathsearchmode = pathsearchmode;
|
|
||||||
pathsearchmode = 1;
|
|
||||||
|
|
||||||
Bstrncpy(name2, pPath, BMAX_PATH);
|
Bstrncpy(name2, pPath, BMAX_PATH);
|
||||||
Bstrupr(name2);
|
Bstrupr(name2);
|
||||||
DICTNODE* pNode;
|
DICTNODE* pNode;
|
||||||
|
@ -731,11 +723,9 @@ int dbLoadMap(const char *pPath, int *pX, int *pY, int *pZ, short *pAngle, short
|
||||||
if (!pNode)
|
if (!pNode)
|
||||||
{
|
{
|
||||||
initprintf("Error opening map file %s", pPath);
|
initprintf("Error opening map file %s", pPath);
|
||||||
pathsearchmode = bakpathsearchmode;
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
char *pData = (char*)gSysRes.Lock(pNode);
|
char *pData = (char*)gSysRes.Lock(pNode);
|
||||||
pathsearchmode = bakpathsearchmode;
|
|
||||||
int nSize = pNode->Size();
|
int nSize = pNode->Size();
|
||||||
MAPSIGNATURE header;
|
MAPSIGNATURE header;
|
||||||
IOBuffer IOBuffer1 = IOBuffer(nSize, pData);
|
IOBuffer IOBuffer1 = IOBuffer(nSize, pData);
|
||||||
|
|
|
@ -426,9 +426,7 @@ void CDemo::StopPlayback(void)
|
||||||
void CDemo::LoadDemoInfo(void)
|
void CDemo::LoadDemoInfo(void)
|
||||||
{
|
{
|
||||||
auto pDemo = &pFirstDemo;
|
auto pDemo = &pFirstDemo;
|
||||||
const int opsm = pathsearchmode;
|
|
||||||
at59ef = 0;
|
at59ef = 0;
|
||||||
pathsearchmode = 0;
|
|
||||||
char zFN[BMAX_PATH];
|
char zFN[BMAX_PATH];
|
||||||
Bsnprintf(zFN, BMAX_PATH, "%s*.dem", BloodIniPre);
|
Bsnprintf(zFN, BMAX_PATH, "%s*.dem", BloodIniPre);
|
||||||
auto pList = klistpath("/", zFN, BUILDVFS_FIND_FILE);
|
auto pList = klistpath("/", zFN, BUILDVFS_FIND_FILE);
|
||||||
|
@ -455,7 +453,6 @@ void CDemo::LoadDemoInfo(void)
|
||||||
pIterator = pIterator->next;
|
pIterator = pIterator->next;
|
||||||
}
|
}
|
||||||
klistfree(pList);
|
klistfree(pList);
|
||||||
pathsearchmode = opsm;
|
|
||||||
pCurrentDemo = pFirstDemo;
|
pCurrentDemo = pFirstDemo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -82,6 +82,7 @@ public:
|
||||||
|
|
||||||
int InitMultipleFiles (TArray<FString> &filenames, const TArray<FString> &todelete);
|
int InitMultipleFiles (TArray<FString> &filenames, const TArray<FString> &todelete);
|
||||||
void AddFile (const char *filename, FileReader *wadinfo = NULL);
|
void AddFile (const char *filename, FileReader *wadinfo = NULL);
|
||||||
|
void AddAdditionalFile(const char* filename, FileReader* wadinfo = NULL) {}
|
||||||
int CheckIfResourceFileLoaded (const char *name) noexcept;
|
int CheckIfResourceFileLoaded (const char *name) noexcept;
|
||||||
|
|
||||||
const char *GetResourceFileName (int filenum) const noexcept;
|
const char *GetResourceFileName (int filenum) const noexcept;
|
||||||
|
|
|
@ -285,33 +285,6 @@ void G_LoadGroups()
|
||||||
|
|
||||||
|
|
||||||
loaddefinitions_game(G_DefFile(), TRUE);
|
loaddefinitions_game(G_DefFile(), TRUE);
|
||||||
|
|
||||||
struct strllist *s;
|
|
||||||
|
|
||||||
int const bakpathsearchmode = pathsearchmode;
|
|
||||||
pathsearchmode = 1;
|
|
||||||
|
|
||||||
while (CommandGrps)
|
|
||||||
{
|
|
||||||
int32_t j;
|
|
||||||
|
|
||||||
s = CommandGrps->next;
|
|
||||||
|
|
||||||
if ((j = initgroupfile(CommandGrps->str)) == -1)
|
|
||||||
initprintf("Could not find file \"%s\".\n", CommandGrps->str);
|
|
||||||
else
|
|
||||||
{
|
|
||||||
g_groupFileHandle = j;
|
|
||||||
initprintf("Using file \"%s\" as game data.\n", CommandGrps->str);
|
|
||||||
if (G_AllowAutoload())
|
|
||||||
G_DoAutoload(CommandGrps->str);
|
|
||||||
}
|
|
||||||
|
|
||||||
Xfree(CommandGrps->str);
|
|
||||||
Xfree(CommandGrps);
|
|
||||||
CommandGrps = s;
|
|
||||||
}
|
|
||||||
pathsearchmode = bakpathsearchmode;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -113,9 +113,6 @@ void CONFIG_SetDefaults(void)
|
||||||
ud.m_player_skill = ud.player_skill = 2;
|
ud.m_player_skill = ud.player_skill = 2;
|
||||||
memcpy(g_player[0].wchoice, "\3\4\5\7\0x8\6\0\2\0x9\1", 10);
|
memcpy(g_player[0].wchoice, "\3\4\5\7\0x8\6\0\2\0x9\1", 10);
|
||||||
wchoice.Callback();
|
wchoice.Callback();
|
||||||
|
|
||||||
|
|
||||||
VM_OnEvent(EVENT_SETDEFAULTS, g_player[myconnectindex].ps->i, myconnectindex);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -124,13 +121,7 @@ void CONFIG_SetDefaults(void)
|
||||||
int CONFIG_ReadSetup(void)
|
int CONFIG_ReadSetup(void)
|
||||||
{
|
{
|
||||||
CONFIG_SetDefaults();
|
CONFIG_SetDefaults();
|
||||||
|
|
||||||
ud.config.setupread = 1;
|
|
||||||
pathsearchmode = 0;
|
|
||||||
|
|
||||||
if (ScreenBPP < 8) ScreenBPP = 32;
|
if (ScreenBPP < 8) ScreenBPP = 32;
|
||||||
|
|
||||||
ud.config.setupread = 1;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,6 +45,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
#include "gamecvars.h"
|
#include "gamecvars.h"
|
||||||
#include "gameconfigfile.h"
|
#include "gameconfigfile.h"
|
||||||
#include "printf.h"
|
#include "printf.h"
|
||||||
|
#include "filesystem/filesystem.h"
|
||||||
|
|
||||||
#include "vfs.h"
|
#include "vfs.h"
|
||||||
|
|
||||||
|
@ -5297,21 +5298,11 @@ static int parsedefinitions_game(scriptfile *pScript, int firstPass)
|
||||||
{
|
{
|
||||||
char *fileName;
|
char *fileName;
|
||||||
|
|
||||||
pathsearchmode = 1;
|
|
||||||
if (!scriptfile_getstring(pScript,&fileName) && firstPass)
|
if (!scriptfile_getstring(pScript,&fileName) && firstPass)
|
||||||
{
|
{
|
||||||
if (initgroupfile(fileName) == -1)
|
fileSystem.AddAdditionalFile(fileName);
|
||||||
initprintf("Could not find file \"%s\".\n", fileName);
|
|
||||||
else
|
|
||||||
{
|
|
||||||
initprintf("Using file \"%s\" as game data.\n", fileName);
|
|
||||||
if (G_AllowAutoload())
|
|
||||||
G_DoAutoload(fileName);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pathsearchmode = 0;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case T_CACHESIZE:
|
case T_CACHESIZE:
|
||||||
{
|
{
|
||||||
|
@ -5767,8 +5758,6 @@ void G_Shutdown(void)
|
||||||
static void G_CompileScripts(void)
|
static void G_CompileScripts(void)
|
||||||
{
|
{
|
||||||
#if !defined LUNATIC
|
#if !defined LUNATIC
|
||||||
int32_t psm = pathsearchmode;
|
|
||||||
|
|
||||||
label = (char *)&sprite[0]; // V8: 16384*44/64 = 11264 V7: 4096*44/64 = 2816
|
label = (char *)&sprite[0]; // V8: 16384*44/64 = 11264 V7: 4096*44/64 = 2816
|
||||||
labelcode = (int32_t *)§or[0]; // V8: 4096*40/4 = 40960 V7: 1024*40/4 = 10240
|
labelcode = (int32_t *)§or[0]; // V8: 4096*40/4 = 40960 V7: 1024*40/4 = 10240
|
||||||
labeltype = (int32_t *)&wall[0]; // V8: 16384*32/4 = 131072 V7: 8192*32/4 = 65536
|
labeltype = (int32_t *)&wall[0]; // V8: 16384*32/4 = 131072 V7: 8192*32/4 = 65536
|
||||||
|
@ -5778,9 +5767,6 @@ static void G_CompileScripts(void)
|
||||||
Gv_Init();
|
Gv_Init();
|
||||||
C_InitProjectiles();
|
C_InitProjectiles();
|
||||||
#else
|
#else
|
||||||
// if we compile for a V7 engine wall[] should be used for label names since it's bigger
|
|
||||||
pathsearchmode = 1;
|
|
||||||
|
|
||||||
C_Compile(G_ConFile());
|
C_Compile(G_ConFile());
|
||||||
|
|
||||||
if (g_loadFromGroupOnly) // g_loadFromGroupOnly is true only when compiling fails and internal defaults are utilized
|
if (g_loadFromGroupOnly) // g_loadFromGroupOnly is true only when compiling fails and internal defaults are utilized
|
||||||
|
@ -5806,7 +5792,6 @@ static void G_CompileScripts(void)
|
||||||
Bmemset(wall, 0, MAXWALLS*sizeof(walltype));
|
Bmemset(wall, 0, MAXWALLS*sizeof(walltype));
|
||||||
|
|
||||||
VM_OnEvent(EVENT_INIT);
|
VM_OnEvent(EVENT_INIT);
|
||||||
pathsearchmode = psm;
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6173,30 +6158,6 @@ void app_crashhandler(void)
|
||||||
G_GameQuit();
|
G_GameQuit();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(_WIN32) && defined(DEBUGGINGAIDS)
|
|
||||||
// See FILENAME_CASE_CHECK in cache1d.c
|
|
||||||
static int32_t check_filename_casing(void)
|
|
||||||
{
|
|
||||||
return !(g_player[myconnectindex].ps->gm & MODE_GAME);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef LUNATIC
|
|
||||||
const char *g_sizes_of_what[] = {
|
|
||||||
"sectortype", "walltype", "spritetype", "spriteext_t",
|
|
||||||
"actor_t", "DukePlayer_t", "playerdata_t",
|
|
||||||
"user_defs", "tiledata_t", "weapondata_t",
|
|
||||||
"projectile_t",
|
|
||||||
};
|
|
||||||
int32_t g_sizes_of[] = {
|
|
||||||
sizeof(sectortype), sizeof(walltype), sizeof(spritetype), sizeof(spriteext_t),
|
|
||||||
sizeof(actor_t), sizeof(DukePlayer_t), sizeof(playerdata_t),
|
|
||||||
sizeof(user_defs), sizeof(tiledata_t), sizeof(weapondata_t),
|
|
||||||
sizeof(projectile_t)
|
|
||||||
};
|
|
||||||
|
|
||||||
DukePlayer_t *g_player_ps[MAXPLAYERS];
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void G_MaybeAllocPlayer(int32_t pnum)
|
void G_MaybeAllocPlayer(int32_t pnum)
|
||||||
{
|
{
|
||||||
|
@ -6204,11 +6165,6 @@ void G_MaybeAllocPlayer(int32_t pnum)
|
||||||
g_player[pnum].ps = (DukePlayer_t *)Xcalloc(1, sizeof(DukePlayer_t));
|
g_player[pnum].ps = (DukePlayer_t *)Xcalloc(1, sizeof(DukePlayer_t));
|
||||||
if (g_player[pnum].input == NULL)
|
if (g_player[pnum].input == NULL)
|
||||||
g_player[pnum].input = (input_t *)Xcalloc(1, sizeof(input_t));
|
g_player[pnum].input = (input_t *)Xcalloc(1, sizeof(input_t));
|
||||||
|
|
||||||
#ifdef LUNATIC
|
|
||||||
g_player_ps[pnum] = g_player[pnum].ps;
|
|
||||||
g_player[pnum].ps->wa.idx = pnum;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -6237,20 +6193,11 @@ int app_main()
|
||||||
|
|
||||||
G_CheckCommandLine();
|
G_CheckCommandLine();
|
||||||
|
|
||||||
// This needs to happen afterwards, as G_CheckCommandLine() is where we set
|
|
||||||
// up the command-line-provided search paths (duh).
|
|
||||||
|
|
||||||
#ifdef STARTUP_SETUP_WINDOW
|
|
||||||
int const readSetup =
|
|
||||||
#endif
|
|
||||||
CONFIG_ReadSetup();
|
CONFIG_ReadSetup();
|
||||||
|
|
||||||
if (enginePreInit())
|
if (enginePreInit())
|
||||||
{
|
{
|
||||||
wm_msgbox("Build Engine Initialization Error",
|
I_Error("app_main: There was a problem initializing the Build engine: %s\n", engineerrstr);
|
||||||
"There was a problem initializing the Build engine: %s", engineerrstr);
|
|
||||||
ERRprintf("app_main: There was a problem initializing the Build engine: %s\n", engineerrstr);
|
|
||||||
Bexit(2);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -6375,6 +6322,8 @@ int app_main()
|
||||||
|
|
||||||
ud.last_level = -1;
|
ud.last_level = -1;
|
||||||
|
|
||||||
|
VM_OnEvent(EVENT_SETDEFAULTS, g_player[myconnectindex].ps->i, myconnectindex);
|
||||||
|
|
||||||
initprintf("Initializing OSD...\n");
|
initprintf("Initializing OSD...\n");
|
||||||
|
|
||||||
OSD_SetVersion(tempbuf, 10,0);
|
OSD_SetVersion(tempbuf, 10,0);
|
||||||
|
|
|
@ -203,7 +203,6 @@ typedef struct {
|
||||||
struct {
|
struct {
|
||||||
int32_t AutoAim;
|
int32_t AutoAim;
|
||||||
int32_t ShowWeapons;
|
int32_t ShowWeapons;
|
||||||
int32_t setupread;
|
|
||||||
|
|
||||||
} config;
|
} config;
|
||||||
|
|
||||||
|
|
|
@ -4603,8 +4603,8 @@ ifvar:
|
||||||
|
|
||||||
if (n != i)
|
if (n != i)
|
||||||
{
|
{
|
||||||
swapptr(&tempscrptr[i], &tempscrptr[n]);
|
std::swap(&tempscrptr[i], &tempscrptr[n]);
|
||||||
swapptr(&tempscrptr[i+1], &tempscrptr[n+1]);
|
std::swap(&tempscrptr[i+1], &tempscrptr[n+1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// for (j=3;j<3+tempscrptr[1]*2;j+=2)initprintf("%5d %8x\n",tempscrptr[j],tempscrptr[j+1]);
|
// for (j=3;j<3+tempscrptr[1]*2;j+=2)initprintf("%5d %8x\n",tempscrptr[j],tempscrptr[j+1]);
|
||||||
|
@ -6103,23 +6103,7 @@ void C_Compile(const char *fileName)
|
||||||
|
|
||||||
if (!kFile.isOpen())
|
if (!kFile.isOpen())
|
||||||
{
|
{
|
||||||
if (g_loadFromGroupOnly == 1 || numgroupfiles == 0)
|
I_Error(tempbuf,"CON file `%s' missing.", fileName);
|
||||||
{
|
|
||||||
#ifndef EDUKE32_STANDALONE
|
|
||||||
I_Error("Required game data was not found.");
|
|
||||||
G_GameExit(tempbuf);
|
|
||||||
#else
|
|
||||||
G_GameExit(" ");
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Bsprintf(tempbuf,"CON file `%s' missing.", fileName);
|
|
||||||
G_GameExit(tempbuf);
|
|
||||||
}
|
|
||||||
|
|
||||||
//g_loadFromGroupOnly = 1;
|
|
||||||
return; //Not there
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int const kFileLen = kFile.GetLength();
|
int const kFileLen = kFile.GetLength();
|
||||||
|
|
|
@ -296,33 +296,6 @@ void G_LoadGroups()
|
||||||
}
|
}
|
||||||
|
|
||||||
loaddefinitions_game(G_DefFile(), TRUE);
|
loaddefinitions_game(G_DefFile(), TRUE);
|
||||||
|
|
||||||
struct strllist *s;
|
|
||||||
|
|
||||||
int const bakpathsearchmode = pathsearchmode;
|
|
||||||
pathsearchmode = 1;
|
|
||||||
|
|
||||||
while (CommandGrps)
|
|
||||||
{
|
|
||||||
int32_t j;
|
|
||||||
|
|
||||||
s = CommandGrps->next;
|
|
||||||
|
|
||||||
if ((j = initgroupfile(CommandGrps->str)) == -1)
|
|
||||||
initprintf("Could not find file \"%s\".\n", CommandGrps->str);
|
|
||||||
else
|
|
||||||
{
|
|
||||||
g_groupFileHandle = j;
|
|
||||||
initprintf("Using file \"%s\" as game data.\n", CommandGrps->str);
|
|
||||||
if (G_AllowAutoload())
|
|
||||||
G_DoAutoload(CommandGrps->str);
|
|
||||||
}
|
|
||||||
|
|
||||||
Bfree(CommandGrps->str);
|
|
||||||
Bfree(CommandGrps);
|
|
||||||
CommandGrps = s;
|
|
||||||
}
|
|
||||||
pathsearchmode = bakpathsearchmode;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -102,16 +102,7 @@ void CONFIG_SetDefaults(void)
|
||||||
int32_t CONFIG_ReadSetup(void)
|
int32_t CONFIG_ReadSetup(void)
|
||||||
{
|
{
|
||||||
CONFIG_SetDefaults();
|
CONFIG_SetDefaults();
|
||||||
|
|
||||||
ud.config.setupread = 1;
|
|
||||||
pathsearchmode = 1;
|
|
||||||
|
|
||||||
pathsearchmode = 0;
|
|
||||||
|
|
||||||
|
|
||||||
if (ScreenBPP < 8) ScreenBPP = 32;
|
if (ScreenBPP < 8) ScreenBPP = 32;
|
||||||
|
|
||||||
ud.config.setupread = 1;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
#include "gamecvars.h"
|
#include "gamecvars.h"
|
||||||
#include "gameconfigfile.h"
|
#include "gameconfigfile.h"
|
||||||
#include "printf.h"
|
#include "printf.h"
|
||||||
|
#include "filesystem/filesystem.h"
|
||||||
|
|
||||||
// Uncomment to prevent anything except mirrors from drawing. It is sensible to
|
// Uncomment to prevent anything except mirrors from drawing. It is sensible to
|
||||||
// also uncomment ENGINE_CLEAR_SCREEN in build/src/engine_priv.h.
|
// also uncomment ENGINE_CLEAR_SCREEN in build/src/engine_priv.h.
|
||||||
|
@ -6788,21 +6788,11 @@ static int parsedefinitions_game(scriptfile *pScript, int firstPass)
|
||||||
{
|
{
|
||||||
char *fileName;
|
char *fileName;
|
||||||
|
|
||||||
pathsearchmode = 1;
|
|
||||||
if (!scriptfile_getstring(pScript,&fileName) && firstPass)
|
if (!scriptfile_getstring(pScript,&fileName) && firstPass)
|
||||||
{
|
{
|
||||||
if (initgroupfile(fileName) == -1)
|
fileSystem.AddAdditionalFile(fileName);
|
||||||
initprintf("Could not find file \"%s\".\n", fileName);
|
|
||||||
else
|
|
||||||
{
|
|
||||||
initprintf("Using file \"%s\" as game data.\n", fileName);
|
|
||||||
if (G_AllowAutoload())
|
|
||||||
G_DoAutoload(fileName);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pathsearchmode = 0;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case T_CACHESIZE:
|
case T_CACHESIZE:
|
||||||
{
|
{
|
||||||
|
@ -7611,21 +7601,12 @@ int app_main()
|
||||||
|
|
||||||
G_CheckCommandLine();
|
G_CheckCommandLine();
|
||||||
|
|
||||||
// This needs to happen afterwards, as G_CheckCommandLine() is where we set
|
|
||||||
// up the command-line-provided search paths (duh).
|
|
||||||
|
|
||||||
#ifdef STARTUP_SETUP_WINDOW
|
|
||||||
int const readSetup =
|
|
||||||
#endif
|
|
||||||
CONFIG_ReadSetup();
|
CONFIG_ReadSetup();
|
||||||
|
|
||||||
|
|
||||||
if (enginePreInit())
|
if (enginePreInit())
|
||||||
{
|
{
|
||||||
wm_msgbox("Build Engine Initialization Error",
|
I_Error("app_main: There was a problem initializing the Build engine: %s\n", engineerrstr);
|
||||||
"There was a problem initializing the Build engine: %s", engineerrstr);
|
|
||||||
ERRprintf("app_main: There was a problem initializing the Build engine: %s\n", engineerrstr);
|
|
||||||
Bexit(2);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -180,8 +180,6 @@ typedef struct {
|
||||||
struct {
|
struct {
|
||||||
int32_t AutoAim;
|
int32_t AutoAim;
|
||||||
int32_t ShowOpponentWeapons;
|
int32_t ShowOpponentWeapons;
|
||||||
|
|
||||||
int32_t setupread;
|
|
||||||
} config;
|
} config;
|
||||||
|
|
||||||
char overhead_on,last_overhead,showweapons;
|
char overhead_on,last_overhead,showweapons;
|
||||||
|
|
|
@ -34,6 +34,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
|
||||||
#include "osd.h"
|
#include "osd.h"
|
||||||
#include "crc32_.h"
|
#include "crc32_.h"
|
||||||
|
#include "printf.h"
|
||||||
|
|
||||||
BEGIN_RR_NS
|
BEGIN_RR_NS
|
||||||
|
|
||||||
|
@ -2378,21 +2379,10 @@ void C_Compile(const char *fileName)
|
||||||
|
|
||||||
if (!kFile.isOpen())
|
if (!kFile.isOpen())
|
||||||
{
|
{
|
||||||
if (g_loadFromGroupOnly == 1 || numgroupfiles == 0)
|
if (!kFile.isOpen())
|
||||||
{
|
{
|
||||||
char const *gf = G_GrpFile();
|
I_Error(tempbuf, "CON file `%s' missing.", fileName);
|
||||||
Bsprintf(tempbuf,"Required game data was not found. A valid copy of \"%s\" or other compatible data is needed to run EDuke32.\n\n"
|
|
||||||
"You must copy \"%s\" to your game directory before continuing!", gf, gf);
|
|
||||||
G_GameExit(tempbuf);
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
Bsprintf(tempbuf,"CON file `%s' missing.", fileName);
|
|
||||||
G_GameExit(tempbuf);
|
|
||||||
}
|
|
||||||
|
|
||||||
//g_loadFromGroupOnly = 1;
|
|
||||||
return; //Not there
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int const kFileLen = kFile.GetLength();
|
int const kFileLen = kFile.GetLength();
|
||||||
|
|
|
@ -123,14 +123,7 @@ void SetDefaultKeyDefinitions(int style)
|
||||||
|
|
||||||
int32_t CONFIG_ReadSetup(void)
|
int32_t CONFIG_ReadSetup(void)
|
||||||
{
|
{
|
||||||
//char ret;
|
|
||||||
extern char ds[];
|
|
||||||
extern char PlayerNameArg[32];
|
|
||||||
|
|
||||||
char waveformtrackname[MAXWAVEFORMTRACKLENGTH] = {0};
|
|
||||||
|
|
||||||
CONFIG_SetDefaults();
|
CONFIG_SetDefaults();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3343,7 +3343,7 @@ int32_t app_main()
|
||||||
|
|
||||||
SW_ExtInit();
|
SW_ExtInit();
|
||||||
|
|
||||||
i = CONFIG_ReadSetup();
|
CONFIG_ReadSetup();
|
||||||
|
|
||||||
if (enginePreInit())
|
if (enginePreInit())
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue