From 155ea82d04d7a5a6304192876d3960f6e98f9776 Mon Sep 17 00:00:00 2001 From: magnusjjj Date: Fri, 27 Mar 2020 14:29:01 +0100 Subject: [PATCH] Add image_create_multiple When trying to create animated .vtf's, had to figure out how to create one that had specific options set to reduce file size. vlImageCreateMultiple was the only one that actually listened to the image format. https://pastebin.com/ETZk9b56 for a sample that uses it to automatically generate animated .vtf's via a quick tuxie.py --input=folder/*.png --output=output.vtf :) --- VTFLib.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/VTFLib.py b/VTFLib.py index 416fc8d..bab8494 100644 --- a/VTFLib.py +++ b/VTFLib.py @@ -188,7 +188,17 @@ def image_create(self, width, height, frames, faces, slices, def image_create_single(self, width, height, image_data, options): image_data = cast(image_data, POINTER(c_byte)) return self.ImageCreateSingle(width, height, image_data, options) - + + ImageCreateMultiple = vtflib_cdll.vlImageCreateMultiple + ImageCreateMultiple.argtypes = [ + c_int32, c_int32, c_int32, c_int32, c_int32, POINTER(c_byte), POINTER( + VTFLibStructures.CreateOptions)] + ImageCreateMultiple.restype = c_bool + + def image_create_multiple(self, width, height, frames, faces, slices, image_data, options): + image_data = cast(image_data, POINTER(c_byte)) + return self.ImageCreateMultiple(width, height, frames, faces, slices, image_data, options) + ImageDestroy = vtflib_cdll.vlImageDestroy ImageDestroy.argtypes = [] ImageDestroy.restype = None