Skip to content

Commit dccf807

Browse files
committed
android: fix compile errors in androiddisplay module
1 parent ac8be1a commit dccf807

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

panda/src/androiddisplay/androidGraphicsWindow.cxx

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ AndroidGraphicsWindow(GraphicsEngine *engine, GraphicsPipe *pipe,
5555

5656
_app = panda_android_app;
5757

58-
GraphicsWindowInputDevice device =
59-
GraphicsWindowInputDevice::pointer_and_keyboard(this, "keyboard_mouse");
58+
PT(GraphicsWindowInputDevice) device = GraphicsWindowInputDevice::pointer_and_keyboard(this, "keyboard_mouse");
6059
add_input_device(device);
60+
_input = device;
6161
}
6262

6363
/**
@@ -486,22 +486,22 @@ handle_key_event(const AInputEvent *event) {
486486
/*
487487
int32_t meta = AKeyEvent_getMetaState(event);
488488
if (meta | AMETA_ALT_ON) {
489-
_input_devices[0].button_down(KeyboardButton.alt());
489+
_input->button_down(KeyboardButton.alt());
490490
}
491491
if (meta | AMETA_ALT_LEFT_ON) {
492-
_input_devices[0].button_down(KeyboardButton.lalt());
492+
_input->button_down(KeyboardButton.lalt());
493493
}
494494
if (meta | AMETA_ALT_RIGHT_ON) {
495-
_input_devices[0].button_down(KeyboardButton.ralt());
495+
_input->button_down(KeyboardButton.ralt());
496496
}
497497
if (meta | AMETA_SHIFT_ON) {
498-
_input_devices[0].button_down(KeyboardButton.shift());
498+
_input->button_down(KeyboardButton.shift());
499499
}
500500
if (meta | AMETA_SHIFT_LEFT_ON) {
501-
_input_devices[0].button_down(KeyboardButton.lshift());
501+
_input->button_down(KeyboardButton.lshift());
502502
}
503503
if (meta | AMETA_SHIFT_RIGHT_ON) {
504-
_input_devices[0].button_down(KeyboardButton.rshift());
504+
_input->button_down(KeyboardButton.rshift());
505505
}*/
506506

507507
int32_t keycode = AKeyEvent_getKeyCode(event);
@@ -517,12 +517,12 @@ handle_key_event(const AInputEvent *event) {
517517
int32_t action = AKeyEvent_getAction(event);
518518
if (action == AKEY_EVENT_ACTION_DOWN) {
519519
if (AKeyEvent_getRepeatCount(event) > 0) {
520-
_input_devices[0].button_resume_down(button);
520+
_input->button_resume_down(button);
521521
} else {
522-
_input_devices[0].button_down(button);
522+
_input->button_down(button);
523523
}
524524
} else if (action == AKEY_EVENT_ACTION_UP) {
525-
_input_devices[0].button_up(button);
525+
_input->button_up(button);
526526
}
527527
// TODO AKEY_EVENT_ACTION_MULTIPLE
528528

@@ -549,16 +549,16 @@ handle_motion_event(const AInputEvent *event) {
549549
if (changed != 0) {
550550
if (changed & AMOTION_EVENT_BUTTON_PRIMARY) {
551551
if (button_state & AMOTION_EVENT_BUTTON_PRIMARY) {
552-
_input_devices[0].button_down(MouseButton::one());
552+
_input->button_down(MouseButton::one());
553553
} else {
554-
_input_devices[0].button_up(MouseButton::one());
554+
_input->button_up(MouseButton::one());
555555
}
556556
}
557557
if (changed & AMOTION_EVENT_BUTTON_SECONDARY) {
558558
if (button_state & AMOTION_EVENT_BUTTON_SECONDARY) {
559-
_input_devices[0].button_down(MouseButton::three());
559+
_input->button_down(MouseButton::three());
560560
} else {
561-
_input_devices[0].button_up(MouseButton::three());
561+
_input->button_up(MouseButton::three());
562562
}
563563
}
564564
_mouse_button_state = button_state;
@@ -568,7 +568,7 @@ handle_motion_event(const AInputEvent *event) {
568568
float x = AMotionEvent_getX(event, 0) - _app->contentRect.left;
569569
float y = AMotionEvent_getY(event, 0) - _app->contentRect.top;
570570

571-
_input_devices[0].set_pointer_in_window(x, y);
571+
_input->set_pointer_in_window(x, y);
572572

573573
return 1;
574574
}

panda/src/androiddisplay/androidGraphicsWindow.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class AndroidGraphicsWindow : public GraphicsWindow {
7373

7474
int32_t _mouse_button_state;
7575

76-
const ARect *rect;
76+
GraphicsWindowInputDevice *_input;
7777

7878
public:
7979
static TypeHandle get_class_type() {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy