Better fix for #94
parent
d11a2f37f9
commit
f30592bf56
|
@ -2440,13 +2440,17 @@ bool CEngine::ChangeTextureColor(const std::string& texName,
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool changeColorsNeeded = true;
|
||||||
|
|
||||||
if (colorRef1.r == colorNew1.r &&
|
if (colorRef1.r == colorNew1.r &&
|
||||||
colorRef1.g == colorNew1.g &&
|
colorRef1.g == colorNew1.g &&
|
||||||
colorRef1.b == colorNew1.b &&
|
colorRef1.b == colorNew1.b &&
|
||||||
colorRef2.r == colorNew2.r &&
|
colorRef2.r == colorNew2.r &&
|
||||||
colorRef2.g == colorNew2.g &&
|
colorRef2.g == colorNew2.g &&
|
||||||
colorRef2.b == colorNew2.b)
|
colorRef2.b == colorNew2.b)
|
||||||
return true;
|
{
|
||||||
|
changeColorsNeeded = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
int dx = img.GetSize().x;
|
int dx = img.GetSize().x;
|
||||||
|
@ -2464,6 +2468,8 @@ bool CEngine::ChangeTextureColor(const std::string& texName,
|
||||||
ColorHSV cr2 = RGB2HSV(colorRef2);
|
ColorHSV cr2 = RGB2HSV(colorRef2);
|
||||||
ColorHSV cn2 = RGB2HSV(colorNew2);
|
ColorHSV cn2 = RGB2HSV(colorNew2);
|
||||||
|
|
||||||
|
if (changeColorsNeeded)
|
||||||
|
{
|
||||||
for (int y = sy; y < ey; y++)
|
for (int y = sy; y < ey; y++)
|
||||||
{
|
{
|
||||||
for (int x = sx; x < ex; x++)
|
for (int x = sx; x < ex; x++)
|
||||||
|
@ -2528,6 +2534,7 @@ bool CEngine::ChangeTextureColor(const std::string& texName,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Texture tex = m_device->CreateTexture(&img, m_defaultTexParams);
|
Texture tex = m_device->CreateTexture(&img, m_defaultTexParams);
|
||||||
|
|
|
@ -3661,8 +3661,6 @@ void CRobotMain::ScenePerso()
|
||||||
|
|
||||||
CObjectManager::GetInstancePointer()->Flush();
|
CObjectManager::GetInstancePointer()->Flush();
|
||||||
|
|
||||||
ChangeColor();
|
|
||||||
|
|
||||||
m_dialog->SetSceneName("perso");
|
m_dialog->SetSceneName("perso");
|
||||||
m_dialog->SetSceneRank(0);
|
m_dialog->SetSceneRank(0);
|
||||||
try {
|
try {
|
||||||
|
@ -4743,7 +4741,7 @@ void CRobotMain::CreateScene(bool soluce, bool fixScene, bool resetObject)
|
||||||
g_build |= BUILD_FLAG;
|
g_build |= BUILD_FLAG;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!resetObject && !fixScene)
|
if (!resetObject)
|
||||||
{
|
{
|
||||||
ChangeColor(); // changes the colors of texture
|
ChangeColor(); // changes the colors of texture
|
||||||
m_short->SetMode(false); // vehicles?
|
m_short->SetMode(false); // vehicles?
|
||||||
|
|
Loading…
Reference in New Issue