Fix UIReggedMaterial::ReregisterMaterial and UIReggedMaterial::GetMaterial

ReregisterMaterial() must register the material if it was registered before, and GetMaterial() must register the material if it hasn't been registered and return it
This commit is contained in:
smallmodel 2024-07-24 21:10:46 +02:00
parent c093122764
commit 016e062fef
No known key found for this signature in database
GPG key ID: 9F2D623CEDF08512
12 changed files with 8 additions and 74 deletions

View file

@ -172,7 +172,6 @@ void UIBindButton::DrawUnpressed(void)
if (str::cmp(s, m_last_keyname)) {
m_mat = uWinMan.RegisterShader("textures/bind/" + s);
if (m_mat) {
m_mat->ReregisterMaterial();
if (m_mat->GetMaterial()) {
m_material = m_mat;
} else {
@ -186,8 +185,6 @@ void UIBindButton::DrawUnpressed(void)
}
if (m_mat) {
m_mat->ReregisterMaterial();
if (m_mat->GetMaterial()) {
return;
}