shithub: cstory

Download patch

ref: e70074cf6445ad441de393d7ddfbccc2c19a399d
parent: dbe773f01a1221c483643e33bd50d0245d2aa077
author: Clownacy <Clownacy@users.noreply.github.com>
date: Tue Jan 7 00:07:47 EST 2020

More-accurate ArmsItem.cpp variable arrangement

--- a/src/ArmsItem.cpp
+++ b/src/ArmsItem.cpp
@@ -14,18 +14,19 @@
 #include "Sound.h"
 #include "TextScr.h"
 
-int gArmsEnergyX = 16;
+ARMS gArmsData[ARMS_MAX];
+ITEM gItemData[ITEM_MAX];
 
 int gSelectedArms;
 int gSelectedItem;
 
-ARMS gArmsData[ARMS_MAX];
-ITEM gItemData[ITEM_MAX];
+static int gCampTitleY;
 
 /// True if we're in the items section of the inventory (not in the weapons section) (only relevant when the inventory is open)
 static BOOL gCampActive;
-static int gCampTitleY;
 
+int gArmsEnergyX = 16;
+
 void ClearArmsData(void)
 {
 #ifdef FIX_BUGS
@@ -175,6 +176,8 @@
 /// Update the inventory cursor
 void MoveCampCursor(void)
 {
+	BOOL bChange;
+
 	// Compute the current amount of weapons and items
 	int arms_num = 0;
 	int item_num = 0;
@@ -187,7 +190,7 @@
 		return;	// Empty inventory
 
 	// True if we're currently changing cursor position
-	BOOL bChange = FALSE;
+	bChange = FALSE;
 
 	if (!gCampActive)
 	{
@@ -300,6 +303,8 @@
 /// Draw the inventory
 void PutCampObject(void)
 {
+	static unsigned int flash;
+
 	int i;
 
 	/// Rect for the current weapon
@@ -347,7 +352,6 @@
 	PutBitmap3(&rcView, (WINDOW_WIDTH / 2) - 112, gCampTitleY + 52, &rcTitle2, SURFACE_ID_TEXT_BOX);
 
 	// Draw arms cursor
-	static unsigned int flash;
 	++flash;
 
 	if (gCampActive == FALSE)
@@ -410,7 +414,6 @@
 
 int CampLoop(void)
 {
-	int arms_num;
 	char old_script_path[MAX_PATH];
 
 	RECT rcView = {0, 0, WINDOW_WIDTH, WINDOW_HEIGHT};
@@ -428,7 +431,7 @@
 	gSelectedItem = 0;
 
 	// Compute current amount of weapons
-	arms_num = 0;
+	int arms_num = 0;
 	while (gArmsData[arms_num].code != 0)
 		++arms_num;