#ifndef LZY_H_ #define LZY_H_ #ifdef __cplusplus extern "C" { #endif #include int LZY_Init(void); int LZY_Deinit(void); int LZY_DrawBegin(void); int LZY_DrawEnd(void); void LZY_DrawSetColor(uint8_t r, uint8_t g, uint8_t b); int LZY_DrawClear(void); void LZY_CycleEvents(void); int LZY_KeyDown(unsigned int scancode); const char *LZY_GetError(void); #ifdef FXCG50 #include enum LZY_ScanCode { LZY_SC_ESCAPE = KEY_EXIT, }; #else /* end FXCG50, begin SDL2 */ #include enum LZY_ScanCode { LZY_SC_ESCAPE = SDLK_ESCAPE, }; #endif /* SDL2 */ #ifdef __cplusplus } #endif #endif /* LZY_H_ */ /* implementation */ #ifdef LZY_IMPLEMENTATION #ifndef LZY_TILE_SIZE #define LZY_TILE_SIZE 16 #endif #ifdef FXCG50 #include #include static color_t draw_color; int LZY_Init(void) { return 0; } int LZY_Deinit(void) { return 0; } int LZY_DrawBegin(void) { return 0; } int LZY_DrawEnd(void) { return 0; } void LZY_DrawSetColor(uint8_t r, uint8_t g, uint8_t b) { draw_color = C_RGB(r << 3, g << 3, b << 3); } int LZY_DrawClear(void) { return 0; } void LZY_CycleEvents(void) {} int LZY_KeyDown(unsigned int scancode) { return 0; } const char *LZY_GetError(void) { return NULL; } #else /* end FXCG50, begin SDL2 */ #include #include int LZY_Init(void) { return 0; } int LZY_Deinit(void) { return 0; } int LZY_DrawBegin(void) { return 0; } int LZY_DrawEnd(void) { return 0; } void LZY_DrawSetColor(uint8_t r, uint8_t g, uint8_t b) {} int LZY_DrawClear(void) { return 0; } void LZY_CycleEvents(void) {} int LZY_KeyDown(unsigned int scancode) { return 0; } const char *LZY_GetError(void) { return NULL; } #endif /* SDL2 */ #endif /* LZY_IMPLEMENTATION */