I have a function AddSprite(Drawable*, unsigned short), that adding Drawable to 2d vector with given layer number(as two parametr)
Its works perfectly, but when i added MapLoader ( its a fallahn`s sfml-tmxloader MapLoader that extends Drawable) to 0 layer and rendered it, i got 0xC0000005 error, i checked my layers numbers, all fine, map being loaded, i dont think what is wrong, my code below
tmx::MapLoader map("resources/");
map.addSearchPath("resources/blocks/");
if (map.load("map.tmx"))
{
if (debug) {
cout << "map loaded!" << endl;
}
}
else
{
if (debug) {
cout << "MAP NOT LOADED!" << endl;
}
}
engine->AddSprite(&map, 0);
//
my rendering code:
inline void Engine::render()
{
while (window.isOpen())
{
window.clear();
for (unsigned int i = 0; i < Engine::layerr.size(); i++)
{
for (unsigned int i1 = 0; i1 < Engine::layerr.at(i).size(); i1++)
{
window.draw(*(Engine::layerr.at(i).at(i1)));
}
}
window.display();
}
}
(i using multithread rendering, so rendering occurs in another detached thread)
my vector looks like this:
vector<vector<Drawable*>> layerr
its haves size 1, but i drawing to layer 0(first) and layers being initialized by:
void Engine::AddLayer(unsigned short layernum)
{
vector<Drawable*> tempvector;
Engine::layerr.push_back(tempvector);
}
sfml-tmxloader
https://github.com/fallahn/sfml-tmxloader is last version
SFML is 2.4.2
Tiled version is 2017.05.26
с++ version is 17 (2017) and visual studio same 2017
i using static SFML,static zlib,x64 architecture and static TMX (TMX_STATIC flag)
sorry for my bad english
Please anybody help me, i dont known what is wrong
my map with tsx and textures in archive attached below