diff --git a/src/osgPlugins/hdr/hdrloader.cpp b/src/osgPlugins/hdr/hdrloader.cpp index aa80602e3..5e1f0ac45 100644 --- a/src/osgPlugins/hdr/hdrloader.cpp +++ b/src/osgPlugins/hdr/hdrloader.cpp @@ -145,10 +145,10 @@ void rawRGBEData(RGBE *_scan, int _len, float *_cols) { int ii = 0; while (_len-- > 0) { - _cols[0] = _scan[0][R] / 255.0; - _cols[1] = _scan[0][G] / 255.0; - _cols[2] = _scan[0][B] / 255.0; - _cols[3] = _scan[0][E] / 255.0; + _cols[0] = _scan[0][R] / 255.0f; + _cols[1] = _scan[0][G] / 255.0f; + _cols[2] = _scan[0][B] / 255.0f; + _cols[3] = _scan[0][E] / 255.0f; _cols += 4; _scan++; ii++; diff --git a/src/osgPlugins/ive/PolygonMode.cpp b/src/osgPlugins/ive/PolygonMode.cpp index 50513dc73..58f37de79 100644 --- a/src/osgPlugins/ive/PolygonMode.cpp +++ b/src/osgPlugins/ive/PolygonMode.cpp @@ -1,15 +1,15 @@ /********************************************************************** * - * FILE: PolygonMode.cpp + * FILE: PolygonMode.cpp * - * DESCRIPTION: Read/Write osg::PolygonMode in binary format to disk. + * DESCRIPTION: Read/Write osg::PolygonMode in binary format to disk. * - * CREATED BY: Auto generated by iveGenerator - * and later modified by Rune Schmidt Jensen. + * CREATED BY: Auto generated by iveGenerator + * and later modified by Rune Schmidt Jensen. * - * HISTORY: Created 6.10.2005 + * HISTORY: Created 6.10.2005 * - * Copyright 2003 VR-C + * Copyright 2003 VR-C **********************************************************************/ #include "Exception.h" @@ -19,39 +19,40 @@ using namespace ive; void PolygonMode::write(DataOutputStream* out){ - // Write PolygonMode's identification. - out->writeInt(IVEPOLYGONMODE); - // If the osg class is inherited by any other class we should also write this to file. - osg::Object* obj = dynamic_cast(this); - if(obj){ - ((ive::Object*)(obj))->write(out); - } - else - throw Exception("PolygonMode::write(): Could not cast this osg::PolygonMode to an osg::Object."); - // Write PolygonMode's properties. + // Write PolygonMode's identification. + out->writeInt(IVEPOLYGONMODE); + // If the osg class is inherited by any other class we should also write this to file. + osg::Object* obj = dynamic_cast(this); + if(obj){ + ((ive::Object*)(obj))->write(out); + } + else + throw Exception("PolygonMode::write(): Could not cast this osg::PolygonMode to an osg::Object."); + // Write PolygonMode's properties. out->writeInt(getMode(osg::PolygonMode::FRONT)); out->writeInt(getMode(osg::PolygonMode::BACK)); } void PolygonMode::read(DataInputStream* in){ - // Peek on PolygonMode's identification. - int id = in->peekInt(); - if(id == IVEPOLYGONMODE){ - // Read PolygonMode's identification. - id = in->readInt(); - // If the osg class is inherited by any other class we should also read this from file. - osg::Object* obj = dynamic_cast(this); - if(obj){ - ((ive::Object*)(obj))->read(in); - } - else - throw Exception("PolygonMode::read(): Could not cast this osg::PolygonMode to an osg::Object."); - // Read PolygonMode's properties - setMode(osg::PolygonMode::FRONT,(Mode)in->readInt()); - setMode(osg::PolygonMode::BACK,(Mode)in->readInt()); - } - else{ - throw Exception("PolygonMode::read(): Expected PolygonMode identification."); - } + // Peek on PolygonMode's identification. + int id = in->peekInt(); + if(id == IVEPOLYGONMODE){ + // Read PolygonMode's identification. + id = in->readInt(); + // If the osg class is inherited by any other class we should also read this from file. + osg::Object* obj = dynamic_cast(this); + if(obj){ + ((ive::Object*)(obj))->read(in); + } + else + throw Exception("PolygonMode::read(): Could not cast this osg::PolygonMode to an osg::Object."); + // Read PolygonMode's properties + setMode(osg::PolygonMode::FRONT,(Mode)in->readInt()); + setMode(osg::PolygonMode::BACK,(Mode)in->readInt()); + } + else{ + throw Exception("PolygonMode::read(): Expected PolygonMode identification."); + } } + diff --git a/src/osgPlugins/ive/PolygonMode.h b/src/osgPlugins/ive/PolygonMode.h index 67e73af55..b5f3c441d 100644 --- a/src/osgPlugins/ive/PolygonMode.h +++ b/src/osgPlugins/ive/PolygonMode.h @@ -7,10 +7,11 @@ namespace ive{ class PolygonMode : public osg::PolygonMode, public ReadWrite { public: - void write(DataOutputStream* out); - void read(DataInputStream* in); + void write(DataOutputStream* out); + void read(DataInputStream* in); }; } #endif +