From b4c986d273dbc1102a049619266c97734bae4816 Mon Sep 17 00:00:00 2001 From: omigamedev Date: Tue, 9 Oct 2018 12:39:24 +0200 Subject: [PATCH] update osx, ios and android projects with the new eraser flag on mouse events --- PanoPainter-OSX/main.cpp | 14 +++++++------- PanoPainter/GameViewController.m | 10 +++++----- android/build.gradle | 1 + android/src/main/cpp/main.cpp | 8 ++++---- src/node_dialog_browse.cpp | 2 +- 5 files changed, 18 insertions(+), 17 deletions(-) diff --git a/PanoPainter-OSX/main.cpp b/PanoPainter-OSX/main.cpp index 7727835..feb7d2e 100644 --- a/PanoPainter-OSX/main.cpp +++ b/PanoPainter-OSX/main.cpp @@ -292,7 +292,7 @@ static CVReturn MyDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTime auto mouseLoc = [self convertPoint:[theEvent locationInWindow] fromView:nil]; std::lock_guard lock(task_mutex); tasklist.emplace_back([mouseLoc,p=theEvent.pressure] { - App::I.mouse_down(0, mouseLoc.x, App::I.height - mouseLoc.y - 1, p, kEventSource::Mouse); + App::I.mouse_down(0, mouseLoc.x, App::I.height - mouseLoc.y - 1, p, kEventSource::Mouse, 0); }); } - (void)rightMouseDown:(NSEvent *)theEvent @@ -300,7 +300,7 @@ static CVReturn MyDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTime auto mouseLoc = [self convertPoint:[theEvent locationInWindow] fromView:nil]; std::lock_guard lock(task_mutex); tasklist.emplace_back([mouseLoc,p=theEvent.pressure] { - App::I.mouse_down(1, mouseLoc.x, App::I.height - mouseLoc.y - 1, p, kEventSource::Mouse); + App::I.mouse_down(1, mouseLoc.x, App::I.height - mouseLoc.y - 1, p, kEventSource::Mouse, 0); }); } - (void)mouseUp:(NSEvent *)theEvent @@ -308,7 +308,7 @@ static CVReturn MyDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTime auto mouseLoc = [self convertPoint:[theEvent locationInWindow] fromView:nil]; std::lock_guard lock(task_mutex); tasklist.emplace_back([mouseLoc] { - App::I.mouse_up(0, mouseLoc.x, App::I.height - mouseLoc.y - 1, kEventSource::Mouse); + App::I.mouse_up(0, mouseLoc.x, App::I.height - mouseLoc.y - 1, kEventSource::Mouse, 0); }); } - (void)rightMouseUp:(NSEvent *)theEvent @@ -316,7 +316,7 @@ static CVReturn MyDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTime auto mouseLoc = [self convertPoint:[theEvent locationInWindow] fromView:nil]; std::lock_guard lock(task_mutex); tasklist.emplace_back([mouseLoc] { - App::I.mouse_up(1, mouseLoc.x, App::I.height - mouseLoc.y - 1, kEventSource::Mouse); + App::I.mouse_up(1, mouseLoc.x, App::I.height - mouseLoc.y - 1, kEventSource::Mouse, 0); }); } - (void)mouseMoved:(NSEvent *)theEvent @@ -324,7 +324,7 @@ static CVReturn MyDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTime auto mouseLoc = [self convertPoint:[theEvent locationInWindow] fromView:nil]; std::lock_guard lock(task_mutex); tasklist.emplace_back([mouseLoc,p=theEvent.pressure] { - App::I.mouse_move(mouseLoc.x, App::I.height - mouseLoc.y - 1, p, kEventSource::Mouse); + App::I.mouse_move(mouseLoc.x, App::I.height - mouseLoc.y - 1, p, kEventSource::Mouse, 0); }); } -(void)mouseDragged:(NSEvent *)theEvent @@ -332,7 +332,7 @@ static CVReturn MyDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTime auto mouseLoc = [self convertPoint:[theEvent locationInWindow] fromView:nil]; std::lock_guard lock(task_mutex); tasklist.emplace_back([mouseLoc,p=theEvent.pressure] { - App::I.mouse_move(mouseLoc.x, App::I.height - mouseLoc.y - 1, p, kEventSource::Mouse); + App::I.mouse_move(mouseLoc.x, App::I.height - mouseLoc.y - 1, p, kEventSource::Mouse, 0); }); } - (void)rightMouseDragged:(NSEvent *)theEvent @@ -340,7 +340,7 @@ static CVReturn MyDisplayLinkCallback(CVDisplayLinkRef displayLink, const CVTime auto mouseLoc = [self convertPoint:[theEvent locationInWindow] fromView:nil]; std::lock_guard lock(task_mutex); tasklist.emplace_back([mouseLoc,p=theEvent.pressure] { - App::I.mouse_move(mouseLoc.x, App::I.height - mouseLoc.y - 1, p, kEventSource::Mouse); + App::I.mouse_move(mouseLoc.x, App::I.height - mouseLoc.y - 1, p, kEventSource::Mouse, 0); }); } - (void)scrollWheel:(NSEvent *)theEvent diff --git a/PanoPainter/GameViewController.m b/PanoPainter/GameViewController.m index 210d66f..3f7b2ed 100644 --- a/PanoPainter/GameViewController.m +++ b/PanoPainter/GameViewController.m @@ -223,7 +223,7 @@ std::set ignored_touch; std::lock_guard lock(task_mutex); tasklist.emplace_back([touchLocation, scale, f=touch.force, source] { - App::I.mouse_down(0, touchLocation.x * scale, touchLocation.y * scale, f, source); + App::I.mouse_down(0, touchLocation.x * scale, touchLocation.y * scale, f, source, 0); }); t_count = 1; t_pos = {touchLocation.x * scale, touchLocation.y * scale}; @@ -270,9 +270,9 @@ std::set ignored_touch; std::lock_guard lock(task_mutex); tasklist.emplace_back([tt0=t0.type,tt1=t1.type,p0,p1,f0=t0.force,f1=t1.force] { if (tt0 == UITouchType::UITouchTypeStylus) - App::I.mouse_move(p0.x, p0.y, f0, kEventSource::Stylus); + App::I.mouse_move(p0.x, p0.y, f0, kEventSource::Stylus, 0); if (tt1 == UITouchType::UITouchTypeStylus) - App::I.mouse_move(p1.x, p1.y, f1, kEventSource::Stylus); + App::I.mouse_move(p1.x, p1.y, f1, kEventSource::Stylus, 0); }); } else if (n == 2) @@ -306,7 +306,7 @@ std::set ignored_touch; kEventSource source = touch.type == UITouchType::UITouchTypeStylus ? kEventSource::Stylus : kEventSource::Touch; std::lock_guard lock(task_mutex); tasklist.emplace_back([touchLocation, scale, source, force] { - App::I.mouse_move(touchLocation.x * scale, touchLocation.y * scale, force, source); + App::I.mouse_move(touchLocation.x * scale, touchLocation.y * scale, force, source, 0); }); } } @@ -332,7 +332,7 @@ std::set ignored_touch; if (tc == 2) App::I.gesture_end(); else - App::I.mouse_up(0, touchLocation.x * scale, touchLocation.y * scale, source); + App::I.mouse_up(0, touchLocation.x * scale, touchLocation.y * scale, source, 0); }); t_count = 0; diff --git a/android/build.gradle b/android/build.gradle index 1f57e52..b79a442 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -151,6 +151,7 @@ task generateVersioning(type: Exec) { copyFiles.dependsOn(generateVersioning) task generateJavaH(type: Exec) { + ignoreExitValue true workingDir "$projectDir" commandLine 'javah', "-jni", "-force", "-cp", "$classpath", "-d", "$outpath", "$activity" } diff --git a/android/src/main/cpp/main.cpp b/android/src/main/cpp/main.cpp index 4575e19..beb0f94 100755 --- a/android/src/main/cpp/main.cpp +++ b/android/src/main/cpp/main.cpp @@ -748,7 +748,7 @@ static int32_t engine_handle_input(struct android_app* app, AInputEvent* event) float pressure = AMotionEvent_getPressure(event, 0); kEventSource source = tool_type == AMOTION_EVENT_TOOL_TYPE_STYLUS ? kEventSource::Stylus : kEventSource::Touch; - App::I.mouse_down(0, x, y, pressure, source); + App::I.mouse_down(0, x, y, pressure, source, 0); tracked = 1; //LOG("first down"); return 1; @@ -784,7 +784,7 @@ static int32_t engine_handle_input(struct android_app* app, AInputEvent* event) kEventSource source = tool_type == AMOTION_EVENT_TOOL_TYPE_STYLUS ? kEventSource::Stylus : kEventSource::Touch; if (tracked == 1) - App::I.mouse_up(0, x, y, source); + App::I.mouse_up(0, x, y, source, 0); tracked = 0; //LOG("first up"); return 1; @@ -801,7 +801,7 @@ static int32_t engine_handle_input(struct android_app* app, AInputEvent* event) { float y = AMotionEvent_getY(event, 0); float x = AMotionEvent_getX(event, 0); - App::I.mouse_move(x, y, 0, kEventSource::Stylus); + App::I.mouse_move(x, y, 0, kEventSource::Stylus, 0); //LOG("single move"); return 1; } @@ -814,7 +814,7 @@ static int32_t engine_handle_input(struct android_app* app, AInputEvent* event) float pressure = AMotionEvent_getPressure(event, 0); kEventSource source = tool_type == AMOTION_EVENT_TOOL_TYPE_STYLUS ? kEventSource::Stylus : kEventSource::Touch; - App::I.mouse_move(x, y, pressure, source); + App::I.mouse_move(x, y, pressure, source, 0); //LOG("single move"); } else if (count == 2) diff --git a/src/node_dialog_browse.cpp b/src/node_dialog_browse.cpp index 6f6a0c9..0134596 100644 --- a/src/node_dialog_browse.cpp +++ b/src/node_dialog_browse.cpp @@ -114,7 +114,7 @@ void NodeDialogBrowse::clear_list() { for (auto& n : container->m_children) { - if (auto item = std::dynamic_pointer_cast(n)) + if (auto item = std::static_pointer_cast(n)) item->m_thumb->tex.destroy(); } container->remove_all_children();