summaryrefslogtreecommitdiff
path: root/src/game.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/game.c')
-rw-r--r--src/game.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/game.c b/src/game.c
index c4ff9ff..5f18fe9 100644
--- a/src/game.c
+++ b/src/game.c
@@ -53,15 +53,15 @@ void g_update() {
}
}
-void g_draw() {
- int x = g_map()->t2c->width * cfg.tile_width/2 - cfg.display_width/2;
- int y = g_map()->t2c->height * cfg.tile_height/2 - cfg.display_height/2;
+void g_draw(int x, int y) {
+ int cx = g_map()->t2c->width * cfg.tile_width/2 - cfg.display_width/2;
+ int cy = g_map()->t2c->height * cfg.tile_height/2 - cfg.display_height/2;
if (g->shake) {
- x += g->shake - rand() % (g->shake * 2);
- y += g->shake - rand() % (g->shake * 2);
+ cx += g->shake - rand() % (g->shake * 2);
+ cy += g->shake - rand() % (g->shake * 2);
}
- TZR_SetCamera(x, y);
- TZR_DrawSetColor(1, 1, 1);
+ TZR_SetCamera(x + cx, y + cy);
+ fgcolor();
map_draw(g_map(), v2_zero());
PROCESS(draw_begin);
PROCESS(draw);