Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/binding-mri/binding-mri.cpp b/binding-mri/binding-mri.cpp
- index 6fccdd5..9848652 100644
- --- a/binding-mri/binding-mri.cpp
- +++ b/binding-mri/binding-mri.cpp
- @@ -74,6 +74,7 @@ void graphicsBindingInit();
- void fileIntBindingInit();
- +RB_METHOD(mkxpRawKeyStates);
- RB_METHOD(mriPrint);
- RB_METHOD(mriP);
- RB_METHOD(mriDataDirectory);
- @@ -141,10 +142,21 @@ static void mriBindingInit()
- VALUE mod = rb_define_module("System");
- _rb_define_module_function(mod, "data_directory", mriDataDirectory);
- _rb_define_module_function(mod, "puts", mkxpPuts);
- + _rb_define_module_function(mod, "raw_key_states", mkxpRawKeyStates);
- rb_gv_set("MKXP", Qtrue);
- }
- +RB_METHOD(mkxpRawKeyStates)
- +{
- + RB_UNUSED_PARAM;
- +
- + VALUE str = rb_str_new(0, sizeof(EventThread::keyStates));
- + memcpy(RSTRING_PTR(str), EventThread::keyStates, sizeof(EventThread::keyStates));
- +
- + return str;
- +}
- +
- static void
- showMsg(const std::string &msg)
- {
- diff --git a/src/eventthread.cpp b/src/eventthread.cpp
- index 6678772..6000dad 100644
- --- a/src/eventthread.cpp
- +++ b/src/eventthread.cpp
- @@ -34,7 +34,7 @@
- #include <string.h>
- -bool EventThread::keyStates[] = { false };
- +uint8_t EventThread::keyStates[] = { false };
- EventThread::JoyState EventThread::joyState =
- {
- diff --git a/src/eventthread.h b/src/eventthread.h
- index ec5e8bb..15d4f63 100644
- --- a/src/eventthread.h
- +++ b/src/eventthread.h
- @@ -42,7 +42,7 @@ struct SDL_Window;
- class EventThread
- {
- public:
- - static bool keyStates[SDL_NUM_SCANCODES];
- + static uint8_t keyStates[SDL_NUM_SCANCODES];
- struct JoyState
- {
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement