mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-11-10 23:31:50 +00:00
Merge branch 'extracolormaps-fix' into 'next'
R_InitExtraColormaps fix This fixes the `R_InitExtraColormaps` function so that it correctly realises there are no "extra colormaps" actually in SRB2's files, rather than telling you there are 6 extra colormaps on game startup (or however many WAD files total you have added). For those who don't know what the function does, it searches for C_START/C_END markers, and if they exist, adds any lumps inbetween to a list of extra colormaps internally. They are never used by the game though, since we last supported colormaps of that kind so long ago I don't think anyone remembers when anymore (definitely more than a decade at least). Merging to next since I don't know if this would cause any netplay issues or not tbh. See merge request !182
This commit is contained in:
commit
8454e75e3c
1 changed files with 7 additions and 6 deletions
13
src/r_data.c
13
src/r_data.c
|
@ -944,23 +944,24 @@ static void R_InitExtraColormaps(void)
|
|||
for (cfile = clump = 0; cfile < numwadfiles; cfile++, clump = 0)
|
||||
{
|
||||
startnum = W_CheckNumForNamePwad("C_START", cfile, clump);
|
||||
if (startnum == LUMPERROR)
|
||||
if (startnum == INT16_MAX)
|
||||
continue;
|
||||
|
||||
endnum = W_CheckNumForNamePwad("C_END", cfile, clump);
|
||||
|
||||
if (endnum == LUMPERROR)
|
||||
if (endnum == INT16_MAX)
|
||||
I_Error("R_InitExtraColormaps: C_START without C_END\n");
|
||||
|
||||
if (WADFILENUM(startnum) != WADFILENUM(endnum))
|
||||
I_Error("R_InitExtraColormaps: C_START and C_END in different wad files!\n");
|
||||
// This shouldn't be possible when you use the Pwad function, silly
|
||||
//if (WADFILENUM(startnum) != WADFILENUM(endnum))
|
||||
//I_Error("R_InitExtraColormaps: C_START and C_END in different wad files!\n");
|
||||
|
||||
if (numcolormaplumps >= maxcolormaplumps)
|
||||
maxcolormaplumps *= 2;
|
||||
colormaplumps = Z_Realloc(colormaplumps,
|
||||
sizeof (*colormaplumps) * maxcolormaplumps, PU_STATIC, NULL);
|
||||
colormaplumps[numcolormaplumps].wadfile = WADFILENUM(startnum);
|
||||
colormaplumps[numcolormaplumps].firstlump = LUMPNUM(startnum+1);
|
||||
colormaplumps[numcolormaplumps].wadfile = cfile;
|
||||
colormaplumps[numcolormaplumps].firstlump = startnum+1;
|
||||
colormaplumps[numcolormaplumps].numlumps = endnum - (startnum + 1);
|
||||
numcolormaplumps++;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue