mirror of
https://github.com/mauiaaron/apple2.git
synced 2024-09-29 08:55:06 +00:00
Bugfix : properly show icon for joystick or keyboard
This commit is contained in:
parent
7067d10949
commit
abfa6e743b
@ -260,6 +260,7 @@ void c_joystick_reset(void)
|
|||||||
bool (*joydriver_isTouchJoystickAvailable)(void) = NULL;
|
bool (*joydriver_isTouchJoystickAvailable)(void) = NULL;
|
||||||
void (*joydriver_setTouchJoystickEnabled)(bool enabled) = NULL;
|
void (*joydriver_setTouchJoystickEnabled)(bool enabled) = NULL;
|
||||||
void (*joydriver_setTouchJoystickOwnsScreen)(bool pwnd) = NULL;
|
void (*joydriver_setTouchJoystickOwnsScreen)(bool pwnd) = NULL;
|
||||||
|
bool (*joydriver_ownsScreen)(void) = NULL;
|
||||||
void (*joydriver_setTouchButtonValues)(char button0Val, char button1Val) = NULL;
|
void (*joydriver_setTouchButtonValues)(char button0Val, char button1Val) = NULL;
|
||||||
void (*joydriver_setTouchAxisType)(touchjoy_axis_type_t axisType) = NULL;
|
void (*joydriver_setTouchAxisType)(touchjoy_axis_type_t axisType) = NULL;
|
||||||
void (*joydriver_setTouchAxisValues)(char up, char left, char right, char down) = NULL;
|
void (*joydriver_setTouchAxisValues)(char up, char left, char right, char down) = NULL;
|
||||||
|
@ -45,9 +45,12 @@ extern bool (*joydriver_isTouchJoystickAvailable)(void);
|
|||||||
// enable/disable touch joystick
|
// enable/disable touch joystick
|
||||||
extern void (*joydriver_setTouchJoystickEnabled)(bool enabled);
|
extern void (*joydriver_setTouchJoystickEnabled)(bool enabled);
|
||||||
|
|
||||||
// grant/remove ownership of touch screeen
|
// grant/remove ownership of touch screen
|
||||||
extern void (*joydriver_setTouchJoystickOwnsScreen)(bool pwnd);
|
extern void (*joydriver_setTouchJoystickOwnsScreen)(bool pwnd);
|
||||||
|
|
||||||
|
// query touch screen ownership
|
||||||
|
extern bool (*joydriver_ownsScreen)(void);
|
||||||
|
|
||||||
// set the joystick button parameters (7bit ASCII characters or MOUSETEXT values)
|
// set the joystick button parameters (7bit ASCII characters or MOUSETEXT values)
|
||||||
extern void (*joydriver_setTouchButtonValues)(char button0Val, char button1Val);
|
extern void (*joydriver_setTouchButtonValues)(char button0Val, char button1Val);
|
||||||
|
|
||||||
|
@ -493,5 +493,6 @@ bool c_keys_is_interface_key(int key)
|
|||||||
bool (*keydriver_isTouchKeyboardAvailable)(void) = NULL;
|
bool (*keydriver_isTouchKeyboardAvailable)(void) = NULL;
|
||||||
void (*keydriver_setTouchKeyboardEnabled)(bool enabled) = NULL;
|
void (*keydriver_setTouchKeyboardEnabled)(bool enabled) = NULL;
|
||||||
void (*keydriver_setTouchKeyboardOwnsScreen)(bool pwnd) = NULL;
|
void (*keydriver_setTouchKeyboardOwnsScreen)(bool pwnd) = NULL;
|
||||||
|
bool (*keydriver_ownsScreen)(void) = NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -155,8 +155,11 @@ extern bool (*keydriver_isTouchKeyboardAvailable)(void);
|
|||||||
// enable/disable touch keyboard HUD element
|
// enable/disable touch keyboard HUD element
|
||||||
extern void (*keydriver_setTouchKeyboardEnabled)(bool enabled);
|
extern void (*keydriver_setTouchKeyboardEnabled)(bool enabled);
|
||||||
|
|
||||||
// grant/remove ownership of touch screeen
|
// grant/remove ownership of touch screen
|
||||||
extern void (*keydriver_setTouchKeyboardOwnsScreen)(bool pwnd);
|
extern void (*keydriver_setTouchKeyboardOwnsScreen)(bool pwnd);
|
||||||
|
|
||||||
|
// query touch screen ownership
|
||||||
|
extern bool (*keydriver_ownsScreen)(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -668,6 +668,10 @@ static void gltouchjoy_setTouchJoystickOwnsScreen(bool pwnd) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool gltouchjoy_ownsScreen(void) {
|
||||||
|
return ownsScreen;
|
||||||
|
}
|
||||||
|
|
||||||
static void _animation_showTouchJoystick(void) {
|
static void _animation_showTouchJoystick(void) {
|
||||||
if (!isAvailable) {
|
if (!isAvailable) {
|
||||||
return;
|
return;
|
||||||
@ -740,6 +744,7 @@ static void _init_gltouchjoy(void) {
|
|||||||
joydriver_isTouchJoystickAvailable = &gltouchjoy_isTouchJoystickAvailable;
|
joydriver_isTouchJoystickAvailable = &gltouchjoy_isTouchJoystickAvailable;
|
||||||
joydriver_setTouchJoystickEnabled = &gltouchjoy_setTouchJoystickEnabled;
|
joydriver_setTouchJoystickEnabled = &gltouchjoy_setTouchJoystickEnabled;
|
||||||
joydriver_setTouchJoystickOwnsScreen = &gltouchjoy_setTouchJoystickOwnsScreen;
|
joydriver_setTouchJoystickOwnsScreen = &gltouchjoy_setTouchJoystickOwnsScreen;
|
||||||
|
joydriver_ownsScreen = &gltouchjoy_ownsScreen;
|
||||||
joydriver_setTouchButtonValues = &gltouchjoy_setTouchButtonValues;
|
joydriver_setTouchButtonValues = &gltouchjoy_setTouchButtonValues;
|
||||||
joydriver_setTouchAxisType = &gltouchjoy_setTouchAxisType;
|
joydriver_setTouchAxisType = &gltouchjoy_setTouchAxisType;
|
||||||
joydriver_setTouchAxisValues = &gltouchjoy_setTouchAxisValues;
|
joydriver_setTouchAxisValues = &gltouchjoy_setTouchAxisValues;
|
||||||
|
@ -682,6 +682,10 @@ static void gltouchkbd_setTouchKeyboardOwnsScreen(bool pwnd) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static bool gltouchkbd_ownsScreen(void) {
|
||||||
|
return ownsScreen;
|
||||||
|
}
|
||||||
|
|
||||||
static void _animation_showTouchKeyboard(void) {
|
static void _animation_showTouchKeyboard(void) {
|
||||||
if (!isAvailable) {
|
if (!isAvailable) {
|
||||||
return;
|
return;
|
||||||
@ -709,6 +713,7 @@ static void _init_gltouchkbd(void) {
|
|||||||
keydriver_isTouchKeyboardAvailable = &gltouchkbd_isTouchKeyboardAvailable;
|
keydriver_isTouchKeyboardAvailable = &gltouchkbd_isTouchKeyboardAvailable;
|
||||||
keydriver_setTouchKeyboardEnabled = &gltouchkbd_setTouchKeyboardEnabled;
|
keydriver_setTouchKeyboardEnabled = &gltouchkbd_setTouchKeyboardEnabled;
|
||||||
keydriver_setTouchKeyboardOwnsScreen = &gltouchkbd_setTouchKeyboardOwnsScreen;
|
keydriver_setTouchKeyboardOwnsScreen = &gltouchkbd_setTouchKeyboardOwnsScreen;
|
||||||
|
keydriver_ownsScreen = &gltouchkbd_ownsScreen;
|
||||||
|
|
||||||
kbd.selectedCol = -1;
|
kbd.selectedCol = -1;
|
||||||
kbd.selectedRow = -1;
|
kbd.selectedRow = -1;
|
||||||
|
@ -73,7 +73,6 @@ static struct {
|
|||||||
GLModel *model;
|
GLModel *model;
|
||||||
bool topLeftShowing;
|
bool topLeftShowing;
|
||||||
bool topRightShowing;
|
bool topRightShowing;
|
||||||
char kbdOrJoy;
|
|
||||||
} menu = { 0 };
|
} menu = { 0 };
|
||||||
|
|
||||||
static struct timespec timingBegin = { 0 };
|
static struct timespec timingBegin = { 0 };
|
||||||
@ -97,7 +96,7 @@ static inline void _present_menu(GLModel *parent) {
|
|||||||
static inline void _show_top_left(void) {
|
static inline void _show_top_left(void) {
|
||||||
topMenuTemplate[0][0] = ICONTEXT_MENU_SPROUT;
|
topMenuTemplate[0][0] = ICONTEXT_MENU_SPROUT;
|
||||||
topMenuTemplate[0][1] = MOUSETEXT_RIGHT;
|
topMenuTemplate[0][1] = MOUSETEXT_RIGHT;
|
||||||
topMenuTemplate[1][0] = menu.kbdOrJoy;
|
topMenuTemplate[1][0] = joydriver_ownsScreen() ? ICONTEXT_UPPERCASE : ICONTEXT_MENU_TOUCHJOY;
|
||||||
topMenuTemplate[1][1] = ICONTEXT_NONACTIONABLE;
|
topMenuTemplate[1][1] = ICONTEXT_NONACTIONABLE;
|
||||||
menu.topLeftShowing = true;
|
menu.topLeftShowing = true;
|
||||||
_present_menu(menu.model);
|
_present_menu(menu.model);
|
||||||
@ -329,7 +328,6 @@ static inline bool _tap_menu_item(float x, float y) {
|
|||||||
if (video_backend->animation_showTouchJoystick) {
|
if (video_backend->animation_showTouchJoystick) {
|
||||||
video_backend->animation_showTouchJoystick();
|
video_backend->animation_showTouchJoystick();
|
||||||
}
|
}
|
||||||
menu.kbdOrJoy = ICONTEXT_UPPERCASE;
|
|
||||||
_hide_top_left();
|
_hide_top_left();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -343,7 +341,6 @@ static inline bool _tap_menu_item(float x, float y) {
|
|||||||
if (video_backend->animation_showTouchKeyboard) {
|
if (video_backend->animation_showTouchKeyboard) {
|
||||||
video_backend->animation_showTouchKeyboard();
|
video_backend->animation_showTouchKeyboard();
|
||||||
}
|
}
|
||||||
menu.kbdOrJoy = ICONTEXT_MENU_TOUCHJOY;
|
|
||||||
_hide_top_left();
|
_hide_top_left();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -597,8 +594,6 @@ static void _init_gltouchmenu(void) {
|
|||||||
interface_setTouchMenuEnabled = &gltouchmenu_setTouchMenuEnabled;
|
interface_setTouchMenuEnabled = &gltouchmenu_setTouchMenuEnabled;
|
||||||
interface_setTouchMenuVisibility = &gltouchmenu_setTouchMenuVisibility;
|
interface_setTouchMenuVisibility = &gltouchmenu_setTouchMenuVisibility;
|
||||||
|
|
||||||
menu.kbdOrJoy = ICONTEXT_UPPERCASE;
|
|
||||||
|
|
||||||
glnode_registerNode(RENDER_TOP, (GLNode){
|
glnode_registerNode(RENDER_TOP, (GLNode){
|
||||||
.setup = &gltouchmenu_setup,
|
.setup = &gltouchmenu_setup,
|
||||||
.shutdown = &gltouchmenu_shutdown,
|
.shutdown = &gltouchmenu_shutdown,
|
||||||
|
Loading…
Reference in New Issue
Block a user