#include "level.h" #include "world.h" #include "mario.h" #include "score.h" #include "ennemi.h" #include "keyboard.h" #include #include #include #include #include #include #include #include #define PACKED_EMPTY 0 #define PACKED_STONE 1 #define PACKED_COIN 2 #define PACKED_BRICK 3 #define PACKED_BRICK_COIN 4 #define PACKED_BOX_COIN 5 #define PACKED_BOX_CHAMPI 6 #define PACKED_BETON 7 #define PACKED_TUYAU_BOUT 8 #define PACKED_TUYAU_MIDDLE 9 void malloc_error() { extern image_t img_ram; timer_stop(0); dimage(0,0,&img_ram); dupdate(); while (1) mkb_getkey(); } static uint8_t pack_access(packed_level_t const * const p, int x, int y) { if (0<=x && xdata[x*p->height+y]; else return PACKED_EMPTY; } static void cell_set(cell_t *const array, int w, int h, int x, int y, cell_t const cell) { if (0<=x && xwidth; const unsigned int h = p->height; cell_t * c = (cell_t *) malloc(sizeof(cell_t) * w * h); if (c==0) malloc_error(); int sx=0, sy=p->height; // Mario start coords for (int x=0; x