diff --git a/Templates/SalmonUniversalTemplate/iOS/ios_api.cpp b/Templates/SalmonUniversalTemplate/iOS/ios_api.cpp index 7f46ee7..b951083 100644 --- a/Templates/SalmonUniversalTemplate/iOS/ios_api.cpp +++ b/Templates/SalmonUniversalTemplate/iOS/ios_api.cpp @@ -1,52 +1,55 @@ #include "include/Engine.h" #include "main_code.h" -TMyApplication App; +TMyApplication* App; extern "C" void AppInit() { + CreateEngine(); + App = new TMyApplication; + App->OuterInit(480, 320, 480, 320); - App.OuterInit(480, 320, 480, 320); } - extern "C" void AppDeinit() { - App.OuterDeinit(); + + App->OuterDeinit(); + delete App; + DestroyEngine(); } extern "C" void AppUpdate(int dt) { - App.OuterUpdate(dt); + App->OuterUpdate(dt); } extern "C" void AppDraw() { - App.OuterDraw(); + App->OuterDraw(); } extern "C" void AppOnTapDown(int posx, int posy) { - App.OuterOnTapDown(vec2(posx, posy)); + App->OuterOnTapDown(vec2(posx, posy)); } extern "C" void AppOnTapUp(int posx, int posy) { - App.OuterOnTapUp(vec2(posx, posy)); + App->OuterOnTapUp(vec2(posx, posy)); } extern "C" void AppOnTapUpAfterScroll(int posx, int posy) { - App.OuterOnTapUpAfterShift(vec2(posx, posy)); + App->OuterOnTapUpAfterShift(vec2(posx, posy)); } extern "C" void AppOnScroll(int shiftx, int shifty) { - App.OuterOnMove(vec2(shiftx, shifty)); + App->OuterOnMove(vec2(shiftx, shifty)); } - diff --git a/Templates/SalmonUniversalTemplate/jni/Android.mk b/Templates/SalmonUniversalTemplate/jni/Android.mk index 4b85a29..d648ff4 100644 --- a/Templates/SalmonUniversalTemplate/jni/Android.mk +++ b/Templates/SalmonUniversalTemplate/jni/Android.mk @@ -41,7 +41,7 @@ LOCAL_PATH:= $(LPATH) include $(CLEAR_VARS) -LOCAL_CFLAGS := -DTARGET_ANDROID -DNOSOUND -DTARGET_SALMON -std=gnu++11 --std=c++11 +LOCAL_CFLAGS := -DTARGET_ANDROID -DNOSOUND -std=gnu++11 --std=c++11 LOCAL_STATIC_LIBRARIES := boost LOCAL_STATIC_LIBRARIES += squirrel LOCAL_STATIC_LIBRARIES += png_lib diff --git a/Templates/SalmonUniversalTemplate/windows/SalmonTemplate/Template/Template.vcxproj b/Templates/SalmonUniversalTemplate/windows/SalmonTemplate/Template/Template.vcxproj index b3c1d5a..f666417 100644 --- a/Templates/SalmonUniversalTemplate/windows/SalmonTemplate/Template/Template.vcxproj +++ b/Templates/SalmonUniversalTemplate/windows/SalmonTemplate/Template/Template.vcxproj @@ -49,7 +49,7 @@ Level3 Disabled ../../../jni;$(SalmonEnginePath);$(LibsPath)\boost_1_52_0;$(LibsPath)\libogg-1.3.0\include;$(LibsPath)\libvorbis-1.3.2\include;$(LibsPath)\sqplus\sqplus;$(LibsPath)\sqplus\include;$(LibsPath)\DirectXsdk\Include;$(LibsPath)\lpng1510 - TARGET_WIN32;TARGET_SALMON;WIN32_LEAN_AND_MEAN;_WIN32_WINNT=0x0501;DEBUG + TARGET_WIN32;WIN32_LEAN_AND_MEAN;_WIN32_WINNT=0x0501;DEBUG 4503 @@ -65,7 +65,7 @@ true true ../../../jni;$(SalmonEnginePath);$(LibsPath)\boost_1_52_0;$(LibsPath)\libogg-1.3.0\include;$(LibsPath)\libvorbis-1.3.2\include;$(LibsPath)\sqplus\sqplus;$(LibsPath)\sqplus\include;$(LibsPath)\DirectXsdk\Include;$(LibsPath)\lpng1510 - TARGET_WIN32;TARGET_SALMON;WIN32_LEAN_AND_MEAN;_WIN32_WINNT=0x0501;NDEBUG + TARGET_WIN32;WIN32_LEAN_AND_MEAN;_WIN32_WINNT=0x0501;NDEBUG 4503