From 155e75943eac291d4a429a424ad5d358edfbdbc7 Mon Sep 17 00:00:00 2001 From: Joshua Granick Date: Sun, 1 Dec 2013 19:53:33 -0800 Subject: [PATCH] Enable multi-touch and don't hard-code the frame rate --- .../src/platform/tizen/TizenApplication.cpp | 40 +++++++++++++++---- project/src/sound/openal/OpenALSound.h | 2 +- 2 files changed, 33 insertions(+), 9 deletions(-) diff --git a/project/src/platform/tizen/TizenApplication.cpp b/project/src/platform/tizen/TizenApplication.cpp index c5580fcb9..f6af0b7d9 100644 --- a/project/src/platform/tizen/TizenApplication.cpp +++ b/project/src/platform/tizen/TizenApplication.cpp @@ -127,6 +127,7 @@ namespace lime { mForm->AddKeyEventListener (*this); mForm->AddTouchEventListener (*this); + mForm->SetMultipointTouchEnabled (true); bool ok = limeEGLCreate (mForm, sgWidth, sgHeight, 2, (sgFlags & wfDepthBuffer) ? 16 : 0, (sgFlags & wfStencilBuffer) ? 8 : 0, 0); @@ -174,18 +175,31 @@ namespace lime { void TizenApplication::OnForeground (void) { - if (mTimer != null) { - - mTimer->Start (10); - - } - Event activate (etActivate); sgTizenFrame->HandleEvent (activate); Event gotFocus (etGotInputFocus); sgTizenFrame->HandleEvent (gotFocus); + Event poll (etPoll); + sgTizenFrame->HandleEvent (poll); + + double next = sgTizenFrame->GetStage ()->GetNextWake () - GetTimeStamp (); + + if (mTimer != null) { + + if (next > 0) { + + mTimer->Start (next * 1000.0); + + } else { + + mTimer->Start (10); + + } + + } + } @@ -223,11 +237,21 @@ namespace lime { } - mTimer->Start (10); - Event poll (etPoll); sgTizenFrame->HandleEvent (poll); + double next = sgTizenFrame->GetStage ()->GetNextWake () - GetTimeStamp (); + + if (next > 0) { + + mTimer->Start (next * 1000.0); + + } else { + + mTimer->Start (10); + + } + } diff --git a/project/src/sound/openal/OpenALSound.h b/project/src/sound/openal/OpenALSound.h index fddad97a0..045ab8dc2 100644 --- a/project/src/sound/openal/OpenALSound.h +++ b/project/src/sound/openal/OpenALSound.h @@ -24,7 +24,7 @@ typedef unsigned char uint8; -#define STREAM_BUFFER_SIZE (4096 * 4) +#define STREAM_BUFFER_SIZE (4096 * 8) namespace lime {