Remove loop when loading level pack
parent
f6f3214dc1
commit
ca392a0efd
|
@ -120,13 +120,7 @@ LevelPack_t* add_level_pack(Assets_t* assets, const char* name, const char* path
|
||||||
uint32_t n_tiles = pack_info->pack.levels[i].width * pack_info->pack.levels[i].height;
|
uint32_t n_tiles = pack_info->pack.levels[i].width * pack_info->pack.levels[i].height;
|
||||||
|
|
||||||
pack_info->pack.levels[i].tiles = calloc(n_tiles, sizeof(LevelTileInfo_t));
|
pack_info->pack.levels[i].tiles = calloc(n_tiles, sizeof(LevelTileInfo_t));
|
||||||
uint16_t dummy;
|
fread(pack_info->pack.levels[i].tiles, 4, n_tiles, file);
|
||||||
for (uint32_t j = 0; j < n_tiles; j++)
|
|
||||||
{
|
|
||||||
fread(&pack_info->pack.levels[i].tiles[j].tile_type, 1, 1, file);
|
|
||||||
fread(&pack_info->pack.levels[i].tiles[j].entity_to_spawn, 1, 1, file);
|
|
||||||
fread(&dummy, 2, 1, file);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fclose(file);
|
fclose(file);
|
||||||
|
|
|
@ -17,6 +17,7 @@ typedef struct LevelTileInfo
|
||||||
{
|
{
|
||||||
uint8_t tile_type;
|
uint8_t tile_type;
|
||||||
uint8_t entity_to_spawn;
|
uint8_t entity_to_spawn;
|
||||||
|
uint8_t dummy[2];
|
||||||
}LevelTileInfo_t;
|
}LevelTileInfo_t;
|
||||||
|
|
||||||
typedef struct LevelMap
|
typedef struct LevelMap
|
||||||
|
|
Loading…
Reference in New Issue