diff --git a/NIF_IO.cpp b/NIF_IO.cpp index 0ca7f60974181b0df2486c8df402b1cea19fc39d..3f706471a87b163876c27aa5af10575edcace314 100644 --- a/NIF_IO.cpp +++ b/NIF_IO.cpp @@ -538,6 +538,29 @@ ostream & operator<<( ostream & out, PixelLayout const & val ) { }; } +//VertMode +void NifStream( VertMode & val, istream& in, uint version ) { val = VertMode(ReadUInt( in )); }; +void NifStream( VertMode const & val, ostream& out, uint version ) { WriteUInt( val, out ); } +ostream & operator<<( ostream & out, VertMode const & val ) { + switch ( val ) { + case VERT_MODE_SRC_IGNORE: return out << "VERT_MODE_SRC_IGNORE"; + case VERT_MODE_SRC_EMISSIVE: return out << "VERT_MODE_SRC_EMISSIVE"; + case VERT_MODE_SRC_AMB_DIF: return out << "VERT_MODE_SRC_AMB_DIF"; + default: return out << "Invalid Value! - " << uint(val); + }; +} + +//LightMode +void NifStream( LightMode & val, istream& in, uint version ) { val = LightMode(ReadUInt( in )); }; +void NifStream( LightMode const & val, ostream& out, uint version ) { WriteUInt( val, out ); } +ostream & operator<<( ostream & out, LightMode const & val ) { + switch ( val ) { + case LIGHT_MODE_EMISSIVE: return out << "LIGHT_MODE_EMISSIVE"; + case LIGHT_MODE_EMI_AMB_DIF: return out << "LIGHT_MODE_EMI_AMB_DIF"; + default: return out << "Invalid Value! - " << uint(val); + }; +} + //The HexString function creates a formatted hex display of the given data for use in printing //a debug string for information that is not understood string HexString( const byte * src, uint len ) { diff --git a/NIF_IO.h b/NIF_IO.h index 81d3d22f21d8b6bd0424576493f5a5b5fb91a2f4..9f5c85ce927f694ab40156340c2043e9581f0a08 100644 --- a/NIF_IO.h +++ b/NIF_IO.h @@ -163,6 +163,23 @@ enum PixelLayout { PIX_LAY_DEFAULT = 5 /*!< Use default setting. */ }; +/*! + * Specifies what type of light is active on the shape. + */ +enum VertMode { + VERT_MODE_SRC_IGNORE = 0, /*!< Source Ignore. */ + VERT_MODE_SRC_EMISSIVE = 1, /*!< Source Emissive. */ + VERT_MODE_SRC_AMB_DIF = 2, /*!< Source Ambient/Diffuse. */ +}; + +/*! + * Specifies the light mode. + */ +enum LightMode { + LIGHT_MODE_EMISSIVE = 0, /*!< Emissive. */ + LIGHT_MODE_EMI_AMB_DIF = 1, /*!< Emissive + Ambient + Diffuse. */ +}; + //--IO Functions--// int BlockSearch( istream& in ); @@ -327,6 +344,16 @@ void NifStream( PixelLayout & val, istream& in, uint version = 0 ); void NifStream( PixelLayout const & val, ostream& out, uint version = 0 ); ostream & operator<<( ostream & out, PixelLayout const & val ); +//VertMode +void NifStream( VertMode & val, istream& in, uint version = 0 ); +void NifStream( VertMode const & val, ostream& out, uint version = 0 ); +ostream & operator<<( ostream & out, VertMode const & val ); + +//LightMode +void NifStream( LightMode & val, istream& in, uint version = 0 ); +void NifStream( LightMode const & val, ostream& out, uint version = 0 ); +ostream & operator<<( ostream & out, LightMode const & val ); + //--Templates--// //Key<T>