From 47a82fdc0bf3fd9a3427252e5218bebcc096288a Mon Sep 17 00:00:00 2001 From: "Lucas S. Vieira" Date: Fri, 7 Feb 2025 19:50:33 -0300 Subject: [PATCH] Replace .psxcsv format with .cnk (rename only) --- Makefile | 14 +++++++------- tools/chunkgen.py | 12 ++++++------ tools/tiled_exporter/chunkexporter.py | 6 +++--- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Makefile b/Makefile index e6026fb..3028320 100644 --- a/Makefile +++ b/Makefile @@ -153,14 +153,14 @@ cleancook: # Also generates 128.png to create a 128x128 tileset (should be done manually) # (Depends on tilemap128.tmx map generated on Tiled) %/MAP128.MAP: %/tilemap128.tmx - tiled --export-map $< "$(basename $<).psxcsv" + tiled --export-map $< "$(basename $<).cnk" tmxrasterizer $< "$(dir $<)128.png" - ./tools/chunkgen.py "$(basename $<).psxcsv" $@ - rm -f "$(basename $<).psxcsv" - rm -f "$(basename $<)_solid.psxcsv" - rm -f "$(basename $<)_oneway.psxcsv" - rm -f "$(basename $<)_none.psxcsv" - rm -f "$(basename $<)_front.psxcsv" + ./tools/chunkgen.py "$(basename $<).cnk" $@ + rm -f "$(basename $<).cnk" + rm -f "$(basename $<)_solid.cnk" + rm -f "$(basename $<)_oneway.cnk" + rm -f "$(basename $<)_none.cnk" + rm -f "$(basename $<)_front.cnk" # =========== Level maps =========== # These maps should use a tileset generated from "128.png". diff --git a/tools/chunkgen.py b/tools/chunkgen.py index ab16a8a..884ee85 100755 --- a/tools/chunkgen.py +++ b/tools/chunkgen.py @@ -3,8 +3,8 @@ # chunkgen.py # Tool for converting 128x128 chunks generated from a .tmx tilemap in Tiled # to a proper .MAP file for the PlayStation engine-psx. -# Converts map128.psxcsv -> MAP128.MAP -# Make sure you export your .tmx map to .psxcsv before using this tool. +# Converts map128.cnk -> MAP128.MAP +# Make sure you export your .tmx map to .cnk before using this tool. import os import sys import pandas as pd @@ -122,10 +122,10 @@ def main(): solid_layer = load_data(sys.argv[1]) else: basepath = os.path.splitext(sys.argv[1])[0] - solid_layer = load_data(f"{basepath}_solid.psxcsv") - oneway_layer = load_data(f"{basepath}_oneway.psxcsv") - none_layer = load_data(f"{basepath}_none.psxcsv") - front_layer = load_data(f"{basepath}_front.psxcsv") + solid_layer = load_data(f"{basepath}_solid.cnk") + oneway_layer = load_data(f"{basepath}_oneway.cnk") + none_layer = load_data(f"{basepath}_none.cnk") + front_layer = load_data(f"{basepath}_front.cnk") with open(out, "wb") as f: export_binary(f, solid_layer, oneway_layer, none_layer, front_layer) diff --git a/tools/tiled_exporter/chunkexporter.py b/tools/tiled_exporter/chunkexporter.py index f0a012a..f152212 100644 --- a/tools/tiled_exporter/chunkexporter.py +++ b/tools/tiled_exporter/chunkexporter.py @@ -10,11 +10,11 @@ import os class PSXChunk(Plugin): @classmethod def nameFilter(cls): - return "PlayStation chunk proto map (*.psxcsv)" + return "PlayStation chunk proto map (*.cnk)" @classmethod def shortName(cls): - return "psxcsv" + return "cnk" @classmethod def write(cls, tileMap, fileName): @@ -23,7 +23,7 @@ class PSXChunk(Plugin): tileLayer = tileLayerAt(tileMap, ilayer) actual_filename = fileName if tileMap.layerCount() > 1: - actual_filename = f"{os.path.splitext(fileName)[0]}_{tileLayer.name().lower()}.psxcsv" + actual_filename = f"{os.path.splitext(fileName)[0]}_{tileLayer.name().lower()}.cnk" with open(actual_filename, "w") as f: width = tileLayer.width() if width % 8 > 0: