fix comment for Maps::getSize(); add getTileSize()

develop
myk002 2021-05-16 14:15:19 -07:00
parent a5c329cfb2
commit 5b960b97bc
No known key found for this signature in database
GPG Key ID: 8A39CA0FA0C16E78
2 changed files with 12 additions and 2 deletions

@ -260,8 +260,10 @@ extern DFHACK_EXPORT bool GetGlobalFeature(t_feature &feature, int32_t index);
* BLOCK DATA * BLOCK DATA
*/ */
/// get size of the map in tiles /// get size of the map in blocks
extern DFHACK_EXPORT void getSize(uint32_t& x, uint32_t& y, uint32_t& z); extern DFHACK_EXPORT void getSize(uint32_t& x, uint32_t& y, uint32_t& z);
/// get size of the map in tiles
extern DFHACK_EXPORT void getTileSize(uint32_t& x, uint32_t& y, uint32_t& z);
/// get the position of the map on world map /// get the position of the map on world map
extern DFHACK_EXPORT void getPosition(int32_t& x, int32_t& y, int32_t& z); extern DFHACK_EXPORT void getPosition(int32_t& x, int32_t& y, int32_t& z);

@ -106,7 +106,7 @@ bool Maps::IsValid ()
return (world->map.block_index != NULL); return (world->map.block_index != NULL);
} }
// getter for map size // getter for map size in blocks
void Maps::getSize (uint32_t& x, uint32_t& y, uint32_t& z) void Maps::getSize (uint32_t& x, uint32_t& y, uint32_t& z)
{ {
if (!IsValid()) if (!IsValid())
@ -119,6 +119,14 @@ void Maps::getSize (uint32_t& x, uint32_t& y, uint32_t& z)
z = world->map.z_count_block; z = world->map.z_count_block;
} }
// getter for map size in tiles
void Maps::getTileSize (uint32_t& x, uint32_t& y, uint32_t& z)
{
getSize(x, y, z);
x *= 16;
y *= 16;
}
// getter for map position // getter for map position
void Maps::getPosition (int32_t& x, int32_t& y, int32_t& z) void Maps::getPosition (int32_t& x, int32_t& y, int32_t& z)
{ {