From 724d02b73f1b4503f623e5e275819b7e38039934 Mon Sep 17 00:00:00 2001 From: Vadim Lopatin Date: Thu, 25 Aug 2016 16:41:28 +0300 Subject: [PATCH] fix Android builds --- android/dlangui_source_files.mk | 6 ++++-- src/dlangui/graphics/resources.d | 28 ++++++++++++++++------------ views/res/shaders/textured.frag | 4 ++-- 3 files changed, 22 insertions(+), 16 deletions(-) diff --git a/android/dlangui_source_files.mk b/android/dlangui_source_files.mk index c3010ad0..c4c731ad 100644 --- a/android/dlangui_source_files.mk +++ b/android/dlangui_source_files.mk @@ -49,12 +49,14 @@ $DLANGUI_DIR/src/dlangui/graphics/scene/scene3d.d \ $DLANGUI_DIR/src/dlangui/graphics/scene/transform.d \ $DLANGUI_DIR/src/dlangui/graphics/scene/mesh.d \ $DLANGUI_DIR/src/dlangui/graphics/scene/fbximport.d \ +$DLANGUI_DIR/src/dlangui/graphics/scene/skybox.d \ $DLANGUI_DIR/src/dlangui/graphics/resources.d \ $DLANGUI_DIR/src/dlangui/graphics/glsupport.d \ $DLANGUI_DIR/src/dlangui/graphics/colors.d \ $DLANGUI_DIR/src/dlangui/graphics/gldrawbuf.d \ $DLANGUI_DIR/src/dlangui/graphics/fonts.d \ -$DLANGUI_DIR/src/dlangui/graphics/domrender.d \ +$DLANGUI_DIR/src/dlangui/graphics/domrender/domrender.d \ +$DLANGUI_DIR/src/dlangui/graphics/domrender/renderblock.d \ $DLANGUI_DIR/src/dlangui/package.d \ $DLANGUI_DIR/src/dlangui/dml/dmlhighlight.d \ $DLANGUI_DIR/src/dlangui/dml/annotations.d \ @@ -98,7 +100,7 @@ $DLANGUI_DIR/3rdparty/android/android_native_app_glue.d \ $DLANGUI_DIR/3rdparty/android/android_native_app_glue_impl.d \ $DLANGUI_DIR/3rdparty/jni.d \ $DLANGUI_DIR/3rdparty/fontconfig/functions.d \ -$DLANGUI_DIR/3rdparty/fontconfig/types.d \ +$DLANGUI_DIR/3rdparty/fontconfig/fctypes.d \ $DLANGUI_DIR/3rdparty/fontconfig/package.d \ $DLANGUI_DIR/3rdparty/GLES3/gl3.d \ $DLANGUI_DIR/3rdparty/dimage/image.d \ diff --git a/src/dlangui/graphics/resources.d b/src/dlangui/graphics/resources.d index b2d7df5e..ce50255b 100644 --- a/src/dlangui/graphics/resources.d +++ b/src/dlangui/graphics/resources.d @@ -167,19 +167,23 @@ __gshared EmbeddedResourceList embeddedResourceList; //version = USE_FULL_PATH_FOR_RESOURCES; EmbeddedResource[] embedResource(string resourceName)() { - version (USE_FULL_PATH_FOR_RESOURCES) { - immutable string name = resourceName; - } else { - immutable string name = baseName(resourceName); - } - static if (name.length > 0 && !name.startsWith("#")) { - immutable ubyte[] data = cast(immutable ubyte[])import(name); - static if (data.length > 0) - return [EmbeddedResource(name, data)]; - else - return []; - } else + static if (resourceName.startsWith("#")) { return []; + } else { + version (USE_FULL_PATH_FOR_RESOURCES) { + immutable string name = resourceName; + } else { + immutable string name = baseName(resourceName); + } + static if (name.length > 0) { + immutable ubyte[] data = cast(immutable ubyte[])import(name); + static if (data.length > 0) + return [EmbeddedResource(name, data)]; + else + return []; + } else + return []; + } } /// embed all resources from list diff --git a/views/res/shaders/textured.frag b/views/res/shaders/textured.frag index 9a12f44b..de9988d2 100644 --- a/views/res/shaders/textured.frag +++ b/views/res/shaders/textured.frag @@ -136,8 +136,8 @@ void main() _baseColor = texture2D(u_diffuseTexture, v_texCoord); #if defined(FOG) - float dist = 0; - float fogFactor = 0; + float dist = 0.0; + float fogFactor = 0.0; //range based dist = length(viewSpace); // linear fog: u_fogMinDistance .. u_fogMaxDistance