From f87f38b8f084a4196a0cc9356e1e8ac788d478af Mon Sep 17 00:00:00 2001 From: nukeykt Date: Sat, 10 Aug 2019 03:25:44 +0900 Subject: [PATCH] Always load widescreen def file --- source/blood/src/blood.cpp | 47 +++++++++++++++++++--------------- source/blood/src/common.cpp | 1 + source/blood/src/common_game.h | 2 ++ 3 files changed, 30 insertions(+), 20 deletions(-) diff --git a/source/blood/src/blood.cpp b/source/blood/src/blood.cpp index 921f16f94..cf0296831 100644 --- a/source/blood/src/blood.cpp +++ b/source/blood/src/blood.cpp @@ -1511,6 +1511,10 @@ int app_main(int argc, char const * const * argv) LoadExtraArts(); levelLoadDefaults(); + + loaddefinitionsfile(BLOODWIDESCREENDEF); + loaddefinitions_game(BLOODWIDESCREENDEF, FALSE); + const char *defsfile = G_DefFile(); uint32_t stime = timerGetTicks(); if (!loaddefinitionsfile(defsfile)) @@ -2134,31 +2138,34 @@ static int parsedefinitions_game(scriptfile *pScript, int firstPass) } } - if (EDUKE32_PREDICT_FALSE((unsigned)tile >= MAXUSERTILES)) + if (!firstPass) { - initprintf("Error: missing or invalid 'tile number' for texture definition near line %s:%d\n", - pScript->filename, scriptfile_getlinum(pScript,texturetokptr)); - break; - } - - if (tilecrc) - { - origcrc = tileCRC(tile); - if (origcrc != tilecrc) + if (EDUKE32_PREDICT_FALSE((unsigned)tile >= MAXUSERTILES)) { - //initprintf("CRC of tile %d doesn't match! CRC: %d, Expected: %d\n", tile, origcrc, tilecrc); + initprintf("Error: missing or invalid 'tile number' for texture definition near line %s:%d\n", + pScript->filename, scriptfile_getlinum(pScript,texturetokptr)); break; } - } - if (havesurface) - surfType[tile] = surface; - if (havevox) - voxelIndex[tile] = vox; - if (haveshade) - tileShade[tile] = shade; - if (haveview) - picanm[tile].extra = view&7; + if (tilecrc) + { + origcrc = tileCRC(tile); + if (origcrc != tilecrc) + { + //initprintf("CRC of tile %d doesn't match! CRC: %d, Expected: %d\n", tile, origcrc, tilecrc); + break; + } + } + + if (havesurface) + surfType[tile] = surface; + if (havevox) + voxelIndex[tile] = vox; + if (haveshade) + tileShade[tile] = shade; + if (haveview) + picanm[tile].extra = view&7; + } } break; diff --git a/source/blood/src/common.cpp b/source/blood/src/common.cpp index 93d556bf8..9e20fe7ad 100644 --- a/source/blood/src/common.cpp +++ b/source/blood/src/common.cpp @@ -241,6 +241,7 @@ void G_LoadGroups(int32_t autoload) } } + loaddefinitions_game(BLOODWIDESCREENDEF, TRUE); loaddefinitions_game(G_DefFile(), TRUE); struct strllist *s; diff --git a/source/blood/src/common_game.h b/source/blood/src/common_game.h index 45c8410fc..9465939aa 100644 --- a/source/blood/src/common_game.h +++ b/source/blood/src/common_game.h @@ -39,6 +39,8 @@ extern int g_useCwd; #define APPBASENAME "nblood" #endif +#define BLOODWIDESCREENDEF "blood_widescreen.def" + #define BYTEVERSION 102 #define EXEVERSION 101