diff --git a/include/color.h b/include/color.h index d82a51b..cabfb8a 100644 --- a/include/color.h +++ b/include/color.h @@ -67,7 +67,7 @@ struct Color { return Color(a-o.a, r-o.r, g-o.g, b-o.b); } - operator uint32() const { + operator uint32_t() const { float ta, tr, tg, tb; ta = (a < 0.0f) ? 0.0f : (a > 1.0f) ? 1.0f : a; tr = (r < 0.0f) ? 0.0f : (r > 1.0f) ? 1.0f : r; diff --git a/include/genmenu.h b/include/genmenu.h index 1442fcb..fff6a67 100644 --- a/include/genmenu.h +++ b/include/genmenu.h @@ -99,7 +99,7 @@ class GenericMenu { // Called by controlPerFrame to process each type of device we support void scanController(int p, bool initial = false); void scanKeyboard(int p, bool initial = false); - void scanCommon(int p, uint32 newKeys, void *rawState); + void scanCommon(int p, uint32_t newKeys, void *rawState); // Called any time an "input event" is detected. You should override // this to handle debounced key-style inputs and peripheral add/remove. @@ -122,7 +122,7 @@ class GenericMenu { // This method should be called any time the user does something that // would cancel the menu's timeout. virtual void resetTimeout(); - virtual void setTimeout(uint32 v); + virtual void setTimeout(uint32_t v); // Set background colors virtual void setBg(float r, float g, float b); @@ -151,21 +151,21 @@ class GenericMenu { float m_exitSpeed; // When was the last time the user did something? - uint32 m_totime; + uint32_t m_totime; // How many seconds should we allow before triggering a timeout? - uint32 m_timeout; + uint32_t m_timeout; // Our scene object std::shared_ptr m_scene; // Allow one "main" controller in each port. We'll track what's in // each port and what buttons are currently held. - uint32 m_contTypes[4]; - uint32 m_contBtns[4]; + uint32_t m_contTypes[4]; + uint32_t m_contBtns[4]; // Key autorepeat mask - uint32 m_autoRep; + uint32_t m_autoRep; // Post-doMenu delay in case sounds are still playing int m_postDelay; diff --git a/src/genmenu.cpp b/src/genmenu.cpp index aa73ace..f499f2a 100644 --- a/src/genmenu.cpp +++ b/src/genmenu.cpp @@ -174,7 +174,7 @@ void GenericMenu::controlPerFrame() { // Check for timeouts and send a message if we have one. In case the // subclass isn't paying attention, reset the counter as well. - uint32 s; + uint32_t s; timer_ms_gettime(&s, NULL); if ((s - m_totime) > m_timeout) { resetTimeout(); @@ -210,10 +210,10 @@ void GenericMenu::scanController(int p, bool initial) { // Get the status of the controller maple_device_t * dev = maple_enum_dev(p, 0); cont_state_t * state = (cont_state_t *)maple_dev_status(dev); - uint32 btns = state->buttons; + uint32_t btns = state->buttons; // Convert the buttons to key bits - uint32 keys = 0; + uint32_t keys = 0; if ((btns & (CONT_A | CONT_B | CONT_X | CONT_Y | CONT_START)) == (CONT_A | CONT_B | CONT_X | CONT_Y | CONT_START)) { @@ -252,10 +252,10 @@ void GenericMenu::scanKeyboard(int p, bool initial) { // Get the status of the keyboard maple_device_t * dev = maple_enum_dev(p, 0); kbd_state_t * state = (kbd_state_t *)maple_dev_status(dev); - uint8 * kb = state->matrix; + uint8_t * kb = state->matrix; // Convert the buttons to key bits - uint32 keys = 0; + uint32_t keys = 0; if (kb[KBD_KEY_LEFT]) keys |= 1 << Event::KeyLeft; if (kb[KBD_KEY_UP]) @@ -289,14 +289,14 @@ void GenericMenu::scanKeyboard(int p, bool initial) { scanCommon(p, keys, state); } -void GenericMenu::scanCommon(int p, uint32 keys, void * rawState) { +void GenericMenu::scanCommon(int p, uint32_t keys, void * rawState) { bool reset = false; - uint32 called = 0; + uint32_t called = 0; // Anything we're doing autorepeat for, call automatically if (m_autoRep & m_contBtns[p]) { // Find the pressed buttons - uint32 btns = m_contBtns[p] & m_autoRep; + uint32_t btns = m_contBtns[p] & m_autoRep; for (int i=0; i