17 lines
471 B
Python
17 lines
471 B
Python
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 [] |