From 263cbe04948d3c8bf2c3a1e4613477cb46c4b07a Mon Sep 17 00:00:00 2001 From: EvanR Date: Sat, 22 May 2010 11:46:20 -0500 Subject: [PATCH] Fixed bug in loading new stage format. --- inner.c | 8 ++++---- stage.c | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/inner.c b/inner.c index 31def99..b2dc342 100644 --- a/inner.c +++ b/inner.c @@ -30,10 +30,10 @@ static void update(){ static void draw(){ int cx = camera_x(); int cy = camera_y(); - //stage_draw_bg(cx, cy); + stage_draw_bg(cx, cy, 0, 0, 320, 240); //entity_draw_visible(cx, cy); - //stage_draw_fg(cx, cy); - hud_draw(cx, cy); + stage_draw_fg(cx, cy, 0, 0, 320, 240); + //hud_draw(cx, cy); } static void press(input in){ @@ -63,7 +63,7 @@ void setup_inner(){ unload_zone(); - int x = load_zone("3ztest"); + int x = load_zone("woods"); if(x < 0){ error_msg("inner: cannot load zone\n"); exit(-1); diff --git a/stage.c b/stage.c index d115280..b9df3d9 100644 --- a/stage.c +++ b/stage.c @@ -164,7 +164,7 @@ x y fg bg shape while(!loader_feof(f)){ loader_scanline(f, "%d %d %d %d %c", &x, &y, &fg, &bg, &shape); - tptr = s->tiles + x + (s->w * y); + tptr = s->tiles + (x+ox) + (s->w * (y+oy)); tptr->fg = fg; tptr->bg = bg; tptr->shape = shape; @@ -255,7 +255,7 @@ void switch_stage(char* id){ printf("ERROR stage not found\n"); } -void draw_stage_fg(int cx, int cy, int x, int y, int w, int h){ +void stage_draw_fg(int cx, int cy, int x, int y, int w, int h){ //draw background /* draw background on tiles where at least the fg or bg tile is partial*/ @@ -263,7 +263,7 @@ void draw_stage_fg(int cx, int cy, int x, int y, int w, int h){ /* draw bg tile where fg is partial */ } -void draw_stage_bg(int cx, int cy, int x, int y, int w, int h){ +void stage_draw_bg(int cx, int cy, int x, int y, int w, int h){ //draw water /* calculate water surfaces, draw them */ //fg tiles -- 2.11.4.GIT