Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/color.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
14 changes: 7 additions & 7 deletions include/genmenu.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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);
Expand Down Expand Up @@ -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<Scene> 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;
Expand Down
20 changes: 10 additions & 10 deletions src/genmenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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))
{
Expand Down Expand Up @@ -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])
Expand Down Expand 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<Event::KeySentinel; i++) {
if (btns & (1 << i)) {
Event evt(Event::EvtKeypress);
Expand All @@ -317,7 +317,7 @@ void GenericMenu::scanCommon(int p, uint32 keys, void * rawState) {
if (keys ^ m_contBtns[p]) {
// Find the pressed buttons
for (int i=0; i<Event::KeySentinel; i++) {
uint32 mask = 1 << i;
uint32_t mask = 1 << i;
if ((keys & mask) && !(m_contBtns[p] & mask) && !(called & mask)) {
Event evt(Event::EvtKeypress);
evt.port = p;
Expand Down Expand Up @@ -412,7 +412,7 @@ void GenericMenu::resetTimeout() {
timer_ms_gettime(&m_totime, NULL);
}

void GenericMenu::setTimeout(uint32 v) {
void GenericMenu::setTimeout(uint32_t v) {
m_timeout = v;
}

Expand Down