소스 검색

android: add a temporary hack for mouse emulation on Android devices.

legacy
Sam Hocevar sam 11 년 전
부모
커밋
b65bde6b91
1개의 변경된 파일11개의 추가작업 그리고 3개의 파일을 삭제
  1. +11
    -3
      src/platform/android/androidapp.cpp

+ 11
- 3
src/platform/android/androidapp.cpp 파일 보기

@@ -91,6 +91,10 @@ public:

android_app* m_native_app;

/* The resolution that was asked (not the one we got) */
/* FIXME: we need proper unproject or at least screen space events!! */
ivec2 m_wanted_resolution;

SavedState m_state;

private:
@@ -200,8 +204,12 @@ int32_t lol::AndroidAppData::HandleInput(AInputEvent* event)
switch (AInputEvent_getType(event))
{
case AINPUT_EVENT_TYPE_MOTION:
Input::SetMousePos(ivec2(AMotionEvent_getX(event, 0),
AMotionEvent_getY(event, 0)));
/* FIXME: we flip the Y axis here, but is it the right place? */
ivec2 pos(AMotionEvent_getX(event, 0),
AMotionEvent_getY(event, 0));
pos = pos * m_wanted_resolution / Video::GetSize();
pos.y = m_wanted_resolution.y - 1 - pos.y;
Input::SetMousePos(pos);
switch (AKeyEvent_getAction(event) & AMOTION_EVENT_ACTION_MASK)
{
case AMOTION_EVENT_ACTION_DOWN:
@@ -284,7 +292,7 @@ void android_main(android_app* native_app)
lol::AndroidApp::AndroidApp(char const *title, ivec2 res, float fps)
: m_data(g_data)
{
;
m_data->m_wanted_resolution = res;
}

void lol::AndroidApp::ShowPointer(bool show)


불러오는 중...
취소
저장