summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gles3/rasterizer_storage_gles3.cpp6
-rw-r--r--drivers/gles3/shaders/scene.glsl2
-rw-r--r--drivers/rtaudio/audio_driver_rtaudio.cpp20
-rw-r--r--drivers/unix/os_unix.cpp2
-rw-r--r--drivers/unix/os_unix.h2
-rw-r--r--drivers/unix/thread_posix.cpp6
-rw-r--r--drivers/unix/thread_posix.h4
-rw-r--r--drivers/windows/thread_windows.cpp6
-rw-r--r--drivers/windows/thread_windows.h4
9 files changed, 32 insertions, 20 deletions
diff --git a/drivers/gles3/rasterizer_storage_gles3.cpp b/drivers/gles3/rasterizer_storage_gles3.cpp
index 89bea1e8cc..f7ecc3b158 100644
--- a/drivers/gles3/rasterizer_storage_gles3.cpp
+++ b/drivers/gles3/rasterizer_storage_gles3.cpp
@@ -6902,17 +6902,19 @@ void RasterizerStorageGLES3::initialize() {
config.use_fast_texture_filter = int(ProjectSettings::get_singleton()->get("rendering/quality/filters/use_nearest_mipmap_filter"));
config.use_anisotropic_filter = config.extensions.has("rendering/quality/filters/anisotropic_filter_level");
- config.s3tc_supported = config.extensions.has("GL_EXT_texture_compression_dxt1") || config.extensions.has("GL_EXT_texture_compression_s3tc") || config.extensions.has("WEBGL_compressed_texture_s3tc");
config.etc_supported = config.extensions.has("GL_OES_compressed_ETC1_RGB8_texture");
config.latc_supported = config.extensions.has("GL_EXT_texture_compression_latc");
- config.rgtc_supported = config.extensions.has("GL_EXT_texture_compression_rgtc");
config.bptc_supported = config.extensions.has("GL_ARB_texture_compression_bptc");
#ifdef GLES_OVER_GL
config.hdr_supported = true;
config.etc2_supported = false;
+ config.s3tc_supported = true;
+ config.rgtc_supported = true; //RGTC - core since OpenGL version 3.0
#else
config.etc2_supported = true;
config.hdr_supported = false;
+ config.s3tc_supported = config.extensions.has("GL_EXT_texture_compression_dxt1") || config.extensions.has("GL_EXT_texture_compression_s3tc") || config.extensions.has("WEBGL_compressed_texture_s3tc");
+ config.rgtc_supported = config.extensions.has("GL_EXT_texture_compression_rgtc") || config.extensions.has("GL_ARB_texture_compression_rgtc");
#endif
config.pvrtc_supported = config.extensions.has("GL_IMG_texture_compression_pvrtc");
diff --git a/drivers/gles3/shaders/scene.glsl b/drivers/gles3/shaders/scene.glsl
index 340a1f24d2..efb82441f4 100644
--- a/drivers/gles3/shaders/scene.glsl
+++ b/drivers/gles3/shaders/scene.glsl
@@ -1929,7 +1929,7 @@ FRAGMENT_SHADER_CODE
if (fog_depth_enabled) {
- float fog_z = smoothstep(fog_depth_begin,z_far,-vertex.z);
+ float fog_z = smoothstep(fog_depth_begin,z_far,length(vertex));
fog_amount = pow(fog_z,fog_depth_curve);
if (fog_transmit_enabled) {
diff --git a/drivers/rtaudio/audio_driver_rtaudio.cpp b/drivers/rtaudio/audio_driver_rtaudio.cpp
index da998db66f..3de25c32ad 100644
--- a/drivers/rtaudio/audio_driver_rtaudio.cpp
+++ b/drivers/rtaudio/audio_driver_rtaudio.cpp
@@ -79,7 +79,7 @@ int AudioDriverRtAudio::callback(void *outputBuffer, void *inputBuffer, unsigned
Error AudioDriverRtAudio::init() {
active = false;
- mutex = NULL;
+ mutex = Mutex::create(true);
dac = memnew(RtAudio);
ERR_EXPLAIN("Cannot initialize RtAudio audio driver: No devices present.")
@@ -136,7 +136,6 @@ Error AudioDriverRtAudio::init() {
try {
dac->openStream(&parameters, NULL, RTAUDIO_SINT32, mix_rate, &buffer_size, &callback, this, &options);
- mutex = Mutex::create(true);
active = true;
break;
@@ -162,6 +161,7 @@ Error AudioDriverRtAudio::init() {
try {
dac->closeStream();
+ active = false;
} catch (RtAudioError &e) {
ERR_PRINT(e.what());
ERR_FAIL_V(ERR_UNAVAILABLE);
@@ -212,17 +212,27 @@ void AudioDriverRtAudio::unlock() {
void AudioDriverRtAudio::finish() {
- if (active && dac->isStreamOpen())
+ lock();
+ if (active && dac->isStreamOpen()) {
dac->closeStream();
- if (mutex)
+ active = false;
+ }
+ unlock();
+
+ if (mutex) {
memdelete(mutex);
- if (dac)
+ mutex = NULL;
+ }
+ if (dac) {
memdelete(dac);
+ dac = NULL;
+ }
}
AudioDriverRtAudio::AudioDriverRtAudio() {
mutex = NULL;
+ dac = NULL;
mix_rate = 44100;
speaker_mode = SPEAKER_MODE_STEREO;
}
diff --git a/drivers/unix/os_unix.cpp b/drivers/unix/os_unix.cpp
index e424590881..0f4e8f757c 100644
--- a/drivers/unix/os_unix.cpp
+++ b/drivers/unix/os_unix.cpp
@@ -415,7 +415,7 @@ Error OS_Unix::kill(const ProcessID &p_pid) {
return ret ? ERR_INVALID_PARAMETER : OK;
}
-int OS_Unix::get_process_ID() const {
+int OS_Unix::get_process_id() const {
return getpid();
};
diff --git a/drivers/unix/os_unix.h b/drivers/unix/os_unix.h
index fdc6d6e28f..6cd0016bb0 100644
--- a/drivers/unix/os_unix.h
+++ b/drivers/unix/os_unix.h
@@ -103,7 +103,7 @@ public:
virtual Error execute(const String &p_path, const List<String> &p_arguments, bool p_blocking, ProcessID *r_child_id = NULL, String *r_pipe = NULL, int *r_exitcode = NULL);
virtual Error kill(const ProcessID &p_pid);
- virtual int get_process_ID() const;
+ virtual int get_process_id() const;
virtual bool has_environment(const String &p_var) const;
virtual String get_environment(const String &p_var) const;
diff --git a/drivers/unix/thread_posix.cpp b/drivers/unix/thread_posix.cpp
index c1559619d7..3b895ff9c1 100644
--- a/drivers/unix/thread_posix.cpp
+++ b/drivers/unix/thread_posix.cpp
@@ -38,7 +38,7 @@
#include "os/memory.h"
-Thread::ID ThreadPosix::get_ID() const {
+Thread::ID ThreadPosix::get_id() const {
return id;
}
@@ -75,7 +75,7 @@ Thread *ThreadPosix::create_func_posix(ThreadCreateCallback p_callback, void *p_
return tr;
}
-Thread::ID ThreadPosix::get_thread_ID_func_posix() {
+Thread::ID ThreadPosix::get_thread_id_func_posix() {
return (ID)pthread_self();
}
@@ -122,7 +122,7 @@ Error ThreadPosix::set_name_func_posix(const String &p_name) {
void ThreadPosix::make_default() {
create_func = create_func_posix;
- get_thread_ID_func = get_thread_ID_func_posix;
+ get_thread_id_func = get_thread_id_func_posix;
wait_to_finish_func = wait_to_finish_func_posix;
set_name_func = set_name_func_posix;
}
diff --git a/drivers/unix/thread_posix.h b/drivers/unix/thread_posix.h
index c0c3e578bb..21e1d290a9 100644
--- a/drivers/unix/thread_posix.h
+++ b/drivers/unix/thread_posix.h
@@ -53,7 +53,7 @@ class ThreadPosix : public Thread {
static void *thread_callback(void *userdata);
static Thread *create_func_posix(ThreadCreateCallback p_callback, void *, const Settings &);
- static ID get_thread_ID_func_posix();
+ static ID get_thread_id_func_posix();
static void wait_to_finish_func_posix(Thread *p_thread);
static Error set_name_func_posix(const String &p_name);
@@ -61,7 +61,7 @@ class ThreadPosix : public Thread {
ThreadPosix();
public:
- virtual ID get_ID() const;
+ virtual ID get_id() const;
static void make_default();
diff --git a/drivers/windows/thread_windows.cpp b/drivers/windows/thread_windows.cpp
index 79077a54c8..01ddf42649 100644
--- a/drivers/windows/thread_windows.cpp
+++ b/drivers/windows/thread_windows.cpp
@@ -33,7 +33,7 @@
#include "os/memory.h"
-Thread::ID ThreadWindows::get_ID() const {
+Thread::ID ThreadWindows::get_id() const {
return id;
}
@@ -72,7 +72,7 @@ Thread *ThreadWindows::create_func_windows(ThreadCreateCallback p_callback, void
return tr;
}
-Thread::ID ThreadWindows::get_thread_ID_func_windows() {
+Thread::ID ThreadWindows::get_thread_id_func_windows() {
return (ID)GetCurrentThreadId(); //must implement
}
@@ -88,7 +88,7 @@ void ThreadWindows::wait_to_finish_func_windows(Thread *p_thread) {
void ThreadWindows::make_default() {
create_func = create_func_windows;
- get_thread_ID_func = get_thread_ID_func_windows;
+ get_thread_id_func = get_thread_id_func_windows;
wait_to_finish_func = wait_to_finish_func_windows;
}
diff --git a/drivers/windows/thread_windows.h b/drivers/windows/thread_windows.h
index 162df08975..143825039c 100644
--- a/drivers/windows/thread_windows.h
+++ b/drivers/windows/thread_windows.h
@@ -52,13 +52,13 @@ class ThreadWindows : public Thread {
static DWORD WINAPI thread_callback(LPVOID userdata);
static Thread *create_func_windows(ThreadCreateCallback p_callback, void *, const Settings &);
- static ID get_thread_ID_func_windows();
+ static ID get_thread_id_func_windows();
static void wait_to_finish_func_windows(Thread *p_thread);
ThreadWindows();
public:
- virtual ID get_ID() const;
+ virtual ID get_id() const;
static void make_default();