Make gfx_draw return int
This commit is contained in:
parent
132d8c860e
commit
938ab93482
|
@ -94,7 +94,9 @@ int game(void)
|
|||
}
|
||||
|
||||
instance_cyclic();
|
||||
gfx_draw();
|
||||
|
||||
if (gfx_draw())
|
||||
goto end;
|
||||
}
|
||||
|
||||
ret = 0;
|
||||
|
|
|
@ -11,7 +11,7 @@ extern "C"
|
|||
#endif
|
||||
|
||||
int gfx_init(void);
|
||||
void gfx_draw(void);
|
||||
int gfx_draw(void);
|
||||
int gfx_toggle_fullscreen(void);
|
||||
void sprite_sort(struct sprite *s);
|
||||
int sprite_clone(const struct sprite *src, struct sprite *dst);
|
||||
|
|
|
@ -55,7 +55,7 @@ static void gfx_sync(void)
|
|||
vblank_set = false;
|
||||
}
|
||||
|
||||
void gfx_draw(void)
|
||||
int gfx_draw(void)
|
||||
{
|
||||
static union gfx_sznext term = {.cmd_next = 0xffffff};
|
||||
|
||||
|
@ -71,4 +71,5 @@ void gfx_draw(void)
|
|||
D2_BCR = 0;
|
||||
D2_CHCR = (1 << 0xa) | 1 | (1 << 0x18);
|
||||
first = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -158,7 +158,7 @@ int gfx_toggle_fullscreen(void)
|
|||
return 0;
|
||||
}
|
||||
|
||||
void gfx_draw(void)
|
||||
int gfx_draw(void)
|
||||
{
|
||||
enum {FPS = 50, REFRESH_MS = 1000 / FPS};
|
||||
static Uint32 prev;
|
||||
|
@ -170,7 +170,11 @@ void gfx_draw(void)
|
|||
prev = SDL_GetTicks();
|
||||
|
||||
if (SDL_Flip(screen))
|
||||
{
|
||||
fprintf(stderr, "SDL_Flip: %s\n", SDL_GetError());
|
||||
return -1;
|
||||
}
|
||||
|
||||
get_resize_events();
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue