Skip to content

Commit

Permalink
More docs
Browse files Browse the repository at this point in the history
  • Loading branch information
captainurist committed Nov 16, 2024
1 parent f176e14 commit 85da476
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/Engine/Graphics/OutdoorTerrain.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,21 @@ struct TileData;
struct OutdoorLocation_MM7;

/**
* A note on grid coordinates. In grid coordinates Y-axis points south (down on the minimap), X-axis points east (right
* on the minimap), `(0, 0)` is NW (top-left) corner of the map.
*
* @param gridPos Grid coordinates.
* @return World coordinates of the grid's corner. XXX
* @return World coordinates of the grid cell's NW (top-left on the minimap) corner.
* @offset 0x0047F469, 0x0047F476
*/
inline Vec2i gridToWorld(Pointi gridPos) {
return {(gridPos.x - 64) << 9, (64 - gridPos.y) << 9};
}

/**
* A note on world coordinates. Y-axis points north (up on the minimap), X-axis points east (right on the minimap),
* `(0, 0)` is in the center of the map.
*
* @param worldPos Position in world coordinates.
* @return Grid cell coordinates that `worldPos` is in.
* @offset 0x0047F44B, 0x0047F458
Expand Down

0 comments on commit 85da476

Please sign in to comment.