1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-22 22:13:35 +02:00

Fix order of objects

This commit is contained in:
nordsoft 2022-08-30 06:56:37 +04:00
parent 3c062bae32
commit ab46e8f128
2 changed files with 2 additions and 11 deletions

View File

@ -133,13 +133,6 @@ void MainWindow::on_actionOpen_triggered()
for(int i = 0; i < map->width; ++i)
{
mapHandler.drawTerrainTile(i, j, 0);
}
}
for(int j = 0; j < map->height; ++j)
{
for(int i = 0; i < map->width; ++i)
{
mapHandler.drawObjects(i, j, 0);
}
}

View File

@ -336,8 +336,6 @@ void MapHandler::drawObjects(int x, int y, int z)
auto & objects = ttiles[z * (sizes.x * sizes.y) + y * sizes.x + x].objects;
for(auto & object : objects)
{
if(!object.real)
continue;
//if(object.visi)
const CGObjectInstance * obj = object.obj;
@ -352,9 +350,9 @@ void MapHandler::drawObjects(int x, int y, int z)
auto objData = findObjectBitmap(obj, animationFrame);
if (objData.objBitmap)
{
QRect srcRect(object.rect.x(), object.rect.y(), tileSize, tileSize);
QRect srcRect(object.rect.x() + x * 32, object.rect.y() + y * 32, tileSize, tileSize);
painter.drawImage(x * tileSize, y * tileSize, *objData.objBitmap);
painter.drawImage(x * 32 - object.rect.x(), y * 32 - object.rect.y(), *objData.objBitmap);
//drawObject(targetSurf, objData.objBitmap, &srcRect, objData.isMoving);
if (objData.flagBitmap)
{