shithub: cstory

Download patch

ref: 32c55a66fdbecafe62ebb550e730393a6cdd419a
parent: b7d01aae3fe5a528209b2f1c3cfc1d906475158d
author: Clownacy <Clownacy@users.noreply.github.com>
date: Wed Aug 21 14:38:59 EDT 2019

KeyControl tweaks

Style change, and compatibility improvement ('int' can be 16-bit, but
the KeyBind enums exceed that. 'long' is guaranteed to be 32-bit, and
won't affect ASM-accuracy since MSVC2003 treats int and long
identically)

--- a/src/KeyControl.cpp
+++ b/src/KeyControl.cpp
@@ -1,22 +1,22 @@
 #include "KeyControl.h"
 
-int gKey;
-int gKeyTrg;
+long gKey;
+long gKeyTrg;
 
-int gKeyJump = KEY_Z;
-int gKeyShot = KEY_X;
-int gKeyArms = KEY_ARMS;
-int gKeyArmsRev = KEY_ARMSREV;
-int gKeyItem = KEY_ITEM;
-int gKeyMap = KEY_MAP;
+long gKeyJump = KEY_Z;
+long gKeyShot = KEY_X;
+long gKeyArms = KEY_ARMS;
+long gKeyArmsRev = KEY_ARMSREV;
+long gKeyItem = KEY_ITEM;
+long gKeyMap = KEY_MAP;
 
-int gKeyOk = KEY_Z;
-int gKeyCancel = KEY_X;
+long gKeyOk = KEY_Z;
+long gKeyCancel = KEY_X;
 
-int gKeyLeft = KEY_LEFT;
-int gKeyUp = KEY_UP;
-int gKeyRight = KEY_RIGHT;
-int gKeyDown = KEY_DOWN;
+long gKeyLeft = KEY_LEFT;
+long gKeyUp = KEY_UP;
+long gKeyRight = KEY_RIGHT;
+long gKeyDown = KEY_DOWN;
 
 void GetTrg()
 {
--- a/src/KeyControl.h
+++ b/src/KeyControl.h
@@ -1,6 +1,6 @@
 #pragma once
 
-enum KEYBIND
+enum KeyBind
 {
 	//The movement keys go in the order of left, right, up and down
 	KEY_LEFT =      0x00000001,
@@ -34,22 +34,22 @@
 	KEY_PLUS =      0x00100000
 };
 
-extern int gKey;
-extern int gKeyTrg;
+extern long gKey;
+extern long gKeyTrg;
 
-extern int gKeyJump;
-extern int gKeyShot;
-extern int gKeyArms;
-extern int gKeyArmsRev;
-extern int gKeyItem;
-extern int gKeyMap;
+extern long gKeyJump;
+extern long gKeyShot;
+extern long gKeyArms;
+extern long gKeyArmsRev;
+extern long gKeyItem;
+extern long gKeyMap;
 
-extern int gKeyOk;
-extern int gKeyCancel;
+extern long gKeyOk;
+extern long gKeyCancel;
 
-extern int gKeyLeft;
-extern int gKeyUp;
-extern int gKeyRight;
-extern int gKeyDown;
+extern long gKeyLeft;
+extern long gKeyUp;
+extern long gKeyRight;
+extern long gKeyDown;
 
 void GetTrg();