mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2026-01-05 22:42:50 +00:00
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:
parent
ba2078f6e9
commit
1f0c44dd9e
2 changed files with 31 additions and 2 deletions
|
|
@ -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
29
tools/convert_cake.py
Normal 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")
|
||||
Loading…
Add table
Reference in a new issue