From 156e47438c769ba8d9cf29d1f50a95ef9c1d913d Mon Sep 17 00:00:00 2001 From: Clownacy Date: Thu, 14 Nov 2019 00:23:50 +0000 Subject: [PATCH] Stage.cpp cleanup --- src/Stage.cpp | 50 ++++++++++++++++++++++++++------------------------ src/Stage.h | 2 +- src/Star.h | 4 ++-- 3 files changed, 29 insertions(+), 27 deletions(-) diff --git a/src/Stage.cpp b/src/Stage.cpp index b6076c33..a9313d68 100644 --- a/src/Stage.cpp +++ b/src/Stage.cpp @@ -130,17 +130,19 @@ const STAGE_TABLE gTMT[95] = { BOOL TransferStage(int no, int w, int x, int y) { - //Move character + BOOL bError; + char path_dir[20]; + char path[MAX_PATH]; + + // Move character SetMyCharPosition(x * 0x10 * 0x200, y * 0x10 * 0x200); - BOOL bError = FALSE; + bError = FALSE; - //Get path - char path_dir[20]; + // Get path strcpy(path_dir, "Stage"); - //Load tileset - char path[MAX_PATH]; + // Load tileset sprintf(path, "%s\\Prt%s", path_dir, gTMT[no].parts); if (!ReloadBitmap_File(path, SURFACE_ID_LEVEL_TILESET)) bError = TRUE; @@ -149,30 +151,30 @@ BOOL TransferStage(int no, int w, int x, int y) if (!LoadAttributeData(path)) bError = TRUE; - //Load tilemap + // Load tilemap sprintf(path, "%s\\%s.pxm", path_dir, gTMT[no].map); if (!LoadMapData2(path)) bError = TRUE; - //Load NPCs + // Load NPCs sprintf(path, "%s\\%s.pxe", path_dir, gTMT[no].map); if (!LoadEvent(path)) bError = TRUE; - //Load script + // Load script sprintf(path, "%s\\%s.tsc", path_dir, gTMT[no].map); if (!LoadTextScript_Stage(path)) bError = TRUE; - //Load background + // Load background sprintf(path, "%s", gTMT[no].back); if (!InitBack(path, gTMT[no].bkType)) bError = TRUE; - //Get path + // Get path strcpy(path_dir, "Npc"); - //Load NPC sprite sheets + // Load NPC sprite sheets sprintf(path, "%s\\Npc%s", path_dir, gTMT[no].npc); if (!ReloadBitmap_File(path, SURFACE_ID_LEVEL_SPRITESET_1)) bError = TRUE; @@ -184,7 +186,7 @@ BOOL TransferStage(int no, int w, int x, int y) if (bError) return FALSE; - //Load map name + // Load map name ReadyMapName(gTMT[no].name); StartTextScript(w); @@ -196,12 +198,12 @@ BOOL TransferStage(int no, int w, int x, int y) InitBossChar(gTMT[no].boss_no); ResetFlash(); gStageNo = no; + return TRUE; } -//Music -const char *gMusicTable[42] = -{ +// Music +const char *gMusicTable[42] = { "XXXX", "WANPAKU", "ANZEN", @@ -226,7 +228,7 @@ const char *gMusicTable[42] = "ACCESS", "IRONH", "GRAND", - "Curly", // Uses the original filename instead of the internal 8.3 one + "Curly", // Uses the original filename instead of the internal allcaps one "OSIDE", "REQUIEM", "WANPAK2", @@ -255,30 +257,30 @@ void ChangeMusic(MusicID no) if (no != MUS_SILENCE && no == gMusicNo) return; - //Stop and keep track of old song + // Stop and keep track of old song gOldPos = GetOrganyaPosition(); gOldNo = gMusicNo; StopOrganyaMusic(); - //Load .org + // Load .org LoadOrganya(gMusicTable[no]); - //Reset position, volume, and then play the song + // Reset position, volume, and then play the song ChangeOrganyaVolume(100); SetOrganyaPosition(0); PlayOrganyaMusic(); gMusicNo = no; } -void ReCallMusic() +void ReCallMusic(void) { - //Stop old song + // Stop old song StopOrganyaMusic(); - //Load .org that was playing before + // Load .org that was playing before LoadOrganya(gMusicTable[gOldNo]); - //Reset position, volume, and then play the song + // Reset position, volume, and then play the song SetOrganyaPosition(gOldPos); ChangeOrganyaVolume(100); PlayOrganyaMusic(); diff --git a/src/Stage.h b/src/Stage.h index 1f628d02..de2432d9 100644 --- a/src/Stage.h +++ b/src/Stage.h @@ -65,4 +65,4 @@ extern MusicID gMusicNo; BOOL TransferStage(int no, int w, int x, int y); void ChangeMusic(MusicID no); -void ReCallMusic(); +void ReCallMusic(void); diff --git a/src/Star.h b/src/Star.h index 15179727..672effb0 100644 --- a/src/Star.h +++ b/src/Star.h @@ -1,5 +1,5 @@ #pragma once -void InitStar(); -void ActStar(); +void InitStar(void); +void ActStar(void); void PutStar(int fx, int fy);