I've got these tile based maps that I load for the player to walk on. Everything seems to work ok most of the time.
However, on full screen mode, the call to draw2DImage() causes my game to crash. I'm not sure what I'm doing wrong that is causing this. Here's the code that calls that:
Code: Select all
for (size_t i = 0; i < curMap->mapHeight; ++i)
{
for (size_t j = 0; j < curMap->mapWidth; ++j)
{
mapPosX += 22; // Tiles are 22 pixels in width
//This is the line that crashes.
driver->draw2DImage(curMap->mapLayout[i][j].tileImg,
core::position2d<s32>(mapPosX, mapPosY),
core::rect<s32>(0, 0, 22, 15), 0, video::SColor(255, 255, 255, 255), true);
}
mapPosX = 0;
mapPosY += 15; // Tiles are 15 pixels in height.
}
Code: Select all
curMap->mapLayout[i][j].tileImg = driver->getTexture("someTexture.png");