|
Revision 13041, 1.8 kB
(checked in by robert, 14 months ago)
|
|
Ran script to remove trailing spaces and tabs
|
-
Property svn:eol-style set to
native
|
| Line | |
|---|
| 1 | |
|---|
| 2 | |
|---|
| 3 | |
|---|
| 4 | |
|---|
| 5 | |
|---|
| 6 | |
|---|
| 7 | |
|---|
| 8 | |
|---|
| 9 | |
|---|
| 10 | |
|---|
| 11 | |
|---|
| 12 | |
|---|
| 13 | |
|---|
| 14 | #include "Exception.h" |
|---|
| 15 | #include "Multisample.h" |
|---|
| 16 | #include "Object.h" |
|---|
| 17 | |
|---|
| 18 | using namespace ive; |
|---|
| 19 | |
|---|
| 20 | void Multisample::write(DataOutputStream* out){ |
|---|
| 21 | |
|---|
| 22 | out->writeInt(IVEMULTISAMPLE); |
|---|
| 23 | |
|---|
| 24 | osg::Object* obj = dynamic_cast<osg::Object*>(this); |
|---|
| 25 | if(obj){ |
|---|
| 26 | ((ive::Object*)(obj))->write(out); |
|---|
| 27 | } |
|---|
| 28 | else |
|---|
| 29 | out_THROW_EXCEPTION("Multisample::write(): Could not cast this osg::Multisample to an osg::Object."); |
|---|
| 30 | |
|---|
| 31 | out->writeFloat(getCoverage()); |
|---|
| 32 | out->writeBool(getInvert()); |
|---|
| 33 | out->writeInt(getHint()); |
|---|
| 34 | } |
|---|
| 35 | |
|---|
| 36 | void Multisample::read(DataInputStream* in){ |
|---|
| 37 | |
|---|
| 38 | int id = in->peekInt(); |
|---|
| 39 | if(id == IVEMULTISAMPLE){ |
|---|
| 40 | |
|---|
| 41 | id = in->readInt(); |
|---|
| 42 | |
|---|
| 43 | osg::Object* obj = dynamic_cast<osg::Object*>(this); |
|---|
| 44 | if(obj){ |
|---|
| 45 | ((ive::Object*)(obj))->read(in); |
|---|
| 46 | } |
|---|
| 47 | else |
|---|
| 48 | in_THROW_EXCEPTION("Multisample::read(): Could not cast this osg::Multisample to an osg::Object."); |
|---|
| 49 | |
|---|
| 50 | setCoverage(in->readFloat()); |
|---|
| 51 | setInvert(in->readBool()); |
|---|
| 52 | setHint((Mode) in->readInt()); |
|---|
| 53 | } |
|---|
| 54 | else{ |
|---|
| 55 | in_THROW_EXCEPTION("Multisample::read(): Expected Multisample identification."); |
|---|
| 56 | } |
|---|
| 57 | } |
|---|