Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Spartan322 committed Feb 12, 2025
2 parents 0e13df4 + ad9abe8 commit 180365a
Show file tree
Hide file tree
Showing 512 changed files with 498,006 additions and 149,351 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/android_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,27 @@ jobs:
cd ../../..
ls -l bin/android_editor_builds/
# Separate different editors for multiple artifacts
mkdir horizonos
mv bin/android_editor_builds/*-horizonos-* horizonos
mkdir picoos
mv bin/android_editor_builds/*-picoos-* picoos
- name: Upload artifact
uses: ./.github/actions/upload-artifact
with:
name: ${{ matrix.cache-name }}

- name: Upload artifact (Horizon OS)
if: matrix.target == 'editor'
uses: ./.github/actions/upload-artifact
with:
name: ${{ matrix.cache-name }}-horizonos
path: horizonos

- name: Upload artifact (PICO OS)
if: matrix.target == 'editor'
uses: ./.github/actions/upload-artifact
with:
name: ${{ matrix.cache-name }}-picoos
path: picoos
14 changes: 12 additions & 2 deletions .github/workflows/linux_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:
artifact: false
cache-limit: 5

- name: Template w/ Mono (target=template_release, tests=yes)
- name: Template w/ Mono, release (target=template_release, tests=yes)
cache-name: linux-template-mono
target: template_release
sconsflags: module_mono_enabled=yes
Expand All @@ -84,6 +84,16 @@ jobs:
artifact: true
cache-limit: 1

- name: Template w/ Mono, debug (target=template_debug, tests=yes)
cache-name: linux-template-mono-debug
target: template_debug
sconsflags: module_mono_enabled=yes
bin: ./bin/redot.linuxbsd.template_debug.x86_64.mono
build-mono: false
tests: true
artifact: true
cache-limit: 1

- name: Minimal template (target=template_release, tests=yes, everything disabled)
cache-name: linux-template-minimal
target: template_release
Expand All @@ -105,7 +115,7 @@ jobs:
run: |
sudo rm -f /etc/apt/sources.list.d/microsoft-prod.list
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EB8B81E14DA65431D7504EA8F63F0F2B90935439
sudo add-apt-repository "deb https://ppa.launchpadcontent.net/kisak/turtle/ubuntu ${{ matrix.os == 'ubuntu-20.04' && 'focal' || 'jammy' }} main"
sudo add-apt-repository "deb https://ppa.launchpadcontent.net/kisak/turtle/ubuntu jammy main"
sudo apt-get install -qq mesa-vulkan-drivers
# TODO: Figure out somehow how to embed this one.
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,7 @@ cpp.hint
# macOS
.DS_Store
__MACOSX
Godot.app

# Windows
# https://github.com/github/gitignore/blob/main/Global/Windows.gitignore
Expand Down
34 changes: 19 additions & 15 deletions COPYRIGHT.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,15 @@ Copyright: 2011, Ole Kniemeyer, MAXON, www.maxon.net
2007-2014, Juan Linietsky, Ariel Manzur
License: Expat and Zlib

Files: modules/betsy/alpha_stitch.glsl
modules/betsy/bc1.glsl
modules/betsy/bc4.glsl
modules/betsy/bc6h.glsl
modules/betsy/CrossPlatformSettings_piece_all.glsl
Comment: Betsy
Copyright: 2020-2022, Matias N. Goldberg
License: Expat

Files: modules/godot_physics_2d/godot_joints_2d.cpp
Comment: Chipmunk2D Joint Constraints
Copyright: 2007, Scott Lembcke
Expand Down Expand Up @@ -188,11 +197,6 @@ Comment: Basis Universal
Copyright: 2019-2024, Binomial LLC.
License: Apache-2.0

Files: thirdparty/betsy/*
Comment: Betsy
Copyright: 2020-2022, Matias N. Goldberg
License: Expat

Files: thirdparty/brotli/*
Comment: Brotli
Copyright: 2009, 2010, 2013-2016 by the Brotli Authors.
Expand Down Expand Up @@ -416,6 +420,11 @@ Comment: FastLZ
Copyright: 2005-2020, Ariya Hidayat
License: Expat

Files: thirdparty/misc/FastNoiseLite.h
Comment: FastNoise Lite
Copyright: 2023, Jordan Peck and contributors
License: Expat

Files: thirdparty/misc/ifaddrs-android.cc
thirdparty/misc/ifaddrs-android.h
Comment: libjingle
Expand All @@ -428,17 +437,17 @@ Comment: Tangent Space Normal Maps implementation
Copyright: 2011, Morten S. Mikkelsen
License: Zlib

Files: thirdparty/misc/nvapi_minimal.h
Comment: NVIDIA NVAPI (minimal excerpt)
Copyright: 2019-2022, NVIDIA Corporation
License: Expat

Files: thirdparty/misc/ok_color.h
thirdparty/misc/ok_color_shader.h
Comment: OK Lab color space
Copyright: 2021, Björn Ottosson
License: Expat

Files: thirdparty/noise/FastNoiseLite.h
Comment: FastNoise Lite
Copyright: 2023, Jordan Peck and contributors
License: Expat

Files: thirdparty/misc/pcg.cpp
thirdparty/misc/pcg.h
Comment: Minimal PCG32 implementation
Expand Down Expand Up @@ -489,11 +498,6 @@ Comment: Multi-channel signed distance field generator
Copyright: 2014-2024, Viktor Chlumsky
License: Expat

Files: thirdparty/nvapi/nvapi_minimal.h
Comment: Stripped down version of "nvapi.h" from the NVIDIA NVAPI SDK
Copyright: 2019-2022, NVIDIA Corporation
License: Expat

Files: thirdparty/openxr/*
Comment: OpenXR Loader
Copyright: 2020-2023, The Khronos Group Inc.
Expand Down
11 changes: 7 additions & 4 deletions core/io/logger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include "core/core_globals.h"
#include "core/io/dir_access.h"
#include "core/os/time.h"
#include "core/templates/rb_set.h"

#include "modules/modules_enabled.gen.h" // For regex.
#ifdef MODULE_REGEX_ENABLED
Expand Down Expand Up @@ -131,7 +132,9 @@ void RotatedFileLogger::clear_old_backups() {

da->list_dir_begin();
String f = da->get_next();
HashSet<String> backups;
// backups is a RBSet because it guarantees that iterating on it is done in sorted order.
// RotatedFileLogger depends on this behavior to delete the oldest log file first.
RBSet<String> backups;
while (!f.is_empty()) {
if (!da->current_is_dir() && f.begins_with(basename) && f.get_extension() == extension && f != base_path.get_file()) {
backups.insert(f);
Expand All @@ -140,12 +143,12 @@ void RotatedFileLogger::clear_old_backups() {
}
da->list_dir_end();

if (backups.size() > (uint32_t)max_backups) {
if (backups.size() > max_backups) {
// since backups are appended with timestamp and Set iterates them in sorted order,
// first backups are the oldest
int to_delete = backups.size() - max_backups;
for (HashSet<String>::Iterator E = backups.begin(); E && to_delete > 0; ++E, --to_delete) {
da->remove(*E);
for (RBSet<String>::Element *E = backups.front(); E && to_delete > 0; E = E->next(), --to_delete) {
da->remove(E->get());
}
}
}
Expand Down
14 changes: 14 additions & 0 deletions core/io/resource_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1198,6 +1198,20 @@ bool ResourceLoader::has_custom_uid_support(const String &p_path) {
return false;
}

bool ResourceLoader::should_create_uid_file(const String &p_path) {
const String local_path = _validate_local_path(p_path);
if (FileAccess::exists(local_path + ".uid")) {
return false;
}

for (int i = 0; i < loader_count; i++) {
if (loader[i]->recognize_path(local_path)) {
return !loader[i]->has_custom_uid_support();
}
}
return false;
}

String ResourceLoader::_path_remap(const String &p_path, bool *r_translation_remapped) {
String new_path = p_path;

Expand Down
1 change: 1 addition & 0 deletions core/io/resource_loader.h
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ class ResourceLoader {
static String get_resource_script_class(const String &p_path);
static ResourceUID::ID get_resource_uid(const String &p_path);
static bool has_custom_uid_support(const String &p_path);
static bool should_create_uid_file(const String &p_path);
static void get_dependencies(const String &p_path, List<String> *p_dependencies, bool p_add_types = false);
static Error rename_dependencies(const String &p_path, const HashMap<String, String> &p_map);
static bool is_import_valid(const String &p_path);
Expand Down
13 changes: 13 additions & 0 deletions core/io/resource_uid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,19 @@ String ResourceUID::get_id_path(ID p_id) const {
ERR_FAIL_COND_V_MSG(p_id == INVALID_ID, String(), "Invalid UID.");
MutexLock l(mutex);
const ResourceUID::Cache *cache = unique_ids.getptr(p_id);

#if TOOLS_ENABLED
// On startup, the scan_for_uid_on_startup callback should be set and will
// execute EditorFileSystem::scan_for_uid, which scans all project files
// to reload the UID cache before the first scan.
// Note: EditorFileSystem::scan_for_uid sets scan_for_uid_on_startup to nullptr
// once the first scan_for_uid is complete.
if (!cache && scan_for_uid_on_startup) {
scan_for_uid_on_startup();
cache = unique_ids.getptr(p_id);
}
#endif

ERR_FAIL_COND_V_MSG(!cache, String(), vformat("Unrecognized UID: \"%s\".", id_to_text(p_id)));
const CharString &cs = cache->cs;
return String::utf8(cs.ptr());
Expand Down
4 changes: 4 additions & 0 deletions core/io/resource_uid.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@

class FileAccess;

typedef void (*ResourceUIDScanForUIDOnStartup)();

class ResourceUID : public Object {
GDCLASS(ResourceUID, Object)
public:
Expand All @@ -65,6 +67,8 @@ class ResourceUID : public Object {
static void _bind_methods();

public:
inline static ResourceUIDScanForUIDOnStartup scan_for_uid_on_startup = nullptr;

String id_to_text(ID p_id) const;
ID text_to_id(const String &p_text) const;

Expand Down
12 changes: 6 additions & 6 deletions core/math/expression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -352,16 +352,16 @@ Error Expression::_get_token(Token &r_token) {
case READING_INT: {
if (is_digit(c)) {
if (is_first_char && c == '0') {
if (next_char == 'b') {
if (next_char == 'b' || next_char == 'B') {
reading = READING_BIN;
} else if (next_char == 'x') {
} else if (next_char == 'x' || next_char == 'X') {
reading = READING_HEX;
}
}
} else if (c == '.') {
reading = READING_DEC;
is_float = true;
} else if (c == 'e') {
} else if (c == 'e' || c == 'E') {
reading = READING_EXP;
is_float = true;
} else {
Expand All @@ -372,22 +372,22 @@ Error Expression::_get_token(Token &r_token) {
case READING_BIN: {
if (bin_beg && !is_binary_digit(c)) {
reading = READING_DONE;
} else if (c == 'b') {
} else if (c == 'b' || c == 'B') {
bin_beg = true;
}

} break;
case READING_HEX: {
if (hex_beg && !is_hex_digit(c)) {
reading = READING_DONE;
} else if (c == 'x') {
} else if (c == 'x' || c == 'X') {
hex_beg = true;
}

} break;
case READING_DEC: {
if (is_digit(c)) {
} else if (c == 'e') {
} else if (c == 'e' || c == 'E') {
reading = READING_EXP;
} else {
reading = READING_DONE;
Expand Down
2 changes: 1 addition & 1 deletion core/string/char_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ constexpr bool is_control(char32_t p_char) {
}

constexpr bool is_whitespace(char32_t p_char) {
return (p_char == ' ') || (p_char == 0x00a0) || (p_char == 0x1680) || (p_char >= 0x2000 && p_char <= 0x200a) || (p_char == 0x202f) || (p_char == 0x205f) || (p_char == 0x3000) || (p_char == 0x2028) || (p_char == 0x2029) || (p_char >= 0x0009 && p_char <= 0x000d) || (p_char == 0x0085);
return (p_char == ' ') || (p_char == 0x00a0) || (p_char == 0x1680) || (p_char >= 0x2000 && p_char <= 0x200b) || (p_char == 0x202f) || (p_char == 0x205f) || (p_char == 0x3000) || (p_char == 0x2028) || (p_char == 0x2029) || (p_char >= 0x0009 && p_char <= 0x000d) || (p_char == 0x0085);
}

constexpr bool is_linebreak(char32_t p_char) {
Expand Down
2 changes: 1 addition & 1 deletion core/string/translation_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ String TranslationServer::get_tool_locale() {
// Look for best matching loaded translation.
Ref<Translation> t = main_domain->get_translation_object(locale);
if (t.is_null()) {
return "en";
return fallback;
}
return t->get_locale();
}
Expand Down
9 changes: 5 additions & 4 deletions core/string/ustring.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4966,17 +4966,18 @@ bool String::is_valid_float() const {
bool numbers_found = false;

for (int i = from; i < len; i++) {
if (is_digit(operator[](i))) {
const char32_t c = operator[](i);
if (is_digit(c)) {
if (exponent_found) {
exponent_values_found = true;
} else {
numbers_found = true;
}
} else if (numbers_found && !exponent_found && operator[](i) == 'e') {
} else if (numbers_found && !exponent_found && (c == 'e' || c == 'E')) {
exponent_found = true;
} else if (!period_found && !exponent_found && operator[](i) == '.') {
} else if (!period_found && !exponent_found && c == '.') {
period_found = true;
} else if ((operator[](i) == '-' || operator[](i) == '+') && exponent_found && !exponent_values_found && !sign_found) {
} else if ((c == '-' || c == '+') && exponent_found && !exponent_values_found && !sign_found) {
sign_found = true;
} else {
return false; // no start with number plz
Expand Down
14 changes: 13 additions & 1 deletion core/variant/variant_call.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1036,6 +1036,18 @@ struct _VariantCall {
return len;
}

static PackedByteArray func_PackedStringArray_to_byte_array(PackedStringArray *p_instance) {
PackedByteArray ret;
uint64_t size = p_instance->size();
const String *r = p_instance->ptr();

for (uint64_t i = 0; i < size; i++) {
ret.append_array(r[i].to_utf8_buffer());
ret.append(0);
}
return ret;
}

static void func_Callable_call(Variant *v, const Variant **p_args, int p_argcount, Variant &r_ret, Callable::CallError &r_error) {
Callable *callable = VariantGetInternalPtr<Callable>::get_ptr(v);
callable->callp(p_args, p_argcount, r_ret, r_error);
Expand Down Expand Up @@ -2579,7 +2591,7 @@ static void _register_variant_builtin_methods_array() {
bind_method(PackedStringArray, has, sarray("value"), varray());
bind_method(PackedStringArray, reverse, sarray(), varray());
bind_method(PackedStringArray, slice, sarray("begin", "end"), varray(INT_MAX));
bind_method(PackedStringArray, to_byte_array, sarray(), varray());
bind_function(PackedStringArray, to_byte_array, _VariantCall::func_PackedStringArray_to_byte_array, sarray(), varray());
bind_method(PackedStringArray, sort, sarray(), varray());
bind_method(PackedStringArray, bsearch, sarray("value", "before"), varray(true));
bind_method(PackedStringArray, duplicate, sarray(), varray());
Expand Down
8 changes: 4 additions & 4 deletions core/variant/variant_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ Error VariantParser::get_token(Stream *p_stream, Token &r_token, int &line, Stri
} else if (c == '.') {
reading = READING_DEC;
is_float = true;
} else if (c == 'e') {
} else if (c == 'e' || c == 'E') {
reading = READING_EXP;
is_float = true;
} else {
Expand All @@ -453,7 +453,7 @@ Error VariantParser::get_token(Stream *p_stream, Token &r_token, int &line, Stri
} break;
case READING_DEC: {
if (is_digit(c)) {
} else if (c == 'e') {
} else if (c == 'e' || c == 'E') {
reading = READING_EXP;
} else {
reading = READING_DONE;
Expand Down Expand Up @@ -1226,7 +1226,7 @@ Error VariantParser::parse_value(Token &token, Variant &value, Stream *p_stream,
r_err_str = String();
value_type = Variant::OBJECT;
value_class_name = token.value;
got_comma_token = true;
got_bracket_token = true;
} else {
return err;
}
Expand Down Expand Up @@ -1964,7 +1964,7 @@ Error VariantWriter::write(const Variant &p_variant, StoreStringFunc p_store_str
case Variant::FLOAT: {
String s = rtos_fix(p_variant.operator double());
if (s != "inf" && s != "inf_neg" && s != "nan") {
if (!s.contains_char('.') && !s.contains_char('e')) {
if (!s.contains_char('.') && !s.contains_char('e') && !s.contains_char('E')) {
s += ".0";
}
}
Expand Down
Loading

0 comments on commit 180365a

Please sign in to comment.