mirror of
https://github.com/minetest/minetestmapper.git
synced 2024-11-21 23:13:53 +01:00
Added draworigin.
This commit is contained in:
parent
b0f36ba4cf
commit
3349bee3a4
@ -196,11 +196,6 @@ void TileGenerator::setDrawScale(bool drawScale)
|
||||
}
|
||||
}
|
||||
|
||||
void TileGenerator::setDrawUnderground(bool drawUnderground)
|
||||
{
|
||||
m_drawUnderground = drawUnderground;
|
||||
}
|
||||
|
||||
void TileGenerator::parseColorsFile(const std::string &fileName)
|
||||
{
|
||||
ifstream in;
|
||||
@ -243,6 +238,9 @@ void TileGenerator::generate(const std::string &input, const std::string &output
|
||||
if (m_drawScale) {
|
||||
renderScale();
|
||||
}
|
||||
if (m_drawOrigin) {
|
||||
renderOrigin();
|
||||
}
|
||||
writeImage(output);
|
||||
}
|
||||
|
||||
@ -535,6 +533,13 @@ void TileGenerator::renderScale()
|
||||
}
|
||||
}
|
||||
|
||||
void TileGenerator::renderOrigin()
|
||||
{
|
||||
int imageX = -m_xMin * 16 + m_border;
|
||||
int imageY = m_mapHeight - m_zMin * -16 + m_border;
|
||||
gdImageArc(m_image, imageX, imageY, 12, 12, 0, 360, rgb2int(m_originColor.r, m_originColor.g, m_originColor.b));
|
||||
}
|
||||
|
||||
inline std::list<int> TileGenerator::getZValueList() const
|
||||
{
|
||||
std::list<int> zlist;
|
||||
|
@ -84,7 +84,6 @@ public:
|
||||
void setDrawOrigin(bool drawOrigin);
|
||||
void setDrawPlayers(bool drawPlayers);
|
||||
void setDrawScale(bool drawScale);
|
||||
void setDrawUnderground(bool drawUnderground);
|
||||
void parseColorsFile(const std::string &fileName);
|
||||
void generate(const std::string &input, const std::string &output);
|
||||
|
||||
@ -99,6 +98,7 @@ private:
|
||||
void renderMapBlock(const std::string &mapBlock, const BlockPos &pos, int version);
|
||||
void renderShading(int zPos);
|
||||
void renderScale();
|
||||
void renderOrigin();
|
||||
void writeImage(const std::string &output);
|
||||
int getImageX(int val) const;
|
||||
int getImageY(int val) const;
|
||||
@ -111,7 +111,6 @@ private:
|
||||
bool m_drawOrigin;
|
||||
bool m_drawPlayers;
|
||||
bool m_drawScale;
|
||||
bool m_drawUnderground;
|
||||
int m_border;
|
||||
|
||||
sqlite3 *m_db;
|
||||
|
Loading…
Reference in New Issue
Block a user