From 1ba2538baf7a91bb288969c67ff9988718678726 Mon Sep 17 00:00:00 2001 From: Vladislav Khorev Date: Sun, 10 Feb 2013 15:34:32 +0000 Subject: [PATCH] fixing minor bugs --- .../jni/android_api.cpp | 38 ++----------------- .../SalmonWallpaperTemplate/jni/main_code.cpp | 6 +++ 2 files changed, 9 insertions(+), 35 deletions(-) diff --git a/Templates/SalmonWallpaperTemplate/jni/android_api.cpp b/Templates/SalmonWallpaperTemplate/jni/android_api.cpp index 21bccc6..4e59528 100644 --- a/Templates/SalmonWallpaperTemplate/jni/android_api.cpp +++ b/Templates/SalmonWallpaperTemplate/jni/android_api.cpp @@ -14,43 +14,10 @@ bool RedBkgPref = false; JNIEXPORT void JNICALL Java_fishrungames_wallpapertemplate_JniWrapper_Init(JNIEnv * env, jobject obj, jint width, jint height) { - Application = JniInitApp(width, height, 800.f, 480.f); + Application = JniInitApp(width, height, width, height); boost::get(Renderer->Camera).SetAlpha((lastOffsetX) * pi / 180.f); - - /* - RenderMutex.lock(); - - try - { - - if (Application->IsInited()) - { - App->OuterDeinit(); //Clean up what is left at previous launch (if applicable) - } - - App->Width = width; - App->Height = height; - - if (width > height) - { - App->OuterInit(width, height, 800.f, 480.f); - } - else - { - App->OuterInit(width, height, 480.f, 800.f); - } - - Renderer->SetAlpha((lastOffsetX) * pi / 180.f); - - App->Inited = true; - } - catch (...) - { - throw; - } - - RenderMutex.unlock();*/ + } @@ -62,6 +29,7 @@ JNIEXPORT void JNICALL Java_fishrungames_wallpapertemplate_JniWrapper_SetOffset( { OffsetChanged = true; lastOffsetX = offsetX; + boost::get(Renderer->Camera).SetAlpha((lastOffsetX) * pi / 180.f); } } diff --git a/Templates/SalmonWallpaperTemplate/jni/main_code.cpp b/Templates/SalmonWallpaperTemplate/jni/main_code.cpp index e174bae..a631cd8 100644 --- a/Templates/SalmonWallpaperTemplate/jni/main_code.cpp +++ b/Templates/SalmonWallpaperTemplate/jni/main_code.cpp @@ -75,12 +75,18 @@ void TAndroidApplication::DrawAllScene() Renderer->PopProjectionMatrix(); + Renderer->PushPerspectiveProjectionMatrix(pi/6, Renderer->GetMatrixWidth() / Renderer->GetMatrixHeight(), 1.f, 4500.f); + + glClear(GL_DEPTH_BUFFER_BIT); Renderer->SetGLCamView(); //LiteModel->DrawVBO(); FlexModel.Draw(); + + Renderer->PopProjectionMatrix(); + }