From 089d7fa171e3a3305991047e82b4043d4f05783f Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Mon, 15 Dec 2014 15:42:58 -0300 Subject: Small batch of fixes -=-=-=-=-=-=-=-=-=-= -Fixed looping error in AudioStreamResampled -winrt port progress -fixes in material in ambient light --- drivers/gles2/shaders/material.glsl | 2 +- drivers/mpc/audio_stream_mpc.cpp | 2 +- drivers/theoraplayer/SCsub | 3 +++ drivers/unix/ip_unix.cpp | 2 +- drivers/windows/dir_access_windows.cpp | 7 +++++-- drivers/windows/file_access_windows.cpp | 1 - 6 files changed, 11 insertions(+), 6 deletions(-) (limited to 'drivers') diff --git a/drivers/gles2/shaders/material.glsl b/drivers/gles2/shaders/material.glsl index f2d9eaf1e5..718dd56249 100644 --- a/drivers/gles2/shaders/material.glsl +++ b/drivers/gles2/shaders/material.glsl @@ -1230,7 +1230,7 @@ LIGHT_SHADER_CODE vec3 ambient = const_light_mult*ambient_light*diffuse.rgb; # if defined(LIGHT_TYPE_OMNI) || defined (LIGHT_TYPE_SPOT) - ambient*=diffuse_interp.a; //attenuation affects ambient too +// ambient*=diffuse_interp.a; //attenuation affects ambient too # endif diff --git a/drivers/mpc/audio_stream_mpc.cpp b/drivers/mpc/audio_stream_mpc.cpp index e1f9aacf5f..d94f57e683 100644 --- a/drivers/mpc/audio_stream_mpc.cpp +++ b/drivers/mpc/audio_stream_mpc.cpp @@ -275,7 +275,7 @@ void AudioStreamMPC::stop() { } bool AudioStreamMPC::is_playing() const { - return active; + return active || (get_total() - get_todo() -1 > 0); } void AudioStreamMPC::set_paused(bool p_paused) { diff --git a/drivers/theoraplayer/SCsub b/drivers/theoraplayer/SCsub index d4218debb6..cd8cabcc94 100644 --- a/drivers/theoraplayer/SCsub +++ b/drivers/theoraplayer/SCsub @@ -78,6 +78,9 @@ else: if env["platform"] == "android": env_theora.Append(CPPFLAGS=["-D_ANDROID"]) +if env["platform"] == "winrt": + env_theora.Append(CPPFLAGS=["-D_WINRT"]) + env_theora.Append(CPPPATH=["#drivers/theoraplayer/include/theoraplayer", "#drivers/theoraplayer/src/YUV", "#drivers/theoraplayer/src/YUV/libyuv/include", "#drivers/theoraplayer/src/Theora", "#drivers/theoraplayer/src/AVFoundation"]) objs = [] diff --git a/drivers/unix/ip_unix.cpp b/drivers/unix/ip_unix.cpp index c221743457..841160f941 100644 --- a/drivers/unix/ip_unix.cpp +++ b/drivers/unix/ip_unix.cpp @@ -28,7 +28,7 @@ /*************************************************************************/ #include "ip_unix.h" -#if defined(UNIX_ENABLED) || defined(WINDOWS_ENABLED) +#if defined(UNIX_ENABLED) || defined(WINDOWS_ENABLED) && !defined(WINRT_ENABLED) #ifdef WINDOWS_ENABLED diff --git a/drivers/windows/dir_access_windows.cpp b/drivers/windows/dir_access_windows.cpp index df6cc6c5e2..d1e9766105 100644 --- a/drivers/windows/dir_access_windows.cpp +++ b/drivers/windows/dir_access_windows.cpp @@ -106,6 +106,7 @@ String DirAccessWindows::get_next() { return name; } else { +#ifndef WINRT_ENABLED _cisdir=(p->fu.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY); String name=p->f.cFileName; @@ -117,7 +118,8 @@ String DirAccessWindows::get_next() { } return name; - +#endif + return ""; } } @@ -358,6 +360,7 @@ bool DirAccessWindows::dir_exists(String p_dir) { return (fileAttr&FILE_ATTRIBUTE_DIRECTORY); } else { +#ifndef WINRT_ENABLED DWORD fileAttr; fileAttr = GetFileAttributesExA(p_dir.ascii().get_data(), GetFileExInfoStandard, &fileInfo); @@ -366,8 +369,8 @@ bool DirAccessWindows::dir_exists(String p_dir) { return (fileAttr&FILE_ATTRIBUTE_DIRECTORY); +#endif } - return false; } diff --git a/drivers/windows/file_access_windows.cpp b/drivers/windows/file_access_windows.cpp index 3cd065841f..a6073cbb29 100644 --- a/drivers/windows/file_access_windows.cpp +++ b/drivers/windows/file_access_windows.cpp @@ -54,7 +54,6 @@ void FileAccessWindows::check_errors() const { Error FileAccessWindows::_open(const String& p_filename, int p_mode_flags) { String filename=fix_path(p_filename); - if (f) close(); -- cgit v1.2.3