diff --git a/src/ArmsItem.cpp b/src/ArmsItem.cpp index 2791ad00..5d7789b9 100644 --- a/src/ArmsItem.cpp +++ b/src/ArmsItem.cpp @@ -324,13 +324,13 @@ void PutCampObject() PutBitmap3(&rcView, 40 * i + (WINDOW_WIDTH - 224) / 2, (WINDOW_HEIGHT - 192) / 2, &rcArms, SURFACE_ID_ARMS_IMAGE); PutBitmap3(&rcView, 40 * i + (WINDOW_WIDTH - 224) / 2, (WINDOW_HEIGHT - 128) / 2, &rcPer, SURFACE_ID_TEXT_BOX); PutBitmap3(&rcView, 40 * i + (WINDOW_WIDTH - 224) / 2, (WINDOW_HEIGHT - 160) / 2, &rcLv, SURFACE_ID_TEXT_BOX); - PutNumber4(40 * i + (WINDOW_WIDTH - 224) / 2, (WINDOW_HEIGHT - 160) / 2, gArmsData[i].level, 0); + PutNumber4(40 * i + (WINDOW_WIDTH - 224) / 2, (WINDOW_HEIGHT - 160) / 2, gArmsData[i].level, FALSE); // Draw ammo if (gArmsData[i].max_num) { - PutNumber4(40 * i + (WINDOW_WIDTH - 224) / 2, (WINDOW_HEIGHT - 144) / 2, gArmsData[i].num, 0); - PutNumber4(40 * i + (WINDOW_WIDTH - 224) / 2, (WINDOW_HEIGHT - 128) / 2, gArmsData[i].max_num, 0); + PutNumber4(40 * i + (WINDOW_WIDTH - 224) / 2, (WINDOW_HEIGHT - 144) / 2, gArmsData[i].num, FALSE); + PutNumber4(40 * i + (WINDOW_WIDTH - 224) / 2, (WINDOW_HEIGHT - 128) / 2, gArmsData[i].max_num, FALSE); } else { diff --git a/src/Game.cpp b/src/Game.cpp index 82b5aa36..cca03ae1 100644 --- a/src/Game.cpp +++ b/src/Game.cpp @@ -56,7 +56,7 @@ int Random(int min, int max) return min + rep_rand() % (max - min + 1); } -void PutNumber4(int x, int y, int value, bool bZero) +void PutNumber4(int x, int y, int value, BOOL bZero) { // Define rects RECT rcClient = grcFull; @@ -189,7 +189,7 @@ int ModeOpening() if (tscRet == 2) return 1; - PutMapName(false); + PutMapName(FALSE); PutTextScript(); PutFramePerSecound(); @@ -317,7 +317,7 @@ int ModeTitle() // Start loop unsigned int wait = 0; - while (true) + while (1) { // Don't accept selection for 10 frames if (wait < 10) @@ -365,10 +365,10 @@ int ModeTitle() int v1, v2, v3, v4; GetCompileVersion(&v1, &v2, &v3, &v4); - PutNumber4((WINDOW_WIDTH - 40) / 2, WINDOW_HEIGHT - 24, v1, 0); - PutNumber4((WINDOW_WIDTH - 8) / 2, WINDOW_HEIGHT - 24, v2, 0); - PutNumber4((WINDOW_WIDTH + 24) / 2, WINDOW_HEIGHT - 24, v3, 0); - PutNumber4((WINDOW_WIDTH + 56) / 2, WINDOW_HEIGHT - 24, v4, 0); + PutNumber4((WINDOW_WIDTH - 40) / 2, WINDOW_HEIGHT - 24, v1, FALSE); + PutNumber4((WINDOW_WIDTH - 8) / 2, WINDOW_HEIGHT - 24, v2, FALSE); + PutNumber4((WINDOW_WIDTH + 24) / 2, WINDOW_HEIGHT - 24, v3, FALSE); + PutNumber4((WINDOW_WIDTH + 56) / 2, WINDOW_HEIGHT - 24, v4, FALSE); // Draw main title PutBitmap3(&grcGame, (WINDOW_WIDTH - 144) / 2, 40, &rcTitle, SURFACE_ID_TITLE); @@ -447,7 +447,7 @@ int ModeAction() unsigned long color = GetCortBoxColor(RGB(0, 0, 0x20)); - bool swPlay = true; + unsigned int swPlay = 1; // Reset stuff gCounter = 0; @@ -471,7 +471,7 @@ int ModeAction() if ((bContinue && LoadProfile(NULL)) || InitializeGame()) { - while (true) + while (1) { // Get pressed keys GetTrg(); @@ -486,12 +486,12 @@ int ModeAction() return 1; } - if (swPlay & 1 && g_GameFlags & 1) + if (swPlay % 2 && g_GameFlags & 1) { if (g_GameFlags & 2) - ActMyChar(true); + ActMyChar(TRUE); else - ActMyChar(false); + ActMyChar(FALSE); ActStar(); ActNpChar(); @@ -515,9 +515,9 @@ int ModeAction() ActFlash(frame_x, frame_y); if (g_GameFlags & 2) - AnimationMyChar(true); + AnimationMyChar(TRUE); else - AnimationMyChar(false); + AnimationMyChar(FALSE); } if (g_GameFlags & 8) @@ -585,7 +585,7 @@ int ModeAction() RotationArmsRev(); } - if (swPlay & 1) + if (swPlay % 2) { int tscRet = TextScriptProc(); if (tscRet == 0) @@ -594,13 +594,13 @@ int ModeAction() return 1; } - PutMapName(false); + PutMapName(FALSE); PutTimeCounter(16, 8); if (g_GameFlags & 2) { - PutMyLife(true); - PutArmsEnergy(true); + PutMyLife(TRUE); + PutArmsEnergy(TRUE); PutMyAir((WINDOW_WIDTH - 80) / 2, (WINDOW_HEIGHT - 32) / 2); PutActiveArmsList(); } @@ -623,7 +623,7 @@ int ModeAction() return 0; } -bool Game() +BOOL Game() { if (LoadGenericData()) { @@ -655,9 +655,9 @@ bool Game() } else { - return false; + return FALSE; } } - return true; + return TRUE; } diff --git a/src/Game.h b/src/Game.h index 19be7142..c90a00be 100644 --- a/src/Game.h +++ b/src/Game.h @@ -1,9 +1,11 @@ #pragma once +#include "WindowsWrapper.h" + extern int g_GameFlags; extern int gCounter; int Random(int min, int max); -void PutNumber4(int x, int y, int value, bool bZero); +void PutNumber4(int x, int y, int value, BOOL bZero); -bool Game(); +BOOL Game(); diff --git a/src/Main.cpp b/src/Main.cpp index 02c28b53..df5d9921 100644 --- a/src/Main.cpp +++ b/src/Main.cpp @@ -62,7 +62,7 @@ void rep_srand(unsigned int seed) void PutFramePerSecound() { if (bFps) - PutNumber4(WINDOW_WIDTH - 40, 8, GetFramePerSecound(), false); + PutNumber4(WINDOW_WIDTH - 40, 8, GetFramePerSecound(), FALSE); } int GetFramePerSecound() diff --git a/src/MiniMap.cpp b/src/MiniMap.cpp index 6759886f..f444580b 100644 --- a/src/MiniMap.cpp +++ b/src/MiniMap.cpp @@ -111,7 +111,7 @@ int MiniMapLoop() rcView.top = (WINDOW_HEIGHT / 2) - gMap.length * f / 8 / 2; rcView.bottom = (WINDOW_HEIGHT / 2) + gMap.length * f / 8 / 2; - PutMapName(true); + PutMapName(TRUE); CortBox(&rcView, 0); PutFramePerSecound(); @@ -130,7 +130,7 @@ int MiniMapLoop() line = 0; my_wait = 0; - while (true) + while (1) { GetTrg(); @@ -164,7 +164,7 @@ int MiniMapLoop() PutBitmap3(&grcGame, rcView.left + 1, rcView.top + 1, &rcMiniMap, SURFACE_ID_MAP); - PutMapName(true); + PutMapName(TRUE); if (++my_wait / 8 % 2) PutBitmap3(&grcGame, my_x + rcView.left + 1, my_y + rcView.top + 1, &my_rect, SURFACE_ID_TEXT_BOX); @@ -196,7 +196,7 @@ int MiniMapLoop() rcView.top = (WINDOW_HEIGHT / 2) - gMap.length * f / 8 / 2; rcView.bottom = (WINDOW_HEIGHT / 2) + gMap.length * f / 8 / 2; - PutMapName(true); + PutMapName(TRUE); CortBox(&rcView, 0); PutFramePerSecound(); diff --git a/src/MycParam.cpp b/src/MycParam.cpp index b5a31019..62527be8 100644 --- a/src/MycParam.cpp +++ b/src/MycParam.cpp @@ -252,8 +252,8 @@ void PutArmsEnergy(BOOL flash) // Draw max ammo if (gArmsData[gSelectedArms].max_num) { - PutNumber4(gArmsEnergyX + 32, 16, gArmsData[gSelectedArms].num, 0); - PutNumber4(gArmsEnergyX + 32, 24, gArmsData[gSelectedArms].max_num, 0); + PutNumber4(gArmsEnergyX + 32, 16, gArmsData[gSelectedArms].num, FALSE); + PutNumber4(gArmsEnergyX + 32, 24, gArmsData[gSelectedArms].max_num, FALSE); } else { @@ -267,7 +267,7 @@ void PutArmsEnergy(BOOL flash) PutBitmap3(&rcView, gArmsEnergyX + 32, 24, &rcPer, SURFACE_ID_TEXT_BOX); PutBitmap3(&rcView, gArmsEnergyX, 32, &rcLv, SURFACE_ID_TEXT_BOX); - PutNumber4(gArmsEnergyX - 8, 32, gArmsData[gSelectedArms].level, 0); + PutNumber4(gArmsEnergyX - 8, 32, gArmsData[gSelectedArms].level, FALSE); SET_RECT(rcExpBox, 0, 72, 40, 80) SET_RECT(rcExpVal, 0, 80, 0, 88) @@ -366,7 +366,7 @@ void PutMyLife(BOOL flash) PutBitmap3(&grcGame, 16, 40, &rcCase, SURFACE_ID_TEXT_BOX); PutBitmap3(&grcGame, 40, 40, &rcBr, SURFACE_ID_TEXT_BOX); PutBitmap3(&grcGame, 40, 40, &rcLife, SURFACE_ID_TEXT_BOX); - PutNumber4(8, 40, gMC.lifeBr, 0); + PutNumber4(8, 40, gMC.lifeBr, FALSE); } void PutMyAir(int x, int y) @@ -383,7 +383,7 @@ void PutMyAir(int x, int y) { // Draw how much air is left if (gMC.air_get % 6 < 4) - PutNumber4(x + 32, y, gMC.air / 10, 0); + PutNumber4(x + 32, y, gMC.air / 10, FALSE); // Draw "AIR" text if (gMC.air % 30 > 10) @@ -420,9 +420,9 @@ void PutTimeCounter(int x, int y) } // Draw time - PutNumber4(x, y, time_count / (60 * 50), false); - PutNumber4(x + 20, y, time_count / 50 % 60, true); - PutNumber4(x + 32, y, time_count / 5 % 10, false); + PutNumber4(x, y, time_count / (60 * 50), FALSE); + PutNumber4(x + 20, y, time_count / 50 % 60, TRUE); + PutNumber4(x + 32, y, time_count / 5 % 10, FALSE); PutBitmap3(&grcGame, x + 30, y, &rcTime[2], SURFACE_ID_TEXT_BOX); } else