summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2018-08-24 09:35:07 +0200
committerRémi Verschelde <rverschelde@gmail.com>2018-08-24 14:59:01 +0200
commit52466d57e9c2897c40698a09482e5e7de230368f (patch)
tree54ff3bb78961ca5d8120cc7e6abe91f5c99d92b7 /drivers
parentd442f3d0aa4185f154bee396efaf24ceb73c9d84 (diff)
Make some debug prints verbose-only, remove others
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gles2/rasterizer_canvas_gles2.cpp8
-rw-r--r--drivers/gles2/rasterizer_storage_gles2.cpp3
-rw-r--r--drivers/gles2/shader_compiler_gles2.cpp1
-rw-r--r--drivers/gles2/shader_gles2.cpp1
-rw-r--r--drivers/gles3/rasterizer_canvas_gles3.cpp19
-rw-r--r--drivers/gles3/shader_compiler_gles3.cpp2
-rw-r--r--drivers/gles3/shader_gles3.cpp9
-rw-r--r--drivers/png/image_loader_png.cpp1
-rw-r--r--drivers/windows/file_access_windows.cpp20
-rw-r--r--drivers/xaudio2/audio_driver_xaudio2.h2
10 files changed, 16 insertions, 50 deletions
diff --git a/drivers/gles2/rasterizer_canvas_gles2.cpp b/drivers/gles2/rasterizer_canvas_gles2.cpp
index 5b04517394..9a9ede761a 100644
--- a/drivers/gles2/rasterizer_canvas_gles2.cpp
+++ b/drivers/gles2/rasterizer_canvas_gles2.cpp
@@ -486,7 +486,8 @@ void RasterizerCanvasGLES2::_canvas_item_render_commands(Item *p_item, Item *cur
RasterizerStorageGLES2::Texture *tex = _bind_canvas_texture(np->texture, np->normal_map);
if (!tex) {
- print_line("TODO: ninepatch without texture");
+ // FIXME: Handle textureless ninepatch gracefully
+ WARN_PRINT("NinePatch without texture not supported yet in GLES2 backend, skipping.");
continue;
}
@@ -612,8 +613,6 @@ void RasterizerCanvasGLES2::_canvas_item_render_commands(Item *p_item, Item *cur
buffer[(3 * 4 * 4) + 14] = (source.position.x + source.size.x) * texpixel_size.x;
buffer[(3 * 4 * 4) + 15] = (source.position.y + source.size.y) * texpixel_size.y;
-
- // print_line(String::num((source.position.y + source.size.y) * texpixel_size.y));
}
glBindBuffer(GL_ARRAY_BUFFER, data.ninepatch_vertices);
@@ -789,7 +788,8 @@ void RasterizerCanvasGLES2::_canvas_item_render_commands(Item *p_item, Item *cur
} break;
default: {
- print_line("other");
+ // FIXME: Proper error handling if relevant
+ //print_line("other");
} break;
}
}
diff --git a/drivers/gles2/rasterizer_storage_gles2.cpp b/drivers/gles2/rasterizer_storage_gles2.cpp
index 262add1cc3..3cee42983d 100644
--- a/drivers/gles2/rasterizer_storage_gles2.cpp
+++ b/drivers/gles2/rasterizer_storage_gles2.cpp
@@ -28,6 +28,7 @@
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
/*************************************************************************/
#include "rasterizer_storage_gles2.h"
+
#include "project_settings.h"
#include "rasterizer_canvas_gles2.h"
#include "rasterizer_scene_gles2.h"
@@ -601,8 +602,6 @@ Ref<Image> RasterizerStorageGLES2::texture_get_data(RID p_texture, int p_layer)
glBindBuffer(GL_PIXEL_PACK_BUFFER, 0);
- //print_line("GET FORMAT: " + Image::get_format_name(texture->format) + " mipmaps: " + itos(texture->mipmaps));
-
for (int i = 0; i < texture->mipmaps; i++) {
int ofs = 0;
diff --git a/drivers/gles2/shader_compiler_gles2.cpp b/drivers/gles2/shader_compiler_gles2.cpp
index 2227c9769a..1c87b3ffb5 100644
--- a/drivers/gles2/shader_compiler_gles2.cpp
+++ b/drivers/gles2/shader_compiler_gles2.cpp
@@ -596,6 +596,7 @@ String ShaderCompilerGLES2::_dump_node_code(SL::Node *p_node, int p_level, Gener
default: {
SL::DataType type = op_node->arguments[3]->get_datatype();
+ // FIXME: Proper error print or graceful handling
print_line(String("uhhhh invalid mix with type: ") + itos(type));
} break;
}
diff --git a/drivers/gles2/shader_gles2.cpp b/drivers/gles2/shader_gles2.cpp
index 5cdbdf84e0..3b2a29d3ee 100644
--- a/drivers/gles2/shader_gles2.cpp
+++ b/drivers/gles2/shader_gles2.cpp
@@ -231,7 +231,6 @@ static String _fix_error_code_line(const String &p_error, int p_code_start, int
continue;
String numstr = error.substr(last_find_pos + 1, (end_pos - last_find_pos) - 1);
- print_line("numstr: " + numstr);
String begin = error.substr(0, last_find_pos + 1);
String end = error.substr(end_pos, error.length());
int num = numstr.to_int() + p_code_start - p_offset;
diff --git a/drivers/gles3/rasterizer_canvas_gles3.cpp b/drivers/gles3/rasterizer_canvas_gles3.cpp
index 5e13bed198..dc6d705586 100644
--- a/drivers/gles3/rasterizer_canvas_gles3.cpp
+++ b/drivers/gles3/rasterizer_canvas_gles3.cpp
@@ -1557,17 +1557,12 @@ void RasterizerCanvasGLES3::canvas_debug_viewport_shadows(Light *p_lights_with_s
int ofs = h;
glDisable(GL_BLEND);
- //print_line(" debug lights ");
while (light) {
-
- //print_line("debug light");
if (light->shadow_buffer.is_valid()) {
- //print_line("sb is valid");
RasterizerStorageGLES3::CanvasLightShadow *sb = storage->canvas_light_shadow_owner.get(light->shadow_buffer);
if (sb) {
glBindTexture(GL_TEXTURE_2D, sb->distance);
- //glBindTexture(GL_TEXTURE_2D,storage->resources.white_tex);
draw_generic_textured_rect(Rect2(h, ofs, w - h * 2, h), Rect2(0, 0, 1, 1));
ofs += h * 2;
}
@@ -1677,19 +1672,7 @@ void RasterizerCanvasGLES3::canvas_light_shadow_buffer_update(RID p_buffer, cons
} break;
}
}
- /*
- if (i==0) {
- for(int i=0;i<cc->lines.size();i++) {
- Vector2 p = instance->xform_cache.xform(cc->lines.get(i));
- Plane pp(Vector3(p.x,p.y,0),1);
- pp.normal = light.xform(pp.normal);
- pp = projection.xform4(pp);
- print_line(itos(i)+": "+pp.normal/pp.d);
- //pp=light_mat.xform4(pp);
- //print_line(itos(i)+": "+pp.normal/pp.d);
- }
- }
-*/
+
glBindVertexArray(cc->array_id);
glDrawElements(GL_TRIANGLES, cc->len * 3, GL_UNSIGNED_SHORT, 0);
diff --git a/drivers/gles3/shader_compiler_gles3.cpp b/drivers/gles3/shader_compiler_gles3.cpp
index 0c353d42bb..a78a392cbd 100644
--- a/drivers/gles3/shader_compiler_gles3.cpp
+++ b/drivers/gles3/shader_compiler_gles3.cpp
@@ -436,8 +436,6 @@ String ShaderCompilerGLES3::_dump_node_code(SL::Node *p_node, int p_level, Gener
continue;
}
- print_line("u - "+String(E->key())+" offset: "+itos(r_gen_code.uniform_offsets[E->get().order]));
-
}
*/
diff --git a/drivers/gles3/shader_gles3.cpp b/drivers/gles3/shader_gles3.cpp
index ca0ce5cd3e..007600bb42 100644
--- a/drivers/gles3/shader_gles3.cpp
+++ b/drivers/gles3/shader_gles3.cpp
@@ -240,8 +240,6 @@ ShaderGLES3::Version *ShaderGLES3::get_current_version() {
CharString code_globals;
CharString material_string;
- //print_line("code version? "+itos(conditional_version.code_version));
-
CustomCode *cc = NULL;
if (conditional_version.code_version > 0) {
@@ -743,13 +741,6 @@ void ShaderGLES3::set_custom_shader(uint32_t p_code_id) {
void ShaderGLES3::free_custom_shader(uint32_t p_code_id) {
- /* if (! custom_code_map.has( p_code_id )) {
- print_line("no code id "+itos(p_code_id));
- } else {
- print_line("freed code id "+itos(p_code_id));
-
- }*/
-
ERR_FAIL_COND(!custom_code_map.has(p_code_id));
if (conditional_version.code_version == p_code_id)
conditional_version.code_version = 0; //bye
diff --git a/drivers/png/image_loader_png.cpp b/drivers/png/image_loader_png.cpp
index 3f512af8d5..b08688892e 100644
--- a/drivers/png/image_loader_png.cpp
+++ b/drivers/png/image_loader_png.cpp
@@ -271,7 +271,6 @@ static void _write_png_data(png_structp png_ptr, png_bytep data, png_size_t p_le
v.resize(vs + p_length);
PoolVector<uint8_t>::Write w = v.write();
copymem(&w[vs], data, p_length);
- //print_line("png write: "+itos(p_length));
}
static PoolVector<uint8_t> _lossless_pack_png(const Ref<Image> &p_image) {
diff --git a/drivers/windows/file_access_windows.cpp b/drivers/windows/file_access_windows.cpp
index ea194e5eae..b4492a2022 100644
--- a/drivers/windows/file_access_windows.cpp
+++ b/drivers/windows/file_access_windows.cpp
@@ -31,11 +31,13 @@
#ifdef WINDOWS_ENABLED
#include "file_access_windows.h"
-#include "os/os.h"
-#include "shlwapi.h"
+
+#include "core/os/os.h"
+#include "core/print_string.h"
+
+#include <shlwapi.h>
#include <windows.h>
-#include "print_string.h"
#include <sys/stat.h>
#include <sys/types.h>
#include <tchar.h>
@@ -133,11 +135,6 @@ void FileAccessWindows::close() {
if (save_path != "") {
- //unlink(save_path.utf8().get_data());
- //print_line("renaming...");
- //_wunlink(save_path.c_str()); //unlink if exists
- //int rename_error = _wrename((save_path+".tmp").c_str(),save_path.c_str());
-
bool rename_error = true;
int attempts = 4;
while (rename_error && attempts) {
@@ -305,11 +302,10 @@ uint64_t FileAccessWindows::_get_modified_time(const String &p_file) {
return st.st_mtime;
} else {
- print_line("no access to " + file);
+ ERR_EXPLAIN("Failed to get modified time for: " + file);
+ ERR_FAIL_V(0);
}
-
- ERR_FAIL_V(0);
-};
+}
FileAccessWindows::FileAccessWindows() {
diff --git a/drivers/xaudio2/audio_driver_xaudio2.h b/drivers/xaudio2/audio_driver_xaudio2.h
index 42e1adb2b7..0867c56128 100644
--- a/drivers/xaudio2/audio_driver_xaudio2.h
+++ b/drivers/xaudio2/audio_driver_xaudio2.h
@@ -51,7 +51,7 @@ class AudioDriverXAudio2 : public AudioDriver {
HANDLE buffer_end_event;
XAudio2DriverVoiceCallback() :
buffer_end_event(CreateEvent(NULL, FALSE, FALSE, NULL)) {}
- void STDMETHODCALLTYPE OnBufferEnd(void *pBufferContext) { /*print_line("buffer ended");*/
+ void STDMETHODCALLTYPE OnBufferEnd(void *pBufferContext) {
SetEvent(buffer_end_event);
}