[godot] Add spine-godot to formatting script.

This commit is contained in:
Mario Zechner 2022-04-06 10:04:17 +02:00
parent e0e3bb9f93
commit 8b892dc58a
7 changed files with 64 additions and 62 deletions

View File

@ -25,7 +25,9 @@ spotless {
'spine-sfml/**/*.cpp', 'spine-sfml/**/*.cpp',
'spine-sfml/**/*.h', 'spine-sfml/**/*.h',
'spine-ue4/**/*.cpp', 'spine-ue4/**/*.cpp',
'spine-ue4/**/*.h' 'spine-ue4/**/*.h',
'spine-godot/godot/modules/spine_godot/*.cpp',
'spine-godot/godot/modules/spine_godot/*.h'
clangFormat("13.0.1").pathToExe("$System.env.CLANGFORMAT").style('file') clangFormat("13.0.1").pathToExe("$System.env.CLANGFORMAT").style('file')
} }

View File

@ -953,8 +953,8 @@ spSkeletonData *spSkeletonJson_readSkeletonDataFile(spSkeletonJson *self, const
static int string_starts_with(const char *str, const char *needle) { static int string_starts_with(const char *str, const char *needle) {
int lenStr, lenNeedle, i; int lenStr, lenNeedle, i;
if (!str) return 0; if (!str) return 0;
lenStr = (int)strlen(str); lenStr = (int) strlen(str);
lenNeedle = (int)strlen(needle); lenNeedle = (int) strlen(needle);
if (lenStr < lenNeedle) return 0; if (lenStr < lenNeedle) return 0;
for (i = 0; i < lenNeedle; i++) { for (i = 0; i < lenNeedle; i++) {
if (str[i] != needle[i]) return 0; if (str[i] != needle[i]) return 0;

View File

@ -78,7 +78,7 @@ public:
}; };
class SpineAtlasResourceFormatLoader : public ResourceFormatLoader { class SpineAtlasResourceFormatLoader : public ResourceFormatLoader {
GDCLASS(SpineAtlasResourceFormatLoader, ResourceFormatLoader); GDCLASS(SpineAtlasResourceFormatLoader, ResourceFormatLoader);
public: public:
virtual RES load(const String &p_path, const String &p_original_path, Error *r_error = NULL); virtual RES load(const String &p_path, const String &p_original_path, Error *r_error = NULL);
@ -88,7 +88,7 @@ public:
}; };
class SpineAtlasResourceFormatSaver : public ResourceFormatSaver { class SpineAtlasResourceFormatSaver : public ResourceFormatSaver {
GDCLASS(SpineAtlasResourceFormatSaver, ResourceFormatSaver); GDCLASS(SpineAtlasResourceFormatSaver, ResourceFormatSaver);
public: public:
Error save(const String &p_path, const RES &p_resource, uint32_t p_flags = 0) override; Error save(const String &p_path, const RES &p_resource, uint32_t p_flags = 0) override;

View File

@ -74,7 +74,7 @@ public:
}; };
class SpineBinaryResourceImportPlugin : public EditorImportPlugin { class SpineBinaryResourceImportPlugin : public EditorImportPlugin {
GDCLASS(SpineBinaryResourceImportPlugin, EditorImportPlugin); GDCLASS(SpineBinaryResourceImportPlugin, EditorImportPlugin);
public: public:
String get_importer_name() const override { return "spine.skel"; } String get_importer_name() const override { return "spine.skel"; }

View File

@ -35,7 +35,7 @@ void SpineSkeletonFileResource::_bind_methods() {
Error SpineSkeletonFileResource::load_from_file(const String &p_path) { Error SpineSkeletonFileResource::load_from_file(const String &p_path) {
Error err; Error err;
if(p_path.ends_with("spjson")) if (p_path.ends_with("spjson"))
json = FileAccess::get_file_as_string(p_path, &err); json = FileAccess::get_file_as_string(p_path, &err);
else else
binary = FileAccess::get_file_as_array(p_path, &err); binary = FileAccess::get_file_as_array(p_path, &err);

View File

@ -71,4 +71,4 @@ public:
bool recognize(const RES &p_resource) const override; bool recognize(const RES &p_resource) const override;
}; };
#endif //GODOT_SPINESKELETONFILERESOURCE_H #endif//GODOT_SPINESKELETONFILERESOURCE_H