mirror of
https://github.com/Relintai/gdnative_cpp.git
synced 2025-01-25 15:29:24 +01:00
Got rid of the pandemonium namespace.
This commit is contained in:
parent
96864fbabb
commit
81c0193475
10
README.md
10
README.md
@ -159,7 +159,7 @@ Create `init.cpp` under `SimpleLibrary/src/` and add the following code:
|
||||
#include <pandemonium.h>
|
||||
#include <Reference.h>
|
||||
|
||||
using namespace pandemonium;
|
||||
|
||||
|
||||
class SimpleClass : public Reference {
|
||||
PANDEMONIUM_CLASS(SimpleClass, Reference);
|
||||
@ -211,19 +211,19 @@ public:
|
||||
|
||||
/** GDNative Initialize **/
|
||||
extern "C" void GDN_EXPORT pandemonium_gdnative_init(pandemonium_gdnative_init_options *o) {
|
||||
pandemonium::Pandemonium::gdnative_init(o);
|
||||
Pandemonium::gdnative_init(o);
|
||||
}
|
||||
|
||||
/** GDNative Terminate **/
|
||||
extern "C" void GDN_EXPORT pandemonium_gdnative_terminate(pandemonium_gdnative_terminate_options *o) {
|
||||
pandemonium::Pandemonium::gdnative_terminate(o);
|
||||
Pandemonium::gdnative_terminate(o);
|
||||
}
|
||||
|
||||
/** NativeScript Initialize **/
|
||||
extern "C" void GDN_EXPORT pandemonium_nativescript_init(void *handle) {
|
||||
pandemonium::Pandemonium::nativescript_init(handle);
|
||||
Pandemonium::nativescript_init(handle);
|
||||
|
||||
pandemonium::register_class<SimpleClass>();
|
||||
Pandemonium::register_class<SimpleClass>();
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -196,7 +196,6 @@ def generate_class_header(used_classes, c, use_template_get_node):
|
||||
if c["base_class"] != "":
|
||||
source.append('#include "' + class_name_to_file_name(strip_name(c["base_class"])) + '.h"')
|
||||
|
||||
source.append("namespace pandemonium {")
|
||||
source.append("")
|
||||
|
||||
for used_type in used_classes:
|
||||
@ -256,7 +255,7 @@ def generate_class_header(used_classes, c, use_template_get_node):
|
||||
source.append("\t}")
|
||||
source.append("")
|
||||
|
||||
# pandemonium::api->pandemonium_global_get_singleton((char *) \"" + strip_name(c["name"]) + "\");"
|
||||
# Pandemonium::api->pandemonium_global_get_singleton((char *) \"" + strip_name(c["name"]) + "\");"
|
||||
|
||||
# class name:
|
||||
# Two versions needed needed because when the user implements a custom class,
|
||||
@ -271,7 +270,7 @@ def generate_class_header(used_classes, c, use_template_get_node):
|
||||
)
|
||||
|
||||
source.append(
|
||||
"\tstatic inline Object *___get_from_variant(Variant a) { pandemonium_object *o = (pandemonium_object*) a; return (o) ? (Object *) pandemonium::nativescript_api->pandemonium_nativescript_get_instance_binding_data(pandemonium::_RegisterState::language_index, o) : nullptr; }"
|
||||
"\tstatic inline Object *___get_from_variant(Variant a) { pandemonium_object *o = (pandemonium_object*) a; return (o) ? (Object *) Pandemonium::nativescript_api->pandemonium_nativescript_get_instance_binding_data(_RegisterState::language_index, o) : nullptr; }"
|
||||
)
|
||||
|
||||
enum_values = []
|
||||
@ -431,7 +430,6 @@ def generate_class_header(used_classes, c, use_template_get_node):
|
||||
source.append("};")
|
||||
source.append("")
|
||||
|
||||
source.append("}")
|
||||
source.append("")
|
||||
|
||||
source.append("#endif")
|
||||
@ -469,8 +467,6 @@ def generate_class_implementation(icalls, used_classes, c, use_template_get_node
|
||||
source.append("")
|
||||
source.append("")
|
||||
|
||||
source.append("namespace pandemonium {")
|
||||
|
||||
core_object_name = "this"
|
||||
|
||||
source.append("")
|
||||
@ -483,7 +479,7 @@ def generate_class_implementation(icalls, used_classes, c, use_template_get_node
|
||||
|
||||
# FIXME Test if inlining has a huge impact on binary size
|
||||
source.append(class_name + "::" + class_name + "() {")
|
||||
source.append('\t_owner = pandemonium::api->pandemonium_global_get_singleton((char *) "' + strip_name(c["name"]) + '");')
|
||||
source.append('\t_owner = Pandemonium::api->pandemonium_global_get_singleton((char *) "' + strip_name(c["name"]) + '");')
|
||||
source.append("}")
|
||||
|
||||
source.append("")
|
||||
@ -502,7 +498,7 @@ def generate_class_implementation(icalls, used_classes, c, use_template_get_node
|
||||
source.append(
|
||||
"\t___mb.mb_"
|
||||
+ method["name"]
|
||||
+ ' = pandemonium::api->pandemonium_method_bind_get_method("'
|
||||
+ ' = Pandemonium::api->pandemonium_method_bind_get_method("'
|
||||
+ c["name"]
|
||||
+ '", "'
|
||||
+ ("get_node" if use_template_get_node and method["name"] == "get_node_internal" else method["name"])
|
||||
@ -510,9 +506,9 @@ def generate_class_implementation(icalls, used_classes, c, use_template_get_node
|
||||
)
|
||||
|
||||
source.append("\tpandemonium_string_name class_name;")
|
||||
source.append('\tpandemonium::api->pandemonium_string_name_new_data_char(&class_name, "' + c["name"] + '");')
|
||||
source.append("\t_detail_class_tag = pandemonium::api->pandemonium_get_class_tag(&class_name);")
|
||||
source.append("\tpandemonium::api->pandemonium_string_name_destroy(&class_name);")
|
||||
source.append('\tPandemonium::api->pandemonium_string_name_new_data_char(&class_name, "' + c["name"] + '");')
|
||||
source.append("\t_detail_class_tag = Pandemonium::api->pandemonium_get_class_tag(&class_name);")
|
||||
source.append("\tPandemonium::api->pandemonium_string_name_destroy(&class_name);")
|
||||
|
||||
source.append("}")
|
||||
source.append("")
|
||||
@ -523,7 +519,7 @@ def generate_class_implementation(icalls, used_classes, c, use_template_get_node
|
||||
source.append(
|
||||
"\treturn ("
|
||||
+ class_name
|
||||
+ ' *) pandemonium::nativescript_api->pandemonium_nativescript_get_instance_binding_data(pandemonium::_RegisterState::language_index, pandemonium::api->pandemonium_get_class_constructor((char *)"'
|
||||
+ ' *) Pandemonium::nativescript_api->pandemonium_nativescript_get_instance_binding_data(_RegisterState::language_index, Pandemonium::api->pandemonium_get_class_constructor((char *)"'
|
||||
+ c["name"]
|
||||
+ '")());'
|
||||
)
|
||||
@ -553,7 +549,7 @@ def generate_class_implementation(icalls, used_classes, c, use_template_get_node
|
||||
|
||||
if method["name"] == "free":
|
||||
# dirty hack because Object::free is marked virtual but doesn't actually exist...
|
||||
source.append("\tpandemonium::api->pandemonium_object_destroy(_owner);")
|
||||
source.append("\tPandemonium::api->pandemonium_object_destroy(_owner);")
|
||||
source.append("}")
|
||||
source.append("")
|
||||
continue
|
||||
@ -587,7 +583,7 @@ def generate_class_implementation(icalls, used_classes, c, use_template_get_node
|
||||
source.append("\tVariant __given_args[" + str(len(method["arguments"])) + "];")
|
||||
|
||||
for i, argument in enumerate(method["arguments"]):
|
||||
source.append("\tpandemonium::api->pandemonium_variant_new_nil((pandemonium_variant *) &__given_args[" + str(i) + "]);")
|
||||
source.append("\tPandemonium::api->pandemonium_variant_new_nil((pandemonium_variant *) &__given_args[" + str(i) + "]);")
|
||||
|
||||
source.append("")
|
||||
|
||||
@ -626,7 +622,7 @@ def generate_class_implementation(icalls, used_classes, c, use_template_get_node
|
||||
|
||||
source.append("\tVariant __result;")
|
||||
source.append(
|
||||
"\t*(pandemonium_variant *) &__result = pandemonium::api->pandemonium_method_bind_call(___mb.mb_"
|
||||
"\t*(pandemonium_variant *) &__result = Pandemonium::api->pandemonium_method_bind_call(___mb.mb_"
|
||||
+ method["name"]
|
||||
+ ", ((const Object *) "
|
||||
+ core_object_name
|
||||
@ -645,7 +641,7 @@ def generate_class_implementation(icalls, used_classes, c, use_template_get_node
|
||||
source.append("")
|
||||
|
||||
for i, argument in enumerate(method["arguments"]):
|
||||
source.append("\tpandemonium::api->pandemonium_variant_destroy((pandemonium_variant *) &__given_args[" + str(i) + "]);")
|
||||
source.append("\tPandemonium::api->pandemonium_variant_destroy((pandemonium_variant *) &__given_args[" + str(i) + "]);")
|
||||
|
||||
source.append("")
|
||||
|
||||
@ -696,8 +692,6 @@ def generate_class_implementation(icalls, used_classes, c, use_template_get_node
|
||||
source.append("}")
|
||||
source.append("")
|
||||
|
||||
source.append("}")
|
||||
|
||||
return "\n".join(source)
|
||||
|
||||
|
||||
@ -719,7 +713,6 @@ def generate_icall_header(icalls):
|
||||
source.append("")
|
||||
source.append("")
|
||||
|
||||
source.append("namespace pandemonium {")
|
||||
source.append("")
|
||||
|
||||
for icall in icalls:
|
||||
@ -776,7 +769,7 @@ def generate_icall_header(icalls):
|
||||
source.append("")
|
||||
|
||||
source.append(
|
||||
"\tpandemonium::api->pandemonium_method_bind_ptrcall(mb, inst->_owner, args, "
|
||||
"\tPandemonium::api->pandemonium_method_bind_ptrcall(mb, inst->_owner, args, "
|
||||
+ ("nullptr" if ret_type == "void" else "&ret")
|
||||
+ ");"
|
||||
)
|
||||
@ -785,7 +778,7 @@ def generate_icall_header(icalls):
|
||||
if is_class_type(ret_type):
|
||||
source.append("\tif (ret) {")
|
||||
source.append(
|
||||
"\t\treturn (Object *) pandemonium::nativescript_api->pandemonium_nativescript_get_instance_binding_data(pandemonium::_RegisterState::language_index, ret);"
|
||||
"\t\treturn (Object *) Pandemonium::nativescript_api->pandemonium_nativescript_get_instance_binding_data(_RegisterState::language_index, ret);"
|
||||
)
|
||||
source.append("\t}")
|
||||
source.append("")
|
||||
@ -796,7 +789,6 @@ def generate_icall_header(icalls):
|
||||
source.append("}")
|
||||
source.append("")
|
||||
|
||||
source.append("}")
|
||||
source.append("")
|
||||
|
||||
source.append("#endif")
|
||||
@ -817,8 +809,6 @@ def generate_type_registry(classes):
|
||||
source.append("")
|
||||
source.append("")
|
||||
|
||||
source.append("namespace pandemonium {")
|
||||
|
||||
source.append("void ___register_types()")
|
||||
source.append("{")
|
||||
|
||||
@ -834,7 +824,7 @@ def generate_type_registry(classes):
|
||||
base_class_type_hash = "0"
|
||||
|
||||
source.append(
|
||||
'\tpandemonium::_TagDB::register_global_type("'
|
||||
'\t_TagDB::register_global_type("'
|
||||
+ c["name"]
|
||||
+ '", '
|
||||
+ class_type_hash
|
||||
@ -846,7 +836,6 @@ def generate_type_registry(classes):
|
||||
source.append("}")
|
||||
|
||||
source.append("")
|
||||
source.append("}")
|
||||
|
||||
return "\n".join(source)
|
||||
|
||||
@ -860,8 +849,6 @@ def generate_init_method_bindings(classes):
|
||||
source.append("")
|
||||
source.append("")
|
||||
|
||||
source.append("namespace pandemonium {")
|
||||
|
||||
source.append("void ___init_method_bindings()")
|
||||
source.append("{")
|
||||
|
||||
@ -871,7 +858,6 @@ def generate_init_method_bindings(classes):
|
||||
source.append("}")
|
||||
|
||||
source.append("")
|
||||
source.append("}")
|
||||
|
||||
return "\n".join(source)
|
||||
|
||||
|
@ -35,7 +35,7 @@
|
||||
|
||||
#include <cstdlib>
|
||||
|
||||
namespace pandemonium {
|
||||
|
||||
|
||||
class Plane;
|
||||
|
||||
@ -105,6 +105,6 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace pandemonium
|
||||
|
||||
|
||||
#endif // RECT3_H
|
||||
|
@ -33,7 +33,7 @@
|
||||
|
||||
#include <gdn/array.h>
|
||||
|
||||
namespace pandemonium {
|
||||
|
||||
|
||||
class String;
|
||||
|
||||
@ -186,6 +186,6 @@ public:
|
||||
~Array();
|
||||
};
|
||||
|
||||
} // namespace pandemonium
|
||||
|
||||
|
||||
#endif // ARRAY_H
|
||||
|
@ -37,7 +37,7 @@
|
||||
|
||||
#include "vector3.h"
|
||||
|
||||
namespace pandemonium {
|
||||
|
||||
|
||||
class Quaternion;
|
||||
|
||||
@ -453,6 +453,6 @@ public:
|
||||
operator Quaternion() const;
|
||||
};
|
||||
|
||||
} // namespace pandemonium
|
||||
|
||||
|
||||
#endif // BASIS_H
|
||||
|
@ -38,7 +38,7 @@
|
||||
#include "defs.h"
|
||||
#include "ustring.h"
|
||||
|
||||
namespace pandemonium {
|
||||
|
||||
|
||||
struct Color {
|
||||
private:
|
||||
@ -166,6 +166,6 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace pandemonium
|
||||
|
||||
|
||||
#endif // COLOR_H
|
||||
|
@ -31,7 +31,7 @@
|
||||
#ifndef DEFS_H
|
||||
#define DEFS_H
|
||||
|
||||
namespace pandemonium {
|
||||
|
||||
|
||||
enum class Error {
|
||||
OK,
|
||||
@ -85,7 +85,7 @@ enum class Error {
|
||||
ERR_PRINTER_ON_FIRE, /// the parallel port printer is engulfed in flames
|
||||
};
|
||||
|
||||
} // namespace pandemonium
|
||||
|
||||
|
||||
#include <pandemonium_global.h>
|
||||
|
||||
@ -132,7 +132,7 @@ typedef float real_t;
|
||||
|
||||
// ERR/WARN macros
|
||||
#ifndef WARN_PRINT
|
||||
#define WARN_PRINT(msg) pandemonium::Pandemonium::print_warning(msg, __func__, __FILE__, __LINE__)
|
||||
#define WARN_PRINT(msg) Pandemonium::print_warning(msg, __func__, __FILE__, __LINE__)
|
||||
#endif
|
||||
|
||||
#ifndef WARN_PRINTS
|
||||
@ -140,7 +140,7 @@ typedef float real_t;
|
||||
#endif
|
||||
|
||||
#ifndef ERR_PRINT
|
||||
#define ERR_PRINT(msg) pandemonium::Pandemonium::print_error(msg, __func__, __FILE__, __LINE__)
|
||||
#define ERR_PRINT(msg) Pandemonium::print_error(msg, __func__, __FILE__, __LINE__)
|
||||
#endif
|
||||
|
||||
#ifndef ERR_PRINTS
|
||||
@ -148,19 +148,19 @@ typedef float real_t;
|
||||
#endif
|
||||
|
||||
#ifndef FATAL_PRINT
|
||||
#define FATAL_PRINT(msg) ERR_PRINT(pandemonium::String("FATAL: ") + (msg))
|
||||
#define FATAL_PRINT(msg) ERR_PRINT(String("FATAL: ") + (msg))
|
||||
#endif
|
||||
|
||||
#ifndef ERR_MSG_INDEX
|
||||
#define ERR_MSG_INDEX(index, size) (pandemonium::String("Index ") + #index + "=" + pandemonium::String::num_int64(index) + " out of size (" + #size + "=" + pandemonium::String::num_int64(size) + ")")
|
||||
#define ERR_MSG_INDEX(index, size) (String("Index ") + #index + "=" + String::num_int64(index) + " out of size (" + #size + "=" + String::num_int64(size) + ")")
|
||||
#endif
|
||||
|
||||
#ifndef ERR_MSG_NULL
|
||||
#define ERR_MSG_NULL(param) (pandemonium::String("Parameter '") + #param + "' is null.")
|
||||
#define ERR_MSG_NULL(param) (String("Parameter '") + #param + "' is null.")
|
||||
#endif
|
||||
|
||||
#ifndef ERR_MSG_COND
|
||||
#define ERR_MSG_COND(cond) (pandemonium::String("Condition '") + #cond + "' is true.")
|
||||
#define ERR_MSG_COND(cond) (String("Condition '") + #cond + "' is true.")
|
||||
#endif
|
||||
|
||||
#ifndef ERR_FAIL_INDEX
|
||||
|
@ -36,7 +36,7 @@
|
||||
|
||||
#include <gdn/dictionary.h>
|
||||
|
||||
namespace pandemonium {
|
||||
|
||||
|
||||
class Variant;
|
||||
|
||||
@ -85,6 +85,6 @@ public:
|
||||
~Dictionary();
|
||||
};
|
||||
|
||||
} // namespace pandemonium
|
||||
|
||||
|
||||
#endif // DICTIONARY_H
|
||||
|
@ -34,7 +34,7 @@
|
||||
#include "defs.h"
|
||||
#include <cmath>
|
||||
|
||||
namespace pandemonium {
|
||||
|
||||
namespace Mathp {
|
||||
|
||||
// Functions reproduced as in Pandemonium's source code `math_funcs.h`.
|
||||
@ -297,6 +297,6 @@ inline unsigned int next_power_of_2(unsigned int x) {
|
||||
}
|
||||
|
||||
} // namespace Math
|
||||
} // namespace pandemonium
|
||||
|
||||
|
||||
#endif // PANDEMONIUM_MATH_H
|
||||
|
@ -33,7 +33,7 @@
|
||||
|
||||
#include <gdn/node_path.h>
|
||||
|
||||
namespace pandemonium {
|
||||
|
||||
|
||||
class String;
|
||||
|
||||
@ -79,6 +79,6 @@ public:
|
||||
~NodePath();
|
||||
};
|
||||
|
||||
} // namespace pandemonium
|
||||
|
||||
|
||||
#endif // NODEPATH_H
|
||||
|
@ -49,14 +49,13 @@
|
||||
|
||||
#include <type_traits>
|
||||
|
||||
namespace pandemonium {
|
||||
namespace detail {
|
||||
|
||||
// Pandemonium classes are wrapped by heap-allocated instances mimicking them through the C API.
|
||||
// They all inherit `_Wrapped`.
|
||||
template <class T>
|
||||
T *get_wrapper(pandemonium_object *obj) {
|
||||
return (T *)pandemonium::nativescript_api->pandemonium_nativescript_get_instance_binding_data(pandemonium::_RegisterState::language_index, obj);
|
||||
return (T *)Pandemonium::nativescript_api->pandemonium_nativescript_get_instance_binding_data(_RegisterState::language_index, obj);
|
||||
}
|
||||
|
||||
// Custom class instances are not obtainable by just casting the pointer to the base class they inherit,
|
||||
@ -64,7 +63,7 @@ T *get_wrapper(pandemonium_object *obj) {
|
||||
// Yet we want to "fake" it as if they were the same entity.
|
||||
template <class T>
|
||||
T *get_custom_class_instance(const Object *obj) {
|
||||
return (obj) ? (T *)pandemonium::nativescript_api->pandemonium_nativescript_get_userdata(obj->_owner) : nullptr;
|
||||
return (obj) ? (T *)Pandemonium::nativescript_api->pandemonium_nativescript_get_userdata(obj->_owner) : nullptr;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
@ -76,31 +75,31 @@ inline T *create_custom_class_instance() {
|
||||
// individually attached to the script instances.
|
||||
|
||||
// We cannot use wrappers because of https://github.com/pandemoniumengine/pandemonium/issues/39181
|
||||
// pandemonium::NativeScript *script = pandemonium::NativeScript::_new();
|
||||
// script->set_library(get_wrapper<pandemonium::GDNativeLibrary>((pandemonium_object *)pandemonium::gdnlib));
|
||||
// Pandemonium::NativeScript *script = Pandemonium::NativeScript::_new();
|
||||
// script->set_library(get_wrapper<Pandemonium::GDNativeLibrary>((pandemonium_object *)Pandemonium::gdnlib));
|
||||
// script->set_class_name(T::___get_class_name());
|
||||
|
||||
static_assert(T::___CLASS_IS_SCRIPT, "This function must only be used on custom classes");
|
||||
|
||||
// So we use the C API directly.
|
||||
static pandemonium_class_constructor script_constructor = pandemonium::api->pandemonium_get_class_constructor("NativeScript");
|
||||
static pandemonium_method_bind *mb_set_library = pandemonium::api->pandemonium_method_bind_get_method("NativeScript", "set_library");
|
||||
static pandemonium_method_bind *mb_set_class_name = pandemonium::api->pandemonium_method_bind_get_method("NativeScript", "set_class_name");
|
||||
static pandemonium_class_constructor script_constructor = Pandemonium::api->pandemonium_get_class_constructor("NativeScript");
|
||||
static pandemonium_method_bind *mb_set_library = Pandemonium::api->pandemonium_method_bind_get_method("NativeScript", "set_library");
|
||||
static pandemonium_method_bind *mb_set_class_name = Pandemonium::api->pandemonium_method_bind_get_method("NativeScript", "set_class_name");
|
||||
pandemonium_object *script = script_constructor();
|
||||
{
|
||||
const void *args[] = { pandemonium::gdnlib };
|
||||
pandemonium::api->pandemonium_method_bind_ptrcall(mb_set_library, script, args, nullptr);
|
||||
const void *args[] = { Pandemonium::gdnlib };
|
||||
Pandemonium::api->pandemonium_method_bind_ptrcall(mb_set_library, script, args, nullptr);
|
||||
}
|
||||
{
|
||||
const String class_name = T::___get_class_name();
|
||||
const void *args[] = { &class_name };
|
||||
pandemonium::api->pandemonium_method_bind_ptrcall(mb_set_class_name, script, args, nullptr);
|
||||
Pandemonium::api->pandemonium_method_bind_ptrcall(mb_set_class_name, script, args, nullptr);
|
||||
}
|
||||
|
||||
// Now to instanciate T, we initially did this, however in case of Reference it returns a variant with refcount
|
||||
// already initialized, which woud cause inconsistent behavior compared to other classes (we still have to return a pointer).
|
||||
//Variant instance_variant = script->new_();
|
||||
//T *instance = pandemonium::get_custom_class_instance<T>(instance_variant);
|
||||
// Variant instance_variant = script->new_();
|
||||
// T *instance = Pandemonium::get_custom_class_instance<T>(instance_variant);
|
||||
|
||||
// So we should do this instead, however while convenient, it uses unnecessary wrapper objects.
|
||||
// Object *base_obj = T::___new_pandemonium_base();
|
||||
@ -108,15 +107,15 @@ inline T *create_custom_class_instance() {
|
||||
// return get_custom_class_instance<T>(base_obj);
|
||||
|
||||
// Again using the C API to do exactly what we have to do.
|
||||
static pandemonium_class_constructor base_constructor = pandemonium::api->pandemonium_get_class_constructor(T::___get_pandemonium_class_name());
|
||||
static pandemonium_method_bind *mb_set_script = pandemonium::api->pandemonium_method_bind_get_method("Object", "set_script");
|
||||
static pandemonium_class_constructor base_constructor = Pandemonium::api->pandemonium_get_class_constructor(T::___get_pandemonium_class_name());
|
||||
static pandemonium_method_bind *mb_set_script = Pandemonium::api->pandemonium_method_bind_get_method("Object", "set_script");
|
||||
pandemonium_object *base_obj = base_constructor();
|
||||
{
|
||||
const void *args[] = { script };
|
||||
pandemonium::api->pandemonium_method_bind_ptrcall(mb_set_script, base_obj, args, nullptr);
|
||||
Pandemonium::api->pandemonium_method_bind_ptrcall(mb_set_script, base_obj, args, nullptr);
|
||||
}
|
||||
|
||||
return (T *)pandemonium::nativescript_api->pandemonium_nativescript_get_userdata(base_obj);
|
||||
return (T *)Pandemonium::nativescript_api->pandemonium_nativescript_get_userdata(base_obj);
|
||||
}
|
||||
|
||||
} // namespace detail
|
||||
@ -133,25 +132,33 @@ inline T *create_custom_class_instance() {
|
||||
// ___get_base_id: Gets the ID of the direct base class, as returned by ___get_id
|
||||
// ___get_base_class_name: Name of the direct base class
|
||||
// ___get_from_variant: Converts a Variant into an Object*. Will be non-null if the class matches.
|
||||
#define PANDEMONIUM_CLASS(Name, Base) \
|
||||
\
|
||||
public: \
|
||||
inline static const char *___get_class_name() { return #Name; } \
|
||||
enum { ___CLASS_IS_SCRIPT = 1 }; \
|
||||
inline static const char *___get_pandemonium_class_name() { \
|
||||
return Base::___get_pandemonium_class_name(); \
|
||||
} \
|
||||
inline static Name *_new() { \
|
||||
return pandemonium::detail::create_custom_class_instance<Name>(); \
|
||||
} \
|
||||
inline static size_t ___get_id() { return typeid(Name).hash_code(); } \
|
||||
inline static size_t ___get_base_id() { return Base::___get_id(); } \
|
||||
inline static const char *___get_base_class_name() { return Base::___get_class_name(); } \
|
||||
inline static pandemonium::Object *___get_from_variant(pandemonium::Variant a) { \
|
||||
return (pandemonium::Object *)pandemonium::detail::get_custom_class_instance<Name>( \
|
||||
pandemonium::Object::___get_from_variant(a)); \
|
||||
} \
|
||||
\
|
||||
#define PANDEMONIUM_CLASS(Name, Base) \
|
||||
\
|
||||
public: \
|
||||
inline static const char *___get_class_name() { \
|
||||
return #Name; \
|
||||
} \
|
||||
enum { ___CLASS_IS_SCRIPT = 1 }; \
|
||||
inline static const char *___get_pandemonium_class_name() { \
|
||||
return Base::___get_pandemonium_class_name(); \
|
||||
} \
|
||||
inline static Name *_new() { \
|
||||
return Pandemonium::detail::create_custom_class_instance<Name>(); \
|
||||
} \
|
||||
inline static size_t ___get_id() { \
|
||||
return typeid(Name).hash_code(); \
|
||||
} \
|
||||
inline static size_t ___get_base_id() { \
|
||||
return Base::___get_id(); \
|
||||
} \
|
||||
inline static const char *___get_base_class_name() { \
|
||||
return Base::___get_class_name(); \
|
||||
} \
|
||||
inline static Pandemonium::Object *___get_from_variant(Pandemonium::Variant a) { \
|
||||
return (Pandemonium::Object *)Pandemonium::detail::get_custom_class_instance<Name>( \
|
||||
Pandemonium::Object::___get_from_variant(a)); \
|
||||
} \
|
||||
\
|
||||
private:
|
||||
|
||||
// Legacy compatibility
|
||||
@ -207,10 +214,10 @@ void register_class() {
|
||||
|
||||
_TagDB::register_type(T::___get_id(), T::___get_base_id());
|
||||
|
||||
pandemonium::nativescript_api->pandemonium_nativescript_register_class(pandemonium::_RegisterState::nativescript_handle,
|
||||
Pandemonium::nativescript_api->pandemonium_nativescript_register_class(_RegisterState::nativescript_handle,
|
||||
T::___get_class_name(), T::___get_base_class_name(), create, destroy);
|
||||
|
||||
pandemonium::nativescript_api->pandemonium_nativescript_set_type_tag(pandemonium::_RegisterState::nativescript_handle,
|
||||
Pandemonium::nativescript_api->pandemonium_nativescript_set_type_tag(_RegisterState::nativescript_handle,
|
||||
T::___get_class_name(), (const void *)T::___get_id());
|
||||
|
||||
T::_register_methods();
|
||||
@ -228,10 +235,10 @@ void register_tool_class() {
|
||||
|
||||
_TagDB::register_type(T::___get_id(), T::___get_base_id());
|
||||
|
||||
pandemonium::nativescript_api->pandemonium_nativescript_register_tool_class(pandemonium::_RegisterState::nativescript_handle,
|
||||
Pandemonium::nativescript_api->pandemonium_nativescript_register_tool_class(_RegisterState::nativescript_handle,
|
||||
T::___get_class_name(), T::___get_base_class_name(), create, destroy);
|
||||
|
||||
pandemonium::nativescript_api->pandemonium_nativescript_set_type_tag(pandemonium::_RegisterState::nativescript_handle,
|
||||
Pandemonium::nativescript_api->pandemonium_nativescript_set_type_tag(_RegisterState::nativescript_handle,
|
||||
T::___get_class_name(), (const void *)T::___get_id());
|
||||
|
||||
T::_register_methods();
|
||||
@ -299,7 +306,7 @@ struct _WrappedMethod<T, void, As...> {
|
||||
template <class T, class R, class... As>
|
||||
pandemonium_variant __wrapped_method(pandemonium_object *, void *method_data, void *user_data, int /*num_args*/, pandemonium_variant **args) {
|
||||
pandemonium_variant v;
|
||||
pandemonium::api->pandemonium_variant_new_nil(&v);
|
||||
Pandemonium::api->pandemonium_variant_new_nil(&v);
|
||||
|
||||
T *obj = (T *)user_data;
|
||||
_WrappedMethod<T, R, As...> *method = (_WrappedMethod<T, R, As...> *)method_data;
|
||||
@ -315,7 +322,7 @@ pandemonium_variant __wrapped_method(pandemonium_object *, void *method_data, vo
|
||||
template <class T, class R, class... As>
|
||||
void *___make_wrapper_function(R (T::*f)(As...)) {
|
||||
using MethodType = _WrappedMethod<T, R, As...>;
|
||||
MethodType *p = (MethodType *)pandemonium::api->pandemonium_alloc(sizeof(MethodType));
|
||||
MethodType *p = (MethodType *)Pandemonium::api->pandemonium_alloc(sizeof(MethodType));
|
||||
p->f = f;
|
||||
return (void *)p;
|
||||
}
|
||||
@ -339,13 +346,13 @@ template <class M>
|
||||
void register_method(const char *name, M method_ptr, pandemonium_method_rpc_mode rpc_type = PANDEMONIUM_METHOD_RPC_MODE_DISABLED) {
|
||||
pandemonium_instance_method method = {};
|
||||
method.method_data = ___make_wrapper_function(method_ptr);
|
||||
method.free_func = pandemonium::api->pandemonium_free;
|
||||
method.free_func = Pandemonium::api->pandemonium_free;
|
||||
method.method = (__pandemonium_wrapper_method)___get_wrapper_function(method_ptr);
|
||||
|
||||
pandemonium_method_attributes attr = {};
|
||||
attr.rpc_type = rpc_type;
|
||||
|
||||
pandemonium::nativescript_api->pandemonium_nativescript_register_method(pandemonium::_RegisterState::nativescript_handle,
|
||||
Pandemonium::nativescript_api->pandemonium_nativescript_register_method(_RegisterState::nativescript_handle,
|
||||
___get_method_class_name(method_ptr), name, attr, method);
|
||||
}
|
||||
|
||||
@ -379,7 +386,7 @@ struct _PropertyGetFunc {
|
||||
T *obj = (T *)user_data;
|
||||
|
||||
pandemonium_variant var;
|
||||
pandemonium::api->pandemonium_variant_new_nil(&var);
|
||||
Pandemonium::api->pandemonium_variant_new_nil(&var);
|
||||
|
||||
Variant *v = (Variant *)&var;
|
||||
|
||||
@ -410,7 +417,7 @@ struct _PropertyDefaultGetFunc {
|
||||
T *obj = (T *)user_data;
|
||||
|
||||
pandemonium_variant var;
|
||||
pandemonium::api->pandemonium_variant_new_nil(&var);
|
||||
Pandemonium::api->pandemonium_variant_new_nil(&var);
|
||||
|
||||
Variant *v = (Variant *)&var;
|
||||
|
||||
@ -455,24 +462,24 @@ void register_property(const char *name, P(T::*var), P default_value,
|
||||
attr.hint_string = *_hint_string;
|
||||
|
||||
_PropertyDefaultSetFunc<T, P> *wrapped_set =
|
||||
(_PropertyDefaultSetFunc<T, P> *)pandemonium::api->pandemonium_alloc(sizeof(_PropertyDefaultSetFunc<T, P>));
|
||||
(_PropertyDefaultSetFunc<T, P> *)Pandemonium::api->pandemonium_alloc(sizeof(_PropertyDefaultSetFunc<T, P>));
|
||||
wrapped_set->f = var;
|
||||
|
||||
_PropertyDefaultGetFunc<T, P> *wrapped_get =
|
||||
(_PropertyDefaultGetFunc<T, P> *)pandemonium::api->pandemonium_alloc(sizeof(_PropertyDefaultGetFunc<T, P>));
|
||||
(_PropertyDefaultGetFunc<T, P> *)Pandemonium::api->pandemonium_alloc(sizeof(_PropertyDefaultGetFunc<T, P>));
|
||||
wrapped_get->f = var;
|
||||
|
||||
pandemonium_property_set_func set_func = {};
|
||||
set_func.method_data = (void *)wrapped_set;
|
||||
set_func.free_func = pandemonium::api->pandemonium_free;
|
||||
set_func.free_func = Pandemonium::api->pandemonium_free;
|
||||
set_func.set_func = &_PropertyDefaultSetFunc<T, P>::_wrapped_setter;
|
||||
|
||||
pandemonium_property_get_func get_func = {};
|
||||
get_func.method_data = (void *)wrapped_get;
|
||||
get_func.free_func = pandemonium::api->pandemonium_free;
|
||||
get_func.free_func = Pandemonium::api->pandemonium_free;
|
||||
get_func.get_func = &_PropertyDefaultGetFunc<T, P>::_wrapped_getter;
|
||||
|
||||
pandemonium::nativescript_api->pandemonium_nativescript_register_property(pandemonium::_RegisterState::nativescript_handle,
|
||||
Pandemonium::nativescript_api->pandemonium_nativescript_register_property(_RegisterState::nativescript_handle,
|
||||
T::___get_class_name(), name, &attr, set_func, get_func);
|
||||
}
|
||||
|
||||
@ -499,23 +506,23 @@ void register_property(const char *name, void (T::*setter)(P), P (T::*getter)(),
|
||||
attr.usage = usage;
|
||||
attr.hint_string = *_hint_string;
|
||||
|
||||
_PropertySetFunc<T, P> *wrapped_set = (_PropertySetFunc<T, P> *)pandemonium::api->pandemonium_alloc(sizeof(_PropertySetFunc<T, P>));
|
||||
_PropertySetFunc<T, P> *wrapped_set = (_PropertySetFunc<T, P> *)Pandemonium::api->pandemonium_alloc(sizeof(_PropertySetFunc<T, P>));
|
||||
wrapped_set->f = setter;
|
||||
|
||||
_PropertyGetFunc<T, P> *wrapped_get = (_PropertyGetFunc<T, P> *)pandemonium::api->pandemonium_alloc(sizeof(_PropertyGetFunc<T, P>));
|
||||
_PropertyGetFunc<T, P> *wrapped_get = (_PropertyGetFunc<T, P> *)Pandemonium::api->pandemonium_alloc(sizeof(_PropertyGetFunc<T, P>));
|
||||
wrapped_get->f = getter;
|
||||
|
||||
pandemonium_property_set_func set_func = {};
|
||||
set_func.method_data = (void *)wrapped_set;
|
||||
set_func.free_func = pandemonium::api->pandemonium_free;
|
||||
set_func.free_func = Pandemonium::api->pandemonium_free;
|
||||
set_func.set_func = &_PropertySetFunc<T, P>::_wrapped_setter;
|
||||
|
||||
pandemonium_property_get_func get_func = {};
|
||||
get_func.method_data = (void *)wrapped_get;
|
||||
get_func.free_func = pandemonium::api->pandemonium_free;
|
||||
get_func.free_func = Pandemonium::api->pandemonium_free;
|
||||
get_func.get_func = &_PropertyGetFunc<T, P>::_wrapped_getter;
|
||||
|
||||
pandemonium::nativescript_api->pandemonium_nativescript_register_property(pandemonium::_RegisterState::nativescript_handle,
|
||||
Pandemonium::nativescript_api->pandemonium_nativescript_register_property(_RegisterState::nativescript_handle,
|
||||
T::___get_class_name(), name, &attr, set_func, get_func);
|
||||
}
|
||||
|
||||
@ -538,7 +545,7 @@ void register_signal(String name, Dictionary args) {
|
||||
|
||||
// Need to check because malloc(0) is platform-dependent. Zero arguments will leave args to nullptr.
|
||||
if (signal.num_args != 0) {
|
||||
signal.args = (pandemonium_signal_argument *)pandemonium::api->pandemonium_alloc(sizeof(pandemonium_signal_argument) * signal.num_args);
|
||||
signal.args = (pandemonium_signal_argument *)Pandemonium::api->pandemonium_alloc(sizeof(pandemonium_signal_argument) * signal.num_args);
|
||||
memset((void *)signal.args, 0, sizeof(pandemonium_signal_argument) * signal.num_args);
|
||||
}
|
||||
|
||||
@ -547,7 +554,7 @@ void register_signal(String name, Dictionary args) {
|
||||
// String name = entry[0];
|
||||
String name = args.keys()[i];
|
||||
pandemonium_string *_key = (pandemonium_string *)&name;
|
||||
pandemonium::api->pandemonium_string_new_copy(&signal.args[i].name, _key);
|
||||
Pandemonium::api->pandemonium_string_new_copy(&signal.args[i].name, _key);
|
||||
|
||||
// if (entry.size() > 1) {
|
||||
// signal.args[i].type = entry[1];
|
||||
@ -555,15 +562,15 @@ void register_signal(String name, Dictionary args) {
|
||||
signal.args[i].type = args.values()[i];
|
||||
}
|
||||
|
||||
pandemonium::nativescript_api->pandemonium_nativescript_register_signal(pandemonium::_RegisterState::nativescript_handle,
|
||||
Pandemonium::nativescript_api->pandemonium_nativescript_register_signal(_RegisterState::nativescript_handle,
|
||||
T::___get_class_name(), &signal);
|
||||
|
||||
for (int i = 0; i < signal.num_args; i++) {
|
||||
pandemonium::api->pandemonium_string_destroy(&signal.args[i].name);
|
||||
Pandemonium::api->pandemonium_string_destroy(&signal.args[i].name);
|
||||
}
|
||||
|
||||
if (signal.args) {
|
||||
pandemonium::api->pandemonium_free(signal.args);
|
||||
Pandemonium::api->pandemonium_free(signal.args);
|
||||
}
|
||||
}
|
||||
|
||||
@ -579,7 +586,7 @@ void register_signal(String name) {
|
||||
pandemonium_signal signal = {};
|
||||
signal.name = *(pandemonium_string *)&name;
|
||||
|
||||
pandemonium::nativescript_api->pandemonium_nativescript_register_signal(pandemonium::_RegisterState::nativescript_handle,
|
||||
Pandemonium::nativescript_api->pandemonium_nativescript_register_signal(_RegisterState::nativescript_handle,
|
||||
T::___get_class_name(), &signal);
|
||||
}
|
||||
|
||||
@ -590,9 +597,9 @@ T *Object::cast_to(const Object *obj) {
|
||||
return nullptr;
|
||||
|
||||
if (T::___CLASS_IS_SCRIPT) {
|
||||
size_t have_tag = (size_t)pandemonium::nativescript_api->pandemonium_nativescript_get_type_tag(obj->_owner);
|
||||
size_t have_tag = (size_t)Pandemonium::nativescript_api->pandemonium_nativescript_get_type_tag(obj->_owner);
|
||||
if (have_tag) {
|
||||
if (!pandemonium::_TagDB::is_type_known((size_t)have_tag)) {
|
||||
if (!_TagDB::is_type_known((size_t)have_tag)) {
|
||||
have_tag = 0;
|
||||
}
|
||||
}
|
||||
@ -601,11 +608,11 @@ T *Object::cast_to(const Object *obj) {
|
||||
have_tag = obj->_type_tag;
|
||||
}
|
||||
|
||||
if (pandemonium::_TagDB::is_type_compatible(T::___get_id(), have_tag)) {
|
||||
if (_TagDB::is_type_compatible(T::___get_id(), have_tag)) {
|
||||
return detail::get_custom_class_instance<T>(obj);
|
||||
}
|
||||
} else {
|
||||
if (pandemonium::api->pandemonium_object_cast_to(obj->_owner, (void *)T::___get_id())) {
|
||||
if (Pandemonium::api->pandemonium_object_cast_to(obj->_owner, (void *)T::___get_id())) {
|
||||
return (T *)obj;
|
||||
}
|
||||
}
|
||||
@ -614,6 +621,4 @@ T *Object::cast_to(const Object *obj) {
|
||||
}
|
||||
#endif
|
||||
|
||||
} // namespace pandemonium
|
||||
|
||||
#endif // PANDEMONIUM_H
|
||||
|
@ -36,21 +36,9 @@
|
||||
#include "array.h"
|
||||
#include "ustring.h"
|
||||
|
||||
namespace pandemonium {
|
||||
|
||||
class Array;
|
||||
class String;
|
||||
|
||||
extern "C" const pandemonium_gdnative_core_api_struct *api;
|
||||
|
||||
extern "C" const pandemonium_gdnative_ext_nativescript_api_struct *nativescript_api;
|
||||
extern "C" const pandemonium_gdnative_ext_pluginscript_api_struct *pluginscript_api;
|
||||
extern "C" const pandemonium_gdnative_ext_android_api_struct *android_api;
|
||||
extern "C" const pandemonium_gdnative_ext_videodecoder_api_struct *videodecoder_api;
|
||||
extern "C" const pandemonium_gdnative_ext_net_api_struct *net_api;
|
||||
|
||||
extern "C" const void *gdnlib;
|
||||
|
||||
class Pandemonium {
|
||||
public:
|
||||
static void print(const String &message);
|
||||
@ -68,6 +56,16 @@ public:
|
||||
static void print(const String &fmt, Args... values) {
|
||||
print(fmt.format(Array::make(values...)));
|
||||
}
|
||||
|
||||
static const pandemonium_gdnative_core_api_struct *api;
|
||||
|
||||
static const pandemonium_gdnative_ext_nativescript_api_struct *nativescript_api;
|
||||
static const pandemonium_gdnative_ext_pluginscript_api_struct *pluginscript_api;
|
||||
static const pandemonium_gdnative_ext_android_api_struct *android_api;
|
||||
static const pandemonium_gdnative_ext_videodecoder_api_struct *videodecoder_api;
|
||||
static const pandemonium_gdnative_ext_net_api_struct *net_api;
|
||||
|
||||
static const void *gdnlib;
|
||||
};
|
||||
|
||||
struct _RegisterState {
|
||||
@ -75,6 +73,4 @@ struct _RegisterState {
|
||||
static int language_index;
|
||||
};
|
||||
|
||||
} // namespace pandemonium
|
||||
|
||||
#endif
|
||||
|
@ -33,7 +33,7 @@
|
||||
|
||||
#include "defs.h"
|
||||
|
||||
namespace pandemonium {
|
||||
|
||||
|
||||
class FunctionProfiling {
|
||||
char signature[1024];
|
||||
@ -44,7 +44,7 @@ public:
|
||||
~FunctionProfiling();
|
||||
};
|
||||
|
||||
} // namespace pandemonium
|
||||
|
||||
|
||||
#ifdef DEBUG_ENABLED
|
||||
#define PANDEMONIUM_PROFILING_FUNCTION FunctionProfiling __function_profiling(__FUNCTION__, __LINE__);
|
||||
|
@ -35,7 +35,7 @@
|
||||
|
||||
#include <cmath>
|
||||
|
||||
namespace pandemonium {
|
||||
|
||||
|
||||
enum ClockDirection {
|
||||
|
||||
@ -93,6 +93,6 @@ public:
|
||||
Plane(const Vector3 &p_point1, const Vector3 &p_point2, const Vector3 &p_point3, ClockDirection p_dir = CLOCKWISE);
|
||||
};
|
||||
|
||||
} // namespace pandemonium
|
||||
|
||||
|
||||
#endif // PLANE_H
|
||||
|
@ -42,7 +42,7 @@
|
||||
|
||||
#include <gdn/pool_arrays.h>
|
||||
|
||||
namespace pandemonium {
|
||||
|
||||
|
||||
class Array;
|
||||
|
||||
@ -66,15 +66,15 @@ public:
|
||||
}
|
||||
|
||||
inline Read(const Read &p_other) {
|
||||
_read_access = pandemonium::api->pandemonium_pool_byte_array_read_access_copy(p_other._read_access);
|
||||
_read_access = Pandemonium::api->pandemonium_pool_byte_array_read_access_copy(p_other._read_access);
|
||||
}
|
||||
|
||||
inline ~Read() {
|
||||
pandemonium::api->pandemonium_pool_byte_array_read_access_destroy(_read_access);
|
||||
Pandemonium::api->pandemonium_pool_byte_array_read_access_destroy(_read_access);
|
||||
}
|
||||
|
||||
inline const uint8_t *ptr() const {
|
||||
return pandemonium::api->pandemonium_pool_byte_array_read_access_ptr(_read_access);
|
||||
return Pandemonium::api->pandemonium_pool_byte_array_read_access_ptr(_read_access);
|
||||
}
|
||||
|
||||
inline const uint8_t &operator[](int p_idx) const {
|
||||
@ -82,7 +82,7 @@ public:
|
||||
}
|
||||
|
||||
inline void operator=(const Read &p_other) {
|
||||
pandemonium::api->pandemonium_pool_byte_array_read_access_operator_assign(_read_access, p_other._read_access);
|
||||
Pandemonium::api->pandemonium_pool_byte_array_read_access_operator_assign(_read_access, p_other._read_access);
|
||||
}
|
||||
};
|
||||
|
||||
@ -96,15 +96,15 @@ public:
|
||||
}
|
||||
|
||||
inline Write(const Write &p_other) {
|
||||
_write_access = pandemonium::api->pandemonium_pool_byte_array_write_access_copy(p_other._write_access);
|
||||
_write_access = Pandemonium::api->pandemonium_pool_byte_array_write_access_copy(p_other._write_access);
|
||||
}
|
||||
|
||||
inline ~Write() {
|
||||
pandemonium::api->pandemonium_pool_byte_array_write_access_destroy(_write_access);
|
||||
Pandemonium::api->pandemonium_pool_byte_array_write_access_destroy(_write_access);
|
||||
}
|
||||
|
||||
inline uint8_t *ptr() const {
|
||||
return pandemonium::api->pandemonium_pool_byte_array_write_access_ptr(_write_access);
|
||||
return Pandemonium::api->pandemonium_pool_byte_array_write_access_ptr(_write_access);
|
||||
}
|
||||
|
||||
inline uint8_t &operator[](int p_idx) const {
|
||||
@ -112,7 +112,7 @@ public:
|
||||
}
|
||||
|
||||
inline void operator=(const Write &p_other) {
|
||||
pandemonium::api->pandemonium_pool_byte_array_write_access_operator_assign(_write_access, p_other._write_access);
|
||||
Pandemonium::api->pandemonium_pool_byte_array_write_access_operator_assign(_write_access, p_other._write_access);
|
||||
}
|
||||
};
|
||||
|
||||
@ -168,15 +168,15 @@ public:
|
||||
}
|
||||
|
||||
inline Read(const Read &p_other) {
|
||||
_read_access = pandemonium::api->pandemonium_pool_int_array_read_access_copy(p_other._read_access);
|
||||
_read_access = Pandemonium::api->pandemonium_pool_int_array_read_access_copy(p_other._read_access);
|
||||
}
|
||||
|
||||
inline ~Read() {
|
||||
pandemonium::api->pandemonium_pool_int_array_read_access_destroy(_read_access);
|
||||
Pandemonium::api->pandemonium_pool_int_array_read_access_destroy(_read_access);
|
||||
}
|
||||
|
||||
inline const int *ptr() const {
|
||||
return pandemonium::api->pandemonium_pool_int_array_read_access_ptr(_read_access);
|
||||
return Pandemonium::api->pandemonium_pool_int_array_read_access_ptr(_read_access);
|
||||
}
|
||||
|
||||
inline const int &operator[](int p_idx) const {
|
||||
@ -184,7 +184,7 @@ public:
|
||||
}
|
||||
|
||||
inline void operator=(const Read &p_other) {
|
||||
pandemonium::api->pandemonium_pool_int_array_read_access_operator_assign(_read_access, p_other._read_access);
|
||||
Pandemonium::api->pandemonium_pool_int_array_read_access_operator_assign(_read_access, p_other._read_access);
|
||||
}
|
||||
};
|
||||
|
||||
@ -198,15 +198,15 @@ public:
|
||||
}
|
||||
|
||||
inline Write(const Write &p_other) {
|
||||
_write_access = pandemonium::api->pandemonium_pool_int_array_write_access_copy(p_other._write_access);
|
||||
_write_access = Pandemonium::api->pandemonium_pool_int_array_write_access_copy(p_other._write_access);
|
||||
}
|
||||
|
||||
inline ~Write() {
|
||||
pandemonium::api->pandemonium_pool_int_array_write_access_destroy(_write_access);
|
||||
Pandemonium::api->pandemonium_pool_int_array_write_access_destroy(_write_access);
|
||||
}
|
||||
|
||||
inline int *ptr() const {
|
||||
return pandemonium::api->pandemonium_pool_int_array_write_access_ptr(_write_access);
|
||||
return Pandemonium::api->pandemonium_pool_int_array_write_access_ptr(_write_access);
|
||||
}
|
||||
|
||||
inline int &operator[](int p_idx) const {
|
||||
@ -214,7 +214,7 @@ public:
|
||||
}
|
||||
|
||||
inline void operator=(const Write &p_other) {
|
||||
pandemonium::api->pandemonium_pool_int_array_write_access_operator_assign(_write_access, p_other._write_access);
|
||||
Pandemonium::api->pandemonium_pool_int_array_write_access_operator_assign(_write_access, p_other._write_access);
|
||||
}
|
||||
};
|
||||
|
||||
@ -270,15 +270,15 @@ public:
|
||||
}
|
||||
|
||||
inline Read(const Read &p_other) {
|
||||
_read_access = pandemonium::api->pandemonium_pool_real_array_read_access_copy(p_other._read_access);
|
||||
_read_access = Pandemonium::api->pandemonium_pool_real_array_read_access_copy(p_other._read_access);
|
||||
}
|
||||
|
||||
inline ~Read() {
|
||||
pandemonium::api->pandemonium_pool_real_array_read_access_destroy(_read_access);
|
||||
Pandemonium::api->pandemonium_pool_real_array_read_access_destroy(_read_access);
|
||||
}
|
||||
|
||||
inline const real_t *ptr() const {
|
||||
return pandemonium::api->pandemonium_pool_real_array_read_access_ptr(_read_access);
|
||||
return Pandemonium::api->pandemonium_pool_real_array_read_access_ptr(_read_access);
|
||||
}
|
||||
|
||||
inline const real_t &operator[](int p_idx) const {
|
||||
@ -286,7 +286,7 @@ public:
|
||||
}
|
||||
|
||||
inline void operator=(const Read &p_other) {
|
||||
pandemonium::api->pandemonium_pool_real_array_read_access_operator_assign(_read_access, p_other._read_access);
|
||||
Pandemonium::api->pandemonium_pool_real_array_read_access_operator_assign(_read_access, p_other._read_access);
|
||||
}
|
||||
};
|
||||
|
||||
@ -300,15 +300,15 @@ public:
|
||||
}
|
||||
|
||||
inline Write(const Write &p_other) {
|
||||
_write_access = pandemonium::api->pandemonium_pool_real_array_write_access_copy(p_other._write_access);
|
||||
_write_access = Pandemonium::api->pandemonium_pool_real_array_write_access_copy(p_other._write_access);
|
||||
}
|
||||
|
||||
inline ~Write() {
|
||||
pandemonium::api->pandemonium_pool_real_array_write_access_destroy(_write_access);
|
||||
Pandemonium::api->pandemonium_pool_real_array_write_access_destroy(_write_access);
|
||||
}
|
||||
|
||||
inline real_t *ptr() const {
|
||||
return pandemonium::api->pandemonium_pool_real_array_write_access_ptr(_write_access);
|
||||
return Pandemonium::api->pandemonium_pool_real_array_write_access_ptr(_write_access);
|
||||
}
|
||||
|
||||
inline real_t &operator[](int p_idx) const {
|
||||
@ -316,7 +316,7 @@ public:
|
||||
}
|
||||
|
||||
inline void operator=(const Write &p_other) {
|
||||
pandemonium::api->pandemonium_pool_real_array_write_access_operator_assign(_write_access, p_other._write_access);
|
||||
Pandemonium::api->pandemonium_pool_real_array_write_access_operator_assign(_write_access, p_other._write_access);
|
||||
}
|
||||
};
|
||||
|
||||
@ -373,15 +373,15 @@ public:
|
||||
}
|
||||
|
||||
inline Read(const Read &p_other) {
|
||||
_read_access = pandemonium::api->pandemonium_pool_string_array_read_access_copy(p_other._read_access);
|
||||
_read_access = Pandemonium::api->pandemonium_pool_string_array_read_access_copy(p_other._read_access);
|
||||
}
|
||||
|
||||
inline ~Read() {
|
||||
pandemonium::api->pandemonium_pool_string_array_read_access_destroy(_read_access);
|
||||
Pandemonium::api->pandemonium_pool_string_array_read_access_destroy(_read_access);
|
||||
}
|
||||
|
||||
inline const String *ptr() const {
|
||||
return (const String *)pandemonium::api->pandemonium_pool_string_array_read_access_ptr(_read_access);
|
||||
return (const String *)Pandemonium::api->pandemonium_pool_string_array_read_access_ptr(_read_access);
|
||||
}
|
||||
|
||||
inline const String &operator[](int p_idx) const {
|
||||
@ -389,7 +389,7 @@ public:
|
||||
}
|
||||
|
||||
inline void operator=(const Read &p_other) {
|
||||
pandemonium::api->pandemonium_pool_string_array_read_access_operator_assign(_read_access, p_other._read_access);
|
||||
Pandemonium::api->pandemonium_pool_string_array_read_access_operator_assign(_read_access, p_other._read_access);
|
||||
}
|
||||
};
|
||||
|
||||
@ -403,15 +403,15 @@ public:
|
||||
}
|
||||
|
||||
inline Write(const Write &p_other) {
|
||||
_write_access = pandemonium::api->pandemonium_pool_string_array_write_access_copy(p_other._write_access);
|
||||
_write_access = Pandemonium::api->pandemonium_pool_string_array_write_access_copy(p_other._write_access);
|
||||
}
|
||||
|
||||
inline ~Write() {
|
||||
pandemonium::api->pandemonium_pool_string_array_write_access_destroy(_write_access);
|
||||
Pandemonium::api->pandemonium_pool_string_array_write_access_destroy(_write_access);
|
||||
}
|
||||
|
||||
inline String *ptr() const {
|
||||
return (String *)pandemonium::api->pandemonium_pool_string_array_write_access_ptr(_write_access);
|
||||
return (String *)Pandemonium::api->pandemonium_pool_string_array_write_access_ptr(_write_access);
|
||||
}
|
||||
|
||||
inline String &operator[](int p_idx) const {
|
||||
@ -419,7 +419,7 @@ public:
|
||||
}
|
||||
|
||||
inline void operator=(const Write &p_other) {
|
||||
pandemonium::api->pandemonium_pool_string_array_write_access_operator_assign(_write_access, p_other._write_access);
|
||||
Pandemonium::api->pandemonium_pool_string_array_write_access_operator_assign(_write_access, p_other._write_access);
|
||||
}
|
||||
};
|
||||
|
||||
@ -475,15 +475,15 @@ public:
|
||||
}
|
||||
|
||||
inline Read(const Read &p_other) {
|
||||
_read_access = pandemonium::api->pandemonium_pool_vector2_array_read_access_copy(p_other._read_access);
|
||||
_read_access = Pandemonium::api->pandemonium_pool_vector2_array_read_access_copy(p_other._read_access);
|
||||
}
|
||||
|
||||
inline ~Read() {
|
||||
pandemonium::api->pandemonium_pool_vector2_array_read_access_destroy(_read_access);
|
||||
Pandemonium::api->pandemonium_pool_vector2_array_read_access_destroy(_read_access);
|
||||
}
|
||||
|
||||
inline const Vector2 *ptr() const {
|
||||
return (const Vector2 *)pandemonium::api->pandemonium_pool_vector2_array_read_access_ptr(_read_access);
|
||||
return (const Vector2 *)Pandemonium::api->pandemonium_pool_vector2_array_read_access_ptr(_read_access);
|
||||
}
|
||||
|
||||
inline const Vector2 &operator[](int p_idx) const {
|
||||
@ -491,7 +491,7 @@ public:
|
||||
}
|
||||
|
||||
inline void operator=(const Read &p_other) {
|
||||
pandemonium::api->pandemonium_pool_vector2_array_read_access_operator_assign(_read_access, p_other._read_access);
|
||||
Pandemonium::api->pandemonium_pool_vector2_array_read_access_operator_assign(_read_access, p_other._read_access);
|
||||
}
|
||||
};
|
||||
|
||||
@ -505,15 +505,15 @@ public:
|
||||
}
|
||||
|
||||
inline Write(const Write &p_other) {
|
||||
_write_access = pandemonium::api->pandemonium_pool_vector2_array_write_access_copy(p_other._write_access);
|
||||
_write_access = Pandemonium::api->pandemonium_pool_vector2_array_write_access_copy(p_other._write_access);
|
||||
}
|
||||
|
||||
inline ~Write() {
|
||||
pandemonium::api->pandemonium_pool_vector2_array_write_access_destroy(_write_access);
|
||||
Pandemonium::api->pandemonium_pool_vector2_array_write_access_destroy(_write_access);
|
||||
}
|
||||
|
||||
inline Vector2 *ptr() const {
|
||||
return (Vector2 *)pandemonium::api->pandemonium_pool_vector2_array_write_access_ptr(_write_access);
|
||||
return (Vector2 *)Pandemonium::api->pandemonium_pool_vector2_array_write_access_ptr(_write_access);
|
||||
}
|
||||
|
||||
inline Vector2 &operator[](int p_idx) const {
|
||||
@ -521,7 +521,7 @@ public:
|
||||
}
|
||||
|
||||
inline void operator=(const Write &p_other) {
|
||||
pandemonium::api->pandemonium_pool_vector2_array_write_access_operator_assign(_write_access, p_other._write_access);
|
||||
Pandemonium::api->pandemonium_pool_vector2_array_write_access_operator_assign(_write_access, p_other._write_access);
|
||||
}
|
||||
};
|
||||
|
||||
@ -577,15 +577,15 @@ public:
|
||||
}
|
||||
|
||||
inline Read(const Read &p_other) {
|
||||
_read_access = pandemonium::api->pandemonium_pool_vector2i_array_read_access_copy(p_other._read_access);
|
||||
_read_access = Pandemonium::api->pandemonium_pool_vector2i_array_read_access_copy(p_other._read_access);
|
||||
}
|
||||
|
||||
inline ~Read() {
|
||||
pandemonium::api->pandemonium_pool_vector2i_array_read_access_destroy(_read_access);
|
||||
Pandemonium::api->pandemonium_pool_vector2i_array_read_access_destroy(_read_access);
|
||||
}
|
||||
|
||||
inline const Vector2i *ptr() const {
|
||||
return (const Vector2i *)pandemonium::api->pandemonium_pool_vector2i_array_read_access_ptr(_read_access);
|
||||
return (const Vector2i *)Pandemonium::api->pandemonium_pool_vector2i_array_read_access_ptr(_read_access);
|
||||
}
|
||||
|
||||
inline const Vector2i &operator[](int p_idx) const {
|
||||
@ -593,7 +593,7 @@ public:
|
||||
}
|
||||
|
||||
inline void operator=(const Read &p_other) {
|
||||
pandemonium::api->pandemonium_pool_vector2i_array_read_access_operator_assign(_read_access, p_other._read_access);
|
||||
Pandemonium::api->pandemonium_pool_vector2i_array_read_access_operator_assign(_read_access, p_other._read_access);
|
||||
}
|
||||
};
|
||||
|
||||
@ -607,15 +607,15 @@ public:
|
||||
}
|
||||
|
||||
inline Write(const Write &p_other) {
|
||||
_write_access = pandemonium::api->pandemonium_pool_vector2i_array_write_access_copy(p_other._write_access);
|
||||
_write_access = Pandemonium::api->pandemonium_pool_vector2i_array_write_access_copy(p_other._write_access);
|
||||
}
|
||||
|
||||
inline ~Write() {
|
||||
pandemonium::api->pandemonium_pool_vector2i_array_write_access_destroy(_write_access);
|
||||
Pandemonium::api->pandemonium_pool_vector2i_array_write_access_destroy(_write_access);
|
||||
}
|
||||
|
||||
inline Vector2i *ptr() const {
|
||||
return (Vector2i *)pandemonium::api->pandemonium_pool_vector2i_array_write_access_ptr(_write_access);
|
||||
return (Vector2i *)Pandemonium::api->pandemonium_pool_vector2i_array_write_access_ptr(_write_access);
|
||||
}
|
||||
|
||||
inline Vector2i &operator[](int p_idx) const {
|
||||
@ -623,7 +623,7 @@ public:
|
||||
}
|
||||
|
||||
inline void operator=(const Write &p_other) {
|
||||
pandemonium::api->pandemonium_pool_vector2i_array_write_access_operator_assign(_write_access, p_other._write_access);
|
||||
Pandemonium::api->pandemonium_pool_vector2i_array_write_access_operator_assign(_write_access, p_other._write_access);
|
||||
}
|
||||
};
|
||||
|
||||
@ -679,15 +679,15 @@ public:
|
||||
}
|
||||
|
||||
inline Read(const Read &p_other) {
|
||||
_read_access = pandemonium::api->pandemonium_pool_vector3_array_read_access_copy(p_other._read_access);
|
||||
_read_access = Pandemonium::api->pandemonium_pool_vector3_array_read_access_copy(p_other._read_access);
|
||||
}
|
||||
|
||||
inline ~Read() {
|
||||
pandemonium::api->pandemonium_pool_vector3_array_read_access_destroy(_read_access);
|
||||
Pandemonium::api->pandemonium_pool_vector3_array_read_access_destroy(_read_access);
|
||||
}
|
||||
|
||||
inline const Vector3 *ptr() const {
|
||||
return (const Vector3 *)pandemonium::api->pandemonium_pool_vector3_array_read_access_ptr(_read_access);
|
||||
return (const Vector3 *)Pandemonium::api->pandemonium_pool_vector3_array_read_access_ptr(_read_access);
|
||||
}
|
||||
|
||||
inline const Vector3 &operator[](int p_idx) const {
|
||||
@ -695,7 +695,7 @@ public:
|
||||
}
|
||||
|
||||
inline void operator=(const Read &p_other) {
|
||||
pandemonium::api->pandemonium_pool_vector3_array_read_access_operator_assign(_read_access, p_other._read_access);
|
||||
Pandemonium::api->pandemonium_pool_vector3_array_read_access_operator_assign(_read_access, p_other._read_access);
|
||||
}
|
||||
};
|
||||
|
||||
@ -709,15 +709,15 @@ public:
|
||||
}
|
||||
|
||||
inline Write(const Write &p_other) {
|
||||
_write_access = pandemonium::api->pandemonium_pool_vector3_array_write_access_copy(p_other._write_access);
|
||||
_write_access = Pandemonium::api->pandemonium_pool_vector3_array_write_access_copy(p_other._write_access);
|
||||
}
|
||||
|
||||
inline ~Write() {
|
||||
pandemonium::api->pandemonium_pool_vector3_array_write_access_destroy(_write_access);
|
||||
Pandemonium::api->pandemonium_pool_vector3_array_write_access_destroy(_write_access);
|
||||
}
|
||||
|
||||
inline Vector3 *ptr() const {
|
||||
return (Vector3 *)pandemonium::api->pandemonium_pool_vector3_array_write_access_ptr(_write_access);
|
||||
return (Vector3 *)Pandemonium::api->pandemonium_pool_vector3_array_write_access_ptr(_write_access);
|
||||
}
|
||||
|
||||
inline Vector3 &operator[](int p_idx) const {
|
||||
@ -725,7 +725,7 @@ public:
|
||||
}
|
||||
|
||||
inline void operator=(const Write &p_other) {
|
||||
pandemonium::api->pandemonium_pool_vector3_array_write_access_operator_assign(_write_access, p_other._write_access);
|
||||
Pandemonium::api->pandemonium_pool_vector3_array_write_access_operator_assign(_write_access, p_other._write_access);
|
||||
}
|
||||
};
|
||||
|
||||
@ -781,15 +781,15 @@ public:
|
||||
}
|
||||
|
||||
inline Read(const Read &p_other) {
|
||||
_read_access = pandemonium::api->pandemonium_pool_color_array_read_access_copy(p_other._read_access);
|
||||
_read_access = Pandemonium::api->pandemonium_pool_color_array_read_access_copy(p_other._read_access);
|
||||
}
|
||||
|
||||
inline ~Read() {
|
||||
pandemonium::api->pandemonium_pool_color_array_read_access_destroy(_read_access);
|
||||
Pandemonium::api->pandemonium_pool_color_array_read_access_destroy(_read_access);
|
||||
}
|
||||
|
||||
inline const Color *ptr() const {
|
||||
return (const Color *)pandemonium::api->pandemonium_pool_color_array_read_access_ptr(_read_access);
|
||||
return (const Color *)Pandemonium::api->pandemonium_pool_color_array_read_access_ptr(_read_access);
|
||||
}
|
||||
|
||||
inline const Color &operator[](int p_idx) const {
|
||||
@ -797,7 +797,7 @@ public:
|
||||
}
|
||||
|
||||
inline void operator=(const Read &p_other) {
|
||||
pandemonium::api->pandemonium_pool_color_array_read_access_operator_assign(_read_access, p_other._read_access);
|
||||
Pandemonium::api->pandemonium_pool_color_array_read_access_operator_assign(_read_access, p_other._read_access);
|
||||
}
|
||||
};
|
||||
|
||||
@ -811,15 +811,15 @@ public:
|
||||
}
|
||||
|
||||
inline Write(const Write &p_other) {
|
||||
_write_access = pandemonium::api->pandemonium_pool_color_array_write_access_copy(p_other._write_access);
|
||||
_write_access = Pandemonium::api->pandemonium_pool_color_array_write_access_copy(p_other._write_access);
|
||||
}
|
||||
|
||||
inline ~Write() {
|
||||
pandemonium::api->pandemonium_pool_color_array_write_access_destroy(_write_access);
|
||||
Pandemonium::api->pandemonium_pool_color_array_write_access_destroy(_write_access);
|
||||
}
|
||||
|
||||
inline Color *ptr() const {
|
||||
return (Color *)pandemonium::api->pandemonium_pool_color_array_write_access_ptr(_write_access);
|
||||
return (Color *)Pandemonium::api->pandemonium_pool_color_array_write_access_ptr(_write_access);
|
||||
}
|
||||
|
||||
inline Color &operator[](int p_idx) const {
|
||||
@ -827,7 +827,7 @@ public:
|
||||
}
|
||||
|
||||
inline void operator=(const Write &p_other) {
|
||||
pandemonium::api->pandemonium_pool_color_array_write_access_operator_assign(_write_access, p_other._write_access);
|
||||
Pandemonium::api->pandemonium_pool_color_array_write_access_operator_assign(_write_access, p_other._write_access);
|
||||
}
|
||||
};
|
||||
|
||||
@ -864,6 +864,6 @@ public:
|
||||
~PoolColorArray();
|
||||
};
|
||||
|
||||
} // namespace pandemonium
|
||||
|
||||
|
||||
#endif // POOLARRAYS_H
|
||||
|
@ -40,7 +40,7 @@
|
||||
#include <vector>
|
||||
|
||||
namespace {
|
||||
using namespace pandemonium;
|
||||
|
||||
} // namespace
|
||||
|
||||
struct Projection {
|
||||
|
@ -37,7 +37,7 @@
|
||||
|
||||
// #include "basis.h"
|
||||
|
||||
namespace pandemonium {
|
||||
|
||||
|
||||
class Quaternion {
|
||||
public:
|
||||
@ -120,6 +120,6 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace pandemonium
|
||||
|
||||
|
||||
#endif // QUAT_H
|
||||
|
@ -37,7 +37,7 @@
|
||||
|
||||
#include <cstdlib>
|
||||
|
||||
namespace pandemonium {
|
||||
|
||||
|
||||
class String;
|
||||
|
||||
@ -155,6 +155,6 @@ struct Rect2 {
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace pandemonium
|
||||
|
||||
|
||||
#endif // RECT2_H
|
||||
|
@ -37,7 +37,7 @@
|
||||
|
||||
#include <cstdlib>
|
||||
|
||||
namespace pandemonium {
|
||||
|
||||
|
||||
class String;
|
||||
|
||||
@ -61,6 +61,6 @@ struct Rect2i {
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace pandemonium
|
||||
|
||||
|
||||
#endif // RECT2_H
|
||||
|
@ -35,7 +35,7 @@
|
||||
#include "reference.h"
|
||||
#include "variant.h"
|
||||
|
||||
namespace pandemonium {
|
||||
|
||||
|
||||
// Replicates Pandemonium's Ref<T> behavior
|
||||
// Rewritten from f5234e70be7dec4930c2d5a0e829ff480d044b1d.
|
||||
@ -211,6 +211,6 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace pandemonium
|
||||
|
||||
|
||||
#endif
|
||||
|
@ -33,7 +33,7 @@
|
||||
|
||||
#include <gdn/rid.h>
|
||||
|
||||
namespace pandemonium {
|
||||
|
||||
|
||||
class Object;
|
||||
|
||||
@ -62,6 +62,6 @@ public:
|
||||
bool operator>=(const RID &p_other) const;
|
||||
};
|
||||
|
||||
} // namespace pandemonium
|
||||
|
||||
|
||||
#endif // RID_H
|
||||
|
@ -33,7 +33,7 @@
|
||||
|
||||
#include <gdn/string_name.h>
|
||||
|
||||
namespace pandemonium {
|
||||
|
||||
|
||||
class String;
|
||||
|
||||
@ -67,6 +67,6 @@ public:
|
||||
bool operator>=(const StringName &s) const;
|
||||
};
|
||||
|
||||
} // namespace pandemonium
|
||||
|
||||
|
||||
#endif // STRING_H
|
||||
|
@ -33,7 +33,7 @@
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
namespace pandemonium {
|
||||
|
||||
|
||||
namespace _TagDB {
|
||||
|
||||
@ -44,6 +44,6 @@ bool is_type_compatible(size_t type_tag, size_t base_type_tag);
|
||||
|
||||
} // namespace _TagDB
|
||||
|
||||
} // namespace pandemonium
|
||||
|
||||
|
||||
#endif // TAGDB_H
|
||||
|
@ -36,7 +36,7 @@
|
||||
#include "aabb.h"
|
||||
#include "plane.h"
|
||||
|
||||
namespace pandemonium {
|
||||
|
||||
|
||||
class Transform {
|
||||
public:
|
||||
@ -116,6 +116,6 @@ public:
|
||||
inline Transform() {}
|
||||
};
|
||||
|
||||
} // namespace pandemonium
|
||||
|
||||
|
||||
#endif // TRANSFORM_H
|
||||
|
@ -33,7 +33,7 @@
|
||||
|
||||
#include "vector2.h"
|
||||
|
||||
namespace pandemonium {
|
||||
|
||||
|
||||
typedef Vector2 Size2;
|
||||
|
||||
@ -131,6 +131,6 @@ struct Transform2D {
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace pandemonium
|
||||
|
||||
|
||||
#endif // TRANSFORM2D_H
|
||||
|
@ -33,8 +33,6 @@
|
||||
|
||||
#include <gdn/string.h>
|
||||
|
||||
namespace pandemonium {
|
||||
|
||||
class NodePath;
|
||||
class Variant;
|
||||
class PoolByteArray;
|
||||
@ -193,6 +191,4 @@ public:
|
||||
String operator+(const char *a, const String &b);
|
||||
String operator+(const wchar_t *a, const String &b);
|
||||
|
||||
} // namespace pandemonium
|
||||
|
||||
#endif // STRING_H
|
||||
|
@ -43,12 +43,12 @@
|
||||
#include "pool_arrays.h"
|
||||
#include "projection.h"
|
||||
#include "quaternion.h"
|
||||
#include "rid.h"
|
||||
#include "rect2.h"
|
||||
#include "rect2i.h"
|
||||
#include "ustring.h"
|
||||
#include "rid.h"
|
||||
#include "transform.h"
|
||||
#include "transform_2d.h"
|
||||
#include "ustring.h"
|
||||
#include "vector2.h"
|
||||
#include "vector2i.h"
|
||||
#include "vector3.h"
|
||||
@ -56,8 +56,6 @@
|
||||
#include "vector4.h"
|
||||
#include "vector4i.h"
|
||||
|
||||
namespace pandemonium {
|
||||
|
||||
class Dictionary;
|
||||
|
||||
class Array;
|
||||
@ -213,7 +211,7 @@ public:
|
||||
|
||||
Variant(const Plane &p_plane);
|
||||
|
||||
Variant(const pandemonium::AABB &p_aabb);
|
||||
Variant(const ::AABB &p_aabb);
|
||||
|
||||
Variant(const Quaternion &p_quaternion);
|
||||
|
||||
@ -229,7 +227,7 @@ public:
|
||||
|
||||
Variant(const NodePath &p_path);
|
||||
|
||||
Variant(const pandemonium::RID &p_rid);
|
||||
Variant(const ::RID &p_rid);
|
||||
|
||||
Variant(const Object *p_object);
|
||||
|
||||
@ -279,7 +277,7 @@ public:
|
||||
operator Vector4() const;
|
||||
operator Vector4i() const;
|
||||
operator Plane() const;
|
||||
operator pandemonium::AABB() const;
|
||||
operator ::AABB() const;
|
||||
operator Quaternion() const;
|
||||
operator Basis() const;
|
||||
operator Transform() const;
|
||||
@ -289,7 +287,7 @@ public:
|
||||
operator Color() const;
|
||||
|
||||
operator NodePath() const;
|
||||
operator pandemonium::RID() const;
|
||||
operator ::RID() const;
|
||||
operator pandemonium_object *() const;
|
||||
|
||||
template <typename T>
|
||||
@ -331,6 +329,4 @@ public:
|
||||
~Variant();
|
||||
};
|
||||
|
||||
} // namespace pandemonium
|
||||
|
||||
#endif // VARIANT_H
|
||||
|
@ -37,7 +37,7 @@
|
||||
|
||||
#include <math_funcs.h>
|
||||
|
||||
namespace pandemonium {
|
||||
|
||||
|
||||
class String;
|
||||
|
||||
@ -301,6 +301,6 @@ inline Vector2 polar2cartesian(Vector2 v) {
|
||||
|
||||
} // namespace Math
|
||||
|
||||
} // namespace pandemonium
|
||||
|
||||
|
||||
#endif // VECTOR2_H
|
||||
|
@ -37,7 +37,7 @@
|
||||
|
||||
#include <math_funcs.h>
|
||||
|
||||
namespace pandemonium {
|
||||
|
||||
|
||||
class String;
|
||||
|
||||
@ -64,6 +64,6 @@ struct Vector2i {
|
||||
operator String() const;
|
||||
};
|
||||
|
||||
} // namespace pandemonium
|
||||
|
||||
|
||||
#endif // VECTOR2_H
|
||||
|
@ -37,7 +37,7 @@
|
||||
|
||||
#include <math_funcs.h>
|
||||
|
||||
namespace pandemonium {
|
||||
|
||||
|
||||
class Basis;
|
||||
class String;
|
||||
@ -336,6 +336,6 @@ inline Vector3 vec3_cross(const Vector3 &p_a, const Vector3 &p_b) {
|
||||
return p_a.cross(p_b);
|
||||
}
|
||||
|
||||
} // namespace pandemonium
|
||||
|
||||
|
||||
#endif // VECTOR3_H
|
||||
|
@ -37,7 +37,7 @@
|
||||
|
||||
#include <math_funcs.h>
|
||||
|
||||
namespace pandemonium {
|
||||
|
||||
|
||||
class String;
|
||||
|
||||
@ -67,6 +67,6 @@ struct Vector3i {
|
||||
operator String() const;
|
||||
};
|
||||
|
||||
} // namespace pandemonium
|
||||
|
||||
|
||||
#endif // VECTOR2_H
|
||||
|
@ -37,7 +37,7 @@
|
||||
|
||||
#include <math_funcs.h>
|
||||
|
||||
namespace pandemonium {
|
||||
|
||||
|
||||
class String;
|
||||
|
||||
@ -70,6 +70,6 @@ struct Vector4 {
|
||||
operator String() const;
|
||||
};
|
||||
|
||||
} // namespace pandemonium
|
||||
|
||||
|
||||
#endif // VECTOR2_H
|
||||
|
@ -37,8 +37,6 @@
|
||||
|
||||
#include <math_funcs.h>
|
||||
|
||||
namespace pandemonium {
|
||||
|
||||
class String;
|
||||
|
||||
struct Vector4i {
|
||||
@ -70,6 +68,4 @@ struct Vector4i {
|
||||
operator String() const;
|
||||
};
|
||||
|
||||
} // namespace pandemonium
|
||||
|
||||
#endif // VECTOR2_H
|
||||
|
@ -33,8 +33,6 @@
|
||||
|
||||
#include <gdn/gdnative.h>
|
||||
|
||||
namespace pandemonium {
|
||||
|
||||
// This is an internal base class used by the bindings. You should not need to access its members.
|
||||
class _Wrapped {
|
||||
public:
|
||||
@ -42,6 +40,4 @@ public:
|
||||
size_t _type_tag;
|
||||
};
|
||||
|
||||
} // namespace pandemonium
|
||||
|
||||
#endif // WRAPPED_H
|
||||
|
@ -34,7 +34,7 @@
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
namespace pandemonium {
|
||||
|
||||
|
||||
bool AABB::intersects(const AABB &p_aabb) const {
|
||||
if (position.x >= (p_aabb.position.x + p_aabb.size.x))
|
||||
@ -601,4 +601,4 @@ AABB::operator String() const {
|
||||
return String() + position + " - " + size;
|
||||
}
|
||||
|
||||
} // namespace pandemonium
|
||||
|
||||
|
@ -35,54 +35,54 @@
|
||||
|
||||
#include <cstdlib>
|
||||
|
||||
namespace pandemonium {
|
||||
|
||||
|
||||
class Object;
|
||||
|
||||
Array::Array() {
|
||||
pandemonium::api->pandemonium_array_new(&_pandemonium_array);
|
||||
Pandemonium::api->pandemonium_array_new(&_pandemonium_array);
|
||||
}
|
||||
|
||||
Array::Array(const Array &other) {
|
||||
pandemonium::api->pandemonium_array_new_copy(&_pandemonium_array, &other._pandemonium_array);
|
||||
Pandemonium::api->pandemonium_array_new_copy(&_pandemonium_array, &other._pandemonium_array);
|
||||
}
|
||||
|
||||
Array &Array::operator=(const Array &other) {
|
||||
pandemonium::api->pandemonium_array_destroy(&_pandemonium_array);
|
||||
pandemonium::api->pandemonium_array_new_copy(&_pandemonium_array, &other._pandemonium_array);
|
||||
Pandemonium::api->pandemonium_array_destroy(&_pandemonium_array);
|
||||
Pandemonium::api->pandemonium_array_new_copy(&_pandemonium_array, &other._pandemonium_array);
|
||||
return *this;
|
||||
}
|
||||
|
||||
Array::Array(const PoolByteArray &a) {
|
||||
pandemonium::api->pandemonium_array_new_pool_byte_array(&_pandemonium_array, (pandemonium_pool_byte_array *)&a);
|
||||
Pandemonium::api->pandemonium_array_new_pool_byte_array(&_pandemonium_array, (pandemonium_pool_byte_array *)&a);
|
||||
}
|
||||
|
||||
Array::Array(const PoolIntArray &a) {
|
||||
pandemonium::api->pandemonium_array_new_pool_int_array(&_pandemonium_array, (pandemonium_pool_int_array *)&a);
|
||||
Pandemonium::api->pandemonium_array_new_pool_int_array(&_pandemonium_array, (pandemonium_pool_int_array *)&a);
|
||||
}
|
||||
|
||||
Array::Array(const PoolRealArray &a) {
|
||||
pandemonium::api->pandemonium_array_new_pool_real_array(&_pandemonium_array, (pandemonium_pool_real_array *)&a);
|
||||
Pandemonium::api->pandemonium_array_new_pool_real_array(&_pandemonium_array, (pandemonium_pool_real_array *)&a);
|
||||
}
|
||||
|
||||
Array::Array(const PoolStringArray &a) {
|
||||
pandemonium::api->pandemonium_array_new_pool_string_array(&_pandemonium_array, (pandemonium_pool_string_array *)&a);
|
||||
Pandemonium::api->pandemonium_array_new_pool_string_array(&_pandemonium_array, (pandemonium_pool_string_array *)&a);
|
||||
}
|
||||
|
||||
Array::Array(const PoolVector2Array &a) {
|
||||
pandemonium::api->pandemonium_array_new_pool_vector2_array(&_pandemonium_array, (pandemonium_pool_vector2_array *)&a);
|
||||
Pandemonium::api->pandemonium_array_new_pool_vector2_array(&_pandemonium_array, (pandemonium_pool_vector2_array *)&a);
|
||||
}
|
||||
|
||||
Array::Array(const PoolVector3Array &a) {
|
||||
pandemonium::api->pandemonium_array_new_pool_vector3_array(&_pandemonium_array, (pandemonium_pool_vector3_array *)&a);
|
||||
Pandemonium::api->pandemonium_array_new_pool_vector3_array(&_pandemonium_array, (pandemonium_pool_vector3_array *)&a);
|
||||
}
|
||||
|
||||
Array::Array(const PoolColorArray &a) {
|
||||
pandemonium::api->pandemonium_array_new_pool_color_array(&_pandemonium_array, (pandemonium_pool_color_array *)&a);
|
||||
Pandemonium::api->pandemonium_array_new_pool_color_array(&_pandemonium_array, (pandemonium_pool_color_array *)&a);
|
||||
}
|
||||
|
||||
Variant &Array::operator[](const int idx) {
|
||||
pandemonium_variant *v = pandemonium::api->pandemonium_array_operator_index(&_pandemonium_array, idx);
|
||||
pandemonium_variant *v = Pandemonium::api->pandemonium_array_operator_index(&_pandemonium_array, idx);
|
||||
// We assume it's ok to reinterpret because the value is a pointer whose data is already owned by the array,
|
||||
// so can return a reference without constructing a Variant
|
||||
return *reinterpret_cast<Variant *>(v);
|
||||
@ -91,137 +91,137 @@ Variant &Array::operator[](const int idx) {
|
||||
const Variant &Array::operator[](const int idx) const {
|
||||
// Yes, I'm casting away the const... you can hate me now.
|
||||
// since the result is
|
||||
pandemonium_variant *v = pandemonium::api->pandemonium_array_operator_index((pandemonium_array *)&_pandemonium_array, idx);
|
||||
pandemonium_variant *v = Pandemonium::api->pandemonium_array_operator_index((pandemonium_array *)&_pandemonium_array, idx);
|
||||
return *reinterpret_cast<const Variant *>(v);
|
||||
}
|
||||
|
||||
void Array::append(const Variant &v) {
|
||||
pandemonium::api->pandemonium_array_append(&_pandemonium_array, (pandemonium_variant *)&v);
|
||||
Pandemonium::api->pandemonium_array_append(&_pandemonium_array, (pandemonium_variant *)&v);
|
||||
}
|
||||
|
||||
void Array::clear() {
|
||||
pandemonium::api->pandemonium_array_clear(&_pandemonium_array);
|
||||
Pandemonium::api->pandemonium_array_clear(&_pandemonium_array);
|
||||
}
|
||||
|
||||
int Array::count(const Variant &v) {
|
||||
return pandemonium::api->pandemonium_array_count(&_pandemonium_array, (pandemonium_variant *)&v);
|
||||
return Pandemonium::api->pandemonium_array_count(&_pandemonium_array, (pandemonium_variant *)&v);
|
||||
}
|
||||
|
||||
bool Array::empty() const {
|
||||
return pandemonium::api->pandemonium_array_empty(&_pandemonium_array);
|
||||
return Pandemonium::api->pandemonium_array_empty(&_pandemonium_array);
|
||||
}
|
||||
|
||||
void Array::erase(const Variant &v) {
|
||||
pandemonium::api->pandemonium_array_erase(&_pandemonium_array, (pandemonium_variant *)&v);
|
||||
Pandemonium::api->pandemonium_array_erase(&_pandemonium_array, (pandemonium_variant *)&v);
|
||||
}
|
||||
|
||||
Variant Array::front() const {
|
||||
pandemonium_variant v = pandemonium::api->pandemonium_array_front(&_pandemonium_array);
|
||||
pandemonium_variant v = Pandemonium::api->pandemonium_array_front(&_pandemonium_array);
|
||||
return Variant(v);
|
||||
}
|
||||
|
||||
Variant Array::back() const {
|
||||
pandemonium_variant v = pandemonium::api->pandemonium_array_back(&_pandemonium_array);
|
||||
pandemonium_variant v = Pandemonium::api->pandemonium_array_back(&_pandemonium_array);
|
||||
return Variant(v);
|
||||
}
|
||||
|
||||
int Array::find(const Variant &what, const int from) const {
|
||||
return pandemonium::api->pandemonium_array_find_from(&_pandemonium_array, (pandemonium_variant *)&what, from);
|
||||
return Pandemonium::api->pandemonium_array_find_from(&_pandemonium_array, (pandemonium_variant *)&what, from);
|
||||
}
|
||||
|
||||
int Array::find_last(const Variant &what) const {
|
||||
return pandemonium::api->pandemonium_array_find_last(&_pandemonium_array, (pandemonium_variant *)&what);
|
||||
return Pandemonium::api->pandemonium_array_find_last(&_pandemonium_array, (pandemonium_variant *)&what);
|
||||
}
|
||||
|
||||
bool Array::has(const Variant &what) const {
|
||||
return pandemonium::api->pandemonium_array_has(&_pandemonium_array, (pandemonium_variant *)&what);
|
||||
return Pandemonium::api->pandemonium_array_has(&_pandemonium_array, (pandemonium_variant *)&what);
|
||||
}
|
||||
|
||||
uint32_t Array::hash() const {
|
||||
return pandemonium::api->pandemonium_array_hash(&_pandemonium_array);
|
||||
return Pandemonium::api->pandemonium_array_hash(&_pandemonium_array);
|
||||
}
|
||||
|
||||
void Array::insert(const int pos, const Variant &value) {
|
||||
pandemonium::api->pandemonium_array_insert(&_pandemonium_array, pos, (pandemonium_variant *)&value);
|
||||
Pandemonium::api->pandemonium_array_insert(&_pandemonium_array, pos, (pandemonium_variant *)&value);
|
||||
}
|
||||
|
||||
void Array::invert() {
|
||||
pandemonium::api->pandemonium_array_invert(&_pandemonium_array);
|
||||
Pandemonium::api->pandemonium_array_invert(&_pandemonium_array);
|
||||
}
|
||||
|
||||
Variant Array::pop_back() {
|
||||
pandemonium_variant v = pandemonium::api->pandemonium_array_pop_back(&_pandemonium_array);
|
||||
pandemonium_variant v = Pandemonium::api->pandemonium_array_pop_back(&_pandemonium_array);
|
||||
return Variant(v);
|
||||
}
|
||||
|
||||
Variant Array::pop_front() {
|
||||
pandemonium_variant v = pandemonium::api->pandemonium_array_pop_front(&_pandemonium_array);
|
||||
pandemonium_variant v = Pandemonium::api->pandemonium_array_pop_front(&_pandemonium_array);
|
||||
return Variant(v);
|
||||
}
|
||||
|
||||
void Array::push_back(const Variant &v) {
|
||||
pandemonium::api->pandemonium_array_push_back(&_pandemonium_array, (pandemonium_variant *)&v);
|
||||
Pandemonium::api->pandemonium_array_push_back(&_pandemonium_array, (pandemonium_variant *)&v);
|
||||
}
|
||||
|
||||
void Array::push_front(const Variant &v) {
|
||||
pandemonium::api->pandemonium_array_push_front(&_pandemonium_array, (pandemonium_variant *)&v);
|
||||
Pandemonium::api->pandemonium_array_push_front(&_pandemonium_array, (pandemonium_variant *)&v);
|
||||
}
|
||||
|
||||
void Array::remove(const int idx) {
|
||||
pandemonium::api->pandemonium_array_remove(&_pandemonium_array, idx);
|
||||
Pandemonium::api->pandemonium_array_remove(&_pandemonium_array, idx);
|
||||
}
|
||||
|
||||
int Array::size() const {
|
||||
return pandemonium::api->pandemonium_array_size(&_pandemonium_array);
|
||||
return Pandemonium::api->pandemonium_array_size(&_pandemonium_array);
|
||||
}
|
||||
|
||||
void Array::resize(const int size) {
|
||||
pandemonium::api->pandemonium_array_resize(&_pandemonium_array, size);
|
||||
Pandemonium::api->pandemonium_array_resize(&_pandemonium_array, size);
|
||||
}
|
||||
|
||||
int Array::rfind(const Variant &what, const int from) const {
|
||||
return pandemonium::api->pandemonium_array_rfind_from(&_pandemonium_array, (pandemonium_variant *)&what, from);
|
||||
return Pandemonium::api->pandemonium_array_rfind_from(&_pandemonium_array, (pandemonium_variant *)&what, from);
|
||||
}
|
||||
|
||||
void Array::sort() {
|
||||
pandemonium::api->pandemonium_array_sort(&_pandemonium_array);
|
||||
Pandemonium::api->pandemonium_array_sort(&_pandemonium_array);
|
||||
}
|
||||
|
||||
void Array::sort_custom(Object *obj, const String &func) {
|
||||
pandemonium::api->pandemonium_array_sort_custom(&_pandemonium_array, (pandemonium_object *)obj, (pandemonium_string *)&func);
|
||||
Pandemonium::api->pandemonium_array_sort_custom(&_pandemonium_array, (pandemonium_object *)obj, (pandemonium_string *)&func);
|
||||
}
|
||||
|
||||
int Array::bsearch(const Variant &value, const bool before) {
|
||||
return pandemonium::api->pandemonium_array_bsearch(&_pandemonium_array, (pandemonium_variant *)&value, before);
|
||||
return Pandemonium::api->pandemonium_array_bsearch(&_pandemonium_array, (pandemonium_variant *)&value, before);
|
||||
}
|
||||
|
||||
int Array::bsearch_custom(const Variant &value, const Object *obj,
|
||||
const String &func, const bool before) {
|
||||
return pandemonium::api->pandemonium_array_bsearch_custom(&_pandemonium_array, (pandemonium_variant *)&value,
|
||||
return Pandemonium::api->pandemonium_array_bsearch_custom(&_pandemonium_array, (pandemonium_variant *)&value,
|
||||
(pandemonium_object *)obj, (pandemonium_string *)&func, before);
|
||||
}
|
||||
|
||||
Array Array::duplicate(const bool deep) const {
|
||||
pandemonium_array arr = pandemonium::api->pandemonium_array_duplicate_deep(&_pandemonium_array, deep);
|
||||
pandemonium_array arr = Pandemonium::api->pandemonium_array_duplicate_deep(&_pandemonium_array, deep);
|
||||
return Array(arr);
|
||||
}
|
||||
|
||||
Variant Array::max() const {
|
||||
pandemonium_variant v = pandemonium::api->pandemonium_array_max(&_pandemonium_array);
|
||||
pandemonium_variant v = Pandemonium::api->pandemonium_array_max(&_pandemonium_array);
|
||||
return Variant(v);
|
||||
}
|
||||
|
||||
Variant Array::min() const {
|
||||
pandemonium_variant v = pandemonium::api->pandemonium_array_min(&_pandemonium_array);
|
||||
pandemonium_variant v = Pandemonium::api->pandemonium_array_min(&_pandemonium_array);
|
||||
return Variant(v);
|
||||
}
|
||||
|
||||
void Array::shuffle() {
|
||||
pandemonium::api->pandemonium_array_shuffle(&_pandemonium_array);
|
||||
Pandemonium::api->pandemonium_array_shuffle(&_pandemonium_array);
|
||||
}
|
||||
|
||||
Array::~Array() {
|
||||
pandemonium::api->pandemonium_array_destroy(&_pandemonium_array);
|
||||
Pandemonium::api->pandemonium_array_destroy(&_pandemonium_array);
|
||||
}
|
||||
|
||||
} // namespace pandemonium
|
||||
|
||||
|
@ -35,7 +35,7 @@
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
namespace pandemonium {
|
||||
|
||||
|
||||
const Basis Basis::IDENTITY = Basis();
|
||||
const Basis Basis::FLIP_X = Basis(-1, 0, 0, 0, 1, 0, 0, 0, 1);
|
||||
@ -634,11 +634,11 @@ Basis::Basis(const Vector3 &p_euler) {
|
||||
set_euler(p_euler);
|
||||
}
|
||||
|
||||
} // namespace pandemonium
|
||||
|
||||
|
||||
#include "quaternion.h"
|
||||
|
||||
namespace pandemonium {
|
||||
|
||||
|
||||
Basis::Basis(const Quaternion &p_quaternion) {
|
||||
real_t d = p_quaternion.length_squared();
|
||||
@ -707,4 +707,4 @@ Basis::operator Quaternion() const {
|
||||
return Quaternion(temp[0], temp[1], temp[2], temp[3]);
|
||||
}
|
||||
|
||||
} // namespace pandemonium
|
||||
|
||||
|
@ -35,7 +35,7 @@
|
||||
#include <gdn/color.h>
|
||||
#include <cmath>
|
||||
|
||||
namespace pandemonium {
|
||||
|
||||
|
||||
#define MIN(a, b) (a < b ? a : b)
|
||||
#define MAX(a, b) (a > b ? a : b)
|
||||
@ -652,4 +652,4 @@ Color Color::operator-() const {
|
||||
1.0 - a);
|
||||
}
|
||||
|
||||
} // namespace pandemonium
|
||||
|
||||
|
@ -33,78 +33,78 @@
|
||||
#include "pandemonium_global.h"
|
||||
#include "variant.h"
|
||||
|
||||
namespace pandemonium {
|
||||
|
||||
|
||||
Dictionary::Dictionary() {
|
||||
pandemonium::api->pandemonium_dictionary_new(&_pandemonium_dictionary);
|
||||
Pandemonium::api->pandemonium_dictionary_new(&_pandemonium_dictionary);
|
||||
}
|
||||
|
||||
Dictionary::Dictionary(const Dictionary &other) {
|
||||
pandemonium::api->pandemonium_dictionary_new_copy(&_pandemonium_dictionary, &other._pandemonium_dictionary);
|
||||
Pandemonium::api->pandemonium_dictionary_new_copy(&_pandemonium_dictionary, &other._pandemonium_dictionary);
|
||||
}
|
||||
|
||||
Dictionary &Dictionary::operator=(const Dictionary &other) {
|
||||
pandemonium::api->pandemonium_dictionary_destroy(&_pandemonium_dictionary);
|
||||
pandemonium::api->pandemonium_dictionary_new_copy(&_pandemonium_dictionary, &other._pandemonium_dictionary);
|
||||
Pandemonium::api->pandemonium_dictionary_destroy(&_pandemonium_dictionary);
|
||||
Pandemonium::api->pandemonium_dictionary_new_copy(&_pandemonium_dictionary, &other._pandemonium_dictionary);
|
||||
return *this;
|
||||
}
|
||||
|
||||
void Dictionary::clear() {
|
||||
pandemonium::api->pandemonium_dictionary_clear(&_pandemonium_dictionary);
|
||||
Pandemonium::api->pandemonium_dictionary_clear(&_pandemonium_dictionary);
|
||||
}
|
||||
|
||||
bool Dictionary::empty() const {
|
||||
return pandemonium::api->pandemonium_dictionary_empty(&_pandemonium_dictionary);
|
||||
return Pandemonium::api->pandemonium_dictionary_empty(&_pandemonium_dictionary);
|
||||
}
|
||||
|
||||
void Dictionary::erase(const Variant &key) {
|
||||
pandemonium::api->pandemonium_dictionary_erase(&_pandemonium_dictionary, (pandemonium_variant *)&key);
|
||||
Pandemonium::api->pandemonium_dictionary_erase(&_pandemonium_dictionary, (pandemonium_variant *)&key);
|
||||
}
|
||||
|
||||
bool Dictionary::has(const Variant &key) const {
|
||||
return pandemonium::api->pandemonium_dictionary_has(&_pandemonium_dictionary, (pandemonium_variant *)&key);
|
||||
return Pandemonium::api->pandemonium_dictionary_has(&_pandemonium_dictionary, (pandemonium_variant *)&key);
|
||||
}
|
||||
|
||||
bool Dictionary::has_all(const Array &keys) const {
|
||||
return pandemonium::api->pandemonium_dictionary_has_all(&_pandemonium_dictionary, (pandemonium_array *)&keys);
|
||||
return Pandemonium::api->pandemonium_dictionary_has_all(&_pandemonium_dictionary, (pandemonium_array *)&keys);
|
||||
}
|
||||
|
||||
uint32_t Dictionary::hash() const {
|
||||
return pandemonium::api->pandemonium_dictionary_hash(&_pandemonium_dictionary);
|
||||
return Pandemonium::api->pandemonium_dictionary_hash(&_pandemonium_dictionary);
|
||||
}
|
||||
|
||||
Array Dictionary::keys() const {
|
||||
pandemonium_array a = pandemonium::api->pandemonium_dictionary_keys(&_pandemonium_dictionary);
|
||||
pandemonium_array a = Pandemonium::api->pandemonium_dictionary_keys(&_pandemonium_dictionary);
|
||||
return Array(a);
|
||||
}
|
||||
|
||||
Variant &Dictionary::operator[](const Variant &key) {
|
||||
pandemonium_variant *v = pandemonium::api->pandemonium_dictionary_operator_index(&_pandemonium_dictionary, (pandemonium_variant *)&key);
|
||||
pandemonium_variant *v = Pandemonium::api->pandemonium_dictionary_operator_index(&_pandemonium_dictionary, (pandemonium_variant *)&key);
|
||||
return *reinterpret_cast<Variant *>(v);
|
||||
}
|
||||
|
||||
const Variant &Dictionary::operator[](const Variant &key) const {
|
||||
// oops I did it again
|
||||
pandemonium_variant *v = pandemonium::api->pandemonium_dictionary_operator_index((pandemonium_dictionary *)&_pandemonium_dictionary, (pandemonium_variant *)&key);
|
||||
pandemonium_variant *v = Pandemonium::api->pandemonium_dictionary_operator_index((pandemonium_dictionary *)&_pandemonium_dictionary, (pandemonium_variant *)&key);
|
||||
return *reinterpret_cast<Variant *>(v);
|
||||
}
|
||||
|
||||
int Dictionary::size() const {
|
||||
return pandemonium::api->pandemonium_dictionary_size(&_pandemonium_dictionary);
|
||||
return Pandemonium::api->pandemonium_dictionary_size(&_pandemonium_dictionary);
|
||||
}
|
||||
|
||||
String Dictionary::to_json() const {
|
||||
pandemonium_string s = pandemonium::api->pandemonium_dictionary_to_json(&_pandemonium_dictionary);
|
||||
pandemonium_string s = Pandemonium::api->pandemonium_dictionary_to_json(&_pandemonium_dictionary);
|
||||
return String(s);
|
||||
}
|
||||
|
||||
Array Dictionary::values() const {
|
||||
pandemonium_array a = pandemonium::api->pandemonium_dictionary_values(&_pandemonium_dictionary);
|
||||
pandemonium_array a = Pandemonium::api->pandemonium_dictionary_values(&_pandemonium_dictionary);
|
||||
return Array(a);
|
||||
}
|
||||
|
||||
Dictionary::~Dictionary() {
|
||||
pandemonium::api->pandemonium_dictionary_destroy(&_pandemonium_dictionary);
|
||||
Pandemonium::api->pandemonium_dictionary_destroy(&_pandemonium_dictionary);
|
||||
}
|
||||
|
||||
} // namespace pandemonium
|
||||
|
||||
|
@ -34,81 +34,81 @@
|
||||
|
||||
#include <gdn/node_path.h>
|
||||
|
||||
namespace pandemonium {
|
||||
|
||||
|
||||
NodePath::NodePath() {
|
||||
String from = "";
|
||||
pandemonium::api->pandemonium_node_path_new(&_node_path, (pandemonium_string *)&from);
|
||||
Pandemonium::api->pandemonium_node_path_new(&_node_path, (pandemonium_string *)&from);
|
||||
}
|
||||
|
||||
NodePath::NodePath(const NodePath &other) {
|
||||
String from = other;
|
||||
pandemonium::api->pandemonium_node_path_new(&_node_path, (pandemonium_string *)&from);
|
||||
Pandemonium::api->pandemonium_node_path_new(&_node_path, (pandemonium_string *)&from);
|
||||
}
|
||||
|
||||
NodePath::NodePath(const String &from) {
|
||||
pandemonium::api->pandemonium_node_path_new(&_node_path, (pandemonium_string *)&from);
|
||||
Pandemonium::api->pandemonium_node_path_new(&_node_path, (pandemonium_string *)&from);
|
||||
}
|
||||
|
||||
NodePath::NodePath(const char *contents) {
|
||||
String from = contents;
|
||||
pandemonium::api->pandemonium_node_path_new(&_node_path, (pandemonium_string *)&from);
|
||||
Pandemonium::api->pandemonium_node_path_new(&_node_path, (pandemonium_string *)&from);
|
||||
}
|
||||
|
||||
String NodePath::get_name(const int idx) const {
|
||||
pandemonium_string str = pandemonium::api->pandemonium_node_path_get_name(&_node_path, idx);
|
||||
pandemonium_string str = Pandemonium::api->pandemonium_node_path_get_name(&_node_path, idx);
|
||||
return String(str);
|
||||
}
|
||||
|
||||
int NodePath::get_name_count() const {
|
||||
return pandemonium::api->pandemonium_node_path_get_name_count(&_node_path);
|
||||
return Pandemonium::api->pandemonium_node_path_get_name_count(&_node_path);
|
||||
}
|
||||
|
||||
String NodePath::get_subname(const int idx) const {
|
||||
pandemonium_string str = pandemonium::api->pandemonium_node_path_get_subname(&_node_path, idx);
|
||||
pandemonium_string str = Pandemonium::api->pandemonium_node_path_get_subname(&_node_path, idx);
|
||||
return String(str);
|
||||
}
|
||||
|
||||
int NodePath::get_subname_count() const {
|
||||
return pandemonium::api->pandemonium_node_path_get_subname_count(&_node_path);
|
||||
return Pandemonium::api->pandemonium_node_path_get_subname_count(&_node_path);
|
||||
}
|
||||
|
||||
bool NodePath::is_absolute() const {
|
||||
return pandemonium::api->pandemonium_node_path_is_absolute(&_node_path);
|
||||
return Pandemonium::api->pandemonium_node_path_is_absolute(&_node_path);
|
||||
}
|
||||
|
||||
bool NodePath::is_empty() const {
|
||||
return pandemonium::api->pandemonium_node_path_is_empty(&_node_path);
|
||||
return Pandemonium::api->pandemonium_node_path_is_empty(&_node_path);
|
||||
}
|
||||
|
||||
NodePath NodePath::get_as_property_path() const {
|
||||
pandemonium_node_path path = pandemonium::api->pandemonium_node_path_get_as_property_path(&_node_path);
|
||||
pandemonium_node_path path = Pandemonium::api->pandemonium_node_path_get_as_property_path(&_node_path);
|
||||
return NodePath(path);
|
||||
}
|
||||
String NodePath::get_concatenated_subnames() const {
|
||||
pandemonium_string str = pandemonium::api->pandemonium_node_path_get_concatenated_subnames(&_node_path);
|
||||
pandemonium_string str = Pandemonium::api->pandemonium_node_path_get_concatenated_subnames(&_node_path);
|
||||
return String(str);
|
||||
}
|
||||
|
||||
NodePath::operator String() const {
|
||||
pandemonium_string str = pandemonium::api->pandemonium_node_path_as_string(&_node_path);
|
||||
pandemonium_string str = Pandemonium::api->pandemonium_node_path_as_string(&_node_path);
|
||||
return String(str);
|
||||
}
|
||||
|
||||
bool NodePath::operator==(const NodePath &other) {
|
||||
return pandemonium::api->pandemonium_node_path_operator_equal(&_node_path, &other._node_path);
|
||||
return Pandemonium::api->pandemonium_node_path_operator_equal(&_node_path, &other._node_path);
|
||||
}
|
||||
|
||||
void NodePath::operator=(const NodePath &other) {
|
||||
pandemonium::api->pandemonium_node_path_destroy(&_node_path);
|
||||
Pandemonium::api->pandemonium_node_path_destroy(&_node_path);
|
||||
|
||||
String other_string = (String)other;
|
||||
|
||||
pandemonium::api->pandemonium_node_path_new(&_node_path, (pandemonium_string *)&other_string);
|
||||
Pandemonium::api->pandemonium_node_path_new(&_node_path, (pandemonium_string *)&other_string);
|
||||
}
|
||||
|
||||
NodePath::~NodePath() {
|
||||
pandemonium::api->pandemonium_node_path_destroy(&_node_path);
|
||||
Pandemonium::api->pandemonium_node_path_destroy(&_node_path);
|
||||
}
|
||||
|
||||
} // namespace pandemonium
|
||||
|
||||
|
@ -36,7 +36,7 @@
|
||||
#include "wrapped.h"
|
||||
|
||||
static GDCALLINGCONV void *wrapper_create(void *data, const void *type_tag, pandemonium_object *instance) {
|
||||
pandemonium::_Wrapped *wrapper_memory = (pandemonium::_Wrapped *)pandemonium::api->pandemonium_alloc(sizeof(pandemonium::_Wrapped));
|
||||
_Wrapped *wrapper_memory = (_Wrapped *)Pandemonium::api->pandemonium_alloc(sizeof(_Wrapped));
|
||||
|
||||
if (!wrapper_memory)
|
||||
return NULL;
|
||||
@ -48,10 +48,10 @@ static GDCALLINGCONV void *wrapper_create(void *data, const void *type_tag, pand
|
||||
|
||||
static GDCALLINGCONV void wrapper_destroy(void *data, void *wrapper) {
|
||||
if (wrapper)
|
||||
pandemonium::api->pandemonium_free(wrapper);
|
||||
Pandemonium::api->pandemonium_free(wrapper);
|
||||
}
|
||||
|
||||
namespace pandemonium {
|
||||
|
||||
|
||||
void *_RegisterState::nativescript_handle;
|
||||
int _RegisterState::language_index;
|
||||
@ -67,7 +67,7 @@ const pandemonium_gdnative_ext_net_api_struct *net_api = nullptr;
|
||||
const void *gdnlib = NULL;
|
||||
|
||||
void Pandemonium::print(const String &message) {
|
||||
pandemonium::api->pandemonium_print((pandemonium_string *)&message);
|
||||
Pandemonium::api->pandemonium_print((pandemonium_string *)&message);
|
||||
}
|
||||
|
||||
void Pandemonium::print_warning(const String &description, const String &function, const String &file, int line) {
|
||||
@ -78,15 +78,15 @@ void Pandemonium::print_warning(const String &description, const String &functio
|
||||
char *c_file = file.alloc_c_string();
|
||||
|
||||
if (c_desc != nullptr && c_func != nullptr && c_file != nullptr) {
|
||||
pandemonium::api->pandemonium_print_warning(c_desc, c_func, c_file, line);
|
||||
Pandemonium::api->pandemonium_print_warning(c_desc, c_func, c_file, line);
|
||||
};
|
||||
|
||||
if (c_desc != nullptr)
|
||||
pandemonium::api->pandemonium_free(c_desc);
|
||||
Pandemonium::api->pandemonium_free(c_desc);
|
||||
if (c_func != nullptr)
|
||||
pandemonium::api->pandemonium_free(c_func);
|
||||
Pandemonium::api->pandemonium_free(c_func);
|
||||
if (c_file != nullptr)
|
||||
pandemonium::api->pandemonium_free(c_file);
|
||||
Pandemonium::api->pandemonium_free(c_file);
|
||||
}
|
||||
|
||||
void Pandemonium::print_error(const String &description, const String &function, const String &file, int line) {
|
||||
@ -97,49 +97,49 @@ void Pandemonium::print_error(const String &description, const String &function,
|
||||
char *c_file = file.alloc_c_string();
|
||||
|
||||
if (c_desc != nullptr && c_func != nullptr && c_file != nullptr) {
|
||||
pandemonium::api->pandemonium_print_error(c_desc, c_func, c_file, line);
|
||||
Pandemonium::api->pandemonium_print_error(c_desc, c_func, c_file, line);
|
||||
};
|
||||
|
||||
if (c_desc != nullptr)
|
||||
pandemonium::api->pandemonium_free(c_desc);
|
||||
Pandemonium::api->pandemonium_free(c_desc);
|
||||
if (c_func != nullptr)
|
||||
pandemonium::api->pandemonium_free(c_func);
|
||||
Pandemonium::api->pandemonium_free(c_func);
|
||||
if (c_file != nullptr)
|
||||
pandemonium::api->pandemonium_free(c_file);
|
||||
Pandemonium::api->pandemonium_free(c_file);
|
||||
}
|
||||
|
||||
void ___register_types();
|
||||
void ___init_method_bindings();
|
||||
|
||||
void Pandemonium::gdnative_init(pandemonium_gdnative_init_options *options) {
|
||||
pandemonium::api = options->api_struct;
|
||||
pandemonium::gdnlib = options->gd_native_library;
|
||||
Pandemonium::api = options->api_struct;
|
||||
Pandemonium::gdnlib = options->gd_native_library;
|
||||
|
||||
const pandemonium_gdnative_api_struct *core_extension = pandemonium::api->next;
|
||||
const pandemonium_gdnative_api_struct *core_extension = Pandemonium::api->next;
|
||||
|
||||
/*
|
||||
while (core_extension) {
|
||||
if (core_extension->version.major == 1 && core_extension->version.minor == 1) {
|
||||
pandemonium::core_1_1_api = (const pandemonium_gdnative_core_1_1_api_struct *)core_extension;
|
||||
Pandemonium::core_1_1_api = (const pandemonium_gdnative_core_1_1_api_struct *)core_extension;
|
||||
} else if (core_extension->version.major == 1 && core_extension->version.minor == 2) {
|
||||
pandemonium::core_1_2_api = (const pandemonium_gdnative_core_1_2_api_struct *)core_extension;
|
||||
Pandemonium::core_1_2_api = (const pandemonium_gdnative_core_1_2_api_struct *)core_extension;
|
||||
}
|
||||
core_extension = core_extension->next;
|
||||
}
|
||||
*/
|
||||
|
||||
// now find our extensions
|
||||
for (int i = 0; i < pandemonium::api->num_extensions; i++) {
|
||||
switch (pandemonium::api->extensions[i]->type) {
|
||||
for (int i = 0; i < Pandemonium::api->num_extensions; i++) {
|
||||
switch (Pandemonium::api->extensions[i]->type) {
|
||||
case GDNATIVE_EXT_NATIVESCRIPT: {
|
||||
pandemonium::nativescript_api = (const pandemonium_gdnative_ext_nativescript_api_struct *)pandemonium::api->extensions[i];
|
||||
Pandemonium::nativescript_api = (const pandemonium_gdnative_ext_nativescript_api_struct *)Pandemonium::api->extensions[i];
|
||||
|
||||
/*
|
||||
const pandemonium_gdnative_api_struct *extension = pandemonium::nativescript_api->next;
|
||||
const pandemonium_gdnative_api_struct *extension = Pandemonium::nativescript_api->next;
|
||||
|
||||
while (extension) {
|
||||
if (extension->version.major == 1 && extension->version.minor == 1) {
|
||||
//pandemonium::nativescript_1_1_api = (const pandemonium_gdnative_ext_nativescript_1_1_api_struct *)extension;
|
||||
//Pandemonium::nativescript_1_1_api = (const pandemonium_gdnative_ext_nativescript_1_1_api_struct *)extension;
|
||||
}
|
||||
|
||||
extension = extension->next;
|
||||
@ -147,23 +147,23 @@ void Pandemonium::gdnative_init(pandemonium_gdnative_init_options *options) {
|
||||
*/
|
||||
} break;
|
||||
case GDNATIVE_EXT_PLUGINSCRIPT: {
|
||||
pandemonium::pluginscript_api = (const pandemonium_gdnative_ext_pluginscript_api_struct *)pandemonium::api->extensions[i];
|
||||
Pandemonium::pluginscript_api = (const pandemonium_gdnative_ext_pluginscript_api_struct *)Pandemonium::api->extensions[i];
|
||||
} break;
|
||||
case GDNATIVE_EXT_ANDROID: {
|
||||
pandemonium::android_api = (const pandemonium_gdnative_ext_android_api_struct *)pandemonium::api->extensions[i];
|
||||
Pandemonium::android_api = (const pandemonium_gdnative_ext_android_api_struct *)Pandemonium::api->extensions[i];
|
||||
} break;
|
||||
case GDNATIVE_EXT_VIDEODECODER: {
|
||||
pandemonium::videodecoder_api = (const pandemonium_gdnative_ext_videodecoder_api_struct *)pandemonium::api->extensions[i];
|
||||
Pandemonium::videodecoder_api = (const pandemonium_gdnative_ext_videodecoder_api_struct *)Pandemonium::api->extensions[i];
|
||||
} break;
|
||||
case GDNATIVE_EXT_NET: {
|
||||
pandemonium::net_api = (const pandemonium_gdnative_ext_net_api_struct *)pandemonium::api->extensions[i];
|
||||
Pandemonium::net_api = (const pandemonium_gdnative_ext_net_api_struct *)Pandemonium::api->extensions[i];
|
||||
|
||||
/*
|
||||
const pandemonium_gdnative_api_struct *extension = pandemonium::net_api->next;
|
||||
const pandemonium_gdnative_api_struct *extension = Pandemonium::net_api->next;
|
||||
|
||||
while (extension) {
|
||||
if (extension->version.major == 3 && extension->version.minor == 2) {
|
||||
pandemonium::net_3_2_api = (const pandemonium_gdnative_ext_net_3_2_api_struct *)extension;
|
||||
Pandemonium::net_3_2_api = (const pandemonium_gdnative_ext_net_3_2_api_struct *)extension;
|
||||
}
|
||||
|
||||
extension = extension->next;
|
||||
@ -181,7 +181,7 @@ void Pandemonium::gdnative_init(pandemonium_gdnative_init_options *options) {
|
||||
binding_funcs.alloc_instance_binding_data = wrapper_create;
|
||||
binding_funcs.free_instance_binding_data = wrapper_destroy;
|
||||
|
||||
pandemonium::_RegisterState::language_index = pandemonium::nativescript_api->pandemonium_nativescript_register_instance_binding_data_functions(binding_funcs);
|
||||
_RegisterState::language_index = Pandemonium::nativescript_api->pandemonium_nativescript_register_instance_binding_data_functions(binding_funcs);
|
||||
|
||||
// register these now
|
||||
___register_types();
|
||||
@ -193,15 +193,15 @@ void Pandemonium::gdnative_terminate(pandemonium_gdnative_terminate_options *opt
|
||||
}
|
||||
|
||||
void Pandemonium::gdnative_profiling_add_data(const char *p_signature, uint64_t p_time) {
|
||||
pandemonium::nativescript_api->pandemonium_nativescript_profiling_add_data(p_signature, p_time);
|
||||
Pandemonium::nativescript_api->pandemonium_nativescript_profiling_add_data(p_signature, p_time);
|
||||
}
|
||||
|
||||
void Pandemonium::nativescript_init(void *handle) {
|
||||
pandemonium::_RegisterState::nativescript_handle = handle;
|
||||
_RegisterState::nativescript_handle = handle;
|
||||
}
|
||||
|
||||
void Pandemonium::nativescript_terminate(void *handle) {
|
||||
pandemonium::nativescript_api->pandemonium_nativescript_unregister_instance_binding_data_functions(pandemonium::_RegisterState::language_index);
|
||||
Pandemonium::nativescript_api->pandemonium_nativescript_unregister_instance_binding_data_functions(_RegisterState::language_index);
|
||||
}
|
||||
|
||||
} // namespace pandemonium
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
#include <cstdio>
|
||||
|
||||
namespace pandemonium {
|
||||
|
||||
|
||||
FunctionProfiling::FunctionProfiling(const char *p_function, const int p_line) {
|
||||
snprintf(signature, 1024, "::%d::%s", p_line, p_function);
|
||||
@ -19,4 +19,3 @@ FunctionProfiling::~FunctionProfiling() {
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace pandemonium
|
@ -34,7 +34,7 @@
|
||||
|
||||
#include <cmath>
|
||||
|
||||
namespace pandemonium {
|
||||
|
||||
|
||||
void Plane::set_normal(const Vector3 &p_normal) {
|
||||
this->normal = p_normal;
|
||||
@ -201,4 +201,4 @@ bool Plane::operator!=(const Plane &p_plane) const {
|
||||
return normal != p_plane.normal || d != p_plane.d;
|
||||
}
|
||||
|
||||
} // namespace pandemonium
|
||||
|
||||
|
@ -39,610 +39,610 @@
|
||||
|
||||
#include <gdn/pool_arrays.h>
|
||||
|
||||
namespace pandemonium {
|
||||
|
||||
|
||||
PoolByteArray::PoolByteArray() {
|
||||
pandemonium::api->pandemonium_pool_byte_array_new(&_pandemonium_array);
|
||||
Pandemonium::api->pandemonium_pool_byte_array_new(&_pandemonium_array);
|
||||
}
|
||||
|
||||
PoolByteArray::PoolByteArray(const PoolByteArray &p_other) {
|
||||
pandemonium::api->pandemonium_pool_byte_array_new_copy(&_pandemonium_array, &p_other._pandemonium_array);
|
||||
Pandemonium::api->pandemonium_pool_byte_array_new_copy(&_pandemonium_array, &p_other._pandemonium_array);
|
||||
}
|
||||
|
||||
PoolByteArray &PoolByteArray::operator=(const PoolByteArray &p_other) {
|
||||
pandemonium::api->pandemonium_pool_byte_array_destroy(&_pandemonium_array);
|
||||
pandemonium::api->pandemonium_pool_byte_array_new_copy(&_pandemonium_array, &p_other._pandemonium_array);
|
||||
Pandemonium::api->pandemonium_pool_byte_array_destroy(&_pandemonium_array);
|
||||
Pandemonium::api->pandemonium_pool_byte_array_new_copy(&_pandemonium_array, &p_other._pandemonium_array);
|
||||
return *this;
|
||||
}
|
||||
|
||||
PoolByteArray::PoolByteArray(const Array &array) {
|
||||
pandemonium::api->pandemonium_pool_byte_array_new_with_array(&_pandemonium_array, (pandemonium_array *)&array);
|
||||
Pandemonium::api->pandemonium_pool_byte_array_new_with_array(&_pandemonium_array, (pandemonium_array *)&array);
|
||||
}
|
||||
|
||||
PoolByteArray::Read PoolByteArray::read() const {
|
||||
Read read;
|
||||
read._read_access = pandemonium::api->pandemonium_pool_byte_array_read(&_pandemonium_array);
|
||||
read._read_access = Pandemonium::api->pandemonium_pool_byte_array_read(&_pandemonium_array);
|
||||
return read;
|
||||
}
|
||||
|
||||
PoolByteArray::Write PoolByteArray::write() {
|
||||
Write write;
|
||||
write._write_access = pandemonium::api->pandemonium_pool_byte_array_write(&_pandemonium_array);
|
||||
write._write_access = Pandemonium::api->pandemonium_pool_byte_array_write(&_pandemonium_array);
|
||||
return write;
|
||||
}
|
||||
|
||||
void PoolByteArray::append(const uint8_t data) {
|
||||
pandemonium::api->pandemonium_pool_byte_array_append(&_pandemonium_array, data);
|
||||
Pandemonium::api->pandemonium_pool_byte_array_append(&_pandemonium_array, data);
|
||||
}
|
||||
|
||||
void PoolByteArray::append_array(const PoolByteArray &array) {
|
||||
pandemonium::api->pandemonium_pool_byte_array_append_array(&_pandemonium_array, &array._pandemonium_array);
|
||||
Pandemonium::api->pandemonium_pool_byte_array_append_array(&_pandemonium_array, &array._pandemonium_array);
|
||||
}
|
||||
|
||||
int PoolByteArray::insert(const int idx, const uint8_t data) {
|
||||
return pandemonium::api->pandemonium_pool_byte_array_insert(&_pandemonium_array, idx, data);
|
||||
return Pandemonium::api->pandemonium_pool_byte_array_insert(&_pandemonium_array, idx, data);
|
||||
}
|
||||
|
||||
void PoolByteArray::invert() {
|
||||
pandemonium::api->pandemonium_pool_byte_array_invert(&_pandemonium_array);
|
||||
Pandemonium::api->pandemonium_pool_byte_array_invert(&_pandemonium_array);
|
||||
}
|
||||
|
||||
void PoolByteArray::push_back(const uint8_t data) {
|
||||
pandemonium::api->pandemonium_pool_byte_array_push_back(&_pandemonium_array, data);
|
||||
Pandemonium::api->pandemonium_pool_byte_array_push_back(&_pandemonium_array, data);
|
||||
}
|
||||
|
||||
void PoolByteArray::remove(const int idx) {
|
||||
pandemonium::api->pandemonium_pool_byte_array_remove(&_pandemonium_array, idx);
|
||||
Pandemonium::api->pandemonium_pool_byte_array_remove(&_pandemonium_array, idx);
|
||||
}
|
||||
|
||||
void PoolByteArray::resize(const int size) {
|
||||
pandemonium::api->pandemonium_pool_byte_array_resize(&_pandemonium_array, size);
|
||||
Pandemonium::api->pandemonium_pool_byte_array_resize(&_pandemonium_array, size);
|
||||
}
|
||||
|
||||
void PoolByteArray::set(const int idx, const uint8_t data) {
|
||||
pandemonium::api->pandemonium_pool_byte_array_set(&_pandemonium_array, idx, data);
|
||||
Pandemonium::api->pandemonium_pool_byte_array_set(&_pandemonium_array, idx, data);
|
||||
}
|
||||
|
||||
uint8_t PoolByteArray::operator[](const int idx) {
|
||||
return pandemonium::api->pandemonium_pool_byte_array_get(&_pandemonium_array, idx);
|
||||
return Pandemonium::api->pandemonium_pool_byte_array_get(&_pandemonium_array, idx);
|
||||
}
|
||||
|
||||
int PoolByteArray::size() const {
|
||||
return pandemonium::api->pandemonium_pool_byte_array_size(&_pandemonium_array);
|
||||
return Pandemonium::api->pandemonium_pool_byte_array_size(&_pandemonium_array);
|
||||
}
|
||||
|
||||
PoolByteArray::~PoolByteArray() {
|
||||
pandemonium::api->pandemonium_pool_byte_array_destroy(&_pandemonium_array);
|
||||
Pandemonium::api->pandemonium_pool_byte_array_destroy(&_pandemonium_array);
|
||||
}
|
||||
|
||||
PoolIntArray::PoolIntArray() {
|
||||
pandemonium::api->pandemonium_pool_int_array_new(&_pandemonium_array);
|
||||
Pandemonium::api->pandemonium_pool_int_array_new(&_pandemonium_array);
|
||||
}
|
||||
|
||||
PoolIntArray::PoolIntArray(const PoolIntArray &p_other) {
|
||||
pandemonium::api->pandemonium_pool_int_array_new_copy(&_pandemonium_array, &p_other._pandemonium_array);
|
||||
Pandemonium::api->pandemonium_pool_int_array_new_copy(&_pandemonium_array, &p_other._pandemonium_array);
|
||||
}
|
||||
|
||||
PoolIntArray &PoolIntArray::operator=(const PoolIntArray &p_other) {
|
||||
pandemonium::api->pandemonium_pool_int_array_destroy(&_pandemonium_array);
|
||||
pandemonium::api->pandemonium_pool_int_array_new_copy(&_pandemonium_array, &p_other._pandemonium_array);
|
||||
Pandemonium::api->pandemonium_pool_int_array_destroy(&_pandemonium_array);
|
||||
Pandemonium::api->pandemonium_pool_int_array_new_copy(&_pandemonium_array, &p_other._pandemonium_array);
|
||||
return *this;
|
||||
}
|
||||
|
||||
PoolIntArray::PoolIntArray(const Array &array) {
|
||||
pandemonium::api->pandemonium_pool_int_array_new_with_array(&_pandemonium_array, (pandemonium_array *)&array);
|
||||
Pandemonium::api->pandemonium_pool_int_array_new_with_array(&_pandemonium_array, (pandemonium_array *)&array);
|
||||
}
|
||||
|
||||
PoolIntArray::Read PoolIntArray::read() const {
|
||||
Read read;
|
||||
read._read_access = pandemonium::api->pandemonium_pool_int_array_read(&_pandemonium_array);
|
||||
read._read_access = Pandemonium::api->pandemonium_pool_int_array_read(&_pandemonium_array);
|
||||
return read;
|
||||
}
|
||||
|
||||
PoolIntArray::Write PoolIntArray::write() {
|
||||
Write write;
|
||||
write._write_access = pandemonium::api->pandemonium_pool_int_array_write(&_pandemonium_array);
|
||||
write._write_access = Pandemonium::api->pandemonium_pool_int_array_write(&_pandemonium_array);
|
||||
return write;
|
||||
}
|
||||
|
||||
void PoolIntArray::append(const int data) {
|
||||
pandemonium::api->pandemonium_pool_int_array_append(&_pandemonium_array, data);
|
||||
Pandemonium::api->pandemonium_pool_int_array_append(&_pandemonium_array, data);
|
||||
}
|
||||
|
||||
void PoolIntArray::append_array(const PoolIntArray &array) {
|
||||
pandemonium::api->pandemonium_pool_int_array_append_array(&_pandemonium_array, &array._pandemonium_array);
|
||||
Pandemonium::api->pandemonium_pool_int_array_append_array(&_pandemonium_array, &array._pandemonium_array);
|
||||
}
|
||||
|
||||
int PoolIntArray::insert(const int idx, const int data) {
|
||||
return pandemonium::api->pandemonium_pool_int_array_insert(&_pandemonium_array, idx, data);
|
||||
return Pandemonium::api->pandemonium_pool_int_array_insert(&_pandemonium_array, idx, data);
|
||||
}
|
||||
|
||||
void PoolIntArray::invert() {
|
||||
pandemonium::api->pandemonium_pool_int_array_invert(&_pandemonium_array);
|
||||
Pandemonium::api->pandemonium_pool_int_array_invert(&_pandemonium_array);
|
||||
}
|
||||
|
||||
void PoolIntArray::push_back(const int data) {
|
||||
pandemonium::api->pandemonium_pool_int_array_push_back(&_pandemonium_array, data);
|
||||
Pandemonium::api->pandemonium_pool_int_array_push_back(&_pandemonium_array, data);
|
||||
}
|
||||
|
||||
void PoolIntArray::remove(const int idx) {
|
||||
pandemonium::api->pandemonium_pool_int_array_remove(&_pandemonium_array, idx);
|
||||
Pandemonium::api->pandemonium_pool_int_array_remove(&_pandemonium_array, idx);
|
||||
}
|
||||
|
||||
void PoolIntArray::resize(const int size) {
|
||||
pandemonium::api->pandemonium_pool_int_array_resize(&_pandemonium_array, size);
|
||||
Pandemonium::api->pandemonium_pool_int_array_resize(&_pandemonium_array, size);
|
||||
}
|
||||
|
||||
void PoolIntArray::set(const int idx, const int data) {
|
||||
pandemonium::api->pandemonium_pool_int_array_set(&_pandemonium_array, idx, data);
|
||||
Pandemonium::api->pandemonium_pool_int_array_set(&_pandemonium_array, idx, data);
|
||||
}
|
||||
|
||||
int PoolIntArray::operator[](const int idx) {
|
||||
return pandemonium::api->pandemonium_pool_int_array_get(&_pandemonium_array, idx);
|
||||
return Pandemonium::api->pandemonium_pool_int_array_get(&_pandemonium_array, idx);
|
||||
}
|
||||
|
||||
int PoolIntArray::size() const {
|
||||
return pandemonium::api->pandemonium_pool_int_array_size(&_pandemonium_array);
|
||||
return Pandemonium::api->pandemonium_pool_int_array_size(&_pandemonium_array);
|
||||
}
|
||||
|
||||
PoolIntArray::~PoolIntArray() {
|
||||
pandemonium::api->pandemonium_pool_int_array_destroy(&_pandemonium_array);
|
||||
Pandemonium::api->pandemonium_pool_int_array_destroy(&_pandemonium_array);
|
||||
}
|
||||
|
||||
PoolRealArray::PoolRealArray() {
|
||||
pandemonium::api->pandemonium_pool_real_array_new(&_pandemonium_array);
|
||||
Pandemonium::api->pandemonium_pool_real_array_new(&_pandemonium_array);
|
||||
}
|
||||
|
||||
PoolRealArray::PoolRealArray(const PoolRealArray &p_other) {
|
||||
pandemonium::api->pandemonium_pool_real_array_new_copy(&_pandemonium_array, &p_other._pandemonium_array);
|
||||
Pandemonium::api->pandemonium_pool_real_array_new_copy(&_pandemonium_array, &p_other._pandemonium_array);
|
||||
}
|
||||
|
||||
PoolRealArray &PoolRealArray::operator=(const PoolRealArray &p_other) {
|
||||
pandemonium::api->pandemonium_pool_real_array_destroy(&_pandemonium_array);
|
||||
pandemonium::api->pandemonium_pool_real_array_new_copy(&_pandemonium_array, &p_other._pandemonium_array);
|
||||
Pandemonium::api->pandemonium_pool_real_array_destroy(&_pandemonium_array);
|
||||
Pandemonium::api->pandemonium_pool_real_array_new_copy(&_pandemonium_array, &p_other._pandemonium_array);
|
||||
return *this;
|
||||
}
|
||||
|
||||
PoolRealArray::Read PoolRealArray::read() const {
|
||||
Read read;
|
||||
read._read_access = pandemonium::api->pandemonium_pool_real_array_read(&_pandemonium_array);
|
||||
read._read_access = Pandemonium::api->pandemonium_pool_real_array_read(&_pandemonium_array);
|
||||
return read;
|
||||
}
|
||||
|
||||
PoolRealArray::Write PoolRealArray::write() {
|
||||
Write write;
|
||||
write._write_access = pandemonium::api->pandemonium_pool_real_array_write(&_pandemonium_array);
|
||||
write._write_access = Pandemonium::api->pandemonium_pool_real_array_write(&_pandemonium_array);
|
||||
return write;
|
||||
}
|
||||
|
||||
PoolRealArray::PoolRealArray(const Array &array) {
|
||||
pandemonium::api->pandemonium_pool_real_array_new_with_array(&_pandemonium_array, (pandemonium_array *)&array);
|
||||
Pandemonium::api->pandemonium_pool_real_array_new_with_array(&_pandemonium_array, (pandemonium_array *)&array);
|
||||
}
|
||||
|
||||
void PoolRealArray::append(const real_t data) {
|
||||
pandemonium::api->pandemonium_pool_real_array_append(&_pandemonium_array, data);
|
||||
Pandemonium::api->pandemonium_pool_real_array_append(&_pandemonium_array, data);
|
||||
}
|
||||
|
||||
void PoolRealArray::append_array(const PoolRealArray &array) {
|
||||
pandemonium::api->pandemonium_pool_real_array_append_array(&_pandemonium_array, &array._pandemonium_array);
|
||||
Pandemonium::api->pandemonium_pool_real_array_append_array(&_pandemonium_array, &array._pandemonium_array);
|
||||
}
|
||||
|
||||
int PoolRealArray::insert(const int idx, const real_t data) {
|
||||
return pandemonium::api->pandemonium_pool_real_array_insert(&_pandemonium_array, idx, data);
|
||||
return Pandemonium::api->pandemonium_pool_real_array_insert(&_pandemonium_array, idx, data);
|
||||
}
|
||||
|
||||
void PoolRealArray::invert() {
|
||||
pandemonium::api->pandemonium_pool_real_array_invert(&_pandemonium_array);
|
||||
Pandemonium::api->pandemonium_pool_real_array_invert(&_pandemonium_array);
|
||||
}
|
||||
|
||||
void PoolRealArray::push_back(const real_t data) {
|
||||
pandemonium::api->pandemonium_pool_real_array_push_back(&_pandemonium_array, data);
|
||||
Pandemonium::api->pandemonium_pool_real_array_push_back(&_pandemonium_array, data);
|
||||
}
|
||||
|
||||
void PoolRealArray::remove(const int idx) {
|
||||
pandemonium::api->pandemonium_pool_real_array_remove(&_pandemonium_array, idx);
|
||||
Pandemonium::api->pandemonium_pool_real_array_remove(&_pandemonium_array, idx);
|
||||
}
|
||||
|
||||
void PoolRealArray::resize(const int size) {
|
||||
pandemonium::api->pandemonium_pool_real_array_resize(&_pandemonium_array, size);
|
||||
Pandemonium::api->pandemonium_pool_real_array_resize(&_pandemonium_array, size);
|
||||
}
|
||||
|
||||
void PoolRealArray::set(const int idx, const real_t data) {
|
||||
pandemonium::api->pandemonium_pool_real_array_set(&_pandemonium_array, idx, data);
|
||||
Pandemonium::api->pandemonium_pool_real_array_set(&_pandemonium_array, idx, data);
|
||||
}
|
||||
|
||||
real_t PoolRealArray::operator[](const int idx) {
|
||||
return pandemonium::api->pandemonium_pool_real_array_get(&_pandemonium_array, idx);
|
||||
return Pandemonium::api->pandemonium_pool_real_array_get(&_pandemonium_array, idx);
|
||||
}
|
||||
|
||||
int PoolRealArray::size() const {
|
||||
return pandemonium::api->pandemonium_pool_real_array_size(&_pandemonium_array);
|
||||
return Pandemonium::api->pandemonium_pool_real_array_size(&_pandemonium_array);
|
||||
}
|
||||
|
||||
PoolRealArray::~PoolRealArray() {
|
||||
pandemonium::api->pandemonium_pool_real_array_destroy(&_pandemonium_array);
|
||||
Pandemonium::api->pandemonium_pool_real_array_destroy(&_pandemonium_array);
|
||||
}
|
||||
|
||||
PoolStringArray::PoolStringArray() {
|
||||
pandemonium::api->pandemonium_pool_string_array_new(&_pandemonium_array);
|
||||
Pandemonium::api->pandemonium_pool_string_array_new(&_pandemonium_array);
|
||||
}
|
||||
|
||||
PoolStringArray::PoolStringArray(const PoolStringArray &p_other) {
|
||||
pandemonium::api->pandemonium_pool_string_array_new_copy(&_pandemonium_array, &p_other._pandemonium_array);
|
||||
Pandemonium::api->pandemonium_pool_string_array_new_copy(&_pandemonium_array, &p_other._pandemonium_array);
|
||||
}
|
||||
|
||||
PoolStringArray &PoolStringArray::operator=(const PoolStringArray &p_other) {
|
||||
pandemonium::api->pandemonium_pool_string_array_destroy(&_pandemonium_array);
|
||||
pandemonium::api->pandemonium_pool_string_array_new_copy(&_pandemonium_array, &p_other._pandemonium_array);
|
||||
Pandemonium::api->pandemonium_pool_string_array_destroy(&_pandemonium_array);
|
||||
Pandemonium::api->pandemonium_pool_string_array_new_copy(&_pandemonium_array, &p_other._pandemonium_array);
|
||||
return *this;
|
||||
}
|
||||
|
||||
PoolStringArray::PoolStringArray(const Array &array) {
|
||||
pandemonium::api->pandemonium_pool_string_array_new_with_array(&_pandemonium_array, (pandemonium_array *)&array);
|
||||
Pandemonium::api->pandemonium_pool_string_array_new_with_array(&_pandemonium_array, (pandemonium_array *)&array);
|
||||
}
|
||||
|
||||
PoolStringArray::Read PoolStringArray::read() const {
|
||||
Read read;
|
||||
read._read_access = pandemonium::api->pandemonium_pool_string_array_read(&_pandemonium_array);
|
||||
read._read_access = Pandemonium::api->pandemonium_pool_string_array_read(&_pandemonium_array);
|
||||
return read;
|
||||
}
|
||||
|
||||
PoolStringArray::Write PoolStringArray::write() {
|
||||
Write write;
|
||||
write._write_access = pandemonium::api->pandemonium_pool_string_array_write(&_pandemonium_array);
|
||||
write._write_access = Pandemonium::api->pandemonium_pool_string_array_write(&_pandemonium_array);
|
||||
return write;
|
||||
}
|
||||
|
||||
void PoolStringArray::append(const String &data) {
|
||||
pandemonium::api->pandemonium_pool_string_array_append(&_pandemonium_array, (pandemonium_string *)&data);
|
||||
Pandemonium::api->pandemonium_pool_string_array_append(&_pandemonium_array, (pandemonium_string *)&data);
|
||||
}
|
||||
|
||||
void PoolStringArray::append_array(const PoolStringArray &array) {
|
||||
pandemonium::api->pandemonium_pool_string_array_append_array(&_pandemonium_array, &array._pandemonium_array);
|
||||
Pandemonium::api->pandemonium_pool_string_array_append_array(&_pandemonium_array, &array._pandemonium_array);
|
||||
}
|
||||
|
||||
int PoolStringArray::insert(const int idx, const String &data) {
|
||||
return pandemonium::api->pandemonium_pool_string_array_insert(&_pandemonium_array, idx, (pandemonium_string *)&data);
|
||||
return Pandemonium::api->pandemonium_pool_string_array_insert(&_pandemonium_array, idx, (pandemonium_string *)&data);
|
||||
}
|
||||
|
||||
void PoolStringArray::invert() {
|
||||
pandemonium::api->pandemonium_pool_string_array_invert(&_pandemonium_array);
|
||||
Pandemonium::api->pandemonium_pool_string_array_invert(&_pandemonium_array);
|
||||
}
|
||||
|
||||
void PoolStringArray::push_back(const String &data) {
|
||||
pandemonium::api->pandemonium_pool_string_array_push_back(&_pandemonium_array, (pandemonium_string *)&data);
|
||||
Pandemonium::api->pandemonium_pool_string_array_push_back(&_pandemonium_array, (pandemonium_string *)&data);
|
||||
}
|
||||
|
||||
void PoolStringArray::remove(const int idx) {
|
||||
pandemonium::api->pandemonium_pool_string_array_remove(&_pandemonium_array, idx);
|
||||
Pandemonium::api->pandemonium_pool_string_array_remove(&_pandemonium_array, idx);
|
||||
}
|
||||
|
||||
void PoolStringArray::resize(const int size) {
|
||||
pandemonium::api->pandemonium_pool_string_array_resize(&_pandemonium_array, size);
|
||||
Pandemonium::api->pandemonium_pool_string_array_resize(&_pandemonium_array, size);
|
||||
}
|
||||
|
||||
void PoolStringArray::set(const int idx, const String &data) {
|
||||
pandemonium::api->pandemonium_pool_string_array_set(&_pandemonium_array, idx, (pandemonium_string *)&data);
|
||||
Pandemonium::api->pandemonium_pool_string_array_set(&_pandemonium_array, idx, (pandemonium_string *)&data);
|
||||
}
|
||||
|
||||
const String PoolStringArray::operator[](const int idx) {
|
||||
String s;
|
||||
pandemonium_string str = pandemonium::api->pandemonium_pool_string_array_get(&_pandemonium_array, idx);
|
||||
pandemonium::api->pandemonium_string_new_copy((pandemonium_string *)&s, &str);
|
||||
pandemonium::api->pandemonium_string_destroy(&str);
|
||||
pandemonium_string str = Pandemonium::api->pandemonium_pool_string_array_get(&_pandemonium_array, idx);
|
||||
Pandemonium::api->pandemonium_string_new_copy((pandemonium_string *)&s, &str);
|
||||
Pandemonium::api->pandemonium_string_destroy(&str);
|
||||
return s;
|
||||
}
|
||||
|
||||
int PoolStringArray::size() const {
|
||||
return pandemonium::api->pandemonium_pool_string_array_size(&_pandemonium_array);
|
||||
return Pandemonium::api->pandemonium_pool_string_array_size(&_pandemonium_array);
|
||||
}
|
||||
|
||||
PoolStringArray::~PoolStringArray() {
|
||||
pandemonium::api->pandemonium_pool_string_array_destroy(&_pandemonium_array);
|
||||
Pandemonium::api->pandemonium_pool_string_array_destroy(&_pandemonium_array);
|
||||
}
|
||||
|
||||
PoolVector2Array::PoolVector2Array() {
|
||||
pandemonium::api->pandemonium_pool_vector2_array_new(&_pandemonium_array);
|
||||
Pandemonium::api->pandemonium_pool_vector2_array_new(&_pandemonium_array);
|
||||
}
|
||||
|
||||
PoolVector2Array::PoolVector2Array(const PoolVector2Array &p_other) {
|
||||
pandemonium::api->pandemonium_pool_vector2_array_new_copy(&_pandemonium_array, &p_other._pandemonium_array);
|
||||
Pandemonium::api->pandemonium_pool_vector2_array_new_copy(&_pandemonium_array, &p_other._pandemonium_array);
|
||||
}
|
||||
|
||||
PoolVector2Array &PoolVector2Array::operator=(const PoolVector2Array &p_other) {
|
||||
pandemonium::api->pandemonium_pool_vector2_array_destroy(&_pandemonium_array);
|
||||
pandemonium::api->pandemonium_pool_vector2_array_new_copy(&_pandemonium_array, &p_other._pandemonium_array);
|
||||
Pandemonium::api->pandemonium_pool_vector2_array_destroy(&_pandemonium_array);
|
||||
Pandemonium::api->pandemonium_pool_vector2_array_new_copy(&_pandemonium_array, &p_other._pandemonium_array);
|
||||
return *this;
|
||||
}
|
||||
|
||||
PoolVector2Array::PoolVector2Array(const Array &array) {
|
||||
pandemonium::api->pandemonium_pool_vector2_array_new_with_array(&_pandemonium_array, (pandemonium_array *)&array);
|
||||
Pandemonium::api->pandemonium_pool_vector2_array_new_with_array(&_pandemonium_array, (pandemonium_array *)&array);
|
||||
}
|
||||
|
||||
PoolVector2Array::Read PoolVector2Array::read() const {
|
||||
Read read;
|
||||
read._read_access = pandemonium::api->pandemonium_pool_vector2_array_read(&_pandemonium_array);
|
||||
read._read_access = Pandemonium::api->pandemonium_pool_vector2_array_read(&_pandemonium_array);
|
||||
return read;
|
||||
}
|
||||
|
||||
PoolVector2Array::Write PoolVector2Array::write() {
|
||||
Write write;
|
||||
write._write_access = pandemonium::api->pandemonium_pool_vector2_array_write(&_pandemonium_array);
|
||||
write._write_access = Pandemonium::api->pandemonium_pool_vector2_array_write(&_pandemonium_array);
|
||||
return write;
|
||||
}
|
||||
|
||||
void PoolVector2Array::append(const Vector2 &data) {
|
||||
pandemonium::api->pandemonium_pool_vector2_array_append(&_pandemonium_array, (pandemonium_vector2 *)&data);
|
||||
Pandemonium::api->pandemonium_pool_vector2_array_append(&_pandemonium_array, (pandemonium_vector2 *)&data);
|
||||
}
|
||||
|
||||
void PoolVector2Array::append_array(const PoolVector2Array &array) {
|
||||
pandemonium::api->pandemonium_pool_vector2_array_append_array(&_pandemonium_array, &array._pandemonium_array);
|
||||
Pandemonium::api->pandemonium_pool_vector2_array_append_array(&_pandemonium_array, &array._pandemonium_array);
|
||||
}
|
||||
|
||||
int PoolVector2Array::insert(const int idx, const Vector2 &data) {
|
||||
return pandemonium::api->pandemonium_pool_vector2_array_insert(&_pandemonium_array, idx, (pandemonium_vector2 *)&data);
|
||||
return Pandemonium::api->pandemonium_pool_vector2_array_insert(&_pandemonium_array, idx, (pandemonium_vector2 *)&data);
|
||||
}
|
||||
|
||||
void PoolVector2Array::invert() {
|
||||
pandemonium::api->pandemonium_pool_vector2_array_invert(&_pandemonium_array);
|
||||
Pandemonium::api->pandemonium_pool_vector2_array_invert(&_pandemonium_array);
|
||||
}
|
||||
|
||||
void PoolVector2Array::push_back(const Vector2 &data) {
|
||||
pandemonium::api->pandemonium_pool_vector2_array_push_back(&_pandemonium_array, (pandemonium_vector2 *)&data);
|
||||
Pandemonium::api->pandemonium_pool_vector2_array_push_back(&_pandemonium_array, (pandemonium_vector2 *)&data);
|
||||
}
|
||||
|
||||
void PoolVector2Array::remove(const int idx) {
|
||||
pandemonium::api->pandemonium_pool_vector2_array_remove(&_pandemonium_array, idx);
|
||||
Pandemonium::api->pandemonium_pool_vector2_array_remove(&_pandemonium_array, idx);
|
||||
}
|
||||
|
||||
void PoolVector2Array::resize(const int size) {
|
||||
pandemonium::api->pandemonium_pool_vector2_array_resize(&_pandemonium_array, size);
|
||||
Pandemonium::api->pandemonium_pool_vector2_array_resize(&_pandemonium_array, size);
|
||||
}
|
||||
|
||||
void PoolVector2Array::set(const int idx, const Vector2 &data) {
|
||||
pandemonium::api->pandemonium_pool_vector2_array_set(&_pandemonium_array, idx, (pandemonium_vector2 *)&data);
|
||||
Pandemonium::api->pandemonium_pool_vector2_array_set(&_pandemonium_array, idx, (pandemonium_vector2 *)&data);
|
||||
}
|
||||
|
||||
const Vector2 PoolVector2Array::operator[](const int idx) {
|
||||
Vector2 v;
|
||||
*(pandemonium_vector2 *)&v = pandemonium::api->pandemonium_pool_vector2_array_get(&_pandemonium_array, idx);
|
||||
*(pandemonium_vector2 *)&v = Pandemonium::api->pandemonium_pool_vector2_array_get(&_pandemonium_array, idx);
|
||||
return v;
|
||||
}
|
||||
|
||||
int PoolVector2Array::size() const {
|
||||
return pandemonium::api->pandemonium_pool_vector2_array_size(&_pandemonium_array);
|
||||
return Pandemonium::api->pandemonium_pool_vector2_array_size(&_pandemonium_array);
|
||||
}
|
||||
|
||||
PoolVector2Array::~PoolVector2Array() {
|
||||
pandemonium::api->pandemonium_pool_vector2_array_destroy(&_pandemonium_array);
|
||||
Pandemonium::api->pandemonium_pool_vector2_array_destroy(&_pandemonium_array);
|
||||
}
|
||||
|
||||
PoolVector2iArray::PoolVector2iArray() {
|
||||
pandemonium::api->pandemonium_pool_vector2i_array_new(&_pandemonium_array);
|
||||
Pandemonium::api->pandemonium_pool_vector2i_array_new(&_pandemonium_array);
|
||||
}
|
||||
|
||||
PoolVector2iArray::PoolVector2iArray(const PoolVector2iArray &p_other) {
|
||||
pandemonium::api->pandemonium_pool_vector2i_array_new_copy(&_pandemonium_array, &p_other._pandemonium_array);
|
||||
Pandemonium::api->pandemonium_pool_vector2i_array_new_copy(&_pandemonium_array, &p_other._pandemonium_array);
|
||||
}
|
||||
|
||||
PoolVector2iArray &PoolVector2iArray::operator=(const PoolVector2iArray &p_other) {
|
||||
pandemonium::api->pandemonium_pool_vector2i_array_destroy(&_pandemonium_array);
|
||||
pandemonium::api->pandemonium_pool_vector2i_array_new_copy(&_pandemonium_array, &p_other._pandemonium_array);
|
||||
Pandemonium::api->pandemonium_pool_vector2i_array_destroy(&_pandemonium_array);
|
||||
Pandemonium::api->pandemonium_pool_vector2i_array_new_copy(&_pandemonium_array, &p_other._pandemonium_array);
|
||||
return *this;
|
||||
}
|
||||
|
||||
PoolVector2iArray::PoolVector2iArray(const Array &array) {
|
||||
pandemonium::api->pandemonium_pool_vector2i_array_new_with_array(&_pandemonium_array, (pandemonium_array *)&array);
|
||||
Pandemonium::api->pandemonium_pool_vector2i_array_new_with_array(&_pandemonium_array, (pandemonium_array *)&array);
|
||||
}
|
||||
|
||||
PoolVector2iArray::Read PoolVector2iArray::read() const {
|
||||
Read read;
|
||||
read._read_access = pandemonium::api->pandemonium_pool_vector2i_array_read(&_pandemonium_array);
|
||||
read._read_access = Pandemonium::api->pandemonium_pool_vector2i_array_read(&_pandemonium_array);
|
||||
return read;
|
||||
}
|
||||
|
||||
PoolVector2iArray::Write PoolVector2iArray::write() {
|
||||
Write write;
|
||||
write._write_access = pandemonium::api->pandemonium_pool_vector2i_array_write(&_pandemonium_array);
|
||||
write._write_access = Pandemonium::api->pandemonium_pool_vector2i_array_write(&_pandemonium_array);
|
||||
return write;
|
||||
}
|
||||
|
||||
void PoolVector2iArray::append(const Vector2i &data) {
|
||||
pandemonium::api->pandemonium_pool_vector2i_array_append(&_pandemonium_array, (pandemonium_vector2i *)&data);
|
||||
Pandemonium::api->pandemonium_pool_vector2i_array_append(&_pandemonium_array, (pandemonium_vector2i *)&data);
|
||||
}
|
||||
|
||||
void PoolVector2iArray::append_array(const PoolVector2iArray &array) {
|
||||
pandemonium::api->pandemonium_pool_vector2i_array_append_array(&_pandemonium_array, &array._pandemonium_array);
|
||||
Pandemonium::api->pandemonium_pool_vector2i_array_append_array(&_pandemonium_array, &array._pandemonium_array);
|
||||
}
|
||||
|
||||
int PoolVector2iArray::insert(const int idx, const Vector2i &data) {
|
||||
return pandemonium::api->pandemonium_pool_vector2i_array_insert(&_pandemonium_array, idx, (pandemonium_vector2i *)&data);
|
||||
return Pandemonium::api->pandemonium_pool_vector2i_array_insert(&_pandemonium_array, idx, (pandemonium_vector2i *)&data);
|
||||
}
|
||||
|
||||
void PoolVector2iArray::invert() {
|
||||
pandemonium::api->pandemonium_pool_vector2i_array_invert(&_pandemonium_array);
|
||||
Pandemonium::api->pandemonium_pool_vector2i_array_invert(&_pandemonium_array);
|
||||
}
|
||||
|
||||
void PoolVector2iArray::push_back(const Vector2i &data) {
|
||||
pandemonium::api->pandemonium_pool_vector2i_array_push_back(&_pandemonium_array, (pandemonium_vector2i *)&data);
|
||||
Pandemonium::api->pandemonium_pool_vector2i_array_push_back(&_pandemonium_array, (pandemonium_vector2i *)&data);
|
||||
}
|
||||
|
||||
void PoolVector2iArray::remove(const int idx) {
|
||||
pandemonium::api->pandemonium_pool_vector2i_array_remove(&_pandemonium_array, idx);
|
||||
Pandemonium::api->pandemonium_pool_vector2i_array_remove(&_pandemonium_array, idx);
|
||||
}
|
||||
|
||||
void PoolVector2iArray::resize(const int size) {
|
||||
pandemonium::api->pandemonium_pool_vector2i_array_resize(&_pandemonium_array, size);
|
||||
Pandemonium::api->pandemonium_pool_vector2i_array_resize(&_pandemonium_array, size);
|
||||
}
|
||||
|
||||
void PoolVector2iArray::set(const int idx, const Vector2i &data) {
|
||||
pandemonium::api->pandemonium_pool_vector2i_array_set(&_pandemonium_array, idx, (pandemonium_vector2i *)&data);
|
||||
Pandemonium::api->pandemonium_pool_vector2i_array_set(&_pandemonium_array, idx, (pandemonium_vector2i *)&data);
|
||||
}
|
||||
|
||||
const Vector2i PoolVector2iArray::operator[](const int idx) {
|
||||
Vector2i v;
|
||||
*(pandemonium_vector2i *)&v = pandemonium::api->pandemonium_pool_vector2i_array_get(&_pandemonium_array, idx);
|
||||
*(pandemonium_vector2i *)&v = Pandemonium::api->pandemonium_pool_vector2i_array_get(&_pandemonium_array, idx);
|
||||
return v;
|
||||
}
|
||||
|
||||
int PoolVector2iArray::size() const {
|
||||
return pandemonium::api->pandemonium_pool_vector2i_array_size(&_pandemonium_array);
|
||||
return Pandemonium::api->pandemonium_pool_vector2i_array_size(&_pandemonium_array);
|
||||
}
|
||||
|
||||
PoolVector2iArray::~PoolVector2iArray() {
|
||||
pandemonium::api->pandemonium_pool_vector2i_array_destroy(&_pandemonium_array);
|
||||
Pandemonium::api->pandemonium_pool_vector2i_array_destroy(&_pandemonium_array);
|
||||
}
|
||||
|
||||
PoolVector3Array::PoolVector3Array() {
|
||||
pandemonium::api->pandemonium_pool_vector3_array_new(&_pandemonium_array);
|
||||
Pandemonium::api->pandemonium_pool_vector3_array_new(&_pandemonium_array);
|
||||
}
|
||||
|
||||
PoolVector3Array::PoolVector3Array(const PoolVector3Array &p_other) {
|
||||
pandemonium::api->pandemonium_pool_vector3_array_new_copy(&_pandemonium_array, &p_other._pandemonium_array);
|
||||
Pandemonium::api->pandemonium_pool_vector3_array_new_copy(&_pandemonium_array, &p_other._pandemonium_array);
|
||||
}
|
||||
|
||||
PoolVector3Array &PoolVector3Array::operator=(const PoolVector3Array &p_other) {
|
||||
pandemonium::api->pandemonium_pool_vector3_array_destroy(&_pandemonium_array);
|
||||
pandemonium::api->pandemonium_pool_vector3_array_new_copy(&_pandemonium_array, &p_other._pandemonium_array);
|
||||
Pandemonium::api->pandemonium_pool_vector3_array_destroy(&_pandemonium_array);
|
||||
Pandemonium::api->pandemonium_pool_vector3_array_new_copy(&_pandemonium_array, &p_other._pandemonium_array);
|
||||
return *this;
|
||||
}
|
||||
|
||||
PoolVector3Array::PoolVector3Array(const Array &array) {
|
||||
pandemonium::api->pandemonium_pool_vector3_array_new_with_array(&_pandemonium_array, (pandemonium_array *)&array);
|
||||
Pandemonium::api->pandemonium_pool_vector3_array_new_with_array(&_pandemonium_array, (pandemonium_array *)&array);
|
||||
}
|
||||
|
||||
PoolVector3Array::Read PoolVector3Array::read() const {
|
||||
Read read;
|
||||
read._read_access = pandemonium::api->pandemonium_pool_vector3_array_read(&_pandemonium_array);
|
||||
read._read_access = Pandemonium::api->pandemonium_pool_vector3_array_read(&_pandemonium_array);
|
||||
return read;
|
||||
}
|
||||
|
||||
PoolVector3Array::Write PoolVector3Array::write() {
|
||||
Write write;
|
||||
write._write_access = pandemonium::api->pandemonium_pool_vector3_array_write(&_pandemonium_array);
|
||||
write._write_access = Pandemonium::api->pandemonium_pool_vector3_array_write(&_pandemonium_array);
|
||||
return write;
|
||||
}
|
||||
|
||||
void PoolVector3Array::append(const Vector3 &data) {
|
||||
pandemonium::api->pandemonium_pool_vector3_array_append(&_pandemonium_array, (pandemonium_vector3 *)&data);
|
||||
Pandemonium::api->pandemonium_pool_vector3_array_append(&_pandemonium_array, (pandemonium_vector3 *)&data);
|
||||
}
|
||||
|
||||
void PoolVector3Array::append_array(const PoolVector3Array &array) {
|
||||
pandemonium::api->pandemonium_pool_vector3_array_append_array(&_pandemonium_array, &array._pandemonium_array);
|
||||
Pandemonium::api->pandemonium_pool_vector3_array_append_array(&_pandemonium_array, &array._pandemonium_array);
|
||||
}
|
||||
|
||||
int PoolVector3Array::insert(const int idx, const Vector3 &data) {
|
||||
return pandemonium::api->pandemonium_pool_vector3_array_insert(&_pandemonium_array, idx, (pandemonium_vector3 *)&data);
|
||||
return Pandemonium::api->pandemonium_pool_vector3_array_insert(&_pandemonium_array, idx, (pandemonium_vector3 *)&data);
|
||||
}
|
||||
|
||||
void PoolVector3Array::invert() {
|
||||
pandemonium::api->pandemonium_pool_vector3_array_invert(&_pandemonium_array);
|
||||
Pandemonium::api->pandemonium_pool_vector3_array_invert(&_pandemonium_array);
|
||||
}
|
||||
|
||||
void PoolVector3Array::push_back(const Vector3 &data) {
|
||||
pandemonium::api->pandemonium_pool_vector3_array_push_back(&_pandemonium_array, (pandemonium_vector3 *)&data);
|
||||
Pandemonium::api->pandemonium_pool_vector3_array_push_back(&_pandemonium_array, (pandemonium_vector3 *)&data);
|
||||
}
|
||||
|
||||
void PoolVector3Array::remove(const int idx) {
|
||||
pandemonium::api->pandemonium_pool_vector3_array_remove(&_pandemonium_array, idx);
|
||||
Pandemonium::api->pandemonium_pool_vector3_array_remove(&_pandemonium_array, idx);
|
||||
}
|
||||
|
||||
void PoolVector3Array::resize(const int size) {
|
||||
pandemonium::api->pandemonium_pool_vector3_array_resize(&_pandemonium_array, size);
|
||||
Pandemonium::api->pandemonium_pool_vector3_array_resize(&_pandemonium_array, size);
|
||||
}
|
||||
|
||||
void PoolVector3Array::set(const int idx, const Vector3 &data) {
|
||||
pandemonium::api->pandemonium_pool_vector3_array_set(&_pandemonium_array, idx, (pandemonium_vector3 *)&data);
|
||||
Pandemonium::api->pandemonium_pool_vector3_array_set(&_pandemonium_array, idx, (pandemonium_vector3 *)&data);
|
||||
}
|
||||
|
||||
const Vector3 PoolVector3Array::operator[](const int idx) {
|
||||
Vector3 v;
|
||||
*(pandemonium_vector3 *)&v = pandemonium::api->pandemonium_pool_vector3_array_get(&_pandemonium_array, idx);
|
||||
*(pandemonium_vector3 *)&v = Pandemonium::api->pandemonium_pool_vector3_array_get(&_pandemonium_array, idx);
|
||||
return v;
|
||||
}
|
||||
|
||||
int PoolVector3Array::size() const {
|
||||
return pandemonium::api->pandemonium_pool_vector3_array_size(&_pandemonium_array);
|
||||
return Pandemonium::api->pandemonium_pool_vector3_array_size(&_pandemonium_array);
|
||||
}
|
||||
|
||||
PoolVector3Array::~PoolVector3Array() {
|
||||
pandemonium::api->pandemonium_pool_vector3_array_destroy(&_pandemonium_array);
|
||||
Pandemonium::api->pandemonium_pool_vector3_array_destroy(&_pandemonium_array);
|
||||
}
|
||||
|
||||
PoolColorArray::PoolColorArray() {
|
||||
pandemonium::api->pandemonium_pool_color_array_new(&_pandemonium_array);
|
||||
Pandemonium::api->pandemonium_pool_color_array_new(&_pandemonium_array);
|
||||
}
|
||||
|
||||
PoolColorArray::PoolColorArray(const PoolColorArray &p_other) {
|
||||
pandemonium::api->pandemonium_pool_color_array_new_copy(&_pandemonium_array, &p_other._pandemonium_array);
|
||||
Pandemonium::api->pandemonium_pool_color_array_new_copy(&_pandemonium_array, &p_other._pandemonium_array);
|
||||
}
|
||||
|
||||
PoolColorArray &PoolColorArray::operator=(const PoolColorArray &p_other) {
|
||||
pandemonium::api->pandemonium_pool_color_array_destroy(&_pandemonium_array);
|
||||
pandemonium::api->pandemonium_pool_color_array_new_copy(&_pandemonium_array, &p_other._pandemonium_array);
|
||||
Pandemonium::api->pandemonium_pool_color_array_destroy(&_pandemonium_array);
|
||||
Pandemonium::api->pandemonium_pool_color_array_new_copy(&_pandemonium_array, &p_other._pandemonium_array);
|
||||
return *this;
|
||||
}
|
||||
|
||||
PoolColorArray::PoolColorArray(const Array &array) {
|
||||
pandemonium::api->pandemonium_pool_color_array_new_with_array(&_pandemonium_array, (pandemonium_array *)&array);
|
||||
Pandemonium::api->pandemonium_pool_color_array_new_with_array(&_pandemonium_array, (pandemonium_array *)&array);
|
||||
}
|
||||
|
||||
PoolColorArray::Read PoolColorArray::read() const {
|
||||
Read read;
|
||||
read._read_access = pandemonium::api->pandemonium_pool_color_array_read(&_pandemonium_array);
|
||||
read._read_access = Pandemonium::api->pandemonium_pool_color_array_read(&_pandemonium_array);
|
||||
return read;
|
||||
}
|
||||
|
||||
PoolColorArray::Write PoolColorArray::write() {
|
||||
Write write;
|
||||
write._write_access = pandemonium::api->pandemonium_pool_color_array_write(&_pandemonium_array);
|
||||
write._write_access = Pandemonium::api->pandemonium_pool_color_array_write(&_pandemonium_array);
|
||||
return write;
|
||||
}
|
||||
|
||||
void PoolColorArray::append(const Color &data) {
|
||||
pandemonium::api->pandemonium_pool_color_array_append(&_pandemonium_array, (pandemonium_color *)&data);
|
||||
Pandemonium::api->pandemonium_pool_color_array_append(&_pandemonium_array, (pandemonium_color *)&data);
|
||||
}
|
||||
|
||||
void PoolColorArray::append_array(const PoolColorArray &array) {
|
||||
pandemonium::api->pandemonium_pool_color_array_append_array(&_pandemonium_array, &array._pandemonium_array);
|
||||
Pandemonium::api->pandemonium_pool_color_array_append_array(&_pandemonium_array, &array._pandemonium_array);
|
||||
}
|
||||
|
||||
int PoolColorArray::insert(const int idx, const Color &data) {
|
||||
return pandemonium::api->pandemonium_pool_color_array_insert(&_pandemonium_array, idx, (pandemonium_color *)&data);
|
||||
return Pandemonium::api->pandemonium_pool_color_array_insert(&_pandemonium_array, idx, (pandemonium_color *)&data);
|
||||
}
|
||||
|
||||
void PoolColorArray::invert() {
|
||||
pandemonium::api->pandemonium_pool_color_array_invert(&_pandemonium_array);
|
||||
Pandemonium::api->pandemonium_pool_color_array_invert(&_pandemonium_array);
|
||||
}
|
||||
|
||||
void PoolColorArray::push_back(const Color &data) {
|
||||
pandemonium::api->pandemonium_pool_color_array_push_back(&_pandemonium_array, (pandemonium_color *)&data);
|
||||
Pandemonium::api->pandemonium_pool_color_array_push_back(&_pandemonium_array, (pandemonium_color *)&data);
|
||||
}
|
||||
|
||||
void PoolColorArray::remove(const int idx) {
|
||||
pandemonium::api->pandemonium_pool_color_array_remove(&_pandemonium_array, idx);
|
||||
Pandemonium::api->pandemonium_pool_color_array_remove(&_pandemonium_array, idx);
|
||||
}
|
||||
|
||||
void PoolColorArray::resize(const int size) {
|
||||
pandemonium::api->pandemonium_pool_color_array_resize(&_pandemonium_array, size);
|
||||
Pandemonium::api->pandemonium_pool_color_array_resize(&_pandemonium_array, size);
|
||||
}
|
||||
|
||||
void PoolColorArray::set(const int idx, const Color &data) {
|
||||
pandemonium::api->pandemonium_pool_color_array_set(&_pandemonium_array, idx, (pandemonium_color *)&data);
|
||||
Pandemonium::api->pandemonium_pool_color_array_set(&_pandemonium_array, idx, (pandemonium_color *)&data);
|
||||
}
|
||||
|
||||
const Color PoolColorArray::operator[](const int idx) {
|
||||
Color v;
|
||||
*(pandemonium_color *)&v = pandemonium::api->pandemonium_pool_color_array_get(&_pandemonium_array, idx);
|
||||
*(pandemonium_color *)&v = Pandemonium::api->pandemonium_pool_color_array_get(&_pandemonium_array, idx);
|
||||
return v;
|
||||
}
|
||||
|
||||
int PoolColorArray::size() const {
|
||||
return pandemonium::api->pandemonium_pool_color_array_size(&_pandemonium_array);
|
||||
return Pandemonium::api->pandemonium_pool_color_array_size(&_pandemonium_array);
|
||||
}
|
||||
|
||||
PoolColorArray::~PoolColorArray() {
|
||||
pandemonium::api->pandemonium_pool_color_array_destroy(&_pandemonium_array);
|
||||
Pandemonium::api->pandemonium_pool_color_array_destroy(&_pandemonium_array);
|
||||
}
|
||||
|
||||
} // namespace pandemonium
|
||||
|
||||
|
@ -35,7 +35,7 @@
|
||||
|
||||
#include <cmath>
|
||||
|
||||
namespace pandemonium {
|
||||
|
||||
|
||||
const Quaternion Quaternion::IDENTITY = Quaternion();
|
||||
|
||||
@ -349,4 +349,4 @@ bool Quaternion::operator!=(const Quaternion &p_quaternion) const {
|
||||
return x != p_quaternion.x || y != p_quaternion.y || z != p_quaternion.z || w != p_quaternion.w;
|
||||
}
|
||||
|
||||
} // namespace pandemonium
|
||||
|
||||
|
@ -35,7 +35,7 @@
|
||||
|
||||
#include <cmath>
|
||||
|
||||
namespace pandemonium {
|
||||
|
||||
|
||||
#ifndef MAX
|
||||
#define MAX(a, b) (a > b ? a : b)
|
||||
@ -320,4 +320,4 @@ next4:
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace pandemonium
|
||||
|
||||
|
@ -32,10 +32,10 @@
|
||||
#include "ustring.h"
|
||||
#include "vector2i.h"
|
||||
|
||||
namespace pandemonium {
|
||||
|
||||
|
||||
Rect2i::operator String() const {
|
||||
return String(position) + ", " + String(size);
|
||||
}
|
||||
|
||||
} // namespace pandemonium
|
||||
|
||||
|
@ -34,14 +34,14 @@
|
||||
|
||||
#include "pandemonium_global.h"
|
||||
|
||||
namespace pandemonium {
|
||||
|
||||
|
||||
RID::RID() {
|
||||
pandemonium::api->pandemonium_rid_new(&_pandemonium_rid);
|
||||
Pandemonium::api->pandemonium_rid_new(&_pandemonium_rid);
|
||||
}
|
||||
|
||||
RID::RID(Object *p) {
|
||||
pandemonium::api->pandemonium_rid_new_with_resource(&_pandemonium_rid, (const pandemonium_object *)p);
|
||||
Pandemonium::api->pandemonium_rid_new_with_resource(&_pandemonium_rid, (const pandemonium_object *)p);
|
||||
}
|
||||
|
||||
pandemonium_rid RID::_get_pandemonium_rid() const {
|
||||
@ -49,11 +49,11 @@ pandemonium_rid RID::_get_pandemonium_rid() const {
|
||||
}
|
||||
|
||||
int32_t RID::get_id() const {
|
||||
return pandemonium::api->pandemonium_rid_get_id(&_pandemonium_rid);
|
||||
return Pandemonium::api->pandemonium_rid_get_id(&_pandemonium_rid);
|
||||
}
|
||||
|
||||
bool RID::operator==(const RID &p_other) const {
|
||||
return pandemonium::api->pandemonium_rid_operator_equal(&_pandemonium_rid, &p_other._pandemonium_rid);
|
||||
return Pandemonium::api->pandemonium_rid_operator_equal(&_pandemonium_rid, &p_other._pandemonium_rid);
|
||||
}
|
||||
|
||||
bool RID::operator!=(const RID &p_other) const {
|
||||
@ -61,7 +61,7 @@ bool RID::operator!=(const RID &p_other) const {
|
||||
}
|
||||
|
||||
bool RID::operator<(const RID &p_other) const {
|
||||
return pandemonium::api->pandemonium_rid_operator_less(&_pandemonium_rid, &p_other._pandemonium_rid);
|
||||
return Pandemonium::api->pandemonium_rid_operator_less(&_pandemonium_rid, &p_other._pandemonium_rid);
|
||||
}
|
||||
|
||||
bool RID::operator>(const RID &p_other) const {
|
||||
@ -76,4 +76,4 @@ bool RID::operator>=(const RID &p_other) const {
|
||||
return !(*this < p_other);
|
||||
}
|
||||
|
||||
} // namespace pandemonium
|
||||
|
||||
|
@ -40,27 +40,27 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
namespace pandemonium {
|
||||
|
||||
pandemonium::StringName::StringName() {
|
||||
pandemonium::api->pandemonium_string_name_new(&_pandemonium_string_name);
|
||||
|
||||
StringName::StringName() {
|
||||
Pandemonium::api->pandemonium_string_name_new(&_pandemonium_string_name);
|
||||
}
|
||||
|
||||
StringName::StringName(const char *contents) {
|
||||
pandemonium::api->pandemonium_string_name_new_data_char(&_pandemonium_string_name, contents);
|
||||
Pandemonium::api->pandemonium_string_name_new_data_char(&_pandemonium_string_name, contents);
|
||||
}
|
||||
|
||||
StringName::StringName(const String &other) {
|
||||
pandemonium::api->pandemonium_string_name_new_data_string(&_pandemonium_string_name, &other._pandemonium_string);
|
||||
Pandemonium::api->pandemonium_string_name_new_data_string(&_pandemonium_string_name, &other._pandemonium_string);
|
||||
}
|
||||
|
||||
StringName::~StringName() {
|
||||
pandemonium::api->pandemonium_string_name_destroy(&_pandemonium_string_name);
|
||||
Pandemonium::api->pandemonium_string_name_destroy(&_pandemonium_string_name);
|
||||
}
|
||||
|
||||
|
||||
bool StringName::operator==(const StringName &s) const {
|
||||
return pandemonium::api->pandemonium_string_name_operator_equal(&_pandemonium_string_name, &s._pandemonium_string_name);
|
||||
return Pandemonium::api->pandemonium_string_name_operator_equal(&_pandemonium_string_name, &s._pandemonium_string_name);
|
||||
}
|
||||
|
||||
bool StringName::operator!=(const StringName &s) const {
|
||||
@ -68,11 +68,11 @@ bool StringName::operator!=(const StringName &s) const {
|
||||
}
|
||||
|
||||
bool StringName::operator<(const StringName &s) const {
|
||||
return pandemonium::api->pandemonium_string_name_operator_less(&_pandemonium_string_name, &s._pandemonium_string_name);
|
||||
return Pandemonium::api->pandemonium_string_name_operator_less(&_pandemonium_string_name, &s._pandemonium_string_name);
|
||||
}
|
||||
|
||||
bool StringName::operator<=(const StringName &s) const {
|
||||
return pandemonium::api->pandemonium_string_name_operator_less(&_pandemonium_string_name, &s._pandemonium_string_name) ||
|
||||
return Pandemonium::api->pandemonium_string_name_operator_less(&_pandemonium_string_name, &s._pandemonium_string_name) ||
|
||||
(*this == s);
|
||||
}
|
||||
|
||||
@ -84,4 +84,4 @@ bool StringName::operator>=(const StringName &s) const {
|
||||
return !(*this < s);
|
||||
}
|
||||
|
||||
} // namespace pandemonium
|
||||
|
||||
|
@ -34,7 +34,7 @@
|
||||
|
||||
#include <pandemonium_global.h>
|
||||
|
||||
namespace pandemonium {
|
||||
|
||||
|
||||
namespace _TagDB {
|
||||
|
||||
@ -52,7 +52,7 @@ bool is_type_known(size_t type_tag) {
|
||||
}
|
||||
|
||||
void register_global_type(const char *name, size_t type_tag, size_t base_type_tag) {
|
||||
pandemonium::nativescript_api->pandemonium_nativescript_set_global_type_tag(pandemonium::_RegisterState::language_index, name, (const void *)type_tag);
|
||||
Pandemonium::nativescript_api->pandemonium_nativescript_set_global_type_tag(_RegisterState::language_index, name, (const void *)type_tag);
|
||||
|
||||
register_type(type_tag, base_type_tag);
|
||||
}
|
||||
@ -75,4 +75,4 @@ bool is_type_compatible(size_t ask_tag, size_t have_tag) {
|
||||
|
||||
} // namespace _TagDB
|
||||
|
||||
} // namespace pandemonium
|
||||
|
||||
|
@ -37,7 +37,7 @@
|
||||
|
||||
#include "quaternion.h"
|
||||
|
||||
namespace pandemonium {
|
||||
|
||||
|
||||
const Transform Transform::IDENTITY = Transform();
|
||||
const Transform Transform::FLIP_X = Transform(-1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0);
|
||||
@ -302,4 +302,4 @@ Transform::Transform(const Basis &p_basis, const Vector3 &p_origin) {
|
||||
origin = p_origin;
|
||||
}
|
||||
|
||||
} // namespace pandemonium
|
||||
|
||||
|
@ -35,7 +35,7 @@
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
namespace pandemonium {
|
||||
|
||||
|
||||
const Transform2D Transform2D::IDENTITY;
|
||||
const Transform2D Transform2D::FLIP_X = Transform2D(-1, 0, 0, 1, 0, 0);
|
||||
@ -329,4 +329,4 @@ Transform2D::operator String() const {
|
||||
return String(String() + elements[0] + ", " + elements[1] + ", " + elements[2]);
|
||||
}
|
||||
|
||||
} // namespace pandemonium
|
||||
|
||||
|
@ -40,113 +40,113 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
namespace pandemonium {
|
||||
|
||||
pandemonium::CharString::~CharString() {
|
||||
pandemonium::api->pandemonium_char_string_destroy(&_char_string);
|
||||
|
||||
CharString::~CharString() {
|
||||
Pandemonium::api->pandemonium_char_string_destroy(&_char_string);
|
||||
}
|
||||
|
||||
int pandemonium::CharString::length() const {
|
||||
return pandemonium::api->pandemonium_char_string_length(&_char_string);
|
||||
int CharString::length() const {
|
||||
return Pandemonium::api->pandemonium_char_string_length(&_char_string);
|
||||
}
|
||||
|
||||
const char *pandemonium::CharString::get_data() const {
|
||||
return pandemonium::api->pandemonium_char_string_get_data(&_char_string);
|
||||
const char *CharString::get_data() const {
|
||||
return Pandemonium::api->pandemonium_char_string_get_data(&_char_string);
|
||||
}
|
||||
|
||||
pandemonium::Char16String::~Char16String() {
|
||||
pandemonium::api->pandemonium_char_16_string_destroy(&_char_string);
|
||||
Char16String::~Char16String() {
|
||||
Pandemonium::api->pandemonium_char_16_string_destroy(&_char_string);
|
||||
}
|
||||
|
||||
int pandemonium::Char16String::length() const {
|
||||
return pandemonium::api->pandemonium_char_16_string_length(&_char_string);
|
||||
int Char16String::length() const {
|
||||
return Pandemonium::api->pandemonium_char_16_string_length(&_char_string);
|
||||
}
|
||||
|
||||
const char16_t *pandemonium::Char16String::get_data() const {
|
||||
return pandemonium::api->pandemonium_char_16_string_get_data(&_char_string);
|
||||
const char16_t *Char16String::get_data() const {
|
||||
return Pandemonium::api->pandemonium_char_16_string_get_data(&_char_string);
|
||||
}
|
||||
|
||||
String String::num(double p_num, int p_decimals) {
|
||||
return String(pandemonium::api->pandemonium_string_num_with_decimals(p_num, p_decimals));
|
||||
return String(Pandemonium::api->pandemonium_string_num_with_decimals(p_num, p_decimals));
|
||||
}
|
||||
|
||||
String String::num_scientific(double p_num) {
|
||||
return String(pandemonium::api->pandemonium_string_num_scientific(p_num));
|
||||
return String(Pandemonium::api->pandemonium_string_num_scientific(p_num));
|
||||
}
|
||||
|
||||
String String::num_real(double p_num) {
|
||||
return String(pandemonium::api->pandemonium_string_num_real(p_num));
|
||||
return String(Pandemonium::api->pandemonium_string_num_real(p_num));
|
||||
}
|
||||
|
||||
String String::num_int64(int64_t p_num, int base, bool capitalize_hex) {
|
||||
return String(pandemonium::api->pandemonium_string_num_int64_capitalized(p_num, base, capitalize_hex));
|
||||
return String(Pandemonium::api->pandemonium_string_num_int64_capitalized(p_num, base, capitalize_hex));
|
||||
}
|
||||
|
||||
String String::chr(pandemonium_char_type p_char) {
|
||||
return String(pandemonium::api->pandemonium_string_chr(p_char));
|
||||
return String(Pandemonium::api->pandemonium_string_chr(p_char));
|
||||
}
|
||||
|
||||
String String::md5(const uint8_t *p_md5) {
|
||||
return String(pandemonium::api->pandemonium_string_md5(p_md5));
|
||||
return String(Pandemonium::api->pandemonium_string_md5(p_md5));
|
||||
}
|
||||
|
||||
String String::hex_encode_buffer(const uint8_t *p_buffer, int p_len) {
|
||||
return String(pandemonium::api->pandemonium_string_hex_encode_buffer(p_buffer, p_len));
|
||||
return String(Pandemonium::api->pandemonium_string_hex_encode_buffer(p_buffer, p_len));
|
||||
}
|
||||
|
||||
pandemonium::String::String() {
|
||||
pandemonium::api->pandemonium_string_new(&_pandemonium_string);
|
||||
String::String() {
|
||||
Pandemonium::api->pandemonium_string_new(&_pandemonium_string);
|
||||
}
|
||||
|
||||
String::String(const char *contents) {
|
||||
pandemonium::api->pandemonium_string_new(&_pandemonium_string);
|
||||
pandemonium::api->pandemonium_string_parse_utf8(&_pandemonium_string, contents);
|
||||
Pandemonium::api->pandemonium_string_new(&_pandemonium_string);
|
||||
Pandemonium::api->pandemonium_string_parse_utf8(&_pandemonium_string, contents);
|
||||
}
|
||||
|
||||
String::String(const wchar_t *contents) {
|
||||
pandemonium::api->pandemonium_string_new_wchar_clip_to_len(&_pandemonium_string, contents, wcslen(contents));
|
||||
Pandemonium::api->pandemonium_string_new_wchar_clip_to_len(&_pandemonium_string, contents, wcslen(contents));
|
||||
}
|
||||
|
||||
String::String(const wchar_t c) {
|
||||
pandemonium::api->pandemonium_string_new_wchar_clip_to_len(&_pandemonium_string, &c, 1);
|
||||
Pandemonium::api->pandemonium_string_new_wchar_clip_to_len(&_pandemonium_string, &c, 1);
|
||||
}
|
||||
|
||||
String::String(const String &other) {
|
||||
pandemonium::api->pandemonium_string_new_copy(&_pandemonium_string, &other._pandemonium_string);
|
||||
Pandemonium::api->pandemonium_string_new_copy(&_pandemonium_string, &other._pandemonium_string);
|
||||
}
|
||||
|
||||
String::String(String &&other) {
|
||||
pandemonium::api->pandemonium_string_new_copy(&_pandemonium_string, &other._pandemonium_string);
|
||||
Pandemonium::api->pandemonium_string_new_copy(&_pandemonium_string, &other._pandemonium_string);
|
||||
}
|
||||
|
||||
String::~String() {
|
||||
pandemonium::api->pandemonium_string_destroy(&_pandemonium_string);
|
||||
Pandemonium::api->pandemonium_string_destroy(&_pandemonium_string);
|
||||
}
|
||||
|
||||
char32_t &String::operator[](const int idx) {
|
||||
return *const_cast<char32_t *>(pandemonium::api->pandemonium_string_operator_index(&_pandemonium_string, idx));
|
||||
return *const_cast<char32_t *>(Pandemonium::api->pandemonium_string_operator_index(&_pandemonium_string, idx));
|
||||
}
|
||||
|
||||
char32_t String::operator[](const int idx) const {
|
||||
return *pandemonium::api->pandemonium_string_operator_index((pandemonium_string *)&_pandemonium_string, idx);
|
||||
return *Pandemonium::api->pandemonium_string_operator_index((pandemonium_string *)&_pandemonium_string, idx);
|
||||
}
|
||||
|
||||
int String::length() const {
|
||||
return pandemonium::api->pandemonium_string_length(&_pandemonium_string);
|
||||
return Pandemonium::api->pandemonium_string_length(&_pandemonium_string);
|
||||
}
|
||||
|
||||
void String::operator=(const String &s) {
|
||||
pandemonium::api->pandemonium_string_destroy(&_pandemonium_string);
|
||||
pandemonium::api->pandemonium_string_new_copy(&_pandemonium_string, &s._pandemonium_string);
|
||||
Pandemonium::api->pandemonium_string_destroy(&_pandemonium_string);
|
||||
Pandemonium::api->pandemonium_string_new_copy(&_pandemonium_string, &s._pandemonium_string);
|
||||
}
|
||||
|
||||
void String::operator=(String &&s) {
|
||||
pandemonium::api->pandemonium_string_destroy(&_pandemonium_string);
|
||||
pandemonium::api->pandemonium_string_new_copy(&_pandemonium_string, &s._pandemonium_string);
|
||||
Pandemonium::api->pandemonium_string_destroy(&_pandemonium_string);
|
||||
Pandemonium::api->pandemonium_string_new_copy(&_pandemonium_string, &s._pandemonium_string);
|
||||
}
|
||||
|
||||
bool String::operator==(const String &s) const {
|
||||
return pandemonium::api->pandemonium_string_operator_equal(&_pandemonium_string, &s._pandemonium_string);
|
||||
return Pandemonium::api->pandemonium_string_operator_equal(&_pandemonium_string, &s._pandemonium_string);
|
||||
}
|
||||
|
||||
bool String::operator!=(const String &s) const {
|
||||
@ -154,24 +154,24 @@ bool String::operator!=(const String &s) const {
|
||||
}
|
||||
|
||||
String String::operator+(const String &s) const {
|
||||
return String(pandemonium::api->pandemonium_string_operator_plus(&_pandemonium_string, &s._pandemonium_string));
|
||||
return String(Pandemonium::api->pandemonium_string_operator_plus(&_pandemonium_string, &s._pandemonium_string));
|
||||
}
|
||||
|
||||
void String::operator+=(const String &s) {
|
||||
*this = String(pandemonium::api->pandemonium_string_operator_plus(&_pandemonium_string, &s._pandemonium_string));
|
||||
*this = String(Pandemonium::api->pandemonium_string_operator_plus(&_pandemonium_string, &s._pandemonium_string));
|
||||
}
|
||||
|
||||
void String::operator+=(const char32_t c) {
|
||||
String _to_be_added = String(c);
|
||||
*this = String(pandemonium::api->pandemonium_string_operator_plus(&_pandemonium_string, &_to_be_added._pandemonium_string));
|
||||
*this = String(Pandemonium::api->pandemonium_string_operator_plus(&_pandemonium_string, &_to_be_added._pandemonium_string));
|
||||
}
|
||||
|
||||
bool String::operator<(const String &s) const {
|
||||
return pandemonium::api->pandemonium_string_operator_less(&_pandemonium_string, &s._pandemonium_string);
|
||||
return Pandemonium::api->pandemonium_string_operator_less(&_pandemonium_string, &s._pandemonium_string);
|
||||
}
|
||||
|
||||
bool String::operator<=(const String &s) const {
|
||||
return pandemonium::api->pandemonium_string_operator_less(&_pandemonium_string, &s._pandemonium_string) ||
|
||||
return Pandemonium::api->pandemonium_string_operator_less(&_pandemonium_string, &s._pandemonium_string) ||
|
||||
(*this == s);
|
||||
}
|
||||
|
||||
@ -188,21 +188,21 @@ String::operator NodePath() const {
|
||||
}
|
||||
|
||||
const char32_t *String::unicode_str() const {
|
||||
return pandemonium::api->pandemonium_string_get_data(&_pandemonium_string);
|
||||
return Pandemonium::api->pandemonium_string_get_data(&_pandemonium_string);
|
||||
}
|
||||
|
||||
char *String::alloc_c_string() const {
|
||||
pandemonium_char_string contents = pandemonium::api->pandemonium_string_utf8(&_pandemonium_string);
|
||||
pandemonium_char_string contents = Pandemonium::api->pandemonium_string_utf8(&_pandemonium_string);
|
||||
|
||||
int length = pandemonium::api->pandemonium_char_string_length(&contents);
|
||||
int length = Pandemonium::api->pandemonium_char_string_length(&contents);
|
||||
|
||||
char *result = (char *)pandemonium::api->pandemonium_alloc(length + 1);
|
||||
char *result = (char *)Pandemonium::api->pandemonium_alloc(length + 1);
|
||||
|
||||
if (result) {
|
||||
memcpy(result, pandemonium::api->pandemonium_char_string_get_data(&contents), length + 1);
|
||||
memcpy(result, Pandemonium::api->pandemonium_char_string_get_data(&contents), length + 1);
|
||||
}
|
||||
|
||||
pandemonium::api->pandemonium_char_string_destroy(&contents);
|
||||
Pandemonium::api->pandemonium_char_string_destroy(&contents);
|
||||
|
||||
return result;
|
||||
}
|
||||
@ -210,7 +210,7 @@ char *String::alloc_c_string() const {
|
||||
CharString String::utf8() const {
|
||||
CharString ret;
|
||||
|
||||
ret._char_string = pandemonium::api->pandemonium_string_utf8(&_pandemonium_string);
|
||||
ret._char_string = Pandemonium::api->pandemonium_string_utf8(&_pandemonium_string);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@ -219,9 +219,9 @@ CharString String::ascii(bool p_extended) const {
|
||||
CharString ret;
|
||||
|
||||
if (p_extended)
|
||||
ret._char_string = pandemonium::api->pandemonium_string_ascii_extended(&_pandemonium_string);
|
||||
ret._char_string = Pandemonium::api->pandemonium_string_ascii_extended(&_pandemonium_string);
|
||||
else
|
||||
ret._char_string = pandemonium::api->pandemonium_string_ascii(&_pandemonium_string);
|
||||
ret._char_string = Pandemonium::api->pandemonium_string_ascii(&_pandemonium_string);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@ -235,300 +235,300 @@ String operator+(const wchar_t *a, const String &b) {
|
||||
}
|
||||
|
||||
bool String::begins_with(const String &p_string) const {
|
||||
return pandemonium::api->pandemonium_string_begins_with(&_pandemonium_string, &p_string._pandemonium_string);
|
||||
return Pandemonium::api->pandemonium_string_begins_with(&_pandemonium_string, &p_string._pandemonium_string);
|
||||
}
|
||||
|
||||
bool String::begins_with_char_array(const char *p_char_array) const {
|
||||
return pandemonium::api->pandemonium_string_begins_with_char_array(&_pandemonium_string, p_char_array);
|
||||
return Pandemonium::api->pandemonium_string_begins_with_char_array(&_pandemonium_string, p_char_array);
|
||||
}
|
||||
|
||||
PoolStringArray String::bigrams() const {
|
||||
pandemonium_array arr = pandemonium::api->pandemonium_string_bigrams(&_pandemonium_string);
|
||||
pandemonium_array arr = Pandemonium::api->pandemonium_string_bigrams(&_pandemonium_string);
|
||||
return Array(arr);
|
||||
}
|
||||
|
||||
String String::c_escape() const {
|
||||
return String(pandemonium::api->pandemonium_string_c_escape(&_pandemonium_string));
|
||||
return String(Pandemonium::api->pandemonium_string_c_escape(&_pandemonium_string));
|
||||
}
|
||||
|
||||
String String::c_unescape() const {
|
||||
return String(pandemonium::api->pandemonium_string_c_unescape(&_pandemonium_string));
|
||||
return String(Pandemonium::api->pandemonium_string_c_unescape(&_pandemonium_string));
|
||||
}
|
||||
|
||||
String String::capitalize() const {
|
||||
return String(pandemonium::api->pandemonium_string_capitalize(&_pandemonium_string));
|
||||
return String(Pandemonium::api->pandemonium_string_capitalize(&_pandemonium_string));
|
||||
}
|
||||
|
||||
bool String::empty() const {
|
||||
return pandemonium::api->pandemonium_string_empty(&_pandemonium_string);
|
||||
return Pandemonium::api->pandemonium_string_empty(&_pandemonium_string);
|
||||
}
|
||||
|
||||
bool String::ends_with(const String &p_string) const {
|
||||
return pandemonium::api->pandemonium_string_ends_with(&_pandemonium_string, &p_string._pandemonium_string);
|
||||
return Pandemonium::api->pandemonium_string_ends_with(&_pandemonium_string, &p_string._pandemonium_string);
|
||||
}
|
||||
|
||||
void String::erase(int position, int chars) {
|
||||
pandemonium::api->pandemonium_string_erase(&_pandemonium_string, position, chars);
|
||||
Pandemonium::api->pandemonium_string_erase(&_pandemonium_string, position, chars);
|
||||
}
|
||||
|
||||
int String::find(String p_what, int p_from) const {
|
||||
return pandemonium::api->pandemonium_string_find_from(&_pandemonium_string, p_what._pandemonium_string, p_from);
|
||||
return Pandemonium::api->pandemonium_string_find_from(&_pandemonium_string, p_what._pandemonium_string, p_from);
|
||||
}
|
||||
|
||||
int String::find_last(String p_what) const {
|
||||
return pandemonium::api->pandemonium_string_find_last(&_pandemonium_string, p_what._pandemonium_string);
|
||||
return Pandemonium::api->pandemonium_string_find_last(&_pandemonium_string, p_what._pandemonium_string);
|
||||
}
|
||||
|
||||
int String::findn(String p_what, int p_from) const {
|
||||
return pandemonium::api->pandemonium_string_findn_from(&_pandemonium_string, p_what._pandemonium_string, p_from);
|
||||
return Pandemonium::api->pandemonium_string_findn_from(&_pandemonium_string, p_what._pandemonium_string, p_from);
|
||||
}
|
||||
|
||||
String String::format(Variant values) const {
|
||||
return String(pandemonium::api->pandemonium_string_format(&_pandemonium_string, (pandemonium_variant *)&values));
|
||||
return String(Pandemonium::api->pandemonium_string_format(&_pandemonium_string, (pandemonium_variant *)&values));
|
||||
}
|
||||
|
||||
String String::format(Variant values, String placeholder) const {
|
||||
pandemonium_char_string contents = pandemonium::api->pandemonium_string_utf8(&placeholder._pandemonium_string);
|
||||
String new_string(pandemonium::api->pandemonium_string_format_with_custom_placeholder(&_pandemonium_string, (pandemonium_variant *)&values, pandemonium::api->pandemonium_char_string_get_data(&contents)));
|
||||
pandemonium::api->pandemonium_char_string_destroy(&contents);
|
||||
pandemonium_char_string contents = Pandemonium::api->pandemonium_string_utf8(&placeholder._pandemonium_string);
|
||||
String new_string(Pandemonium::api->pandemonium_string_format_with_custom_placeholder(&_pandemonium_string, (pandemonium_variant *)&values, Pandemonium::api->pandemonium_char_string_get_data(&contents)));
|
||||
Pandemonium::api->pandemonium_char_string_destroy(&contents);
|
||||
|
||||
return new_string;
|
||||
}
|
||||
|
||||
String String::get_base_dir() const {
|
||||
return String(pandemonium::api->pandemonium_string_get_base_dir(&_pandemonium_string));
|
||||
return String(Pandemonium::api->pandemonium_string_get_base_dir(&_pandemonium_string));
|
||||
}
|
||||
|
||||
String String::get_basename() const {
|
||||
return String(pandemonium::api->pandemonium_string_get_basename(&_pandemonium_string));
|
||||
return String(Pandemonium::api->pandemonium_string_get_basename(&_pandemonium_string));
|
||||
}
|
||||
|
||||
String String::get_extension() const {
|
||||
return String(pandemonium::api->pandemonium_string_get_extension(&_pandemonium_string));
|
||||
return String(Pandemonium::api->pandemonium_string_get_extension(&_pandemonium_string));
|
||||
}
|
||||
|
||||
String String::get_file() const {
|
||||
return String(pandemonium::api->pandemonium_string_get_file(&_pandemonium_string));
|
||||
return String(Pandemonium::api->pandemonium_string_get_file(&_pandemonium_string));
|
||||
}
|
||||
|
||||
int String::hash() const {
|
||||
return pandemonium::api->pandemonium_string_hash(&_pandemonium_string);
|
||||
return Pandemonium::api->pandemonium_string_hash(&_pandemonium_string);
|
||||
}
|
||||
|
||||
int String::hex_to_int() const {
|
||||
return pandemonium::api->pandemonium_string_hex_to_int(&_pandemonium_string);
|
||||
return Pandemonium::api->pandemonium_string_hex_to_int(&_pandemonium_string);
|
||||
}
|
||||
|
||||
String String::insert(int position, String what) const {
|
||||
return String(pandemonium::api->pandemonium_string_insert(&_pandemonium_string, position, what._pandemonium_string));
|
||||
return String(Pandemonium::api->pandemonium_string_insert(&_pandemonium_string, position, what._pandemonium_string));
|
||||
}
|
||||
|
||||
bool String::is_abs_path() const {
|
||||
return pandemonium::api->pandemonium_string_is_abs_path(&_pandemonium_string);
|
||||
return Pandemonium::api->pandemonium_string_is_abs_path(&_pandemonium_string);
|
||||
}
|
||||
|
||||
bool String::is_rel_path() const {
|
||||
return pandemonium::api->pandemonium_string_is_rel_path(&_pandemonium_string);
|
||||
return Pandemonium::api->pandemonium_string_is_rel_path(&_pandemonium_string);
|
||||
}
|
||||
|
||||
bool String::is_subsequence_of(String text) const {
|
||||
return pandemonium::api->pandemonium_string_is_subsequence_of(&_pandemonium_string, &text._pandemonium_string);
|
||||
return Pandemonium::api->pandemonium_string_is_subsequence_of(&_pandemonium_string, &text._pandemonium_string);
|
||||
}
|
||||
|
||||
bool String::is_subsequence_ofi(String text) const {
|
||||
return pandemonium::api->pandemonium_string_is_subsequence_ofi(&_pandemonium_string, &text._pandemonium_string);
|
||||
return Pandemonium::api->pandemonium_string_is_subsequence_ofi(&_pandemonium_string, &text._pandemonium_string);
|
||||
}
|
||||
|
||||
bool String::is_valid_float() const {
|
||||
return pandemonium::api->pandemonium_string_is_valid_float(&_pandemonium_string);
|
||||
return Pandemonium::api->pandemonium_string_is_valid_float(&_pandemonium_string);
|
||||
}
|
||||
|
||||
bool String::is_valid_html_color() const {
|
||||
return pandemonium::api->pandemonium_string_is_valid_html_color(&_pandemonium_string);
|
||||
return Pandemonium::api->pandemonium_string_is_valid_html_color(&_pandemonium_string);
|
||||
}
|
||||
|
||||
bool String::is_valid_identifier() const {
|
||||
return pandemonium::api->pandemonium_string_is_valid_identifier(&_pandemonium_string);
|
||||
return Pandemonium::api->pandemonium_string_is_valid_identifier(&_pandemonium_string);
|
||||
}
|
||||
|
||||
bool String::is_valid_integer() const {
|
||||
return pandemonium::api->pandemonium_string_is_numeric(&_pandemonium_string);
|
||||
return Pandemonium::api->pandemonium_string_is_numeric(&_pandemonium_string);
|
||||
}
|
||||
|
||||
bool String::is_valid_ip_address() const {
|
||||
return pandemonium::api->pandemonium_string_is_valid_ip_address(&_pandemonium_string);
|
||||
return Pandemonium::api->pandemonium_string_is_valid_ip_address(&_pandemonium_string);
|
||||
}
|
||||
|
||||
String String::json_escape() const {
|
||||
return String(pandemonium::api->pandemonium_string_json_escape(&_pandemonium_string));
|
||||
return String(Pandemonium::api->pandemonium_string_json_escape(&_pandemonium_string));
|
||||
}
|
||||
|
||||
String String::left(int position) const {
|
||||
return String(pandemonium::api->pandemonium_string_left(&_pandemonium_string, position));
|
||||
return String(Pandemonium::api->pandemonium_string_left(&_pandemonium_string, position));
|
||||
}
|
||||
|
||||
bool String::match(String expr) const {
|
||||
return pandemonium::api->pandemonium_string_match(&_pandemonium_string, &expr._pandemonium_string);
|
||||
return Pandemonium::api->pandemonium_string_match(&_pandemonium_string, &expr._pandemonium_string);
|
||||
}
|
||||
|
||||
bool String::matchn(String expr) const {
|
||||
return pandemonium::api->pandemonium_string_match(&_pandemonium_string, &expr._pandemonium_string);
|
||||
return Pandemonium::api->pandemonium_string_match(&_pandemonium_string, &expr._pandemonium_string);
|
||||
}
|
||||
|
||||
PoolByteArray String::md5_buffer() const {
|
||||
pandemonium_pool_byte_array arr = pandemonium::api->pandemonium_string_md5_buffer(&_pandemonium_string);
|
||||
pandemonium_pool_byte_array arr = Pandemonium::api->pandemonium_string_md5_buffer(&_pandemonium_string);
|
||||
return PoolByteArray(arr);
|
||||
}
|
||||
|
||||
String String::md5_text() const {
|
||||
return String(pandemonium::api->pandemonium_string_md5_text(&_pandemonium_string));
|
||||
return String(Pandemonium::api->pandemonium_string_md5_text(&_pandemonium_string));
|
||||
}
|
||||
|
||||
int String::ord_at(int at) const {
|
||||
return pandemonium::api->pandemonium_string_ord_at(&_pandemonium_string, at);
|
||||
return Pandemonium::api->pandemonium_string_ord_at(&_pandemonium_string, at);
|
||||
}
|
||||
|
||||
String String::pad_decimals(int digits) const {
|
||||
return String(pandemonium::api->pandemonium_string_pad_decimals(&_pandemonium_string, digits));
|
||||
return String(Pandemonium::api->pandemonium_string_pad_decimals(&_pandemonium_string, digits));
|
||||
}
|
||||
|
||||
String String::pad_zeros(int digits) const {
|
||||
return String(pandemonium::api->pandemonium_string_pad_zeros(&_pandemonium_string, digits));
|
||||
return String(Pandemonium::api->pandemonium_string_pad_zeros(&_pandemonium_string, digits));
|
||||
}
|
||||
|
||||
String String::percent_decode() const {
|
||||
return String(pandemonium::api->pandemonium_string_percent_decode(&_pandemonium_string));
|
||||
return String(Pandemonium::api->pandemonium_string_percent_decode(&_pandemonium_string));
|
||||
}
|
||||
|
||||
String String::percent_encode() const {
|
||||
return String(pandemonium::api->pandemonium_string_percent_encode(&_pandemonium_string));
|
||||
return String(Pandemonium::api->pandemonium_string_percent_encode(&_pandemonium_string));
|
||||
}
|
||||
|
||||
String String::plus_file(String file) const {
|
||||
return String(pandemonium::api->pandemonium_string_plus_file(&_pandemonium_string, &file._pandemonium_string));
|
||||
return String(Pandemonium::api->pandemonium_string_plus_file(&_pandemonium_string, &file._pandemonium_string));
|
||||
}
|
||||
|
||||
String String::replace(String p_key, String p_with) const {
|
||||
return String(pandemonium::api->pandemonium_string_replace(&_pandemonium_string, p_key._pandemonium_string, p_with._pandemonium_string));
|
||||
return String(Pandemonium::api->pandemonium_string_replace(&_pandemonium_string, p_key._pandemonium_string, p_with._pandemonium_string));
|
||||
}
|
||||
|
||||
String String::replacen(String what, String forwhat) const {
|
||||
return String(pandemonium::api->pandemonium_string_replacen(&_pandemonium_string, what._pandemonium_string, forwhat._pandemonium_string));
|
||||
return String(Pandemonium::api->pandemonium_string_replacen(&_pandemonium_string, what._pandemonium_string, forwhat._pandemonium_string));
|
||||
}
|
||||
|
||||
int String::rfind(String p_what, int p_from) const {
|
||||
return pandemonium::api->pandemonium_string_rfind_from(&_pandemonium_string, p_what._pandemonium_string, p_from);
|
||||
return Pandemonium::api->pandemonium_string_rfind_from(&_pandemonium_string, p_what._pandemonium_string, p_from);
|
||||
}
|
||||
|
||||
int String::rfindn(String p_what, int p_from) const {
|
||||
return pandemonium::api->pandemonium_string_rfindn_from(&_pandemonium_string, p_what._pandemonium_string, p_from);
|
||||
return Pandemonium::api->pandemonium_string_rfindn_from(&_pandemonium_string, p_what._pandemonium_string, p_from);
|
||||
}
|
||||
|
||||
String String::right(int position) const {
|
||||
return String(pandemonium::api->pandemonium_string_right(&_pandemonium_string, position));
|
||||
return String(Pandemonium::api->pandemonium_string_right(&_pandemonium_string, position));
|
||||
}
|
||||
|
||||
PoolByteArray String::sha256_buffer() const {
|
||||
pandemonium_pool_byte_array arr = pandemonium::api->pandemonium_string_sha256_buffer(&_pandemonium_string);
|
||||
pandemonium_pool_byte_array arr = Pandemonium::api->pandemonium_string_sha256_buffer(&_pandemonium_string);
|
||||
return PoolByteArray(arr);
|
||||
}
|
||||
|
||||
String String::sha256_text() const {
|
||||
return String(pandemonium::api->pandemonium_string_sha256_text(&_pandemonium_string));
|
||||
return String(Pandemonium::api->pandemonium_string_sha256_text(&_pandemonium_string));
|
||||
}
|
||||
|
||||
float String::similarity(String text) const {
|
||||
return pandemonium::api->pandemonium_string_similarity(&_pandemonium_string, &text._pandemonium_string);
|
||||
return Pandemonium::api->pandemonium_string_similarity(&_pandemonium_string, &text._pandemonium_string);
|
||||
}
|
||||
|
||||
// TODO Suport allow_empty
|
||||
PoolStringArray String::split(String divisor, bool /*allow_empty*/) const {
|
||||
pandemonium_pool_string_array arr = pandemonium::api->pandemonium_string_split(&_pandemonium_string, &divisor._pandemonium_string);
|
||||
pandemonium_pool_string_array arr = Pandemonium::api->pandemonium_string_split(&_pandemonium_string, &divisor._pandemonium_string);
|
||||
return PoolStringArray(arr);
|
||||
}
|
||||
|
||||
// TODO Suport allow_empty
|
||||
PoolIntArray String::split_ints(String divisor, bool /*allow_empty*/) const {
|
||||
pandemonium_array arr = pandemonium::api->pandemonium_string_split_floats(&_pandemonium_string, &divisor._pandemonium_string);
|
||||
pandemonium_array arr = Pandemonium::api->pandemonium_string_split_floats(&_pandemonium_string, &divisor._pandemonium_string);
|
||||
return Array(arr);
|
||||
}
|
||||
|
||||
// TODO Suport allow_empty
|
||||
PoolRealArray String::split_floats(String divisor, bool /*allow_empty*/) const {
|
||||
// TODO The GDNative API returns pandemonium_array, when according to the doc, it should have been pandemonium_pool_real_array
|
||||
pandemonium_array arr = pandemonium::api->pandemonium_string_split_floats(&_pandemonium_string, &divisor._pandemonium_string);
|
||||
pandemonium_array arr = Pandemonium::api->pandemonium_string_split_floats(&_pandemonium_string, &divisor._pandemonium_string);
|
||||
Array wrapped_array(arr);
|
||||
return PoolRealArray(wrapped_array);
|
||||
}
|
||||
|
||||
String String::strip_edges(bool left, bool right) const {
|
||||
return String(pandemonium::api->pandemonium_string_strip_edges(&_pandemonium_string, left, right));
|
||||
return String(Pandemonium::api->pandemonium_string_strip_edges(&_pandemonium_string, left, right));
|
||||
}
|
||||
|
||||
String String::substr(int from, int len) const {
|
||||
return String(pandemonium::api->pandemonium_string_substr(&_pandemonium_string, from, len));
|
||||
return String(Pandemonium::api->pandemonium_string_substr(&_pandemonium_string, from, len));
|
||||
}
|
||||
|
||||
float String::to_float() const {
|
||||
return pandemonium::api->pandemonium_string_to_float(&_pandemonium_string);
|
||||
return Pandemonium::api->pandemonium_string_to_float(&_pandemonium_string);
|
||||
}
|
||||
|
||||
int64_t String::to_int() const {
|
||||
return pandemonium::api->pandemonium_string_to_int(&_pandemonium_string);
|
||||
return Pandemonium::api->pandemonium_string_to_int(&_pandemonium_string);
|
||||
}
|
||||
|
||||
String String::to_lower() const {
|
||||
return String(pandemonium::api->pandemonium_string_to_lower(&_pandemonium_string));
|
||||
return String(Pandemonium::api->pandemonium_string_to_lower(&_pandemonium_string));
|
||||
}
|
||||
|
||||
String String::to_upper() const {
|
||||
return String(pandemonium::api->pandemonium_string_to_upper(&_pandemonium_string));
|
||||
return String(Pandemonium::api->pandemonium_string_to_upper(&_pandemonium_string));
|
||||
}
|
||||
|
||||
String String::xml_escape() const {
|
||||
return String(pandemonium::api->pandemonium_string_xml_escape(&_pandemonium_string));
|
||||
return String(Pandemonium::api->pandemonium_string_xml_escape(&_pandemonium_string));
|
||||
}
|
||||
|
||||
String String::xml_unescape() const {
|
||||
return String(pandemonium::api->pandemonium_string_xml_unescape(&_pandemonium_string));
|
||||
return String(Pandemonium::api->pandemonium_string_xml_unescape(&_pandemonium_string));
|
||||
}
|
||||
|
||||
signed char String::casecmp_to(String p_str) const {
|
||||
return pandemonium::api->pandemonium_string_casecmp_to(&_pandemonium_string, &p_str._pandemonium_string);
|
||||
return Pandemonium::api->pandemonium_string_casecmp_to(&_pandemonium_string, &p_str._pandemonium_string);
|
||||
}
|
||||
|
||||
signed char String::nocasecmp_to(String p_str) const {
|
||||
return pandemonium::api->pandemonium_string_nocasecmp_to(&_pandemonium_string, &p_str._pandemonium_string);
|
||||
return Pandemonium::api->pandemonium_string_nocasecmp_to(&_pandemonium_string, &p_str._pandemonium_string);
|
||||
}
|
||||
|
||||
signed char String::naturalnocasecmp_to(String p_str) const {
|
||||
return pandemonium::api->pandemonium_string_naturalnocasecmp_to(&_pandemonium_string, &p_str._pandemonium_string);
|
||||
return Pandemonium::api->pandemonium_string_naturalnocasecmp_to(&_pandemonium_string, &p_str._pandemonium_string);
|
||||
}
|
||||
|
||||
String String::dedent() const {
|
||||
pandemonium_string s = pandemonium::api->pandemonium_string_dedent(&_pandemonium_string);
|
||||
pandemonium_string s = Pandemonium::api->pandemonium_string_dedent(&_pandemonium_string);
|
||||
return String(s);
|
||||
}
|
||||
|
||||
PoolStringArray String::rsplit(const String &divisor, const bool allow_empty, const int maxsplit) const {
|
||||
pandemonium_pool_string_array arr =
|
||||
pandemonium::api->pandemonium_string_rsplit_maxsplit(&_pandemonium_string, &divisor._pandemonium_string, allow_empty, maxsplit);
|
||||
Pandemonium::api->pandemonium_string_rsplit_maxsplit(&_pandemonium_string, &divisor._pandemonium_string, allow_empty, maxsplit);
|
||||
return PoolStringArray(arr);
|
||||
}
|
||||
|
||||
String String::rstrip(const String &chars) const {
|
||||
pandemonium_string s = pandemonium::api->pandemonium_string_rstrip(&_pandemonium_string, &chars._pandemonium_string);
|
||||
pandemonium_string s = Pandemonium::api->pandemonium_string_rstrip(&_pandemonium_string, &chars._pandemonium_string);
|
||||
return String(s);
|
||||
}
|
||||
|
||||
String String::trim_prefix(const String &prefix) const {
|
||||
pandemonium_string s = pandemonium::api->pandemonium_string_trim_prefix(&_pandemonium_string, &prefix._pandemonium_string);
|
||||
pandemonium_string s = Pandemonium::api->pandemonium_string_trim_prefix(&_pandemonium_string, &prefix._pandemonium_string);
|
||||
return String(s);
|
||||
}
|
||||
|
||||
String String::trim_suffix(const String &suffix) const {
|
||||
pandemonium_string s = pandemonium::api->pandemonium_string_trim_suffix(&_pandemonium_string, &suffix._pandemonium_string);
|
||||
pandemonium_string s = Pandemonium::api->pandemonium_string_trim_suffix(&_pandemonium_string, &suffix._pandemonium_string);
|
||||
return String(s);
|
||||
}
|
||||
|
||||
} // namespace pandemonium
|
||||
|
||||
|
@ -34,190 +34,188 @@
|
||||
|
||||
#include "core_types.h"
|
||||
#include "defs.h"
|
||||
#include "pandemonium_global.h"
|
||||
#include "object.h"
|
||||
|
||||
namespace pandemonium {
|
||||
#include "pandemonium_global.h"
|
||||
|
||||
Variant::Variant() {
|
||||
pandemonium::api->pandemonium_variant_new_nil(&_pandemonium_variant);
|
||||
Pandemonium::api->pandemonium_variant_new_nil(&_pandemonium_variant);
|
||||
}
|
||||
|
||||
Variant::Variant(const Variant &v) {
|
||||
pandemonium::api->pandemonium_variant_new_copy(&_pandemonium_variant, &v._pandemonium_variant);
|
||||
Pandemonium::api->pandemonium_variant_new_copy(&_pandemonium_variant, &v._pandemonium_variant);
|
||||
}
|
||||
|
||||
Variant::Variant(bool p_bool) {
|
||||
pandemonium::api->pandemonium_variant_new_bool(&_pandemonium_variant, p_bool);
|
||||
Pandemonium::api->pandemonium_variant_new_bool(&_pandemonium_variant, p_bool);
|
||||
}
|
||||
|
||||
Variant::Variant(signed int p_int) // real one
|
||||
{
|
||||
pandemonium::api->pandemonium_variant_new_int(&_pandemonium_variant, p_int);
|
||||
Pandemonium::api->pandemonium_variant_new_int(&_pandemonium_variant, p_int);
|
||||
}
|
||||
|
||||
Variant::Variant(unsigned int p_int) {
|
||||
pandemonium::api->pandemonium_variant_new_uint(&_pandemonium_variant, p_int);
|
||||
Pandemonium::api->pandemonium_variant_new_uint(&_pandemonium_variant, p_int);
|
||||
}
|
||||
|
||||
Variant::Variant(signed short p_short) // real one
|
||||
{
|
||||
pandemonium::api->pandemonium_variant_new_int(&_pandemonium_variant, (int)p_short);
|
||||
Pandemonium::api->pandemonium_variant_new_int(&_pandemonium_variant, (int)p_short);
|
||||
}
|
||||
|
||||
Variant::Variant(int64_t p_char) // real one
|
||||
{
|
||||
pandemonium::api->pandemonium_variant_new_int(&_pandemonium_variant, p_char);
|
||||
Pandemonium::api->pandemonium_variant_new_int(&_pandemonium_variant, p_char);
|
||||
}
|
||||
|
||||
Variant::Variant(uint64_t p_char) {
|
||||
pandemonium::api->pandemonium_variant_new_uint(&_pandemonium_variant, p_char);
|
||||
Pandemonium::api->pandemonium_variant_new_uint(&_pandemonium_variant, p_char);
|
||||
}
|
||||
|
||||
Variant::Variant(float p_float) {
|
||||
pandemonium::api->pandemonium_variant_new_real(&_pandemonium_variant, p_float);
|
||||
Pandemonium::api->pandemonium_variant_new_real(&_pandemonium_variant, p_float);
|
||||
}
|
||||
|
||||
Variant::Variant(double p_double) {
|
||||
pandemonium::api->pandemonium_variant_new_real(&_pandemonium_variant, p_double);
|
||||
Pandemonium::api->pandemonium_variant_new_real(&_pandemonium_variant, p_double);
|
||||
}
|
||||
|
||||
Variant::Variant(const String &p_string) {
|
||||
pandemonium::api->pandemonium_variant_new_string(&_pandemonium_variant, (pandemonium_string *)&p_string);
|
||||
Pandemonium::api->pandemonium_variant_new_string(&_pandemonium_variant, (pandemonium_string *)&p_string);
|
||||
}
|
||||
|
||||
Variant::Variant(const StringName &p_string) {
|
||||
pandemonium::api->pandemonium_variant_new_string_name(&_pandemonium_variant, (pandemonium_string_name *)&p_string);
|
||||
Pandemonium::api->pandemonium_variant_new_string_name(&_pandemonium_variant, (pandemonium_string_name *)&p_string);
|
||||
}
|
||||
|
||||
Variant::Variant(const char *const p_cstring) {
|
||||
String s = String(p_cstring);
|
||||
pandemonium::api->pandemonium_variant_new_string(&_pandemonium_variant, (pandemonium_string *)&s);
|
||||
Pandemonium::api->pandemonium_variant_new_string(&_pandemonium_variant, (pandemonium_string *)&s);
|
||||
}
|
||||
|
||||
Variant::Variant(const wchar_t *p_wstring) {
|
||||
String s = p_wstring;
|
||||
pandemonium::api->pandemonium_variant_new_string(&_pandemonium_variant, (pandemonium_string *)&s);
|
||||
Pandemonium::api->pandemonium_variant_new_string(&_pandemonium_variant, (pandemonium_string *)&s);
|
||||
}
|
||||
|
||||
Variant::Variant(const Vector2 &p_vector2) {
|
||||
pandemonium::api->pandemonium_variant_new_vector2(&_pandemonium_variant, (pandemonium_vector2 *)&p_vector2);
|
||||
Pandemonium::api->pandemonium_variant_new_vector2(&_pandemonium_variant, (pandemonium_vector2 *)&p_vector2);
|
||||
}
|
||||
|
||||
Variant::Variant(const Vector2i &p_vector2i) {
|
||||
pandemonium::api->pandemonium_variant_new_vector2i(&_pandemonium_variant, (pandemonium_vector2i *)&p_vector2i);
|
||||
Pandemonium::api->pandemonium_variant_new_vector2i(&_pandemonium_variant, (pandemonium_vector2i *)&p_vector2i);
|
||||
}
|
||||
|
||||
Variant::Variant(const Rect2 &p_rect2) {
|
||||
pandemonium::api->pandemonium_variant_new_rect2(&_pandemonium_variant, (pandemonium_rect2 *)&p_rect2);
|
||||
Pandemonium::api->pandemonium_variant_new_rect2(&_pandemonium_variant, (pandemonium_rect2 *)&p_rect2);
|
||||
}
|
||||
|
||||
Variant::Variant(const Rect2i &p_rect2i) {
|
||||
pandemonium::api->pandemonium_variant_new_rect2i(&_pandemonium_variant, (pandemonium_rect2i *)&p_rect2i);
|
||||
Pandemonium::api->pandemonium_variant_new_rect2i(&_pandemonium_variant, (pandemonium_rect2i *)&p_rect2i);
|
||||
}
|
||||
|
||||
Variant::Variant(const Vector3 &p_vector3) {
|
||||
pandemonium::api->pandemonium_variant_new_vector3(&_pandemonium_variant, (pandemonium_vector3 *)&p_vector3);
|
||||
Pandemonium::api->pandemonium_variant_new_vector3(&_pandemonium_variant, (pandemonium_vector3 *)&p_vector3);
|
||||
}
|
||||
|
||||
Variant::Variant(const Vector3i &p_vector3i) {
|
||||
pandemonium::api->pandemonium_variant_new_vector3i(&_pandemonium_variant, (pandemonium_vector3i *)&p_vector3i);
|
||||
Pandemonium::api->pandemonium_variant_new_vector3i(&_pandemonium_variant, (pandemonium_vector3i *)&p_vector3i);
|
||||
}
|
||||
|
||||
Variant::Variant(const Vector4 &p_vector4) {
|
||||
pandemonium::api->pandemonium_variant_new_vector4(&_pandemonium_variant, (pandemonium_vector4 *)&p_vector4);
|
||||
Pandemonium::api->pandemonium_variant_new_vector4(&_pandemonium_variant, (pandemonium_vector4 *)&p_vector4);
|
||||
}
|
||||
|
||||
Variant::Variant(const Vector4i &p_vector4i) {
|
||||
pandemonium::api->pandemonium_variant_new_vector4i(&_pandemonium_variant, (pandemonium_vector4i *)&p_vector4i);
|
||||
Pandemonium::api->pandemonium_variant_new_vector4i(&_pandemonium_variant, (pandemonium_vector4i *)&p_vector4i);
|
||||
}
|
||||
|
||||
Variant::Variant(const Plane &p_plane) {
|
||||
pandemonium::api->pandemonium_variant_new_plane(&_pandemonium_variant, (pandemonium_plane *)&p_plane);
|
||||
Pandemonium::api->pandemonium_variant_new_plane(&_pandemonium_variant, (pandemonium_plane *)&p_plane);
|
||||
}
|
||||
|
||||
Variant::Variant(const pandemonium::AABB &p_aabb) {
|
||||
pandemonium::api->pandemonium_variant_new_aabb(&_pandemonium_variant, (pandemonium_aabb *)&p_aabb);
|
||||
Variant::Variant(const ::AABB &p_aabb) {
|
||||
Pandemonium::api->pandemonium_variant_new_aabb(&_pandemonium_variant, (pandemonium_aabb *)&p_aabb);
|
||||
}
|
||||
|
||||
Variant::Variant(const Quaternion &p_quaternion) {
|
||||
pandemonium::api->pandemonium_variant_new_quaternion(&_pandemonium_variant, (pandemonium_quaternion *)&p_quaternion);
|
||||
Pandemonium::api->pandemonium_variant_new_quaternion(&_pandemonium_variant, (pandemonium_quaternion *)&p_quaternion);
|
||||
}
|
||||
|
||||
Variant::Variant(const Basis &p_transform) {
|
||||
pandemonium::api->pandemonium_variant_new_basis(&_pandemonium_variant, (pandemonium_basis *)&p_transform);
|
||||
Pandemonium::api->pandemonium_variant_new_basis(&_pandemonium_variant, (pandemonium_basis *)&p_transform);
|
||||
}
|
||||
|
||||
Variant::Variant(const Transform2D &p_transform) {
|
||||
pandemonium::api->pandemonium_variant_new_transform2d(&_pandemonium_variant, (pandemonium_transform2d *)&p_transform);
|
||||
Pandemonium::api->pandemonium_variant_new_transform2d(&_pandemonium_variant, (pandemonium_transform2d *)&p_transform);
|
||||
}
|
||||
|
||||
Variant::Variant(const Transform &p_transform) {
|
||||
pandemonium::api->pandemonium_variant_new_transform(&_pandemonium_variant, (pandemonium_transform *)&p_transform);
|
||||
Pandemonium::api->pandemonium_variant_new_transform(&_pandemonium_variant, (pandemonium_transform *)&p_transform);
|
||||
}
|
||||
|
||||
Variant::Variant(const Projection &p_projection) {
|
||||
pandemonium::api->pandemonium_variant_new_projection(&_pandemonium_variant, (pandemonium_projection *)&p_projection);
|
||||
Pandemonium::api->pandemonium_variant_new_projection(&_pandemonium_variant, (pandemonium_projection *)&p_projection);
|
||||
}
|
||||
|
||||
Variant::Variant(const Color &p_color) {
|
||||
pandemonium::api->pandemonium_variant_new_color(&_pandemonium_variant, (pandemonium_color *)&p_color);
|
||||
Pandemonium::api->pandemonium_variant_new_color(&_pandemonium_variant, (pandemonium_color *)&p_color);
|
||||
}
|
||||
|
||||
Variant::Variant(const NodePath &p_path) {
|
||||
pandemonium::api->pandemonium_variant_new_node_path(&_pandemonium_variant, (pandemonium_node_path *)&p_path);
|
||||
Pandemonium::api->pandemonium_variant_new_node_path(&_pandemonium_variant, (pandemonium_node_path *)&p_path);
|
||||
}
|
||||
|
||||
Variant::Variant(const pandemonium::RID &p_rid) {
|
||||
pandemonium::api->pandemonium_variant_new_rid(&_pandemonium_variant, (pandemonium_rid *)&p_rid);
|
||||
Variant::Variant(const ::RID &p_rid) {
|
||||
Pandemonium::api->pandemonium_variant_new_rid(&_pandemonium_variant, (pandemonium_rid *)&p_rid);
|
||||
}
|
||||
|
||||
Variant::Variant(const Object *p_object) {
|
||||
if (p_object)
|
||||
pandemonium::api->pandemonium_variant_new_object(&_pandemonium_variant, p_object->_owner);
|
||||
Pandemonium::api->pandemonium_variant_new_object(&_pandemonium_variant, p_object->_owner);
|
||||
else
|
||||
pandemonium::api->pandemonium_variant_new_nil(&_pandemonium_variant);
|
||||
Pandemonium::api->pandemonium_variant_new_nil(&_pandemonium_variant);
|
||||
}
|
||||
|
||||
Variant::Variant(const Dictionary &p_dictionary) {
|
||||
pandemonium::api->pandemonium_variant_new_dictionary(&_pandemonium_variant, (pandemonium_dictionary *)&p_dictionary);
|
||||
Pandemonium::api->pandemonium_variant_new_dictionary(&_pandemonium_variant, (pandemonium_dictionary *)&p_dictionary);
|
||||
}
|
||||
|
||||
Variant::Variant(const Array &p_array) {
|
||||
pandemonium::api->pandemonium_variant_new_array(&_pandemonium_variant, (pandemonium_array *)&p_array);
|
||||
Pandemonium::api->pandemonium_variant_new_array(&_pandemonium_variant, (pandemonium_array *)&p_array);
|
||||
}
|
||||
|
||||
Variant::Variant(const PoolByteArray &p_raw_array) {
|
||||
pandemonium::api->pandemonium_variant_new_pool_byte_array(&_pandemonium_variant, (pandemonium_pool_byte_array *)&p_raw_array);
|
||||
Pandemonium::api->pandemonium_variant_new_pool_byte_array(&_pandemonium_variant, (pandemonium_pool_byte_array *)&p_raw_array);
|
||||
}
|
||||
|
||||
Variant::Variant(const PoolIntArray &p_int_array) {
|
||||
pandemonium::api->pandemonium_variant_new_pool_int_array(&_pandemonium_variant, (pandemonium_pool_int_array *)&p_int_array);
|
||||
Pandemonium::api->pandemonium_variant_new_pool_int_array(&_pandemonium_variant, (pandemonium_pool_int_array *)&p_int_array);
|
||||
}
|
||||
|
||||
Variant::Variant(const PoolRealArray &p_real_array) {
|
||||
pandemonium::api->pandemonium_variant_new_pool_real_array(&_pandemonium_variant, (pandemonium_pool_real_array *)&p_real_array);
|
||||
Pandemonium::api->pandemonium_variant_new_pool_real_array(&_pandemonium_variant, (pandemonium_pool_real_array *)&p_real_array);
|
||||
}
|
||||
|
||||
Variant::Variant(const PoolStringArray &p_string_array) {
|
||||
pandemonium::api->pandemonium_variant_new_pool_string_array(&_pandemonium_variant, (pandemonium_pool_string_array *)&p_string_array);
|
||||
Pandemonium::api->pandemonium_variant_new_pool_string_array(&_pandemonium_variant, (pandemonium_pool_string_array *)&p_string_array);
|
||||
}
|
||||
|
||||
Variant::Variant(const PoolVector2Array &p_vector2_array) {
|
||||
pandemonium::api->pandemonium_variant_new_pool_vector2_array(&_pandemonium_variant, (pandemonium_pool_vector2_array *)&p_vector2_array);
|
||||
Pandemonium::api->pandemonium_variant_new_pool_vector2_array(&_pandemonium_variant, (pandemonium_pool_vector2_array *)&p_vector2_array);
|
||||
}
|
||||
|
||||
Variant::Variant(const PoolVector3Array &p_vector3_array) {
|
||||
pandemonium::api->pandemonium_variant_new_pool_vector3_array(&_pandemonium_variant, (pandemonium_pool_vector3_array *)&p_vector3_array);
|
||||
Pandemonium::api->pandemonium_variant_new_pool_vector3_array(&_pandemonium_variant, (pandemonium_pool_vector3_array *)&p_vector3_array);
|
||||
}
|
||||
|
||||
Variant::Variant(const PoolColorArray &p_color_array) {
|
||||
pandemonium::api->pandemonium_variant_new_pool_color_array(&_pandemonium_variant, (pandemonium_pool_color_array *)&p_color_array);
|
||||
Pandemonium::api->pandemonium_variant_new_pool_color_array(&_pandemonium_variant, (pandemonium_pool_color_array *)&p_color_array);
|
||||
}
|
||||
|
||||
Variant &Variant::operator=(const Variant &v) {
|
||||
pandemonium::api->pandemonium_variant_destroy(&_pandemonium_variant);
|
||||
pandemonium::api->pandemonium_variant_new_copy(&_pandemonium_variant, &v._pandemonium_variant);
|
||||
Pandemonium::api->pandemonium_variant_destroy(&_pandemonium_variant);
|
||||
Pandemonium::api->pandemonium_variant_new_copy(&_pandemonium_variant, &v._pandemonium_variant);
|
||||
return *this;
|
||||
}
|
||||
|
||||
@ -225,182 +223,182 @@ Variant::operator bool() const {
|
||||
return booleanize();
|
||||
}
|
||||
Variant::operator signed int() const {
|
||||
return pandemonium::api->pandemonium_variant_as_int(&_pandemonium_variant);
|
||||
return Pandemonium::api->pandemonium_variant_as_int(&_pandemonium_variant);
|
||||
}
|
||||
Variant::operator unsigned int() const // this is the real one
|
||||
{
|
||||
return pandemonium::api->pandemonium_variant_as_uint(&_pandemonium_variant);
|
||||
return Pandemonium::api->pandemonium_variant_as_uint(&_pandemonium_variant);
|
||||
}
|
||||
Variant::operator signed short() const {
|
||||
return pandemonium::api->pandemonium_variant_as_int(&_pandemonium_variant);
|
||||
return Pandemonium::api->pandemonium_variant_as_int(&_pandemonium_variant);
|
||||
}
|
||||
Variant::operator unsigned short() const {
|
||||
return pandemonium::api->pandemonium_variant_as_uint(&_pandemonium_variant);
|
||||
return Pandemonium::api->pandemonium_variant_as_uint(&_pandemonium_variant);
|
||||
}
|
||||
Variant::operator signed char() const {
|
||||
return pandemonium::api->pandemonium_variant_as_int(&_pandemonium_variant);
|
||||
return Pandemonium::api->pandemonium_variant_as_int(&_pandemonium_variant);
|
||||
}
|
||||
Variant::operator unsigned char() const {
|
||||
return pandemonium::api->pandemonium_variant_as_uint(&_pandemonium_variant);
|
||||
return Pandemonium::api->pandemonium_variant_as_uint(&_pandemonium_variant);
|
||||
}
|
||||
Variant::operator int64_t() const {
|
||||
return pandemonium::api->pandemonium_variant_as_int(&_pandemonium_variant);
|
||||
return Pandemonium::api->pandemonium_variant_as_int(&_pandemonium_variant);
|
||||
}
|
||||
Variant::operator uint64_t() const {
|
||||
return pandemonium::api->pandemonium_variant_as_uint(&_pandemonium_variant);
|
||||
return Pandemonium::api->pandemonium_variant_as_uint(&_pandemonium_variant);
|
||||
}
|
||||
|
||||
Variant::operator wchar_t() const {
|
||||
return pandemonium::api->pandemonium_variant_as_int(&_pandemonium_variant);
|
||||
return Pandemonium::api->pandemonium_variant_as_int(&_pandemonium_variant);
|
||||
}
|
||||
|
||||
Variant::operator float() const {
|
||||
return pandemonium::api->pandemonium_variant_as_real(&_pandemonium_variant);
|
||||
return Pandemonium::api->pandemonium_variant_as_real(&_pandemonium_variant);
|
||||
}
|
||||
|
||||
Variant::operator double() const {
|
||||
return pandemonium::api->pandemonium_variant_as_real(&_pandemonium_variant);
|
||||
return Pandemonium::api->pandemonium_variant_as_real(&_pandemonium_variant);
|
||||
}
|
||||
Variant::operator String() const {
|
||||
pandemonium_string s = pandemonium::api->pandemonium_variant_as_string(&_pandemonium_variant);
|
||||
pandemonium_string s = Pandemonium::api->pandemonium_variant_as_string(&_pandemonium_variant);
|
||||
return String(s);
|
||||
}
|
||||
Variant::operator StringName() const {
|
||||
pandemonium_string_name s = pandemonium::api->pandemonium_variant_as_string_name(&_pandemonium_variant);
|
||||
pandemonium_string_name s = Pandemonium::api->pandemonium_variant_as_string_name(&_pandemonium_variant);
|
||||
return StringName(s);
|
||||
}
|
||||
Variant::operator Vector2() const {
|
||||
pandemonium_vector2 s = pandemonium::api->pandemonium_variant_as_vector2(&_pandemonium_variant);
|
||||
pandemonium_vector2 s = Pandemonium::api->pandemonium_variant_as_vector2(&_pandemonium_variant);
|
||||
return *(Vector2 *)&s;
|
||||
}
|
||||
Variant::operator Vector2i() const {
|
||||
pandemonium_vector2i s = pandemonium::api->pandemonium_variant_as_vector2i(&_pandemonium_variant);
|
||||
pandemonium_vector2i s = Pandemonium::api->pandemonium_variant_as_vector2i(&_pandemonium_variant);
|
||||
return *(Vector2i *)&s;
|
||||
}
|
||||
Variant::operator Rect2() const {
|
||||
pandemonium_rect2 s = pandemonium::api->pandemonium_variant_as_rect2(&_pandemonium_variant);
|
||||
pandemonium_rect2 s = Pandemonium::api->pandemonium_variant_as_rect2(&_pandemonium_variant);
|
||||
return *(Rect2 *)&s;
|
||||
}
|
||||
Variant::operator Rect2i() const {
|
||||
pandemonium_rect2i s = pandemonium::api->pandemonium_variant_as_rect2i(&_pandemonium_variant);
|
||||
pandemonium_rect2i s = Pandemonium::api->pandemonium_variant_as_rect2i(&_pandemonium_variant);
|
||||
return *(Rect2i *)&s;
|
||||
}
|
||||
Variant::operator Vector3() const {
|
||||
pandemonium_vector3 s = pandemonium::api->pandemonium_variant_as_vector3(&_pandemonium_variant);
|
||||
pandemonium_vector3 s = Pandemonium::api->pandemonium_variant_as_vector3(&_pandemonium_variant);
|
||||
return *(Vector3 *)&s;
|
||||
}
|
||||
Variant::operator Vector3i() const {
|
||||
pandemonium_vector3i s = pandemonium::api->pandemonium_variant_as_vector3i(&_pandemonium_variant);
|
||||
pandemonium_vector3i s = Pandemonium::api->pandemonium_variant_as_vector3i(&_pandemonium_variant);
|
||||
return *(Vector3i *)&s;
|
||||
}
|
||||
Variant::operator Vector4() const {
|
||||
pandemonium_vector4 s = pandemonium::api->pandemonium_variant_as_vector4(&_pandemonium_variant);
|
||||
pandemonium_vector4 s = Pandemonium::api->pandemonium_variant_as_vector4(&_pandemonium_variant);
|
||||
return *(Vector4 *)&s;
|
||||
}
|
||||
Variant::operator Vector4i() const {
|
||||
pandemonium_vector4i s = pandemonium::api->pandemonium_variant_as_vector4i(&_pandemonium_variant);
|
||||
pandemonium_vector4i s = Pandemonium::api->pandemonium_variant_as_vector4i(&_pandemonium_variant);
|
||||
return *(Vector4i *)&s;
|
||||
}
|
||||
Variant::operator Plane() const {
|
||||
pandemonium_plane s = pandemonium::api->pandemonium_variant_as_plane(&_pandemonium_variant);
|
||||
pandemonium_plane s = Pandemonium::api->pandemonium_variant_as_plane(&_pandemonium_variant);
|
||||
return *(Plane *)&s;
|
||||
}
|
||||
Variant::operator pandemonium::AABB() const {
|
||||
pandemonium_aabb s = pandemonium::api->pandemonium_variant_as_aabb(&_pandemonium_variant);
|
||||
return *(pandemonium::AABB *)&s;
|
||||
Variant::operator ::AABB() const {
|
||||
pandemonium_aabb s = Pandemonium::api->pandemonium_variant_as_aabb(&_pandemonium_variant);
|
||||
return *(::AABB *)&s;
|
||||
}
|
||||
Variant::operator Quaternion() const {
|
||||
pandemonium_quaternion s = pandemonium::api->pandemonium_variant_as_quaternion(&_pandemonium_variant);
|
||||
pandemonium_quaternion s = Pandemonium::api->pandemonium_variant_as_quaternion(&_pandemonium_variant);
|
||||
return *(Quaternion *)&s;
|
||||
}
|
||||
Variant::operator Basis() const {
|
||||
pandemonium_basis s = pandemonium::api->pandemonium_variant_as_basis(&_pandemonium_variant);
|
||||
pandemonium_basis s = Pandemonium::api->pandemonium_variant_as_basis(&_pandemonium_variant);
|
||||
return *(Basis *)&s;
|
||||
}
|
||||
Variant::operator Transform() const {
|
||||
pandemonium_transform s = pandemonium::api->pandemonium_variant_as_transform(&_pandemonium_variant);
|
||||
pandemonium_transform s = Pandemonium::api->pandemonium_variant_as_transform(&_pandemonium_variant);
|
||||
return *(Transform *)&s;
|
||||
}
|
||||
Variant::operator Transform2D() const {
|
||||
pandemonium_transform2d s = pandemonium::api->pandemonium_variant_as_transform2d(&_pandemonium_variant);
|
||||
pandemonium_transform2d s = Pandemonium::api->pandemonium_variant_as_transform2d(&_pandemonium_variant);
|
||||
return *(Transform2D *)&s;
|
||||
}
|
||||
Variant::operator Projection() const {
|
||||
pandemonium_projection s = pandemonium::api->pandemonium_variant_as_projection(&_pandemonium_variant);
|
||||
pandemonium_projection s = Pandemonium::api->pandemonium_variant_as_projection(&_pandemonium_variant);
|
||||
return *(Projection *)&s;
|
||||
}
|
||||
|
||||
Variant::operator Color() const {
|
||||
pandemonium_color s = pandemonium::api->pandemonium_variant_as_color(&_pandemonium_variant);
|
||||
pandemonium_color s = Pandemonium::api->pandemonium_variant_as_color(&_pandemonium_variant);
|
||||
return *(Color *)&s;
|
||||
}
|
||||
Variant::operator NodePath() const {
|
||||
pandemonium_node_path ret = pandemonium::api->pandemonium_variant_as_node_path(&_pandemonium_variant);
|
||||
pandemonium_node_path ret = Pandemonium::api->pandemonium_variant_as_node_path(&_pandemonium_variant);
|
||||
return NodePath(ret);
|
||||
}
|
||||
Variant::operator pandemonium::RID() const {
|
||||
pandemonium_rid s = pandemonium::api->pandemonium_variant_as_rid(&_pandemonium_variant);
|
||||
return *(pandemonium::RID *)&s;
|
||||
Variant::operator ::RID() const {
|
||||
pandemonium_rid s = Pandemonium::api->pandemonium_variant_as_rid(&_pandemonium_variant);
|
||||
return *(::RID *)&s;
|
||||
}
|
||||
|
||||
Variant::operator Dictionary() const {
|
||||
Dictionary ret(pandemonium::api->pandemonium_variant_as_dictionary(&_pandemonium_variant));
|
||||
Dictionary ret(Pandemonium::api->pandemonium_variant_as_dictionary(&_pandemonium_variant));
|
||||
return ret;
|
||||
}
|
||||
|
||||
Variant::operator Array() const {
|
||||
Array ret(pandemonium::api->pandemonium_variant_as_array(&_pandemonium_variant));
|
||||
Array ret(Pandemonium::api->pandemonium_variant_as_array(&_pandemonium_variant));
|
||||
return ret;
|
||||
}
|
||||
|
||||
Variant::operator PoolByteArray() const {
|
||||
pandemonium_pool_byte_array ret = pandemonium::api->pandemonium_variant_as_pool_byte_array(&_pandemonium_variant);
|
||||
pandemonium_pool_byte_array ret = Pandemonium::api->pandemonium_variant_as_pool_byte_array(&_pandemonium_variant);
|
||||
return PoolByteArray(ret);
|
||||
}
|
||||
Variant::operator PoolIntArray() const {
|
||||
pandemonium_pool_int_array ret = pandemonium::api->pandemonium_variant_as_pool_int_array(&_pandemonium_variant);
|
||||
pandemonium_pool_int_array ret = Pandemonium::api->pandemonium_variant_as_pool_int_array(&_pandemonium_variant);
|
||||
return PoolIntArray(ret);
|
||||
}
|
||||
Variant::operator PoolRealArray() const {
|
||||
pandemonium_pool_real_array ret = pandemonium::api->pandemonium_variant_as_pool_real_array(&_pandemonium_variant);
|
||||
pandemonium_pool_real_array ret = Pandemonium::api->pandemonium_variant_as_pool_real_array(&_pandemonium_variant);
|
||||
return PoolRealArray(ret);
|
||||
}
|
||||
Variant::operator PoolStringArray() const {
|
||||
pandemonium_pool_string_array ret = pandemonium::api->pandemonium_variant_as_pool_string_array(&_pandemonium_variant);
|
||||
pandemonium_pool_string_array ret = Pandemonium::api->pandemonium_variant_as_pool_string_array(&_pandemonium_variant);
|
||||
return PoolStringArray(ret);
|
||||
}
|
||||
Variant::operator PoolVector2Array() const {
|
||||
pandemonium_pool_vector2_array ret = pandemonium::api->pandemonium_variant_as_pool_vector2_array(&_pandemonium_variant);
|
||||
pandemonium_pool_vector2_array ret = Pandemonium::api->pandemonium_variant_as_pool_vector2_array(&_pandemonium_variant);
|
||||
return PoolVector2Array(ret);
|
||||
}
|
||||
Variant::operator PoolVector3Array() const {
|
||||
pandemonium_pool_vector3_array ret = pandemonium::api->pandemonium_variant_as_pool_vector3_array(&_pandemonium_variant);
|
||||
pandemonium_pool_vector3_array ret = Pandemonium::api->pandemonium_variant_as_pool_vector3_array(&_pandemonium_variant);
|
||||
return PoolVector3Array(ret);
|
||||
}
|
||||
Variant::operator PoolColorArray() const {
|
||||
pandemonium_pool_color_array ret = pandemonium::api->pandemonium_variant_as_pool_color_array(&_pandemonium_variant);
|
||||
pandemonium_pool_color_array ret = Pandemonium::api->pandemonium_variant_as_pool_color_array(&_pandemonium_variant);
|
||||
return PoolColorArray(ret);
|
||||
}
|
||||
Variant::operator pandemonium_object *() const {
|
||||
return pandemonium::api->pandemonium_variant_as_object(&_pandemonium_variant);
|
||||
return Pandemonium::api->pandemonium_variant_as_object(&_pandemonium_variant);
|
||||
}
|
||||
|
||||
Variant::Type Variant::get_type() const {
|
||||
return static_cast<Type>(pandemonium::api->pandemonium_variant_get_type(&_pandemonium_variant));
|
||||
return static_cast<Type>(Pandemonium::api->pandemonium_variant_get_type(&_pandemonium_variant));
|
||||
}
|
||||
|
||||
Variant Variant::call(const String &method, const Variant **args, const int arg_count) {
|
||||
pandemonium_variant v = pandemonium::api->pandemonium_variant_call(
|
||||
pandemonium_variant v = Pandemonium::api->pandemonium_variant_call(
|
||||
&_pandemonium_variant, (pandemonium_string *)&method, (const pandemonium_variant **)args, arg_count, nullptr);
|
||||
return Variant(v);
|
||||
}
|
||||
|
||||
bool Variant::has_method(const String &method) {
|
||||
return pandemonium::api->pandemonium_variant_has_method(&_pandemonium_variant, (pandemonium_string *)&method);
|
||||
return Pandemonium::api->pandemonium_variant_has_method(&_pandemonium_variant, (pandemonium_string *)&method);
|
||||
}
|
||||
|
||||
bool Variant::operator==(const Variant &b) const {
|
||||
return pandemonium::api->pandemonium_variant_operator_equal(&_pandemonium_variant, &b._pandemonium_variant);
|
||||
return Pandemonium::api->pandemonium_variant_operator_equal(&_pandemonium_variant, &b._pandemonium_variant);
|
||||
}
|
||||
|
||||
bool Variant::operator!=(const Variant &b) const {
|
||||
@ -408,7 +406,7 @@ bool Variant::operator!=(const Variant &b) const {
|
||||
}
|
||||
|
||||
bool Variant::operator<(const Variant &b) const {
|
||||
return pandemonium::api->pandemonium_variant_operator_less(&_pandemonium_variant, &b._pandemonium_variant);
|
||||
return Pandemonium::api->pandemonium_variant_operator_less(&_pandemonium_variant, &b._pandemonium_variant);
|
||||
}
|
||||
|
||||
bool Variant::operator<=(const Variant &b) const {
|
||||
@ -424,15 +422,13 @@ bool Variant::operator>=(const Variant &b) const {
|
||||
}
|
||||
|
||||
bool Variant::hash_compare(const Variant &b) const {
|
||||
return pandemonium::api->pandemonium_variant_hash_compare(&_pandemonium_variant, &b._pandemonium_variant);
|
||||
return Pandemonium::api->pandemonium_variant_hash_compare(&_pandemonium_variant, &b._pandemonium_variant);
|
||||
}
|
||||
|
||||
bool Variant::booleanize() const {
|
||||
return pandemonium::api->pandemonium_variant_booleanize(&_pandemonium_variant);
|
||||
return Pandemonium::api->pandemonium_variant_booleanize(&_pandemonium_variant);
|
||||
}
|
||||
|
||||
Variant::~Variant() {
|
||||
pandemonium::api->pandemonium_variant_destroy(&_pandemonium_variant);
|
||||
Pandemonium::api->pandemonium_variant_destroy(&_pandemonium_variant);
|
||||
}
|
||||
|
||||
} // namespace pandemonium
|
||||
|
@ -34,7 +34,7 @@
|
||||
|
||||
#include "ustring.h"
|
||||
|
||||
namespace pandemonium {
|
||||
|
||||
|
||||
const Vector2 Vector2::ZERO = Vector2();
|
||||
const Vector2 Vector2::ONE = Vector2(1, 1);
|
||||
@ -97,4 +97,4 @@ Vector2::operator String() const {
|
||||
return String::num(x) + ", " + String::num(y);
|
||||
}
|
||||
|
||||
} // namespace pandemonium
|
||||
|
||||
|
@ -34,10 +34,10 @@
|
||||
|
||||
#include "ustring.h"
|
||||
|
||||
namespace pandemonium {
|
||||
|
||||
|
||||
Vector2i::operator String() const {
|
||||
return String::num(x) + ", " + String::num(y);
|
||||
}
|
||||
|
||||
} // namespace pandemonium
|
||||
|
||||
|
@ -36,7 +36,7 @@
|
||||
|
||||
#include "basis.h"
|
||||
|
||||
namespace pandemonium {
|
||||
|
||||
|
||||
const Vector3 Vector3::ZERO = Vector3();
|
||||
const Vector3 Vector3::ONE = Vector3(1, 1, 1);
|
||||
@ -118,4 +118,4 @@ Vector3::operator String() const {
|
||||
return String::num(x) + ", " + String::num(y) + ", " + String::num(z);
|
||||
}
|
||||
|
||||
} // namespace pandemonium
|
||||
|
||||
|
@ -34,10 +34,10 @@
|
||||
|
||||
#include "ustring.h"
|
||||
|
||||
namespace pandemonium {
|
||||
|
||||
|
||||
Vector3i::operator String() const {
|
||||
return String::num(x) + ", " + String::num(y) + ", " + String::num(z) ;
|
||||
}
|
||||
|
||||
} // namespace pandemonium
|
||||
|
||||
|
@ -34,10 +34,10 @@
|
||||
|
||||
#include "ustring.h"
|
||||
|
||||
namespace pandemonium {
|
||||
|
||||
|
||||
Vector4::operator String() const {
|
||||
return String::num(x) + ", " + String::num(y) + ", " + String::num(z) + ", " + String::num(w);
|
||||
}
|
||||
|
||||
} // namespace pandemonium
|
||||
|
||||
|
@ -34,10 +34,10 @@
|
||||
|
||||
#include "ustring.h"
|
||||
|
||||
namespace pandemonium {
|
||||
|
||||
|
||||
Vector4i::operator String() const {
|
||||
return String::num(x) + ", " + String::num(y) + ", " + String::num(z) + ", " + String::num(w);
|
||||
}
|
||||
|
||||
} // namespace pandemonium
|
||||
|
||||
|
@ -31,7 +31,7 @@
|
||||
#include <pandemonium.h>
|
||||
#include <Reference.h>
|
||||
|
||||
using namespace pandemonium;
|
||||
|
||||
|
||||
class SimpleClass : public Reference {
|
||||
PANDEMONIUM_CLASS(SimpleClass, Reference);
|
||||
@ -69,7 +69,7 @@ public:
|
||||
register_property<SimpleClass, int>("value", &SimpleClass::set_value, &SimpleClass::get_value, 0);
|
||||
|
||||
/** Registering a signal: **/
|
||||
register_signal<SimpleClass>("signal_name0"); // windows: error C2668: 'pandemonium::register_signal': ambiguous call to overloaded function
|
||||
register_signal<SimpleClass>("signal_name0"); // windows: error C2668: 'Pandemonium::register_signal': ambiguous call to overloaded function
|
||||
register_signal<SimpleClass>("signal_name1", "string_argument", PANDEMONIUM_VARIANT_TYPE_STRING);
|
||||
}
|
||||
|
||||
@ -87,17 +87,17 @@ public:
|
||||
|
||||
/** GDNative Initialize **/
|
||||
extern "C" void GDN_EXPORT pandemonium_gdnative_init(pandemonium_gdnative_init_options *o) {
|
||||
pandemonium::Pandemonium::gdnative_init(o);
|
||||
Pandemonium::gdnative_init(o);
|
||||
}
|
||||
|
||||
/** GDNative Terminate **/
|
||||
extern "C" void GDN_EXPORT pandemonium_gdnative_terminate(pandemonium_gdnative_terminate_options *o) {
|
||||
pandemonium::Pandemonium::gdnative_terminate(o);
|
||||
Pandemonium::gdnative_terminate(o);
|
||||
}
|
||||
|
||||
/** NativeScript Initialize **/
|
||||
extern "C" void GDN_EXPORT pandemonium_nativescript_init(void *handle) {
|
||||
pandemonium::Pandemonium::nativescript_init(handle);
|
||||
Pandemonium::nativescript_init(handle);
|
||||
|
||||
pandemonium::register_class<SimpleClass>();
|
||||
Pandemonium::register_class<SimpleClass>();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user