From 04fb62175a2e04330a7c81e62525276f4d4b58a5 Mon Sep 17 00:00:00 2001 From: Naruto TAKAHASHI Date: Wed, 20 Aug 2025 20:41:24 +0900 Subject: [PATCH 1/3] enable textures/vram_compression/import_etc2_astc=true --- examples/feature_test_gdextension/project.godot | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/feature_test_gdextension/project.godot b/examples/feature_test_gdextension/project.godot index b970ebc..1d10696 100644 --- a/examples/feature_test_gdextension/project.godot +++ b/examples/feature_test_gdextension/project.godot @@ -25,4 +25,5 @@ common/enable_pause_aware_picking=true [rendering] +textures/vram_compression/import_etc2_astc=true environment/defaults/default_environment="res://default_env.tres" From d88e6276a2ff408dc8c5b57e157e34db078a13b4 Mon Sep 17 00:00:00 2001 From: Naruto TAKAHASHI Date: Sun, 31 Aug 2025 18:09:34 +0900 Subject: [PATCH 2/3] add -framework CoreFoundation at building macOS --- SConstruct | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/SConstruct b/SConstruct index a5e2b1e..eb74adb 100644 --- a/SConstruct +++ b/SConstruct @@ -76,6 +76,10 @@ env.Append( "gd_spritestudio/SpriteStudio6-SDK/Common/Helper", ] ) + +if env["platform"] == 'macos': + env.Append(LINKFLAGS=["-framework", "CoreFoundation"]) + # Set iOS minimum deployment target if env["platform"] == "ios": env.Append(CCFLAGS=["-miphoneos-version-min=12.0"]) @@ -89,7 +93,6 @@ sources.extend(Glob("gd_spritestudio/SpriteStudio6-SDK/Common/Helper/DebugPrint. sources.extend(Glob("gd_spritestudio/SpriteStudio6-SDK/Common/Helper/IsshTexture.cpp")) sources.extend(Glob("gd_spritestudio/SpriteStudio6-SDK/Common/Helper/stb_image.c")) - if env["target"] in ["editor", "template_debug"]: try: doc_data = env.GodotCPPDocData("src/gen/doc_data.gen.cpp", source=Glob("doc_classes/*.xml")) From beb5f0c4071de94f3f03b7fbef7236ce393256c9 Mon Sep 17 00:00:00 2001 From: Naruto TAKAHASHI Date: Tue, 2 Sep 2025 00:32:46 +0900 Subject: [PATCH 3/3] fix GDExtension code of gd_io.cpp --- gd_spritestudio/gd_io.cpp | 41 +++++++++------------------------------ 1 file changed, 9 insertions(+), 32 deletions(-) diff --git a/gd_spritestudio/gd_io.cpp b/gd_spritestudio/gd_io.cpp index c6e8249..0fc40b9 100644 --- a/gd_spritestudio/gd_io.cpp +++ b/gd_spritestudio/gd_io.cpp @@ -31,24 +31,14 @@ String GdIO::loadStringFromFile( const String& strPath ) String str = String( "" ); #ifdef SPRITESTUDIO_GODOT_EXTENSION - Ref resFileAccess = FileAccess::open( strPath, FileAccess::READ); - err = resFileAccess->get_error(); - if ( err != OK ) { + str = FileAccess::get_file_as_string(strPath); + if (str.length() == 0) { + err = ERR_FILE_UNRECOGNIZED; ERR_PRINT( String( "loadStringFromFile error: " ) + String::num( err ) ); - if ( resFileAccess.is_valid() ) { - resFileAccess->close(); - } - return str; } - while ( !resFileAccess->eof_reached() ) { - str += resFileAccess->get_line(); - } - - resFileAccess->close(); - #endif #ifdef GD_V4 Ref resFileAccess = FileAccess::open( strPath, FileAccess::READ, &err ); @@ -96,14 +86,10 @@ Error GdIO::saveStringToFile( const String& strPath, const String& str ) #ifdef SPRITESTUDIO_GODOT_EXTENSION Ref resFileAccess = FileAccess::open( strPath, FileAccess::WRITE); - err = resFileAccess->get_error(); - if ( err != OK ) { + if ( !resFileAccess.is_valid() ) { + err = ERR_FILE_CANT_OPEN; ERR_PRINT( String( "saveStringToFile error: " ) + String::num( err ) ); - if ( resFileAccess.is_valid() ) { - resFileAccess->close(); - } - return err; } @@ -157,14 +143,9 @@ Variant GdIO::loadVariantFromFile( const String& strPath ) #ifdef SPRITESTUDIO_GODOT_EXTENSION Ref resFileAccess = FileAccess::open( strPath, FileAccess::READ); - err = resFileAccess->get_error(); - if ( err != OK ) { + if ( !resFileAccess.is_valid() ) { + err = ERR_FILE_CANT_OPEN; ERR_PRINT( String( "loadVariantFromFile error: " ) + String::num( err ) ); - - if ( resFileAccess.is_valid() ) { - resFileAccess->close(); - } - return val; } @@ -241,14 +222,10 @@ Error GdIO::saveVariantToFile( const String& strPath, const Variant& val ) #ifdef SPRITESTUDIO_GODOT_EXTENSION Ref resFileAccess = FileAccess::open( strPath, FileAccess::WRITE); - err = resFileAccess->get_error(); - if ( err != OK ) { + if ( !resFileAccess.is_valid() ) { + err = ERR_FILE_CANT_OPEN; ERR_PRINT( String( "saveVariantToFile error: " ) + String::num( err ) ); - if ( resFileAccess.is_valid() ) { - resFileAccess->close(); - } - return err; }