fixed missing toreillerLoop in debug picking
This commit is contained in:
parent
2305173f4c
commit
3ec9f35fd6
@ -189,8 +189,13 @@ Coord PixelPipeline::setCursorPosPicking(int mouseX, int mouseY)
|
|||||||
pos /= glm::vec2(m_width, m_height); // part that depends on resolution
|
pos /= glm::vec2(m_width, m_height); // part that depends on resolution
|
||||||
pos = (pos - glm::vec2(0.5f))*m_mapHeight/m_camera.z; // part that depends on camera zoom
|
pos = (pos - glm::vec2(0.5f))*m_mapHeight/m_camera.z; // part that depends on camera zoom
|
||||||
pos += glm::vec2(m_camera.x + 0.5f, -m_camera.y + 0.5f)*m_mapHeight; // part that depends on camera offset
|
pos += glm::vec2(m_camera.x + 0.5f, -m_camera.y + 0.5f)*m_mapHeight; // part that depends on camera offset
|
||||||
debugCursorPos = pos;
|
if(pos.x < 0)
|
||||||
return Coord(pos.x, pos.y);
|
--pos.x;
|
||||||
|
if(pos.y < 0)
|
||||||
|
--pos.y;
|
||||||
|
Coord coordPos = m_map->toreillerLoop(Coord(pos.x, pos.y));
|
||||||
|
setCursorPos(coordPos);
|
||||||
|
return coordPos;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PixelPipeline::setCursorPos(const Coord &pos)
|
void PixelPipeline::setCursorPos(const Coord &pos)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user