Redefine camera scroll as view center
This commit is contained in:
@@ -134,6 +134,9 @@ private:
|
||||
|
||||
float tilePx() const;
|
||||
float viewportWidthTiles() const;
|
||||
// World-X (tiles) at the left edge of the viewport. m_scrollXTiles stores the
|
||||
// view center; this derives the left edge the world<->widget conversions need.
|
||||
float viewLeftTiles() const;
|
||||
QPointF worldToWidget(QVector2D worldPos) const;
|
||||
QPointF tileToWidget(QPoint tile) const;
|
||||
QPoint widgetToTile(QPoint widgetPt) const;
|
||||
@@ -218,6 +221,7 @@ private:
|
||||
std::mt19937 m_rng;
|
||||
double m_gameSpeedMultiplier;
|
||||
double m_prevNonZeroSpeed;
|
||||
// World-X (tiles) at the center of the viewport (see viewLeftTiles()).
|
||||
float m_scrollXTiles;
|
||||
|
||||
QTimer* m_renderTimer;
|
||||
|
||||
Reference in New Issue
Block a user