summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/bind/core_bind.cpp7
-rw-r--r--core/bind/core_bind.h2
-rw-r--r--core/engine.h3
-rw-r--r--doc/base/classes.xml7
-rw-r--r--drivers/gles3/rasterizer_scene_gles3.cpp38
-rw-r--r--drivers/gles3/rasterizer_scene_gles3.h4
-rw-r--r--drivers/gles3/rasterizer_storage_gles3.cpp10
-rw-r--r--drivers/gles3/rasterizer_storage_gles3.h2
-rw-r--r--editor/editor_export.cpp36
-rw-r--r--editor/editor_node.cpp51
-rw-r--r--editor/editor_run.cpp38
-rw-r--r--editor/plugins/cube_grid_theme_editor_plugin.cpp1
-rw-r--r--editor/plugins/sample_editor_plugin.cpp4
-rw-r--r--editor/plugins/tile_set_editor_plugin.cpp1
-rw-r--r--editor/project_manager.cpp8
-rw-r--r--editor/property_editor.cpp6
-rw-r--r--editor/run_settings_dialog.cpp2
-rw-r--r--editor/scene_tree_editor.cpp6
-rw-r--r--main/main.cpp340
-rw-r--r--modules/gridmap/grid_map_editor_plugin.cpp2
-rw-r--r--modules/visual_script/visual_script_editor.cpp1
-rw-r--r--platform/android/export/export.cpp28
-rw-r--r--platform/android/godot_android.cpp1
-rw-r--r--platform/android/java/src/org/godotengine/godot/Godot.java12
-rw-r--r--platform/android/java_glue.cpp4
-rw-r--r--platform/iphone/view_controller.mm2
-rw-r--r--platform/uwp/app.cpp2
-rw-r--r--platform/uwp/export/export.cpp2
-rw-r--r--scene/3d/light.cpp16
-rw-r--r--scene/3d/light.h4
-rw-r--r--scene/3d/visual_instance.cpp19
-rw-r--r--scene/3d/visual_instance.h1
-rw-r--r--scene/gui/popup.cpp7
-rw-r--r--servers/visual/rasterizer.h1
-rw-r--r--servers/visual/visual_server_raster.h1
-rw-r--r--servers/visual/visual_server_scene.cpp16
-rw-r--r--servers/visual/visual_server_wrap_mt.h1
-rw-r--r--servers/visual_server.h2
38 files changed, 418 insertions, 270 deletions
diff --git a/core/bind/core_bind.cpp b/core/bind/core_bind.cpp
index a3812e41b7..273ef78669 100644
--- a/core/bind/core_bind.cpp
+++ b/core/bind/core_bind.cpp
@@ -2534,6 +2534,11 @@ float _Engine::get_frames_per_second() const {
return Engine::get_singleton()->get_frames_per_second();
}
+String _Engine::get_custom_level() const {
+
+ return Engine::get_singleton()->get_custom_level();
+}
+
void _Engine::set_time_scale(float p_scale) {
Engine::get_singleton()->set_time_scale(p_scale);
}
@@ -2573,6 +2578,8 @@ void _Engine::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_time_scale", "time_scale"), &_Engine::set_time_scale);
ClassDB::bind_method(D_METHOD("get_time_scale"), &_Engine::get_time_scale);
+ ClassDB::bind_method(D_METHOD("get_custom_level"), &_Engine::get_custom_level);
+
ClassDB::bind_method(D_METHOD("get_frames_drawn"), &_Engine::get_frames_drawn);
ClassDB::bind_method(D_METHOD("get_frames_per_second"), &_Engine::get_frames_per_second);
diff --git a/core/bind/core_bind.h b/core/bind/core_bind.h
index 45416f5fd8..61c80aaba3 100644
--- a/core/bind/core_bind.h
+++ b/core/bind/core_bind.h
@@ -639,6 +639,8 @@ public:
void set_time_scale(float p_scale);
float get_time_scale();
+ String get_custom_level() const;
+
MainLoop *get_main_loop() const;
Dictionary get_version_info() const;
diff --git a/core/engine.h b/core/engine.h
index fc3e151540..16dfb77593 100644
--- a/core/engine.h
+++ b/core/engine.h
@@ -39,6 +39,7 @@ class Engine {
friend class Main;
+ String _custom_level;
uint64_t frames_drawn;
uint32_t _frame_delay;
uint64_t _frame_ticks;
@@ -66,6 +67,8 @@ public:
virtual float get_frames_per_second() const { return _fps; }
+ String get_custom_level() const { return _custom_level; }
+
uint64_t get_frames_drawn();
uint64_t get_fixed_frames() const { return _fixed_frames; }
diff --git a/doc/base/classes.xml b/doc/base/classes.xml
index 2912a3f0a4..f21fa2c7c0 100644
--- a/doc/base/classes.xml
+++ b/doc/base/classes.xml
@@ -14960,6 +14960,13 @@
<description>
</description>
<methods>
+ <method name="get_custom_level" qualifiers="const">
+ <return type="String">
+ </return>
+ <description>
+ Returns the value of the commandline argument "-level".
+ </description>
+ </method>
<method name="get_frames_drawn">
<return type="int">
</return>
diff --git a/drivers/gles3/rasterizer_scene_gles3.cpp b/drivers/gles3/rasterizer_scene_gles3.cpp
index ac6ca1ec0c..6e8303563f 100644
--- a/drivers/gles3/rasterizer_scene_gles3.cpp
+++ b/drivers/gles3/rasterizer_scene_gles3.cpp
@@ -1088,11 +1088,12 @@ void RasterizerSceneGLES3::gi_probe_instance_set_bounds(RID p_probe, const Vecto
bool RasterizerSceneGLES3::_setup_material(RasterizerStorageGLES3::Material *p_material, bool p_alpha_pass) {
+ /* this is handled outside
if (p_material->shader->spatial.cull_mode == RasterizerStorageGLES3::Shader::Spatial::CULL_MODE_DISABLED) {
glDisable(GL_CULL_FACE);
} else {
glEnable(GL_CULL_FACE);
- }
+ } */
if (state.current_line_width != p_material->line_width) {
//glLineWidth(MAX(p_material->line_width,1.0));
@@ -1857,12 +1858,21 @@ void RasterizerSceneGLES3::_setup_light(RenderList::Element *e, const Transform
}
}
-void RasterizerSceneGLES3::_set_cull(bool p_front, bool p_reverse_cull) {
+void RasterizerSceneGLES3::_set_cull(bool p_front, bool p_disabled, bool p_reverse_cull) {
bool front = p_front;
if (p_reverse_cull)
front = !front;
+ if (p_disabled != state.cull_disabled) {
+ if (p_disabled)
+ glDisable(GL_CULL_FACE);
+ else
+ glEnable(GL_CULL_FACE);
+
+ state.cull_disabled = p_disabled;
+ }
+
if (front != state.cull_front) {
glCullFace(front ? GL_FRONT : GL_BACK);
@@ -1900,7 +1910,9 @@ void RasterizerSceneGLES3::_render_list(RenderList::Element **p_elements, int p_
}
state.cull_front = false;
+ state.cull_disabled = false;
glCullFace(GL_BACK);
+ glEnable(GL_CULL_FACE);
state.current_depth_test = true;
glEnable(GL_DEPTH_TEST);
@@ -2101,7 +2113,7 @@ void RasterizerSceneGLES3::_render_list(RenderList::Element **p_elements, int p_
storage->info.render.surface_switch_count++;
}
- _set_cull(e->sort_key & RenderList::SORT_KEY_MIRROR_FLAG, p_reverse_cull);
+ _set_cull(e->sort_key & RenderList::SORT_KEY_MIRROR_FLAG, e->sort_key & RenderList::SORT_KEY_CULL_DISABLED_FLAG, p_reverse_cull);
state.scene_shader.set_uniform(SceneShaderGLES3::NORMAL_MULT, e->instance->mirror ? -1.0 : 1.0);
state.scene_shader.set_uniform(SceneShaderGLES3::WORLD_TRANSFORM, e->instance->transform);
@@ -2188,8 +2200,12 @@ void RasterizerSceneGLES3::_add_geometry_with_material(RasterizerStorageGLES3::G
bool shadow = false;
bool mirror = p_instance->mirror;
+ bool no_cull = false;
- if (p_material->shader->spatial.cull_mode == RasterizerStorageGLES3::Shader::Spatial::CULL_MODE_FRONT) {
+ if (p_material->shader->spatial.cull_mode == RasterizerStorageGLES3::Shader::Spatial::CULL_MODE_DISABLED) {
+ no_cull = true;
+ mirror = false;
+ } else if (p_material->shader->spatial.cull_mode == RasterizerStorageGLES3::Shader::Spatial::CULL_MODE_FRONT) {
mirror = !mirror;
}
@@ -2208,10 +2224,13 @@ void RasterizerSceneGLES3::_add_geometry_with_material(RasterizerStorageGLES3::G
if (!p_material->shader->spatial.uses_alpha_scissor && !p_material->shader->spatial.writes_modelview_or_projection && !p_material->shader->spatial.uses_vertex && !p_material->shader->spatial.uses_discard && p_material->shader->spatial.depth_draw_mode != RasterizerStorageGLES3::Shader::Spatial::DEPTH_DRAW_ALPHA_PREPASS) {
//shader does not use discard and does not write a vertex position, use generic material
- if (p_instance->cast_shadows == VS::SHADOW_CASTING_SETTING_DOUBLE_SIDED)
+ if (p_instance->cast_shadows == VS::SHADOW_CASTING_SETTING_DOUBLE_SIDED) {
p_material = storage->material_owner.getptr(default_material_twosided);
- else
+ no_cull = true;
+ mirror = false;
+ } else {
p_material = storage->material_owner.getptr(default_material);
+ }
}
has_alpha = false;
@@ -2275,6 +2294,10 @@ void RasterizerSceneGLES3::_add_geometry_with_material(RasterizerStorageGLES3::G
e->sort_key |= RenderList::SORT_KEY_MIRROR_FLAG;
}
+ if (no_cull) {
+ e->sort_key |= RenderList::SORT_KEY_CULL_DISABLED_FLAG;
+ }
+
//e->light_type=0xFF; // no lights!
if (shadow || p_material->shader->spatial.unshaded || state.debug_draw == VS::VIEWPORT_DEBUG_DRAW_UNSHADED) {
@@ -4535,6 +4558,9 @@ void RasterizerSceneGLES3::render_shadow(RID p_light, RID p_shadow_atlas, int p_
state.scene_shader.set_conditional(SceneShaderGLES3::RENDER_DEPTH, true);
+ if (light->reverse_cull) {
+ flip_facing = !flip_facing;
+ }
_render_list(render_list.elements, render_list.element_count, light_transform, light_projection, 0, flip_facing, false, true, false, false);
state.scene_shader.set_conditional(SceneShaderGLES3::RENDER_DEPTH, false);
diff --git a/drivers/gles3/rasterizer_scene_gles3.h b/drivers/gles3/rasterizer_scene_gles3.h
index e1d96f23dd..740d277a3a 100644
--- a/drivers/gles3/rasterizer_scene_gles3.h
+++ b/drivers/gles3/rasterizer_scene_gles3.h
@@ -187,6 +187,7 @@ public:
int reflection_probe_count;
bool cull_front;
+ bool cull_disabled;
bool used_sss;
bool used_screen_texture;
bool using_contact_shadows;
@@ -654,6 +655,7 @@ public:
SORT_KEY_MATERIAL_INDEX_SHIFT = 40,
SORT_KEY_GEOMETRY_INDEX_SHIFT = 20,
SORT_KEY_GEOMETRY_TYPE_SHIFT = 15,
+ SORT_KEY_CULL_DISABLED_FLAG = 4,
SORT_KEY_SKELETON_FLAG = 2,
SORT_KEY_MIRROR_FLAG = 1
@@ -779,7 +781,7 @@ public:
RenderList render_list;
- _FORCE_INLINE_ void _set_cull(bool p_front, bool p_reverse_cull);
+ _FORCE_INLINE_ void _set_cull(bool p_front, bool p_disabled, bool p_reverse_cull);
_FORCE_INLINE_ bool _setup_material(RasterizerStorageGLES3::Material *p_material, bool p_alpha_pass);
_FORCE_INLINE_ void _setup_geometry(RenderList::Element *e, const Transform &p_view_transform);
diff --git a/drivers/gles3/rasterizer_storage_gles3.cpp b/drivers/gles3/rasterizer_storage_gles3.cpp
index 8dd083fbe8..11d5bcb207 100644
--- a/drivers/gles3/rasterizer_storage_gles3.cpp
+++ b/drivers/gles3/rasterizer_storage_gles3.cpp
@@ -4451,7 +4451,7 @@ RID RasterizerStorageGLES3::light_create(VS::LightType p_type) {
light->omni_shadow_mode = VS::LIGHT_OMNI_SHADOW_DUAL_PARABOLOID;
light->omni_shadow_detail = VS::LIGHT_OMNI_SHADOW_DETAIL_VERTICAL;
light->directional_blend_splits = false;
-
+ light->reverse_cull = false;
light->version = 0;
return light_owner.make_rid(light);
@@ -4530,6 +4530,14 @@ void RasterizerStorageGLES3::light_set_cull_mask(RID p_light, uint32_t p_mask) {
light->instance_change_notify();
}
+void RasterizerStorageGLES3::light_set_reverse_cull_face_mode(RID p_light, bool p_enabled) {
+
+ Light *light = light_owner.getornull(p_light);
+ ERR_FAIL_COND(!light);
+
+ light->reverse_cull = p_enabled;
+}
+
void RasterizerStorageGLES3::light_omni_set_shadow_mode(RID p_light, VS::LightOmniShadowMode p_mode) {
Light *light = light_owner.getornull(p_light);
diff --git a/drivers/gles3/rasterizer_storage_gles3.h b/drivers/gles3/rasterizer_storage_gles3.h
index 3c7ea000ba..f612d9e879 100644
--- a/drivers/gles3/rasterizer_storage_gles3.h
+++ b/drivers/gles3/rasterizer_storage_gles3.h
@@ -868,6 +868,7 @@ public:
RID projector;
bool shadow;
bool negative;
+ bool reverse_cull;
uint32_t cull_mask;
VS::LightOmniShadowMode omni_shadow_mode;
VS::LightOmniShadowDetail omni_shadow_detail;
@@ -887,6 +888,7 @@ public:
virtual void light_set_projector(RID p_light, RID p_texture);
virtual void light_set_negative(RID p_light, bool p_enable);
virtual void light_set_cull_mask(RID p_light, uint32_t p_mask);
+ virtual void light_set_reverse_cull_face_mode(RID p_light, bool p_enabled);
virtual void light_omni_set_shadow_mode(RID p_light, VS::LightOmniShadowMode p_mode);
virtual void light_omni_set_shadow_detail(RID p_light, VS::LightOmniShadowDetail p_detail);
diff --git a/editor/editor_export.cpp b/editor/editor_export.cpp
index d8d3554612..fe1dfa281c 100644
--- a/editor/editor_export.cpp
+++ b/editor/editor_export.cpp
@@ -229,17 +229,17 @@ void EditorExportPlatform::gen_debug_flags(Vector<String> &r_flags, int p_flags)
if (p_flags & DEBUG_FLAG_DUMB_CLIENT) {
int port = EditorSettings::get_singleton()->get("filesystem/file_server/port");
String passwd = EditorSettings::get_singleton()->get("filesystem/file_server/password");
- r_flags.push_back("--remote-fs");
+ r_flags.push_back("-rfs");
r_flags.push_back(host + ":" + itos(port));
if (passwd != "") {
- r_flags.push_back("--remote-fs-password");
+ r_flags.push_back("-rfs_pass");
r_flags.push_back(passwd);
}
}
if (p_flags & DEBUG_FLAG_REMOTE_DEBUG) {
- r_flags.push_back("--remote-debug");
+ r_flags.push_back("-rdebug");
r_flags.push_back(host + ":" + String::num(remote_port));
@@ -248,7 +248,7 @@ void EditorExportPlatform::gen_debug_flags(Vector<String> &r_flags, int p_flags)
if (breakpoints.size()) {
- r_flags.push_back("--breakpoints");
+ r_flags.push_back("-bp");
String bpoints;
for (const List<String>::Element *E = breakpoints.front(); E; E = E->next()) {
@@ -263,12 +263,12 @@ void EditorExportPlatform::gen_debug_flags(Vector<String> &r_flags, int p_flags)
if (p_flags & DEBUG_FLAG_VIEW_COLLISONS) {
- r_flags.push_back("--debug-collisions");
+ r_flags.push_back("-debugcol");
}
if (p_flags & DEBUG_FLAG_VIEW_NAVIGATION) {
- r_flags.push_back("--debug-navigation");
+ r_flags.push_back("-debugnav");
}
}
@@ -714,17 +714,17 @@ void EditorExportPlatform::gen_export_flags(Vector<String> &r_flags, int p_flags
if (p_flags & DEBUG_FLAG_DUMB_CLIENT) {
int port = EditorSettings::get_singleton()->get("filesystem/file_server/port");
String passwd = EditorSettings::get_singleton()->get("filesystem/file_server/password");
- r_flags.push_back("--remote-fs");
+ r_flags.push_back("-rfs");
r_flags.push_back(host + ":" + itos(port));
if (passwd != "") {
- r_flags.push_back("--remote-fs-password");
+ r_flags.push_back("-rfs_pass");
r_flags.push_back(passwd);
}
}
if (p_flags & DEBUG_FLAG_REMOTE_DEBUG) {
- r_flags.push_back("--remote-debug");
+ r_flags.push_back("-rdebug");
r_flags.push_back(host + ":" + String::num(remote_port));
@@ -733,7 +733,7 @@ void EditorExportPlatform::gen_export_flags(Vector<String> &r_flags, int p_flags
if (breakpoints.size()) {
- r_flags.push_back("--breakpoints");
+ r_flags.push_back("-bp");
String bpoints;
for (const List<String>::Element *E = breakpoints.front(); E; E = E->next()) {
@@ -748,12 +748,12 @@ void EditorExportPlatform::gen_export_flags(Vector<String> &r_flags, int p_flags
if (p_flags & DEBUG_FLAG_VIEW_COLLISONS) {
- r_flags.push_back("--debug-collisions");
+ r_flags.push_back("-debugcol");
}
if (p_flags & DEBUG_FLAG_VIEW_NAVIGATION) {
- r_flags.push_back("--debug-navigation");
+ r_flags.push_back("-debugnav");
}
}
EditorExportPlatform::EditorExportPlatform() {
@@ -2231,17 +2231,17 @@ void EditorExportPlatform::gen_export_flags(Vector<String> &r_flags, int p_flags
if (p_flags&EXPORT_DUMB_CLIENT) {
int port = EditorSettings::get_singleton()->get("filesystem/file_server/port");
String passwd = EditorSettings::get_singleton()->get("filesystem/file_server/password");
- r_flags.push_back("--remote-fs");
+ r_flags.push_back("-rfs");
r_flags.push_back(host+":"+itos(port));
if (passwd!="") {
- r_flags.push_back("--remote-fs-password");
+ r_flags.push_back("-rfs_pass");
r_flags.push_back(passwd);
}
}
if (p_flags&EXPORT_REMOTE_DEBUG) {
- r_flags.push_back("--remote-debug");
+ r_flags.push_back("-rdebug");
r_flags.push_back(host+":"+String::num(remote_port));
@@ -2251,7 +2251,7 @@ void EditorExportPlatform::gen_export_flags(Vector<String> &r_flags, int p_flags
if (breakpoints.size()) {
- r_flags.push_back("--breakpoints");
+ r_flags.push_back("-bp");
String bpoints;
for(const List<String>::Element *E=breakpoints.front();E;E=E->next()) {
@@ -2267,12 +2267,12 @@ void EditorExportPlatform::gen_export_flags(Vector<String> &r_flags, int p_flags
if (p_flags&EXPORT_VIEW_COLLISONS) {
- r_flags.push_back("--debug-collisions");
+ r_flags.push_back("-debugcol");
}
if (p_flags&EXPORT_VIEW_NAVIGATION) {
- r_flags.push_back("--debug-navigation");
+ r_flags.push_back("-debugnav");
}
diff --git a/editor/editor_node.cpp b/editor/editor_node.cpp
index 9199ff825e..a5f0478854 100644
--- a/editor/editor_node.cpp
+++ b/editor/editor_node.cpp
@@ -1850,6 +1850,47 @@ void EditorNode::_run(bool p_current, const String &p_custom) {
_playing_edited = p_current;
}
+void EditorNode::_cleanup_scene() {
+
+#if 0
+ Node *scene = editor_data.get_edited_scene_root();
+ editor_selection->clear();
+ editor_data.clear_editor_states();
+ editor_history.clear();
+ _hide_top_editors();
+ animation_editor->cleanup();
+ property_editor->edit(NULL);
+ resources_dock->cleanup();
+ scene_import_metadata.unref();
+ //set_edited_scene(NULL);
+ if (scene) {
+ if (scene->get_filename()!="") {
+ previous_scenes.push_back(scene->get_filename());
+ }
+
+ memdelete(scene);
+ }
+ editor_data.get_undo_redo().clear_history();
+ saved_version=editor_data.get_undo_redo().get_version();
+ run_settings_dialog->set_run_mode(0);
+ run_settings_dialog->set_custom_arguments("-l $scene");
+
+ List<Ref<Resource> > cached;
+ ResourceCache::get_cached_resources(&cached);
+
+ for(List<Ref<Resource> >::Element *E=cached.front();E;E=E->next()) {
+
+ String path = E->get()->get_path();
+ if (path.is_resource_file()) {
+ ERR_PRINT(("Stray resource not cleaned:"+path).utf8().get_data());
+ }
+
+ }
+
+ _update_title();
+#endif
+}
+
void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) {
//print_line("option "+itos(p_option)+" confirm "+itos(p_confirmed));
@@ -1873,6 +1914,8 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) {
_scene_tab_changed(idx);
editor_data.clear_editor_states();
+ //_cleanup_scene();
+
} break;
case FILE_NEW_INHERITED_SCENE:
case FILE_OPEN_SCENE: {
@@ -2693,6 +2736,8 @@ void EditorNode::_menu_option_confirm(int p_option, bool p_confirmed) {
import_reload_fn = scene->get_filename();
_save_scene(import_reload_fn);
+ _cleanup_scene();
+
}
@@ -2778,9 +2823,9 @@ void EditorNode::_discard_changes(const String &p_str) {
String exec = OS::get_singleton()->get_executable_path();
List<String> args;
- args.push_back("--path");
+ args.push_back("-path");
args.push_back(exec.get_base_dir());
- args.push_back("--project-manager");
+ args.push_back("-pm");
OS::ProcessID pid = 0;
Error err = OS::get_singleton()->execute(exec, args, false, &pid);
@@ -3282,6 +3327,8 @@ Error EditorNode::load_scene(const String &p_scene, bool p_ignore_broken_deps, b
_scene_tab_changed(idx);
}
+ //_cleanup_scene(); // i'm sorry but this MUST happen to avoid modified resources to not be reloaded.
+
dependency_errors.clear();
Ref<PackedScene> sdata = ResourceLoader::load(lpath, "", true);
diff --git a/editor/editor_run.cpp b/editor/editor_run.cpp
index 28907ccf51..4954b1f741 100644
--- a/editor/editor_run.cpp
+++ b/editor/editor_run.cpp
@@ -45,27 +45,28 @@ Error EditorRun::run(const String &p_scene, const String p_custom_args, const Li
int remote_port = (int)EditorSettings::get_singleton()->get("network/debug/remote_port");
if (resource_path != "") {
- args.push_back("--path");
+ args.push_back("-path");
args.push_back(resource_path.replace(" ", "%20"));
}
if (true) {
- args.push_back("--remote-debug");
+ args.push_back("-rdebug");
args.push_back(remote_host + ":" + String::num(remote_port));
}
- args.push_back("--editor-pid");
+ args.push_back("-epid");
args.push_back(String::num(OS::get_singleton()->get_process_id()));
if (debug_collisions) {
- args.push_back("--debug-collisions");
+ args.push_back("-debugcol");
}
if (debug_navigation) {
- args.push_back("--debug-navigation");
+ args.push_back("-debugnav");
}
int screen = EditorSettings::get_singleton()->get("run/window_placement/screen");
+
if (screen == 0) {
screen = OS::get_singleton()->get_current_screen();
} else {
@@ -77,6 +78,7 @@ Error EditorRun::run(const String &p_scene, const String p_custom_args, const Li
screen_rect.size = OS::get_singleton()->get_screen_size(screen);
Size2 desired_size;
+
desired_size.x = ProjectSettings::get_singleton()->get("display/window/size/width");
desired_size.y = ProjectSettings::get_singleton()->get("display/window/size/height");
@@ -93,39 +95,39 @@ Error EditorRun::run(const String &p_scene, const String p_custom_args, const Li
switch (window_placement) {
case 0: { // default
- args.push_back("--position");
+ args.push_back("-p");
args.push_back(itos(screen_rect.position.x) + "x" + itos(screen_rect.position.y));
} break;
case 1: { // centered
Vector2 pos = screen_rect.position + ((screen_rect.size - desired_size) / 2).floor();
- args.push_back("--position");
- args.push_back(itos(pos.x) + "," + itos(pos.y));
+ args.push_back("-p");
+ args.push_back(itos(pos.x) + "x" + itos(pos.y));
} break;
case 2: { // custom pos
Vector2 pos = EditorSettings::get_singleton()->get("run/window_placement/rect_custom_position");
pos += screen_rect.position;
- args.push_back("--position");
- args.push_back(itos(pos.x) + "," + itos(pos.y));
+ args.push_back("-p");
+ args.push_back(itos(pos.x) + "x" + itos(pos.y));
} break;
case 3: { // force maximized
Vector2 pos = screen_rect.position;
- args.push_back("--position");
- args.push_back(itos(pos.x) + "," + itos(pos.y));
- args.push_back("--maximized");
+ args.push_back("-p");
+ args.push_back(itos(pos.x) + "x" + itos(pos.y));
+ args.push_back("-mx");
} break;
case 4: { // force fullscreen
Vector2 pos = screen_rect.position;
- args.push_back("--position");
- args.push_back(itos(pos.x) + "," + itos(pos.y));
- args.push_back("--fullscreen");
+ args.push_back("-p");
+ args.push_back(itos(pos.x) + "x" + itos(pos.y));
+ args.push_back("-f");
} break;
}
if (p_breakpoints.size()) {
- args.push_back("--breakpoints");
+ args.push_back("-bp");
String bpoints;
for (const List<String>::Element *E = p_breakpoints.front(); E; E = E->next()) {
@@ -150,7 +152,7 @@ Error EditorRun::run(const String &p_scene, const String p_custom_args, const Li
String exec = OS::get_singleton()->get_executable_path();
- printf("Running: %ls", exec.c_str());
+ printf("running: %ls", exec.c_str());
for (List<String>::Element *E = args.front(); E; E = E->next()) {
printf(" %ls", E->get().c_str());
diff --git a/editor/plugins/cube_grid_theme_editor_plugin.cpp b/editor/plugins/cube_grid_theme_editor_plugin.cpp
index b26b2aec4f..1fcd514b31 100644
--- a/editor/plugins/cube_grid_theme_editor_plugin.cpp
+++ b/editor/plugins/cube_grid_theme_editor_plugin.cpp
@@ -368,7 +368,6 @@ MeshLibraryEditorPlugin::MeshLibraryEditorPlugin(EditorNode *p_node) {
p_node->get_viewport()->add_child(theme_editor);
theme_editor->set_area_as_parent_rect();
- theme_editor->set_anchor(MARGIN_RIGHT, Control::ANCHOR_END);
theme_editor->set_anchor(MARGIN_BOTTOM, Control::ANCHOR_BEGIN);
theme_editor->set_end(Point2(0, 22));
theme_editor->hide();
diff --git a/editor/plugins/sample_editor_plugin.cpp b/editor/plugins/sample_editor_plugin.cpp
index 1d6417e2d5..2dd6de1683 100644
--- a/editor/plugins/sample_editor_plugin.cpp
+++ b/editor/plugins/sample_editor_plugin.cpp
@@ -374,8 +374,8 @@ SampleEditor::SampleEditor() {
sample_texframe->add_child(info_label);
info_label->set_area_as_parent_rect();
info_label->set_anchor_and_margin(MARGIN_TOP,ANCHOR_END,-15);
- info_label->set_margin(MARGIN_BOTTOM,4);
- info_label->set_margin(MARGIN_RIGHT,4);
+ info_label->set_margin(MARGIN_BOTTOM,-4);
+ info_label->set_margin(MARGIN_RIGHT,-4);
info_label->set_align(Label::ALIGN_RIGHT);
diff --git a/editor/plugins/tile_set_editor_plugin.cpp b/editor/plugins/tile_set_editor_plugin.cpp
index bed4727bb9..8396b4d412 100644
--- a/editor/plugins/tile_set_editor_plugin.cpp
+++ b/editor/plugins/tile_set_editor_plugin.cpp
@@ -294,7 +294,6 @@ TileSetEditorPlugin::TileSetEditorPlugin(EditorNode *p_node) {
p_node->get_viewport()->add_child(tileset_editor);
tileset_editor->set_area_as_parent_rect();
- tileset_editor->set_anchor(MARGIN_RIGHT, Control::ANCHOR_END);
tileset_editor->set_anchor(MARGIN_BOTTOM, Control::ANCHOR_BEGIN);
tileset_editor->set_end(Point2(0, 22));
tileset_editor->hide();
diff --git a/editor/project_manager.cpp b/editor/project_manager.cpp
index 769cf250c4..1ea8440508 100644
--- a/editor/project_manager.cpp
+++ b/editor/project_manager.cpp
@@ -929,10 +929,10 @@ void ProjectManager::_open_project_confirm() {
List<String> args;
- args.push_back("--path");
+ args.push_back("-path");
args.push_back(path);
- args.push_back("--editor");
+ args.push_back("-editor");
String exec = OS::get_singleton()->get_executable_path();
@@ -982,7 +982,7 @@ void ProjectManager::_run_project_confirm() {
List<String> args;
- args.push_back("--path");
+ args.push_back("-path");
args.push_back(path);
String exec = OS::get_singleton()->get_executable_path();
@@ -1219,7 +1219,7 @@ ProjectManager::ProjectManager() {
panel->add_child(vb);
vb->set_area_as_parent_rect(20 * EDSCALE);
vb->set_margin(MARGIN_TOP, 4 * EDSCALE);
- vb->set_margin(MARGIN_BOTTOM, 4 * EDSCALE);
+ vb->set_margin(MARGIN_BOTTOM, -4 * EDSCALE);
vb->add_constant_override("separation", 15 * EDSCALE);
String cp;
diff --git a/editor/property_editor.cpp b/editor/property_editor.cpp
index 0ec83d8a36..1bd748a083 100644
--- a/editor/property_editor.cpp
+++ b/editor/property_editor.cpp
@@ -1939,10 +1939,8 @@ CustomPropertyEditor::CustomPropertyEditor() {
text_edit = memnew(TextEdit);
add_child(text_edit);
- text_edit->set_area_as_parent_rect();
- for (int i = 0; i < 4; i++)
- text_edit->set_margin((Margin)i, 5);
- text_edit->set_margin(MARGIN_BOTTOM, 30);
+ text_edit->set_area_as_parent_rect(5);
+ text_edit->set_margin(MARGIN_BOTTOM, -30);
text_edit->hide();
text_edit->connect("text_changed", this, "_text_edit_changed");
diff --git a/editor/run_settings_dialog.cpp b/editor/run_settings_dialog.cpp
index dfb152d40b..4548ae0939 100644
--- a/editor/run_settings_dialog.cpp
+++ b/editor/run_settings_dialog.cpp
@@ -88,5 +88,7 @@ RunSettingsDialog::RunSettingsDialog() {
get_ok()->set_text(TTR("Close"));
//get_cancel()->set_text("Close");
+ arguments->set_text("-l $scene");
+
set_title(TTR("Scene Run Settings"));
}
diff --git a/editor/scene_tree_editor.cpp b/editor/scene_tree_editor.cpp
index 94ef712c25..2fab78e8c0 100644
--- a/editor/scene_tree_editor.cpp
+++ b/editor/scene_tree_editor.cpp
@@ -573,8 +573,10 @@ void SceneTreeEditor::set_selected(Node *p_node, bool p_emit_selected) {
selected = NULL;
_update_tree();
selected = p_node;
- if (p_emit_selected)
- emit_signal("node_selected");
+ }
+
+ if (p_emit_selected) {
+ emit_signal("node_selected");
}
}
diff --git a/main/main.cpp b/main/main.cpp
index 14b6ac29ec..e00a482bde 100644
--- a/main/main.cpp
+++ b/main/main.cpp
@@ -110,7 +110,6 @@ static bool force_lowdpi = false;
static int init_screen = -1;
static bool use_vsync = true;
static bool editor = false;
-static bool show_help = false;
static String unescape_cmdline(const String &p_str) {
@@ -127,88 +126,63 @@ static String unescape_cmdline(const String &p_str) {
void Main::print_help(const char *p_binary) {
- OS::get_singleton()->print(VERSION_FULL_NAME " - https://godotengine.org\n");
- OS::get_singleton()->print("(c) 2007-2017 Juan Linietsky, Ariel Manzur.\n");
- OS::get_singleton()->print("(c) 2014-2017 Godot Engine contributors.\n");
- OS::get_singleton()->print("\n");
- OS::get_singleton()->print("Usage: %s [options] [path to scene or 'project.godot' file]\n", p_binary);
- OS::get_singleton()->print("\n");
-
- OS::get_singleton()->print("General options:\n");
- OS::get_singleton()->print(" -h, --help Display this help message.\n");
- OS::get_singleton()->print(" -v, --verbose Use verbose stdout mode.\n");
- OS::get_singleton()->print(" --quiet Quiet mode, silences stdout messages. Errors are still displayed.\n");
- OS::get_singleton()->print("\n");
-
- OS::get_singleton()->print("Run options:\n");
+ OS::get_singleton()->print(VERSION_FULL_NAME " (c) 2008-2017 Juan Linietsky, Ariel Manzur.\n");
+ OS::get_singleton()->print("Usage: %s [options] [scene]\n", p_binary);
+ OS::get_singleton()->print("Options:\n");
+ OS::get_singleton()->print("\t-path [dir] : Path to a game, containing project.godot\n");
#ifdef TOOLS_ENABLED
- OS::get_singleton()->print(" -e, --editor Start the editor instead of running the scene.\n");
- OS::get_singleton()->print(" -p, --project-manager Start the project manager, even if a project is auto-detected.\n");
+ OS::get_singleton()->print("\t-e,-editor : Bring up the editor instead of running the scene.\n");
#endif
- OS::get_singleton()->print(" -l, --language <locale> Use a specific locale (<locale> being a two-letter code).\n");
- OS::get_singleton()->print(" --path <directory> Path to a project (<directory> must contain a 'project.godot' file).\n");
- OS::get_singleton()->print(" --main-pack <file> Path to a pack (.pck) file to load.\n");
- OS::get_singleton()->print(" --render-thread <mode> Render thread mode ('unsafe', 'safe', 'separate').\n");
- OS::get_singleton()->print(" --remote-fs <address> Remote filesystem (<host/IP>[:<port>] address).\n");
- OS::get_singleton()->print(" --remote-fs-password <password> Password for remote filesystem.\n");
- OS::get_singleton()->print(" --audio-driver <driver> Audio driver (");
- for (int i = 0; i < OS::get_singleton()->get_audio_driver_count(); i++) {
- if (i != 0)
- OS::get_singleton()->print(", ");
- OS::get_singleton()->print("'%s'", OS::get_singleton()->get_audio_driver_name(i));
+ OS::get_singleton()->print("\t-test [test] : Run a test.\n");
+ OS::get_singleton()->print("\t\t(");
+ const char **test_names = tests_get_names();
+ const char *coma = "";
+ while (*test_names) {
+
+ OS::get_singleton()->print("%s%s", coma, *test_names);
+ test_names++;
+ coma = ", ";
}
- OS::get_singleton()->print(").\n");
- OS::get_singleton()->print(" --video-driver <driver> Video driver (");
+ OS::get_singleton()->print(")\n");
+
+ OS::get_singleton()->print("\t-r WIDTHxHEIGHT\t : Request Window Resolution\n");
+ OS::get_singleton()->print("\t-p XxY\t : Request Window Position\n");
+ OS::get_singleton()->print("\t-f\t\t : Request Fullscreen\n");
+ OS::get_singleton()->print("\t-mx\t\t Request Maximized\n");
+ OS::get_singleton()->print("\t-w\t\t Request Windowed\n");
+ OS::get_singleton()->print("\t-vd DRIVER\t : Video Driver (");
for (int i = 0; i < OS::get_singleton()->get_video_driver_count(); i++) {
+
if (i != 0)
OS::get_singleton()->print(", ");
- OS::get_singleton()->print("'%s'", OS::get_singleton()->get_video_driver_name(i));
+ OS::get_singleton()->print("%s", OS::get_singleton()->get_video_driver_name(i));
}
- OS::get_singleton()->print(").\n");
- OS::get_singleton()->print("\n");
-
- OS::get_singleton()->print("Display options:\n");
- OS::get_singleton()->print(" -f, --fullscreen Request fullscreen mode.\n");
- OS::get_singleton()->print(" -m, --maximized Request a maximized window.\n");
- OS::get_singleton()->print(" -w, --windowed Request windowed mode.\n");
- OS::get_singleton()->print(" --resolution <W>x<H> Request window resolution.\n");
- OS::get_singleton()->print(" --position <X>,<Y> Request window position.\n");
- OS::get_singleton()->print(" --low-dpi Force low-DPI mode (macOS only).\n");
- OS::get_singleton()->print(" --no-window Disable window creation (Windows only). Useful together with --script.\n");
- OS::get_singleton()->print("\n");
-
- OS::get_singleton()->print("Debug options:\n");
- OS::get_singleton()->print(" -d, --debug Debug (local stdout debugger).\n");
- OS::get_singleton()->print(" -b, --breakpoints Breakpoint list as source::line comma-separated pairs, no spaces (use %%20, %%2C, etc. instead).\n");
- OS::get_singleton()->print(" --profiling Enable profiling in the script debugger.\n");
- OS::get_singleton()->print(" --remote-debug <address> Remote debug (<host/IP>:<port> address).\n");
-#ifdef DEBUG_ENABLED
- OS::get_singleton()->print(" --debug-collisions Show collisions shapes when running the scene.\n");
- OS::get_singleton()->print(" --debug-navigation Show navigation polygons when running the scene.\n");
-#endif
- OS::get_singleton()->print(" --frame-delay <ms> Simulate high CPU load (delay each frame by <ms> milliseconds).\n");
- OS::get_singleton()->print(" --time-scale <scale> Force time scale (higher values are faster, 1.0 is normal speed).\n");
- OS::get_singleton()->print("\n");
+ OS::get_singleton()->print(")\n");
+ OS::get_singleton()->print("\t-ldpi\t : Force low-dpi mode (OSX Only)\n");
- OS::get_singleton()->print("Standalone tools:\n");
- OS::get_singleton()->print(" -s, --script <script> Run a script.\n");
-#ifdef TOOLS_ENABLED
- OS::get_singleton()->print(" --export <target> Export the project using the given export target.\n");
- OS::get_singleton()->print(" --export-debug Use together with --export, enables debug mode for the template.\n");
- OS::get_singleton()->print(" --doctool <file> Dump the whole engine API to <file> in XML format. If <file> exists, it will be merged.\n");
- OS::get_singleton()->print(" --no-docbase Disallow dumping the base types (used with --doctool).\n");
-#ifdef DEBUG_METHODS_ENABLED
- OS::get_singleton()->print(" --gdnative-generate-json-api Generate JSON dump of the Godot API for GDNative bindings.\n");
-#endif
- OS::get_singleton()->print(" --test <test> Run a unit test (");
- const char **test_names = tests_get_names();
- const char *comma = "";
- while (*test_names) {
- OS::get_singleton()->print("%s'%s'", comma, *test_names);
- test_names++;
- comma = ", ";
+ OS::get_singleton()->print("\t-ad DRIVER\t : Audio Driver (");
+ for (int i = 0; i < OS::get_singleton()->get_audio_driver_count(); i++) {
+
+ if (i != 0)
+ OS::get_singleton()->print(", ");
+ OS::get_singleton()->print("%s", OS::get_singleton()->get_audio_driver_name(i));
}
- OS::get_singleton()->print(").\n");
+ OS::get_singleton()->print(")\n");
+ OS::get_singleton()->print("\t-rthread <mode>\t : Render Thread Mode ('unsafe', 'safe', 'separate').\n");
+ OS::get_singleton()->print("\t-s,-script [script] : Run a script.\n");
+ OS::get_singleton()->print("\t-d,-debug : Debug (local stdout debugger).\n");
+ OS::get_singleton()->print("\t-rdebug ADDRESS : Remote debug (<ip>:<port> host address).\n");
+ OS::get_singleton()->print("\t-fdelay [msec]: Simulate high CPU load (delay each frame by [msec]).\n");
+ OS::get_singleton()->print("\t-timescale [msec]: Simulate high CPU load (delay each frame by [msec]).\n");
+ OS::get_singleton()->print("\t-bp : breakpoint list as source::line comma separated pairs, no spaces (%%20,%%2C,etc instead).\n");
+ OS::get_singleton()->print("\t-v : Verbose stdout mode\n");
+ OS::get_singleton()->print("\t-lang [locale]: Use a specific locale\n");
+ OS::get_singleton()->print("\t-rfs <host/ip>[:<port>] : Remote FileSystem.\n");
+ OS::get_singleton()->print("\t-rfs_pass <password> : Password for Remote FileSystem.\n");
+#ifdef TOOLS_ENABLED
+ OS::get_singleton()->print("\t-doctool FILE: Dump the whole engine api to FILE in XML format. If FILE exists, it will be merged.\n");
+ OS::get_singleton()->print("\t-nodocbase: Disallow dump the base types (used with -doctool).\n");
+ OS::get_singleton()->print("\t-export [target] Export the project using given export target.\n");
#endif
}
@@ -278,6 +252,9 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
String remotefs;
String remotefs_pass;
+ String screen = "";
+
+ List<String> pack_list;
Vector<String> breakpoints;
bool use_custom_res = true;
bool force_res = false;
@@ -304,12 +281,14 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
List<String>::Element *N = I->next();
- if (I->get() == "-h" || I->get() == "--help" || I->get() == "/?") { // display help
+ if (I->get() == "-noop") {
+
+ // no op
+ } else if (I->get() == "-h" || I->get() == "--help" || I->get() == "/?") { // resolution
- show_help = true;
goto error;
- } else if (I->get() == "--resolution") { // force resolution
+ } else if (I->get() == "-r") { // resolution
if (I->next()) {
@@ -317,16 +296,16 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
if (vm.find("x") == -1) { // invalid parameter format
- OS::get_singleton()->print("Invalid resolution '%s', it should be e.g. '1280x720'.\n", vm.utf8().get_data());
+ OS::get_singleton()->print("Invalid -r argument: %s\n", vm.utf8().get_data());
goto error;
}
int w = vm.get_slice("x", 0).to_int();
int h = vm.get_slice("x", 1).to_int();
- if (w <= 0 || h <= 0) {
+ if (w == 0 || h == 0) {
- OS::get_singleton()->print("Invalid resolution '%s', width and height must be above 0.\n", vm.utf8().get_data());
+ OS::get_singleton()->print("Invalid -r resolution, x and y must be >0\n");
goto error;
}
@@ -336,86 +315,84 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
N = I->next()->next();
} else {
- OS::get_singleton()->print("Missing resolution argument, aborting.\n");
+ OS::get_singleton()->print("Invalid -p argument, needs resolution\n");
goto error;
}
- } else if (I->get() == "--position") { // set window position
+ } else if (I->get() == "-p") { // position
if (I->next()) {
String vm = I->next()->get();
- if (vm.find(",") == -1) { // invalid parameter format
+ if (vm.find("x") == -1) { // invalid parameter format
- OS::get_singleton()->print("Invalid position '%s', it should be e.g. '80,128'.\n", vm.utf8().get_data());
+ OS::get_singleton()->print("Invalid -p argument: %s\n", vm.utf8().get_data());
goto error;
}
- int x = vm.get_slice(",", 0).to_int();
- int y = vm.get_slice(",", 1).to_int();
+ int x = vm.get_slice("x", 0).to_int();
+ int y = vm.get_slice("x", 1).to_int();
init_custom_pos = Point2(x, y);
init_use_custom_pos = true;
N = I->next()->next();
} else {
- OS::get_singleton()->print("Missing position argument, aborting.\n");
+ OS::get_singleton()->print("Invalid -r argument, needs position\n");
goto error;
}
- } else if (I->get() == "-m" || I->get() == "--maximized") { // force maximized window
+ } else if (I->get() == "-mx") { // video driver
init_maximized = true;
- } else if (I->get() == "-w" || I->get() == "--windowed") { // force windowed window
+ } else if (I->get() == "-w") { // video driver
init_windowed = true;
- } else if (I->get() == "--profiling") { // enable profiling
+ } else if (I->get() == "-profile") { // video driver
use_debug_profiler = true;
- } else if (I->get() == "--video-driver") { // force video driver
+ } else if (I->get() == "-vd") { // video driver
if (I->next()) {
video_driver = I->next()->get();
N = I->next()->next();
} else {
- OS::get_singleton()->print("Missing video driver argument, aborting.\n");
+ OS::get_singleton()->print("Invalid -cd argument, needs driver name\n");
goto error;
}
- } else if (I->get() == "-l" || I->get() == "--language") { // language
+ } else if (I->get() == "-lang") { // language
if (I->next()) {
locale = I->next()->get();
N = I->next()->next();
} else {
- OS::get_singleton()->print("Missing language argument, aborting.\n");
+ OS::get_singleton()->print("Invalid -lang argument, needs language code\n");
goto error;
}
- } else if (I->get() == "--low-dpi") { // force low DPI (macOS only)
+ } else if (I->get() == "-ldpi") { // language
force_lowdpi = true;
- } else if (I->get() == "--remote-fs") { // remote filesystem
+ } else if (I->get() == "-rfs") { // language
if (I->next()) {
remotefs = I->next()->get();
N = I->next()->next();
} else {
- OS::get_singleton()->print("Missing remote filesystem address, aborting.\n");
goto error;
}
- } else if (I->get() == "--remote-fs-password") { // remote filesystem password
+ } else if (I->get() == "-rfs_pass") { // language
if (I->next()) {
remotefs_pass = I->next()->get();
N = I->next()->next();
} else {
- OS::get_singleton()->print("Missing remote filesystem password, aborting.\n");
goto error;
}
- } else if (I->get() == "--render-thread") { // render thread mode
+ } else if (I->get() == "-rthread") { // language
if (I->next()) {
@@ -428,37 +405,35 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
N = I->next()->next();
} else {
- OS::get_singleton()->print("Missing render thread mode argument, aborting.\n");
goto error;
}
- } else if (I->get() == "--audio-driver") { // audio driver
+ } else if (I->get() == "-ad") { // video driver
if (I->next()) {
audio_driver = I->next()->get();
N = I->next()->next();
} else {
- OS::get_singleton()->print("Missing audio driver argument, aborting.\n");
goto error;
}
- } else if (I->get() == "-f" || I->get() == "--fullscreen") { // force fullscreen
+ } else if (I->get() == "-f") { // fullscreen
//video_mode.fullscreen=false;
init_fullscreen = true;
- } else if (I->get() == "-e" || I->get() == "--editor") { // starts editor
+ } else if (I->get() == "-e" || I->get() == "-editor") { // fonud editor
editor = true;
- } else if (I->get() == "--no-window") { // disable window creation, Windows only
+ } else if (I->get() == "-nowindow") { // fullscreen
OS::get_singleton()->set_no_window_mode(true);
- } else if (I->get() == "--quiet") { // quieter output
+ } else if (I->get() == "-quiet") { // fullscreen
quiet_stdout = true;
- } else if (I->get() == "-v" || I->get() == "--verbose") { // verbose output
+ } else if (I->get() == "-v") { // fullscreen
OS::get_singleton()->_verbose_stdout = true;
- } else if (I->get() == "--path") { // set path of project to start or edit
+ } else if (I->get() == "-path") { // resolution
if (I->next()) {
@@ -470,7 +445,6 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
}
N = I->next()->next();
} else {
- OS::get_singleton()->print("Missing relative or absolute path, aborting.\n");
goto error;
}
} else if (I->get().ends_with("project.godot")) {
@@ -490,7 +464,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
#ifdef TOOLS_ENABLED
editor = true;
#endif
- } else if (I->get() == "-b" || I->get() == "--breakpoints") { // add breakpoints
+ } else if (I->get() == "-bp") { // /breakpoints
if (I->next()) {
@@ -498,73 +472,88 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
breakpoints = bplist.split(",");
N = I->next()->next();
} else {
- OS::get_singleton()->print("Missing list of breakpoints, aborting.\n");
goto error;
}
- } else if (I->get() == "--frame-delay") { // force frame delay
+ } else if (I->get() == "-fdelay") { // resolution
if (I->next()) {
frame_delay = I->next()->get().to_int();
N = I->next()->next();
} else {
- OS::get_singleton()->print("Missing frame delay argument, aborting.\n");
goto error;
}
- } else if (I->get() == "--time-scale") { // force time scale
+ } else if (I->get() == "-timescale") { // resolution
if (I->next()) {
Engine::get_singleton()->set_time_scale(I->next()->get().to_double());
N = I->next()->next();
} else {
- OS::get_singleton()->print("Missing time scale argument, aborting.\n");
goto error;
}
- } else if (I->get() == "--main-pack") {
+ } else if (I->get() == "-pack") {
+
+ if (I->next()) {
+
+ pack_list.push_back(I->next()->get());
+ N = I->next()->next();
+ } else {
+
+ goto error;
+ };
+
+ } else if (I->get() == "-main_pack") {
if (I->next()) {
main_pack = I->next()->get();
N = I->next()->next();
} else {
- OS::get_singleton()->print("Missing path to main pack file, aborting.\n");
+
goto error;
};
- } else if (I->get() == "-d" || I->get() == "--debug") {
+ } else if (I->get() == "-debug" || I->get() == "-d") {
debug_mode = "local";
#ifdef DEBUG_ENABLED
- } else if (I->get() == "--debug-collisions") {
+ } else if (I->get() == "-debugcol" || I->get() == "-dc") {
debug_collisions = true;
- } else if (I->get() == "--debug-navigation") {
+ } else if (I->get() == "-debugnav" || I->get() == "-dn") {
debug_navigation = true;
#endif
- } else if (I->get() == "--remote-debug") {
+ } else if (I->get() == "-editor_scene") {
+
+ if (I->next()) {
+
+ ProjectSettings::get_singleton()->set("editor_scene", game_path = I->next()->get());
+ } else {
+ goto error;
+ }
+
+ } else if (I->get() == "-rdebug") {
if (I->next()) {
debug_mode = "remote";
debug_host = I->next()->get();
- if (debug_host.find(":") == -1) { // wrong address
- OS::get_singleton()->print("Invalid debug host address, it should be of the form <host/IP>:<port>.\n");
+ if (debug_host.find(":") == -1) { //wrong host
+ OS::get_singleton()->print("Invalid debug host string\n");
goto error;
}
N = I->next()->next();
} else {
- OS::get_singleton()->print("Missing remote debug host address, aborting.\n");
goto error;
}
- } else if (I->get() == "--editor-pid") { // not exposed to user
+ } else if (I->get() == "-epid") {
if (I->next()) {
int editor_pid = I->next()->get().to_int();
ProjectSettings::get_singleton()->set("editor_pid", editor_pid);
N = I->next()->next();
} else {
- OS::get_singleton()->print("Missing editor PID argument, aborting.\n");
goto error;
}
} else {
@@ -628,7 +617,7 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
Error err = file_access_network_client->connect(remotefs, port, remotefs_pass);
if (err) {
- OS::get_singleton()->printerr("Could not connect to remotefs: %s:%i.\n", remotefs.utf8().get_data(), port);
+ OS::get_singleton()->printerr("Could not connect to remotefs: %s:%i\n", remotefs.utf8().get_data(), port);
goto error;
}
@@ -664,14 +653,14 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
#ifdef TOOLS_ENABLED
editor = false;
#else
- OS::get_singleton()->print("Error: Could not load game path '%s'.\n", game_path.ascii().get_data());
+ OS::get_singleton()->print("error: Couldn't load game path '%s'\n", game_path.ascii().get_data());
goto error;
#endif
}
if (editor) {
- main_args.push_back("--editor");
+ main_args.push_back("-editor");
init_maximized = true;
use_custom_res = false;
}
@@ -753,7 +742,11 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
OS::get_singleton()->_render_thread_mode = OS::RenderThreadMode(rtm);
}
- /* Determine audio and video drivers */
+ /* Determine Video Driver */
+
+ if (audio_driver == "") { // specified in project.godot
+ audio_driver = GLOBAL_DEF("audio/driver", OS::get_singleton()->get_audio_driver_name(0));
+ }
for (int i = 0; i < OS::get_singleton()->get_video_driver_count(); i++) {
@@ -771,10 +764,6 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
//goto error;
}
- if (audio_driver == "") { // specified in project.godot
- audio_driver = GLOBAL_DEF("audio/driver", OS::get_singleton()->get_audio_driver_name(0));
- }
-
for (int i = 0; i < OS::get_singleton()->get_audio_driver_count(); i++) {
if (audio_driver == OS::get_singleton()->get_audio_driver_name(i)) {
@@ -842,8 +831,7 @@ error:
args.clear();
main_args.clear();
- if (show_help)
- print_help(execpath);
+ print_help(execpath);
if (performance)
memdelete(performance);
@@ -1059,18 +1047,23 @@ bool Main::start() {
String game_path;
String script;
String test;
+ String screen;
String _export_preset;
+ String _import;
+ String _import_script;
+ bool noquit = false;
bool export_debug = false;
bool project_manager_request = false;
-
List<String> args = OS::get_singleton()->get_cmdline_args();
for (int i = 0; i < args.size(); i++) {
//parameters that do not have an argument to the right
- if (args[i] == "--no-docbase") {
+ if (args[i] == "-nodocbase") {
doc_base = false;
- } else if (args[i] == "-e" || args[i] == "--editor") {
+ } else if (args[i] == "-noquit") {
+ noquit = true;
+ } else if (args[i] == "-editor" || args[i] == "-e") {
editor = true;
- } else if (args[i] == "-p" || args[i] == "--project-manager") {
+ } else if (args[i] == "-pm" || args[i] == "-project_manager") {
project_manager_request = true;
} else if (args[i].length() && args[i][0] != '-' && game_path == "") {
game_path = args[i];
@@ -1078,21 +1071,29 @@ bool Main::start() {
//parameters that have an argument to the right
else if (i < (args.size() - 1)) {
bool parsed_pair = true;
- if (args[i] == "--doctool") {
+ if (args[i] == "-doctool") {
doc_tool = args[i + 1];
for (int j = i + 2; j < args.size(); j++)
removal_docs.push_back(args[j]);
- } else if (args[i] == "-s" || args[i] == "--script") {
+ } else if (args[i] == "-script" || args[i] == "-s") {
script = args[i + 1];
- } else if (args[i] == "--test") {
+ } else if (args[i] == "-level" || args[i] == "-l") {
+ Engine::get_singleton()->_custom_level = args[i + 1];
+ } else if (args[i] == "-test") {
test = args[i + 1];
- } else if (args[i] == "--export") {
+ } else if (args[i] == "-export") {
editor = true; //needs editor
_export_preset = args[i + 1];
- } else if (args[i] == "--export-debug") {
+ } else if (args[i] == "-export_debug") {
editor = true; //needs editor
_export_preset = args[i + 1];
export_debug = true;
+ } else if (args[i] == "-import") {
+ editor = true; //needs editor
+ _import = args[i + 1];
+ } else if (args[i] == "-import_script") {
+ editor = true; //needs editor
+ _import_script = args[i + 1];
} else {
// The parameter does not match anything known, don't skip the next argument
parsed_pair = false;
@@ -1138,7 +1139,7 @@ bool Main::start() {
if (_export_preset != "") {
if (game_path == "") {
String err = "Command line param ";
- err += export_debug ? "--export-debug" : "--export";
+ err += export_debug ? "-export_debug" : "-export";
err += " passed but no destination path given.\n";
err += "Please specify the binary's file path to export to. Aborting export.";
ERR_PRINT(err.utf8().get_data());
@@ -1198,7 +1199,7 @@ bool Main::start() {
if (!main_loop) {
if (!ClassDB::class_exists(main_loop_type)) {
- OS::get_singleton()->alert("Error: MainLoop type doesn't exist: " + main_loop_type);
+ OS::get_singleton()->alert("godot: error: MainLoop type doesn't exist: " + main_loop_type);
return false;
} else {
@@ -1348,8 +1349,19 @@ bool Main::start() {
#ifdef TOOLS_ENABLED
if (editor) {
- Error serr = editor_node->load_scene(local_game_path);
+ if (_import != "") {
+
+ //editor_node->import_scene(_import,local_game_path,_import_script);
+ if (!noquit)
+ sml->quit();
+ game_path = ""; //no load anything
+ } else {
+
+ Error serr = editor_node->load_scene(local_game_path);
+ }
OS::get_singleton()->set_context(OS::CONTEXT_EDITOR);
+
+ //editor_node->set_edited_scene(game);
}
#endif
}
@@ -1423,6 +1435,7 @@ bool Main::start() {
n->set_name(name);
//defer so references are all valid on _ready()
+ //sml->get_root()->add_child(n);
to_add.push_back(n);
if (global_var) {
@@ -1447,6 +1460,7 @@ bool Main::start() {
ERR_EXPLAIN("Failed loading scene: " + local_game_path);
ERR_FAIL_COND_V(!scene, false)
+ //sml->get_root()->add_child(scene);
sml->add_current_scene(scene);
String iconpath = GLOBAL_DEF("application/config/icon", "Variant()");
@@ -1460,6 +1474,27 @@ bool Main::start() {
}
#ifdef TOOLS_ENABLED
+
+ /*if (_export_platform!="") {
+
+ sml->quit();
+ }*/
+
+ /*
+ if (sml->get_root_node()) {
+
+ Console *console = memnew( Console );
+
+ sml->get_root_node()->cast_to<RootNode>()->set_console(console);
+ if (GLOBAL_DEF("console/visible_default",false).operator bool()) {
+
+ console->show();
+ } else {P
+
+ console->hide();
+ };
+ }
+*/
if (project_manager_request || (script == "" && test == "" && game_path == "" && !editor)) {
ProjectManager *pmanager = memnew(ProjectManager);
@@ -1468,6 +1503,7 @@ bool Main::start() {
sml->get_root()->add_child(pmanager);
OS::get_singleton()->set_context(OS::CONTEXT_PROJECTMAN);
}
+
#endif
}
@@ -1548,6 +1584,10 @@ bool Main::iteration() {
time_accum -= frame_slice;
message_queue->flush();
+ /*
+ if (AudioServer::get_singleton())
+ AudioServer::get_singleton()->update();
+ */
fixed_process_ticks = MAX(fixed_process_ticks, OS::get_singleton()->get_ticks_usec() - fixed_begin); // keep the largest one for reference
fixed_process_max = MAX(OS::get_singleton()->get_ticks_usec() - fixed_begin, fixed_process_max);
@@ -1596,6 +1636,7 @@ bool Main::iteration() {
script_debugger->idle_poll();
}
+ //x11_delay_usec(10000);
frames++;
Engine::get_singleton()->_idle_frames++;
@@ -1697,6 +1738,7 @@ void Main::cleanup() {
unregister_core_driver_types();
unregister_core_types();
+ //PerformanceMetrics::finish();
OS::get_singleton()->clear_last_error();
OS::get_singleton()->finalize_core();
}
diff --git a/modules/gridmap/grid_map_editor_plugin.cpp b/modules/gridmap/grid_map_editor_plugin.cpp
index 38f58799df..7bb80c2510 100644
--- a/modules/gridmap/grid_map_editor_plugin.cpp
+++ b/modules/gridmap/grid_map_editor_plugin.cpp
@@ -1203,7 +1203,7 @@ GridMapEditor::GridMapEditor(EditorNode *p_editor) {
edit_mode = memnew(OptionButton);
edit_mode->set_area_as_parent_rect();
edit_mode->set_anchor_and_margin(MARGIN_BOTTOM, ANCHOR_BEGIN, 24);
- edit_mode->set_anchor_and_margin(MARGIN_RIGHT, ANCHOR_END, -14);
+ edit_mode->set_margin(MARGIN_RIGHT, -14);
edit_mode->add_item("Tiles");
edit_mode->add_item("Areas");
hb->add_child(edit_mode);
diff --git a/modules/visual_script/visual_script_editor.cpp b/modules/visual_script/visual_script_editor.cpp
index 9a1033e954..b9e7a6ffc4 100644
--- a/modules/visual_script/visual_script_editor.cpp
+++ b/modules/visual_script/visual_script_editor.cpp
@@ -3279,7 +3279,6 @@ VisualScriptEditor::VisualScriptEditor() {
select_func_text->set_valign(Label::VALIGN_CENTER);
select_func_text->set_h_size_flags(SIZE_EXPAND_FILL);
add_child(select_func_text);
- graph->set_area_as_parent_rect();
hint_text = memnew(Label);
hint_text->set_anchor_and_margin(MARGIN_TOP, ANCHOR_END, -100);
diff --git a/platform/android/export/export.cpp b/platform/android/export/export.cpp
index ee93c29577..3c52834d92 100644
--- a/platform/android/export/export.cpp
+++ b/platform/android/export/export.cpp
@@ -1220,10 +1220,10 @@ Error EditorExportPlatformAndroid::export_project(const String& p_path, bool p_d
/*String host = EditorSettings::get_singleton()->get("filesystem/file_server/host");
int port = EditorSettings::get_singleton()->get("filesystem/file_server/post");
String passwd = EditorSettings::get_singleton()->get("filesystem/file_server/password");
- cl.push_back("--remote-fs");
+ cl.push_back("-rfs");
cl.push_back(host+":"+itos(port));
if (passwd!="") {
- cl.push_back("--remote-fs-password");
+ cl.push_back("-rfs_pass");
cl.push_back(passwd);
}*/
@@ -1243,10 +1243,10 @@ Error EditorExportPlatformAndroid::export_project(const String& p_path, bool p_d
err = save_pack(pf);
memdelete(pf);
- cl.push_back("--use_apk_expansion");
- cl.push_back("--apk_expansion_md5");
+ cl.push_back("-use_apk_expansion");
+ cl.push_back("-apk_expansion_md5");
cl.push_back(FileAccess::get_md5(fullpath));
- cl.push_back("--apk_expansion_key");
+ cl.push_back("-apk_expansion_key");
cl.push_back(apk_expansion_pkey.strip_edges());
} else {
@@ -1262,10 +1262,10 @@ Error EditorExportPlatformAndroid::export_project(const String& p_path, bool p_d
}
if (use_32_fb)
- cl.push_back("--use_depth_32");
+ cl.push_back("-use_depth_32");
if (immersive)
- cl.push_back("--use_immersive");
+ cl.push_back("-use_immersive");
if (cl.size()) {
//add comandline
@@ -3330,10 +3330,10 @@ public:
/*String host = EditorSettings::get_singleton()->get("filesystem/file_server/host");
int port = EditorSettings::get_singleton()->get("filesystem/file_server/post");
String passwd = EditorSettings::get_singleton()->get("filesystem/file_server/password");
- cl.push_back("--remote-fs");
+ cl.push_back("-rfs");
cl.push_back(host+":"+itos(port));
if (passwd!="") {
- cl.push_back("--remote-fs-password");
+ cl.push_back("-rfs_pass");
cl.push_back(passwd);
}*/
@@ -3350,10 +3350,10 @@ public:
return OK;
}
- cl.push_back("--use_apk_expansion");
- cl.push_back("--apk_expansion_md5");
+ cl.push_back("-use_apk_expansion");
+ cl.push_back("-apk_expansion_md5");
cl.push_back(FileAccess::get_md5(fullpath));
- cl.push_back("--apk_expansion_key");
+ cl.push_back("-apk_expansion_key");
cl.push_back(apk_expansion_pkey.strip_edges());
} else {
@@ -3367,10 +3367,10 @@ public:
}
if (use_32_fb)
- cl.push_back("--use_depth_32");
+ cl.push_back("-use_depth_32");
if (immersive)
- cl.push_back("--use_immersive");
+ cl.push_back("-use_immersive");
if (cl.size()) {
//add comandline
diff --git a/platform/android/godot_android.cpp b/platform/android/godot_android.cpp
index 5933b83d06..6fbd42d7b3 100644
--- a/platform/android/godot_android.cpp
+++ b/platform/android/godot_android.cpp
@@ -616,6 +616,7 @@ static void engine_handle_cmd(struct android_app *app, int32_t cmd) {
//do initialization here, when there's OpenGL! hackish but the only way
engine->os = new OS_Android(_gfx_init, engine);
+ //char *args[]={"-test","gui",NULL};
__android_log_print(ANDROID_LOG_INFO, "godot", "pre asdasd setup...");
#if 0
Error err = Main::setup("apk",2,args);
diff --git a/platform/android/java/src/org/godotengine/godot/Godot.java b/platform/android/java/src/org/godotengine/godot/Godot.java
index d444d37c2f..d620b2b9c4 100644
--- a/platform/android/java/src/org/godotengine/godot/Godot.java
+++ b/platform/android/java/src/org/godotengine/godot/Godot.java
@@ -387,7 +387,7 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC
new_cmdline = new String[ 2 ];
}
- new_cmdline[cll]="--main_pack";
+ new_cmdline[cll]="-main_pack";
new_cmdline[cll+1]=expansion_pack_path;
command_line=new_cmdline;
}
@@ -452,9 +452,9 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC
for(int i=0;i<command_line.length;i++) {
boolean has_extra = i< command_line.length -1;
- if (command_line[i].equals("--use_depth_32")) {
+ if (command_line[i].equals("-use_depth_32")) {
use_32_bits=true;
- } else if (command_line[i].equals("--use_immersive")) {
+ } else if (command_line[i].equals("-use_immersive")) {
use_immersive=true;
if(Build.VERSION.SDK_INT >= 19.0){ // check if the application runs on an android 4.4+
window.getDecorView().setSystemUiVisibility(
@@ -467,12 +467,12 @@ public class Godot extends Activity implements SensorEventListener, IDownloaderC
UiChangeListener();
}
- } else if (command_line[i].equals("--use_apk_expansion")) {
+ } else if (command_line[i].equals("-use_apk_expansion")) {
use_apk_expansion=true;
- } else if (has_extra && command_line[i].equals("--apk_expansion_md5")) {
+ } else if (has_extra && command_line[i].equals("-apk_expansion_md5")) {
main_pack_md5=command_line[i+1];
i++;
- } else if (has_extra && command_line[i].equals("--apk_expansion_key")) {
+ } else if (has_extra && command_line[i].equals("-apk_expansion_key")) {
main_pack_key=command_line[i+1];
SharedPreferences prefs = getSharedPreferences("app_data_keys", MODE_PRIVATE);
Editor editor = prefs.edit();
diff --git a/platform/android/java_glue.cpp b/platform/android/java_glue.cpp
index eb139fb471..683e1cfb22 100644
--- a/platform/android/java_glue.cpp
+++ b/platform/android/java_glue.cpp
@@ -844,7 +844,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_initialize(JNIEnv *en
} else {
//__android_log_print(ANDROID_LOG_INFO,"godot","cmdline arg %i is: %s\n",i,rawString);
- if (strcmp(rawString, "--main_pack") == 0)
+ if (strcmp(rawString, "-main_pack") == 0)
use_apk_expansion = true;
}
@@ -867,7 +867,7 @@ JNIEXPORT void JNICALL Java_org_godotengine_godot_GodotLib_initialize(JNIEnv *en
__android_log_print(ANDROID_LOG_INFO, "godot", "**SETUP");
#if 0
- char *args[]={"--test","render",NULL};
+ char *args[]={"-test","render",NULL};
__android_log_print(ANDROID_LOG_INFO,"godot","pre asdasd setup...");
Error err = Main::setup("apk",2,args,false);
#else
diff --git a/platform/iphone/view_controller.mm b/platform/iphone/view_controller.mm
index 921ef8f607..574598e1d3 100644
--- a/platform/iphone/view_controller.mm
+++ b/platform/iphone/view_controller.mm
@@ -42,7 +42,7 @@ int add_path(int p_argc, char **p_args) {
if (!str)
return p_argc;
- p_args[p_argc++] = "--path";
+ p_args[p_argc++] = "-path";
[str retain]; // memory leak lol (maybe make it static here and delete it in ViewController destructor? @todo
p_args[p_argc++] = (char *)[str cString];
p_args[p_argc] = NULL;
diff --git a/platform/uwp/app.cpp b/platform/uwp/app.cpp
index 8824d1c1d0..c773c0b746 100644
--- a/platform/uwp/app.cpp
+++ b/platform/uwp/app.cpp
@@ -512,7 +512,7 @@ void App::UpdateWindowSize(Size size) {
char **App::get_command_line(unsigned int *out_argc) {
- static char *fail_cl[] = { "--path", "game", NULL };
+ static char *fail_cl[] = { "-path", "game", NULL };
*out_argc = 2;
FILE *f = _wfopen(L"__cl__.cl", L"rb");
diff --git a/platform/uwp/export/export.cpp b/platform/uwp/export/export.cpp
index 68307c4e90..39717196aa 100644
--- a/platform/uwp/export/export.cpp
+++ b/platform/uwp/export/export.cpp
@@ -1330,7 +1330,7 @@ public:
}
if (!(p_flags & DEBUG_FLAG_DUMB_CLIENT)) {
- cl.push_back("--path");
+ cl.push_back("-path");
cl.push_back("game");
}
diff --git a/scene/3d/light.cpp b/scene/3d/light.cpp
index 977f1f81a7..1304954cf3 100644
--- a/scene/3d/light.cpp
+++ b/scene/3d/light.cpp
@@ -106,6 +106,16 @@ Color Light::get_shadow_color() const {
return shadow_color;
}
+void Light::set_shadow_reverse_cull_face(bool p_enable) {
+ reverse_cull = p_enable;
+ VS::get_singleton()->light_set_reverse_cull_face_mode(light, reverse_cull);
+}
+
+bool Light::get_shadow_reverse_cull_face() const {
+
+ return reverse_cull;
+}
+
Rect3 Light::get_aabb() const {
if (type == VisualServer::LIGHT_DIRECTIONAL) {
@@ -202,6 +212,9 @@ void Light::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_color", "color"), &Light::set_color);
ClassDB::bind_method(D_METHOD("get_color"), &Light::get_color);
+ ClassDB::bind_method(D_METHOD("set_shadow_reverse_cull_face", "enable"), &Light::set_shadow_reverse_cull_face);
+ ClassDB::bind_method(D_METHOD("get_shadow_reverse_cull_face"), &Light::get_shadow_reverse_cull_face);
+
ClassDB::bind_method(D_METHOD("set_shadow_color", "shadow_color"), &Light::set_shadow_color);
ClassDB::bind_method(D_METHOD("get_shadow_color"), &Light::get_shadow_color);
@@ -217,6 +230,7 @@ void Light::_bind_methods() {
ADD_PROPERTYI(PropertyInfo(Variant::REAL, "shadow_bias", PROPERTY_HINT_RANGE, "-16,16,0.01"), "set_param", "get_param", PARAM_SHADOW_BIAS);
ADD_PROPERTYI(PropertyInfo(Variant::REAL, "shadow_contact", PROPERTY_HINT_RANGE, "0,16,0.01"), "set_param", "get_param", PARAM_CONTACT_SHADOW_SIZE);
ADD_PROPERTYI(PropertyInfo(Variant::REAL, "shadow_max_distance", PROPERTY_HINT_RANGE, "0,65536,0.1"), "set_param", "get_param", PARAM_SHADOW_MAX_DISTANCE);
+ ADD_PROPERTY(PropertyInfo(Variant::BOOL, "shadow_reverse_cull_face"), "set_shadow_reverse_cull_face", "get_shadow_reverse_cull_face");
ADD_GROUP("Editor", "");
ADD_PROPERTY(PropertyInfo(Variant::BOOL, "editor_only"), "set_editor_only", "is_editor_only");
ADD_GROUP("", "");
@@ -244,6 +258,8 @@ Light::Light(VisualServer::LightType p_type) {
light = VisualServer::get_singleton()->light_create(p_type);
VS::get_singleton()->instance_set_base(get_instance(), light);
+ reverse_cull = false;
+
editor_only = false;
set_color(Color(1, 1, 1, 1));
set_shadow(false);
diff --git a/scene/3d/light.h b/scene/3d/light.h
index 22ff5c0763..788e948536 100644
--- a/scene/3d/light.h
+++ b/scene/3d/light.h
@@ -69,6 +69,7 @@ private:
Color shadow_color;
bool shadow;
bool negative;
+ bool reverse_cull;
uint32_t cull_mask;
VS::LightType type;
bool editor_only;
@@ -110,6 +111,9 @@ public:
void set_shadow_color(const Color &p_shadow_color);
Color get_shadow_color() const;
+ void set_shadow_reverse_cull_face(bool p_enable);
+ bool get_shadow_reverse_cull_face() const;
+
virtual Rect3 get_aabb() const;
virtual PoolVector<Face3> get_faces(uint32_t p_usage_flags) const;
diff --git a/scene/3d/visual_instance.cpp b/scene/3d/visual_instance.cpp
index 1a294d016a..7d61006529 100644
--- a/scene/3d/visual_instance.cpp
+++ b/scene/3d/visual_instance.cpp
@@ -231,14 +231,6 @@ void GeometryInstance::_notification(int p_what) {
void GeometryInstance::set_flag(Flags p_flag, bool p_value) {
ERR_FAIL_INDEX(p_flag, FLAG_MAX);
- if (p_flag == FLAG_CAST_SHADOW) {
- if (p_value == true) {
- set_cast_shadows_setting(SHADOW_CASTING_SETTING_ON);
- } else {
- set_cast_shadows_setting(SHADOW_CASTING_SETTING_OFF);
- }
- }
-
if (flags[p_flag] == p_value)
return;
@@ -252,14 +244,6 @@ bool GeometryInstance::get_flag(Flags p_flag) const {
ERR_FAIL_INDEX_V(p_flag, FLAG_MAX, false);
- if (p_flag == FLAG_CAST_SHADOW) {
- if (shadow_casting_setting == SHADOW_CASTING_SETTING_OFF) {
- return false;
- } else {
- return true;
- }
- }
-
return flags[p_flag];
}
@@ -330,7 +314,6 @@ void GeometryInstance::_bind_methods() {
//ADD_SIGNAL( MethodInfo("visibility_changed"));
- BIND_CONSTANT(FLAG_CAST_SHADOW);
BIND_CONSTANT(FLAG_VISIBLE_IN_ALL_ROOMS);
BIND_CONSTANT(FLAG_MAX);
@@ -350,8 +333,6 @@ GeometryInstance::GeometryInstance() {
flags[i] = false;
}
- flags[FLAG_CAST_SHADOW] = true;
-
shadow_casting_setting = SHADOW_CASTING_SETTING_ON;
extra_cull_margin = 0;
//VS::get_singleton()->instance_geometry_set_baked_light_texture_index(get_instance(),0);
diff --git a/scene/3d/visual_instance.h b/scene/3d/visual_instance.h
index 9318198e54..694d0c2499 100644
--- a/scene/3d/visual_instance.h
+++ b/scene/3d/visual_instance.h
@@ -84,7 +84,6 @@ class GeometryInstance : public VisualInstance {
public:
enum Flags {
- FLAG_CAST_SHADOW = VS::INSTANCE_FLAG_CAST_SHADOW,
FLAG_VISIBLE_IN_ALL_ROOMS = VS::INSTANCE_FLAG_VISIBLE_IN_ALL_ROOMS,
FLAG_USE_BAKED_LIGHT = VS::INSTANCE_FLAG_USE_BAKED_LIGHT,
FLAG_MAX = VS::INSTANCE_FLAG_MAX,
diff --git a/scene/gui/popup.cpp b/scene/gui/popup.cpp
index f2ba6bfbc4..b21139f969 100644
--- a/scene/gui/popup.cpp
+++ b/scene/gui/popup.cpp
@@ -276,9 +276,10 @@ void PopupPanel::set_child_rect(Control *p_child) {
Ref<StyleBox> p = get_stylebox("panel");
p_child->set_area_as_parent_rect();
- for (int i = 0; i < 4; i++) {
- p_child->set_margin(Margin(i), p->get_margin(Margin(i)));
- }
+ p_child->set_margin(MARGIN_LEFT, p->get_margin(MARGIN_LEFT));
+ p_child->set_margin(MARGIN_RIGHT, -p->get_margin(MARGIN_RIGHT));
+ p_child->set_margin(MARGIN_TOP, p->get_margin(MARGIN_TOP));
+ p_child->set_margin(MARGIN_BOTTOM, -p->get_margin(MARGIN_BOTTOM));
}
void PopupPanel::_notification(int p_what) {
diff --git a/servers/visual/rasterizer.h b/servers/visual/rasterizer.h
index 5c5ff1c057..3b4ba313e6 100644
--- a/servers/visual/rasterizer.h
+++ b/servers/visual/rasterizer.h
@@ -331,6 +331,7 @@ public:
virtual void light_set_projector(RID p_light, RID p_texture) = 0;
virtual void light_set_negative(RID p_light, bool p_enable) = 0;
virtual void light_set_cull_mask(RID p_light, uint32_t p_mask) = 0;
+ virtual void light_set_reverse_cull_face_mode(RID p_light, bool p_enabled) = 0;
virtual void light_omni_set_shadow_mode(RID p_light, VS::LightOmniShadowMode p_mode) = 0;
virtual void light_omni_set_shadow_detail(RID p_light, VS::LightOmniShadowDetail p_detail) = 0;
diff --git a/servers/visual/visual_server_raster.h b/servers/visual/visual_server_raster.h
index 0cb832e39a..fff37a71b3 100644
--- a/servers/visual/visual_server_raster.h
+++ b/servers/visual/visual_server_raster.h
@@ -786,6 +786,7 @@ public:
BIND2(light_set_projector, RID, RID)
BIND2(light_set_negative, RID, bool)
BIND2(light_set_cull_mask, RID, uint32_t)
+ BIND2(light_set_reverse_cull_face_mode, RID, bool)
BIND2(light_omni_set_shadow_mode, RID, LightOmniShadowMode)
BIND2(light_omni_set_shadow_detail, RID, LightOmniShadowDetail)
diff --git a/servers/visual/visual_server_scene.cpp b/servers/visual/visual_server_scene.cpp
index ab32567d4f..fb298e3ed7 100644
--- a/servers/visual/visual_server_scene.cpp
+++ b/servers/visual/visual_server_scene.cpp
@@ -978,16 +978,6 @@ void VisualServerScene::instance_geometry_set_flag(RID p_instance, VS::InstanceF
switch (p_flags) {
- case VS::INSTANCE_FLAG_CAST_SHADOW: {
- if (p_enabled == true) {
- instance->cast_shadows = VS::SHADOW_CASTING_SETTING_ON;
- } else {
- instance->cast_shadows = VS::SHADOW_CASTING_SETTING_OFF;
- }
-
- instance->base_material_changed(); // to actually compute if shadows are visible or not
-
- } break;
case VS::INSTANCE_FLAG_VISIBLE_IN_ALL_ROOMS: {
instance->visible_in_all_rooms = p_enabled;
@@ -1001,6 +991,12 @@ void VisualServerScene::instance_geometry_set_flag(RID p_instance, VS::InstanceF
}
}
void VisualServerScene::instance_geometry_set_cast_shadows_setting(RID p_instance, VS::ShadowCastingSetting p_shadow_casting_setting) {
+
+ Instance *instance = instance_owner.get(p_instance);
+ ERR_FAIL_COND(!instance);
+
+ instance->cast_shadows = p_shadow_casting_setting;
+ instance->base_material_changed(); // to actually compute if shadows are visible or not
}
void VisualServerScene::instance_geometry_set_material_override(RID p_instance, RID p_material) {
diff --git a/servers/visual/visual_server_wrap_mt.h b/servers/visual/visual_server_wrap_mt.h
index f531ecd0fd..ca040e9355 100644
--- a/servers/visual/visual_server_wrap_mt.h
+++ b/servers/visual/visual_server_wrap_mt.h
@@ -225,6 +225,7 @@ public:
FUNC2(light_set_projector, RID, RID)
FUNC2(light_set_negative, RID, bool)
FUNC2(light_set_cull_mask, RID, uint32_t)
+ FUNC2(light_set_reverse_cull_face_mode, RID, bool)
FUNC2(light_omni_set_shadow_mode, RID, LightOmniShadowMode)
FUNC2(light_omni_set_shadow_detail, RID, LightOmniShadowDetail)
diff --git a/servers/visual_server.h b/servers/visual_server.h
index ab74055552..5e0a390a21 100644
--- a/servers/visual_server.h
+++ b/servers/visual_server.h
@@ -371,6 +371,7 @@ public:
virtual void light_set_projector(RID p_light, RID p_texture) = 0;
virtual void light_set_negative(RID p_light, bool p_enable) = 0;
virtual void light_set_cull_mask(RID p_light, uint32_t p_mask) = 0;
+ virtual void light_set_reverse_cull_face_mode(RID p_light, bool p_enabled) = 0;
// omni light
enum LightOmniShadowMode {
@@ -743,7 +744,6 @@ public:
virtual Vector<ObjectID> instances_cull_convex(const Vector<Plane> &p_convex, RID p_scenario = RID()) const = 0;
enum InstanceFlags {
- INSTANCE_FLAG_CAST_SHADOW,
INSTANCE_FLAG_VISIBLE_IN_ALL_ROOMS,
INSTANCE_FLAG_USE_BAKED_LIGHT,
INSTANCE_FLAG_MAX