summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKikooDX <kikoodx@paranoici.org>2022-04-01 18:41:25 +0200
committerKikooDX <kikoodx@paranoici.org>2022-04-01 19:39:51 +0200
commit1c161f621f9946944c6cc718feaec63ce13acea7 (patch)
treeb0138bb98d5366ad6f2b602adeab572e19667d21
parent692beeca172b03787cd94a7bdff6c70fb8196afd (diff)
downloadwehfou-1c161f621f9946944c6cc718feaec63ce13acea7.tar.gz
draw lev-- SHIT ICE CREAM TRUCK
-rw-r--r--inc/level.h1
-rw-r--r--res/fxconv-metadata.txt1
-rw-r--r--src/level.c13
-rw-r--r--src/main.c2
4 files changed, 15 insertions, 2 deletions
diff --git a/inc/level.h b/inc/level.h
index 8b4e542..e944080 100644
--- a/inc/level.h
+++ b/inc/level.h
@@ -3,3 +3,4 @@
void level_deinit(void);
void level_load(int id);
void level_find(int tile, int *x, int *y);
+void level_draw(void);
diff --git a/res/fxconv-metadata.txt b/res/fxconv-metadata.txt
index 3e64f5d..327e8ab 100644
--- a/res/fxconv-metadata.txt
+++ b/res/fxconv-metadata.txt
@@ -1,6 +1,7 @@
tset.png:
type: bopti-image
name: bimg_tset
+ profile: p4
font.png:
type: bopti-image
name: bimg_font
diff --git a/src/level.c b/src/level.c
index 72e60d1..1259922 100644
--- a/src/level.c
+++ b/src/level.c
@@ -41,8 +41,19 @@ void level_find(int tile, int *x, int *y)
if (x != NULL)
*x = i % width * TILE_SIZE;
if (y != NULL)
- *y = i % height * TILE_SIZE;
+ *y = i / width * TILE_SIZE;
return;
}
}
}
+
+void level_draw(void)
+{
+ for (int y = 0; y < height; y++) {
+ for (int x = 0; x < width; x++) {
+ const int t = data[x + y * width];
+ if (t && t != 2)
+ LZY_DrawTile(t, x * TILE_SIZE, y * TILE_SIZE);
+ }
+ }
+}
diff --git a/src/main.c b/src/main.c
index 7cb99e3..b5ef9d7 100644
--- a/src/main.c
+++ b/src/main.c
@@ -16,7 +16,6 @@ int main(int argc, char **argv)
}
level_load(0);
- player_init(0, 0);
while (!LZY_ShouldQuit()) {
LZY_CycleEvents();
@@ -29,6 +28,7 @@ int main(int argc, char **argv)
LZY_DrawTileEx(TSET_LINE, 0, DISPLAY_HEIGHT / 2, 13, 7);
LZY_DrawTileEx(TSET_LINE, DISPLAY_WIDTH / 2, DISPLAY_HEIGHT / 2,
13, 7);
+ level_draw();
player_draw();
LZY_DrawEnd();
}