Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
godot
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
community
godot
Commits
de59fe04
Commit
de59fe04
authored
Aug 24, 2018
by
Rémi Verschelde
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add print_verbose to print to stdout only in verbose mode
Equivalent of the cumbersome: if (OS::get_singleton()->is_stdout_verbose()) print_line(msg);
parent
34e58fd8
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
68 additions
and
123 deletions
+68
-123
resource_loader.cpp
core/io/resource_loader.cpp
+4
-13
object.cpp
core/object.cpp
+3
-3
print_string.cpp
core/print_string.cpp
+7
-0
print_string.h
core/print_string.h
+1
-0
string_db.cpp
core/string_db.cpp
+2
-3
audio_driver_alsa.cpp
drivers/alsa/audio_driver_alsa.cpp
+1
-3
audio_driver_coreaudio.cpp
drivers/coreaudio/audio_driver_coreaudio.cpp
+2
-4
rasterizer_gles2.cpp
drivers/gles2/rasterizer_gles2.cpp
+1
-3
rasterizer_gles3.cpp
drivers/gles3/rasterizer_gles3.cpp
+3
-3
audio_driver_pulseaudio.cpp
drivers/pulseaudio/audio_driver_pulseaudio.cpp
+3
-7
audio_driver_rtaudio.cpp
drivers/rtaudio/audio_driver_rtaudio.cpp
+1
-4
file_access_unix.cpp
drivers/unix/file_access_unix.cpp
+1
-6
audio_driver_wasapi.cpp
drivers/wasapi/audio_driver_wasapi.cpp
+2
-4
editor_settings.cpp
editor/editor_settings.cpp
+3
-6
main.cpp
main/main.cpp
+2
-4
csharp_script.cpp
modules/mono/csharp_script.cpp
+1
-5
godotsharp_builds.cpp
modules/mono/editor/godotsharp_builds.cpp
+4
-4
gd_mono.cpp
modules/mono/mono_gd/gd_mono.cpp
+17
-29
gd_mono_log.cpp
modules/mono/mono_gd/gd_mono_log.cpp
+1
-2
audio_driver_jandroid.cpp
platform/android/audio_driver_jandroid.cpp
+1
-3
joypad.cpp
platform/windows/joypad.cpp
+1
-3
os_x11.cpp
platform/x11/os_x11.cpp
+7
-14
No files found.
core/io/resource_loader.cpp
View file @
de59fe04
...
...
@@ -204,8 +204,7 @@ RES ResourceLoader::load(const String &p_path, const String &p_type_hint, bool p
if
(
!
p_no_cache
&&
ResourceCache
::
has
(
local_path
))
{
if
(
OS
::
get_singleton
()
->
is_stdout_verbose
())
print_line
(
"load resource: "
+
local_path
+
" (cached)"
);
print_verbose
(
"Loading resource: "
+
local_path
+
" (cached)"
);
if
(
r_error
)
*
r_error
=
OK
;
return
RES
(
ResourceCache
::
get
(
local_path
));
...
...
@@ -216,9 +215,7 @@ RES ResourceLoader::load(const String &p_path, const String &p_type_hint, bool p
ERR_FAIL_COND_V
(
path
==
""
,
RES
());
if
(
OS
::
get_singleton
()
->
is_stdout_verbose
())
print_line
(
"load resource: "
+
path
);
print_verbose
(
"Loading resource: "
+
path
);
RES
res
=
_load
(
path
,
local_path
,
p_type_hint
,
p_no_cache
,
r_error
);
if
(
res
.
is_null
())
{
...
...
@@ -286,9 +283,7 @@ Ref<ResourceInteractiveLoader> ResourceLoader::load_interactive(const String &p_
if
(
!
p_no_cache
&&
ResourceCache
::
has
(
local_path
))
{
if
(
OS
::
get_singleton
()
->
is_stdout_verbose
())
print_line
(
"load resource: "
+
local_path
+
" (cached)"
);
print_verbose
(
"Loading resource: "
+
local_path
+
" (cached)"
);
Ref
<
Resource
>
res_cached
=
ResourceCache
::
get
(
local_path
);
Ref
<
ResourceInteractiveLoaderDefault
>
ril
=
Ref
<
ResourceInteractiveLoaderDefault
>
(
memnew
(
ResourceInteractiveLoaderDefault
));
...
...
@@ -298,14 +293,10 @@ Ref<ResourceInteractiveLoader> ResourceLoader::load_interactive(const String &p_
bool
xl_remapped
=
false
;
String
path
=
_path_remap
(
local_path
,
&
xl_remapped
);
ERR_FAIL_COND_V
(
path
==
""
,
Ref
<
ResourceInteractiveLoader
>
());
if
(
OS
::
get_singleton
()
->
is_stdout_verbose
())
print_line
(
"load resource: "
);
print_verbose
(
"Loading resource: "
+
path
);
bool
found
=
false
;
for
(
int
i
=
0
;
i
<
loader_count
;
i
++
)
{
if
(
!
loader
[
i
]
->
recognize_path
(
path
,
p_type_hint
))
...
...
core/object.cpp
View file @
de59fe04
...
...
@@ -2080,10 +2080,10 @@ void ObjectDB::cleanup() {
String
node_name
;
if
(
instances
[
*
K
]
->
is_class
(
"Node"
))
node_name
=
" - Node
N
ame: "
+
String
(
instances
[
*
K
]
->
call
(
"get_name"
));
node_name
=
" - Node
n
ame: "
+
String
(
instances
[
*
K
]
->
call
(
"get_name"
));
if
(
instances
[
*
K
]
->
is_class
(
"Resource"
))
node_name
=
" - Resource
N
ame: "
+
String
(
instances
[
*
K
]
->
call
(
"get_name"
))
+
" Path: "
+
String
(
instances
[
*
K
]
->
call
(
"get_path"
));
print_line
(
"Leaked
I
nstance: "
+
String
(
instances
[
*
K
]
->
get_class
())
+
":"
+
itos
(
*
K
)
+
node_name
);
node_name
=
" - Resource
n
ame: "
+
String
(
instances
[
*
K
]
->
call
(
"get_name"
))
+
" Path: "
+
String
(
instances
[
*
K
]
->
call
(
"get_path"
));
print_line
(
"Leaked
i
nstance: "
+
String
(
instances
[
*
K
]
->
get_class
())
+
":"
+
itos
(
*
K
)
+
node_name
);
}
}
}
...
...
core/print_string.cpp
View file @
de59fe04
...
...
@@ -107,3 +107,10 @@ void print_error(String p_string) {
_global_unlock
();
}
void
print_verbose
(
String
p_string
)
{
if
(
OS
::
get_singleton
()
->
is_stdout_verbose
())
{
print_line
(
p_string
);
}
}
core/print_string.h
View file @
de59fe04
...
...
@@ -58,5 +58,6 @@ extern bool _print_line_enabled;
extern
bool
_print_error_enabled
;
extern
void
print_line
(
String
p_string
);
extern
void
print_error
(
String
p_string
);
extern
void
print_verbose
(
String
p_string
);
#endif
core/string_db.cpp
View file @
de59fe04
...
...
@@ -73,7 +73,6 @@ void StringName::cleanup() {
_Data
*
d
=
_table
[
i
];
lost_strings
++
;
if
(
OS
::
get_singleton
()
->
is_stdout_verbose
())
{
if
(
d
->
cname
)
{
print_line
(
"Orphan StringName: "
+
String
(
d
->
cname
));
}
else
{
...
...
@@ -85,8 +84,8 @@ void StringName::cleanup() {
memdelete
(
d
);
}
}
if
(
OS
::
get_singleton
()
->
is_stdout_verbose
()
&&
lost_strings
)
{
print_
lin
e
(
"StringName: "
+
itos
(
lost_strings
)
+
" unclaimed string names at exit."
);
if
(
lost_strings
)
{
print_
verbos
e
(
"StringName: "
+
itos
(
lost_strings
)
+
" unclaimed string names at exit."
);
}
lock
->
unlock
();
...
...
drivers/alsa/audio_driver_alsa.cpp
View file @
de59fe04
...
...
@@ -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
);
...
...
drivers/coreaudio/audio_driver_coreaudio.cpp
View file @
de59fe04
...
...
@@ -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
));
...
...
drivers/gles2/rasterizer_gles2.cpp
View file @
de59fe04
...
...
@@ -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
())
{
...
...
drivers/gles3/rasterizer_gles3.cpp
View file @
de59fe04
...
...
@@ -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
())
{
...
...
drivers/pulseaudio/audio_driver_pulseaudio.cpp
View file @
de59fe04
...
...
@@ -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
;
...
...
drivers/rtaudio/audio_driver_rtaudio.cpp
View file @
de59fe04
...
...
@@ -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
;
...
...
drivers/unix/file_access_unix.cpp
View file @
de59fe04
...
...
@@ -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
);
};
}
...
...
drivers/wasapi/audio_driver_wasapi.cpp
View file @
de59fe04
...
...
@@ -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
;
}
...
...
editor/editor_settings.cpp
View file @
de59fe04
...
...
@@ -853,10 +853,7 @@ void EditorSettings::create() {
singleton
->
data_dir
=
data_dir
;
singleton
->
cache_dir
=
cache_dir
;
if
(
OS
::
get_singleton
()
->
is_stdout_verbose
())
{
print_line
(
"EditorSettings: Load OK!"
);
}
print_verbose
(
"EditorSettings: Load OK!"
);
singleton
->
setup_language
();
singleton
->
setup_network
();
...
...
@@ -968,8 +965,8 @@ void EditorSettings::save() {
if
(
err
!=
OK
)
{
ERR_PRINTS
(
"Error saving editor settings to "
+
singleton
->
config_file_path
);
}
else
if
(
OS
::
get_singleton
()
->
is_stdout_verbose
())
{
print_
line
(
"EditorSettings
Save OK!"
);
}
else
{
print_
verbose
(
"EditorSettings:
Save OK!"
);
}
}
...
...
main/main.cpp
View file @
de59fe04
...
...
@@ -1214,10 +1214,8 @@ Error Main::setup2(Thread::ID p_main_tid_override) {
ClassDB
::
set_current_api
(
ClassDB
::
API_NONE
);
//no more api is registered at this point
if
(
OS
::
get_singleton
()
->
is_stdout_verbose
())
{
print_line
(
"CORE API HASH: "
+
itos
(
ClassDB
::
get_api_hash
(
ClassDB
::
API_CORE
)));
print_line
(
"EDITOR API HASH: "
+
itos
(
ClassDB
::
get_api_hash
(
ClassDB
::
API_EDITOR
)));
}
print_verbose
(
"CORE API HASH: "
+
itos
(
ClassDB
::
get_api_hash
(
ClassDB
::
API_CORE
)));
print_verbose
(
"EDITOR API HASH: "
+
itos
(
ClassDB
::
get_api_hash
(
ClassDB
::
API_EDITOR
)));
MAIN_PRINT
(
"Main: Done"
);
return
OK
;
...
...
modules/mono/csharp_script.cpp
View file @
de59fe04
...
...
@@ -2118,11 +2118,7 @@ Error CSharpScript::reload(bool p_keep_state) {
if
(
script_class
)
{
#ifdef DEBUG_ENABLED
if
(
OS
::
get_singleton
()
->
is_stdout_verbose
())
{
OS
::
get_singleton
()
->
print
(
String
(
"Found class "
+
script_class
->
get_namespace
()
+
"."
+
script_class
->
get_name
()
+
" for script "
+
get_path
()
+
"
\n
"
)
.
utf8
());
}
print_verbose
(
"Found class "
+
script_class
->
get_namespace
()
+
"."
+
script_class
->
get_name
()
+
" for script "
+
get_path
());
#endif
tool
=
script_class
->
has_attribute
(
CACHED_CLASS
(
ToolAttribute
));
...
...
modules/mono/editor/godotsharp_builds.cpp
View file @
de59fe04
...
...
@@ -97,8 +97,7 @@ MonoString *godot_icall_BuildInstance_get_MSBuildPath() {
return
GDMonoMarshal
::
mono_string_from_godot
(
msbuild_tools_path
+
"MSBuild.exe"
);
}
if
(
OS
::
get_singleton
()
->
is_stdout_verbose
())
OS
::
get_singleton
()
->
print
(
"Cannot find executable for '"
PROP_NAME_MSBUILD_VS
"'. Trying with '"
PROP_NAME_MSBUILD_MONO
"'...
\n
"
);
print_verbose
(
"Cannot find executable for '"
PROP_NAME_MSBUILD_VS
"'. Trying with '"
PROP_NAME_MSBUILD_MONO
"'..."
);
}
// FALL THROUGH
case
GodotSharpBuilds
:
:
MSBUILD_MONO
:
{
String
msbuild_path
=
GDMono
::
get_singleton
()
->
get_mono_reg_info
().
bin_dir
.
plus_file
(
"msbuild.bat"
);
...
...
@@ -556,8 +555,9 @@ void GodotSharpBuilds::BuildProcess::start(bool p_blocking) {
exited
=
true
;
exit_code
=
klass
->
get_field
(
"exitCode"
)
->
get_int_value
(
mono_object
);
if
(
exit_code
!=
0
&&
OS
::
get_singleton
()
->
is_stdout_verbose
())
OS
::
get_singleton
()
->
print
(
String
(
"MSBuild finished with exit code "
+
itos
(
exit_code
)
+
"
\n
"
).
utf8
());
if
(
exit_code
!=
0
)
{
print_verbose
(
"MSBuild finished with exit code "
+
itos
(
exit_code
));
}
build_tab
->
on_build_exit
(
exit_code
==
0
?
MonoBuildTab
::
RESULT_SUCCESS
:
MonoBuildTab
::
RESULT_ERROR
);
}
else
{
...
...
modules/mono/mono_gd/gd_mono.cpp
View file @
de59fe04
...
...
@@ -148,7 +148,7 @@ void GDMono::initialize() {
ERR_FAIL_NULL
(
Engine
::
get_singleton
());
OS
::
get_singleton
()
->
print
(
"Mono: Initializing module...
\n
"
);
print_verbose
(
"Mono: Initializing module...
"
);
#ifdef DEBUG_METHODS_ENABLED
_initialize_and_check_api_hashes
();
...
...
@@ -202,7 +202,7 @@ void GDMono::initialize() {
runtime_initialized
=
true
;
OS
::
get_singleton
()
->
print
(
"Mono: Runtime initialized
\n
"
);
print_verbose
(
"Mono: Runtime initialized
"
);
// mscorlib assembly MUST be present at initialization
ERR_EXPLAIN
(
"Mono: Failed to load mscorlib assembly"
);
...
...
@@ -226,7 +226,7 @@ void GDMono::initialize() {
#ifdef DEBUG_ENABLED
bool
debugger_attached
=
_wait_for_debugger_msecs
(
500
);
if
(
!
debugger_attached
&&
OS
::
get_singleton
()
->
is_stdout_verbose
())
OS
::
get_singleton
()
->
printerr
(
"Mono: Debugger wait timeout
\n
"
);
print_error
(
"Mono: Debugger wait timeout
"
);
#endif
_register_internal_calls
();
...
...
@@ -256,7 +256,7 @@ void GDMono::initialize() {
metadata_set_api_assembly_invalidated
(
APIAssembly
::
API_EDITOR
,
true
);
}
OS
::
get_singleton
()
->
print
(
"Mono: Proceeding to unload scripts domain because of invalid API assemblies
\n
"
);
print_line
(
"Mono: Proceeding to unload scripts domain because of invalid API assemblies.
"
);
Error
err
=
_unload_scripts_domain
();
if
(
err
!=
OK
)
{
...
...
@@ -269,11 +269,10 @@ void GDMono::initialize() {
}
}
#else
if
(
OS
::
get_singleton
()
->
is_stdout_verbose
())
OS
::
get_singleton
()
->
print
(
"Mono: Glue disabled, ignoring script assemblies
\n
"
);
print_verbose
(
"Mono: Glue disabled, ignoring script assemblies."
);
#endif
OS
::
get_singleton
()
->
print
(
"Mono: INITIALIZED
\n
"
);
print_verbose
(
"Mono: INITIALIZED
"
);
}
#ifndef MONO_GLUE_DISABLED
...
...
@@ -352,8 +351,7 @@ bool GDMono::load_assembly(const String &p_name, MonoAssemblyName *p_aname, GDMo
CRASH_COND
(
!
r_assembly
);
if
(
OS
::
get_singleton
()
->
is_stdout_verbose
())
OS
::
get_singleton
()
->
print
((
String
()
+
"Mono: Loading assembly "
+
p_name
+
(
p_refonly
?
" (refonly)"
:
""
)
+
"...
\n
"
).
utf8
());
print_verbose
(
"Mono: Loading assembly "
+
p_name
+
(
p_refonly
?
" (refonly)"
:
""
)
+
"..."
);
MonoImageOpenStatus
status
=
MONO_IMAGE_OK
;
MonoAssembly
*
assembly
=
mono_assembly_load_full
(
p_aname
,
NULL
,
&
status
,
p_refonly
);
...
...
@@ -372,8 +370,7 @@ bool GDMono::load_assembly(const String &p_name, MonoAssemblyName *p_aname, GDMo
*
r_assembly
=
*
stored_assembly
;
if
(
OS
::
get_singleton
()
->
is_stdout_verbose
())
OS
::
get_singleton
()
->
print
(
String
(
"Mono: Assembly "
+
p_name
+
(
p_refonly
?
" (refonly)"
:
""
)
+
" loaded from path: "
+
(
*
r_assembly
)
->
get_path
()
+
"
\n
"
).
utf8
());
print_verbose
(
"Mono: Assembly "
+
p_name
+
(
p_refonly
?
" (refonly)"
:
""
)
+
" loaded from path: "
+
(
*
r_assembly
)
->
get_path
());
return
true
;
}
...
...
@@ -500,7 +497,7 @@ bool GDMono::_load_project_assembly() {
mono_assembly_set_main
(
project_assembly
->
get_assembly
());
}
else
{
if
(
OS
::
get_singleton
()
->
is_stdout_verbose
())
OS
::
get_singleton
()
->
printerr
(
"Mono: Failed to load project assembly
\n
"
);
print_error
(
"Mono: Failed to load project assembly
"
);
}
return
success
;
...
...
@@ -510,13 +507,13 @@ bool GDMono::_load_api_assemblies() {
if
(
!
_load_core_api_assembly
())
{
if
(
OS
::
get_singleton
()
->
is_stdout_verbose
())
OS
::
get_singleton
()
->
printerr
(
"Mono: Failed to load Core API assembly
\n
"
);
print_error
(
"Mono: Failed to load Core API assembly
"
);
return
false
;
}
else
{
#ifdef TOOLS_ENABLED
if
(
!
_load_editor_api_assembly
())
{
if
(
OS
::
get_singleton
()
->
is_stdout_verbose
())
OS
::
get_singleton
()
->
printerr
(
"Mono: Failed to load Editor API assembly
\n
"
);
print_error
(
"Mono: Failed to load Editor API assembly
"
);
return
false
;
}
#endif
...
...
@@ -593,9 +590,7 @@ Error GDMono::_load_scripts_domain() {
ERR_FAIL_COND_V
(
scripts_domain
!=
NULL
,
ERR_BUG
);
if
(
OS
::
get_singleton
()
->
is_stdout_verbose
())
{
OS
::
get_singleton
()
->
print
(
"Mono: Loading scripts domain...
\n
"
);
}
print_verbose
(
"Mono: Loading scripts domain..."
);
scripts_domain
=
GDMonoUtils
::
create_domain
(
"GodotEngine.ScriptsDomain"
);
...
...
@@ -611,9 +606,7 @@ Error GDMono::_unload_scripts_domain() {
ERR_FAIL_NULL_V
(
scripts_domain
,
ERR_BUG
);
if
(
OS
::
get_singleton
()
->
is_stdout_verbose
())
{
OS
::
get_singleton
()
->
print
(
"Mono: Unloading scripts domain...
\n
"
);
}
print_verbose
(
"Mono: Unloading scripts domain..."
);
_GodotSharp
::
get_singleton
()
->
_dispose_callback
();
...
...
@@ -661,9 +654,7 @@ Error GDMono::_load_tools_domain() {
ERR_FAIL_COND_V
(
tools_domain
!=
NULL
,
ERR_BUG
);
if
(
OS
::
get_singleton
()
->
is_stdout_verbose
())
{
OS
::
get_singleton
()
->
print
(
"Mono: Loading tools domain...
\n
"
);
}
print_verbose
(
"Mono: Loading tools domain..."
);
tools_domain
=
GDMonoUtils
::
create_domain
(
"GodotEngine.ToolsDomain"
);
...
...
@@ -728,8 +719,7 @@ Error GDMono::reload_scripts_domain() {
if
(
!
_load_project_assembly
())
return
ERR_CANT_OPEN
;
#else
if
(
OS
::
get_singleton
()
->
is_stdout_verbose
())
OS
::
get_singleton
()
->
print
(
"Mono: Glue disabled, ignoring script assemblies
\n
"
);
print_verbose
(
"Mono: Glue disabled, ignoring script assemblies."
);
#endif
return
OK
;
...
...
@@ -742,9 +732,7 @@ Error GDMono::finalize_and_unload_domain(MonoDomain *p_domain) {
String
domain_name
=
mono_domain_get_friendly_name
(
p_domain
);
if
(
OS
::
get_singleton
()
->
is_stdout_verbose
())
{
OS
::
get_singleton
()
->
print
(
String
(
"Mono: Unloading domain `"
+
domain_name
+
"`...
\n
"
).
utf8
());
}
print_verbose
(
"Mono: Unloading domain `"
+
domain_name
+
"`..."
);
if
(
mono_domain_get
()
!=
root_domain
)
mono_domain_set
(
root_domain
,
true
);
...
...
@@ -877,7 +865,7 @@ GDMono::~GDMono() {
GDMonoUtils
::
clear_cache
();
OS
::
get_singleton
()
->
print
(
"Mono: Runtime cleanup...
\n
"
);
print_verbose
(
"Mono: Runtime cleanup...
"
);
runtime_initialized
=
false
;
mono_jit_cleanup
(
root_domain
);
...
...
modules/mono/mono_gd/gd_mono_log.cpp
View file @
de59fe04
...
...
@@ -152,8 +152,7 @@ void GDMonoLog::initialize() {
log_level_id
=
log_level_get_id
(
log_level
);
if
(
log_file
)
{
if
(
OS
::
get_singleton
()
->
is_stdout_verbose
())
OS
::
get_singleton
()
->
print
(
String
(
"Mono: Logfile is "
+
log_file_path
+
"
\n
"
).
utf8
());
print_verbose
(
"Mono: Logfile is "
+
log_file_path
);
mono_trace_set_log_handler
(
gdmono_MonoLogCallback
,
this
);
}
else
{
OS
::
get_singleton
()
->
printerr
(
"Mono: No log file, using default log handler
\n
"
);
...
...
platform/android/audio_driver_jandroid.cpp
View file @
de59fe04
...
...
@@ -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
);
...
...
platform/windows/joypad.cpp
View file @
de59fe04
...
...
@@ -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
;
}
...
...
platform/x11/os_x11.cpp
View file @
de59fe04
...
...
@@ -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 */
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment