Add cake screen split into tiles script (by eros)

Co-Authored-By: eros71 <16540103+eros71-dev@users.noreply.github.com>
This commit is contained in:
Agent X 2025-02-27 22:00:20 -05:00
parent ba2078f6e9
commit 1f0c44dd9e
2 changed files with 31 additions and 2 deletions

View file

@ -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| */

29
tools/convert_cake.py Normal file
View file

@ -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")