projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added event actions (by triggering gadgets) for global animations
[rocksndiamonds.git]
/
src
/
libgame
/
sdl.c
diff --git
a/src/libgame/sdl.c
b/src/libgame/sdl.c
index 8ac2fc3af6e298f3eb3ba20fb8155c4607d64205..47ad26237b32ab1186c6a059152f038c69655b96 100644
(file)
--- a/
src/libgame/sdl.c
+++ b/
src/libgame/sdl.c
@@
-3060,10
+3060,12
@@
static void DrawTouchInputOverlay_ShowGridButtons(int alpha)
for (y = 0; y < grid_ysize; y++)
{
int grid_button = overlay.grid_button[x][y];
for (y = 0; y < grid_ysize; y++)
{
int grid_button = overlay.grid_button[x][y];
+ int grid_button_action = GET_ACTION_FROM_GRID_BUTTON(grid_button);
int alpha_draw = alpha;
int outline_border = MV_NONE;
int border_size = 2;
boolean draw_outlined = setup.touch.draw_outlined;
int alpha_draw = alpha;
int outline_border = MV_NONE;
int border_size = 2;
boolean draw_outlined = setup.touch.draw_outlined;
+ boolean draw_pressed = setup.touch.draw_pressed;
if (grid_button == CHAR_GRID_BUTTON_NONE)
continue;
if (grid_button == CHAR_GRID_BUTTON_NONE)
continue;
@@
-3071,6
+3073,14
@@
static void DrawTouchInputOverlay_ShowGridButtons(int alpha)
if (grid_button == overlay.grid_button_highlight)
alpha_draw = alpha_highlight;
if (grid_button == overlay.grid_button_highlight)
alpha_draw = alpha_highlight;
+ if (draw_pressed && overlay.grid_button_action & grid_button_action)
+ {
+ if (draw_outlined)
+ draw_outlined = FALSE;
+ else
+ alpha_draw = MIN((float)alpha_draw * 1.5, SDL_ALPHA_OPAQUE);
+ }
+
SDL_SetRenderDrawColor(sdl_renderer, 255, 255, 255, alpha_draw);
rect.x = (x + 0) * video.screen_width / grid_xsize;
SDL_SetRenderDrawColor(sdl_renderer, 255, 255, 255, alpha_draw);
rect.x = (x + 0) * video.screen_width / grid_xsize;