Skip to content
Snippets Groups Projects
Commit e44727f6 authored by Amorilia's avatar Amorilia
Browse files

Fix for having ByteColor4 inside a Key.

parent 8d527db4
No related branches found
No related tags found
No related merge requests found
......@@ -214,6 +214,12 @@ ostream & operator<<( ostream & out, Char8String const & val );
void NifStream( InertiaMatrix & val, istream& in, const NifInfo & info);
void NifStream( InertiaMatrix const & val, ostream& out, const NifInfo & info);
//ByteColor4
class ByteColor4;
void NifStream( ByteColor4 & val, istream& in, const NifInfo & info);
void NifStream( ByteColor4 const & val, ostream& out, const NifInfo & info);
ostream & operator<<( ostream & out, ByteColor4 const & val );
//--Templates--//
void NifStream( Key<Quaternion> & key, istream& file, const NifInfo & info, KeyType type );
......
......@@ -12,6 +12,8 @@ All rights reserved. Please see niflib.h for license. */
//--BEGIN FILE HEAD CUSTOM CODE--//
#include "../gen/ByteColor4.h"
//--END CUSTOM CODE--//
#include "NiPSSimulatorStep.h"
......
......@@ -4,6 +4,7 @@ All rights reserved. Please see niflib.h for license. */
#include "../include/NIF_IO.h"
#include "../include/niflib.h"
#include "../include/gen/Header.h"
#include "../include/gen/ByteColor4.h"
namespace Niflib {
//--Endian Support Functions--//
......@@ -890,6 +891,26 @@ void NifStream( InertiaMatrix const & val, ostream& out, const NifInfo & info )
}
}
//ByteColor4
void NifStream( ByteColor4 & val, istream& in, const NifInfo & info ) {
val.r = ReadByte(in);
val.g = ReadByte(in);
val.b = ReadByte(in);
val.a = ReadByte(in);
}
void NifStream( ByteColor4 const & val, ostream& out, const NifInfo & info ) {
WriteByte( val.r, out);
WriteByte( val.g, out);
WriteByte( val.b, out);
WriteByte( val.a, out);
}
ostream & operator<<( ostream & out, ByteColor4 const & val ) {
out << "RGBA: " << val.r << " " << val.g << " " << val.b << " " << val.a;
return out;
}
ostream & operator<<( ostream & out, hdrInfo const & val ) {
out.pword(hdrInfo::infoIdx) = (void*)val.info;
return (out);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment