mirror of
https://github.com/edubart/otclient.git
synced 2025-10-18 21:43:26 +02:00
Widgets can now rotate :O
This commit is contained in:
@@ -226,6 +226,19 @@ void Painter::rotate(float x, float y, float angle)
|
||||
translate(x, y);
|
||||
}
|
||||
|
||||
void Painter::pushTransformMatrix()
|
||||
{
|
||||
m_transformMatrixStack.push_back(m_transformMatrix);
|
||||
assert(m_transformMatrixStack.size() < 100);
|
||||
}
|
||||
|
||||
void Painter::popTransformMatrix()
|
||||
{
|
||||
assert(m_transformMatrixStack.size() > 0);
|
||||
setTransformMatrix(m_transformMatrixStack.back());
|
||||
m_transformMatrixStack.pop_back();
|
||||
}
|
||||
|
||||
void Painter::updateGlTexture()
|
||||
{
|
||||
if(m_glTextureId != 0)
|
||||
|
@@ -106,6 +106,9 @@ public:
|
||||
void rotate(float x, float y, float angle);
|
||||
void rotate(const Point& p, float angle) { rotate(p.x, p.y, angle); }
|
||||
|
||||
void pushTransformMatrix();
|
||||
void popTransformMatrix();
|
||||
|
||||
Matrix3 getTransformMatrix() { return m_transformMatrix; }
|
||||
Matrix3 getProjectionMatrix() { return m_projectionMatrix; }
|
||||
Matrix3 getTextureMatrix() { return m_textureMatrix; }
|
||||
@@ -137,6 +140,7 @@ protected:
|
||||
|
||||
CoordsBuffer m_coordsBuffer;
|
||||
|
||||
std::vector<Matrix3> m_transformMatrixStack;
|
||||
Matrix3 m_transformMatrix;
|
||||
Matrix3 m_projectionMatrix;
|
||||
Matrix3 m_textureMatrix;
|
||||
|
@@ -89,8 +89,10 @@ TexturePtr TextureManager::getTexture(const std::string& fileName)
|
||||
texture = g_textures.getEmptyTexture();
|
||||
}
|
||||
|
||||
if(texture)
|
||||
if(texture) {
|
||||
texture->setSmooth(true);
|
||||
m_textures[filePath] = texture;
|
||||
}
|
||||
}
|
||||
|
||||
return texture;
|
||||
|
Reference in New Issue
Block a user