REname map_* for more lisibility

This commit is contained in:
Ulysse Cura 2025-08-26 02:10:21 +02:00
parent ea8f2cab2f
commit eac6432a28
3 changed files with 31 additions and 23 deletions

View File

@ -1,9 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.10" tiledversion="1.11.1" orientation="orthogonal" renderorder="left-up" width="32" height="24" tilewidth="16" tileheight="16" infinite="0" nextlayerid="12" nextobjectid="12">
<map version="1.10" tiledversion="1.11.1" orientation="orthogonal" renderorder="left-up" width="32" height="24" tilewidth="16" tileheight="16" infinite="0" nextlayerid="13" nextobjectid="12">
<editorsettings>
<export target="dungeon_entry.json" format="json"/>
</editorsettings>
<tileset firstgid="1" source="../tileset/tileset.tsx"/>
<tileset firstgid="2647" source="hiitboxes.tsx"/>
<layer id="3" name="BackgroundLayer1" width="32" height="24">
<data encoding="base64" compression="zlib">
eJx9ljlsU0EQhtfv2c+OAkgcCYlEABGnAiooOSRuKKAAXAENDQ0VIeHogkHiMDRQuAcSjgKQDFKAECSgCBU0QUkeBhLsSAlHaij4V2+HNztvneLT857/zOzsrKueUp9BlREadP8keAPGfaUmQAguo30FXAXXQMnM1Wtac0otB22gPZfcW7d/BUr9BnOBvW+V2VLO2O0FaaUWgkVgEO3n4AV4CYbMnG7o7QZ7wF6wLxfZ1MnsewSdx+CJH/XxfU+g/TSI5o1k4jWbMLYZbAFbwQz6ZsEP8FP7Y/bvhd4ZcBacA+fBQfQfAofBF2h+Bd/AJJjyo/1p3zLz9w/0/2bic+BxXIF1HWAlWGX8OI65A9C7B+6DB+AhKGLsIrgEFkNjCVgKloGWdLw3+foerEUM1oH1Qaxf9ZJnecCP+25C/xYYg+Y4mABjaFd0TMEzsA1628EOsBPsSkf7U86RDUegexQcC2z7ZH7mMnHfW/x+B5qbcKZNUV+zsb8OpsEp6HWD06AH9KZjTUKvK2HddXAjsG2jGBSUUnkVfTVdBj2WziRjSmtvQ+8OuAv6wQAoZu0z1r+HoPsKDIPXxoY12H8a1Nm37mh3qni/k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CDsX7sUvjfHd4/5HKeiJv8n/j/pddkXoOGPO6VQYf9a97Gfw/HA3i0ef+4ZX2e8+gfd/DvU5yn7GraYzwrpBn30DtG/wejX2Y8j7YxrJ/NGIsW4FdKezdtjgkG/zB8IyCkuO/dP8HZdHQ=
</data>
</layer>
<layer id="12" name="HitBoxes" width="32" height="24" visible="0">
<data encoding="base64" compression="zlib">
eJwL52JgCB/Fo3gUj+JRjBNHYMHEyFHLbnroobY51HADuWZQMw5IjVNqxz+x5tIi7eGyg9ZpfhSP4lFMewwANhMjLQ==
</data>
</layer>
</map>

View File

