diff options
-rw-r--r-- | AUTHORS.md | 11 | ||||
-rw-r--r-- | DONORS.md | 63 | ||||
-rw-r--r-- | core/string/ustring.cpp | 83 | ||||
-rw-r--r-- | modules/xatlas_unwrap/register_types.cpp | 2 | ||||
-rw-r--r-- | scene/resources/mesh.cpp | 1 |
5 files changed, 88 insertions, 72 deletions
diff --git a/AUTHORS.md b/AUTHORS.md index 430596e611..07a67de77b 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -46,7 +46,7 @@ name is available. Bastiaan Olij (BastiaanOlij) Ben Brookshire (sheepandshepherd) Benjamin Larsson (Nallebeorn) - Bernard Liebl (poke1024) + Bernhard Liebl (poke1024) Bhuvan Vemula (Bhu1-V) Błażej Szczygieł (zaps166) Bojidar Marinov (bojidar-bg) @@ -121,6 +121,7 @@ name is available. Joan Fons Sanchez (JFonS) Johannes Witt (HaSa1002) Johan Manuel (29jm) + Jordan Schidlowsky (winterpixelgames) Joshua Grams (JoshuaGrams) Juan Linietsky (reduz) Julian Murgia (StraToN) @@ -149,6 +150,7 @@ name is available. Mariano Javier Suligoy (MarianoGnu) Mario Schlack (hurikhan) Marios Staikopoulos (marstaik) + Markus Sauermann (Sauermann) Martin Capitanio (capnm) Martin Liška (marxin) Martin Sjursen (binbitten) @@ -164,6 +166,7 @@ name is available. MichiRecRoom (LikeLakers2) Morris "Tabor" Arroad (mortarroad) mrezai + Muhammad Huri (CakHuri) muiroc Nathan Franke (nathanfranke) Nathan Lovato (NathanLovato) @@ -180,14 +183,16 @@ name is available. Paul Joannon (paulloz) Paul Trojahn (ptrojahn) Pawel Kowal (pkowal1982) + Pawel Lampe (Scony) Pedro J. Estébanez (RandomShaper) Pieter-Jan Briers (PJB3005) Poommetee Ketson (Noshyaar) Przemysław Gołąb (n-pigeon) + Rafael M. G. (rafallus) Rafał Mikrut (qarmin) Ralf Hölzemer (rollenrolm) Ramesh Ravone (RameshRavone) - raphael10241024 + Raphael2048 Raul Santos (raulsntos) Ray Koopa (RayKoopa) Rémi Verschelde (akien-mga) @@ -208,12 +213,14 @@ name is available. Simon Wenner (swenner) Stijn Hinlopen (hinlopen) Swarnim Arun (minraws) + TC (floppyhammer) Thakee Nathees (ThakeeNathees) thebestnom Theo Hallenius (TheoXD) Timo Schwarzer (timoschwarzer) Timo (toger5) Tomasz Chabora (KoBeWi) + trollodel Twarit Waikar (IronicallySerious) Umang Kalra (theoway) Vinzenz Feenstra (vinzenz) @@ -46,10 +46,10 @@ generous deed immortalized in the next stable release of Godot Engine. Andrew Bowen Andrew Dunai anti666 - blurp Christian Baune Christopher Montesano Christopher Shifflett + CodeLikeCammy Daniel Edwards Darrin Massena David Mydlarz @@ -73,6 +73,7 @@ generous deed immortalized in the next stable release of Godot Engine. Maxim Karsten Michael Mike King + Nassor Paulino da Silva Nathan Warden Neal Gompa (Conan Kudo) Ninja_5tyl3 @@ -81,11 +82,13 @@ generous deed immortalized in the next stable release of Godot Engine. Rami Relintai Ronnie Cheng + ShikadiGum Slobodan Milnovic Stephan Lanfermann Steve Thomas Krampl Violin Iliev + Vladimír Chvátil ## Gold donors @@ -99,11 +102,11 @@ generous deed immortalized in the next stable release of Godot Engine. Carlo Cabanilla Daniel James David Gehrig + David Hubber David Snopek Ed Morley First Last Florian Rämisch - Gamejunkey Hunter Jones Jacobus Dens Jakub Grzesik @@ -112,6 +115,7 @@ generous deed immortalized in the next stable release of Godot Engine. Jonathan Wright Jon Woodward Karl Werf + Kevin Vu Klavdij Voncina Maciej Pendolski Manuele Finocchiaro @@ -141,7 +145,6 @@ generous deed immortalized in the next stable release of Godot Engine. Victor Xeno Coliseum - Adam McLaughlin Adam Nakonieczny Adam Nelson Adrian Adamiak @@ -159,6 +162,7 @@ generous deed immortalized in the next stable release of Godot Engine. Arthur S. Muszynski Brandon Hawkinson Cameron Connolly + Carl Kryschi Charlie Whitfield Chase Taranto Chris Petrich @@ -170,6 +174,7 @@ generous deed immortalized in the next stable release of Godot Engine. Cristopher CzechBlueBear D + DagobertDick dan didenko Daniel Daniel Hernández Alcojor @@ -179,6 +184,7 @@ generous deed immortalized in the next stable release of Godot Engine. Dev To be curious Dima Fedotov Dimitri Nüscheler + Dmitriy Khudorozhkov Donn Eddy Douglas Hammond Eric Brand @@ -196,35 +202,34 @@ generous deed immortalized in the next stable release of Godot Engine. Geoffroy Warin GGGames.org gisora - GlassBrick GrayDwarf Guilherme Felipe de C. G. da Silva + Harry Tumber Harvey Fong - Hayden Whitehead Heath Hayes Horváth Péter Hu Hund Hunter Barabas HurrieCrane - Jake Burga Jamal Bencharki James Couzens Jan Sælid Jared Jared White + Jean-Sébastien Ross Jennifer Wilcox Jeremi Biernacki - Jesús Chicharro Joel Fivat Johnathan Kupferer - Jose Fernando Alexandre Josef Stumpfegger Jose Malheiro Jose Manuel Muñoz Perez Joshie Sparks Joshua Flores Joshua Lesperance + Juan Velandia Judd + Julián Absatz Julian Todd Juraj Móza JUSTIN CARROLL @@ -245,6 +250,7 @@ generous deed immortalized in the next stable release of Godot Engine. Marcus Richter Mark Barrett Martin Eigel + Martin Gulliksson Martin Kotz Martin Soucek matt @@ -259,6 +265,7 @@ generous deed immortalized in the next stable release of Godot Engine. nate etan Nick Abousselam Nicola Cocchiaro + Nicolás Carrasco Nicole Barovic Oliver Dick Oscar Campos @@ -269,7 +276,6 @@ generous deed immortalized in the next stable release of Godot Engine. Peter Richmond Petr Malac PhaineOfCatz - Piotr Wyszyński Rafał Michno Raymond Harris Reilt @@ -285,6 +291,7 @@ generous deed immortalized in the next stable release of Godot Engine. Romeo Disca Ronnie Ashlock Ronny Mühle + Ryan Breaker Ryan Heath Ryan Scott Samuel Hummerstone @@ -317,8 +324,6 @@ generous deed immortalized in the next stable release of Godot Engine. toto bibi Troy Kinsella Turntsnaco - tweaklab - Tyler Chase Valryia Vincent Cloutier Vlad Ceru Opran @@ -328,7 +333,6 @@ generous deed immortalized in the next stable release of Godot Engine. xzibiting Yifan Lai Yuancheng Zhang - Zie Weaver Артём Равбецкий ## Silver donors @@ -357,7 +361,6 @@ generous deed immortalized in the next stable release of Godot Engine. Ales Jelovcan Alessandro Senese Alexander Ravenheart - Alexander Walter (SilvanuZ) Alex Chan Alex Clavelle alex raeside @@ -383,12 +386,10 @@ generous deed immortalized in the next stable release of Godot Engine. Aubrey Falconer Auré Franky aurelien condomines - Avner AzulCrescent b110110 Balázs Batári Bálint Horváth - bcat Beau Seymour Benedikt Benoit Jauvin-Girard @@ -409,7 +410,6 @@ generous deed immortalized in the next stable release of Godot Engine. Brian Klein Brodie Fairhall Bronson Zgeb - Bruno Hurth Burney Waring c64cosmin Caleb Gartner @@ -437,6 +437,7 @@ generous deed immortalized in the next stable release of Godot Engine. Corchari Craig Maloney Craig Post + Dakota Watkins damucz Daniel Cheney Daren Scot Wilson @@ -460,6 +461,7 @@ generous deed immortalized in the next stable release of Godot Engine. Duodecimal Eduardo Teixeira Edward Herbert + Edward L Edward Swartz Egon Elbre Elgenzay @@ -471,6 +473,7 @@ generous deed immortalized in the next stable release of Godot Engine. Eric Williams Erika Sanders Erkki Seppälä + Ewan Holmes Faisal Alkubaisi Fault Boy fby @@ -497,16 +500,18 @@ generous deed immortalized in the next stable release of Godot Engine. Grominet Guillaume Pham Ngoc Guldoman + gurehamu Hal A Haplo Hayden Foley Heribert Hirth - Hillel Taub-Tabib Hinken Houdini Blueprints Ian ORourke Ian Williams + Idilio Alfaro IndustrialRobot + Ivan Nikolaev iveks izzy neuhaus Jackson Harmer @@ -529,6 +534,7 @@ generous deed immortalized in the next stable release of Godot Engine. Jason Bolton Jason Evans Jason Uechi + Jason Yundt Jeff Hungerford Jeffrey Berube Jennifer Graves @@ -539,7 +545,6 @@ generous deed immortalized in the next stable release of Godot Engine. Joel Höglund John Bruce John Gabriel - John Szevin Jonas Jonas Arndt Jonas Bernemann @@ -556,6 +561,7 @@ generous deed immortalized in the next stable release of Godot Engine. Jordy Goodridge Jorge Antunes Jorge Araya Navarro + Jose Francisco 'Yiro' Vera Girona Joseph Catrambone Josh P Josh Taylor @@ -583,12 +589,11 @@ generous deed immortalized in the next stable release of Godot Engine. Kent Jofur Kerotasma Ketafuki - Kevin van Rooijen Kiri Jolly Kodera Software Kolandrious - Konstantin Goncharov Kquona + Krishna Nadoor Kristian Nygaard Jensen KR McGinley Kronarq @@ -606,6 +611,7 @@ generous deed immortalized in the next stable release of Godot Engine. Leonardo Dimano Linus Lind Lundgren Logan Apple + Luca Poli Ludovic DELVAL Luigi Renna Luis Gaemperle @@ -619,6 +625,7 @@ generous deed immortalized in the next stable release of Godot Engine. Markus Martin Markus Michael Egger Markus Ort + Markus Strompen Martin FIbik Martin Holas Martin Liška @@ -636,7 +643,6 @@ generous deed immortalized in the next stable release of Godot Engine. Melissa Mears Merlyn Morgan-Graham Metal Demon 2000 - mewin mhilbrunner Michael Michael Bruce-Lockhart @@ -657,6 +663,7 @@ generous deed immortalized in the next stable release of Godot Engine. Molly Jameson MoltenGears Moowool + moulefrite MrAZIE Mrjemandem Nathan Fish @@ -676,17 +683,18 @@ generous deed immortalized in the next stable release of Godot Engine. Nils Nordmark Nima Farid Noel Billig - NZ oceoh Okatima Oleg Reva + Oliver Ambrose Oriol Muñoz Princep - Orionis oscar1000108 Oscar Domingo + p Pascal Patrick Indermühle Patrick Nafarrete + Patrick Wuttke Paul E Hansen Paul Gieske Paweł Kowal @@ -709,8 +717,9 @@ generous deed immortalized in the next stable release of Godot Engine. Rainer Amler Rami Hanano Rammeow - Ramunas Leknickas + RAMupgrade red1939 + Relintai Remi Rampin Reneator René Habermann @@ -725,6 +734,7 @@ generous deed immortalized in the next stable release of Godot Engine. Roger Smith Roglozor Roland Rząsa + Roman Papush Ronald Ho Hip (CrimsonZA) Ronan Roy Scayged @@ -742,6 +752,7 @@ generous deed immortalized in the next stable release of Godot Engine. SeungJong k Shaidak Shane + Shane Abraham Shane Sicienski Shane Spoor Silver1063 @@ -755,6 +766,7 @@ generous deed immortalized in the next stable release of Godot Engine. slavfox smbe19 smo1704 + Soheib El-Harrache Solene Waked Sophie Winter Spencer Everhart @@ -785,6 +797,7 @@ generous deed immortalized in the next stable release of Godot Engine. Tim Gleason Tim Klein Timothy B. MacDonald + tinyBigGAMES LLC Title Plinsut TMoney Toadile @@ -812,7 +825,6 @@ generous deed immortalized in the next stable release of Godot Engine. Vitaliy Sapronenko Vi Watch Vladimir Savin - VoxelVisions.com Wapiti . Watchinofoye Wiley Thompson @@ -826,6 +838,7 @@ generous deed immortalized in the next stable release of Godot Engine. yakcyll Yan Shi Yegor Smirnov + Zach H. Zak Stephens Zher Huei Lee 蕭惟允 diff --git a/core/string/ustring.cpp b/core/string/ustring.cpp index c4edc8c086..759c121f29 100644 --- a/core/string/ustring.cpp +++ b/core/string/ustring.cpp @@ -103,9 +103,12 @@ bool Char16String::operator<(const Char16String &p_right) const { } Char16String &Char16String::operator+=(char16_t p_char) { - resize(size() ? size() + 1 : 2); - set(length(), 0); - set(length() - 1, p_char); + const int lhs_len = length(); + resize(lhs_len + 2); + + char16_t *dst = ptrw(); + dst[lhs_len] = p_char; + dst[lhs_len + 1] = 0; return *this; } @@ -158,9 +161,12 @@ bool CharString::operator<(const CharString &p_right) const { } CharString &CharString::operator+=(char p_char) { - resize(size() ? size() + 1 : 2); - set(length(), 0); - set(length() - 1, p_char); + const int lhs_len = length(); + resize(lhs_len + 2); + + char *dst = ptrw(); + dst[lhs_len] = p_char; + dst[lhs_len + 1] = 0; return *this; } @@ -304,11 +310,7 @@ void String::copy_from(const char *p_cstr) { return; } - int len = 0; - const char *ptr = p_cstr; - while (*(ptr++) != 0) { - len++; - } + const size_t len = strlen(p_cstr); if (len == 0) { resize(0); @@ -319,7 +321,7 @@ void String::copy_from(const char *p_cstr) { char32_t *dst = this->ptrw(); - for (int i = 0; i < len + 1; i++) { + for (size_t i = 0; i <= len; i++) { dst[i] = p_cstr[i]; } } @@ -374,13 +376,14 @@ void String::copy_from(const wchar_t *p_cstr, const int p_clip_to) { void String::copy_from(const char32_t &p_char) { resize(2); + char32_t *dst = ptrw(); if ((p_char >= 0xd800 && p_char <= 0xdfff) || (p_char > 0x10ffff)) { print_error("Unicode parsing error: Invalid unicode codepoint " + num_int64(p_char, 16) + "."); - set(0, 0xfffd); + dst[0] = 0xfffd; } else { - set(0, p_char); + dst[0] = p_char; } - set(1, 0); + dst[1] = 0; } void String::copy_from(const char32_t *p_cstr) { @@ -429,9 +432,8 @@ void String::copy_from(const char32_t *p_cstr, const int p_clip_to) { // p_length <= p_char strlen void String::copy_from_unchecked(const char32_t *p_char, const int p_length) { resize(p_length + 1); - set(p_length, 0); - char32_t *dst = ptrw(); + dst[p_length] = 0; for (int i = 0; i < p_length; i++) { if ((p_char[i] >= 0xd800 && p_char[i] <= 0xdfff) || (p_char[i] > 0x10ffff)) { @@ -484,27 +486,23 @@ String operator+(char32_t p_chr, const String &p_str) { } String &String::operator+=(const String &p_str) { - if (is_empty()) { + const int lhs_len = length(); + if (lhs_len == 0) { *this = p_str; return *this; } - if (p_str.is_empty()) { + const int rhs_len = p_str.length(); + if (rhs_len == 0) { return *this; } - int from = length(); - - resize(length() + p_str.size()); + resize(lhs_len + rhs_len + 1); const char32_t *src = p_str.get_data(); - char32_t *dst = ptrw(); - - set(length(), 0); + char32_t *dst = ptrw() + lhs_len; - for (int i = 0; i < p_str.length(); i++) { - dst[from + i] = src[i]; - } + memcpy(dst, src, (rhs_len + 1) * sizeof(char32_t)); return *this; } @@ -514,22 +512,15 @@ String &String::operator+=(const char *p_str) { return *this; } - int src_len = 0; - const char *ptr = p_str; - while (*(ptr++) != 0) { - src_len++; - } - - int from = length(); + const int lhs_len = length(); + const size_t rhs_len = strlen(p_str); - resize(from + src_len + 1); + resize(lhs_len + rhs_len + 1); - char32_t *dst = ptrw(); + char32_t *dst = ptrw() + lhs_len; - set(length(), 0); - - for (int i = 0; i < src_len; i++) { - dst[from + i] = p_str[i]; + for (size_t i = 0; i <= rhs_len; i++) { + dst[i] = p_str[i]; } return *this; @@ -552,14 +543,16 @@ String &String::operator+=(const char32_t *p_str) { } String &String::operator+=(char32_t p_char) { - resize(size() ? size() + 1 : 2); - set(length(), 0); + const int lhs_len = length(); + resize(lhs_len + 2); + char32_t *dst = ptrw(); if ((p_char >= 0xd800 && p_char <= 0xdfff) || (p_char > 0x10ffff)) { print_error("Unicode parsing error: Invalid unicode codepoint " + num_int64(p_char, 16) + "."); - set(length() - 1, 0xfffd); + dst[lhs_len] = 0xfffd; } else { - set(length() - 1, p_char); + dst[lhs_len] = p_char; } + dst[lhs_len + 1] = 0; return *this; } diff --git a/modules/xatlas_unwrap/register_types.cpp b/modules/xatlas_unwrap/register_types.cpp index 6f397fe285..139df9c735 100644 --- a/modules/xatlas_unwrap/register_types.cpp +++ b/modules/xatlas_unwrap/register_types.cpp @@ -120,6 +120,8 @@ bool xatlas_mesh_lightmap_unwrap_callback(float p_texel_size, const float *p_ver xatlas::ChartOptions chart_options; chart_options.fixWinding = true; + ERR_FAIL_COND_V_MSG(p_texel_size <= 0.0f, false, "Texel size must be greater than 0."); + xatlas::PackOptions pack_options; pack_options.padding = 1; pack_options.maxChartSize = 4094; // Lightmap atlassing needs 2 for padding between meshes, so 4096-2 diff --git a/scene/resources/mesh.cpp b/scene/resources/mesh.cpp index 441e84eccc..6b44b05e02 100644 --- a/scene/resources/mesh.cpp +++ b/scene/resources/mesh.cpp @@ -1684,6 +1684,7 @@ Error ArrayMesh::lightmap_unwrap(const Transform3D &p_base_transform, float p_te Error ArrayMesh::lightmap_unwrap_cached(const Transform3D &p_base_transform, float p_texel_size, const Vector<uint8_t> &p_src_cache, Vector<uint8_t> &r_dst_cache, bool p_generate_cache) { ERR_FAIL_COND_V(!array_mesh_lightmap_unwrap_callback, ERR_UNCONFIGURED); ERR_FAIL_COND_V_MSG(blend_shapes.size() != 0, ERR_UNAVAILABLE, "Can't unwrap mesh with blend shapes."); + ERR_FAIL_COND_V_MSG(p_texel_size <= 0.0f, ERR_PARAMETER_RANGE_ERROR, "Texel size must be greater than 0."); LocalVector<float> vertices; LocalVector<float> normals; |