Clean-up Game.cpp
This commit is contained in:
parent
262fcfbaa3
commit
5e49d734c9
1 changed files with 17 additions and 17 deletions
34
src/Game.cpp
34
src/Game.cpp
|
@ -52,7 +52,7 @@ BOOL bContinue;
|
||||||
int Random(int min, int max)
|
int Random(int min, int max)
|
||||||
{
|
{
|
||||||
const int range = max - min + 1;
|
const int range = max - min + 1;
|
||||||
return min + rand() % range;
|
return (rand() % range) + min;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PutNumber4(int x, int y, int value, BOOL bZero)
|
void PutNumber4(int x, int y, int value, BOOL bZero)
|
||||||
|
@ -391,19 +391,19 @@ int ModeTitle(HWND hWnd)
|
||||||
CortBox(&grcGame, back_color);
|
CortBox(&grcGame, back_color);
|
||||||
|
|
||||||
// Draw version
|
// Draw version
|
||||||
PutBitmap3(&grcGame, (WINDOW_WIDTH - 120) / 2, WINDOW_HEIGHT - 24, &rcVersion, SURFACE_ID_TEXT_BOX);
|
PutBitmap3(&grcGame, (WINDOW_WIDTH / 2) - 60, WINDOW_HEIGHT - 24, &rcVersion, SURFACE_ID_TEXT_BOX);
|
||||||
PutBitmap3(&grcGame, (WINDOW_WIDTH - 8) / 2, WINDOW_HEIGHT - 24, &rcPeriod, SURFACE_ID_TEXT_BOX);
|
PutBitmap3(&grcGame, (WINDOW_WIDTH / 2) - 4, WINDOW_HEIGHT - 24, &rcPeriod, SURFACE_ID_TEXT_BOX);
|
||||||
|
|
||||||
PutNumber4((WINDOW_WIDTH - 40) / 2, WINDOW_HEIGHT - 24, v1, FALSE);
|
PutNumber4((WINDOW_WIDTH / 2) - 20, WINDOW_HEIGHT - 24, v1, FALSE);
|
||||||
PutNumber4((WINDOW_WIDTH - 8) / 2, WINDOW_HEIGHT - 24, v2, FALSE);
|
PutNumber4((WINDOW_WIDTH / 2) - 4, WINDOW_HEIGHT - 24, v2, FALSE);
|
||||||
PutNumber4((WINDOW_WIDTH + 24) / 2, WINDOW_HEIGHT - 24, v3, FALSE);
|
PutNumber4((WINDOW_WIDTH / 2) + 12, WINDOW_HEIGHT - 24, v3, FALSE);
|
||||||
PutNumber4((WINDOW_WIDTH + 56) / 2, WINDOW_HEIGHT - 24, v4, FALSE);
|
PutNumber4((WINDOW_WIDTH / 2) + 28, WINDOW_HEIGHT - 24, v4, FALSE);
|
||||||
|
|
||||||
// Draw main title
|
// Draw main title
|
||||||
PutBitmap3(&grcGame, (WINDOW_WIDTH - 144) / 2, 40, &rcTitle, SURFACE_ID_TITLE);
|
PutBitmap3(&grcGame, (WINDOW_WIDTH / 2) - 72, 40, &rcTitle, SURFACE_ID_TITLE);
|
||||||
PutBitmap3(&grcGame, (WINDOW_WIDTH - 48) / 2, (WINDOW_HEIGHT + 16) / 2, &rcNew, SURFACE_ID_TITLE);
|
PutBitmap3(&grcGame, (WINDOW_WIDTH / 2) - 24, (WINDOW_HEIGHT / 2) + 8, &rcNew, SURFACE_ID_TITLE);
|
||||||
PutBitmap3(&grcGame, (WINDOW_WIDTH - 48) / 2, (WINDOW_HEIGHT + 56) / 2, &rcContinue, SURFACE_ID_TITLE);
|
PutBitmap3(&grcGame, (WINDOW_WIDTH / 2) - 24, (WINDOW_HEIGHT / 2) + 28, &rcContinue, SURFACE_ID_TITLE);
|
||||||
PutBitmap3(&grcGame, (WINDOW_WIDTH - 160) / 2, WINDOW_HEIGHT - 48, &rcPixel, SURFACE_ID_PIXEL);
|
PutBitmap3(&grcGame, (WINDOW_WIDTH / 2) - 80, WINDOW_HEIGHT - 48, &rcPixel, SURFACE_ID_PIXEL);
|
||||||
|
|
||||||
// Draw character cursor
|
// Draw character cursor
|
||||||
switch (char_type)
|
switch (char_type)
|
||||||
|
@ -431,15 +431,15 @@ int ModeTitle(HWND hWnd)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!bContinue)
|
if (!bContinue)
|
||||||
char_y = (WINDOW_HEIGHT + 14) / 2;
|
char_y = (WINDOW_HEIGHT / 2) + 7;
|
||||||
else
|
else
|
||||||
char_y = (WINDOW_HEIGHT + 54) / 2;
|
char_y = (WINDOW_HEIGHT / 2) + 27;
|
||||||
|
|
||||||
// Pixel being redundant
|
// Pixel being redundant
|
||||||
if (!bContinue)
|
if (!bContinue)
|
||||||
PutBitmap3(&grcGame, (WINDOW_WIDTH - 88) / 2, char_y, &char_rc, char_surf);
|
PutBitmap3(&grcGame, (WINDOW_WIDTH / 2) - 44, char_y, &char_rc, char_surf);
|
||||||
else
|
else
|
||||||
PutBitmap3(&grcGame, (WINDOW_WIDTH - 88) / 2, char_y, &char_rc, char_surf);
|
PutBitmap3(&grcGame, (WINDOW_WIDTH / 2) - 44, char_y, &char_rc, char_surf);
|
||||||
|
|
||||||
// Draw carets
|
// Draw carets
|
||||||
PutCaret(0, 0);
|
PutCaret(0, 0);
|
||||||
|
@ -506,7 +506,7 @@ int ModeAction(HWND hWnd)
|
||||||
|
|
||||||
if (bContinue)
|
if (bContinue)
|
||||||
{
|
{
|
||||||
if (!LoadProfile(NULL) && !InitializeGame(hWnd)) // ...Shouldn't that '&&' be a '||'?
|
if (!LoadProfile(NULL) && !InitializeGame(hWnd))
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -653,7 +653,7 @@ int ModeAction(HWND hWnd)
|
||||||
{
|
{
|
||||||
PutMyLife(TRUE);
|
PutMyLife(TRUE);
|
||||||
PutArmsEnergy(TRUE);
|
PutArmsEnergy(TRUE);
|
||||||
PutMyAir((WINDOW_WIDTH - 80) / 2, (WINDOW_HEIGHT - 32) / 2);
|
PutMyAir((WINDOW_WIDTH / 2) - 40, (WINDOW_HEIGHT / 2) - 16);
|
||||||
PutActiveArmsList();
|
PutActiveArmsList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue