Added draworigin.

This commit is contained in:
Miroslav Bendík 2012-08-25 15:21:51 +02:00
parent b0f36ba4cf
commit 3349bee3a4
2 changed files with 11 additions and 7 deletions

View File

@ -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;

View File

@ -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;