@ -12,54 +12,54 @@ void verify_maps_integrity(void)
const entity_t *ENTITIES = MAPS[map_index]->entities;
std::cout << "Map " << map_index + 1 << std::endl;
std::cout << " - MapName : " << MAPS[map_index]->map_name << std::endl;
std::cout << " - MapWidth : " << MAPS[map_index]->map_width << std::endl;
std::cout << " - MapHeight : " << MAPS[map_index]->map_height << std::endl;
std::cout << " - MapName : " << MAPS[map_index]->name << std::endl;
std::cout << " - MapWidth : " << MAPS[map_index]->width << std::endl;
std::cout << " - MapHeight : " << MAPS[map_index]->height << std::endl;
std::cout << " BackgroundLayer1 :";
for(uint32_t tile_index_x = 0; tile_index_x < MAPS[map_index]->map_width; tile_index_x++)
for(uint32_t tile_index_x = 0; tile_index_x < MAPS[map_index]->width; tile_index_x++)
{
std::cout << "\n ";
for(uint32_t tile_index_y = 0; tile_index_y < MAPS[map_index]->map_height; tile_index_y++)
for(uint32_t tile_index_y = 0; tile_index_y < MAPS[map_index]->height; tile_index_y++)
{
std::cout << MAPS[map_index]->map_background_layer1[tile_index_x * MAPS[map_index]->map_width + tile_index_y] << ",";
std::cout << MAPS[map_index]->background_layer1[tile_index_x * MAPS[map_index]->width + tile_index_y] << ",";
}
}
std::cout << "\n BackgroundLayer2 :";
for(uint32_t tile_index_x = 0; tile_index_x < MAPS[map_index]->map_width; tile_index_x++)
for(uint32_t tile_index_x = 0; tile_index_x < MAPS[map_index]->width; tile_index_x++)
{
std::cout << "\n ";
for(uint32_t tile_index_y = 0; tile_index_y < MAPS[map_index]->map_height; tile_index_y++)
for(uint32_t tile_index_y = 0; tile_index_y < MAPS[map_index]->height; tile_index_y++)
{
std::cout << MAPS[map_index]->map_background_layer2[tile_index_x * MAPS[map_index]->map_width + tile_index_y] << ",";
std::cout << MAPS[map_index]->background_layer2[tile_index_x * MAPS[map_index]->width + tile_index_y] << ",";
}
}
std::cout << "\n BackgroundLayer3 :";
for(uint32_t tile_index_x = 0; tile_index_x < MAPS[map_index]->map_width; tile_index_x++)
for(uint32_t tile_index_x = 0; tile_index_x < MAPS[map_index]->width; tile_index_x++)
{
std::cout << "\n ";
for(uint32_t tile_index_y = 0; tile_index_y < MAPS[map_index]->map_height; tile_index_y++)
for(uint32_t tile_index_y = 0; tile_index_y < MAPS[map_index]->height; tile_index_y++)
{
std::cout << MAPS[map_index]->map_background_layer3[tile_index_x * MAPS[map_index]->map_width + tile_index_y] << ",";
std::cout << MAPS[map_index]->background_layer3[tile_index_x * MAPS[map_index]->width + tile_index_y] << ",";
}
}
std::cout << "\n Foreground :";
for(uint32_t tile_index_x = 0; tile_index_x < MAPS[map_index]->map_width; tile_index_x++)
for(uint32_t tile_index_x = 0; tile_index_x < MAPS[map_index]->width; tile_index_x++)
{
std::cout << "\n ";
for(uint32_t tile_index_y = 0; tile_index_y < MAPS[map_index]->map_height; tile_index_y++)
for(uint32_t tile_index_y = 0; tile_index_y < MAPS[map_index]->height; tile_index_y++)
{
std::cout << MAPS[map_index]->map_foreground[tile_index_x * MAPS[map_index]->map_width + tile_index_y] << ",";
std::cout << MAPS[map_index]->foreground[tile_index_x * MAPS[map_index]->width + tile_index_y] << ",";
}
}

View File

@ -4,15 +4,17 @@
#include "ecs/ecs.hpp"
typedef struct map_t {
const char *map_name;
const char *name;
const uint32_t map_width;
const uint32_t map_height;
const uint32_t width;
const uint32_t height;
const uint16_t *map_background_layer1;
const uint16_t *map_background_layer2;
const uint16_t *map_background_layer3;
const uint16_t *map_foreground;
const uint16_t *background_layer1;
const uint16_t *background_layer2;
const uint16_t *background_layer3;
const uint16_t *foreground;
const uint32_t *hitboxes;
const uint32_t nb_entities;
const entity_t *entities;