You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-12-06 17:25:19 +00:00
Implement a BitField hint
Allows to specify the binder that an enum must be treated as a bitfield.
This commit is contained in:
@@ -147,7 +147,7 @@ void ResourceLoader::_bind_methods() {
|
||||
|
||||
////// ResourceSaver //////
|
||||
|
||||
Error ResourceSaver::save(const String &p_path, const Ref<Resource> &p_resource, uint32_t p_flags) {
|
||||
Error ResourceSaver::save(const String &p_path, const Ref<Resource> &p_resource, BitField<SaverFlags> p_flags) {
|
||||
ERR_FAIL_COND_V_MSG(p_resource.is_null(), ERR_INVALID_PARAMETER, "Can't save empty resource to path '" + String(p_path) + "'.");
|
||||
return ::ResourceSaver::save(p_path, p_resource, p_flags);
|
||||
}
|
||||
@@ -179,14 +179,14 @@ void ResourceSaver::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("add_resource_format_saver", "format_saver", "at_front"), &ResourceSaver::add_resource_format_saver, DEFVAL(false));
|
||||
ClassDB::bind_method(D_METHOD("remove_resource_format_saver", "format_saver"), &ResourceSaver::remove_resource_format_saver);
|
||||
|
||||
BIND_ENUM_CONSTANT(FLAG_NONE);
|
||||
BIND_ENUM_CONSTANT(FLAG_RELATIVE_PATHS);
|
||||
BIND_ENUM_CONSTANT(FLAG_BUNDLE_RESOURCES);
|
||||
BIND_ENUM_CONSTANT(FLAG_CHANGE_PATH);
|
||||
BIND_ENUM_CONSTANT(FLAG_OMIT_EDITOR_PROPERTIES);
|
||||
BIND_ENUM_CONSTANT(FLAG_SAVE_BIG_ENDIAN);
|
||||
BIND_ENUM_CONSTANT(FLAG_COMPRESS);
|
||||
BIND_ENUM_CONSTANT(FLAG_REPLACE_SUBRESOURCE_PATHS);
|
||||
BIND_BITFIELD_FLAG(FLAG_NONE);
|
||||
BIND_BITFIELD_FLAG(FLAG_RELATIVE_PATHS);
|
||||
BIND_BITFIELD_FLAG(FLAG_BUNDLE_RESOURCES);
|
||||
BIND_BITFIELD_FLAG(FLAG_CHANGE_PATH);
|
||||
BIND_BITFIELD_FLAG(FLAG_OMIT_EDITOR_PROPERTIES);
|
||||
BIND_BITFIELD_FLAG(FLAG_SAVE_BIG_ENDIAN);
|
||||
BIND_BITFIELD_FLAG(FLAG_COMPRESS);
|
||||
BIND_BITFIELD_FLAG(FLAG_REPLACE_SUBRESOURCE_PATHS);
|
||||
}
|
||||
|
||||
////// OS //////
|
||||
|
||||
Reference in New Issue
Block a user