projects
/
rocksndiamonds.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
b5fb0b0
)
fixed bug with broken undo/redo buttons when using 'tape.show_game_buttons'
author
Holger Schemel
<info@artsoft.org>
Fri, 20 Jan 2017 20:04:11 +0000
(21:04 +0100)
committer
Holger Schemel
<info@artsoft.org>
Fri, 20 Jan 2017 20:04:11 +0000
(21:04 +0100)
src/tape.c
patch
|
blob
|
history
src/tape.h
patch
|
blob
|
history
diff --git
a/src/tape.c
b/src/tape.c
index 5a879d12ac0af05f624130ea6d5adf7ed8fe4917..5e8746df2384c48d23ad92fba19010b96c4a6eeb 100644
(file)
--- a/
src/tape.c
+++ b/
src/tape.c
@@
-401,8
+401,7
@@
void DrawCompleteVideoDisplay()
gfx.vxsize, gfx.vysize, gfx.vx, gfx.vy);
/* draw tape buttons (forced) */
gfx.vxsize, gfx.vysize, gfx.vx, gfx.vy);
/* draw tape buttons (forced) */
- UnmapTapeButtons();
- MapTapeButtons();
+ RedrawOrRemapTapeButtons();
DrawVideoDisplay(VIDEO_ALL_OFF, 0);
DrawVideoDisplay(VIDEO_ALL_OFF, 0);
@@
-1290,6
+1289,34
@@
void UnmapTapeButtons()
UnmapGameButtons();
}
UnmapGameButtons();
}
+void RedrawTapeButtons()
+{
+ int i;
+
+ for (i = 0; i < NUM_TAPE_BUTTONS; i++)
+ RedrawGadget(tape_gadget[i]);
+
+ if (tape.show_game_buttons)
+ RedrawGameButtons();
+
+ // RedrawGadget() may have set REDRAW_ALL if buttons are defined off-area
+ redraw_mask &= ~REDRAW_ALL;
+}
+
+void RedrawOrRemapTapeButtons()
+{
+ if (tape_gadget[TAPE_CTRL_ID_PLAY]->mapped)
+ {
+ // tape buttons already mapped
+ RedrawTapeButtons();
+ }
+ else
+ {
+ UnmapTapeButtons();
+ MapTapeButtons();
+ }
+}
+
static void HandleTapeButtonsExt(int id)
{
if (game_status != GAME_MODE_MAIN && game_status != GAME_MODE_PLAYING)
static void HandleTapeButtonsExt(int id)
{
if (game_status != GAME_MODE_MAIN && game_status != GAME_MODE_PLAYING)
diff --git
a/src/tape.h
b/src/tape.h
index cf6f4dfda9d046982b6f9ad148d97953770dafac..bc80f440b3ec191dd6f911caf1d1e01674fedd27 100644
(file)
--- a/
src/tape.h
+++ b/
src/tape.h
@@
-232,6
+232,8
@@
void MapTapeEjectButton();
void MapTapeWarpButton();
void MapTapeButtons();
void UnmapTapeButtons();
void MapTapeWarpButton();
void MapTapeButtons();
void UnmapTapeButtons();
+void RedrawTapeButtons();
+void RedrawOrRemapTapeButtons();
void HandleTapeButtonKeys(Key);
void HandleTapeButtonKeys(Key);