summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2018-08-24 14:58:36 +0200
committerGitHub <noreply@github.com>2018-08-24 14:58:36 +0200
commitd442f3d0aa4185f154bee396efaf24ceb73c9d84 (patch)
tree46086425e2349832e9f07f05492ac67d74ecc333 /drivers
parent548c26239907c34081a96bff61d653f2a32ac243 (diff)
parentde59fe04e73250229e6ac11f9314e1b75dbdef1a (diff)
Merge pull request #21351 from akien-mga/print_verbose
Add print_verbose to print to stdout only in verbose mode
Diffstat (limited to 'drivers')
-rw-r--r--drivers/alsa/audio_driver_alsa.cpp4
-rw-r--r--drivers/coreaudio/audio_driver_coreaudio.cpp6
-rw-r--r--drivers/gles2/rasterizer_gles2.cpp4
-rw-r--r--drivers/gles3/rasterizer_gles3.cpp6
-rw-r--r--drivers/pulseaudio/audio_driver_pulseaudio.cpp10
-rw-r--r--drivers/rtaudio/audio_driver_rtaudio.cpp5
-rw-r--r--drivers/unix/file_access_unix.cpp7
-rw-r--r--drivers/wasapi/audio_driver_wasapi.cpp6
8 files changed, 14 insertions, 34 deletions
diff --git a/drivers/alsa/audio_driver_alsa.cpp b/drivers/alsa/audio_driver_alsa.cpp
index a44a11a46d..1f53d52951 100644
--- a/drivers/alsa/audio_driver_alsa.cpp
+++ b/drivers/alsa/audio_driver_alsa.cpp
@@ -116,9 +116,7 @@ Error AudioDriverALSA::init_device() {
status = snd_pcm_hw_params_set_period_size_near(pcm_handle, hwparams, &period_size, NULL);
CHECK_FAIL(status < 0);
- if (OS::get_singleton()->is_stdout_verbose()) {
- print_line("audio buffer frames: " + itos(period_size) + " calculated latency: " + itos(period_size * 1000 / mix_rate) + "ms");
- }
+ print_verbose("Audio buffer frames: " + itos(period_size) + " calculated latency: " + itos(period_size * 1000 / mix_rate) + "ms");
status = snd_pcm_hw_params_set_periods_near(pcm_handle, hwparams, &periods, NULL);
CHECK_FAIL(status < 0);
diff --git a/drivers/coreaudio/audio_driver_coreaudio.cpp b/drivers/coreaudio/audio_driver_coreaudio.cpp
index e1f47cb8c2..689f1f462d 100644
--- a/drivers/coreaudio/audio_driver_coreaudio.cpp
+++ b/drivers/coreaudio/audio_driver_coreaudio.cpp
@@ -178,10 +178,8 @@ Error AudioDriverCoreAudio::init() {
input_position = 0;
input_size = 0;
- if (OS::get_singleton()->is_stdout_verbose()) {
- print_line("CoreAudio: detected " + itos(channels) + " channels");
- print_line("CoreAudio: audio buffer frames: " + itos(buffer_frames) + " calculated latency: " + itos(buffer_frames * 1000 / mix_rate) + "ms");
- }
+ print_verbose("CoreAudio: detected " + itos(channels) + " channels");
+ print_verbose("CoreAudio: audio buffer frames: " + itos(buffer_frames) + " calculated latency: " + itos(buffer_frames * 1000 / mix_rate) + "ms");
AURenderCallbackStruct callback;
zeromem(&callback, sizeof(AURenderCallbackStruct));
diff --git a/drivers/gles2/rasterizer_gles2.cpp b/drivers/gles2/rasterizer_gles2.cpp
index 8815205054..c926f2bcc4 100644
--- a/drivers/gles2/rasterizer_gles2.cpp
+++ b/drivers/gles2/rasterizer_gles2.cpp
@@ -138,9 +138,7 @@ RasterizerScene *RasterizerGLES2::get_scene() {
void RasterizerGLES2::initialize() {
- if (OS::get_singleton()->is_stdout_verbose()) {
- print_line("Using GLES2 video driver");
- }
+ print_verbose("Using GLES2 video driver");
#ifdef GLAD_ENABLED
if (!gladLoadGL()) {
diff --git a/drivers/gles3/rasterizer_gles3.cpp b/drivers/gles3/rasterizer_gles3.cpp
index cb17695c5f..0d42635194 100644
--- a/drivers/gles3/rasterizer_gles3.cpp
+++ b/drivers/gles3/rasterizer_gles3.cpp
@@ -33,7 +33,9 @@
#include "gl_context/context_gl.h"
#include "os/os.h"
#include "project_settings.h"
+
#include <string.h>
+
RasterizerStorage *RasterizerGLES3::get_storage() {
return storage;
@@ -136,9 +138,7 @@ typedef void (*DebugMessageCallbackARB)(DEBUGPROCARB callback, const void *userP
void RasterizerGLES3::initialize() {
- if (OS::get_singleton()->is_stdout_verbose()) {
- print_line("Using GLES3 video driver");
- }
+ print_verbose("Using GLES3 video driver");
#ifdef GLAD_ENABLED
if (!gladLoadGL()) {
diff --git a/drivers/pulseaudio/audio_driver_pulseaudio.cpp b/drivers/pulseaudio/audio_driver_pulseaudio.cpp
index d1104eec18..744b3a35e6 100644
--- a/drivers/pulseaudio/audio_driver_pulseaudio.cpp
+++ b/drivers/pulseaudio/audio_driver_pulseaudio.cpp
@@ -183,10 +183,8 @@ Error AudioDriverPulseAudio::init_device() {
buffer_frames = closest_power_of_2(latency * mix_rate / 1000);
pa_buffer_size = buffer_frames * pa_map.channels;
- if (OS::get_singleton()->is_stdout_verbose()) {
- print_line("PulseAudio: detected " + itos(pa_map.channels) + " channels");
- print_line("PulseAudio: audio buffer frames: " + itos(buffer_frames) + " calculated latency: " + itos(buffer_frames * 1000 / mix_rate) + "ms");
- }
+ print_verbose("PulseAudio: detected " + itos(pa_map.channels) + " channels");
+ print_verbose("PulseAudio: audio buffer frames: " + itos(buffer_frames) + " calculated latency: " + itos(buffer_frames * 1000 / mix_rate) + "ms");
pa_sample_spec spec;
spec.format = PA_SAMPLE_S16LE;
@@ -614,9 +612,7 @@ Error AudioDriverPulseAudio::capture_init_device() {
break;
}
- if (OS::get_singleton()->is_stdout_verbose()) {
- print_line("PulseAudio: detected " + itos(pa_rec_map.channels) + " input channels");
- }
+ print_verbose("PulseAudio: detected " + itos(pa_rec_map.channels) + " input channels");
pa_sample_spec spec;
diff --git a/drivers/rtaudio/audio_driver_rtaudio.cpp b/drivers/rtaudio/audio_driver_rtaudio.cpp
index 365788e192..69830b542b 100644
--- a/drivers/rtaudio/audio_driver_rtaudio.cpp
+++ b/drivers/rtaudio/audio_driver_rtaudio.cpp
@@ -112,10 +112,7 @@ Error AudioDriverRtAudio::init() {
int latency = GLOBAL_DEF("audio/output_latency", DEFAULT_OUTPUT_LATENCY);
unsigned int buffer_frames = closest_power_of_2(latency * mix_rate / 1000);
-
- if (OS::get_singleton()->is_stdout_verbose()) {
- print_line("audio buffer frames: " + itos(buffer_frames) + " calculated latency: " + itos(buffer_frames * 1000 / mix_rate) + "ms");
- }
+ print_verbose("Audio buffer frames: " + itos(buffer_frames) + " calculated latency: " + itos(buffer_frames * 1000 / mix_rate) + "ms");
short int tries = 2;
diff --git a/drivers/unix/file_access_unix.cpp b/drivers/unix/file_access_unix.cpp
index c25d34125d..ca16c6fcae 100644
--- a/drivers/unix/file_access_unix.cpp
+++ b/drivers/unix/file_access_unix.cpp
@@ -106,7 +106,6 @@ Error FileAccessUnix::_open(const String &p_path, int p_mode_flags) {
if (is_backup_save_enabled() && (p_mode_flags & WRITE) && !(p_mode_flags & READ)) {
save_path = path;
path = path + ".tmp";
- //print_line("saving instead to "+path);
}
f = fopen(path.utf8().get_data(), mode_string);
@@ -134,9 +133,6 @@ void FileAccessUnix::close() {
}
if (save_path != "") {
-
- //unlink(save_path.utf8().get_data());
- //print_line("renaming...");
int rename_error = rename((save_path + ".tmp").utf8().get_data(), save_path.utf8().get_data());
if (rename_error && close_fail_notify) {
@@ -291,8 +287,7 @@ uint64_t FileAccessUnix::_get_modified_time(const String &p_file) {
if (!err) {
return flags.st_mtime;
} else {
- print_line("ERROR IN: " + p_file);
-
+ ERR_EXPLAIN("Failed to get modified time for: " + p_file);
ERR_FAIL_V(0);
};
}
diff --git a/drivers/wasapi/audio_driver_wasapi.cpp b/drivers/wasapi/audio_driver_wasapi.cpp
index 2dcb4ff3d8..11abe3256e 100644
--- a/drivers/wasapi/audio_driver_wasapi.cpp
+++ b/drivers/wasapi/audio_driver_wasapi.cpp
@@ -321,10 +321,8 @@ Error AudioDriverWASAPI::init_render_device(bool reinit) {
input_position = 0;
input_size = 0;
- if (OS::get_singleton()->is_stdout_verbose()) {
- print_line("WASAPI: detected " + itos(channels) + " channels");
- print_line("WASAPI: audio buffer frames: " + itos(buffer_frames) + " calculated latency: " + itos(buffer_frames * 1000 / mix_rate) + "ms");
- }
+ print_verbose("WASAPI: detected " + itos(channels) + " channels");
+ print_verbose("WASAPI: audio buffer frames: " + itos(buffer_frames) + " calculated latency: " + itos(buffer_frames * 1000 / mix_rate) + "ms");
return OK;
}