Skip to content

Commit

Permalink
Apply Rebel branding to core
Browse files Browse the repository at this point in the history
  • Loading branch information
madmiraal committed Jan 18, 2025
1 parent 59dda56 commit 3b3bd20
Show file tree
Hide file tree
Showing 29 changed files with 129 additions and 140 deletions.
2 changes: 1 addition & 1 deletion core/SCsub
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ if env["builtin_zstd"]:
env.core_sources += thirdparty_obj


# Godot source files
# Rebel source files

env.add_source_files(env.core_sources, "*.cpp")
env.add_source_files(env.core_sources, "script_encryption_key.gen.cpp")
Expand Down
4 changes: 2 additions & 2 deletions core/bind/core_bind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -516,13 +516,13 @@ Error _OS::shell_open(String p_uri) {
if (p_uri.begins_with("res://")) {
WARN_PRINT(
"Attempting to open an URL with the \"res://\" protocol. Use "
"`ProjectSettings.globalize_path()` to convert a Godot-specific "
"`ProjectSettings.globalize_path()` to convert a Rebel-specific "
"path to a system path before opening it with `OS.shell_open()`."
);
} else if (p_uri.begins_with("user://")) {
WARN_PRINT(
"Attempting to open an URL with the \"user://\" protocol. Use "
"`ProjectSettings.globalize_path()` to convert a Godot-specific "
"`ProjectSettings.globalize_path()` to convert a Rebel-specific "
"path to a system path before opening it with `OS.shell_open()`."
);
}
Expand Down
1 change: 0 additions & 1 deletion core/color.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,6 @@ Color Color::from_hsv(float p_h, float p_s, float p_v, float p_a) const {
return c;
}

// FIXME: Remove once Godot 3.1 has been released
float Color::gray() const {
WARN_DEPRECATED_MSG(
"'Color.gray()' is deprecated and will be removed in a future version. "
Expand Down
2 changes: 1 addition & 1 deletion core/core_builders.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ def next_tag(self):
f.write("/* THIS FILE IS GENERATED DO NOT EDIT */\n")
f.write("#ifndef _EDITOR_LICENSE_H\n")
f.write("#define _EDITOR_LICENSE_H\n")
f.write("const char *const GODOT_LICENSE_TEXT =")
f.write("const char *const REBEL_LICENSE_TEXT =")

with open_utf8(src_license, "r") as license_file:
for line in license_file:
Expand Down
6 changes: 3 additions & 3 deletions core/crypto/SCsub
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ if not has_module:
CPPDEFINES=[
(
"MBEDTLS_CONFIG_FILE",
'\\"thirdparty/mbedtls/include/godot_core_mbedtls_config.h\\"',
'\\"thirdparty/mbedtls/include/rebel_mbedtls_config.h\\"',
)
]
)
Expand All @@ -39,7 +39,7 @@ if not has_module:
"md5.c",
"sha1.c",
"sha256.c",
"godot_core_mbedtls_platform.c",
"rebel_mbedtls_platform.c",
]
thirdparty_mbedtls_sources = [
thirdparty_mbedtls_dir + file for file in thirdparty_mbedtls_sources
Expand All @@ -48,7 +48,7 @@ if not has_module:
env.core_sources += thirdparty_obj


# Godot source files
# Rebel source files

core_obj = []

Expand Down
2 changes: 1 addition & 1 deletion core/engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ Dictionary Engine::get_license_info() const {
}

String Engine::get_license_text() const {
return String(GODOT_LICENSE_TEXT);
return String(REBEL_LICENSE_TEXT);
}

void Engine::set_print_error_messages(bool p_enabled) {
Expand Down
2 changes: 1 addition & 1 deletion core/image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4548,7 +4548,7 @@ Error Image::load_bmp_from_buffer(const PoolVector<uint8_t>& p_array) {
ERR_FAIL_NULL_V_MSG(
_bmp_mem_loader_func,
ERR_UNAVAILABLE,
"The BMP module isn't enabled. Recompile the Godot editor or export "
"The BMP module isn't enabled. Recompile Rebel Editor or export "
"template binary with the `module_bmp_enabled=yes` SCons option."
);
return _load_from_buffer(p_array, _bmp_mem_loader_func);
Expand Down
2 changes: 1 addition & 1 deletion core/io/file_access_pack.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include "core/print_string.h"
#include "core/set.h"

// Godot's packed file magic header ("GDPC" in ASCII).
// Rebel's packed file magic header ("GDPC" in ASCII).
#define PACK_HEADER_MAGIC 0x43504447
// The current packed file format version number.
#define PACK_FORMAT_VERSION 1
Expand Down
52 changes: 26 additions & 26 deletions core/io/file_access_zip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ ZipArchive* ZipArchive::instance = nullptr;

extern "C" {

static void* godot_open(void* data, const char* p_fname, int mode) {
static void* zopen_file(void* data, const char* p_fname, int mode) {
if (mode & ZLIB_FILEFUNC_MODE_WRITE) {
return nullptr;
}
Expand All @@ -25,13 +25,13 @@ static void* godot_open(void* data, const char* p_fname, int mode) {
return f;
}

static uLong godot_read(void* data, void* fdata, void* buf, uLong size) {
static uLong zread_file(void* data, void* fdata, void* buf, uLong size) {
FileAccess* f = (FileAccess*)fdata;
f->get_buffer((uint8_t*)buf, size);
return size;
}

static uLong godot_write(
static uLong zwrite_file(
voidpf opaque,
voidpf stream,
const void* buf,
Expand All @@ -40,12 +40,12 @@ static uLong godot_write(
return 0;
}

static long godot_tell(voidpf opaque, voidpf stream) {
static long ztell_file(voidpf opaque, voidpf stream) {
FileAccess* f = (FileAccess*)stream;
return f->get_position();
}

static long godot_seek(voidpf opaque, voidpf stream, uLong offset, int origin) {
static long zseek_file(voidpf opaque, voidpf stream, uLong offset, int origin) {
FileAccess* f = (FileAccess*)stream;

uint64_t pos = offset;
Expand All @@ -64,7 +64,7 @@ static long godot_seek(voidpf opaque, voidpf stream, uLong offset, int origin) {
return 0;
}

static int godot_close(voidpf opaque, voidpf stream) {
static int zclose_file(voidpf opaque, voidpf stream) {
FileAccess* f = (FileAccess*)stream;
if (f) {
f->close();
Expand All @@ -74,16 +74,16 @@ static int godot_close(voidpf opaque, voidpf stream) {
return 0;
}

static int godot_testerror(voidpf opaque, voidpf stream) {
static int zerror_file(voidpf opaque, voidpf stream) {
FileAccess* f = (FileAccess*)stream;
return f->get_error() != OK ? 1 : 0;
}

static voidpf godot_alloc(voidpf opaque, uInt items, uInt size) {
static voidpf zalloc_mem(voidpf opaque, uInt items, uInt size) {
return memalloc(items * size);
}

static void godot_free(voidpf opaque, voidpf address) {
static void zfree_mem(voidpf opaque, voidpf address) {
memfree(address);
}

Expand All @@ -107,17 +107,17 @@ unzFile ZipArchive::get_file_handle(String p_file) const {
memset(&io, 0, sizeof(io));

io.opaque = nullptr;
io.zopen_file = godot_open;
io.zread_file = godot_read;
io.zwrite_file = godot_write;
io.zopen_file = zopen_file;
io.zread_file = zread_file;
io.zwrite_file = zwrite_file;

io.ztell_file = godot_tell;
io.zseek_file = godot_seek;
io.zclose_file = godot_close;
io.zerror_file = godot_testerror;
io.ztell_file = ztell_file;
io.zseek_file = zseek_file;
io.zclose_file = zclose_file;
io.zerror_file = zerror_file;

io.alloc_mem = godot_alloc;
io.free_mem = godot_free;
io.alloc_mem = zalloc_mem;
io.free_mem = zfree_mem;

unzFile pkg =
unzOpen2(packages[file.package].filename.utf8().get_data(), &io);
Expand Down Expand Up @@ -160,14 +160,14 @@ bool ZipArchive::try_open_pack(
memset(&io, 0, sizeof(io));

io.opaque = nullptr;
io.zopen_file = godot_open;
io.zread_file = godot_read;
io.zwrite_file = godot_write;
io.zopen_file = zopen_file;
io.zread_file = zread_file;
io.zwrite_file = zwrite_file;

io.ztell_file = godot_tell;
io.zseek_file = godot_seek;
io.zclose_file = godot_close;
io.zerror_file = godot_testerror;
io.ztell_file = ztell_file;
io.zseek_file = zseek_file;
io.zclose_file = zclose_file;
io.zerror_file = zerror_file;

unzFile zfile = unzOpen2(p_path.utf8().get_data(), &io);
ERR_FAIL_COND_V(!zfile, false);
Expand Down Expand Up @@ -374,4 +374,4 @@ FileAccessZip::~FileAccessZip() {
close();
}

#endif
#endif // MINIZIP_ENABLED
4 changes: 2 additions & 2 deletions core/io/http_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ Error HTTPClient::request_raw(
// Should it add utf8 encoding?
}
if (add_uagent) {
request += "User-Agent: GodotEngine/" + String(VERSION_FULL_BUILD)
request += "User-Agent: RebelEngine/" + String(VERSION_FULL_BUILD)
+ " (" + OS::get_singleton()->get_name() + ")\r\n";
}
if (add_accept) {
Expand Down Expand Up @@ -257,7 +257,7 @@ Error HTTPClient::request(
// Should it add utf8 encoding?
}
if (add_uagent) {
request += "User-Agent: GodotEngine/" + String(VERSION_FULL_BUILD)
request += "User-Agent: RebelEngine/" + String(VERSION_FULL_BUILD)
+ " (" + OS::get_singleton()->get_name() + ")\r\n";
}
if (add_accept) {
Expand Down
12 changes: 6 additions & 6 deletions core/make_binders.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ class MethodBind$argc$$ifret R$$ifconst C$ : public MethodBind {
$ifret R$ $ifnoret void$ (T::*method)($arg, P@$) $ifconst const$;
#ifdef DEBUG_METHODS_ENABLED
virtual Variant::Type _gen_argument_type(int p_arg) const { return _get_argument_type(p_arg); }
virtual GodotTypeInfo::Metadata get_argument_meta(int p_arg) const {
virtual RebelTypeInfo::Metadata get_argument_meta(int p_arg) const {
$ifret if (p_arg==-1) return GetTypeInfo<R>::METADATA;$
$arg if (p_arg==(@-1)) return GetTypeInfo<P@>::METADATA;
$
return GodotTypeInfo::METADATA_NONE;
return RebelTypeInfo::METADATA_NONE;
}
Variant::Type _get_argument_type(int p_argument) const {
$ifret if (p_argument==-1) return (Variant::Type)GetTypeInfo<R>::VARIANT_TYPE;$
Expand Down Expand Up @@ -100,11 +100,11 @@ class MethodBind$argc$$ifret R$$ifconst C$ : public MethodBind {
#ifdef DEBUG_METHODS_ENABLED
virtual Variant::Type _gen_argument_type(int p_arg) const { return _get_argument_type(p_arg); }
virtual GodotTypeInfo::Metadata get_argument_meta(int p_arg) const {
virtual RebelTypeInfo::Metadata get_argument_meta(int p_arg) const {
$ifret if (p_arg==-1) return GetTypeInfo<R>::METADATA;$
$arg if (p_arg==(@-1)) return GetTypeInfo<P@>::METADATA;
$
return GodotTypeInfo::METADATA_NONE;
return RebelTypeInfo::METADATA_NONE;
}
Variant::Type _get_argument_type(int p_argument) const {
Expand Down Expand Up @@ -200,11 +200,11 @@ class FunctionBind$argc$$ifret R$$ifconst C$ : public MethodBind {
$ifret R$ $ifnoret void$ (*method) ($ifconst const$ T *$ifargs , $$arg, P@$);
#ifdef DEBUG_METHODS_ENABLED
virtual Variant::Type _gen_argument_type(int p_arg) const { return _get_argument_type(p_arg); }
virtual GodotTypeInfo::Metadata get_argument_meta(int p_arg) const {
virtual RebelTypeInfo::Metadata get_argument_meta(int p_arg) const {
$ifret if (p_arg==-1) return GetTypeInfo<R>::METADATA;$
$arg if (p_arg==(@-1)) return GetTypeInfo<P@>::METADATA;
$
return GodotTypeInfo::METADATA_NONE;
return RebelTypeInfo::METADATA_NONE;
}
Variant::Type _get_argument_type(int p_argument) const {
$ifret if (p_argument==-1) return (Variant::Type)GetTypeInfo<R>::VARIANT_TYPE;$
Expand Down
8 changes: 3 additions & 5 deletions core/math/bvh.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@

// BVH
// This class provides a wrapper around BVH tree, which contains most of the
// functionality for a dynamic BVH with templated leaf size. However BVH also
// adds facilities for pairing, to maintain compatibility with Godot 3.2.
// Pairing is a collision pairing system, on top of the basic BVH.
// functionality for a dynamic BVH with templated leaf size.
// BVH also adds facilities for pairing. Pairing is a collision pairing system,
// on top of the basic BVH.

// Some notes on the use of BVH / Octree from Godot 3.2.
// This is not well explained elsewhere.
// The rendering tree mask and types that are sent to the BVH are NOT layer
// masks. They are INSTANCE_TYPES (defined in visual_server.h), e.g. MESH,
// MULTIMESH, PARTICLES etc. Thus the lights do no cull by layer mask in the
Expand Down
12 changes: 6 additions & 6 deletions core/math/convex_hull.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
// SPDX-License-Identifier: MIT

/*
* Based on Godot's patched VHACD-version of Bullet's btConvexHullComputer.
* Based on Rebel's patched VHACD-version of Bullet's btConvexHullComputer.
* See /thirdparty/vhacd/btConvexHullComputer.cpp at
* 64403ddcab9f1dca2408f0a412a22d899708bbb1 In turn, based on
* /src/LinearMath/btConvexHullComputer.cpp in
Expand All @@ -16,8 +16,8 @@
* - int32_t is consistently used instead of int in some cases
* - integrated patch db0d6c92927f5a1358b887f2645c11f3014f0e8a from Bullet
* (CWE-190 integer overflow in btConvexHullComputer)
* - adapted to Godot's code style
* - replaced Bullet's types (e.g. vectors) with Godot's
* - adapted to Rebel's code style
* - replaced Bullet's types (e.g. vectors) with Rebel's
* - replaced custom Pool implementation with PagedAllocator
*/

Expand Down Expand Up @@ -52,10 +52,10 @@ misrepresented as being the original software.
// #define DEBUG_CONVEX_HULL
// #define SHOW_ITERATIONS

// -- GODOT start --
// -- REBEL start --
// Assembly optimizations are not used at the moment.
// #define USE_X86_64_ASM
// -- GODOT end --
// -- REBEL end --

#ifdef DEBUG_ENABLED
#define CHULL_ASSERT(m_cond) \
Expand Down Expand Up @@ -2586,7 +2586,7 @@ Error ConvexHullComputer::convex_hull(
e = e->get_next_edge_of_face();
} while (e != e_start);

// reverse indices: Godot wants clockwise, but this is counter-clockwise
// reverse indices: Rebel wants clockwise, but this is counter-clockwise
if (face.indices.size() > 2) {
// reverse all but the first index.
int* indices = face.indices.ptrw();
Expand Down
5 changes: 1 addition & 4 deletions core/math/math_funcs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,7 @@ int Math::range_step_decimals(double p_step) {
}

double Math::dectime(double p_value, double p_amount, double p_step) {
WARN_DEPRECATED_MSG(
"The `dectime()` function has been deprecated and will be removed in "
"Godot 4.0. Use `move_toward()` instead."
);
WARN_DEPRECATED_MSG("The `dectime()` function has been deprecated.");
double sgn = p_value < 0 ? -1.0 : 1.0;
double val = Math::abs(p_value);
val -= p_amount * p_step;
Expand Down
6 changes: 3 additions & 3 deletions core/method_bind.h
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ class MethodBind {
); // set by class, db, can't be inferred otherwise
Vector<StringName> get_argument_names() const;

virtual GodotTypeInfo::Metadata get_argument_meta(int p_arg) const = 0;
virtual RebelTypeInfo::Metadata get_argument_meta(int p_arg) const = 0;

#endif
void set_hint_flags(uint32_t p_hint) {
Expand Down Expand Up @@ -343,8 +343,8 @@ class MethodBindVarArg : public MethodBind {
return _gen_argument_type_info(p_arg).type;
}

virtual GodotTypeInfo::Metadata get_argument_meta(int) const {
return GodotTypeInfo::METADATA_NONE;
virtual RebelTypeInfo::Metadata get_argument_meta(int) const {
return RebelTypeInfo::METADATA_NONE;
}

#else
Expand Down
7 changes: 3 additions & 4 deletions core/os/os.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -853,10 +853,9 @@ void OS::add_frame_delay(bool p_can_draw) {
OS::OS() {
void* volatile stack_bottom;

restart_on_exit = false;
singleton = this;
_keep_screen_on = true; // set default value to true, because this had been
// true before godot 2.0.
restart_on_exit = false;
singleton = this;
_keep_screen_on = true;
low_processor_usage_mode = false;
low_processor_usage_mode_sleep_usec = 10000;
_verbose_stdout = false;
Expand Down
2 changes: 1 addition & 1 deletion core/project_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ Error ProjectSettings::_setup(
bool found = _load_resource_pack(exec_path);

// Attempt with exec_name.pck.
// (This is the usual case when distributing a Godot game.)
// (This is the usual case when distributing a Rebel game.)
String exec_dir = exec_path.get_base_dir();
String exec_filename = exec_path.get_file();
String exec_basename = exec_filename.get_basename();
Expand Down
Loading

0 comments on commit 3b3bd20

Please sign in to comment.