diff --git a/metadata.json b/metadata.json index a88fa80..059bc63 100644 --- a/metadata.json +++ b/metadata.json @@ -1 +1 @@ -{"gitHubUrl":"https://github.com/YoYoGames/GMEXT-GDK","projectFile":"source/GDKExtension_gml/GDKExtension.yyp","projectVersion":"LTS22","releaseTemplate":"templates/release_body.md","extensionMetaData":[{"extensionFile":"source/GDKExtension_gml/extensions/GDKExtension/GDKExtension.yy","packageId":"com.yoyogames.windowsgdkext","packageName":"WindowsGDK Ext","packageVersion":"2.0.0","packageFormat":"LTS22","includeFolders":null,"includeResources":null,"excludeFolders":null,"excludeResources":null,"postRemovals":["**/.vs/","**/.vsc/","**/*.exp","**/*.ilk","**/*.lib","**/*.pdb","**/*.exp","**/*.exe","**/Debug/","**/Release/",".DS_Store","*.user","xcuserdata/","**/Gaming.Desktop.x64/"]}],"documentationFolder":null} \ No newline at end of file +{"gitHubUrl":"https://github.com/YoYoGames/GMEXT-GDK","projectFile":"source/GDKExtension_gml/GDKExtension.yyp","projectVersion":"LTS22","releaseTemplate":"templates/release_body.md","extensionMetaData":[{"extensionFile":"source/GDKExtension_gml/extensions/GDKExtension/GDKExtension.yy","packageId":"com.yoyogames.windowsgdkext","packageName":"WindowsGDK Ext","packageVersion":"2.0.1","packageFormat":"LTS22","includeFolders":null,"includeResources":null,"excludeFolders":null,"excludeResources":null,"postRemovals":["**/.vs/","**/.vsc/","**/*.exp","**/*.ilk","**/*.lib","**/*.pdb","**/*.exp","**/*.exe","**/Debug/","**/Release/",".DS_Store","*.user","xcuserdata/","**/Gaming.Desktop.x64/"]}],"documentationFolder":null} \ No newline at end of file diff --git a/source/GDKExtension_gml/extensions/GDKExtension/GDKExtension.dll b/source/GDKExtension_gml/extensions/GDKExtension/GDKExtension.dll index 08f03ee..d243eff 100644 Binary files a/source/GDKExtension_gml/extensions/GDKExtension/GDKExtension.dll and b/source/GDKExtension_gml/extensions/GDKExtension/GDKExtension.dll differ diff --git a/source/GDKExtension_gml/extensions/GDKExtension/GDKExtension.yy b/source/GDKExtension_gml/extensions/GDKExtension/GDKExtension.yy index a260335..9fb2c85 100644 --- a/source/GDKExtension_gml/extensions/GDKExtension/GDKExtension.yy +++ b/source/GDKExtension_gml/extensions/GDKExtension/GDKExtension.yy @@ -14,7 +14,7 @@ "copyToTargets":64, "description":"", "exportToGame":true, - "extensionVersion":"2.0.0", + "extensionVersion":"2.0.1", "files":[ {"$GMExtensionFile":"","%Name":"","constants":[],"copyToTargets":64,"filename":"GDKExtension.dll","final":"","functions":[ {"$GMExtensionFunction":"","%Name":"gdk_init","argCount":0,"args":[1,],"documentation":"","externalName":"","help":"gdk_init(scid)","hidden":false,"kind":1,"name":"gdk_init","resourceType":"GMExtensionFunction","resourceVersion":"2.0","returnType":1,}, diff --git a/source/GDKExtension_gml/extensions/GDKExtension/gdkextension_windows/GDKExtension/LoadSave.cpp b/source/GDKExtension_gml/extensions/GDKExtension/gdkextension_windows/GDKExtension/LoadSave.cpp index b8bf903..4fc9bec 100644 --- a/source/GDKExtension_gml/extensions/GDKExtension/gdkextension_windows/GDKExtension/LoadSave.cpp +++ b/source/GDKExtension_gml/extensions/GDKExtension/gdkextension_windows/GDKExtension/LoadSave.cpp @@ -226,7 +226,11 @@ void gdk_save_buffer(RValue& Result, CInstance* selfinst, CInstance* otherinst, return; } - if (offset < 0 || offset >= buffer_size || size < 1 || (offset + size) > buffer_size) + if ((offset + size) > buffer_size) { + size = buffer_size - offset; + } + + if (offset < 0 || offset >= buffer_size || size < 1) { DebugConsoleOutput("gdk_save_buffer() - error: offset and/or size argument out of range\n"); Result.val = -1; diff --git a/source/GDKExtension_gml/extensions/GDKExtension/post_package_step.bat b/source/GDKExtension_gml/extensions/GDKExtension/post_package_step.bat index 352963b..7540dec 100644 --- a/source/GDKExtension_gml/extensions/GDKExtension/post_package_step.bat +++ b/source/GDKExtension_gml/extensions/GDKExtension/post_package_step.bat @@ -14,14 +14,14 @@ if not "%YYPLATFORM_option_windows_copy_exe_to_dest%" == "True" ( :: Check if GDK is installed if not exist "C:\Program Files (x86)\Microsoft GDK\Command Prompts\GamingDesktopVars.cmd" ( - call %Utils% logError "Goto https://github.com/microsoft/GDK/releases/tag/June_2023_Update_2 to install the GDK" + call %Utils% logError "Goto https://github.com/microsoft/GDK/releases/tag/June_2024_Update_3 to install the GDK" ) :: Check if GDK version is correct call %Utils% optionGetValue "gdkVersion" GDK_VERSION set GDK_PATH=%GameDK%%GDK_VERSION%\GRDK\ExtensionLibraries if not exist "%GDK_PATH%" ( - call %Utils% logError "Wrong GDK version, goto https://github.com/microsoft/GDK/releases/tag/June_2023_Update_2" + call %Utils% logError "Wrong GDK version, goto https://github.com/microsoft/GDK/releases/tag/June_2024_Update_3" ) :: Setup the GDK Environment (force version Update Jun 2023) diff --git a/source/GDKExtension_gml/objects/objSaveGroup/Create_0.gml b/source/GDKExtension_gml/objects/objSaveGroup/Create_0.gml index ff5d09c..d9b6079 100644 --- a/source/GDKExtension_gml/objects/objSaveGroup/Create_0.gml +++ b/source/GDKExtension_gml/objects/objSaveGroup/Create_0.gml @@ -15,13 +15,13 @@ onClick = function() { /* Save a group of buffers. */ var b2 = buffer_create(1, buffer_grow, 1); - buffer_write(b2, buffer_text, "bar"); + buffer_write(b2, buffer_string, "bar"); var b3 = buffer_create(1, buffer_grow, 1); - buffer_write(b3, buffer_text, "baz"); + buffer_write(b3, buffer_string, "baz"); var b4 = buffer_create(1, buffer_grow, 1); - buffer_write(b4, buffer_text, "qux"); + buffer_write(b4, buffer_string, "qux"); switch (os_type) { case os_windows: @@ -41,17 +41,17 @@ onClick = function() { windowsSaveGroup = function(_b2, _b3, _b4) { gdk_save_group_begin("multi"); - gdk_save_buffer(_b2, "b2", 0, buffer_tell(_b2)); - gdk_save_buffer(_b3, "b3", 0, buffer_tell(_b3)); - gdk_save_buffer(_b4, "b4", 0, buffer_tell(_b4)); + gdk_save_buffer(_b2, "b2", 0, buffer_get_size(_b2)); + gdk_save_buffer(_b3, "b3", 0, buffer_get_size(_b3)); + gdk_save_buffer(_b4, "b4", 0, buffer_get_size(_b4)); requestId = gdk_save_group_end(); } xboxSaveGroup = function(_b2, _b3, _b4) { buffer_async_group_begin("multi"); - buffer_save_async(_b2, "b2", 0, buffer_tell(_b2)); - buffer_save_async(_b3, "b3", 0, buffer_tell(_b3)); - buffer_save_async(_b4, "b4", 0, buffer_tell(_b4)); + buffer_save_async(_b2, "b2", 0, buffer_get_size(_b2)); + buffer_save_async(_b3, "b3", 0, buffer_get_size(_b3)); + buffer_save_async(_b4, "b4", 0, buffer_get_size(_b4)); requestId = buffer_async_group_end(); } diff --git a/source/GDKExtension_gml/objects/objSaveSingle/Create_0.gml b/source/GDKExtension_gml/objects/objSaveSingle/Create_0.gml index 86d4a8d..60398bf 100644 --- a/source/GDKExtension_gml/objects/objSaveSingle/Create_0.gml +++ b/source/GDKExtension_gml/objects/objSaveSingle/Create_0.gml @@ -23,14 +23,14 @@ onClick = function() { // On Windows GDK the function used to save buffers asynchronously // is 'gdk_save_buffer' it will return a requestID that can be checked // during the Async Save/Load event. - requestId = gdk_save_buffer(b1, "single/b1", 0, buffer_tell(b1)); + requestId = gdk_save_buffer(b1, "single/b1", 0, buffer_get_size(b1)); break; case os_xboxseriesxs: // On Xbox Series X/S the function used to save buffers asynchronously // is 'buffer_save_async' it will return a requestID that can be checked // during the Async Save/Load event. - requestId = buffer_save_async(b1, "single/b1", 0, buffer_tell(b1)); + requestId = buffer_save_async(b1, "single/b1", 0, buffer_get_size(b1)); break; default: throw "[ERROR] objSaveSingle, unsupported platform";