summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--SConstruct3
-rw-r--r--core/ustring.cpp2
-rw-r--r--doc/classes/String.xml2
-rw-r--r--methods.py2
-rw-r--r--modules/SCsub8
-rw-r--r--modules/gdscript/gdscript_editor.cpp4
-rw-r--r--modules/gdscript/gdscript_parser.cpp2
-rw-r--r--scene/main/viewport.cpp125
-rw-r--r--scene/main/viewport.h9
-rw-r--r--servers/visual_server.cpp14
-rw-r--r--version.py2
11 files changed, 25 insertions, 148 deletions
diff --git a/SConstruct b/SConstruct
index dcf8134c93..f71c6a397c 100644
--- a/SConstruct
+++ b/SConstruct
@@ -90,6 +90,7 @@ env_base.android_appattributes_chunk = ""
env_base.disabled_modules = []
env_base.use_ptrcall = False
env_base.split_drivers = False
+env_base.split_modules = False
env_base.module_version_string = ""
# To decide whether to rebuild a file, use the MD5 sum only if the timestamp has changed.
@@ -289,6 +290,8 @@ if selected_platform in platform_list:
basename = basename.replace('\\\\', '/')
if os.path.isfile(basename + ".h"):
env.vs_incs = env.vs_incs + [basename + ".h"]
+ elif os.path.isfile(basename + ".hpp"):
+ env.vs_incs = env.vs_incs + [basename + ".hpp"]
if os.path.isfile(basename + ".c"):
env.vs_srcs = env.vs_srcs + [basename + ".c"]
elif os.path.isfile(basename + ".cpp"):
diff --git a/core/ustring.cpp b/core/ustring.cpp
index 7aa2b012de..d445e4ed47 100644
--- a/core/ustring.cpp
+++ b/core/ustring.cpp
@@ -3167,7 +3167,7 @@ String String::http_unescape() const {
if ((ord1 >= '0' && ord1 <= '9') || (ord1 >= 'A' && ord1 <= 'Z')) {
CharType ord2 = ord_at(i + 2);
if ((ord2 >= '0' && ord2 <= '9') || (ord2 >= 'A' && ord2 <= 'Z')) {
- char bytes[2] = { ord1, ord2 };
+ char bytes[2] = { (char)ord1, (char)ord2 };
res += (char)strtol(bytes, NULL, 16);
i += 2;
}
diff --git a/doc/classes/String.xml b/doc/classes/String.xml
index 19ab367257..73d3da39c6 100644
--- a/doc/classes/String.xml
+++ b/doc/classes/String.xml
@@ -321,7 +321,7 @@
<argument index="0" name="what" type="String">
</argument>
<description>
- Finds the last occurrence of a substring. Returns the starting position of the substring or -1 if not found. Optionally, the initial search index can be passed.
+ Finds the last occurrence of a substring. Returns the starting position of the substring or -1 if not found.
</description>
</method>
<method name="findn">
diff --git a/methods.py b/methods.py
index 892fa8cfc3..a8f1fb8a5d 100644
--- a/methods.py
+++ b/methods.py
@@ -1598,7 +1598,7 @@ def detect_visual_c_compiler_version(tools_env):
# and not scons setup environment (env)... so make sure you call the right environment on it or it will fail to detect
# the proper vc version that will be called
- # These is no flag to give to visual c compilers to set the architecture, ie scons bits argument (32,64,ARM etc)
+ # There is no flag to give to visual c compilers to set the architecture, ie scons bits argument (32,64,ARM etc)
# There are many different cl.exe files that are run, and each one compiles & links to a different architecture
# As far as I know, the only way to figure out what compiler will be run when Scons calls cl.exe via Program()
# is to check the PATH variable and figure out which one will be called first. Code bellow does that and returns:
diff --git a/modules/SCsub b/modules/SCsub
index e3c535e981..7a467676cd 100644
--- a/modules/SCsub
+++ b/modules/SCsub
@@ -17,6 +17,10 @@ for x in env.module_list:
env_modules.Append(CPPFLAGS=["-DMODULE_" + x.upper() + "_ENABLED"])
SConscript(x + "/SCsub")
-lib = env_modules.add_library("modules", env.modules_sources)
+if env.split_modules:
+ env.split_lib("modules")
+else:
-env.Prepend(LIBS=[lib])
+ lib = env_modules.add_library("modules", env.modules_sources)
+
+ env.Prepend(LIBS=[lib])
diff --git a/modules/gdscript/gdscript_editor.cpp b/modules/gdscript/gdscript_editor.cpp
index 8154fe2b6d..c4269ab4a9 100644
--- a/modules/gdscript/gdscript_editor.cpp
+++ b/modules/gdscript/gdscript_editor.cpp
@@ -2450,8 +2450,10 @@ Error GDScriptLanguage::complete_code(const String &p_code, const String &p_base
} break;
case GDScriptParser::COMPLETION_RESOURCE_PATH: {
- if (EditorSettings::get_singleton()->get("text_editor/completion/complete_file_paths"))
+ if (EditorSettings::get_singleton()->get("text_editor/completion/complete_file_paths")) {
get_directory_contents(EditorFileSystem::get_singleton()->get_filesystem(), options);
+ r_forced = true;
+ }
} break;
case GDScriptParser::COMPLETION_ASSIGN: {
#if defined(DEBUG_METHODS_ENABLED) && defined(TOOLS_ENABLED)
diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp
index ed21194dd3..75fb7e15c4 100644
--- a/modules/gdscript/gdscript_parser.cpp
+++ b/modules/gdscript/gdscript_parser.cpp
@@ -460,7 +460,7 @@ GDScriptParser::Node *GDScriptParser::_parse_expression(Node *p_parent, bool p_s
//this can be too slow for just validating code
if (for_completion && ScriptCodeCompletionCache::get_singleton()) {
res = ScriptCodeCompletionCache::get_singleton()->get_cached_resource(path);
- } else {
+ } else if (FileAccess::exists(path)) {
res = ResourceLoader::load(path);
}
if (!res.is_valid()) {
diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp
index 1a2ea796bd..1ff1f4b6d8 100644
--- a/scene/main/viewport.cpp
+++ b/scene/main/viewport.cpp
@@ -196,8 +196,6 @@ void Viewport::_update_stretch_transform() {
if (size_override_stretch && size_override) {
- //print_line("sive override size "+size_override_size);
- //print_line("rect size "+size);
stretch_transform = Transform2D();
Size2 scale = size / (size_override_size + size_override_margin * 2);
stretch_transform.scale(scale);
@@ -211,114 +209,6 @@ void Viewport::_update_stretch_transform() {
_update_global_transform();
}
-void Viewport::_update_rect() {
-
- if (!is_inside_tree())
- return;
-
- /*if (!render_target && parent_control) {
-
- Control *c = parent_control;
-
- rect.pos=Point2();
- rect.size=c->get_size();
- }*/
- /*
- VisualServer::ViewportRect vr;
- vr.x=rect.pos.x;
- vr.y=rect.pos.y;
-
- if (render_target) {
- vr.x=0;
- vr.y=0;
- }
- vr.width=rect.size.width;
- vr.height=rect.size.height;
-
- VisualServer::get_singleton()->viewport_set_rect(viewport,vr);
- last_vp_rect=rect;
-
- if (canvas_item.is_valid()) {
- VisualServer::get_singleton()->canvas_item_set_custom_rect(canvas_item,true,rect);
- }
-
- emit_signal("size_changed");
- texture->emit_changed();
-*/
-}
-
-void Viewport::_parent_resized() {
-
- _update_rect();
-}
-
-void Viewport::_parent_draw() {
-}
-
-void Viewport::_parent_visibility_changed() {
-
- /*
- if (parent_control) {
-
- Control *c = parent_control;
- VisualServer::get_singleton()->canvas_item_set_visible(canvas_item,c->is_visible_in_tree());
-
- _update_listener();
- _update_listener_2d();
- }
-*/
-}
-
-void Viewport::_vp_enter_tree() {
-
- /* if (parent_control) {
-
- Control *cparent=parent_control;
- RID parent_ci = cparent->get_canvas_item();
- ERR_FAIL_COND(!parent_ci.is_valid());
- canvas_item = VisualServer::get_singleton()->canvas_item_create();
-
- VisualServer::get_singleton()->canvas_item_set_parent(canvas_item,parent_ci);
- VisualServer::get_singleton()->canvas_item_set_visible(canvas_item,false);
- //VisualServer::get_singleton()->canvas_item_attach_viewport(canvas_item,viewport);
- parent_control->connect("resized",this,"_parent_resized");
- parent_control->connect("visibility_changed",this,"_parent_visibility_changed");
- } else if (!parent){
-
- //VisualServer::get_singleton()->viewport_attach_to_screen(viewport,0);
-
- }
-*/
-}
-
-void Viewport::_vp_exit_tree() {
-
- /*
- if (parent_control) {
-
- parent_control->disconnect("resized",this,"_parent_resized");
- }
-
- if (parent_control) {
-
- parent_control->disconnect("visibility_changed",this,"_parent_visibility_changed");
- }
-
- if (canvas_item.is_valid()) {
-
- VisualServer::get_singleton()->free(canvas_item);
- canvas_item=RID();
-
- }
-
- if (!parent) {
-
- VisualServer::get_singleton()->viewport_detach(viewport);
-
- }
-*/
-}
-
void Viewport::update_worlds() {
if (!is_inside_tree())
@@ -376,7 +266,6 @@ void Viewport::_notification(int p_what) {
_update_listener();
_update_listener_2d();
- _update_rect();
find_world_2d()->_register_viewport(this, Rect2());
@@ -436,11 +325,6 @@ void Viewport::_notification(int p_what) {
if (world_2d.is_valid())
world_2d->_remove_viewport(this);
- /*
- if (!render_target)
- _vp_exit_tree();
- */
-
VisualServer::get_singleton()->viewport_set_scenario(viewport, RID());
// SpatialSoundServer::get_singleton()->listener_set_space(internal_listener, RID());
VisualServer::get_singleton()->viewport_remove_canvas(viewport, current_canvas);
@@ -718,7 +602,6 @@ void Viewport::set_size(const Size2 &p_size) {
size = p_size.floor();
VS::get_singleton()->viewport_set_size(viewport, size.width, size.height);
- _update_rect();
_update_stretch_transform();
emit_signal("size_changed");
@@ -1167,7 +1050,7 @@ void Viewport::set_size_override(bool p_enable, const Size2 &p_size, const Vecto
size_override_size = p_size;
}
size_override_margin = p_margin;
- _update_rect();
+
_update_stretch_transform();
emit_signal("size_changed");
}
@@ -1186,9 +1069,6 @@ void Viewport::set_size_override_stretch(bool p_enable) {
return;
size_override_stretch = p_enable;
- if (size_override) {
- _update_rect();
- }
_update_stretch_transform();
}
@@ -2684,9 +2564,6 @@ void Viewport::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_transparent_background", "enable"), &Viewport::set_transparent_background);
ClassDB::bind_method(D_METHOD("has_transparent_background"), &Viewport::has_transparent_background);
- ClassDB::bind_method(D_METHOD("_parent_visibility_changed"), &Viewport::_parent_visibility_changed);
-
- ClassDB::bind_method(D_METHOD("_parent_resized"), &Viewport::_parent_resized);
ClassDB::bind_method(D_METHOD("_vp_input"), &Viewport::_vp_input);
ClassDB::bind_method(D_METHOD("_vp_input_text", "text"), &Viewport::_vp_input_text);
ClassDB::bind_method(D_METHOD("_vp_unhandled_input"), &Viewport::_vp_unhandled_input);
diff --git a/scene/main/viewport.h b/scene/main/viewport.h
index 48e2929e54..07bbd3f1fa 100644
--- a/scene/main/viewport.h
+++ b/scene/main/viewport.h
@@ -206,12 +206,6 @@ private:
void _test_new_mouseover(ObjectID new_collider);
Map<ObjectID, uint64_t> physics_2d_mouseover;
- void _update_rect();
-
- void _parent_resized();
- void _parent_draw();
- void _parent_visibility_changed();
-
Ref<World2D> world_2d;
Ref<World> world;
Ref<World> own_world;
@@ -294,9 +288,6 @@ private:
_FORCE_INLINE_ Transform2D _get_input_pre_xform() const;
- void _vp_enter_tree();
- void _vp_exit_tree();
-
void _vp_input(const Ref<InputEvent> &p_ev);
void _vp_input_text(const String &p_text);
void _vp_unhandled_input(const Ref<InputEvent> &p_ev);
diff --git a/servers/visual_server.cpp b/servers/visual_server.cpp
index c689fda17c..faa8c50837 100644
--- a/servers/visual_server.cpp
+++ b/servers/visual_server.cpp
@@ -441,9 +441,9 @@ Error VisualServer::_surface_set_data(Array p_arrays, uint32_t p_format, uint32_
for (int i = 0; i < p_vertex_array_len; i++) {
int8_t vector[4] = {
- CLAMP(src[i].x * 127, -128, 127),
- CLAMP(src[i].y * 127, -128, 127),
- CLAMP(src[i].z * 127, -128, 127),
+ (int8_t)CLAMP(src[i].x * 127, -128, 127),
+ (int8_t)CLAMP(src[i].y * 127, -128, 127),
+ (int8_t)CLAMP(src[i].z * 127, -128, 127),
0,
};
@@ -476,10 +476,10 @@ Error VisualServer::_surface_set_data(Array p_arrays, uint32_t p_format, uint32_
for (int i = 0; i < p_vertex_array_len; i++) {
uint8_t xyzw[4] = {
- CLAMP(src[i * 4 + 0] * 127, -128, 127),
- CLAMP(src[i * 4 + 1] * 127, -128, 127),
- CLAMP(src[i * 4 + 2] * 127, -128, 127),
- CLAMP(src[i * 4 + 3] * 127, -128, 127)
+ (uint8_t)CLAMP(src[i * 4 + 0] * 127, -128, 127),
+ (uint8_t)CLAMP(src[i * 4 + 1] * 127, -128, 127),
+ (uint8_t)CLAMP(src[i * 4 + 2] * 127, -128, 127),
+ (uint8_t)CLAMP(src[i * 4 + 3] * 127, -128, 127)
};
copymem(&vw[p_offsets[ai] + i * p_stride], xyzw, 4);
diff --git a/version.py b/version.py
index 8a6ee63e49..82a60f3bce 100644
--- a/version.py
+++ b/version.py
@@ -2,5 +2,5 @@ short_name = "godot"
name = "Godot Engine"
major = 3
minor = 0
-status = "rc1"
+status = "rc2"
module_config = ""