Don't right-shift signed integers which is implementation-defined

This commit is contained in:
scrawl 2015-01-08 02:34:37 +01:00
parent 4b88ef5891
commit ef7e0070a6
3 changed files with 3 additions and 3 deletions

View file

@ -340,7 +340,7 @@ namespace MWGui
{
if (attr.find("color") != attr.end())
{
int color;
unsigned int color;
std::stringstream ss;
ss << attr.at("color");
ss >> std::hex >> color;

View file

@ -336,7 +336,7 @@ void Animation::addExtraLight(Ogre::SceneManager *sceneMgr, NifOgre::ObjectScene
{
const MWWorld::Fallback *fallback = MWBase::Environment::get().getWorld()->getFallback();
const int clr = light->mData.mColor;
const unsigned int clr = light->mData.mColor;
Ogre::ColourValue color(((clr >> 0) & 0xFF) / 255.0f,
((clr >> 8) & 0xFF) / 255.0f,
((clr >> 16) & 0xFF) / 255.0f);

View file

@ -37,7 +37,7 @@ struct Light
int mValue;
int mTime; // Duration
int mRadius;
int mColor; // 4-byte rgba value
unsigned int mColor; // 4-byte rgba value
int mFlags;
}; // Size = 24 bytes