remove LZY_GINT_* related ifdef clauses
They caused a lot of confusion when undefined and doesn't help for parity.
This commit is contained in:
parent
2eb6438878
commit
bf1c9bd3d4
50
inc/lzy.h
50
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) {
|
||||
|
|
Loading…
Reference in New Issue