mirror of
https://github.com/godotengine/godot.git
synced 2024-11-21 19:42:43 +00:00
simplify formatting scripts, add a clang-tidy script, and run clang-tidy
This commit is contained in:
parent
01f5d7c616
commit
8a0a3accee
@ -1,10 +1,9 @@
|
|||||||
---
|
---
|
||||||
Checks: 'clang-diagnostic-*,clang-analyzer-*,-*,modernize-redundant-void-arg,modernize-use-bool-literals,modernize-use-default-member-init,modernize-use-nullptr,readability-braces-around-statements'
|
Checks: 'clang-diagnostic-*,clang-analyzer-*,-*,modernize-redundant-void-arg,modernize-use-bool-literals,modernize-use-default-member-init,modernize-use-nullptr,readability-braces-around-statements'
|
||||||
WarningsAsErrors: ''
|
WarningsAsErrors: ''
|
||||||
HeaderFilterRegex: '.*'
|
HeaderFilterRegex: ''
|
||||||
AnalyzeTemporaryDtors: false
|
AnalyzeTemporaryDtors: false
|
||||||
FormatStyle: none
|
FormatStyle: none
|
||||||
CheckOptions:
|
|
||||||
CheckOptions:
|
CheckOptions:
|
||||||
- key: cert-dcl16-c.NewSuffixes
|
- key: cert-dcl16-c.NewSuffixes
|
||||||
value: 'L;LL;LU;LLU'
|
value: 'L;LL;LU;LLU'
|
||||||
|
@ -1221,8 +1221,9 @@ String InputEventScreenDrag::to_string() {
|
|||||||
|
|
||||||
bool InputEventScreenDrag::accumulate(const Ref<InputEvent> &p_event) {
|
bool InputEventScreenDrag::accumulate(const Ref<InputEvent> &p_event) {
|
||||||
Ref<InputEventScreenDrag> drag = p_event;
|
Ref<InputEventScreenDrag> drag = p_event;
|
||||||
if (drag.is_null())
|
if (drag.is_null()) {
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (get_index() != drag->get_index()) {
|
if (get_index() != drag->get_index()) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -700,8 +700,9 @@ public:
|
|||||||
static String get_category_static() { return String(); }
|
static String get_category_static() { return String(); }
|
||||||
|
|
||||||
virtual String get_class() const {
|
virtual String get_class() const {
|
||||||
if (_extension)
|
if (_extension) {
|
||||||
return _extension->class_name.operator String();
|
return _extension->class_name.operator String();
|
||||||
|
}
|
||||||
return "Object";
|
return "Object";
|
||||||
}
|
}
|
||||||
virtual String get_save_class() const { return get_class(); } //class stored when saving
|
virtual String get_save_class() const { return get_class(); } //class stored when saving
|
||||||
|
@ -184,7 +184,7 @@ void RasterizerCanvasGLES3::canvas_render_items(RID p_to_render_target, Item *p_
|
|||||||
}
|
}
|
||||||
|
|
||||||
state.current_tex = RID();
|
state.current_tex = RID();
|
||||||
state.current_tex_ptr = NULL;
|
state.current_tex_ptr = nullptr;
|
||||||
state.current_normal = RID();
|
state.current_normal = RID();
|
||||||
state.current_specular = RID();
|
state.current_specular = RID();
|
||||||
state.canvas_texscreen_used = false;
|
state.canvas_texscreen_used = false;
|
||||||
@ -233,13 +233,13 @@ void RasterizerCanvasGLES3::_render_items(RID p_to_render_target, int p_item_cou
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (material != prev_material) {
|
if (material != prev_material) {
|
||||||
RasterizerStorageGLES3::Shader *shader_ptr = NULL;
|
RasterizerStorageGLES3::Shader *shader_ptr = nullptr;
|
||||||
|
|
||||||
if (material_ptr) {
|
if (material_ptr) {
|
||||||
shader_ptr = material_ptr->shader;
|
shader_ptr = material_ptr->shader;
|
||||||
|
|
||||||
if (shader_ptr && shader_ptr->mode != RS::SHADER_CANVAS_ITEM) {
|
if (shader_ptr && shader_ptr->mode != RS::SHADER_CANVAS_ITEM) {
|
||||||
shader_ptr = NULL; // not a canvas item shader, don't use.
|
shader_ptr = nullptr; // not a canvas item shader, don't use.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -295,8 +295,9 @@ void RasterizerCanvasGLES3::_render_items(RID p_to_render_target, int p_item_cou
|
|||||||
t->detect_normal(t->detect_normal_ud);
|
t->detect_normal(t->detect_normal_ud);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (t->render_target)
|
if (t->render_target) {
|
||||||
t->render_target->used_in_frame = true;
|
t->render_target->used_in_frame = true;
|
||||||
|
}
|
||||||
|
|
||||||
glBindTexture(t->target, t->tex_id);
|
glBindTexture(t->target, t->tex_id);
|
||||||
}
|
}
|
||||||
@ -582,7 +583,7 @@ void RasterizerCanvasGLES3::_render_item(RID p_render_target, const Item *p_item
|
|||||||
static const GLenum prim[5] = { GL_POINTS, GL_LINES, GL_LINE_STRIP, GL_TRIANGLES, GL_TRIANGLE_STRIP };
|
static const GLenum prim[5] = { GL_POINTS, GL_LINES, GL_LINE_STRIP, GL_TRIANGLES, GL_TRIANGLE_STRIP };
|
||||||
|
|
||||||
if (pb->index_buffer != 0) {
|
if (pb->index_buffer != 0) {
|
||||||
glDrawElements(prim[polygon->primitive], pb->count, GL_UNSIGNED_INT, 0);
|
glDrawElements(prim[polygon->primitive], pb->count, GL_UNSIGNED_INT, nullptr);
|
||||||
} else {
|
} else {
|
||||||
glDrawArrays(prim[polygon->primitive], 0, pb->count);
|
glDrawArrays(prim[polygon->primitive], 0, pb->count);
|
||||||
}
|
}
|
||||||
@ -946,7 +947,7 @@ void RasterizerCanvasGLES3::_bind_canvas_texture(RID p_texture, RS::CanvasItemTe
|
|||||||
|
|
||||||
if (!texture) {
|
if (!texture) {
|
||||||
state.current_tex = RID();
|
state.current_tex = RID();
|
||||||
state.current_tex_ptr = NULL;
|
state.current_tex_ptr = nullptr;
|
||||||
ct->size_cache = Size2i(1, 1);
|
ct->size_cache = Size2i(1, 1);
|
||||||
|
|
||||||
glActiveTexture(GL_TEXTURE0);
|
glActiveTexture(GL_TEXTURE0);
|
||||||
@ -1096,7 +1097,7 @@ RendererCanvasRender::PolygonID RasterizerCanvasGLES3::request_polygon(const Vec
|
|||||||
{
|
{
|
||||||
// Always uses vertex positions
|
// Always uses vertex positions
|
||||||
glEnableVertexAttribArray(RS::ARRAY_VERTEX);
|
glEnableVertexAttribArray(RS::ARRAY_VERTEX);
|
||||||
glVertexAttribPointer(RS::ARRAY_VERTEX, 2, GL_FLOAT, GL_FALSE, stride * sizeof(float), NULL);
|
glVertexAttribPointer(RS::ARRAY_VERTEX, 2, GL_FLOAT, GL_FALSE, stride * sizeof(float), nullptr);
|
||||||
const Vector2 *points_ptr = p_points.ptr();
|
const Vector2 *points_ptr = p_points.ptr();
|
||||||
|
|
||||||
for (uint32_t i = 0; i < vertex_count; i++) {
|
for (uint32_t i = 0; i < vertex_count; i++) {
|
||||||
@ -1313,7 +1314,7 @@ void RasterizerCanvasGLES3::initialize() {
|
|||||||
glGenBuffers(1, &data.ninepatch_vertices);
|
glGenBuffers(1, &data.ninepatch_vertices);
|
||||||
glBindBuffer(GL_ARRAY_BUFFER, data.ninepatch_vertices);
|
glBindBuffer(GL_ARRAY_BUFFER, data.ninepatch_vertices);
|
||||||
|
|
||||||
glBufferData(GL_ARRAY_BUFFER, sizeof(float) * (16 + 16) * 2, NULL, GL_DYNAMIC_DRAW);
|
glBufferData(GL_ARRAY_BUFFER, sizeof(float) * (16 + 16) * 2, nullptr, GL_DYNAMIC_DRAW);
|
||||||
|
|
||||||
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
glBindBuffer(GL_ARRAY_BUFFER, 0);
|
||||||
|
|
||||||
@ -1443,7 +1444,7 @@ void fragment() {
|
|||||||
default_canvas_texture = storage->canvas_texture_allocate();
|
default_canvas_texture = storage->canvas_texture_allocate();
|
||||||
storage->canvas_texture_initialize(default_canvas_texture);
|
storage->canvas_texture_initialize(default_canvas_texture);
|
||||||
|
|
||||||
state.using_light = NULL;
|
state.using_light = nullptr;
|
||||||
state.using_transparent_rt = false;
|
state.using_transparent_rt = false;
|
||||||
state.using_skeleton = false;
|
state.using_skeleton = false;
|
||||||
state.current_shader_version = state.canvas_shader_default_version;
|
state.current_shader_version = state.canvas_shader_default_version;
|
||||||
|
@ -130,46 +130,51 @@ void RasterizerGLES3::end_frame(bool p_swap_buffers) {
|
|||||||
|
|
||||||
#ifdef CAN_DEBUG
|
#ifdef CAN_DEBUG
|
||||||
static void GLAPIENTRY _gl_debug_print(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *message, const GLvoid *userParam) {
|
static void GLAPIENTRY _gl_debug_print(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *message, const GLvoid *userParam) {
|
||||||
if (type == _EXT_DEBUG_TYPE_OTHER_ARB)
|
if (type == _EXT_DEBUG_TYPE_OTHER_ARB) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (type == _EXT_DEBUG_TYPE_PERFORMANCE_ARB)
|
if (type == _EXT_DEBUG_TYPE_PERFORMANCE_ARB) {
|
||||||
return; //these are ultimately annoying, so removing for now
|
return; //these are ultimately annoying, so removing for now
|
||||||
|
}
|
||||||
|
|
||||||
char debSource[256], debType[256], debSev[256];
|
char debSource[256], debType[256], debSev[256];
|
||||||
|
|
||||||
if (source == _EXT_DEBUG_SOURCE_API_ARB)
|
if (source == _EXT_DEBUG_SOURCE_API_ARB) {
|
||||||
strcpy(debSource, "OpenGL");
|
strcpy(debSource, "OpenGL");
|
||||||
else if (source == _EXT_DEBUG_SOURCE_WINDOW_SYSTEM_ARB)
|
} else if (source == _EXT_DEBUG_SOURCE_WINDOW_SYSTEM_ARB) {
|
||||||
strcpy(debSource, "Windows");
|
strcpy(debSource, "Windows");
|
||||||
else if (source == _EXT_DEBUG_SOURCE_SHADER_COMPILER_ARB)
|
} else if (source == _EXT_DEBUG_SOURCE_SHADER_COMPILER_ARB) {
|
||||||
strcpy(debSource, "Shader Compiler");
|
strcpy(debSource, "Shader Compiler");
|
||||||
else if (source == _EXT_DEBUG_SOURCE_THIRD_PARTY_ARB)
|
} else if (source == _EXT_DEBUG_SOURCE_THIRD_PARTY_ARB) {
|
||||||
strcpy(debSource, "Third Party");
|
strcpy(debSource, "Third Party");
|
||||||
else if (source == _EXT_DEBUG_SOURCE_APPLICATION_ARB)
|
} else if (source == _EXT_DEBUG_SOURCE_APPLICATION_ARB) {
|
||||||
strcpy(debSource, "Application");
|
strcpy(debSource, "Application");
|
||||||
else if (source == _EXT_DEBUG_SOURCE_OTHER_ARB)
|
} else if (source == _EXT_DEBUG_SOURCE_OTHER_ARB) {
|
||||||
strcpy(debSource, "Other");
|
strcpy(debSource, "Other");
|
||||||
|
}
|
||||||
|
|
||||||
if (type == _EXT_DEBUG_TYPE_ERROR_ARB)
|
if (type == _EXT_DEBUG_TYPE_ERROR_ARB) {
|
||||||
strcpy(debType, "Error");
|
strcpy(debType, "Error");
|
||||||
else if (type == _EXT_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB)
|
} else if (type == _EXT_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB) {
|
||||||
strcpy(debType, "Deprecated behavior");
|
strcpy(debType, "Deprecated behavior");
|
||||||
else if (type == _EXT_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB)
|
} else if (type == _EXT_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB) {
|
||||||
strcpy(debType, "Undefined behavior");
|
strcpy(debType, "Undefined behavior");
|
||||||
else if (type == _EXT_DEBUG_TYPE_PORTABILITY_ARB)
|
} else if (type == _EXT_DEBUG_TYPE_PORTABILITY_ARB) {
|
||||||
strcpy(debType, "Portability");
|
strcpy(debType, "Portability");
|
||||||
else if (type == _EXT_DEBUG_TYPE_PERFORMANCE_ARB)
|
} else if (type == _EXT_DEBUG_TYPE_PERFORMANCE_ARB) {
|
||||||
strcpy(debType, "Performance");
|
strcpy(debType, "Performance");
|
||||||
else if (type == _EXT_DEBUG_TYPE_OTHER_ARB)
|
} else if (type == _EXT_DEBUG_TYPE_OTHER_ARB) {
|
||||||
strcpy(debType, "Other");
|
strcpy(debType, "Other");
|
||||||
|
}
|
||||||
|
|
||||||
if (severity == _EXT_DEBUG_SEVERITY_HIGH_ARB)
|
if (severity == _EXT_DEBUG_SEVERITY_HIGH_ARB) {
|
||||||
strcpy(debSev, "High");
|
strcpy(debSev, "High");
|
||||||
else if (severity == _EXT_DEBUG_SEVERITY_MEDIUM_ARB)
|
} else if (severity == _EXT_DEBUG_SEVERITY_MEDIUM_ARB) {
|
||||||
strcpy(debSev, "Medium");
|
strcpy(debSev, "Medium");
|
||||||
else if (severity == _EXT_DEBUG_SEVERITY_LOW_ARB)
|
} else if (severity == _EXT_DEBUG_SEVERITY_LOW_ARB) {
|
||||||
strcpy(debSev, "Low");
|
strcpy(debSev, "Low");
|
||||||
|
}
|
||||||
|
|
||||||
String output = String() + "GL ERROR: Source: " + debSource + "\tType: " + debType + "\tID: " + itos(id) + "\tSeverity: " + debSev + "\tMessage: " + message;
|
String output = String() + "GL ERROR: Source: " + debSource + "\tType: " + debType + "\tID: " + itos(id) + "\tSeverity: " + debSev + "\tMessage: " + message;
|
||||||
|
|
||||||
@ -203,7 +208,7 @@ void RasterizerGLES3::initialize() {
|
|||||||
if (OS::get_singleton()->is_stdout_verbose()) {
|
if (OS::get_singleton()->is_stdout_verbose()) {
|
||||||
if (GLAD_GL_ARB_debug_output) {
|
if (GLAD_GL_ARB_debug_output) {
|
||||||
glEnable(_EXT_DEBUG_OUTPUT_SYNCHRONOUS_ARB);
|
glEnable(_EXT_DEBUG_OUTPUT_SYNCHRONOUS_ARB);
|
||||||
glDebugMessageCallbackARB(_gl_debug_print, NULL);
|
glDebugMessageCallbackARB(_gl_debug_print, nullptr);
|
||||||
glEnable(_EXT_DEBUG_OUTPUT);
|
glEnable(_EXT_DEBUG_OUTPUT);
|
||||||
} else {
|
} else {
|
||||||
print_line("OpenGL debugging not supported!");
|
print_line("OpenGL debugging not supported!");
|
||||||
@ -215,12 +220,12 @@ void RasterizerGLES3::initialize() {
|
|||||||
#ifdef CAN_DEBUG
|
#ifdef CAN_DEBUG
|
||||||
#ifdef GLES_OVER_GL
|
#ifdef GLES_OVER_GL
|
||||||
if (OS::get_singleton()->is_stdout_verbose() && GLAD_GL_ARB_debug_output) {
|
if (OS::get_singleton()->is_stdout_verbose() && GLAD_GL_ARB_debug_output) {
|
||||||
glDebugMessageControlARB(_EXT_DEBUG_SOURCE_API_ARB, _EXT_DEBUG_TYPE_ERROR_ARB, _EXT_DEBUG_SEVERITY_HIGH_ARB, 0, NULL, GL_TRUE);
|
glDebugMessageControlARB(_EXT_DEBUG_SOURCE_API_ARB, _EXT_DEBUG_TYPE_ERROR_ARB, _EXT_DEBUG_SEVERITY_HIGH_ARB, 0, nullptr, GL_TRUE);
|
||||||
glDebugMessageControlARB(_EXT_DEBUG_SOURCE_API_ARB, _EXT_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB, _EXT_DEBUG_SEVERITY_HIGH_ARB, 0, NULL, GL_TRUE);
|
glDebugMessageControlARB(_EXT_DEBUG_SOURCE_API_ARB, _EXT_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB, _EXT_DEBUG_SEVERITY_HIGH_ARB, 0, nullptr, GL_TRUE);
|
||||||
glDebugMessageControlARB(_EXT_DEBUG_SOURCE_API_ARB, _EXT_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB, _EXT_DEBUG_SEVERITY_HIGH_ARB, 0, NULL, GL_TRUE);
|
glDebugMessageControlARB(_EXT_DEBUG_SOURCE_API_ARB, _EXT_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB, _EXT_DEBUG_SEVERITY_HIGH_ARB, 0, nullptr, GL_TRUE);
|
||||||
glDebugMessageControlARB(_EXT_DEBUG_SOURCE_API_ARB, _EXT_DEBUG_TYPE_PORTABILITY_ARB, _EXT_DEBUG_SEVERITY_HIGH_ARB, 0, NULL, GL_TRUE);
|
glDebugMessageControlARB(_EXT_DEBUG_SOURCE_API_ARB, _EXT_DEBUG_TYPE_PORTABILITY_ARB, _EXT_DEBUG_SEVERITY_HIGH_ARB, 0, nullptr, GL_TRUE);
|
||||||
glDebugMessageControlARB(_EXT_DEBUG_SOURCE_API_ARB, _EXT_DEBUG_TYPE_PERFORMANCE_ARB, _EXT_DEBUG_SEVERITY_HIGH_ARB, 0, NULL, GL_TRUE);
|
glDebugMessageControlARB(_EXT_DEBUG_SOURCE_API_ARB, _EXT_DEBUG_TYPE_PERFORMANCE_ARB, _EXT_DEBUG_SEVERITY_HIGH_ARB, 0, nullptr, GL_TRUE);
|
||||||
glDebugMessageControlARB(_EXT_DEBUG_SOURCE_API_ARB, _EXT_DEBUG_TYPE_OTHER_ARB, _EXT_DEBUG_SEVERITY_HIGH_ARB, 0, NULL, GL_TRUE);
|
glDebugMessageControlARB(_EXT_DEBUG_SOURCE_API_ARB, _EXT_DEBUG_TYPE_OTHER_ARB, _EXT_DEBUG_SEVERITY_HIGH_ARB, 0, nullptr, GL_TRUE);
|
||||||
// glDebugMessageInsertARB(
|
// glDebugMessageInsertARB(
|
||||||
// GL_DEBUG_SOURCE_API_ARB,
|
// GL_DEBUG_SOURCE_API_ARB,
|
||||||
// GL_DEBUG_TYPE_OTHER_ARB, 1,
|
// GL_DEBUG_TYPE_OTHER_ARB, 1,
|
||||||
@ -299,8 +304,9 @@ void RasterizerGLES3::blit_render_targets_to_screen(DisplayServer::WindowID p_sc
|
|||||||
}
|
}
|
||||||
|
|
||||||
void RasterizerGLES3::set_boot_image(const Ref<Image> &p_image, const Color &p_color, bool p_scale, bool p_use_filter) {
|
void RasterizerGLES3::set_boot_image(const Ref<Image> &p_image, const Color &p_color, bool p_scale, bool p_use_filter) {
|
||||||
if (p_image.is_null() || p_image->is_empty())
|
if (p_image.is_null() || p_image->is_empty()) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Size2i win_size = DisplayServer::get_singleton()->screen_get_size();
|
Size2i win_size = DisplayServer::get_singleton()->screen_get_size();
|
||||||
|
|
||||||
|
@ -976,7 +976,7 @@ Ref<Image> RasterizerStorageGLES3::texture_get_data(RID p_texture, int p_layer)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
void RasterizerStorageGLES3::_texture_set_state_from_flags(Texture *p_tex) {
|
void RasterizerStorageGLES3::_texture_set_state_from_flags(Texture *p_tex) {
|
||||||
if ((p_tex->flags & TEXTURE_FLAG_MIPMAPS) && !p_tex->ignore_mipmaps)
|
if ((p_tex->flags & TEXTURE_FLAG_MIPMAPS) && !p_tex->ignore_mipmaps) {
|
||||||
if (p_tex->flags & TEXTURE_FLAG_FILTER) {
|
if (p_tex->flags & TEXTURE_FLAG_FILTER) {
|
||||||
// these do not exactly correspond ...
|
// these do not exactly correspond ...
|
||||||
p_tex->GLSetFilter(p_tex->target, RS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS);
|
p_tex->GLSetFilter(p_tex->target, RS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR_WITH_MIPMAPS);
|
||||||
@ -985,7 +985,7 @@ void RasterizerStorageGLES3::_texture_set_state_from_flags(Texture *p_tex) {
|
|||||||
p_tex->GLSetFilter(p_tex->target, RS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS);
|
p_tex->GLSetFilter(p_tex->target, RS::CANVAS_ITEM_TEXTURE_FILTER_NEAREST_WITH_MIPMAPS);
|
||||||
//texture->glTexParam_MinFilter(texture->target, config.use_fast_texture_filter ? GL_NEAREST_MIPMAP_NEAREST : GL_NEAREST_MIPMAP_LINEAR);
|
//texture->glTexParam_MinFilter(texture->target, config.use_fast_texture_filter ? GL_NEAREST_MIPMAP_NEAREST : GL_NEAREST_MIPMAP_LINEAR);
|
||||||
}
|
}
|
||||||
else {
|
} else {
|
||||||
if (p_tex->flags & TEXTURE_FLAG_FILTER) {
|
if (p_tex->flags & TEXTURE_FLAG_FILTER) {
|
||||||
p_tex->GLSetFilter(p_tex->target, RS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR);
|
p_tex->GLSetFilter(p_tex->target, RS::CANVAS_ITEM_TEXTURE_FILTER_LINEAR);
|
||||||
//texture->glTexParam_MinFilter(texture->target, GL_LINEAR);
|
//texture->glTexParam_MinFilter(texture->target, GL_LINEAR);
|
||||||
@ -1125,8 +1125,9 @@ void RasterizerStorageGLES3::texture_debug_usage(List<RS::TextureInfo> *r_info)
|
|||||||
|
|
||||||
for (List<RID>::Element *E = textures.front(); E; E = E->next()) {
|
for (List<RID>::Element *E = textures.front(); E; E = E->next()) {
|
||||||
Texture *t = texture_owner.get_or_null(E->get());
|
Texture *t = texture_owner.get_or_null(E->get());
|
||||||
if (!t)
|
if (!t) {
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
RS::TextureInfo tinfo;
|
RS::TextureInfo tinfo;
|
||||||
tinfo.path = t->path;
|
tinfo.path = t->path;
|
||||||
tinfo.format = t->format;
|
tinfo.format = t->format;
|
||||||
@ -1173,7 +1174,7 @@ void RasterizerStorageGLES3::texture_set_proxy(RID p_texture, RID p_proxy) {
|
|||||||
|
|
||||||
if (texture->proxy) {
|
if (texture->proxy) {
|
||||||
texture->proxy->proxy_owners.erase(texture);
|
texture->proxy->proxy_owners.erase(texture);
|
||||||
texture->proxy = NULL;
|
texture->proxy = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (p_proxy.is_valid()) {
|
if (p_proxy.is_valid()) {
|
||||||
@ -1298,8 +1299,9 @@ void RasterizerStorageGLES3::shader_initialize(RID p_rid) {
|
|||||||
//}
|
//}
|
||||||
|
|
||||||
void RasterizerStorageGLES3::_shader_make_dirty(Shader *p_shader) {
|
void RasterizerStorageGLES3::_shader_make_dirty(Shader *p_shader) {
|
||||||
if (p_shader->dirty_list.in_list())
|
if (p_shader->dirty_list.in_list()) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
_shader_dirty_list.add(&p_shader->dirty_list);
|
_shader_dirty_list.add(&p_shader->dirty_list);
|
||||||
}
|
}
|
||||||
@ -1371,7 +1373,7 @@ void RasterizerStorageGLES3::_update_shader(Shader *p_shader) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ShaderCompiler::GeneratedCode gen_code;
|
ShaderCompiler::GeneratedCode gen_code;
|
||||||
ShaderCompiler::IdentifierActions *actions = NULL;
|
ShaderCompiler::IdentifierActions *actions = nullptr;
|
||||||
|
|
||||||
switch (p_shader->mode) {
|
switch (p_shader->mode) {
|
||||||
case RS::SHADER_CANVAS_ITEM: {
|
case RS::SHADER_CANVAS_ITEM: {
|
||||||
@ -1697,8 +1699,9 @@ RID RasterizerStorageGLES3::shader_get_default_texture_param(RID p_shader, const
|
|||||||
/* COMMON MATERIAL API */
|
/* COMMON MATERIAL API */
|
||||||
|
|
||||||
void RasterizerStorageGLES3::_material_make_dirty(Material *p_material) const {
|
void RasterizerStorageGLES3::_material_make_dirty(Material *p_material) const {
|
||||||
if (p_material->dirty_list.in_list())
|
if (p_material->dirty_list.in_list()) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
_material_dirty_list.add(&p_material->dirty_list);
|
_material_dirty_list.add(&p_material->dirty_list);
|
||||||
}
|
}
|
||||||
@ -1954,8 +1957,9 @@ void RasterizerStorageGLES3::_update_material(Material *p_material) {
|
|||||||
p_material->textures.resize(p_material->shader->texture_uniforms.size());
|
p_material->textures.resize(p_material->shader->texture_uniforms.size());
|
||||||
|
|
||||||
for (Map<StringName, ShaderLanguage::ShaderNode::Uniform>::Element *E = p_material->shader->uniforms.front(); E; E = E->next()) {
|
for (Map<StringName, ShaderLanguage::ShaderNode::Uniform>::Element *E = p_material->shader->uniforms.front(); E; E = E->next()) {
|
||||||
if (E->get().texture_order < 0)
|
if (E->get().texture_order < 0) {
|
||||||
continue; // not a texture, does not go here
|
continue; // not a texture, does not go here
|
||||||
|
}
|
||||||
|
|
||||||
RID texture;
|
RID texture;
|
||||||
|
|
||||||
@ -2909,7 +2913,7 @@ void RasterizerStorageGLES3::_set_current_render_target(RID p_render_target) {
|
|||||||
_dims.win_height = rt->height;
|
_dims.win_height = rt->height;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
frame.current_rt = NULL;
|
frame.current_rt = nullptr;
|
||||||
frame.clear_request = false;
|
frame.clear_request = false;
|
||||||
bind_framebuffer_system();
|
bind_framebuffer_system();
|
||||||
}
|
}
|
||||||
@ -2917,8 +2921,9 @@ void RasterizerStorageGLES3::_set_current_render_target(RID p_render_target) {
|
|||||||
|
|
||||||
void RasterizerStorageGLES3::_render_target_allocate(RenderTarget *rt) {
|
void RasterizerStorageGLES3::_render_target_allocate(RenderTarget *rt) {
|
||||||
// do not allocate a render target with no size
|
// do not allocate a render target with no size
|
||||||
if (rt->width <= 0 || rt->height <= 0)
|
if (rt->width <= 0 || rt->height <= 0) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// do not allocate a render target that is attached to the screen
|
// do not allocate a render target that is attached to the screen
|
||||||
if (rt->flags[RENDER_TARGET_DIRECT_TO_SCREEN]) {
|
if (rt->flags[RENDER_TARGET_DIRECT_TO_SCREEN]) {
|
||||||
@ -2966,7 +2971,7 @@ void RasterizerStorageGLES3::_render_target_allocate(RenderTarget *rt) {
|
|||||||
glGenTextures(1, &rt->color);
|
glGenTextures(1, &rt->color);
|
||||||
glBindTexture(GL_TEXTURE_2D, rt->color);
|
glBindTexture(GL_TEXTURE_2D, rt->color);
|
||||||
|
|
||||||
glTexImage2D(GL_TEXTURE_2D, 0, color_internal_format, rt->width, rt->height, 0, color_format, color_type, NULL);
|
glTexImage2D(GL_TEXTURE_2D, 0, color_internal_format, rt->width, rt->height, 0, color_format, color_type, nullptr);
|
||||||
|
|
||||||
if (texture->flags & TEXTURE_FLAG_FILTER) {
|
if (texture->flags & TEXTURE_FLAG_FILTER) {
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||||
@ -2986,7 +2991,7 @@ void RasterizerStorageGLES3::_render_target_allocate(RenderTarget *rt) {
|
|||||||
if (config.support_depth_texture) {
|
if (config.support_depth_texture) {
|
||||||
glGenTextures(1, &rt->depth);
|
glGenTextures(1, &rt->depth);
|
||||||
glBindTexture(GL_TEXTURE_2D, rt->depth);
|
glBindTexture(GL_TEXTURE_2D, rt->depth);
|
||||||
glTexImage2D(GL_TEXTURE_2D, 0, config.depth_internalformat, rt->width, rt->height, 0, GL_DEPTH_COMPONENT, config.depth_type, NULL);
|
glTexImage2D(GL_TEXTURE_2D, 0, config.depth_internalformat, rt->width, rt->height, 0, GL_DEPTH_COMPONENT, config.depth_type, nullptr);
|
||||||
|
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||||
@ -3109,9 +3114,9 @@ void RasterizerStorageGLES3::_render_target_allocate(RenderTarget *rt) {
|
|||||||
glBindTexture(GL_TEXTURE_2D, rt->copy_screen_effect.color);
|
glBindTexture(GL_TEXTURE_2D, rt->copy_screen_effect.color);
|
||||||
|
|
||||||
if (rt->flags[RendererStorage::RENDER_TARGET_TRANSPARENT]) {
|
if (rt->flags[RendererStorage::RENDER_TARGET_TRANSPARENT]) {
|
||||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, rt->width, rt->height, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
|
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, rt->width, rt->height, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr);
|
||||||
} else {
|
} else {
|
||||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, rt->width, rt->height, 0, GL_RGB, GL_UNSIGNED_BYTE, NULL);
|
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, rt->width, rt->height, 0, GL_RGB, GL_UNSIGNED_BYTE, nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||||
@ -3159,8 +3164,9 @@ void RasterizerStorageGLES3::_render_target_allocate(RenderTarget *rt) {
|
|||||||
w >>= 1;
|
w >>= 1;
|
||||||
h >>= 1;
|
h >>= 1;
|
||||||
|
|
||||||
if (w < 2 || h < 2)
|
if (w < 2 || h < 2) {
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
level++;
|
level++;
|
||||||
}
|
}
|
||||||
@ -3173,7 +3179,7 @@ void RasterizerStorageGLES3::_render_target_allocate(RenderTarget *rt) {
|
|||||||
glBindTexture(GL_TEXTURE_2D, rt->mip_maps[i].color);
|
glBindTexture(GL_TEXTURE_2D, rt->mip_maps[i].color);
|
||||||
|
|
||||||
for (int l = 0; l < level + 1; l++) {
|
for (int l = 0; l < level + 1; l++) {
|
||||||
glTexImage2D(GL_TEXTURE_2D, l, color_internal_format, width, height, 0, color_format, color_type, NULL);
|
glTexImage2D(GL_TEXTURE_2D, l, color_internal_format, width, height, 0, color_format, color_type, nullptr);
|
||||||
width = MAX(1, (width / 2));
|
width = MAX(1, (width / 2));
|
||||||
height = MAX(1, (height / 2));
|
height = MAX(1, (height / 2));
|
||||||
}
|
}
|
||||||
@ -3186,7 +3192,7 @@ void RasterizerStorageGLES3::_render_target_allocate(RenderTarget *rt) {
|
|||||||
for (int l = 0; l < level + 1; l++) {
|
for (int l = 0; l < level + 1; l++) {
|
||||||
glGenTextures(1, &rt->mip_maps[i].sizes.write[l].color);
|
glGenTextures(1, &rt->mip_maps[i].sizes.write[l].color);
|
||||||
glBindTexture(GL_TEXTURE_2D, rt->mip_maps[i].sizes[l].color);
|
glBindTexture(GL_TEXTURE_2D, rt->mip_maps[i].sizes[l].color);
|
||||||
glTexImage2D(GL_TEXTURE_2D, 0, color_internal_format, width, height, 0, color_format, color_type, NULL);
|
glTexImage2D(GL_TEXTURE_2D, 0, color_internal_format, width, height, 0, color_format, color_type, nullptr);
|
||||||
width = MAX(1, (width / 2));
|
width = MAX(1, (width / 2));
|
||||||
height = MAX(1, (height / 2));
|
height = MAX(1, (height / 2));
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||||
@ -3255,8 +3261,9 @@ void RasterizerStorageGLES3::_render_target_allocate(RenderTarget *rt) {
|
|||||||
|
|
||||||
void RasterizerStorageGLES3::_render_target_clear(RenderTarget *rt) {
|
void RasterizerStorageGLES3::_render_target_clear(RenderTarget *rt) {
|
||||||
// there is nothing to clear when DIRECT_TO_SCREEN is used
|
// there is nothing to clear when DIRECT_TO_SCREEN is used
|
||||||
if (rt->flags[RENDER_TARGET_DIRECT_TO_SCREEN])
|
if (rt->flags[RENDER_TARGET_DIRECT_TO_SCREEN]) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (rt->fbo) {
|
if (rt->fbo) {
|
||||||
glDeleteFramebuffers(1, &rt->fbo);
|
glDeleteFramebuffers(1, &rt->fbo);
|
||||||
@ -3373,8 +3380,9 @@ void RasterizerStorageGLES3::render_target_set_size(RID p_render_target, int p_w
|
|||||||
RenderTarget *rt = render_target_owner.get_or_null(p_render_target);
|
RenderTarget *rt = render_target_owner.get_or_null(p_render_target);
|
||||||
ERR_FAIL_COND(!rt);
|
ERR_FAIL_COND(!rt);
|
||||||
|
|
||||||
if (p_width == rt->width && p_height == rt->height)
|
if (p_width == rt->width && p_height == rt->height) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
_render_target_clear(rt);
|
_render_target_clear(rt);
|
||||||
|
|
||||||
@ -3561,8 +3569,9 @@ void RasterizerStorageGLES3::render_target_set_msaa(RID p_render_target, RS::Vie
|
|||||||
RenderTarget *rt = render_target_owner.get_or_null(p_render_target);
|
RenderTarget *rt = render_target_owner.get_or_null(p_render_target);
|
||||||
ERR_FAIL_COND(!rt);
|
ERR_FAIL_COND(!rt);
|
||||||
|
|
||||||
if (rt->msaa == p_msaa)
|
if (rt->msaa == p_msaa) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
_render_target_clear(rt);
|
_render_target_clear(rt);
|
||||||
rt->msaa = p_msaa;
|
rt->msaa = p_msaa;
|
||||||
@ -3638,8 +3647,9 @@ void RasterizerStorageGLES3::render_target_mark_sdf_enabled(RID p_render_target,
|
|||||||
RID RasterizerStorageGLES3::canvas_light_shadow_buffer_create(int p_width) {
|
RID RasterizerStorageGLES3::canvas_light_shadow_buffer_create(int p_width) {
|
||||||
CanvasLightShadow *cls = memnew(CanvasLightShadow);
|
CanvasLightShadow *cls = memnew(CanvasLightShadow);
|
||||||
|
|
||||||
if (p_width > config.max_texture_size)
|
if (p_width > config.max_texture_size) {
|
||||||
p_width = config.max_texture_size;
|
p_width = config.max_texture_size;
|
||||||
|
}
|
||||||
|
|
||||||
cls->size = p_width;
|
cls->size = p_width;
|
||||||
cls->height = 16;
|
cls->height = 16;
|
||||||
@ -3657,10 +3667,10 @@ RID RasterizerStorageGLES3::canvas_light_shadow_buffer_create(int p_width) {
|
|||||||
glGenTextures(1, &cls->distance);
|
glGenTextures(1, &cls->distance);
|
||||||
glBindTexture(GL_TEXTURE_2D, cls->distance);
|
glBindTexture(GL_TEXTURE_2D, cls->distance);
|
||||||
if (config.use_rgba_2d_shadows) {
|
if (config.use_rgba_2d_shadows) {
|
||||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, cls->size, cls->height, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
|
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, cls->size, cls->height, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr);
|
||||||
} else {
|
} else {
|
||||||
#ifdef GLES_OVER_GL
|
#ifdef GLES_OVER_GL
|
||||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_R32F, cls->size, cls->height, 0, _RED_OES, GL_FLOAT, NULL);
|
glTexImage2D(GL_TEXTURE_2D, 0, GL_R32F, cls->size, cls->height, 0, _RED_OES, GL_FLOAT, nullptr);
|
||||||
#else
|
#else
|
||||||
glTexImage2D(GL_TEXTURE_2D, 0, GL_FLOAT, cls->size, cls->height, 0, _RED_OES, GL_FLOAT, NULL);
|
glTexImage2D(GL_TEXTURE_2D, 0, GL_FLOAT, cls->size, cls->height, 0, _RED_OES, GL_FLOAT, NULL);
|
||||||
#endif
|
#endif
|
||||||
@ -3856,7 +3866,7 @@ bool RasterizerStorageGLES3::free(RID p_rid) {
|
|||||||
while (shader->materials.first()) {
|
while (shader->materials.first()) {
|
||||||
Material *m = shader->materials.first()->self();
|
Material *m = shader->materials.first()->self();
|
||||||
|
|
||||||
m->shader = NULL;
|
m->shader = nullptr;
|
||||||
_material_make_dirty(m);
|
_material_make_dirty(m);
|
||||||
|
|
||||||
shader->materials.remove(shader->materials.first());
|
shader->materials.remove(shader->materials.first());
|
||||||
@ -4248,7 +4258,7 @@ void RasterizerStorageGLES3::initialize() {
|
|||||||
GLuint depth;
|
GLuint depth;
|
||||||
glGenTextures(1, &depth);
|
glGenTextures(1, &depth);
|
||||||
glBindTexture(GL_TEXTURE_2D, depth);
|
glBindTexture(GL_TEXTURE_2D, depth);
|
||||||
glTexImage2D(GL_TEXTURE_2D, 0, config.depth_internalformat, 32, 32, 0, GL_DEPTH_COMPONENT, config.depth_type, NULL);
|
glTexImage2D(GL_TEXTURE_2D, 0, config.depth_internalformat, 32, 32, 0, GL_DEPTH_COMPONENT, config.depth_type, nullptr);
|
||||||
|
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||||
@ -4280,7 +4290,7 @@ void RasterizerStorageGLES3::initialize() {
|
|||||||
|
|
||||||
glGenTextures(1, &depth);
|
glGenTextures(1, &depth);
|
||||||
glBindTexture(GL_TEXTURE_2D, depth);
|
glBindTexture(GL_TEXTURE_2D, depth);
|
||||||
glTexImage2D(GL_TEXTURE_2D, 0, config.depth_internalformat, 32, 32, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, NULL);
|
glTexImage2D(GL_TEXTURE_2D, 0, config.depth_internalformat, 32, 32, 0, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, nullptr);
|
||||||
|
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
|
||||||
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||||
@ -4308,7 +4318,7 @@ void RasterizerStorageGLES3::initialize() {
|
|||||||
|
|
||||||
frame.count = 0;
|
frame.count = 0;
|
||||||
frame.delta = 0;
|
frame.delta = 0;
|
||||||
frame.current_rt = NULL;
|
frame.current_rt = nullptr;
|
||||||
frame.clear_request = false;
|
frame.clear_request = false;
|
||||||
|
|
||||||
glGetIntegerv(GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS, &config.max_vertex_texture_image_units);
|
glGetIntegerv(GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS, &config.max_vertex_texture_image_units);
|
||||||
|
@ -142,8 +142,8 @@ public:
|
|||||||
} shaders;
|
} shaders;
|
||||||
|
|
||||||
struct Info {
|
struct Info {
|
||||||
uint64_t texture_mem;
|
uint64_t texture_mem = 0;
|
||||||
uint64_t vertex_mem;
|
uint64_t vertex_mem = 0;
|
||||||
|
|
||||||
struct Render {
|
struct Render {
|
||||||
uint32_t object_count;
|
uint32_t object_count;
|
||||||
@ -167,9 +167,7 @@ public:
|
|||||||
}
|
}
|
||||||
} render, render_final, snap;
|
} render, render_final, snap;
|
||||||
|
|
||||||
Info() :
|
Info() {
|
||||||
texture_mem(0),
|
|
||||||
vertex_mem(0) {
|
|
||||||
render.reset();
|
render.reset();
|
||||||
render_final.reset();
|
render_final.reset();
|
||||||
}
|
}
|
||||||
@ -275,8 +273,9 @@ public:
|
|||||||
// texture coords start from bottom left, means we need to draw render target textures upside down
|
// texture coords start from bottom left, means we need to draw render target textures upside down
|
||||||
// to be compatible with vulkan etc.
|
// to be compatible with vulkan etc.
|
||||||
bool is_upside_down() const {
|
bool is_upside_down() const {
|
||||||
if (proxy)
|
if (proxy) {
|
||||||
return proxy->is_upside_down();
|
return proxy->is_upside_down();
|
||||||
|
}
|
||||||
|
|
||||||
return render_target != nullptr;
|
return render_target != nullptr;
|
||||||
}
|
}
|
||||||
@ -364,7 +363,7 @@ public:
|
|||||||
images.clear();
|
images.clear();
|
||||||
|
|
||||||
for (Set<Texture *>::Element *E = proxy_owners.front(); E; E = E->next()) {
|
for (Set<Texture *>::Element *E = proxy_owners.front(); E; E = E->next()) {
|
||||||
E->get()->proxy = NULL;
|
E->get()->proxy = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (proxy) {
|
if (proxy) {
|
||||||
@ -374,8 +373,9 @@ public:
|
|||||||
|
|
||||||
// texture state
|
// texture state
|
||||||
void GLSetFilter(GLenum p_target, RS::CanvasItemTextureFilter p_filter) {
|
void GLSetFilter(GLenum p_target, RS::CanvasItemTextureFilter p_filter) {
|
||||||
if (p_filter == state_filter)
|
if (p_filter == state_filter) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
state_filter = p_filter;
|
state_filter = p_filter;
|
||||||
GLint pmin = GL_LINEAR; // param min
|
GLint pmin = GL_LINEAR; // param min
|
||||||
GLint pmag = GL_LINEAR; // param mag
|
GLint pmag = GL_LINEAR; // param mag
|
||||||
@ -399,8 +399,9 @@ public:
|
|||||||
glTexParameteri(p_target, GL_TEXTURE_MAG_FILTER, pmag);
|
glTexParameteri(p_target, GL_TEXTURE_MAG_FILTER, pmag);
|
||||||
}
|
}
|
||||||
void GLSetRepeat(GLenum p_target, RS::CanvasItemTextureRepeat p_repeat) {
|
void GLSetRepeat(GLenum p_target, RS::CanvasItemTextureRepeat p_repeat) {
|
||||||
if (p_repeat == state_repeat)
|
if (p_repeat == state_repeat) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
state_repeat = p_repeat;
|
state_repeat = p_repeat;
|
||||||
GLint prep = GL_CLAMP_TO_EDGE; // parameter repeat
|
GLint prep = GL_CLAMP_TO_EDGE; // parameter repeat
|
||||||
switch (state_repeat) {
|
switch (state_repeat) {
|
||||||
@ -637,7 +638,7 @@ public:
|
|||||||
|
|
||||||
Shader() :
|
Shader() :
|
||||||
dirty_list(this) {
|
dirty_list(this) {
|
||||||
shader = NULL;
|
shader = nullptr;
|
||||||
valid = false;
|
valid = false;
|
||||||
version = RID();
|
version = RID();
|
||||||
last_pass = 0;
|
last_pass = 0;
|
||||||
@ -697,7 +698,7 @@ public:
|
|||||||
dirty_list(this) {
|
dirty_list(this) {
|
||||||
can_cast_shadow_cache = false;
|
can_cast_shadow_cache = false;
|
||||||
is_animated_cache = false;
|
is_animated_cache = false;
|
||||||
shader = NULL;
|
shader = nullptr;
|
||||||
line_width = 1.0;
|
line_width = 1.0;
|
||||||
last_pass = 0;
|
last_pass = 0;
|
||||||
render_priority = 0;
|
render_priority = 0;
|
||||||
@ -1151,27 +1152,23 @@ public:
|
|||||||
|
|
||||||
struct RenderTarget {
|
struct RenderTarget {
|
||||||
RID self;
|
RID self;
|
||||||
GLuint fbo;
|
GLuint fbo = 0;
|
||||||
GLuint color;
|
GLuint color = 0;
|
||||||
GLuint depth;
|
GLuint depth = 0;
|
||||||
|
|
||||||
GLuint multisample_fbo;
|
GLuint multisample_fbo = 0;
|
||||||
GLuint multisample_color;
|
GLuint multisample_color = 0;
|
||||||
GLuint multisample_depth;
|
GLuint multisample_depth = 0;
|
||||||
bool multisample_active;
|
bool multisample_active = false;
|
||||||
|
|
||||||
struct Effect {
|
struct Effect {
|
||||||
GLuint fbo;
|
GLuint fbo = 0;
|
||||||
int width;
|
int width = 0;
|
||||||
int height;
|
int height = 0;
|
||||||
|
|
||||||
GLuint color;
|
GLuint color = 0;
|
||||||
|
|
||||||
Effect() :
|
Effect() {
|
||||||
fbo(0),
|
|
||||||
width(0),
|
|
||||||
height(0),
|
|
||||||
color(0) {
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -1186,71 +1183,47 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
Vector<Size> sizes;
|
Vector<Size> sizes;
|
||||||
GLuint color;
|
GLuint color = 0;
|
||||||
int levels;
|
int levels = 0;
|
||||||
|
|
||||||
MipMaps() :
|
MipMaps() {
|
||||||
color(0),
|
|
||||||
levels(0) {
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
MipMaps mip_maps[2];
|
MipMaps mip_maps[2];
|
||||||
|
|
||||||
struct External {
|
struct External {
|
||||||
GLuint fbo;
|
GLuint fbo = 0;
|
||||||
GLuint color;
|
GLuint color = 0;
|
||||||
GLuint depth;
|
GLuint depth = 0;
|
||||||
RID texture;
|
RID texture;
|
||||||
|
|
||||||
External() :
|
External() {
|
||||||
fbo(0),
|
|
||||||
color(0),
|
|
||||||
depth(0) {
|
|
||||||
}
|
}
|
||||||
} external;
|
} external;
|
||||||
|
|
||||||
int x, y, width, height;
|
int x = 0, y = 0, width = 0, height = 0;
|
||||||
|
|
||||||
bool flags[RENDER_TARGET_FLAG_MAX];
|
bool flags[RENDER_TARGET_FLAG_MAX];
|
||||||
|
|
||||||
// instead of allocating sized render targets immediately,
|
// instead of allocating sized render targets immediately,
|
||||||
// defer this for faster startup
|
// defer this for faster startup
|
||||||
bool allocate_is_dirty = false;
|
bool allocate_is_dirty = false;
|
||||||
bool used_in_frame;
|
bool used_in_frame = false;
|
||||||
RS::ViewportMSAA msaa;
|
RS::ViewportMSAA msaa = RS::VIEWPORT_MSAA_DISABLED;
|
||||||
|
|
||||||
bool use_fxaa;
|
bool use_fxaa = false;
|
||||||
bool use_debanding;
|
bool use_debanding = false;
|
||||||
|
|
||||||
RID texture;
|
RID texture;
|
||||||
|
|
||||||
bool used_dof_blur_near;
|
bool used_dof_blur_near = false;
|
||||||
bool mip_maps_allocated;
|
bool mip_maps_allocated = false;
|
||||||
|
|
||||||
Color clear_color;
|
Color clear_color = Color(1, 1, 1, 1);
|
||||||
bool clear_requested;
|
bool clear_requested = false;
|
||||||
|
|
||||||
RenderTarget() :
|
RenderTarget() {
|
||||||
fbo(0),
|
|
||||||
color(0),
|
|
||||||
depth(0),
|
|
||||||
multisample_fbo(0),
|
|
||||||
multisample_color(0),
|
|
||||||
multisample_depth(0),
|
|
||||||
multisample_active(false),
|
|
||||||
x(0),
|
|
||||||
y(0),
|
|
||||||
width(0),
|
|
||||||
height(0),
|
|
||||||
used_in_frame(false),
|
|
||||||
msaa(RS::VIEWPORT_MSAA_DISABLED),
|
|
||||||
use_fxaa(false),
|
|
||||||
use_debanding(false),
|
|
||||||
used_dof_blur_near(false),
|
|
||||||
mip_maps_allocated(false),
|
|
||||||
clear_color(Color(1, 1, 1, 1)),
|
|
||||||
clear_requested(false) {
|
|
||||||
for (int i = 0; i < RENDER_TARGET_FLAG_MAX; ++i) {
|
for (int i = 0; i < RENDER_TARGET_FLAG_MAX; ++i) {
|
||||||
flags[i] = false;
|
flags[i] = false;
|
||||||
}
|
}
|
||||||
@ -1427,8 +1400,9 @@ inline bool RasterizerStorageGLES3::safe_buffer_sub_data(unsigned int p_total_bu
|
|||||||
r_offset_after = p_offset + p_data_size;
|
r_offset_after = p_offset + p_data_size;
|
||||||
#ifdef DEBUG_ENABLED
|
#ifdef DEBUG_ENABLED
|
||||||
// we are trying to write across the edge of the buffer
|
// we are trying to write across the edge of the buffer
|
||||||
if (r_offset_after > p_total_buffer_size)
|
if (r_offset_after > p_total_buffer_size) {
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
glBufferSubData(p_target, p_offset, p_data_size, p_data);
|
glBufferSubData(p_target, p_offset, p_data_size, p_data);
|
||||||
return true;
|
return true;
|
||||||
@ -1440,7 +1414,7 @@ inline void RasterizerStorageGLES3::buffer_orphan_and_upload(unsigned int p_buff
|
|||||||
// Orphan the buffer to avoid CPU/GPU sync points caused by glBufferSubData
|
// Orphan the buffer to avoid CPU/GPU sync points caused by glBufferSubData
|
||||||
// Was previously #ifndef GLES_OVER_GL however this causes stalls on desktop mac also (and possibly other)
|
// Was previously #ifndef GLES_OVER_GL however this causes stalls on desktop mac also (and possibly other)
|
||||||
if (!p_optional_orphan || (config.should_orphan)) {
|
if (!p_optional_orphan || (config.should_orphan)) {
|
||||||
glBufferData(p_target, p_buffer_size, NULL, p_usage);
|
glBufferData(p_target, p_buffer_size, nullptr, p_usage);
|
||||||
#ifdef RASTERIZER_EXTRA_CHECKS
|
#ifdef RASTERIZER_EXTRA_CHECKS
|
||||||
// fill with garbage off the end of the array
|
// fill with garbage off the end of the array
|
||||||
if (p_buffer_size) {
|
if (p_buffer_size) {
|
||||||
|
@ -61,8 +61,9 @@ RES ResourceFormatGLES2Texture::load(const String &p_path, const String &p_origi
|
|||||||
Ref<ImageTexture> texture = memnew(ImageTexture);
|
Ref<ImageTexture> texture = memnew(ImageTexture);
|
||||||
texture->create_from_image(img);
|
texture->create_from_image(img);
|
||||||
|
|
||||||
if (r_error)
|
if (r_error) {
|
||||||
*r_error = OK;
|
*r_error = OK;
|
||||||
|
}
|
||||||
|
|
||||||
return texture;
|
return texture;
|
||||||
}
|
}
|
||||||
|
@ -538,7 +538,7 @@ Error VulkanContext::_check_capabilities() {
|
|||||||
|
|
||||||
VkPhysicalDeviceShaderFloat16Int8FeaturesKHR shader_features;
|
VkPhysicalDeviceShaderFloat16Int8FeaturesKHR shader_features;
|
||||||
shader_features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES_KHR;
|
shader_features.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_FLOAT16_INT8_FEATURES_KHR;
|
||||||
shader_features.pNext = NULL;
|
shader_features.pNext = nullptr;
|
||||||
|
|
||||||
device_features.pNext = &shader_features;
|
device_features.pNext = &shader_features;
|
||||||
|
|
||||||
@ -547,7 +547,7 @@ Error VulkanContext::_check_capabilities() {
|
|||||||
|
|
||||||
VkPhysicalDevice16BitStorageFeaturesKHR storage_feature;
|
VkPhysicalDevice16BitStorageFeaturesKHR storage_feature;
|
||||||
storage_feature.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES_KHR;
|
storage_feature.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_16BIT_STORAGE_FEATURES_KHR;
|
||||||
storage_feature.pNext = NULL;
|
storage_feature.pNext = nullptr;
|
||||||
|
|
||||||
device_features.pNext = &storage_feature;
|
device_features.pNext = &storage_feature;
|
||||||
|
|
||||||
|
@ -456,8 +456,9 @@ void EditorProfiler::_graph_tex_input(const Ref<InputEvent> &p_ev) {
|
|||||||
if (mb.is_valid() || (mm->get_button_mask() & MouseButton::MASK_LEFT) != MouseButton::NONE) {
|
if (mb.is_valid() || (mm->get_button_mask() & MouseButton::MASK_LEFT) != MouseButton::NONE) {
|
||||||
updating_frame = true;
|
updating_frame = true;
|
||||||
|
|
||||||
if (x < total_metrics)
|
if (x < total_metrics) {
|
||||||
cursor_metric_edit->set_value(_get_frame_metric(x).frame_number);
|
cursor_metric_edit->set_value(_get_frame_metric(x).frame_number);
|
||||||
|
}
|
||||||
updating_frame = false;
|
updating_frame = false;
|
||||||
|
|
||||||
if (activate->is_pressed()) {
|
if (activate->is_pressed()) {
|
||||||
|
@ -411,8 +411,9 @@ Vector<String> Collada::_read_string_array(XMLParser &parser) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Transform3D Collada::_read_transform(XMLParser &parser) {
|
Transform3D Collada::_read_transform(XMLParser &parser) {
|
||||||
if (parser.is_empty())
|
if (parser.is_empty()) {
|
||||||
return Transform3D();
|
return Transform3D();
|
||||||
|
}
|
||||||
|
|
||||||
Vector<String> array;
|
Vector<String> array;
|
||||||
while (parser.read() == OK) {
|
while (parser.read() == OK) {
|
||||||
|
@ -75,7 +75,7 @@ class AnimationNodeBlendTreeEditor : public AnimationTreeNodeEditorPlugin {
|
|||||||
String type;
|
String type;
|
||||||
Ref<Script> script;
|
Ref<Script> script;
|
||||||
int input_port_count;
|
int input_port_count;
|
||||||
AddOption(const String &p_name = String(), const String &p_type = String(), bool p_input_port_count = 0) :
|
AddOption(const String &p_name = String(), const String &p_type = String(), int p_input_port_count = 0) :
|
||||||
name(p_name),
|
name(p_name),
|
||||||
type(p_type),
|
type(p_type),
|
||||||
input_port_count(p_input_port_count) {
|
input_port_count(p_input_port_count) {
|
||||||
|
@ -6,28 +6,20 @@ set -uo pipefail
|
|||||||
|
|
||||||
# Apply black.
|
# Apply black.
|
||||||
echo -e "Formatting Python files..."
|
echo -e "Formatting Python files..."
|
||||||
PY_FILES=$(find \( -path "./.git" \
|
PY_FILES=$(git ls-files '*SConstruct' '*SCsub' '*.py' --exclude='.git/*' --exclude='thirdparty/*')
|
||||||
-o -path "./thirdparty" \
|
|
||||||
\) -prune \
|
|
||||||
-o \( -name "SConstruct" \
|
|
||||||
-o -name "SCsub" \
|
|
||||||
-o -name "*.py" \
|
|
||||||
\) -print)
|
|
||||||
black -l 120 $PY_FILES
|
black -l 120 $PY_FILES
|
||||||
|
|
||||||
git diff --color > patch.patch
|
diff=$(git diff --color)
|
||||||
|
|
||||||
# If no patch has been generated all is OK, clean up, and exit.
|
# If no patch has been generated all is OK, clean up, and exit.
|
||||||
if [ ! -s patch.patch ] ; then
|
if [ -z "$diff" ] ; then
|
||||||
printf "Files in this commit comply with the black style rules.\n"
|
printf "Files in this commit comply with the black style rules.\n"
|
||||||
rm -f patch.patch
|
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# A patch has been created, notify the user, clean up, and exit.
|
# A patch has been created, notify the user, clean up, and exit.
|
||||||
printf "\n*** The following differences were found between the code "
|
printf "\n*** The following differences were found between the code "
|
||||||
printf "and the formatting rules:\n\n"
|
printf "and the formatting rules:\n\n"
|
||||||
cat patch.patch
|
echo "$diff"
|
||||||
printf "\n*** Aborting, please fix your commit(s) with 'git commit --amend' or 'git rebase -i <hash>'\n"
|
printf "\n*** Aborting, please fix your commit(s) with 'git commit --amend' or 'git rebase -i <hash>'\n"
|
||||||
rm -f patch.patch
|
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -4,13 +4,10 @@
|
|||||||
# This is the primary script responsible for fixing style violations.
|
# This is the primary script responsible for fixing style violations.
|
||||||
|
|
||||||
set -uo pipefail
|
set -uo pipefail
|
||||||
IFS=$'\n\t'
|
|
||||||
|
|
||||||
CLANG_FORMAT_FILE_EXTS=(".c" ".h" ".cpp" ".hpp" ".cc" ".hh" ".cxx" ".m" ".mm" ".inc" ".java" ".glsl")
|
# Loops through all code files tracked by Git.
|
||||||
|
git ls-files '*.c' '*.h' '*.cpp' '*.hpp' '*.cc' '*.hh' '*.cxx' '*.m' '*.mm' '*.inc' '*.java' '*.glsl' |
|
||||||
# Loops through all text files tracked by Git.
|
while read -r f; do
|
||||||
git grep -zIl '' |
|
|
||||||
while IFS= read -rd '' f; do
|
|
||||||
# Exclude some files.
|
# Exclude some files.
|
||||||
if [[ "$f" == "thirdparty"* ]]; then
|
if [[ "$f" == "thirdparty"* ]]; then
|
||||||
continue
|
continue
|
||||||
@ -20,37 +17,31 @@ while IFS= read -rd '' f; do
|
|||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for extension in ${CLANG_FORMAT_FILE_EXTS[@]}; do
|
# Run clang-format.
|
||||||
if [[ "$f" == *"$extension" ]]; then
|
clang-format --Wno-error=unknown -i "$f"
|
||||||
# Run clang-format.
|
|
||||||
clang-format --Wno-error=unknown -i "$f"
|
# Fix copyright headers, but not all files get them.
|
||||||
# Fix copyright headers, but not all files get them.
|
if [[ "$f" == *"inc" ]]; then
|
||||||
if [[ "$f" == *"inc" ]]; then
|
continue
|
||||||
continue 2
|
elif [[ "$f" == *"glsl" ]]; then
|
||||||
elif [[ "$f" == *"glsl" ]]; then
|
continue
|
||||||
continue 2
|
elif [[ "$f" == "platform/android/java/lib/src/org/godotengine/godot/input/InputManager"* ]]; then
|
||||||
elif [[ "$f" == "platform/android/java/lib/src/org/godotengine/godot/input/InputManager"* ]]; then
|
continue
|
||||||
continue 2
|
fi
|
||||||
fi
|
|
||||||
python misc/scripts/copyright_headers.py "$f"
|
python misc/scripts/copyright_headers.py "$f"
|
||||||
continue 2
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
done
|
done
|
||||||
|
|
||||||
git diff --color > patch.patch
|
diff=$(git diff --color)
|
||||||
|
|
||||||
# If no patch has been generated all is OK, clean up, and exit.
|
# If no patch has been generated all is OK, clean up, and exit.
|
||||||
if [ ! -s patch.patch ] ; then
|
if [ -z "$diff" ] ; then
|
||||||
printf "Files in this commit comply with the clang-format style rules.\n"
|
printf "Files in this commit comply with the clang-tidy style rules.\n"
|
||||||
rm -f patch.patch
|
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# A patch has been created, notify the user, clean up, and exit.
|
# A patch has been created, notify the user, clean up, and exit.
|
||||||
printf "\n*** The following differences were found between the code "
|
printf "\n*** The following changes have been made to comply with the formatting rules:\n\n"
|
||||||
printf "and the formatting rules:\n\n"
|
echo "$diff"
|
||||||
cat patch.patch
|
printf "\n*** Please fix your commit(s) with 'git commit --amend' or 'git rebase -i <hash>'\n"
|
||||||
printf "\n*** Aborting, please fix your commit(s) with 'git commit --amend' or 'git rebase -i <hash>'\n"
|
|
||||||
rm -f patch.patch
|
|
||||||
exit 1
|
exit 1
|
||||||
|
39
misc/scripts/clang_tidy.sh
Executable file
39
misc/scripts/clang_tidy.sh
Executable file
@ -0,0 +1,39 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# This script runs clang-tidy on all relevant files in the repo.
|
||||||
|
# This is more thorough than clang-format and thus slower; it should only be run manually.
|
||||||
|
|
||||||
|
set -uo pipefail
|
||||||
|
|
||||||
|
# Loops through all code files tracked by Git.
|
||||||
|
git ls-files '*.c' '*.h' '*.cpp' '*.hpp' '*.cc' '*.hh' '*.cxx' '*.m' '*.mm' '*.inc' '*.java' '*.glsl' |
|
||||||
|
while read -r f; do
|
||||||
|
# Exclude some files.
|
||||||
|
if [[ "$f" == "thirdparty"* ]]; then
|
||||||
|
continue
|
||||||
|
elif [[ "$f" == "platform/android/java/lib/src/com/google"* ]]; then
|
||||||
|
continue
|
||||||
|
elif [[ "$f" == *"-so_wrap."* ]]; then
|
||||||
|
continue
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Run clang-tidy.
|
||||||
|
clang-tidy --quiet --fix "$f" &> /dev/null
|
||||||
|
|
||||||
|
# Run clang-format. This also fixes the output of clang-tidy.
|
||||||
|
clang-format --Wno-error=unknown -i "$f"
|
||||||
|
done
|
||||||
|
|
||||||
|
diff=$(git diff --color)
|
||||||
|
|
||||||
|
# If no patch has been generated all is OK, clean up, and exit.
|
||||||
|
if [ -z "$diff" ] ; then
|
||||||
|
printf "Files in this commit comply with the clang-tidy style rules.\n"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# A patch has been created, notify the user, clean up, and exit.
|
||||||
|
printf "\n*** The following changes have been made to comply with the formatting rules:\n\n"
|
||||||
|
echo "$diff"
|
||||||
|
printf "\n*** Please fix your commit(s) with 'git commit --amend' or 'git rebase -i <hash>'\n"
|
||||||
|
exit 1
|
@ -47,10 +47,10 @@ while IFS= read -rd '' f; do
|
|||||||
perl -i -ple 's/\s*$//g' "$f"
|
perl -i -ple 's/\s*$//g' "$f"
|
||||||
done
|
done
|
||||||
|
|
||||||
git diff --color > patch.patch
|
diff=$(git diff --color)
|
||||||
|
|
||||||
# If no patch has been generated all is OK, clean up, and exit.
|
# If no patch has been generated all is OK, clean up, and exit.
|
||||||
if [ ! -s patch.patch ] ; then
|
if [ -z "$diff" ] ; then
|
||||||
printf "Files in this commit comply with the formatting rules.\n"
|
printf "Files in this commit comply with the formatting rules.\n"
|
||||||
rm -f patch.patch
|
rm -f patch.patch
|
||||||
exit 0
|
exit 0
|
||||||
@ -59,7 +59,6 @@ fi
|
|||||||
# A patch has been created, notify the user, clean up, and exit.
|
# A patch has been created, notify the user, clean up, and exit.
|
||||||
printf "\n*** The following differences were found between the code "
|
printf "\n*** The following differences were found between the code "
|
||||||
printf "and the formatting rules:\n\n"
|
printf "and the formatting rules:\n\n"
|
||||||
cat patch.patch
|
echo "$diff"
|
||||||
printf "\n*** Aborting, please fix your commit(s) with 'git commit --amend' or 'git rebase -i <hash>'\n"
|
printf "\n*** Aborting, please fix your commit(s) with 'git commit --amend' or 'git rebase -i <hash>'\n"
|
||||||
rm -f patch.patch
|
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -130,7 +130,7 @@ AnimationCurve::~AnimationCurve() {
|
|||||||
AnimationCurveNode::AnimationCurveNode(uint64_t id, const ElementPtr element, const std::string &name,
|
AnimationCurveNode::AnimationCurveNode(uint64_t id, const ElementPtr element, const std::string &name,
|
||||||
const Document &doc, const char *const *target_prop_whitelist /*= nullptr*/,
|
const Document &doc, const char *const *target_prop_whitelist /*= nullptr*/,
|
||||||
size_t whitelist_size /*= 0*/) :
|
size_t whitelist_size /*= 0*/) :
|
||||||
Object(id, element, name), target(), doc(doc) {
|
Object(id, element, name), doc(doc) {
|
||||||
// find target node
|
// find target node
|
||||||
const char *whitelist[] = { "Model", "NodeAttribute", "Deformer" };
|
const char *whitelist[] = { "Model", "NodeAttribute", "Deformer" };
|
||||||
const std::vector<const Connection *> &conns = doc.GetConnectionsBySourceSequenced(ID(), whitelist, 3);
|
const std::vector<const Connection *> &conns = doc.GetConnectionsBySourceSequenced(ID(), whitelist, 3);
|
||||||
|
@ -104,7 +104,7 @@ Constraint::~Constraint() {
|
|||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Cluster::Cluster(uint64_t id, const ElementPtr element, const Document &doc, const std::string &name) :
|
Cluster::Cluster(uint64_t id, const ElementPtr element, const Document &doc, const std::string &name) :
|
||||||
Deformer(id, element, doc, name), valid_transformAssociateModel(false) {
|
Deformer(id, element, doc, name) {
|
||||||
const ScopePtr sc = GetRequiredScope(element);
|
const ScopePtr sc = GetRequiredScope(element);
|
||||||
// for( auto element : sc.Elements())
|
// for( auto element : sc.Elements())
|
||||||
// {
|
// {
|
||||||
@ -177,7 +177,7 @@ Cluster::~Cluster() {
|
|||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Skin::Skin(uint64_t id, const ElementPtr element, const Document &doc, const std::string &name) :
|
Skin::Skin(uint64_t id, const ElementPtr element, const Document &doc, const std::string &name) :
|
||||||
Deformer(id, element, doc, name), accuracy(0.0f) {
|
Deformer(id, element, doc, name) {
|
||||||
const ScopePtr sc = GetRequiredScope(element);
|
const ScopePtr sc = GetRequiredScope(element);
|
||||||
|
|
||||||
// keep this it is used for debugging and any FBX format changes
|
// keep this it is used for debugging and any FBX format changes
|
||||||
|
@ -235,7 +235,7 @@ Scope::~Scope() {
|
|||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
Parser::Parser(const TokenList &tokens, bool is_binary) :
|
Parser::Parser(const TokenList &tokens, bool is_binary) :
|
||||||
corrupt(false), tokens(tokens), cursor(tokens.begin()), is_binary(is_binary) {
|
tokens(tokens), cursor(tokens.begin()), is_binary(is_binary) {
|
||||||
root = new_Scope(*this, true);
|
root = new_Scope(*this, true);
|
||||||
scopes.push_back(root);
|
scopes.push_back(root);
|
||||||
}
|
}
|
||||||
|
@ -145,8 +145,7 @@ std::string PeekPropertyName(const Element &element) {
|
|||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
// ------------------------------------------------------------------------------------------------
|
// ------------------------------------------------------------------------------------------------
|
||||||
PropertyTable::PropertyTable() :
|
PropertyTable::PropertyTable() {
|
||||||
element(nullptr) {
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Is used when dealing with FBX Objects not metadata.
|
// Is used when dealing with FBX Objects not metadata.
|
||||||
|
@ -132,15 +132,15 @@ const TBuiltInResource DefaultTBuiltInResource = {
|
|||||||
/* .maxDualSourceDrawBuffersEXT = */ 1,
|
/* .maxDualSourceDrawBuffersEXT = */ 1,
|
||||||
|
|
||||||
/* .limits = */ {
|
/* .limits = */ {
|
||||||
/* .nonInductiveForLoops = */ 1,
|
/* .nonInductiveForLoops = */ true,
|
||||||
/* .whileLoops = */ 1,
|
/* .whileLoops = */ true,
|
||||||
/* .doWhileLoops = */ 1,
|
/* .doWhileLoops = */ true,
|
||||||
/* .generalUniformIndexing = */ 1,
|
/* .generalUniformIndexing = */ true,
|
||||||
/* .generalAttributeMatrixVectorIndexing = */ 1,
|
/* .generalAttributeMatrixVectorIndexing = */ true,
|
||||||
/* .generalVaryingIndexing = */ 1,
|
/* .generalVaryingIndexing = */ true,
|
||||||
/* .generalSamplerIndexing = */ 1,
|
/* .generalSamplerIndexing = */ true,
|
||||||
/* .generalVariableIndexing = */ 1,
|
/* .generalVariableIndexing = */ true,
|
||||||
/* .generalConstantMatrixVectorIndexing = */ 1,
|
/* .generalConstantMatrixVectorIndexing = */ true,
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -127,8 +127,9 @@ _FORCE_INLINE_ int32_t ot_tag_from_string(const char *p_str, int p_len) {
|
|||||||
char tag[4];
|
char tag[4];
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
|
|
||||||
if (!p_str || !p_len || !*p_str)
|
if (!p_str || !p_len || !*p_str) {
|
||||||
return OT_TAG(0, 0, 0, 0);
|
return OT_TAG(0, 0, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
if (p_len < 0 || p_len > 4) {
|
if (p_len < 0 || p_len > 4) {
|
||||||
p_len = 4;
|
p_len = 4;
|
||||||
|
@ -912,7 +912,7 @@ int VisualScriptPropertySet::get_output_sequence_port_count() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool VisualScriptPropertySet::has_input_sequence_port() const {
|
bool VisualScriptPropertySet::has_input_sequence_port() const {
|
||||||
return 1;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Node *VisualScriptPropertySet::_get_base_node() const {
|
Node *VisualScriptPropertySet::_get_base_node() const {
|
||||||
|
@ -1332,8 +1332,9 @@ int DisplayServerX11::window_get_current_screen(WindowID p_window) const {
|
|||||||
|
|
||||||
void DisplayServerX11::gl_window_make_current(DisplayServer::WindowID p_window_id) {
|
void DisplayServerX11::gl_window_make_current(DisplayServer::WindowID p_window_id) {
|
||||||
#if defined(GLES3_ENABLED)
|
#if defined(GLES3_ENABLED)
|
||||||
if (gl_manager)
|
if (gl_manager) {
|
||||||
gl_manager->window_make_current(p_window_id);
|
gl_manager->window_make_current(p_window_id);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -68,8 +68,9 @@ static int ctxErrorHandler(Display *dpy, XErrorEvent *ev) {
|
|||||||
int GLManager_X11::_find_or_create_display(Display *p_x11_display) {
|
int GLManager_X11::_find_or_create_display(Display *p_x11_display) {
|
||||||
for (unsigned int n = 0; n < _displays.size(); n++) {
|
for (unsigned int n = 0; n < _displays.size(); n++) {
|
||||||
const GLDisplay &d = _displays[n];
|
const GLDisplay &d = _displays[n];
|
||||||
if (d.x11_display == p_x11_display)
|
if (d.x11_display == p_x11_display) {
|
||||||
return n;
|
return n;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// create
|
// create
|
||||||
@ -82,8 +83,7 @@ int GLManager_X11::_find_or_create_display(Display *p_x11_display) {
|
|||||||
GLDisplay &d = _displays[new_display_id];
|
GLDisplay &d = _displays[new_display_id];
|
||||||
|
|
||||||
d.context = memnew(GLManager_X11_Private);
|
d.context = memnew(GLManager_X11_Private);
|
||||||
;
|
d.context->glx_context = nullptr;
|
||||||
d.context->glx_context = 0;
|
|
||||||
|
|
||||||
//Error err = _create_context(d);
|
//Error err = _create_context(d);
|
||||||
_create_context(d);
|
_create_context(d);
|
||||||
@ -124,7 +124,7 @@ Error GLManager_X11::_create_context(GLDisplay &gl_display) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
int fbcount;
|
int fbcount;
|
||||||
GLXFBConfig fbconfig = 0;
|
GLXFBConfig fbconfig = nullptr;
|
||||||
XVisualInfo *vi = nullptr;
|
XVisualInfo *vi = nullptr;
|
||||||
|
|
||||||
gl_display.x_swa.event_mask = StructureNotifyMask;
|
gl_display.x_swa.event_mask = StructureNotifyMask;
|
||||||
@ -137,8 +137,9 @@ Error GLManager_X11::_create_context(GLDisplay &gl_display) {
|
|||||||
|
|
||||||
for (int i = 0; i < fbcount; i++) {
|
for (int i = 0; i < fbcount; i++) {
|
||||||
vi = (XVisualInfo *)glXGetVisualFromFBConfig(x11_display, fbc[i]);
|
vi = (XVisualInfo *)glXGetVisualFromFBConfig(x11_display, fbc[i]);
|
||||||
if (!vi)
|
if (!vi) {
|
||||||
continue;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
XRenderPictFormat *pict_format = XRenderFindVisualFormat(x11_display, vi->visual);
|
XRenderPictFormat *pict_format = XRenderFindVisualFormat(x11_display, vi->visual);
|
||||||
if (!pict_format) {
|
if (!pict_format) {
|
||||||
@ -262,22 +263,26 @@ void GLManager_X11::window_destroy(DisplayServer::WindowID p_window_id) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void GLManager_X11::release_current() {
|
void GLManager_X11::release_current() {
|
||||||
if (!_current_window)
|
if (!_current_window) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
glXMakeCurrent(_x_windisp.x11_display, None, nullptr);
|
glXMakeCurrent(_x_windisp.x11_display, None, nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GLManager_X11::window_make_current(DisplayServer::WindowID p_window_id) {
|
void GLManager_X11::window_make_current(DisplayServer::WindowID p_window_id) {
|
||||||
if (p_window_id == -1)
|
if (p_window_id == -1) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
GLWindow &win = _windows[p_window_id];
|
GLWindow &win = _windows[p_window_id];
|
||||||
if (!win.in_use)
|
if (!win.in_use) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// noop
|
// noop
|
||||||
if (&win == _current_window)
|
if (&win == _current_window) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const GLDisplay &disp = get_display(win.gldisplay_id);
|
const GLDisplay &disp = get_display(win.gldisplay_id);
|
||||||
|
|
||||||
@ -287,8 +292,9 @@ void GLManager_X11::window_make_current(DisplayServer::WindowID p_window_id) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void GLManager_X11::make_current() {
|
void GLManager_X11::make_current() {
|
||||||
if (!_current_window)
|
if (!_current_window) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
if (!_current_window->in_use) {
|
if (!_current_window->in_use) {
|
||||||
WARN_PRINT("current window not in use!");
|
WARN_PRINT("current window not in use!");
|
||||||
return;
|
return;
|
||||||
@ -301,8 +307,9 @@ void GLManager_X11::swap_buffers() {
|
|||||||
// NO NEED TO CALL SWAP BUFFERS for each window...
|
// NO NEED TO CALL SWAP BUFFERS for each window...
|
||||||
// see https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/glXSwapBuffers.xml
|
// see https://www.khronos.org/registry/OpenGL-Refpages/gl2.1/xhtml/glXSwapBuffers.xml
|
||||||
|
|
||||||
if (!_current_window)
|
if (!_current_window) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
if (!_current_window->in_use) {
|
if (!_current_window->in_use) {
|
||||||
WARN_PRINT("current window not in use!");
|
WARN_PRINT("current window not in use!");
|
||||||
return;
|
return;
|
||||||
@ -335,19 +342,23 @@ void GLManager_X11::set_use_vsync(bool p_use) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// we need an active window to get a display to set the vsync
|
// we need an active window to get a display to set the vsync
|
||||||
if (!_current_window)
|
if (!_current_window) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
const GLDisplay &disp = get_current_display();
|
const GLDisplay &disp = get_current_display();
|
||||||
|
|
||||||
if (!setup) {
|
if (!setup) {
|
||||||
setup = true;
|
setup = true;
|
||||||
String extensions = glXQueryExtensionsString(disp.x11_display, DefaultScreen(disp.x11_display));
|
String extensions = glXQueryExtensionsString(disp.x11_display, DefaultScreen(disp.x11_display));
|
||||||
if (extensions.find("GLX_EXT_swap_control") != -1)
|
if (extensions.find("GLX_EXT_swap_control") != -1) {
|
||||||
glXSwapIntervalEXT = (PFNGLXSWAPINTERVALEXTPROC)glXGetProcAddressARB((const GLubyte *)"glXSwapIntervalEXT");
|
glXSwapIntervalEXT = (PFNGLXSWAPINTERVALEXTPROC)glXGetProcAddressARB((const GLubyte *)"glXSwapIntervalEXT");
|
||||||
if (extensions.find("GLX_MESA_swap_control") != -1)
|
}
|
||||||
|
if (extensions.find("GLX_MESA_swap_control") != -1) {
|
||||||
glXSwapIntervalMESA = (PFNGLXSWAPINTERVALSGIPROC)glXGetProcAddressARB((const GLubyte *)"glXSwapIntervalMESA");
|
glXSwapIntervalMESA = (PFNGLXSWAPINTERVALSGIPROC)glXGetProcAddressARB((const GLubyte *)"glXSwapIntervalMESA");
|
||||||
if (extensions.find("GLX_SGI_swap_control") != -1)
|
}
|
||||||
|
if (extensions.find("GLX_SGI_swap_control") != -1) {
|
||||||
glXSwapIntervalSGI = (PFNGLXSWAPINTERVALSGIPROC)glXGetProcAddressARB((const GLubyte *)"glXSwapIntervalSGI");
|
glXSwapIntervalSGI = (PFNGLXSWAPINTERVALSGIPROC)glXGetProcAddressARB((const GLubyte *)"glXSwapIntervalSGI");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
int val = p_use ? 1 : 0;
|
int val = p_use ? 1 : 0;
|
||||||
if (glXSwapIntervalMESA) {
|
if (glXSwapIntervalMESA) {
|
||||||
@ -357,8 +368,9 @@ void GLManager_X11::set_use_vsync(bool p_use) {
|
|||||||
} else if (glXSwapIntervalEXT) {
|
} else if (glXSwapIntervalEXT) {
|
||||||
GLXDrawable drawable = glXGetCurrentDrawable();
|
GLXDrawable drawable = glXGetCurrentDrawable();
|
||||||
glXSwapIntervalEXT(disp.x11_display, drawable, val);
|
glXSwapIntervalEXT(disp.x11_display, drawable, val);
|
||||||
} else
|
} else {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
use_vsync = p_use;
|
use_vsync = p_use;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -300,8 +300,9 @@ Node3D *Node3D::get_parent_node_3d() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Transform3D Node3D::get_relative_transform(const Node *p_parent) const {
|
Transform3D Node3D::get_relative_transform(const Node *p_parent) const {
|
||||||
if (p_parent == this)
|
if (p_parent == this) {
|
||||||
return Transform3D();
|
return Transform3D();
|
||||||
|
}
|
||||||
|
|
||||||
ERR_FAIL_COND_V(!data.parent, Transform3D());
|
ERR_FAIL_COND_V(!data.parent, Transform3D());
|
||||||
|
|
||||||
|
@ -1088,8 +1088,9 @@ void AnimatedSprite3D::set_frame(int p_frame) {
|
|||||||
|
|
||||||
if (frames->has_animation(animation)) {
|
if (frames->has_animation(animation)) {
|
||||||
int limit = frames->get_frame_count(animation);
|
int limit = frames->get_frame_count(animation);
|
||||||
if (p_frame >= limit)
|
if (p_frame >= limit) {
|
||||||
p_frame = limit - 1;
|
p_frame = limit - 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (p_frame < 0) {
|
if (p_frame < 0) {
|
||||||
|
@ -1692,8 +1692,9 @@ int GraphEdit::_set_operations(SET_OPERATIONS p_operation, Set<StringName> &r_u,
|
|||||||
switch (p_operation) {
|
switch (p_operation) {
|
||||||
case GraphEdit::IS_EQUAL: {
|
case GraphEdit::IS_EQUAL: {
|
||||||
for (Set<StringName>::Element *E = r_u.front(); E; E = E->next()) {
|
for (Set<StringName>::Element *E = r_u.front(); E; E = E->next()) {
|
||||||
if (!r_v.has(E->get()))
|
if (!r_v.has(E->get())) {
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return r_u.size() == r_v.size();
|
return r_u.size() == r_v.size();
|
||||||
} break;
|
} break;
|
||||||
@ -1702,8 +1703,9 @@ int GraphEdit::_set_operations(SET_OPERATIONS p_operation, Set<StringName> &r_u,
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
for (Set<StringName>::Element *E = r_u.front(); E; E = E->next()) {
|
for (Set<StringName>::Element *E = r_u.front(); E; E = E->next()) {
|
||||||
if (!r_v.has(E->get()))
|
if (!r_v.has(E->get())) {
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
} break;
|
} break;
|
||||||
|
@ -555,8 +555,9 @@ void TreeItem::uncollapse_tree() {
|
|||||||
void TreeItem::set_custom_minimum_height(int p_height) {
|
void TreeItem::set_custom_minimum_height(int p_height) {
|
||||||
custom_min_height = p_height;
|
custom_min_height = p_height;
|
||||||
|
|
||||||
for (Cell &c : cells)
|
for (Cell &c : cells) {
|
||||||
c.cached_minimum_size_dirty = true;
|
c.cached_minimum_size_dirty = true;
|
||||||
|
}
|
||||||
|
|
||||||
_changed_notify();
|
_changed_notify();
|
||||||
}
|
}
|
||||||
@ -1092,8 +1093,9 @@ bool TreeItem::get_expand_right(int p_column) const {
|
|||||||
void TreeItem::set_disable_folding(bool p_disable) {
|
void TreeItem::set_disable_folding(bool p_disable) {
|
||||||
disable_folding = p_disable;
|
disable_folding = p_disable;
|
||||||
|
|
||||||
for (Cell &c : cells)
|
for (Cell &c : cells) {
|
||||||
c.cached_minimum_size_dirty = true;
|
c.cached_minimum_size_dirty = true;
|
||||||
|
}
|
||||||
|
|
||||||
_changed_notify(0);
|
_changed_notify(0);
|
||||||
}
|
}
|
||||||
|
@ -2474,34 +2474,38 @@ T Animation::_interpolate(const Vector<TKey<T>> &p_keys, double p_time, Interpol
|
|||||||
real_t delta = (length - p_keys[next].time) - (length - p_keys[idx].time);
|
real_t delta = (length - p_keys[next].time) - (length - p_keys[idx].time);
|
||||||
real_t from = (length - p_time) - (length - p_keys[idx].time);
|
real_t from = (length - p_time) - (length - p_keys[idx].time);
|
||||||
|
|
||||||
if (Math::is_zero_approx(delta))
|
if (Math::is_zero_approx(delta)) {
|
||||||
c = 0;
|
c = 0;
|
||||||
else
|
} else {
|
||||||
c = from / delta;
|
c = from / delta;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
next = len - 1;
|
next = len - 1;
|
||||||
real_t delta = p_keys[idx].time + (length - p_keys[next].time);
|
real_t delta = p_keys[idx].time + (length - p_keys[next].time);
|
||||||
real_t from = (length - p_time) - (length - p_keys[idx].time);
|
real_t from = (length - p_time) - (length - p_keys[idx].time);
|
||||||
|
|
||||||
if (Math::is_zero_approx(delta))
|
if (Math::is_zero_approx(delta)) {
|
||||||
c = 0;
|
c = 0;
|
||||||
else
|
} else {
|
||||||
c = from / delta;
|
c = from / delta;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// on loop, in front of last key
|
// on loop, in front of last key
|
||||||
idx = 0;
|
idx = 0;
|
||||||
next = len - 1;
|
next = len - 1;
|
||||||
real_t endtime = p_keys[idx].time;
|
real_t endtime = p_keys[idx].time;
|
||||||
if (endtime > length) // may be keys past the end
|
if (endtime > length) { // may be keys past the end
|
||||||
endtime = length;
|
endtime = length;
|
||||||
|
}
|
||||||
real_t delta = p_keys[next].time - endtime;
|
real_t delta = p_keys[next].time - endtime;
|
||||||
real_t from = p_time - endtime;
|
real_t from = p_time - endtime;
|
||||||
|
|
||||||
if (Math::is_zero_approx(delta))
|
if (Math::is_zero_approx(delta)) {
|
||||||
c = 0;
|
c = 0;
|
||||||
else
|
} else {
|
||||||
c = from / delta;
|
c = from / delta;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else { // no loop
|
} else { // no loop
|
||||||
|
@ -2344,8 +2344,9 @@ real_t Font::draw_char(RID p_canvas_item, const Point2 &p_pos, char32_t p_char,
|
|||||||
|
|
||||||
bool Font::has_char(char32_t p_char) const {
|
bool Font::has_char(char32_t p_char) const {
|
||||||
for (int i = 0; i < data.size(); i++) {
|
for (int i = 0; i < data.size(); i++) {
|
||||||
if (data[i]->has_char(p_char))
|
if (data[i]->has_char(p_char)) {
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -34,8 +34,9 @@
|
|||||||
void SkeletonModification3D::_execute(real_t p_delta) {
|
void SkeletonModification3D::_execute(real_t p_delta) {
|
||||||
GDVIRTUAL_CALL(_execute, p_delta);
|
GDVIRTUAL_CALL(_execute, p_delta);
|
||||||
|
|
||||||
if (!enabled)
|
if (!enabled) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SkeletonModification3D::_setup_modification(SkeletonModificationStack3D *p_stack) {
|
void SkeletonModification3D::_setup_modification(SkeletonModificationStack3D *p_stack) {
|
||||||
|
@ -5089,7 +5089,7 @@ int TileData::get_collision_polygon_shapes_count(int p_layer_id, int p_polygon_i
|
|||||||
}
|
}
|
||||||
|
|
||||||
Ref<ConvexPolygonShape2D> TileData::get_collision_polygon_shape(int p_layer_id, int p_polygon_index, int shape_index) const {
|
Ref<ConvexPolygonShape2D> TileData::get_collision_polygon_shape(int p_layer_id, int p_polygon_index, int shape_index) const {
|
||||||
ERR_FAIL_INDEX_V(p_layer_id, physics.size(), 0);
|
ERR_FAIL_INDEX_V(p_layer_id, physics.size(), Ref<ConvexPolygonShape2D>());
|
||||||
ERR_FAIL_INDEX_V(p_polygon_index, physics[p_layer_id].polygons.size(), Ref<ConvexPolygonShape2D>());
|
ERR_FAIL_INDEX_V(p_polygon_index, physics[p_layer_id].polygons.size(), Ref<ConvexPolygonShape2D>());
|
||||||
ERR_FAIL_INDEX_V(shape_index, (int)physics[p_layer_id].polygons[p_polygon_index].shapes.size(), Ref<ConvexPolygonShape2D>());
|
ERR_FAIL_INDEX_V(shape_index, (int)physics[p_layer_id].polygons[p_polygon_index].shapes.size(), Ref<ConvexPolygonShape2D>());
|
||||||
return physics[p_layer_id].polygons[p_polygon_index].shapes[shape_index];
|
return physics[p_layer_id].polygons[p_polygon_index].shapes[shape_index];
|
||||||
|
@ -456,10 +456,12 @@ void AudioServer::_mix_step() {
|
|||||||
case AudioStreamPlaybackListNode::AWAITING_DELETION:
|
case AudioStreamPlaybackListNode::AWAITING_DELETION:
|
||||||
case AudioStreamPlaybackListNode::FADE_OUT_TO_DELETION:
|
case AudioStreamPlaybackListNode::FADE_OUT_TO_DELETION:
|
||||||
playback_list.erase(playback, [](AudioStreamPlaybackListNode *p) {
|
playback_list.erase(playback, [](AudioStreamPlaybackListNode *p) {
|
||||||
if (p->prev_bus_details)
|
if (p->prev_bus_details) {
|
||||||
delete p->prev_bus_details;
|
delete p->prev_bus_details;
|
||||||
if (p->bus_details)
|
}
|
||||||
|
if (p->bus_details) {
|
||||||
delete p->bus_details;
|
delete p->bus_details;
|
||||||
|
}
|
||||||
p->stream_playback.unref();
|
p->stream_playback.unref();
|
||||||
delete p;
|
delete p;
|
||||||
});
|
});
|
||||||
|
@ -1042,7 +1042,7 @@ void RenderForwardMobile::_render_uv2(const PagedArray<GeometryInstance *> &p_in
|
|||||||
RENDER_TIMESTAMP("Render Material");
|
RENDER_TIMESTAMP("Render Material");
|
||||||
|
|
||||||
{
|
{
|
||||||
RenderListParameters render_list_params(render_list[RENDER_LIST_SECONDARY].elements.ptr(), render_list[RENDER_LIST_SECONDARY].element_info.ptr(), render_list[RENDER_LIST_SECONDARY].elements.size(), true, pass_mode, rp_uniform_set, true, 0);
|
RenderListParameters render_list_params(render_list[RENDER_LIST_SECONDARY].elements.ptr(), render_list[RENDER_LIST_SECONDARY].element_info.ptr(), render_list[RENDER_LIST_SECONDARY].elements.size(), true, pass_mode, rp_uniform_set, true, false);
|
||||||
//regular forward for now
|
//regular forward for now
|
||||||
Vector<Color> clear = {
|
Vector<Color> clear = {
|
||||||
Color(0, 0, 0, 0),
|
Color(0, 0, 0, 0),
|
||||||
|
@ -38,8 +38,9 @@
|
|||||||
namespace TestString {
|
namespace TestString {
|
||||||
|
|
||||||
int u32scmp(const char32_t *l, const char32_t *r) {
|
int u32scmp(const char32_t *l, const char32_t *r) {
|
||||||
for (; *l == *r && *l && *r; l++, r++)
|
for (; *l == *r && *l && *r; l++, r++) {
|
||||||
;
|
;
|
||||||
|
}
|
||||||
return *l - *r;
|
return *l - *r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user