From 6704657e7124f544a9658b2c1d80ea64cb67b528 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Wed, 8 Apr 2020 17:46:48 +0200 Subject: [PATCH] Apply sematic codestyle --- Source/automap.cpp | 14 ++--- Source/codec.cpp | 2 +- Source/control.cpp | 6 +- Source/diablo.cpp | 4 +- Source/encrypt.cpp | 4 +- Source/engine.cpp | 142 ++++++++++++++++++++++---------------------- Source/gamemenu.cpp | 18 +++--- Source/gendung.cpp | 10 ++-- Source/gmenu.cpp | 2 +- 9 files changed, 101 insertions(+), 101 deletions(-) diff --git a/Source/automap.cpp b/Source/automap.cpp index feb25ad67..557f12ec7 100644 --- a/Source/automap.cpp +++ b/Source/automap.cpp @@ -96,7 +96,7 @@ void InitAutomap() return; } - dwTiles >>= 1; + dwTiles /= 2; pTmp = pAFile; for (i = 1; i <= dwTiles; i++) { @@ -234,7 +234,7 @@ void DrawAutomap() for (j = 0; j < cells; j++) { WORD maptype = GetAutomapType(mapx + j, mapy - j, TRUE); - if (maptype) + if (maptype != 0) DrawAutomapTile(x, sy, maptype); x += AmLine64; } @@ -243,7 +243,7 @@ void DrawAutomap() y = sy + AmLine16; for (j = 0; j <= cells; j++) { WORD maptype = GetAutomapType(mapx + j, mapy - j, TRUE); - if (maptype) + if (maptype != 0) DrawAutomapTile(x, y, maptype); x += AmLine64; } @@ -366,7 +366,7 @@ void DrawAutomapTile(int sx, int sy, WORD automap_type) DrawLine(sx, sy, x1, y2, COLOR_DIM); DrawLine(sx, sy, x2, y2, COLOR_DIM); } - if (!(flags & (MAPFLAG_VERTDOOR | MAPFLAG_VERTGRATE | MAPFLAG_VERTARCH))) + if ((flags & (MAPFLAG_VERTDOOR | MAPFLAG_VERTGRATE | MAPFLAG_VERTARCH)) == 0) DrawLine(sx, sy - AmLine16, sx - AmLine32, sy, COLOR_DIM); } @@ -399,7 +399,7 @@ void DrawAutomapTile(int sx, int sy, WORD automap_type) DrawLine(sx, sy, x1, y2, COLOR_DIM); DrawLine(sx, sy, x2, y2, COLOR_DIM); } - if (!(flags & (MAPFLAG_HORZDOOR | MAPFLAG_HORZGRATE | MAPFLAG_HORZARCH))) + if ((flags & (MAPFLAG_HORZDOOR | MAPFLAG_HORZGRATE | MAPFLAG_HORZARCH)) == 0) DrawLine(sx, sy - AmLine16, sx + AmLine32, sy, COLOR_DIM); } @@ -567,9 +567,9 @@ void DrawAutomapText() nextline = 50; } } - if (setlevel) + if (setlevel) { PrintGameStr(8, nextline, quest_level_names[(BYTE)setlvlnum], COL_GOLD); - else if (currlevel) { + } else if (currlevel) { sprintf(desc, "Level: %i", currlevel); PrintGameStr(8, nextline, desc, COL_GOLD); } diff --git a/Source/codec.cpp b/Source/codec.cpp index cb78b9835..0411fcefd 100644 --- a/Source/codec.cpp +++ b/Source/codec.cpp @@ -136,7 +136,7 @@ void codec_encode(BYTE *pbSrcDst, DWORD size, int size_64, char *pszPassword) sig = (CodecSignature *)pbSrcDst; sig->error = 0; sig->unused = 0; - sig->checksum = *(DWORD *)tmp; + sig->checksum = *(DWORD *)&tmp[0]; sig->last_chunk_size = last_chunk; SHA1Clear(); } diff --git a/Source/control.cpp b/Source/control.cpp index 8482c6150..5bdd2ea44 100644 --- a/Source/control.cpp +++ b/Source/control.cpp @@ -2515,7 +2515,7 @@ void control_drop_gold(char vkey) input[strlen(input) - 1] = '\0'; dropGoldValue = atoi(input); } else if (vkey - '0' >= 0 && vkey - '0' <= 9) { - if (dropGoldValue || atoi(input) <= initialDropGoldValue) { + if (dropGoldValue != 0 || atoi(input) <= initialDropGoldValue) { input[strlen(input)] = vkey; if (atoi(input) > initialDropGoldValue) return; @@ -2643,7 +2643,7 @@ char *control_print_talk_msg(char *msg, int x, int y, int *nOffset, int color) if (width > 514 + PANEL_LEFT) return msg; msg++; - if (c) { + if (c != 0) { PrintChar(*nOffset, c, color); } *nOffset += fontkern[c] + 1; @@ -2795,7 +2795,7 @@ void control_press_enter() int i; BYTE talk_save; - if (sgszTalkMsg[0]) { + if (sgszTalkMsg[0] != 0) { control_reset_talk_msg(sgszTalkMsg); for (i = 0; i < 8; i++) { if (!strcmp(sgszTalkSave[i], sgszTalkMsg)) diff --git a/Source/diablo.cpp b/Source/diablo.cpp index 29ab4a27f..97bc81910 100644 --- a/Source/diablo.cpp +++ b/Source/diablo.cpp @@ -585,7 +585,7 @@ void diablo_reload_process(HINSTANCE hInstance) ExitProcess(0); } - if (InterlockedIncrement(plMap) == 0) { + if (InterlockedIncrement(&plMap[0]) == 0) { plMap[1] = GetCurrentProcessId(); } else { hPrev = GetForegroundWindow(); @@ -832,7 +832,7 @@ BOOL LeftMouseDown(int wParam) SetCursor_(CURSOR_HAND); } } else { - if (plr[myplr]._pStatPts && !spselflag) + if (plr[myplr]._pStatPts != 0 && !spselflag) CheckLvlBtn(); if (!lvlbtndown) return LeftMouseCmd(wParam == MK_SHIFT + MK_LBUTTON); diff --git a/Source/encrypt.cpp b/Source/encrypt.cpp index dd4d0a4a2..f3f81d4d4 100644 --- a/Source/encrypt.cpp +++ b/Source/encrypt.cpp @@ -85,8 +85,8 @@ int PkwareCompress(void *buf, int size) ptr = (char *)DiabloAllocPtr(CMP_BUFFER_SIZE); destSize = 2 * size; - if (destSize < 8192) - destSize = 8192; + if (destSize < 2 * 4096) + destSize = 2 * 4096; destData = (BYTE *)DiabloAllocPtr(destSize); diff --git a/Source/engine.cpp b/Source/engine.cpp index 2107a8333..ab70bbd7d 100644 --- a/Source/engine.cpp +++ b/Source/engine.cpp @@ -83,10 +83,10 @@ void CelBlit(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth) int w; /// ASSERT: assert(pDecodeTo != NULL); - if (!pDecodeTo) + if (pDecodeTo == NULL) return; /// ASSERT: assert(pRLEBytes != NULL); - if (!pRLEBytes) + if (pRLEBytes == NULL) return; #ifdef USE_ASM @@ -191,10 +191,10 @@ void CelDraw(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth) BYTE *pRLEBytes; /// ASSERT: assert(gpBuffer); - if (!gpBuffer) + if (gpBuffer == NULL) return; /// ASSERT: assert(pCelBuff != NULL); - if (!pCelBuff) + if (pCelBuff == NULL) return; pRLEBytes = CelGetFrame(pCelBuff, nCel, &nDataSize); @@ -214,10 +214,10 @@ void CelBlitFrame(BYTE *pBuff, BYTE *pCelBuff, int nCel, int nWidth) BYTE *pRLEBytes; /// ASSERT: assert(pCelBuff != NULL); - if (!pCelBuff) + if (pCelBuff == NULL) return; /// ASSERT: assert(pBuff != NULL); - if (!pBuff) + if (pBuff == NULL) return; pRLEBytes = CelGetFrame(pCelBuff, nCel, &nDataSize); @@ -241,10 +241,10 @@ void CelClippedDraw(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int Ce int nDataStart, nDataSize, nDataCap; /// ASSERT: assert(gpBuffer); - if (!gpBuffer) + if (gpBuffer == NULL) return; /// ASSERT: assert(pCelBuff != NULL); - if (!pCelBuff) + if (pCelBuff == NULL) return; pFrameTable = (DWORD *)pCelBuff; @@ -287,10 +287,10 @@ void CelClippedBlit(BYTE *pBuff, BYTE *pCelBuff, int nCel, int nWidth, int CelSk int nDataStart, nDataSize, nDataCap; /// ASSERT: assert(pCelBuff != NULL); - if (!pCelBuff) + if (pCelBuff == NULL) return; /// ASSERT: assert(pBuff != NULL); - if (!pBuff) + if (pBuff == NULL) return; pFrameTable = (DWORD *)pCelBuff; @@ -326,10 +326,10 @@ void CelBlitLight(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth) BYTE *tbl; /// ASSERT: assert(pDecodeTo != NULL); - if (!pDecodeTo) + if (pDecodeTo == NULL) return; /// ASSERT: assert(pRLEBytes != NULL); - if (!pRLEBytes) + if (pRLEBytes == NULL) return; #ifdef USE_ASM @@ -487,10 +487,10 @@ void CelBlitLightTrans(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWid BYTE *tbl; /// ASSERT: assert(pDecodeTo != NULL); - if (!pDecodeTo) + if (pDecodeTo == NULL) return; /// ASSERT: assert(pRLEBytes != NULL); - if (!pRLEBytes) + if (pRLEBytes == NULL) return; #ifdef USE_ASM @@ -681,10 +681,10 @@ void CelDrawLight(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth) BYTE *pDecodeTo, *pRLEBytes; /// ASSERT: assert(gpBuffer); - if (!gpBuffer) + if (gpBuffer == NULL) return; /// ASSERT: assert(pCelBuff != NULL); - if (!pCelBuff) + if (pCelBuff == NULL) return; pRLEBytes = CelGetFrame(pCelBuff, nCel, &nDataSize); @@ -713,10 +713,10 @@ void CelClippedDrawLight(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, i DWORD *pFrameTable; /// ASSERT: assert(gpBuffer); - if (!gpBuffer) + if (gpBuffer == NULL) return; /// ASSERT: assert(pCelBuff != NULL); - if (!pCelBuff) + if (pCelBuff == NULL) return; pFrameTable = (DWORD *)pCelBuff; @@ -761,10 +761,10 @@ void CelClippedBlitLightTrans(BYTE *pBuff, BYTE *pCelBuff, int nCel, int nWidth, DWORD *pFrameTable; /// ASSERT: assert(pCelBuff != NULL); - if (!pCelBuff) + if (pCelBuff == NULL) return; /// ASSERT: assert(pBuff != NULL); - if (!pBuff) + if (pBuff == NULL) return; pFrameTable = (DWORD *)pCelBuff; @@ -812,10 +812,10 @@ void CelDrawLightRed(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int C DWORD *pFrameTable; /// ASSERT: assert(gpBuffer); - if (!gpBuffer) + if (gpBuffer == NULL) return; /// ASSERT: assert(pCelBuff != NULL); - if (!pCelBuff) + if (pCelBuff == NULL) return; pFrameTable = (DWORD *)pCelBuff; @@ -840,7 +840,7 @@ void CelDrawLightRed(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int C idx = light4flag ? 1024 : 4096; if (light == 2) - idx += 256; + idx += 256; // gray colors if (light >= 4) idx += (light - 1) << 8; @@ -930,13 +930,13 @@ void CelBlitSafe(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidth) int w; /// ASSERT: assert(pDecodeTo != NULL); - if (!pDecodeTo) + if (pDecodeTo == NULL) return; /// ASSERT: assert(pRLEBytes != NULL); - if (!pRLEBytes) + if (pRLEBytes == NULL) return; /// ASSERT: assert(gpBuffer); - if (!gpBuffer) + if (gpBuffer == NULL) return; #ifdef USE_ASM @@ -1055,10 +1055,10 @@ void CelClippedDrawSafe(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, in int nDataStart, nDataSize, nDataCap; /// ASSERT: assert(gpBuffer); - if (!gpBuffer) + if (gpBuffer == NULL) return; /// ASSERT: assert(pCelBuff != NULL); - if (!pCelBuff) + if (pCelBuff == NULL) return; pFrameTable = (DWORD *)pCelBuff; @@ -1101,10 +1101,10 @@ void CelClippedBlitSafe(BYTE *pBuff, BYTE *pCelBuff, int nCel, int nWidth, int C int nDataStart, nDataSize, nDataCap; /// ASSERT: assert(pCelBuff != NULL); - if (!pCelBuff) + if (pCelBuff == NULL) return; /// ASSERT: assert(pBuff != NULL); - if (!pBuff) + if (pBuff == NULL) return; pFrameTable = (DWORD *)pCelBuff; @@ -1140,13 +1140,13 @@ void CelBlitLightSafe(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int nWidt BYTE *tbl; /// ASSERT: assert(pDecodeTo != NULL); - if (!pDecodeTo) + if (pDecodeTo == NULL) return; /// ASSERT: assert(pRLEBytes != NULL); - if (!pRLEBytes) + if (pRLEBytes == NULL) return; /// ASSERT: assert(gpBuffer); - if (!gpBuffer) + if (gpBuffer == NULL) return; #ifdef USE_ASM @@ -1316,13 +1316,13 @@ void CelBlitLightTransSafe(BYTE *pDecodeTo, BYTE *pRLEBytes, int nDataSize, int BYTE *tbl; /// ASSERT: assert(pDecodeTo != NULL); - if (!pDecodeTo) + if (pDecodeTo == NULL) return; /// ASSERT: assert(pRLEBytes != NULL); - if (!pRLEBytes) + if (pRLEBytes == NULL) return; /// ASSERT: assert(gpBuffer); - if (!gpBuffer) + if (gpBuffer == NULL) return; #ifdef USE_ASM @@ -1527,10 +1527,10 @@ void CelDrawLightSafe(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int DWORD *pFrameTable; /// ASSERT: assert(gpBuffer); - if (!gpBuffer) + if (gpBuffer == NULL) return; /// ASSERT: assert(pCelBuff != NULL); - if (!pCelBuff) + if (pCelBuff == NULL) return; pFrameTable = (DWORD *)pCelBuff; @@ -1575,7 +1575,7 @@ void CelClippedBlitLightTransSafe(BYTE *pBuff, BYTE *pCelBuff, int nCel, int nWi DWORD *pFrameTable; /// ASSERT: assert(pCelBuff != NULL); - if (!pCelBuff) + if (pCelBuff == NULL) return; pFrameTable = (DWORD *)pCelBuff; @@ -1623,10 +1623,10 @@ void CelDrawLightRedSafe(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, i DWORD *pFrameTable; /// ASSERT: assert(gpBuffer); - if (!gpBuffer) + if (gpBuffer == NULL) return; /// ASSERT: assert(pCelBuff != NULL); - if (!pCelBuff) + if (pCelBuff == NULL) return; pFrameTable = (DWORD *)pCelBuff; @@ -1651,7 +1651,7 @@ void CelDrawLightRedSafe(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, i idx = light4flag ? 1024 : 4096; if (light == 2) - idx += 256; + idx += 256; // gray colors if (light >= 4) idx += (light - 1) << 8; @@ -1752,10 +1752,10 @@ void CelBlitWidth(BYTE *pBuff, int x, int y, int wdt, BYTE *pCelBuff, int nCel, BYTE *pRLEBytes, *dst, *end; /// ASSERT: assert(pCelBuff != NULL); - if (!pCelBuff) + if (pCelBuff == NULL) return; /// ASSERT: assert(pBuff != NULL); - if (!pBuff) + if (pBuff == NULL) return; #ifdef USE_ASM @@ -1878,10 +1878,10 @@ void CelBlitOutline(char col, int sx, int sy, BYTE *pCelBuff, int nCel, int nWid BYTE *pRLEBytes, *dst; /// ASSERT: assert(pCelBuff != NULL); - if (!pCelBuff) + if (pCelBuff == NULL) return; /// ASSERT: assert(gpBuffer); - if (!gpBuffer) + if (gpBuffer == NULL) return; #ifdef USE_ASM @@ -1906,11 +1906,11 @@ void CelBlitOutline(char col, int sx, int sy, BYTE *pCelBuff, int nCel, int nWid mov nDataCap, eax } - if (!nDataStart) return; + if (nDataStart == 0) return; if (CelCap == 8) nDataCap = 0; - if (nDataCap) + if (nDataCap != 0) nDataSize = nDataCap - nDataStart; else nDataSize -= nDataStart; @@ -2026,10 +2026,10 @@ void CelBlitOutlineSafe(char col, int sx, int sy, BYTE *pCelBuff, int nCel, int BYTE *pRLEBytes, *dst; /// ASSERT: assert(pCelBuff != NULL); - if (!pCelBuff) + if (pCelBuff == NULL) return; /// ASSERT: assert(gpBuffer); - if (!gpBuffer) + if (gpBuffer == NULL) return; #ifdef USE_ASM @@ -2054,11 +2054,11 @@ void CelBlitOutlineSafe(char col, int sx, int sy, BYTE *pCelBuff, int nCel, int mov nDataCap, eax } - if (!nDataStart) return; + if (nDataStart == 0) return; if (CelCap == 8) nDataCap = 0; - if (nDataCap) + if (nDataCap != 0) nDataSize = nDataCap - nDataStart; else nDataSize -= nDataStart; @@ -2741,12 +2741,12 @@ void Cl2Draw(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSkip, int nDataStart, nDataSize; /// ASSERT: assert(gpBuffer != NULL); - if (!gpBuffer) + if (gpBuffer == NULL) return; /// ASSERT: assert(pCelBuff != NULL); - if (!pCelBuff) + if (pCelBuff == NULL) return; - /// ASSERT: assert(nCel > 0); + assert(nCel > 0); if (nCel <= 0) return; @@ -2937,10 +2937,10 @@ void Cl2DrawOutline(char col, int sx, int sy, BYTE *pCelBuff, int nCel, int nWid DWORD *pFrameTable; /// ASSERT: assert(gpBuffer != NULL); - if (!gpBuffer) + if (gpBuffer == NULL) return; /// ASSERT: assert(pCelBuff != NULL); - if (!pCelBuff) + if (pCelBuff == NULL) return; /// ASSERT: assert(nCel > 0); if (nCel <= 0) @@ -3156,10 +3156,10 @@ void Cl2DrawLightTbl(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int C DWORD *pFrameTable; /// ASSERT: assert(gpBuffer != NULL); - if (!gpBuffer) + if (gpBuffer == NULL) return; /// ASSERT: assert(pCelBuff != NULL); - if (!pCelBuff) + if (pCelBuff == NULL) return; /// ASSERT: assert(nCel > 0); if (nCel <= 0) @@ -3185,7 +3185,7 @@ void Cl2DrawLightTbl(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int C idx = light4flag ? 1024 : 4096; if (light == 2) - idx += 256; + idx += 256; // gray colors if (light >= 4) idx += (light - 1) << 8; @@ -3372,10 +3372,10 @@ void Cl2DrawLight(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelS DWORD *pFrameTable; /// ASSERT: assert(gpBuffer != NULL); - if (!gpBuffer) + if (gpBuffer == NULL) return; /// ASSERT: assert(pCelBuff != NULL); - if (!pCelBuff) + if (pCelBuff == NULL) return; /// ASSERT: assert(nCel > 0); if (nCel <= 0) @@ -3422,10 +3422,10 @@ void Cl2DrawSafe(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int CelSk int nDataStart, nDataSize; /// ASSERT: assert(gpBuffer != NULL); - if (!gpBuffer) + if (gpBuffer == NULL) return; /// ASSERT: assert(pCelBuff != NULL); - if (!pCelBuff) + if (pCelBuff == NULL) return; /// ASSERT: assert(nCel > 0); if (nCel <= 0) @@ -3631,10 +3631,10 @@ void Cl2DrawOutlineSafe(char col, int sx, int sy, BYTE *pCelBuff, int nCel, int DWORD *pFrameTable; /// ASSERT: assert(gpBuffer != NULL); - if (!gpBuffer) + if (gpBuffer == NULL) return; /// ASSERT: assert(pCelBuff != NULL); - if (!pCelBuff) + if (pCelBuff == NULL) return; /// ASSERT: assert(nCel > 0); if (nCel <= 0) @@ -3863,10 +3863,10 @@ void Cl2DrawLightTblSafe(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, i DWORD *pFrameTable; /// ASSERT: assert(gpBuffer != NULL); - if (!gpBuffer) + if (gpBuffer == NULL) return; /// ASSERT: assert(pCelBuff != NULL); - if (!pCelBuff) + if (pCelBuff == NULL) return; /// ASSERT: assert(nCel > 0); if (nCel <= 0) @@ -3892,7 +3892,7 @@ void Cl2DrawLightTblSafe(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, i idx = light4flag ? 1024 : 4096; if (light == 2) - idx += 256; + idx += 256; // gray colors if (light >= 4) idx += (light - 1) << 8; @@ -4092,10 +4092,10 @@ void Cl2DrawLightSafe(int sx, int sy, BYTE *pCelBuff, int nCel, int nWidth, int DWORD *pFrameTable; /// ASSERT: assert(gpBuffer != NULL); - if (!gpBuffer) + if (gpBuffer == NULL) return; /// ASSERT: assert(pCelBuff != NULL); - if (!pCelBuff) + if (pCelBuff == NULL) return; /// ASSERT: assert(nCel > 0); if (nCel <= 0) diff --git a/Source/gamemenu.cpp b/Source/gamemenu.cpp index 354622e14..ede26776e 100644 --- a/Source/gamemenu.cpp +++ b/Source/gamemenu.cpp @@ -72,7 +72,7 @@ void gamemenu_update_single(TMenuItem *pMenuItems) if (plr[myplr]._pmode != PM_DEATH && !deathflag) enable = TRUE; - gmenu_enable(sgSingleMenu, enable); + gmenu_enable(&sgSingleMenu[0], enable); } void gamemenu_update_multi(TMenuItem *pMenuItems) @@ -229,14 +229,14 @@ void gamemenu_music_volume(BOOL bActivate) music_start(leveltype); } } else { - volume = gamemenu_slider_music_sound(sgOptionsMenu); - sound_get_or_set_music_volume(volume); - - if (volume == VOLUME_MIN) { - if (gbMusicOn) { - gbMusicOn = FALSE; - music_stop(); - } + volume = gamemenu_slider_music_sound(&sgOptionsMenu[0]); + sound_get_or_set_music_volume(volume); + + if (volume == VOLUME_MIN) { + if (gbMusicOn) { + gbMusicOn = FALSE; + music_stop(); + } } else if (!gbMusicOn) { gbMusicOn = TRUE; music_start(leveltype); diff --git a/Source/gendung.cpp b/Source/gendung.cpp index 8e0297f95..3b0cbfc9e 100644 --- a/Source/gendung.cpp +++ b/Source/gendung.cpp @@ -364,7 +364,7 @@ void MakeSpeedCels() if (total_frames > 128) total_frames = 128; - frameidx = 0; /* move into loop ? */ + frameidx = 0; if (light4flag) blk_cnt = 3; @@ -483,7 +483,7 @@ void MakeSpeedCels() for (y = 0; y < MAXDUNY; y++) { for (x = 0; x < MAXDUNX; x++) { - if (dPiece[x][y]) { + if (dPiece[x][y] != 0) { pMap = &dpiece_defs_map_2[x][y]; for (i = 0; i < blocks; i++) { if (pMap->mt[i]) { @@ -539,7 +539,7 @@ void SetDungeonMicros() for (x = 0; x < MAXDUNX; x++) { lv = dPiece[x][y]; pMap = &dpiece_defs_map_2[x][y]; - if (lv) { + if (lv != 0) { lv--; if (leveltype != DTYPE_HELL) pPiece = (WORD *)&pLevelPieces[20 * lv]; @@ -616,7 +616,7 @@ void DRLG_CopyTrans(int sx, int sy, int dx, int dy) void DRLG_ListTrans(int num, BYTE *List) { int i; - BYTE x1, x2, y1, y2; + BYTE x1, y1, x2, y2; for (i = 0; i < num; i++) { x1 = *List++; @@ -630,7 +630,7 @@ void DRLG_ListTrans(int num, BYTE *List) void DRLG_AreaTrans(int num, BYTE *List) { int i; - BYTE x1, x2, y1, y2; + BYTE x1, y1, x2, y2; for (i = 0; i < num; i++) { x1 = *List++; diff --git a/Source/gmenu.cpp b/Source/gmenu.cpp index 8235e1c1c..fee71eb71 100644 --- a/Source/gmenu.cpp +++ b/Source/gmenu.cpp @@ -62,7 +62,7 @@ void gmenu_print_text(int x, int y, char *pszStr) while (*pszStr) { c = gbFontTransTbl[(BYTE)*pszStr++]; c = lfontframe[c]; - if (c) + if (c != 0) CelDrawLight(x, y, BigTGold_cel, c, 46); x += lfontkern[c] + 2; }