Pull setting g_noFloorPal[] further down, into makepalookup().

Now passed as last arg 'noFloorPal' to makepalookup(). Used as follows:
- from loadlookups(): *false*, i.e. do take over floor pal.
- from generatefogpals() [default fog pals] and fillemptylookups(): *true*,
  i.e. don't take over floor pal
- from DEF 'fogpal': true
- from DEF 'makepalookup': take over flag from pal from which we are remapping,
  or set to true if remapping from pal 0
- (CROSSHAIR_PAL: true)

This should make the issue reported in
 http://forums.duke4.net/topic/775-eduke32-20-and-polymer/page__view__findpost__p__197583
resolve in a natural manner.

git-svn-id: https://svn.eduke32.com/eduke32@4812 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2014-12-13 22:33:05 +00:00
parent 70cbde87eb
commit 50a5e38cb6
3 changed files with 9 additions and 13 deletions

View file

@ -1098,7 +1098,7 @@ void loadtile(int16_t tilenume);
int32_t qloadkvx(int32_t voxindex, const char *filename); int32_t qloadkvx(int32_t voxindex, const char *filename);
intptr_t allocatepermanenttile(int16_t tilenume, int32_t xsiz, int32_t ysiz); intptr_t allocatepermanenttile(int16_t tilenume, int32_t xsiz, int32_t ysiz);
void copytilepiece(int32_t tilenume1, int32_t sx1, int32_t sy1, int32_t xsiz, int32_t ysiz, int32_t tilenume2, int32_t sx2, int32_t sy2); void copytilepiece(int32_t tilenume1, int32_t sx1, int32_t sy1, int32_t xsiz, int32_t ysiz, int32_t tilenume2, int32_t sx2, int32_t sy2);
void makepalookup(int32_t palnum, const char *remapbuf, int8_t r, int8_t g, int8_t b, char dastat); void makepalookup(int32_t palnum, const char *remapbuf, int8_t r, int8_t g, int8_t b, char noFloorPal);
//void setvgapalette(void); //void setvgapalette(void);
void setbasepaltable(uint8_t **basepaltable, uint8_t basepalcount); void setbasepaltable(uint8_t **basepaltable, uint8_t basepalcount);
void setbrightness(char dabrightness, uint8_t dapalid, uint8_t flags); void setbrightness(char dabrightness, uint8_t dapalid, uint8_t flags);

View file

@ -1757,7 +1757,8 @@ static int32_t defsparser(scriptfile *script)
// NOTE: all palookups are initialized, i.e. non-NULL! // NOTE: all palookups are initialized, i.e. non-NULL!
// NOTE2: aliasing (pal==remappal) is OK // NOTE2: aliasing (pal==remappal) is OK
makepalookup(pal, palookup[remappal], red, green, blue, 1); makepalookup(pal, palookup[remappal], red, green, blue,
remappal==0 ? 1 : g_noFloorPal[remappal]);
} }
break; break;
case T_TEXTURE: case T_TEXTURE:

View file

@ -8334,7 +8334,7 @@ int32_t loadlookups(int32_t fp)
if (kread(fp, remapbuf, 256) != 256) if (kread(fp, remapbuf, 256) != 256)
return -1; return -1;
makepalookup(palnum, remapbuf, 0,0,0, 1); makepalookup(palnum, remapbuf, 0,0,0, 0);
} }
return 0; return 0;
@ -8352,11 +8352,6 @@ void generatefogpals(void)
makepalookup(j+2, NULL, 0, 15, 0, 1); makepalookup(j+2, NULL, 0, 15, 0, 1);
makepalookup(j+3, NULL, 0, 0, 15, 1); makepalookup(j+3, NULL, 0, 0, 15, 1);
g_noFloorPal[j] = 1;
g_noFloorPal[j+1] = 1;
g_noFloorPal[j+2] = 1;
g_noFloorPal[j+3] = 1;
break; break;
} }
} }
@ -8371,8 +8366,6 @@ void fillemptylookups(void)
#define COLRESULTSIZ 4096 #define COLRESULTSIZ 4096
#define COLRESULT(x) do { } while (0)
static uint32_t getclosestcol_results[COLRESULTSIZ]; static uint32_t getclosestcol_results[COLRESULTSIZ];
static int32_t numclosestcolresults; static int32_t numclosestcolresults;
@ -15059,7 +15052,7 @@ int32_t setpalookup(int32_t palnum, const uint8_t *shtab)
// //
// makepalookup // makepalookup
// //
void makepalookup(int32_t palnum, const char *remapbuf, int8_t r, int8_t g, int8_t b, char dastat) void makepalookup(int32_t palnum, const char *remapbuf, int8_t r, int8_t g, int8_t b, char noFloorPal)
{ {
int32_t i, j; int32_t i, j;
@ -15072,6 +15065,8 @@ void makepalookup(int32_t palnum, const char *remapbuf, int8_t r, int8_t g, int8
if ((unsigned)palnum >= MAXPALOOKUPS) if ((unsigned)palnum >= MAXPALOOKUPS)
return; return;
g_noFloorPal[palnum] = noFloorPal;
if (remapbuf==NULL) if (remapbuf==NULL)
{ {
if ((r|g|b) == 0) if ((r|g|b) == 0)
@ -15089,8 +15084,8 @@ void makepalookup(int32_t palnum, const char *remapbuf, int8_t r, int8_t g, int8
maybe_alloc_palookup(palnum); maybe_alloc_palookup(palnum);
if (dastat == 0) return; if ((r|g|b|63) != 63)
if ((r|g|b|63) != 63) return; return;
if ((r|g|b) == 0) if ((r|g|b) == 0)
{ {