shithub: cstory

Download patch

ref: e2c57e6dbc3a9c0e74557ad9a42f98f20bb9e5a6
parent: aeb1e292b730f334e4ea288ba0245fe756054972
author: Gabriel Ravier <gabravier@gmail.com>
date: Fri Sep 13 16:35:37 EDT 2019

Alphabetized macros in BossFrog and re-ordered some stuff to go along with Clownacy's coding standards

Also changed NPC_NULL_DELETES_ITSELF to NPC_DAMAGE_TEXT_HOLDER as Fayti pointed out the misnomer

Note to self : Make a PR with coding standards

Signed-off-by: Gabriel Ravier <gabravier@gmail.com>

--- a/src/BossFrog.cpp
+++ b/src/BossFrog.cpp
@@ -11,6 +11,19 @@
 #include "Sound.h"
 #include "Triangle.h"
 
+enum BalfrogAnims
+{
+	BALFANI_NOTHING = 0,
+	BALFANI_STANDING_STILL = 1,
+	BALFANI_MOUTH_BARELY_OPEN_CROUCHING = 2,
+	BALFANI_MOUTH_OPEN_CROUCHING = 3,
+	BALFANI_MOUTH_OPEN_CROUCHING_FLASHING = 4,
+	BALFANI_JUMPING = 5,
+	BALFANI_BALROG_WHITE = 6,
+	BALFANI_BALROG_CROUCHING = 7,
+	BALFANI_BALROG_JUMPING = 8
+};
+
 enum BalfrogStates
 {
 	BALFROG_INITIALIZE = 0,
@@ -39,19 +52,6 @@
 	BALFROG_NOP = 141,
 	BALFROG_GO_INTO_CEILING = 142,
 	BALFROG_GONE_INTO_CEILING = 143
-};
-
-enum BalfrogAnims
-{
-	BALFANI_NOTHING = 0,
-	BALFANI_STANDING_STILL = 1,
-	BALFANI_MOUTH_BARELY_OPEN_CROUCHING = 2,
-	BALFANI_MOUTH_OPEN_CROUCHING = 3,
-	BALFANI_MOUTH_OPEN_CROUCHING_FLASHING = 4,
-	BALFANI_JUMPING = 5,
-	BALFANI_BALROG_WHITE = 6,
-	BALFANI_BALROG_CROUCHING = 7,
-	BALFANI_BALROG_JUMPING = 8
 };
 
 // Balfrog's mouth
--- a/src/CommonDefines.h
+++ b/src/CommonDefines.h
@@ -3,14 +3,14 @@
 #define WINDOW_WIDTH 320
 #define WINDOW_HEIGHT 240
 
-enum Direction
-{
-	DIR_LEFT = 0,
-	DIR_UP = 1,
-	DIR_RIGHT = 2,
-	DIR_DOWN = 3,
-	DIR_AUTO = 4
-};
+#define TILES_TO_UNITS(x) ((x) * 0x2000)
+#define UNITS_TO_TILES(x) ((x) / 0x2000)
+#define TILES_TO_PIXELS(x) ((x) * 0x10)
+#define PIXELS_TO_TILES(x) ((x) / 0x10)
+#define PIXELS_TO_UNITS(x) ((x) * 0x200)
+#define UNITS_TO_PIXELS(x) ((x) / 0x200)
+#define SECONDS_TO_FRAMES(x) ((x) * 50)
+#define FRAMES_TO_SECONDS(x) ((x) / 50)
 
 enum Collisions
 {
@@ -21,11 +21,11 @@
 	// To be continued
 };
 
-#define TILES_TO_UNITS(x) ((x) * 0x2000)
-#define UNITS_TO_TILES(x) ((x) / 0x2000)
-#define TILES_TO_PIXELS(x) ((x) * 0x10)
-#define PIXELS_TO_TILES(x) ((x) / 0x10)
-#define PIXELS_TO_UNITS(x) ((x) * 0x200)
-#define UNITS_TO_PIXELS(x) ((x) / 0x200)
-#define SECONDS_TO_FRAMES(x) ((x) * 50)
-#define FRAMES_TO_SECONDS(x) ((x) / 50)
+enum Direction
+{
+	DIR_LEFT = 0,
+	DIR_UP = 1,
+	DIR_RIGHT = 2,
+	DIR_DOWN = 3,
+	DIR_AUTO = 4
+};
--- a/src/NpChar.h
+++ b/src/NpChar.h
@@ -37,7 +37,7 @@
 	NPC_NULL = 0,
 	NPC_EXP = 1,
 	NPC_ENEMY_BEHEMOTH = 2,
-	NPC_NULL_DELETES_ITSELF = 3,
+	NPC_DAMAGE_TEXT_HOLDER = 3,
 	NPC_SMOKE = 4,
 	// To be continued
 	NPC_ENEMY_FROG = 104,
--- a/src/Sound.h
+++ b/src/Sound.h
@@ -13,17 +13,6 @@
 
 #define SE_MAX 160	// According to the Organya source code release, this is the real name for this constant
 
-extern LPDIRECTSOUND       lpDS;
-extern LPDIRECTSOUNDBUFFER lpSECONDARYBUFFER[SE_MAX];
-
-BOOL InitDirectSound(HWND hwnd);
-void EndDirectSound(void);
-void PlaySoundObject(int no, int mode);
-void ChangeSoundFrequency(int no, unsigned long rate);
-void ChangeSoundVolume(int no, long volume);
-void ChangeSoundPan(int no, long pan);
-int MakePixToneObject(const PIXTONEPARAMETER *ptp, int ptp_num, int no);
-
 enum SoundEffectNames
 {
 	// To be continued
@@ -37,3 +26,14 @@
 	SND_EXPLOSION = 72,
 	// To be continued
 };
+
+extern LPDIRECTSOUND lpDS;
+extern LPDIRECTSOUNDBUFFER lpSECONDARYBUFFER[SE_MAX];
+
+BOOL InitDirectSound(HWND hwnd);
+void EndDirectSound(void);
+void PlaySoundObject(int no, int mode);
+void ChangeSoundFrequency(int no, unsigned long rate);
+void ChangeSoundVolume(int no, long volume);
+void ChangeSoundPan(int no, long pan);
+int MakePixToneObject(const PIXTONEPARAMETER *ptp, int ptp_num, int no);