summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
Diffstat (limited to 'platform')
-rw-r--r--platform/android/audio_driver_jandroid.cpp4
-rw-r--r--platform/android/export/export.cpp32
-rw-r--r--platform/android/godot_android.cpp2
-rw-r--r--platform/android/java_class_wrapper.cpp5
-rw-r--r--platform/android/os_android.cpp2
-rw-r--r--platform/iphone/export/export.cpp3
-rw-r--r--platform/osx/export/export.cpp7
-rw-r--r--platform/windows/context_gl_win.cpp14
-rw-r--r--platform/windows/joypad.cpp4
-rw-r--r--platform/windows/os_windows.cpp33
-rw-r--r--platform/x11/context_gl_x11.cpp13
-rw-r--r--platform/x11/os_x11.cpp23
12 files changed, 23 insertions, 119 deletions
diff --git a/platform/android/audio_driver_jandroid.cpp b/platform/android/audio_driver_jandroid.cpp
index b9f1f1eab0..46bd691290 100644
--- a/platform/android/audio_driver_jandroid.cpp
+++ b/platform/android/audio_driver_jandroid.cpp
@@ -82,9 +82,7 @@ Error AudioDriverAndroid::init() {
int latency = GLOBAL_DEF_RST("audio/output_latency", 25);
unsigned int buffer_size = next_power_of_2(latency * mix_rate / 1000);
- if (OS::get_singleton()->is_stdout_verbose()) {
- print_line("audio buffer size: " + itos(buffer_size));
- }
+ print_verbose("Audio buffer size: " + itos(buffer_size));
audioBuffer = env->CallObjectMethod(io, _init_audio, mix_rate, buffer_size);
diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp
index 4f72b359e9..b76b0d5dbe 100644
--- a/platform/android/export/export.cpp
+++ b/platform/android/export/export.cpp
@@ -257,7 +257,6 @@ class EditorExportAndroid : public EditorExportPlatform {
if (dpos == -1)
continue;
d = d.substr(0, dpos).strip_edges();
- //print_line("found device: "+d);
ldevices.push_back(d);
}
@@ -345,8 +344,6 @@ class EditorExportAndroid : public EditorExportPlatform {
}
d.name = vendor + " " + device;
- //print_line("name: "+d.name);
- //print_line("description: "+d.description);
}
ndevices.push_back(d);
@@ -671,19 +668,14 @@ class EditorExportAndroid : public EditorExportPlatform {
ucstring.write[len] = 0;
string_table.write[i] = ucstring.ptr();
}
-
- //print_line("String "+itos(i)+": "+string_table[i]);
}
for (uint32_t i = string_end; i < (ofs + size); i++) {
stable_extra.push_back(p_manifest[i]);
}
- //printf("stable extra: %i\n",int(stable_extra.size()));
string_table_ends = ofs + size;
- //print_line("STABLE SIZE: "+itos(size)+" ACTUAL: "+itos(string_table_ends));
-
} break;
case CHUNK_XML_START_TAG: {
@@ -714,35 +706,25 @@ class EditorExportAndroid : public EditorExportPlatform {
//replace project information
if (tname == "manifest" && attrname == "package") {
-
- print_line("FOUND package");
string_table.write[attr_value] = get_package_name(package_name);
}
- if (tname == "manifest" && /*nspace=="android" &&*/ attrname == "versionCode") {
-
- print_line("FOUND versionCode");
+ if (tname == "manifest" && attrname == "versionCode") {
encode_uint32(version_code, &p_manifest.write[iofs + 16]);
}
- if (tname == "manifest" && /*nspace=="android" &&*/ attrname == "versionName") {
-
- print_line("FOUND versionName");
+ if (tname == "manifest" && attrname == "versionName") {
if (attr_value == 0xFFFFFFFF) {
WARN_PRINT("Version name in a resource, should be plaintext")
} else
string_table.write[attr_value] = version_name;
}
- if (tname == "activity" && /*nspace=="android" &&*/ attrname == "screenOrientation") {
+ if (tname == "activity" && attrname == "screenOrientation") {
encode_uint32(orientation == 0 ? 0 : 1, &p_manifest.write[iofs + 16]);
}
- if (tname == "uses-feature" && /*nspace=="android" &&*/ attrname == "glEsVersion") {
- print_line("version number: " + itos(decode_uint32(&p_manifest[iofs + 16])));
- }
-
if (tname == "supports-screens") {
if (attrname == "smallScreens") {
@@ -773,7 +755,6 @@ class EditorExportAndroid : public EditorExportPlatform {
String tname = string_table[name];
if (tname == "manifest") {
- print_line("Found manifest end");
// save manifest ending so we can restore it
Vector<uint8_t> manifest_end;
@@ -913,8 +894,6 @@ class EditorExportAndroid : public EditorExportPlatform {
encode_uint32(string_table.size(), &ret.write[16]); //update new number of strings
encode_uint32(string_data_offset - 8, &ret.write[28]); //update new string data offset
- //print_line("file size: "+itos(ret.size()));
-
p_manifest = ret;
}
@@ -956,7 +935,6 @@ class EditorExportAndroid : public EditorExportPlatform {
void _fix_resources(const Ref<EditorExportPreset> &p_preset, Vector<uint8_t> &p_manifest) {
const int UTF8_FLAG = 0x00000100;
- print_line("*******************GORRRGLE***********************");
uint32_t string_block_len = decode_uint32(&p_manifest[16]);
uint32_t string_count = decode_uint32(&p_manifest[20]);
@@ -1234,8 +1212,8 @@ public:
err = OS::get_singleton()->execute(adb, args, true, NULL, NULL, &rv);
}
- print_line("Installing into device (please wait..): " + devices[p_device].name);
- ep.step("Installing to Device (please wait..)..", 2);
+ print_line("Installing to device (please wait...): " + devices[p_device].name);
+ ep.step("Installing to device (please wait...)", 2);
args.clear();
args.push_back("-s");
diff --git a/platform/android/godot_android.cpp b/platform/android/godot_android.cpp
index 0e5f4fb93a..061e05f5ee 100644
--- a/platform/android/godot_android.cpp
+++ b/platform/android/godot_android.cpp
@@ -928,7 +928,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_Godot_registerMethod(JNIEnv *e
jmethodID mid = env->GetMethodID(cls, mname.ascii().get_data(), cs.ascii().get_data());
if (!mid) {
- print_line("FAILED GETTING METHOD ID " + mname);
+ print_line("RegisterMethod: Failed getting method ID: " + mname);
}
s->add_method(mname, mid, types, get_jni_type(retval));
diff --git a/platform/android/java_class_wrapper.cpp b/platform/android/java_class_wrapper.cpp
index 446a5911e5..022ccb7d89 100644
--- a/platform/android/java_class_wrapper.cpp
+++ b/platform/android/java_class_wrapper.cpp
@@ -554,7 +554,6 @@ bool JavaClassWrapper::_get_type_sig(JNIEnv *env, jobject obj, uint32_t &sig, St
jstring name2 = (jstring)env->CallObjectMethod(obj, Class_getName);
String str_type = env->GetStringUTFChars(name2, NULL);
- print_line("name: " + str_type);
env->DeleteLocalRef(name2);
uint32_t t = 0;
@@ -1191,9 +1190,6 @@ Ref<JavaClass> JavaClassWrapper::wrap(const String &p_class) {
env->DeleteLocalRef(obj);
env->DeleteLocalRef(param_types);
env->DeleteLocalRef(return_type);
-
- //args[i] = _jobject_to_variant(env, obj);
- //print_line("\targ"+itos(i)+": "+Variant::get_type_name(args[i].get_type()));
};
env->DeleteLocalRef(methods);
@@ -1210,7 +1206,6 @@ Ref<JavaClass> JavaClassWrapper::wrap(const String &p_class) {
jstring name = (jstring)env->CallObjectMethod(obj, Field_getName);
String str_field = env->GetStringUTFChars(name, NULL);
env->DeleteLocalRef(name);
- print_line("FIELD: " + str_field);
int mods = env->CallIntMethod(obj, Field_getModifiers);
if ((mods & 0x8) && (mods & 0x10) && (mods & 0x1)) { //static final public!
diff --git a/platform/android/os_android.cpp b/platform/android/os_android.cpp
index f9eda9dff1..c8bdf98923 100644
--- a/platform/android/os_android.cpp
+++ b/platform/android/os_android.cpp
@@ -337,8 +337,6 @@ void OS_Android::process_event(Ref<InputEvent> p_event) {
void OS_Android::process_touch(int p_what, int p_pointer, const Vector<TouchPos> &p_points) {
- //print_line("ev: "+itos(p_what)+" pnt: "+itos(p_pointer)+" pointc: "+itos(p_points.size()));
-
switch (p_what) {
case 0: { //gesture begin
diff --git a/platform/iphone/export/export.cpp b/platform/iphone/export/export.cpp
index 9754807f38..008e213e5e 100644
--- a/platform/iphone/export/export.cpp
+++ b/platform/iphone/export/export.cpp
@@ -739,7 +739,7 @@ Error EditorExportPlatformIOS::export_project(const Ref<EditorExportPreset> &p_p
String library_to_use = "libgodot.iphone." + String(p_debug ? "debug" : "release") + ".fat.a";
- print_line("static library: " + library_to_use);
+ print_line("Static library: " + library_to_use);
String pkg_name;
if (p_preset->get("application/name") != "")
pkg_name = p_preset->get("application/name"); // app_name
@@ -809,7 +809,6 @@ Error EditorExportPlatformIOS::export_project(const Ref<EditorExportPreset> &p_p
file = file.replace_first("iphone/", "");
if (files_to_parse.has(file)) {
- print_line(String("parse ") + file);
_fix_config_file(p_preset, data, config_data, p_debug);
} else if (file.begins_with("libgodot.iphone")) {
if (file != library_to_use) {
diff --git a/platform/osx/export/export.cpp b/platform/osx/export/export.cpp
index 57ca29bdd5..880705b507 100644
--- a/platform/osx/export/export.cpp
+++ b/platform/osx/export/export.cpp
@@ -380,7 +380,6 @@ Error EditorExportPlatformOSX::export_project(const Ref<EditorExportPreset> &p_p
String file = fname;
- print_line("READ: " + file);
Vector<uint8_t> data;
data.resize(info.uncompressed_size);
@@ -394,7 +393,6 @@ Error EditorExportPlatformOSX::export_project(const Ref<EditorExportPreset> &p_p
file = file.replace_first("osx_template.app/", "");
if (file == "Contents/Info.plist") {
- print_line("parse plist");
_fix_plist(p_preset, data, pkg_name);
}
@@ -415,13 +413,12 @@ Error EditorExportPlatformOSX::export_project(const Ref<EditorExportPreset> &p_p
iconpath = p_preset->get("application/icon");
else
iconpath = ProjectSettings::get_singleton()->get("application/config/icon");
- print_line("icon? " + iconpath);
+
if (iconpath != "") {
Ref<Image> icon;
icon.instance();
icon->load(iconpath);
if (!icon->empty()) {
- print_line("loaded?");
_make_icon(icon, data);
}
}
@@ -475,9 +472,7 @@ Error EditorExportPlatformOSX::export_project(const Ref<EditorExportPreset> &p_p
Z_DEFLATED,
Z_DEFAULT_COMPRESSION);
- print_line("OPEN ERR: " + itos(zerr));
zerr = zipWriteInFileInZip(dst_pkg_zip, data.ptr(), data.size());
- print_line("WRITE ERR: " + itos(zerr));
zipCloseFileInZip(dst_pkg_zip);
}
}
diff --git a/platform/windows/context_gl_win.cpp b/platform/windows/context_gl_win.cpp
index a158237418..59435b04ea 100644
--- a/platform/windows/context_gl_win.cpp
+++ b/platform/windows/context_gl_win.cpp
@@ -68,20 +68,6 @@ void ContextGL_Win::swap_buffers() {
SwapBuffers(hDC);
}
-/*
-static GLWrapperFuncPtr wrapper_get_proc_address(const char* p_function) {
-
- print_line(String()+"getting proc of: "+p_function);
- GLWrapperFuncPtr func=(GLWrapperFuncPtr)get_gl_proc_address(p_function);
- if (!func) {
- print_line("Couldn't find function: "+String(p_function));
- print_line("error: "+itos(GetLastError()));
- }
- return func;
-
-}
-*/
-
void ContextGL_Win::set_use_vsync(bool p_use) {
if (wglSwapIntervalEXT) {
diff --git a/platform/windows/joypad.cpp b/platform/windows/joypad.cpp
index 796531fe24..b56fb6509e 100644
--- a/platform/windows/joypad.cpp
+++ b/platform/windows/joypad.cpp
@@ -540,9 +540,7 @@ void JoypadWindows::load_xinput() {
}
if (!xinput_dll) {
- if (OS::get_singleton()->is_stdout_verbose()) {
- print_line("Could not find XInput, using DirectInput only");
- }
+ print_verbose("Could not find XInput, using DirectInput only");
return;
}
diff --git a/platform/windows/os_windows.cpp b/platform/windows/os_windows.cpp
index 56ac467dc6..b7b207dde1 100644
--- a/platform/windows/os_windows.cpp
+++ b/platform/windows/os_windows.cpp
@@ -449,7 +449,7 @@ LRESULT OS_Windows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
input->set_mouse_position(c);
mm->set_speed(Vector2(0, 0));
- if (raw->data.mouse.usFlags ==MOUSE_MOVE_RELATIVE) {
+ if (raw->data.mouse.usFlags == MOUSE_MOVE_RELATIVE) {
mm->set_relative(Vector2(raw->data.mouse.lLastX, raw->data.mouse.lLastY));
} else if (raw->data.mouse.usFlags == MOUSE_MOVE_ABSOLUTE) {
@@ -460,9 +460,8 @@ LRESULT OS_Windows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
int nScreenTop = GetSystemMetrics(SM_YVIRTUALSCREEN);
Vector2 abs_pos(
- (double(raw->data.mouse.lLastX) - 65536.0 / (nScreenWidth) ) * nScreenWidth / 65536.0 + nScreenLeft,
- (double(raw->data.mouse.lLastY) - 65536.0 / (nScreenHeight) ) * nScreenHeight / 65536.0 + nScreenTop
- );
+ (double(raw->data.mouse.lLastX) - 65536.0 / (nScreenWidth)) * nScreenWidth / 65536.0 + nScreenLeft,
+ (double(raw->data.mouse.lLastY) - 65536.0 / (nScreenHeight)) * nScreenHeight / 65536.0 + nScreenTop);
POINT coords; //client coords
coords.x = abs_pos.x;
@@ -470,15 +469,13 @@ LRESULT OS_Windows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
ScreenToClient(hWnd, &coords);
-
- mm->set_relative(Vector2(coords.x - old_x, coords.y - old_y ));
+ mm->set_relative(Vector2(coords.x - old_x, coords.y - old_y));
old_x = coords.x;
old_y = coords.y;
/*Input.mi.dx = (int)((((double)(pos.x)-nScreenLeft) * 65536) / nScreenWidth + 65536 / (nScreenWidth));
Input.mi.dy = (int)((((double)(pos.y)-nScreenTop) * 65536) / nScreenHeight + 65536 / (nScreenHeight));
*/
-
}
if (window_has_focus && main_loop)
@@ -856,14 +853,6 @@ LRESULT OS_Windows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
if (ke.uMsg == WM_SYSKEYUP)
ke.uMsg = WM_KEYUP;
- /*if (ke.uMsg==WM_KEYDOWN && alt_mem && uMsg!=WM_SYSKEYDOWN) {
- //altgr hack for intl keyboards, not sure how good it is
- //windows is weeeeird
- ke.mod_state.alt=false;
- ke.mod_state.control=false;
- print_line("")
- }*/
-
ke.wParam = wParam;
ke.lParam = lParam;
key_event_buffer[key_event_pos++] = ke;
@@ -871,7 +860,7 @@ LRESULT OS_Windows::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
} break;
case WM_INPUTLANGCHANGEREQUEST: {
- print_line("input lang change");
+ // FIXME: Do something?
} break;
case WM_TOUCH: {
@@ -1126,7 +1115,6 @@ Error OS_Windows::initialize(const VideoMode &p_desired, int p_video_driver, int
WNDCLASSEXW wc;
if (is_hidpi_allowed()) {
- print_line("hidpi aware?");
HMODULE Shcore = LoadLibraryW(L"Shcore.dll");
if (Shcore != NULL) {
@@ -1201,8 +1189,6 @@ Error OS_Windows::initialize(const VideoMode &p_desired, int p_video_driver, int
WindowRect.right = data.size.width;
WindowRect.bottom = data.size.height;
- print_line("wr right " + itos(WindowRect.right) + ", " + itos(WindowRect.bottom));
-
/* DEVMODE dmScreenSettings;
memset(&dmScreenSettings,0,sizeof(dmScreenSettings));
dmScreenSettings.dmSize=sizeof(dmScreenSettings);
@@ -1490,12 +1476,6 @@ void OS_Windows::finalize() {
if (user_proc) {
SetWindowLongPtr(hWnd, GWLP_WNDPROC, (LONG_PTR)user_proc);
};
-
- /*
- if (debugger_connection_console) {
- memdelete(debugger_connection_console);
- }
- */
}
void OS_Windows::finalize_core() {
@@ -1759,9 +1739,6 @@ void OS_Windows::set_window_fullscreen(bool p_enabled) {
if (pre_fs_valid) {
GetWindowRect(hWnd, &pre_fs_rect);
- //print_line("A: "+itos(pre_fs_rect.left)+","+itos(pre_fs_rect.top)+","+itos(pre_fs_rect.right-pre_fs_rect.left)+","+itos(pre_fs_rect.bottom-pre_fs_rect.top));
- //MapWindowPoints(hWnd, GetParent(hWnd), (LPPOINT) &pre_fs_rect, 2);
- //print_line("B: "+itos(pre_fs_rect.left)+","+itos(pre_fs_rect.top)+","+itos(pre_fs_rect.right-pre_fs_rect.left)+","+itos(pre_fs_rect.bottom-pre_fs_rect.top));
}
int cs = get_current_screen();
diff --git a/platform/x11/context_gl_x11.cpp b/platform/x11/context_gl_x11.cpp
index cd76667c64..5a239e326b 100644
--- a/platform/x11/context_gl_x11.cpp
+++ b/platform/x11/context_gl_x11.cpp
@@ -65,19 +65,6 @@ void ContextGL_X11::swap_buffers() {
glXSwapBuffers(x11_display, x11_window);
}
-/*
-static GLWrapperFuncPtr wrapper_get_proc_address(const char* p_function) {
-
- //print_line(String()+"getting proc of: "+p_function);
- GLWrapperFuncPtr func=(GLWrapperFuncPtr)glXGetProcAddress( (const GLubyte*) p_function);
- if (!func) {
- print_line("Couldn't find function: "+String(p_function));
- }
-
- return func;
-
-}*/
-
static bool ctxErrorOccurred = false;
static int ctxErrorHandler(Display *dpy, XErrorEvent *ev) {
ctxErrorOccurred = true;
diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp
index 733d2509f7..043902f48c 100644
--- a/platform/x11/os_x11.cpp
+++ b/platform/x11/os_x11.cpp
@@ -170,13 +170,13 @@ Error OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_a
#ifdef TOUCH_ENABLED
if (!XQueryExtension(x11_display, "XInputExtension", &touch.opcode, &event_base, &error_base)) {
- fprintf(stderr, "XInput extension not available");
+ print_verbose("XInput extension not available, touch support disabled.");
} else {
// 2.2 is the first release with multitouch
int xi_major = 2;
int xi_minor = 2;
if (XIQueryVersion(x11_display, &xi_major, &xi_minor) != Success) {
- fprintf(stderr, "XInput 2.2 not available (server supports %d.%d)\n", xi_major, xi_minor);
+ print_verbose(vformat("XInput 2.2 not available (server supports %d.%d), touch support disabled.", xi_major, xi_minor));
touch.opcode = 0;
} else {
int dev_count;
@@ -198,14 +198,14 @@ Error OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_a
}
if (direct_touch) {
touch.devices.push_back(dev->deviceid);
- fprintf(stderr, "Using touch device: %s\n", dev->name);
+ print_verbose("XInput: Using touch device: " + String(dev->name));
}
}
XIFreeDeviceInfo(info);
- if (is_stdout_verbose() && !touch.devices.size()) {
- fprintf(stderr, "No touch devices found\n");
+ if (!touch.devices.size()) {
+ print_verbose("XInput: No touch devices found.");
}
}
}
@@ -266,7 +266,6 @@ Error OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_a
*/
// maybe contextgl wants to be in charge of creating the window
-//print_line("def videomode "+itos(current_videomode.width)+","+itos(current_videomode.height));
#if defined(OPENGL_ENABLED)
ContextGL_X11::ContextType opengl_api_type = ContextGL_X11::GLES_3_0_COMPATIBLE;
@@ -427,9 +426,7 @@ Error OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_a
cursor_theme = XcursorGetTheme(x11_display);
if (!cursor_theme) {
- if (is_stdout_verbose()) {
- print_line("XcursorGetTheme could not get cursor theme");
- }
+ print_verbose("XcursorGetTheme could not get cursor theme");
cursor_theme = "default";
}
@@ -442,7 +439,6 @@ Error OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_a
current_cursor = CURSOR_ARROW;
if (cursor_theme) {
- //print_line("cursor theme: "+String(cursor_theme));
for (int i = 0; i < CURSOR_MAX; i++) {
static const char *cursor_file[] = {
@@ -468,10 +464,8 @@ Error OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_a
img[i] = XcursorLibraryLoadImage(cursor_file[i], cursor_theme, cursor_size);
if (img[i]) {
cursors[i] = XcursorImageLoadCursor(x11_display, img[i]);
- //print_line("found cursor: "+String(cursor_file[i])+" id "+itos(cursors[i]));
} else {
- if (OS::is_stdout_verbose())
- print_line("failed cursor: " + String(cursor_file[i]));
+ print_verbose("Failed loading custom cursor: " + String(cursor_file[i]));
}
}
}
@@ -1516,7 +1510,6 @@ void OS_X11::handle_key_event(XKeyEvent *p_event, bool p_echo) {
// KeyMappingX11 also translates keysym to unicode.
// It does a binary search on a table to translate
// most properly.
- //print_line("keysym_unicode: "+rtos(keysym_unicode));
unsigned int unicode = keysym_unicode > 0 ? KeyMappingX11::get_unicode_from_keysym(keysym_unicode) : 0;
/* Phase 4, determine if event must be filtered */
@@ -1539,7 +1532,7 @@ void OS_X11::handle_key_event(XKeyEvent *p_event, bool p_echo) {
// know Mod1 was ALT and Mod4 was META (applekey/winkey)
// just tried Mods until i found them.
- //print_line("mod1: "+itos(xkeyevent->state&Mod1Mask)+" mod 5: "+itos(xkeyevent->state&Mod5Mask));
+ //print_verbose("mod1: "+itos(xkeyevent->state&Mod1Mask)+" mod 5: "+itos(xkeyevent->state&Mod5Mask));
Ref<InputEventKey> k;
k.instance();