diff --git a/CMakeLists.txt b/CMakeLists.txt
index e3c55a3..e5745f6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -72,6 +72,7 @@ set(ASSETS_cg
set(ASSETS_cg_EGA64
assets-cg/ega64/tileset/tilesetEGA64_CG.png
+ assets-cg/ega64/tileset/tileset_inEGA64_CG.png
)
set(ASSETS_fx
@@ -86,6 +87,7 @@ set(ASSETS_fx
set(ASSETS_fx_1b
assets-fx/1b/tileset/tileset1b.png
+ assets-fx/1b/tileset/tileset_in1b.png
assets-fx/1b/npc/char/npc_male.png
assets-fx/1b/npc/char/npc_female.png
assets-fx/1b/npc/char/npc_milkman.png
@@ -100,6 +102,7 @@ set(ASSETS_fx_1b
set(ASSETS_fx_2b
assets-fx/2b/tileset/tileset2b.png
+ assets-fx/2b/tileset/tileset_in2b.png
assets-fx/2b/npc/char/npc_male.png
assets-fx/2b/npc/char/npc_female.png
assets-fx/2b/npc/char/npc_milkman.png
diff --git a/assets-cg/1b/tileset/fxconv-metadata.txt b/assets-cg/1b/tileset/fxconv-metadata.txt
deleted file mode 100644
index fad2b40..0000000
--- a/assets-cg/1b/tileset/fxconv-metadata.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-tileset1b_CG.png:
- type: bopti-image
- name: img_tilesetnpp
- profile: p8
diff --git a/assets-cg/1b/tileset/tileset1b_CG.png b/assets-cg/1b/tileset/tileset1b_CG.png
deleted file mode 100644
index 089c983..0000000
Binary files a/assets-cg/1b/tileset/tileset1b_CG.png and /dev/null differ
diff --git a/assets-cg/2b/sprites/SpriteTestCG2b.png b/assets-cg/2b/sprites/SpriteTestCG2b.png
deleted file mode 100644
index e709b04..0000000
Binary files a/assets-cg/2b/sprites/SpriteTestCG2b.png and /dev/null differ
diff --git a/assets-cg/2b/tileset/fxconv-metadata.txt b/assets-cg/2b/tileset/fxconv-metadata.txt
deleted file mode 100644
index 203e19f..0000000
--- a/assets-cg/2b/tileset/fxconv-metadata.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-tileset2b_CG.png:
- type: bopti-image
- name: img_tilesetnpp
- profile: p8
-
\ No newline at end of file
diff --git a/assets-cg/2b/tileset/tileset2b_CG.png b/assets-cg/2b/tileset/tileset2b_CG.png
deleted file mode 100644
index aa53e42..0000000
Binary files a/assets-cg/2b/tileset/tileset2b_CG.png and /dev/null differ
diff --git a/assets-cg/ega64/tileset/fxconv-metadata.txt b/assets-cg/ega64/tileset/fxconv-metadata.txt
index 15d8aeb..e8cdf0d 100644
--- a/assets-cg/ega64/tileset/fxconv-metadata.txt
+++ b/assets-cg/ega64/tileset/fxconv-metadata.txt
@@ -2,4 +2,8 @@ tilesetEGA64_CG.png:
type: bopti-image
name: img_tilesetnpp
profile: p8
-
\ No newline at end of file
+
+tileset_inEGA64_CG.png:
+ type: bopti-image
+ name: img_indoor
+ profile: p8
diff --git a/assets-fx/1b/tileset/fxconv-metadata.txt b/assets-fx/1b/tileset/fxconv-metadata.txt
index d5e87d6..9d175fc 100644
--- a/assets-fx/1b/tileset/fxconv-metadata.txt
+++ b/assets-fx/1b/tileset/fxconv-metadata.txt
@@ -2,3 +2,6 @@ tileset1b.png:
type: bopti-image
name: img_tilesetnpp
+tileset_in1b.png:
+ type: bopti-image
+ name: img_indoor
diff --git a/assets-fx/2b/tileset/fxconv-metadata.txt b/assets-fx/2b/tileset/fxconv-metadata.txt
index 2548038..4f2ab9a 100644
--- a/assets-fx/2b/tileset/fxconv-metadata.txt
+++ b/assets-fx/2b/tileset/fxconv-metadata.txt
@@ -1,3 +1,7 @@
tileset2b.png:
type: bopti-image
name: img_tilesetnpp
+
+tileset_in2b.png:
+ type: bopti-image
+ name: img_indoor
diff --git a/assets/converters.py b/assets/converters.py
index 63d6de5..28d224b 100644
--- a/assets/converters.py
+++ b/assets/converters.py
@@ -70,6 +70,8 @@ def convert_map(input: str, output: str, params: dict, target):
npcs = {}
signs = {}
portals = {}
+
+ indoor = 0
name = os.path.splitext(os.path.basename(input))[0]
@@ -115,7 +117,7 @@ def convert_map(input: str, output: str, params: dict, target):
# Get the outdoor tileset
try:
if VERBOSE: print("INFO: Getting the outdoor tileset")
- outdoor_tileset = input_map.get_tileset_by_firstgid(1)
+ outdoor_tileset = input_map.get_tileset_by_name("tilesetnpp")
except Exception as e:
# Show a simple error message on failure.
sys.stderr.write(f"ERROR: Failed to get the outdoor tileset.\n"
@@ -125,12 +127,32 @@ def convert_map(input: str, output: str, params: dict, target):
# Get the walkable tileset
try:
if VERBOSE: print("INFO: Getting the walkable tileset")
- walkable_tileset = input_map.get_tileset_by_firstgid(409)
+ walkable_tileset = input_map.get_tileset_by_name("Walkable")
except Exception as e:
# Show a simple error message on failure.
sys.stderr.write(f"ERROR: Failed to get the walkable tileset.\n"
+ f" Error message: {e}\n")
sys.exit(1)
+
+ # Check if this is an indoor map
+ try:
+ if VERBOSE: print("INFO: Checking if it is an indoor map")
+ indoor = int(input_map.get_property("indoor"))
+ except Exception as e:
+ # Show a warning
+ print(f"WARNING: Indoor property not found.\n")
+
+ if indoor:
+ # Get the indoor tileset
+ try:
+ if VERBOSE: print("INFO: Getting the indoor tileset (it is an\n"
+ + " indoor map)")
+ indoor_tileset = input_map.get_tileset_by_name("indoor")
+ except Exception as e:
+ # Show a simple error message on failure.
+ sys.stderr.write(f"ERROR: Failed to get the indoor tileset.\n"
+ + f" Error message: {e}\n")
+ sys.exit(1)
# Get the background
try:
@@ -141,7 +163,10 @@ def convert_map(input: str, output: str, params: dict, target):
height = bg_layer.get_height()
if VERBOSE: print(f"INFO: Map size: ({width}, {height}).")
# Get the layer data himself
- background_layer = bg_layer.get_data_with_tileset(outdoor_tileset)
+ if indoor:
+ background_layer = bg_layer.get_data_with_tileset(indoor_tileset)
+ else:
+ background_layer = bg_layer.get_data_with_tileset(outdoor_tileset)
# Check if the size of the layer data is correct.
if len(background_layer) != width*height:
raise Exception("Bad layer size!")
@@ -157,7 +182,10 @@ def convert_map(input: str, output: str, params: dict, target):
if VERBOSE: print("INFO: Getting the foreground layer")
fg_layer = input_map.get_layer_by_name("Foreground")
# Get the layer data himself
- foreground_layer = fg_layer.get_data_with_tileset(outdoor_tileset)
+ if indoor:
+ foreground_layer = fg_layer.get_data_with_tileset(indoor_tileset)
+ else:
+ foreground_layer = fg_layer.get_data_with_tileset(outdoor_tileset)
# Check if the size of the layer data is correct.
if len(foreground_layer) != width*height:
raise Exception("Bad layer size!")
@@ -252,8 +280,14 @@ def convert_map(input: str, output: str, params: dict, target):
map_struct += fxconv.u32(width)
map_struct += fxconv.u32(height)
map_struct += fxconv.u32(3)
- map_struct += fxconv.u32(outdoor_tileset.columns)
- tileset_name = os.path.splitext(os.path.basename(outdoor_tileset.source))[0]
+ if indoor: map_struct += fxconv.u32(indoor_tileset.columns)
+ else: map_struct += fxconv.u32(outdoor_tileset.columns)
+ if indoor:
+ tileset_name = os.path.splitext(
+ os.path.basename(indoor_tileset.source))[0]
+ else:
+ tileset_name = os.path.splitext(
+ os.path.basename(outdoor_tileset.source))[0]
map_struct += fxconv.ref(f"img_{tileset_name}")
# Store the walkable layer
@@ -335,6 +369,7 @@ def convert_map(input: str, output: str, params: dict, target):
# separately.
dialog_name = os.path.splitext(os.path.basename(dialog_file))[0]
map_struct += fxconv.ref(f"_{dialog_name}")
+ map_struct += fxconv.u32(indoor)
# Store the background layer
background_data = bytes()
diff --git a/assets/indoor.png b/assets/indoor.png
new file mode 120000
index 0000000..578ed8f
--- /dev/null
+++ b/assets/indoor.png
@@ -0,0 +1 @@
+../assets-fx/2b/tileset/tileset_in2b.png
\ No newline at end of file
diff --git a/assets/indoor.tsx b/assets/indoor.tsx
new file mode 100644
index 0000000..c5bbf05
--- /dev/null
+++ b/assets/indoor.tsx
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/assets/interior1_0.tmx b/assets/interior1_0.tmx
index cca09fa..7299f5f 100644
--- a/assets/interior1_0.tmx
+++ b/assets/interior1_0.tmx
@@ -1,50 +1,76 @@
-