#include "world.h" #include "tile.h" #include #define min(x,y) (x>y?y:x) #define max(x,y) (x0) r-=8; return r; } static world_get_bottomy(int x) { int r = max(x-31,0)%8;// if (r>0) r-=8; return r; } */ int world_get_real_x0(int x) //mario delta en 0,0 {return max(x-63,0);} int world_get_real_y0(int x) //mario delta en 0,0 {return max(x-31,0);} /* static int get_cleft(int c) {return max(0, max(c-63,0)/8);} static int get_ctop(int c) {return max(0, max(c-31,0)/8);;} */ void world_draw(int x, int y) { int s_left = world_get_real_x0(x)%8-8; int s_top = world_get_real_y0(y)%8-8; int tx, ty, rx, ry; tx=s_left; rx=world_get_real_x0(x)-8; while (tx<128) { ry=world_get_real_y0(y)-8; ty=s_top; while (ty<64) { display_cell(rx,ry, tx, ty); ty+=8; ry+=8; } tx+=8; rx+=8; } }