修改游戏底层矩阵相关
This commit is contained in:
@@ -43,6 +43,35 @@ RefPtr<Texture> Sprite::GetTexture()
|
||||
return m_texture;
|
||||
}
|
||||
|
||||
GlMatrix Sprite::matrix3x2ToGLMatrix(const Matrix3x2 &mat)
|
||||
{
|
||||
return {
|
||||
// 列0:x轴线性变换
|
||||
mat._11, // [0][0]
|
||||
mat._12, // [1][0]
|
||||
0.0f, // [2][0]
|
||||
0.0f, // [3][0]
|
||||
|
||||
// 列1:y轴线性变换
|
||||
mat._21, // [0][1]
|
||||
mat._22, // [1][1]
|
||||
0.0f, // [2][1]
|
||||
0.0f, // [3][1]
|
||||
|
||||
// 列2:z轴(固定)
|
||||
0.0f, // [0][2]
|
||||
0.0f, // [1][2]
|
||||
1.0f, // [2][2]
|
||||
0.0f, // [3][2]
|
||||
|
||||
// 列3:平移
|
||||
mat._31, // [0][3](x平移)
|
||||
mat._32, // [1][3](y平移)
|
||||
0.0f, // [2][3]
|
||||
1.0f // [3][3]
|
||||
};
|
||||
}
|
||||
|
||||
void Sprite::CalcRenderInfoLogic()
|
||||
{
|
||||
// 获取至在最终的父对象检查是否显示
|
||||
@@ -151,7 +180,9 @@ void Sprite::Render()
|
||||
|
||||
if (_RenderGuidanceInfo.IsInScreen && _RenderGuidanceInfo.Visible)
|
||||
{
|
||||
SDL_FPoint AnchorPos = _RenderGuidanceInfo.AnchorPos;
|
||||
SDL_FPoint AnchorPos;
|
||||
AnchorPos.x = _RenderGuidanceInfo.AnchorPos.x;
|
||||
AnchorPos.y = _RenderGuidanceInfo.AnchorPos.y;
|
||||
|
||||
// 混合
|
||||
if (this->_BlendMode != NONE)
|
||||
@@ -163,8 +194,6 @@ void Sprite::Render()
|
||||
// 还原混合
|
||||
if (this->_BlendMode != NONE)
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
|
||||
Game::GetInstance().m_RenderCount++;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -172,10 +201,7 @@ void Sprite::Clear()
|
||||
{
|
||||
}
|
||||
|
||||
void Sprite::SetBlendMode(LE_BlEND_MODE mode)
|
||||
{
|
||||
this->_BlendMode = mode;
|
||||
}
|
||||
|
||||
|
||||
void Sprite::Blend()
|
||||
{
|
||||
@@ -186,8 +212,3 @@ void Sprite::Blend()
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
LE_BlEND_MODE Sprite::GetBlendMode()
|
||||
{
|
||||
return this->_BlendMode;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user