This adds back in the engine's old automapping feature

This was removed a long time ago because Duke3D and Shadow Warrior don't use it.

git-svn-id: https://svn.eduke32.com/eduke32@7873 1a8010ca-5511-0410-912e-c29ae57300e0

# Conflicts:
#	source/build/src/polymer.cpp
#	source/build/src/polymost.cpp
This commit is contained in:
terminx 2019-08-01 06:50:56 +00:00 committed by Christoph Oelckers
parent 6ad445d47b
commit 1a0c56f0f1
4 changed files with 20 additions and 6 deletions

View file

@ -869,6 +869,7 @@ EXTERN int32_t windowpos, windowx, windowy;
// spritenum = 54;
// show2dsprite[spritenum>>3] &= ~(1<<(spritenum&7));
EXTERN int automapping;
EXTERN char show2dsector[(MAXSECTORS+7)>>3];
EXTERN char show2dwall[(MAXWALLS+7)>>3];
EXTERN char show2dsprite[(MAXSPRITES+7)>>3];

View file

@ -1674,10 +1674,8 @@ static void classicScanSector(int16_t startsectnum)
return;
}
if (automapping)
{
if (automapping)
show2dsector[startsectnum>>3] |= pow2char[startsectnum&7];
}
sectorborder[0] = startsectnum;
int32_t sectorbordercnt = 1;
@ -6222,6 +6220,9 @@ draw_as_face_sprite:
classicDrawVoxel(tspr->x,tspr->y,tspr->z,i,daxrepeat,(int32_t)tspr->yrepeat,vtilenum,
tspr->shade,tspr->pal,lwall,swall,tspr->cstat,(tspr->cstat&48)!=48,floorz,ceilingz);
}
if (automapping == 1 && (unsigned)spritenum < MAXSPRITES)
show2dsprite[spritenum>>3] |= pow2char[spritenum&7];
}
static void renderDrawSprite(int32_t snum)
@ -8643,6 +8644,12 @@ int32_t renderDrawRoomsQ16(int32_t daposx, int32_t daposy, int32_t daposz,
classicDrawBunches(closest);
if (automapping)
{
for (int z=bunchfirst[closest]; z>=0; z=bunchp2[z])
show2dwall[thewall[z]>>3] |= pow2char[thewall[z]&7];
}
numbunches--;
bunchfirst[closest] = bunchfirst[numbunches];
bunchlast[closest] = bunchlast[numbunches];

View file

@ -4974,7 +4974,8 @@ void polymost_scansector(int32_t sectnum)
{
if (sectnum < 0) return;
if (automapping) show2dsector[sectnum>>3] |= pow2char[sectnum&7];
if (automapping)
show2dsector[sectnum>>3] |= pow2char[sectnum&7];
sectorborder[0] = sectnum;
int sectorbordercnt = 1;
@ -5453,8 +5454,8 @@ void polymost_drawrooms()
if (automapping)
{
for (int z = bunchfirst[closest]; z >= 0; z = bunchp2[z])
show2dwall[thewall[z] >> 3] |= pow2char[thewall[z] & 7];
for (int z=bunchfirst[closest]; z>=0; z=bunchp2[z])
show2dwall[thewall[z]>>3] |= pow2char[thewall[z]&7];
}
numbunches--;
@ -6457,6 +6458,10 @@ void polymost_drawsprite(int32_t snum)
case 3: // Voxel sprite
break;
}
if (automapping == 1 && (unsigned)spritenum < MAXSPRITES)
show2dsprite[spritenum>>3] |= pow2char[spritenum&7];
_drawsprite_return:
polymost_identityrotmat();
tilesiz[globalpicnum] = oldsiz;

View file

@ -1261,6 +1261,7 @@ static void Gv_AddSystemVars(void)
Gv_NewVar("WORKSLIKE", 0, GAMEVAR_SYSTEM | GAMEVAR_PERPLAYER | GAMEVAR_READONLY);
Gv_NewVar("ZRANGE", 4, GAMEVAR_SYSTEM | GAMEVAR_PERPLAYER);
Gv_NewVar("automapping", (intptr_t)&automapping, GAMEVAR_SYSTEM | GAMEVAR_INT32PTR);
Gv_NewVar("cameraang", (intptr_t)&ud.cameraq16ang, GAMEVAR_SYSTEM | GAMEVAR_Q16PTR);
Gv_NewVar("cameraclock", (intptr_t)&g_cameraClock, GAMEVAR_SYSTEM | GAMEVAR_INT32PTR);
Gv_NewVar("cameradist", (intptr_t)&g_cameraDistance, GAMEVAR_SYSTEM | GAMEVAR_INT32PTR);