diff --git a/src/pc/lua/utils/smlua_misc_utils.h b/src/pc/lua/utils/smlua_misc_utils.h index 9780b5a9f..968334e7f 100644 --- a/src/pc/lua/utils/smlua_misc_utils.h +++ b/src/pc/lua/utils/smlua_misc_utils.h @@ -134,9 +134,9 @@ void save_file_set_using_backup_slot(bool usingBackupSlot); /* |description|Registers a custom moving texture entry (used for vanilla water boxes)|descriptionEnd| */ void movtexqc_register(const char* name, s16 level, s16 area, s16 type); -/* |description|Gets the water level in an area|descriptionEnd| */ +/* |description|Gets the water level in an area corresponding to `index` (0-indexed)|descriptionEnd| */ s16 get_water_level(u8 index); -/* |description|Sets the water level in an area|descriptionEnd| */ +/* |description|Sets the water level in an area corresponding to `index` (0-indexed)|descriptionEnd| */ void set_water_level(u8 index, s16 height, bool sync); /* |description|Plays a screen transition|descriptionEnd| */ diff --git a/tools/convert_cake.py b/tools/convert_cake.py new file mode 100644 index 000000000..82a69b6af --- /dev/null +++ b/tools/convert_cake.py @@ -0,0 +1,29 @@ +from PIL import Image +import os + +def split_image(image_path, output_folder, slice_width=80, slice_height=20): + # Open the image + image = Image.open(image_path) + width, height = image.size + + # Ensure output folder exists + os.makedirs(output_folder, exist_ok=True) + + slice_count = 0 + + # Loop to create slices + for y in range(0, height, slice_height): + for x in range(0, width, slice_width): + # Define the bounding box (left, upper, right, lower) + box = (x, y, x + slice_width, y + slice_height) + slice_img = image.crop(box) + + # Save slice + slice_filename = os.path.join(output_folder, f"cake_end_texture_{slice_count}.png") + slice_img.save(slice_filename) + slice_count += 1 + + print(f"Image split into {slice_count} slices and saved in '{output_folder}'.") + +# Example usage +split_image("cake.png", "output_slices")