Merge branch 'storyline/s2e1' into yubo

fix_opengl_on_mac
Ulukyn 5 years ago
commit 521a5c8fb7

@ -3269,14 +3269,15 @@ CRGBAF CBitmap::getColor (float x, float y) const
uint32 i; uint32 i;
bool isValid = true;
for (i = 0; i < 4; ++i) for (i = 0; i < 4; ++i)
{ {
nlassert (nX[i] >= 0); if (nX[i] < 0 || nY[i] < 0 || nX[i] >= nWidth || nY[i] >= nHeight)
nlassert (nY[i] >= 0 ); isValid = false;
nlassert (nX[i] < nWidth);
nlassert (nY[i] < nHeight);
} }
if (isValid)
{
// Decimal part of (x,y) // Decimal part of (x,y)
x = x - (float)nX[0]; x = x - (float)nX[0];
y = y - (float)nY[0]; y = y - (float)nY[0];
@ -3341,6 +3342,7 @@ CRGBAF CBitmap::getColor (float x, float y) const
break; break;
default: break; default: break;
} }
}
return CRGBAF (0.0f, 0.0f, 0.0f, 0.0f); return CRGBAF (0.0f, 0.0f, 0.0f, 0.0f);
} }

@ -2298,13 +2298,28 @@ int CLuaIHMRyzom::addShape(CLuaState &ls)
if(!instance.empty()) if(!instance.empty())
{ {
if (texture == "#season#" || texture.empty())
{
uint8 selectedTextureSet = (uint8)::computeCurrSeason();
instance.selectTextureSet(selectedTextureSet);
texture = "";
}
else if (texture[0] == '#')
{
uint8 selectedTextureSet;
fromString(texture.substr(1), selectedTextureSet);
instance.selectTextureSet(selectedTextureSet);
texture = "";
}
for(uint j=0;j<instance.getNumMaterials();j++) for(uint j=0;j<instance.getNumMaterials();j++)
{ {
if (!highlight) if (!highlight)
{ {
instance.getMaterial(j).setAmbient(CRGBA(0,0,0,255)); /*instance.getMaterial(j).setAmbient(CRGBA(0,0,0,255));
instance.getMaterial(j).setEmissive(CRGBA(255,255,255,255)); instance.getMaterial(j).setEmissive(CRGBA(255,255,255,255));
instance.getMaterial(j).setShininess(10.0f); instance.getMaterial(j).setShininess(10.0f);*/
} }
else else
{ {

Loading…
Cancel
Save