From 3872bbb992de5f24f1dd3b2030f8491e7ca2772d Mon Sep 17 00:00:00 2001 From: Shon Ferguson <shonferg@users.sourceforge.net> Date: Sun, 28 May 2006 17:58:17 +0000 Subject: [PATCH] Noticed VertMode and LightMode enums had not been implemented, so did so. --- NIF_IO.cpp | 23 +++++++++++++++++++++++ NIF_IO.h | 27 +++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) diff --git a/NIF_IO.cpp b/NIF_IO.cpp index 0ca7f609..3f706471 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 81d3d22f..9f5c85ce 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> -- GitLab