From 4bbbebb13fb35c3b9226d2dfab27414816233c1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jhonny=20Go=CC=88ransson?= Date: Wed, 15 Jan 2025 16:19:29 +0100 Subject: [PATCH 1/2] Use new build-fn method --- texturepacker/editor/src/texturepacker.clj | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/texturepacker/editor/src/texturepacker.clj b/texturepacker/editor/src/texturepacker.clj index 3b533b1..5dc705e 100644 --- a/texturepacker/editor/src/texturepacker.clj +++ b/texturepacker/editor/src/texturepacker.clj @@ -359,12 +359,12 @@ (defn- make-gpu-texture [request-id page-image-content-generators texture-profile] (let [buffered-images (mapv call-content-generator page-image-content-generators)] (g/precluding-errors buffered-images - (let [texture-images + (let [texture-images+texture-bytes (mapv #(tex-gen/make-preview-texture-image % texture-profile) buffered-images)] (texture/texture-images->gpu-texture request-id - texture-images + texture-images+texture-bytes {:min-filter gl/nearest :mag-filter gl/nearest}))))) @@ -1044,10 +1044,10 @@ (let [{:keys [paged-atlas texture-profile compress]} user-data path (resource/path resource) texture-profile-pb (some->> texture-profile (protobuf/map->pb Graphics$TextureProfile)) - ^TextureGenerator$GenerateResult texture-generate-result (plugin-create-texture path paged-atlas buffered-images texture-profile-pb compress) - texture-image-bytes (TextureUtil/generateResultToByteArray texture-generate-result)] + texture-generate-result (plugin-create-texture path paged-atlas buffered-images texture-profile-pb compress)] {:resource resource - :content texture-image-bytes})))) + :build-fn tex-gen/build-texture-resource-fn + :user-data {:texture-generator-result texture-generate-result}})))) (defn- make-texture-build-target [workspace node-id paged-atlas page-image-content-generators texture-profile compress] From 748999ae2912dd9e565bde2be6c172b504d91ce6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jhonny=20Go=CC=88ransson?= Date: Thu, 16 Jan 2025 15:12:45 +0100 Subject: [PATCH 2/2] Review changes --- texturepacker/editor/src/texturepacker.clj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/texturepacker/editor/src/texturepacker.clj b/texturepacker/editor/src/texturepacker.clj index 5dc705e..bf23bb9 100644 --- a/texturepacker/editor/src/texturepacker.clj +++ b/texturepacker/editor/src/texturepacker.clj @@ -1046,7 +1046,7 @@ texture-profile-pb (some->> texture-profile (protobuf/map->pb Graphics$TextureProfile)) texture-generate-result (plugin-create-texture path paged-atlas buffered-images texture-profile-pb compress)] {:resource resource - :build-fn tex-gen/build-texture-resource-fn + :write-content-fn tex-gen/write-texturec-content-fn :user-data {:texture-generator-result texture-generate-result}})))) (defn- make-texture-build-target