SW: automapping (deleted), visibility --> g_visibility, numpalookups --> numshades

git-svn-id: https://svn.eduke32.com/eduke32@5207 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
hendricks266 2015-05-19 22:03:30 +00:00
parent 1f59b4c23e
commit 6d0da8bb1a
8 changed files with 38 additions and 42 deletions

View file

@ -80,16 +80,18 @@ void PrevCheat(PLAYERp UNUSED(pp), char *UNUSED(cheat_string))
ExitLevel = TRUE; ExitLevel = TRUE;
} }
static int32_t showallmap;
void MapCheat(PLAYERp pp, char *UNUSED(cheat_string)) void MapCheat(PLAYERp pp, char *UNUSED(cheat_string))
{ {
automapping ^= 1; showallmap ^= 1;
if (automapping) if (showallmap)
MapSetAll2D(0); MapSetAll2D(0);
else else
MapSetAll2D(0xFF); MapSetAll2D(0xFF);
sprintf(ds, "AUTOMAPPING %s", automapping ? "ON" : "OFF"); sprintf(ds, "SHOWALLMAP %s", showallmap ? "ON" : "OFF");
PutStringInfo(pp, ds); PutStringInfo(pp, ds);
} }

View file

@ -2386,7 +2386,7 @@ drawscreen(PLAYERp pp)
} }
QuakeViewChange(camerapp, &quake_z, &quake_x, &quake_y, &quake_ang); QuakeViewChange(camerapp, &quake_z, &quake_x, &quake_y, &quake_ang);
VisViewChange(camerapp, &visibility); VisViewChange(camerapp, &g_visibility);
tz = tz + quake_z; tz = tz + quake_z;
tx = tx + quake_x; tx = tx + quake_x;
ty = ty + quake_y; ty = ty + quake_y;

View file

@ -676,13 +676,7 @@ MapSetAll2D(uint8_t fill)
void void
MapSetup(void) MapSetup(void)
{ {
#define NO_AUTO_MAPPING FALSE
#if NO_AUTO_MAPPING
MapSetAll2D(0xFF); MapSetAll2D(0xFF);
#else
automapping = TRUE;
#endif
} }
void void
@ -1391,11 +1385,11 @@ InitLevel(void)
if (sector[0].extra != -1) if (sector[0].extra != -1)
{ {
NormalVisibility = visibility = sector[0].extra; NormalVisibility = g_visibility = sector[0].extra;
sector[0].extra = 0; sector[0].extra = 0;
} }
else else
NormalVisibility = visibility; NormalVisibility = g_visibility;
// //
// Do Player stuff first // Do Player stuff first
@ -4384,22 +4378,22 @@ DebugKeys(PLAYERp pp)
{ {
if (KEY_PRESSED(KEYSC_LSHIFT) | KEY_PRESSED(KEYSC_RSHIFT)) // SHIFT if (KEY_PRESSED(KEYSC_LSHIFT) | KEY_PRESSED(KEYSC_RSHIFT)) // SHIFT
{ {
visibility = visibility - (visibility >> 3); g_visibility = g_visibility - (g_visibility >> 3);
if (visibility < 128) if (g_visibility < 128)
visibility = 16348; g_visibility = 16348;
//if (visibility > 16384) //if (g_visibility > 16384)
// visibility = 128; // g_visibility = 128;
} }
else else
{ {
KEY_PRESSED(KEYSC_L) = 0; KEY_PRESSED(KEYSC_L) = 0;
visibility = visibility - (visibility >> 3); g_visibility = g_visibility - (g_visibility >> 3);
if (visibility > 16384) if (g_visibility > 16384)
visibility = 128; g_visibility = 128;
} }
} }

View file

