mirror of
https://github.com/godotengine/godot.git
synced 2024-11-21 03:18:37 +08:00
Several fixes to Android exporter and port.
Android seems to be working again!
This commit is contained in:
parent
c37fad650f
commit
efaeebab4d
@ -821,8 +821,10 @@ Image RasterizerStorageGLES3::texture_get_data(RID p_texture, VS::CubeMapSide p_
|
||||
ERR_FAIL_COND_V(texture->data_size == 0, Image());
|
||||
ERR_FAIL_COND_V(texture->render_target, Image());
|
||||
|
||||
if (!texture->images[p_cube_side].empty())
|
||||
if (!texture->images[p_cube_side].empty()) {
|
||||
return texture->images[p_cube_side];
|
||||
}
|
||||
print_line("GETTING FROM GL ");
|
||||
|
||||
#ifdef GLES_OVER_GL
|
||||
|
||||
@ -3047,18 +3049,17 @@ Rect3 RasterizerStorageGLES3::mesh_get_aabb(RID p_mesh, RID p_skeleton) const {
|
||||
if (!skused[j])
|
||||
continue;
|
||||
|
||||
|
||||
int base_ofs = ((j / 256) * 256) * 2 * 4 + (j % 256) * 4;
|
||||
|
||||
Transform mtx;
|
||||
|
||||
mtx.basis[0].x=texture[base_ofs+0];
|
||||
mtx.basis[0].y=texture[base_ofs+1];
|
||||
mtx.origin.x=texture[base_ofs+3];
|
||||
base_ofs+=256*4;
|
||||
mtx.basis[1].x=texture[base_ofs+0];
|
||||
mtx.basis[1].y=texture[base_ofs+1];
|
||||
mtx.origin.y=texture[base_ofs+3];
|
||||
mtx.basis[0].x = texture[base_ofs + 0];
|
||||
mtx.basis[0].y = texture[base_ofs + 1];
|
||||
mtx.origin.x = texture[base_ofs + 3];
|
||||
base_ofs += 256 * 4;
|
||||
mtx.basis[1].x = texture[base_ofs + 0];
|
||||
mtx.basis[1].y = texture[base_ofs + 1];
|
||||
mtx.origin.y = texture[base_ofs + 3];
|
||||
|
||||
Rect3 baabb = mtx.xform(skbones[j]);
|
||||
if (first) {
|
||||
@ -3078,20 +3079,20 @@ Rect3 RasterizerStorageGLES3::mesh_get_aabb(RID p_mesh, RID p_skeleton) const {
|
||||
|
||||
Transform mtx;
|
||||
|
||||
mtx.basis[0].x=texture[base_ofs+0];
|
||||
mtx.basis[0].y=texture[base_ofs+1];
|
||||
mtx.basis[0].z=texture[base_ofs+2];
|
||||
mtx.origin.x=texture[base_ofs+3];
|
||||
base_ofs+=256*4;
|
||||
mtx.basis[1].x=texture[base_ofs+0];
|
||||
mtx.basis[1].y=texture[base_ofs+1];
|
||||
mtx.basis[1].z=texture[base_ofs+2];
|
||||
mtx.origin.y=texture[base_ofs+3];
|
||||
base_ofs+=256*4;
|
||||
mtx.basis[2].x=texture[base_ofs+0];
|
||||
mtx.basis[2].y=texture[base_ofs+1];
|
||||
mtx.basis[2].z=texture[base_ofs+2];
|
||||
mtx.origin.z=texture[base_ofs+3];
|
||||
mtx.basis[0].x = texture[base_ofs + 0];
|
||||
mtx.basis[0].y = texture[base_ofs + 1];
|
||||
mtx.basis[0].z = texture[base_ofs + 2];
|
||||
mtx.origin.x = texture[base_ofs + 3];
|
||||
base_ofs += 256 * 4;
|
||||
mtx.basis[1].x = texture[base_ofs + 0];
|
||||
mtx.basis[1].y = texture[base_ofs + 1];
|
||||
mtx.basis[1].z = texture[base_ofs + 2];
|
||||
mtx.origin.y = texture[base_ofs + 3];
|
||||
base_ofs += 256 * 4;
|
||||
mtx.basis[2].x = texture[base_ofs + 0];
|
||||
mtx.basis[2].y = texture[base_ofs + 1];
|
||||
mtx.basis[2].z = texture[base_ofs + 2];
|
||||
mtx.origin.z = texture[base_ofs + 3];
|
||||
|
||||
Rect3 baabb = mtx.xform(skbones[j]);
|
||||
if (first) {
|
||||
@ -3927,7 +3928,7 @@ RID RasterizerStorageGLES3::skeleton_create() {
|
||||
|
||||
Skeleton *skeleton = memnew(Skeleton);
|
||||
|
||||
glGenTextures(1,&skeleton->texture);
|
||||
glGenTextures(1, &skeleton->texture);
|
||||
|
||||
return skeleton_owner.make_rid(skeleton);
|
||||
}
|
||||
@ -3941,22 +3942,22 @@ void RasterizerStorageGLES3::skeleton_allocate(RID p_skeleton, int p_bones, bool
|
||||
if (skeleton->size == p_bones && skeleton->use_2d == p_2d_skeleton)
|
||||
return;
|
||||
|
||||
skeleton->size=p_bones;
|
||||
skeleton->use_2d=p_2d_skeleton;
|
||||
skeleton->size = p_bones;
|
||||
skeleton->use_2d = p_2d_skeleton;
|
||||
|
||||
int height = p_bones/256;
|
||||
if (p_bones%256)
|
||||
int height = p_bones / 256;
|
||||
if (p_bones % 256)
|
||||
height++;
|
||||
|
||||
glActiveTexture(GL_TEXTURE0);
|
||||
glBindTexture(GL_TEXTURE_2D,skeleton->texture);
|
||||
glBindTexture(GL_TEXTURE_2D, skeleton->texture);
|
||||
|
||||
if (skeleton->use_2d) {
|
||||
skeleton->skel_texture.resize(256*height*2*4);
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA32F, 256, height*2, 0, GL_RGBA, GL_FLOAT, NULL);
|
||||
skeleton->skel_texture.resize(256 * height * 2 * 4);
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA32F, 256, height * 2, 0, GL_RGBA, GL_FLOAT, NULL);
|
||||
} else {
|
||||
skeleton->skel_texture.resize(256*height*3*4);
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA32F, 256, height*3, 0, GL_RGBA, GL_FLOAT, NULL);
|
||||
skeleton->skel_texture.resize(256 * height * 3 * 4);
|
||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA32F, 256, height * 3, 0, GL_RGBA, GL_FLOAT, NULL);
|
||||
}
|
||||
|
||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
@ -3988,21 +3989,20 @@ void RasterizerStorageGLES3::skeleton_bone_set_transform(RID p_skeleton, int p_b
|
||||
|
||||
int base_ofs = ((p_bone / 256) * 256) * 3 * 4 + (p_bone % 256) * 4;
|
||||
|
||||
texture[base_ofs+0]=p_transform.basis[0].x;
|
||||
texture[base_ofs+1]=p_transform.basis[0].y;
|
||||
texture[base_ofs+2]=p_transform.basis[0].z;
|
||||
texture[base_ofs+3]=p_transform.origin.x;
|
||||
base_ofs+=256*4;
|
||||
texture[base_ofs+0]=p_transform.basis[1].x;
|
||||
texture[base_ofs+1]=p_transform.basis[1].y;
|
||||
texture[base_ofs+2]=p_transform.basis[1].z;
|
||||
texture[base_ofs+3]=p_transform.origin.y;
|
||||
base_ofs+=256*4;
|
||||
texture[base_ofs+0]=p_transform.basis[2].x;
|
||||
texture[base_ofs+1]=p_transform.basis[2].y;
|
||||
texture[base_ofs+2]=p_transform.basis[2].z;
|
||||
texture[base_ofs+3]=p_transform.origin.z;
|
||||
|
||||
texture[base_ofs + 0] = p_transform.basis[0].x;
|
||||
texture[base_ofs + 1] = p_transform.basis[0].y;
|
||||
texture[base_ofs + 2] = p_transform.basis[0].z;
|
||||
texture[base_ofs + 3] = p_transform.origin.x;
|
||||
base_ofs += 256 * 4;
|
||||
texture[base_ofs + 0] = p_transform.basis[1].x;
|
||||
texture[base_ofs + 1] = p_transform.basis[1].y;
|
||||
texture[base_ofs + 2] = p_transform.basis[1].z;
|
||||
texture[base_ofs + 3] = p_transform.origin.y;
|
||||
base_ofs += 256 * 4;
|
||||
texture[base_ofs + 0] = p_transform.basis[2].x;
|
||||
texture[base_ofs + 1] = p_transform.basis[2].y;
|
||||
texture[base_ofs + 2] = p_transform.basis[2].z;
|
||||
texture[base_ofs + 3] = p_transform.origin.z;
|
||||
|
||||
if (!skeleton->update_list.in_list()) {
|
||||
skeleton_update_list.add(&skeleton->update_list);
|
||||
@ -4023,24 +4023,22 @@ Transform RasterizerStorageGLES3::skeleton_bone_get_transform(RID p_skeleton, in
|
||||
|
||||
int base_ofs = ((p_bone / 256) * 256) * 3 * 4 + (p_bone % 256) * 4;
|
||||
|
||||
ret.basis[0].x=texture[base_ofs+0];
|
||||
ret.basis[0].y=texture[base_ofs+1];
|
||||
ret.basis[0].z=texture[base_ofs+2];
|
||||
ret.origin.x=texture[base_ofs+3];
|
||||
base_ofs+=256*4;
|
||||
ret.basis[1].x=texture[base_ofs+0];
|
||||
ret.basis[1].y=texture[base_ofs+1];
|
||||
ret.basis[1].z=texture[base_ofs+2];
|
||||
ret.origin.y=texture[base_ofs+3];
|
||||
base_ofs+=256*4;
|
||||
ret.basis[2].x=texture[base_ofs+0];
|
||||
ret.basis[2].y=texture[base_ofs+1];
|
||||
ret.basis[2].z=texture[base_ofs+2];
|
||||
ret.origin.z=texture[base_ofs+3];
|
||||
|
||||
ret.basis[0].x = texture[base_ofs + 0];
|
||||
ret.basis[0].y = texture[base_ofs + 1];
|
||||
ret.basis[0].z = texture[base_ofs + 2];
|
||||
ret.origin.x = texture[base_ofs + 3];
|
||||
base_ofs += 256 * 4;
|
||||
ret.basis[1].x = texture[base_ofs + 0];
|
||||
ret.basis[1].y = texture[base_ofs + 1];
|
||||
ret.basis[1].z = texture[base_ofs + 2];
|
||||
ret.origin.y = texture[base_ofs + 3];
|
||||
base_ofs += 256 * 4;
|
||||
ret.basis[2].x = texture[base_ofs + 0];
|
||||
ret.basis[2].y = texture[base_ofs + 1];
|
||||
ret.basis[2].z = texture[base_ofs + 2];
|
||||
ret.origin.z = texture[base_ofs + 3];
|
||||
|
||||
return ret;
|
||||
|
||||
}
|
||||
void RasterizerStorageGLES3::skeleton_bone_set_transform_2d(RID p_skeleton, int p_bone, const Transform2D &p_transform) {
|
||||
|
||||
@ -4054,16 +4052,15 @@ void RasterizerStorageGLES3::skeleton_bone_set_transform_2d(RID p_skeleton, int
|
||||
|
||||
int base_ofs = ((p_bone / 256) * 256) * 2 * 4 + (p_bone % 256) * 4;
|
||||
|
||||
texture[base_ofs+0]=p_transform[0][0];
|
||||
texture[base_ofs+1]=p_transform[1][0];
|
||||
texture[base_ofs+2]=0;
|
||||
texture[base_ofs+3]=p_transform[2][0];
|
||||
base_ofs+=256*4;
|
||||
texture[base_ofs+0]=p_transform[0][1];
|
||||
texture[base_ofs+1]=p_transform[1][1];
|
||||
texture[base_ofs+2]=0;
|
||||
texture[base_ofs+3]=p_transform[2][1];
|
||||
|
||||
texture[base_ofs + 0] = p_transform[0][0];
|
||||
texture[base_ofs + 1] = p_transform[1][0];
|
||||
texture[base_ofs + 2] = 0;
|
||||
texture[base_ofs + 3] = p_transform[2][0];
|
||||
base_ofs += 256 * 4;
|
||||
texture[base_ofs + 0] = p_transform[0][1];
|
||||
texture[base_ofs + 1] = p_transform[1][1];
|
||||
texture[base_ofs + 2] = 0;
|
||||
texture[base_ofs + 3] = p_transform[2][1];
|
||||
|
||||
if (!skeleton->update_list.in_list()) {
|
||||
skeleton_update_list.add(&skeleton->update_list);
|
||||
@ -4083,13 +4080,13 @@ Transform2D RasterizerStorageGLES3::skeleton_bone_get_transform_2d(RID p_skeleto
|
||||
|
||||
int base_ofs = ((p_bone / 256) * 256) * 2 * 4 + (p_bone % 256) * 4;
|
||||
|
||||
ret[0][0]=texture[base_ofs+0];
|
||||
ret[1][0]=texture[base_ofs+1];
|
||||
ret[2][0]=texture[base_ofs+3];
|
||||
base_ofs+=256*4;
|
||||
ret[0][1]=texture[base_ofs+0];
|
||||
ret[1][1]=texture[base_ofs+1];
|
||||
ret[2][1]=texture[base_ofs+3];
|
||||
ret[0][0] = texture[base_ofs + 0];
|
||||
ret[1][0] = texture[base_ofs + 1];
|
||||
ret[2][0] = texture[base_ofs + 3];
|
||||
base_ofs += 256 * 4;
|
||||
ret[0][1] = texture[base_ofs + 0];
|
||||
ret[1][1] = texture[base_ofs + 1];
|
||||
ret[2][1] = texture[base_ofs + 3];
|
||||
|
||||
return ret;
|
||||
}
|
||||
@ -4103,15 +4100,12 @@ void RasterizerStorageGLES3::update_dirty_skeletons() {
|
||||
Skeleton *skeleton = skeleton_update_list.first()->self();
|
||||
if (skeleton->size) {
|
||||
|
||||
|
||||
|
||||
int height = skeleton->size/256;
|
||||
if (skeleton->size%256)
|
||||
int height = skeleton->size / 256;
|
||||
if (skeleton->size % 256)
|
||||
height++;
|
||||
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D,skeleton->texture);
|
||||
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 256,height*(skeleton->use_2d?2:3), GL_RGBA, GL_FLOAT, skeleton->skel_texture.ptr());
|
||||
glBindTexture(GL_TEXTURE_2D, skeleton->texture);
|
||||
glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 256, height * (skeleton->use_2d ? 2 : 3), GL_RGBA, GL_FLOAT, skeleton->skel_texture.ptr());
|
||||
}
|
||||
|
||||
for (Set<RasterizerScene::InstanceBase *>::Element *E = skeleton->instances.front(); E; E = E->next()) {
|
||||
@ -5977,7 +5971,7 @@ bool RasterizerStorageGLES3::free(RID p_rid) {
|
||||
|
||||
skeleton_allocate(p_rid, 0, false);
|
||||
|
||||
glDeleteTextures(1,&skeleton->texture);
|
||||
glDeleteTextures(1, &skeleton->texture);
|
||||
skeleton_owner.free(p_rid);
|
||||
memdelete(skeleton);
|
||||
|
||||
|
@ -601,6 +601,58 @@ Error EditorExportPlatform::save_zip(const Ref<EditorExportPreset> &p_preset, co
|
||||
return OK;
|
||||
}
|
||||
|
||||
void EditorExportPlatform::gen_export_flags(Vector<String> &r_flags, int p_flags) {
|
||||
|
||||
String host = EditorSettings::get_singleton()->get("network/debug_host");
|
||||
|
||||
if (p_flags & DEBUG_FLAG_REMOTE_DEBUG_LOCALHOST)
|
||||
host = "localhost";
|
||||
|
||||
if (p_flags & DEBUG_FLAG_DUMB_CLIENT) {
|
||||
int port = EditorSettings::get_singleton()->get("filesystem/file_server/port");
|
||||
String passwd = EditorSettings::get_singleton()->get("filesystem/file_server/password");
|
||||
r_flags.push_back("-rfs");
|
||||
r_flags.push_back(host + ":" + itos(port));
|
||||
if (passwd != "") {
|
||||
r_flags.push_back("-rfs_pass");
|
||||
r_flags.push_back(passwd);
|
||||
}
|
||||
}
|
||||
|
||||
if (p_flags & DEBUG_FLAG_REMOTE_DEBUG) {
|
||||
|
||||
r_flags.push_back("-rdebug");
|
||||
|
||||
r_flags.push_back(host + ":" + String::num(GLOBAL_DEF("network/debug/remote_port", 6007)));
|
||||
|
||||
List<String> breakpoints;
|
||||
ScriptEditor::get_singleton()->get_breakpoints(&breakpoints);
|
||||
|
||||
if (breakpoints.size()) {
|
||||
|
||||
r_flags.push_back("-bp");
|
||||
String bpoints;
|
||||
for (const List<String>::Element *E = breakpoints.front(); E; E = E->next()) {
|
||||
|
||||
bpoints += E->get().replace(" ", "%20");
|
||||
if (E->next())
|
||||
bpoints += ",";
|
||||
}
|
||||
|
||||
r_flags.push_back(bpoints);
|
||||
}
|
||||
}
|
||||
|
||||
if (p_flags & DEBUG_FLAG_VIEW_COLLISONS) {
|
||||
|
||||
r_flags.push_back("-debugcol");
|
||||
}
|
||||
|
||||
if (p_flags & DEBUG_FLAG_VIEW_NAVIGATION) {
|
||||
|
||||
r_flags.push_back("-debugnav");
|
||||
}
|
||||
}
|
||||
EditorExportPlatform::EditorExportPlatform() {
|
||||
}
|
||||
|
||||
@ -804,6 +856,18 @@ void EditorExport::load_config() {
|
||||
block_save = false;
|
||||
}
|
||||
|
||||
bool EditorExport::poll_export_platforms() {
|
||||
|
||||
bool changed = false;
|
||||
for (int i = 0; i < export_platforms.size(); i++) {
|
||||
if (export_platforms[i]->poll_devices()) {
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
|
||||
return changed;
|
||||
}
|
||||
|
||||
EditorExport::EditorExport() {
|
||||
|
||||
save_timer = memnew(Timer);
|
||||
|
@ -153,6 +153,7 @@ private:
|
||||
protected:
|
||||
virtual void get_preset_features(const Ref<EditorExportPreset> &p_preset, List<String> *r_features) = 0;
|
||||
String find_export_template(String template_file_name) const;
|
||||
void gen_export_flags(Vector<String> &r_flags, int p_flags);
|
||||
|
||||
public:
|
||||
struct ExportOption {
|
||||
@ -190,7 +191,7 @@ public:
|
||||
DEBUG_FLAG_VIEW_NAVIGATION = 16,
|
||||
};
|
||||
|
||||
virtual Error run(int p_device, int p_debug_flags) { return OK; }
|
||||
virtual Error run(const Ref<EditorExportPreset> &p_preset, int p_device, int p_debug_flags) { return OK; }
|
||||
|
||||
virtual bool can_export(const Ref<EditorExportPreset> &p_preset, String &r_error, bool &r_missing_templates) const = 0;
|
||||
|
||||
@ -234,6 +235,8 @@ public:
|
||||
|
||||
void load_config();
|
||||
|
||||
bool poll_export_platforms();
|
||||
|
||||
EditorExport();
|
||||
~EditorExport();
|
||||
};
|
||||
|
@ -29,18 +29,15 @@
|
||||
#include "editor_run_native.h"
|
||||
|
||||
#include "editor_export.h"
|
||||
#include "editor_node.h"
|
||||
|
||||
void EditorRunNative::_notification(int p_what) {
|
||||
|
||||
#if 0
|
||||
if (p_what==NOTIFICATION_ENTER_TREE) {
|
||||
if (p_what == NOTIFICATION_ENTER_TREE) {
|
||||
|
||||
List<StringName> ep;
|
||||
EditorImportExport::get_singleton()->get_export_platforms(&ep);
|
||||
ep.sort_custom<StringName::AlphCompare>();
|
||||
for(List<StringName>::Element *E=ep.front();E;E=E->next()) {
|
||||
for (int i = 0; i < EditorExport::get_singleton()->get_export_platform_count(); i++) {
|
||||
|
||||
Ref<EditorExportPlatform> eep = EditorImportExport::get_singleton()->get_export_platform(E->get());
|
||||
Ref<EditorExportPlatform> eep = EditorExport::get_singleton()->get_export_platform(i);
|
||||
if (eep.is_null())
|
||||
continue;
|
||||
Ref<ImageTexture> icon = eep->get_logo();
|
||||
@ -49,85 +46,93 @@ void EditorRunNative::_notification(int p_what) {
|
||||
im.clear_mipmaps();
|
||||
if (!im.empty()) {
|
||||
|
||||
im.resize(16,16);
|
||||
|
||||
Ref<ImageTexture> small_icon = memnew( ImageTexture);
|
||||
small_icon->create_from_image(im);
|
||||
MenuButton *mb = memnew( MenuButton );
|
||||
mb->get_popup()->connect("id_pressed",this,"_run_native",varray(E->get()));
|
||||
mb->connect("pressed",this,"_run_native",varray(-1, E->get()));
|
||||
im.resize(16, 16);
|
||||
Ref<ImageTexture> small_icon;
|
||||
small_icon.instance();
|
||||
small_icon->create_from_image(im, 0);
|
||||
MenuButton *mb = memnew(MenuButton);
|
||||
mb->get_popup()->connect("id_pressed", this, "_run_native", varray(i));
|
||||
//mb->connect("pressed", this, "_run_native", varray(-1, i));
|
||||
mb->set_icon(small_icon);
|
||||
add_child(mb);
|
||||
menus[E->get()]=mb;
|
||||
menus[i] = mb;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (p_what==NOTIFICATION_PROCESS) {
|
||||
if (p_what == NOTIFICATION_PROCESS) {
|
||||
|
||||
|
||||
bool changed = EditorImportExport::get_singleton()->poll_export_platforms() || first;
|
||||
bool changed = EditorExport::get_singleton()->poll_export_platforms() || first;
|
||||
|
||||
if (changed) {
|
||||
|
||||
for(Map<StringName,MenuButton*>::Element *E=menus.front();E;E=E->next()) {
|
||||
for (Map<int, MenuButton *>::Element *E = menus.front(); E; E = E->next()) {
|
||||
|
||||
Ref<EditorExportPlatform> eep = EditorImportExport::get_singleton()->get_export_platform(E->key());
|
||||
Ref<EditorExportPlatform> eep = EditorExport::get_singleton()->get_export_platform(E->key());
|
||||
MenuButton *mb = E->get();
|
||||
int dc = eep->get_device_count();
|
||||
|
||||
if (dc==0) {
|
||||
if (dc == 0) {
|
||||
mb->hide();
|
||||
} else {
|
||||
mb->get_popup()->clear();
|
||||
mb->show();
|
||||
if (dc == 1) {
|
||||
mb->set_tooltip(eep->get_device_name(0) + "\n\n" + eep->get_device_info(0).strip_edges());
|
||||
} else {
|
||||
mb->set_tooltip("Select device from the list");
|
||||
for(int i=0;i<dc;i++) {
|
||||
mb->get_popup()->add_icon_item(get_icon("Play","EditorIcons"),eep->get_device_name(i));
|
||||
mb->get_popup()->set_item_tooltip(mb->get_popup()->get_item_count() -1,eep->get_device_info(i).strip_edges());
|
||||
}
|
||||
mb->set_tooltip("Select device from the list");
|
||||
for (int i = 0; i < dc; i++) {
|
||||
mb->get_popup()->add_icon_item(get_icon("Play", "EditorIcons"), eep->get_device_name(i));
|
||||
mb->get_popup()->set_item_tooltip(mb->get_popup()->get_item_count() - 1, eep->get_device_info(i).strip_edges());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
first=false;
|
||||
first = false;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void EditorRunNative::_run_native(int p_idx, const String &p_platform) {
|
||||
void EditorRunNative::_run_native(int p_idx, int p_platform) {
|
||||
|
||||
#if 0
|
||||
Ref<EditorExportPlatform> eep = EditorImportExport::get_singleton()->get_export_platform(p_platform);
|
||||
Ref<EditorExportPlatform> eep = EditorExport::get_singleton()->get_export_platform(p_platform);
|
||||
ERR_FAIL_COND(eep.is_null());
|
||||
if (p_idx == -1) {
|
||||
/*if (p_idx == -1) {
|
||||
if (eep->get_device_count() == 1) {
|
||||
menus[p_platform]->get_popup()->hide();
|
||||
p_idx = 0;
|
||||
} else {
|
||||
return;
|
||||
}
|
||||
}*/
|
||||
|
||||
Ref<EditorExportPreset> preset;
|
||||
|
||||
for (int i = 0; i < EditorExport::get_singleton()->get_export_preset_count(); i++) {
|
||||
|
||||
Ref<EditorExportPreset> ep = EditorExport::get_singleton()->get_export_preset(i);
|
||||
if (ep->is_runnable() && ep->get_platform() == eep) {
|
||||
preset = ep;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (preset.is_null()) {
|
||||
EditorNode::get_singleton()->show_warning("No runnable export preset found for this platform.\nPlease add a runnable preset in the export menu.");
|
||||
return;
|
||||
}
|
||||
|
||||
emit_signal("native_run");
|
||||
|
||||
int flags=0;
|
||||
int flags = 0;
|
||||
if (deploy_debug_remote)
|
||||
flags|=EditorExportPlatform::EXPORT_REMOTE_DEBUG;
|
||||
flags |= EditorExportPlatform::DEBUG_FLAG_REMOTE_DEBUG;
|
||||
if (deploy_dumb)
|
||||
flags|=EditorExportPlatform::EXPORT_DUMB_CLIENT;
|
||||
flags |= EditorExportPlatform::DEBUG_FLAG_DUMB_CLIENT;
|
||||
if (debug_collisions)
|
||||
flags|=EditorExportPlatform::EXPORT_VIEW_COLLISONS;
|
||||
flags |= EditorExportPlatform::DEBUG_FLAG_VIEW_COLLISONS;
|
||||
if (debug_navigation)
|
||||
flags|=EditorExportPlatform::EXPORT_VIEW_NAVIGATION;
|
||||
flags |= EditorExportPlatform::DEBUG_FLAG_VIEW_NAVIGATION;
|
||||
|
||||
eep->run(p_idx,flags);
|
||||
|
||||
#endif
|
||||
eep->run(preset, p_idx, flags);
|
||||
}
|
||||
|
||||
void EditorRunNative::_bind_methods() {
|
||||
|
@ -36,14 +36,14 @@ class EditorRunNative : public HBoxContainer {
|
||||
|
||||
GDCLASS(EditorRunNative, BoxContainer);
|
||||
|
||||
Map<StringName, MenuButton *> menus;
|
||||
Map<int, MenuButton *> menus;
|
||||
bool first;
|
||||
bool deploy_dumb;
|
||||
bool deploy_debug_remote;
|
||||
bool debug_collisions;
|
||||
bool debug_navigation;
|
||||
|
||||
void _run_native(int p_idx, const String &p_platform);
|
||||
void _run_native(int p_idx, int p_platform);
|
||||
|
||||
protected:
|
||||
static void _bind_methods();
|
||||
|
@ -31,7 +31,7 @@
|
||||
$$ADD_APPLICATION_CHUNKS$$
|
||||
|
||||
</application>
|
||||
<uses-feature android:glEsVersion="0x00020000"/>
|
||||
<uses-feature android:glEsVersion="0x00030000"/>
|
||||
|
||||
$$ADD_PERMISSION_CHUNKS$$
|
||||
<uses-permission android:name="godot.ACCESS_CHECKIN_PROPERTIES"/>
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -721,7 +721,7 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC
|
||||
@Override public void onBackPressed() {
|
||||
|
||||
System.out.printf("** BACK REQUEST!\n");
|
||||
GodotLib.back();
|
||||
//GodotLib.back();
|
||||
}
|
||||
|
||||
public void forceQuit() {
|
||||
|
@ -77,18 +77,18 @@ public class GodotView extends GLSurfaceView implements InputDeviceListener {
|
||||
|
||||
private static GodotIO io;
|
||||
private static boolean firsttime=true;
|
||||
private static boolean use_gl2=false;
|
||||
private static boolean use_gl3=false;
|
||||
private static boolean use_32=false;
|
||||
|
||||
private Godot activity;
|
||||
|
||||
|
||||
private InputManagerCompat mInputManager;
|
||||
public GodotView(Context context,GodotIO p_io,boolean p_use_gl2, boolean p_use_32_bits, Godot p_activity) {
|
||||
public GodotView(Context context,GodotIO p_io,boolean p_use_gl3, boolean p_use_32_bits, Godot p_activity) {
|
||||
super(context);
|
||||
ctx=context;
|
||||
io=p_io;
|
||||
use_gl2=p_use_gl2;
|
||||
use_gl3=p_use_gl3;
|
||||
use_32=p_use_32_bits;
|
||||
|
||||
activity = p_activity;
|
||||
@ -362,14 +362,15 @@ public class GodotView extends GLSurfaceView implements InputDeviceListener {
|
||||
private static class ContextFactory implements GLSurfaceView.EGLContextFactory {
|
||||
private static int EGL_CONTEXT_CLIENT_VERSION = 0x3098;
|
||||
public EGLContext createContext(EGL10 egl, EGLDisplay display, EGLConfig eglConfig) {
|
||||
if (use_gl2)
|
||||
Log.w(TAG, "creating OpenGL ES 2.0 context :");
|
||||
if (use_gl3)
|
||||
Log.w(TAG, "creating OpenGL ES 3.0 context :");
|
||||
else
|
||||
Log.w(TAG, "creating OpenGL ES 1.1 context :");
|
||||
Log.w(TAG, "creating OpenGL ES 2.0 context :");
|
||||
|
||||
checkEglError("Before eglCreateContext", egl);
|
||||
int[] attrib_list2 = {EGL_CONTEXT_CLIENT_VERSION, 2, EGL10.EGL_NONE };
|
||||
EGLContext context = egl.eglCreateContext(display, eglConfig, EGL10.EGL_NO_CONTEXT, use_gl2?attrib_list2:null);
|
||||
int[] attrib_list3 = {EGL_CONTEXT_CLIENT_VERSION, 3, EGL10.EGL_NONE };
|
||||
EGLContext context = egl.eglCreateContext(display, eglConfig, EGL10.EGL_NO_CONTEXT, use_gl3?attrib_list3:attrib_list2);
|
||||
checkEglError("After eglCreateContext", egl);
|
||||
return context;
|
||||
}
|
||||
@ -432,13 +433,14 @@ public class GodotView extends GLSurfaceView implements InputDeviceListener {
|
||||
EGL10.EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT,
|
||||
EGL10.EGL_NONE
|
||||
};
|
||||
private static int[] s_configAttribs =
|
||||
private static int[] s_configAttribs3 =
|
||||
{
|
||||
EGL10.EGL_RED_SIZE, 4,
|
||||
EGL10.EGL_GREEN_SIZE, 4,
|
||||
EGL10.EGL_BLUE_SIZE, 4,
|
||||
// EGL10.EGL_DEPTH_SIZE, 16,
|
||||
// EGL10.EGL_STENCIL_SIZE, EGL10.EGL_DONT_CARE,
|
||||
EGL10.EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, //apparently there is no EGL_OPENGL_ES3_BIT
|
||||
EGL10.EGL_NONE
|
||||
};
|
||||
|
||||
@ -447,7 +449,7 @@ public class GodotView extends GLSurfaceView implements InputDeviceListener {
|
||||
/* Get the number of minimally matching EGL configurations
|
||||
*/
|
||||
int[] num_config = new int[1];
|
||||
egl.eglChooseConfig(display, use_gl2?s_configAttribs2:s_configAttribs, null, 0, num_config);
|
||||
egl.eglChooseConfig(display, use_gl3?s_configAttribs3:s_configAttribs2, null, 0, num_config);
|
||||
|
||||
int numConfigs = num_config[0];
|
||||
|
||||
@ -458,7 +460,7 @@ public class GodotView extends GLSurfaceView implements InputDeviceListener {
|
||||
/* Allocate then read the array of minimally matching EGL configs
|
||||
*/
|
||||
EGLConfig[] configs = new EGLConfig[numConfigs];
|
||||
egl.eglChooseConfig(display, use_gl2?s_configAttribs2:s_configAttribs, configs, numConfigs, num_config);
|
||||
egl.eglChooseConfig(display, use_gl3?s_configAttribs3:s_configAttribs2, configs, numConfigs, num_config);
|
||||
|
||||
if (DEBUG) {
|
||||
printConfigs(egl, display, configs);
|
||||
|
@ -929,7 +929,16 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_back(JNIEnv *env, job
|
||||
|
||||
static void _initialize_java_modules() {
|
||||
|
||||
if (!GlobalConfig::get_singleton()->has("android/modules")) {
|
||||
print_line("ANDROID MODULES: Nothing to load, aborting");
|
||||
return;
|
||||
}
|
||||
|
||||
String modules = GlobalConfig::get_singleton()->get("android/modules");
|
||||
modules = modules.strip_edges();
|
||||
if (modules == String()) {
|
||||
return;
|
||||
}
|
||||
Vector<String> mods = modules.split(",", false);
|
||||
print_line("ANDROID MODULES : " + modules);
|
||||
__android_log_print(ANDROID_LOG_INFO, "godot", "mod count: %i", mods.size());
|
||||
|
Loading…
Reference in New Issue
Block a user