From Kristofer Tingdahl, warning fixes.

git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@15030 16af8721-9629-0410-8352-f15c8da7e697
This commit is contained in:
Robert Osfield 2015-07-31 10:54:13 +00:00
parent d6828651d0
commit 1fe7aa056b
4 changed files with 13 additions and 13 deletions

View File

@ -1950,13 +1950,13 @@ void _writeColor(GLenum pixelFormat, T* data, float scale, const Vec4& c)
switch(pixelFormat)
{
case(GL_DEPTH_COMPONENT): //intentionally fall through and execute the code for GL_LUMINANCE
case(GL_LUMINANCE): { (*data++) = c[0] * scale; } break;
case(GL_ALPHA): { (*data++) = c[3] * scale; } break;
case(GL_LUMINANCE_ALPHA): { (*data++) = c[0] * scale; (*data++) = c[3] * scale; } break;
case(GL_RGB): { (*data++) = c[0] *scale; (*data++) = c[1] *scale; (*data++) = c[2] *scale;} break;
case(GL_RGBA): { (*data++) = c[0] *scale; (*data++) = c[1] *scale; (*data++) = c[2] *scale; (*data++) = c[3] *scale;} break;
case(GL_BGR): { (*data++) = c[2] *scale; (*data++) = c[1] *scale; (*data++) = c[0] *scale;} break;
case(GL_BGRA): { (*data++) = c[2] *scale; (*data++) = c[1] *scale; (*data++) = c[0] *scale; (*data++) = c[3] *scale;} break;
case(GL_LUMINANCE): { (*data++) = (T)(c[0] * scale); } break;
case(GL_ALPHA): { (*data++) = (T)(c[3] * scale); } break;
case(GL_LUMINANCE_ALPHA): { (*data++) = (T)(c[0] * scale); (*data++) = (T)(c[3] * scale); } break;
case(GL_RGB): { (*data++) = (T)(c[0] *scale); (*data++) = (T)(c[1] *scale); (*data++) = (T)(c[2] *scale);} break;
case(GL_RGBA): { (*data++) = (T)(c[0] *scale); (*data++) = (T)(c[1] *scale); (*data++) = (T)(c[2] *scale); (*data++) = (T)(c[3] *scale);} break;
case(GL_BGR): { (*data++) = (T)(c[2] *scale); (*data++) = (T)(c[1] *scale); (*data++) = (T)(c[0] *scale);} break;
case(GL_BGRA): { (*data++) = (T)(c[2] *scale); (*data++) = (T)(c[1] *scale); (*data++) = (T)(c[0] *scale); (*data++) = (T)(c[3] *scale);} break;
}
}

View File

@ -1340,7 +1340,7 @@ ReaderWriter3DS::StateSetInfo ReaderWriter3DS::ReaderObject::createStateSet(Lib3
// rebuild the texture with alpha channel (rescale according to map amount)
for (int i=0, j=0; i<n; i+=4, j+=nc)
{
img_data[i] = img_data[i+1] = img_data[i+2] = img_data[i+3] = one_minus_factor + orig_img_data[j]*factor;
img_data[i] = img_data[i+1] = img_data[i+2] = img_data[i+3] = (unsigned char)(one_minus_factor + orig_img_data[j]*factor);
}
osg_image->setImage(osg_image->s(),osg_image->t(),osg_image->r(), GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, img_data, osg::Image::USE_NEW_DELETE);
opacity_map->setImage(osg_image.get());

View File

@ -140,7 +140,7 @@ static int getContainerProperty(lua_State * _lua)
osgDB::VectorBaseSerializer* vs = dynamic_cast<osgDB::VectorBaseSerializer*>(bs);
if (vs)
{
const void* dataPtr = vs->getElement(*object, index);
const void* dataPtr = vs->getElement(*object, (unsigned int) index);
if (dataPtr)
{
SerializerScratchPad valuesp(vs->getElementType(), dataPtr, vs->getElementSize());
@ -191,7 +191,7 @@ static int setContainerProperty(lua_State* _lua)
SerializerScratchPad ssp;
lse->getDataFromStack(&ssp, vs->getElementType(), 3);
{
vs->setElement(*object, index, ssp.data);
vs->setElement(*object, (unsigned int) index, ssp.data);
}
}
return 0;
@ -3808,7 +3808,7 @@ void LuaScriptEngine::pushValue(const osg::Matrixf& value) const
{
for(unsigned int c=0; c<4; ++c)
{
lua_pushnumber(_lua, r*4+c); lua_pushinteger(_lua, value(r,c)); lua_settable(_lua, -3);
lua_pushnumber(_lua, r*4+c); lua_pushinteger(_lua, (lua_Integer) value(r,c)); lua_settable(_lua, -3);
}
}
}

View File

@ -721,8 +721,8 @@ bool InteractiveImageHandler::mousePosition(osgViewer::View* view, osg::NodeVisi
if (!view) return false;
if (_fullscreen)
{
x = ea.getX();
y = ea.getY();
x = (int) ea.getX();
y = (int) ea.getY();
return true;
}