Commit 7f6301e6 authored by Richard Gobeille's avatar Richard Gobeille
Browse files

engine: templatize bitmap functions and transition direct manipulation of...

engine: templatize bitmap functions and transition direct manipulation of bitmap arrays over to use of the functions
parent c1429cde
......@@ -1146,14 +1146,31 @@ static FORCE_INLINE int nextPow2(int const value)
static CONSTEXPR const char pow2char[8] = {1,2,4,8,16,32,64,128u};
static FORCE_INLINE void bitmap_set(uint8_t *const ptr, int const n) { ptr[n>>3] |= pow2char[n&7]; }
static FORCE_INLINE void bitmap_clear(uint8_t *const ptr, int const n) { ptr[n>>3] &= ~pow2char[n&7]; }
static FORCE_INLINE CONSTEXPR char bitmap_test(uint8_t const *const ptr, int const n) { return ptr[n>>3] & pow2char[n&7]; }
#ifdef __cplusplus
template <typename T>
static FORCE_INLINE void bitmap_set(T *const ptr, int const n)
{
EDUKE32_STATIC_ASSERT((sizeof(T) << 3) == CHAR_BIT);
ptr[n>>3] |= pow2char[n&7];
}
template <typename T>
static FORCE_INLINE void bitmap_clear(T *const ptr, int const n)
{
EDUKE32_STATIC_ASSERT((sizeof(T) << 3) == CHAR_BIT);
ptr[n>>3] &= ~pow2char[n&7];
}
template <typename T>
static FORCE_INLINE CONSTEXPR bool bitmap_test(T const *const ptr, int const n)
{
EDUKE32_STATIC_ASSERT((sizeof(T) << 3) == CHAR_BIT);
return (ptr[n>>3] & pow2char[n&7]) == pow2char[n&7];
}
////////// Utility functions //////////
// breadth-first search helpers
#ifdef __cplusplus
template <typename T>
void bfirst_search_init(T *const list, uint8_t *const bitmap, T *const eltnumptr, int const maxelts, int const firstelt)
{
......
......@@ -909,7 +909,7 @@ static void editorDraw2dWall(int32_t i, int32_t posxe, int32_t posye, int32_t po
int64_t const dy = wal->y-wall[p2].y;
int64_t const dist = dx*dx + dy*dy;
int const bothSidesHighlighted = ((show2dwall[i>>3]&pow2char[i&7]) && (show2dwall[p2>>3]&pow2char[p2&7]));
int const bothSidesHighlighted = bitmap_test(show2dwall, i) && bitmap_test(show2dwall, p2);
if (dist > INT32_MAX)
{
......@@ -1016,7 +1016,7 @@ static void editorDraw2dWall(int32_t i, int32_t posxe, int32_t posye, int32_t po
}
}
if ((zoome >= 256 && editstatus == 1) || show2dwall[i>>3]&pow2char[i&7])
if ((zoome >= 256 && editstatus == 1) || bitmap_test(show2dwall, i))
if ((halfxdim16+x1 >= 2) && (halfxdim16+x1 <= xdim-3) &&
(midydim16+y1 >= 2) && (midydim16+y1 <= ydim16-3))
{
......@@ -1033,7 +1033,7 @@ static void editorDraw2dWall(int32_t i, int32_t posxe, int32_t posye, int32_t po
pointsize++;
}
if (show2dwall[i>>3]&pow2char[i&7])
if (bitmap_test(show2dwall, i))
col = editorcolors[14] - (M32_THROB>>1);
if (m32_sideview)
......@@ -1121,7 +1121,7 @@ static void editorDraw2dSprite(int32_t j, int32_t posxe, int32_t posye, int32_t
}
else // if (highlightcnt > 0)
{
if (show2dsprite[j>>3]&pow2char[j&7])
if (bitmap_test(show2dsprite, j))
col = editorcolors[14] - (M32_THROB>>1);
}
}
......@@ -1295,10 +1295,10 @@ void editorDraw2dScreen(const vec3_t *pos, int16_t cursectnum, int16_t ange, int
for (i=0; i<numwalls; i++)
{
int32_t j = wall[i].nextwall;
if ((graywallbitmap[i>>3]&pow2char[i&7]) && (j < 0 || (graywallbitmap[j>>3]&pow2char[j&7])))
graybitmap[i>>3] |= pow2char[i&7];
if (bitmap_test(graywallbitmap, i) && (j < 0 || bitmap_test(graywallbitmap, j)))
bitmap_set(graybitmap, i);
else
graybitmap[i>>3] &= ~pow2char[i&7];
bitmap_clear(graybitmap, i);
}
}
......@@ -1310,11 +1310,11 @@ void editorDraw2dScreen(const vec3_t *pos, int16_t cursectnum, int16_t ange, int
#else
if (alwaysshowgray)
for (i=numwalls-1; i>=0; i--)
if (graybitmap[i>>3]&pow2char[i&7])
if (bitmap_test(graybitmap, i))
editorDraw2dWall(i, posxe, posye, posze, zoome, 1+2);
for (i=numwalls-1; i>=0; i--)
if ((graybitmap[i>>3]&pow2char[i&7])==0)
if (!bitmap_test(graybitmap, i))
editorDraw2dWall(i, posxe, posye, posze, zoome, 2);
#endif
}
......@@ -1344,7 +1344,7 @@ void editorDraw2dScreen(const vec3_t *pos, int16_t cursectnum, int16_t ange, int
if (sprite[j].statnum<MAXSTATUS)
{
// if sprite is highlighted, always draw it
if ((show2dsprite[j>>3]&pow2char[j&7])==0)
if (!bitmap_test(show2dsprite, j))
{
if (!m32_sideview && sprite[j].sectnum >= 0)
YAX_SKIPSECTOR(sprite[j].sectnum);
......@@ -1373,8 +1373,8 @@ void editorDraw2dScreen(const vec3_t *pos, int16_t cursectnum, int16_t ange, int
int32_t j = m32_wallsprite[i];
if (j<MAXWALLS)
{
if (alwaysshowgray || !(graybitmap[j>>3]&pow2char[j&7]))
editorDraw2dWall(j, posxe, posye, posze, zoome, !!(graybitmap[j>>3]&pow2char[j&7]));
if (alwaysshowgray || !bitmap_test(graybitmap, j))
editorDraw2dWall(j, posxe, posye, posze, zoome, !!bitmap_test(graybitmap, j));
}
else
{
......
This diff is collapsed.
......@@ -46,9 +46,9 @@ void paletteInitClosestColorMap(uint8_t const * const pal)
int32_t const j = (pal1[0]>>FASTPALRIGHTSHIFT)*FASTPALGRIDSIZ*FASTPALGRIDSIZ
+ (pal1[1]>>FASTPALRIGHTSHIFT)*FASTPALGRIDSIZ + (pal1[2]>>FASTPALRIGHTSHIFT)
+ FASTPALGRIDSIZ*FASTPALGRIDSIZ + FASTPALGRIDSIZ + 1;
if (colhere[j>>3]&pow2char(j&7)) colnext[i] = colhead[j]; else colnext[i] = -1;
if (bitmap_test(colhere, j)) colnext[i] = colhead[j]; else colnext[i] = -1;
colhead[j] = i;
colhere[j>>3] |= pow2char(j&7);
bitmap_set(colhere, j);
}
paletteFlushClosestColor();
......@@ -154,7 +154,7 @@ int32_t paletteGetClosestColorWithBlacklistNoCache(int32_t r, int32_t g, int32_t
{
int i = colscan[k]+j;
if ((colhere[i>>3]&pow2char(i&7)) == 0)
if (!bitmap_test(colhere, i))
continue;
i = colhead[i];
......
......@@ -376,9 +376,8 @@ void yax_updategrays(int32_t posze)
#endif
// update grayouts due to editorzrange
keep &= (sector[i].ceilingz >= editorzrange[0] && sector[i].floorz <= editorzrange[1]);
if (!keep) // outside bounds, gray out!
graysectbitmap[i>>3] |= pow2char[i&7];
bitmap_set(graysectbitmap, i);
}
#ifdef YAX_ENABLE
......@@ -386,18 +385,18 @@ void yax_updategrays(int32_t posze)
{
for (i=0; i<numsectors; i++)
if (!(mingoodz <= sector[i].ceilingz && sector[i].floorz <= maxgoodz))
graysectbitmap[i>>3] |= pow2char[i&7];
bitmap_set(graysectbitmap, i);
}
#endif
numgraysects = 0;
for (i=0; i<numsectors; i++)
{
if (graysectbitmap[i>>3]&pow2char[i&7])
if (bitmap_test(graysectbitmap, i))
{
numgraysects++;
for (j=sector[i].wallptr; j<sector[i].wallptr+sector[i].wallnum; j++)
graywallbitmap[j>>3] |= pow2char[j&7];
bitmap_set(graywallbitmap, j);
}
}
}
......@@ -620,14 +619,14 @@ void yax_update(int32_t resetstat)
{
yax_getbunches(i, &cb, &fb);
if (cb>=0)
havebunch[cb>>3] |= pow2char[cb&7];
bitmap_set(havebunch, cb);
if (fb>=0)
havebunch[fb>>3] |= pow2char[fb&7];
bitmap_set(havebunch, fb);
}
for (i=0; i<YAX_MAXBUNCHES; i++)
{
if ((havebunch[i>>3]&pow2char[i&7])==0)
if (bitmap_test(havebunch, i)==0)
{
bunchmap[i] = 255;
dasub++;
......@@ -999,13 +998,13 @@ void yax_drawrooms(void (*SpriteAnimFunc)(int32_t,int32_t,int32_t,int32_t,int32_
for (i=0; i<numsectors; i++)
{
if (!(gotsector[i>>3]&pow2char[i&7]))
if (!bitmap_test(gotsector, i))
continue;
j = yax_getbunch(i, cf);
if (j >= 0 && !(havebunch[j>>3]&pow2char[j&7]))
if (j >= 0 && !bitmap_test(havebunch, j))
{
if (videoGetRenderMode() == REND_CLASSIC && (haveymost[j>>3]&pow2char[j&7])==0)
if (videoGetRenderMode() == REND_CLASSIC && bitmap_test(haveymost, j)==0)
{
yaxdebug("%s, l %d: skipped bunch %d (no *most)", cf?"v":"^", lev, j);
continue;
......@@ -1015,7 +1014,7 @@ void yax_drawrooms(void (*SpriteAnimFunc)(int32_t,int32_t,int32_t,int32_t,int32_
(cf==0 && globalposz >= sector[i].ceilingz) ||
(cf==1 && globalposz <= sector[i].floorz))
{
havebunch[j>>3] |= pow2char[j&7];
bitmap_set(havebunch, j);
bunches[cf][bnchnum[cf]++] = j;
bnchend[lev][cf]++;
numhere++;
......@@ -1762,7 +1761,7 @@ static void classicScanSector(int16_t startsectnum)
return;
if (automapping)
show2dsector[startsectnum>>3] |= pow2char[startsectnum&7];
bitmap_set(show2dsector, startsectnum);
sectorborder[0] = startsectnum;
int32_t sectorbordercnt = 1;
......@@ -1788,8 +1787,8 @@ static void classicScanSector(int16_t startsectnum)
if (renderAddTsprite(i, sectnum))
break;
}
gotsector[sectnum>>3] |= pow2char[sectnum&7];
bitmap_set(gotsector, sectnum);
const int32_t onumbunches = numbunches;
const int32_t onumscans = numscans;
......@@ -1820,7 +1819,7 @@ static void classicScanSector(int16_t startsectnum)
#ifdef YAX_ENABLE
if (yax_nomaskpass==0 || !yax_isislandwall(w, !yax_globalcf) || (yax_nomaskdidit=1, 0))
#endif
if ((gotsector[nextsectnum>>3]&pow2char[nextsectnum&7]) == 0)
if (bitmap_test(gotsector, nextsectnum) == 0)
{
// OV: E2L10
coord_t temp = (coord_t)x1*y2-(coord_t)x2*y1;
......@@ -1833,7 +1832,7 @@ static void classicScanSector(int16_t startsectnum)
if (mulscale5(tempint,tempint) <= (x2-x1)*(x2-x1)+(y2-y1)*(y2-y1))
{
sectorborder[sectorbordercnt++] = nextsectnum;
gotsector[nextsectnum>>3] |= pow2char[nextsectnum&7];
bitmap_set(gotsector, nextsectnum);
}
}
#endif
......@@ -4491,10 +4490,10 @@ static void classicDrawBunches(int32_t bunch)
for (i=0; i<2; i++)
if (checkcf&(1<<i))
{
if ((haveymost[bn[i]>>3]&pow2char[bn[i]&7])==0)
if (bitmap_test(haveymost, bn[i])==0)
{
// init yax *most arrays for that bunch
haveymost[bn[i]>>3] |= pow2char[bn[i]&7];
bitmap_set(haveymost, bn[i]);
for (x=xdimen*bn[i]; x<xdimen*(bn[i]+1); x++)
{
yumost[x] = ydimen;
......@@ -4533,7 +4532,7 @@ static void classicDrawBunches(int32_t bunch)
#ifdef YAX_ENABLE
// this is to prevent double-drawing of translucent masked ceilings
if (r_tror_nomaskpass==0 || yax_globallev==YAX_MAXDRAWS || (sec->ceilingstat&256)==0 ||
yax_nomaskpass==1 || !(yax_gotsector[sectnum>>3]&pow2char[sectnum&7]))
yax_nomaskpass==1 || !bitmap_test(yax_gotsector, sectnum))
#endif
{
if ((sec->ceilingstat&3) == 2)
......@@ -4548,7 +4547,7 @@ static void classicDrawBunches(int32_t bunch)
#ifdef YAX_ENABLE
// this is to prevent double-drawing of translucent masked floors
if (r_tror_nomaskpass==0 || yax_globallev==YAX_MAXDRAWS || (sec->floorstat&256)==0 ||
yax_nomaskpass==1 || !(yax_gotsector[sectnum>>3]&pow2char[sectnum&7]))
yax_nomaskpass==1 || !bitmap_test(yax_gotsector, sectnum))
#endif
{
if ((sec->floorstat&3) == 2)
......@@ -4863,7 +4862,7 @@ static void classicDrawBunches(int32_t bunch)
if (numhits < 0)
return;
if (!(wal->cstat&32) && (gotsector[nextsectnum>>3]&pow2char[nextsectnum&7]) == 0)
if (!(wal->cstat&32) && bitmap_test(gotsector, nextsectnum) == 0)
{
if (umost[x2] < dmost[x2])
classicScanSector(nextsectnum);
......@@ -6849,7 +6848,7 @@ next_most:
}
if (automapping == 1 && (unsigned)spritenum < MAXSPRITES)
show2dsprite[spritenum>>3] |= pow2char[spritenum&7];
bitmap_set(show2dsprite, spritenum);
}
static void renderDrawSprite(int32_t snum)
......@@ -9447,7 +9446,7 @@ int32_t renderDrawRoomsQ16(int32_t daposx, int32_t daposy, int32_t daposz,
if (automapping)
{
for (int z=bunchfirst[closest]; z>=0; z=bunchp2[z])
show2dwall[thewall[z]>>3] |= pow2char[thewall[z]&7];
bitmap_set(show2dwall, thewall[z]);
}
numbunches--;
......@@ -10103,7 +10102,7 @@ void renderDrawMapView(int32_t dax, int32_t day, int32_t zoome, int16_t ang)
usectorptr_t sec;
for (s=0,sec=(usectorptr_t)&sector[s]; s<numsectors; s++,sec++)
if (show2dsector[s>>3]&pow2char[s&7])
if (bitmap_test(show2dsector, s))
{
#ifdef YAX_ENABLE
if (yax_getbunch(s, YAX_FLOOR) >= 0 && (sector[s].floorstat&(256+128))==0)
......@@ -10168,7 +10167,7 @@ void renderDrawMapView(int32_t dax, int32_t day, int32_t zoome, int16_t ang)
tsprite[sortnum++].owner = i;
}
}
gotsector[s>>3] |= pow2char[s&7];
bitmap_set(gotsector, s);
globalorientation = (int32_t)sec->floorstat;
if ((globalorientation&1) != 0) continue;
......@@ -12478,13 +12477,13 @@ void dragpoint(int16_t pointhighlight, int32_t dax, int32_t day, uint8_t flags)
wall[w].x = dax;
wall[w].y = day;
walbitmap[w>>3] |= pow2char[w&7];
bitmap_set(walbitmap, w);
for (YAX_ITER_WALLS(w, j, tmpcf))
{
if ((walbitmap[j>>3]&pow2char[j&7])==0)
if (bitmap_test(walbitmap, j)==0)
{
walbitmap[j>>3] |= pow2char[j&7];
bitmap_set(walbitmap, j);
yaxwalls[numyaxwalls++] = j;
}
}
......@@ -12517,7 +12516,7 @@ void dragpoint(int16_t pointhighlight, int32_t dax, int32_t day, uint8_t flags)
break;
}
if ((walbitmap[w>>3] & pow2char[w&7]))
if (bitmap_test(walbitmap, w))
{
if (clockwise)
break;
......@@ -12534,13 +12533,13 @@ void dragpoint(int16_t pointhighlight, int32_t dax, int32_t day, uint8_t flags)
int32_t w;
// TODO: extern a separate bitmap instead?
for (w=0; w<numwalls; w++)
if (walbitmap[w>>3] & pow2char[w&7])
if (bitmap_test(walbitmap, w))
{
editwall[w>>3] |= 1<<(w&7);
bitmap_set(editwall, w);
if (flags&2)
{
int wn = lastwall(w);
editwall[wn>>3] |= 1<<(wn&7);
bitmap_set(editwall, wn);
}
}
}
......
......@@ -5471,7 +5471,7 @@ static void polymost_drawalls(int32_t const bunch)
#ifdef YAX_ENABLE
// this is to prevent double-drawing of translucent masked floors
if (g_nodraw || r_tror_nomaskpass==0 || yax_globallev==YAX_MAXDRAWS || (sec->floorstat&256)==0 ||
yax_nomaskpass==1 || !(yax_gotsector[sectnum>>3]&pow2char[sectnum&7]))
yax_nomaskpass==1 || !bitmap_test(yax_gotsector, sectnum))
{
#endif
if (!(globalorientation&1))
......@@ -5889,7 +5889,7 @@ static void polymost_drawalls(int32_t const bunch)
#ifdef YAX_ENABLE
// this is to prevent double-drawing of translucent masked ceilings
if (g_nodraw || r_tror_nomaskpass==0 || yax_globallev==YAX_MAXDRAWS || (sec->ceilingstat&256)==0 ||
yax_nomaskpass==1 || !(yax_gotsector[sectnum>>3]&pow2char[sectnum&7]))
yax_nomaskpass==1 || !bitmap_test(yax_gotsector, sectnum))
{
#endif
if (!(globalorientation&1))
......@@ -6271,10 +6271,10 @@ static void polymost_drawalls(int32_t const bunch)
for (i=0; i<2; i++)
if (checkcf&(1<<i))
{
if ((haveymost[bn[i]>>3]&pow2char[bn[i]&7])==0)
if (!bitmap_test(haveymost, bn[i]))
{
// init yax *most arrays for that bunch
haveymost[bn[i]>>3] |= pow2char[bn[i]&7];
bitmap_set(haveymost, bn[i]);
yax_vsp[bn[i]*2][1].x = xbl;
yax_vsp[bn[i]*2][2].x = xbr;
yax_vsp[bn[i]*2][1].cy[0] = xbb;
......@@ -6508,7 +6508,7 @@ static void polymost_drawalls(int32_t const bunch)
domostpolymethod = DAMETH_NOMASK;
if (nextsectnum >= 0)
if ((!(gotsector[nextsectnum>>3]&pow2char[nextsectnum&7])) && testvisiblemost(x0,x1))
if (!bitmap_test(gotsector, nextsectnum) && testvisiblemost(x0,x1))
polymost_scansector(nextsectnum);
}
}
......@@ -6543,7 +6543,7 @@ void polymost_scansector(int32_t sectnum)
if (sectnum < 0) return;
if (automapping)
show2dsector[sectnum>>3] |= pow2char[sectnum&7];
bitmap_set(show2dsector, sectnum);
sectorborder[0] = sectnum;
int sectorbordercnt = 1;
......@@ -6575,7 +6575,7 @@ void polymost_scansector(int32_t sectnum)
}
}
gotsector[sectnum>>3] |= pow2char[sectnum&7];
bitmap_set(gotsector, sectnum);
int const bunchfrst = numbunches;
int const onumscans = numscans;
......@@ -6602,7 +6602,7 @@ void polymost_scansector(int32_t sectnum)
#ifdef YAX_ENABLE
if (yax_nomaskpass==0 || !yax_isislandwall(z, !yax_globalcf) || (yax_nomaskdidit=1, 0))
#endif
if ((gotsector[nextsectnum>>3]&pow2char[nextsectnum&7]) == 0)
if (!bitmap_test(gotsector, nextsectnum))
{
double const d = fp1.x*fp2.y - fp2.x*fp1.y;
vec2d_t const p1 = { fp2.x-fp1.x, fp2.y-fp1.y };
......@@ -6616,7 +6616,7 @@ void polymost_scansector(int32_t sectnum)
)
{
sectorborder[sectorbordercnt++] = nextsectnum;
gotsector[nextsectnum>>3] |= pow2char[nextsectnum&7];
bitmap_set(gotsector, nextsectnum);
}
}
......@@ -7117,7 +7117,7 @@ void polymost_drawrooms()
if (automapping)
{
for (int z=bunchfirst[closest]; z>=0; z=bunchp2[z])
show2dwall[thewall[z]>>3] |= pow2char[thewall[z]&7];
bitmap_set(show2dwall, thewall[z]);
}
numbunches--;
......@@ -8832,7 +8832,7 @@ void polymost_drawsprite(int32_t snum)
}
if (automapping == 1 && (unsigned)spritenum < MAXSPRITES)
show2dsprite[spritenum>>3] |= pow2char[spritenum&7];
bitmap_set(show2dsprite, spritenum);
_drawsprite_return:
polymost_identityrotmat();
......@@ -9634,7 +9634,7 @@ int32_t polymost_drawtilescreen(int32_t tilex, int32_t tiley, int32_t wallnum, i
usehightile = usehitile && usehightile;
pth = texcache_fetch(wallnum, 0, 0, DAMETH_CLAMPED | (videoGetRenderMode() == REND_POLYMOST && polymost_useindexedtextures() ? DAMETH_INDEXED : 0));
if (usehightile)
loadedhitile[wallnum>>3] |= pow2char[wallnum&7];
bitmap_set(loadedhitile, wallnum);
usehightile = ousehightile;
if (pth)
......
......@@ -206,7 +206,7 @@ void artSetupMapArt(const char *filename)
void tileSetupDummy(int32_t const tile)
{
faketile[tile>>3] |= pow2char[tile&7];
bitmap_set(faketile, tile);
DO_FREE_AND_NULL(faketiledata[tile]);
}
......@@ -219,7 +219,7 @@ static void tileSetDataSafe(int32_t const tile, int32_t tsiz, char const * const
{
faketilesize[tile] = tsiz;
faketiledata[tile] = (char *) Xrealloc(newtile, tsiz);
faketile[tile>>3] |= pow2char[tile&7];
bitmap_set(faketile, tile);
tilefilenum[tile] = MAXARTFILES_TOTAL;
}
else
......@@ -237,13 +237,13 @@ void tileSetData(int32_t const tile, int32_t tsiz, char const * const buffer)
{
faketilesize[tile] = tsiz;
faketiledata[tile] = (char *) Xrealloc(faketiledata[tile], tsiz);
faketile[tile>>3] |= pow2char[tile&7];
bitmap_set(faketile, tile);
tilefilenum[tile] = MAXARTFILES_TOTAL;
}
else
{
DO_FREE_AND_NULL(faketiledata[tile]);
faketile[tile>>3] &= ~pow2char[tile&7];
bitmap_clear(faketile, tile);
}
}
......@@ -257,7 +257,7 @@ static void tileSoftDelete(int32_t const tile)
walock[tile] = CACHE1D_FREE;
waloff[tile] = 0;
faketile[tile>>3] &= ~pow2char[tile&7];
bitmap_clear(faketile, tile);
Bmemset(&picanm[tile], 0, sizeof(picanm_t));
}
......@@ -513,7 +513,7 @@ static int32_t artReadIndexedFile(int32_t tilefilei)
{
// Tiles having dummytile replacements or those that are
// cache1d-locked can't be replaced.
if (faketile[i>>3] & pow2char[i&7] || walock[i] >= CACHE1D_LOCKED)
if (bitmap_test(faketile, i) || walock[i] >= CACHE1D_LOCKED)
{
LOG_F(WARNING, "Per-map .art file could not be loaded %s: tile %d is locked by %s.", fn, i, walock[i] >= CACHE1D_LOCKED ? "cache1d" : "dummytile");
kclose(fil);
......@@ -677,7 +677,7 @@ void tileLoadData(int16_t tilenume, int32_t dasiz, char *buffer)
int const tfn = tilefilenum[tilenume];
// dummy tiles for highres replacements and tilefromtexture definitions
if (faketile[tilenume>>3] & pow2char[tilenume&7])
if (bitmap_test(faketile, tilenume))
{
if (faketiledata[tilenume] != NULL)
LZ4_decompress_safe(faketiledata[tilenume], buffer, faketilesize[tilenume], dasiz);
......
......@@ -710,10 +710,10 @@ const char *ExtGetWallCaption(int16_t wallnum)
Bmemset(tempbuf,0,sizeof(tempbuf));
if (editwall[wallnum>>3]&pow2char[wallnum&7])
if (bitmap_test(editwall, wallnum))
{
Bsprintf(tempbuf,"%d", wallength(wallnum));
editwall[wallnum>>3] &= ~pow2char[wallnum&7];
bitmap_clear(editwall, wallnum);
return tempbuf;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment