Skip to content

Commit

Permalink
Merge pull request godotengine#27776 from neikeq/issue-27772
Browse files Browse the repository at this point in the history
core_bind: Use the appropriate enum instead of int
  • Loading branch information
neikeq authored Apr 7, 2019
2 parents 01c2071 + ebe2f4e commit 9e326ce
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
14 changes: 7 additions & 7 deletions core/bind/core_bind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ _ResourceLoader::_ResourceLoader() {
singleton = this;
}

Error _ResourceSaver::save(const String &p_path, const RES &p_resource, uint32_t p_flags) {
Error _ResourceSaver::save(const String &p_path, const RES &p_resource, SaverFlags p_flags) {

ERR_FAIL_COND_V(p_resource.is_null(), ERR_INVALID_PARAMETER);
return ResourceSaver::save(p_path, p_resource, p_flags);
Expand Down Expand Up @@ -1579,7 +1579,7 @@ _Geometry::_Geometry() {

///////////////////////// FILE

Error _File::open_encrypted(const String &p_path, int p_mode_flags, const Vector<uint8_t> &p_key) {
Error _File::open_encrypted(const String &p_path, ModeFlags p_mode_flags, const Vector<uint8_t> &p_key) {

Error err = open(p_path, p_mode_flags);
if (err)
Expand All @@ -1596,7 +1596,7 @@ Error _File::open_encrypted(const String &p_path, int p_mode_flags, const Vector
return OK;
}

Error _File::open_encrypted_pass(const String &p_path, int p_mode_flags, const String &p_pass) {
Error _File::open_encrypted_pass(const String &p_path, ModeFlags p_mode_flags, const String &p_pass) {

Error err = open(p_path, p_mode_flags);
if (err)
Expand All @@ -1614,7 +1614,7 @@ Error _File::open_encrypted_pass(const String &p_path, int p_mode_flags, const S
return OK;
}

Error _File::open_compressed(const String &p_path, int p_mode_flags, int p_compress_mode) {
Error _File::open_compressed(const String &p_path, ModeFlags p_mode_flags, CompressionMode p_compress_mode) {

FileAccessCompressed *fac = memnew(FileAccessCompressed);

Expand All @@ -1631,7 +1631,7 @@ Error _File::open_compressed(const String &p_path, int p_mode_flags, int p_compr
return OK;
}

Error _File::open(const String &p_path, int p_mode_flags) {
Error _File::open(const String &p_path, ModeFlags p_mode_flags) {

close();
Error err;
Expand Down Expand Up @@ -2453,12 +2453,12 @@ void _Thread::_start_func(void *ud) {
}
}

Error _Thread::start(Object *p_instance, const StringName &p_method, const Variant &p_userdata, int p_priority) {
Error _Thread::start(Object *p_instance, const StringName &p_method, const Variant &p_userdata, Priority p_priority) {

ERR_FAIL_COND_V(active, ERR_ALREADY_IN_USE);
ERR_FAIL_COND_V(!p_instance, ERR_INVALID_PARAMETER);
ERR_FAIL_COND_V(p_method == StringName(), ERR_INVALID_PARAMETER);
ERR_FAIL_INDEX_V(p_priority, 3, ERR_INVALID_PARAMETER);
ERR_FAIL_INDEX_V(p_priority, PRIORITY_MAX, ERR_INVALID_PARAMETER);

ret = Variant();
target_method = p_method;
Expand Down
15 changes: 8 additions & 7 deletions core/bind/core_bind.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class _ResourceSaver : public Object {

static _ResourceSaver *get_singleton() { return singleton; }

Error save(const String &p_path, const RES &p_resource, uint32_t p_flags);
Error save(const String &p_path, const RES &p_resource, SaverFlags p_flags);
PoolVector<String> get_recognized_extensions(const RES &p_resource);

_ResourceSaver();
Expand Down Expand Up @@ -436,11 +436,11 @@ class _File : public Reference {
COMPRESSION_GZIP = Compression::MODE_GZIP
};

Error open_encrypted(const String &p_path, int p_mode_flags, const Vector<uint8_t> &p_key);
Error open_encrypted_pass(const String &p_path, int p_mode_flags, const String &p_pass);
Error open_compressed(const String &p_path, int p_mode_flags, int p_compress_mode = 0);
Error open_encrypted(const String &p_path, ModeFlags p_mode_flags, const Vector<uint8_t> &p_key);
Error open_encrypted_pass(const String &p_path, ModeFlags p_mode_flags, const String &p_pass);
Error open_compressed(const String &p_path, ModeFlags p_mode_flags, CompressionMode p_compress_mode = COMPRESSION_FASTLZ);

Error open(const String &p_path, int p_mode_flags); ///< open a file
Error open(const String &p_path, ModeFlags p_mode_flags); ///< open a file
void close(); ///< close a file
bool is_open() const; ///< true when file is open

Expand Down Expand Up @@ -632,10 +632,11 @@ class _Thread : public Reference {

PRIORITY_LOW,
PRIORITY_NORMAL,
PRIORITY_HIGH
PRIORITY_HIGH,
PRIORITY_MAX
};

Error start(Object *p_instance, const StringName &p_method, const Variant &p_userdata = Variant(), int p_priority = PRIORITY_NORMAL);
Error start(Object *p_instance, const StringName &p_method, const Variant &p_userdata = Variant(), Priority p_priority = PRIORITY_NORMAL);
String get_id() const;
bool is_active() const;
Variant wait_to_finish();
Expand Down

0 comments on commit 9e326ce

Please sign in to comment.