Accurate main function variable names

This commit is contained in:
Clownacy 2019-08-29 20:19:31 +01:00
parent 36291ebf36
commit 2f56effc51

View file

@ -115,16 +115,16 @@ int main(int argc, char *argv[])
if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_EVENTS | SDL_INIT_TIMER) >= 0) if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_EVENTS | SDL_INIT_TIMER) >= 0)
{ {
// Load configuration // Load configuration
CONFIG config; CONFIG conf;
if (!LoadConfigData(&config)) if (!LoadConfigData(&conf))
DefaultConfigData(&config); DefaultConfigData(&conf);
// Apply keybinds // Apply keybinds
// Swap X and Z buttons // Swap X and Z buttons
if (config.attack_button_mode) if (conf.attack_button_mode)
{ {
if (config.attack_button_mode == 1) if (conf.attack_button_mode == 1)
{ {
gKeyJump = KEY_X; gKeyJump = KEY_X;
gKeyShot = KEY_Z; gKeyShot = KEY_Z;
@ -137,9 +137,9 @@ int main(int argc, char *argv[])
} }
// Swap Okay and Cancel buttons // Swap Okay and Cancel buttons
if (config.ok_button_mode) if (conf.ok_button_mode)
{ {
if (config.ok_button_mode == 1) if (conf.ok_button_mode == 1)
{ {
gKeyOk = gKeyShot; gKeyOk = gKeyShot;
gKeyCancel = gKeyJump; gKeyCancel = gKeyJump;
@ -159,9 +159,9 @@ int main(int argc, char *argv[])
} }
// Alternate movement keys // Alternate movement keys
if (config.move_button_mode) if (conf.move_button_mode)
{ {
if (config.move_button_mode == 1) if (conf.move_button_mode == 1)
{ {
gKeyLeft = KEY_ALT_LEFT; gKeyLeft = KEY_ALT_LEFT;
gKeyUp = KEY_ALT_UP; gKeyUp = KEY_ALT_UP;
@ -180,7 +180,7 @@ int main(int argc, char *argv[])
// Set gamepad inputs // Set gamepad inputs
for (int i = 0; i < 8; i++) for (int i = 0; i < 8; i++)
{ {
switch (config.joystick_button[i]) switch (conf.joystick_button[i])
{ {
case 1: case 1:
gJoystickButtonTable[i] = gKeyJump; gJoystickButtonTable[i] = gKeyJump;
@ -241,14 +241,14 @@ int main(int argc, char *argv[])
// Get window dimensions and colour depth // Get window dimensions and colour depth
int windowWidth; int windowWidth;
int windowHeight; int windowHeight;
int colourDepth; int depth;
switch (config.display_mode) switch (conf.display_mode)
{ {
case 1: case 1:
case 2: case 2:
// Set window dimensions // Set window dimensions
if (config.display_mode == 1) if (conf.display_mode == 1)
{ {
windowWidth = WINDOW_WIDTH; windowWidth = WINDOW_WIDTH;
windowHeight = WINDOW_HEIGHT; windowHeight = WINDOW_HEIGHT;
@ -264,7 +264,7 @@ int main(int argc, char *argv[])
if (gWindow) if (gWindow)
{ {
if (config.display_mode == 1) if (conf.display_mode == 1)
StartDirectDraw(0, 0); StartDirectDraw(0, 0);
else else
StartDirectDraw(1, 0); StartDirectDraw(1, 0);
@ -285,20 +285,20 @@ int main(int argc, char *argv[])
if (gWindow) if (gWindow)
{ {
// Set colour depth // Set colour depth
switch (config.display_mode) switch (conf.display_mode)
{ {
case 0: case 0:
colourDepth = 16; depth = 16;
break; break;
case 3: case 3:
colourDepth = 24; depth = 24;
break; break;
case 4: case 4:
colourDepth = 32; depth = 32;
break; break;
} }
StartDirectDraw(2, colourDepth); StartDirectDraw(2, depth);
bFullscreen = TRUE; bFullscreen = TRUE;
SDL_ShowCursor(0); SDL_ShowCursor(0);
@ -340,15 +340,15 @@ int main(int argc, char *argv[])
#endif #endif
// Set rects // Set rects
RECT loading_rect = {0, 0, 64, 8}; RECT rcLoading = {0, 0, 64, 8};
RECT clip_rect = {0, 0, WINDOW_WIDTH, WINDOW_HEIGHT}; RECT rcFull = {0, 0, WINDOW_WIDTH, WINDOW_HEIGHT};
// Load the "LOADING" text // Load the "LOADING" text
MakeSurface_File("Loading", SURFACE_ID_LOADING); MakeSurface_File("Loading", SURFACE_ID_LOADING);
// Draw loading screen // Draw loading screen
CortBox(&clip_rect, 0x000000); CortBox(&rcFull, 0x000000);
PutBitmap3(&clip_rect, (WINDOW_WIDTH - 64) / 2, (WINDOW_HEIGHT - 8) / 2, &loading_rect, SURFACE_ID_LOADING); PutBitmap3(&rcFull, (WINDOW_WIDTH - 64) / 2, (WINDOW_HEIGHT - 8) / 2, &rcLoading, SURFACE_ID_LOADING);
SDL_SysWMinfo wmInfo; SDL_SysWMinfo wmInfo;
SDL_VERSION(&wmInfo.version); SDL_VERSION(&wmInfo.version);
@ -363,14 +363,14 @@ int main(int argc, char *argv[])
InitDirectSound(ghWnd); InitDirectSound(ghWnd);
// Initialize joystick // Initialize joystick
if (config.bJoystick && InitDirectInput(hinstance, ghWnd)) if (conf.bJoystick && InitDirectInput(hinstance, ghWnd))
{ {
ResetJoystickStatus(); ResetJoystickStatus();
gbUseJoystick = TRUE; gbUseJoystick = TRUE;
} }
// Initialize stuff // Initialize stuff
InitTextObject(config.font_name); InitTextObject(conf.font_name);
InitTriangleTable(); InitTriangleTable();
// Run game code // Run game code