mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-26 11:40:44 +00:00
engine.c: in loadlookups(), allow pal 0.
BUILD_LUNATIC. git-svn-id: https://svn.eduke32.com/eduke32@4355 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
605c4dbc21
commit
82b87e1812
3 changed files with 12 additions and 5 deletions
|
@ -8150,7 +8150,8 @@ static int32_t loadpalette(void)
|
||||||
// Returns:
|
// Returns:
|
||||||
// - if generated fog shade tables, their first palnum P (fog pals are [P .. P+3])
|
// - if generated fog shade tables, their first palnum P (fog pals are [P .. P+3])
|
||||||
// - if didn't (no room), 0
|
// - if didn't (no room), 0
|
||||||
// - on error, -1
|
// - on error, -1 (didn't read enough data)
|
||||||
|
// - -2: error, we already wrote an error message ourselves
|
||||||
int32_t loadlookups(int32_t fp, uint8_t **basepaltabptr)
|
int32_t loadlookups(int32_t fp, uint8_t **basepaltabptr)
|
||||||
{
|
{
|
||||||
uint8_t numlookups;
|
uint8_t numlookups;
|
||||||
|
@ -8167,10 +8168,10 @@ int32_t loadlookups(int32_t fp, uint8_t **basepaltabptr)
|
||||||
if (kread(fp, &palnum, 1) != 1)
|
if (kread(fp, &palnum, 1) != 1)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (palnum == 0 || palnum >= 256-RESERVEDPALS)
|
if (palnum >= 256-RESERVEDPALS)
|
||||||
{
|
{
|
||||||
initprintf("ERROR: attempt to load lookup at reserved pal %d\n", palnum);
|
initprintf("ERROR: attempt to load lookup at reserved pal %d\n", palnum);
|
||||||
return -1;
|
return -2;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (kread(fp, remapbuf, 256) != 256)
|
if (kread(fp, remapbuf, 256) != 256)
|
||||||
|
|
|
@ -2866,6 +2866,7 @@ static int32_t ReadPaletteTable(void)
|
||||||
|
|
||||||
if (g_firstFogPal < 0)
|
if (g_firstFogPal < 0)
|
||||||
{
|
{
|
||||||
|
if (g_firstFogPal == -1)
|
||||||
initprintf("ERROR loading PALOOKUP.DAT: failed reading enough data\n");
|
initprintf("ERROR loading PALOOKUP.DAT: failed reading enough data\n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -10644,7 +10644,12 @@ static void G_LoadExtraPalettes(void)
|
||||||
kclose(fp);
|
kclose(fp);
|
||||||
|
|
||||||
if (g_firstFogPal < 0)
|
if (g_firstFogPal < 0)
|
||||||
|
{
|
||||||
|
if (g_firstFogPal == -1)
|
||||||
G_GameExit("\nERROR loading 'lookup.dat': failed reading enough data.");
|
G_GameExit("\nERROR loading 'lookup.dat': failed reading enough data.");
|
||||||
|
else
|
||||||
|
G_GameExit("\nERROR loading 'lookup.dat'.");
|
||||||
|
}
|
||||||
|
|
||||||
// Make color index 255 of default/water/slime palette black.
|
// Make color index 255 of default/water/slime palette black.
|
||||||
Bmemset(&palette[255*3], 0, 3);
|
Bmemset(&palette[255*3], 0, 3);
|
||||||
|
|
Loading…
Reference in a new issue