aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKikooDX <kikoodx@paranoici.org>2022-04-12 12:02:53 +0200
committerKikooDX <kikoodx@paranoici.org>2022-04-12 12:02:55 +0200
commitbf1c9bd3d4625f85dedfa8a241e08bca54caeea4 (patch)
tree7377b4262a07dda84fe9daa6c6a8d573314a1ba4
parent2eb6438878ddaadd1dd07e75b14238d3051b66c7 (diff)
downloadlzy-bf1c9bd3d4625f85dedfa8a241e08bca54caeea4.tar.gz
remove LZY_GINT_* related ifdef clauses
They caused a lot of confusion when undefined and doesn't help for parity.
-rw-r--r--inc/lzy.h50
1 files changed, 8 insertions, 42 deletions
diff --git a/inc/lzy.h b/inc/lzy.h
index 9509bdf..6e51755 100644
--- a/inc/lzy.h
+++ b/inc/lzy.h
@@ -206,37 +206,33 @@ static color_t draw_color = C_BLACK;
static int should_quit = 0;
static int timer = 0;
static volatile int has_ticked = 0;
-#ifdef LZY_GINT_TILESET
static unsigned int tset_width, tset_height;
-#endif
-#ifdef LZY_GINT_FONT
static unsigned int font_width, font_height;
-#endif
static int timer_callback(volatile int *);
int LZY_Init(int argc, const char **argv, const char *title, int target_fps,
const char *tset_path, const char *font_path) {
-#ifdef LZY_GINT_TILESET
extern bopti_image_t LZY_GINT_TILESET;
- tset_width = LZY_GINT_TILESET.width / LZY_TILE_SIZE;
- tset_height = LZY_GINT_TILESET.height / LZY_TILE_SIZE;
-#endif
-#ifdef LZY_GINT_FONT
extern bopti_image_t LZY_GINT_FONT;
- font_width = LZY_GINT_FONT.width / LZY_CHR_WIDTH;
- font_height = LZY_GINT_FONT.height / LZY_CHR_HEIGHT;
-#endif
+
LZY_UNUSED(argc);
LZY_UNUSED(argv);
LZY_UNUSED(title);
LZY_UNUSED(tset_path);
LZY_UNUSED(font_path);
+ tset_width = LZY_GINT_TILESET.width / LZY_TILE_SIZE;
+ tset_height = LZY_GINT_TILESET.height / LZY_TILE_SIZE;
+
+ font_width = LZY_GINT_FONT.width / LZY_CHR_WIDTH;
+ font_height = LZY_GINT_FONT.height / LZY_CHR_HEIGHT;
+
if (target_fps > 0) {
timer = timer_configure(TIMER_ANY, 1000000 / target_fps,
GINT_CALL(timer_callback, &has_ticked));
timer_start(timer);
}
+
return 0;
}
@@ -303,12 +299,6 @@ int LZY_DrawFillRect(int x, int y, unsigned int w, unsigned int h) {
}
int LZY_DrawTile(unsigned int id, int x, int y) {
-#ifndef LZY_GINT_TILESET
- LZY_UNUSED(id);
- LZY_UNUSED(x);
- LZY_UNUSED(y);
- return -1;
-#else
extern bopti_image_t LZY_GINT_TILESET;
int ix, iy;
@@ -323,19 +313,10 @@ int LZY_DrawTile(unsigned int id, int x, int y) {
DIMAGE_NONE);
return 0;
-#endif
}
int LZY_DrawTileEx(unsigned int id, int x, int y, unsigned int w,
unsigned int h) {
-#ifndef LZY_GINT_TILESET
- LZY_UNUSED(id);
- LZY_UNUSED(x);
- LZY_UNUSED(y);
- LZY_UNUSED(w);
- LZY_UNUSED(h);
- return -1;
-#else
extern bopti_image_t LZY_GINT_TILESET;
int ix, iy;
@@ -358,16 +339,9 @@ int LZY_DrawTileEx(unsigned int id, int x, int y, unsigned int w,
h * LZY_TILE_SIZE, DIMAGE_NONE);
return 0;
-#endif
}
int LZY_DrawChar(unsigned char chr, int x, int y) {
-#ifndef LZY_GINT_FONT
- LZY_UNUSED(chr);
- LZY_UNUSED(x);
- LZY_UNUSED(y);
- return -1;
-#else
extern bopti_image_t LZY_GINT_FONT;
const unsigned int id = (unsigned int)chr - LZY_FIRST_CHR;
int ix, iy;
@@ -383,16 +357,9 @@ int LZY_DrawChar(unsigned char chr, int x, int y) {
DIMAGE_NONE);
return 0;
-#endif
}
int LZY_DrawText(int x, int y, const char *text) {
-#ifndef LZY_GINT_FONT
- LZY_UNUSED(text);
- LZY_UNUSED(x);
- LZY_UNUSED(y);
- return -1;
-#else
int err = 0;
if (text == NULL)
@@ -406,7 +373,6 @@ int LZY_DrawText(int x, int y, const char *text) {
}
return err;
-#endif
}
LZY_Music *LZY_MusicLoad(const char *path) {