From 798a56efbd9ba7b5d1f439a23608aa1f28458ccf Mon Sep 17 00:00:00 2001 From: Raimon Zamora Date: Tue, 19 May 2026 18:08:07 +0200 Subject: [PATCH] - Crec que estaba en lo de que els axis pogueren funcioanr com a botons de pad --- main.cpp | 3 +++ ui_menu.cpp | 12 ++++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/main.cpp b/main.cpp index 2e1fc64..fa0313f 100644 --- a/main.cpp +++ b/main.cpp @@ -204,6 +204,9 @@ int main(int argc, char *argv[]) if (e.type == SDL_CONTROLLERBUTTONUP) { gamepad::buttonUp(e.jbutton.which, e.jbutton.button); } + if (e.type == SDL_CONTROLLERAXISMOTION) { + //if (e.jaxis.value>16000) printf("%i\n", e.jaxis.value); + } if (e.type == SDL_MOUSEBUTTONDOWN) result = ui::window::sendEvent(e.button.windowID, &e); if (e.type == SDL_MOUSEBUTTONUP) result = ui::window::sendEvent(e.button.windowID, &e); if (e.type == SDL_MOUSEMOTION) result = ui::window::sendEvent(e.motion.windowID, &e); diff --git a/ui_menu.cpp b/ui_menu.cpp index 4bb0b8d..e059158 100644 --- a/ui_menu.cpp +++ b/ui_menu.cpp @@ -41,11 +41,11 @@ namespace ui void show() { ui::setoffset(0,0); - int mx, my; + int mx=-1, my=-1; Uint32 mb = SDL_GetMouseState(&mx, &my); mx=mx/CHR_W; my=my/CHR_H; int w; - ui::printrect(0, 0, 320, 1, COLOR_BLACK); + ui::printrect(0, 0, 320, 1, COLOR_DARK); int opt_pos=1; int index=0; for (auto &menu : menus) @@ -55,7 +55,7 @@ namespace ui if (my<1 && mx>=opt_pos && mx=menu_x && mx