Warning fixes for Win32 build.

This commit is contained in:
Robert Osfield
2005-10-24 11:25:20 +00:00
parent 7b1b3b6ace
commit b5085b7799
3 changed files with 43 additions and 41 deletions

View File

@@ -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++;

View File

@@ -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<osg::Object*>(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<osg::Object*>(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<osg::Object*>(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<osg::Object*>(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.");
}
}

View File

@@ -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