diff options
-rw-r--r-- | CONTRIBUTING.md | 24 | ||||
-rw-r--r-- | core/os/copymem.cpp | 42 | ||||
-rw-r--r-- | core/os/copymem.h | 87 | ||||
-rw-r--r-- | modules/webm/libvpx/SCsub | 7 | ||||
-rw-r--r-- | platform/server/detect.py | 1 | ||||
-rw-r--r-- | platform/x11/detect.py | 1 | ||||
-rw-r--r-- | scene/main/instance_placeholder.cpp | 19 | ||||
-rw-r--r-- | scene/main/instance_placeholder.h | 2 | ||||
-rw-r--r-- | thirdparty/libvpx/vpx_config.h | 6 |
9 files changed, 61 insertions, 128 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 887fe93779..fc088ab14b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -54,6 +54,30 @@ Also try to make commits that bring the engine from one stable state to another This git style guide has some good practices to have in mind: https://github.com/agis-/git-style-guide +#### Format your commit logs with readability in mind + +The way you format your commit logs is quite important to ensure that the commit history and changelog will be easy to read and understand. A git commit log is formatted as a short title (first line) and an extended description (everything after the first line and an empty separation line). + +The short title is the most important part, as it is what will appear in the `shortlog` changelog (one line per commit, so no description shown) or in the GitHub interface unless you click the "expand" button. As the name tells it, try to keep that first line relatively short (ideally <= 50 chars, though it's rare to be able to tell enough in so few characters, so you can go a bit higher) - it should describe what the commit does globally, while details would go in the description. Typically, if you can't keep the title short because you have too much stuff to mention, it means that you should probably split your changes in several commits :) + +Here's an example of a well-formatted commit log (note how the extended description is also manually wrapped at 80 chars for readability): + +``` +Prevent French fries carbonization by fixing heat regulation + +When using the French fries frying module, Godot would not regulate the heat +and thus bring the oil bath to supercritical liquid conditions, thus causing +unwanted side effects in the physics engine. + +By fixing the regulation system via an added binding to the internal feature, +this commit now ensures that Godot will not go past the ebullition temperature +of cooking oil under normal atmosheric conditions. + +Fixes #1789, long live the Realm! +``` + +*Note:* When using the GitHub online editor (or worse, the drag and drop feature), *please* edit the commit title to something meaningful. Commits named "Update my_file.cpp" will not be accepted. + Thanks! The Godot development team diff --git a/core/os/copymem.cpp b/core/os/copymem.cpp deleted file mode 100644 index 49f53f1a51..0000000000 --- a/core/os/copymem.cpp +++ /dev/null @@ -1,42 +0,0 @@ -/*************************************************************************/ -/* copymem.cpp */ -/*************************************************************************/ -/* This file is part of: */ -/* GODOT ENGINE */ -/* http://www.godotengine.org */ -/*************************************************************************/ -/* Copyright (c) 2007-2016 Juan Linietsky, Ariel Manzur. */ -/* */ -/* Permission is hereby granted, free of charge, to any person obtaining */ -/* a copy of this software and associated documentation files (the */ -/* "Software"), to deal in the Software without restriction, including */ -/* without limitation the rights to use, copy, modify, merge, publish, */ -/* distribute, sublicense, and/or sell copies of the Software, and to */ -/* permit persons to whom the Software is furnished to do so, subject to */ -/* the following conditions: */ -/* */ -/* The above copyright notice and this permission notice shall be */ -/* included in all copies or substantial portions of the Software. */ -/* */ -/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ -/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ -/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/ -/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ -/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ -/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ -/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/*************************************************************************/ -#include "copymem.h" - -#include <string.h> - -void movemem_system(void *to, void *from,int amount) { - - memmove(to,from,amount); - -} - -void zeromem(void* p_mem,size_t p_bytes) { - - memset(p_mem,0,p_bytes); -} diff --git a/core/os/copymem.h b/core/os/copymem.h index d7fc46aae4..4b9554519a 100644 --- a/core/os/copymem.h +++ b/core/os/copymem.h @@ -31,89 +31,18 @@ #include "typedefs.h" -///@TODO use optimized routines for this, depending on platform. these are just the standard ones +#ifdef PLATFORM_COPYMEM -#define copymem(m_to,m_from,m_count) \ - do { \ - unsigned char * _from=(unsigned char*)m_from; \ - unsigned char * _to=(unsigned char*)m_to; \ - int _count=m_count; \ - for (int _i=0;_i<_count;_i++) \ - _to[_i]=_from[_i]; \ - } while (0); - /* - case 0: *_dto++ = *_dfrom++; \ - case 7: *_dto++ = *_dfrom++; \ - case 6: *_dto++ = *_dfrom++; \ - case 5: *_dto++ = *_dfrom++; \ - case 4: *_dto++ = *_dfrom++; \ - case 3: *_dto++ = *_dfrom++; \ - case 2: *_dto++ = *_dfrom++; \ - case 1: *_dto++ = *_dfrom++; \ - */ -#define movemem_duff(m_to, m_from, m_count) \ - do { \ - if (m_to<m_from) { \ - unsigned char* _dto = (unsigned char*)m_to; \ - unsigned char* _dfrom = (unsigned char*)m_from; \ - int n = (m_count + 7) / 8; \ - switch (m_count % 8) { \ - do { \ - case 0: *_dto++ = *_dfrom++; \ - case 7: *_dto++ = *_dfrom++; \ - case 6: *_dto++ = *_dfrom++; \ - case 5: *_dto++ = *_dfrom++; \ - case 4: *_dto++ = *_dfrom++; \ - case 3: *_dto++ = *_dfrom++; \ - case 2: *_dto++ = *_dfrom++; \ - case 1: *_dto++ = *_dfrom++; \ - } while (--n > 0); \ - }; \ - } else if (m_to>m_from) { \ - unsigned char* _dto = &((unsigned char*)m_to)[m_count-1]; \ - unsigned char* _dfrom = &((unsigned char*)m_from)[m_count-1]; \ - int n = (m_count + 7) / 8; \ - switch (m_count % 8) { \ - do { \ - case 0: *_dto-- = *_dfrom--; \ - case 7: *_dto-- = *_dfrom--; \ - case 6: *_dto-- = *_dfrom--; \ - case 5: *_dto-- = *_dfrom--; \ - case 4: *_dto-- = *_dfrom--; \ - case 3: *_dto-- = *_dfrom--; \ - case 2: *_dto-- = *_dfrom--; \ - case 1: *_dto-- = *_dfrom--; \ - } while (--n > 0); \ - }; \ - } \ - } while(0) \ +#include "platform_copymem.h" // included from platform/<current_platform>/platform_copymem.h" -#define movemem_conventional(m_to,m_from,m_count) \ - do { \ - if (m_to<m_from) { \ - unsigned char * _from=(unsigned char*)m_from; \ - unsigned char * _to=(unsigned char*)m_to; \ - int _count=m_count; \ - for (int _i=0;_i<_count;_i++) \ - _to[_i]=_from[_i]; \ - \ - } else if (m_to>m_from) { \ - unsigned char * _from=(unsigned char*)m_from; \ - unsigned char * _to=(unsigned char*)m_to; \ - int _count=m_count; \ - while (_count--) \ - _to[_count]=_from[_count]; \ - \ - \ - } \ - } while (0); \ +#else -void movemem_system(void*,void*,int); +#include <string.h> -#define movemem movemem_system - - -void zeromem(void* p_mem,size_t p_bytes); +#define copymem(to,from,count) memcpy(to,from,count) +#define zeromem(to, count) memset(to, 0, count) +#define movemem(to, from, count) memmove(to, from, count) #endif +#endif diff --git a/modules/webm/libvpx/SCsub b/modules/webm/libvpx/SCsub index 365cabd072..a6b9e46ee8 100644 --- a/modules/webm/libvpx/SCsub +++ b/modules/webm/libvpx/SCsub @@ -263,14 +263,15 @@ if env["platform"] == 'uwp': else: webm_cpu_x86 = True else: + is_ios_x86 = (env["platform"] == 'iphone' and env["ios_sim"] == "yes") is_android_x86 = (env["platform"] == 'android' and env["android_arch"] == 'x86') if is_android_x86: cpu_bits = '32' if osx_fat: webm_cpu_x86 = True else: - webm_cpu_x86 = (cpu_bits == '32' or cpu_bits == '64') and (env["platform"] == 'windows' or env["platform"] == 'x11' or env["platform"] == 'osx' or env["platform"] == 'haiku' or is_android_x86) - webm_cpu_arm = env["platform"] == 'iphone' or env["platform"] == 'bb10' or (env["platform"] == 'android' and env["android_arch"] != 'x86') + webm_cpu_x86 = (cpu_bits == '32' or cpu_bits == '64') and (env["platform"] == 'windows' or env["platform"] == 'x11' or env["platform"] == 'osx' or env["platform"] == 'haiku' or is_android_x86 or is_ios_x86) + webm_cpu_arm = (not is_ios_x86 and env["platform"] == 'iphone') or env["platform"] == 'bb10' or (not is_android_x86 and env["platform"] == 'android') if webm_cpu_x86: import subprocess @@ -308,7 +309,7 @@ if webm_cpu_x86: else: if env["platform"] == 'windows' or env["platform"] == 'uwp': env_libvpx["ASFORMAT"] = 'win' - elif env["platform"] == 'osx': + elif env["platform"] == 'osx' or env["platform"] == "iphone": env_libvpx["ASFORMAT"] = 'macho' else: env_libvpx["ASFORMAT"] = 'elf' diff --git a/platform/server/detect.py b/platform/server/detect.py index 4d86ffd376..8bc85f342d 100644 --- a/platform/server/detect.py +++ b/platform/server/detect.py @@ -76,7 +76,6 @@ def configure(env): env.ParseConfig('pkg-config libwebp --cflags --libs') if (env['builtin_freetype'] == 'no'): - env['builtin_libpng'] = 'no' # Freetype links against libpng env.ParseConfig('pkg-config freetype2 --cflags --libs') if (env['builtin_libpng'] == 'no'): diff --git a/platform/x11/detect.py b/platform/x11/detect.py index d8cd79297e..857b147e14 100644 --- a/platform/x11/detect.py +++ b/platform/x11/detect.py @@ -140,7 +140,6 @@ def configure(env): env.ParseConfig('pkg-config libwebp --cflags --libs') if (env['builtin_freetype'] == 'no'): - env['builtin_libpng'] = 'no' # Freetype links against libpng env.ParseConfig('pkg-config freetype2 --cflags --libs') if (env['builtin_libpng'] == 'no'): diff --git a/scene/main/instance_placeholder.cpp b/scene/main/instance_placeholder.cpp index fb047ea5e4..15045a73d5 100644 --- a/scene/main/instance_placeholder.cpp +++ b/scene/main/instance_placeholder.cpp @@ -101,11 +101,28 @@ void InstancePlaceholder::replace_by_instance(const Ref<PackedScene> &p_custom_s base->remove_child(this); base->add_child(scene); base->move_child(scene,pos); - } +Dictionary InstancePlaceholder::get_stored_values(bool p_with_order) { + + Dictionary ret; + StringArray order; + + for(List<PropSet>::Element *E=stored_values.front();E;E=E->next()) { + ret[E->get().name] = E->get().value; + if (p_with_order) + order.push_back(E->get().name); + }; + + if (p_with_order) + ret[".order"] = order; + + return ret; +}; + void InstancePlaceholder::_bind_methods() { + ObjectTypeDB::bind_method(_MD("get_stored_values","with_order"),&InstancePlaceholder::get_stored_values,DEFVAL(false)); ObjectTypeDB::bind_method(_MD("replace_by_instance","custom_scene:PackedScene"),&InstancePlaceholder::replace_by_instance,DEFVAL(Variant())); ObjectTypeDB::bind_method(_MD("get_instance_path"),&InstancePlaceholder::get_instance_path); } diff --git a/scene/main/instance_placeholder.h b/scene/main/instance_placeholder.h index ef76686196..cacba49b39 100644 --- a/scene/main/instance_placeholder.h +++ b/scene/main/instance_placeholder.h @@ -57,6 +57,8 @@ public: void set_instance_path(const String& p_name); String get_instance_path() const; + Dictionary get_stored_values(bool p_with_order = false); + void replace_by_instance(const Ref<PackedScene>& p_custom_scene=Ref<PackedScene>()); InstancePlaceholder(); diff --git a/thirdparty/libvpx/vpx_config.h b/thirdparty/libvpx/vpx_config.h index 7058f0327b..9ed45d4006 100644 --- a/thirdparty/libvpx/vpx_config.h +++ b/thirdparty/libvpx/vpx_config.h @@ -9,7 +9,11 @@ #ifndef VPX_CONFIG_H #define VPX_CONFIG_H #define RESTRICT -#define INLINE inline +#if defined(_MSC_VER) && (_MSC_VER < 1900) + #define INLINE __inline +#else + #define INLINE inline +#endif #define HAVE_MIPS32 0 #define HAVE_MEDIA 0 |