You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
openmw/components/esm/util.cpp

17 lines
422 B
C++

#include "util.hpp"
osg::Vec2 ESM::indexToPosition(const ESM::ExteriorCellIndex& cellIndex, bool centre)
{
const int cellSize = ESM::getCellSize(ESM::isEsm4Ext(cellIndex.mWorldspace));
float x = static_cast<float>(cellSize * cellIndex.mX);
float y = static_cast<float>(cellSize * cellIndex.mY);
if (centre)
{
x += cellSize / 2;
y += cellSize / 2;
}
return osg::Vec2(x, y);
}