summaryrefslogtreecommitdiff
path: root/platform/bb10
diff options
context:
space:
mode:
authorhurikhan <m4r10.5ch14ck@gmail.com>2015-03-08 15:10:48 +0800
committerhurikhan <m4r10.5ch14ck@gmail.com>2015-03-08 15:10:48 +0800
commit87be945d49e1f53a34f7e4a27fa9b17e527b43c4 (patch)
treec1fb9e1ac10bac08c25c31bbf3a29848b90a4c49 /platform/bb10
parentf5d2e1f42cca1c5b078073133fccda63c556a0da (diff)
parent2c2894ceb674927a35d2798b3e63adabdb020077 (diff)
Merge remote-tracking branch 'upstream/master' into x11-window-management
Diffstat (limited to 'platform/bb10')
-rw-r--r--platform/bb10/SCsub10
-rw-r--r--platform/bb10/bar/bar-descriptor.xml30
-rw-r--r--platform/bb10/detect.py2
-rw-r--r--platform/bb10/export/export.cpp79
-rw-r--r--platform/bb10/os_bb10.cpp2
5 files changed, 44 insertions, 79 deletions
diff --git a/platform/bb10/SCsub b/platform/bb10/SCsub
index 2e8ef47005..24f2b5d242 100644
--- a/platform/bb10/SCsub
+++ b/platform/bb10/SCsub
@@ -18,13 +18,5 @@ if env['bb10_lgles_override'] == "yes":
prog = None
-if env["target"]=="release":
- prog = env_bps.Program('#platform/bb10/godot_bb10_opt', bb10_lib)
-else:
- prog = env_bps.Program('#platform/bb10/godot_bb10', bb10_lib)
-
-import os
-fname = os.path.basename(str(prog[0]))
-
-env.Command('#bin/'+fname, prog, Copy('bin/'+fname, prog[0]))
+prog = env_bps.Program('#bin/godot', bb10_lib)
diff --git a/platform/bb10/bar/bar-descriptor.xml b/platform/bb10/bar/bar-descriptor.xml
index df5d34e077..0ba70b7180 100644
--- a/platform/bb10/bar/bar-descriptor.xml
+++ b/platform/bb10/bar/bar-descriptor.xml
@@ -1,65 +1,53 @@
-<?xml version="1.0" encoding="utf-8" standalone="no"?>
+<?xml version='1.0' encoding='utf-8' standalone='no'?>
<qnx xmlns="http://www.qnx.com/schemas/application/1.0">
-
-<!-- BlackBerry® 10 application descriptor file.
+ <!-- BlackBerry® 10 application descriptor file.
Specifies parameters for identifying, installing, and launching native applications on BlackBerry® 10 OS.
-->
-
<!-- A universally unique application identifier. Must be unique across all BlackBerry applications.
Using a reverse DNS-style name as the id is recommended. (Eg. com.example.ExampleApplication.) Required. -->
<id>com.godot.game</id>
-
<!-- The name that is displayed in the BlackBerry application installer.
May have multiple values for each language. See samples or xsd schema file. Optional. -->
<name>Godot Game</name>
-
<!-- A string value of the format <0-999>.<0-999>.<0-999> that represents application version which can be used to check for application upgrade.
Values can also be 1-part or 2-part. It is not necessary to have a 3-part value.
An updated version of application must have a versionNumber value higher than the previous version. Required. -->
<versionNumber>0.0.1</versionNumber>
-
<!-- Fourth digit segment of the package version. First three segments are taken from the
<versionNumber> element. Must be an integer from 0 to 2^16-1 -->
<buildId>0</buildId>
-
<!-- Description, displayed in the BlackBerry application installer.
May have multiple values for each language. See samples or xsd schema file. Optional. -->
<description>Game made with Godot Engine</description>
-
<!-- Name of author which is used for signing. Must match the developer name of your development certificate. -->
<author>You Name or Company</author>
<authorId>authorIDherePlease</authorId>
-
<!-- Unique author ID assigned by signing authority. Required if using debug tokens. -->
<!-- <authorId>ABC1234YjsnUk235h</authorId> -->
-
<initialWindow>
<aspectRatio>landscape</aspectRatio>
<autoOrients>false</autoOrients>
<systemChrome>none</systemChrome>
<transparent>false</transparent>
</initialWindow>
-
<!-- The category where the application appears. Either core.games or core.media. -->
<category>core.games</category>
<permission>read_device_identifying_information</permission>
<permission>access_internet</permission>
- <asset path="assets">assets</asset>
+ <asset path="data.pck">data.pck</asset>
<configuration name="Device-Debug">
- <platformArchitecture>armle-v7</platformArchitecture>
- <asset path="godot_bb10.qnx.armle" entry="true" type="Qnx/Elf">godot_bb10.qnx.armle</asset>
+ <platformArchitecture>armle-v7</platformArchitecture>
+ <asset type="Qnx/Elf" path="godot.bb10.debug.qnx.armle" entry="true">godot.bb10.debug.qnx.armle</asset>
</configuration>
<configuration name="Device-Release">
- <platformArchitecture>armle-v7</platformArchitecture>
- <asset path="godot_bb10_opt.qnx.armle" entry="true" type="Qnx/Elf">godot_bb10_opt.qnx.armle</asset>
+ <platformArchitecture>armle-v7</platformArchitecture>
+ <asset type="Qnx/Elf" path="godot.bb10.opt.qnx.armle" entry="true">godot.bb10.opt.qnx.armle</asset>
</configuration>
<!-- The icon for the application. -->
<icon>
- <image>icon.png</image>
+ <image>icon.png</image>
</icon>
-
<!-- Ensure that shared libraries in the package are found at run-time. -->
- <env var="LD_LIBRARY_PATH" value="app/native/lib:/usr/lib/qt4/lib"/>
-
+ <env value="app/native/lib:/usr/lib/qt4/lib" var="LD_LIBRARY_PATH"/>
</qnx>
diff --git a/platform/bb10/detect.py b/platform/bb10/detect.py
index 3ddb7a4450..f134a9df19 100644
--- a/platform/bb10/detect.py
+++ b/platform/bb10/detect.py
@@ -81,8 +81,6 @@ def configure(env):
if (env["target"]=="release"):
env.Append(CCFLAGS=['-O3','-DRELEASE_BUILD'])
- env['OBJSUFFIX'] = "_opt"+env['OBJSUFFIX']
- env['LIBSUFFIX'] = "_opt"+env['LIBSUFFIX']
elif (env["target"]=="debug"):
diff --git a/platform/bb10/export/export.cpp b/platform/bb10/export/export.cpp
index d40cb82cdf..7862ecd493 100644
--- a/platform/bb10/export/export.cpp
+++ b/platform/bb10/export/export.cpp
@@ -321,12 +321,29 @@ Error EditorExportPlatformBB10::export_project(const String& p_path, bool p_debu
//BE SUPER CAREFUL WITH THIS PLEASE!!!
//BLACKBERRY THIS IS YOUR FAULT FOR NOT MAKING A BETTER WAY!!
- if (bar_dir.ends_with("bb10_export")) {
- Error err = da->erase_contents_recursive();
- if (err!=OK) {
+ bool berr = bar_dir.ends_with("bb10_export");
+ if (berr) {
+ if (da->list_dir_begin()) {
EditorNode::add_io_error("Can't ensure that dir is empty:\n"+bar_dir);
- ERR_FAIL_COND_V(err!=OK,err);
- }
+ ERR_FAIL_COND_V(berr,FAILED);
+ };
+
+ String f = da->get_next();
+ while (f != "") {
+
+ if (f == "." || f == "..") {
+ f = da->get_next();
+ continue;
+ };
+ Error err = da->remove(bar_dir + "/" + f);
+ if (err != OK) {
+ EditorNode::add_io_error("Can't ensure that dir is empty:\n"+bar_dir);
+ ERR_FAIL_COND_V(err!=OK,err);
+ };
+ f = da->get_next();
+ };
+
+ da->list_dir_end();
} else {
print_line("ARE YOU CRAZY??? THIS IS A SERIOUS BUG HERE!!!");
@@ -405,52 +422,23 @@ Error EditorExportPlatformBB10::export_project(const String& p_path, bool p_debu
ret = unzGoToNextFile(pkg);
}
- ep.step("Finding Files..",1);
-
- Vector<StringName> files=get_dependencies(false);
-
ep.step("Adding Files..",2);
- da->change_dir(bar_dir);
- da->make_dir("assets");
- Error err = da->change_dir("assets");
- ERR_FAIL_COND_V(err,err);
-
- String asset_dir=da->get_current_dir();
- if (!asset_dir.ends_with("/"))
- asset_dir+="/";
-
- for(int i=0;i<files.size();i++) {
-
- String fname=files[i];
- Vector<uint8_t> data = get_exported_file(fname);
- /*
- FileAccess *f=FileAccess::open(files[i],FileAccess::READ);
- if (!f) {
- EditorNode::add_io_error("Couldn't read: "+String(files[i]));
- }
- ERR_CONTINUE(!f);
- data.resize(f->get_len());
- f->get_buffer(data.ptr(),data.size());
-*/
- String dst_path=fname;
- dst_path=dst_path.replace_first("res://",asset_dir);
-
- da->make_dir_recursive(dst_path.get_base_dir());
-
- ep.step("Adding File: "+String(files[i]).get_file(),3+i*100/files.size());
-
- FileAccessRef fr = FileAccess::open(dst_path,FileAccess::WRITE);
- fr->store_buffer(data.ptr(),data.size());
+ FileAccess* dst = FileAccess::open(bar_dir+"/data.pck", FileAccess::WRITE);
+ if (!dst) {
+ EditorNode::add_io_error("Can't copy executable file to:\n "+p_path);
+ return ERR_FILE_CANT_WRITE;
}
-
+ save_pack(dst, false, 1024);
+ dst->close();
+ memdelete(dst);
ep.step("Creating BAR Package..",104);
String bb_packager=EditorSettings::get_singleton()->get("blackberry/host_tools");
bb_packager=bb_packager.plus_file("blackberry-nativepackager");
if (OS::get_singleton()->get_name()=="Windows")
- bb_packager+=".exe";
+ bb_packager+=".bat";
if (!FileAccess::exists(bb_packager)) {
@@ -482,7 +470,7 @@ Error EditorExportPlatformBB10::export_project(const String& p_path, bool p_debu
int ec;
- err = OS::get_singleton()->execute(bb_packager,args,true,NULL,NULL,&ec);
+ Error err = OS::get_singleton()->execute(bb_packager,args,true,NULL,NULL,&ec);
if (err!=OK)
return err;
@@ -493,7 +481,6 @@ Error EditorExportPlatformBB10::export_project(const String& p_path, bool p_debu
}
-
bool EditorExportPlatformBB10::poll_devices() {
bool dc=devices_changed;
@@ -537,7 +524,7 @@ void EditorExportPlatformBB10::_device_poll_thread(void *ud) {
bb_deploy=bb_deploy.plus_file("blackberry-deploy");
bool windows = OS::get_singleton()->get_name()=="Windows";
if (windows)
- bb_deploy+=".exe";
+ bb_deploy+=".bat";
if (!FileAccess::exists(bb_deploy)) {
OS::get_singleton()->delay_usec(3000000);
@@ -639,7 +626,7 @@ Error EditorExportPlatformBB10::run(int p_device, bool p_dumb) {
String bb_deploy=EditorSettings::get_singleton()->get("blackberry/host_tools");
bb_deploy=bb_deploy.plus_file("blackberry-deploy");
if (OS::get_singleton()->get_name()=="Windows")
- bb_deploy+=".exe";
+ bb_deploy+=".bat";
if (!FileAccess::exists(bb_deploy)) {
EditorNode::add_io_error("Blackberry Deploy not found:\n"+bb_deploy);
diff --git a/platform/bb10/os_bb10.cpp b/platform/bb10/os_bb10.cpp
index ff43a68b1d..d89033b1df 100644
--- a/platform/bb10/os_bb10.cpp
+++ b/platform/bb10/os_bb10.cpp
@@ -619,7 +619,7 @@ OSBB10::OSBB10() {
printf("godot bb10!\n");
getcwd(launch_dir, sizeof(launch_dir));
printf("launch dir %s\n", launch_dir);
- chdir("app/native/assets");
+ chdir("app/native");
launch_dir_ptr = launch_dir;
}