ref: f7a8a260a416c8d0d07ba77e7faafda867741a43
parent: bfc255478c0e329df60b9c91bf10ecf94d8555a1
author: Clownacy <Clownacy@users.noreply.github.com>
date: Wed Jul 8 15:30:11 EDT 2020
Added OTHER_RECT struct Unifies the weird not-RECTs
--- a/src/Bullet.h
+++ b/src/Bullet.h
@@ -2,6 +2,8 @@
#include "WindowsWrapper.h"
+#include "CommonDefines.h"
+
#define BULLET_MAX 0x40
typedef struct BULLET
@@ -31,13 +33,7 @@
int enemyYL;
int blockXL;
int blockYL;
- struct
- {
- int front;
- int top;
- int back;
- int bottom;
- } view;
+ OTHER_RECT view;
} BULLET;
typedef struct BULLET_TABLE
@@ -50,13 +46,7 @@
int enemyYL;
int blockXL;
int blockYL;
- struct
- {
- int front;
- int top;
- int back;
- int bottom;
- } view;
+ OTHER_RECT view;
} BULLET_TABLE;
extern BULLET gBul[BULLET_MAX];
--- a/src/CommonDefines.h
+++ b/src/CommonDefines.h
@@ -20,3 +20,11 @@
DIR_DOWN = 3,
DIR_AUTO = 4
};
+
+struct OTHER_RECT // The original name for this struct is unknown
+{
+ int front;
+ int top;
+ int back;
+ int bottom;
+};
--- a/src/MyChar.h
+++ b/src/MyChar.h
@@ -2,6 +2,8 @@
#include "WindowsWrapper.h"
+#include "CommonDefines.h"
+
// TODO - When I add bitmask constants for gMC.flags...
// 0x100 is a 'player is underwater' flag
@@ -38,20 +40,8 @@
int ym;
int ani_wait;
int ani_no;
- struct
- {
- int front;
- int top;
- int back;
- int bottom;
- } hit;
- struct
- {
- int front;
- int top;
- int back;
- int bottom;
- } view;
+ OTHER_RECT hit;
+ OTHER_RECT view;
RECT rect;
RECT rect_arms;
int level;
--- a/src/NpChar.h
+++ b/src/NpChar.h
@@ -2,6 +2,7 @@
#include "WindowsWrapper.h"
+#include "CommonDefines.h"
#include "Draw.h"
#define NPC_MAX 0x200
@@ -81,20 +82,8 @@
int count2;
int act_no;
int act_wait;
- struct
- {
- int front;
- int top;
- int back;
- int bottom;
- } hit;
- struct
- {
- int front;
- int top;
- int back;
- int bottom;
- } view;
+ OTHER_RECT hit;
+ OTHER_RECT view;
unsigned char shock;
int damage_view;
int damage;