Iterate on GLTouchJoystick

- Use smaller models/textures
    - Slightly change the joystick/kpad glyphs
This commit is contained in:
Aaron Culliney 2016-01-02 15:05:32 -08:00
parent 691dbd5ac2
commit 2ec88ad433
4 changed files with 20 additions and 19 deletions

View File

@ -179,7 +179,7 @@ void Java_org_deadc0de_apple2ix_Apple2Preferences_nativeSetTouchJoystickButtonTy
rosetteChars[ROSETTE_NORTH] = (uint8_t)MOUSETEXT_UP; rosetteScancodes[ROSETTE_NORTH] = -1;
rosetteChars[ROSETTE_NORTHEAST] = ' '; rosetteScancodes[ROSETTE_NORTHEAST] = -1;
rosetteChars[ROSETTE_WEST] = (uint8_t)MOUSETEXT_LEFT; rosetteScancodes[ROSETTE_WEST] = -1;
rosetteChars[ROSETTE_CENTER] = '+'; rosetteScancodes[ROSETTE_CENTER] = -1;
rosetteChars[ROSETTE_CENTER] = ICONTEXT_MENU_TOUCHJOY; rosetteScancodes[ROSETTE_CENTER] = -1;
rosetteChars[ROSETTE_EAST] = (uint8_t)MOUSETEXT_RIGHT; rosetteScancodes[ROSETTE_EAST] = -1;
rosetteChars[ROSETTE_SOUTHWEST] = ' '; rosetteScancodes[ROSETTE_SOUTHWEST] = -1;
rosetteChars[ROSETTE_SOUTH] = (uint8_t)MOUSETEXT_DOWN; rosetteScancodes[ROSETTE_SOUTH] = -1;
@ -236,6 +236,9 @@ void Java_org_deadc0de_apple2ix_Apple2Preferences_nativeTouchJoystickSetKeypadTy
for (unsigned int i=0; i<(ROSETTE_ROWS * ROSETTE_COLS); i++) {
actualChars[i] = (uint8_t)rosetteChars[i];
}
if (actualChars[4] == ICONTEXT_NONACTIONABLE) {
actualChars[4] = ICONTEXT_MENU_TOUCHJOY;
}
joydriver_setTouchAxisTypes(actualChars, rosetteScans);
joydriver_setTouchButtonTypes(
(touchjoy_button_type_t)buttonsChars[0], buttonsScans[0],

View File

@ -310,7 +310,7 @@ const unsigned char interface_glyphs[256] =
/* : 0x11 ----------------------- mini-spacebar visual */
0x00, 0x00, 0x00, 0x00, 0x00, 0x22, 0x3e, 0x00,
/* : 0x12 ----------------------- glyph_joystick */
0x08, 0x08, 0x08, 0x77, 0x08, 0x08, 0x08, 0x00,
0x08, 0x08, 0x08, 0x77, 0x08, 0x08, 0x08, 0x08,
/* : 0x13 ----------------------- glyph_ctrl */
0x08, 0x1c, 0x3e, 0x63, 0x7b, 0x63, 0x7f, 0x00,
/* : 0x14 ----------------------- glyph_lowercase */
@ -322,7 +322,7 @@ const unsigned char interface_glyphs[256] =
/* : 0x17 ----------------------- glyph_backspace */
0x00, 0x08, 0x04, 0x7e, 0x04, 0x08, 0x00, 0x00,
/* : 0x18 ----------------------- glyph_joystick_kpad */
0x08, 0x2a, 0x08, 0x77, 0x08, 0x2a, 0x08, 0x00,
0x08, 0x2a, 0x08, 0x77, 0x08, 0x2a, 0x08, 0x08,
/* : 0x19 ----------------------- glyph_leftspace */
0x00, 0x7e, 0x02, 0x42, 0x42, 0x42, 0x02, 0x7e,
/* : 0x1A ----------------------- glyph_midspace */

View File

@ -1344,7 +1344,7 @@
...#...
...#...
...#...
.......
...#...
: 0x13 ----------------------- glyph_ctrl
...#...
..###..
@ -1398,7 +1398,7 @@
...#...
.#.#.#.
...#...
.......
...#...
: 0x19 ----------------------- glyph_leftspace
.......
.######

View File

@ -18,8 +18,8 @@
#define MODEL_DEPTH -1/32.f
#define TRACKING_NONE (-1)
#define AXIS_TEMPLATE_COLS 5
#define AXIS_TEMPLATE_ROWS 5
#define AXIS_TEMPLATE_COLS 3
#define AXIS_TEMPLATE_ROWS 3
#define BUTTON_TEMPLATE_COLS 1
#define BUTTON_TEMPLATE_ROWS 1
@ -30,13 +30,13 @@
#define BUTTON_FB_WIDTH (BUTTON_TEMPLATE_COLS * FONT80_WIDTH_PIXELS)
#define BUTTON_FB_HEIGHT (BUTTON_TEMPLATE_ROWS * FONT_HEIGHT_PIXELS)
#define AXIS_OBJ_W 0.4
#define AXIS_OBJ_H 0.5
#define AXIS_OBJ_W 0.3
#define AXIS_OBJ_H 0.4
#define AXIS_OBJ_HALF_W (AXIS_OBJ_W/2.f)
#define AXIS_OBJ_HALF_H (AXIS_OBJ_H/2.f)
#define BUTTON_OBJ_W 0.2
#define BUTTON_OBJ_H 0.25
#define BUTTON_OBJ_W 0.15
#define BUTTON_OBJ_H 0.2
#define BUTTON_OBJ_HALF_W (BUTTON_OBJ_W/2.f)
#define BUTTON_OBJ_HALF_H (BUTTON_OBJ_H/2.f)
@ -89,11 +89,9 @@ static void _setup_axis_object(GLModel *parent) {
if (hudElement->tpl == NULL) {
// deferred construction ...
const char axisTemplate[AXIS_TEMPLATE_ROWS][AXIS_TEMPLATE_COLS+1] = {
" @ ",
" | ",
"@-+-@",
" | ",
" @ ",
" @ ",
"@+@",
" @ ",
};
const unsigned int size = sizeof(axisTemplate);
@ -111,7 +109,7 @@ static void _setup_axis_object(GLModel *parent) {
for (unsigned int i=0; i<ROSETTE_ROWS; i++) {
for (unsigned int j=0; j<ROSETTE_COLS; j++) {
((hudElement->tpl)+(row*i*2))[j*2] = axes.rosetteChars[(i*ROSETTE_ROWS)+j];
((hudElement->tpl)+(row*i))[j] = axes.rosetteChars[(i*ROSETTE_ROWS)+j];
}
}
@ -667,7 +665,7 @@ static void gltouchjoy_setTouchButtonTypes(
} else if (touchDownChar == TOUCH_BUTTON1) {
currButtonDisplayChar = MOUSETEXT_CLOSEDAPPLE;
} else if (touchDownChar == TOUCH_BOTH) {
currButtonDisplayChar = '+';
currButtonDisplayChar = ICONTEXT_MENU_TOUCHJOY;
} else if (touchDownScancode < 0) {
currButtonDisplayChar = ' ';
}
@ -756,7 +754,7 @@ static void _init_gltouchjoy(void) {
axes.rosetteChars[3] = MOUSETEXT_LEFT;
axes.rosetteScancodes[3] = -1;
axes.rosetteChars[4] = '+';
axes.rosetteChars[4] = ICONTEXT_MENU_TOUCHJOY;
axes.rosetteScancodes[4] = -1;
axes.rosetteChars[5] = MOUSETEXT_RIGHT;
axes.rosetteScancodes[5] = -1;