More-accurate ArmsItem.cpp variable arrangement

This commit is contained in:
Clownacy 2020-01-07 05:07:47 +00:00
parent dbe773f01a
commit e70074cf64

View file

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