mirror of
https://github.com/thunderbrewhq/thunderbrew
synced 2025-04-09 23:06:47 +03:00
feat(gx): handle changes to texture wrap settings
This commit is contained in:
parent
2282b8a54a
commit
45c1978a85
@ -930,7 +930,17 @@ void CGxDevice::TexMarkForUpdate(CGxTex* texId, const CiRect& updateRect, int32_
|
||||
}
|
||||
|
||||
void CGxDevice::TexSetWrap(CGxTex* texId, EGxTexWrapMode wrapU, EGxTexWrapMode wrapV) {
|
||||
// TODO
|
||||
if (texId->m_flags.m_wrapU == wrapU && texId->m_flags.m_wrapV == wrapV) {
|
||||
return;
|
||||
}
|
||||
|
||||
texId->m_flags.m_wrapU = wrapU;
|
||||
texId->m_flags.m_wrapV = wrapV;
|
||||
texId->m_needsFlagUpdate = 1;
|
||||
|
||||
for (int32_t rs = GxRs_Texture0; rs <= GxRs_Texture15; rs++) {
|
||||
this->IRsForceUpdate(static_cast<EGxRenderState>(rs));
|
||||
}
|
||||
}
|
||||
|
||||
void CGxDevice::ValidateDraw(CGxBatch* batch, int32_t count) {
|
||||
|
@ -283,8 +283,8 @@ enum EGxTexTarget {
|
||||
};
|
||||
|
||||
enum EGxTexWrapMode {
|
||||
GxTex_WrapMode0 = 0,
|
||||
GxTex_WrapMode1 = 1
|
||||
GxTex_Clamp = 0,
|
||||
GxTex_Wrap = 1
|
||||
};
|
||||
|
||||
enum EGxXform {
|
||||
|
@ -516,8 +516,9 @@ void CM2SceneRender::SetupTextures() {
|
||||
if (texture) {
|
||||
uint16_t textureFlags = this->m_data->textures[textureIndex].flags;
|
||||
|
||||
EGxTexWrapMode wrapU = static_cast<EGxTexWrapMode>(textureFlags & 0x1);
|
||||
EGxTexWrapMode wrapV = static_cast<EGxTexWrapMode>(textureFlags & 0x2);
|
||||
EGxTexWrapMode wrapU = textureFlags & 0x1 ? GxTex_Wrap : GxTex_Clamp;
|
||||
EGxTexWrapMode wrapV = textureFlags & 0x2 ? GxTex_Wrap : GxTex_Clamp;
|
||||
|
||||
GxTexSetWrap(texture, wrapU, wrapV);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user