shithub: cstory

Download patch

ref: b1dbce8743be53305db50acf72410185352df46c
parent: 0ceb8955d2a4f31e752f2e9d04b1a1c0cc55bd8e
author: Clownacy <Clownacy@users.noreply.github.com>
date: Tue Jan 7 01:05:07 EST 2020

More-accurate Ending.cpp variable arrangement

--- a/src/Ending.cpp
+++ b/src/Ending.cpp
@@ -40,8 +40,8 @@
 // Draw casts
 void PutStripper(void)
 {
-	RECT rc;
 	int s;
+	RECT rc;
 
 	for (s = 0; s < MAX_STRIP; ++s)
 	{
@@ -69,8 +69,8 @@
 // Create a cast object
 void SetStripper(int x, int y, const char *text, int cast)
 {
-	RECT rc;
 	int s;
+	RECT rc;
 
 	for (s = 0; s < MAX_STRIP; ++s)
 		if (!(Strip[s].flag & 0x80))
@@ -99,8 +99,8 @@
 // Regenerate cast text
 void RestoreStripper(void)
 {
-	RECT rc;
 	int s;
+	RECT rc;
 
 	for (s = 0; s < MAX_STRIP; ++s)
 	{
@@ -161,6 +161,8 @@
 	ReloadBitmap_Resource(name, SURFACE_ID_CREDITS_IMAGE);
 }
 
+const char *credit_script = "Credit.tsc";
+
 // Initialize and release credits
 void InitCreditScript(void)
 {
@@ -179,11 +181,12 @@
 	}
 }
 
-const char *credit_script = "Credit.tsc";
-
 // Start playing credits
 BOOL StartCreditScript(void)
 {
+	FILE *fp;
+	char path[MAX_PATH];
+
 	// Clear previously existing credits data
 	if (Credit.pData != NULL)
 	{
@@ -192,7 +195,6 @@
 	}
 
 	// Open file
-	char path[MAX_PATH];
 	sprintf(path, "%s\\%s", gDataPath, credit_script);
 
 	Credit.size = GetFileSizeLong(path);
@@ -204,7 +206,7 @@
 	if (Credit.pData == NULL)
 		return FALSE;
 
-	FILE *fp = fopen(path, "rb");
+	fp = fopen(path, "rb");
 	if (fp == NULL)
 	{
 		free(Credit.pData);
@@ -441,6 +443,7 @@
 // Scene of the island falling
 int Scene_DownIsland(HWND hWnd, int mode)
 {
+	ISLAND_SPRITE sprite;
 	int wait;
 
 	// Setup background
@@ -451,7 +454,6 @@
 	// Setup island
 	RECT rc_sprite = {160, 0, 200, 24};
 
-	ISLAND_SPRITE sprite;
 	sprite.x = 168 * 0x200;
 	sprite.y = 64 * 0x200;