#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 void malloc_error() { extern image_t img_ram; timer_stop(0); dimage(0,0,&img_ram); dupdate(); while (1) mkb_getkey(); } void unpack_level(packed_level_t const * const packed_level_t p) { unsigned int const size = p->width*p->height; map_t * m = (map_t *) malloc( 4*sizeof(int) + size*sizeof(cell_t) ); if (m==0) malloc_error(); if (map_current) { free(map_current); map_current=0; } map_current=m; map_current->w = p->width; map_current->h = p->height; }