Android fixes
This commit is contained in:
@@ -76,12 +76,12 @@ function _g2_make_glyphs(start: i32, end: i32): i32[] {
|
|||||||
function g2_init() {
|
function g2_init() {
|
||||||
if (!_g2_initialized) {
|
if (!_g2_initialized) {
|
||||||
iron_g2_init(
|
iron_g2_init(
|
||||||
iron_load_blob("./data/g2_image.vert" + sys_shader_ext()),
|
iron_load_blob(data_path() + "g2_image.vert" + sys_shader_ext()),
|
||||||
iron_load_blob("./data/g2_image.frag" + sys_shader_ext()),
|
iron_load_blob(data_path() + "g2_image.frag" + sys_shader_ext()),
|
||||||
iron_load_blob("./data/g2_colored.vert" + sys_shader_ext()),
|
iron_load_blob(data_path() + "g2_colored.vert" + sys_shader_ext()),
|
||||||
iron_load_blob("./data/g2_colored.frag" + sys_shader_ext()),
|
iron_load_blob(data_path() + "g2_colored.frag" + sys_shader_ext()),
|
||||||
iron_load_blob("./data/g2_text.vert" + sys_shader_ext()),
|
iron_load_blob(data_path() + "g2_text.vert" + sys_shader_ext()),
|
||||||
iron_load_blob("./data/g2_text.frag" + sys_shader_ext())
|
iron_load_blob(data_path() + "g2_text.frag" + sys_shader_ext())
|
||||||
);
|
);
|
||||||
_g2_initialized = true;
|
_g2_initialized = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -381,7 +381,7 @@ function sys_get_shader(name: string): shader_t {
|
|||||||
let shader: shader_t = map_get(_sys_shaders, name);
|
let shader: shader_t = map_get(_sys_shaders, name);
|
||||||
if (shader == null) {
|
if (shader == null) {
|
||||||
shader = g4_shader_create(
|
shader = g4_shader_create(
|
||||||
iron_load_blob("./data/" + name + sys_shader_ext()),
|
iron_load_blob(data_path() + name + sys_shader_ext()),
|
||||||
ends_with(name, ".frag") ? shader_type_t.FRAGMENT : ends_with(name, ".vert") ? shader_type_t.VERTEX : shader_type_t.GEOMETRY);
|
ends_with(name, ".frag") ? shader_type_t.FRAGMENT : ends_with(name, ".vert") ? shader_type_t.VERTEX : shader_type_t.GEOMETRY);
|
||||||
map_set(_sys_shaders, name, shader);
|
map_set(_sys_shaders, name, shader);
|
||||||
}
|
}
|
||||||
|
|||||||
+9
-14
@@ -2447,7 +2447,12 @@ function shader_find_type(options) {
|
|||||||
return 'msl';
|
return 'msl';
|
||||||
}
|
}
|
||||||
else if (options.graphics === 'opengl') {
|
else if (options.graphics === 'opengl') {
|
||||||
return 'glsl';
|
if (goptions.target === "android" || goptions.target === "wasm") {
|
||||||
|
return "essl";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
return 'glsl';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (options.graphics === 'direct3d11' || options.graphics === 'direct3d12') {
|
else if (options.graphics === 'direct3d11' || options.graphics === 'direct3d12') {
|
||||||
return 'hlsl';
|
return 'hlsl';
|
||||||
@@ -2534,24 +2539,14 @@ class ShaderCompiler {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
let parameters = [this.type, from, to, this.temp, "iron"];
|
|
||||||
fs_ensuredir(this.temp);
|
fs_ensuredir(this.temp);
|
||||||
|
|
||||||
if (goptions.target === "android" || goptions.target === "wasm") {
|
// from = path_resolve(from);
|
||||||
parameters[0] = "essl";
|
// to = path_resolve(to);
|
||||||
}
|
// this.temp = path_resolve(this.temp);
|
||||||
|
|
||||||
parameters[1] = path_resolve(parameters[1]);
|
|
||||||
parameters[2] = path_resolve(parameters[2]);
|
|
||||||
parameters[3] = path_resolve(parameters[3]);
|
|
||||||
|
|
||||||
amake.ashader(this.type, from, to);
|
amake.ashader(this.type, from, to);
|
||||||
|
|
||||||
// let child = os_exec(this.compiler, parameters);
|
|
||||||
// if (child.status !== 0) {
|
|
||||||
// console.log('Shader compiler error.')
|
|
||||||
// }
|
|
||||||
|
|
||||||
let compiled_shader = new CompiledShader();
|
let compiled_shader = new CompiledShader();
|
||||||
return compiled_shader;
|
return compiled_shader;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ let file_cloud_sizes: map_t<string, i32> = null;
|
|||||||
let _file_init_cloud_bytes_done: ()=>void;
|
let _file_init_cloud_bytes_done: ()=>void;
|
||||||
|
|
||||||
// ///if arm_android
|
// ///if arm_android
|
||||||
// let let file_internal: map_t<string, string[]> = null; // .apk contents
|
// let file_internal: map_t<string, string[]> = null; // .apk contents
|
||||||
// ///end
|
// ///end
|
||||||
|
|
||||||
function file_read_directory(path: string): string[] {
|
function file_read_directory(path: string): string[] {
|
||||||
|
|||||||
Reference in New Issue
Block a user