Going to redo assets.
This commit is contained in:
17
tools/assetstool/assetparser.py
Normal file
17
tools/assetstool/assetparser.py
Normal file
@@ -0,0 +1,17 @@
|
||||
import os
|
||||
import sys
|
||||
from tilesetparser import parseTileset
|
||||
from imageparser import parseImage
|
||||
|
||||
def parseAsset(assetPath):
|
||||
if not os.path.isfile(assetPath):
|
||||
print(f"Error: Input asset '{assetPath}' does not exist.")
|
||||
sys.exit(1)
|
||||
|
||||
if assetPath.endswith(".tsx"):
|
||||
return parseTileset(assetPath)
|
||||
elif assetPath.endswith(".png"):
|
||||
return parseImage(assetPath)
|
||||
else:
|
||||
print(f"Warning: Unsupported asset type for '{assetPath}'. Skipping.")
|
||||
return []
|
Reference in New Issue
Block a user