From c8af0523acff3b7ee6d1d2a607d30cf0dc20604c Mon Sep 17 00:00:00 2001 From: Stephan Unverwerth Date: Fri, 29 Jun 2018 17:40:22 +0200 Subject: [PATCH] refactor leveltype to use macros (#103) --- Source/automap.cpp | 2 +- Source/control.cpp | 4 ++-- Source/cursor.cpp | 2 +- Source/diablo.cpp | 44 ++++++++++++++++++++++---------------------- Source/gendung.cpp | 30 +++++++++++++++--------------- Source/inv.cpp | 2 +- Source/items.cpp | 2 +- Source/lighting.cpp | 4 ++-- Source/missiles.cpp | 2 +- Source/objects.cpp | 20 ++++++++++---------- Source/player.cpp | 12 ++++++------ Source/scrollrt.cpp | 4 ++-- Source/stores.cpp | 6 +++--- Source/themes.cpp | 12 ++++++------ Source/trigs.cpp | 2 +- 15 files changed, 74 insertions(+), 74 deletions(-) diff --git a/Source/automap.cpp b/Source/automap.cpp index e8722e215..47799fe7b 100644 --- a/Source/automap.cpp +++ b/Source/automap.cpp @@ -229,7 +229,7 @@ void __cdecl DrawAutomap() int v25; // [esp+10h] [ebp-8h] int screen_y; // [esp+14h] [ebp-4h] - if ( leveltype ) + if ( leveltype != DTYPE_TOWN ) { screen_buf_end = (int)gpBuffer->row[352].col_unused_1; v0 = AutoMapXOfs; diff --git a/Source/control.cpp b/Source/control.cpp index 7294016eb..8a832d80a 100644 --- a/Source/control.cpp +++ b/Source/control.cpp @@ -1851,7 +1851,7 @@ LABEL_32: GetObjectStr(pcursobj); if ( pcursmonst != -1 ) { - if ( leveltype ) + if ( leveltype != DTYPE_TOWN) { _LOBYTE(infoclr) = 0; strcpy(infostr, monster[pcursmonst].mName); @@ -2641,7 +2641,7 @@ void __cdecl RedBack() v0 = -(light4flag != 0); _LOWORD(v0) = v0 & 0xF400; v12 = v0 + 0x1200; - if ( leveltype == 4 ) + if ( leveltype == DTYPE_HELL ) { v7 = gpBuffer->row[0].pixels; _EBX = &pLightTbl[v12]; diff --git a/Source/cursor.cpp b/Source/cursor.cpp index 977fda630..95c860963 100644 --- a/Source/cursor.cpp +++ b/Source/cursor.cpp @@ -740,7 +740,7 @@ LABEL_40: } if ( sbookflag && MouseX > 320 || (chrflag || questlog) && MouseX < 320 ) return; - if ( !leveltype ) + if ( leveltype == DTYPE_TOWN ) { if ( v83 ) { diff --git a/Source/diablo.cpp b/Source/diablo.cpp index 391aa18de..70e1bfe4a 100644 --- a/Source/diablo.cpp +++ b/Source/diablo.cpp @@ -932,7 +932,7 @@ LABEL_48: CheckLvlBtn(); if ( lvlbtndown ) return 0; - if ( leveltype ) + if ( leveltype != DTYPE_TOWN ) { v7 = abs(plr[myplr].WorldX - cursmx) < 2 && abs(plr[myplr].WorldY - cursmy) < 2; _HIWORD(v8) = _HIWORD(pcurs); @@ -1293,7 +1293,7 @@ LABEL_113: chrflag = 0; sbookflag = 0; spselflag = 0; - if ( qtextflag && !leveltype ) + if ( qtextflag && leveltype == DTYPE_TOWN) { qtextflag = 0; sfx_stop(); @@ -1417,7 +1417,7 @@ LABEL_106: chrflag = 0; sbookflag = 0; spselflag = 0; - if ( qtextflag && !leveltype ) + if ( qtextflag && leveltype == DTYPE_TOWN ) { qtextflag = 0; sfx_stop(); @@ -1804,7 +1804,7 @@ void __cdecl LoadLvlGFX() unsigned char *v4; // eax char *v5; // ecx - if ( !leveltype ) + if (leveltype == DTYPE_TOWN) { pDungeonCels = LoadFileInMem("Levels\\TownData\\Town.CEL", 0); pMegaTiles = LoadFileInMem("Levels\\TownData\\Town.TIL", 0); @@ -1812,18 +1812,18 @@ void __cdecl LoadLvlGFX() v5 = "Levels\\TownData\\TownS.CEL"; goto LABEL_14; } - if ( leveltype == 1 ) + if (leveltype == DTYPE_CATHEDRAL) { pDungeonCels = LoadFileInMem("Levels\\L1Data\\L1.CEL", 0); v2 = LoadFileInMem("Levels\\L1Data\\L1.TIL", 0); v3 = "Levels\\L1Data\\L1.MIN"; goto LABEL_12; } - if ( leveltype != 2 ) + if (leveltype != DTYPE_CATACOMBS) { - if ( leveltype != 3 ) + if (leveltype != DTYPE_CAVES) { - if ( leveltype != 4 ) + if (leveltype != DTYPE_HELL) { TermMsg("LoadLvlGFX"); return; @@ -1872,30 +1872,30 @@ void __fastcall CreateLevel(int lvldir) switch ( leveltype ) { - case 0: + case DTYPE_TOWN: CreateTown(lvldir); InitTownTriggers(); hnd = 0; break; - case 1: + case DTYPE_CATHEDRAL: CreateL5Dungeon(glSeedTbl[currlevel], lvldir); InitL1Triggers(); Freeupstairs(); hnd = 1; break; - case 2: + case DTYPE_CATACOMBS: CreateL2Dungeon(glSeedTbl[currlevel], lvldir); InitL2Triggers(); Freeupstairs(); hnd = 2; break; - case 3: + case DTYPE_CAVES: CreateL3Dungeon(glSeedTbl[currlevel], lvldir); InitL3Triggers(); Freeupstairs(); hnd = 3; break; - case 4: + case DTYPE_HELL: CreateL4Dungeon(glSeedTbl[currlevel], lvldir); InitL4Triggers(); Freeupstairs(); @@ -1944,11 +1944,11 @@ void __fastcall LoadGameLevel(bool firstflag, int lvldir) InitHelp(); } SetRndSeed(glSeedTbl[currlevel]); - if ( !leveltype ) + if ( leveltype == DTYPE_TOWN) SetupTownStores(); IncProgress(); InitAutomap(); - if ( leveltype && lvldir != 4 ) + if ( leveltype != DTYPE_TOWN && lvldir != 4 ) { InitLighting(); InitVision(); @@ -1961,7 +1961,7 @@ void __fastcall LoadGameLevel(bool firstflag, int lvldir) IncProgress(); FillSolidBlockTbls(); SetRndSeed(glSeedTbl[currlevel]); - if ( leveltype ) + if ( leveltype != DTYPE_TOWN ) { GetLevelMTypes(); InitThemes(); @@ -2006,7 +2006,7 @@ void __fastcall LoadGameLevel(bool firstflag, int lvldir) } } SetRndSeed(glSeedTbl[currlevel]); - if ( leveltype ) + if ( leveltype != DTYPE_TOWN) { if ( firstflag || lvldir == 4 || !plr[myplr]._pLvlVisited[currlevel] || gbMaxPlayers != 1 ) { @@ -2119,7 +2119,7 @@ LABEL_72: } } - if ( leveltype ) + if ( leveltype != DTYPE_TOWN ) SetDungeonMicros(); InitLightMax(); IncProgress(); @@ -2129,7 +2129,7 @@ LABEL_72: InitControlPan(); IncProgress(); } - if ( leveltype ) + if ( leveltype != DTYPE_TOWN) { ProcessLightList(); ProcessVisionList(); @@ -2201,7 +2201,7 @@ void __cdecl game_logic() } if ( gbProcessPlayers ) ProcessPlayers(); - if ( leveltype ) + if ( leveltype != DTYPE_TOWN ) { ProcessMonsters(); ProcessObjects(); @@ -2276,11 +2276,11 @@ void __cdecl diablo_color_cyc_logic() color_cycle_timer = v0; if ( palette_get_colour_cycling() ) { - if ( leveltype == 4 ) + if ( leveltype == DTYPE_HELL ) { lighting_color_cycling(); } - else if ( leveltype == 3 ) + else if ( leveltype == DTYPE_CAVES ) { if ( fullscreen ) palette_update_caves(); diff --git a/Source/gendung.cpp b/Source/gendung.cpp index 376ddd364..b76871043 100644 --- a/Source/gendung.cpp +++ b/Source/gendung.cpp @@ -83,7 +83,7 @@ void __cdecl FillSolidBlockTbls() memset(nTransTable, 0, 0x801u); memset(nMissileTable, 0, 0x801u); memset(nTrapTable, 0, 0x801u); - if ( leveltype ) + if ( leveltype != DTYPE_TOWN ) { switch ( leveltype ) { @@ -211,7 +211,7 @@ void __cdecl gendung_418D91() } while ( v0 < 2048 ); v1 = dpiece_defs_map_2; - v48 = 2 * (leveltype == 4) + 10; + v48 = 2 * (leveltype == DTYPE_HELL) + 10; do { v2 = v1; @@ -250,7 +250,7 @@ void __cdecl gendung_418D91() } v9 = 0; level_frame_sizes[0] = 0; - if ( leveltype == 4 && v8 > 0 ) + if ( leveltype == DTYPE_HELL && v8 > 0 ) { do { @@ -600,7 +600,7 @@ void __cdecl SetDungeonMicros() int (*v9)[112]; // [esp+Ch] [ebp-8h] signed int v10; // [esp+10h] [ebp-4h] - if ( leveltype == 4 ) + if ( leveltype == DTYPE_HELL ) { dword_5A5594 = 12; v0 = 16; @@ -622,7 +622,7 @@ void __cdecl SetDungeonMicros() if ( (*v2)[0] ) { v3 = (*v2)[0] - 1; - if ( leveltype == 4 ) + if ( leveltype == DTYPE_HELL ) v4 = *(_DWORD *)&dpiece_defs[0].blocks + 32 * v3; else v4 = *(_DWORD *)&dpiece_defs[0].blocks + 20 * v3; @@ -1067,7 +1067,7 @@ LABEL_52: v21 = &dungeon[v6][v4]; while ( 1 ) { - if ( leveltype != 2 ) + if ( leveltype != DTYPE_CATACOMBS ) goto LABEL_21; if ( v4 == v2 && v6 >= themeLoc[v1].x && v6 <= v20 ) goto LABEL_12; @@ -1080,7 +1080,7 @@ LABEL_16: goto LABEL_19; *v21 = 3; LABEL_21: - if ( leveltype == 3 ) + if ( leveltype == DTYPE_CAVES ) { if ( v4 == v2 && v6 >= themeLoc[v1].x && v6 <= v20 ) { @@ -1111,7 +1111,7 @@ LABEL_35: goto LABEL_35; *v21 = 7; } - if ( leveltype != 4 ) + if ( leveltype != DTYPE_HELL ) goto LABEL_51; if ( v4 != v2 || v6 < themeLoc[v1].x || v6 > v20 ) { @@ -1151,7 +1151,7 @@ LABEL_13: goto LABEL_16; } LABEL_53: - if ( leveltype == 2 ) + if ( leveltype == DTYPE_CATACOMBS ) { v7 = themeLoc[v1].x; v8 = 10 * (v7 + themeLoc[v1].width); @@ -1161,7 +1161,7 @@ LABEL_53: dungeon[0][v5 + v2 - 1] = 9; // *((_BYTE *)&dMonster[111][111] + v5 + v2 + 3) = 9; dungeon[-1][v3 + v8 * 4 + v2 - 1] = 6; // *((_BYTE *)&dMonster[111][101] + v3 + v8 * 4 + v2 + 3) = 6; } - if ( leveltype == 3 ) + if ( leveltype == DTYPE_CAVES ) { v9 = themeLoc[v1].x; v10 = 10 * (v9 + themeLoc[v1].width); @@ -1171,7 +1171,7 @@ LABEL_53: dungeon[0][v5 + v2 - 1] = 152; // *((_BYTE *)&dMonster[111][111] + v5 + v2 + 3) = -104; dungeon[-1][v3 + v10 * 4 + v2 - 1] = 138; // *((_BYTE *)&dMonster[111][101] + v3 + v10 * 4 + v2 + 3) = -118; } - if ( leveltype == 4 ) + if ( leveltype == DTYPE_HELL ) { v11 = themeLoc[v1].x; v12 = 10 * (v11 + themeLoc[v1].width); @@ -1181,7 +1181,7 @@ LABEL_53: dungeon[0][v5 + v2 - 1] = 15; // *((_BYTE *)&dMonster[111][111] + v5 + v2 + 3) = 15; dungeon[-1][v3 + v12 * 4 + v2 - 1] = 12; // *((_BYTE *)&dMonster[111][101] + v3 + v12 * 4 + v2 + 3) = 12; } - if ( leveltype == 2 ) + if ( leveltype == DTYPE_CATACOMBS ) { _LOBYTE(v5) = 0; v13 = random(v5, 2); @@ -1203,7 +1203,7 @@ LABEL_53: // *((_BYTE *)&dMonster[111][10 * (themeLoc[v1].x + themeLoc[v1].width) + 102] + themeLoc[v1].height / 2 + v5) = 4; } } - if ( leveltype == 3 ) + if ( leveltype == DTYPE_CAVES ) { _LOBYTE(v5) = 0; v14 = random(v5, 2); @@ -1225,7 +1225,7 @@ LABEL_53: // *((_BYTE *)&dMonster[111][10 * (themeLoc[v1].x + themeLoc[v1].width) + 102] + themeLoc[v1].height / 2 + v5) = -109; } } - if ( leveltype == 4 ) + if ( leveltype == DTYPE_HELL ) { _LOBYTE(v5) = 0; v15 = random(v5, 2); @@ -1333,7 +1333,7 @@ void __fastcall DRLG_PlaceThemeRooms(int minSize, int maxSize, int floor, int fr themeLoc[v18].height = v16; v20 = x + v19; v21 = v5 + v16; - if ( leveltype == 3 ) + if ( leveltype == DTYPE_CAVES ) DRLG_RectTrans(x_start, 2 * v5 + 20, 2 * v20 + 15, 2 * v21 + 15); else DRLG_MRectTrans(x + 1, v5 + 1, v20, v21); diff --git a/Source/inv.cpp b/Source/inv.cpp index b85879152..8ede90276 100644 --- a/Source/inv.cpp +++ b/Source/inv.cpp @@ -3017,7 +3017,7 @@ bool __cdecl UseScroll() signed int v4; // esi int *v5; // ecx - if ( pcurs != CURSOR_HAND || !leveltype && !*(_DWORD *)&spelldata[plr[myplr]._pRSpell].sTownSpell ) + if ( pcurs != CURSOR_HAND || leveltype == DTYPE_TOWN && !*(_DWORD *)&spelldata[plr[myplr]._pRSpell].sTownSpell ) return 0; v0 = myplr; v1 = 0; diff --git a/Source/items.cpp b/Source/items.cpp index 17e6e492f..584413f24 100644 --- a/Source/items.cpp +++ b/Source/items.cpp @@ -2111,7 +2111,7 @@ void __fastcall GetItemAttrs(int i, int idata, int lvl) if ( gnDifficulty == DIFF_HELL ) rndv = 5 * (currlevel + 32) + random(21, 10 * (currlevel + 32)); - if ( leveltype == 4 ) + if ( leveltype == DTYPE_HELL ) rndv += rndv >> 3; if ( rndv > 5000 ) rndv = 5000; diff --git a/Source/lighting.cpp b/Source/lighting.cpp index 6c29abddf..d63996ee0 100644 --- a/Source/lighting.cpp +++ b/Source/lighting.cpp @@ -1201,7 +1201,7 @@ void __cdecl MakeLightTable() } memset(v0, 0, 0x100u); v12 = v0 + 256; - if ( leveltype == 4 ) + if ( leveltype == DTYPE_HELL ) { v13 = pLightTbl; if ( v1 > 0 ) @@ -1753,7 +1753,7 @@ void __cdecl lighting_color_cycling() char v4; // dl const void *v5; // esi - if ( leveltype == 4 ) + if ( leveltype == DTYPE_HELL ) { v0 = pLightTbl; if ( (light4flag != 0 ? 4 : 16) > 0 ) diff --git a/Source/missiles.cpp b/Source/missiles.cpp index ca613364a..dae505073 100644 --- a/Source/missiles.cpp +++ b/Source/missiles.cpp @@ -6368,7 +6368,7 @@ void __fastcall MI_Teleport(int i) v9 = plr[v2].WorldX; missile[v1]._miVar1 = 1; v10 = plr[v2].WorldY; - v11 = leveltype == 0; + v11 = leveltype == DTYPE_TOWN; dPlayer[v9][v10] = v2 + 1; if ( !v11 ) { diff --git a/Source/objects.cpp b/Source/objects.cpp index 919338e88..50dbbb2c5 100644 --- a/Source/objects.cpp +++ b/Source/objects.cpp @@ -1134,7 +1134,7 @@ void __cdecl AddChestTraps() if ( v3 >= OBJ_CHEST1 && v3 <= OBJ_CHEST3 && !object[v2]._oTrapFlag && random(0, 100) < 10 ) { object[v2]._otype += OBJ_BOOKCASER; - v4 = leveltype == 2; + v4 = leveltype == DTYPE_CATACOMBS; object[v2]._oTrapFlag = 1; if ( v4 ) v5 = random(0, 2); @@ -1518,7 +1518,7 @@ void __fastcall InitObjects(int a1) AddStoryBooks(); if ( currlevel == 12 ) AddStoryBooks(); - if ( leveltype == 1 ) + if ( leveltype == DTYPE_CATHEDRAL ) { //_LOBYTE(v1) = QuestStatus(6); if ( QuestStatus(6) ) @@ -1533,7 +1533,7 @@ void __fastcall InitObjects(int a1) AddL1Objs(0, 0, 112, 112); InitRndBarrels(); } - if ( leveltype == 2 ) + if ( leveltype == DTYPE_CATACOMBS ) { //_LOBYTE(v4) = QuestStatus(0); if ( QuestStatus(0) ) @@ -1603,12 +1603,12 @@ void __fastcall InitObjects(int a1) { v8 = v16; } - if ( leveltype == 3 ) + if ( leveltype == DTYPE_CAVES ) { AddL3Objs(0, 0, 112, 112); InitRndBarrels(); } - if ( leveltype == 4 ) + if ( leveltype == DTYPE_HELL ) { //_LOBYTE(v12) = QuestStatus(11); if ( QuestStatus(11) ) @@ -3085,7 +3085,7 @@ void __fastcall ObjSetMicro(int dx, int dy, int pn) dPiece[0][dy + 112 * dx] = pn; v3 = pn - 1; v4 = (char *)dpiece_defs_map_1 + 32 * gendung_get_dpiece_num_from_coord(dx, dy); - if ( leveltype == 4 ) + if ( leveltype == DTYPE_HELL ) { v7 = *(_DWORD *)&dpiece_defs[0].blocks + 32 * v3; v8 = 0; @@ -3911,12 +3911,12 @@ void __fastcall ObjChangeMap(int x1, int y1, int x2, int y2) while ( i <= v5 ); } } - if ( leveltype == 1 ) + if ( leveltype == DTYPE_CATHEDRAL ) { ObjL1Special(2 * v6 + 16, 2 * v4 + 16, 2 * v5 + 17, 2 * y2 + 17); AddL1Objs(2 * v6 + 16, 2 * v4 + 16, 2 * v5 + 17, 2 * y2 + 17); /* v7 */ } - if ( leveltype == 2 ) + if ( leveltype == DTYPE_CATACOMBS ) { v8 = 2 * v5 + 17; v9 = 2 * v4 + 16; @@ -3958,9 +3958,9 @@ void __fastcall ObjChangeMapResync(int x1, int y1, int x2, int y2) v5 = v8; } } - if ( leveltype == 1 ) + if ( leveltype == DTYPE_CATHEDRAL ) ObjL1Special(2 * v6 + 16, 2 * v5 + 16, 2 * x2 + 17, 2 * v4 + 17); - if ( leveltype == 2 ) + if ( leveltype == DTYPE_CATACOMBS ) ObjL2Special(2 * v6 + 16, 2 * v5 + 16, 2 * x2 + 17, 2 * v4 + 17); } // 5BB1ED: using guessed type char leveltype; diff --git a/Source/player.cpp b/Source/player.cpp index 60fe2e0ac..7340b8d9c 100644 --- a/Source/player.cpp +++ b/Source/player.cpp @@ -570,7 +570,7 @@ void __fastcall SetPlrAnims(int pnum) v3 = v1; v4 = SLOBYTE(plr[v1]._pClass); v5 = v4; - v6 = leveltype == 0; + v6 = leveltype == DTYPE_TOWN; plr[v3]._pNWidth = 96; plr[v3]._pWWidth = 96; plr[v3]._pAWidth = 128; @@ -1377,7 +1377,7 @@ void __fastcall PlrDoTrans(int x, int y) int v7; // eax int v8; // [esp+8h] [ebp-4h] - if ( leveltype == 1 || leveltype == 2 ) + if ( leveltype == DTYPE_CATHEDRAL || leveltype == DTYPE_CATACOMBS ) { v2 = y - 1; if ( y - 1 <= y + 1 ) @@ -1894,7 +1894,7 @@ void __fastcall StartWalk3(int pnum, int xvel, int yvel, int xoff, int yoff, int plr[v12]._pVar4 = x; plr[v12]._pyoff = yoff; dFlags[x][v16] |= 0x20u; - v17 = leveltype == 0; + v17 = leveltype == DTYPE_TOWN; plr[v12]._pxoff = xoff; if ( !v17 ) { @@ -2999,7 +2999,7 @@ LABEL_9: v7 = v5 + plr[v2]._pVar1; v8 = plr[v2]._pVar2 + v6; plr[v2].WorldX = v7; - v9 = leveltype == 0; + v9 = leveltype == DTYPE_TOWN; dPlayer[v7][v8] = v1 + 1; plr[v2].WorldY = v8; if ( !v9 ) @@ -3129,7 +3129,7 @@ LABEL_9: plr[v2].WorldX = v5; *v6 &= 0xDFu; v7 = plr[v2]._pVar2; - v8 = leveltype == 0; + v8 = leveltype == DTYPE_TOWN; dPlayer[v5][v7] = v1 + 1; plr[v2].WorldY = v7; if ( !v8 ) @@ -4934,7 +4934,7 @@ void __fastcall CheckPlrSpell() v2 = plr[v0]._pRSpell; if ( v2 != -1 ) { - if ( !leveltype && !*(_DWORD *)&spelldata[v2].sTownSpell ) + if ( leveltype == DTYPE_TOWN && !*(_DWORD *)&spelldata[v2].sTownSpell ) { v5 = *((_BYTE *)&plr[0]._pClass + v1); switch ( v5 ) diff --git a/Source/scrollrt.cpp b/Source/scrollrt.cpp index 73f837159..1875f482a 100644 --- a/Source/scrollrt.cpp +++ b/Source/scrollrt.cpp @@ -762,7 +762,7 @@ void __fastcall scrollrt_draw_lower(int x, int y, int sx, int sy, int a5, int so drawLowerScreen(v19); v20 = v8[11]; level_cel_block = v8[11]; - if ( v20 && leveltype == 4 ) + if ( v20 && leveltype == DTYPE_HELL ) drawLowerScreen(v19 - 24576); v21 = sy; scrollrt_draw_clipped_dungeon((char *)gpBuffer + screen_y_times_768[sy] + sx, sxa, sya, sx, sy, 0); @@ -887,7 +887,7 @@ LABEL_23: level_cel_block = v8[10]; if ( v45 ) { - if ( leveltype == 4 ) + if ( leveltype == DTYPE_HELL ) drawLowerScreen(v44 - 24576); } scrollrt_draw_clipped_dungeon((char *)gpBuffer + *v51 + sx, sxa, sya, sx, sy, 0); diff --git a/Source/stores.cpp b/Source/stores.cpp index 7c43d8b55..3cd0b8ca6 100644 --- a/Source/stores.cpp +++ b/Source/stores.cpp @@ -2252,7 +2252,7 @@ void __cdecl STextESC() if ( qtextflag ) { qtextflag = 0; - if ( !leveltype ) + if ( leveltype == DTYPE_TOWN ) sfx_stop(); } else @@ -4051,7 +4051,7 @@ void __cdecl STextEnter() if ( qtextflag ) { qtextflag = 0; - if ( !leveltype ) + if ( leveltype == DTYPE_TOWN ) sfx_stop(); } else @@ -4150,7 +4150,7 @@ void __cdecl CheckStoreBtn() if ( qtextflag ) { qtextflag = 0; - if ( !leveltype ) + if ( leveltype == DTYPE_TOWN ) sfx_stop(); } else if ( stextsel != -1 && MouseY >= 32 && MouseY <= 320 ) diff --git a/Source/themes.cpp b/Source/themes.cpp index 9f6807f2b..c14f18470 100644 --- a/Source/themes.cpp +++ b/Source/themes.cpp @@ -326,13 +326,13 @@ LABEL_21: } if ( leveltype != 3 ) { - v6 = leveltype == 4; + v6 = leveltype == DTYPE_HELL; goto LABEL_21; } return 0; } LABEL_16: - v6 = leveltype == 1; + v6 = leveltype == DTYPE_CATHEDRAL; goto LABEL_21; } v7 = t - 12; @@ -354,7 +354,7 @@ LABEL_16: return rv; goto LABEL_16; } - if ( leveltype == 4 ) + if ( leveltype == DTYPE_HELL ) { v6 = cauldronFlag == 0; goto LABEL_21; @@ -575,7 +575,7 @@ void __cdecl InitThemes() if ( currlevel != 16 ) { v1 = leveltype; - if ( leveltype == 1 ) + if ( leveltype == DTYPE_CATHEDRAL ) { ThemeGoodIn[0] = 0; ThemeGoodIn[1] = 0; @@ -683,7 +683,7 @@ void __cdecl HoldThemeRooms() if ( currlevel != 16 ) { - if ( leveltype == 1 ) + if ( leveltype == DTYPE_CATHEDRAL ) { v0 = numthemes; for ( i = 0; i < v0; ++i ) @@ -1514,7 +1514,7 @@ void __cdecl CreateThemeRooms() } } InitObjFlag = 0; - if ( leveltype == 4 && themeCount > 0 ) + if ( leveltype == DTYPE_HELL && themeCount > 0 ) UpdateL4Trans(); } } diff --git a/Source/trigs.cpp b/Source/trigs.cpp index f6fe335cb..4b2d21dd8 100644 --- a/Source/trigs.cpp +++ b/Source/trigs.cpp @@ -1227,7 +1227,7 @@ void __cdecl CheckTrigForce() break; default: LABEL_14: - if ( !leveltype ) + if ( leveltype == DTYPE_TOWN ) goto LABEL_24; if ( trigflag[3] ) {