Changeset 1964


Ignore:
Timestamp:
Oct 2, 2012, 10:35:20 AM (5 years ago)
Author:
sam
Message:

android: use the FPS value provided by the application; we now run at
60 fps on Android devices, too.

Location:
trunk/src/platform/android
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/platform/android/androidapp.cpp

    r1949 r1964  
    3535Queue<int> g_main_queue;
    3636Thread *g_main_thread;
     37float g_fps;
    3738
    3839AndroidApp::AndroidApp(char const *title, ivec2 res, float fps)
    39   : data(0)
     40  : m_data(0)
    4041{
     42    g_fps = fps;
    4143}
    4244
     
    5153void AndroidApp::Run()
    5254{
     55    g_main_queue.Push(1);
    5356    g_main_queue.Push(1);
    5457
     
    101104Java_org_zoy_LolEngine_LolRenderer_nativeInit(JNIEnv* env)
    102105{
    103     Log::Info("Java layer initialising renderer");
    104     Ticker::Setup(30.0f);
     106    /* Initialise app thread and wait for it to be ready, ie. set
     107     * the FPS value at least. */
     108    g_main_thread = new Thread(lol::AndroidApp::MainRun, NULL);;
     109    g_main_queue.Pop();
     110
     111    /* Launch our ticker */
     112    Log::Info("Java layer initialising renderer at %g fps", g_fps);
     113    Ticker::Setup(g_fps);
    105114    Video::Setup(ivec2(320, 200));
    106115
    107     g_main_thread = new Thread(lol::AndroidApp::MainRun, NULL);;
     116    /* Wake up app thread */
    108117    g_main_queue.Pop();
    109118}
     
    146155                                          jint x, jint y)
    147156{
    148     ivec2 pos = ivec2(0, 479) + ivec2(x * 640, -y * 480) / Video::GetSize();
    149     Input::SetMousePos(pos);
     157    Input::SetMousePos(ivec2(x, y));
    150158}
    151159
  • trunk/src/platform/android/androidapp.h

    r1684 r1964  
    3636
    3737private:
    38     AndroidAppData *data;
     38    AndroidAppData *m_data;
    3939};
    4040
Note: See TracChangeset for help on using the changeset viewer.