@ -571,7 +571,7 @@ DoPlayerNightVisionPalette(PLAYERp pp)
if (NightVision) if (NightVision)
return; // Already using night vision, don't return; // Already using night vision, don't
// bother. // bother.
visibility = 0; g_visibility = 0;
for (i = 0; i < numsectors; i++) for (i = 0; i < numsectors; i++)
{ {
sectorfloorpals[i] = sector[i].floorpal; sectorfloorpals[i] = sector[i].floorpal;
@ -591,7 +591,7 @@ DoPlayerNightVisionPalette(PLAYERp pp)
} }
else else
{ {
visibility = NormalVisibility; g_visibility = NormalVisibility;
for (i = 0; i < numsectors; i++) for (i = 0; i < numsectors; i++)
{ {
sector[i].floorpal = sectorfloorpals[i]; sector[i].floorpal = sectorfloorpals[i];

View file

@ -1402,18 +1402,18 @@ MoreKeys(short searchstat, short searchwall, short searchsector, short pointhigh
if (KEY_PRESSED(KEYSC_KPMINUS)) if (KEY_PRESSED(KEYSC_KPMINUS))
{ {
KEY_PRESSED(KEYSC_KPMINUS) = 0; KEY_PRESSED(KEYSC_KPMINUS) = 0;
visibility = visibility - (visibility >> 3); g_visibility = g_visibility - (g_visibility >> 3);
if (visibility < 0) if (g_visibility < 0)
visibility = 16348; g_visibility = 16348;
} }
else if (KEY_PRESSED(KEYSC_KPPLUS)) else if (KEY_PRESSED(KEYSC_KPPLUS))
{ {
KEY_PRESSED(KEYSC_KPPLUS) = 0; KEY_PRESSED(KEYSC_KPPLUS) = 0;
visibility = visibility + (visibility >> 3); g_visibility = g_visibility + (g_visibility >> 3);
if (visibility > 16348) if (g_visibility > 16348)
visibility = 0; g_visibility = 0;
} }
} }
@ -2070,7 +2070,7 @@ ExtCheckKeys(void)
// try it every time through the loop // try it every time through the loop
SetSpriteExtra(); SetSpriteExtra();
sector[0].extra = visibility; sector[0].extra = g_visibility;
// if(!BKeyPressed()) // if(!BKeyPressed())
// ticdiff = totalclock-oldtotalclock; // Difference in tics from last time // ticdiff = totalclock-oldtotalclock; // Difference in tics from last time
@ -2189,11 +2189,11 @@ ExtLoadMap(const char *mapname)
// if in valid range set visiblity for the map // if in valid range set visiblity for the map
if (sector[0].extra != -1 && sector[0].extra > 0 && sector[0].extra < 16384) if (sector[0].extra != -1 && sector[0].extra > 0 && sector[0].extra < 16384)
visibility = sector[0].extra; g_visibility = sector[0].extra;
else else
// if NOT in valid range set a default // if NOT in valid range set a default
visibility = 2; g_visibility = 2;
// Load up voxel sprites from voxel script file // Load up voxel sprites from voxel script file
//LoadKVXFromScript("swvoxfil.txt"); //LoadKVXFromScript("swvoxfil.txt");

View file

@ -737,12 +737,12 @@ JS_DrawMirrors(PLAYERp pp, int tx, int ty, int tz, short tpang, int tphoriz)
ASSERT(sp); ASSERT(sp);
// tvisibility = visibility; // tvisibility = g_visibility;
// visibility <<= 1; // Make mirror darker // g_visibility <<= 1; // Make mirror darker
// Make TV cam style mirror seem to shimmer // Make TV cam style mirror seem to shimmer
// if (mirror[cnt].ismagic && STD_RANDOM_P2(256) > 128) // if (mirror[cnt].ismagic && STD_RANDOM_P2(256) > 128)
// visibility -= STD_RANDOM_P2(128); // g_visibility -= STD_RANDOM_P2(128);
// Calculate the angle of the mirror wall // Calculate the angle of the mirror wall
w = mirror[cnt].mirrorwall; w = mirror[cnt].mirrorwall;
@ -903,8 +903,8 @@ JS_DrawMirrors(PLAYERp pp, int tx, int ty, int tz, short tpang, int tphoriz)
} }
// visibility = tvisibility; // g_visibility = tvisibility;
// visibility = NormalVisibility; // g_visibility = NormalVisibility;
// drawrooms(tx, ty, tz, tpang, tphoriz, pp->cursectnum); // drawrooms(tx, ty, tz, tpang, tphoriz, pp->cursectnum);
// Clean up anything that the camera view might have done // Clean up anything that the camera view might have done

View file

@ -1127,14 +1127,14 @@ DoPlayerSpriteReset(short SpriteNum)
int int
SetVisHigh(void) SetVisHigh(void)
{ {
// visibility = NormalVisibility>>1; // g_visibility = NormalVisibility>>1;
return 0; return 0;
} }
int int
SetVisNorm(void) SetVisNorm(void)
{ {
// visibility = NormalVisibility; // g_visibility = NormalVisibility;
return 0; return 0;
} }

View file

@ -582,10 +582,10 @@ int SaveGame(short save_num)
MWRITE(&totalclock,sizeof(totalclock),1,fil); MWRITE(&totalclock,sizeof(totalclock),1,fil);
MWRITE(&numframes,sizeof(numframes),1,fil); MWRITE(&numframes,sizeof(numframes),1,fil);
MWRITE(&randomseed,sizeof(randomseed),1,fil); MWRITE(&randomseed,sizeof(randomseed),1,fil);
MWRITE(&numpalookups,sizeof(numpalookups),1,fil); MWRITE(&numshades,sizeof(numshades),1,fil);
MWRITE(&NormalVisibility,sizeof(NormalVisibility),1,fil); MWRITE(&NormalVisibility,sizeof(NormalVisibility),1,fil);
MWRITE(&visibility,sizeof(visibility),1,fil); MWRITE(&g_visibility,sizeof(g_visibility),1,fil);
MWRITE(&parallaxtype,sizeof(parallaxtype),1,fil); MWRITE(&parallaxtype,sizeof(parallaxtype),1,fil);
MWRITE(&parallaxyoffs,sizeof(parallaxyoffs),1,fil); MWRITE(&parallaxyoffs,sizeof(parallaxyoffs),1,fil);
MWRITE(pskyoff,sizeof(pskyoff),1,fil); MWRITE(pskyoff,sizeof(pskyoff),1,fil);
@ -1073,10 +1073,10 @@ int LoadGame(short save_num)
MREAD(&totalclock,sizeof(totalclock),1,fil); MREAD(&totalclock,sizeof(totalclock),1,fil);
MREAD(&numframes,sizeof(numframes),1,fil); MREAD(&numframes,sizeof(numframes),1,fil);
MREAD(&randomseed,sizeof(randomseed),1,fil); MREAD(&randomseed,sizeof(randomseed),1,fil);
MREAD(&numpalookups,sizeof(numpalookups),1,fil); MREAD(&numshades,sizeof(numshades),1,fil);
MREAD(&NormalVisibility,sizeof(NormalVisibility),1,fil); MREAD(&NormalVisibility,sizeof(NormalVisibility),1,fil);
MREAD(&visibility,sizeof(visibility),1,fil); MREAD(&g_visibility,sizeof(g_visibility),1,fil);
MREAD(&parallaxtype,sizeof(parallaxtype),1,fil); MREAD(&parallaxtype,sizeof(parallaxtype),1,fil);
MREAD(&parallaxyoffs,sizeof(parallaxyoffs),1,fil); MREAD(&parallaxyoffs,sizeof(parallaxyoffs),1,fil);
MREAD(pskyoff,sizeof(pskyoff),1,fil); MREAD(pskyoff,sizeof(pskyoff),1,fil);