- Ja llig correctament el mapa en format text

This commit is contained in:
2023-10-18 17:25:24 +02:00
parent fdc604be3c
commit c6b994cc37
3 changed files with 20 additions and 7 deletions

View File

@@ -42,7 +42,7 @@ namespace mapa
do {
textfile::searchToken("LEVEL");
} while (std::stoi(textfile::getNextToken()) != game::getConfig("fase"));
} while (textfile::toInt(textfile::getNextToken()) != game::getConfig("fase"));
const int tileset = textfile::getIntValue("tileset");
arounders::orientacio_inicial = textfile::getIntValue("orientacio");
@@ -58,10 +58,10 @@ namespace mapa
accions::corda = textfile::getIntValue("corda");
ini_x = textfile::getIntValue("inici");
ini_y = std::stoi(textfile::getNextToken());
ini_y = textfile::toInt(textfile::getNextToken());
fin_x = textfile::getIntValue("final");
fin_y = std::stoi(textfile::getNextToken());
fin_y = textfile::toInt(textfile::getNextToken());
//int tilemap[200];
//for (int y=0; y<10; ++y) for (int x=0; x<10; ++x) fscanf(f, "%i", &tilemap[x+y*20]);
@@ -76,13 +76,13 @@ namespace mapa
for (int y=0; y<10; ++y)
for (int x=0; x<10; ++x)
{
int tile; fscanf(f, "%i", &tile);
int tile = textfile::toInt(textfile::getNextToken());
if (tile > 0) draw::draw(x*16, y*16, 16, 16, (tile-1)*16, tileset*16);
}
draw::freeSurface(tiles);
textfile::fclose();
textfile::close();
draw::surface *marcador = draw::loadSurface("marcador.gif");
draw::setSource(marcador);