ditch able for our boi tiled

This commit is contained in:
kdx 2023-03-24 23:31:41 +01:00
parent e236ce10d4
commit c2f29cd7b9
13 changed files with 257 additions and 25 deletions

View File

@ -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)

View File

@ -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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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],
"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
}

View File

@ -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,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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
}

View File

@ -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,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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
}

14
map/tset.tsj Normal file
View File

@ -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"
}

View File

@ -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,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
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],
"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
}

View File

@ -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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 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
}

View File

@ -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);