From 3fbaa479e33466394cd243ab652bd1c4c082549a Mon Sep 17 00:00:00 2001 From: volzhs Date: Wed, 28 Oct 2015 15:48:37 +0900 Subject: improve android payments GodotPaymentV3 currently consumes purchased item right after purchasing. But, some in-app item should not consume like "remove ads permanently" So, I added "setAutoConsume(boolean)", "requestPurchased()", "consume(sku_string)". AutoConsume is true by default as before. usage: func _ready(): var payment = Globals.get_singleton("GodotPayments") payment.setPurchaseCallbackId(get_instance_ID()) payment.setAutoConsume(false) # default : true payment.requestPurchased() # callback : has_purchased payment.purchase("item_name") # callback : purchase_success, purchase_fail, purchase_cancel, purchase_owned payment.consume("item_name") # callback : consume_success func purchase_success(receipt, signature, sku): print("purchase_success : ", sku) func purchase_fail(): print("purchase_fail") func purchase_cancel(): print("purchase_cancel") func purchase_owned(sku): print("purchase_owned : ", sku) func consume_success(receipt, signature, sku): print("consume_success : ", sku) func has_purchased(receipt, signature, sku): if sku == "": print("has_purchased : nothing") else: print("has_purchased : ", sku) --- .../java/src/com/android/godot/GodotPaymentV3.java | 60 +++++++--- .../android/godot/payments/PaymentsManager.java | 123 +++++++++++++++++---- .../com/android/godot/payments/PurchaseTask.java | 8 +- 3 files changed, 150 insertions(+), 41 deletions(-) (limited to 'platform') diff --git a/platform/android/java/src/com/android/godot/GodotPaymentV3.java b/platform/android/java/src/com/android/godot/GodotPaymentV3.java index 0fd102ac55..0799e1e83d 100644 --- a/platform/android/java/src/com/android/godot/GodotPaymentV3.java +++ b/platform/android/java/src/com/android/godot/GodotPaymentV3.java @@ -27,7 +27,7 @@ public class GodotPaymentV3 extends Godot.SingletonBase { activity.getPaymentsManager().requestPurchase(sku, transactionId); } }); - }; + } /* public string requestPurchasedTicket(){ activity.getPaymentsManager() @@ -42,7 +42,7 @@ public class GodotPaymentV3 extends Godot.SingletonBase { public GodotPaymentV3(Activity p_activity) { - registerClass("GodotPayments", new String[] {"purchase", "setPurchaseCallbackId", "setPurchaseValidationUrlPrefix", "setTransactionId", "getSignature", "consumeUnconsumedPurchases"}); + registerClass("GodotPayments", new String[] {"purchase", "setPurchaseCallbackId", "setPurchaseValidationUrlPrefix", "setTransactionId", "getSignature", "consumeUnconsumedPurchases", "requestPurchased", "setAutoConsume", "consume"}); activity=(Godot) p_activity; } @@ -54,7 +54,6 @@ public class GodotPaymentV3 extends Godot.SingletonBase { activity.getPaymentsManager().consumeUnconsumedPurchases(); } }); - } private String signature; @@ -63,25 +62,26 @@ public class GodotPaymentV3 extends Godot.SingletonBase { } - public void callbackSuccess(String ticket, String signature){ -// Log.d(this.getClass().getName(), "PRE-Send callback to purchase success"); - GodotLib.callobject(purchaseCallbackId, "purchase_success", new Object[]{ticket, signature}); -// Log.d(this.getClass().getName(), "POST-Send callback to purchase success"); + public void callbackSuccess(String ticket, String signature, String sku){ +// Log.d(this.getClass().getName(), "PRE-Send callback to purchase success"); + GodotLib.callobject(purchaseCallbackId, "purchase_success", new Object[]{ticket, signature, sku}); +// Log.d(this.getClass().getName(), "POST-Send callback to purchase success"); } public void callbackSuccessProductMassConsumed(String ticket, String signature, String sku){ -// Log.d(this.getClass().getName(), "PRE-Send callback to consume success"); - GodotLib.calldeferred(purchaseCallbackId, "consume_success", new Object[]{ticket, signature, sku}); -// Log.d(this.getClass().getName(), "POST-Send callback to consume success"); +// Log.d(this.getClass().getName(), "PRE-Send callback to consume success"); + Log.d(this.getClass().getName(), "callbackSuccessProductMassConsumed > "+ticket+","+signature+","+sku); + GodotLib.calldeferred(purchaseCallbackId, "consume_success", new Object[]{ticket, signature, sku}); +// Log.d(this.getClass().getName(), "POST-Send callback to consume success"); } public void callbackSuccessNoUnconsumedPurchases(){ - GodotLib.calldeferred(purchaseCallbackId, "no_validation_required", new Object[]{}); + GodotLib.calldeferred(purchaseCallbackId, "no_validation_required", new Object[]{}); } public void callbackFail(){ - GodotLib.calldeferred(purchaseCallbackId, "purchase_fail", new Object[]{}); -// GodotLib.callobject(purchaseCallbackId, "purchase_fail", new Object[]{}); + GodotLib.calldeferred(purchaseCallbackId, "purchase_fail", new Object[]{}); +// GodotLib.callobject(purchaseCallbackId, "purchase_fail", new Object[]{}); } public void callbackCancel(){ @@ -89,6 +89,10 @@ public class GodotPaymentV3 extends Godot.SingletonBase { // GodotLib.callobject(purchaseCallbackId, "purchase_cancel", new Object[]{}); } + public void callbackAlreadyOwned(String sku){ + GodotLib.calldeferred(purchaseCallbackId, "purchase_owned", new Object[]{sku}); + } + public int getPurchaseCallbackId() { return purchaseCallbackId; } @@ -97,8 +101,6 @@ public class GodotPaymentV3 extends Godot.SingletonBase { this.purchaseCallbackId = purchaseCallbackId; } - - public String getPurchaseValidationUrlPrefix(){ return this.purchaseValidationUrlPrefix ; } @@ -107,12 +109,10 @@ public class GodotPaymentV3 extends Godot.SingletonBase { this.purchaseValidationUrlPrefix = url; } - public String getAccessToken() { return accessToken; } - public void setAccessToken(String accessToken) { this.accessToken = accessToken; } @@ -125,4 +125,30 @@ public class GodotPaymentV3 extends Godot.SingletonBase { return this.transactionId; } + // request purchased items are not consumed + public void requestPurchased(){ + activity.getPaymentsManager().setBaseSingleton(this); + activity.runOnUiThread(new Runnable() { + @Override + public void run() { + activity.getPaymentsManager().requestPurchased(); + } + }); + } + + // callback for requestPurchased() + public void callbackPurchased(String receipt, String signature, String sku){ + GodotLib.calldeferred(purchaseCallbackId, "has_purchased", new Object[]{receipt, signature, sku}); + } + + // consume item automatically after purchase. default is true. + public void setAutoConsume(boolean autoConsume){ + activity.getPaymentsManager().setAutoConsume(autoConsume); + } + + // consume a specific item + public void consume(String sku){ + activity.getPaymentsManager().consume(sku); + } } + diff --git a/platform/android/java/src/com/android/godot/payments/PaymentsManager.java b/platform/android/java/src/com/android/godot/payments/PaymentsManager.java index 5bf86d0b69..189f7108c1 100644 --- a/platform/android/java/src/com/android/godot/payments/PaymentsManager.java +++ b/platform/android/java/src/com/android/godot/payments/PaymentsManager.java @@ -25,10 +25,8 @@ import com.android.vending.billing.IInAppBillingService; public class PaymentsManager { public static final int BILLING_RESPONSE_RESULT_OK = 0; - - public static final int REQUEST_CODE_FOR_PURCHASE = 0x1001; - + private static boolean auto_consume = true; private Activity activity; IInAppBillingService mService; @@ -69,13 +67,12 @@ public class PaymentsManager { } @Override - public void onServiceConnected(ComponentName name, - IBinder service) { - mService = IInAppBillingService.Stub.asInterface(service); + public void onServiceConnected(ComponentName name, IBinder service) { + mService = IInAppBillingService.Stub.asInterface(service); } }; - public void requestPurchase(String sku, String transactionId){ + public void requestPurchase(final String sku, String transactionId){ new PurchaseTask(mService, Godot.getInstance()) { @Override @@ -88,6 +85,12 @@ public class PaymentsManager { protected void canceled() { godotPaymentV3.callbackCancel(); } + + @Override + protected void alreadyOwned() { + godotPaymentV3.callbackAlreadyOwned(sku); + } + }.purchase(sku, transactionId); } @@ -114,26 +117,82 @@ public class PaymentsManager { }.consumeItAll(); } + public void requestPurchased(){ + try{ + PaymentsCache pc = new PaymentsCache(Godot.getInstance()); + +// Log.d("godot", "requestPurchased for " + activity.getPackageName()); + Bundle bundle = mService.getPurchases(3, activity.getPackageName(), "inapp",null); + +/* + for (String key : bundle.keySet()) { + Object value = bundle.get(key); + Log.d("godot", String.format("%s %s (%s)", key, value.toString(), value.getClass().getName())); + } +*/ + + if (bundle.getInt("RESPONSE_CODE") == 0){ + + final ArrayList myPurchases = bundle.getStringArrayList("INAPP_PURCHASE_DATA_LIST"); + final ArrayList mySignatures = bundle.getStringArrayList("INAPP_DATA_SIGNATURE_LIST"); + + + if (myPurchases == null || myPurchases.size() == 0){ +// Log.d("godot", "No purchases!"); + godotPaymentV3.callbackPurchased("", "", ""); + return; + } + +// Log.d("godot", "# products are purchased:" + myPurchases.size()); + for (int i=0;i Date: Sun, 1 Nov 2015 20:53:26 +0100 Subject: Cosmetic fixes to SCons buildsystem - Removed trailing spaces - Made sure all indentation is done using tabs (fixes #39) - Potentially fixed an identation issue for openssl check --- platform/android/SCsub | 4 ++-- platform/bb10/SCsub | 1 - platform/flash/SCsub | 2 -- platform/windows/SCsub | 2 +- 4 files changed, 3 insertions(+), 6 deletions(-) (limited to 'platform') diff --git a/platform/android/SCsub b/platform/android/SCsub index 6feeb8b365..834ee58adc 100644 --- a/platform/android/SCsub +++ b/platform/android/SCsub @@ -62,10 +62,10 @@ pp_baseout.write( manifest ) for x in env.android_source_files: - shutil.copy(x,abspath+"/java/src/com/android/godot") + shutil.copy(x,abspath+"/java/src/com/android/godot") for x in env.android_module_libraries: - shutil.copy(x,abspath+"/java/libs") + shutil.copy(x,abspath+"/java/libs") env_android.SharedLibrary("#bin/libgodot",[android_objects],SHLIBSUFFIX=env["SHLIBSUFFIX"]) diff --git a/platform/bb10/SCsub b/platform/bb10/SCsub index 24f2b5d242..81f6e726e4 100644 --- a/platform/bb10/SCsub +++ b/platform/bb10/SCsub @@ -19,4 +19,3 @@ if env['bb10_lgles_override'] == "yes": prog = None prog = env_bps.Program('#bin/godot', bb10_lib) - diff --git a/platform/flash/SCsub b/platform/flash/SCsub index b7aef3b65d..4e5f26d52a 100644 --- a/platform/flash/SCsub +++ b/platform/flash/SCsub @@ -36,5 +36,3 @@ java -jar $ALCHEMY/usr/lib/asc2.jar -md -strict -optimize -AS3 \ -import ../platform/flash/lib/libGL.abc \ ../platform/flash/Console.as """ - - diff --git a/platform/windows/SCsub b/platform/windows/SCsub index 1ad32e7989..e7d7285b43 100644 --- a/platform/windows/SCsub +++ b/platform/windows/SCsub @@ -13,7 +13,7 @@ common_win=[ env.Program('#bin/godot',['godot_win.cpp']+common_win,PROGSUFFIX=env["PROGSUFFIX"]) -# Microsoft Visual Studio Project Generation +# Microsoft Visual Studio Project Generation if (env['vsproj'])=="yes": env.vs_srcs = env.vs_srcs + ["platform/windows/godot_win.cpp"] for x in common_win: -- cgit v1.2.3 From e723488aa3933ec0e56b8e09e44256f6dc5da344 Mon Sep 17 00:00:00 2001 From: Saracen Date: Sat, 31 Oct 2015 08:59:29 +0000 Subject: Moved deleting sample player in OS finalize methods to before deleting audio server to prevent crash when exiting. --- platform/bb10/os_bb10.cpp | 3 ++- platform/haiku/os_haiku.cpp | 3 ++- platform/server/os_server.cpp | 3 ++- platform/windows/os_windows.cpp | 3 ++- platform/winrt/os_winrt.cpp | 3 ++- platform/x11/os_x11.cpp | 3 ++- 6 files changed, 12 insertions(+), 6 deletions(-) (limited to 'platform') diff --git a/platform/bb10/os_bb10.cpp b/platform/bb10/os_bb10.cpp index d89033b1df..c8e7ae561e 100644 --- a/platform/bb10/os_bb10.cpp +++ b/platform/bb10/os_bb10.cpp @@ -195,9 +195,10 @@ void OSBB10::finalize() { // memdelete(debugger_connection_console); //} + memdelete(sample_manager); + audio_server->finish(); memdelete(audio_server); - memdelete(sample_manager); visual_server->finish(); memdelete(visual_server); diff --git a/platform/haiku/os_haiku.cpp b/platform/haiku/os_haiku.cpp index 1edb23d504..ef483657ca 100644 --- a/platform/haiku/os_haiku.cpp +++ b/platform/haiku/os_haiku.cpp @@ -137,9 +137,10 @@ void OS_Haiku::finalize() { spatial_sound_2d_server->finish(); memdelete(spatial_sound_2d_server); + memdelete(sample_manager); + audio_server->finish(); memdelete(audio_server); - memdelete(sample_manager); visual_server->finish(); memdelete(visual_server); diff --git a/platform/server/os_server.cpp b/platform/server/os_server.cpp index 75e0878bac..8b831140d6 100644 --- a/platform/server/os_server.cpp +++ b/platform/server/os_server.cpp @@ -107,9 +107,10 @@ void OS_Server::finalize() { // memdelete(debugger_connection_console); //} + memdelete(sample_manager); + audio_server->finish(); memdelete(audio_server); - memdelete(sample_manager); visual_server->finish(); memdelete(visual_server); diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index 438a5a6903..c6dae86222 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -1373,9 +1373,10 @@ void OS_Windows::finalize() { // memdelete(debugger_connection_console); //} + memdelete(sample_manager); + audio_server->finish(); memdelete(audio_server); - memdelete(sample_manager); memdelete(input); diff --git a/platform/winrt/os_winrt.cpp b/platform/winrt/os_winrt.cpp index 3e06d9d59b..02de262508 100644 --- a/platform/winrt/os_winrt.cpp +++ b/platform/winrt/os_winrt.cpp @@ -326,10 +326,11 @@ void OSWinrt::finalize() { //if (debugger_connection_console) { // memdelete(debugger_connection_console); //} + + memdelete(sample_manager); audio_server->finish(); memdelete(audio_server); - memdelete(sample_manager); memdelete(input); diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp index 34bd1184a1..3218230d0b 100644 --- a/platform/x11/os_x11.cpp +++ b/platform/x11/os_x11.cpp @@ -452,9 +452,10 @@ void OS_X11::finalize() { // memdelete(debugger_connection_console); //} + memdelete(sample_manager); + audio_server->finish(); memdelete(audio_server); - memdelete(sample_manager); visual_server->finish(); memdelete(visual_server); -- cgit v1.2.3 From 6334895088947eb318c8df15d0a68db27819a06f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Thu, 5 Nov 2015 20:13:05 +0100 Subject: Display error type (error, warning, script error) in OS::print_error Previously all types of errors would be shown as ERROR, thus making for example warnings (WARN_PRINT) somewhat aggressive. ERROR is displayed in red, WARNING in yellow and SCRIPT ERROR in magenta (though the latter does not seem used so far). Fixes #1127. --- platform/windows/os_windows.cpp | 25 ++++++++++++++++++------- platform/winrt/os_winrt.cpp | 26 ++++++++++++++++++-------- 2 files changed, 36 insertions(+), 15 deletions(-) (limited to 'platform') diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index 438a5a6903..01a8261563 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -1768,15 +1768,26 @@ void OS_Windows::print_error(const char* p_function,const char* p_file,int p_lin HANDLE hCon=GetStdHandle(STD_OUTPUT_HANDLE); if (!hCon || hCon==INVALID_HANDLE_VALUE) { - if (p_rationale && p_rationale[0]) { - - print("\E[1;31;40mERROR: %s: \E[1;37;40m%s\n",p_function,p_rationale); - print("\E[0;31;40m At: %s:%i.\E[0;0;37m\n",p_file,p_line); - } else { - print("\E[1;31;40mERROR: %s: \E[1;37;40m%s\n",p_function,p_code); - print("\E[0;31;40m At: %s:%i.\E[0;0;37m\n",p_file,p_line); + const char* err_details; + if (p_rationale && p_rationale[0]) + err_details=p_rationale; + else + err_details=p_code; + switch(p_type) { + case ERR_ERROR: + print("\E[1;31;40mERROR: %s: \E[1;37;40m%s\n",p_function,err_details); + print("\E[0;31;40m At: %s:%i.\E[0;0;37m\n",p_file,p_line); + break; + case ERR_WARNING: + print("\E[1;33;40mWARNING: %s: \E[1;37;40m%s\n",p_function,err_details); + print("\E[0;33;40m At: %s:%i.\E[0;0;37m\n",p_file,p_line); + break; + case ERR_SCRIPT: + print("\E[1;35;40mSCRIPT ERROR: %s: \E[1;37;40m%s\n",p_function,err_details); + print("\E[0;35;40m At: %s:%i.\E[0;0;37m\n",p_file,p_line); + break; } } else { diff --git a/platform/winrt/os_winrt.cpp b/platform/winrt/os_winrt.cpp index 3e06d9d59b..1e060a3667 100644 --- a/platform/winrt/os_winrt.cpp +++ b/platform/winrt/os_winrt.cpp @@ -424,15 +424,25 @@ void OSWinrt::get_fullscreen_mode_list(List *p_list,int p_screen) con void OSWinrt::print_error(const char* p_function,const char* p_file,int p_line,const char *p_code,const char*p_rationale,ErrorType p_type) { - if (p_rationale && p_rationale[0]) { - - print("\E[1;31;40mERROR: %s: \E[1;37;40m%s\n",p_function,p_rationale); - print("\E[0;31;40m At: %s:%i.\E[0;0;37m\n",p_file,p_line); - - } else { - print("\E[1;31;40mERROR: %s: \E[1;37;40m%s\n",p_function,p_code); - print("\E[0;31;40m At: %s:%i.\E[0;0;37m\n",p_file,p_line); + const char* err_details; + if (p_rationale && p_rationale[0]) + err_details=p_rationale; + else + err_details=p_code; + switch(p_type) { + case ERR_ERROR: + print("\E[1;31;40mERROR: %s: \E[1;37;40m%s\n",p_function,err_details); + print("\E[0;31;40m At: %s:%i.\E[0;0;37m\n",p_file,p_line); + break; + case ERR_WARNING: + print("\E[1;33;40mWARNING: %s: \E[1;37;40m%s\n",p_function,err_details); + print("\E[0;33;40m At: %s:%i.\E[0;0;37m\n",p_file,p_line); + break; + case ERR_SCRIPT: + print("\E[1;35;40mSCRIPT ERROR: %s: \E[1;37;40m%s\n",p_function,err_details); + print("\E[0;35;40m At: %s:%i.\E[0;0;37m\n",p_file,p_line); + break; } } -- cgit v1.2.3 From 9ab7de243fe0348c46a87c03b1fce15b8e1afeb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Tue, 10 Nov 2015 08:04:48 +0100 Subject: Fix error messages forcing a white font for subsequent messages This is achieved using the "no specific formatting" \E[0m tag. Fixes #2566. Also remove the hardcoded black background colour and use default bolded terminal font for error message. Error logs should now look good both on terminals with a dark and light background colour. --- platform/windows/os_windows.cpp | 12 ++++++------ platform/winrt/os_winrt.cpp | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) (limited to 'platform') diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index 01a8261563..964b9e76f3 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -1777,16 +1777,16 @@ void OS_Windows::print_error(const char* p_function,const char* p_file,int p_lin switch(p_type) { case ERR_ERROR: - print("\E[1;31;40mERROR: %s: \E[1;37;40m%s\n",p_function,err_details); - print("\E[0;31;40m At: %s:%i.\E[0;0;37m\n",p_file,p_line); + print("\E[1;31mERROR: %s: \E[0m\E[1m%s\n",p_function,err_details); + print("\E[0;31m At: %s:%i.\E[0m\n",p_file,p_line); break; case ERR_WARNING: - print("\E[1;33;40mWARNING: %s: \E[1;37;40m%s\n",p_function,err_details); - print("\E[0;33;40m At: %s:%i.\E[0;0;37m\n",p_file,p_line); + print("\E[1;33mWARNING: %s: \E[0m\E[1m%s\n",p_function,err_details); + print("\E[0;33m At: %s:%i.\E[0m\n",p_file,p_line); break; case ERR_SCRIPT: - print("\E[1;35;40mSCRIPT ERROR: %s: \E[1;37;40m%s\n",p_function,err_details); - print("\E[0;35;40m At: %s:%i.\E[0;0;37m\n",p_file,p_line); + print("\E[1;35mSCRIPT ERROR: %s: \E[0m\E[1m",p_function,err_details); + print("\E[0;35m At: %s:%i.\E[0m\n",p_file,p_line); break; } } else { diff --git a/platform/winrt/os_winrt.cpp b/platform/winrt/os_winrt.cpp index 1e060a3667..51f60a0362 100644 --- a/platform/winrt/os_winrt.cpp +++ b/platform/winrt/os_winrt.cpp @@ -432,16 +432,16 @@ void OSWinrt::print_error(const char* p_function,const char* p_file,int p_line,c switch(p_type) { case ERR_ERROR: - print("\E[1;31;40mERROR: %s: \E[1;37;40m%s\n",p_function,err_details); - print("\E[0;31;40m At: %s:%i.\E[0;0;37m\n",p_file,p_line); + print("\E[1;31mERROR: %s: \E[0m\E[1m%s\n",p_function,err_details); + print("\E[0;31m At: %s:%i.\E[0m\n",p_file,p_line); break; case ERR_WARNING: - print("\E[1;33;40mWARNING: %s: \E[1;37;40m%s\n",p_function,err_details); - print("\E[0;33;40m At: %s:%i.\E[0;0;37m\n",p_file,p_line); + print("\E[1;33mWARNING: %s: \E[0m\E[1m%s\n",p_function,err_details); + print("\E[0;33m At: %s:%i.\E[0m\n",p_file,p_line); break; case ERR_SCRIPT: - print("\E[1;35;40mSCRIPT ERROR: %s: \E[1;37;40m%s\n",p_function,err_details); - print("\E[0;35;40m At: %s:%i.\E[0;0;37m\n",p_file,p_line); + print("\E[1;35mSCRIPT ERROR: %s: \E[0m\E[1m",p_function,err_details); + print("\E[0;35m At: %s:%i.\E[0m\n",p_file,p_line); break; } } -- cgit v1.2.3 From 8adc4ef65b76ee0e8a5fdf6c773d47716fa8511f Mon Sep 17 00:00:00 2001 From: Ariel Manzur Date: Sat, 14 Nov 2015 11:14:17 -0300 Subject: windows crash and bind placeholder method --- platform/windows/os_windows.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'platform') diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp index 438a5a6903..55452052e4 100644 --- a/platform/windows/os_windows.cpp +++ b/platform/windows/os_windows.cpp @@ -1350,7 +1350,9 @@ void OS_Windows::finalize() { memdelete(main_loop); main_loop=NULL; - + + memdelete(input); + visual_server->finish(); memdelete(visual_server); #ifdef OPENGL_ENABLED @@ -1377,8 +1379,6 @@ void OS_Windows::finalize() { memdelete(audio_server); memdelete(sample_manager); - memdelete(input); - physics_server->finish(); memdelete(physics_server); -- cgit v1.2.3 From 14b95797485d3d17b8e68cf0a811a59be26f06bb Mon Sep 17 00:00:00 2001 From: masoud bh Date: Sat, 14 Nov 2015 20:40:22 +0330 Subject: Skip META-INF from Android Template --- platform/android/export/export.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'platform') diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp index f8fc03ec61..1deeb3457a 100644 --- a/platform/android/export/export.cpp +++ b/platform/android/export/export.cpp @@ -1123,6 +1123,10 @@ Error EditorExportPlatformAndroid::export_project(const String& p_path, bool p_d if (file=="lib/armeabi/libgodot_android.so" && !export_arm) { skip=true; } + + if (file.begins_with("META-INF") && _signed) { + skip=true; + } print_line("ADDING: "+file); -- cgit v1.2.3 From 402c24ec8baf10d6445213f1552cbeaaf0b55643 Mon Sep 17 00:00:00 2001 From: Aren Villanueva Date: Mon, 16 Nov 2015 11:07:21 +1100 Subject: iOS compile fixes. --- platform/iphone/app_delegate.mm | 2 ++ platform/iphone/game_center.mm | 2 +- platform/iphone/gl_view.mm | 10 +++++++++- platform/iphone/godot_iphone.cpp | 2 ++ platform/iphone/icloud.mm | 2 -- platform/iphone/sem_iphone.cpp | 5 +++++ platform/iphone/view_controller.mm | 3 +++ 7 files changed, 22 insertions(+), 4 deletions(-) (limited to 'platform') diff --git a/platform/iphone/app_delegate.mm b/platform/iphone/app_delegate.mm index 647bf1a2d1..e5bd7a96b4 100644 --- a/platform/iphone/app_delegate.mm +++ b/platform/iphone/app_delegate.mm @@ -56,6 +56,8 @@ #import "Appirater.h" #endif +Error _shell_open(String); + Error _shell_open(String p_uri) { NSString* url = [[NSString alloc] initWithUTF8String:p_uri.utf8().get_data()]; diff --git a/platform/iphone/game_center.mm b/platform/iphone/game_center.mm index 79c056776d..1e46d9f014 100644 --- a/platform/iphone/game_center.mm +++ b/platform/iphone/game_center.mm @@ -30,8 +30,8 @@ #include "game_center.h" -extern "C" { #import +extern "C" { #import "app_delegate.h" }; diff --git a/platform/iphone/gl_view.mm b/platform/iphone/gl_view.mm index 279fbdafa8..f19e16f3f6 100755 --- a/platform/iphone/gl_view.mm +++ b/platform/iphone/gl_view.mm @@ -54,6 +54,14 @@ static bool video_playing = false; static float video_previous_volume = 0.0f; static CMTime video_current_time; +void _show_keyboard(String); +void _hide_keyboard(); +bool _play_video(String, float, String, String); +bool _is_video_playing(); +void _focus_out_video(); +void _unpause_video(); +void _stop_video(); + void _show_keyboard(String p_existing) { keyboard_text = p_existing; printf("instance on show is %p\n", _instance); @@ -618,7 +626,7 @@ static void clear_touches() { - (void)audioRouteChangeListenerCallback:(NSNotification*)notification { - printf("*********** route changed!%i\n"); + printf("*********** route changed!\n"); NSDictionary *interuptionDict = notification.userInfo; NSInteger routeChangeReason = [[interuptionDict valueForKey:AVAudioSessionRouteChangeReasonKey] integerValue]; diff --git a/platform/iphone/godot_iphone.cpp b/platform/iphone/godot_iphone.cpp index b7b9b747b4..f0cb929429 100644 --- a/platform/iphone/godot_iphone.cpp +++ b/platform/iphone/godot_iphone.cpp @@ -40,6 +40,8 @@ int add_path(int p_argc, char** p_args); int add_cmdline(int p_argc, char** p_args); }; +int iphone_main(int, int, int, char**); + int iphone_main(int width, int height, int argc, char** argv) { int len = strlen(argv[0]); diff --git a/platform/iphone/icloud.mm b/platform/iphone/icloud.mm index 2dc2f7d9c1..a35d8ecd69 100644 --- a/platform/iphone/icloud.mm +++ b/platform/iphone/icloud.mm @@ -30,10 +30,8 @@ #include "icloud.h" -extern "C" { #import #import "app_delegate.h" -}; ICloud* ICloud::instance = NULL; diff --git a/platform/iphone/sem_iphone.cpp b/platform/iphone/sem_iphone.cpp index 5afaa7b308..36baa40427 100644 --- a/platform/iphone/sem_iphone.cpp +++ b/platform/iphone/sem_iphone.cpp @@ -31,6 +31,11 @@ #include #include +void cgsem_init(cgsem_t*); +void cgsem_post(cgsem_t*); +void cgsem_wait(cgsem_t*); +void cgsem_destroy(cgsem_t*); + void cgsem_init(cgsem_t *cgsem) { int flags, fd, i; diff --git a/platform/iphone/view_controller.mm b/platform/iphone/view_controller.mm index 6a9c3ac9ec..f98fb7c355 100644 --- a/platform/iphone/view_controller.mm +++ b/platform/iphone/view_controller.mm @@ -32,6 +32,9 @@ extern "C" { +int add_path(int, char**); +int add_cmdline(int, char**); + int add_path(int p_argc, char** p_args) { NSString* str = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"godot_path"]; -- cgit v1.2.3 From e68c2c6c2a14c32e7c07ab3158fc459b104212d3 Mon Sep 17 00:00:00 2001 From: Aren Villanueva Date: Mon, 16 Nov 2015 12:31:44 +1100 Subject: Use macros to determine which iOS SDK we have in order to be backwards compatible with older SDKs when fixing template compilation issues. --- platform/iphone/game_center.mm | 10 ++++++++++ platform/iphone/icloud.mm | 8 ++++++++ 2 files changed, 18 insertions(+) (limited to 'platform') diff --git a/platform/iphone/game_center.mm b/platform/iphone/game_center.mm index 1e46d9f014..4cb7a20a7f 100644 --- a/platform/iphone/game_center.mm +++ b/platform/iphone/game_center.mm @@ -30,8 +30,18 @@ #include "game_center.h" +#ifdef __IPHONE_9_0 + #import extern "C" { + +#else + +extern "C" { +#import + +#endif + #import "app_delegate.h" }; diff --git a/platform/iphone/icloud.mm b/platform/iphone/icloud.mm index a35d8ecd69..518385992d 100644 --- a/platform/iphone/icloud.mm +++ b/platform/iphone/icloud.mm @@ -30,9 +30,17 @@ #include "icloud.h" +#ifndef __IPHONE_9_0 +extern "C" { +#endif + #import #import "app_delegate.h" +#ifndef __IPHONE_9_0 +}; +#endif + ICloud* ICloud::instance = NULL; void ICloud::_bind_methods() { -- cgit v1.2.3 From f2704eb162ce5e2de6916cf8c2d8daeba81d03de Mon Sep 17 00:00:00 2001 From: masoud bh Date: Thu, 19 Nov 2015 01:40:29 +0330 Subject: Android add FA(persian) locale strings --- platform/android/java/res/values-fa/strings.xml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 platform/android/java/res/values-fa/strings.xml (limited to 'platform') diff --git a/platform/android/java/res/values-fa/strings.xml b/platform/android/java/res/values-fa/strings.xml new file mode 100644 index 0000000000..450f9fe212 --- /dev/null +++ b/platform/android/java/res/values-fa/strings.xml @@ -0,0 +1,16 @@ + + + godot-project-name-fa + سلام + آیا می خواهید بر روی اتصال داده همراه دانلود را شروع کنید؟ بر اساس نوع سطح داده شما این ممکن است برای شما هزینه مالی داشته باشد. + اگر نمی خواهید بر روی اتصال داده همراه دانلود را شروع کنید ، دانلود به صورت خودکار در زمان دسترسی به وای-فای شروع می شود. + ادامه دانلود + تنظیمات وای-فای + درحال تایید دانلود + تایید فایل XAPK تکمیل شد. برای خروج تایید کنید. + اعتبارسنجی فایل XAPK ناموق. + توقف دانلود + ادامه دانلود + انصراف + انصراف از تایید شدن + -- cgit v1.2.3