summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkdx <kikoodx@paranoici.org>2023-03-24 23:31:41 +0100
committerkdx <kikoodx@paranoici.org>2023-03-24 23:31:41 +0100
commitc2f29cd7b97cf028ba7ed10896a37eeb05be6a78 (patch)
treef5084a9e2192e79ff0fdd39056cf7cbeed6029a7
parente236ce10d4b7b38890a533e7e520f661b09c30a8 (diff)
downloadhyperultra-c2f29cd7b97cf028ba7ed10896a37eeb05be6a78.tar.gz
ditch able for our boi tiled
-rw-r--r--Makefile8
-rw-r--r--map/idkwymmdr.json1
-rw-r--r--map/idkwymmdr.tmj45
-rw-r--r--map/nuancierdesaut.json1
-rw-r--r--map/nuancierdesaut.tmj45
-rw-r--r--map/trailblazer.json1
-rw-r--r--map/trailblazer.tmj45
-rw-r--r--map/tset.tsj14
-rw-r--r--map/wakywakysnakysnake.json1
-rw-r--r--map/wakywakysnakysnake.tmj45
-rw-r--r--map/weallstartsomewhere.json1
-rw-r--r--map/weallstartsomewhere.tmj45
-rw-r--r--src/map.c30
13 files changed, 257 insertions, 25 deletions
diff --git a/Makefile b/Makefile
index 808de94..1a546ba 100644
--- a/Makefile
+++ b/Makefile
@@ -3,7 +3,7 @@ LD := $(CC)
CFLAGS := -Os -std=c99 -Wall -Wextra -Imap -MMD
LDFLAGS := -lm -lSDL2 -lSDL2_image -lSDL2_mixer
NAME := hyperultra
-EMBED := $(patsubst %.json,%.h,$(wildcard map/*.json))
+EMBED := map/maps.h
OBJ := $(patsubst %.c,%.o,$(wildcard src/*.c))
DEP := $(patsubst %.o,%.d,$(OBJ))
@@ -17,8 +17,8 @@ $(NAME): $(OBJ)
%.o: %.c
$(CC) $(CFLAGS) -c -o $@ $<
-%.h: %.json
- able -e -i $< -o $@ 2&>/dev/null
+$(EMBED):
+ tmj2c map/*.tmj >$@
run: re
./$(NAME)
@@ -30,6 +30,6 @@ re:
@make --no-print-directory clean
@make --no-print-directory all
-.PHONY: all run clean re
+.PHONY: all run clean re $(EMBED)
-include $(DEP)
diff --git a/map/idkwymmdr.json b/map/idkwymmdr.json
deleted file mode 100644
index cfac04c..0000000
--- a/map/idkwymmdr.json
+++ /dev/null
@@ -1 +0,0 @@
-{"width":25,"height":14,"data":[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,5,0,0,0,0,0,0,0,1,5,0,0,0,0,0,0,0,0,0,0,5,1,1,1,5,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,5,1,1,0,0,0,0,0,0,0,0,1,0,0,0,5,0,0,0,0,5,0,0,0,0,0,1,1,0,0,0,1,1,1,1,0,1,0,1,1,0,0,0,0,0,0,1,1,0,0,1,1,1,0,0,0,1,0,0,1,0,0,1,1,1,1,1,0,0,1,1,1,0,0,1,0,1,1,0,0,0,1,1,1,0,0,0,1,5,0,5,1,0,0,1,0,0,0,0,1,0,1,1,0,0,1,1,1,5,0,0,0,1,0,0,0,1,0,1,1,1,1,0,1,1,0,1,1,0,0,1,5,1,1,1,0,1,1,0,0,1,1,0,1,5,0,0,0,1,0,0,1,1,2,0,1,0,0,5,1,0,1,1,5,1,1,0,0,1,0,0,0,1,1,0,5,1,1,1,1,0,0,0,1,0,0,0,1,1,1,0,0,1,5,0,0,1,1,0,4,0,1,1,5,0,0,5,1,5,0,0,0,0,0,0,0,0,1,0,0,0,5,1,1,1,0,1,1,0,0,0,1,0,0,0,5,0,0,0,0,5,1,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]} \ No newline at end of file
diff --git a/map/idkwymmdr.tmj b/map/idkwymmdr.tmj
new file mode 100644
index 0000000..b7f5261
--- /dev/null
+++ b/map/idkwymmdr.tmj
@@ -0,0 +1,45 @@
+{ "compressionlevel":-1,
+ "height":14,
+ "infinite":false,
+ "layers":[
+ {
+ "data":[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1, 1, 1, 1, 1],
+ "height":14,
+ "id":1,
+ "name":"Tile Layer 1",
+ "opacity":1,
+ "type":"tilelayer",
+ "visible":true,
+ "width":25,
+ "x":0,
+ "y":0
+ }],
+ "nextlayerid":2,
+ "nextobjectid":1,
+ "orientation":"orthogonal",
+ "renderorder":"right-down",
+ "tiledversion":"1.10.0",
+ "tileheight":16,
+ "tilesets":[
+ {
+ "firstgid":1,
+ "source":"tset.tsj"
+ }],
+ "tilewidth":16,
+ "type":"map",
+ "version":"1.10",
+ "width":25
+} \ No newline at end of file
diff --git a/map/nuancierdesaut.json b/map/nuancierdesaut.json
deleted file mode 100644
index 2ae06aa..0000000
--- a/map/nuancierdesaut.json
+++ /dev/null
@@ -1 +0,0 @@
-{"width":25,"height":14,"data":[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,1,1,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,3,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,1,1,0,0,0,1,1,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,2,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]} \ No newline at end of file
diff --git a/map/nuancierdesaut.tmj b/map/nuancierdesaut.tmj
new file mode 100644
index 0000000..632de5a
--- /dev/null
+++ b/map/nuancierdesaut.tmj
@@ -0,0 +1,45 @@
+{ "compressionlevel":-1,
+ "height":14,
+ "infinite":false,
+ "layers":[
+ {
+ "data":[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1,
+ 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1,
+ 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 3, 0, 1,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, 0, 0, 1,
+ 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 0, 2, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
+ "height":14,
+ "id":1,
+ "name":"Tile Layer 1",
+ "opacity":1,
+ "type":"tilelayer",
+ "visible":true,
+ "width":25,
+ "x":0,
+ "y":0
+ }],
+ "nextlayerid":2,
+ "nextobjectid":1,
+ "orientation":"orthogonal",
+ "renderorder":"right-down",
+ "tiledversion":"1.10.0",
+ "tileheight":16,
+ "tilesets":[
+ {
+ "firstgid":1,
+ "source":"tset.tsj"
+ }],
+ "tilewidth":16,
+ "type":"map",
+ "version":"1.10",
+ "width":25
+} \ No newline at end of file
diff --git a/map/trailblazer.json b/map/trailblazer.json
deleted file mode 100644
index 70b900b..0000000
--- a/map/trailblazer.json
+++ /dev/null
@@ -1 +0,0 @@
-{"width":25,"height":14,"data":[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,5,0,0,0,0,0,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,5,0,0,0,0,0,0,1,0,0,0,1,5,5,5,1,0,0,2,0,1,1,1,1,0,0,0,0,0,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,4,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]} \ No newline at end of file
diff --git a/map/trailblazer.tmj b/map/trailblazer.tmj
new file mode 100644
index 0000000..856253e
--- /dev/null
+++ b/map/trailblazer.tmj
@@ -0,0 +1,45 @@
+{ "compressionlevel":-1,
+ "height":14,
+ "infinite":false,
+ "layers":[
+ {
+ "data":[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 0, 0, 0, 0, 0, 5, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
+ 1, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
+ 1, 1, 1, 1, 5, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 5, 5, 5, 1, 0, 0, 2, 0, 1,
+ 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 0, 0, 0, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 0, 4, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
+ "height":14,
+ "id":1,
+ "name":"Tile Layer 1",
+ "opacity":1,
+ "type":"tilelayer",
+ "visible":true,
+ "width":25,
+ "x":0,
+ "y":0
+ }],
+ "nextlayerid":2,
+ "nextobjectid":1,
+ "orientation":"orthogonal",
+ "renderorder":"right-down",
+ "tiledversion":"1.10.0",
+ "tileheight":16,
+ "tilesets":[
+ {
+ "firstgid":1,
+ "source":"tset.tsj"
+ }],
+ "tilewidth":16,
+ "type":"map",
+ "version":"1.10",
+ "width":25
+} \ No newline at end of file
diff --git a/map/tset.tsj b/map/tset.tsj
new file mode 100644
index 0000000..c71ece6
--- /dev/null
+++ b/map/tset.tsj
@@ -0,0 +1,14 @@
+{ "columns":2,
+ "image":"..\/res\/tset.png",
+ "imageheight":48,
+ "imagewidth":32,
+ "margin":0,
+ "name":"tset",
+ "spacing":0,
+ "tilecount":6,
+ "tiledversion":"1.10.0",
+ "tileheight":16,
+ "tilewidth":16,
+ "type":"tileset",
+ "version":"1.10"
+} \ No newline at end of file
diff --git a/map/wakywakysnakysnake.json b/map/wakywakysnakysnake.json
deleted file mode 100644
index 8a0a3c3..0000000
--- a/map/wakywakysnakysnake.json
+++ /dev/null
@@ -1 +0,0 @@
-{"width":25,"height":14,"data":[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,5,0,0,0,1,1,1,1,5,0,0,0,0,0,0,0,2,0,0,1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,1,1,1,1,1,1,1,1,5,0,0,0,0,0,4,1,1,1,1,1,1,0,0,5,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,5,0,0,1,1,1,1,1,1,1,5,0,0,0,0,0,5,1,1,1,1,1,1,1,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,5,0,0,0,1,0,0,5,1,1,5,0,0,0,0,0,0,0,0,0,0,5,1,1,1,1,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,1,1,1,1,1,1,5,0,0,0,0,0,0,0,0,0,0,0,0,5,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,5,0,0,5,0,0,1,1,0,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]} \ No newline at end of file
diff --git a/map/wakywakysnakysnake.tmj b/map/wakywakysnakysnake.tmj
new file mode 100644
index 0000000..ea677d2
--- /dev/null
+++ b/map/wakywakysnakysnake.tmj
@@ -0,0 +1,45 @@
+{ "compressionlevel":-1,
+ "height":14,
+ "inf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, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
+ "height":14,
+ "id":1,
+ "name":"Tile Layer 1",
+ "opacity":1,
+ "type":"tilelayer",
+ "visible":true,
+ "width":25,
+ "x":0,
+ "y":0
+ }],
+ "nextlayerid":2,
+ "nextobjectid":1,
+ "orientation":"orthogonal",
+ "renderorder":"right-down",
+ "tiledversion":"1.10.0",
+ "tileheight":16,
+ "tilesets":[
+ {
+ "firstgid":1,
+ "source":"tset.tsj"
+ }],
+ "tilewidth":16,
+ "type":"map",
+ "version":"1.10",
+ "width":25
+} \ No newline at end of file
diff --git a/map/weallstartsomewhere.json b/map/weallstartsomewhere.json
deleted file mode 100644
index 10f4ff3..0000000
--- a/map/weallstartsomewhere.json
+++ /dev/null
@@ -1 +0,0 @@
-{"width":25,"height":14,"data":[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0,0,0,1,1,5,0,0,5,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,3,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,1,1,1,0,0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,5,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,1,1,1,1,5,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,1,1,1,1,1,0,0,1,0,1,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,1,1,1,0,0,0,1,1,1,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,5,1,1,0,2,0,0,0,5,0,0,0,1,1,0,1,1,1,0,0,5,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]} \ No newline at end of file
diff --git a/map/weallstartsomewhere.tmj b/map/weallstartsomewhere.tmj
new file mode 100644
index 0000000..0aae235
--- /dev/null
+++ b/map/weallstartsomewhere.tmj
@@ -0,0 +1,45 @@
+{ "compressionlevel":-1,
+ "height":14,
+ "infinite":false,
+ "layers":[
+ {
+ "data":[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
+ 1, 5, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 3, 0, 1,
+ 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 1,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1,
+ 1, 5, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1,
+ 1, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1,
+ 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 1,
+ 1, 0, 2, 0, 0, 0, 5, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 0, 5, 0, 0, 0, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1],
+ "height":14,
+ "id":1,
+ "name":"Tile Layer 1",
+ "opacity":1,
+ "type":"tilelayer",
+ "visible":true,
+ "width":25,
+ "x":0,
+ "y":0
+ }],
+ "nextlayerid":2,
+ "nextobjectid":1,
+ "orientation":"orthogonal",
+ "renderorder":"right-down",
+ "tiledversion":"1.10.0",
+ "tileheight":16,
+ "tilesets":[
+ {
+ "firstgid":1,
+ "source":"tset.tsj"
+ }],
+ "tilewidth":16,
+ "type":"map",
+ "version":"1.10",
+ "width":25
+} \ No newline at end of file
diff --git a/src/map.c b/src/map.c
index 05774c6..dcfd3fe 100644
--- a/src/map.c
+++ b/src/map.c
@@ -1,30 +1,28 @@
#include "map.h"
#include "lzy.h"
#include "cfg.h"
-#include "nuancierdesaut.h"
-#include "trailblazer.h"
-#include "weallstartsomewhere.h"
-#include "wakywakysnakysnake.h"
-#include "idkwymmdr.h"
+#include "maps.h"
#include <stddef.h>
#include <string.h>
#define LOL(x) (unsigned char *)(x)
-unsigned char *maps[] = {
- map_nuancierdesaut_json.data, LOL("nuancier de saut"),
- map_trailblazer_json.data, LOL("trailblazer"),
- map_weallstartsomewhere_json.data, LOL("we all start somewhere"),
- map_wakywakysnakysnake_json.data, LOL("waky waky snaky snake"),
- map_idkwymmdr_json.data, LOL("idk wym mdr"),
- NULL
+struct {
+ const Tmj2cMap *map;
+ const char *name;
+} maps[] = {
+ { &map_nuancierdesaut_tmj, "nuancier de saut" },
+ { &map_trailblazer_tmj, "trailblazer" },
+ { &map_weallstartsomewhere_tmj, "we all start somewhere" },
+ { &map_wakywakysnakysnake_tmj, "waky waky snaky snake" },
+ { &map_idkwymmdr_tmj, "idk wym mdr" },
};
unsigned int map_id = 0;
void
map_next(void)
{
- if (maps[map_id + 2] != NULL)
- map_id += 2;
+ if (map_id + 1 < sizeof(maps) / sizeof(maps[0]))
+ map_id += 1;
else
map_id = 0;
}
@@ -46,7 +44,7 @@ map_get(int x, int y)
{
if (x < 0 || y < 0 || x >= map_width() || y >= map_height())
return 1;
- return maps[map_id][x + y * map_width()];
+ return maps[map_id].map->layers[0].data[x + y * map_width()];
}
int
@@ -85,7 +83,7 @@ map_draw(void)
void
map_draw_ui(void)
{
- const char *s = (char *)maps[1 + map_id];
+ const char *s = maps[map_id].name;
const int x = (DISPLAY_WIDTH - CHR_WIDTH * strlen(s)) / 2;
const int y = (DISPLAY_HEIGHT - CHR_HEIGHT) / 2;
LZY_DrawText(x, y, s);