fix Android builds

This commit is contained in:
Vadim Lopatin 2016-08-25 16:41:28 +03:00
parent 556bf309e6
commit 724d02b73f
3 changed files with 22 additions and 16 deletions

View File

@ -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 \

View File

@ -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

View File

@ -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