clear world.c code

dev
Milang 3 years ago
parent de30485e46
commit 0c527962ab
  1. BIN
      INIT/CasioRAM.mem
  2. BIN
      SuperCbr.g1a
  3. 21
      src/world.c

Binary file not shown.

Binary file not shown.

@ -179,16 +179,17 @@ void world_draw()
int my0=camera_y();
int sx0=mx0%8;
int sy0=my0%8;
int mx=mx0;
for (int i=0; i<=17; i++)
//int mx=mx0;
int mx, my;
for (int i=0, mx=mx0; i<=17; i++, mx+=8)
{
int my=my0;
for (int j=0; j<=9; j++)
//int my=my0;
for (int j=0, my=my0; j<=9; j++, my+=8)
{
display_cell(mx, my, 8*i-sx0, 8*j-sy0,0); //ap
my+=8;
//my+=8;
}
mx+=8;
//mx+=8;
}
bonus_draw();
@ -204,7 +205,7 @@ void world_draw()
for (int i=0; i<=17; i++)
{
int my=my0;
for (int j=0; j<=9; j++)
for (int j=0; j<=9; j++)
{
display_cell(mx, my, 8*i-sx0, 8*j-sy0,1); //pp
my+=8;
@ -254,9 +255,9 @@ void world_set(int w, int h, int x, int y, cell_t const * a)
// Calculates the new struct size
int size= 4*sizeof(int) + sizeof(cell_t)*w*h;
map_current=(map_t*)malloc_prof(size);
if (map_current==0)
malloc_error();
// Copy map into ram
map_current=(map_t*)malloc_prof(size); if (map_current==0) malloc_error();
// Copy the map to ram
map_current->w = w;

Loading…
Cancel
Save