Good afternoon,
I have found an strange behaviour (sure it's a stupid question) but I was doing a tileMap for my game following the SFML example
https://www.sfml-dev.org/tutorials/2.5/graphics-vertex-array.php#example-tile-map and the result is:
(This is the good image - the tilemap is smaller than the screen, so it displays the black space)
The int array is created in the buildScene function of class world and passed to the tilemap in the same function.
The problem is that if I create the array in the header file it shows more sprites than normal.
Also, I had changed the c style array to a std::vector that is created in the header and filled in the constructor and it gives the same problem.
Do you know what is happening?
PD printing the array in World::buildScene and TileMap::load gives the same array.
buildScene
1 1 1 1 1 1 1 1 1 1 1 1 1 33 33 291 1 1 1 1 1 1 1 1 1 65 101 99 1 1 32 1 289 1 1 1 1 65 67 1 1 1 1 1 1 1 1 1 0 65 67 1 1 32 32 32 32 1 1 1 1 65 67 1 1 32 1 1 10 11 1 1 1 97 99 1 1 32 32 1 42 43 1 1 1 1 1 1 1 230 231 32 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
TileMap::load
1 1 1 1 1 1 1 1 1 1 1 1 1 33 33 291 1 1 1 1 1 1 1 1 1 65 101 99 1 1 32 1 289 1 1 1 1 65 67 1 1 1 1 1 1 1 1 1 0 65 67 1 1 32 32 32 32 1 1 1 1 65 67 1 1 32 1 1 10 11 1 1 1 97 99 1 1 32 32 1 42 43 1 1 1 1 1 1 1 230 231 32 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
------------------------
header file:
https://github.com/lazaro92/fantasy-maker/blob/feature/1/Include/Book/World.hppsrc file:
https://github.com/lazaro92/fantasy-maker/blob/feature/1/Source/World.cpp