projects
/
eradicate
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixed RLEsprite bug
[eradicate]
/
src
/
game.c
diff --git
a/src/game.c
b/src/game.c
index
238ee08
..
4c220b5
100644
(file)
--- a/
src/game.c
+++ b/
src/game.c
@@
-1,5
+1,6
@@
#include "game.h"
#include "screens.h"
#include "game.h"
#include "screens.h"
+#include "sprite.h"
int fb_width, fb_height;
long fb_size;
int fb_width, fb_height;
long fb_size;
@@
-10,9
+11,14
@@
long time_msec;
void (*draw)(void);
void (*key_event)(int key, int pressed);
void (*draw)(void);
void (*key_event)(int key, int pressed);
+static struct sprites dbgfont;
+
int init(int argc, char **argv)
{
int init(int argc, char **argv)
{
+ if(load_sprites(&dbgfont, "data/dbgfont.spr") == -1) {
+ return -1;
+ }
if(intro_init() == -1) {
return -1;
}
if(intro_init() == -1) {
return -1;
}
@@
-30,15
+36,17
@@
void cleanup(void)
menu_cleanup();
}
menu_cleanup();
}
-void cs_puts_font(cs_font_func csfont, int sz, void *fb, int x, int y, const char *str)
+void dbg_print(void *fb, int x, int y, const char *str)
{
{
+ uint16_t *dest = (uint16_t*)fb + y * fb_width + x;
+
while(*str) {
int c = *str++;
if(c > ' ' && c < 128) {
while(*str) {
int c = *str++;
if(c > ' ' && c < 128) {
- csfont(fb, x, y, c - ' ');
+ draw_sprite(dest, fb_width * 2, &dbgfont, c - ' ');
}
}
- x += sz;
+ dest += 8;
}
}
}
}