diff --git a/Sources/Plasma/Apps/plClient/plClient.cpp b/Sources/Plasma/Apps/plClient/plClient.cpp index cd794d68..2ffacb11 100644 --- a/Sources/Plasma/Apps/plClient/plClient.cpp +++ b/Sources/Plasma/Apps/plClient/plClient.cpp @@ -2124,7 +2124,7 @@ hsG3DDeviceModeRecord plClient::ILoadDevMode(const char* devModeFile) /// Read the rest in selMode.Read(&stream); - UInt16 performance = stream.ReadSwap16(); + UInt16 performance = stream.ReadLE16(); if( performance < 25 ) plBitmap::SetGlobalLevelChopCount( 2 ); @@ -2158,7 +2158,7 @@ hsG3DDeviceModeRecord plClient::ILoadDevMode(const char* devModeFile) { dmr.GetDevice()->Write(&stream); dmr.GetMode()->Write(&stream); - stream.WriteSwap16((UInt16)(0*100)); + stream.WriteLE16((UInt16)(0*100)); stream.Close(); } diff --git a/Sources/Plasma/Apps/plPythonPack/main.cpp b/Sources/Plasma/Apps/plPythonPack/main.cpp index f9cf81b2..82a25b1b 100644 --- a/Sources/Plasma/Apps/plPythonPack/main.cpp +++ b/Sources/Plasma/Apps/plPythonPack/main.cpp @@ -187,13 +187,13 @@ void WritePythonFile(std::string fileName, std::string path, hsStream *s) printf(errmsg); printf("\n"); } - s->WriteSwap32(size); + s->WriteLE32(size); s->Write(size, pycode); } else { printf("......blast! Compile error!\n"); - s->WriteSwap32(0); + s->WriteLE32(0); PyErr_Print(); PyErr_Clear(); @@ -378,13 +378,13 @@ void PackDirectory(std::string dir, std::string rootPath, std::string pakName, s if (!s.Open(pakName.c_str(), "wb")) return; - s.WriteSwap32(fileNames.size()); + s.WriteLE32(fileNames.size()); int i; for (i = 0; i < fileNames.size(); i++) { s.WriteSafeString(fileNames[i].c_str()); - s.WriteSwap32(0); + s.WriteLE32(0); } PythonInterface::initPython(rootPath); @@ -412,7 +412,7 @@ void PackDirectory(std::string dir, std::string rootPath, std::string pakName, s for (i = 0; i < fileNames.size(); i++) { s.WriteSafeString(fileNames[i].c_str()); - s.WriteSwap32(filePositions[i]); + s.WriteLE32(filePositions[i]); } s.Close(); diff --git a/Sources/Plasma/CoreLib/hsBitVector.cpp b/Sources/Plasma/CoreLib/hsBitVector.cpp index 4f185a99..1e75570a 100644 --- a/Sources/Plasma/CoreLib/hsBitVector.cpp +++ b/Sources/Plasma/CoreLib/hsBitVector.cpp @@ -115,24 +115,24 @@ void hsBitVector::Read(hsStream* s) { Reset(); - s->LogReadSwap(&fNumBitVectors,"NumBitVectors"); + s->LogReadLE(&fNumBitVectors,"NumBitVectors"); if( fNumBitVectors ) { delete [] fBitVectors; fBitVectors = TRACKED_NEW UInt32[fNumBitVectors]; int i; for( i = 0; i < fNumBitVectors; i++ ) - s->LogReadSwap(&fBitVectors[i],"BitVector"); + s->LogReadLE(&fBitVectors[i],"BitVector"); } } void hsBitVector::Write(hsStream* s) const { - s->WriteSwap32(fNumBitVectors); + s->WriteLE32(fNumBitVectors); int i; for( i = 0; i < fNumBitVectors; i++ ) - s->WriteSwap32(fBitVectors[i]); + s->WriteLE32(fBitVectors[i]); } hsTArray& hsBitVector::Enumerate(hsTArray& dst) const diff --git a/Sources/Plasma/CoreLib/hsBounds.cpp b/Sources/Plasma/CoreLib/hsBounds.cpp index 829e5ae6..c95e6978 100644 --- a/Sources/Plasma/CoreLib/hsBounds.cpp +++ b/Sources/Plasma/CoreLib/hsBounds.cpp @@ -60,12 +60,12 @@ const hsScalar hsBounds::kRealSmall = 1.0e-5f; void hsBounds::Read(hsStream *s) { - fType =(hsBoundsType) s->ReadSwap32(); + fType =(hsBoundsType) s->ReadLE32(); } void hsBounds::Write(hsStream *s) { - s->WriteSwap32((Int32)fType); + s->WriteLE32((Int32)fType); } /////////////////////////////////////////////////////////////////////////////////////// @@ -620,8 +620,8 @@ void hsBoundsOriented::Write(hsStream *stream) { hsBounds::Write(stream); fCenter.Write(stream); - stream->WriteSwap32(fCenterValid); - stream->WriteSwap32(fNumPlanes); + stream->WriteLE32(fCenterValid); + stream->WriteLE32(fNumPlanes); int i; for( i = 0; i < fNumPlanes; i++ ) { @@ -633,8 +633,8 @@ void hsBoundsOriented::Read(hsStream *stream) { hsBounds::Read(stream); fCenter.Read(stream); - fCenterValid = (hsBool)stream->ReadSwap32(); - fNumPlanes = stream->ReadSwap32(); + fCenterValid = (hsBool)stream->ReadLE32(); + fNumPlanes = stream->ReadLE32(); if (fPlanes) delete [] fPlanes; fPlanes = TRACKED_NEW hsPlane3[fNumPlanes]; @@ -2592,7 +2592,7 @@ hsBool hsBounds3Ext::ISectRayBS(const hsPoint3& from, const hsPoint3& to, hsPoin void hsBounds3Ext::Read(hsStream *s) { - fExtFlags = s->ReadSwap32(); + fExtFlags = s->ReadLE32(); hsBounds3::Read(s); if( !(fExtFlags & kAxisAligned) ) { @@ -2601,8 +2601,8 @@ void hsBounds3Ext::Read(hsStream *s) for( i = 0; i < 3; i++ ) { fAxes[i].Read(s); - fDists[i].fX = s->ReadSwapScalar(); - fDists[i].fY = s->ReadSwapScalar(); + fDists[i].fX = s->ReadLEScalar(); + fDists[i].fY = s->ReadLEScalar(); } IMakeMinsMaxs(); IMakeDists(); @@ -2611,7 +2611,7 @@ void hsBounds3Ext::Read(hsStream *s) } void hsBounds3Ext::Write(hsStream *s) { - s->WriteSwap32(fExtFlags); + s->WriteLE32(fExtFlags); hsBounds3::Write(s); if( !(fExtFlags & kAxisAligned) ) { @@ -2622,14 +2622,14 @@ void hsBounds3Ext::Write(hsStream *s) fAxes[i].Write(s); if( fExtFlags & kDistsSet ) { - s->WriteSwapScalar(fDists[i].fX); - s->WriteSwapScalar(fDists[i].fY); + s->WriteLEScalar(fDists[i].fX); + s->WriteLEScalar(fDists[i].fY); } else { // Playing nice with binary patches--writing uninited values BAD! - s->WriteSwapScalar( 0.f ); - s->WriteSwapScalar( 0.f ); + s->WriteLEScalar( 0.f ); + s->WriteLEScalar( 0.f ); } } } diff --git a/Sources/Plasma/CoreLib/hsColorRGBA.h b/Sources/Plasma/CoreLib/hsColorRGBA.h index 595ba325..8ecca454 100644 --- a/Sources/Plasma/CoreLib/hsColorRGBA.h +++ b/Sources/Plasma/CoreLib/hsColorRGBA.h @@ -78,17 +78,17 @@ struct hsColorRGBA { inline void hsColorRGBA::Read(hsStream *s) { - r = s->ReadSwapScalar(); - g = s->ReadSwapScalar(); - b = s->ReadSwapScalar(); - a = s->ReadSwapScalar(); + r = s->ReadLEScalar(); + g = s->ReadLEScalar(); + b = s->ReadLEScalar(); + a = s->ReadLEScalar(); } inline void hsColorRGBA::Write(hsStream *s) const { - s->WriteSwapScalar(r); - s->WriteSwapScalar(g); - s->WriteSwapScalar(b); - s->WriteSwapScalar(a); + s->WriteLEScalar(r); + s->WriteLEScalar(g); + s->WriteLEScalar(b); + s->WriteLEScalar(a); } inline hsColorRGBA& hsColorRGBA::FromARGB32(UInt32 c) diff --git a/Sources/Plasma/CoreLib/hsGeometry3.cpp b/Sources/Plasma/CoreLib/hsGeometry3.cpp index 8bec72bb..f83c6359 100644 --- a/Sources/Plasma/CoreLib/hsGeometry3.cpp +++ b/Sources/Plasma/CoreLib/hsGeometry3.cpp @@ -93,9 +93,9 @@ void hsScalarTriple::Read(hsStream *stream) void hsScalarTriple::Write(hsStream *stream) const { - stream->WriteSwapScalar(fX); - stream->WriteSwapScalar(fY); - stream->WriteSwapScalar(fZ); + stream->WriteLEScalar(fX); + stream->WriteLEScalar(fY); + stream->WriteLEScalar(fZ); } hsPlane3::hsPlane3(const hsPoint3* pt1, const hsPoint3* pt2, const hsPoint3* pt3) @@ -117,11 +117,11 @@ hsPlane3::hsPlane3(const hsPoint3* pt1, const hsPoint3* pt2, const hsPoint3* pt3 void hsPlane3::Read(hsStream *stream) { fN.Read(stream); - fD=stream->ReadSwapScalar(); + fD=stream->ReadLEScalar(); } void hsPlane3::Write(hsStream *stream) const { fN.Write(stream); - stream->WriteSwapScalar(fD); + stream->WriteLEScalar(fD); } diff --git a/Sources/Plasma/CoreLib/hsMatrix33.cpp b/Sources/Plasma/CoreLib/hsMatrix33.cpp index 5d5e9a51..cb66df1e 100644 --- a/Sources/Plasma/CoreLib/hsMatrix33.cpp +++ b/Sources/Plasma/CoreLib/hsMatrix33.cpp @@ -95,7 +95,7 @@ void hsMatrix33::Read(hsStream* s) { for( j = 0; j < 3; j++ ) { - fMap[i][j] = s->ReadSwapScalar(); + fMap[i][j] = s->ReadLEScalar(); } } } @@ -107,7 +107,7 @@ void hsMatrix33::Write(hsStream* s) { for( j = 0; j < 3; j++ ) { - s->WriteSwapScalar(fMap[i][j]); + s->WriteLEScalar(fMap[i][j]); } } } \ No newline at end of file diff --git a/Sources/Plasma/CoreLib/hsMatrix44.cpp b/Sources/Plasma/CoreLib/hsMatrix44.cpp index 7450f810..3aad0d4f 100644 --- a/Sources/Plasma/CoreLib/hsMatrix44.cpp +++ b/Sources/Plasma/CoreLib/hsMatrix44.cpp @@ -940,10 +940,10 @@ void hsMatrix44::Read(hsStream *stream) for(i=0; i<4; i++) for(j=0; j<4; j++) #if HS_SCALAR_IS_FIXED - fMap[i][j] = stream->ReadSwap32(); + fMap[i][j] = stream->ReadLE32(); #endif #if HS_SCALAR_IS_FLOAT - fMap[i][j] = stream->ReadSwapFloat(); + fMap[i][j] = stream->ReadLEFloat(); #endif IsIdentity(); } @@ -961,10 +961,10 @@ void hsMatrix44::Write(hsStream *stream) for(i=0; i<4; i++) for(j=0; j<4; j++) #if HS_SCALAR_IS_FIXED - stream->WriteSwap32(fMap[i][j]); + stream->WriteLE32(fMap[i][j]); #endif #if HS_SCALAR_IS_FLOAT - stream->WriteSwapFloat(fMap[i][j]); + stream->WriteLEFloat(fMap[i][j]); #endif } } diff --git a/Sources/Plasma/CoreLib/hsQuat.cpp b/Sources/Plasma/CoreLib/hsQuat.cpp index 14ba1334..a1436235 100644 --- a/Sources/Plasma/CoreLib/hsQuat.cpp +++ b/Sources/Plasma/CoreLib/hsQuat.cpp @@ -240,18 +240,18 @@ hsQuat hsQuat::operator*(const hsQuat &in) const // I/O void hsQuat::Read(hsStream *stream) { - fX = stream->ReadSwapFloat(); - fY = stream->ReadSwapFloat(); - fZ = stream->ReadSwapFloat(); - fW = stream->ReadSwapFloat(); + fX = stream->ReadLEFloat(); + fY = stream->ReadLEFloat(); + fZ = stream->ReadLEFloat(); + fW = stream->ReadLEFloat(); } void hsQuat::Write(hsStream *stream) { - stream->WriteSwapFloat(fX); - stream->WriteSwapFloat(fY); - stream->WriteSwapFloat(fZ); - stream->WriteSwapFloat(fW); + stream->WriteLEFloat(fX); + stream->WriteLEFloat(fY); + stream->WriteLEFloat(fZ); + stream->WriteLEFloat(fW); } diff --git a/Sources/Plasma/CoreLib/hsStream.cpp b/Sources/Plasma/CoreLib/hsStream.cpp index 8e0b38d3..0ff993f7 100644 --- a/Sources/Plasma/CoreLib/hsStream.cpp +++ b/Sources/Plasma/CoreLib/hsStream.cpp @@ -151,7 +151,7 @@ UInt32 hsStream::WriteFmtV(const char * fmt, va_list av) UInt32 hsStream::WriteSafeStringLong(const char *string) { UInt32 len = hsStrlen(string); - WriteSwap32(len); + WriteLE32(len); if (len > 0) { char *buff = TRACKED_NEW char[len+1]; @@ -172,16 +172,16 @@ UInt32 hsStream::WriteSafeStringLong(const char *string) UInt32 hsStream::WriteSafeWStringLong(const wchar_t *string) { UInt32 len = wcslen(string); - WriteSwap32(len); + WriteLE32(len); if (len > 0) { int i; for (i=0; i 0 && numChars <= GetSizeLeft()) { name = TRACKED_NEW char[numChars+1]; @@ -211,14 +211,14 @@ char *hsStream::ReadSafeStringLong() wchar_t *hsStream::ReadSafeWStringLong() { wchar_t *retVal = nil; - UInt32 numChars = ReadSwap32(); + UInt32 numChars = ReadLE32(); if (numChars > 0 && numChars <= (GetSizeLeft()/2)) // divide by two because each char is two bytes { retVal = TRACKED_NEW wchar_t[numChars+1]; int i; for (i=0; i 0) { char *buff = TRACKED_NEW char[len+1]; @@ -261,16 +261,16 @@ UInt32 hsStream::WriteSafeWString(const wchar_t *string) hsAssert(len<0xf000, xtl::format("string len of %d is too long for WriteSafeWString, use WriteSafeWStringLong", len).c_str() ); - WriteSwap16(len | 0xf000); + WriteLE16(len | 0xf000); if (len > 0) { int i; for (i=0; iRead(sizeof(UInt16), &value); - value = hsSWAP16(value); + value = hsToLE16(value); return value; } -void hsStream::ReadSwap16(int count, UInt16 values[]) +void hsStream::ReadLE16(int count, UInt16 values[]) { this->Read(count * sizeof(UInt16), values); for (int i = 0; i < count; i++) - values[i] = hsSWAP16(values[i]); + values[i] = hsToLE16(values[i]); } -UInt32 hsStream::ReadSwap32() +UInt32 hsStream::ReadLE32() { UInt32 value; Read4Bytes(&value); - value = hsSWAP32(value); + value = hsToLE32(value); return value; } -void hsStream::ReadSwap32(int count, UInt32 values[]) +void hsStream::ReadLE32(int count, UInt32 values[]) { this->Read(count * sizeof(UInt32), values); for (int i = 0; i < count; i++) - values[i] = hsSWAP32(values[i]); + values[i] = hsToLE32(values[i]); } -UInt32 hsStream::ReadUnswap32() +UInt32 hsStream::ReadBE32() { UInt32 value; Read4Bytes(&value); - value = hsUNSWAP32(value); + value = hsToBE32(value); return value; } #if HS_CAN_USE_FLOAT - double hsStream::ReadSwapDouble() + double hsStream::ReadLEDouble() { double value; Read8Bytes(&value); - value = hsSWAPDouble(value); + value = hsToLEDouble(value); return value; } - void hsStream::ReadSwapDouble(int count, double values[]) + void hsStream::ReadLEDouble(int count, double values[]) { this->Read(count * sizeof(double), values); for (int i = 0; i < count; i++) - values[i] = hsSWAPDouble(values[i]); + values[i] = hsToLEDouble(values[i]); } - float hsStream::ReadSwapFloat() + float hsStream::ReadLEFloat() { float value; Read4Bytes(&value); - value = hsSWAPFloat(value); + value = hsToLEFloat(value); return value; } - void hsStream::ReadSwapFloat(int count, float values[]) + void hsStream::ReadLEFloat(int count, float values[]) { this->Read(count * sizeof(float), values); for (int i = 0; i < count; i++) - values[i] = hsSWAPFloat(values[i]); + values[i] = hsToLEFloat(values[i]); } - float hsStream::ReadUnswapFloat() + float hsStream::ReadBEFloat() { float value; this->Read(sizeof(float), &value); - value = hsUNSWAPFloat(value); + value = hsToBEFloat(value); return value; } #endif @@ -612,78 +612,78 @@ void hsStream::WriteByte(UInt8 value) this->Write(sizeof(UInt8), &value); } -void hsStream::WriteSwap16(UInt16 value) +void hsStream::WriteLE16(UInt16 value) { - value = hsSWAP16(value); + value = hsToLE16(value); this->Write(sizeof(Int16), &value); } -void hsStream::WriteSwap16(int count, const UInt16 values[]) +void hsStream::WriteLE16(int count, const UInt16 values[]) { for (int i = 0; i < count; i++) - this->WriteSwap16(values[i]); + this->WriteLE16(values[i]); } -void hsStream::WriteSwap32(UInt32 value) +void hsStream::WriteLE32(UInt32 value) { - value = hsSWAP32(value); + value = hsToLE32(value); this->Write(sizeof(Int32), &value); } -void hsStream::WriteSwap32(int count, const UInt32 values[]) +void hsStream::WriteLE32(int count, const UInt32 values[]) { for (int i = 0; i < count; i++) - this->WriteSwap32(values[i]); + this->WriteLE32(values[i]); } -void hsStream::WriteUnswap32(UInt32 value) +void hsStream::WriteBE32(UInt32 value) { - value = hsUNSWAP32(value); + value = hsToBE32(value); this->Write(sizeof(Int32), &value); } #if HS_CAN_USE_FLOAT - void hsStream::WriteSwapDouble(double value) + void hsStream::WriteLEDouble(double value) { - value = hsSWAPDouble(value); + value = hsToLEDouble(value); this->Write(sizeof(double), &value); } - void hsStream::WriteSwapDouble(int count, const double values[]) + void hsStream::WriteLEDouble(int count, const double values[]) { for (int i = 0; i < count; i++) - this->WriteSwapDouble(values[i]); + this->WriteLEDouble(values[i]); } - void hsStream::WriteSwapFloat(float value) + void hsStream::WriteLEFloat(float value) { - value = hsSWAPFloat(value); + value = hsToLEFloat(value); this->Write(sizeof(float), &value); } - void hsStream::WriteSwapFloat(int count, const float values[]) + void hsStream::WriteLEFloat(int count, const float values[]) { for (int i = 0; i < count; i++) - this->WriteSwapFloat(values[i]); + this->WriteLEFloat(values[i]); } - void hsStream::WriteUnswapFloat(float value) + void hsStream::WriteBEFloat(float value) { - value = hsUNSWAPFloat(value); + value = hsToBEFloat(value); this->Write(sizeof(float), &value); } #endif -void hsStream::WriteSwapAtom(UInt32 tag, UInt32 size) +void hsStream::WriteLEAtom(UInt32 tag, UInt32 size) { - this->WriteSwap32(tag); - this->WriteSwap32(size); + this->WriteLE32(tag); + this->WriteLE32(size); } -UInt32 hsStream::ReadSwapAtom(UInt32* sizePtr) +UInt32 hsStream::ReadLEAtom(UInt32* sizePtr) { - UInt32 tag = this->ReadSwap32(); - UInt32 size = this->ReadSwap32(); + UInt32 tag = this->ReadLE32(); + UInt32 size = this->ReadLE32(); if (sizePtr) *sizePtr = size; diff --git a/Sources/Plasma/CoreLib/hsStream.h b/Sources/Plasma/CoreLib/hsStream.h index 1582a791..d2bcc23f 100644 --- a/Sources/Plasma/CoreLib/hsStream.h +++ b/Sources/Plasma/CoreLib/hsStream.h @@ -61,8 +61,8 @@ struct FileEntry; #define LogReadSafeString() ReadSafeString(); #define LogReadSafeStringLong() ReadSafeStringLong(); #define LogSkip(deltaByteCount, desc) Skip(deltaByteCount) -#define LogReadSwap(value, desc) ReadSwap(value) -#define LogReadSwapArray(count, values, desc) ReadSwap(count, values) +#define LogReadLE(value, desc) ReadLE(value) +#define LogReadLEArray(count, values, desc) ReadLE(count, values) #define LogSubStreamStart(desc) LogVoidFunc() #define LogSubStreamPushDesc(desc) LogVoidFunc() #define LogSubStreamEnd() LogVoidFunc() @@ -110,10 +110,10 @@ public: virtual void LogSkip(UInt32 deltaByteCount, const char* desc) { Skip(deltaByteCount); } // Stream Notes for Logging - virtual void LogStringString(const char* s) { } - virtual void LogSubStreamStart(const char* desc) { } - virtual void LogSubStreamEnd() { } - virtual void LogSubStreamPushDesc(const char* desc) { } + virtual void LogStringString(const char* s) { } + virtual void LogSubStreamStart(const char* desc) { } + virtual void LogSubStreamEnd() { } + virtual void LogSubStreamPushDesc(const char* desc) { } #endif void LogVoidFunc() { } @@ -132,178 +132,178 @@ public: UInt32 WriteFmt(const char * fmt, ...); UInt32 WriteFmtV(const char * fmt, va_list av); - UInt32 WriteSafeStringLong(const char *string); // uses 4 bytes for length - UInt32 WriteSafeWStringLong(const wchar_t *string); - char * ReadSafeStringLong(); - wchar_t * ReadSafeWStringLong(); + UInt32 WriteSafeStringLong(const char *string); // uses 4 bytes for length + UInt32 WriteSafeWStringLong(const wchar_t *string); + char * ReadSafeStringLong(); + wchar_t * ReadSafeWStringLong(); - UInt32 WriteSafeString(const char *string); // uses 2 bytes for length - UInt32 WriteSafeWString(const wchar_t *string); - char * ReadSafeString(); - wchar_t * ReadSafeWString(); + UInt32 WriteSafeString(const char *string); // uses 2 bytes for length + UInt32 WriteSafeWString(const wchar_t *string); + char * ReadSafeString(); + wchar_t * ReadSafeWString(); - hsBool GetToken(char *s, UInt32 maxLen=UInt32(-1), const char beginComment=kComment, const char endComment=kEolnCode); - hsBool ReadLn(char* s, UInt32 maxLen=UInt32(-1), const char beginComment=kComment, const char endComment=kEolnCode); + hsBool GetToken(char *s, UInt32 maxLen=UInt32(-1), const char beginComment=kComment, const char endComment=kEolnCode); + hsBool ReadLn(char* s, UInt32 maxLen=UInt32(-1), const char beginComment=kComment, const char endComment=kEolnCode); - bool Readbool(); - hsBool ReadBool(); - void ReadBool(int count, hsBool values[]); - UInt16 ReadSwap16(); - void ReadSwap16(int count, UInt16 values[]); - UInt32 ReadSwap32(); - void ReadSwap32(int count, UInt32 values[]); - UInt32 ReadUnswap32(); + bool Readbool(); + hsBool ReadBool(); + void ReadBool(int count, hsBool values[]); + UInt16 ReadLE16(); + void ReadLE16(int count, UInt16 values[]); + UInt32 ReadLE32(); + void ReadLE32(int count, UInt32 values[]); + UInt32 ReadBE32(); void Writebool(bool value); void WriteBool(hsBool value); void WriteBool(int count, const hsBool values[]); void WriteByte(UInt8 value); - void WriteSwap16(UInt16 value); - void WriteSwap16(int count, const UInt16 values[]); - void WriteSwap32(UInt32 value); - void WriteSwap32(int count, const UInt32 values[]); - void WriteUnswap32(UInt32 value); + void WriteLE16(UInt16 value); + void WriteLE16(int count, const UInt16 values[]); + void WriteLE32(UInt32 value); + void WriteLE32(int count, const UInt32 values[]); + void WriteBE32(UInt32 value); /* Overloaded Begin (8 & 16 & 32 int)*/ /* yes, swapping an 8 bit value does nothing, just useful*/ - void ReadSwap(bool* value) { *value = this->ReadByte() ? true : false; } - void ReadSwap(UInt8* value) { *value = this->ReadByte(); } - void ReadSwap(int count, UInt8 values[]) { this->Read(count, values); } - void ReadSwap(UInt16* value) { *value = this->ReadSwap16(); } - void ReadSwap(int count, UInt16 values[]) { this->ReadSwap16(count, values); } - void ReadSwap(UInt32* value) { *value = this->ReadSwap32(); } - void ReadSwap(int count, UInt32 values[]) { this->ReadSwap32(count, values); } + void ReadLE(bool* value) { *value = this->ReadByte() ? true : false; } + void ReadLE(UInt8* value) { *value = this->ReadByte(); } + void ReadLE(int count, UInt8 values[]) { this->Read(count, values); } + void ReadLE(UInt16* value) { *value = this->ReadLE16(); } + void ReadLE(int count, UInt16 values[]) { this->ReadLE16(count, values); } + void ReadLE(UInt32* value) { *value = this->ReadLE32(); } + void ReadLE(int count, UInt32 values[]) { this->ReadLE32(count, values); } #ifdef STREAM_LOGGER - // Begin LogReadSwaps - virtual void LogReadSwap(bool* value, const char* desc) { this->ReadSwap(value); } - virtual void LogReadSwap(UInt8* value, const char* desc) { this->ReadSwap(value); } - virtual void LogReadSwapArray(int count, UInt8 values[], const char* desc) { this->ReadSwap(count, values); } - virtual void LogReadSwap(UInt16* value, const char* desc) { this->ReadSwap(value); } - virtual void LogReadSwapArray(int count, UInt16 values[], const char* desc) { this->ReadSwap(count, values); } - virtual void LogReadSwap(UInt32* value, const char* desc) { this->ReadSwap(value); } - virtual void LogReadSwapArray(int count, UInt32 values[], const char* desc) { this->ReadSwap(count, values); } - // End LogReadSwaps + // Begin LogReadLEs + virtual void LogReadLE(bool* value, const char* desc) { this->ReadLE(value); } + virtual void LogReadLE(UInt8* value, const char* desc) { this->ReadLE(value); } + virtual void LogReadLEArray(int count, UInt8 values[], const char* desc) { this->ReadLE(count, values); } + virtual void LogReadLE(UInt16* value, const char* desc) { this->ReadLE(value); } + virtual void LogReadLEArray(int count, UInt16 values[], const char* desc) { this->ReadLE(count, values); } + virtual void LogReadLE(UInt32* value, const char* desc) { this->ReadLE(value); } + virtual void LogReadLEArray(int count, UInt32 values[], const char* desc) { this->ReadLE(count, values); } + // End LogReadLEs #endif - void WriteSwap(bool value) { this->Write(1,&value); } - void WriteSwap(UInt8 value) { this->Write(1,&value); } - void WriteSwap(int count, const UInt8 values[]) { this->Write(count, values); } - void WriteSwap(UInt16 value) { this->WriteSwap16(value); } - void WriteSwap(int count, const UInt16 values[]) { this->WriteSwap16(count, values); } - void WriteSwap(UInt32 value) { this->WriteSwap32(value); } - void WriteSwap(int count, const UInt32 values[]) { this->WriteSwap32(count, values); } - void ReadSwap(Int8* value) { *value = this->ReadByte(); } - void ReadSwap(int count, Int8 values[]) { this->Read(count, values); } - void ReadSwap(char* value) { *value = (char)this->ReadByte(); } - void ReadSwap(int count, char values[]) { this->Read(count, values); } - void ReadSwap(Int16* value) { *value = (Int16)this->ReadSwap16(); } - void ReadSwap(int count, Int16 values[]) { this->ReadSwap16(count, (UInt16*)values); } - void ReadSwap(Int32* value) { *value = (Int32)this->ReadSwap32(); } - void ReadSwap(int count, Int32 values[]) { this->ReadSwap32(count, (UInt32*)values); } + void WriteLE(bool value) { this->Write(1,&value); } + void WriteLE(UInt8 value) { this->Write(1,&value); } + void WriteLE(int count, const UInt8 values[]) { this->Write(count, values); } + void WriteLE(UInt16 value) { this->WriteLE16(value); } + void WriteLE(int count, const UInt16 values[]) { this->WriteLE16(count, values); } + void WriteLE(UInt32 value) { this->WriteLE32(value); } + void WriteLE(int count, const UInt32 values[]) { this->WriteLE32(count, values); } + void ReadLE(Int8* value) { *value = this->ReadByte(); } + void ReadLE(int count, Int8 values[]) { this->Read(count, values); } + void ReadLE(char* value) { *value = (char)this->ReadByte(); } + void ReadLE(int count, char values[]) { this->Read(count, values); } + void ReadLE(Int16* value) { *value = (Int16)this->ReadLE16(); } + void ReadLE(int count, Int16 values[]) { this->ReadLE16(count, (UInt16*)values); } + void ReadLE(Int32* value) { *value = (Int32)this->ReadLE32(); } + void ReadLE(int count, Int32 values[]) { this->ReadLE32(count, (UInt32*)values); } #ifdef STREAM_LOGGER - // Begin LogReadSwaps - virtual void LogReadSwap(Int8* value, const char* desc) { this->ReadSwap(value); } - virtual void LogReadSwapArray(int count, Int8 values[], const char* desc) { this->ReadSwap(count, values); } - virtual void LogReadSwap(char* value, const char* desc) { this->ReadSwap(value); } - virtual void LogReadSwapArray(int count, char values[], const char* desc) { this->ReadSwap(count, values); } - virtual void LogReadSwap(Int16* value, const char* desc) { this->ReadSwap(value); } - virtual void LogReadSwapArray(int count, Int16 values[], const char* desc) { this->ReadSwap(count, (UInt16*)values); } - virtual void LogReadSwap(Int32* value, const char* desc) { this->ReadSwap(value); } - virtual void LogReadSwapArray(int count, Int32 values[], const char* desc) { this->ReadSwap(count, (UInt32*)values); } - virtual void LogReadSwap(int* value, const char* desc) { this->ReadSwap(value); } - virtual void LogReadSwapArray(int count, int values[], const char* desc) { this->ReadSwap(count, (UInt32*)values); } - // End LogReadSwaps + // Begin LogReadLEs + virtual void LogReadLE(Int8* value, const char* desc) { this->ReadLE(value); } + virtual void LogReadLEArray(int count, Int8 values[], const char* desc) { this->ReadLE(count, values); } + virtual void LogReadLE(char* value, const char* desc) { this->ReadLE(value); } + virtual void LogReadLEArray(int count, char values[], const char* desc) { this->ReadLE(count, values); } + virtual void LogReadLE(Int16* value, const char* desc) { this->ReadLE(value); } + virtual void LogReadLEArray(int count, Int16 values[], const char* desc) { this->ReadLE(count, (UInt16*)values); } + virtual void LogReadLE(Int32* value, const char* desc) { this->ReadLE(value); } + virtual void LogReadLEArray(int count, Int32 values[], const char* desc) { this->ReadLE(count, (UInt32*)values); } + virtual void LogReadLE(int* value, const char* desc) { this->ReadLE(value); } + virtual void LogReadLEArray(int count, int values[], const char* desc) { this->ReadLE(count, (UInt32*)values); } + // End LogReadLEs #endif - void WriteSwap(Int8 value) { this->Write(1,&value); } - void WriteSwap(int count, const Int8 values[]) { this->Write(count, values); } - void WriteSwap(char value) { this->Write(1,(UInt8*)&value); } - void WriteSwap(int count, const char values[]) { this->Write(count, (UInt8*)values); } - void WriteSwap(Int16 value) { this->WriteSwap16((UInt16)value); } - void WriteSwap(int count, const Int16 values[]) { this->WriteSwap16(count, (UInt16*)values); } - void WriteSwap(Int32 value) { this->WriteSwap32((UInt32)value); } - void WriteSwap(int count, const Int32 values[]) { this->WriteSwap32(count, (UInt32*)values); } + void WriteLE(Int8 value) { this->Write(1,&value); } + void WriteLE(int count, const Int8 values[]) { this->Write(count, values); } + void WriteLE(char value) { this->Write(1,(UInt8*)&value); } + void WriteLE(int count, const char values[]) { this->Write(count, (UInt8*)values); } + void WriteLE(Int16 value) { this->WriteLE16((UInt16)value); } + void WriteLE(int count, const Int16 values[]) { this->WriteLE16(count, (UInt16*)values); } + void WriteLE(Int32 value) { this->WriteLE32((UInt32)value); } + void WriteLE(int count, const Int32 values[]) { this->WriteLE32(count, (UInt32*)values); } /* Overloaded End */ #if HS_CAN_USE_FLOAT - float ReadSwapFloat(); - void ReadSwapFloat(int count, float values[]); - double ReadSwapDouble(); - void ReadSwapDouble(int count, double values[]); - float ReadUnswapFloat(); - void WriteSwapFloat(float value); - void WriteSwapFloat(int count, const float values[]); - void WriteSwapDouble(double value); - void WriteSwapDouble(int count, const double values[]); - void WriteUnswapFloat(float value); + float ReadLEFloat(); + void ReadLEFloat(int count, float values[]); + double ReadLEDouble(); + void ReadLEDouble(int count, double values[]); + float ReadBEFloat(); + void WriteLEFloat(float value); + void WriteLEFloat(int count, const float values[]); + void WriteLEDouble(double value); + void WriteLEDouble(int count, const double values[]); + void WriteBEFloat(float value); /* Overloaded Begin (Float)*/ - void ReadSwap(float* value) { *value = ReadSwapFloat(); } - void ReadSwap(int count, float values[]) { ReadSwapFloat(count, values); } - void ReadSwap(double* value) { *value = ReadSwapDouble(); } - void ReadSwap(int count, double values[]) { ReadSwapDouble(count, values); } + void ReadLE(float* value) { *value = ReadLEFloat(); } + void ReadLE(int count, float values[]) { ReadLEFloat(count, values); } + void ReadLE(double* value) { *value = ReadLEDouble(); } + void ReadLE(int count, double values[]) { ReadLEDouble(count, values); } #ifdef STREAM_LOGGER - // Begin LogReadSwaps - virtual void LogReadSwap(float* value, const char* desc) { ReadSwap(value); } - virtual void LogReadSwapArray(int count, float values[], const char* desc) { ReadSwap(count, values); } - virtual void LogReadSwap(double* value, const char* desc) { ReadSwap(value); } - virtual void LogReadSwapArray(int count, double values[], const char* desc) { ReadSwap(count, values); } - // End LogReadSwaps + // Begin LogReadLEs + virtual void LogReadLE(float* value, const char* desc) { ReadLE(value); } + virtual void LogReadLEArray(int count, float values[], const char* desc) { ReadLE(count, values); } + virtual void LogReadLE(double* value, const char* desc) { ReadLE(value); } + virtual void LogReadLEArray(int count, double values[], const char* desc) { ReadLE(count, values); } + // End LogReadLEs #endif - void WriteSwap(float value) { WriteSwapFloat(value); } - void WriteSwap(int count, const float values[]) { WriteSwapFloat(count, values); } - void WriteSwap(double value) { WriteSwapDouble(value); } - void WriteSwap(int count, const double values[]) { WriteSwapDouble(count, values); } + void WriteLE(float value) { WriteLEFloat(value); } + void WriteLE(int count, const float values[]) { WriteLEFloat(count, values); } + void WriteLE(double value) { WriteLEDouble(value); } + void WriteLE(int count, const double values[]) { WriteLEDouble(count, values); } /* Overloaded End */ #endif #if HS_SCALAR_IS_FIXED - hsFixed ReadSwapScalar() { return (hsFixed)this->ReadSwap32(); } - void ReadSwapScalar(int count, hsFixed values[]) - { - this->ReadSwap32(count, (UInt32*)values); - } - hsFixed ReadUnswapScalar() { return (hsFixed)this->ReadUnswap32(); } + hsFixed ReadLEScalar() { return (hsFixed)this->ReadLE32(); } + void ReadLEScalar(int count, hsFixed values[]) + { + this->ReadLE32(count, (UInt32*)values); + } + hsFixed ReadBEScalar() { return (hsFixed)this->ReadBE32(); } - void WriteSwapScalar(hsFixed value) { this->WriteSwap32(value); } - void WriteSwapScalar(int count, const hsFixed values[]) - { - this->WriteSwap32(count, (UInt32*)values); - } - void WriteUnswapScalar(hsFixed value) { this->WriteUnswap32(value); } + void WriteLEScalar(hsFixed value) { this->WriteLE32(value); } + void WriteLEScalar(int count, const hsFixed values[]) + { + this->WriteLE32(count, (UInt32*)values); + } + void WriteBEScalar(hsFixed value) { this->WriteBE32(value); } /* Overloaded Begin (Scalar) */ - void ReadSwap(hsFixed* value) { this->ReadSwap((UInt32*)value); } - void ReadSwap(int count, hsFixed values[]) { this->ReadSwap(count, (UInt32*)values); } - void WriteSwap(hsFixed value) { this->WriteSwap((UInt32)value); } - void WriteSwap(int count, const hsFixed values[]) { this->WriteSwap(count, (UInt32*)values); } + void ReadLE(hsFixed* value) { this->ReadLE((UInt32*)value); } + void ReadLE(int count, hsFixed values[]) { this->ReadLE(count, (UInt32*)values); } + void WriteLE(hsFixed value) { this->WriteLE((UInt32)value); } + void WriteLE(int count, const hsFixed values[]) { this->WriteLE(count, (UInt32*)values); } /* Overloaded End */ #else - float ReadSwapScalar() { return (float)this->ReadSwapFloat(); } - void ReadSwapScalar(int count, float values[]) - { - this->ReadSwapFloat(count, (float*)values); - } - float ReadUnswapScalar() { return (float)this->ReadUnswapFloat(); } - void WriteSwapScalar(float value) { this->WriteSwapFloat(value); } - void WriteSwapScalar(int count, const float values[]) - { - this->WriteSwapFloat(count, (float*)values); - } - void WriteUnswapScalar(float value) { this->WriteUnswapFloat(value); } + float ReadLEScalar() { return (float)this->ReadLEFloat(); } + void ReadLEScalar(int count, float values[]) + { + this->ReadLEFloat(count, (float*)values); + } + float ReadBEScalar() { return (float)this->ReadBEFloat(); } + void WriteLEScalar(float value) { this->WriteLEFloat(value); } + void WriteLEScalar(int count, const float values[]) + { + this->WriteLEFloat(count, (float*)values); + } + void WriteBEScalar(float value) { this->WriteBEFloat(value); } #endif - void WriteSwapAtom(UInt32 tag, UInt32 size); - UInt32 ReadSwapAtom(UInt32* size); + void WriteLEAtom(UInt32 tag, UInt32 size); + UInt32 ReadLEAtom(UInt32* size); /* Overloaded Begin (Atom)*/ - void WriteSwap(UInt32* tag, UInt32 size) { WriteSwapAtom(*tag, size); } - void ReadSwap(UInt32* tag, UInt32 *size) { *tag = ReadSwapAtom(size); } + void WriteLE(UInt32* tag, UInt32 size) { WriteLEAtom(*tag, size); } + void ReadLE(UInt32* tag, UInt32 *size) { *tag = ReadLEAtom(size); } /* Overloaded End */ virtual void VirtualSetPosition(UInt32 pos, VDB_Type ){ SetPosition(pos); }; virtual hsPackFileSys::FileEntry *GetFileEntry() { return nil; } // Streams from Packfiles can return a FileEntry diff --git a/Sources/Plasma/CoreLib/hsTypes.h b/Sources/Plasma/CoreLib/hsTypes.h index df2be19b..8dc0a9b5 100644 --- a/Sources/Plasma/CoreLib/hsTypes.h +++ b/Sources/Plasma/CoreLib/hsTypes.h @@ -197,27 +197,27 @@ typedef UInt32 hsGSeedValue; #endif #if LITTLE_ENDIAN - #define hsUNSWAP16(n) hsSwapEndian16(n) - #define hsUNSWAP32(n) hsSwapEndian32(n) - #define hsUNSWAP64(n) hsSwapEndian64(n) - #define hsUNSWAPFloat(n) hsSwapEndianFloat(n) - #define hsUNSWAPDouble(n) hsSwapEndianDouble(n) - #define hsSWAP16(n) (n) - #define hsSWAP32(n) (n) - #define hsSWAP64(n) (n) - #define hsSWAPFloat(n) (n) - #define hsSWAPDouble(n) (n) + #define hsToBE16(n) hsSwapEndian16(n) + #define hsToBE32(n) hsSwapEndian32(n) + #define hsToBE64(n) hsSwapEndian64(n) + #define hsToBEFloat(n) hsSwapEndianFloat(n) + #define hsToBEDouble(n) hsSwapEndianDouble(n) + #define hsToLE16(n) (n) + #define hsToLE32(n) (n) + #define hsToLE64(n) (n) + #define hsToLEFloat(n) (n) + #define hsToLEDouble(n) (n) #else - #define hsUNSWAP16(n) (n) - #define hsUNSWAP32(n) (n) - #define hsUNSWAP64(n) (n) - #define hsUNSWAPFloat(n) (n) - #define hsUNSWAPDouble(n) (n) - #define hsSWAP16(n) hsSwapEndian16(n) - #define hsSWAP32(n) hsSwapEndian32(n) - #define hsSWAP64(n) hsSwapEndian64(n) - #define hsSWAPFloat(n) hsSwapEndianFloat(n) - #define hsSWAPDouble(n) hsSwapEndianDouble(n) + #define hsToBE16(n) (n) + #define hsToBE32(n) (n) + #define hsToBE64(n) (n) + #define hsToBEFloat(n) (n) + #define hsToBEDouble(n) (n) + #define hsToLE16(n) hsSwapEndian16(n) + #define hsToLE32(n) hsSwapEndian32(n) + #define hsToLE64(n) hsSwapEndian64(n) + #define hsToLEFloat(n) hsSwapEndianFloat(n) + #define hsToLEDouble(n) hsSwapEndianDouble(n) #endif inline void hsSwap(Int32& a, Int32& b) diff --git a/Sources/Plasma/CoreLib/pcSmallRect.cpp b/Sources/Plasma/CoreLib/pcSmallRect.cpp index ef395c9a..e447dd1a 100644 --- a/Sources/Plasma/CoreLib/pcSmallRect.cpp +++ b/Sources/Plasma/CoreLib/pcSmallRect.cpp @@ -50,16 +50,16 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com void pcSmallRect::Read( hsStream *s ) { - s->ReadSwap( &fX ); - s->ReadSwap( &fY ); - s->ReadSwap( &fWidth ); - s->ReadSwap( &fHeight ); + s->ReadLE( &fX ); + s->ReadLE( &fY ); + s->ReadLE( &fWidth ); + s->ReadLE( &fHeight ); } void pcSmallRect::Write( hsStream *s ) { - s->WriteSwap( fX ); - s->WriteSwap( fY ); - s->WriteSwap( fWidth ); - s->WriteSwap( fHeight ); + s->WriteLE( fX ); + s->WriteLE( fY ); + s->WriteLE( fWidth ); + s->WriteLE( fHeight ); } diff --git a/Sources/Plasma/CoreLib/plGeneric.cpp b/Sources/Plasma/CoreLib/plGeneric.cpp index 73617dec..6c8b6817 100644 --- a/Sources/Plasma/CoreLib/plGeneric.cpp +++ b/Sources/Plasma/CoreLib/plGeneric.cpp @@ -153,11 +153,11 @@ int plGeneric::Write(hsStream* stream) break; case kInt: - stream->WriteSwap(fIntVal); + stream->WriteLE(fIntVal); break; case kFloat: - stream->WriteSwap(fFloatVal); + stream->WriteLE(fFloatVal); break; case kString: @@ -181,11 +181,11 @@ int plGeneric::Read(hsStream* stream) break; case kInt: - stream->ReadSwap(&fIntVal); + stream->ReadLE(&fIntVal); break; case kFloat: - stream->ReadSwap(&fFloatVal); + stream->ReadLE(&fFloatVal); break; case kString: diff --git a/Sources/Plasma/CoreLib/plLoadMask.cpp b/Sources/Plasma/CoreLib/plLoadMask.cpp index 0c7a332f..38821ab0 100644 --- a/Sources/Plasma/CoreLib/plLoadMask.cpp +++ b/Sources/Plasma/CoreLib/plLoadMask.cpp @@ -82,7 +82,7 @@ void plLoadMask::Read(hsStream* s) { // read as packed byte UInt8 qc; - s->LogReadSwap(&qc,"Quality|Capabilty"); + s->LogReadLE(&qc,"Quality|Capabilty"); fQuality[0] = (qc & 0xf0) >> 4; fQuality[1] = (qc & 0x0f); @@ -96,7 +96,7 @@ void plLoadMask::Write(hsStream* s) const { // write packed into 1 byte UInt8 qc = (fQuality[0]<<4) | (fQuality[1] & 0xf); - s->WriteSwap(qc); + s->WriteLE(qc); } UInt32 plLoadMask::ValidateReps(int num, const int quals[], const int caps[]) diff --git a/Sources/Plasma/CoreLib/plViewTransform.cpp b/Sources/Plasma/CoreLib/plViewTransform.cpp index 1b6eb26e..6b911418 100644 --- a/Sources/Plasma/CoreLib/plViewTransform.cpp +++ b/Sources/Plasma/CoreLib/plViewTransform.cpp @@ -349,7 +349,7 @@ void plViewTransform::GetViewPort(int& loX, int& loY, int& hiX, int& hiY) const void plViewTransform::Read(hsStream* s) { - fFlags = s->ReadSwap32(); + fFlags = s->ReadLE32(); fFlags &= ~kSetMask; fCameraToWorld.Read(s); @@ -358,8 +358,8 @@ void plViewTransform::Read(hsStream* s) fMin.Read(s); fMax.Read(s); - fWidth = s->ReadSwap16(); - fHeight = s->ReadSwap16(); + fWidth = s->ReadLE16(); + fHeight = s->ReadLE16(); fViewPortX.Read(s); fViewPortY.Read(s); @@ -370,7 +370,7 @@ void plViewTransform::Read(hsStream* s) void plViewTransform::Write(hsStream* s) { - s->WriteSwap32(fFlags & ~kSetMask); + s->WriteLE32(fFlags & ~kSetMask); fCameraToWorld.Write(s); fWorldToCamera.Write(s); @@ -378,8 +378,8 @@ void plViewTransform::Write(hsStream* s) fMin.Write(s); fMax.Write(s); - s->WriteSwap16(fWidth); - s->WriteSwap16(fHeight); + s->WriteLE16(fWidth); + s->WriteLE16(fHeight); fViewPortX.Write(s); fViewPortY.Write(s); diff --git a/Sources/Plasma/FeatureLib/pfAnimation/pfObjectFlocker.cpp b/Sources/Plasma/FeatureLib/pfAnimation/pfObjectFlocker.cpp index 5e39461e..4603f28f 100644 --- a/Sources/Plasma/FeatureLib/pfAnimation/pfObjectFlocker.cpp +++ b/Sources/Plasma/FeatureLib/pfAnimation/pfObjectFlocker.cpp @@ -1032,18 +1032,18 @@ void pfObjectFlocker::Read(hsStream* s, hsResMgr* mgr) SetNumBoids(s->ReadByte()); fBoidKey = mgr->ReadKey(s); - fFlock.SetGoalWeight(s->ReadSwapScalar()); - fFlock.SetWanderWeight(s->ReadSwapScalar()); + fFlock.SetGoalWeight(s->ReadLEScalar()); + fFlock.SetWanderWeight(s->ReadLEScalar()); - fFlock.SetSeparationWeight(s->ReadSwapScalar()); - fFlock.SetSeparationRadius(s->ReadSwapScalar()); + fFlock.SetSeparationWeight(s->ReadLEScalar()); + fFlock.SetSeparationRadius(s->ReadLEScalar()); - fFlock.SetCohesionWeight(s->ReadSwapScalar()); - fFlock.SetCohesionRadius(s->ReadSwapScalar()); + fFlock.SetCohesionWeight(s->ReadLEScalar()); + fFlock.SetCohesionRadius(s->ReadLEScalar()); - fFlock.SetMaxForce(s->ReadSwapScalar()); - fFlock.SetMaxSpeed(s->ReadSwapScalar()); - fFlock.SetMinSpeed(s->ReadSwapScalar()); + fFlock.SetMaxForce(s->ReadLEScalar()); + fFlock.SetMaxSpeed(s->ReadLEScalar()); + fFlock.SetMinSpeed(s->ReadLEScalar()); fUseTargetRotation = s->ReadBool(); fRandomizeAnimationStart = s->ReadBool(); @@ -1058,18 +1058,18 @@ void pfObjectFlocker::Write(hsStream* s, hsResMgr* mgr) s->WriteByte(fNumBoids); mgr->WriteKey(s, fBoidKey); - s->WriteSwapScalar(fFlock.GoalWeight()); - s->WriteSwapScalar(fFlock.WanderWeight()); + s->WriteLEScalar(fFlock.GoalWeight()); + s->WriteLEScalar(fFlock.WanderWeight()); - s->WriteSwapScalar(fFlock.SeparationWeight()); - s->WriteSwapScalar(fFlock.SeparationRadius()); + s->WriteLEScalar(fFlock.SeparationWeight()); + s->WriteLEScalar(fFlock.SeparationRadius()); - s->WriteSwapScalar(fFlock.CohesionWeight()); - s->WriteSwapScalar(fFlock.CohesionRadius()); + s->WriteLEScalar(fFlock.CohesionWeight()); + s->WriteLEScalar(fFlock.CohesionRadius()); - s->WriteSwapScalar(fFlock.MaxForce()); - s->WriteSwapScalar(fFlock.MaxSpeed()); - s->WriteSwapScalar(fFlock.MinSpeed()); + s->WriteLEScalar(fFlock.MaxForce()); + s->WriteLEScalar(fFlock.MaxSpeed()); + s->WriteLEScalar(fFlock.MinSpeed()); s->WriteBool(fUseTargetRotation); s->WriteBool(fRandomizeAnimationStart); diff --git a/Sources/Plasma/FeatureLib/pfAnimation/plBlower.cpp b/Sources/Plasma/FeatureLib/pfAnimation/plBlower.cpp index 3f1dd114..b2d92827 100644 --- a/Sources/Plasma/FeatureLib/pfAnimation/plBlower.cpp +++ b/Sources/Plasma/FeatureLib/pfAnimation/plBlower.cpp @@ -193,20 +193,20 @@ void plBlower::Read(hsStream* s, hsResMgr* mgr) { plSingleModifier::Read(s, mgr); - fMasterPower = s->ReadSwapScalar(); - fDirectRate = s->ReadSwapScalar(); - fImpulseRate = s->ReadSwapScalar(); - fSpringKonst = s->ReadSwapScalar(); + fMasterPower = s->ReadLEScalar(); + fDirectRate = s->ReadLEScalar(); + fImpulseRate = s->ReadLEScalar(); + fSpringKonst = s->ReadLEScalar(); } void plBlower::Write(hsStream* s, hsResMgr* mgr) { plSingleModifier::Write(s, mgr); - s->WriteSwapScalar(fMasterPower); - s->WriteSwapScalar(fDirectRate); - s->WriteSwapScalar(fImpulseRate); - s->WriteSwapScalar(fSpringKonst); + s->WriteLEScalar(fMasterPower); + s->WriteLEScalar(fDirectRate); + s->WriteLEScalar(fImpulseRate); + s->WriteLEScalar(fSpringKonst); } void plBlower::IInitOscillators() diff --git a/Sources/Plasma/FeatureLib/pfAnimation/plFilterCoordInterface.cpp b/Sources/Plasma/FeatureLib/pfAnimation/plFilterCoordInterface.cpp index 6c5831f2..1ec19ed5 100644 --- a/Sources/Plasma/FeatureLib/pfAnimation/plFilterCoordInterface.cpp +++ b/Sources/Plasma/FeatureLib/pfAnimation/plFilterCoordInterface.cpp @@ -94,7 +94,7 @@ void plFilterCoordInterface::Read(hsStream* stream, hsResMgr* mgr) { plCoordinateInterface::Read(stream, mgr); - fFilterMask = stream->ReadSwap32(); + fFilterMask = stream->ReadLE32(); fRefParentLocalToWorld.Read(stream); } @@ -102,7 +102,7 @@ void plFilterCoordInterface::Write(hsStream* stream, hsResMgr* mgr) { plCoordinateInterface::Write(stream, mgr); - stream->WriteSwap32(fFilterMask); + stream->WriteLE32(fFilterMask); fRefParentLocalToWorld.Write(stream); } diff --git a/Sources/Plasma/FeatureLib/pfAnimation/plLineFollowMod.cpp b/Sources/Plasma/FeatureLib/pfAnimation/plLineFollowMod.cpp index 9d58d8d1..28d02ca5 100644 --- a/Sources/Plasma/FeatureLib/pfAnimation/plLineFollowMod.cpp +++ b/Sources/Plasma/FeatureLib/pfAnimation/plLineFollowMod.cpp @@ -159,20 +159,20 @@ void plLineFollowMod::Read(hsStream* stream, hsResMgr* mgr) mgr->ReadKeyNotifyMe(stream, TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, 0, kRefObject), plRefFlags::kPassiveRef); - int n = stream->ReadSwap32(); + int n = stream->ReadLE32(); while(n--) { mgr->ReadKeyNotifyMe(stream, TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, 0, kRefStereizer), plRefFlags::kPassiveRef); } - UInt32 f = stream->ReadSwap32(); + UInt32 f = stream->ReadLE32(); SetFollowMode(FollowMode(f & 0xffff)); fFollowFlags = (UInt16)((f >> 16) & 0xffff); if( fFollowFlags & kOffset ) { - fOffset = stream->ReadSwapScalar(); + fOffset = stream->ReadLEScalar(); } if( fFollowFlags & kOffsetAng ) { @@ -180,11 +180,11 @@ void plLineFollowMod::Read(hsStream* stream, hsResMgr* mgr) } if( fFollowFlags & kOffsetClamp ) { - fOffsetClamp = stream->ReadSwapScalar(); + fOffsetClamp = stream->ReadLEScalar(); } if( fFollowFlags & kSpeedClamp ) { - fSpeedClamp = stream->ReadSwapScalar(); + fSpeedClamp = stream->ReadLEScalar(); } } @@ -198,20 +198,20 @@ void plLineFollowMod::Write(hsStream* stream, hsResMgr* mgr) mgr->WriteKey(stream, fRefObj); - stream->WriteSwap32(fStereizers.GetCount()); + stream->WriteLE32(fStereizers.GetCount()); int i; for( i = 0; i < fStereizers.GetCount(); i++ ) mgr->WriteKey(stream, fStereizers[i]->GetKey()); UInt32 f = UInt32(fFollowMode) | (UInt32(fFollowFlags) << 16); - stream->WriteSwap32(f); + stream->WriteLE32(f); if( fFollowFlags & kOffset ) - stream->WriteSwapScalar(fOffset); + stream->WriteLEScalar(fOffset); if( fFollowFlags & kOffsetClamp ) - stream->WriteSwapScalar(fOffsetClamp); + stream->WriteLEScalar(fOffsetClamp); if( fFollowFlags & kSpeedClamp ) - stream->WriteSwapScalar(fSpeedClamp); + stream->WriteLEScalar(fSpeedClamp); } diff --git a/Sources/Plasma/FeatureLib/pfAnimation/plRandomCommandMod.cpp b/Sources/Plasma/FeatureLib/pfAnimation/plRandomCommandMod.cpp index dd6498b0..4ca722b2 100644 --- a/Sources/Plasma/FeatureLib/pfAnimation/plRandomCommandMod.cpp +++ b/Sources/Plasma/FeatureLib/pfAnimation/plRandomCommandMod.cpp @@ -277,8 +277,8 @@ void plRandomCommandMod::Read(hsStream* s, hsResMgr* mgr) fMode = s->ReadByte(); fState = s->ReadByte(); - fMinDelay = s->ReadSwapScalar(); - fMaxDelay = s->ReadSwapScalar(); + fMinDelay = s->ReadLEScalar(); + fMaxDelay = s->ReadLEScalar(); IReset(); } @@ -290,8 +290,8 @@ void plRandomCommandMod::Write(hsStream* s, hsResMgr* mgr) s->WriteByte(fMode); s->WriteByte(fState); - s->WriteSwapScalar(fMinDelay); - s->WriteSwapScalar(fMaxDelay); + s->WriteLEScalar(fMinDelay); + s->WriteLEScalar(fMaxDelay); } void plRandomCommandMod::IRetry(hsScalar secs) diff --git a/Sources/Plasma/FeatureLib/pfAnimation/plStereizer.cpp b/Sources/Plasma/FeatureLib/pfAnimation/plStereizer.cpp index 82a3195b..3a1a0b89 100644 --- a/Sources/Plasma/FeatureLib/pfAnimation/plStereizer.cpp +++ b/Sources/Plasma/FeatureLib/pfAnimation/plStereizer.cpp @@ -78,13 +78,13 @@ void plStereizer::Read(hsStream* stream, hsResMgr* mgr) { plSingleModifier::Read(stream, mgr); - fAmbientDist = stream->ReadSwapScalar(); - fTransition = stream->ReadSwapScalar(); + fAmbientDist = stream->ReadLEScalar(); + fTransition = stream->ReadLEScalar(); - fMaxSepDist = stream->ReadSwapScalar(); - fMinSepDist = stream->ReadSwapScalar(); + fMaxSepDist = stream->ReadLEScalar(); + fMinSepDist = stream->ReadLEScalar(); - fTanAng = stream->ReadSwapScalar(); + fTanAng = stream->ReadLEScalar(); fInitPos.Read(stream); @@ -96,13 +96,13 @@ void plStereizer::Write(hsStream* stream, hsResMgr* mgr) { plSingleModifier::Write(stream, mgr); - stream->WriteSwapScalar(fAmbientDist); - stream->WriteSwapScalar(fTransition); + stream->WriteLEScalar(fAmbientDist); + stream->WriteLEScalar(fTransition); - stream->WriteSwapScalar(fMaxSepDist); - stream->WriteSwapScalar(fMinSepDist); + stream->WriteLEScalar(fMaxSepDist); + stream->WriteLEScalar(fMinSepDist); - stream->WriteSwapScalar(fTanAng); + stream->WriteLEScalar(fTanAng); fInitPos.Write(stream); } diff --git a/Sources/Plasma/FeatureLib/pfAudio/plRandomSoundMod.cpp b/Sources/Plasma/FeatureLib/pfAudio/plRandomSoundMod.cpp index 55819d6d..b77c6bc9 100644 --- a/Sources/Plasma/FeatureLib/pfAudio/plRandomSoundMod.cpp +++ b/Sources/Plasma/FeatureLib/pfAudio/plRandomSoundMod.cpp @@ -64,23 +64,23 @@ plRandomSoundModGroup::~plRandomSoundModGroup() void plRandomSoundModGroup::Read(hsStream *s) { - fNumSounds = s->ReadSwap16(); - fGroupedIdx = s->ReadSwap16(); + fNumSounds = s->ReadLE16(); + fGroupedIdx = s->ReadLE16(); fIndices = TRACKED_NEW UInt16[fNumSounds]; int i; for (i = 0; i < fNumSounds; i++) - fIndices[i] = s->ReadSwap16(); + fIndices[i] = s->ReadLE16(); } void plRandomSoundModGroup::Write(hsStream *s) { - s->WriteSwap16(fNumSounds); - s->WriteSwap16(fGroupedIdx); + s->WriteLE16(fNumSounds); + s->WriteLE16(fGroupedIdx); int i; for (i = 0; i < fNumSounds; i++) - s->WriteSwap16(fIndices[i]); + s->WriteLE16(fIndices[i]); } /////////////////////////////////////////////////////////////////////////////////////// @@ -294,7 +294,7 @@ void plRandomSoundMod::Read(hsStream *s, hsResMgr *mgr) { plRandomCommandMod::Read(s, mgr); - fNumGroups = s->ReadSwap16(); + fNumGroups = s->ReadLE16(); if (fNumGroups > 0) { fGroups = TRACKED_NEW plRandomSoundModGroup[fNumGroups]; @@ -308,7 +308,7 @@ void plRandomSoundMod::Write(hsStream *s, hsResMgr *mgr) { plRandomCommandMod::Write(s, mgr); - s->WriteSwap16(fNumGroups); + s->WriteLE16(fNumGroups); if (fNumGroups > 0) { int i; diff --git a/Sources/Plasma/FeatureLib/pfCamera/plCameraBrain.cpp b/Sources/Plasma/FeatureLib/pfCamera/plCameraBrain.cpp index f100225c..9699d9d6 100644 --- a/Sources/Plasma/FeatureLib/pfCamera/plCameraBrain.cpp +++ b/Sources/Plasma/FeatureLib/pfCamera/plCameraBrain.cpp @@ -501,17 +501,17 @@ void plCameraBrain1::Read(hsStream* stream, hsResMgr* mgr) plgDispatch::Dispatch()->RegisterForExactType(plPlayerPageMsg::Index(), GetKey()); } - fAccel = stream->ReadSwapFloat(); - fDecel = stream->ReadSwapFloat(); - fVelocity = stream->ReadSwapFloat(); - fPOAAccel = stream->ReadSwapFloat(); - fPOADecel = stream->ReadSwapFloat(); - fPOAVelocity = stream->ReadSwapFloat(); - fXPanLimit = stream->ReadSwapFloat(); - fZPanLimit = stream->ReadSwapFloat(); - fZoomRate = stream->ReadSwapFloat(); - fZoomMin = stream->ReadSwapFloat(); - fZoomMax = stream->ReadSwapFloat(); + fAccel = stream->ReadLEFloat(); + fDecel = stream->ReadLEFloat(); + fVelocity = stream->ReadLEFloat(); + fPOAAccel = stream->ReadLEFloat(); + fPOADecel = stream->ReadLEFloat(); + fPOAVelocity = stream->ReadLEFloat(); + fXPanLimit = stream->ReadLEFloat(); + fZPanLimit = stream->ReadLEFloat(); + fZoomRate = stream->ReadLEFloat(); + fZoomMin = stream->ReadLEFloat(); + fZoomMax = stream->ReadLEFloat(); } @@ -522,17 +522,17 @@ void plCameraBrain1::Write(hsStream* stream, hsResMgr* mgr) mgr->WriteKey(stream, GetSubject()); mgr->WriteKey(stream, fRail); fFlags.Write(stream); - stream->WriteSwapFloat(fAccel); - stream->WriteSwapFloat(fDecel); - stream->WriteSwapFloat(fVelocity); - stream->WriteSwapFloat(fPOAAccel); - stream->WriteSwapFloat(fPOADecel); - stream->WriteSwapFloat(fPOAVelocity); - stream->WriteSwapFloat(fXPanLimit); - stream->WriteSwapFloat(fZPanLimit); - stream->WriteSwapFloat(fZoomRate); - stream->WriteSwapFloat(fZoomMin); - stream->WriteSwapFloat(fZoomMax); + stream->WriteLEFloat(fAccel); + stream->WriteLEFloat(fDecel); + stream->WriteLEFloat(fVelocity); + stream->WriteLEFloat(fPOAAccel); + stream->WriteLEFloat(fPOADecel); + stream->WriteLEFloat(fPOAVelocity); + stream->WriteLEFloat(fXPanLimit); + stream->WriteLEFloat(fZPanLimit); + stream->WriteLEFloat(fZoomRate); + stream->WriteLEFloat(fZoomMin); + stream->WriteLEFloat(fZoomMax); } hsBool plCameraBrain1::MsgReceive(plMessage* msg) { @@ -1759,18 +1759,18 @@ hsPoint3 plCameraBrain1_Circle::GetCenterPoint() void plCameraBrain1_Circle::Write(hsStream* stream, hsResMgr* mgr) { plCameraBrain1::Write(stream, mgr); - stream->WriteSwap32(GetCircleFlags()); + stream->WriteLE32(GetCircleFlags()); fCenter.Write(stream); - stream->WriteSwapScalar(GetRadius()); + stream->WriteLEScalar(GetRadius()); mgr->WriteKey(stream, fCenterObject); mgr->WriteKey(stream, fPOAObj); - stream->WriteSwapScalar(fCirPerSec); + stream->WriteLEScalar(fCirPerSec); } void plCameraBrain1_Circle::Read(hsStream* stream, hsResMgr* mgr) { plCameraBrain1::Read(stream, mgr); - SetCircleFlags(stream->ReadSwap32()); + SetCircleFlags(stream->ReadLE32()); if (GetCircleFlags() & kCircleLocalAvatar) { if (plNetClientApp::GetInstance() && plNetClientApp::GetInstance()->GetLocalPlayer()) @@ -1780,12 +1780,12 @@ void plCameraBrain1_Circle::Read(hsStream* stream, hsResMgr* mgr) } fCenter.Read(stream); - SetRadius(stream->ReadSwapScalar()); + SetRadius(stream->ReadLEScalar()); plGenRefMsg* msg = TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnRequest, 0, kCircleTarget ); // SceneObject mgr->ReadKeyNotifyMe( stream, msg, plRefFlags::kActiveRef ); plGenRefMsg* msg2 = TRACKED_NEW plGenRefMsg( GetKey(), plRefMsg::kOnRequest, 0, kPOAObject ); // SceneObject mgr->ReadKeyNotifyMe( stream, msg2, plRefFlags::kActiveRef ); - fCirPerSec = stream->ReadSwapScalar(); + fCirPerSec = stream->ReadLEScalar(); plgDispatch::Dispatch()->RegisterForExactType(plEvalMsg::Index(), GetKey()); } diff --git a/Sources/Plasma/FeatureLib/pfCamera/plCameraModifier.cpp b/Sources/Plasma/FeatureLib/pfCamera/plCameraModifier.cpp index 45fec79e..8084c0d5 100644 --- a/Sources/Plasma/FeatureLib/pfCamera/plCameraModifier.cpp +++ b/Sources/Plasma/FeatureLib/pfCamera/plCameraModifier.cpp @@ -323,7 +323,7 @@ void plCameraModifier1::Read(hsStream* stream, hsResMgr* mgr) hsKeyedObject::Read(stream, mgr); fBrain = nil; mgr->ReadKeyNotifyMe(stream, TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, 0, kRefBrain), plRefFlags::kActiveRef); - int count = stream->ReadSwap32(); + int count = stream->ReadLE32(); int i; for (i = 0; i < count; i++) { @@ -332,12 +332,12 @@ void plCameraModifier1::Read(hsStream* stream, hsResMgr* mgr) hsBool cutpos = stream->ReadBool(); hsBool cutpoa = stream->ReadBool(); hsBool ignore = stream->ReadBool(); - hsScalar v = stream->ReadSwapScalar(); - hsScalar a = stream->ReadSwapScalar(); - hsScalar d = stream->ReadSwapScalar(); - hsScalar pV = stream->ReadSwapScalar(); - hsScalar pA = stream->ReadSwapScalar(); - hsScalar pD = stream->ReadSwapScalar(); + hsScalar v = stream->ReadLEScalar(); + hsScalar a = stream->ReadLEScalar(); + hsScalar d = stream->ReadLEScalar(); + hsScalar pV = stream->ReadLEScalar(); + hsScalar pA = stream->ReadLEScalar(); + hsScalar pD = stream->ReadLEScalar(); CamTrans* camTrans = TRACKED_NEW CamTrans(key); camTrans->fAccel = a; @@ -352,9 +352,9 @@ void plCameraModifier1::Read(hsStream* stream, hsResMgr* mgr) fTrans.Append(camTrans); } - fFOVw = stream->ReadSwapFloat(); - fFOVh = stream->ReadSwapFloat(); - int n = stream->ReadSwap32(); + fFOVw = stream->ReadLEFloat(); + fFOVh = stream->ReadLEFloat(); + int n = stream->ReadLE32(); fMessageQueue.SetCountAndZero(n); for(i = 0; i < n; i++ ) { @@ -366,7 +366,7 @@ void plCameraModifier1::Read(hsStream* stream, hsResMgr* mgr) mgr->ReadKeyNotifyMe(stream, TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, i, kRefCallbackMsg), plRefFlags::kActiveRef); } - n = stream->ReadSwap32(); + n = stream->ReadLE32(); fFOVInstructions.SetCountAndZero(n); for(i = 0; i < n; i++ ) { @@ -387,23 +387,23 @@ void plCameraModifier1::Write(hsStream* stream, hsResMgr* mgr) mgr->WriteKey(stream, fBrain ); int i = fTrans.Count(); - stream->WriteSwap32(i); + stream->WriteLE32(i); for (i = 0; i < fTrans.Count(); i++) { mgr->WriteKey(stream, fTrans[i]->fTransTo); stream->WriteBool(fTrans[i]->fCutPos); stream->WriteBool(fTrans[i]->fCutPOA); stream->WriteBool(fTrans[i]->fIgnore); - stream->WriteSwapScalar(fTrans[i]->fVelocity); - stream->WriteSwapScalar(fTrans[i]->fAccel); - stream->WriteSwapScalar(fTrans[i]->fDecel); - stream->WriteSwapScalar(fTrans[i]->fPOAVelocity); - stream->WriteSwapScalar(fTrans[i]->fPOAAccel); - stream->WriteSwapScalar(fTrans[i]->fPOADecel); + stream->WriteLEScalar(fTrans[i]->fVelocity); + stream->WriteLEScalar(fTrans[i]->fAccel); + stream->WriteLEScalar(fTrans[i]->fDecel); + stream->WriteLEScalar(fTrans[i]->fPOAVelocity); + stream->WriteLEScalar(fTrans[i]->fPOAAccel); + stream->WriteLEScalar(fTrans[i]->fPOADecel); } - stream->WriteSwapFloat(fFOVw); - stream->WriteSwapFloat(fFOVh); - stream->WriteSwap32(fMessageQueue.Count()); + stream->WriteLEFloat(fFOVw); + stream->WriteLEFloat(fFOVh); + stream->WriteLE32(fMessageQueue.Count()); for (i = 0; i < fMessageQueue.Count(); i++) { mgr->WriteCreatable(stream, fMessageQueue[i]); @@ -412,7 +412,7 @@ void plCameraModifier1::Write(hsStream* stream, hsResMgr* mgr) { mgr->WriteKey(stream, fMessageQueue[i]->GetSender()); } - stream->WriteSwap32(fFOVInstructions.Count()); + stream->WriteLE32(fFOVInstructions.Count()); for (i = 0; i < fFOVInstructions.Count(); i++) { mgr->WriteCreatable(stream, fFOVInstructions[i]); diff --git a/Sources/Plasma/FeatureLib/pfConditional/plANDConditionalObject.cpp b/Sources/Plasma/FeatureLib/pfConditional/plANDConditionalObject.cpp index 172dcd3a..4c417f79 100644 --- a/Sources/Plasma/FeatureLib/pfConditional/plANDConditionalObject.cpp +++ b/Sources/Plasma/FeatureLib/pfConditional/plANDConditionalObject.cpp @@ -103,7 +103,7 @@ void plANDConditionalObject::Read(hsStream* stream, hsResMgr* mgr) plConditionalObject::Read(stream, mgr); plCondRefMsg* refMsg; - int n = stream->ReadSwap32(); + int n = stream->ReadLE32(); fChildren.SetCountAndZero(n); for(int i = 0; i < n; i++ ) { @@ -116,7 +116,7 @@ void plANDConditionalObject::Write(hsStream* stream, hsResMgr* mgr) { plConditionalObject::Write(stream, mgr); - stream->WriteSwap32(fChildren.GetCount()); + stream->WriteLE32(fChildren.GetCount()); for( int i = 0; i < fChildren.GetCount(); i++ ) fChildren[i]->Write(stream, mgr); } diff --git a/Sources/Plasma/FeatureLib/pfConditional/plActivatorConditionalObject.cpp b/Sources/Plasma/FeatureLib/pfConditional/plActivatorConditionalObject.cpp index 3ee68658..fc13adcd 100644 --- a/Sources/Plasma/FeatureLib/pfConditional/plActivatorConditionalObject.cpp +++ b/Sources/Plasma/FeatureLib/pfConditional/plActivatorConditionalObject.cpp @@ -145,14 +145,14 @@ void plActivatorConditionalObject::Read(hsStream* stream, hsResMgr* mgr) { plConditionalObject::Read(stream, mgr); fActivators.Reset(); - int n = stream->ReadSwap32(); + int n = stream->ReadLE32(); for (int i = 0; i < n; i++) fActivators.Append(mgr->ReadKey(stream)); } void plActivatorConditionalObject::Write(hsStream* stream, hsResMgr* mgr) { plConditionalObject::Write(stream, mgr); - stream->WriteSwap32(fActivators.Count()); + stream->WriteLE32(fActivators.Count()); for (int i = 0; i < fActivators.Count(); i++) mgr->WriteKey(stream, fActivators[i]); } diff --git a/Sources/Plasma/FeatureLib/pfConditional/plAnimationEventConditionalObject.cpp b/Sources/Plasma/FeatureLib/pfConditional/plAnimationEventConditionalObject.cpp index 62bdf5bd..f2113109 100644 --- a/Sources/Plasma/FeatureLib/pfConditional/plAnimationEventConditionalObject.cpp +++ b/Sources/Plasma/FeatureLib/pfConditional/plAnimationEventConditionalObject.cpp @@ -86,13 +86,13 @@ void plAnimationEventConditionalObject::Read(hsStream* stream, hsResMgr* mgr) { plConditionalObject::Read(stream, mgr); fTarget = mgr->ReadKey(stream); - fAction = (CallbackEvent)stream->ReadSwap32(); + fAction = (CallbackEvent)stream->ReadLE32(); } void plAnimationEventConditionalObject::Write(hsStream* stream, hsResMgr* mgr) { plConditionalObject::Write(stream, mgr); mgr->WriteKey(stream, fTarget); - stream->WriteSwap32(fAction); + stream->WriteLE32(fAction); } diff --git a/Sources/Plasma/FeatureLib/pfConditional/plControlEventConditionalObject.cpp b/Sources/Plasma/FeatureLib/pfConditional/plControlEventConditionalObject.cpp index a6aef8d2..2e89ca77 100644 --- a/Sources/Plasma/FeatureLib/pfConditional/plControlEventConditionalObject.cpp +++ b/Sources/Plasma/FeatureLib/pfConditional/plControlEventConditionalObject.cpp @@ -73,12 +73,12 @@ hsBool plControlEventConditionalObject::MsgReceive(plMessage* msg) void plControlEventConditionalObject::Read(hsStream* stream, hsResMgr* mgr) { plConditionalObject::Read(stream, mgr); - fControlEvent = (ControlEventCode)stream->ReadSwap32(); + fControlEvent = (ControlEventCode)stream->ReadLE32(); } void plControlEventConditionalObject::Write(hsStream* stream, hsResMgr* mgr) { plConditionalObject::Write(stream, mgr); - stream->WriteSwap32((UInt32)fControlEvent); + stream->WriteLE32((UInt32)fControlEvent); } diff --git a/Sources/Plasma/FeatureLib/pfConditional/plFacingConditionalObject.cpp b/Sources/Plasma/FeatureLib/pfConditional/plFacingConditionalObject.cpp index c4ce8770..2c11b1a5 100644 --- a/Sources/Plasma/FeatureLib/pfConditional/plFacingConditionalObject.cpp +++ b/Sources/Plasma/FeatureLib/pfConditional/plFacingConditionalObject.cpp @@ -67,14 +67,14 @@ hsBool plFacingConditionalObject::MsgReceive(plMessage* msg) void plFacingConditionalObject::Write(hsStream* stream, hsResMgr* mgr) { plConditionalObject::Write(stream, mgr); - stream->WriteSwap(fTolerance); + stream->WriteLE(fTolerance); stream->WriteBool(fDirectional); } void plFacingConditionalObject::Read(hsStream* stream, hsResMgr* mgr) { plConditionalObject::Read(stream, mgr); - stream->ReadSwap(&fTolerance); + stream->ReadLE(&fTolerance); fDirectional = stream->ReadBool(); } diff --git a/Sources/Plasma/FeatureLib/pfConditional/plKeyPressConditionalObject.cpp b/Sources/Plasma/FeatureLib/pfConditional/plKeyPressConditionalObject.cpp index a059be46..f8ae7e2d 100644 --- a/Sources/Plasma/FeatureLib/pfConditional/plKeyPressConditionalObject.cpp +++ b/Sources/Plasma/FeatureLib/pfConditional/plKeyPressConditionalObject.cpp @@ -73,12 +73,12 @@ hsBool plKeyPressConditionalObject::MsgReceive(plMessage* msg) void plKeyPressConditionalObject::Read(hsStream* stream, hsResMgr* mgr) { plConditionalObject::Read(stream, mgr); - fKeyEvent = (plKeyDef)stream->ReadSwap32(); + fKeyEvent = (plKeyDef)stream->ReadLE32(); } void plKeyPressConditionalObject::Write(hsStream* stream, hsResMgr* mgr) { plConditionalObject::Write(stream, mgr); - stream->WriteSwap32((UInt32)fKeyEvent); + stream->WriteLE32((UInt32)fKeyEvent); } diff --git a/Sources/Plasma/FeatureLib/pfConditional/plORConditionalObject.cpp b/Sources/Plasma/FeatureLib/pfConditional/plORConditionalObject.cpp index 72813292..79b08bf2 100644 --- a/Sources/Plasma/FeatureLib/pfConditional/plORConditionalObject.cpp +++ b/Sources/Plasma/FeatureLib/pfConditional/plORConditionalObject.cpp @@ -108,7 +108,7 @@ void plORConditionalObject::Read(hsStream* stream, hsResMgr* mgr) plConditionalObject::Read(stream, mgr); plCondRefMsg* refMsg; - int n = stream->ReadSwap32(); + int n = stream->ReadLE32(); fChildren.SetCountAndZero(n); for(int i = 0; i < n; i++ ) { @@ -121,7 +121,7 @@ void plORConditionalObject::Write(hsStream* stream, hsResMgr* mgr) { plConditionalObject::Write(stream, mgr); - stream->WriteSwap32(fChildren.GetCount()); + stream->WriteLE32(fChildren.GetCount()); for( int i = 0; i < fChildren.GetCount(); i++ ) mgr->WriteKey(stream, fChildren[i]); } diff --git a/Sources/Plasma/FeatureLib/pfConditional/plObjectInBoxConditionalObject.cpp b/Sources/Plasma/FeatureLib/pfConditional/plObjectInBoxConditionalObject.cpp index c710bb0a..d5d25b52 100644 --- a/Sources/Plasma/FeatureLib/pfConditional/plObjectInBoxConditionalObject.cpp +++ b/Sources/Plasma/FeatureLib/pfConditional/plObjectInBoxConditionalObject.cpp @@ -282,15 +282,15 @@ hsBool plVolumeSensorConditionalObject::Satisfied() void plVolumeSensorConditionalObject::Read(hsStream* stream, hsResMgr* mgr) { plConditionalObject::Read(stream, mgr); - fTrigNum = stream->ReadSwap32(); - fType = stream->ReadSwap32(); + fTrigNum = stream->ReadLE32(); + fType = stream->ReadLE32(); fFirst = stream->ReadBool(); } void plVolumeSensorConditionalObject::Write(hsStream* stream, hsResMgr* mgr) { plConditionalObject::Write(stream, mgr); - stream->WriteSwap32(fTrigNum); - stream->WriteSwap32(fType); + stream->WriteLE32(fTrigNum); + stream->WriteLE32(fType); stream->WriteBool(fFirst); } #include "pnMessage/plPlayerPageMsg.h" diff --git a/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIButtonMod.cpp b/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIButtonMod.cpp index ca423730..c3aa690b 100644 --- a/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIButtonMod.cpp +++ b/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIButtonMod.cpp @@ -201,18 +201,18 @@ void pfGUIButtonMod::Read( hsStream *s, hsResMgr *mgr ) pfGUIControlMod::Read(s, mgr); fAnimationKeys.Reset(); - UInt32 i, count = s->ReadSwap32(); + UInt32 i, count = s->ReadLE32(); for( i = 0; i < count; i++ ) fAnimationKeys.Append( mgr->ReadKey( s ) ); fAnimName = s->ReadSafeString(); fMouseOverAnimKeys.Reset(); - count = s->ReadSwap32(); + count = s->ReadLE32(); for( i = 0; i < count; i++ ) fMouseOverAnimKeys.Append( mgr->ReadKey( s ) ); fMouseOverAnimName = s->ReadSafeString(); - fNotifyType = s->ReadSwap32(); + fNotifyType = s->ReadLE32(); mgr->ReadKeyNotifyMe( s, TRACKED_NEW plGenRefMsg( GetKey(), plRefMsg::kOnCreate, -1, kRefDraggable ), plRefFlags::kActiveRef ); } @@ -221,18 +221,18 @@ void pfGUIButtonMod::Write( hsStream *s, hsResMgr *mgr ) pfGUIControlMod::Write( s, mgr ); UInt32 i, count = fAnimationKeys.GetCount(); - s->WriteSwap32( count ); + s->WriteLE32( count ); for( i = 0; i < count; i++ ) mgr->WriteKey( s, fAnimationKeys[ i ] ); s->WriteSafeString( fAnimName ); count = fMouseOverAnimKeys.GetCount(); - s->WriteSwap32( count ); + s->WriteLE32( count ); for( i = 0; i < count; i++ ) mgr->WriteKey( s, fMouseOverAnimKeys[ i ] ); s->WriteSafeString( fMouseOverAnimName ); - s->WriteSwap32( fNotifyType ); + s->WriteLE32( fNotifyType ); mgr->WriteKey( s, fDraggable != nil ? fDraggable->GetKey() : nil ); diff --git a/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUICheckBoxCtrl.cpp b/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUICheckBoxCtrl.cpp index fc2137fd..8e814cbf 100644 --- a/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUICheckBoxCtrl.cpp +++ b/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUICheckBoxCtrl.cpp @@ -98,7 +98,7 @@ void pfGUICheckBoxCtrl::Read( hsStream *s, hsResMgr *mgr ) pfGUIControlMod::Read(s, mgr); fAnimationKeys.Reset(); - UInt32 i, count = s->ReadSwap32(); + UInt32 i, count = s->ReadLE32(); for( i = 0; i < count; i++ ) fAnimationKeys.Append( mgr->ReadKey( s ) ); @@ -111,7 +111,7 @@ void pfGUICheckBoxCtrl::Write( hsStream *s, hsResMgr *mgr ) pfGUIControlMod::Write( s, mgr ); UInt32 i, count = fAnimationKeys.GetCount(); - s->WriteSwap32( count ); + s->WriteLE32( count ); for( i = 0; i < count; i++ ) mgr->WriteKey( s, fAnimationKeys[ i ] ); diff --git a/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIControlHandlers.cpp b/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIControlHandlers.cpp index b08085a5..b5b0ea97 100644 --- a/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIControlHandlers.cpp +++ b/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIControlHandlers.cpp @@ -61,18 +61,18 @@ void pfGUICtrlProcWriteableObject::Write( pfGUICtrlProcWriteableObject *obj, { if( obj != nil ) { - s->WriteSwap32( obj->fType ); + s->WriteLE32( obj->fType ); obj->IWrite( s ); } else - s->WriteSwap32( kNull ); + s->WriteLE32( kNull ); } pfGUICtrlProcWriteableObject *pfGUICtrlProcWriteableObject::Read( hsStream *s ) { pfGUICtrlProcWriteableObject *obj; - UInt32 type = s->ReadSwap32(); + UInt32 type = s->ReadLE32(); switch( type ) { @@ -125,7 +125,7 @@ pfGUIConsoleCmdProc::~pfGUIConsoleCmdProc() void pfGUIConsoleCmdProc::IRead( hsStream *s ) { - int i = s->ReadSwap32(); + int i = s->ReadLE32(); if( i > 0 ) { fCommand = TRACKED_NEW char[ i + 1 ]; @@ -140,11 +140,11 @@ void pfGUIConsoleCmdProc::IWrite( hsStream *s ) { if( fCommand != nil ) { - s->WriteSwap32( strlen( fCommand ) ); + s->WriteLE32( strlen( fCommand ) ); s->Write( strlen( fCommand ), fCommand ); } else - s->WriteSwap32( 0 ); + s->WriteLE32( 0 ); } void pfGUIConsoleCmdProc::DoSomething( pfGUIControlMod *ctrl ) diff --git a/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIControlMod.cpp b/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIControlMod.cpp index 40173590..7fc3ebda 100644 --- a/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIControlMod.cpp +++ b/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIControlMod.cpp @@ -127,12 +127,12 @@ void pfGUIColorScheme::Read( hsStream *s ) fBackColor.Read( s ); fSelForeColor.Read( s ); fSelBackColor.Read( s ); - s->ReadSwap( &fTransparent ); + s->ReadLE( &fTransparent ); delete [] fFontFace; fFontFace = s->ReadSafeString(); - s->ReadSwap( &fFontSize ); - s->ReadSwap( &fFontFlags ); + s->ReadLE( &fFontSize ); + s->ReadLE( &fFontFlags ); } void pfGUIColorScheme::Write( hsStream *s ) @@ -141,11 +141,11 @@ void pfGUIColorScheme::Write( hsStream *s ) fBackColor.Write( s ); fSelForeColor.Write( s ); fSelBackColor.Write( s ); - s->WriteSwap( fTransparent ); + s->WriteLE( fTransparent ); s->WriteSafeString( fFontFace ); - s->WriteSwap( fFontSize ); - s->WriteSwap( fFontFlags ); + s->WriteLE( fFontSize ); + s->WriteLE( fFontFlags ); } //// Constructor/Destructor ////////////////////////////////////////////////// @@ -809,7 +809,7 @@ void pfGUIControlMod::Refresh( void ) void pfGUIControlMod::Read( hsStream *s, hsResMgr *mgr ) { plSingleModifier::Read(s, mgr); - s->ReadSwap( &fTagID ); + s->ReadLE( &fTagID ); fVisible = s->ReadBool(); // Read the handler in @@ -842,7 +842,7 @@ void pfGUIControlMod::Read( hsStream *s, hsResMgr *mgr ) { fSoundIndices.SetCountAndZero( count ); for( i = 0; i < count; i++ ) - fSoundIndices[ i ] = (int)s->ReadSwap32(); + fSoundIndices[ i ] = (int)s->ReadLE32(); } if( HasFlag( kHasProxy ) ) @@ -857,7 +857,7 @@ void pfGUIControlMod::Write( hsStream *s, hsResMgr *mgr ) ClearFlag( kHasProxy ); plSingleModifier::Write( s, mgr ); - s->WriteSwap( fTagID ); + s->WriteLE( fTagID ); s->WriteBool( fVisible ); // Write the handler out (if it's not a writeable, damn you) @@ -885,7 +885,7 @@ void pfGUIControlMod::Write( hsStream *s, hsResMgr *mgr ) s->WriteByte( fSoundIndices.GetCount() ); UInt8 i; for( i = 0; i < fSoundIndices.GetCount(); i++ ) - s->WriteSwap32( fSoundIndices[ i ] ); + s->WriteLE32( fSoundIndices[ i ] ); if( HasFlag( kHasProxy ) ) mgr->WriteKey( s, fProxy->GetKey() ); diff --git a/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIDialogMod.cpp b/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIDialogMod.cpp index 9f4b0bf6..7fd2abf8 100644 --- a/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIDialogMod.cpp +++ b/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIDialogMod.cpp @@ -296,7 +296,7 @@ void pfGUIDialogMod::Read( hsStream *s, hsResMgr *mgr ) s->Read( sizeof( fName ), fName ); - UInt32 i, count = s->ReadSwap32(); + UInt32 i, count = s->ReadLE32(); fControls.SetCountAndZero( count ); for( i = 0; i < count; i++ ) mgr->ReadKeyNotifyMe( s, TRACKED_NEW plGenRefMsg( GetKey(), plRefMsg::kOnCreate, i, kControlRef ), plRefFlags::kActiveRef ); @@ -310,13 +310,13 @@ void pfGUIDialogMod::Read( hsStream *s, hsResMgr *mgr ) hsgResMgr::ResMgr()->AddViaNotify( GetKey(), refMsg, plRefFlags::kPassiveRef ); } - s->ReadSwap( &fTagID ); + s->ReadLE( &fTagID ); fProcReceiver = mgr->ReadKey( s ); if( fProcReceiver != nil ) SetHandler( TRACKED_NEW pfGUIDialogNotifyProc( fProcReceiver ) ); - s->ReadSwap( &fVersion ); + s->ReadLE( &fVersion ); fColorScheme->Read( s ); @@ -333,15 +333,15 @@ void pfGUIDialogMod::Write( hsStream *s, hsResMgr *mgr ) mgr->WriteKey( s, fRenderMod->GetKey() ); s->Write( sizeof( fName ), fName ); - s->WriteSwap32( fControls.GetCount() ); + s->WriteLE32( fControls.GetCount() ); for( i = 0; i < fControls.GetCount(); i++ ) mgr->WriteKey( s, fControls[ i ]->GetKey() ); - s->WriteSwap( fTagID ); + s->WriteLE( fTagID ); mgr->WriteKey( s, fProcReceiver ); - s->WriteSwap( fVersion ); + s->WriteLE( fVersion ); fColorScheme->Write( s ); diff --git a/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIDynDisplayCtrl.cpp b/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIDynDisplayCtrl.cpp index 0d01046f..b243ed6e 100644 --- a/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIDynDisplayCtrl.cpp +++ b/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIDynDisplayCtrl.cpp @@ -121,17 +121,17 @@ void pfGUIDynDisplayCtrl::Read( hsStream *s, hsResMgr *mgr ) pfGUIControlMod::Read(s, mgr); - count = s->ReadSwap32(); + count = s->ReadLE32(); fTextMaps.SetCountAndZero( count ); for( i = 0; i < count; i++ ) mgr->ReadKeyNotifyMe( s, TRACKED_NEW plGenRefMsg( GetKey(), plRefMsg::kOnCreate, i, kRefTextMap ), plRefFlags::kActiveRef ); - count = s->ReadSwap32(); + count = s->ReadLE32(); fLayers.SetCountAndZero( count ); for( i = 0; i < count; i++ ) mgr->ReadKeyNotifyMe( s, TRACKED_NEW plGenRefMsg( GetKey(), plRefMsg::kOnCreate, i, kRefLayer ), plRefFlags::kActiveRef ); - count = s->ReadSwap32(); + count = s->ReadLE32(); fMaterials.SetCountAndZero( count ); for( i = 0; i < count; i++ ) mgr->ReadKeyNotifyMe( s, TRACKED_NEW plGenRefMsg( GetKey(), plRefMsg::kOnCreate, i, kRefMaterial ), plRefFlags::kActiveRef ); @@ -144,15 +144,15 @@ void pfGUIDynDisplayCtrl::Write( hsStream *s, hsResMgr *mgr ) pfGUIControlMod::Write( s, mgr ); - s->WriteSwap32( fTextMaps.GetCount() ); + s->WriteLE32( fTextMaps.GetCount() ); for( i = 0; i < fTextMaps.GetCount(); i++ ) mgr->WriteKey( s, fTextMaps[ i ]->GetKey() ); - s->WriteSwap32( fLayers.GetCount() ); + s->WriteLE32( fLayers.GetCount() ); for( i = 0; i < fLayers.GetCount(); i++ ) mgr->WriteKey( s, fLayers[ i ]->GetKey() ); - s->WriteSwap32( fMaterials.GetCount() ); + s->WriteLE32( fMaterials.GetCount() ); for( i = 0; i < fMaterials.GetCount(); i++ ) mgr->WriteKey( s, fMaterials[ i ]->GetKey() ); } diff --git a/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIKnobCtrl.cpp b/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIKnobCtrl.cpp index 27740eb8..def6b884 100644 --- a/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIKnobCtrl.cpp +++ b/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIKnobCtrl.cpp @@ -109,7 +109,7 @@ void pfGUIKnobCtrl::Read( hsStream *s, hsResMgr *mgr ) pfGUIValueCtrl::Read(s, mgr); fAnimationKeys.Reset(); - UInt32 i, count = s->ReadSwap32(); + UInt32 i, count = s->ReadLE32(); for( i = 0; i < count; i++ ) fAnimationKeys.Append( mgr->ReadKey( s ) ); fAnimName = s->ReadSafeString(); @@ -125,7 +125,7 @@ void pfGUIKnobCtrl::Write( hsStream *s, hsResMgr *mgr ) pfGUIValueCtrl::Write( s, mgr ); UInt32 i, count = fAnimationKeys.GetCount(); - s->WriteSwap32( count ); + s->WriteLE32( count ); for( i = 0; i < count; i++ ) mgr->WriteKey( s, fAnimationKeys[ i ] ); s->WriteSafeString( fAnimName ); diff --git a/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIPopUpMenu.cpp b/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIPopUpMenu.cpp index 08670e0b..777066eb 100644 --- a/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIPopUpMenu.cpp +++ b/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIPopUpMenu.cpp @@ -240,9 +240,9 @@ void pfGUIPopUpMenu::Read( hsStream *s, hsResMgr *mgr ) fOriginX = fOriginY = -1.f; - fMargin = s->ReadSwap16(); + fMargin = s->ReadLE16(); - UInt32 i, count = s->ReadSwap32(); + UInt32 i, count = s->ReadLE32(); fMenuItems.SetCountAndZero( count ); for( i = 0; i < count; i++ ) { @@ -271,9 +271,9 @@ void pfGUIPopUpMenu::Write( hsStream *s, hsResMgr *mgr ) pfGUIDialogMod::Write( s, mgr ); - s->WriteSwap16( fMargin ); + s->WriteLE16( fMargin ); - s->WriteSwap32( fMenuItems.GetCount() ); + s->WriteLE32( fMenuItems.GetCount() ); UInt32 i; for( i = 0; i < fMenuItems.GetCount(); i++ ) { @@ -892,11 +892,11 @@ void pfGUISkin::Read( hsStream *s, hsResMgr *mgr ) { hsKeyedObject::Read( s, mgr ); - s->ReadSwap( &fItemMargin ); - s->ReadSwap( &fBorderMargin ); + s->ReadLE( &fItemMargin ); + s->ReadLE( &fBorderMargin ); UInt32 i, count; - s->ReadSwap( &count ); + s->ReadLE( &count ); for( i = 0; i < count; i++ ) fElements[ i ].Read( s ); @@ -911,11 +911,11 @@ void pfGUISkin::Write( hsStream *s, hsResMgr *mgr ) { hsKeyedObject::Write( s, mgr ); - s->WriteSwap( fItemMargin ); - s->WriteSwap( fBorderMargin ); + s->WriteLE( fItemMargin ); + s->WriteLE( fBorderMargin ); UInt32 i = kNumElements; - s->WriteSwap( i ); + s->WriteLE( i ); for( i = 0; i < kNumElements; i++ ) fElements[ i ].Write( s ); @@ -941,16 +941,16 @@ hsBool pfGUISkin::MsgReceive( plMessage *msg ) void pfGUISkin::pfSRect::Read( hsStream *s ) { - s->ReadSwap( &fX ); - s->ReadSwap( &fY ); - s->ReadSwap( &fWidth ); - s->ReadSwap( &fHeight ); + s->ReadLE( &fX ); + s->ReadLE( &fY ); + s->ReadLE( &fWidth ); + s->ReadLE( &fHeight ); } void pfGUISkin::pfSRect::Write( hsStream *s ) { - s->WriteSwap( fX ); - s->WriteSwap( fY ); - s->WriteSwap( fWidth ); - s->WriteSwap( fHeight ); + s->WriteLE( fX ); + s->WriteLE( fY ); + s->WriteLE( fWidth ); + s->WriteLE( fHeight ); } diff --git a/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIProgressCtrl.cpp b/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIProgressCtrl.cpp index 16d0b760..a8d3982c 100644 --- a/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIProgressCtrl.cpp +++ b/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIProgressCtrl.cpp @@ -111,7 +111,7 @@ void pfGUIProgressCtrl::Read( hsStream *s, hsResMgr *mgr ) pfGUIValueCtrl::Read(s, mgr); fAnimationKeys.Reset(); - UInt32 i, count = s->ReadSwap32(); + UInt32 i, count = s->ReadLE32(); for( i = 0; i < count; i++ ) fAnimationKeys.Append( mgr->ReadKey( s ) ); fAnimName = s->ReadSafeString(); @@ -124,7 +124,7 @@ void pfGUIProgressCtrl::Write( hsStream *s, hsResMgr *mgr ) pfGUIValueCtrl::Write( s, mgr ); UInt32 i, count = fAnimationKeys.GetCount(); - s->WriteSwap32( count ); + s->WriteLE32( count ); for( i = 0; i < count; i++ ) mgr->WriteKey( s, fAnimationKeys[ i ] ); s->WriteSafeString( fAnimName ); diff --git a/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIRadioGroupCtrl.cpp b/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIRadioGroupCtrl.cpp index 11101365..d343f6d2 100644 --- a/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIRadioGroupCtrl.cpp +++ b/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIRadioGroupCtrl.cpp @@ -175,7 +175,7 @@ void pfGUIRadioGroupCtrl::Read( hsStream *s, hsResMgr *mgr ) { pfGUIControlMod::Read(s, mgr); - UInt32 i, count = s->ReadSwap32(); + UInt32 i, count = s->ReadLE32(); fControls.SetCountAndZero( count ); for( i = 0; i < count; i++ ) @@ -183,7 +183,7 @@ void pfGUIRadioGroupCtrl::Read( hsStream *s, hsResMgr *mgr ) mgr->ReadKeyNotifyMe( s, TRACKED_NEW plGenRefMsg( GetKey(), plRefMsg::kOnCreate, i, kRefControl ), plRefFlags::kActiveRef ); } - fValue = fDefaultValue = s->ReadSwap16(); + fValue = fDefaultValue = s->ReadLE16(); if( fValue != -1 && fControls[ fValue ] != nil ) fControls[ fValue ]->SetChecked( true ); } @@ -195,11 +195,11 @@ void pfGUIRadioGroupCtrl::Write( hsStream *s, hsResMgr *mgr ) pfGUIControlMod::Write( s, mgr ); - s->WriteSwap32( fControls.GetCount() ); + s->WriteLE32( fControls.GetCount() ); for( i = 0; i < fControls.GetCount(); i++ ) mgr->WriteKey( s, fControls[ i ]->GetKey() ); - s->WriteSwap16( (UInt16)fDefaultValue ); + s->WriteLE16( (UInt16)fDefaultValue ); } //// SetValue //////////////////////////////////////////////////////////////// diff --git a/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUITextBoxMod.cpp b/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUITextBoxMod.cpp index d6d8fde3..c6992ed2 100644 --- a/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUITextBoxMod.cpp +++ b/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUITextBoxMod.cpp @@ -154,7 +154,7 @@ void pfGUITextBoxMod::Read( hsStream *s, hsResMgr *mgr ) { pfGUIControlMod::Read(s, mgr); - UInt32 len = s->ReadSwap32(); + UInt32 len = s->ReadLE32(); if( len > 0 ) { char *text = TRACKED_NEW char[ len + 1 ]; @@ -181,11 +181,11 @@ void pfGUITextBoxMod::Write( hsStream *s, hsResMgr *mgr ) pfGUIControlMod::Write( s, mgr ); if( fText == nil ) - s->WriteSwap32( 0 ); + s->WriteLE32( 0 ); else { char *text = hsWStringToString(fText); - s->WriteSwap32( strlen( text ) ); + s->WriteLE32( strlen( text ) ); s->Write( strlen( text ), text ); delete [] text; } diff --git a/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIUpDownPairMod.cpp b/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIUpDownPairMod.cpp index 0cc94ad7..9d2e07b2 100644 --- a/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIUpDownPairMod.cpp +++ b/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIUpDownPairMod.cpp @@ -208,9 +208,9 @@ void pfGUIUpDownPairMod::Read( hsStream *s, hsResMgr *mgr ) mgr->ReadKeyNotifyMe( s, TRACKED_NEW plGenRefMsg( GetKey(), plRefMsg::kOnCreate, -1, kRefUpControl ), plRefFlags::kActiveRef ); mgr->ReadKeyNotifyMe( s, TRACKED_NEW plGenRefMsg( GetKey(), plRefMsg::kOnCreate, -1, kRefDownControl ), plRefFlags::kActiveRef ); - s->ReadSwap( &fMin ); - s->ReadSwap( &fMax ); - s->ReadSwap( &fStep ); + s->ReadLE( &fMin ); + s->ReadLE( &fMax ); + s->ReadLE( &fStep ); fValue = fMin; } @@ -222,9 +222,9 @@ void pfGUIUpDownPairMod::Write( hsStream *s, hsResMgr *mgr ) mgr->WriteKey( s, fUpControl->GetKey() ); mgr->WriteKey( s, fDownControl->GetKey() ); - s->WriteSwap( fMin ); - s->WriteSwap( fMax ); - s->WriteSwap( fStep ); + s->WriteLE( fMin ); + s->WriteLE( fMax ); + s->WriteLE( fStep ); } diff --git a/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIValueCtrl.cpp b/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIValueCtrl.cpp index 2956fd27..186ba4b7 100644 --- a/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIValueCtrl.cpp +++ b/Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIValueCtrl.cpp @@ -93,9 +93,9 @@ void pfGUIValueCtrl::Read( hsStream *s, hsResMgr *mgr ) { pfGUIControlMod::Read(s, mgr); - s->ReadSwap( &fMin ); - s->ReadSwap( &fMax ); - s->ReadSwap( &fStep ); + s->ReadLE( &fMin ); + s->ReadLE( &fMax ); + s->ReadLE( &fStep ); fValue = fMin; } @@ -104,8 +104,8 @@ void pfGUIValueCtrl::Write( hsStream *s, hsResMgr *mgr ) { pfGUIControlMod::Write( s, mgr ); - s->WriteSwap( fMin ); - s->WriteSwap( fMax ); - s->WriteSwap( fStep ); + s->WriteLE( fMin ); + s->WriteLE( fMax ); + s->WriteLE( fStep ); } diff --git a/Sources/Plasma/FeatureLib/pfMessage/pfGUINotifyMsg.h b/Sources/Plasma/FeatureLib/pfMessage/pfGUINotifyMsg.h index b23b7f6c..826b4372 100644 --- a/Sources/Plasma/FeatureLib/pfMessage/pfGUINotifyMsg.h +++ b/Sources/Plasma/FeatureLib/pfMessage/pfGUINotifyMsg.h @@ -126,14 +126,14 @@ public: { plMessage::IMsgRead(stream, mgr); fControlKey = mgr->ReadKey(stream); - fEvent = stream->ReadSwap32(); + fEvent = stream->ReadLE32(); } void Write(hsStream* stream, hsResMgr* mgr) { plMessage::IMsgWrite(stream, mgr); mgr->WriteKey(stream, fControlKey); - stream->WriteSwap32(fEvent); + stream->WriteLE32(fEvent); } }; diff --git a/Sources/Plasma/FeatureLib/pfMessage/pfGameGUIMsg.h b/Sources/Plasma/FeatureLib/pfMessage/pfGameGUIMsg.h index 0e9a4fba..9b6c8edf 100644 --- a/Sources/Plasma/FeatureLib/pfMessage/pfGameGUIMsg.h +++ b/Sources/Plasma/FeatureLib/pfMessage/pfGameGUIMsg.h @@ -78,7 +78,7 @@ class pfGameGUIMsg : public plMessage virtual void Read(hsStream* s, hsResMgr* mgr) { plMessage::IMsgRead( s, mgr ); - s->ReadSwap( &fCommand ); + s->ReadLE( &fCommand ); s->Read( sizeof( fString ), fString ); fAge = s->ReadSafeString(); } @@ -86,7 +86,7 @@ class pfGameGUIMsg : public plMessage virtual void Write(hsStream* s, hsResMgr* mgr) { plMessage::IMsgWrite( s, mgr ); - s->WriteSwap( fCommand ); + s->WriteLE( fCommand ); s->Write( sizeof( fString ), fString ); s->WriteSafeString( fAge ); } diff --git a/Sources/Plasma/FeatureLib/pfMessage/pfKIMsg.h b/Sources/Plasma/FeatureLib/pfMessage/pfKIMsg.h index b0b6cf13..737c1e53 100644 --- a/Sources/Plasma/FeatureLib/pfMessage/pfKIMsg.h +++ b/Sources/Plasma/FeatureLib/pfMessage/pfKIMsg.h @@ -189,9 +189,9 @@ class pfKIMsg : public plMessage virtual void Read(hsStream* s, hsResMgr* mgr) { plMessage::IMsgRead( s, mgr ); - s->ReadSwap( &fCommand ); + s->ReadLE( &fCommand ); fUser = s->ReadSafeString(); - fPlayerID = s->ReadSwap32(); + fPlayerID = s->ReadLE32(); wchar_t *temp = s->ReadSafeWString(); if (temp) // apparently ReadSafeWString can return null, which std::wstring doesn't like being assigned @@ -200,21 +200,21 @@ class pfKIMsg : public plMessage fString = L""; delete [] temp; - fFlags = s->ReadSwap32(); - fDelay = s->ReadSwapScalar(); - fValue = s->ReadSwap32(); + fFlags = s->ReadLE32(); + fDelay = s->ReadLEScalar(); + fValue = s->ReadLE32(); } virtual void Write(hsStream* s, hsResMgr* mgr) { plMessage::IMsgWrite( s, mgr ); - s->WriteSwap( fCommand ); + s->WriteLE( fCommand ); s->WriteSafeString( fUser ); - s->WriteSwap32( fPlayerID ); + s->WriteLE32( fPlayerID ); s->WriteSafeWString( fString.c_str() ); - s->WriteSwap32( fFlags ); - s->WriteSwapScalar(fDelay); - s->WriteSwap32( fValue ); + s->WriteLE32( fFlags ); + s->WriteLEScalar(fDelay); + s->WriteLE32( fValue ); } UInt8 GetCommand( void ) const { return fCommand; } diff --git a/Sources/Plasma/FeatureLib/pfMessage/pfMarkerMsg.cpp b/Sources/Plasma/FeatureLib/pfMessage/pfMarkerMsg.cpp index 1496b074..729a8795 100644 --- a/Sources/Plasma/FeatureLib/pfMessage/pfMarkerMsg.cpp +++ b/Sources/Plasma/FeatureLib/pfMessage/pfMarkerMsg.cpp @@ -62,7 +62,7 @@ void pfMarkerMsg::Read(hsStream* stream, hsResMgr* mgr) fType = (Type)stream->ReadByte(); if (fType == kMarkerCaptured) - fMarkerID = stream->ReadSwap32(); + fMarkerID = stream->ReadLE32(); } void pfMarkerMsg::Write(hsStream* stream, hsResMgr* mgr) @@ -72,7 +72,7 @@ void pfMarkerMsg::Write(hsStream* stream, hsResMgr* mgr) stream->WriteByte(fType); if (fType == kMarkerCaptured) - stream->WriteSwap32(fMarkerID); + stream->WriteLE32(fMarkerID); } void pfMarkerMsg::PrintDebug(char* buf) diff --git a/Sources/Plasma/FeatureLib/pfMessage/plClothingMsg.cpp b/Sources/Plasma/FeatureLib/pfMessage/plClothingMsg.cpp index 6ce9ea50..119db720 100644 --- a/Sources/Plasma/FeatureLib/pfMessage/plClothingMsg.cpp +++ b/Sources/Plasma/FeatureLib/pfMessage/plClothingMsg.cpp @@ -47,27 +47,27 @@ void plClothingMsg::Read(hsStream* stream, hsResMgr* mgr) { plMessage::IMsgRead(stream, mgr); - fCommands = stream->ReadSwap32(); + fCommands = stream->ReadLE32(); if (stream->ReadBool()) fItemKey = mgr->ReadKey(stream); fColor.Read(stream); fLayer = stream->ReadByte(); fDelta = stream->ReadByte(); - fWeight = stream->ReadSwapScalar(); + fWeight = stream->ReadLEScalar(); } void plClothingMsg::Write(hsStream* stream, hsResMgr* mgr) { plMessage::IMsgWrite(stream, mgr); - stream->WriteSwap32(fCommands); + stream->WriteLE32(fCommands); stream->WriteBool(fItemKey != nil); if (fItemKey) mgr->WriteKey(stream, fItemKey); fColor.Write(stream); stream->WriteByte(fLayer); stream->WriteByte(fDelta); - stream->WriteSwapScalar(fWeight); + stream->WriteLEScalar(fWeight); } enum ClothingFlags @@ -85,7 +85,7 @@ void plClothingMsg::ReadVersion(hsStream* s, hsResMgr* mgr) contentFlags.Read(s); if (contentFlags.IsBitSet(kClothingCommands)) - fCommands = s->ReadSwap32(); + fCommands = s->ReadLE32(); if (contentFlags.IsBitSet(kClothingItemKey)) { if (s->ReadBool()) @@ -106,7 +106,7 @@ void plClothingMsg::WriteVersion(hsStream* s, hsResMgr* mgr) contentFlags.Write(s); // kClothingCommands - s->WriteSwap32(fCommands); + s->WriteLE32(fCommands); // kClothingItemKey s->WriteBool(fItemKey != nil); if (fItemKey) diff --git a/Sources/Plasma/FeatureLib/pfPython/cyMisc.cpp b/Sources/Plasma/FeatureLib/pfPython/cyMisc.cpp index c5a24255..b5a57150 100644 --- a/Sources/Plasma/FeatureLib/pfPython/cyMisc.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/cyMisc.cpp @@ -2301,10 +2301,10 @@ public: if ( ageInfoStream && nPlayersStream ) { UInt16 nAgeInfoEntries; - ageInfoStream->GetStream()->ReadSwap( &nAgeInfoEntries ); + ageInfoStream->GetStream()->ReadLE( &nAgeInfoEntries ); UInt16 nPlayerCountEntries; - nPlayersStream->GetStream()->ReadSwap( &nPlayerCountEntries ); + nPlayersStream->GetStream()->ReadLE( &nPlayerCountEntries ); hsAssert( nAgeInfoEntries==nPlayerCountEntries, "huh?" ); @@ -2316,7 +2316,7 @@ public: plAgeInfoStruct ageInfo; UInt32 nPlayers; ageInfo.Read( ageInfoStream->GetStream(), nil ); - nPlayersStream->GetStream()->ReadSwap( &nPlayers ); + nPlayersStream->GetStream()->ReadLE( &nPlayers ); PyObject* t = PyTuple_New(2); PyTuple_SetItem(t, 0, pyAgeInfoStruct::New(&ageInfo)); PyTuple_SetItem(t, 1, PyLong_FromUnsignedLong(nPlayers)); diff --git a/Sources/Plasma/FeatureLib/pfPython/plPythonFileMod.cpp b/Sources/Plasma/FeatureLib/pfPython/plPythonFileMod.cpp index 47af503d..29c3304c 100644 --- a/Sources/Plasma/FeatureLib/pfPython/plPythonFileMod.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/plPythonFileMod.cpp @@ -2942,7 +2942,7 @@ void plPythonFileMod::Read(hsStream* stream, hsResMgr* mgr) fPythonFile = stream->ReadSafeString(); // then read in the list of receivers that want to be notified - int nRcvs = stream->ReadSwap32(); + int nRcvs = stream->ReadLE32(); fReceivers.Reset(); int m; for( m=0; mReadSwap32(); + int nParms = stream->ReadLE32(); fParameters.SetCountAndZero(nParms); int i; for( i=0; iWriteSafeString(fPythonFile); // then write out the list of receivers that want to be notified - stream->WriteSwap32(fReceivers.GetCount()); + stream->WriteLE32(fReceivers.GetCount()); int m; for( m=0; mWriteKey(stream, fReceivers[m]); // then write out the list of parameters - stream->WriteSwap32(fParameters.GetCount()); + stream->WriteLE32(fParameters.GetCount()); int i; for( i=0; iReadSwap32(); + int numFiles = fPackStream->ReadLE32(); UInt32 streamIndex = (UInt32)(fPackStreams.size()); for (int i = 0; i < numFiles; i++) { @@ -152,7 +152,7 @@ bool plPythonPack::Open() char* buf = fPackStream->ReadSafeString(); std::string pythonName = buf; // reading a "string" from a hsStream directly into a stl string causes memory loss delete [] buf; - UInt32 offset = fPackStream->ReadSwap32(); + UInt32 offset = fPackStream->ReadLE32(); plPackOffsetInfo offsetInfo; offsetInfo.fOffset = offset; @@ -209,7 +209,7 @@ PyObject* plPythonPack::OpenPacked(const char* fileName) fPackStream->SetPosition(offsetInfo.fOffset); - Int32 size = fPackStream->ReadSwap32(); + Int32 size = fPackStream->ReadLE32(); if (size > 0) { char *buf = TRACKED_NEW char[size]; diff --git a/Sources/Plasma/FeatureLib/pfPython/plPythonParameter.h b/Sources/Plasma/FeatureLib/pfPython/plPythonParameter.h index 5cc7e6ce..bd30f9b6 100644 --- a/Sources/Plasma/FeatureLib/pfPython/plPythonParameter.h +++ b/Sources/Plasma/FeatureLib/pfPython/plPythonParameter.h @@ -356,32 +356,32 @@ public: { SetToNone(); - fID = stream->ReadSwap32(); - fValueType = stream->ReadSwap32(); + fID = stream->ReadLE32(); + fValueType = stream->ReadLE32(); // read the different types of data int count; switch ( fValueType ) { case kInt: - datarecord.fIntNumber = stream->ReadSwap32(); + datarecord.fIntNumber = stream->ReadLE32(); break; case kFloat: - stream->ReadSwap(&datarecord.fFloatNumber); + stream->ReadLE(&datarecord.fFloatNumber); break; case kBoolean: - datarecord.fBool = stream->ReadSwap32(); + datarecord.fBool = stream->ReadLE32(); break; case kString: case kAnimationName: - count = stream->ReadSwap32(); + count = stream->ReadLE32(); if ( count != 0 ) { datarecord.fString = TRACKED_NEW char[count+1]; - stream->ReadSwap(count,datarecord.fString); + stream->ReadLE(count,datarecord.fString); } else datarecord.fString = nil; @@ -412,20 +412,20 @@ public: void Write(hsStream * stream, hsResMgr* mgr) { int count; - stream->WriteSwap32(fID); - stream->WriteSwap32(fValueType); + stream->WriteLE32(fID); + stream->WriteLE32(fValueType); switch ( fValueType ) { case kInt: - stream->WriteSwap32(datarecord.fIntNumber); + stream->WriteLE32(datarecord.fIntNumber); break; case kFloat: - stream->WriteSwap(datarecord.fFloatNumber); + stream->WriteLE(datarecord.fFloatNumber); break; case kBoolean: - stream->WriteSwap32(datarecord.fBool); + stream->WriteLE32(datarecord.fBool); break; case kString: @@ -434,9 +434,9 @@ public: count = hsStrlen(datarecord.fString)+1; else count = 0; - stream->WriteSwap(count); + stream->WriteLE(count); if ( count != 0 ) - stream->WriteSwap(count,datarecord.fString); + stream->WriteLE(count,datarecord.fString); break; case kSceneObject: diff --git a/Sources/Plasma/FeatureLib/pfSurface/plDistOpacityMod.cpp b/Sources/Plasma/FeatureLib/pfSurface/plDistOpacityMod.cpp index f4b9e6fb..3dd4bb7c 100644 --- a/Sources/Plasma/FeatureLib/pfSurface/plDistOpacityMod.cpp +++ b/Sources/Plasma/FeatureLib/pfSurface/plDistOpacityMod.cpp @@ -186,7 +186,7 @@ void plDistOpacityMod::Read(hsStream* s, hsResMgr* mgr) int i; for( i = 0; i < kNumDists; i++ ) - fDists[i] = s->ReadSwapScalar(); + fDists[i] = s->ReadLEScalar(); ICheckDists(); @@ -199,7 +199,7 @@ void plDistOpacityMod::Write(hsStream* s, hsResMgr* mgr) int i; for( i = 0; i < kNumDists; i++ ) - s->WriteSwapScalar(fDists[i]); + s->WriteLEScalar(fDists[i]); } void plDistOpacityMod::SetTarget(plSceneObject* so) diff --git a/Sources/Plasma/FeatureLib/pfSurface/plFadeOpacityLay.cpp b/Sources/Plasma/FeatureLib/pfSurface/plFadeOpacityLay.cpp index 1eec092b..aefb4f77 100644 --- a/Sources/Plasma/FeatureLib/pfSurface/plFadeOpacityLay.cpp +++ b/Sources/Plasma/FeatureLib/pfSurface/plFadeOpacityLay.cpp @@ -78,13 +78,13 @@ void plFadeOpacityLay::Read(hsStream* s, hsResMgr* mgr) { plLayerInterface::Read(s, mgr); - fOpScale = s->ReadSwapScalar(); + fOpScale = s->ReadLEScalar(); } void plFadeOpacityLay::Write(hsStream* s, hsResMgr* mgr) { plLayerInterface::Write(s, mgr); - s->WriteSwapScalar(fOpScale); + s->WriteLEScalar(fOpScale); } diff --git a/Sources/Plasma/FeatureLib/pfSurface/plFadeOpacityMod.cpp b/Sources/Plasma/FeatureLib/pfSurface/plFadeOpacityMod.cpp index aed1583a..306299ad 100644 --- a/Sources/Plasma/FeatureLib/pfSurface/plFadeOpacityMod.cpp +++ b/Sources/Plasma/FeatureLib/pfSurface/plFadeOpacityMod.cpp @@ -126,16 +126,16 @@ void plFadeOpacityMod::Read(hsStream* s, hsResMgr* mgr) { plSingleModifier::Read(s, mgr); - fFadeUp = s->ReadSwapScalar(); - fFadeDown = s->ReadSwapScalar(); + fFadeUp = s->ReadLEScalar(); + fFadeDown = s->ReadLEScalar(); } void plFadeOpacityMod::Write(hsStream* s, hsResMgr* mgr) { plSingleModifier::Write(s, mgr); - s->WriteSwapScalar(fFadeUp); - s->WriteSwapScalar(fFadeDown); + s->WriteLEScalar(fFadeUp); + s->WriteLEScalar(fFadeDown); } void plFadeOpacityMod::SetTarget(plSceneObject* so) diff --git a/Sources/Plasma/FeatureLib/pfSurface/plLayerMovie.cpp b/Sources/Plasma/FeatureLib/pfSurface/plLayerMovie.cpp index 3c7d1934..05af21f2 100644 --- a/Sources/Plasma/FeatureLib/pfSurface/plLayerMovie.cpp +++ b/Sources/Plasma/FeatureLib/pfSurface/plLayerMovie.cpp @@ -185,7 +185,7 @@ void plLayerMovie::Read(hsStream* s, hsResMgr* mgr) plLayerAnimation::Read(s, mgr); delete [] fMovieName; - int len = s->ReadSwap32(); + int len = s->ReadLE32(); if( len ) { fMovieName = TRACKED_NEW char[len+1]; @@ -204,7 +204,7 @@ void plLayerMovie::Write(hsStream* s, hsResMgr* mgr) plLayerAnimation::Write(s, mgr); int len = hsStrlen(fMovieName); - s->WriteSwap32(len); + s->WriteLE32(len); if( len ) s->Write(len, fMovieName); } diff --git a/Sources/Plasma/NucleusLib/inc/hsGMatState.inl b/Sources/Plasma/NucleusLib/inc/hsGMatState.inl index 520998ce..0eb9ab26 100644 --- a/Sources/Plasma/NucleusLib/inc/hsGMatState.inl +++ b/Sources/Plasma/NucleusLib/inc/hsGMatState.inl @@ -7,20 +7,20 @@ void hsGMatState::Read(hsStream* s) { - fBlendFlags = s->ReadSwap32(); - fClampFlags = s->ReadSwap32(); - fShadeFlags = s->ReadSwap32(); - fZFlags = s->ReadSwap32(); - fMiscFlags = s->ReadSwap32(); + fBlendFlags = s->ReadLE32(); + fClampFlags = s->ReadLE32(); + fShadeFlags = s->ReadLE32(); + fZFlags = s->ReadLE32(); + fMiscFlags = s->ReadLE32(); } void hsGMatState::Write(hsStream* s) { - s->WriteSwap32(fBlendFlags); - s->WriteSwap32(fClampFlags); - s->WriteSwap32(fShadeFlags); - s->WriteSwap32(fZFlags); - s->WriteSwap32(fMiscFlags); + s->WriteLE32(fBlendFlags); + s->WriteLE32(fClampFlags); + s->WriteLE32(fShadeFlags); + s->WriteLE32(fZFlags); + s->WriteLE32(fMiscFlags); } void hsGMatState::Clear(const hsGMatState& state) diff --git a/Sources/Plasma/NucleusLib/pnKeyedObject/plKeyImp.cpp b/Sources/Plasma/NucleusLib/pnKeyedObject/plKeyImp.cpp index 157b77b0..40b0bf14 100644 --- a/Sources/Plasma/NucleusLib/pnKeyedObject/plKeyImp.cpp +++ b/Sources/Plasma/NucleusLib/pnKeyedObject/plKeyImp.cpp @@ -189,8 +189,8 @@ hsKeyedObject* plKeyImp::VerifyLoaded() void plKeyImp::Read(hsStream* s) { fUoid.Read(s); - s->ReadSwap(&fStartPos); - s->ReadSwap(&fDataLen); + s->ReadLE(&fStartPos); + s->ReadLE(&fDataLen); plProfile_NewMem(KeyMem, CalcKeySize(this)); @@ -204,15 +204,15 @@ void plKeyImp::SkipRead(hsStream* s) { plUoid tempUoid; tempUoid.Read(s); - s->ReadSwap32(); - s->ReadSwap32(); + s->ReadLE32(); + s->ReadLE32(); } void plKeyImp::Write(hsStream* s) { fUoid.Write(s); - s->WriteSwap(fStartPos); - s->WriteSwap(fDataLen); + s->WriteLE(fStartPos); + s->WriteLE(fDataLen); if (fStartPos == (UInt32)-1) int foo = 0; } diff --git a/Sources/Plasma/NucleusLib/pnKeyedObject/plMsgForwarder.cpp b/Sources/Plasma/NucleusLib/pnKeyedObject/plMsgForwarder.cpp index b91f3f15..089fdd2c 100644 --- a/Sources/Plasma/NucleusLib/pnKeyedObject/plMsgForwarder.cpp +++ b/Sources/Plasma/NucleusLib/pnKeyedObject/plMsgForwarder.cpp @@ -75,7 +75,7 @@ void plMsgForwarder::Read(hsStream* s, hsResMgr* mgr) { hsKeyedObject::Read(s, mgr); - int numKeys = s->ReadSwap32(); + int numKeys = s->ReadLE32(); fForwardKeys.Reset(); fForwardKeys.Expand(numKeys); fForwardKeys.SetCount(numKeys); @@ -91,7 +91,7 @@ void plMsgForwarder::Write(hsStream* s, hsResMgr* mgr) hsKeyedObject::Write(s, mgr); int numKeys = fForwardKeys.Count(); - s->WriteSwap32(numKeys); + s->WriteLE32(numKeys); for (int i = 0; i < numKeys; i++) mgr->WriteKey(s, fForwardKeys[i]); } diff --git a/Sources/Plasma/NucleusLib/pnKeyedObject/plUoid.cpp b/Sources/Plasma/NucleusLib/pnKeyedObject/plUoid.cpp index 22505834..d8494838 100644 --- a/Sources/Plasma/NucleusLib/pnKeyedObject/plUoid.cpp +++ b/Sources/Plasma/NucleusLib/pnKeyedObject/plUoid.cpp @@ -59,14 +59,14 @@ plLocation::plLocation(const plLocation& toCopyFrom) void plLocation::Read(hsStream* s) { - s->LogReadSwap(&fSequenceNumber, "Location Sequence Number"); - s->LogReadSwap(&fFlags, "Location Flags"); + s->LogReadLE(&fSequenceNumber, "Location Sequence Number"); + s->LogReadLE(&fFlags, "Location Flags"); } void plLocation::Write(hsStream* s) const { - s->WriteSwap(fSequenceNumber); - s->WriteSwap(fFlags); + s->WriteLE(fSequenceNumber); + s->WriteLE(fFlags); } plLocation& plLocation::operator=(const plLocation& rhs) @@ -175,18 +175,18 @@ void plUoid::Read(hsStream* s) else fLoadMask.SetAlways(); - s->LogReadSwap(&fClassType, "ClassType"); - s->LogReadSwap(&fObjectID, "ObjectID"); + s->LogReadLE(&fClassType, "ClassType"); + s->LogReadLE(&fObjectID, "ObjectID"); s->LogSubStreamPushDesc("ObjectName"); fObjectName = s->LogReadSafeString(); // conditional cloneIDs read if (contents & kHasCloneIDs) { - s->LogReadSwap( &fCloneID ,"CloneID"); + s->LogReadLE( &fCloneID ,"CloneID"); UInt16 dummy; - s->LogReadSwap(&dummy, "dummy"); // To avoid breaking format - s->LogReadSwap( &fClonePlayerID ,"ClonePlayerID"); + s->LogReadLE(&dummy, "dummy"); // To avoid breaking format + s->LogReadLE( &fClonePlayerID ,"ClonePlayerID"); } else { @@ -209,17 +209,17 @@ void plUoid::Write(hsStream* s) const if (contents & kHasLoadMask) fLoadMask.Write(s); - s->WriteSwap( fClassType ); - s->WriteSwap( fObjectID ); + s->WriteLE( fClassType ); + s->WriteLE( fObjectID ); s->WriteSafeString( fObjectName ); // conditional cloneIDs write if (contents & kHasCloneIDs) { - s->WriteSwap(fCloneID); + s->WriteLE(fCloneID); UInt16 dummy = 0; - s->WriteSwap(dummy); // to avoid breaking format - s->WriteSwap(fClonePlayerID); + s->WriteLE(dummy); // to avoid breaking format + s->WriteLE(fClonePlayerID); } } diff --git a/Sources/Plasma/NucleusLib/pnMessage/plAudioSysMsg.h b/Sources/Plasma/NucleusLib/pnMessage/plAudioSysMsg.h index a3e7c6fb..47a26189 100644 --- a/Sources/Plasma/NucleusLib/pnMessage/plAudioSysMsg.h +++ b/Sources/Plasma/NucleusLib/pnMessage/plAudioSysMsg.h @@ -94,14 +94,14 @@ public: void Read(hsStream* stream, hsResMgr* mgr) { plMessage::IMsgRead(stream, mgr); - stream->WriteSwap(fAudFlag); + stream->WriteLE(fAudFlag); mgr->WriteKey(stream, pObj); } void Write(hsStream* stream, hsResMgr* mgr) { plMessage::IMsgWrite(stream, mgr); - stream->ReadSwap(&fAudFlag); + stream->ReadLE(&fAudFlag); pObj = mgr->ReadKey(stream); } }; diff --git a/Sources/Plasma/NucleusLib/pnMessage/plCameraMsg.cpp b/Sources/Plasma/NucleusLib/pnMessage/plCameraMsg.cpp index dbed771f..5d091bd6 100644 --- a/Sources/Plasma/NucleusLib/pnMessage/plCameraMsg.cpp +++ b/Sources/Plasma/NucleusLib/pnMessage/plCameraMsg.cpp @@ -81,7 +81,7 @@ void plCameraMsg::Read(hsStream* stream, hsResMgr* mgr) { plMessage::IMsgRead(stream, mgr); fCmd.Read(stream); - fTransTime = stream->ReadSwapDouble(); + fTransTime = stream->ReadLEDouble(); fActivated = stream->ReadBool(); fNewCam = mgr->ReadKey(stream); fTriggerer = mgr->ReadKey(stream); @@ -92,7 +92,7 @@ void plCameraMsg::Write(hsStream* stream, hsResMgr* mgr) { plMessage::IMsgWrite(stream, mgr); fCmd.Write(stream); - stream->WriteSwapDouble(fTransTime); + stream->WriteLEDouble(fTransTime); stream->WriteBool(fActivated); mgr->WriteKey(stream, fNewCam); mgr->WriteKey(stream, fTriggerer); @@ -101,33 +101,33 @@ void plCameraMsg::Write(hsStream* stream, hsResMgr* mgr) void plCameraConfig::Read(hsStream* stream) { - fAccel = stream->ReadSwapFloat(); - fDecel = stream->ReadSwapFloat(); - fVel = stream->ReadSwapFloat(); - fFPAccel = stream->ReadSwapFloat(); - fFPDecel = stream->ReadSwapFloat(); - fFPVel = stream->ReadSwapFloat(); - fFOVw = stream->ReadSwapFloat(); - fFOVh = stream->ReadSwapFloat(); - fOffset.fX = stream->ReadSwapFloat(); - fOffset.fY = stream->ReadSwapFloat(); - fOffset.fZ = stream->ReadSwapFloat(); + fAccel = stream->ReadLEFloat(); + fDecel = stream->ReadLEFloat(); + fVel = stream->ReadLEFloat(); + fFPAccel = stream->ReadLEFloat(); + fFPDecel = stream->ReadLEFloat(); + fFPVel = stream->ReadLEFloat(); + fFOVw = stream->ReadLEFloat(); + fFOVh = stream->ReadLEFloat(); + fOffset.fX = stream->ReadLEFloat(); + fOffset.fY = stream->ReadLEFloat(); + fOffset.fZ = stream->ReadLEFloat(); fWorldspace = stream->ReadBool(); } void plCameraConfig::Write(hsStream* stream) { - stream->WriteSwapFloat(fAccel); - stream->WriteSwapFloat(fDecel); - stream->WriteSwapFloat(fVel); - stream->WriteSwapFloat(fFPAccel); - stream->WriteSwapFloat(fFPDecel); - stream->WriteSwapFloat(fFPVel); - stream->WriteSwapFloat(fFOVw); - stream->WriteSwapFloat(fFOVh); - stream->WriteSwapFloat(fOffset.fX); - stream->WriteSwapFloat(fOffset.fY); - stream->WriteSwapFloat(fOffset.fZ); + stream->WriteLEFloat(fAccel); + stream->WriteLEFloat(fDecel); + stream->WriteLEFloat(fVel); + stream->WriteLEFloat(fFPAccel); + stream->WriteLEFloat(fFPDecel); + stream->WriteLEFloat(fFPVel); + stream->WriteLEFloat(fFOVw); + stream->WriteLEFloat(fFOVh); + stream->WriteLEFloat(fOffset.fX); + stream->WriteLEFloat(fOffset.fY); + stream->WriteLEFloat(fOffset.fZ); stream->WriteBool(fWorldspace); } diff --git a/Sources/Plasma/NucleusLib/pnMessage/plClientMsg.h b/Sources/Plasma/NucleusLib/pnMessage/plClientMsg.h index e9a243f9..c0acc4ac 100644 --- a/Sources/Plasma/NucleusLib/pnMessage/plClientMsg.h +++ b/Sources/Plasma/NucleusLib/pnMessage/plClientMsg.h @@ -153,15 +153,15 @@ public: void Read(hsStream* stream, hsResMgr* mgr) { plRefMsg::Read(stream, mgr); - stream->ReadSwap(&fType); - stream->ReadSwap(&fWhich); + stream->ReadLE(&fType); + stream->ReadLE(&fWhich); } void Write(hsStream* stream, hsResMgr* mgr) { plRefMsg::Write(stream, mgr); - stream->WriteSwap(fType); - stream->WriteSwap(fWhich); + stream->WriteLE(fType); + stream->WriteLE(fWhich); } }; diff --git a/Sources/Plasma/NucleusLib/pnMessage/plCursorChangeMsg.h b/Sources/Plasma/NucleusLib/pnMessage/plCursorChangeMsg.h index ef475de3..9075aa31 100644 --- a/Sources/Plasma/NucleusLib/pnMessage/plCursorChangeMsg.h +++ b/Sources/Plasma/NucleusLib/pnMessage/plCursorChangeMsg.h @@ -91,15 +91,15 @@ public: void Read(hsStream* stream, hsResMgr* mgr) { plMessage::IMsgRead(stream, mgr); - fType = stream->ReadSwap32(); - fPriority = stream->ReadSwap32(); + fType = stream->ReadLE32(); + fPriority = stream->ReadLE32(); } void Write(hsStream* stream, hsResMgr* mgr) { plMessage::IMsgWrite(stream, mgr); - stream->WriteSwap32(fType); - stream->WriteSwap32(fPriority); + stream->WriteLE32(fType); + stream->WriteLE32(fPriority); } }; diff --git a/Sources/Plasma/NucleusLib/pnMessage/plEventCallbackMsg.h b/Sources/Plasma/NucleusLib/pnMessage/plEventCallbackMsg.h index c267df09..dd937e92 100644 --- a/Sources/Plasma/NucleusLib/pnMessage/plEventCallbackMsg.h +++ b/Sources/Plasma/NucleusLib/pnMessage/plEventCallbackMsg.h @@ -91,20 +91,20 @@ public: virtual void Read(hsStream* stream, hsResMgr* mgr) { plMessage::IMsgRead(stream, mgr); - fEventTime = stream->ReadSwapFloat(); - fEvent = (CallbackEvent)stream->ReadSwap16(); - fIndex = stream->ReadSwap16(); - fRepeats = stream->ReadSwap16(); - fUser = stream->ReadSwap16(); + fEventTime = stream->ReadLEFloat(); + fEvent = (CallbackEvent)stream->ReadLE16(); + fIndex = stream->ReadLE16(); + fRepeats = stream->ReadLE16(); + fUser = stream->ReadLE16(); } virtual void Write(hsStream* stream, hsResMgr* mgr) { plMessage::IMsgWrite(stream, mgr); - stream->WriteSwapFloat(fEventTime); - stream->WriteSwap16((Int16)fEvent); - stream->WriteSwap16(fIndex); - stream->WriteSwap16(fRepeats); - stream->WriteSwap16(fUser); + stream->WriteLEFloat(fEventTime); + stream->WriteLE16((Int16)fEvent); + stream->WriteLE16(fIndex); + stream->WriteLE16(fRepeats); + stream->WriteLE16(fUser); } }; diff --git a/Sources/Plasma/NucleusLib/pnMessage/plIntRefMsg.h b/Sources/Plasma/NucleusLib/pnMessage/plIntRefMsg.h index 23b61a34..3b43fce9 100644 --- a/Sources/Plasma/NucleusLib/pnMessage/plIntRefMsg.h +++ b/Sources/Plasma/NucleusLib/pnMessage/plIntRefMsg.h @@ -78,17 +78,17 @@ public: void Read(hsStream* stream, hsResMgr* mgr) { plRefMsg::Read(stream, mgr); - stream->ReadSwap(&fType); - stream->ReadSwap(&fWhich); - stream->ReadSwap(&fIdx); + stream->ReadLE(&fType); + stream->ReadLE(&fWhich); + stream->ReadLE(&fIdx); } void Write(hsStream* stream, hsResMgr* mgr) { plRefMsg::Write(stream, mgr); - stream->WriteSwap(fType); - stream->WriteSwap(fWhich); - stream->WriteSwap(fIdx); + stream->WriteLE(fType); + stream->WriteLE(fWhich); + stream->WriteLE(fIdx); } }; diff --git a/Sources/Plasma/NucleusLib/pnMessage/plMessage.cpp b/Sources/Plasma/NucleusLib/pnMessage/plMessage.cpp index 93e4d239..cc4177e6 100644 --- a/Sources/Plasma/NucleusLib/pnMessage/plMessage.cpp +++ b/Sources/Plasma/NucleusLib/pnMessage/plMessage.cpp @@ -119,14 +119,14 @@ void plMessage::IMsgRead(hsStream* s, hsResMgr* mgr) fSender = mgr->ReadKey(s); int n; - s->LogReadSwap(&n,"NumberOfReceivers"); + s->LogReadLE(&n,"NumberOfReceivers"); fReceivers.SetCount(n); int i; for( i = 0; i < fReceivers.GetCount(); i++ ) fReceivers[i] = mgr->ReadKey(s); - s->LogReadSwap(&fTimeStamp,"TimeStamp"); // read as double - s->LogReadSwap(&fBCastFlags, "BCastFlags"); + s->LogReadLE(&fTimeStamp,"TimeStamp"); // read as double + s->LogReadLE(&fBCastFlags, "BCastFlags"); } void plMessage::IMsgWrite(hsStream* s, hsResMgr* mgr) @@ -134,13 +134,13 @@ void plMessage::IMsgWrite(hsStream* s, hsResMgr* mgr) plCreatable::Write(s, mgr); mgr->WriteKey(s,fSender); - s->WriteSwap32(fReceivers.GetCount()); + s->WriteLE32(fReceivers.GetCount()); int i; for( i = 0; i < fReceivers.GetCount(); i++ ) mgr->WriteKey(s,fReceivers[i]); - s->WriteSwap(fTimeStamp); // write as double - s->WriteSwap32(fBCastFlags); + s->WriteLE(fTimeStamp); // write as double + s->WriteLE32(fBCastFlags); } enum MsgFlags @@ -161,7 +161,7 @@ void plMessage::IMsgReadVersion(hsStream* s, hsResMgr* mgr) if (contentFlags.IsBitSet(kMsgReceivers)) { - int n = s->ReadSwap32(); + int n = s->ReadLE32(); fReceivers.SetCount(n); int i; for( i = 0; i < fReceivers.GetCount(); i++ ) @@ -169,10 +169,10 @@ void plMessage::IMsgReadVersion(hsStream* s, hsResMgr* mgr) } if (contentFlags.IsBitSet(kMsgTimeStamp)) - s->ReadSwap(&fTimeStamp); // read as double + s->ReadLE(&fTimeStamp); // read as double if (contentFlags.IsBitSet(kMsgBCastFlags)) - fBCastFlags = s->ReadSwap32(); + fBCastFlags = s->ReadLE32(); } void plMessage::IMsgWriteVersion(hsStream* s, hsResMgr* mgr) @@ -188,16 +188,16 @@ void plMessage::IMsgWriteVersion(hsStream* s, hsResMgr* mgr) mgr->WriteKey(s,fSender); // kMsgReceivers - s->WriteSwap32(fReceivers.GetCount()); + s->WriteLE32(fReceivers.GetCount()); int i; for( i = 0; i < fReceivers.GetCount(); i++ ) mgr->WriteKey(s,fReceivers[i]); // kMsgTimeStamp - s->WriteSwap(fTimeStamp); // write as double + s->WriteLE(fTimeStamp); // write as double // kMsgBCastFlags - s->WriteSwap32(fBCastFlags); + s->WriteLE32(fBCastFlags); } void plMessage::AddNetReceiver( UInt32 plrID ) @@ -222,7 +222,7 @@ int plMsgStdStringHelper::Poke(const std::string & stringref, hsStream* stream, plMessage::plStrLen strlen; hsAssert( stringref.length()<0xFFFF, "buf too big for plMsgStdStringHelper" ); strlen = stringref.length(); - stream->WriteSwap(strlen); + stream->WriteLE(strlen); if (strlen) stream->Write(strlen,stringref.data()); return stream->GetPosition(); @@ -231,7 +231,7 @@ int plMsgStdStringHelper::Poke(const std::string & stringref, hsStream* stream, int plMsgStdStringHelper::PokeBig(const std::string & stringref, hsStream* stream, const UInt32 peekOptions) { UInt32 strlen = stringref.length(); - stream->WriteSwap(strlen); + stream->WriteLE(strlen); if (strlen) stream->Write(strlen,stringref.data()); return stream->GetPosition(); @@ -242,7 +242,7 @@ int plMsgStdStringHelper::Poke(const char * buf, UInt32 bufsz, hsStream* stream, plMessage::plStrLen strlen; hsAssert( bufsz<0xFFFF, "buf too big for plMsgStdStringHelper" ); strlen = (plMessage::plStrLen)bufsz; - stream->WriteSwap(strlen); + stream->WriteLE(strlen); if (strlen) stream->Write(strlen,buf); return stream->GetPosition(); @@ -250,7 +250,7 @@ int plMsgStdStringHelper::Poke(const char * buf, UInt32 bufsz, hsStream* stream, int plMsgStdStringHelper::PokeBig(const char * buf, UInt32 bufsz, hsStream* stream, const UInt32 peekOptions) { - stream->WriteSwap(bufsz); + stream->WriteLE(bufsz); if (bufsz) stream->Write(bufsz,buf); return stream->GetPosition(); @@ -261,7 +261,7 @@ int plMsgStdStringHelper::Peek(std::string & stringref, hsStream* stream, const { plMessage::plStrLen strlen; stream->LogSubStreamStart("push this"); - stream->LogReadSwap(&strlen,"StrLen"); + stream->LogReadLE(&strlen,"StrLen"); stringref.erase(); if (strlen <= stream->GetSizeLeft()) { @@ -283,7 +283,7 @@ int plMsgStdStringHelper::PeekBig(std::string & stringref, hsStream* stream, co { UInt32 bufsz; stream->LogSubStreamStart("push this"); - stream->LogReadSwap(&bufsz,"Bufsz"); + stream->LogReadLE(&bufsz,"Bufsz"); stringref.erase(); if (bufsz <= stream->GetSizeLeft()) { @@ -308,7 +308,7 @@ int plMsgXtlStringHelper::Poke(const xtl::istring & stringref, hsStream* stream, { plMessage::plStrLen strlen; strlen = stringref.length(); - stream->WriteSwap(strlen); + stream->WriteLE(strlen); if (strlen) stream->Write(strlen,stringref.data()); return stream->GetPosition(); @@ -319,7 +319,7 @@ int plMsgXtlStringHelper::Peek(xtl::istring & stringref, hsStream* stream, const { plMessage::plStrLen strlen; stream->LogSubStreamStart("push me"); - stream->LogReadSwap(&strlen,"StrLen"); + stream->LogReadLE(&strlen,"StrLen"); stringref.erase(); if (strlen <= stream->GetSizeLeft()) { @@ -341,7 +341,7 @@ int plMsgCStringHelper::Poke(const char * str, hsStream* stream, const UInt32 pe { plMessage::plStrLen strlen; strlen = (str)?hsStrlen(str):0; - stream->WriteSwap(strlen); + stream->WriteLE(strlen); if (strlen) stream->Write(strlen,str); return stream->GetPosition(); @@ -352,7 +352,7 @@ int plMsgCStringHelper::Peek(char *& str, hsStream* stream, const UInt32 peekOpt { plMessage::plStrLen strlen; stream->LogSubStreamStart("push me"); - stream->LogReadSwap(&strlen,"StrLen"); + stream->LogReadLE(&strlen,"StrLen"); delete [] str; str = nil; if (strlen <= stream->GetSizeLeft()) diff --git a/Sources/Plasma/NucleusLib/pnMessage/plMessageWithCallbacks.cpp b/Sources/Plasma/NucleusLib/pnMessage/plMessageWithCallbacks.cpp index b2c09c96..d23ded24 100644 --- a/Sources/Plasma/NucleusLib/pnMessage/plMessageWithCallbacks.cpp +++ b/Sources/Plasma/NucleusLib/pnMessage/plMessageWithCallbacks.cpp @@ -68,7 +68,7 @@ void plMessageWithCallbacks::Read(hsStream* stream, hsResMgr* mgr) Clear(); // read count - int n = stream->ReadSwap32(); + int n = stream->ReadLE32(); fCallbacks.SetCount(n); // read callbacks @@ -85,7 +85,7 @@ void plMessageWithCallbacks::Write(hsStream* stream, hsResMgr* mgr) // write count int n=fCallbacks.GetCount(); - stream->WriteSwap32(n); + stream->WriteLE32(n); // write callbacks int i; @@ -110,7 +110,7 @@ void plMessageWithCallbacks::ReadVersion(hsStream* s, hsResMgr* mgr) if (contentFlags.IsBitSet(kMsgWithCBsCallbacks)) { // read count - int n = s->ReadSwap32(); + int n = s->ReadLE32(); fCallbacks.SetCount(n); for (int i = 0; i < n; i++) @@ -128,7 +128,7 @@ void plMessageWithCallbacks::WriteVersion(hsStream* s, hsResMgr* mgr) // write count int n = fCallbacks.GetCount(); - s->WriteSwap32(n); + s->WriteLE32(n); // write callbacks for (int i = 0; i < n; i++) diff --git a/Sources/Plasma/NucleusLib/pnMessage/plNotifyMsg.cpp b/Sources/Plasma/NucleusLib/pnMessage/plNotifyMsg.cpp index 4f8895b0..c8553289 100644 --- a/Sources/Plasma/NucleusLib/pnMessage/plNotifyMsg.cpp +++ b/Sources/Plasma/NucleusLib/pnMessage/plNotifyMsg.cpp @@ -840,11 +840,11 @@ void plNotifyMsg::Read(hsStream* stream, hsResMgr* mgr) { plMessage::IMsgRead(stream, mgr); // read in the static data - fType = stream->ReadSwap32(); - stream->ReadSwap(&fState); - fID = stream->ReadSwap32(); + fType = stream->ReadLE32(); + stream->ReadLE(&fState); + fID = stream->ReadLE32(); // read in the variable part of the message - Int32 numberEDs = stream->ReadSwap32(); + Int32 numberEDs = stream->ReadLE32(); fEvents.SetCountAndZero(numberEDs); if ( numberEDs > 0 ) { @@ -869,12 +869,12 @@ void plNotifyMsg::Write(hsStream* stream, hsResMgr* mgr) { plMessage::IMsgWrite(stream, mgr); // write static data - stream->WriteSwap32(fType); - stream->WriteSwap(fState); - stream->WriteSwap32(fID); + stream->WriteLE32(fType); + stream->WriteLE(fState); + stream->WriteLE32(fID); // then write the variable data Int32 numberEDs = fEvents.Count(); - stream->WriteSwap32(numberEDs); + stream->WriteLE32(numberEDs); if ( numberEDs > 0 ) { // write out each record @@ -903,18 +903,18 @@ void plNotifyMsg::ReadVersion(hsStream* s, hsResMgr* mgr) contentFlags.Read(s); if (contentFlags.IsBitSet(kNotifyMsgType)) - fType = s->ReadSwap32(); + fType = s->ReadLE32(); if (contentFlags.IsBitSet(kNotifyMsgState)) - s->ReadSwap(&fState); + s->ReadLE(&fState); if (contentFlags.IsBitSet(kNotifyMsgID)) - fID = s->ReadSwap32(); + fID = s->ReadLE32(); if (contentFlags.IsBitSet(kNotifyMsgEDs)) { // read in the variable part of the message - Int32 numberEDs = s->ReadSwap32(); + Int32 numberEDs = s->ReadLE32(); fEvents.SetCountAndZero(numberEDs); if (numberEDs > 0) { @@ -946,17 +946,17 @@ void plNotifyMsg::WriteVersion(hsStream* s, hsResMgr* mgr) contentFlags.Write(s); // kNotifyMsgType - s->WriteSwap32(fType); + s->WriteLE32(fType); // kNotifyMsgState - s->WriteSwap(fState); + s->WriteLE(fState); // kNotifyMsgID - s->WriteSwap32(fID); + s->WriteLE32(fID); // kNotifyMsgEDs Int32 numberEDs = fEvents.Count(); - s->WriteSwap32(numberEDs); + s->WriteLE32(numberEDs); if (numberEDs > 0) { // write out each record @@ -1028,7 +1028,7 @@ proEventData* proEventData::ICreateEventDataType(Int32 type) proEventData* proEventData::Read( hsStream *stream, hsResMgr *mgr ) { - Int32 evtType = stream->ReadSwap32(); + Int32 evtType = stream->ReadLE32(); proEventData* data = ICreateEventDataType(evtType); @@ -1040,7 +1040,7 @@ proEventData* proEventData::Read( hsStream *stream, hsResMgr *mgr ) void proEventData::Write(hsStream *stream, hsResMgr *mgr) { - stream->WriteSwap32(fEventType); + stream->WriteLE32(fEventType); IWrite(stream, mgr); } @@ -1056,7 +1056,7 @@ proEventData* proEventData::ReadVersion(hsStream* s, hsResMgr* mgr) if (contentFlags.IsBitSet(kProEventDataType)) { - Int32 evtType = s->ReadSwap32(); + Int32 evtType = s->ReadLE32(); proEventData* data = ICreateEventDataType(evtType); @@ -1076,7 +1076,7 @@ void proEventData::WriteVersion(hsStream* s, hsResMgr* mgr) contentFlags.Write(s); // kProEventDataType - s->WriteSwap32(fEventType); + s->WriteLE32(fEventType); IWriteVersion(s, mgr); } @@ -1233,12 +1233,12 @@ void proSpawnedEventData::IWriteVersion(hsStream* s, hsResMgr* mgr) void proControlKeyEventData::IRead(hsStream* stream, hsResMgr* mgr) { - fControlKey = stream->ReadSwap32(); + fControlKey = stream->ReadLE32(); fDown = stream->ReadBool(); } void proControlKeyEventData::IWrite(hsStream* stream, hsResMgr* mgr) { - stream->WriteSwap32(fControlKey); + stream->WriteLE32(fControlKey); stream->WriteBool(fDown); } @@ -1254,7 +1254,7 @@ void proControlKeyEventData::IReadVersion(hsStream* s, hsResMgr* mgr) contentFlags.Read(s); if (contentFlags.IsBitSet(kProControlKey)) - fControlKey = s->ReadSwap32(); + fControlKey = s->ReadLE32(); if (contentFlags.IsBitSet(kProControlDown)) fDown = s->ReadBool(); } @@ -1266,7 +1266,7 @@ void proControlKeyEventData::IWriteVersion(hsStream* s, hsResMgr* mgr) contentFlags.Write(s); // kProControlKey - s->WriteSwap32(fControlKey); + s->WriteLE32(fControlKey); // kProControlDown s->WriteBool(fDown); } @@ -1286,16 +1286,16 @@ void proVariableEventData::IDestruct() void proVariableEventData::IRead(hsStream* stream, hsResMgr* mgr) { fName = stream->ReadSafeString(); - fDataType = stream->ReadSwap32(); - fNumber = stream->ReadSwapScalar(); + fDataType = stream->ReadLE32(); + fNumber = stream->ReadLEScalar(); fKey = mgr->ReadKey(stream); } void proVariableEventData::IWrite(hsStream* stream, hsResMgr* mgr) { stream->WriteSafeString(fName); - stream->WriteSwap32(fDataType); - stream->WriteSwapScalar(fNumber); + stream->WriteLE32(fDataType); + stream->WriteLEScalar(fNumber); mgr->WriteKey(stream, fKey); } @@ -1315,9 +1315,9 @@ void proVariableEventData::IReadVersion(hsStream* s, hsResMgr* mgr) if (contentFlags.IsBitSet(kProVariableName)) fName = s->ReadSafeString(); if (contentFlags.IsBitSet(kProVariableDataType)) - fDataType = s->ReadSwap32(); + fDataType = s->ReadLE32(); if (contentFlags.IsBitSet(kProVariableNumber)) - fNumber = s->ReadSwapScalar(); + fNumber = s->ReadLEScalar(); if (contentFlags.IsBitSet(kProVariableKey)) fKey = mgr->ReadKey(s); } @@ -1334,9 +1334,9 @@ void proVariableEventData::IWriteVersion(hsStream* s, hsResMgr* mgr) // kProVariableName s->WriteSafeString(fName); // kProVariableDataType - s->WriteSwap32(fDataType); + s->WriteLE32(fDataType); // kProVariableNumber - s->WriteSwapScalar(fNumber); + s->WriteLEScalar(fNumber); // kProVariableKey mgr->WriteKey(s, fKey); } @@ -1345,7 +1345,7 @@ void proFacingEventData::IRead(hsStream* stream, hsResMgr* mgr) { fFacer = mgr->ReadKey(stream); fFacee = mgr->ReadKey(stream); - dot = stream->ReadSwapScalar(); + dot = stream->ReadLEScalar(); enabled = stream->ReadBool(); } @@ -1353,7 +1353,7 @@ void proFacingEventData::IWrite(hsStream* stream, hsResMgr* mgr) { mgr->WriteKey(stream, fFacer); mgr->WriteKey(stream, fFacee); - stream->WriteSwapScalar(dot); + stream->WriteLEScalar(dot); stream->WriteBool(enabled); } @@ -1375,7 +1375,7 @@ void proFacingEventData::IReadVersion(hsStream* s, hsResMgr* mgr) if (contentFlags.IsBitSet(kProFacingFacee)) fFacee = mgr->ReadKey(s); if (contentFlags.IsBitSet(kProFacingDot)) - dot = s->ReadSwapScalar(); + dot = s->ReadLEScalar(); if (contentFlags.IsBitSet(kProFacingEnabled)) enabled = s->ReadBool(); } @@ -1394,7 +1394,7 @@ void proFacingEventData::IWriteVersion(hsStream* s, hsResMgr* mgr) // kProFacingFacee mgr->WriteKey(s, fFacee); // kProFacingDot - s->WriteSwapScalar(dot); + s->WriteLEScalar(dot); // kProFacingEnabled s->WriteBool(enabled); } @@ -1493,12 +1493,12 @@ void proActivateEventData::IWriteVersion(hsStream* s, hsResMgr* mgr) void proCallbackEventData::IRead(hsStream* stream, hsResMgr* mgr) { - fEventType = stream->ReadSwap32(); + fEventType = stream->ReadLE32(); } void proCallbackEventData::IWrite(hsStream* stream, hsResMgr* mgr) { - stream->WriteSwap32(fEventType); + stream->WriteLE32(fEventType); } enum ProCallbackFlags @@ -1512,7 +1512,7 @@ void proCallbackEventData::IReadVersion(hsStream* s, hsResMgr* mgr) contentFlags.Read(s); if (contentFlags.IsBitSet(kProCallbackEventType)) - fEventType = s->ReadSwap32(); + fEventType = s->ReadLE32(); } void proCallbackEventData::IWriteVersion(hsStream* s, hsResMgr* mgr) @@ -1522,17 +1522,17 @@ void proCallbackEventData::IWriteVersion(hsStream* s, hsResMgr* mgr) contentFlags.Write(s); // kProCallbackEventType - s->WriteSwap32(fEventType); + s->WriteLE32(fEventType); } void proResponderStateEventData::IRead(hsStream* stream, hsResMgr* mgr) { - fState = stream->ReadSwap32(); + fState = stream->ReadLE32(); } void proResponderStateEventData::IWrite(hsStream* stream, hsResMgr* mgr) { - stream->WriteSwap32(fState); + stream->WriteLE32(fState); } enum ProResponderFlags @@ -1546,7 +1546,7 @@ void proResponderStateEventData::IReadVersion(hsStream* s, hsResMgr* mgr) contentFlags.Read(s); if (contentFlags.IsBitSet(kProResponderState)) - fState = s->ReadSwap32(); + fState = s->ReadLE32(); } void proResponderStateEventData::IWriteVersion(hsStream* s, hsResMgr* mgr) @@ -1556,20 +1556,20 @@ void proResponderStateEventData::IWriteVersion(hsStream* s, hsResMgr* mgr) contentFlags.Write(s); // kProResponderState - s->WriteSwap32(fState); + s->WriteLE32(fState); } void proMultiStageEventData::IRead(hsStream* stream, hsResMgr* mgr) { - fStage = stream->ReadSwap32(); - fEvent = stream->ReadSwap32(); + fStage = stream->ReadLE32(); + fEvent = stream->ReadLE32(); fAvatar = mgr->ReadKey(stream); } void proMultiStageEventData::IWrite(hsStream* stream, hsResMgr* mgr) { - stream->WriteSwap32(fStage); - stream->WriteSwap32(fEvent); + stream->WriteLE32(fStage); + stream->WriteLE32(fEvent); mgr->WriteKey(stream, fAvatar); } @@ -1586,9 +1586,9 @@ void proMultiStageEventData::IReadVersion(hsStream* s, hsResMgr* mgr) contentFlags.Read(s); if (contentFlags.IsBitSet(kProMultiStageStage)) - fStage = s->ReadSwap32(); + fStage = s->ReadLE32(); if (contentFlags.IsBitSet(kProMultiStageEvent)) - fEvent = s->ReadSwap32(); + fEvent = s->ReadLE32(); if (contentFlags.IsBitSet(kProMultiStageAvatar)) fAvatar = mgr->ReadKey(s); } @@ -1602,23 +1602,23 @@ void proMultiStageEventData::IWriteVersion(hsStream* s, hsResMgr* mgr) contentFlags.Write(s); // kProMultiStageStage - s->WriteSwap32(fStage); + s->WriteLE32(fStage); // kProMultiStageEvent - s->WriteSwap32(fEvent); + s->WriteLE32(fEvent); // kProMultiStageAvatar mgr->WriteKey(s, fAvatar); } void proCoopEventData::IRead(hsStream* stream, hsResMgr* mgr) { - fID = stream->ReadSwap32(); - fSerial = stream->ReadSwap16(); + fID = stream->ReadLE32(); + fSerial = stream->ReadLE16(); } void proCoopEventData::IWrite(hsStream* stream, hsResMgr* mgr) { - stream->WriteSwap32(fID); - stream->WriteSwap16(fSerial); + stream->WriteLE32(fID); + stream->WriteLE16(fSerial); } enum ProCoopFlags @@ -1633,9 +1633,9 @@ void proCoopEventData::IReadVersion(hsStream* stream, hsResMgr* mgr) contentFlags.Read(stream); if(contentFlags.IsBitSet(kProCoopID)) - fID = stream->ReadSwap32(); + fID = stream->ReadLE32(); if(contentFlags.IsBitSet(kProCoopSerial)) - fSerial = stream->ReadSwap16(); + fSerial = stream->ReadLE16(); } void proCoopEventData::IWriteVersion(hsStream* stream, hsResMgr* mgr) @@ -1645,23 +1645,23 @@ void proCoopEventData::IWriteVersion(hsStream* stream, hsResMgr* mgr) contentFlags.SetBit(kProCoopSerial); contentFlags.Write(stream); - stream->WriteSwap32(fID); - stream->WriteSwap16(fSerial); + stream->WriteLE32(fID); + stream->WriteLE16(fSerial); } void proOfferLinkingBookEventData::IWrite(hsStream* stream, hsResMgr* mgr) { mgr->WriteKey(stream, offerer); - stream->WriteSwap32(targetAge); - stream->WriteSwap32(offeree); + stream->WriteLE32(targetAge); + stream->WriteLE32(offeree); } void proOfferLinkingBookEventData::IRead(hsStream* stream, hsResMgr* mgr) { offerer = mgr->ReadKey(stream); - targetAge = stream->ReadSwap32(); - offeree = stream->ReadSwap32(); + targetAge = stream->ReadLE32(); + offeree = stream->ReadLE32(); } enum ProOfferFlags @@ -1680,8 +1680,8 @@ void proOfferLinkingBookEventData::IWriteVersion(hsStream* s, hsResMgr* mgr) contentFlags.Write(s); mgr->WriteKey(s, offerer); - s->WriteSwap32(targetAge); - s->WriteSwap32(offeree); + s->WriteLE32(targetAge); + s->WriteLE32(offeree); } void proOfferLinkingBookEventData::IReadVersion(hsStream* s, hsResMgr* mgr) @@ -1692,21 +1692,21 @@ void proOfferLinkingBookEventData::IReadVersion(hsStream* s, hsResMgr* mgr) if(contentFlags.IsBitSet(kProOfferOfferer)) offerer = mgr->ReadKey(s); if(contentFlags.IsBitSet(kProOfferTargetAge)) - targetAge = s->ReadSwap32(); + targetAge = s->ReadLE32(); if(contentFlags.IsBitSet(kProOfferOfferee)) - offeree = s->ReadSwap32(); + offeree = s->ReadLE32(); } void proBookEventData::IWrite(hsStream* stream, hsResMgr* mgr) { - stream->WriteSwap32(fEvent); - stream->WriteSwap32(fLinkID); + stream->WriteLE32(fEvent); + stream->WriteLE32(fLinkID); } void proBookEventData::IRead(hsStream* stream, hsResMgr* mgr) { - fEvent = stream->ReadSwap32(); - fLinkID = stream->ReadSwap32(); + fEvent = stream->ReadLE32(); + fLinkID = stream->ReadLE32(); } enum ProBookFlags @@ -1722,8 +1722,8 @@ void proBookEventData::IWriteVersion(hsStream* s, hsResMgr* mgr) contentFlags.SetBit(kProBookLinkID); contentFlags.Write(s); - s->WriteSwap32( fEvent ); - s->WriteSwap32( fLinkID ); + s->WriteLE32( fEvent ); + s->WriteLE32( fLinkID ); } void proBookEventData::IReadVersion(hsStream* s, hsResMgr* mgr) @@ -1732,9 +1732,9 @@ void proBookEventData::IReadVersion(hsStream* s, hsResMgr* mgr) contentFlags.Read(s); if(contentFlags.IsBitSet(kProBookEvent)) - fEvent = s->ReadSwap32(); + fEvent = s->ReadLE32(); if(contentFlags.IsBitSet(kProBookLinkID)) - fLinkID = s->ReadSwap32(); + fLinkID = s->ReadLE32(); } diff --git a/Sources/Plasma/NucleusLib/pnMessage/plObjRefMsg.h b/Sources/Plasma/NucleusLib/pnMessage/plObjRefMsg.h index cde64a55..d86c5c71 100644 --- a/Sources/Plasma/NucleusLib/pnMessage/plObjRefMsg.h +++ b/Sources/Plasma/NucleusLib/pnMessage/plObjRefMsg.h @@ -74,15 +74,15 @@ public: void Read(hsStream* stream, hsResMgr* mgr) { plRefMsg::Read(stream, mgr); - stream->ReadSwap(&fType); - stream->ReadSwap(&fWhich); + stream->ReadLE(&fType); + stream->ReadLE(&fWhich); } void Write(hsStream* stream, hsResMgr* mgr) { plRefMsg::Write(stream, mgr); - stream->WriteSwap(fType); - stream->WriteSwap(fWhich); + stream->WriteLE(fType); + stream->WriteLE(fWhich); } }; diff --git a/Sources/Plasma/NucleusLib/pnMessage/plPlayerPageMsg.h b/Sources/Plasma/NucleusLib/pnMessage/plPlayerPageMsg.h index 1ba57ccd..ad4d642f 100644 --- a/Sources/Plasma/NucleusLib/pnMessage/plPlayerPageMsg.h +++ b/Sources/Plasma/NucleusLib/pnMessage/plPlayerPageMsg.h @@ -77,7 +77,7 @@ public: fLocallyOriginated = stream->ReadBool(); fLastOut = stream->ReadBool(); fUnload = stream->ReadBool(); - fClientID = stream->ReadSwap32(); + fClientID = stream->ReadLE32(); } void Write(hsStream* stream, hsResMgr* mgr) { @@ -86,7 +86,7 @@ public: stream->WriteBool(fLocallyOriginated); stream->WriteBool(fLastOut); stream->WriteBool(fUnload); - stream->WriteSwap32(fClientID); + stream->WriteLE32(fClientID); } }; diff --git a/Sources/Plasma/NucleusLib/pnMessage/plProxyDrawMsg.cpp b/Sources/Plasma/NucleusLib/pnMessage/plProxyDrawMsg.cpp index 43726343..a7049254 100644 --- a/Sources/Plasma/NucleusLib/pnMessage/plProxyDrawMsg.cpp +++ b/Sources/Plasma/NucleusLib/pnMessage/plProxyDrawMsg.cpp @@ -71,11 +71,11 @@ plProxyDrawMsg::~plProxyDrawMsg() void plProxyDrawMsg::Read(hsStream* s, hsResMgr* mgr) { plMessage::IMsgRead(s, mgr); - fProxyFlags = s->ReadSwap16(); + fProxyFlags = s->ReadLE16(); } void plProxyDrawMsg::Write(hsStream* s, hsResMgr* mgr) { plMessage::IMsgWrite(s, mgr); - s->WriteSwap16(fProxyFlags); + s->WriteLE16(fProxyFlags); } \ No newline at end of file diff --git a/Sources/Plasma/NucleusLib/pnMessage/plRefMsg.cpp b/Sources/Plasma/NucleusLib/pnMessage/plRefMsg.cpp index a583c221..bce5fdc7 100644 --- a/Sources/Plasma/NucleusLib/pnMessage/plRefMsg.cpp +++ b/Sources/Plasma/NucleusLib/pnMessage/plRefMsg.cpp @@ -81,7 +81,7 @@ plRefMsg& plRefMsg::SetOldRef(hsKeyedObject* oldRef) void plRefMsg::Read(hsStream* stream, hsResMgr* mgr) { plMessage::IMsgRead(stream, mgr); - stream->ReadSwap(&fContext); + stream->ReadLE(&fContext); plKey key; key = mgr->ReadKey(stream); @@ -93,7 +93,7 @@ void plRefMsg::Read(hsStream* stream, hsResMgr* mgr) void plRefMsg::Write(hsStream* stream, hsResMgr* mgr) { plMessage::IMsgWrite(stream, mgr); - stream->WriteSwap(fContext); + stream->WriteLE(fContext); mgr->WriteKey(stream, (fRef ? fRef->GetKey() : nil)); mgr->WriteKey(stream, (fOldRef ? fOldRef->GetKey() : nil)); @@ -103,13 +103,13 @@ void plRefMsg::Write(hsStream* stream, hsResMgr* mgr) void plGenRefMsg::Read(hsStream* stream, hsResMgr* mgr) { plRefMsg::Read(stream, mgr); - stream->ReadSwap(&fType); - fWhich = stream->ReadSwap32(); + stream->ReadLE(&fType); + fWhich = stream->ReadLE32(); } void plGenRefMsg::Write(hsStream* stream, hsResMgr* mgr) { plRefMsg::Write(stream, mgr); - stream->WriteSwap(fType); - stream->WriteSwap32(fWhich); + stream->WriteLE(fType); + stream->WriteLE32(fWhich); } diff --git a/Sources/Plasma/NucleusLib/pnMessage/plServerReplyMsg.cpp b/Sources/Plasma/NucleusLib/pnMessage/plServerReplyMsg.cpp index 05a32af7..22a5702d 100644 --- a/Sources/Plasma/NucleusLib/pnMessage/plServerReplyMsg.cpp +++ b/Sources/Plasma/NucleusLib/pnMessage/plServerReplyMsg.cpp @@ -46,13 +46,13 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com void plServerReplyMsg::Read(hsStream* stream, hsResMgr* mgr) { plMessage::IMsgRead(stream, mgr); - stream->ReadSwap(&fType); + stream->ReadLE(&fType); } void plServerReplyMsg::Write(hsStream* stream, hsResMgr* mgr) { plMessage::IMsgWrite(stream, mgr); - stream->WriteSwap(fType); + stream->WriteLE(fType); } enum ServerReplyFlags @@ -68,7 +68,7 @@ void plServerReplyMsg::ReadVersion(hsStream* s, hsResMgr* mgr) contentFlags.Read(s); if (contentFlags.IsBitSet(kServerReplyType)) - s->ReadSwap(&fType); + s->ReadLE(&fType); } void plServerReplyMsg::WriteVersion(hsStream* s, hsResMgr* mgr) @@ -80,5 +80,5 @@ void plServerReplyMsg::WriteVersion(hsStream* s, hsResMgr* mgr) contentFlags.Write(s); // kServerReplyType - s->WriteSwap(fType); + s->WriteLE(fType); } diff --git a/Sources/Plasma/NucleusLib/pnMessage/plSoundMsg.cpp b/Sources/Plasma/NucleusLib/pnMessage/plSoundMsg.cpp index 69b5c968..c9ababec 100644 --- a/Sources/Plasma/NucleusLib/pnMessage/plSoundMsg.cpp +++ b/Sources/Plasma/NucleusLib/pnMessage/plSoundMsg.cpp @@ -62,16 +62,16 @@ void plSoundMsg::Read(hsStream* stream, hsResMgr* mgr) plMessageWithCallbacks::Read(stream, mgr); fCmd.Read(stream); - stream->ReadSwap(&fBegin); - stream->ReadSwap(&fEnd); + stream->ReadLE(&fBegin); + stream->ReadLE(&fEnd); fLoop = stream->ReadBool(); fPlaying = stream->ReadBool(); - stream->ReadSwap(&fSpeed); - stream->ReadSwap(&fTime); - stream->ReadSwap(&fIndex); - stream->ReadSwap(&fRepeats); - stream->ReadSwap(&fNameStr); - stream->ReadSwap(&fVolume); + stream->ReadLE(&fSpeed); + stream->ReadLE(&fTime); + stream->ReadLE(&fIndex); + stream->ReadLE(&fRepeats); + stream->ReadLE(&fNameStr); + stream->ReadLE(&fVolume); fFadeType = (plSoundMsg::FadeType)stream->ReadByte(); } @@ -80,15 +80,15 @@ void plSoundMsg::Write(hsStream* stream, hsResMgr* mgr) plMessageWithCallbacks::Write(stream, mgr); fCmd.Write(stream); - stream->WriteSwap(fBegin); - stream->WriteSwap(fEnd); + stream->WriteLE(fBegin); + stream->WriteLE(fEnd); stream->WriteBool(fLoop); stream->WriteBool(fPlaying); - stream->WriteSwap(fSpeed); - stream->WriteSwap(fTime); - stream->WriteSwap(fIndex); - stream->WriteSwap(fRepeats); - stream->WriteSwap(fNameStr); - stream->WriteSwap(fVolume); + stream->WriteLE(fSpeed); + stream->WriteLE(fTime); + stream->WriteLE(fIndex); + stream->WriteLE(fRepeats); + stream->WriteLE(fNameStr); + stream->WriteLE(fVolume); stream->WriteByte( (UInt8)fFadeType ); } diff --git a/Sources/Plasma/NucleusLib/pnMessage/plTimeMsg.h b/Sources/Plasma/NucleusLib/pnMessage/plTimeMsg.h index 3853d8b7..40516462 100644 --- a/Sources/Plasma/NucleusLib/pnMessage/plTimeMsg.h +++ b/Sources/Plasma/NucleusLib/pnMessage/plTimeMsg.h @@ -72,15 +72,15 @@ public: void Read(hsStream* stream, hsResMgr* mgr) { plMessage::IMsgRead(stream, mgr); - stream->ReadSwap(&fSeconds); - stream->ReadSwap(&fDelSecs); + stream->ReadLE(&fSeconds); + stream->ReadLE(&fDelSecs); } void Write(hsStream* stream, hsResMgr* mgr) { plMessage::IMsgWrite(stream, mgr); - stream->WriteSwap(fSeconds); - stream->WriteSwap(fDelSecs); + stream->WriteLE(fSeconds); + stream->WriteLE(fDelSecs); } }; diff --git a/Sources/Plasma/NucleusLib/pnMessage/plWarpMsg.h b/Sources/Plasma/NucleusLib/pnMessage/plWarpMsg.h index 55877a94..9c536fa0 100644 --- a/Sources/Plasma/NucleusLib/pnMessage/plWarpMsg.h +++ b/Sources/Plasma/NucleusLib/pnMessage/plWarpMsg.h @@ -86,14 +86,14 @@ public: { plMessage::IMsgRead(stream, mgr); fTransform.Read(stream); - stream->ReadSwap(&fWarpFlags); + stream->ReadLE(&fWarpFlags); } void Write(hsStream* stream, hsResMgr* mgr) { plMessage::IMsgWrite(stream, mgr); fTransform.Write(stream); - stream->WriteSwap(fWarpFlags); + stream->WriteLE(fWarpFlags); } }; diff --git a/Sources/Plasma/NucleusLib/pnModifier/plLogicModBase.cpp b/Sources/Plasma/NucleusLib/pnModifier/plLogicModBase.cpp index 759f9d52..54e3a670 100644 --- a/Sources/Plasma/NucleusLib/pnModifier/plLogicModBase.cpp +++ b/Sources/Plasma/NucleusLib/pnModifier/plLogicModBase.cpp @@ -318,7 +318,7 @@ void plLogicModBase::AddNotifyReceiver(plKey receiver) void plLogicModBase::Read(hsStream* stream, hsResMgr* mgr) { plSingleModifier::Read(stream, mgr); - int n = stream->ReadSwap32(); + int n = stream->ReadLE32(); fCommandList.SetCountAndZero(n); for(int i = 0; i < n; i++ ) { @@ -339,7 +339,7 @@ void plLogicModBase::Read(hsStream* stream, hsResMgr* mgr) void plLogicModBase::Write(hsStream* stream, hsResMgr* mgr) { plSingleModifier::Write(stream, mgr); - stream->WriteSwap32(fCommandList.GetCount()); + stream->WriteLE32(fCommandList.GetCount()); for(int i = 0; i < fCommandList.GetCount(); i++ ) mgr->WriteCreatable( stream, fCommandList[i] ); mgr->WriteCreatable( stream, fNotify ); diff --git a/Sources/Plasma/NucleusLib/pnNetCommon/plGenericVar.cpp b/Sources/Plasma/NucleusLib/pnNetCommon/plGenericVar.cpp index 2f4d0dd4..aa1ef349 100644 --- a/Sources/Plasma/NucleusLib/pnNetCommon/plGenericVar.cpp +++ b/Sources/Plasma/NucleusLib/pnNetCommon/plGenericVar.cpp @@ -174,7 +174,7 @@ const char & plGenericType::IToChar( void ) const void plGenericType::Read(hsStream* s) { IDeallocString(); - s->ReadSwap(&fType); + s->ReadLE(&fType); switch ( fType ) { @@ -184,23 +184,23 @@ void plGenericType::Read(hsStream* s) break; case kBool: {Int8 b; - s->ReadSwap( &b ); + s->ReadLE( &b ); fB = b?true:false;} break; case kChar: - s->ReadSwap( &fC ); + s->ReadLE( &fC ); break; case kInt : - s->ReadSwap( &fI ); + s->ReadLE( &fI ); break; case kUInt: - s->ReadSwap( &fU ); + s->ReadLE( &fU ); break; case kFloat: - s->ReadSwap( &fF ); + s->ReadLE( &fF ); break; case kDouble: - s->ReadSwap( &fD ); + s->ReadLE( &fD ); break; case kNone : break; @@ -209,7 +209,7 @@ void plGenericType::Read(hsStream* s) void plGenericType::Write(hsStream* s) { - s->WriteSwap(fType); + s->WriteLE(fType); switch ( fType ) { @@ -219,22 +219,22 @@ void plGenericType::Write(hsStream* s) break; case kBool: {Int8 b = fB?1:0; - s->WriteSwap( b );} + s->WriteLE( b );} break; case kChar: - s->WriteSwap( fC ); + s->WriteLE( fC ); break; case kInt : - s->WriteSwap( fI ); + s->WriteLE( fI ); break; case kUInt: - s->WriteSwap( fU ); + s->WriteLE( fU ); break; case kFloat: - s->WriteSwap( fF ); + s->WriteLE( fF ); break; case kDouble: - s->WriteSwap( fD ); + s->WriteLE( fD ); break; case kNone : break; diff --git a/Sources/Plasma/NucleusLib/pnNetCommon/plNetAddress.cpp b/Sources/Plasma/NucleusLib/pnNetCommon/plNetAddress.cpp index 1e758781..0743066a 100644 --- a/Sources/Plasma/NucleusLib/pnNetCommon/plNetAddress.cpp +++ b/Sources/Plasma/NucleusLib/pnNetCommon/plNetAddress.cpp @@ -149,16 +149,16 @@ std::string plNetAddress::AsString() const void plNetAddress::Read(hsStream * s) { - s->ReadSwap((UInt32*)&fAddr.sin_addr.s_addr); - s->ReadSwap(&fAddr.sin_port); - s->ReadSwap(&fAddr.sin_family); + s->ReadLE((UInt32*)&fAddr.sin_addr.s_addr); + s->ReadLE(&fAddr.sin_port); + s->ReadLE(&fAddr.sin_family); } void plNetAddress::Write(hsStream * s) { - s->WriteSwap((UInt32)fAddr.sin_addr.s_addr); - s->WriteSwap(fAddr.sin_port); - s->WriteSwap(fAddr.sin_family); + s->WriteLE((UInt32)fAddr.sin_addr.s_addr); + s->WriteLE(fAddr.sin_port); + s->WriteLE(fAddr.sin_family); } diff --git a/Sources/Plasma/NucleusLib/pnNetCommon/plNetGroup.h b/Sources/Plasma/NucleusLib/pnNetCommon/plNetGroup.h index fca716ae..1b785055 100644 --- a/Sources/Plasma/NucleusLib/pnNetCommon/plNetGroup.h +++ b/Sources/Plasma/NucleusLib/pnNetCommon/plNetGroup.h @@ -76,8 +76,8 @@ public: bool operator<(const plNetGroupId& netGroup) const { return fId < netGroup.fId; } // read and write to hsStream - void Write(hsStream *s) const { fId.Write(s); s->WriteSwap(fFlags); } - void Read(hsStream *s) { fId.Read(s); s->LogReadSwap(&fFlags,"GroupId Flags"); } + void Write(hsStream *s) const { fId.Write(s); s->WriteLE(fFlags); } + void Read(hsStream *s) { fId.Read(s); s->LogReadLE(&fFlags,"GroupId Flags"); } }; namespace plNetGroup diff --git a/Sources/Plasma/NucleusLib/pnNetCommon/plNetResManager.cpp b/Sources/Plasma/NucleusLib/pnNetCommon/plNetResManager.cpp index e196b90c..6235e436 100644 --- a/Sources/Plasma/NucleusLib/pnNetCommon/plNetResManager.cpp +++ b/Sources/Plasma/NucleusLib/pnNetCommon/plNetResManager.cpp @@ -78,7 +78,7 @@ plNetResManager::~plNetResManager() plCreatable* plNetResManager::IReadCreatable(hsStream* s) const { - UInt16 hClass = s->ReadSwap16(); + UInt16 hClass = s->ReadLE16(); if (plFactory::CanCreate(hClass)) { plCreatable *pCre = plFactory::Create(hClass); diff --git a/Sources/Plasma/NucleusLib/pnNetCommon/plNetSharedState.cpp b/Sources/Plasma/NucleusLib/pnNetCommon/plNetSharedState.cpp index 63bf1907..a004b3c1 100644 --- a/Sources/Plasma/NucleusLib/pnNetCommon/plNetSharedState.cpp +++ b/Sources/Plasma/NucleusLib/pnNetCommon/plNetSharedState.cpp @@ -86,7 +86,7 @@ void plNetSharedState::Read(hsStream* stream) Reset(); plMsgStdStringHelper::Peek(fName, stream); - Int32 num=stream->ReadSwap32(); + Int32 num=stream->ReadLE32(); fServerMayDelete = stream->Readbool(); fVars.reserve(num); @@ -103,7 +103,7 @@ void plNetSharedState::Write(hsStream* stream) { plMsgStdStringHelper::Poke(fName, stream); Int32 num=GetNumVars(); - stream->WriteSwap32(num); + stream->WriteLE32(num); stream->Writebool(fServerMayDelete); int i; diff --git a/Sources/Plasma/NucleusLib/pnNetCommon/plSynchedObject.cpp b/Sources/Plasma/NucleusLib/pnNetCommon/plSynchedObject.cpp index b1c09043..96d60f0f 100644 --- a/Sources/Plasma/NucleusLib/pnNetCommon/plSynchedObject.cpp +++ b/Sources/Plasma/NucleusLib/pnNetCommon/plSynchedObject.cpp @@ -333,11 +333,11 @@ void plSynchedObject::Read(hsStream* stream, hsResMgr* mgr) hsKeyedObject::Read(stream, mgr); fNetGroup = GetKey()->GetUoid().GetLocation(); - stream->ReadSwap(&fSynchFlags); + stream->ReadLE(&fSynchFlags); if (fSynchFlags & kExcludePersistentState) { Int16 num; - stream->ReadSwap(&num); + stream->ReadLE(&num); fSDLExcludeList.clear(); int i; for(i=0;iReadSwap(&num); + stream->ReadLE(&num); fSDLVolatileList.clear(); int i; for(i=0;iWriteSwap(fSynchFlags); + stream->WriteLE(fSynchFlags); if (fSynchFlags & kExcludePersistentState) { Int16 num=fSDLExcludeList.size(); - stream->WriteSwap(num); + stream->WriteLE(num); SDLStateList::iterator it=fSDLExcludeList.begin(); for(; it != fSDLExcludeList.end(); it++) @@ -383,7 +383,7 @@ void plSynchedObject::Write(hsStream* stream, hsResMgr* mgr) if (fSynchFlags & kHasVolatileState) { Int16 num=fSDLVolatileList.size(); - stream->WriteSwap(num); + stream->WriteLE(num); SDLStateList::iterator it=fSDLVolatileList.begin(); for(; it != fSDLVolatileList.end(); it++) diff --git a/Sources/Plasma/NucleusLib/pnNetCommon/plSynchedValue.cpp b/Sources/Plasma/NucleusLib/pnNetCommon/plSynchedValue.cpp index d3a68b60..33e0211d 100644 --- a/Sources/Plasma/NucleusLib/pnNetCommon/plSynchedValue.cpp +++ b/Sources/Plasma/NucleusLib/pnNetCommon/plSynchedValue.cpp @@ -52,9 +52,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define ISaveOrLoadSimpleType() \ { \ if (save) \ - stream->WriteSwap(v); \ + stream->WriteLE(v); \ else \ - stream->ReadSwap(&v); \ + stream->ReadLE(&v); \ return v; \ } @@ -101,7 +101,7 @@ const plKey plSynchedValueBase::ISaveOrLoad(const plKey key, hsBool32 save, hsSt // I need to write a key to MY stream... #if 0 // DEBUG Int32 len = hsStrlen(key->GetName()); - stream->WriteSwap32(len); + stream->WriteLE32(len); stream->Write(len, key->GetName()); #endif key->GetUoid().Write(stream); @@ -119,7 +119,7 @@ const plKey plSynchedValueBase::ISaveOrLoad(const plKey key, hsBool32 save, hsSt { // read a key from MY stream #if 0 // DEBUG - Int32 len = stream->ReadSwap32(); + Int32 len = stream->ReadLE32(); char tmp[256]; hsAssert(len<256, "key name overflow"); stream->Read(len, tmp); diff --git a/Sources/Plasma/NucleusLib/pnNetCommon/plSynchedValue.h b/Sources/Plasma/NucleusLib/pnNetCommon/plSynchedValue.h index f19b0c47..fd238862 100644 --- a/Sources/Plasma/NucleusLib/pnNetCommon/plSynchedValue.h +++ b/Sources/Plasma/NucleusLib/pnNetCommon/plSynchedValue.h @@ -339,7 +339,7 @@ void plSynchedTArray::ISaveOrLoad(hsBool32 save, hsStream* stream, hsResMgr* { // write out size of array Int32 i, num = fValueList.GetCount(); - stream->WriteSwap(num); + stream->WriteLE(num); for(i=0;i::ISaveOrLoad(hsBool32 save, hsStream* stream, hsResMgr* fValueList.Reset(); // read in size of array Int32 i, num; - stream->ReadSwap(&num); + stream->ReadLE(&num); for(i=0;iWriteSwap( len ); + stream->WriteLE( len ); buf.resize( len ); fStream.Read( len, (void*)buf.data() ); stream->Write( len, (const void*)buf.data() ); @@ -113,7 +113,7 @@ void plCreatableStream::Read( hsStream* stream, hsResMgr* mgr ) fStream.Rewind(); std::string buf; UInt32 len; - stream->LogReadSwap( &len,"CreatableStream Len"); + stream->LogReadLE( &len,"CreatableStream Len"); buf.resize( len ); stream->LogRead( len, (void*)buf.data(),"CreatableStream Data"); fStream.Write( len, (const void*)buf.data() ); diff --git a/Sources/Plasma/NucleusLib/pnSceneObject/plCoordinateInterface.cpp b/Sources/Plasma/NucleusLib/pnSceneObject/plCoordinateInterface.cpp index 85b56eca..42c8ac56 100644 --- a/Sources/Plasma/NucleusLib/pnSceneObject/plCoordinateInterface.cpp +++ b/Sources/Plasma/NucleusLib/pnSceneObject/plCoordinateInterface.cpp @@ -557,7 +557,7 @@ void plCoordinateInterface::Read(hsStream* stream, hsResMgr* mgr) fLocalToWorld.Read(stream); fWorldToLocal.Read(stream); - int n = stream->ReadSwap32(); + int n = stream->ReadLE32(); int i; for( i = 0; i < n; i++ ) { @@ -576,7 +576,7 @@ void plCoordinateInterface::Write(hsStream* stream, hsResMgr* mgr) fLocalToWorld.Write(stream); fWorldToLocal.Write(stream); - stream->WriteSwap32(fChildren.GetCount()); + stream->WriteLE32(fChildren.GetCount()); int i; for( i = 0; i < fChildren.GetCount(); i++ ) mgr->WriteKey(stream, fChildren[i]); diff --git a/Sources/Plasma/NucleusLib/pnSceneObject/plDrawInterface.cpp b/Sources/Plasma/NucleusLib/pnSceneObject/plDrawInterface.cpp index d9172b73..d8a917a6 100644 --- a/Sources/Plasma/NucleusLib/pnSceneObject/plDrawInterface.cpp +++ b/Sources/Plasma/NucleusLib/pnSceneObject/plDrawInterface.cpp @@ -146,19 +146,19 @@ void plDrawInterface::Read(hsStream* s, hsResMgr* mgr) { plObjInterface::Read(s, mgr); - int nDrawables = s->ReadSwap32(); + int nDrawables = s->ReadLE32(); if (nDrawables > 0) ICheckDrawableIndex(nDrawables-1); int i; for( i = 0; i < fDrawables.GetCount(); i++ ) { - fDrawableIndices[i] = s->ReadSwap32(); + fDrawableIndices[i] = s->ReadLE32(); plIntRefMsg* refMsg = TRACKED_NEW plIntRefMsg(GetKey(), plRefMsg::kOnCreate, i, plIntRefMsg::kDrawable); mgr->ReadKeyNotifyMe(s,refMsg, plRefFlags::kActiveRef); } - int nReg = s->ReadSwap32(); + int nReg = s->ReadLE32(); fRegions.SetCountAndZero(nReg); for( i = 0; i < nReg; i++ ) { @@ -171,16 +171,16 @@ void plDrawInterface::Write(hsStream* s, hsResMgr* mgr) { plObjInterface::Write(s, mgr); - s->WriteSwap32(fDrawables.GetCount()); + s->WriteLE32(fDrawables.GetCount()); int i; for( i = 0; i < fDrawables.GetCount(); i++ ) { - s->WriteSwap32(fDrawableIndices[i]); + s->WriteLE32(fDrawableIndices[i]); mgr->WriteKey(s, fDrawables[i]); } - s->WriteSwap32(fRegions.GetCount()); + s->WriteLE32(fRegions.GetCount()); for( i = 0; i < fRegions.GetCount(); i++ ) { mgr->WriteKey(s, fRegions[i]); diff --git a/Sources/Plasma/NucleusLib/pnSceneObject/plSceneObject.cpp b/Sources/Plasma/NucleusLib/pnSceneObject/plSceneObject.cpp index f124277a..282155f4 100644 --- a/Sources/Plasma/NucleusLib/pnSceneObject/plSceneObject.cpp +++ b/Sources/Plasma/NucleusLib/pnSceneObject/plSceneObject.cpp @@ -124,7 +124,7 @@ void plSceneObject::Read(hsStream* stream, hsResMgr* mgr) int i; - int nGen = stream->ReadSwap32(); + int nGen = stream->ReadLE32(); fGenerics.SetCount(0); for( i = 0; i < nGen; i++ ) { @@ -134,7 +134,7 @@ void plSceneObject::Read(hsStream* stream, hsResMgr* mgr) plObjRefMsg* refMsg; int nOldMods=fModifiers.GetCount(); // existng modifiers created during interface loading - int nNewMods = stream->ReadSwap32(); + int nNewMods = stream->ReadLE32(); fModifiers.ExpandAndZero(nOldMods+nNewMods); // reserve space for new modifiers+existing modifiers for( i = nOldMods; i < nOldMods+nNewMods; i++ ) { @@ -159,7 +159,7 @@ void plSceneObject::Write(hsStream* stream, hsResMgr* mgr) int i; - stream->WriteSwap32(fGenerics.GetCount()); + stream->WriteLE32(fGenerics.GetCount()); for( i = 0; i < fGenerics.GetCount(); i++ ) mgr->WriteKey(stream, fGenerics[i]); @@ -167,7 +167,7 @@ void plSceneObject::Write(hsStream* stream, hsResMgr* mgr) if (fModifiers[i]->GetKey() == nil) RemoveModifier(fModifiers[i]); - stream->WriteSwap32(fModifiers.GetCount()); + stream->WriteLE32(fModifiers.GetCount()); for( i = 0; i < fModifiers.GetCount(); i++ ) mgr->WriteKey(stream,fModifiers[i]); diff --git a/Sources/Plasma/NucleusLib/pnSceneObject/plSimulationInterface.cpp b/Sources/Plasma/NucleusLib/pnSceneObject/plSimulationInterface.cpp index 32d9ae72..3b111837 100644 --- a/Sources/Plasma/NucleusLib/pnSceneObject/plSimulationInterface.cpp +++ b/Sources/Plasma/NucleusLib/pnSceneObject/plSimulationInterface.cpp @@ -97,7 +97,7 @@ void plSimulationInterface::Read(hsStream* s, hsResMgr* mgr) // avoid breaking the format fProps.Read(s); // Also unnecessary - int poop = s->ReadSwap32(); + int poop = s->ReadLE32(); plIntRefMsg* refMsg = TRACKED_NEW plIntRefMsg(GetKey(), plRefMsg::kOnCreate, 0, plIntRefMsg::kPhysical, 0); mgr->ReadKeyNotifyMe(s, refMsg, plRefFlags::kActiveRef); @@ -109,7 +109,7 @@ void plSimulationInterface::Write(hsStream* s, hsResMgr* mgr) // Legacy crap fProps.Write(s); - s->WriteSwap32(0); + s->WriteLE32(0); mgr->WriteKey(s, fPhysical); } diff --git a/Sources/Plasma/NucleusLib/pnTimer/plTimedValue.h b/Sources/Plasma/NucleusLib/pnTimer/plTimedValue.h index 6343b819..c55a32c3 100644 --- a/Sources/Plasma/NucleusLib/pnTimer/plTimedValue.h +++ b/Sources/Plasma/NucleusLib/pnTimer/plTimedValue.h @@ -76,7 +76,7 @@ public: }; // Read/Writable version of plTimedValue, for intrinsic types (e.g. int, float, bool). -// Must be a type that hsStream has an overloaded ReadSwap/WriteSwap defined. +// Must be a type that hsStream has an overloaded ReadLE/WriteLE defined. template class plTimedSimple : public plTimedValue { public: @@ -141,7 +141,7 @@ template void plTimedSimple::Read(hsStream* s) { T val; - s->ReadSwap(&val); + s->ReadLE(&val); Set(val, 0.f); } @@ -149,7 +149,7 @@ template void plTimedSimple::Write(hsStream* s) const { T val = this->Value(); - s->WriteSwap(val); + s->WriteLE(val); } template diff --git a/Sources/Plasma/PubUtilLib/plAudible/plWinAudible.cpp b/Sources/Plasma/PubUtilLib/plAudible/plWinAudible.cpp index 5ffa79a8..e11945ea 100644 --- a/Sources/Plasma/PubUtilLib/plAudible/plWinAudible.cpp +++ b/Sources/Plasma/PubUtilLib/plAudible/plWinAudible.cpp @@ -453,7 +453,7 @@ hsBool plWinAudible::IsPlaying(int index) void plWinAudible::Read(hsStream* s, hsResMgr* mgr) { plAudible::Read(s, mgr); - int n = s->ReadSwap32(); + int n = s->ReadLE32(); fSoundObjs.SetCountAndZero(n); for(int i = 0; i < n; i++ ) { @@ -482,7 +482,7 @@ void plWinAudible::IAssignSoundKey( plSound *sound, const char *name, UInt32 i ) void plWinAudible::Write(hsStream* s, hsResMgr* mgr) { plAudible::Write(s, mgr); - s->WriteSwap32(fSoundObjs.GetCount()); + s->WriteLE32(fSoundObjs.GetCount()); for(int i = 0; i < fSoundObjs.GetCount(); i++ ) // mgr->WriteCreatable( s, fSoundObjs[i] ); mgr->WriteKey(s, fSoundObjs[i]); diff --git a/Sources/Plasma/PubUtilLib/plAudio/plEAXEffects.cpp b/Sources/Plasma/PubUtilLib/plAudio/plEAXEffects.cpp index e7db6175..e8768e37 100644 --- a/Sources/Plasma/PubUtilLib/plAudio/plEAXEffects.cpp +++ b/Sources/Plasma/PubUtilLib/plAudio/plEAXEffects.cpp @@ -462,23 +462,23 @@ void plEAXSourceSettings::Read( hsStream *s ) fEnabled = s->ReadBool(); if( fEnabled ) { - fRoom = s->ReadSwap16(); - fRoomHF = s->ReadSwap16(); + fRoom = s->ReadLE16(); + fRoomHF = s->ReadLE16(); fRoomAuto = s->ReadBool(); fRoomHFAuto = s->ReadBool(); - fOutsideVolHF = s->ReadSwap16(); + fOutsideVolHF = s->ReadLE16(); - fAirAbsorptionFactor = s->ReadSwapFloat(); - fRoomRolloffFactor = s->ReadSwapFloat(); - fDopplerFactor = s->ReadSwapFloat(); - fRolloffFactor = s->ReadSwapFloat(); + fAirAbsorptionFactor = s->ReadLEFloat(); + fRoomRolloffFactor = s->ReadLEFloat(); + fDopplerFactor = s->ReadLEFloat(); + fRolloffFactor = s->ReadLEFloat(); fSoftStarts.Read( s ); fSoftEnds.Read( s ); fOcclusionSoftValue = -1.f; - SetOcclusionSoftValue( s->ReadSwapFloat() ); + SetOcclusionSoftValue( s->ReadLEFloat() ); fDirtyParams = kAll; } @@ -491,22 +491,22 @@ void plEAXSourceSettings::Write( hsStream *s ) s->WriteBool( fEnabled ); if( fEnabled ) { - s->WriteSwap16( fRoom ); - s->WriteSwap16( fRoomHF ); + s->WriteLE16( fRoom ); + s->WriteLE16( fRoomHF ); s->WriteBool( fRoomAuto ); s->WriteBool( fRoomHFAuto ); - s->WriteSwap16( fOutsideVolHF ); + s->WriteLE16( fOutsideVolHF ); - s->WriteSwapFloat( fAirAbsorptionFactor ); - s->WriteSwapFloat( fRoomRolloffFactor ); - s->WriteSwapFloat( fDopplerFactor ); - s->WriteSwapFloat( fRolloffFactor ); + s->WriteLEFloat( fAirAbsorptionFactor ); + s->WriteLEFloat( fRoomRolloffFactor ); + s->WriteLEFloat( fDopplerFactor ); + s->WriteLEFloat( fRolloffFactor ); fSoftStarts.Write( s ); fSoftEnds.Write( s ); - s->WriteSwapFloat( fOcclusionSoftValue ); + s->WriteLEFloat( fOcclusionSoftValue ); } } @@ -607,18 +607,18 @@ void plEAXSourceSoftSettings::Reset( void ) void plEAXSourceSoftSettings::Read( hsStream *s ) { - s->ReadSwap( &fOcclusion ); - s->ReadSwap( &fOcclusionLFRatio ); - s->ReadSwap( &fOcclusionRoomRatio ); - s->ReadSwap( &fOcclusionDirectRatio ); + s->ReadLE( &fOcclusion ); + s->ReadLE( &fOcclusionLFRatio ); + s->ReadLE( &fOcclusionRoomRatio ); + s->ReadLE( &fOcclusionDirectRatio ); } void plEAXSourceSoftSettings::Write( hsStream *s ) { - s->WriteSwap( fOcclusion ); - s->WriteSwap( fOcclusionLFRatio ); - s->WriteSwap( fOcclusionRoomRatio ); - s->WriteSwap( fOcclusionDirectRatio ); + s->WriteLE( fOcclusion ); + s->WriteLE( fOcclusionLFRatio ); + s->WriteLE( fOcclusionRoomRatio ); + s->WriteLE( fOcclusionDirectRatio ); } void plEAXSourceSoftSettings::SetOcclusion( Int16 occ, hsScalar lfRatio, hsScalar roomRatio, hsScalar directRatio ) diff --git a/Sources/Plasma/PubUtilLib/plAudio/plEAXListenerMod.cpp b/Sources/Plasma/PubUtilLib/plAudio/plEAXListenerMod.cpp index 19071fc1..98731f22 100644 --- a/Sources/Plasma/PubUtilLib/plAudio/plEAXListenerMod.cpp +++ b/Sources/Plasma/PubUtilLib/plAudio/plEAXListenerMod.cpp @@ -173,30 +173,30 @@ void plEAXListenerMod::Read( hsStream* s, hsResMgr* mgr ) mgr->ReadKeyNotifyMe( s, TRACKED_NEW plGenRefMsg( GetKey(), plRefMsg::kOnCreate, 0, kRefSoftRegion ), plRefFlags::kActiveRef ); // Read the listener params - fListenerProps->ulEnvironment = s->ReadSwap32(); - fListenerProps->flEnvironmentSize = s->ReadSwapFloat(); - fListenerProps->flEnvironmentDiffusion = s->ReadSwapFloat(); - fListenerProps->lRoom = s->ReadSwap32(); - fListenerProps->lRoomHF = s->ReadSwap32(); - fListenerProps->lRoomLF = s->ReadSwap32(); - fListenerProps->flDecayTime = s->ReadSwapFloat(); - fListenerProps->flDecayHFRatio = s->ReadSwapFloat(); - fListenerProps->flDecayLFRatio = s->ReadSwapFloat(); - fListenerProps->lReflections = s->ReadSwap32(); - fListenerProps->flReflectionsDelay = s->ReadSwapFloat(); + fListenerProps->ulEnvironment = s->ReadLE32(); + fListenerProps->flEnvironmentSize = s->ReadLEFloat(); + fListenerProps->flEnvironmentDiffusion = s->ReadLEFloat(); + fListenerProps->lRoom = s->ReadLE32(); + fListenerProps->lRoomHF = s->ReadLE32(); + fListenerProps->lRoomLF = s->ReadLE32(); + fListenerProps->flDecayTime = s->ReadLEFloat(); + fListenerProps->flDecayHFRatio = s->ReadLEFloat(); + fListenerProps->flDecayLFRatio = s->ReadLEFloat(); + fListenerProps->lReflections = s->ReadLE32(); + fListenerProps->flReflectionsDelay = s->ReadLEFloat(); //fListenerProps->vReflectionsPan; // early reflections panning vector - fListenerProps->lReverb = s->ReadSwap32(); // late reverberation level relative to room effect - fListenerProps->flReverbDelay = s->ReadSwapFloat(); + fListenerProps->lReverb = s->ReadLE32(); // late reverberation level relative to room effect + fListenerProps->flReverbDelay = s->ReadLEFloat(); //fListenerProps->vReverbPan; // late reverberation panning vector - fListenerProps->flEchoTime = s->ReadSwapFloat(); - fListenerProps->flEchoDepth = s->ReadSwapFloat(); - fListenerProps->flModulationTime = s->ReadSwapFloat(); - fListenerProps->flModulationDepth = s->ReadSwapFloat(); - fListenerProps->flAirAbsorptionHF = s->ReadSwapFloat(); - fListenerProps->flHFReference = s->ReadSwapFloat(); - fListenerProps->flLFReference = s->ReadSwapFloat(); - fListenerProps->flRoomRolloffFactor = s->ReadSwapFloat(); - fListenerProps->ulFlags = s->ReadSwap32(); + fListenerProps->flEchoTime = s->ReadLEFloat(); + fListenerProps->flEchoDepth = s->ReadLEFloat(); + fListenerProps->flModulationTime = s->ReadLEFloat(); + fListenerProps->flModulationDepth = s->ReadLEFloat(); + fListenerProps->flAirAbsorptionHF = s->ReadLEFloat(); + fListenerProps->flHFReference = s->ReadLEFloat(); + fListenerProps->flLFReference = s->ReadLEFloat(); + fListenerProps->flRoomRolloffFactor = s->ReadLEFloat(); + fListenerProps->ulFlags = s->ReadLE32(); // Done reading, time to tell the audio sys we exist IRegister(); @@ -210,30 +210,30 @@ void plEAXListenerMod::Write( hsStream* s, hsResMgr* mgr ) mgr->WriteKey( s, fSoftRegion ); // Write the listener params - s->WriteSwap32( fListenerProps->ulEnvironment ); - s->WriteSwapFloat( fListenerProps->flEnvironmentSize ); - s->WriteSwapFloat( fListenerProps->flEnvironmentDiffusion ); - s->WriteSwap32( fListenerProps->lRoom ); - s->WriteSwap32( fListenerProps->lRoomHF ); - s->WriteSwap32( fListenerProps->lRoomLF ); - s->WriteSwapFloat( fListenerProps->flDecayTime ); - s->WriteSwapFloat( fListenerProps->flDecayHFRatio ); - s->WriteSwapFloat( fListenerProps->flDecayLFRatio ); - s->WriteSwap32( fListenerProps->lReflections ); - s->WriteSwapFloat( fListenerProps->flReflectionsDelay ); - //s->WriteSwapFloat( fListenerProps->vReflectionsPan; // early reflections panning vector - s->WriteSwap32( fListenerProps->lReverb ); // late reverberation level relative to room effect - s->WriteSwapFloat( fListenerProps->flReverbDelay ); - //s->WriteSwapFloat( fListenerProps->vReverbPan; // late reverberation panning vector - s->WriteSwapFloat( fListenerProps->flEchoTime ); - s->WriteSwapFloat( fListenerProps->flEchoDepth ); - s->WriteSwapFloat( fListenerProps->flModulationTime ); - s->WriteSwapFloat( fListenerProps->flModulationDepth ); - s->WriteSwapFloat( fListenerProps->flAirAbsorptionHF ); - s->WriteSwapFloat( fListenerProps->flHFReference ); - s->WriteSwapFloat( fListenerProps->flLFReference ); - s->WriteSwapFloat( fListenerProps->flRoomRolloffFactor ); - s->WriteSwap32( fListenerProps->ulFlags ); + s->WriteLE32( fListenerProps->ulEnvironment ); + s->WriteLEFloat( fListenerProps->flEnvironmentSize ); + s->WriteLEFloat( fListenerProps->flEnvironmentDiffusion ); + s->WriteLE32( fListenerProps->lRoom ); + s->WriteLE32( fListenerProps->lRoomHF ); + s->WriteLE32( fListenerProps->lRoomLF ); + s->WriteLEFloat( fListenerProps->flDecayTime ); + s->WriteLEFloat( fListenerProps->flDecayHFRatio ); + s->WriteLEFloat( fListenerProps->flDecayLFRatio ); + s->WriteLE32( fListenerProps->lReflections ); + s->WriteLEFloat( fListenerProps->flReflectionsDelay ); + //s->WriteLEFloat( fListenerProps->vReflectionsPan; // early reflections panning vector + s->WriteLE32( fListenerProps->lReverb ); // late reverberation level relative to room effect + s->WriteLEFloat( fListenerProps->flReverbDelay ); + //s->WriteLEFloat( fListenerProps->vReverbPan; // late reverberation panning vector + s->WriteLEFloat( fListenerProps->flEchoTime ); + s->WriteLEFloat( fListenerProps->flEchoDepth ); + s->WriteLEFloat( fListenerProps->flModulationTime ); + s->WriteLEFloat( fListenerProps->flModulationDepth ); + s->WriteLEFloat( fListenerProps->flAirAbsorptionHF ); + s->WriteLEFloat( fListenerProps->flHFReference ); + s->WriteLEFloat( fListenerProps->flLFReference ); + s->WriteLEFloat( fListenerProps->flRoomRolloffFactor ); + s->WriteLE32( fListenerProps->ulFlags ); } diff --git a/Sources/Plasma/PubUtilLib/plAudio/plSound.cpp b/Sources/Plasma/PubUtilLib/plAudio/plSound.cpp index 3df8c68d..bbc8e58a 100644 --- a/Sources/Plasma/PubUtilLib/plAudio/plSound.cpp +++ b/Sources/Plasma/PubUtilLib/plAudio/plSound.cpp @@ -1262,11 +1262,11 @@ void plSound::IRead( hsStream *s, hsResMgr *mgr ) { fPlaying = s->ReadBool(); fVirtualStartTime = hsTimer::GetSysSeconds(); // Need if we're autostart - fTime = s->ReadSwapDouble(); - fMaxFalloff = s->ReadSwap32(); - fMinFalloff = s->ReadSwap32(); - s->ReadSwap( &fCurrVolume ); - s->ReadSwap( &fDesiredVol ); + fTime = s->ReadLEDouble(); + fMaxFalloff = s->ReadLE32(); + fMinFalloff = s->ReadLE32(); + s->ReadLE( &fCurrVolume ); + s->ReadLE( &fDesiredVol ); /// mcn debugging - Thanks to some of my older sound code, it's possible that a few volumes /// will come in too large. This will only happen with scenes that were exported with that intermediate @@ -1279,11 +1279,11 @@ void plSound::IRead( hsStream *s, hsResMgr *mgr ) fCurrVolume = 1.f; fMaxVolume = fDesiredVol; - fOuterVol = s->ReadSwap32(); - fInnerCone = s->ReadSwap32(); - fOuterCone = s->ReadSwap32(); - s->ReadSwap( &fFadedVolume ); - s->ReadSwap( &fProperties ); + fOuterVol = s->ReadLE32(); + fInnerCone = s->ReadLE32(); + fOuterCone = s->ReadLE32(); + s->ReadLE( &fFadedVolume ); + s->ReadLE( &fProperties ); fType = s->ReadByte(); fPriority = s->ReadByte(); @@ -1312,16 +1312,16 @@ void plSound::IRead( hsStream *s, hsResMgr *mgr ) void plSound::IWrite( hsStream *s, hsResMgr *mgr ) { s->WriteBool(fPlaying); - s->WriteSwapDouble(fTime); - s->WriteSwap32(fMaxFalloff); - s->WriteSwap32(fMinFalloff); - s->WriteSwap( fCurrVolume ); - s->WriteSwap( fDesiredVol ); - s->WriteSwap32(fOuterVol); - s->WriteSwap32(fInnerCone); - s->WriteSwap32(fOuterCone); - s->WriteSwap( fFadedVolume ); - s->WriteSwap( fProperties ); + s->WriteLEDouble(fTime); + s->WriteLE32(fMaxFalloff); + s->WriteLE32(fMinFalloff); + s->WriteLE( fCurrVolume ); + s->WriteLE( fDesiredVol ); + s->WriteLE32(fOuterVol); + s->WriteLE32(fInnerCone); + s->WriteLE32(fOuterCone); + s->WriteLE( fFadedVolume ); + s->WriteLE( fProperties ); s->WriteByte( fType ); s->WriteByte( fPriority ); @@ -1347,24 +1347,24 @@ void plSound::IWrite( hsStream *s, hsResMgr *mgr ) void plSound::plFadeParams::Read( hsStream *s ) { - s->ReadSwap( &fLengthInSecs ); - s->ReadSwap( &fVolStart ); - s->ReadSwap( &fVolEnd ); - s->ReadSwap( &fType ); - s->ReadSwap( &fCurrTime ); - s->ReadSwap( &fStopWhenDone ); - s->ReadSwap( &fFadeSoftVol ); + s->ReadLE( &fLengthInSecs ); + s->ReadLE( &fVolStart ); + s->ReadLE( &fVolEnd ); + s->ReadLE( &fType ); + s->ReadLE( &fCurrTime ); + s->ReadLE( &fStopWhenDone ); + s->ReadLE( &fFadeSoftVol ); } void plSound::plFadeParams::Write( hsStream *s ) { - s->WriteSwap( fLengthInSecs ); - s->WriteSwap( fVolStart ); - s->WriteSwap( fVolEnd ); - s->WriteSwap( fType ); - s->WriteSwap( fCurrTime ); - s->WriteSwap( fStopWhenDone ); - s->WriteSwap( fFadeSoftVol ); + s->WriteLE( fLengthInSecs ); + s->WriteLE( fVolStart ); + s->WriteLE( fVolEnd ); + s->WriteLE( fType ); + s->WriteLE( fCurrTime ); + s->WriteLE( fStopWhenDone ); + s->WriteLE( fFadeSoftVol ); } hsScalar plSound::plFadeParams::InterpValue( void ) @@ -1534,11 +1534,11 @@ plAGApplicator *plSoundVolumeApplicator::CloneWithChannel( plAGChannel *channel void plSoundVolumeApplicator::Write( hsStream *stream, hsResMgr *mgr ) { plAGApplicator::Write( stream, mgr ); - stream->WriteSwap32( fIndex ); + stream->WriteLE32( fIndex ); } void plSoundVolumeApplicator::Read( hsStream *s, hsResMgr *mgr ) { plAGApplicator::Read( s, mgr ); - fIndex = s->ReadSwap32(); + fIndex = s->ReadLE32(); } diff --git a/Sources/Plasma/PubUtilLib/plAudio/plVoiceChat.cpp b/Sources/Plasma/PubUtilLib/plAudio/plVoiceChat.cpp index 0c63270a..1898d749 100644 --- a/Sources/Plasma/PubUtilLib/plAudio/plVoiceChat.cpp +++ b/Sources/Plasma/PubUtilLib/plAudio/plVoiceChat.cpp @@ -624,7 +624,7 @@ hsBool plSpeex::Encode(short *data, int numFrames, int *packedLength, hsRAMStrea frameLength = speex_bits_write(fBits, (char *)frameData, fFrameSize); // write data - length and bytes - out->WriteSwap(frameLength); + out->WriteLE(frameLength); *packedLength += sizeof(frameLength); // add length of encoded frame out->Write(frameLength, frameData); *packedLength += frameLength; // update length @@ -654,7 +654,7 @@ hsBool plSpeex::Decode(UInt8 *data, int size, int numFrames, int *numOutputBytes // Decode data for (int i = 0; i < numFrames; i++) { - stream.ReadSwap( &frameLen ); // read the length of the current frame to be decoded + stream.ReadLE( &frameLen ); // read the length of the current frame to be decoded stream.Read( frameLen, frameData ); // read the data memset(speexOutput, 0, fFrameSize * sizeof(float)); diff --git a/Sources/Plasma/PubUtilLib/plAudio/plWin32GroupedSound.cpp b/Sources/Plasma/PubUtilLib/plAudio/plWin32GroupedSound.cpp index 6b073a42..08a5bc45 100644 --- a/Sources/Plasma/PubUtilLib/plAudio/plWin32GroupedSound.cpp +++ b/Sources/Plasma/PubUtilLib/plAudio/plWin32GroupedSound.cpp @@ -98,13 +98,13 @@ void plWin32GroupedSound::SetPositionArray( UInt16 numSounds, UInt32 *posArra void plWin32GroupedSound::IRead( hsStream *s, hsResMgr *mgr ) { plWin32StaticSound::IRead( s, mgr ); - UInt16 i, n = s->ReadSwap16(); + UInt16 i, n = s->ReadLE16(); fStartPositions.SetCountAndZero( n ); fVolumes.SetCountAndZero( n ); for( i = 0; i < n; i++ ) { - fStartPositions[ i ] = s->ReadSwap32(); - fVolumes[ i ] = s->ReadSwapScalar(); + fStartPositions[ i ] = s->ReadLE32(); + fVolumes[ i ] = s->ReadLEScalar(); } } @@ -112,12 +112,12 @@ void plWin32GroupedSound::IWrite( hsStream *s, hsResMgr *mgr ) { plWin32StaticSound::IWrite( s, mgr ); - s->WriteSwap16( fStartPositions.GetCount() ); + s->WriteLE16( fStartPositions.GetCount() ); UInt16 i; for( i = 0; i < fStartPositions.GetCount(); i++ ) { - s->WriteSwap32( fStartPositions[ i ] ); - s->WriteSwapScalar( fVolumes[ i ] ); + s->WriteLE32( fStartPositions[ i ] ); + s->WriteLEScalar( fVolumes[ i ] ); } } diff --git a/Sources/Plasma/PubUtilLib/plAudioCore/plSoundBuffer.cpp b/Sources/Plasma/PubUtilLib/plAudioCore/plSoundBuffer.cpp index 48472d92..3aac30af 100644 --- a/Sources/Plasma/PubUtilLib/plAudioCore/plSoundBuffer.cpp +++ b/Sources/Plasma/PubUtilLib/plAudioCore/plSoundBuffer.cpp @@ -223,16 +223,16 @@ void plSoundBuffer::Read( hsStream *s, hsResMgr *mgr ) { hsKeyedObject::Read( s, mgr ); - s->ReadSwap( &fFlags ); - s->ReadSwap( &fDataLength ); + s->ReadLE( &fFlags ); + s->ReadLE( &fDataLength ); fFileName = s->ReadSafeString(); - s->ReadSwap( &fHeader.fFormatTag ); - s->ReadSwap( &fHeader.fNumChannels ); - s->ReadSwap( &fHeader.fNumSamplesPerSec ); - s->ReadSwap( &fHeader.fAvgBytesPerSec ); - s->ReadSwap( &fHeader.fBlockAlign ); - s->ReadSwap( &fHeader.fBitsPerSample ); + s->ReadLE( &fHeader.fFormatTag ); + s->ReadLE( &fHeader.fNumChannels ); + s->ReadLE( &fHeader.fNumSamplesPerSec ); + s->ReadLE( &fHeader.fAvgBytesPerSec ); + s->ReadLE( &fHeader.fBlockAlign ); + s->ReadLE( &fHeader.fBitsPerSample ); fValid = false; if( !( fFlags & kIsExternal ) ) @@ -262,8 +262,8 @@ void plSoundBuffer::Write( hsStream *s, hsResMgr *mgr ) if( fData == nil ) fFlags |= kIsExternal; - s->WriteSwap( fFlags ); - s->WriteSwap( fDataLength ); + s->WriteLE( fFlags ); + s->WriteLE( fDataLength ); // Truncate the path to just a file name on write if( fFileName != nil ) @@ -277,12 +277,12 @@ void plSoundBuffer::Write( hsStream *s, hsResMgr *mgr ) else s->WriteSafeString( nil ); - s->WriteSwap( fHeader.fFormatTag ); - s->WriteSwap( fHeader.fNumChannels ); - s->WriteSwap( fHeader.fNumSamplesPerSec ); - s->WriteSwap( fHeader.fAvgBytesPerSec ); - s->WriteSwap( fHeader.fBlockAlign ); - s->WriteSwap( fHeader.fBitsPerSample ); + s->WriteLE( fHeader.fFormatTag ); + s->WriteLE( fHeader.fNumChannels ); + s->WriteLE( fHeader.fNumSamplesPerSec ); + s->WriteLE( fHeader.fAvgBytesPerSec ); + s->WriteLE( fHeader.fBlockAlign ); + s->WriteLE( fHeader.fBitsPerSample ); if( !( fFlags & kIsExternal ) ) s->Write( fDataLength, fData ); diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAGAnim.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plAGAnim.cpp index 1578ae13..890b215d 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAGAnim.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAGAnim.cpp @@ -226,10 +226,10 @@ void plAGAnim::Read(hsStream *stream, hsResMgr *mgr) // read in the name of the animation itself fName = stream->ReadSafeString(); - fStart = stream->ReadSwapScalar(); - fEnd = stream->ReadSwapScalar(); + fStart = stream->ReadLEScalar(); + fEnd = stream->ReadLEScalar(); - int numApps = stream->ReadSwap32(); + int numApps = stream->ReadLE32(); fApps.reserve(numApps); // pre-allocate for performance int i; @@ -250,12 +250,12 @@ void plAGAnim::Write(hsStream *stream, hsResMgr *mgr) stream->WriteSafeString(fName); - stream->WriteSwapScalar(fStart); - stream->WriteSwapScalar(fEnd); + stream->WriteLEScalar(fStart); + stream->WriteLEScalar(fEnd); int numApps = fApps.size(); - stream->WriteSwap32(numApps); + stream->WriteLE32(numApps); int i; for (i = 0; i < numApps; i++) @@ -404,42 +404,42 @@ void plATCAnim::Read(hsStream *stream, hsResMgr *mgr) { plAGAnim::Read(stream, mgr); - fInitial = stream->ReadSwapScalar(); + fInitial = stream->ReadLEScalar(); fAutoStart = stream->Readbool(); - fLoopStart = stream->ReadSwapScalar(); - fLoopEnd = stream->ReadSwapScalar(); + fLoopStart = stream->ReadLEScalar(); + fLoopEnd = stream->ReadLEScalar(); fLoop = stream->Readbool(); fEaseInType = stream->ReadByte(); - fEaseInMin = stream->ReadSwapScalar(); - fEaseInMax = stream->ReadSwapScalar(); - fEaseInLength = stream->ReadSwapScalar(); + fEaseInMin = stream->ReadLEScalar(); + fEaseInMax = stream->ReadLEScalar(); + fEaseInLength = stream->ReadLEScalar(); fEaseOutType = stream->ReadByte(); - fEaseOutMin = stream->ReadSwapScalar(); - fEaseOutMax = stream->ReadSwapScalar(); - fEaseOutLength = stream->ReadSwapScalar(); + fEaseOutMin = stream->ReadLEScalar(); + fEaseOutMax = stream->ReadLEScalar(); + fEaseOutLength = stream->ReadLEScalar(); int i; - int numMarkers = stream->ReadSwap32(); + int numMarkers = stream->ReadLE32(); for (i = 0; i < numMarkers; i++) { char *name = stream->ReadSafeString(); - float time = stream->ReadSwapFloat(); + float time = stream->ReadLEFloat(); fMarkers[name] = time; } - int numLoops = stream->ReadSwap32(); + int numLoops = stream->ReadLE32(); for (i = 0; i < numLoops; i++) { char *name = stream->ReadSafeString(); - float begin = stream->ReadSwapScalar(); - float end = stream->ReadSwapScalar(); + float begin = stream->ReadLEScalar(); + float end = stream->ReadLEScalar(); fLoops[name] = std::pair(begin,end); } - int numStops = stream->ReadSwap32(); + int numStops = stream->ReadLE32(); for (i = 0; i < numStops; i++) - fStopPoints.push_back(stream->ReadSwapScalar()); + fStopPoints.push_back(stream->ReadLEScalar()); } // Write --------------------------------------------- @@ -448,41 +448,41 @@ void plATCAnim::Write(hsStream *stream, hsResMgr *mgr) { plAGAnim::Write(stream, mgr); - stream->WriteSwapScalar(fInitial); + stream->WriteLEScalar(fInitial); stream->Writebool(fAutoStart); - stream->WriteSwapScalar(fLoopStart); - stream->WriteSwapScalar(fLoopEnd); + stream->WriteLEScalar(fLoopStart); + stream->WriteLEScalar(fLoopEnd); stream->Writebool(fLoop); stream->WriteByte(fEaseInType); - stream->WriteSwapScalar(fEaseInMin); - stream->WriteSwapScalar(fEaseInMax); - stream->WriteSwapScalar(fEaseInLength); + stream->WriteLEScalar(fEaseInMin); + stream->WriteLEScalar(fEaseInMax); + stream->WriteLEScalar(fEaseInLength); stream->WriteByte(fEaseOutType); - stream->WriteSwapScalar(fEaseOutMin); - stream->WriteSwapScalar(fEaseOutMax); - stream->WriteSwapScalar(fEaseOutLength); + stream->WriteLEScalar(fEaseOutMin); + stream->WriteLEScalar(fEaseOutMax); + stream->WriteLEScalar(fEaseOutLength); - stream->WriteSwap32(fMarkers.size()); + stream->WriteLE32(fMarkers.size()); for (MarkerMap::iterator it = fMarkers.begin(); it != fMarkers.end(); it++) { stream->WriteSafeString(it->first); - stream->WriteSwapFloat(it->second); + stream->WriteLEFloat(it->second); } - stream->WriteSwap32(fLoops.size()); + stream->WriteLE32(fLoops.size()); for (LoopMap::iterator loopIt = fLoops.begin(); loopIt != fLoops.end(); loopIt++) { stream->WriteSafeString(loopIt->first); std::pair& loop = loopIt->second; - stream->WriteSwapFloat(loop.first); - stream->WriteSwapFloat(loop.second); + stream->WriteLEFloat(loop.first); + stream->WriteLEFloat(loop.second); } int i; - stream->WriteSwap32(fStopPoints.size()); + stream->WriteLE32(fStopPoints.size()); for (i = 0; i < fStopPoints.size(); i++) - stream->WriteSwapScalar(fStopPoints[i]); + stream->WriteLEScalar(fStopPoints[i]); } // CheckLoop -------------- @@ -629,8 +629,8 @@ void plEmoteAnim::Read(hsStream *stream, hsResMgr *mgr) plATCAnim::Read(stream, mgr); // plAGAnim::RegisterEmote(fName, this); - fFadeIn = stream->ReadSwapScalar(); - fFadeOut = stream->ReadSwapScalar(); + fFadeIn = stream->ReadLEScalar(); + fFadeOut = stream->ReadLEScalar(); fBodyUsage = static_cast(stream->ReadByte()); } @@ -640,8 +640,8 @@ void plEmoteAnim::Read(hsStream *stream, hsResMgr *mgr) void plEmoteAnim::Write(hsStream *stream, hsResMgr *mgr) { plATCAnim::Write(stream, mgr); - stream->WriteSwapScalar(fFadeIn); - stream->WriteSwapScalar(fFadeOut); + stream->WriteLEScalar(fFadeIn); + stream->WriteLEScalar(fFadeOut); stream->WriteByte(static_cast(fBodyUsage)); } diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAGMasterMod.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plAGMasterMod.cpp index 28c13d2f..75dfb149 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAGMasterMod.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAGMasterMod.cpp @@ -91,8 +91,8 @@ void plAGMasterMod::Write(hsStream *stream, hsResMgr *mgr) plModifier::Write(stream, mgr); int length = 0; - stream->WriteSwap32(length); // backwards compatability. Nuke on next format change. - stream->WriteSwap32(fPrivateAnims.size()); + stream->WriteLE32(length); // backwards compatability. Nuke on next format change. + stream->WriteLE32(fPrivateAnims.size()); int i; for (i = 0; i < fPrivateAnims.size(); i++) { @@ -111,14 +111,14 @@ void plAGMasterMod::Read(hsStream * stream, hsResMgr *mgr) plModifier::Read(stream, mgr); ////////////////////////////////////////// - int nameLength = stream->ReadSwap32(); // Unused. Nuke next format change. + int nameLength = stream->ReadLE32(); // Unused. Nuke next format change. char *junk = TRACKED_NEW char[nameLength+1]; // stream->Read(nameLength, junk); // junk[nameLength] = 0; // delete [] junk; // ////////////////////////////////////////// - int numPrivateAnims = stream->ReadSwap32(); + int numPrivateAnims = stream->ReadLE32(); fPrivateAnims.reserve(numPrivateAnims); // pre-allocate for performance int i; for (i = 0; i < numPrivateAnims; i++) diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAnimStage.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plAnimStage.cpp index 8619acbe..b2e2ec11 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAnimStage.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAnimStage.cpp @@ -744,41 +744,41 @@ void plAnimStage::Read(hsStream *stream, hsResMgr *mgr) delete [] fAnimName; fAnimName = stream->ReadSafeString(); fNotify = stream->ReadByte(); - fForwardType = (ForwardType)stream->ReadSwap32(); - fBackType = (BackType)stream->ReadSwap32(); - fAdvanceType = (AdvanceType)stream->ReadSwap32(); - fRegressType = (RegressType)stream->ReadSwap32(); - fLoops = stream->ReadSwap32(); + fForwardType = (ForwardType)stream->ReadLE32(); + fBackType = (BackType)stream->ReadLE32(); + fAdvanceType = (AdvanceType)stream->ReadLE32(); + fRegressType = (RegressType)stream->ReadLE32(); + fLoops = stream->ReadLE32(); fDoAdvanceTo = stream->Readbool(); - fAdvanceTo = stream->ReadSwap32(); + fAdvanceTo = stream->ReadLE32(); fDoRegressTo = stream->Readbool(); - fRegressTo = stream->ReadSwap32(); + fRegressTo = stream->ReadLE32(); } void plAnimStage::Write(hsStream *stream, hsResMgr *mgr) { stream->WriteSafeString(fAnimName); stream->WriteByte(fNotify); - stream->WriteSwap32(fForwardType); - stream->WriteSwap32(fBackType); - stream->WriteSwap32(fAdvanceType); - stream->WriteSwap32(fRegressType); - stream->WriteSwap32(fLoops); + stream->WriteLE32(fForwardType); + stream->WriteLE32(fBackType); + stream->WriteLE32(fAdvanceType); + stream->WriteLE32(fRegressType); + stream->WriteLE32(fLoops); stream->Writebool(fDoAdvanceTo); - stream->WriteSwap32(fAdvanceTo); + stream->WriteLE32(fAdvanceTo); stream->Writebool(fDoRegressTo); - stream->WriteSwap32(fRegressTo); + stream->WriteLE32(fRegressTo); } // SAVEAUX void plAnimStage::SaveAux(hsStream *stream, hsResMgr *mgr) { - stream->WriteSwapScalar(fLocalTime); - stream->WriteSwapScalar(fLength); - stream->WriteSwap32(fCurLoop); + stream->WriteLEScalar(fLocalTime); + stream->WriteLEScalar(fLength); + stream->WriteLE32(fCurLoop); stream->Writebool(fAttached); // no ephemeral stage at the moment } @@ -786,9 +786,9 @@ void plAnimStage::SaveAux(hsStream *stream, hsResMgr *mgr) // LOADAUX void plAnimStage::LoadAux(hsStream *stream, hsResMgr *mgr, double time) { - fLocalTime = stream->ReadSwapScalar(); - fLength = stream->ReadSwapScalar(); - fCurLoop = stream->ReadSwap32(); + fLocalTime = stream->ReadLEScalar(); + fLength = stream->ReadLEScalar(); + fCurLoop = stream->ReadLE32(); // This should actually be Readbool (lowercase), but I won't fix it since that // would require a version change fAttached = (stream->Readbool() != 0); diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plArmatureEffects.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plArmatureEffects.cpp index 9ee5052e..cbe8451e 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plArmatureEffects.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plArmatureEffects.cpp @@ -83,7 +83,7 @@ void plArmatureEffectsMgr::Read(hsStream *s, hsResMgr *mgr) { hsKeyedObject::Read(s, mgr); - int numEffects = s->ReadSwap32(); + int numEffects = s->ReadLE32(); while (numEffects > 0) { plRefMsg *msg = TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, -1, -1); @@ -98,7 +98,7 @@ void plArmatureEffectsMgr::Write(hsStream *s, hsResMgr *mgr) { hsKeyedObject::Write(s, mgr); - s->WriteSwap32(fEffects.GetCount()); + s->WriteLE32(fEffects.GetCount()); int i; for (i = 0; i < fEffects.GetCount(); i++) mgr->WriteKey(s, fEffects[i]->GetKey()); diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plArmatureMod.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plArmatureMod.cpp index 7a388861..d49a2834 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plArmatureMod.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plArmatureMod.cpp @@ -214,20 +214,20 @@ void plArmatureModBase::Read(hsStream * stream, hsResMgr *mgr) plAGMasterMod::Read(stream, mgr); int i; - int meshKeyCount = stream->ReadSwap32(); + int meshKeyCount = stream->ReadLE32(); for(i = 0; i < meshKeyCount; i++) { plKey meshKey = mgr->ReadKey(stream); fMeshKeys.push_back(meshKey); plKeyVector *vec = TRACKED_NEW plKeyVector; - int boneCount = stream->ReadSwap32(); + int boneCount = stream->ReadLE32(); for(int j = 0; j < boneCount; j++) vec->push_back(mgr->ReadKey(stream)); fUnusedBones.push_back(vec); } - int nBrains = stream->ReadSwap32(); + int nBrains = stream->ReadLE32(); for (i = 0; i < nBrains; i++) { plArmatureBrain * brain = (plArmatureBrain *)mgr->ReadCreatable(stream); @@ -241,20 +241,20 @@ void plArmatureModBase::Write(hsStream *stream, hsResMgr *mgr) int i; int meshKeyCount = fMeshKeys.size(); - stream->WriteSwap32(meshKeyCount); + stream->WriteLE32(meshKeyCount); for (i = 0; i < meshKeyCount; i++) { plKey meshKey = fMeshKeys[i]; mgr->WriteKey(stream, meshKey); // Should be a list per mesh key - stream->WriteSwap32(fUnusedBones[i]->size()); + stream->WriteLE32(fUnusedBones[i]->size()); for(int j = 0; j < fUnusedBones[i]->size(); j++) mgr->WriteKey(stream, (*fUnusedBones[i])[j]); } int nBrains = fBrains.size(); - stream->WriteSwap32(nBrains); + stream->WriteLE32(nBrains); for (i = 0; i < nBrains; i++) { mgr->WriteCreatable(stream, fBrains[i]); @@ -1721,7 +1721,7 @@ void plArmatureMod::Write(hsStream *stream, hsResMgr *mgr) mgr->WriteKey(stream, fMeshKeys[0]); stream->WriteSafeString(fRootName); int nBrains = fBrains.size(); - stream->WriteSwap32(nBrains); + stream->WriteLE32(nBrains); for (int i = 0; i < nBrains; i++) mgr->WriteCreatable(stream, fBrains[i]); @@ -1735,7 +1735,7 @@ void plArmatureMod::Write(hsStream *stream, hsResMgr *mgr) mgr->WriteKey(stream, fClothingOutfit->GetKey()); } - stream->WriteSwap32(fBodyType); + stream->WriteLE32(fBodyType); if( fEffects == nil ) stream->WriteBool( false ); else @@ -1744,8 +1744,8 @@ void plArmatureMod::Write(hsStream *stream, hsResMgr *mgr) mgr->WriteKey(stream, fEffects->GetKey()); } - stream->WriteSwapFloat(fPhysHeight); - stream->WriteSwapFloat(fPhysWidth); + stream->WriteLEFloat(fPhysHeight); + stream->WriteLEFloat(fPhysWidth); stream->WriteSafeString(fAnimationPrefix.c_str()); stream->WriteSafeString(fBodyAgeName.c_str()); @@ -1764,7 +1764,7 @@ void plArmatureMod::Read(hsStream * stream, hsResMgr *mgr) fRootName = stream->ReadSafeString(); // read in the brains - int nBrains = stream->ReadSwap32(); + int nBrains = stream->ReadLE32(); for (int i = 0; i < nBrains; i++) { plArmatureBrain * brain = (plArmatureBrain *)mgr->ReadCreatable(stream); @@ -1776,7 +1776,7 @@ void plArmatureMod::Read(hsStream * stream, hsResMgr *mgr) else fClothingOutfit = nil; - fBodyType = stream->ReadSwap32(); + fBodyType = stream->ReadLE32(); if( stream->ReadBool() ) { @@ -1825,8 +1825,8 @@ void plArmatureMod::Read(hsStream * stream, hsResMgr *mgr) else fEffects = nil; - fPhysHeight = stream->ReadSwapFloat(); - fPhysWidth = stream->ReadSwapFloat(); + fPhysHeight = stream->ReadLEFloat(); + fPhysWidth = stream->ReadLEFloat(); char* temp = stream->ReadSafeString(); fAnimationPrefix = temp; @@ -2608,14 +2608,14 @@ void plArmatureLODMod::Read(hsStream *stream, hsResMgr *mgr) plArmatureMod::Read(stream, mgr); fMeshKeys.clear(); - int meshKeyCount = stream->ReadSwap32(); + int meshKeyCount = stream->ReadLE32(); for(int i = 0; i < meshKeyCount; i++) { plKey meshKey = mgr->ReadKey(stream); fMeshKeys.push_back(meshKey); plKeyVector *vec = TRACKED_NEW plKeyVector; - int boneCount = stream->ReadSwap32(); + int boneCount = stream->ReadLE32(); for(int j = 0; j < boneCount; j++) vec->push_back(mgr->ReadKey(stream)); fUnusedBones.push_back(vec); @@ -2628,7 +2628,7 @@ void plArmatureLODMod::Write(hsStream *stream, hsResMgr *mgr) plArmatureMod::Write(stream, mgr); int meshKeyCount = fMeshKeys.size(); - stream->WriteSwap32(meshKeyCount); + stream->WriteLE32(meshKeyCount); for(int i = 0; i < meshKeyCount; i++) { @@ -2636,7 +2636,7 @@ void plArmatureLODMod::Write(hsStream *stream, hsResMgr *mgr) mgr->WriteKey(stream, meshKey); // Should be a list per mesh key - stream->WriteSwap32(fUnusedBones[i]->size()); + stream->WriteLE32(fUnusedBones[i]->size()); for(int j = 0; j < fUnusedBones[i]->size(); j++) mgr->WriteKey(stream, (*fUnusedBones[i])[j]); } diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAvBrain.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plAvBrain.cpp index 7f7fb72e..e81fefa2 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAvBrain.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAvBrain.cpp @@ -132,13 +132,13 @@ void plArmatureBrain::Write(hsStream *stream, hsResMgr *mgr) plCreatable::Write(stream, mgr); // plAvBrain - stream->WriteSwap32(0); + stream->WriteLE32(0); stream->WriteBool(false); // plAvBrainUser - stream->WriteSwap32(0); - stream->WriteSwapScalar(0.f); - stream->WriteSwapDouble(0.f); + stream->WriteLE32(0); + stream->WriteLEScalar(0.f); + stream->WriteLEDouble(0.f); } void plArmatureBrain::Read(hsStream *stream, hsResMgr *mgr) @@ -146,14 +146,14 @@ void plArmatureBrain::Read(hsStream *stream, hsResMgr *mgr) plCreatable::Read(stream, mgr); // plAvBrain - stream->ReadSwap32(); + stream->ReadLE32(); if (stream->ReadBool()) mgr->ReadKey(stream); // plAvBrainUser - stream->ReadSwap32(); - stream->ReadSwapScalar(); - stream->ReadSwapDouble(); + stream->ReadLE32(); + stream->ReadLEScalar(); + stream->ReadLEDouble(); } // MSGRECEIVE diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainCoop.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainCoop.cpp index 6fdfae89..6ce293e8 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainCoop.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainCoop.cpp @@ -199,8 +199,8 @@ void plAvBrainCoop::Read(hsStream *stream, hsResMgr *mgr) { plAvBrainGeneric::Read(stream, mgr); - fInitiatorID = stream->ReadSwap32(); - fInitiatorSerial = stream->ReadSwap16(); + fInitiatorID = stream->ReadLE32(); + fInitiatorSerial = stream->ReadLE16(); if(stream->Readbool()) { @@ -212,7 +212,7 @@ void plAvBrainCoop::Read(hsStream *stream, hsResMgr *mgr) } fWaitingForClick = stream->Readbool(); - unsigned numRecipients = stream->ReadSwap16(); + unsigned numRecipients = stream->ReadLE16(); for (unsigned i = 0; i < numRecipients; i++) fRecipients.push_back(mgr->ReadKey(stream)); } @@ -223,8 +223,8 @@ void plAvBrainCoop::Write(hsStream *stream, hsResMgr *mgr) { plAvBrainGeneric::Write(stream, mgr); - stream->WriteSwap32(fInitiatorID); - stream->WriteSwap16(fInitiatorSerial); + stream->WriteLE32(fInitiatorID); + stream->WriteLE16(fInitiatorSerial); bool hasHostKey = (fHostKey != nil); bool hasGuestKey = (fGuestKey != nil); @@ -239,7 +239,7 @@ void plAvBrainCoop::Write(hsStream *stream, hsResMgr *mgr) stream->Writebool(fWaitingForClick); - stream->WriteSwap16(fRecipients.size()); + stream->WriteLE16(fRecipients.size()); for (unsigned i = 0; i < fRecipients.size(); i++) mgr->WriteKey(stream, fRecipients[i]); } diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainGeneric.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainGeneric.cpp index 1acf553e..7535156c 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainGeneric.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainGeneric.cpp @@ -779,7 +779,7 @@ void plAvBrainGeneric::Write(hsStream *stream, hsResMgr *mgr) { plArmatureBrain::Write(stream, mgr); int numStages = fStages->size(); - stream->WriteSwap32(numStages); + stream->WriteLE32(numStages); for(int i = 0; i < numStages; i++) { @@ -790,9 +790,9 @@ void plAvBrainGeneric::Write(hsStream *stream, hsResMgr *mgr) stage->SaveAux(stream, mgr); // save ephemeral state } - stream->WriteSwap32(fCurStage); - stream->WriteSwap32(fType); - stream->WriteSwap32(fExitFlags); + stream->WriteLE32(fCurStage); + stream->WriteLE32(fType); + stream->WriteLE32(fExitFlags); stream->WriteByte(fMode); stream->Writebool(fForward); @@ -810,8 +810,8 @@ void plAvBrainGeneric::Write(hsStream *stream, hsResMgr *mgr) stream->WriteBool(false); } - stream->WriteSwapScalar(fFadeIn); - stream->WriteSwapScalar(fFadeOut); + stream->WriteLEScalar(fFadeIn); + stream->WriteLEScalar(fFadeOut); stream->WriteByte(fMoveMode); stream->WriteByte(fBodyUsage); mgr->WriteKey(stream, fRecipient); @@ -822,7 +822,7 @@ void plAvBrainGeneric::Write(hsStream *stream, hsResMgr *mgr) void plAvBrainGeneric::Read(hsStream *stream, hsResMgr *mgr) { plArmatureBrain::Read(stream, mgr); - int numStages = stream->ReadSwap32(); + int numStages = stream->ReadLE32(); for(int i = 0; i < numStages; i++) { @@ -834,9 +834,9 @@ void plAvBrainGeneric::Read(hsStream *stream, hsResMgr *mgr) fStages->push_back(stage); } - fCurStage = stream->ReadSwap32(); - fType = static_cast(stream->ReadSwap32()); - fExitFlags = stream->ReadSwap32(); + fCurStage = stream->ReadLE32(); + fType = static_cast(stream->ReadLE32()); + fExitFlags = stream->ReadLE32(); fMode = static_cast(stream->ReadByte()); fForward = stream->Readbool(); @@ -851,8 +851,8 @@ void plAvBrainGeneric::Read(hsStream *stream, hsResMgr *mgr) fEndMessage = nil; } - fFadeIn = stream->ReadSwapScalar(); - fFadeOut = stream->ReadSwapScalar(); + fFadeIn = stream->ReadLEScalar(); + fFadeOut = stream->ReadLEScalar(); fMoveMode = static_cast(stream->ReadByte()); fBodyUsage = static_cast(stream->ReadByte()); fRecipient = mgr->ReadKey(stream); diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAvLadderModifier.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plAvLadderModifier.cpp index 3c9529bd..5d7a3450 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAvLadderModifier.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAvLadderModifier.cpp @@ -334,26 +334,26 @@ void plAvLadderMod::Read(hsStream *stream, hsResMgr *mgr) { plSingleModifier::Read(stream, mgr); - fType = stream->ReadSwap32(); - fLoops = stream->ReadSwap32(); + fType = stream->ReadLE32(); + fLoops = stream->ReadLE32(); fGoingUp = stream->Readbool(); fEnabled = stream->Readbool(); - fLadderView.fX = stream->ReadSwapScalar(); - fLadderView.fY = stream->ReadSwapScalar(); - fLadderView.fZ = stream->ReadSwapScalar(); + fLadderView.fX = stream->ReadLEScalar(); + fLadderView.fY = stream->ReadLEScalar(); + fLadderView.fZ = stream->ReadLEScalar(); } void plAvLadderMod::Write(hsStream *stream, hsResMgr *mgr) { plSingleModifier::Write(stream, mgr); - stream->WriteSwap32(fType); - stream->WriteSwap32(fLoops); + stream->WriteLE32(fType); + stream->WriteLE32(fLoops); stream->Writebool(fGoingUp); stream->WriteBool(fEnabled); - stream->WriteSwapScalar(fLadderView.fX); - stream->WriteSwapScalar(fLadderView.fY); - stream->WriteSwapScalar(fLadderView.fZ); + stream->WriteLEScalar(fLadderView.fX); + stream->WriteLEScalar(fLadderView.fY); + stream->WriteLEScalar(fLadderView.fZ); } // true is up; false is down diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAvatarClothing.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plAvatarClothing.cpp index 4008c753..ea606273 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAvatarClothing.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAvatarClothing.cpp @@ -180,7 +180,7 @@ void plClothingItem::Read(hsStream *s, hsResMgr *mgr) if (s->ReadBool()) mgr->ReadKeyNotifyMe(s, TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, -1, -1), plRefFlags::kActiveRef); // thumbnail - int tileCount = s->ReadSwap32(); + int tileCount = s->ReadLE32(); int i, j; for (i = 0; i < tileCount; i++) { @@ -237,7 +237,7 @@ void plClothingItem::Write(hsStream *s, hsResMgr *mgr) if (fTextures[i] == nil) texSkip++; - s->WriteSwap32(fTextures.GetCount() - texSkip); + s->WriteLE32(fTextures.GetCount() - texSkip); for (i = 0; i < fTextures.GetCount(); i++) { if (fTextures[i] == nil) @@ -1184,7 +1184,7 @@ void plClothingOutfit::WearRandomOutfit() hsBool plClothingOutfit::ReadItems(hsStream* s, hsResMgr* mgr, hsBool broadcast /* = true */) { hsBool result = true; - UInt32 numItems = s->ReadSwap32(); + UInt32 numItems = s->ReadLE32(); int i; for (i = 0; i < numItems; i++) { @@ -1214,7 +1214,7 @@ hsBool plClothingOutfit::ReadItems(hsStream* s, hsResMgr* mgr, hsBool broadcast void plClothingOutfit::WriteItems(hsStream *s, hsResMgr *mgr) { - s->WriteSwap32(fItems.GetCount()); + s->WriteLE32(fItems.GetCount()); int i; for (i = 0; i < fItems.GetCount(); i++) { diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAvatarTasks.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plAvatarTasks.cpp index 7c511834..62b2ff21 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAvatarTasks.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAvatarTasks.cpp @@ -482,10 +482,10 @@ void plAvAnimTask::LeaveAge(plArmatureMod *avatar) void plAvAnimTask::Read(hsStream *stream, hsResMgr *mgr) { fAnimName = stream->ReadSafeString(); - fInitialBlend = stream->ReadSwapScalar(); - fTargetBlend = stream->ReadSwapScalar(); - fFadeSpeed = stream->ReadSwapScalar(); - fSetTime = stream->ReadSwapScalar(); + fInitialBlend = stream->ReadLEScalar(); + fTargetBlend = stream->ReadLEScalar(); + fFadeSpeed = stream->ReadLEScalar(); + fSetTime = stream->ReadLEScalar(); fStart = stream->ReadBool(); fLoop = stream->ReadBool(); fAttach = stream->ReadBool(); @@ -495,10 +495,10 @@ void plAvAnimTask::Read(hsStream *stream, hsResMgr *mgr) void plAvAnimTask::Write(hsStream *stream, hsResMgr *mgr) { stream->WriteSafeString(fAnimName); - stream->WriteSwapScalar(fInitialBlend); - stream->WriteSwapScalar(fTargetBlend); - stream->WriteSwapScalar(fFadeSpeed); - stream->WriteSwapScalar(fSetTime); + stream->WriteLEScalar(fInitialBlend); + stream->WriteLEScalar(fTargetBlend); + stream->WriteLEScalar(fFadeSpeed); + stream->WriteLEScalar(fSetTime); stream->WriteBool(fStart); stream->WriteBool(fLoop); stream->WriteBool(fAttach); diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plMultistageBehMod.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plMultistageBehMod.cpp index e92e5a28..cb02b8f2 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plMultistageBehMod.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plMultistageBehMod.cpp @@ -211,7 +211,7 @@ void plMultistageBehMod::Read(hsStream *stream, hsResMgr *mgr) IDeleteStageVec(); fStages = TRACKED_NEW plAnimStageVec; - int numStages = stream->ReadSwap32(); + int numStages = stream->ReadLE32(); fStages->reserve(numStages); int i; @@ -223,7 +223,7 @@ void plMultistageBehMod::Read(hsStream *stream, hsResMgr *mgr) fStages->push_back(stage); } - int numReceivers = stream->ReadSwap32(); + int numReceivers = stream->ReadLE32(); fReceivers.clear(); fReceivers.reserve(numReceivers); for (i = 0; i < numReceivers; i++) @@ -242,7 +242,7 @@ void plMultistageBehMod::Write(hsStream *stream, hsResMgr *mgr) stream->Writebool(fReverseFBControlsOnRelease); int numStages = fStages->size(); - stream->WriteSwap32(numStages); + stream->WriteLE32(numStages); int i; for (i = 0; i < numStages; i++) @@ -252,7 +252,7 @@ void plMultistageBehMod::Write(hsStream *stream, hsResMgr *mgr) } int numReceivers = fReceivers.size(); - stream->WriteSwap32(numReceivers); + stream->WriteLE32(numReceivers); for (i = 0; i < numReceivers; i++) { plKey key = fReceivers[i]; diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plOneShotMod.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plOneShotMod.cpp index 40c1d6fd..4efe5672 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plOneShotMod.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plOneShotMod.cpp @@ -166,7 +166,7 @@ void plOneShotMod::Read(hsStream *stream, hsResMgr *mgr) // read in the name of the animation itself fAnimName = stream->ReadSafeString(); - fSeekDuration = stream->ReadSwapScalar(); + fSeekDuration = stream->ReadLEScalar(); fDrivable = stream->ReadBool(); fReversable = stream->ReadBool(); fSmartSeek = (float)stream->ReadBool(); @@ -178,7 +178,7 @@ void plOneShotMod::Write(hsStream *stream, hsResMgr *mgr) plMultiModifier::Write(stream, mgr); stream->WriteSafeString(fAnimName); - stream->WriteSwapScalar(fSeekDuration); + stream->WriteLEScalar(fSeekDuration); stream->WriteBool(fDrivable); stream->WriteBool(fReversable); stream->WriteBool((hsBool)fSmartSeek); diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plScalarChannel.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plScalarChannel.cpp index 52c9e2ef..9b43428e 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plScalarChannel.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plScalarChannel.cpp @@ -160,13 +160,13 @@ plScalarConstant::~plScalarConstant() void plScalarConstant::Read(hsStream *stream, hsResMgr *mgr) { plScalarChannel::Read(stream, mgr); - fResult = stream->ReadSwapScalar(); + fResult = stream->ReadLEScalar(); } void plScalarConstant::Write(hsStream *stream, hsResMgr *mgr) { plScalarChannel::Write(stream, mgr); - stream->WriteSwapScalar(fResult); + stream->WriteLEScalar(fResult); } diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plSeekPointMod.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plSeekPointMod.cpp index 2526518a..bc2bd205 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plSeekPointMod.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plSeekPointMod.cpp @@ -87,7 +87,7 @@ void plSeekPointMod::Read(hsStream *stream, hsResMgr *mgr) plMultiModifier::Read(stream, mgr); // read in the name of the animation itself - int length = stream->ReadSwap32(); + int length = stream->ReadLE32(); if(length > 0) { fName = TRACKED_NEW char[length + 1]; @@ -102,7 +102,7 @@ void plSeekPointMod::Write(hsStream *stream, hsResMgr *mgr) plMultiModifier::Write(stream, mgr); int length = strlen(fName); - stream->WriteSwap32(length); + stream->WriteLE32(length); if (length > 0) { stream->Write(length, fName); diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plSittingModifier.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plSittingModifier.cpp index cd83b592..c03b648a 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plSittingModifier.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plSittingModifier.cpp @@ -98,7 +98,7 @@ void plSittingModifier::Read(hsStream *stream, hsResMgr *mgr) fMiscFlags = stream->ReadByte(); - int keyCount = stream->ReadSwap32(); + int keyCount = stream->ReadLE32(); for (int i = 0; i < keyCount; i++ ) fNotifyKeys.Append(mgr->ReadKey(stream)); } @@ -111,7 +111,7 @@ void plSittingModifier::Write(hsStream *stream, hsResMgr *mgr) stream->WriteByte(fMiscFlags); - stream->WriteSwap32(fNotifyKeys.GetCount()); + stream->WriteLE32(fNotifyKeys.GetCount()); for (int i = 0; i < fNotifyKeys.GetCount(); i++) mgr->WriteKey(stream, fNotifyKeys[i]); } diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plSwimRegion.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plSwimRegion.cpp index c032c800..3edfaba8 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plSwimRegion.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plSwimRegion.cpp @@ -50,18 +50,18 @@ void plSwimRegionInterface::Read(hsStream* s, hsResMgr* mgr) { plObjInterface::Read(s, mgr); - fDownBuoyancy = s->ReadSwapScalar(); - fUpBuoyancy = s->ReadSwapScalar(); - fMaxUpwardVel = s->ReadSwapScalar(); + fDownBuoyancy = s->ReadLEScalar(); + fUpBuoyancy = s->ReadLEScalar(); + fMaxUpwardVel = s->ReadLEScalar(); } void plSwimRegionInterface::Write(hsStream* s, hsResMgr* mgr) { plObjInterface::Write(s, mgr); - s->WriteSwapScalar(fDownBuoyancy); - s->WriteSwapScalar(fUpBuoyancy); - s->WriteSwapScalar(fMaxUpwardVel); + s->WriteLEScalar(fDownBuoyancy); + s->WriteLEScalar(fUpBuoyancy); + s->WriteLEScalar(fMaxUpwardVel); } void plSwimRegionInterface::GetCurrent(plPhysicalControllerCore *physical, hsVector3 &linearResult, hsScalar &angularResult, hsScalar elapsed) @@ -86,11 +86,11 @@ void plSwimCircularCurrentRegion::Read(hsStream* stream, hsResMgr* mgr) { plSwimRegionInterface::Read(stream, mgr); - fRotation = stream->ReadSwapScalar(); - fPullNearDistSq = stream->ReadSwapScalar(); - fPullNearVel = stream->ReadSwapScalar(); - fPullFarDistSq = stream->ReadSwapScalar(); - fPullFarVel = stream->ReadSwapScalar(); + fRotation = stream->ReadLEScalar(); + fPullNearDistSq = stream->ReadLEScalar(); + fPullNearVel = stream->ReadLEScalar(); + fPullFarDistSq = stream->ReadLEScalar(); + fPullFarVel = stream->ReadLEScalar(); mgr->ReadKeyNotifyMe(stream, TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, -1, -1), plRefFlags::kActiveRef); // currentSO } @@ -98,11 +98,11 @@ void plSwimCircularCurrentRegion::Write(hsStream* stream, hsResMgr* mgr) { plSwimRegionInterface::Write(stream, mgr); - stream->WriteSwapScalar(fRotation); - stream->WriteSwapScalar(fPullNearDistSq); - stream->WriteSwapScalar(fPullNearVel); - stream->WriteSwapScalar(fPullFarDistSq); - stream->WriteSwapScalar(fPullFarVel); + stream->WriteLEScalar(fRotation); + stream->WriteLEScalar(fPullNearDistSq); + stream->WriteLEScalar(fPullNearVel); + stream->WriteLEScalar(fPullFarDistSq); + stream->WriteLEScalar(fPullFarVel); mgr->WriteKey(stream, fCurrentSO); } @@ -204,10 +204,10 @@ void plSwimStraightCurrentRegion::Read(hsStream* stream, hsResMgr* mgr) { plSwimRegionInterface::Read(stream, mgr); - fNearDist = stream->ReadSwapScalar(); - fNearVel = stream->ReadSwapScalar(); - fFarDist = stream->ReadSwapScalar(); - fFarVel = stream->ReadSwapScalar(); + fNearDist = stream->ReadLEScalar(); + fNearVel = stream->ReadLEScalar(); + fFarDist = stream->ReadLEScalar(); + fFarVel = stream->ReadLEScalar(); mgr->ReadKeyNotifyMe(stream, TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, -1, -1), plRefFlags::kActiveRef); // currentSO } @@ -215,10 +215,10 @@ void plSwimStraightCurrentRegion::Write(hsStream* stream, hsResMgr* mgr) { plSwimRegionInterface::Write(stream, mgr); - stream->WriteSwapScalar(fNearDist); - stream->WriteSwapScalar(fNearVel); - stream->WriteSwapScalar(fFarDist); - stream->WriteSwapScalar(fFarVel); + stream->WriteLEScalar(fNearDist); + stream->WriteLEScalar(fNearVel); + stream->WriteLEScalar(fFarDist); + stream->WriteLEScalar(fFarVel); mgr->WriteKey(stream, fCurrentSO); } diff --git a/Sources/Plasma/PubUtilLib/plClientResMgr/plClientResMgr.cpp b/Sources/Plasma/PubUtilLib/plClientResMgr/plClientResMgr.cpp index fb9114c5..f79b5ded 100644 --- a/Sources/Plasma/PubUtilLib/plClientResMgr/plClientResMgr.cpp +++ b/Sources/Plasma/PubUtilLib/plClientResMgr/plClientResMgr.cpp @@ -88,13 +88,13 @@ void plClientResMgr::ILoadResources(const char* resfile) hsUNIXStream in; if (in.Open(wFilename, L"rb")) { - UInt32 header = in.ReadSwap32(); - UInt32 version = in.ReadSwap32(); + UInt32 header = in.ReadLE32(); + UInt32 version = in.ReadLE32(); UInt32 num_resources = 0; switch (version) { case 1: - num_resources = in.ReadSwap32(); + num_resources = in.ReadLE32(); for (int i = 0; i < num_resources; i++) { plMipmap* res_data = NULL; @@ -109,7 +109,7 @@ void plClientResMgr::ILoadResources(const char* resfile) if (res_type == ".png") { // Read resource stream size, but the PNG has that info in the header // so it's not needed - res_size = in.ReadSwap32(); + res_size = in.ReadLE32(); res_data = plPNG::Instance().ReadFromStream(&in); } else if (res_type == ".jpg") { // Don't read resource stream size, as plJPEG's reader will need it @@ -119,7 +119,7 @@ void plClientResMgr::ILoadResources(const char* resfile) // so default fallback is targa // TODO - Add plTarga::ReadFromStream() // for now, just skip the unknown resource and put NULL into the map - res_size = in.ReadSwap32(); + res_size = in.ReadLE32(); in.Skip(res_size); } diff --git a/Sources/Plasma/PubUtilLib/plCompression/plZlibStream.cpp b/Sources/Plasma/PubUtilLib/plCompression/plZlibStream.cpp index 336af121..75c5af93 100644 --- a/Sources/Plasma/PubUtilLib/plCompression/plZlibStream.cpp +++ b/Sources/Plasma/PubUtilLib/plCompression/plZlibStream.cpp @@ -211,7 +211,7 @@ int plZlibStream::IValidateGzHeader(UInt32 byteCount, const void* buffer) if ((flags & EXTRA_FIELD) != 0) { // skip the extra field - UInt16 len = s.ReadSwap16(); + UInt16 len = s.ReadLE16(); while (len-- != 0 && s.ReadByte()) { CheckForEnd(); @@ -241,7 +241,7 @@ int plZlibStream::IValidateGzHeader(UInt32 byteCount, const void* buffer) // skip the header crc if ((flags & HEAD_CRC) != 0) { - s.ReadSwap16(); + s.ReadLE16(); CheckForEnd(); } diff --git a/Sources/Plasma/PubUtilLib/plContainer/plKeysAndValues.cpp b/Sources/Plasma/PubUtilLib/plContainer/plKeysAndValues.cpp index b2a4723d..51848422 100644 --- a/Sources/Plasma/PubUtilLib/plContainer/plKeysAndValues.cpp +++ b/Sources/Plasma/PubUtilLib/plContainer/plKeysAndValues.cpp @@ -228,20 +228,20 @@ bool plKeysAndValues::GetValueIterators(const xtl::istring & key, Values::const_ void plKeysAndValues::Read(hsStream * s) { UInt16 nkeys; - s->ReadSwap(&nkeys); + s->ReadLE(&nkeys); for (int ki=0; kiReadSwap(&strlen); + s->ReadLE(&strlen); std::string key; key.assign(strlen+1,'\0'); s->Read(strlen,(void*)key.data()); key.resize(strlen); UInt16 nvalues; - s->ReadSwap(&nvalues); + s->ReadLE(&nvalues); for (int vi=0; viReadSwap(&strlen); + s->ReadLE(&strlen); std::string value; value.assign(strlen+1,'\0'); s->Read(strlen,(void*)value.data()); @@ -255,24 +255,24 @@ void plKeysAndValues::Read(hsStream * s) void plKeysAndValues::Write(hsStream * s) { // write nkeys - s->WriteSwap((UInt16)fKeys.size()); + s->WriteLE((UInt16)fKeys.size()); // iterate through keys Keys::const_iterator ki,ke; GetKeyIterators(ki,ke); for (ki;ki!=ke;++ki) { // write key string - s->WriteSwap((UInt16)ki->first.size()); + s->WriteLE((UInt16)ki->first.size()); s->Write(ki->first.size(),ki->first.c_str()); // write nvalues for this key - s->WriteSwap((UInt16)ki->second.size()); + s->WriteLE((UInt16)ki->second.size()); // iterate through values for this key Values::const_iterator vi,ve; GetValueIterators(ki->first,vi,ve); for (vi;vi!=ve;++vi) { // write value string - s->WriteSwap((UInt16)vi->size()); + s->WriteLE((UInt16)vi->size()); s->Write(vi->size(),vi->c_str()); } } diff --git a/Sources/Plasma/PubUtilLib/plDrawable/plActivePrintShape.cpp b/Sources/Plasma/PubUtilLib/plDrawable/plActivePrintShape.cpp index f91c6a81..cec356fe 100644 --- a/Sources/Plasma/PubUtilLib/plDrawable/plActivePrintShape.cpp +++ b/Sources/Plasma/PubUtilLib/plDrawable/plActivePrintShape.cpp @@ -65,7 +65,7 @@ void plActivePrintShape::Read(hsStream* stream, hsResMgr* mgr) { plPrintShape::Read(stream, mgr); - UInt32 n = stream->ReadSwap32(); + UInt32 n = stream->ReadLE32(); fDecalMgrs.SetCount(n); int i; for( i = 0; i < n; i++ ) @@ -78,7 +78,7 @@ void plActivePrintShape::Write(hsStream* stream, hsResMgr* mgr) { plPrintShape::Write(stream, mgr); - stream->WriteSwap32(fDecalMgrs.GetCount()); + stream->WriteLE32(fDecalMgrs.GetCount()); int i; for( i = 0; i < fDecalMgrs.GetCount(); i++ ) mgr->WriteKey(stream, fDecalMgrs[i]); diff --git a/Sources/Plasma/PubUtilLib/plDrawable/plCluster.cpp b/Sources/Plasma/PubUtilLib/plDrawable/plCluster.cpp index 364f68bb..88d256f3 100644 --- a/Sources/Plasma/PubUtilLib/plDrawable/plCluster.cpp +++ b/Sources/Plasma/PubUtilLib/plDrawable/plCluster.cpp @@ -69,7 +69,7 @@ void plCluster::Read(hsStream* s, plClusterGroup* grp) hsAssert(fGroup->GetTemplate(), "Template should have been loaded by now"); const int numVerts = fGroup->GetTemplate()->NumVerts(); - const int numInst = s->ReadSwap32(); + const int numInst = s->ReadLE32(); fInsts.SetCount(numInst); int i; for( i = 0; i < numInst; i++ ) @@ -85,7 +85,7 @@ void plCluster::Write(hsStream* s) const fEncoding.Write(s); const int numVerts = fGroup->GetTemplate()->NumVerts(); - s->WriteSwap32(fInsts.GetCount()); + s->WriteLE32(fInsts.GetCount()); int i; for( i = 0; i < fInsts.GetCount(); i++ ) { diff --git a/Sources/Plasma/PubUtilLib/plDrawable/plClusterGroup.cpp b/Sources/Plasma/PubUtilLib/plDrawable/plClusterGroup.cpp index 6f17b525..854ab339 100644 --- a/Sources/Plasma/PubUtilLib/plDrawable/plClusterGroup.cpp +++ b/Sources/Plasma/PubUtilLib/plDrawable/plClusterGroup.cpp @@ -114,7 +114,7 @@ void plClusterGroup::Read(hsStream* stream, hsResMgr* mgr) mgr->ReadKeyNotifyMe(stream, TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, -1, kRefMaterial), plRefFlags::kActiveRef); - const int numClust = stream->ReadSwap32(); + const int numClust = stream->ReadLE32(); fClusters.SetCount(numClust); for( i = 0; i < numClust; i++ ) { @@ -122,17 +122,17 @@ void plClusterGroup::Read(hsStream* stream, hsResMgr* mgr) fClusters[i]->Read(stream, this); } - const int numRegions = stream->ReadSwap32(); + const int numRegions = stream->ReadLE32(); for( i = 0; i < numRegions; i++ ) mgr->ReadKeyNotifyMe(stream, TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, -1, kRefRegion), plRefFlags::kActiveRef); - const int numLights = stream->ReadSwap32(); + const int numLights = stream->ReadLE32(); for( i = 0; i < numLights; i++ ) mgr->ReadKeyNotifyMe(stream, TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, -1, kRefLight), plRefFlags::kActiveRef); fLOD.Read(stream); - fRenderLevel.Set(stream->ReadSwap32()); + fRenderLevel.Set(stream->ReadLE32()); fSceneNode = mgr->ReadKey(stream); @@ -150,21 +150,21 @@ void plClusterGroup::Write(hsStream* stream, hsResMgr* mgr) mgr->WriteKey(stream, fMaterial); - stream->WriteSwap32(fClusters.GetCount()); + stream->WriteLE32(fClusters.GetCount()); for( i = 0; i < fClusters.GetCount(); i++ ) fClusters[i]->Write(stream); - stream->WriteSwap32(fRegions.GetCount()); + stream->WriteLE32(fRegions.GetCount()); for( i = 0; i < fRegions.GetCount(); i++ ) mgr->WriteKey(stream, fRegions[i]); - stream->WriteSwap32(fLights.GetCount()); + stream->WriteLE32(fLights.GetCount()); for( i = 0; i < fLights.GetCount(); i++ ) mgr->WriteKey(stream, fLights[i]); fLOD.Write(stream); - stream->WriteSwap32(fRenderLevel.Level()); + stream->WriteLE32(fRenderLevel.Level()); mgr->WriteKey(stream, fSceneNode); } @@ -332,12 +332,12 @@ UInt32 plClusterGroup::NumInst() const void plLODDist::Read(hsStream* s) { - fMinDist = s->ReadSwapScalar(); - fMaxDist = s->ReadSwapScalar(); + fMinDist = s->ReadLEScalar(); + fMaxDist = s->ReadLEScalar(); } void plLODDist::Write(hsStream* s) const { - s->WriteSwapScalar(fMinDist); - s->WriteSwapScalar(fMaxDist); + s->WriteLEScalar(fMinDist); + s->WriteLEScalar(fMaxDist); } \ No newline at end of file diff --git a/Sources/Plasma/PubUtilLib/plDrawable/plCutter.cpp b/Sources/Plasma/PubUtilLib/plDrawable/plCutter.cpp index 68f2d7a3..6dda26b6 100644 --- a/Sources/Plasma/PubUtilLib/plDrawable/plCutter.cpp +++ b/Sources/Plasma/PubUtilLib/plDrawable/plCutter.cpp @@ -62,18 +62,18 @@ void plCutter::Read(hsStream* stream, hsResMgr* mgr) { plCreatable::Read(stream, mgr); - fLengthU = stream->ReadSwapScalar(); - fLengthV = stream->ReadSwapScalar(); - fLengthW = stream->ReadSwapScalar(); + fLengthU = stream->ReadLEScalar(); + fLengthV = stream->ReadLEScalar(); + fLengthW = stream->ReadLEScalar(); } void plCutter::Write(hsStream* stream, hsResMgr* mgr) { plCreatable::Write(stream, mgr); - stream->WriteSwapScalar(fLengthU); - stream->WriteSwapScalar(fLengthV); - stream->WriteSwapScalar(fLengthW); + stream->WriteLEScalar(fLengthU); + stream->WriteLEScalar(fLengthV); + stream->WriteLEScalar(fLengthW); } diff --git a/Sources/Plasma/PubUtilLib/plDrawable/plDrawableSpans.cpp b/Sources/Plasma/PubUtilLib/plDrawable/plDrawableSpans.cpp index 7caf361b..b7544f78 100644 --- a/Sources/Plasma/PubUtilLib/plDrawable/plDrawableSpans.cpp +++ b/Sources/Plasma/PubUtilLib/plDrawable/plDrawableSpans.cpp @@ -934,12 +934,12 @@ void plDrawableSpans::Read( hsStream* s, hsResMgr* mgr ) plDrawable::Read(s, mgr); - fProps = s->ReadSwap32(); - fCriteria = s->ReadSwap32(); - fRenderLevel.fLevel = s->ReadSwap32(); + fProps = s->ReadLE32(); + fCriteria = s->ReadLE32(); + fRenderLevel.fLevel = s->ReadLE32(); /// Read in the material keys - count = s->ReadSwap32(); + count = s->ReadLE32(); fMaterials.SetCountAndZero( count ); for( i = 0; i < count; i++ ) { @@ -948,7 +948,7 @@ void plDrawableSpans::Read( hsStream* s, hsResMgr* mgr ) } /// Read the icicles in - count = s->ReadSwap32(); + count = s->ReadLE32(); fIcicles.SetCount( count ); for( i = 0; i < count; i++ ) { @@ -960,15 +960,15 @@ void plDrawableSpans::Read( hsStream* s, hsResMgr* mgr ) /// Read the patches in // FIXME MAJOR VERSION // no more patches, remove this line - count = s->ReadSwap32(); + count = s->ReadLE32(); /// Now read the index array in and use it to create a pointer table fSpanSourceIndices.Reset(); fSpans.Reset(); - count = s->ReadSwap32(); + count = s->ReadLE32(); for( i = 0; i < count; i++ ) { - j = s->ReadSwap32(); + j = s->ReadLE32(); switch( j & kSpanTypeMask ) { case kSpanTypeIcicle: fSpans.Append( (plSpan *)&fIcicles[ j & kSpanIDMask ] ); break; @@ -1013,7 +1013,7 @@ void plDrawableSpans::Read( hsStream* s, hsResMgr* mgr ) { if( fSpans[i]->fProps & plSpan::kPropHasPermaLights ) { - UInt32 lcnt = s->ReadSwap32(); + UInt32 lcnt = s->ReadLE32(); int j; for( j = 0; j < lcnt; j++ ) { @@ -1022,7 +1022,7 @@ void plDrawableSpans::Read( hsStream* s, hsResMgr* mgr ) } if( fSpans[i]->fProps & plSpan::kPropHasPermaProjs ) { - UInt32 lcnt = s->ReadSwap32(); + UInt32 lcnt = s->ReadLE32(); int j; for( j = 0; j < lcnt; j++ ) { @@ -1032,7 +1032,7 @@ void plDrawableSpans::Read( hsStream* s, hsResMgr* mgr ) } /// Read in the source spans if necessary - count = s->ReadSwap32(); + count = s->ReadLE32(); if( count > 0 ) { fSourceSpans.SetCount( count ); @@ -1049,7 +1049,7 @@ void plDrawableSpans::Read( hsStream* s, hsResMgr* mgr ) fSourceSpans.Reset(); /// Read in the matrix palette (if any) - count = s->ReadSwap32(); + count = s->ReadLE32(); fLocalToWorlds.SetCount(count); fWorldToLocals.SetCount(count); fLocalToBones.SetCount(count); @@ -1064,21 +1064,21 @@ void plDrawableSpans::Read( hsStream* s, hsResMgr* mgr ) } /// Read in the drawInterface index arrays - count = s->ReadSwap32(); + count = s->ReadLE32(); fDIIndices.SetCountAndZero( count ); for( i = 0; i < count; i++ ) { fDIIndices[ i ] = TRACKED_NEW plDISpanIndex; - fDIIndices[ i ]->fFlags = (UInt8)(s->ReadSwap32()); - count2 = s->ReadSwap32(); + fDIIndices[ i ]->fFlags = (UInt8)(s->ReadLE32()); + count2 = s->ReadLE32(); fDIIndices[ i ]->SetCountAndZero( count2 ); for( j = 0; j < count2; j++ ) - (*fDIIndices[ i ])[ j ] = s->ReadSwap32(); + (*fDIIndices[ i ])[ j ] = s->ReadLE32(); } /// Read the groups in - count = s->ReadSwap32(); + count = s->ReadLE32(); while( count-- ) { group = TRACKED_NEW plGBufferGroup(0, fProps & kPropVolatile, fProps & kPropSortFaces); diff --git a/Sources/Plasma/PubUtilLib/plDrawable/plDrawableSpansExport.cpp b/Sources/Plasma/PubUtilLib/plDrawable/plDrawableSpansExport.cpp index c828ba16..444233df 100644 --- a/Sources/Plasma/PubUtilLib/plDrawable/plDrawableSpansExport.cpp +++ b/Sources/Plasma/PubUtilLib/plDrawable/plDrawableSpansExport.cpp @@ -91,33 +91,33 @@ void plDrawableSpans::Write( hsStream* s, hsResMgr* mgr ) // Parent write plDrawable::Write(s, mgr); - s->WriteSwap32( fProps ); - s->WriteSwap32( fCriteria ); - s->WriteSwap32( fRenderLevel.fLevel ); + s->WriteLE32( fProps ); + s->WriteLE32( fCriteria ); + s->WriteLE32( fRenderLevel.fLevel ); /// Write out the material keys - s->WriteSwap32( fMaterials.GetCount() ); + s->WriteLE32( fMaterials.GetCount() ); for( i = 0; i < fMaterials.GetCount(); i++ ) mgr->WriteKey( s, fMaterials[ i ] ); /// Write out the icicles - s->WriteSwap32( fIcicles.GetCount() ); + s->WriteLE32( fIcicles.GetCount() ); for( i = 0; i < fIcicles.GetCount(); i++ ) fIcicles[ i ].Write( s ); /// Write out the patches // FIXME MAJOR VERSION // no more patches, remove this line - s->WriteSwap32(0); + s->WriteLE32(0); /// Write out the index table based on the pointer array count = fSpans.GetCount(); - s->WriteSwap32( count ); + s->WriteLE32( count ); for( i = 0; i < count; i++ ) { UInt8 *icicle = (UInt8 *)fSpans[ i ], *base = (UInt8 *)fIcicles.AcquireArray(); j = (UInt32)( icicle - base ) / sizeof( plIcicle ); - s->WriteSwap32( j ); + s->WriteLE32( j ); } /// Write out the common keys @@ -140,7 +140,7 @@ void plDrawableSpans::Write( hsStream* s, hsResMgr* mgr ) if( fSpans[i]->fProps & plSpan::kPropHasPermaLights ) { UInt32 lcnt = fSpans[i]->fPermaLights.GetCount(); - s->WriteSwap32(lcnt); + s->WriteLE32(lcnt); int j; for( j = 0; j < lcnt; j++ ) mgr->WriteKey( s, fSpans[i]->fPermaLights[j]); @@ -148,7 +148,7 @@ void plDrawableSpans::Write( hsStream* s, hsResMgr* mgr ) if( fSpans[i]->fProps & plSpan::kPropHasPermaProjs ) { UInt32 lcnt = fSpans[i]->fPermaProjs.GetCount(); - s->WriteSwap32(lcnt); + s->WriteLE32(lcnt); int j; for( j = 0; j < lcnt; j++ ) mgr->WriteKey( s, fSpans[i]->fPermaProjs[j]); @@ -156,7 +156,7 @@ void plDrawableSpans::Write( hsStream* s, hsResMgr* mgr ) } /// Write out the source spans if necessary - s->WriteSwap32( fSourceSpans.GetCount() ); + s->WriteLE32( fSourceSpans.GetCount() ); if( fSourceSpans.GetCount() > 0 ) { for( i = 0; i < fSourceSpans.GetCount(); i++ ) @@ -164,7 +164,7 @@ void plDrawableSpans::Write( hsStream* s, hsResMgr* mgr ) } count = fLocalToWorlds.GetCount(); - s->WriteSwap32(count); + s->WriteLE32(count); for( i = 0; i < count; i++ ) { fLocalToWorlds[i].Write(s); @@ -175,21 +175,21 @@ void plDrawableSpans::Write( hsStream* s, hsResMgr* mgr ) } // Write out the drawInterface index arrays - s->WriteSwap32( fDIIndices.GetCount() ); + s->WriteLE32( fDIIndices.GetCount() ); for( i = 0; i < fDIIndices.GetCount(); i++ ) { plDISpanIndex *array = fDIIndices[ i ]; - s->WriteSwap32( array->fFlags ); - s->WriteSwap32( array->GetCount() ); + s->WriteLE32( array->fFlags ); + s->WriteLE32( array->GetCount() ); for( j = 0; j < array->GetCount(); j++ ) - s->WriteSwap32( (*array)[ j ] ); + s->WriteLE32( (*array)[ j ] ); } // Write the groups out count = fGroups.GetCount(); - s->WriteSwap( count ); + s->WriteLE( count ); for( i = 0; i < count; i++ ) { #ifdef VERT_LOG diff --git a/Sources/Plasma/PubUtilLib/plDrawable/plDynaDecalMgr.cpp b/Sources/Plasma/PubUtilLib/plDrawable/plDynaDecalMgr.cpp index 8aeb93e4..5fc6eb07 100644 --- a/Sources/Plasma/PubUtilLib/plDrawable/plDynaDecalMgr.cpp +++ b/Sources/Plasma/PubUtilLib/plDrawable/plDynaDecalMgr.cpp @@ -198,40 +198,40 @@ void plDynaDecalMgr::Read(hsStream* stream, hsResMgr* mgr) mgr->ReadKeyNotifyMe(stream, TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, 0, kRefMatRTShade), plRefFlags::kActiveRef); - int n = stream->ReadSwap32(); + int n = stream->ReadLE32(); int i; for( i = 0; i < n; i++ ) { mgr->ReadKeyNotifyMe(stream, TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, 0, kRefTarget), plRefFlags::kPassiveRef); } // Associated slave particle systems. We read in the scene objects now, and find the associated systems on loaded message. - n = stream->ReadSwap32(); + n = stream->ReadLE32(); for( i = 0; i < n; i++ ) { mgr->ReadKeyNotifyMe(stream, TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, 0, kRefPartyObject), plRefFlags::kPassiveRef); } - fMaxNumVerts = (UInt16)(stream->ReadSwap32()); - fMaxNumIdx = (UInt16)(stream->ReadSwap32()); + fMaxNumVerts = (UInt16)(stream->ReadLE32()); + fMaxNumIdx = (UInt16)(stream->ReadLE32()); - fWaitOnEnable = stream->ReadSwap32(); + fWaitOnEnable = stream->ReadLE32(); - fIntensity = stream->ReadSwapScalar(); + fIntensity = stream->ReadLEScalar(); fInitAtten = fIntensity; - fWetLength = stream->ReadSwapScalar(); - fRampEnd = stream->ReadSwapScalar(); - fDecayStart = stream->ReadSwapScalar(); - fLifeSpan = stream->ReadSwapScalar(); + fWetLength = stream->ReadLEScalar(); + fRampEnd = stream->ReadLEScalar(); + fDecayStart = stream->ReadLEScalar(); + fLifeSpan = stream->ReadLEScalar(); - fGridSizeU = stream->ReadSwapScalar(); - fGridSizeV = stream->ReadSwapScalar(); + fGridSizeU = stream->ReadLEScalar(); + fGridSizeV = stream->ReadLEScalar(); fScale.Read(stream); - fPartyTime = stream->ReadSwapScalar(); + fPartyTime = stream->ReadLEScalar(); - n = stream->ReadSwap32(); + n = stream->ReadLE32(); fNotifies.SetCount(n); for( i = 0; i < n; i++ ) fNotifies[i] = mgr->ReadKey(stream); @@ -256,7 +256,7 @@ void plDynaDecalMgr::Write(hsStream* stream, hsResMgr* mgr) mgr->WriteKey(stream, fMatPreShade); mgr->WriteKey(stream, fMatRTShade); - stream->WriteSwap32(fTargets.GetCount()); + stream->WriteLE32(fTargets.GetCount()); int i; for( i = 0; i < fTargets.GetCount(); i++ ) @@ -265,32 +265,32 @@ void plDynaDecalMgr::Write(hsStream* stream, hsResMgr* mgr) } // Particle systems (really their associated sceneobjects). - stream->WriteSwap32(fPartyObjects.GetCount()); + stream->WriteLE32(fPartyObjects.GetCount()); for( i = 0; i < fPartyObjects.GetCount(); i++ ) { mgr->WriteKey(stream, fPartyObjects[i]); } - stream->WriteSwap32(fMaxNumVerts); - stream->WriteSwap32(fMaxNumIdx); + stream->WriteLE32(fMaxNumVerts); + stream->WriteLE32(fMaxNumIdx); - stream->WriteSwap32(fWaitOnEnable); + stream->WriteLE32(fWaitOnEnable); - stream->WriteSwapScalar(fIntensity); + stream->WriteLEScalar(fIntensity); - stream->WriteSwapScalar(fWetLength); - stream->WriteSwapScalar(fRampEnd); - stream->WriteSwapScalar(fDecayStart); - stream->WriteSwapScalar(fLifeSpan); + stream->WriteLEScalar(fWetLength); + stream->WriteLEScalar(fRampEnd); + stream->WriteLEScalar(fDecayStart); + stream->WriteLEScalar(fLifeSpan); - stream->WriteSwapScalar(fGridSizeU); - stream->WriteSwapScalar(fGridSizeV); + stream->WriteLEScalar(fGridSizeU); + stream->WriteLEScalar(fGridSizeV); fScale.Write(stream); - stream->WriteSwapScalar(fPartyTime); + stream->WriteLEScalar(fPartyTime); - stream->WriteSwap32(fNotifies.GetCount()); + stream->WriteLE32(fNotifies.GetCount()); for( i = 0; i < fNotifies.GetCount(); i++ ) mgr->WriteKey(stream, fNotifies[i]); diff --git a/Sources/Plasma/PubUtilLib/plDrawable/plDynaWakeMgr.cpp b/Sources/Plasma/PubUtilLib/plDrawable/plDynaWakeMgr.cpp index 321174a7..c9a40939 100644 --- a/Sources/Plasma/PubUtilLib/plDrawable/plDynaWakeMgr.cpp +++ b/Sources/Plasma/PubUtilLib/plDrawable/plDynaWakeMgr.cpp @@ -117,8 +117,8 @@ void plDynaWakeMgr::Read(hsStream* stream, hsResMgr* mgr) fDefaultDir.Read(stream); fAnimPath = plAnimPath::ConvertNoRef(mgr->ReadCreatable(stream)); - fAnimWgt = stream->ReadSwapScalar(); - fVelWgt = stream->ReadSwapScalar(); + fAnimWgt = stream->ReadLEScalar(); + fVelWgt = stream->ReadLEScalar(); } void plDynaWakeMgr::Write(hsStream* stream, hsResMgr* mgr) @@ -128,8 +128,8 @@ void plDynaWakeMgr::Write(hsStream* stream, hsResMgr* mgr) fDefaultDir.Write(stream); mgr->WriteCreatable(stream, fAnimPath); - stream->WriteSwapScalar(fAnimWgt); - stream->WriteSwapScalar(fVelWgt); + stream->WriteLEScalar(fAnimWgt); + stream->WriteLEScalar(fVelWgt); } hsVector3 plDynaWakeMgr::IGetDirection(const plDynaDecalInfo& info, const hsPoint3& pos) const diff --git a/Sources/Plasma/PubUtilLib/plDrawable/plGeometrySpan.cpp b/Sources/Plasma/PubUtilLib/plDrawable/plGeometrySpan.cpp index b72b0d04..1fe30601 100644 --- a/Sources/Plasma/PubUtilLib/plDrawable/plGeometrySpan.cpp +++ b/Sources/Plasma/PubUtilLib/plDrawable/plGeometrySpan.cpp @@ -515,29 +515,29 @@ void plGeometrySpan::Read( hsStream *stream ) fOBBToLocal.Read(stream); fLocalToOBB.Read(stream); - fBaseMatrix = stream->ReadSwap32(); + fBaseMatrix = stream->ReadLE32(); fNumMatrices = stream->ReadByte(); - fLocalUVWChans = stream->ReadSwap16(); - fMaxBoneIdx = stream->ReadSwap16(); - fPenBoneIdx = stream->ReadSwap16(); + fLocalUVWChans = stream->ReadLE16(); + fMaxBoneIdx = stream->ReadLE16(); + fPenBoneIdx = stream->ReadLE16(); - fMinDist = stream->ReadSwapScalar(); - fMaxDist = stream->ReadSwapScalar(); + fMinDist = stream->ReadLEScalar(); + fMaxDist = stream->ReadLEScalar(); fFormat = stream->ReadByte(); - fProps = stream->ReadSwap32(); - fNumVerts = stream->ReadSwap32(); - fNumIndices = stream->ReadSwap32(); + fProps = stream->ReadLE32(); + fNumVerts = stream->ReadLE32(); + fNumIndices = stream->ReadLE32(); // FIXME MAJOR VERSION // remove these two lines. No more patches. - stream->ReadSwap32(); + stream->ReadLE32(); stream->ReadByte(); - fDecalLevel = stream->ReadSwap32(); + fDecalLevel = stream->ReadLE32(); if( fProps & kWaterHeight ) - fWaterHeight = stream->ReadSwapScalar(); + fWaterHeight = stream->ReadLEScalar(); if( fNumVerts > 0 ) { @@ -556,8 +556,8 @@ void plGeometrySpan::Read( hsStream *stream ) fDiffuseRGBA = TRACKED_NEW UInt32[ fNumVerts ]; fSpecularRGBA = TRACKED_NEW UInt32[ fNumVerts ]; - stream->ReadSwap32( fNumVerts, fDiffuseRGBA ); - stream->ReadSwap32( fNumVerts, fSpecularRGBA ); + stream->ReadLE32( fNumVerts, fDiffuseRGBA ); + stream->ReadLE32( fNumVerts, fSpecularRGBA ); } else { @@ -571,16 +571,16 @@ void plGeometrySpan::Read( hsStream *stream ) if( fNumIndices > 0 ) { fIndexData = TRACKED_NEW UInt16[ fNumIndices ]; - stream->ReadSwap16( fNumIndices, fIndexData ); + stream->ReadLE16( fNumIndices, fIndexData ); } else fIndexData = nil; // Read the group ID, then look up our instanceRef array from it - fInstanceGroupID = stream->ReadSwap32(); + fInstanceGroupID = stream->ReadLE32(); if( fInstanceGroupID != kNoGroupID ) { - UInt32 count = stream->ReadSwap32(); + UInt32 count = stream->ReadLE32(); fInstanceRefs = IGetInstanceGroup( fInstanceGroupID, count ); fInstanceRefs->Append( this ); @@ -607,29 +607,29 @@ void plGeometrySpan::Write( hsStream *stream ) fOBBToLocal.Write(stream); fLocalToOBB.Write(stream); - stream->WriteSwap32( fBaseMatrix ); + stream->WriteLE32( fBaseMatrix ); stream->WriteByte( fNumMatrices ); - stream->WriteSwap16(fLocalUVWChans); - stream->WriteSwap16(fMaxBoneIdx); - stream->WriteSwap16((UInt16)fPenBoneIdx); + stream->WriteLE16(fLocalUVWChans); + stream->WriteLE16(fMaxBoneIdx); + stream->WriteLE16((UInt16)fPenBoneIdx); - stream->WriteSwapScalar(fMinDist); - stream->WriteSwapScalar(fMaxDist); + stream->WriteLEScalar(fMinDist); + stream->WriteLEScalar(fMaxDist); stream->WriteByte( fFormat ); - stream->WriteSwap32( fProps ); - stream->WriteSwap32( fNumVerts ); - stream->WriteSwap32( fNumIndices ); + stream->WriteLE32( fProps ); + stream->WriteLE32( fNumVerts ); + stream->WriteLE32( fNumIndices ); // FIXME MAJOR VERSION // Remove these two lines. - stream->WriteSwap32(0); + stream->WriteLE32(0); stream->WriteByte(0); - stream->WriteSwap32( fDecalLevel ); + stream->WriteLE32( fDecalLevel ); if( fProps & kWaterHeight ) - stream->WriteSwapScalar(fWaterHeight); + stream->WriteLEScalar(fWaterHeight); if( fNumVerts > 0 ) { @@ -642,19 +642,19 @@ void plGeometrySpan::Write( hsStream *stream ) fMultColor[ i ].Write( stream ); fAddColor[ i ].Write( stream ); } - stream->WriteSwap32( fNumVerts, fDiffuseRGBA ); - stream->WriteSwap32( fNumVerts, fSpecularRGBA ); + stream->WriteLE32( fNumVerts, fDiffuseRGBA ); + stream->WriteLE32( fNumVerts, fSpecularRGBA ); } if( fNumIndices > 0 ) { - stream->WriteSwap16( fNumIndices, fIndexData ); + stream->WriteLE16( fNumIndices, fIndexData ); } // Write the groupID as well as the count for instanceRefs. This way - stream->WriteSwap32( fInstanceGroupID ); + stream->WriteLE32( fInstanceGroupID ); if( fInstanceGroupID != kNoGroupID ) - stream->WriteSwap32( fInstanceRefs->GetCount() ); + stream->WriteLE32( fInstanceRefs->GetCount() ); else { hsAssert( fInstanceRefs == nil, "Nil instanceRefs array but no group ID, non sequitur" ); diff --git a/Sources/Plasma/PubUtilLib/plDrawable/plInstanceDrawInterface.cpp b/Sources/Plasma/PubUtilLib/plDrawable/plInstanceDrawInterface.cpp index 9631e8ad..7bd4d7c2 100644 --- a/Sources/Plasma/PubUtilLib/plDrawable/plInstanceDrawInterface.cpp +++ b/Sources/Plasma/PubUtilLib/plDrawable/plInstanceDrawInterface.cpp @@ -57,7 +57,7 @@ void plInstanceDrawInterface::Read(hsStream* stream, hsResMgr* mgr) { plDrawInterface::Read(stream, mgr); - fTargetID = stream->ReadSwap32(); + fTargetID = stream->ReadLE32(); plSwapSpansRefMsg *sMsg = TRACKED_NEW plSwapSpansRefMsg(GetKey(), plRefMsg::kOnCreate, -1, -1); mgr->ReadKeyNotifyMe(stream, sMsg, plRefFlags::kActiveRef); } @@ -66,7 +66,7 @@ void plInstanceDrawInterface::Write(hsStream* stream, hsResMgr* mgr) { plDrawInterface::Write(stream, mgr); - stream->WriteSwap32(fTargetID); + stream->WriteLE32(fTargetID); mgr->WriteKey(stream, fDrawable->GetKey()); } diff --git a/Sources/Plasma/PubUtilLib/plDrawable/plMorphArray.cpp b/Sources/Plasma/PubUtilLib/plDrawable/plMorphArray.cpp index 403c4a60..6f062f51 100644 --- a/Sources/Plasma/PubUtilLib/plDrawable/plMorphArray.cpp +++ b/Sources/Plasma/PubUtilLib/plDrawable/plMorphArray.cpp @@ -73,7 +73,7 @@ void plMorphArray::Apply(hsTArray& dst, hsTArray* weight void plMorphArray::Read(hsStream* s, hsResMgr* mgr) { - int n = s->ReadSwap32(); + int n = s->ReadLE32(); fDeltas.SetCount(n); int i; for( i = 0; i < n; i++ ) @@ -82,7 +82,7 @@ void plMorphArray::Read(hsStream* s, hsResMgr* mgr) void plMorphArray::Write(hsStream* s, hsResMgr* mgr) { - s->WriteSwap32(fDeltas.GetCount()); + s->WriteLE32(fDeltas.GetCount()); int i; for( i = 0; i < fDeltas.GetCount(); i++ ) diff --git a/Sources/Plasma/PubUtilLib/plDrawable/plMorphDelta.cpp b/Sources/Plasma/PubUtilLib/plDrawable/plMorphDelta.cpp index e50c5475..c44309e7 100644 --- a/Sources/Plasma/PubUtilLib/plDrawable/plMorphDelta.cpp +++ b/Sources/Plasma/PubUtilLib/plDrawable/plMorphDelta.cpp @@ -301,15 +301,15 @@ void plMorphDelta::SetDeltas(int iSpan, const hsTArray& deltas, int void plMorphDelta::Read(hsStream* s, hsResMgr* mgr) { - fWeight = s->ReadSwapScalar(); + fWeight = s->ReadLEScalar(); - int n = s->ReadSwap32(); + int n = s->ReadLE32(); SetNumSpans(n); int iSpan; for( iSpan = 0; iSpan < n; iSpan++ ) { - int nDel = s->ReadSwap32(); - int nUVW = s->ReadSwap32(); + int nDel = s->ReadLE32(); + int nUVW = s->ReadLE32(); AllocDeltas(iSpan, nDel, nUVW); if( nDel ) { @@ -323,17 +323,17 @@ void plMorphDelta::Read(hsStream* s, hsResMgr* mgr) void plMorphDelta::Write(hsStream* s, hsResMgr* mgr) { - s->WriteSwapScalar(fWeight); + s->WriteLEScalar(fWeight); - s->WriteSwap32(fSpans.GetCount()); + s->WriteLE32(fSpans.GetCount()); int iSpan; for( iSpan = 0; iSpan < fSpans.GetCount(); iSpan++ ) { int nDel = fSpans[iSpan].fDeltas.GetCount(); int nUVW = fSpans[iSpan].fNumUVWChans; - s->WriteSwap32(nDel); - s->WriteSwap32(nUVW); + s->WriteLE32(nDel); + s->WriteLE32(nUVW); if( nDel ) { diff --git a/Sources/Plasma/PubUtilLib/plDrawable/plMorphSequence.cpp b/Sources/Plasma/PubUtilLib/plDrawable/plMorphSequence.cpp index 512ce5d9..ce85e477 100644 --- a/Sources/Plasma/PubUtilLib/plDrawable/plMorphSequence.cpp +++ b/Sources/Plasma/PubUtilLib/plDrawable/plMorphSequence.cpp @@ -70,7 +70,7 @@ void plMorphDataSet::Read(hsStream* s, hsResMgr* mgr) { hsKeyedObject::Read(s, mgr); - int n = s->ReadSwap32(); + int n = s->ReadLE32(); fMorphs.SetCount(n); int i; for( i = 0; i < n; i++ ) @@ -81,7 +81,7 @@ void plMorphDataSet::Write(hsStream* s, hsResMgr* mgr) { hsKeyedObject::Write(s, mgr); - s->WriteSwap32(fMorphs.GetCount()); + s->WriteLE32(fMorphs.GetCount()); int i; for( i = 0; i < fMorphs.GetCount(); i++ ) fMorphs[i].Write(s, mgr); @@ -485,13 +485,13 @@ void plMorphSequence::Read(hsStream* s, hsResMgr* mgr) fMorphFlags = 0; - int n = s->ReadSwap32(); + int n = s->ReadLE32(); fMorphs.SetCount(n); int i; for( i = 0; i < n; i++ ) fMorphs[i].Read(s, mgr); - n = s->ReadSwap32(); + n = s->ReadLE32(); for( i = 0; i < n; i++) mgr->ReadKeyNotifyMe(s, TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, -1, -1), plRefFlags::kActiveRef); } @@ -500,12 +500,12 @@ void plMorphSequence::Write(hsStream* s, hsResMgr* mgr) { plSingleModifier::Write(s, mgr); - s->WriteSwap32(fMorphs.GetCount()); + s->WriteLE32(fMorphs.GetCount()); int i; for( i = 0; i < fMorphs.GetCount(); i++ ) fMorphs[i].Write(s, mgr); - s->WriteSwap32(fSharedMeshes.GetCount()); + s->WriteLE32(fSharedMeshes.GetCount()); for( i = 0; i < fSharedMeshes.GetCount(); i++ ) mgr->WriteKey(s, fSharedMeshes[i].fMesh); } diff --git a/Sources/Plasma/PubUtilLib/plDrawable/plPrintShape.cpp b/Sources/Plasma/PubUtilLib/plDrawable/plPrintShape.cpp index 9bc65382..39785226 100644 --- a/Sources/Plasma/PubUtilLib/plDrawable/plPrintShape.cpp +++ b/Sources/Plasma/PubUtilLib/plDrawable/plPrintShape.cpp @@ -61,17 +61,17 @@ void plPrintShape::Read(hsStream* stream, hsResMgr* mgr) { plObjInterface::Read(stream, mgr); - fWidth = stream->ReadSwapScalar(); - fLength = stream->ReadSwapScalar(); - fHeight = stream->ReadSwapScalar(); + fWidth = stream->ReadLEScalar(); + fLength = stream->ReadLEScalar(); + fHeight = stream->ReadLEScalar(); } void plPrintShape::Write(hsStream* stream, hsResMgr* mgr) { plObjInterface::Write(stream, mgr); - stream->WriteSwapScalar(fWidth); - stream->WriteSwapScalar(fLength); - stream->WriteSwapScalar(fHeight); + stream->WriteLEScalar(fWidth); + stream->WriteLEScalar(fLength); + stream->WriteLEScalar(fHeight); } diff --git a/Sources/Plasma/PubUtilLib/plDrawable/plSharedMesh.cpp b/Sources/Plasma/PubUtilLib/plDrawable/plSharedMesh.cpp index e9067a06..611fc672 100644 --- a/Sources/Plasma/PubUtilLib/plDrawable/plSharedMesh.cpp +++ b/Sources/Plasma/PubUtilLib/plDrawable/plSharedMesh.cpp @@ -108,7 +108,7 @@ void plSharedMesh::Read(hsStream* s, hsResMgr* mgr) hsKeyedObject::Read(s, mgr); int i; - fSpans.SetCount(s->ReadSwap32()); + fSpans.SetCount(s->ReadLE32()); for (i = 0; i < fSpans.GetCount(); i++) { fSpans[i] = TRACKED_NEW plGeometrySpan; @@ -124,7 +124,7 @@ void plSharedMesh::Write(hsStream* s, hsResMgr* mgr) hsKeyedObject::Write(s, mgr); int i; - s->WriteSwap32(fSpans.GetCount()); + s->WriteLE32(fSpans.GetCount()); for (i = 0; i < fSpans.GetCount(); i++) fSpans[i]->Write(s); diff --git a/Sources/Plasma/PubUtilLib/plDrawable/plSpaceTree.cpp b/Sources/Plasma/PubUtilLib/plDrawable/plSpaceTree.cpp index bf8e96b9..88d95dcc 100644 --- a/Sources/Plasma/PubUtilLib/plDrawable/plSpaceTree.cpp +++ b/Sources/Plasma/PubUtilLib/plDrawable/plSpaceTree.cpp @@ -60,10 +60,10 @@ void plSpaceTreeNode::Read(hsStream* s) { fWorldBounds.Read(s); - fFlags = s->ReadSwap16(); - fParent = s->ReadSwap16(); - fChildren[0] = s->ReadSwap16(); - fChildren[1] = s->ReadSwap16(); + fFlags = s->ReadLE16(); + fParent = s->ReadLE16(); + fChildren[0] = s->ReadLE16(); + fChildren[1] = s->ReadLE16(); } @@ -71,14 +71,14 @@ void plSpaceTreeNode::Write(hsStream* s) { fWorldBounds.Write(s); - s->WriteSwap16(fFlags); - s->WriteSwap16(fParent); - s->WriteSwap16(fChildren[0]); + s->WriteLE16(fFlags); + s->WriteLE16(fParent); + s->WriteLE16(fChildren[0]); if( fFlags & kIsLeaf ) // Temp for now to play nice with binary patches - s->WriteSwap16( 0 ); + s->WriteLE16( 0 ); else - s->WriteSwap16(fChildren[1]); + s->WriteLE16(fChildren[1]); } plSpaceTree::plSpaceTree() @@ -545,11 +545,11 @@ void plSpaceTree::Read(hsStream* s, hsResMgr* mgr) { plCreatable::Read(s, mgr); - fRoot = s->ReadSwap16(); + fRoot = s->ReadLE16(); - fNumLeaves = UInt16(s->ReadSwap32()); + fNumLeaves = UInt16(s->ReadLE32()); - UInt32 n = s->ReadSwap32(); + UInt32 n = s->ReadLE32(); fTree.SetCount(n); int i; for( i = 0; i < n; i++ ) @@ -560,11 +560,11 @@ void plSpaceTree::Write(hsStream* s, hsResMgr* mgr) { plCreatable::Write(s, mgr); - s->WriteSwap16(fRoot); + s->WriteLE16(fRoot); - s->WriteSwap32(fNumLeaves); + s->WriteLE32(fNumLeaves); - s->WriteSwap32(fTree.GetCount()); + s->WriteLE32(fTree.GetCount()); int i; for( i = 0; i < fTree.GetCount(); i++ ) { diff --git a/Sources/Plasma/PubUtilLib/plDrawable/plSpanInstance.cpp b/Sources/Plasma/PubUtilLib/plDrawable/plSpanInstance.cpp index 052d6957..70020c53 100644 --- a/Sources/Plasma/PubUtilLib/plDrawable/plSpanInstance.cpp +++ b/Sources/Plasma/PubUtilLib/plDrawable/plSpanInstance.cpp @@ -49,13 +49,13 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com void plSpanEncoding::Read(hsStream* s) { fCode = s->ReadByte(); - fPosScale = s->ReadSwapScalar(); + fPosScale = s->ReadLEScalar(); } void plSpanEncoding::Write(hsStream* s) const { s->WriteByte((UInt8)fCode); - s->WriteSwapScalar(fPosScale); + s->WriteLEScalar(fPosScale); } diff --git a/Sources/Plasma/PubUtilLib/plDrawable/plSpanTemplate.cpp b/Sources/Plasma/PubUtilLib/plDrawable/plSpanTemplate.cpp index fd7d4b9e..ac70b007 100644 --- a/Sources/Plasma/PubUtilLib/plDrawable/plSpanTemplate.cpp +++ b/Sources/Plasma/PubUtilLib/plDrawable/plSpanTemplate.cpp @@ -108,9 +108,9 @@ void plSpanTemplate::DeAlloc() void plSpanTemplate::Read(hsStream* stream) { - fNumVerts = stream->ReadSwap16(); - fFormat = stream->ReadSwap16(); - fNumTris = stream->ReadSwap16(); + fNumVerts = stream->ReadLE16(); + fFormat = stream->ReadLE16(); + fNumTris = stream->ReadLE16(); Alloc(fFormat, fNumVerts, fNumTris); @@ -120,9 +120,9 @@ void plSpanTemplate::Read(hsStream* stream) void plSpanTemplate::Write(hsStream* stream) const { - stream->WriteSwap16(fNumVerts); - stream->WriteSwap16(fFormat); - stream->WriteSwap16(fNumTris); + stream->WriteLE16(fNumVerts); + stream->WriteLE16(fFormat); + stream->WriteLE16(fNumTris); stream->Write(VertSize(), fData); stream->Write(IndexSize(), fIndices); diff --git a/Sources/Plasma/PubUtilLib/plDrawable/plSpanTypes.cpp b/Sources/Plasma/PubUtilLib/plDrawable/plSpanTypes.cpp index a2d02d58..1bd75b70 100644 --- a/Sources/Plasma/PubUtilLib/plDrawable/plSpanTypes.cpp +++ b/Sources/Plasma/PubUtilLib/plDrawable/plSpanTypes.cpp @@ -68,28 +68,28 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com void plSpan::Read( hsStream *stream ) { - fSubType = (UInt16)(stream->ReadSwap32()); + fSubType = (UInt16)(stream->ReadLE32()); fFogEnvironment = nil; - fMaterialIdx = stream->ReadSwap32(); + fMaterialIdx = stream->ReadLE32(); fLocalToWorld.Read( stream ); fWorldToLocal.Read( stream ); - fProps = stream->ReadSwap32(); + fProps = stream->ReadLE32(); fLocalBounds.Read( stream ); fWorldBounds.Read( stream ); - fNumMatrices = (UInt8)(stream->ReadSwap32()); - fBaseMatrix = stream->ReadSwap32(); + fNumMatrices = (UInt8)(stream->ReadLE32()); + fBaseMatrix = stream->ReadLE32(); - fLocalUVWChans = stream->ReadSwap16(); - fMaxBoneIdx = stream->ReadSwap16(); - fPenBoneIdx = stream->ReadSwap16(); + fLocalUVWChans = stream->ReadLE16(); + fMaxBoneIdx = stream->ReadLE16(); + fPenBoneIdx = stream->ReadLE16(); - fMinDist = stream->ReadSwapScalar(); - fMaxDist = stream->ReadSwapScalar(); + fMinDist = stream->ReadLEScalar(); + fMaxDist = stream->ReadLEScalar(); if( fProps & kWaterHeight ) - fWaterHeight = stream->ReadSwapScalar(); + fWaterHeight = stream->ReadLEScalar(); #ifdef HS_DEBUGGING fOwnerKey = nil; @@ -100,28 +100,28 @@ void plSpan::Read( hsStream *stream ) void plSpan::Write( hsStream *stream ) { - stream->WriteSwap32(fSubType); + stream->WriteLE32(fSubType); - stream->WriteSwap32( fMaterialIdx ); + stream->WriteLE32( fMaterialIdx ); fLocalToWorld.Write( stream ); fWorldToLocal.Write( stream ); - stream->WriteSwap32( fProps ); + stream->WriteLE32( fProps ); fLocalBounds.Write( stream ); fWorldBounds.Write( stream ); - stream->WriteSwap32( fNumMatrices ); - stream->WriteSwap32( fBaseMatrix ); + stream->WriteLE32( fNumMatrices ); + stream->WriteLE32( fBaseMatrix ); - stream->WriteSwap16( fLocalUVWChans ); - stream->WriteSwap16( fMaxBoneIdx ); - stream->WriteSwap16( fPenBoneIdx ); + stream->WriteLE16( fLocalUVWChans ); + stream->WriteLE16( fMaxBoneIdx ); + stream->WriteLE16( fPenBoneIdx ); - stream->WriteSwapScalar( fMinDist ); - stream->WriteSwapScalar( fMaxDist ); + stream->WriteLEScalar( fMinDist ); + stream->WriteLEScalar( fMaxDist ); if( fProps & kWaterHeight ) - stream->WriteSwapScalar(fWaterHeight); + stream->WriteLEScalar(fWaterHeight); } void plSpan::RemoveAuxSpan(plAuxSpan* aux) @@ -355,24 +355,24 @@ void plVertexSpan::Read( hsStream* stream ) { plSpan:: Read( stream ); - fGroupIdx = stream->ReadSwap32(); - fVBufferIdx = stream->ReadSwap32(); - fCellIdx = stream->ReadSwap32(); - fCellOffset = stream->ReadSwap32(); - fVStartIdx = stream->ReadSwap32(); - fVLength = stream->ReadSwap32(); + fGroupIdx = stream->ReadLE32(); + fVBufferIdx = stream->ReadLE32(); + fCellIdx = stream->ReadLE32(); + fCellOffset = stream->ReadLE32(); + fVStartIdx = stream->ReadLE32(); + fVLength = stream->ReadLE32(); } void plVertexSpan::Write( hsStream* stream ) { plSpan::Write( stream ); - stream->WriteSwap32( fGroupIdx ); - stream->WriteSwap32( fVBufferIdx ); - stream->WriteSwap32( fCellIdx ); - stream->WriteSwap32( fCellOffset ); - stream->WriteSwap32( fVStartIdx ); - stream->WriteSwap32( fVLength ); + stream->WriteLE32( fGroupIdx ); + stream->WriteLE32( fVBufferIdx ); + stream->WriteLE32( fCellIdx ); + stream->WriteLE32( fCellOffset ); + stream->WriteLE32( fVStartIdx ); + stream->WriteLE32( fVLength ); } hsBool plVertexSpan::CanMergeInto( plSpan *other ) @@ -422,9 +422,9 @@ void plIcicle::Read( hsStream *stream ) { plVertexSpan::Read( stream ); - fIBufferIdx = stream->ReadSwap32(); - fIPackedIdx = fIStartIdx = stream->ReadSwap32(); - fILength = stream->ReadSwap32(); + fIBufferIdx = stream->ReadLE32(); + fIPackedIdx = fIStartIdx = stream->ReadLE32(); + fILength = stream->ReadLE32(); if( fProps & kPropFacesSortable ) { @@ -446,9 +446,9 @@ void plIcicle::Write( hsStream *stream ) { plVertexSpan::Write( stream ); - stream->WriteSwap32( fIBufferIdx ); - stream->WriteSwap32( fIStartIdx ); - stream->WriteSwap32( fILength ); + stream->WriteLE32( fIBufferIdx ); + stream->WriteLE32( fIStartIdx ); + stream->WriteLE32( fILength ); if( fProps & kPropFacesSortable ) { diff --git a/Sources/Plasma/PubUtilLib/plDrawable/plWaveSet7.cpp b/Sources/Plasma/PubUtilLib/plDrawable/plWaveSet7.cpp index acb4686e..895f4767 100644 --- a/Sources/Plasma/PubUtilLib/plDrawable/plWaveSet7.cpp +++ b/Sources/Plasma/PubUtilLib/plDrawable/plWaveSet7.cpp @@ -366,18 +366,18 @@ void plWaveSet7::Read(hsStream* stream, hsResMgr* mgr) { plMultiModifier::Read(stream, mgr); - fMaxLen = stream->ReadSwapScalar(); + fMaxLen = stream->ReadLEScalar(); fState.Read(stream); IUpdateWindDir(0); - int n = stream->ReadSwap32(); + int n = stream->ReadLE32(); int i; for( i = 0; i < n; i++ ) { mgr->ReadKeyNotifyMe(stream, TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, -1, kRefShore), plRefFlags::kPassiveRef); } - n = stream->ReadSwap32(); + n = stream->ReadLE32(); for( i = 0; i < n; i++ ) { mgr->ReadKeyNotifyMe(stream, TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, -1, kRefDecal), plRefFlags::kPassiveRef); @@ -407,17 +407,17 @@ void plWaveSet7::Write(hsStream* stream, hsResMgr* mgr) { plMultiModifier::Write(stream, mgr); - stream->WriteSwapScalar(fMaxLen); + stream->WriteLEScalar(fMaxLen); fState.Write(stream); - stream->WriteSwap32(fShores.GetCount()); + stream->WriteLE32(fShores.GetCount()); int i; for( i = 0; i < fShores.GetCount(); i++ ) { mgr->WriteKey(stream, fShores[i]); } - stream->WriteSwap32(fDecals.GetCount()); + stream->WriteLE32(fDecals.GetCount()); for( i = 0; i < fDecals.GetCount(); i++ ) { mgr->WriteKey(stream, fDecals[i]); diff --git a/Sources/Plasma/PubUtilLib/plEncryption/plChecksum.cpp b/Sources/Plasma/PubUtilLib/plEncryption/plChecksum.cpp index 64807e71..aa5fb562 100644 --- a/Sources/Plasma/PubUtilLib/plEncryption/plChecksum.cpp +++ b/Sources/Plasma/PubUtilLib/plEncryption/plChecksum.cpp @@ -54,7 +54,7 @@ plChecksum::plChecksum(unsigned int bufsize, const char* buffer) while (buffer < bufferEnvenEnd) { - fSum += hsSWAP32(*((SumStorage*)buffer)); + fSum += hsToLE32(*((SumStorage*)buffer)); buffer += wndsz; } @@ -64,7 +64,7 @@ plChecksum::plChecksum(unsigned int bufsize, const char* buffer) ((char*)&last)[i % wndsz] = *buffer; buffer++; } - fSum+= hsSWAP32(last); + fSum+= hsToLE32(last); } plMD5Checksum::plMD5Checksum( UInt32 size, UInt8 *buffer ) diff --git a/Sources/Plasma/PubUtilLib/plFile/plEncryptedStream.cpp b/Sources/Plasma/PubUtilLib/plFile/plEncryptedStream.cpp index ffbab70f..ae44d88a 100644 --- a/Sources/Plasma/PubUtilLib/plFile/plEncryptedStream.cpp +++ b/Sources/Plasma/PubUtilLib/plFile/plEncryptedStream.cpp @@ -398,7 +398,7 @@ bool plEncryptedStream::IWriteEncypted(hsStream* sourceStream, const wchar* outp outputStream.Write(kMagicStringLen, kMagicString); // Save some space to write the file size at the end - outputStream.WriteSwap32(0); + outputStream.WriteLE32(0); // Write out all the full size encrypted blocks we can char buf[kEncryptChunkSize]; @@ -431,7 +431,7 @@ bool plEncryptedStream::IWriteEncypted(hsStream* sourceStream, const wchar* outp UInt32 actualSize = sourceStream->GetPosition(); outputStream.Rewind(); outputStream.Skip(kMagicStringLen); - outputStream.WriteSwap32(actualSize); + outputStream.WriteLE32(actualSize); outputStream.Close(); diff --git a/Sources/Plasma/PubUtilLib/plFile/plSecureStream.cpp b/Sources/Plasma/PubUtilLib/plFile/plSecureStream.cpp index fc34a128..3be4f54c 100644 --- a/Sources/Plasma/PubUtilLib/plFile/plSecureStream.cpp +++ b/Sources/Plasma/PubUtilLib/plFile/plSecureStream.cpp @@ -436,7 +436,7 @@ bool plSecureStream::IWriteEncrypted(hsStream* sourceStream, const wchar* output outputStream.Write(kMagicStringLen, kMagicString); // Save some space to write the file size at the end - outputStream.WriteSwap32(0); + outputStream.WriteLE32(0); // Write out all the full size encrypted blocks we can char buf[kEncryptChunkSize]; @@ -469,7 +469,7 @@ bool plSecureStream::IWriteEncrypted(hsStream* sourceStream, const wchar* output UInt32 actualSize = sourceStream->GetPosition(); outputStream.Rewind(); outputStream.Skip(kMagicStringLen); - outputStream.WriteSwap32(actualSize); + outputStream.WriteLE32(actualSize); outputStream.Close(); diff --git a/Sources/Plasma/PubUtilLib/plGImage/plBitmap.cpp b/Sources/Plasma/PubUtilLib/plGImage/plBitmap.cpp index 3f0d0dc0..29d54cff 100644 --- a/Sources/Plasma/PubUtilLib/plGImage/plBitmap.cpp +++ b/Sources/Plasma/PubUtilLib/plGImage/plBitmap.cpp @@ -110,7 +110,7 @@ UInt32 plBitmap::Read( hsStream *s ) fPixelSize = s->ReadByte(); fSpace = s->ReadByte(); - fFlags = s->ReadSwap16(); + fFlags = s->ReadLE16(); fCompressionType = s->ReadByte(); if(( fCompressionType == kUncompressed )||( fCompressionType == kJPEGCompression )) @@ -125,8 +125,8 @@ UInt32 plBitmap::Read( hsStream *s ) read += 2; } - fLowModifiedTime = s->ReadSwap32(); - fHighModifiedTime = s->ReadSwap32(); + fLowModifiedTime = s->ReadLE32(); + fHighModifiedTime = s->ReadLE32(); return read; } @@ -142,7 +142,7 @@ UInt32 plBitmap::Write( hsStream *s ) s->WriteByte( fPixelSize ); s->WriteByte( fSpace ); - s->WriteSwap16( fFlags ); + s->WriteLE16( fFlags ); s->WriteByte( fCompressionType ); if(( fCompressionType == kUncompressed )||(fCompressionType == kJPEGCompression )) @@ -157,8 +157,8 @@ UInt32 plBitmap::Write( hsStream *s ) written += 2; } - s->WriteSwap32(fLowModifiedTime); - s->WriteSwap32(fHighModifiedTime); + s->WriteLE32(fLowModifiedTime); + s->WriteLE32(fHighModifiedTime); return written; } diff --git a/Sources/Plasma/PubUtilLib/plGImage/plDynamicTextMap.cpp b/Sources/Plasma/PubUtilLib/plGImage/plDynamicTextMap.cpp index 52606981..780f407e 100644 --- a/Sources/Plasma/PubUtilLib/plGImage/plDynamicTextMap.cpp +++ b/Sources/Plasma/PubUtilLib/plGImage/plDynamicTextMap.cpp @@ -272,18 +272,18 @@ UInt32 plDynamicTextMap::Read( hsStream *s ) // The funny thing is that we don't read anything like a mipmap; we just // keep the width and height and call Create() after we read those in - fVisWidth = (UInt16)(s->ReadSwap32()); - fVisHeight = (UInt16)(s->ReadSwap32()); + fVisWidth = (UInt16)(s->ReadLE32()); + fVisHeight = (UInt16)(s->ReadLE32()); fHasAlpha = s->ReadBool(); totalRead += 2 * 4; - UInt32 initSize = s->ReadSwap32(); + UInt32 initSize = s->ReadLE32(); totalRead += 4; if( initSize > 0 ) { fInitBuffer = TRACKED_NEW UInt32[ initSize ]; - s->ReadSwap32( initSize, fInitBuffer ); + s->ReadLE32( initSize, fInitBuffer ); totalRead += initSize * 4; } else @@ -303,14 +303,14 @@ UInt32 plDynamicTextMap::Write( hsStream *s ) { UInt32 totalWritten = plBitmap::Write( s ); - s->WriteSwap32( fVisWidth ); - s->WriteSwap32( fVisHeight ); + s->WriteLE32( fVisWidth ); + s->WriteLE32( fVisHeight ); s->WriteBool( fHasAlpha ); - s->WriteSwap32( fInitBuffer != nil ? fVisWidth * fVisHeight * sizeof( UInt32 ) : 0 ); + s->WriteLE32( fInitBuffer != nil ? fVisWidth * fVisHeight * sizeof( UInt32 ) : 0 ); if( fInitBuffer != nil ) { - s->WriteSwap32( fVisWidth * fVisHeight, fInitBuffer ); + s->WriteLE32( fVisWidth * fVisHeight, fInitBuffer ); } return totalWritten; diff --git a/Sources/Plasma/PubUtilLib/plGImage/plFont.cpp b/Sources/Plasma/PubUtilLib/plGImage/plFont.cpp index 5c9da580..e77763cd 100644 --- a/Sources/Plasma/PubUtilLib/plGImage/plFont.cpp +++ b/Sources/Plasma/PubUtilLib/plGImage/plFont.cpp @@ -83,20 +83,20 @@ plFont::plCharacter::plCharacter() void plFont::plCharacter::Read( hsStream *s ) { // Rocket science here... - s->ReadSwap( &fBitmapOff ); - s->ReadSwap( &fHeight ); - s->ReadSwap( &fBaseline ); - s->ReadSwap( &fLeftKern ); - s->ReadSwap( &fRightKern ); + s->ReadLE( &fBitmapOff ); + s->ReadLE( &fHeight ); + s->ReadLE( &fBaseline ); + s->ReadLE( &fLeftKern ); + s->ReadLE( &fRightKern ); } void plFont::plCharacter::Write( hsStream *s ) { - s->WriteSwap( fBitmapOff ); - s->WriteSwap( fHeight ); - s->WriteSwap( fBaseline ); - s->WriteSwap( fLeftKern ); - s->WriteSwap( fRightKern ); + s->WriteLE( fBitmapOff ); + s->WriteLE( fHeight ); + s->WriteLE( fBaseline ); + s->WriteLE( fLeftKern ); + s->WriteLE( fRightKern ); } //// Constructor/Read/Write/Destructor/etc //////////////////////////////////// @@ -1126,45 +1126,45 @@ hsBool plFont::LoadFromFNTStream( hsStream *stream ) void Read( hsStream *s ) { - version = s->ReadSwap16(); - size = s->ReadSwap32(); + version = s->ReadLE16(); + size = s->ReadLE32(); s->Read( sizeof( copyright ), copyright ); - s->ReadSwap( &type ); - s->ReadSwap( &points ); - s->ReadSwap( &vertRes ); - s->ReadSwap( &horzRes ); - s->ReadSwap( &ascent ); - s->ReadSwap( &internalLeading ); - s->ReadSwap( &externalLeading ); - s->ReadSwap( &italic ); - s->ReadSwap( &underline ); - s->ReadSwap( &strikeout ); - s->ReadSwap( &weight ); - s->ReadSwap( &charSet ); - s->ReadSwap( &pixWidth ); - s->ReadSwap( &pixHeight ); - s->ReadSwap( &pitchFamily ); - s->ReadSwap( &avgWidth ); - s->ReadSwap( &maxWidth ); - s->ReadSwap( &firstChar ); - s->ReadSwap( &lastChar ); - s->ReadSwap( &defaultChar ); - s->ReadSwap( &breakChar ); - s->ReadSwap( &widthBytes ); - s->ReadSwap( &device ); - s->ReadSwap( &face ); - s->ReadSwap( &bitsPointer ); - s->ReadSwap( &bitsOffset ); - s->ReadSwap( &reserved ); + s->ReadLE( &type ); + s->ReadLE( &points ); + s->ReadLE( &vertRes ); + s->ReadLE( &horzRes ); + s->ReadLE( &ascent ); + s->ReadLE( &internalLeading ); + s->ReadLE( &externalLeading ); + s->ReadLE( &italic ); + s->ReadLE( &underline ); + s->ReadLE( &strikeout ); + s->ReadLE( &weight ); + s->ReadLE( &charSet ); + s->ReadLE( &pixWidth ); + s->ReadLE( &pixHeight ); + s->ReadLE( &pitchFamily ); + s->ReadLE( &avgWidth ); + s->ReadLE( &maxWidth ); + s->ReadLE( &firstChar ); + s->ReadLE( &lastChar ); + s->ReadLE( &defaultChar ); + s->ReadLE( &breakChar ); + s->ReadLE( &widthBytes ); + s->ReadLE( &device ); + s->ReadLE( &face ); + s->ReadLE( &bitsPointer ); + s->ReadLE( &bitsOffset ); + s->ReadLE( &reserved ); if( version == 0x0300 ) { - s->ReadSwap( &flags ); - s->ReadSwap( &aSpace ); - s->ReadSwap( &bSpace ); - s->ReadSwap( &cSpace ); - s->ReadSwap( &colorPointer ); + s->ReadLE( &flags ); + s->ReadLE( &aSpace ); + s->ReadLE( &bSpace ); + s->ReadLE( &cSpace ); + s->ReadLE( &colorPointer ); s->Read( sizeof( reserved1 ), reserved1 ); } else @@ -1189,11 +1189,11 @@ hsBool plFont::LoadFromFNTStream( hsStream *stream ) charEntries = TRACKED_NEW charEntry[ count ]; for( i = 0; i < count; i++ ) { - charEntries[ i ].width = stream->ReadSwap16(); + charEntries[ i ].width = stream->ReadLE16(); if( fntInfo.version == 0x0200 ) - charEntries[ i ].offset = stream->ReadSwap16(); + charEntries[ i ].offset = stream->ReadLE16(); else - charEntries[ i ].offset = stream->ReadSwap32(); + charEntries[ i ].offset = stream->ReadLE32(); } char faceName[ 256 ], deviceName[ 256 ]; @@ -1926,11 +1926,11 @@ hsBool plFont::ReadRaw( hsStream *s ) { s->Read( sizeof( fFace ), fFace ); fSize = s->ReadByte(); - s->ReadSwap( &fFlags ); + s->ReadLE( &fFlags ); - s->ReadSwap( &fWidth ); - s->ReadSwap( &fHeight ); - s->ReadSwap( &fMaxCharHeight ); + s->ReadLE( &fWidth ); + s->ReadLE( &fHeight ); + s->ReadLE( &fMaxCharHeight ); fBPP = s->ReadByte(); @@ -1943,10 +1943,10 @@ hsBool plFont::ReadRaw( hsStream *s ) else fBMapData = nil; - s->ReadSwap( &fFirstChar ); + s->ReadLE( &fFirstChar ); UInt32 i; - fCharacters.SetCountAndZero( s->ReadSwap32() ); + fCharacters.SetCountAndZero( s->ReadLE32() ); for( i = 0; i < fCharacters.GetCount(); i++ ) fCharacters[ i ].Read( s ); @@ -1959,11 +1959,11 @@ hsBool plFont::WriteRaw( hsStream *s ) { s->Write( sizeof( fFace ), fFace ); s->WriteByte( fSize ); - s->WriteSwap( fFlags ); + s->WriteLE( fFlags ); - s->WriteSwap( fWidth ); - s->WriteSwap( fHeight ); - s->WriteSwap( fMaxCharHeight ); + s->WriteLE( fWidth ); + s->WriteLE( fHeight ); + s->WriteLE( fMaxCharHeight ); s->WriteByte( fBPP ); @@ -1971,10 +1971,10 @@ hsBool plFont::WriteRaw( hsStream *s ) if( size > 0 ) s->Write( size, fBMapData ); - s->WriteSwap( fFirstChar ); + s->WriteLE( fFirstChar ); UInt32 i; - s->WriteSwap32( fCharacters.GetCount() ); + s->WriteLE32( fCharacters.GetCount() ); for( i = 0; i < fCharacters.GetCount(); i++ ) fCharacters[ i ].Write( s ); diff --git a/Sources/Plasma/PubUtilLib/plGImage/plMipmap.cpp b/Sources/Plasma/PubUtilLib/plGImage/plMipmap.cpp index 9d4babb9..9320d70d 100644 --- a/Sources/Plasma/PubUtilLib/plGImage/plMipmap.cpp +++ b/Sources/Plasma/PubUtilLib/plGImage/plMipmap.cpp @@ -216,10 +216,10 @@ UInt32 plMipmap::Read( hsStream *s ) clampBy = 1; UInt32 amtToSkip = 0; - fWidth = s->ReadSwap32(); - fHeight = s->ReadSwap32(); - fRowBytes = s->ReadSwap32(); - fTotalSize = s->ReadSwap32(); + fWidth = s->ReadLE32(); + fHeight = s->ReadLE32(); + fRowBytes = s->ReadLE32(); + fTotalSize = s->ReadLE32(); fNumLevels = s->ReadByte(); totalRead += 4 * 4 + 1; @@ -285,10 +285,10 @@ UInt32 plMipmap::Write( hsStream *s ) { UInt32 totalWritten = plBitmap::Write( s ); - s->WriteSwap32( fWidth ); - s->WriteSwap32( fHeight ); - s->WriteSwap32( fRowBytes ); - s->WriteSwap32( fTotalSize ); + s->WriteLE32( fWidth ); + s->WriteLE32( fHeight ); + s->WriteLE32( fRowBytes ); + s->WriteLE32( fTotalSize ); s->WriteByte( fNumLevels ); totalWritten += 4 * 4 + 1; @@ -337,7 +337,7 @@ void plMipmap::IReadRawImage( hsStream *stream ) case 32: for( i = 0; i < fNumLevels; i++ ) { - stream->ReadSwap32( fLevelSizes[ i ] >> 2, (UInt32 *)data ); + stream->ReadLE32( fLevelSizes[ i ] >> 2, (UInt32 *)data ); data += fLevelSizes[ i ]; } break; @@ -345,7 +345,7 @@ void plMipmap::IReadRawImage( hsStream *stream ) case 16: for( i = 0; i < fNumLevels; i++ ) { - stream->ReadSwap16( fLevelSizes[ i ] >> 1, (UInt16 *)data ); + stream->ReadLE16( fLevelSizes[ i ] >> 1, (UInt16 *)data ); data += fLevelSizes[ i ]; } break; @@ -368,7 +368,7 @@ void plMipmap::IWriteRawImage( hsStream *stream ) case 32: for( i = 0; i < fNumLevels; i++ ) { - stream->WriteSwap32( fLevelSizes[ i ] >> 2, (UInt32 *)data ); + stream->WriteLE32( fLevelSizes[ i ] >> 2, (UInt32 *)data ); data += fLevelSizes[ i ]; } break; @@ -376,7 +376,7 @@ void plMipmap::IWriteRawImage( hsStream *stream ) case 16: for( i = 0; i < fNumLevels; i++ ) { - stream->WriteSwap16( fLevelSizes[ i ] >> 1, (UInt16 *)data ); + stream->WriteLE16( fLevelSizes[ i ] >> 1, (UInt16 *)data ); data += fLevelSizes[ i ]; } break; @@ -457,8 +457,8 @@ plMipmap *plMipmap::IReadRLEImage( hsStream *stream ) while (!done) { - count = stream->ReadSwap32(); - color = stream->ReadSwap32(); + count = stream->ReadLE32(); + color = stream->ReadLE32(); if (count == 0) done = true; else @@ -495,8 +495,8 @@ void plMipmap::IWriteRLEImage( hsStream *stream, plMipmap *mipmap ) color &= 0x00FFFFFF; // strip the alpha (if there is any) if (color != curColor) { - stream->WriteSwap32(count); - stream->WriteSwap32(curColor); + stream->WriteLE32(count); + stream->WriteLE32(curColor); count = 0; curColor = color; } @@ -504,10 +504,10 @@ void plMipmap::IWriteRLEImage( hsStream *stream, plMipmap *mipmap ) src++; curPos++; } - stream->WriteSwap32(count); - stream->WriteSwap32(color); - stream->WriteSwap32(0); // terminate with zero count - stream->WriteSwap32(0); + stream->WriteLE32(count); + stream->WriteLE32(color); + stream->WriteLE32(0); // terminate with zero count + stream->WriteLE32(0); } void plMipmap::IReadJPEGImage( hsStream *stream ) diff --git a/Sources/Plasma/PubUtilLib/plGImage/plTGAWriter.cpp b/Sources/Plasma/PubUtilLib/plGImage/plTGAWriter.cpp index fe5cc05c..0719e07b 100644 --- a/Sources/Plasma/PubUtilLib/plGImage/plTGAWriter.cpp +++ b/Sources/Plasma/PubUtilLib/plGImage/plTGAWriter.cpp @@ -84,11 +84,11 @@ void plTGAWriter::WriteMipmap( const char *fileName, plMipmap *mipmap ) stream.WriteByte( 0 ); // Color map spec stream.WriteByte( 0 ); // Color map spec - stream.WriteSwap16( 0 ); // xOrigin - stream.WriteSwap16( 0 ); // yOrigin + stream.WriteLE16( 0 ); // xOrigin + stream.WriteLE16( 0 ); // yOrigin - stream.WriteSwap16( (UInt16)mipmap->GetWidth() ); - stream.WriteSwap16( (UInt16)mipmap->GetHeight() ); + stream.WriteLE16( (UInt16)mipmap->GetWidth() ); + stream.WriteLE16( (UInt16)mipmap->GetHeight() ); stream.WriteByte( 24 ); stream.WriteByte( 0 ); diff --git a/Sources/Plasma/PubUtilLib/plGLight/plLightInfo.cpp b/Sources/Plasma/PubUtilLib/plGLight/plLightInfo.cpp index 56eaa9a7..737549d9 100644 --- a/Sources/Plasma/PubUtilLib/plGLight/plLightInfo.cpp +++ b/Sources/Plasma/PubUtilLib/plGLight/plLightInfo.cpp @@ -477,7 +477,7 @@ void plLightInfo::Read(hsStream* s, hsResMgr* mgr) plKey nodeKey = mgr->ReadKey(s); ISetSceneNode(nodeKey); - int n = s->ReadSwap32(); + int n = s->ReadLE32(); fVisRegions.SetCountAndZero(n); int i; for( i = 0; i < n; i++ ) @@ -506,7 +506,7 @@ void plLightInfo::Write(hsStream* s, hsResMgr* mgr) mgr->WriteKey(s, fSceneNode); - s->WriteSwap32(fVisRegions.GetCount()); + s->WriteLE32(fVisRegions.GetCount()); int i; for( i = 0; i < fVisRegions.GetCount(); i++ ) mgr->WriteKey(s, fVisRegions[i]); @@ -668,18 +668,18 @@ void plLimitedDirLightInfo::Read(hsStream* s, hsResMgr* mgr) { plDirectionalLightInfo::Read(s, mgr); - fWidth = s->ReadSwapScalar(); - fHeight = s->ReadSwapScalar(); - fDepth = s->ReadSwapScalar(); + fWidth = s->ReadLEScalar(); + fHeight = s->ReadLEScalar(); + fDepth = s->ReadLEScalar(); } void plLimitedDirLightInfo::Write(hsStream* s, hsResMgr* mgr) { plDirectionalLightInfo::Write(s, mgr); - s->WriteSwapScalar(fWidth); - s->WriteSwapScalar(fHeight); - s->WriteSwapScalar(fDepth); + s->WriteLEScalar(fWidth); + s->WriteLEScalar(fHeight); + s->WriteLEScalar(fDepth); } void plLimitedDirLightInfo::IMakeIsect() @@ -840,20 +840,20 @@ void plOmniLightInfo::Read(hsStream* s, hsResMgr* mgr) { plLightInfo::Read(s, mgr); - fAttenConst = s->ReadSwapScalar(); - fAttenLinear = s->ReadSwapScalar(); - fAttenQuadratic = s->ReadSwapScalar(); - fAttenCutoff = s->ReadSwapScalar(); + fAttenConst = s->ReadLEScalar(); + fAttenLinear = s->ReadLEScalar(); + fAttenQuadratic = s->ReadLEScalar(); + fAttenCutoff = s->ReadLEScalar(); } void plOmniLightInfo::Write(hsStream* s, hsResMgr* mgr) { plLightInfo::Write(s, mgr); - s->WriteSwapScalar(fAttenConst); - s->WriteSwapScalar(fAttenLinear); - s->WriteSwapScalar(fAttenQuadratic); - s->WriteSwapScalar( fAttenCutoff ); + s->WriteLEScalar(fAttenConst); + s->WriteLEScalar(fAttenLinear); + s->WriteLEScalar(fAttenQuadratic); + s->WriteLEScalar( fAttenCutoff ); } @@ -972,18 +972,18 @@ void plSpotLightInfo::Read(hsStream* s, hsResMgr* mgr) { plOmniLightInfo::Read(s, mgr); - fFalloff = s->ReadSwapScalar(); - fSpotInner = s->ReadSwapScalar(); - fSpotOuter = s->ReadSwapScalar(); + fFalloff = s->ReadLEScalar(); + fSpotInner = s->ReadLEScalar(); + fSpotOuter = s->ReadLEScalar(); } void plSpotLightInfo::Write(hsStream* s, hsResMgr* mgr) { plOmniLightInfo::Write(s, mgr); - s->WriteSwapScalar(fFalloff); - s->WriteSwapScalar(fSpotInner); - s->WriteSwapScalar(fSpotOuter); + s->WriteLEScalar(fFalloff); + s->WriteLEScalar(fSpotInner); + s->WriteLEScalar(fSpotOuter); } diff --git a/Sources/Plasma/PubUtilLib/plGLight/plShadowCaster.cpp b/Sources/Plasma/PubUtilLib/plGLight/plShadowCaster.cpp index 7bd90524..2c89532b 100644 --- a/Sources/Plasma/PubUtilLib/plGLight/plShadowCaster.cpp +++ b/Sources/Plasma/PubUtilLib/plGLight/plShadowCaster.cpp @@ -88,9 +88,9 @@ void plShadowCaster::Read(hsStream* stream, hsResMgr* mgr) // else fCastFlags &= ~kPerspective; - fBoost = stream->ReadSwapScalar(); - fAttenScale = stream->ReadSwapScalar(); - fBlurScale = stream->ReadSwapScalar(); + fBoost = stream->ReadLEScalar(); + fAttenScale = stream->ReadLEScalar(); + fBlurScale = stream->ReadLEScalar(); Activate(); } @@ -101,9 +101,9 @@ void plShadowCaster::Write(hsStream* stream, hsResMgr* mgr) stream->WriteByte(fCastFlags); - stream->WriteSwapScalar(fBoost); - stream->WriteSwapScalar(fAttenScale); - stream->WriteSwapScalar(fBlurScale); + stream->WriteLEScalar(fBoost); + stream->WriteLEScalar(fAttenScale); + stream->WriteLEScalar(fBlurScale); } void plShadowCaster::Activate() const diff --git a/Sources/Plasma/PubUtilLib/plGLight/plShadowMaster.cpp b/Sources/Plasma/PubUtilLib/plGLight/plShadowMaster.cpp index e9d11f94..b535bc75 100644 --- a/Sources/Plasma/PubUtilLib/plGLight/plShadowMaster.cpp +++ b/Sources/Plasma/PubUtilLib/plGLight/plShadowMaster.cpp @@ -126,15 +126,15 @@ void plShadowMaster::Read(hsStream* stream, hsResMgr* mgr) { plObjInterface::Read(stream, mgr); - fAttenDist = stream->ReadSwapScalar(); + fAttenDist = stream->ReadLEScalar(); - fMaxDist = stream->ReadSwapScalar(); - fMinDist = stream->ReadSwapScalar(); + fMaxDist = stream->ReadLEScalar(); + fMinDist = stream->ReadLEScalar(); - fMaxSize = stream->ReadSwap32(); - fMinSize = stream->ReadSwap32(); + fMaxSize = stream->ReadLE32(); + fMinSize = stream->ReadLE32(); - fPower = stream->ReadSwapScalar(); + fPower = stream->ReadLEScalar(); Activate(); } @@ -143,15 +143,15 @@ void plShadowMaster::Write(hsStream* stream, hsResMgr* mgr) { plObjInterface::Write(stream, mgr); - stream->WriteSwapScalar(fAttenDist); + stream->WriteLEScalar(fAttenDist); - stream->WriteSwapScalar(fMaxDist); - stream->WriteSwapScalar(fMinDist); + stream->WriteLEScalar(fMaxDist); + stream->WriteLEScalar(fMinDist); - stream->WriteSwap32(fMaxSize); - stream->WriteSwap32(fMinSize); + stream->WriteLE32(fMaxSize); + stream->WriteLE32(fMinSize); - stream->WriteSwapScalar(fPower); + stream->WriteLEScalar(fPower); } void plShadowMaster::Activate() const diff --git a/Sources/Plasma/PubUtilLib/plInputCore/plInputInterfaceMgr.cpp b/Sources/Plasma/PubUtilLib/plInputCore/plInputInterfaceMgr.cpp index 3f5f7d4f..f28f73ff 100644 --- a/Sources/Plasma/PubUtilLib/plInputCore/plInputInterfaceMgr.cpp +++ b/Sources/Plasma/PubUtilLib/plInputCore/plInputInterfaceMgr.cpp @@ -81,7 +81,7 @@ plProfile_CreateTimer("Input", "Update", Input); void plCtrlCmd::Write(hsStream* stream, hsResMgr* mgr) { - stream->WriteSwap32( fControlCode ); + stream->WriteLE32( fControlCode ); stream->WriteBool( fControlActivated ); fPt.Write(stream); @@ -91,7 +91,7 @@ void plCtrlCmd::Write(hsStream* stream, hsResMgr* mgr) void plCtrlCmd::Read(hsStream* stream, hsResMgr* mgr) { - fControlCode = (ControlEventCode)stream->ReadSwap32(); + fControlCode = (ControlEventCode)stream->ReadLE32(); fControlActivated = stream->ReadBool(); fPt.Read(stream); diff --git a/Sources/Plasma/PubUtilLib/plInterp/hsKeys.cpp b/Sources/Plasma/PubUtilLib/plInterp/hsKeys.cpp index 6d8e1f1e..bc8a9e19 100644 --- a/Sources/Plasma/PubUtilLib/plInterp/hsKeys.cpp +++ b/Sources/Plasma/PubUtilLib/plInterp/hsKeys.cpp @@ -48,13 +48,13 @@ const int hsKeyFrame::kMaxFrameNumber = 65535; void hsPoint3Key::Read(hsStream *stream) { - fFrame = stream->ReadSwap16(); + fFrame = stream->ReadLE16(); fValue.Read(stream); } void hsPoint3Key::Write(hsStream *stream) { - stream->WriteSwap16(fFrame); + stream->WriteLE16(fFrame); fValue.Write(stream); } @@ -67,7 +67,7 @@ hsBool hsPoint3Key::CompareValue(hsPoint3Key *key) void hsBezPoint3Key::Read(hsStream *stream) { - fFrame = stream->ReadSwap16(); + fFrame = stream->ReadLE16(); fInTan.Read(stream); fOutTan.Read(stream); fValue.Read(stream); @@ -75,7 +75,7 @@ void hsBezPoint3Key::Read(hsStream *stream) void hsBezPoint3Key::Write(hsStream *stream) { - stream->WriteSwap16(fFrame); + stream->WriteLE16(fFrame); fInTan.Write(stream); fOutTan.Write(stream); fValue.Write(stream); @@ -92,14 +92,14 @@ hsBool hsBezPoint3Key::CompareValue(hsBezPoint3Key *key) void hsScalarKey::Read(hsStream *stream) { - fFrame = stream->ReadSwap16(); - fValue = stream->ReadSwapScalar(); + fFrame = stream->ReadLE16(); + fValue = stream->ReadLEScalar(); } void hsScalarKey::Write(hsStream *stream) { - stream->WriteSwap16(fFrame); - stream->WriteSwapScalar(fValue); + stream->WriteLE16(fFrame); + stream->WriteLEScalar(fValue); } hsBool hsScalarKey::CompareValue(hsScalarKey *key) @@ -109,18 +109,18 @@ hsBool hsScalarKey::CompareValue(hsScalarKey *key) void hsBezScalarKey::Read(hsStream *stream) { - fFrame = stream->ReadSwap16(); - fInTan = stream->ReadSwapScalar(); - fOutTan = stream->ReadSwapScalar(); - fValue = stream->ReadSwapScalar(); + fFrame = stream->ReadLE16(); + fInTan = stream->ReadLEScalar(); + fOutTan = stream->ReadLEScalar(); + fValue = stream->ReadLEScalar(); } void hsBezScalarKey::Write(hsStream *stream) { - stream->WriteSwap16(fFrame); - stream->WriteSwapScalar(fInTan); - stream->WriteSwapScalar(fOutTan); - stream->WriteSwapScalar(fValue); + stream->WriteLE16(fFrame); + stream->WriteLEScalar(fInTan); + stream->WriteLEScalar(fOutTan); + stream->WriteLEScalar(fValue); } hsBool hsBezScalarKey::CompareValue(hsBezScalarKey *key) @@ -132,13 +132,13 @@ hsBool hsBezScalarKey::CompareValue(hsBezScalarKey *key) void hsQuatKey::Read(hsStream *stream) { - fFrame = stream->ReadSwap16(); + fFrame = stream->ReadLE16(); fValue.Read(stream); } void hsQuatKey::Write(hsStream *stream) { - stream->WriteSwap16(fFrame); + stream->WriteLE16(fFrame); fValue.Write(stream); } @@ -154,14 +154,14 @@ const hsScalar hsCompressedQuatKey32::k10BitScaleRange = 1023 / (2 * kOneOverRoo void hsCompressedQuatKey32::Read(hsStream *stream) { - fFrame = stream->ReadSwap16(); - fData = stream->ReadSwap32(); + fFrame = stream->ReadLE16(); + fData = stream->ReadLE32(); } void hsCompressedQuatKey32::Write(hsStream *stream) { - stream->WriteSwap16(fFrame); - stream->WriteSwap32(fData); + stream->WriteLE16(fFrame); + stream->WriteLE32(fData); } hsBool hsCompressedQuatKey32::CompareValue(hsCompressedQuatKey32 *key) @@ -295,16 +295,16 @@ const hsScalar hsCompressedQuatKey64::k21BitScaleRange = 2097151 / (2 * kOneOver void hsCompressedQuatKey64::Read(hsStream *stream) { - fFrame = stream->ReadSwap16(); - fData[0] = stream->ReadSwap32(); - fData[1] = stream->ReadSwap32(); + fFrame = stream->ReadLE16(); + fData[0] = stream->ReadLE32(); + fData[1] = stream->ReadLE32(); } void hsCompressedQuatKey64::Write(hsStream *stream) { - stream->WriteSwap16(fFrame); - stream->WriteSwap32(fData[0]); - stream->WriteSwap32(fData[1]); + stream->WriteLE16(fFrame); + stream->WriteLE32(fData[0]); + stream->WriteLE32(fData[1]); } hsBool hsCompressedQuatKey64::CompareValue(hsCompressedQuatKey64 *key) @@ -456,13 +456,13 @@ void hsScaleValue::Write(hsStream *stream) ///////////////////////////////////////// void hsScaleKey::Read(hsStream *stream) { - fFrame = stream->ReadSwap16(); + fFrame = stream->ReadLE16(); fValue.Read(stream); } void hsScaleKey::Write(hsStream *stream) { - stream->WriteSwap16(fFrame); + stream->WriteLE16(fFrame); fValue.Write(stream); } @@ -473,7 +473,7 @@ hsBool hsScaleKey::CompareValue(hsScaleKey *key) void hsBezScaleKey::Read(hsStream *stream) { - fFrame = stream->ReadSwap16(); + fFrame = stream->ReadLE16(); fInTan.Read(stream); fOutTan.Read(stream); fValue.Read(stream); @@ -481,7 +481,7 @@ void hsBezScaleKey::Read(hsStream *stream) void hsBezScaleKey::Write(hsStream *stream) { - stream->WriteSwap16(fFrame); + stream->WriteLE16(fFrame); fInTan.Write(stream); fOutTan.Write(stream); fValue.Write(stream); @@ -510,13 +510,13 @@ void hsG3DSMaxKeyFrame::Set(const hsAffineParts &parts, UInt16 frame) void hsG3DSMaxKeyFrame::Read(hsStream *stream) { - fFrame = stream->ReadSwap16(); + fFrame = stream->ReadLE16(); fParts.Read(stream); } void hsG3DSMaxKeyFrame::Write(hsStream *stream) { - stream->WriteSwap16(fFrame); + stream->WriteLE16(fFrame); fParts.Write(stream); } @@ -529,20 +529,20 @@ hsBool hsG3DSMaxKeyFrame::CompareValue(hsG3DSMaxKeyFrame *key) void hsMatrix33Key::Read(hsStream *stream) { - fFrame = stream->ReadSwap16(); + fFrame = stream->ReadLE16(); Int32 i,j; for(i=0;i<3;i++) for(j=0;j<3;j++) - fValue.fMap[j][i] = stream->ReadSwapScalar(); + fValue.fMap[j][i] = stream->ReadLEScalar(); } void hsMatrix33Key::Write(hsStream *stream) { - stream->WriteSwap16(fFrame); + stream->WriteLE16(fFrame); Int32 i,j; for(i=0;i<3;i++) for(j=0;j<3;j++) - stream->WriteSwapScalar(fValue.fMap[j][i]); + stream->WriteLEScalar(fValue.fMap[j][i]); } hsBool hsMatrix33Key::CompareValue(hsMatrix33Key *key) @@ -554,13 +554,13 @@ hsBool hsMatrix33Key::CompareValue(hsMatrix33Key *key) void hsMatrix44Key::Read(hsStream *stream) { - fFrame = stream->ReadSwap16(); + fFrame = stream->ReadLE16(); fValue.Read(stream); } void hsMatrix44Key::Write(hsStream *stream) { - stream->WriteSwap16(fFrame); + stream->WriteLE16(fFrame); fValue.Write(stream); } diff --git a/Sources/Plasma/PubUtilLib/plInterp/hsTimedValue.h b/Sources/Plasma/PubUtilLib/plInterp/hsTimedValue.h index 6a744886..60eff26b 100644 --- a/Sources/Plasma/PubUtilLib/plInterp/hsTimedValue.h +++ b/Sources/Plasma/PubUtilLib/plInterp/hsTimedValue.h @@ -100,31 +100,31 @@ public: template void hsTimedValue::WriteScalar(hsStream* s, hsScalar currSecs) { - s->WriteSwap32(fFlags); + s->WriteLE32(fFlags); - s->WriteSwapScalar(fValue); + s->WriteLEScalar(fValue); if( !(fFlags & kIdle) ) { - s->WriteSwapScalar(fDuration); - s->WriteSwapScalar(currSecs - fStartTime); + s->WriteLEScalar(fDuration); + s->WriteLEScalar(currSecs - fStartTime); - s->WriteSwapScalar(fGoal); - s->WriteSwapScalar(fFrom); + s->WriteLEScalar(fGoal); + s->WriteLEScalar(fFrom); } } template void hsTimedValue::Write(hsStream* s, hsScalar currSecs) { - s->WriteSwap32(fFlags); + s->WriteLE32(fFlags); fValue.Write(s); if( !(fFlags & kIdle) ) { - s->WriteSwapScalar(fDuration); - s->WriteSwapScalar(currSecs - fStartTime); + s->WriteLEScalar(fDuration); + s->WriteLEScalar(currSecs - fStartTime); fGoal.Write(s); fFrom.Write(s); @@ -134,31 +134,31 @@ void hsTimedValue::Write(hsStream* s, hsScalar currSecs) template void hsTimedValue::ReadScalar(hsStream* s, hsScalar currSecs) { - fFlags = s->ReadSwap32(); + fFlags = s->ReadLE32(); - fValue = s->ReadSwapScalar(); + fValue = s->ReadLEScalar(); if( !(fFlags & kIdle) ) { - fDuration = s->ReadSwapScalar(); - fStartTime = currSecs - s->ReadSwapScalar(); + fDuration = s->ReadLEScalar(); + fStartTime = currSecs - s->ReadLEScalar(); - fGoal = s->ReadSwapScalar(); - fFrom = s->ReadSwapScalar(); + fGoal = s->ReadLEScalar(); + fFrom = s->ReadLEScalar(); } } template void hsTimedValue::Read(hsStream* s, hsScalar currSecs) { - fFlags = s->ReadSwap32(); + fFlags = s->ReadLE32(); fValue.Read(s); if( !(fFlags & kIdle) ) { - fDuration = s->ReadSwapScalar(); - fStartTime = currSecs - s->ReadSwapScalar(); + fDuration = s->ReadLEScalar(); + fStartTime = currSecs - s->ReadLEScalar(); fGoal.Read(s); fFrom.Read(s); diff --git a/Sources/Plasma/PubUtilLib/plInterp/plATCEaseCurves.cpp b/Sources/Plasma/PubUtilLib/plInterp/plATCEaseCurves.cpp index 83fd86cb..2242be86 100644 --- a/Sources/Plasma/PubUtilLib/plInterp/plATCEaseCurves.cpp +++ b/Sources/Plasma/PubUtilLib/plInterp/plATCEaseCurves.cpp @@ -119,24 +119,24 @@ void plATCEaseCurve::Read(hsStream *s, hsResMgr *mgr) { plCreatable::Read(s, mgr); - fMinLength = s->ReadSwapScalar(); - fMaxLength = s->ReadSwapScalar(); - fNormLength = fLength = s->ReadSwapScalar(); - fStartSpeed = s->ReadSwapScalar(); - fSpeed = s->ReadSwapScalar(); - fBeginWorldTime = s->ReadSwapDouble(); + fMinLength = s->ReadLEScalar(); + fMaxLength = s->ReadLEScalar(); + fNormLength = fLength = s->ReadLEScalar(); + fStartSpeed = s->ReadLEScalar(); + fSpeed = s->ReadLEScalar(); + fBeginWorldTime = s->ReadLEDouble(); } void plATCEaseCurve::Write(hsStream *s, hsResMgr *mgr) { plCreatable::Write(s, mgr); - s->WriteSwapScalar(fMinLength); - s->WriteSwapScalar(fMaxLength); - s->WriteSwapScalar(fNormLength); - s->WriteSwapScalar(fStartSpeed); - s->WriteSwapScalar(fSpeed); - s->WriteSwapDouble(fBeginWorldTime); + s->WriteLEScalar(fMinLength); + s->WriteLEScalar(fMaxLength); + s->WriteLEScalar(fNormLength); + s->WriteLEScalar(fStartSpeed); + s->WriteLEScalar(fSpeed); + s->WriteLEDouble(fBeginWorldTime); } /////////////////////////////////////////////////////////////////////////////////////////////// @@ -345,19 +345,19 @@ void plSplineEaseCurve::Read(hsStream *s, hsResMgr *mgr) { plATCEaseCurve::Read(s, mgr); - fCoef[0] = s->ReadSwapScalar(); - fCoef[1] = s->ReadSwapScalar(); - fCoef[2] = s->ReadSwapScalar(); - fCoef[3] = s->ReadSwapScalar(); + fCoef[0] = s->ReadLEScalar(); + fCoef[1] = s->ReadLEScalar(); + fCoef[2] = s->ReadLEScalar(); + fCoef[3] = s->ReadLEScalar(); } void plSplineEaseCurve::Write(hsStream *s, hsResMgr *mgr) { plATCEaseCurve::Write(s, mgr); - s->WriteSwapScalar(fCoef[0]); - s->WriteSwapScalar(fCoef[1]); - s->WriteSwapScalar(fCoef[2]); - s->WriteSwapScalar(fCoef[3]); + s->WriteLEScalar(fCoef[0]); + s->WriteLEScalar(fCoef[1]); + s->WriteLEScalar(fCoef[2]); + s->WriteLEScalar(fCoef[3]); } diff --git a/Sources/Plasma/PubUtilLib/plInterp/plAnimPath.cpp b/Sources/Plasma/PubUtilLib/plInterp/plAnimPath.cpp index 44bb1a09..88835e69 100644 --- a/Sources/Plasma/PubUtilLib/plInterp/plAnimPath.cpp +++ b/Sources/Plasma/PubUtilLib/plInterp/plAnimPath.cpp @@ -188,7 +188,7 @@ void plAnimPath::SetTransform(const hsMatrix44& l2w, const hsMatrix44& w2l) void plAnimPath::Read(hsStream* stream, hsResMgr* mgr) { - fAnimPathFlags=stream->ReadSwap32(); + fAnimPathFlags=stream->ReadLE32(); delete fController; fController = plCompoundController::ConvertNoRef(mgr->ReadCreatable(stream)); @@ -200,15 +200,15 @@ void plAnimPath::Read(hsStream* stream, hsResMgr* mgr) fLocalToWorld.Read(stream); fWorldToLocal.Read(stream); - fLength = stream->ReadSwapScalar(); - fMinDistSq = stream->ReadSwapScalar(); + fLength = stream->ReadLEScalar(); + fMinDistSq = stream->ReadLEScalar(); Reset(); } void plAnimPath::Write(hsStream* stream, hsResMgr* mgr) { - stream->WriteSwap32(fAnimPathFlags); + stream->WriteLE32(fAnimPathFlags); mgr->WriteCreatable(stream, fController); @@ -217,8 +217,8 @@ void plAnimPath::Write(hsStream* stream, hsResMgr* mgr) fLocalToWorld.Write(stream); fWorldToLocal.Write(stream); - stream->WriteSwapScalar(fLength); - stream->WriteSwapScalar(fMinDistSq); + stream->WriteLEScalar(fLength); + stream->WriteLEScalar(fMinDistSq); } hsBool plAnimPath::OutOfRange(hsPoint3 &worldPt, hsScalar range) const diff --git a/Sources/Plasma/PubUtilLib/plInterp/plAnimTimeConvert.cpp b/Sources/Plasma/PubUtilLib/plInterp/plAnimTimeConvert.cpp index 6514bcbf..1a913720 100644 --- a/Sources/Plasma/PubUtilLib/plInterp/plAnimTimeConvert.cpp +++ b/Sources/Plasma/PubUtilLib/plInterp/plAnimTimeConvert.cpp @@ -889,23 +889,23 @@ void plAnimTimeConvert::Read(hsStream* s, hsResMgr* mgr) { plCreatable::Read(s, mgr); - fFlags = (UInt16)(s->ReadSwap32()); + fFlags = (UInt16)(s->ReadLE32()); - fBegin = fInitialBegin = s->ReadSwapScalar(); - fEnd = fInitialEnd = s->ReadSwapScalar(); - fLoopEnd = s->ReadSwapScalar(); - fLoopBegin = s->ReadSwapScalar(); - fSpeed = s->ReadSwapScalar(); + fBegin = fInitialBegin = s->ReadLEScalar(); + fEnd = fInitialEnd = s->ReadLEScalar(); + fLoopEnd = s->ReadLEScalar(); + fLoopBegin = s->ReadLEScalar(); + fSpeed = s->ReadLEScalar(); fEaseInCurve = plATCEaseCurve::ConvertNoRef(mgr->ReadCreatable(s)); fEaseOutCurve = plATCEaseCurve::ConvertNoRef(mgr->ReadCreatable(s)); fSpeedEaseCurve = plATCEaseCurve::ConvertNoRef(mgr->ReadCreatable(s)); - fCurrentAnimTime = s->ReadSwapScalar(); - fLastEvalWorldTime = s->ReadSwapDouble(); + fCurrentAnimTime = s->ReadLEScalar(); + fLastEvalWorldTime = s->ReadLEDouble(); // load other non-synched data; - int count = s->ReadSwap32(); + int count = s->ReadLE32(); fCallbackMsgs.SetCountAndZero(count); int i; @@ -915,10 +915,10 @@ void plAnimTimeConvert::Read(hsStream* s, hsResMgr* mgr) fCallbackMsgs[i] = msg; } - count = s->ReadSwap32(); + count = s->ReadLE32(); for (i = 0; i < count; i++) { - fStopPoints.Append(s->ReadSwapScalar()); + fStopPoints.Append(s->ReadLEScalar()); } IProcessStateChange(0, fBegin); } @@ -927,31 +927,31 @@ void plAnimTimeConvert::Write(hsStream* s, hsResMgr* mgr) { plCreatable::Write(s, mgr); - s->WriteSwap32(fFlags); + s->WriteLE32(fFlags); - s->WriteSwapScalar(fBegin); - s->WriteSwapScalar(fEnd); - s->WriteSwapScalar(fLoopEnd); - s->WriteSwapScalar(fLoopBegin); - s->WriteSwapScalar(fSpeed); + s->WriteLEScalar(fBegin); + s->WriteLEScalar(fEnd); + s->WriteLEScalar(fLoopEnd); + s->WriteLEScalar(fLoopBegin); + s->WriteLEScalar(fSpeed); mgr->WriteCreatable(s, fEaseInCurve); mgr->WriteCreatable(s, fEaseOutCurve); mgr->WriteCreatable(s, fSpeedEaseCurve); - s->WriteSwapScalar(fCurrentAnimTime); - s->WriteSwapDouble(fLastEvalWorldTime); + s->WriteLEScalar(fCurrentAnimTime); + s->WriteLEDouble(fLastEvalWorldTime); // save out other non-synched important data - s->WriteSwap32(fCallbackMsgs.Count()); + s->WriteLE32(fCallbackMsgs.Count()); int i; for (i = 0; i < fCallbackMsgs.Count(); i++) mgr->WriteCreatable(s, fCallbackMsgs[i]); - s->WriteSwap32(fStopPoints.GetCount()); + s->WriteLE32(fStopPoints.GetCount()); for (i = 0; i < fStopPoints.GetCount(); i++) { - s->WriteSwapScalar(fStopPoints.Get(i)); + s->WriteLEScalar(fStopPoints.Get(i)); } } @@ -1347,30 +1347,30 @@ void plAnimTimeConvert::EnableCallbacks(hsBool val) void plATCState::Read(hsStream *s, hsResMgr *mgr) { - fStartWorldTime = s->ReadSwapDouble(); - fStartAnimTime = s->ReadSwapScalar(); - - fFlags = (UInt8)(s->ReadSwap32()); - fEnd = s->ReadSwapScalar(); - fLoopBegin = s->ReadSwapScalar(); - fLoopEnd = s->ReadSwapScalar(); - fSpeed = s->ReadSwapScalar(); - fWrapTime = s->ReadSwapScalar(); + fStartWorldTime = s->ReadLEDouble(); + fStartAnimTime = s->ReadLEScalar(); + + fFlags = (UInt8)(s->ReadLE32()); + fEnd = s->ReadLEScalar(); + fLoopBegin = s->ReadLEScalar(); + fLoopEnd = s->ReadLEScalar(); + fSpeed = s->ReadLEScalar(); + fWrapTime = s->ReadLEScalar(); if (s->ReadBool()) fEaseCurve = plATCEaseCurve::ConvertNoRef(mgr->ReadCreatable(s)); } void plATCState::Write(hsStream *s, hsResMgr *mgr) { - s->WriteSwapDouble(fStartWorldTime); - s->WriteSwapScalar(fStartAnimTime); - - s->WriteSwap32(fFlags); - s->WriteSwapScalar(fEnd); - s->WriteSwapScalar(fLoopBegin); - s->WriteSwapScalar(fLoopEnd); - s->WriteSwapScalar(fSpeed); - s->WriteSwapScalar(fWrapTime); + s->WriteLEDouble(fStartWorldTime); + s->WriteLEScalar(fStartAnimTime); + + s->WriteLE32(fFlags); + s->WriteLEScalar(fEnd); + s->WriteLEScalar(fLoopBegin); + s->WriteLEScalar(fLoopEnd); + s->WriteLEScalar(fSpeed); + s->WriteLEScalar(fWrapTime); if (fEaseCurve != nil) { s->WriteBool(true); diff --git a/Sources/Plasma/PubUtilLib/plInterp/plController.cpp b/Sources/Plasma/PubUtilLib/plInterp/plController.cpp index 00cc675e..298e3708 100644 --- a/Sources/Plasma/PubUtilLib/plInterp/plController.cpp +++ b/Sources/Plasma/PubUtilLib/plInterp/plController.cpp @@ -605,7 +605,7 @@ hsBool plLeafController::PurgeRedundantSubcontrollers() void plLeafController::Read(hsStream* s, hsResMgr *mgr) { UInt8 type = s->ReadByte(); - UInt32 numKeys = s->ReadSwap32(); + UInt32 numKeys = s->ReadLE32(); AllocKeys(numKeys, type); int i; @@ -681,7 +681,7 @@ void plLeafController::Read(hsStream* s, hsResMgr *mgr) void plLeafController::Write(hsStream* s, hsResMgr *mgr) { s->WriteByte(fType); - s->WriteSwap32(fNumKeys); + s->WriteLE32(fNumKeys); int i; switch (fType) diff --git a/Sources/Plasma/PubUtilLib/plInterp/plModulator.cpp b/Sources/Plasma/PubUtilLib/plInterp/plModulator.cpp index 5eb2b38f..99963824 100644 --- a/Sources/Plasma/PubUtilLib/plInterp/plModulator.cpp +++ b/Sources/Plasma/PubUtilLib/plInterp/plModulator.cpp @@ -111,13 +111,13 @@ hsScalar plModulator::Modulation(const hsPoint3& pos) const void plModulator::Read(hsStream* s, hsResMgr* mgr) { fVolume = plVolumeIsect::ConvertNoRef(mgr->ReadCreatable(s)); - fSoftDist = s->ReadSwapScalar(); + fSoftDist = s->ReadLEScalar(); } void plModulator::Write(hsStream* s, hsResMgr* mgr) { mgr->WriteCreatable(s, fVolume); - s->WriteSwapScalar(fSoftDist); + s->WriteLEScalar(fSoftDist); } diff --git a/Sources/Plasma/PubUtilLib/plIntersect/plHardRegionPlanes.cpp b/Sources/Plasma/PubUtilLib/plIntersect/plHardRegionPlanes.cpp index 83460ec5..fb0f914e 100644 --- a/Sources/Plasma/PubUtilLib/plIntersect/plHardRegionPlanes.cpp +++ b/Sources/Plasma/PubUtilLib/plIntersect/plHardRegionPlanes.cpp @@ -103,7 +103,7 @@ void plHardRegionPlanes::Read(hsStream* s, hsResMgr* mgr) { plHardRegion::Read(s, mgr); - int n = s->ReadSwap32(); + int n = s->ReadLE32(); fPlanes.SetCount(n); int i; @@ -123,7 +123,7 @@ void plHardRegionPlanes::Write(hsStream* s, hsResMgr* mgr) { plHardRegion::Write(s, mgr); - s->WriteSwap32(fPlanes.GetCount()); + s->WriteLE32(fPlanes.GetCount()); int i; for( i = 0; i < fPlanes.GetCount(); i++ ) diff --git a/Sources/Plasma/PubUtilLib/plIntersect/plHardRegionTypes.cpp b/Sources/Plasma/PubUtilLib/plIntersect/plHardRegionTypes.cpp index 2c10fe46..a74e7769 100644 --- a/Sources/Plasma/PubUtilLib/plIntersect/plHardRegionTypes.cpp +++ b/Sources/Plasma/PubUtilLib/plIntersect/plHardRegionTypes.cpp @@ -62,7 +62,7 @@ void plHardRegionComplex::Read(hsStream* s, hsResMgr* mgr) { plHardRegion::Read(s, mgr); - int n = s->ReadSwap32(); + int n = s->ReadLE32(); int i; for( i = 0; i < n; i++ ) mgr->ReadKeyNotifyMe(s, TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, 0, kSubRegion), plRefFlags::kActiveRef); @@ -72,7 +72,7 @@ void plHardRegionComplex::Write(hsStream* s, hsResMgr* mgr) { plHardRegion::Write(s, mgr); - s->WriteSwap32(fSubRegions.GetCount()); + s->WriteLE32(fSubRegions.GetCount()); int i; for( i = 0; i < fSubRegions.GetCount(); i++ ) mgr->WriteKey(s, fSubRegions[i]); diff --git a/Sources/Plasma/PubUtilLib/plIntersect/plSoftVolume.cpp b/Sources/Plasma/PubUtilLib/plIntersect/plSoftVolume.cpp index 48d7601b..4d3e9728 100644 --- a/Sources/Plasma/PubUtilLib/plIntersect/plSoftVolume.cpp +++ b/Sources/Plasma/PubUtilLib/plIntersect/plSoftVolume.cpp @@ -65,22 +65,22 @@ void plSoftVolume::Read(hsStream* s, hsResMgr* mgr) { plRegionBase::Read(s, mgr); - fListenState = s->ReadSwap32(); + fListenState = s->ReadLE32(); SetCheckListener(0 != (fListenState & kListenCheck)); - fInsideStrength = s->ReadSwapScalar(); - fOutsideStrength = s->ReadSwapScalar(); + fInsideStrength = s->ReadLEScalar(); + fOutsideStrength = s->ReadLEScalar(); } void plSoftVolume::Write(hsStream* s, hsResMgr* mgr) { plRegionBase::Write(s, mgr); - s->WriteSwap32(fListenState); + s->WriteLE32(fListenState); - s->WriteSwapScalar(fInsideStrength); - s->WriteSwapScalar(fOutsideStrength); + s->WriteLEScalar(fInsideStrength); + s->WriteLEScalar(fOutsideStrength); } hsScalar plSoftVolume::GetStrength(const hsPoint3& pos) const diff --git a/Sources/Plasma/PubUtilLib/plIntersect/plSoftVolumeTypes.cpp b/Sources/Plasma/PubUtilLib/plIntersect/plSoftVolumeTypes.cpp index 6c849f82..25d4a6b4 100644 --- a/Sources/Plasma/PubUtilLib/plIntersect/plSoftVolumeTypes.cpp +++ b/Sources/Plasma/PubUtilLib/plIntersect/plSoftVolumeTypes.cpp @@ -91,7 +91,7 @@ void plSoftVolumeSimple::Read(hsStream* s, hsResMgr* mgr) { plSoftVolume::Read(s, mgr); - fSoftDist = s->ReadSwapScalar(); + fSoftDist = s->ReadLEScalar(); fVolume = plVolumeIsect::ConvertNoRef(mgr->ReadCreatable(s)); } @@ -100,7 +100,7 @@ void plSoftVolumeSimple::Write(hsStream* s, hsResMgr* mgr) { plSoftVolume::Write(s, mgr); - s->WriteSwapScalar(fSoftDist); + s->WriteLEScalar(fSoftDist); mgr->WriteCreatable(s, fVolume); } @@ -126,7 +126,7 @@ void plSoftVolumeComplex::Read(hsStream* s, hsResMgr* mgr) { plSoftVolume::Read(s, mgr); - int n = s->ReadSwap32(); + int n = s->ReadLE32(); int i; for( i = 0; i < n; i++ ) mgr->ReadKeyNotifyMe(s, TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, 0, kSubVolume), plRefFlags::kActiveRef); @@ -136,7 +136,7 @@ void plSoftVolumeComplex::Write(hsStream* s, hsResMgr* mgr) { plSoftVolume::Write(s, mgr); - s->WriteSwap32(fSubVolumes.GetCount()); + s->WriteLE32(fSubVolumes.GetCount()); int i; for( i = 0; i < fSubVolumes.GetCount(); i++ ) mgr->WriteKey(s, fSubVolumes[i]); diff --git a/Sources/Plasma/PubUtilLib/plIntersect/plVolumeIsect.cpp b/Sources/Plasma/PubUtilLib/plIntersect/plVolumeIsect.cpp index a9908258..82c49967 100644 --- a/Sources/Plasma/PubUtilLib/plIntersect/plVolumeIsect.cpp +++ b/Sources/Plasma/PubUtilLib/plIntersect/plVolumeIsect.cpp @@ -153,7 +153,7 @@ void plSphereIsect::Read(hsStream* s, hsResMgr* mgr) { fCenter.Read(s); fWorldCenter.Read(s); - fRadius = s->ReadSwapScalar(); + fRadius = s->ReadLEScalar(); fMins.Read(s); fMaxs.Read(s); } @@ -162,7 +162,7 @@ void plSphereIsect::Write(hsStream* s, hsResMgr* mgr) { fCenter.Write(s); fWorldCenter.Write(s); - s->WriteSwapScalar(fRadius); + s->WriteLEScalar(fRadius); fMins.Write(s); fMaxs.Write(s); } @@ -333,10 +333,10 @@ void plConeIsect::SetLength(hsScalar d) void plConeIsect::Read(hsStream* s, hsResMgr* mgr) { - fCapped = s->ReadSwap32(); + fCapped = s->ReadLE32(); - fRadAngle = s->ReadSwapScalar(); - fLength = s->ReadSwapScalar(); + fRadAngle = s->ReadLEScalar(); + fLength = s->ReadLEScalar(); fWorldTip.Read(s); fWorldNorm.Read(s); @@ -349,16 +349,16 @@ void plConeIsect::Read(hsStream* s, hsResMgr* mgr) for(i = 0; i < n; i++ ) { fNorms[i].Read(s); - fDists[i] = s->ReadSwapScalar(); + fDists[i] = s->ReadLEScalar(); } } void plConeIsect::Write(hsStream* s, hsResMgr* mgr) { - s->WriteSwap32(fCapped); + s->WriteLE32(fCapped); - s->WriteSwapScalar(fRadAngle); - s->WriteSwapScalar(fLength); + s->WriteLEScalar(fRadAngle); + s->WriteLEScalar(fLength); fWorldTip.Write(s); fWorldNorm.Write(s); @@ -371,7 +371,7 @@ void plConeIsect::Write(hsStream* s, hsResMgr* mgr) for(i = 0; i < n; i++ ) { fNorms[i].Write(s); - s->WriteSwapScalar(fDists[i]); + s->WriteLEScalar(fDists[i]); } } @@ -515,26 +515,26 @@ void plCylinderIsect::Read(hsStream* s, hsResMgr* mgr) { fTop.Read(s); fBot.Read(s); - fRadius = s->ReadSwapScalar(); + fRadius = s->ReadLEScalar(); fWorldBot.Read(s); fWorldNorm.Read(s); - fLength = s->ReadSwapScalar(); - fMin = s->ReadSwapScalar(); - fMax = s->ReadSwapScalar(); + fLength = s->ReadLEScalar(); + fMin = s->ReadLEScalar(); + fMax = s->ReadLEScalar(); } void plCylinderIsect::Write(hsStream* s, hsResMgr* mgr) { fTop.Write(s); fBot.Write(s); - s->WriteSwapScalar(fRadius); + s->WriteLEScalar(fRadius); fWorldBot.Write(s); fWorldNorm.Write(s); - s->WriteSwapScalar(fLength); - s->WriteSwapScalar(fMin); - s->WriteSwapScalar(fMax); + s->WriteLEScalar(fLength); + s->WriteLEScalar(fMin); + s->WriteLEScalar(fMax); } /////////////////////////////////////////////////////////////////////////// @@ -634,15 +634,15 @@ hsScalar plParallelIsect::Test(const hsPoint3& pos) const void plParallelIsect::Read(hsStream* s, hsResMgr* mgr) { - int n = s->ReadSwap16(); + int n = s->ReadLE16(); fPlanes.SetCount(n); int i; for( i = 0; i < n; i++ ) { fPlanes[i].fNorm.Read(s); - fPlanes[i].fMin = s->ReadSwapScalar(); - fPlanes[i].fMax = s->ReadSwapScalar(); + fPlanes[i].fMin = s->ReadLEScalar(); + fPlanes[i].fMax = s->ReadLEScalar(); fPlanes[i].fPosOne.Read(s); fPlanes[i].fPosTwo.Read(s); @@ -651,14 +651,14 @@ void plParallelIsect::Read(hsStream* s, hsResMgr* mgr) void plParallelIsect::Write(hsStream* s, hsResMgr* mgr) { - s->WriteSwap16(fPlanes.GetCount()); + s->WriteLE16(fPlanes.GetCount()); int i; for( i = 0; i < fPlanes.GetCount(); i++ ) { fPlanes[i].fNorm.Write(s); - s->WriteSwapScalar(fPlanes[i].fMin); - s->WriteSwapScalar(fPlanes[i].fMax); + s->WriteLEScalar(fPlanes[i].fMin); + s->WriteLEScalar(fPlanes[i].fMax); fPlanes[i].fPosOne.Write(s); fPlanes[i].fPosTwo.Write(s); @@ -777,7 +777,7 @@ hsScalar plConvexIsect::Test(const hsPoint3& pos) const void plConvexIsect::Read(hsStream* s, hsResMgr* mgr) { - Int16 n = s->ReadSwap16(); + Int16 n = s->ReadLE16(); fPlanes.SetCount(n); int i; @@ -785,26 +785,26 @@ void plConvexIsect::Read(hsStream* s, hsResMgr* mgr) { fPlanes[i].fNorm.Read(s); fPlanes[i].fPos.Read(s); - fPlanes[i].fDist = s->ReadSwapScalar(); + fPlanes[i].fDist = s->ReadLEScalar(); fPlanes[i].fWorldNorm.Read(s); - fPlanes[i].fWorldDist = s->ReadSwapScalar(); + fPlanes[i].fWorldDist = s->ReadLEScalar(); } } void plConvexIsect::Write(hsStream* s, hsResMgr* mgr) { - s->WriteSwap16(fPlanes.GetCount()); + s->WriteLE16(fPlanes.GetCount()); int i; for( i = 0; i < fPlanes.GetCount(); i++ ) { fPlanes[i].fNorm.Write(s); fPlanes[i].fPos.Write(s); - s->WriteSwapScalar(fPlanes[i].fDist); + s->WriteLEScalar(fPlanes[i].fDist); fPlanes[i].fWorldNorm.Write(s); - s->WriteSwapScalar(fPlanes[i].fWorldDist); + s->WriteLEScalar(fPlanes[i].fWorldDist); } } @@ -889,7 +889,7 @@ void plComplexIsect::SetTransform(const hsMatrix44& l2w, const hsMatrix44& w2l) void plComplexIsect::Read(hsStream* s, hsResMgr* mgr) { - int n = s->ReadSwap16(); + int n = s->ReadLE16(); fVolumes.SetCount(n); int i; for( i = 0; i < n; i++ ) @@ -901,7 +901,7 @@ void plComplexIsect::Read(hsStream* s, hsResMgr* mgr) void plComplexIsect::Write(hsStream* s, hsResMgr* mgr) { - s->WriteSwap16(fVolumes.GetCount()); + s->WriteLE16(fVolumes.GetCount()); int i; for( i = 0; i < fVolumes.GetCount(); i++ ) mgr->WriteCreatable(s, fVolumes[i]); diff --git a/Sources/Plasma/PubUtilLib/plJPEG/plJPEG.cpp b/Sources/Plasma/PubUtilLib/plJPEG/plJPEG.cpp index 3dd655dc..77c130b8 100644 --- a/Sources/Plasma/PubUtilLib/plJPEG/plJPEG.cpp +++ b/Sources/Plasma/PubUtilLib/plJPEG/plJPEG.cpp @@ -142,7 +142,7 @@ plMipmap *plJPEG::IRead( hsStream *inStream ) /// or a memory buffer. Since we can't give it the former, we have to read the entire /// JPEG stream into a separate buffer before we can decode it. Which means we ALSO /// have to write/read a length of said buffer. Such is life, I guess... - jpegSourceSize = inStream->ReadSwap32(); + jpegSourceSize = inStream->ReadLE32(); jpegSourceBuffer = TRACKED_NEW UInt8[ jpegSourceSize ]; if( jpegSourceBuffer == nil ) { @@ -258,7 +258,7 @@ plMipmap* plJPEG::ReadFromFile( const wchar *fileName ) UInt8 *tempbuffer = TRACKED_NEW UInt8[fsize]; in.Rewind(); in.Read(fsize, tempbuffer); - tempstream.WriteSwap32(fsize); + tempstream.WriteLE32(fsize); tempstream.Write(fsize, tempbuffer); delete [] tempbuffer; tempstream.Rewind(); @@ -344,7 +344,7 @@ hsBool plJPEG::IWrite( plMipmap *source, hsStream *outStream ) delete [] jbuffer; // jpeglib changes bufferSize and bufferAddr - outStream->WriteSwap32( bufferSize ); + outStream->WriteLE32( bufferSize ); outStream->Write( bufferSize, bufferAddr ); } catch( ... ) @@ -384,7 +384,7 @@ hsBool plJPEG::WriteToFile( const wchar *fileName, plMipmap *sourceData ) // The stream writer for JPEGs prepends a 32-bit size, // so remove that from the stream before saving to a file tempstream.Rewind(); - UInt32 fsize = tempstream.ReadSwap32(); + UInt32 fsize = tempstream.ReadLE32(); UInt8 *tempbuffer = TRACKED_NEW UInt8[fsize]; tempstream.Read(fsize, tempbuffer); out.Write(fsize, tempbuffer); diff --git a/Sources/Plasma/PubUtilLib/plMessage/plAccountUpdateMsg.cpp b/Sources/Plasma/PubUtilLib/plMessage/plAccountUpdateMsg.cpp index e6cd9d9d..38cc831b 100644 --- a/Sources/Plasma/PubUtilLib/plMessage/plAccountUpdateMsg.cpp +++ b/Sources/Plasma/PubUtilLib/plMessage/plAccountUpdateMsg.cpp @@ -55,17 +55,17 @@ plAccountUpdateMsg::plAccountUpdateMsg(unsigned updateType) void plAccountUpdateMsg::Read(hsStream* stream, hsResMgr* mgr) { plMessage::IMsgRead(stream, mgr); - fUpdateType = stream->ReadSwap32(); - fResult = stream->ReadSwap32(); - fPlayerInt = stream->ReadSwap32(); + fUpdateType = stream->ReadLE32(); + fResult = stream->ReadLE32(); + fPlayerInt = stream->ReadLE32(); } void plAccountUpdateMsg::Write(hsStream* stream, hsResMgr* mgr) { plMessage::IMsgWrite(stream, mgr); - stream->WriteSwap32(fUpdateType); - stream->WriteSwap32(fResult); - stream->WriteSwap32(fPlayerInt); + stream->WriteLE32(fUpdateType); + stream->WriteLE32(fResult); + stream->WriteLE32(fPlayerInt); } unsigned plAccountUpdateMsg::GetUpdateType() diff --git a/Sources/Plasma/PubUtilLib/plMessage/plActivatorMsg.h b/Sources/Plasma/PubUtilLib/plMessage/plActivatorMsg.h index f20ed00d..7150407c 100644 --- a/Sources/Plasma/PubUtilLib/plMessage/plActivatorMsg.h +++ b/Sources/Plasma/PubUtilLib/plMessage/plActivatorMsg.h @@ -68,14 +68,14 @@ public: void Read(hsStream* stream, hsResMgr* mgr) { plMessage::IMsgRead(stream, mgr); - fTriggerType = stream->ReadSwap32(); + fTriggerType = stream->ReadLE32(); fHitPoint.Read(stream); } void Write(hsStream* stream, hsResMgr* mgr) { plMessage::IMsgWrite(stream, mgr); - stream->WriteSwap32( fTriggerType ); + stream->WriteLE32( fTriggerType ); fHitPoint.Write(stream); } diff --git a/Sources/Plasma/PubUtilLib/plMessage/plAnimCmdMsg.cpp b/Sources/Plasma/PubUtilLib/plMessage/plAnimCmdMsg.cpp index 5e19661c..f2b9755d 100644 --- a/Sources/Plasma/PubUtilLib/plMessage/plAnimCmdMsg.cpp +++ b/Sources/Plasma/PubUtilLib/plMessage/plAnimCmdMsg.cpp @@ -102,13 +102,13 @@ void plAnimCmdMsg::Read(hsStream* stream, hsResMgr* mgr) plMessageWithCallbacks::Read(stream, mgr); fCmd.Read(stream); - stream->ReadSwap(&fBegin); - stream->ReadSwap(&fEnd); - stream->ReadSwap(&fLoopEnd); - stream->ReadSwap(&fLoopBegin); - stream->ReadSwap(&fSpeed); - stream->ReadSwap(&fSpeedChangeRate); - stream->ReadSwap(&fTime); + stream->ReadLE(&fBegin); + stream->ReadLE(&fEnd); + stream->ReadLE(&fLoopEnd); + stream->ReadLE(&fLoopBegin); + stream->ReadLE(&fSpeed); + stream->ReadLE(&fSpeedChangeRate); + stream->ReadLE(&fTime); fAnimName = stream->ReadSafeString(); fLoopName = stream->ReadSafeString(); @@ -119,13 +119,13 @@ void plAnimCmdMsg::Write(hsStream* stream, hsResMgr* mgr) plMessageWithCallbacks::Write(stream, mgr); fCmd.Write(stream); - stream->WriteSwap(fBegin); - stream->WriteSwap(fEnd); - stream->WriteSwap(fLoopEnd); - stream->WriteSwap(fLoopBegin); - stream->WriteSwap(fSpeed); - stream->WriteSwap(fSpeedChangeRate); - stream->WriteSwap(fTime); + stream->WriteLE(fBegin); + stream->WriteLE(fEnd); + stream->WriteLE(fLoopEnd); + stream->WriteLE(fLoopBegin); + stream->WriteLE(fSpeed); + stream->WriteLE(fSpeedChangeRate); + stream->WriteLE(fTime); stream->WriteSafeString(fAnimName); stream->WriteSafeString(fLoopName); @@ -155,10 +155,10 @@ void plAGCmdMsg::Read(hsStream* stream, hsResMgr* mgr) plMessage::IMsgRead(stream, mgr); fCmd.Read(stream); - stream->ReadSwap(&fBlend); - stream->ReadSwap(&fBlendRate); - stream->ReadSwap(&fAmp); - stream->ReadSwap(&fAmpRate); + stream->ReadLE(&fBlend); + stream->ReadLE(&fBlendRate); + stream->ReadLE(&fAmp); + stream->ReadLE(&fAmpRate); fAnimName = stream->ReadSafeString(); } @@ -168,10 +168,10 @@ void plAGCmdMsg::Write(hsStream* stream, hsResMgr* mgr) plMessage::IMsgWrite(stream, mgr); fCmd.Write(stream); - stream->WriteSwap(fBlend); - stream->WriteSwap(fBlendRate); - stream->WriteSwap(fAmp); - stream->WriteSwap(fAmpRate); + stream->WriteLE(fBlend); + stream->WriteLE(fBlendRate); + stream->WriteLE(fAmp); + stream->WriteLE(fAmpRate); stream->WriteSafeString(fAnimName); } diff --git a/Sources/Plasma/PubUtilLib/plMessage/plAvCoopMsg.cpp b/Sources/Plasma/PubUtilLib/plMessage/plAvCoopMsg.cpp index 5e1f4f9f..a9847ec6 100644 --- a/Sources/Plasma/PubUtilLib/plMessage/plAvCoopMsg.cpp +++ b/Sources/Plasma/PubUtilLib/plMessage/plAvCoopMsg.cpp @@ -102,10 +102,10 @@ void plAvCoopMsg::Read(hsStream *stream, hsResMgr *mgr) if(stream->Readbool()) fCoordinator = reinterpret_cast(mgr->ReadCreatable(stream)); - fInitiatorID = stream->ReadSwap32(); - fInitiatorSerial = stream->ReadSwap16(); + fInitiatorID = stream->ReadLE32(); + fInitiatorSerial = stream->ReadLE16(); - fCommand = static_cast(stream->ReadSwap16()); + fCommand = static_cast(stream->ReadLE16()); } // Write ----------------------------------------------- @@ -118,10 +118,10 @@ void plAvCoopMsg::Write(hsStream *stream, hsResMgr *mgr) if(fCoordinator) mgr->WriteCreatable(stream, fCoordinator); - stream->WriteSwap32(fInitiatorID); - stream->WriteSwap16(fInitiatorSerial); + stream->WriteLE32(fInitiatorID); + stream->WriteLE16(fInitiatorSerial); - stream->WriteSwap16(fCommand); + stream->WriteLE16(fCommand); } #endif // ndef NO_AV_MSGS diff --git a/Sources/Plasma/PubUtilLib/plMessage/plAvatarMsg.cpp b/Sources/Plasma/PubUtilLib/plMessage/plAvatarMsg.cpp index ec2e5545..89f00a33 100644 --- a/Sources/Plasma/PubUtilLib/plMessage/plAvatarMsg.cpp +++ b/Sources/Plasma/PubUtilLib/plMessage/plAvatarMsg.cpp @@ -297,10 +297,10 @@ void plAvSeekMsg::Read(hsStream *stream, hsResMgr *mgr) fTargetLookAt.Read(stream); } - fDuration = stream->ReadSwapScalar(); + fDuration = stream->ReadLEScalar(); fSmartSeek = stream->ReadBool(); fAnimName = stream->ReadSafeString(); - fAlignType = static_cast(stream->ReadSwap16()); + fAlignType = static_cast(stream->ReadLE16()); fNoSeek = stream->ReadBool(); fFlags = stream->ReadByte(); fFinishKey = mgr->ReadKey(stream); @@ -318,10 +318,10 @@ void plAvSeekMsg::Write(hsStream *stream, hsResMgr *mgr) fTargetLookAt.Write(stream); } - stream->WriteSwapScalar(fDuration); + stream->WriteLEScalar(fDuration); stream->WriteBool(fSmartSeek); stream->WriteSafeString(fAnimName); - stream->WriteSwap16(static_cast(fAlignType)); + stream->WriteLE16(static_cast(fAlignType)); stream->WriteBool(fNoSeek); stream->WriteByte(fFlags); mgr->WriteKey(stream, fFinishKey); @@ -461,25 +461,25 @@ plAvBrainGenericMsg::plAvBrainGenericMsg(plKey sender, plKey receiver, void plAvBrainGenericMsg::Write(hsStream *stream, hsResMgr *mgr) { plAvatarMsg::Write(stream, mgr); - stream->WriteSwap32(fType); - stream->WriteSwap32(fWhichStage); + stream->WriteLE32(fType); + stream->WriteLE32(fWhichStage); stream->WriteBool(fSetTime); - stream->WriteSwapScalar(fNewTime); + stream->WriteLEScalar(fNewTime); stream->WriteBool(fSetDirection); stream->WriteBool(fNewDirection); - stream->WriteSwapScalar(fTransitionTime); + stream->WriteLEScalar(fTransitionTime); } void plAvBrainGenericMsg::Read(hsStream *stream, hsResMgr *mgr) { plAvatarMsg::Read(stream, mgr); - fType = static_cast(stream->ReadSwap32()); - fWhichStage = stream->ReadSwap32(); + fType = static_cast(stream->ReadLE32()); + fWhichStage = stream->ReadLE32(); fSetTime = stream->ReadBool(); - fNewTime = stream->ReadSwapScalar(); + fNewTime = stream->ReadLEScalar(); fSetDirection = stream->ReadBool(); fNewDirection = stream->ReadBool(); - fTransitionTime = stream->ReadSwapScalar(); + fTransitionTime = stream->ReadLEScalar(); } enum AvBrainGenericFlags @@ -508,19 +508,19 @@ void plAvBrainGenericMsg::WriteVersion(hsStream* s, hsResMgr* mgr) contentFlags.Write(s); // kAvBrainGenericType - s->WriteSwap32(fType); + s->WriteLE32(fType); // kAvBrainGenericWhich - s->WriteSwap32(fWhichStage); + s->WriteLE32(fWhichStage); // kAvBrainGenericSetTime s->WriteBool(fSetTime); // kAvBrainGenericNewTime - s->WriteSwapScalar(fNewTime); + s->WriteLEScalar(fNewTime); // kAvBrainGenericSetDir s->WriteBool(fSetDirection); // kAvBrainGenericNewDir s->WriteBool(fNewDirection); // kAvBrainGenericTransTime - s->WriteSwapScalar(fTransitionTime); + s->WriteLEScalar(fTransitionTime); } void plAvBrainGenericMsg::ReadVersion(hsStream* s, hsResMgr* mgr) @@ -531,19 +531,19 @@ void plAvBrainGenericMsg::ReadVersion(hsStream* s, hsResMgr* mgr) contentFlags.Read(s); if (contentFlags.IsBitSet(kAvBrainGenericType)) - fType = static_cast(s->ReadSwap32()); + fType = static_cast(s->ReadLE32()); if (contentFlags.IsBitSet(kAvBrainGenericWhich)) - fWhichStage = s->ReadSwap32(); + fWhichStage = s->ReadLE32(); if (contentFlags.IsBitSet(kAvBrainGenericSetTime)) fSetTime = s->ReadBool(); if (contentFlags.IsBitSet(kAvBrainGenericNewTime)) - fNewTime = s->ReadSwapScalar(); + fNewTime = s->ReadLEScalar(); if (contentFlags.IsBitSet(kAvBrainGenericSetDir)) fSetDirection = s->ReadBool(); if (contentFlags.IsBitSet(kAvBrainGenericNewDir)) fNewDirection = s->ReadBool(); if (contentFlags.IsBitSet(kAvBrainGenericTransTime)) - fTransitionTime = s->ReadSwapScalar(); + fTransitionTime = s->ReadLEScalar(); } /////////////////// diff --git a/Sources/Plasma/PubUtilLib/plMessage/plBulletMsg.cpp b/Sources/Plasma/PubUtilLib/plMessage/plBulletMsg.cpp index ed158bb9..86071b5d 100644 --- a/Sources/Plasma/PubUtilLib/plMessage/plBulletMsg.cpp +++ b/Sources/Plasma/PubUtilLib/plMessage/plBulletMsg.cpp @@ -55,9 +55,9 @@ void plBulletMsg::Read(hsStream* stream, hsResMgr* mgr) fFrom.Read(stream); fDir.Read(stream); - fRange = stream->ReadSwapScalar(); - fRadius = stream->ReadSwapScalar(); - fPartyTime = stream->ReadSwapScalar(); + fRange = stream->ReadLEScalar(); + fRadius = stream->ReadLEScalar(); + fPartyTime = stream->ReadLEScalar(); } void plBulletMsg::Write(hsStream* stream, hsResMgr* mgr) @@ -68,9 +68,9 @@ void plBulletMsg::Write(hsStream* stream, hsResMgr* mgr) fFrom.Write(stream); fDir.Write(stream); - stream->WriteSwapScalar(fRange); - stream->WriteSwapScalar(fRadius); - stream->WriteSwapScalar(fPartyTime); + stream->WriteLEScalar(fRange); + stream->WriteLEScalar(fRadius); + stream->WriteLEScalar(fPartyTime); } void plBulletMsg::FireShot(const hsPoint3& from, const hsVector3& dir, hsScalar radius, hsScalar range, hsScalar psecs) diff --git a/Sources/Plasma/PubUtilLib/plMessage/plCCRMsg.cpp b/Sources/Plasma/PubUtilLib/plMessage/plCCRMsg.cpp index 00827d6a..d1ecefec 100644 --- a/Sources/Plasma/PubUtilLib/plMessage/plCCRMsg.cpp +++ b/Sources/Plasma/PubUtilLib/plMessage/plCCRMsg.cpp @@ -52,7 +52,7 @@ void plCCRPetitionMsg::Read(hsStream* stream, hsResMgr* mgr) plMsgStdStringHelper::Peek(fNote, stream); plMsgStdStringHelper::Peek(fTitle, stream); - stream->ReadSwap(&fPetitionType); + stream->ReadLE(&fPetitionType); } void plCCRPetitionMsg::Write(hsStream* stream, hsResMgr* mgr) @@ -61,7 +61,7 @@ void plCCRPetitionMsg::Write(hsStream* stream, hsResMgr* mgr) plMsgStdStringHelper::Poke(fNote, stream); plMsgStdStringHelper::Poke(fTitle, stream); - stream->WriteSwap(fPetitionType); + stream->WriteLE(fPetitionType); } /////////////////////////////////////////////////////////// @@ -99,8 +99,8 @@ void plCCRCommunicationMsg::Read(hsStream* stream, hsResMgr* mgr) { plMessage::IMsgRead(stream, mgr); plMsgStdStringHelper::Peek(fString, stream); - fType = (Type)stream->ReadSwap32(); - stream->ReadSwap(&fCCRPlayerID); + fType = (Type)stream->ReadLE32(); + stream->ReadLE(&fCCRPlayerID); } void plCCRCommunicationMsg::Write(hsStream* stream, hsResMgr* mgr) @@ -108,8 +108,8 @@ void plCCRCommunicationMsg::Write(hsStream* stream, hsResMgr* mgr) plMessage::IMsgWrite(stream, mgr); plMsgStdStringHelper::Poke(fString, stream); - stream->WriteSwap32((int)fType); - stream->WriteSwap(fCCRPlayerID); + stream->WriteLE32((int)fType); + stream->WriteLE(fCCRPlayerID); } /////////////////////////////////////////////////////////// diff --git a/Sources/Plasma/PubUtilLib/plMessage/plClimbMsg.cpp b/Sources/Plasma/PubUtilLib/plMessage/plClimbMsg.cpp index 54fa2f75..c3653511 100644 --- a/Sources/Plasma/PubUtilLib/plMessage/plClimbMsg.cpp +++ b/Sources/Plasma/PubUtilLib/plMessage/plClimbMsg.cpp @@ -68,8 +68,8 @@ void plClimbMsg::Read(hsStream *stream, hsResMgr *mgr) { plMessage::IMsgRead(stream, mgr); - fCommand = static_cast(stream->ReadSwap32()); - fDirection = static_cast(stream->ReadSwap32()); + fCommand = static_cast(stream->ReadLE32()); + fDirection = static_cast(stream->ReadLE32()); fStatus = stream->ReadBool(); fTarget = mgr->ReadKey(stream); } @@ -77,8 +77,8 @@ void plClimbMsg::Read(hsStream *stream, hsResMgr *mgr) void plClimbMsg::Write(hsStream *stream, hsResMgr *mgr) { plMessage::IMsgWrite(stream, mgr); - stream->WriteSwap32(static_cast(fCommand)); - stream->WriteSwap32(static_cast(fDirection)); + stream->WriteLE32(static_cast(fCommand)); + stream->WriteLE32(static_cast(fDirection)); stream->WriteBool(fStatus); mgr->WriteKey(stream, fTarget); } diff --git a/Sources/Plasma/PubUtilLib/plMessage/plCondRefMsg.h b/Sources/Plasma/PubUtilLib/plMessage/plCondRefMsg.h index 03b15838..3854f2af 100644 --- a/Sources/Plasma/PubUtilLib/plMessage/plCondRefMsg.h +++ b/Sources/Plasma/PubUtilLib/plMessage/plCondRefMsg.h @@ -66,13 +66,13 @@ public: void Read(hsStream* stream, hsResMgr* mgr) { plRefMsg::Read(stream, mgr); - stream->ReadSwap(&fWhich); + stream->ReadLE(&fWhich); } void Write(hsStream* stream, hsResMgr* mgr) { plRefMsg::Write(stream, mgr); - stream->WriteSwap(fWhich); + stream->WriteLE(fWhich); } }; diff --git a/Sources/Plasma/PubUtilLib/plMessage/plConsoleMsg.h b/Sources/Plasma/PubUtilLib/plMessage/plConsoleMsg.h index ecb34331..e868594a 100644 --- a/Sources/Plasma/PubUtilLib/plMessage/plConsoleMsg.h +++ b/Sources/Plasma/PubUtilLib/plMessage/plConsoleMsg.h @@ -84,7 +84,7 @@ public: virtual void Read(hsStream* s, hsResMgr* mgr) { plMessage::IMsgRead(s, mgr); - s->ReadSwap(&fCmd); + s->ReadLE(&fCmd); // read string plMsgCStringHelper::Peek(fString, s); } @@ -92,7 +92,7 @@ public: virtual void Write(hsStream* s, hsResMgr* mgr) { plMessage::IMsgWrite(s, mgr); - s->WriteSwap(fCmd); + s->WriteLE(fCmd); // write cmd/string plMsgCStringHelper::Poke(fString, s); } diff --git a/Sources/Plasma/PubUtilLib/plMessage/plDynaDecalEnableMsg.cpp b/Sources/Plasma/PubUtilLib/plMessage/plDynaDecalEnableMsg.cpp index 1cf31a2c..edda5a87 100644 --- a/Sources/Plasma/PubUtilLib/plMessage/plDynaDecalEnableMsg.cpp +++ b/Sources/Plasma/PubUtilLib/plMessage/plDynaDecalEnableMsg.cpp @@ -79,11 +79,11 @@ void plDynaDecalEnableMsg::Read(hsStream* stream, hsResMgr* mgr) fKey = mgr->ReadKey(stream); - fConTime = stream->ReadSwapDouble(); + fConTime = stream->ReadLEDouble(); - fFlags = stream->ReadSwap32(); + fFlags = stream->ReadLE32(); - fID = stream->ReadSwap32(); + fID = stream->ReadLE32(); } void plDynaDecalEnableMsg::Write(hsStream* stream, hsResMgr* mgr) @@ -92,10 +92,10 @@ void plDynaDecalEnableMsg::Write(hsStream* stream, hsResMgr* mgr) mgr->WriteKey(stream, fKey); - stream->WriteSwapDouble(fConTime); + stream->WriteLEDouble(fConTime); - stream->WriteSwap32(fFlags); + stream->WriteLE32(fFlags); - stream->WriteSwap32(fID); + stream->WriteLE32(fID); } diff --git a/Sources/Plasma/PubUtilLib/plMessage/plDynamicEnvMapMsg.cpp b/Sources/Plasma/PubUtilLib/plMessage/plDynamicEnvMapMsg.cpp index 184d3a7c..e4ff5e6b 100644 --- a/Sources/Plasma/PubUtilLib/plMessage/plDynamicEnvMapMsg.cpp +++ b/Sources/Plasma/PubUtilLib/plMessage/plDynamicEnvMapMsg.cpp @@ -48,26 +48,26 @@ void plDynamicEnvMapMsg::Read(hsStream* s, hsResMgr* mgr) { plMessage::IMsgRead(s, mgr); - fCmd = s->ReadSwap32(); + fCmd = s->ReadLE32(); fPos.Read(s); - fHither = s->ReadSwapScalar(); - fYon = s->ReadSwapScalar(); - fFogStart = s->ReadSwapScalar(); + fHither = s->ReadLEScalar(); + fYon = s->ReadLEScalar(); + fFogStart = s->ReadLEScalar(); fColor.Read(s); - fRefresh = s->ReadSwapScalar(); + fRefresh = s->ReadLEScalar(); } void plDynamicEnvMapMsg::Write(hsStream* s, hsResMgr* mgr) { plMessage::IMsgWrite(s, mgr); - s->WriteSwap32(fCmd); + s->WriteLE32(fCmd); fPos.Write(s); - s->WriteSwapScalar(fHither); - s->WriteSwapScalar(fYon); - s->WriteSwapScalar(fFogStart); + s->WriteLEScalar(fHither); + s->WriteLEScalar(fYon); + s->WriteLEScalar(fFogStart); fColor.Write(s); - s->WriteSwapScalar(fRefresh); + s->WriteLEScalar(fRefresh); } diff --git a/Sources/Plasma/PubUtilLib/plMessage/plDynamicTextMsg.cpp b/Sources/Plasma/PubUtilLib/plMessage/plDynamicTextMsg.cpp index df448786..faf6cc80 100644 --- a/Sources/Plasma/PubUtilLib/plMessage/plDynamicTextMsg.cpp +++ b/Sources/Plasma/PubUtilLib/plMessage/plDynamicTextMsg.cpp @@ -210,14 +210,14 @@ void plDynamicTextMsg::Read( hsStream *s, hsResMgr *mgr ) { plMessage::IMsgRead( s, mgr ); - s->ReadSwap( &fCmd ); - s->ReadSwap( &fX ); - s->ReadSwap( &fY ); + s->ReadLE( &fCmd ); + s->ReadLE( &fX ); + s->ReadLE( &fY ); - s->ReadSwap( &fLeft ); - s->ReadSwap( &fTop ); - s->ReadSwap( &fRight ); - s->ReadSwap( &fBottom ); + s->ReadLE( &fLeft ); + s->ReadLE( &fTop ); + s->ReadLE( &fRight ); + s->ReadLE( &fBottom ); fClearColor.Read( s ); fColor.Read( s ); @@ -225,10 +225,10 @@ void plDynamicTextMsg::Read( hsStream *s, hsResMgr *mgr ) fString = s->ReadSafeWString(); fImageKey = mgr->ReadKey( s ); - s->ReadSwap( &fFlags ); + s->ReadLE( &fFlags ); - s->ReadSwap( &fBlockRGB ); - s->ReadSwap( &fLineSpacing ); + s->ReadLE( &fBlockRGB ); + s->ReadLE( &fLineSpacing ); } void plDynamicTextMsg::Write( hsStream *s, hsResMgr *mgr ) { @@ -241,14 +241,14 @@ void plDynamicTextMsg::Write( hsStream *s, hsResMgr *mgr ) } #endif - s->WriteSwap( fCmd ); - s->WriteSwap( fX ); - s->WriteSwap( fY ); + s->WriteLE( fCmd ); + s->WriteLE( fX ); + s->WriteLE( fY ); - s->WriteSwap( fLeft ); - s->WriteSwap( fTop ); - s->WriteSwap( fRight ); - s->WriteSwap( fBottom ); + s->WriteLE( fLeft ); + s->WriteLE( fTop ); + s->WriteLE( fRight ); + s->WriteLE( fBottom ); fClearColor.Write( s ); fColor.Write( s ); @@ -256,10 +256,10 @@ void plDynamicTextMsg::Write( hsStream *s, hsResMgr *mgr ) s->WriteSafeWString( fString ); mgr->WriteKey( s, fImageKey ); - s->WriteSwap( fFlags ); + s->WriteLE( fFlags ); - s->WriteSwap( fBlockRGB ); - s->WriteSwap( fLineSpacing ); + s->WriteLE( fBlockRGB ); + s->WriteLE( fLineSpacing ); } enum DynamicTextMsgFlags @@ -288,19 +288,19 @@ void plDynamicTextMsg::ReadVersion(hsStream* s, hsResMgr* mgr) contentFlags.Read(s); if (contentFlags.IsBitSet(kDynTextMsgCmd)) - s->ReadSwap( &fCmd ); + s->ReadLE( &fCmd ); if (contentFlags.IsBitSet(kDynTextMsgX)) - s->ReadSwap( &fX ); + s->ReadLE( &fX ); if (contentFlags.IsBitSet(kDynTextMsgY)) - s->ReadSwap( &fY ); + s->ReadLE( &fY ); if (contentFlags.IsBitSet(kDynTextMsgLeft)) - s->ReadSwap( &fLeft ); + s->ReadLE( &fLeft ); if (contentFlags.IsBitSet(kDynTextMsgTop)) - s->ReadSwap( &fTop ); + s->ReadLE( &fTop ); if (contentFlags.IsBitSet(kDynTextMsgRight)) - s->ReadSwap( &fRight ); + s->ReadLE( &fRight ); if (contentFlags.IsBitSet(kDynTextMsgBottom)) - s->ReadSwap( &fBottom ); + s->ReadLE( &fBottom ); if (contentFlags.IsBitSet(kDynTextMsgClearColor)) fClearColor.Read( s ); if (contentFlags.IsBitSet(kDynTextMsgColor)) @@ -310,11 +310,11 @@ void plDynamicTextMsg::ReadVersion(hsStream* s, hsResMgr* mgr) if (contentFlags.IsBitSet(kDynTextMsgImageKey)) fImageKey = mgr->ReadKey( s ); if (contentFlags.IsBitSet(kDynTextMsgFlags)) - s->ReadSwap( &fFlags ); + s->ReadLE( &fFlags ); if (contentFlags.IsBitSet(kDynTextMsgBlockRGB)) - s->ReadSwap( &fBlockRGB ); + s->ReadLE( &fBlockRGB ); if (contentFlags.IsBitSet(kDynTextMsgLineSpacing)) - s->ReadSwap( &fLineSpacing ); + s->ReadLE( &fLineSpacing ); } void plDynamicTextMsg::WriteVersion(hsStream* s, hsResMgr* mgr) @@ -339,20 +339,20 @@ void plDynamicTextMsg::WriteVersion(hsStream* s, hsResMgr* mgr) contentFlags.Write(s); // kDynTextMsgCmd - s->WriteSwap( fCmd ); + s->WriteLE( fCmd ); // kDynTextMsgX - s->WriteSwap( fX ); + s->WriteLE( fX ); // kDynTextMsgY - s->WriteSwap( fY ); + s->WriteLE( fY ); // kDynTextMsgLeft - s->WriteSwap( fLeft ); + s->WriteLE( fLeft ); // kDynTextMsgTop - s->WriteSwap( fTop ); + s->WriteLE( fTop ); // kDynTextMsgRight - s->WriteSwap( fRight ); + s->WriteLE( fRight ); // kDynTextMsgBottom - s->WriteSwap( fBottom ); + s->WriteLE( fBottom ); // kDynTextMsgClearColor fClearColor.Write( s ); @@ -365,12 +365,12 @@ void plDynamicTextMsg::WriteVersion(hsStream* s, hsResMgr* mgr) mgr->WriteKey( s, fImageKey ); // kDynTextMsgFlags - s->WriteSwap( fFlags ); + s->WriteLE( fFlags ); // kDynTextMsgBlockRGB - s->WriteSwap( fBlockRGB ); + s->WriteLE( fBlockRGB ); // kDynTextMsgLineSpacing - s->WriteSwap( fLineSpacing ); + s->WriteLE( fLineSpacing ); } diff --git a/Sources/Plasma/PubUtilLib/plMessage/plExcludeRegionMsg.h b/Sources/Plasma/PubUtilLib/plMessage/plExcludeRegionMsg.h index 601625fe..93e7a51b 100644 --- a/Sources/Plasma/PubUtilLib/plMessage/plExcludeRegionMsg.h +++ b/Sources/Plasma/PubUtilLib/plMessage/plExcludeRegionMsg.h @@ -77,14 +77,14 @@ public: { plMessage::IMsgRead(stream, mgr); fCmd = stream->ReadByte(); - fSynchFlags = stream->ReadSwap32(); + fSynchFlags = stream->ReadLE32(); } void Write(hsStream* stream, hsResMgr* mgr) { plMessage::IMsgWrite(stream, mgr); stream->WriteByte(fCmd); - stream->WriteSwap32(fSynchFlags); + stream->WriteLE32(fSynchFlags); } }; diff --git a/Sources/Plasma/PubUtilLib/plMessage/plInputEventMsg.cpp b/Sources/Plasma/PubUtilLib/plMessage/plInputEventMsg.cpp index 5eb83843..1b90626c 100644 --- a/Sources/Plasma/PubUtilLib/plMessage/plInputEventMsg.cpp +++ b/Sources/Plasma/PubUtilLib/plMessage/plInputEventMsg.cpp @@ -68,14 +68,14 @@ void plInputEventMsg::Read(hsStream* stream, hsResMgr* mgr) { plMessage::IMsgRead(stream, mgr); - stream->ReadSwap(&fEvent); + stream->ReadLE(&fEvent); } void plInputEventMsg::Write(hsStream* stream, hsResMgr* mgr) { plMessage::IMsgWrite(stream, mgr); - stream->WriteSwap(fEvent); + stream->WriteLE(fEvent); } enum InputEventMsgFlags @@ -91,7 +91,7 @@ void plInputEventMsg::ReadVersion(hsStream* s, hsResMgr* mgr) contentFlags.Read(s); if (contentFlags.IsBitSet(kInputEventMsgEvent)) - s->ReadSwap(&fEvent); + s->ReadLE(&fEvent); } void plInputEventMsg::WriteVersion(hsStream* s, hsResMgr* mgr) @@ -103,7 +103,7 @@ void plInputEventMsg::WriteVersion(hsStream* s, hsResMgr* mgr) contentFlags.Write(s); // kInputEventMsgEvent - s->WriteSwap(fEvent); + s->WriteLE(fEvent); } plControlEventMsg::plControlEventMsg() : @@ -134,9 +134,9 @@ plControlEventMsg::~plControlEventMsg() void plControlEventMsg::Read(hsStream* stream, hsResMgr* mgr) { plInputEventMsg::Read(stream, mgr); - stream->ReadSwap((Int32*)&fControlCode); - stream->ReadSwap(&fControlActivated); - stream->ReadSwap(&fControlPct); + stream->ReadLE((Int32*)&fControlCode); + stream->ReadLE(&fControlActivated); + stream->ReadLE(&fControlPct); fTurnToPt.Read(stream); // read cmd/string @@ -146,9 +146,9 @@ void plControlEventMsg::Read(hsStream* stream, hsResMgr* mgr) void plControlEventMsg::Write(hsStream* stream, hsResMgr* mgr) { plInputEventMsg::Write(stream, mgr); - stream->WriteSwap((Int32)fControlCode); - stream->WriteSwap(fControlActivated); - stream->WriteSwap(fControlPct); + stream->WriteLE((Int32)fControlCode); + stream->WriteLE(fControlActivated); + stream->WriteLE(fControlPct); fTurnToPt.Write(stream); // write cmd/string @@ -172,13 +172,13 @@ void plControlEventMsg::ReadVersion(hsStream* s, hsResMgr* mgr) contentFlags.Read(s); if (contentFlags.IsBitSet(kControlEventMsgCode)) - s->ReadSwap((Int32*)&fControlCode); + s->ReadLE((Int32*)&fControlCode); if (contentFlags.IsBitSet(kControlEventMsgActivated)) - s->ReadSwap(&fControlActivated); + s->ReadLE(&fControlActivated); if (contentFlags.IsBitSet(kControlEventMsgPct)) - s->ReadSwap(&fControlPct); + s->ReadLE(&fControlPct); if (contentFlags.IsBitSet(kControlEventMsgTurnToPt)) fTurnToPt.Read(s); @@ -201,13 +201,13 @@ void plControlEventMsg::WriteVersion(hsStream* s, hsResMgr* mgr) contentFlags.Write(s); // kControlEventMsgCode, - s->WriteSwap((Int32)fControlCode); + s->WriteLE((Int32)fControlCode); // kControlEventMsgActivated, - s->WriteSwap(fControlActivated); + s->WriteLE(fControlActivated); // kControlEventMsgPct, - s->WriteSwap(fControlPct); + s->WriteLE(fControlPct); // kControlEventMsgTurnToPt, fTurnToPt.Write(s); @@ -283,13 +283,13 @@ const UInt8 plAvatarInputStateMsg::fMapSize = 12; void plAvatarInputStateMsg::Read(hsStream *s, hsResMgr *mgr) { plMessage::IMsgRead(s, mgr); - fState = s->ReadSwap16(); + fState = s->ReadLE16(); } void plAvatarInputStateMsg::Write(hsStream *s, hsResMgr *mgr) { plMessage::IMsgWrite(s, mgr); - s->WriteSwap16(fState); + s->WriteLE16(fState); } enum AvatarInputStateMsgFlags @@ -305,7 +305,7 @@ void plAvatarInputStateMsg::ReadVersion(hsStream* s, hsResMgr* mgr) contentFlags.Read(s); if (contentFlags.IsBitSet(kAvatarInputStateMsgState)) - fState = s->ReadSwap16(); + fState = s->ReadLE16(); } void plAvatarInputStateMsg::WriteVersion(hsStream* s, hsResMgr* mgr) @@ -316,7 +316,7 @@ void plAvatarInputStateMsg::WriteVersion(hsStream* s, hsResMgr* mgr) contentFlags.SetBit(kAvatarInputStateMsgState); contentFlags.Write(s); - s->WriteSwap16(fState); + s->WriteLE16(fState); } hsBool plAvatarInputStateMsg::IsCodeInMap(ControlEventCode code) diff --git a/Sources/Plasma/PubUtilLib/plMessage/plInputEventMsg.h b/Sources/Plasma/PubUtilLib/plMessage/plInputEventMsg.h index e761e9e6..d9e36c39 100644 --- a/Sources/Plasma/PubUtilLib/plMessage/plInputEventMsg.h +++ b/Sources/Plasma/PubUtilLib/plMessage/plInputEventMsg.h @@ -165,23 +165,23 @@ public: void Read(hsStream* stream, hsResMgr* mgr) { plInputEventMsg::Read(stream, mgr); - stream->ReadSwap((Int32*)&fKeyCode); - stream->ReadSwap(&fKeyDown); - stream->ReadSwap(&fCapsLockKeyDown); - stream->ReadSwap(&fShiftKeyDown); - stream->ReadSwap(&fCtrlKeyDown); - stream->ReadSwap(&fRepeat); + stream->ReadLE((Int32*)&fKeyCode); + stream->ReadLE(&fKeyDown); + stream->ReadLE(&fCapsLockKeyDown); + stream->ReadLE(&fShiftKeyDown); + stream->ReadLE(&fCtrlKeyDown); + stream->ReadLE(&fRepeat); } void Write(hsStream* stream, hsResMgr* mgr) { plInputEventMsg::Write(stream, mgr); - stream->WriteSwap((Int32)fKeyCode); - stream->WriteSwap(fKeyDown); - stream->WriteSwap(fCapsLockKeyDown); - stream->WriteSwap(fShiftKeyDown); - stream->WriteSwap(fCtrlKeyDown); - stream->WriteSwap(fRepeat); + stream->WriteLE((Int32)fKeyCode); + stream->WriteLE(fKeyDown); + stream->WriteLE(fCapsLockKeyDown); + stream->WriteLE(fShiftKeyDown); + stream->WriteLE(fCtrlKeyDown); + stream->WriteLE(fRepeat); } }; @@ -224,21 +224,21 @@ public: void Read(hsStream* stream, hsResMgr* mgr) { plInputEventMsg::Read(stream, mgr); - stream->ReadSwap((Int32*)&fKeyCode); - stream->ReadSwap(&fKeyDown); - stream->ReadSwap(&fCapsLockKeyDown); - stream->ReadSwap(&fShiftKeyDown); - stream->ReadSwap(&fCtrlKeyDown); + stream->ReadLE((Int32*)&fKeyCode); + stream->ReadLE(&fKeyDown); + stream->ReadLE(&fCapsLockKeyDown); + stream->ReadLE(&fShiftKeyDown); + stream->ReadLE(&fCtrlKeyDown); } void Write(hsStream* stream, hsResMgr* mgr) { plInputEventMsg::Write(stream, mgr); - stream->WriteSwap((Int32)fKeyCode); - stream->WriteSwap(fKeyDown); - stream->WriteSwap(fCapsLockKeyDown); - stream->WriteSwap(fShiftKeyDown); - stream->WriteSwap(fCtrlKeyDown); + stream->WriteLE((Int32)fKeyCode); + stream->WriteLE(fKeyDown); + stream->WriteLE(fCapsLockKeyDown); + stream->WriteLE(fShiftKeyDown); + stream->WriteLE(fCtrlKeyDown); } }; @@ -262,15 +262,15 @@ public: void Read(hsStream* stream, hsResMgr* mgr) { plInputEventMsg::Read(stream, mgr); - stream->ReadSwap(&fX); - stream->ReadSwap(&fWx); + stream->ReadLE(&fX); + stream->ReadLE(&fWx); } void Write(hsStream* stream, hsResMgr* mgr) { plInputEventMsg::Write(stream, mgr); - stream->WriteSwap(fX); - stream->WriteSwap(fWx); + stream->WriteLE(fX); + stream->WriteLE(fWx); } }; @@ -295,15 +295,15 @@ public: void Read(hsStream* stream, hsResMgr* mgr) { plInputEventMsg::Read(stream, mgr); - stream->ReadSwap(&fY); - stream->ReadSwap(&fWy); + stream->ReadLE(&fY); + stream->ReadLE(&fWy); } void Write(hsStream* stream, hsResMgr* mgr) { plInputEventMsg::Write(stream, mgr); - stream->WriteSwap(fY); - stream->WriteSwap(fWy); + stream->WriteLE(fY); + stream->WriteLE(fWy); } }; @@ -326,13 +326,13 @@ public: void Read(hsStream* stream, hsResMgr* mgr) { plInputEventMsg::Read(stream, mgr); - stream->ReadSwap(&fButton); + stream->ReadLE(&fButton); } void Write(hsStream* stream, hsResMgr* mgr) { plInputEventMsg::Write(stream, mgr); - stream->WriteSwap(fButton); + stream->WriteLE(fButton); } }; @@ -379,23 +379,23 @@ public: void Read(hsStream* stream, hsResMgr* mgr) { plInputEventMsg::Read(stream, mgr); - stream->ReadSwap(&fXPos); - stream->ReadSwap(&fYPos); - stream->ReadSwap(&fDX); - stream->ReadSwap(&fDY); - stream->ReadSwap(&fButton); - stream->ReadSwap(&fWheelDelta); + stream->ReadLE(&fXPos); + stream->ReadLE(&fYPos); + stream->ReadLE(&fDX); + stream->ReadLE(&fDY); + stream->ReadLE(&fButton); + stream->ReadLE(&fWheelDelta); } void Write(hsStream* stream, hsResMgr* mgr) { plInputEventMsg::Write(stream, mgr); - stream->WriteSwap(fXPos); - stream->WriteSwap(fYPos); - stream->WriteSwap(fDX); - stream->WriteSwap(fDY); - stream->WriteSwap(fButton); - stream->WriteSwap(fWheelDelta); + stream->WriteLE(fXPos); + stream->WriteLE(fYPos); + stream->WriteLE(fDX); + stream->WriteLE(fDY); + stream->WriteLE(fButton); + stream->WriteLE(fWheelDelta); } }; diff --git a/Sources/Plasma/PubUtilLib/plMessage/plInputIfaceMgrMsg.h b/Sources/Plasma/PubUtilLib/plMessage/plInputIfaceMgrMsg.h index d1259116..40ed943d 100644 --- a/Sources/Plasma/PubUtilLib/plMessage/plInputIfaceMgrMsg.h +++ b/Sources/Plasma/PubUtilLib/plMessage/plInputIfaceMgrMsg.h @@ -100,8 +100,8 @@ class plInputIfaceMgrMsg : public plMessage virtual void Read(hsStream* s, hsResMgr* mgr) { plMessage::IMsgRead( s, mgr ); - s->ReadSwap( &fCommand ); - s->ReadSwap( &fPageID ); + s->ReadLE( &fCommand ); + s->ReadLE( &fPageID ); ageName = s->ReadSafeString(); ageFileName = s->ReadSafeString(); spawnPoint = s->ReadSafeString(); @@ -111,8 +111,8 @@ class plInputIfaceMgrMsg : public plMessage virtual void Write(hsStream* s, hsResMgr* mgr) { plMessage::IMsgWrite( s, mgr ); - s->WriteSwap( fCommand ); - s->WriteSwap( fPageID ); + s->WriteLE( fCommand ); + s->WriteLE( fPageID ); s->WriteSafeString(ageName); s->WriteSafeString(ageFileName); s->WriteSafeString(spawnPoint); diff --git a/Sources/Plasma/PubUtilLib/plMessage/plInterestingPing.h b/Sources/Plasma/PubUtilLib/plMessage/plInterestingPing.h index bfc5f037..cb6dfff1 100644 --- a/Sources/Plasma/PubUtilLib/plMessage/plInterestingPing.h +++ b/Sources/Plasma/PubUtilLib/plMessage/plInterestingPing.h @@ -71,9 +71,9 @@ public: void Read(hsStream* stream, hsResMgr* mgr) { plMessage::IMsgRead(stream, mgr); - stream->ReadSwap(&fWeight); - stream->ReadSwap(&fRadius); - stream->ReadSwap(&fSize); + stream->ReadLE(&fWeight); + stream->ReadLE(&fRadius); + stream->ReadLE(&fSize); fPos.Read(stream); fObj = mgr->ReadKey(stream); } @@ -81,9 +81,9 @@ public: void Write(hsStream* stream, hsResMgr* mgr) { plMessage::IMsgWrite(stream, mgr); - stream->WriteSwap(fWeight); - stream->WriteSwap(fRadius); - stream->WriteSwap(fSize); + stream->WriteLE(fWeight); + stream->WriteLE(fRadius); + stream->WriteLE(fSize); fPos.Write(stream); mgr->WriteKey(stream, fObj); } diff --git a/Sources/Plasma/PubUtilLib/plMessage/plLOSHitMsg.h b/Sources/Plasma/PubUtilLib/plMessage/plLOSHitMsg.h index 287fd23d..c553bb78 100644 --- a/Sources/Plasma/PubUtilLib/plMessage/plLOSHitMsg.h +++ b/Sources/Plasma/PubUtilLib/plMessage/plLOSHitMsg.h @@ -79,8 +79,8 @@ public: fObj = mgr->ReadKey(stream); fHitPoint.Read(stream); fNoHit = stream->ReadBool(); - stream->ReadSwap(&fRequestID); - stream->ReadSwap(&fHitFlags); + stream->ReadLE(&fRequestID); + stream->ReadLE(&fHitFlags); } void Write(hsStream* stream, hsResMgr* mgr) @@ -89,8 +89,8 @@ public: mgr->WriteKey(stream, fObj); fHitPoint.Write(stream); stream->WriteBool(fNoHit); - stream->WriteSwap(fRequestID); - stream->WriteSwap(fHitFlags); + stream->WriteLE(fRequestID); + stream->WriteLE(fHitFlags); } }; diff --git a/Sources/Plasma/PubUtilLib/plMessage/plLayRefMsg.cpp b/Sources/Plasma/PubUtilLib/plMessage/plLayRefMsg.cpp index 3ad0bb87..63c84a87 100644 --- a/Sources/Plasma/PubUtilLib/plMessage/plLayRefMsg.cpp +++ b/Sources/Plasma/PubUtilLib/plMessage/plLayRefMsg.cpp @@ -47,13 +47,13 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com void plLayRefMsg::Read(hsStream* stream, hsResMgr* mgr) { plRefMsg::Read(stream, mgr); - stream->ReadSwap(&fType); - stream->ReadSwap(&fWhich); + stream->ReadLE(&fType); + stream->ReadLE(&fWhich); } void plLayRefMsg::Write(hsStream* stream, hsResMgr* mgr) { plRefMsg::Write(stream, mgr); - stream->WriteSwap(fType); - stream->WriteSwap(fWhich); + stream->WriteLE(fType); + stream->WriteLE(fWhich); } diff --git a/Sources/Plasma/PubUtilLib/plMessage/plLinkToAgeMsg.cpp b/Sources/Plasma/PubUtilLib/plMessage/plLinkToAgeMsg.cpp index 4dc3a6d1..a27d5a3c 100644 --- a/Sources/Plasma/PubUtilLib/plMessage/plLinkToAgeMsg.cpp +++ b/Sources/Plasma/PubUtilLib/plMessage/plLinkToAgeMsg.cpp @@ -146,7 +146,7 @@ void plLinkingMgrMsg::Read( hsStream* stream, hsResMgr* mgr ) contentFlags.Read( stream ); if ( contentFlags.IsBitSet( kLinkingMgrCmd ) ) - stream->ReadSwap( &fLinkingMgrCmd ); + stream->ReadLE( &fLinkingMgrCmd ); if ( contentFlags.IsBitSet( kLinkingMgrArgs ) ) fArgs.Read( stream, mgr ); } @@ -160,7 +160,7 @@ void plLinkingMgrMsg::Write( hsStream* stream, hsResMgr* mgr ) contentFlags.SetBit( kLinkingMgrArgs ); contentFlags.Write( stream ); - stream->WriteSwap( fLinkingMgrCmd ); + stream->WriteLE( fLinkingMgrCmd ); fArgs.Write( stream, mgr ); } @@ -189,12 +189,12 @@ void plLinkEffectsTriggerMsg::Read(hsStream* stream, hsResMgr* mgr) { plMessage::IMsgRead( stream, mgr ); - fInvisLevel = stream->ReadSwap32(); + fInvisLevel = stream->ReadLE32(); fLeavingAge = stream->ReadBool(); fLinkKey = mgr->ReadKey(stream); // This variable is for internal use only. Still read/written for backwards compatability. - fEffects = stream->ReadSwap32(); + fEffects = stream->ReadLE32(); fEffects = 0; fLinkInAnimKey = mgr->ReadKey(stream); @@ -204,10 +204,10 @@ void plLinkEffectsTriggerMsg::Write(hsStream* stream, hsResMgr* mgr) { plMessage::IMsgWrite( stream, mgr ); - stream->WriteSwap32(fInvisLevel); + stream->WriteLE32(fInvisLevel); stream->WriteBool(fLeavingAge); mgr->WriteKey(stream, fLinkKey); - stream->WriteSwap32(fEffects); + stream->WriteLE32(fEffects); mgr->WriteKey(stream, fLinkInAnimKey); } @@ -231,7 +231,7 @@ void plLinkEffectsTriggerMsg::ReadVersion(hsStream* s, hsResMgr* mgr) if (contentFlags.IsBitSet(kLinkEffectsLinkKey)) fLinkKey = mgr->ReadKey(s); if (contentFlags.IsBitSet(kLinkEffectsEffects)) - fEffects = s->ReadSwap32(); + fEffects = s->ReadLE32(); if (contentFlags.IsBitSet(kLinkEffectsLinkInAnimKey)) fLinkInAnimKey = mgr->ReadKey(s); @@ -258,7 +258,7 @@ void plLinkEffectsTriggerMsg::WriteVersion(hsStream* s, hsResMgr* mgr) // kLinkEffectsLinkKey mgr->WriteKey(s, fLinkKey); // kLinkEffectsEffects - s->WriteSwap32(fEffects); + s->WriteLE32(fEffects); // kLinkEffectsLinkInAnimKey mgr->WriteKey(s, fLinkInAnimKey); } @@ -303,7 +303,7 @@ void plLinkEffectBCMsg::Read(hsStream* stream, hsResMgr* mgr) plMessage::IMsgRead(stream, mgr); fLinkKey = mgr->ReadKey(stream); - fLinkFlags = stream->ReadSwap32(); + fLinkFlags = stream->ReadLE32(); } void plLinkEffectBCMsg::Write(hsStream* stream, hsResMgr* mgr) @@ -311,7 +311,7 @@ void plLinkEffectBCMsg::Write(hsStream* stream, hsResMgr* mgr) plMessage::IMsgWrite(stream, mgr); mgr->WriteKey(stream, fLinkKey); - stream->WriteSwap32(fLinkFlags); + stream->WriteLE32(fLinkFlags); } void plLinkEffectBCMsg::SetLinkFlag(UInt32 flag, hsBool on /* = true */) diff --git a/Sources/Plasma/PubUtilLib/plMessage/plLoadAgeMsg.cpp b/Sources/Plasma/PubUtilLib/plMessage/plLoadAgeMsg.cpp index 63f0631f..f5bcbf08 100644 --- a/Sources/Plasma/PubUtilLib/plMessage/plLoadAgeMsg.cpp +++ b/Sources/Plasma/PubUtilLib/plMessage/plLoadAgeMsg.cpp @@ -53,7 +53,7 @@ void plLoadAgeMsg::Read(hsStream* stream, hsResMgr* mgr) // read agename UInt8 len; - stream->ReadSwap(&len); + stream->ReadLE(&len); if (len) { fAgeFilename=TRACKED_NEW char[len+1]; @@ -61,7 +61,7 @@ void plLoadAgeMsg::Read(hsStream* stream, hsResMgr* mgr) fAgeFilename[len]=0; } fUnload = stream->ReadBool(); - stream->ReadSwap(&fPlayerID); + stream->ReadLE(&fPlayerID); fAgeGuid.Read(stream); } @@ -71,13 +71,13 @@ void plLoadAgeMsg::Write(hsStream* stream, hsResMgr* mgr) // write agename UInt8 len=fAgeFilename?hsStrlen(fAgeFilename):0; - stream->WriteSwap(len); + stream->WriteLE(len); if (len) { stream->Write(len, fAgeFilename); } stream->WriteBool(fUnload); - stream->WriteSwap(fPlayerID); + stream->WriteLE(fPlayerID); fAgeGuid.Write(stream); } @@ -107,7 +107,7 @@ void plLoadAgeMsg::ReadVersion(hsStream* s, hsResMgr* mgr) fUnload = s->ReadBool(); if (contentFlags.IsBitSet(kLoadAgePlayerID)) - s->ReadSwap(&fPlayerID); + s->ReadLE(&fPlayerID); if (contentFlags.IsBitSet(kLoadAgeAgeGuid)) fAgeGuid.Read(s); @@ -129,7 +129,7 @@ void plLoadAgeMsg::WriteVersion(hsStream* s, hsResMgr* mgr) // kLoadAgeUnload s->WriteBool(fUnload); // kLoadAgePlayerID - s->WriteSwap(fPlayerID); + s->WriteLE(fPlayerID); // kLoadAgeAgeGuid fAgeGuid.Write(s); } diff --git a/Sources/Plasma/PubUtilLib/plMessage/plLoadCloneMsg.cpp b/Sources/Plasma/PubUtilLib/plMessage/plLoadCloneMsg.cpp index 38c4dc42..796fdf94 100644 --- a/Sources/Plasma/PubUtilLib/plMessage/plLoadCloneMsg.cpp +++ b/Sources/Plasma/PubUtilLib/plMessage/plLoadCloneMsg.cpp @@ -128,8 +128,8 @@ void plLoadCloneMsg::Read(hsStream* stream, hsResMgr* mgr) plMessage::IMsgRead(stream, mgr); fCloneKey = mgr->ReadKey(stream); fRequestorKey = mgr->ReadKey(stream); - fOriginatingPlayerID = stream->ReadSwap32(); - fUserData = stream->ReadSwap32(); + fOriginatingPlayerID = stream->ReadLE32(); + fUserData = stream->ReadLE32(); fValidMsg = stream->ReadBool(); fIsLoading = stream->ReadBool(); fTriggerMsg = plMessage::ConvertNoRef(mgr->ReadCreatable(stream)); @@ -141,8 +141,8 @@ void plLoadCloneMsg::Write(hsStream* stream, hsResMgr* mgr) plMessage::IMsgWrite(stream,mgr); mgr->WriteKey(stream, fCloneKey); mgr->WriteKey(stream, fRequestorKey); - stream->WriteSwap32(fOriginatingPlayerID); - stream->WriteSwap32(fUserData); + stream->WriteLE32(fOriginatingPlayerID); + stream->WriteLE32(fUserData); stream->WriteBool(fValidMsg); stream->WriteBool(fIsLoading); mgr->WriteCreatable(stream, fTriggerMsg); @@ -173,10 +173,10 @@ void plLoadCloneMsg::ReadVersion(hsStream* stream, hsResMgr* mgr) fRequestorKey = mgr->ReadKey(stream); if (contentFlags.IsBitSet(kLoadCloneMsgOrigPlayerID)) - fOriginatingPlayerID = stream->ReadSwap32(); + fOriginatingPlayerID = stream->ReadLE32(); if (contentFlags.IsBitSet(kLoadCloneMsgUserData)) - fUserData = stream->ReadSwap32(); + fUserData = stream->ReadLE32(); if (contentFlags.IsBitSet(kLoadCloneMsgValidMsg)) fValidMsg = stream->ReadBool(); @@ -207,9 +207,9 @@ void plLoadCloneMsg::WriteVersion(hsStream* stream, hsResMgr* mgr) // kLoadCloneMsgRequestorKey mgr->WriteKey(stream, fRequestorKey); // kLoadCloneMsgOrigPlayerID - stream->WriteSwap32(fOriginatingPlayerID); + stream->WriteLE32(fOriginatingPlayerID); // kLoadCloneMsgUserData - stream->WriteSwap32(fUserData); + stream->WriteLE32(fUserData); // kLoadCloneMsgValidMsg stream->WriteBool(fValidMsg); // kLoadCloneMsgIsLoading diff --git a/Sources/Plasma/PubUtilLib/plMessage/plMeshRefMsg.h b/Sources/Plasma/PubUtilLib/plMessage/plMeshRefMsg.h index 5a1cd5bb..d6380114 100644 --- a/Sources/Plasma/PubUtilLib/plMessage/plMeshRefMsg.h +++ b/Sources/Plasma/PubUtilLib/plMessage/plMeshRefMsg.h @@ -69,15 +69,15 @@ public: virtual void Read(hsStream* stream, hsResMgr* mgr) { plRefMsg::Read(stream, mgr); - stream->ReadSwap(&fType); - stream->ReadSwap(&fWhich); + stream->ReadLE(&fType); + stream->ReadLE(&fWhich); } virtual void Write(hsStream* stream, hsResMgr* mgr) { plRefMsg::Write(stream, mgr); - stream->WriteSwap(fType); - stream->WriteSwap(fWhich); + stream->WriteLE(fType); + stream->WriteLE(fWhich); } }; diff --git a/Sources/Plasma/PubUtilLib/plMessage/plNetVoiceListMsg.cpp b/Sources/Plasma/PubUtilLib/plMessage/plNetVoiceListMsg.cpp index a983634d..fdd540a9 100644 --- a/Sources/Plasma/PubUtilLib/plMessage/plNetVoiceListMsg.cpp +++ b/Sources/Plasma/PubUtilLib/plMessage/plNetVoiceListMsg.cpp @@ -50,11 +50,11 @@ void plNetVoiceListMsg::Read(hsStream* stream, hsResMgr* mgr) plMessage::IMsgRead(stream, mgr); fRemoved = mgr->ReadKey(stream); - fCmd = stream->ReadSwap32(); - int n = stream->ReadSwap32(); + fCmd = stream->ReadLE32(); + int n = stream->ReadLE32(); fClientIDs.SetCountAndZero(0); for (int i = 0; i < n; i++) - fClientIDs.Append(stream->ReadSwap32()); + fClientIDs.Append(stream->ReadLE32()); } @@ -63,8 +63,8 @@ void plNetVoiceListMsg::Write(hsStream* stream, hsResMgr* mgr) plMessage::IMsgWrite(stream, mgr); mgr->WriteKey(stream, fRemoved); - stream->WriteSwap32(fCmd); - stream->WriteSwap32(fClientIDs.Count()); + stream->WriteLE32(fCmd); + stream->WriteLE32(fClientIDs.Count()); for (int i = 0; iWriteSwap32(fClientIDs[i]); + stream->WriteLE32(fClientIDs[i]); } \ No newline at end of file diff --git a/Sources/Plasma/PubUtilLib/plMessage/plOneShotCallbacks.cpp b/Sources/Plasma/PubUtilLib/plMessage/plOneShotCallbacks.cpp index a82328e8..3e5552d1 100644 --- a/Sources/Plasma/PubUtilLib/plMessage/plOneShotCallbacks.cpp +++ b/Sources/Plasma/PubUtilLib/plMessage/plOneShotCallbacks.cpp @@ -73,13 +73,13 @@ plOneShotCallbacks::plOneShotCallback& plOneShotCallbacks::GetCallback(int i) void plOneShotCallbacks::Read(hsStream* stream, hsResMgr* mgr) { - int size = stream->ReadSwap32(); + int size = stream->ReadLE32(); fCallbacks.reserve(size); for (int i = 0; i < size; i++) { char *marker = stream->ReadSafeString(); plKey receiver = mgr->ReadKey(stream); - Int16 user = stream->ReadSwap16(); + Int16 user = stream->ReadLE16(); fCallbacks.push_back(plOneShotCallback(marker, receiver, user)); } @@ -88,11 +88,11 @@ void plOneShotCallbacks::Read(hsStream* stream, hsResMgr* mgr) void plOneShotCallbacks::Write(hsStream* stream, hsResMgr* mgr) { int size = fCallbacks.size(); - stream->WriteSwap32(size); + stream->WriteLE32(size); for (int i = 0; i < size; i++) { stream->WriteSafeString(fCallbacks[i].fMarker); mgr->WriteKey(stream, fCallbacks[i].fReceiver); - stream->WriteSwap16(fCallbacks[i].fUser); + stream->WriteLE16(fCallbacks[i].fUser); } } \ No newline at end of file diff --git a/Sources/Plasma/PubUtilLib/plMessage/plParticleUpdateMsg.h b/Sources/Plasma/PubUtilLib/plMessage/plParticleUpdateMsg.h index de819978..d8f153b9 100644 --- a/Sources/Plasma/PubUtilLib/plMessage/plParticleUpdateMsg.h +++ b/Sources/Plasma/PubUtilLib/plMessage/plParticleUpdateMsg.h @@ -96,16 +96,16 @@ public: { plMessage::IMsgRead(stream, mgr); - fParamID = stream->ReadSwap32(); - stream->ReadSwap(&fParamValue); + fParamID = stream->ReadLE32(); + stream->ReadLE(&fParamValue); } virtual void Write(hsStream* stream, hsResMgr* mgr) { plMessage::IMsgWrite(stream, mgr); - stream->WriteSwap32(fParamID); - stream->WriteSwap(fParamValue); + stream->WriteLE32(fParamID); + stream->WriteLE(fParamValue); } }; @@ -134,7 +134,7 @@ public: plMessage::IMsgRead(stream, mgr); fSysSOKey = mgr->ReadKey(stream); - fNumToTransfer = stream->ReadSwap16(); + fNumToTransfer = stream->ReadLE16(); } virtual void Write(hsStream *stream, hsResMgr *mgr) @@ -142,7 +142,7 @@ public: plMessage::IMsgWrite(stream, mgr); mgr->WriteKey(stream, fSysSOKey); - stream->WriteSwap16(fNumToTransfer); + stream->WriteLE16(fNumToTransfer); } }; @@ -177,16 +177,16 @@ public: virtual void Read(hsStream *stream, hsResMgr *mgr) { plMessage::IMsgRead(stream,mgr); - fNumToKill = stream->ReadSwapScalar(); - fTimeLeft = stream->ReadSwapScalar(); - stream->ReadSwap(&fFlags); + fNumToKill = stream->ReadLEScalar(); + fTimeLeft = stream->ReadLEScalar(); + stream->ReadLE(&fFlags); } virtual void Write(hsStream *stream, hsResMgr *mgr) { plMessage::IMsgWrite(stream, mgr); - stream->WriteSwapScalar(fNumToKill); - stream->WriteSwapScalar(fTimeLeft); - stream->WriteSwap(fFlags); + stream->WriteLEScalar(fNumToKill); + stream->WriteLEScalar(fTimeLeft); + stream->WriteLE(fFlags); } }; diff --git a/Sources/Plasma/PubUtilLib/plMessage/plSimInfluenceMsg.cpp b/Sources/Plasma/PubUtilLib/plMessage/plSimInfluenceMsg.cpp index 7255b41f..28faca2d 100644 --- a/Sources/Plasma/PubUtilLib/plMessage/plSimInfluenceMsg.cpp +++ b/Sources/Plasma/PubUtilLib/plMessage/plSimInfluenceMsg.cpp @@ -154,14 +154,14 @@ void plDampMsg::Read(hsStream *stream, hsResMgr *mgr) { plSimInfluenceMsg::Read(stream, mgr); - stream->WriteSwapScalar(fDamp); + stream->WriteLEScalar(fDamp); } void plDampMsg::Write(hsStream * stream, hsResMgr *mgr) { plSimInfluenceMsg::Write(stream, mgr); - fDamp = stream->ReadSwapScalar(); + fDamp = stream->ReadLEScalar(); } diff --git a/Sources/Plasma/PubUtilLib/plMessage/plSynchEnableMsg.cpp b/Sources/Plasma/PubUtilLib/plMessage/plSynchEnableMsg.cpp index 37712201..9746d0e8 100644 --- a/Sources/Plasma/PubUtilLib/plMessage/plSynchEnableMsg.cpp +++ b/Sources/Plasma/PubUtilLib/plMessage/plSynchEnableMsg.cpp @@ -50,13 +50,13 @@ plSynchEnableMsg::plSynchEnableMsg(bool push, bool enable) : fPush(push), fEnabl void plSynchEnableMsg::Read(hsStream* stream, hsResMgr* mgr) { plMessage::IMsgRead( stream, mgr ); - stream->WriteSwap(fEnable); - stream->WriteSwap(fPush); + stream->WriteLE(fEnable); + stream->WriteLE(fPush); } void plSynchEnableMsg::Write(hsStream* stream, hsResMgr* mgr) { plMessage::IMsgWrite( stream, mgr ); - stream->ReadSwap(&fEnable); - stream->ReadSwap(&fPush); + stream->ReadLE(&fEnable); + stream->ReadLE(&fPush); } diff --git a/Sources/Plasma/PubUtilLib/plMessage/plTimerCallbackMsg.h b/Sources/Plasma/PubUtilLib/plMessage/plTimerCallbackMsg.h index 3f26ba45..f835cffc 100644 --- a/Sources/Plasma/PubUtilLib/plMessage/plTimerCallbackMsg.h +++ b/Sources/Plasma/PubUtilLib/plMessage/plTimerCallbackMsg.h @@ -64,15 +64,15 @@ public: virtual void Read(hsStream* stream, hsResMgr* mgr) { plMessage::IMsgRead(stream, mgr); - fID = stream->ReadSwap32(); - fTime = stream->ReadSwapScalar(); + fID = stream->ReadLE32(); + fTime = stream->ReadLEScalar(); } virtual void Write(hsStream* stream, hsResMgr* mgr) { plMessage::IMsgWrite(stream, mgr); - stream->WriteSwap32(fID); - stream->WriteSwapScalar(fTime); + stream->WriteLE32(fID); + stream->WriteLEScalar(fTime); } }; diff --git a/Sources/Plasma/PubUtilLib/plMessage/plTransitionMsg.h b/Sources/Plasma/PubUtilLib/plMessage/plTransitionMsg.h index 23f7af13..5c23dd3d 100644 --- a/Sources/Plasma/PubUtilLib/plMessage/plTransitionMsg.h +++ b/Sources/Plasma/PubUtilLib/plMessage/plTransitionMsg.h @@ -80,17 +80,17 @@ public: virtual void Read(hsStream* s, hsResMgr* mgr) { plMessageWithCallbacks::Read(s, mgr); - s->ReadSwap(&fEffect); - s->ReadSwap(&fLengthInSecs); - s->ReadSwap(&fHoldUntilNext); + s->ReadLE(&fEffect); + s->ReadLE(&fLengthInSecs); + s->ReadLE(&fHoldUntilNext); } virtual void Write(hsStream* s, hsResMgr* mgr) { plMessageWithCallbacks::Write(s, mgr); - s->WriteSwap(fEffect); - s->WriteSwap(fLengthInSecs); - s->WriteSwap(fHoldUntilNext); + s->WriteLE(fEffect); + s->WriteLE(fLengthInSecs); + s->WriteLE(fHoldUntilNext); } }; diff --git a/Sources/Plasma/PubUtilLib/plMessage/plVaultNotifyMsg.cpp b/Sources/Plasma/PubUtilLib/plMessage/plVaultNotifyMsg.cpp index efeb10e2..4963ac9e 100644 --- a/Sources/Plasma/PubUtilLib/plMessage/plVaultNotifyMsg.cpp +++ b/Sources/Plasma/PubUtilLib/plMessage/plVaultNotifyMsg.cpp @@ -56,15 +56,15 @@ plVaultNotifyMsg::~plVaultNotifyMsg() void plVaultNotifyMsg::Read(hsStream* stream, hsResMgr* mgr) { - stream->ReadSwap( &fType ); - stream->ReadSwap( &fResultCode ); + stream->ReadLE( &fType ); + stream->ReadLE( &fResultCode ); fArgs.Read( stream, mgr ); } void plVaultNotifyMsg::Write(hsStream* stream, hsResMgr* mgr) { - stream->WriteSwap( fType ); - stream->WriteSwap( fResultCode ); + stream->WriteLE( fType ); + stream->WriteLE( fResultCode ); fArgs.Write( stream, mgr ); } diff --git a/Sources/Plasma/PubUtilLib/plModifier/plAnimEventModifier.cpp b/Sources/Plasma/PubUtilLib/plModifier/plAnimEventModifier.cpp index 4d972c5d..7b1cdc5e 100644 --- a/Sources/Plasma/PubUtilLib/plModifier/plAnimEventModifier.cpp +++ b/Sources/Plasma/PubUtilLib/plModifier/plAnimEventModifier.cpp @@ -64,7 +64,7 @@ void plAnimEventModifier::Read(hsStream* stream, hsResMgr* mgr) { plSingleModifier::Read(stream, mgr); - int numReceivers = stream->ReadSwap32(); + int numReceivers = stream->ReadLE32(); fReceivers.Expand(numReceivers); for (int i = 0; i < numReceivers; i++) fReceivers.Push(mgr->ReadKey(stream)); @@ -86,7 +86,7 @@ void plAnimEventModifier::Write(hsStream* stream, hsResMgr* mgr) plSingleModifier::Write(stream, mgr); int numReceivers = fReceivers.Count(); - stream->WriteSwap32(numReceivers); + stream->WriteLE32(numReceivers); for (int i = 0; i < numReceivers; i++) mgr->WriteKey(stream, fReceivers[i]); diff --git a/Sources/Plasma/PubUtilLib/plModifier/plDecalEnableMod.cpp b/Sources/Plasma/PubUtilLib/plModifier/plDecalEnableMod.cpp index 186f6c54..b3964e3d 100644 --- a/Sources/Plasma/PubUtilLib/plModifier/plDecalEnableMod.cpp +++ b/Sources/Plasma/PubUtilLib/plModifier/plDecalEnableMod.cpp @@ -93,24 +93,24 @@ void plDecalEnableMod::Read(hsStream* stream, hsResMgr* mgr) { plSingleModifier::Read(stream, mgr); - int n = stream->ReadSwap32(); + int n = stream->ReadLE32(); fDecalMgrs.SetCount(n); int i; for( i = 0; i < n; i++ ) fDecalMgrs[i] = mgr->ReadKey(stream); - fWetLength = stream->ReadSwapScalar(); + fWetLength = stream->ReadLEScalar(); } void plDecalEnableMod::Write(hsStream* stream, hsResMgr* mgr) { plSingleModifier::Write(stream, mgr); - stream->WriteSwap32(fDecalMgrs.GetCount()); + stream->WriteLE32(fDecalMgrs.GetCount()); int i; for( i = 0; i < fDecalMgrs.GetCount(); i++ ) mgr->WriteKey(stream, fDecalMgrs[i]); - stream->WriteSwapScalar(fWetLength); + stream->WriteLEScalar(fWetLength); } diff --git a/Sources/Plasma/PubUtilLib/plModifier/plExcludeRegionModifier.cpp b/Sources/Plasma/PubUtilLib/plModifier/plExcludeRegionModifier.cpp index 3fe6c892..8f4cb483 100644 --- a/Sources/Plasma/PubUtilLib/plModifier/plExcludeRegionModifier.cpp +++ b/Sources/Plasma/PubUtilLib/plModifier/plExcludeRegionModifier.cpp @@ -91,13 +91,13 @@ void plExcludeRegionModifier::Read(hsStream* stream, hsResMgr* mgr) { plSingleModifier::Read(stream, mgr); - int numPoints = stream->ReadSwap32(); + int numPoints = stream->ReadLE32(); for (int i = 0; i < numPoints; i++) { fSafePoints.push_back(mgr->ReadKey(stream)); } fSeek = stream->ReadBool(); - fSeekTime = stream->ReadSwapScalar(); + fSeekTime = stream->ReadLEScalar(); } void plExcludeRegionModifier::Write(hsStream* stream, hsResMgr* mgr) @@ -105,13 +105,13 @@ void plExcludeRegionModifier::Write(hsStream* stream, hsResMgr* mgr) plSingleModifier::Write(stream, mgr); int numPoints = fSafePoints.size(); - stream->WriteSwap32(numPoints); + stream->WriteLE32(numPoints); for (int i = 0; i < numPoints; i++) { mgr->WriteKey(stream,fSafePoints[i]); } stream->WriteBool(fSeek); - stream->WriteSwapScalar(fSeekTime); + stream->WriteLEScalar(fSeekTime); } void plExcludeRegionModifier::ISetPhysicalState(bool cleared) diff --git a/Sources/Plasma/PubUtilLib/plModifier/plGameMarkerModifier.cpp b/Sources/Plasma/PubUtilLib/plModifier/plGameMarkerModifier.cpp index 9adc1e11..247b612f 100644 --- a/Sources/Plasma/PubUtilLib/plModifier/plGameMarkerModifier.cpp +++ b/Sources/Plasma/PubUtilLib/plModifier/plGameMarkerModifier.cpp @@ -85,8 +85,8 @@ void plGameMarkerModifier::Read(hsStream* stream, hsResMgr* mgr) fRedAnimKey = mgr->ReadKey(stream); fOpenAnimKey = mgr->ReadKey(stream); fBounceAnimKey = mgr->ReadKey(stream); - fPlaceSndIdx = stream->ReadSwap16(); - fHitSndIdx = stream->ReadSwap16(); + fPlaceSndIdx = stream->ReadLE16(); + fHitSndIdx = stream->ReadLE16(); } void plGameMarkerModifier::Write(hsStream* stream, hsResMgr* mgr) @@ -97,6 +97,6 @@ void plGameMarkerModifier::Write(hsStream* stream, hsResMgr* mgr) mgr->WriteKey(stream, fRedAnimKey); mgr->WriteKey(stream, fOpenAnimKey); mgr->WriteKey(stream, fBounceAnimKey); - stream->WriteSwap16(fPlaceSndIdx); - stream->WriteSwap16(fHitSndIdx); + stream->WriteLE16(fPlaceSndIdx); + stream->WriteLE16(fHitSndIdx); } diff --git a/Sources/Plasma/PubUtilLib/plModifier/plImageLibMod.cpp b/Sources/Plasma/PubUtilLib/plModifier/plImageLibMod.cpp index 8407a507..dfd87baf 100644 --- a/Sources/Plasma/PubUtilLib/plModifier/plImageLibMod.cpp +++ b/Sources/Plasma/PubUtilLib/plModifier/plImageLibMod.cpp @@ -85,7 +85,7 @@ void plImageLibMod::Read(hsStream* stream, hsResMgr* mgr) { plSingleModifier::Read(stream, mgr); - UInt32 i, count = stream->ReadSwap32(); + UInt32 i, count = stream->ReadLE32(); fImages.SetCountAndZero( count ); for( i = 0; i < count; i++ ) mgr->ReadKeyNotifyMe( stream, TRACKED_NEW plGenRefMsg( GetKey(), plRefMsg::kOnCreate, i, kRefImage ), plRefFlags::kActiveRef ); @@ -95,7 +95,7 @@ void plImageLibMod::Write(hsStream* stream, hsResMgr* mgr) { plSingleModifier::Write(stream, mgr); - stream->WriteSwap32( fImages.GetCount() ); + stream->WriteLE32( fImages.GetCount() ); UInt32 i; for( i = 0; i < fImages.GetCount(); i++ ) mgr->WriteKey( stream, fImages[ i ]->GetKey() ); diff --git a/Sources/Plasma/PubUtilLib/plModifier/plInterfaceInfoModifier.cpp b/Sources/Plasma/PubUtilLib/plModifier/plInterfaceInfoModifier.cpp index f8cb22c9..ca6d71f4 100644 --- a/Sources/Plasma/PubUtilLib/plModifier/plInterfaceInfoModifier.cpp +++ b/Sources/Plasma/PubUtilLib/plModifier/plInterfaceInfoModifier.cpp @@ -58,7 +58,7 @@ plInterfaceInfoModifier::~plInterfaceInfoModifier() void plInterfaceInfoModifier::Read(hsStream* s, hsResMgr* mgr) { plSingleModifier::Read(s, mgr); - int i = s->ReadSwap32(); + int i = s->ReadLE32(); for (int x = 0; x < i; x++) fKeyList.Append(mgr->ReadKey(s)); } @@ -66,7 +66,7 @@ void plInterfaceInfoModifier::Read(hsStream* s, hsResMgr* mgr) void plInterfaceInfoModifier::Write(hsStream* s, hsResMgr* mgr) { plSingleModifier::Write(s, mgr); - s->WriteSwap32(fKeyList.Count()); + s->WriteLE32(fKeyList.Count()); for (int i = 0; i < fKeyList.Count(); i++) mgr->WriteKey(s, fKeyList[i]); } diff --git a/Sources/Plasma/PubUtilLib/plModifier/plLogicModifier.cpp b/Sources/Plasma/PubUtilLib/plModifier/plLogicModifier.cpp index 2c0fd007..da7f2ce6 100644 --- a/Sources/Plasma/PubUtilLib/plModifier/plLogicModifier.cpp +++ b/Sources/Plasma/PubUtilLib/plModifier/plLogicModifier.cpp @@ -239,7 +239,7 @@ void plLogicModifier::Read(hsStream* stream, hsResMgr* mgr) { plLogicModBase::Read(stream, mgr); plCondRefMsg* refMsg; - int n = stream->ReadSwap32(); + int n = stream->ReadLE32(); fConditionList.SetCountAndZero(n); int i; for(i = 0; i < n; i++ ) @@ -247,16 +247,16 @@ void plLogicModifier::Read(hsStream* stream, hsResMgr* mgr) refMsg = TRACKED_NEW plCondRefMsg(GetKey(), i); mgr->ReadKeyNotifyMe(stream,refMsg, plRefFlags::kActiveRef); } - fMyCursor = stream->ReadSwap32(); + fMyCursor = stream->ReadLE32(); } void plLogicModifier::Write(hsStream* stream, hsResMgr* mgr) { plLogicModBase::Write(stream, mgr); - stream->WriteSwap32(fConditionList.GetCount()); + stream->WriteLE32(fConditionList.GetCount()); for( int i = 0; i < fConditionList.GetCount(); i++ ) mgr->WriteKey(stream, fConditionList[i]); - stream->WriteSwap32(fMyCursor); + stream->WriteLE32(fMyCursor); } void plLogicModifier::AddCondition(plConditionalObject* c) diff --git a/Sources/Plasma/PubUtilLib/plModifier/plMaintainersMarkerModifier.cpp b/Sources/Plasma/PubUtilLib/plModifier/plMaintainersMarkerModifier.cpp index e1788149..75bc2d78 100644 --- a/Sources/Plasma/PubUtilLib/plModifier/plMaintainersMarkerModifier.cpp +++ b/Sources/Plasma/PubUtilLib/plModifier/plMaintainersMarkerModifier.cpp @@ -60,11 +60,11 @@ void plMaintainersMarkerModifier::RemoveTarget(plSceneObject* so) void plMaintainersMarkerModifier::Read(hsStream *stream, hsResMgr *mgr) { plMultiModifier::Read(stream, mgr); - stream->ReadSwap(&fCalibrated); + stream->ReadLE(&fCalibrated); } void plMaintainersMarkerModifier::Write(hsStream *stream, hsResMgr *mgr) { plMultiModifier::Write(stream, mgr); - stream->WriteSwap(fCalibrated); + stream->WriteLE(fCalibrated); } diff --git a/Sources/Plasma/PubUtilLib/plNetClientRecorder/plNetClientStreamRecorder.cpp b/Sources/Plasma/PubUtilLib/plNetClientRecorder/plNetClientStreamRecorder.cpp index 8a470e4b..deab3856 100644 --- a/Sources/Plasma/PubUtilLib/plNetClientRecorder/plNetClientStreamRecorder.cpp +++ b/Sources/Plasma/PubUtilLib/plNetClientRecorder/plNetClientStreamRecorder.cpp @@ -138,7 +138,7 @@ bool plNetClientStreamRecorder::BeginPlayback(const char* recName) plSDLMgr::GetInstance()->Read(fRecordStream); fPlaybackTimeOffset = GetTime(); - fNextPlaybackTime = fRecordStream->ReadSwapDouble(); + fNextPlaybackTime = fRecordStream->ReadLEDouble(); fBetweenAges = false; } else @@ -161,7 +161,7 @@ void plNetClientStreamRecorder::RecordMsg(plNetMessage* msg, double secs) if (IProcessRecordMsg(msg,secs)) { - fRecordStream->WriteSwapDouble(secs - fPlaybackTimeOffset); + fRecordStream->WriteLEDouble(secs - fPlaybackTimeOffset); GetResMgr()->WriteCreatableVersion(fRecordStream, msg); ILogMsg(msg); @@ -228,7 +228,7 @@ plNetMessage* plNetClientStreamRecorder::IGetNextMessage() // gameMsg->StreamInfo()->SetStreamType(plMsg->ClassIndex()); // type of game msg } - double nextPlaybackTime = fRecordStream->ReadSwapDouble(); + double nextPlaybackTime = fRecordStream->ReadLEDouble(); if (nextPlaybackTime < fNextPlaybackTime) fBetweenAges = true; diff --git a/Sources/Plasma/PubUtilLib/plNetCommon/plClientGuid.cpp b/Sources/Plasma/PubUtilLib/plNetCommon/plClientGuid.cpp index d7b215c5..ffc45360 100644 --- a/Sources/Plasma/PubUtilLib/plNetCommon/plClientGuid.cpp +++ b/Sources/Plasma/PubUtilLib/plNetCommon/plClientGuid.cpp @@ -304,33 +304,33 @@ std::string plClientGuid::AsLogString() const void plClientGuid::Read(hsStream * s, hsResMgr* mgr) { s->LogSubStreamStart("push me"); - s->LogReadSwap(&fFlags,"Flags"); + s->LogReadLE(&fFlags,"Flags"); if (IsFlagSet(kAccountUUID)) { s->LogSubStreamPushDesc("AcctUUID"); fAccountUUID.Read( s ); } if (IsFlagSet(kPlayerID)) - s->LogReadSwap(&fPlayerID,"PlayerID"); + s->LogReadLE(&fPlayerID,"PlayerID"); else if (IsFlagSet(kTempPlayerID)) - s->LogReadSwap(&fPlayerID,"TempPlayerID"); + s->LogReadLE(&fPlayerID,"TempPlayerID"); if (IsFlagSet(kPlayerName)) { s->LogSubStreamPushDesc("PlayerName"); plMsgStdStringHelper::Peek( fPlayerName, s ); } if (IsFlagSet(kCCRLevel)) - s->LogReadSwap(&fCCRLevel,"CCRLevel"); + s->LogReadLE(&fCCRLevel,"CCRLevel"); if (IsFlagSet(kProtectedLogin)) - s->LogReadSwap(&fProtectedLogin,"ProtectedLogin"); + s->LogReadLE(&fProtectedLogin,"ProtectedLogin"); if (IsFlagSet(kBuildType)) - s->LogReadSwap(&fBuildType,"BuildType"); + s->LogReadLE(&fBuildType,"BuildType"); if (IsFlagSet(kSrcAddr)) - s->LogReadSwap(&fSrcAddr,"SrcAddr"); + s->LogReadLE(&fSrcAddr,"SrcAddr"); if (IsFlagSet(kSrcPort)) - s->LogReadSwap(&fSrcPort,"SrcPort"); + s->LogReadLE(&fSrcPort,"SrcPort"); if (IsFlagSet(kReserved)) - s->LogReadSwap(&fReserved,"Reserved"); + s->LogReadLE(&fReserved,"Reserved"); if (IsFlagSet(kClientKey)) { s->LogSubStreamPushDesc("ClientKey"); @@ -341,27 +341,27 @@ void plClientGuid::Read(hsStream * s, hsResMgr* mgr) void plClientGuid::Write(hsStream * s, hsResMgr* mgr) { - s->WriteSwap(fFlags); + s->WriteLE(fFlags); if (IsFlagSet(kAccountUUID)) fAccountUUID.Write( s ); if (IsFlagSet(kPlayerID)) - s->WriteSwap(fPlayerID); + s->WriteLE(fPlayerID); else if (IsFlagSet(kTempPlayerID)) - s->WriteSwap(fPlayerID); + s->WriteLE(fPlayerID); if (IsFlagSet(kPlayerName)) plMsgStdStringHelper::Poke( fPlayerName, s ); if (IsFlagSet(kCCRLevel)) - s->WriteSwap(fCCRLevel); + s->WriteLE(fCCRLevel); if (IsFlagSet(kProtectedLogin)) - s->WriteSwap(fProtectedLogin); + s->WriteLE(fProtectedLogin); if (IsFlagSet(kBuildType)) - s->WriteSwap(fBuildType); + s->WriteLE(fBuildType); if (IsFlagSet(kSrcAddr)) - s->WriteSwap(fSrcAddr); + s->WriteLE(fSrcAddr); if (IsFlagSet(kSrcPort)) - s->WriteSwap(fSrcPort); + s->WriteLE(fSrcPort); if (IsFlagSet(kReserved)) - s->WriteSwap(fReserved); + s->WriteLE(fReserved); if (IsFlagSet(kClientKey)) plMsgStdStringHelper::Poke( fClientKey, s ); } diff --git a/Sources/Plasma/PubUtilLib/plNetCommon/plNetCommonHelpers.cpp b/Sources/Plasma/PubUtilLib/plNetCommon/plNetCommonHelpers.cpp index ff24e374..e45cc166 100644 --- a/Sources/Plasma/PubUtilLib/plNetCommon/plNetCommonHelpers.cpp +++ b/Sources/Plasma/PubUtilLib/plNetCommon/plNetCommonHelpers.cpp @@ -68,27 +68,27 @@ fDLDroppedPackets(0) void plNetCoreStatsSummary::Read(hsStream* s, hsResMgr*) { UInt8 streamVer; - s->ReadSwap(&streamVer); + s->ReadLE(&streamVer); hsAssert(streamVer==StreamVersion,"plNetCoreStatsSummary invalid stream version."); - s->ReadSwap(&fULBitsPS); - s->ReadSwap(&fDLBitsPS); - s->ReadSwap(&fULPeakBitsPS); - s->ReadSwap(&fDLPeakBitsPS); - s->ReadSwap(&fULPeakPktsPS); - s->ReadSwap(&fDLPeakPktsPS); - s->ReadSwap(&fDLDroppedPackets); + s->ReadLE(&fULBitsPS); + s->ReadLE(&fDLBitsPS); + s->ReadLE(&fULPeakBitsPS); + s->ReadLE(&fDLPeakBitsPS); + s->ReadLE(&fULPeakPktsPS); + s->ReadLE(&fDLPeakPktsPS); + s->ReadLE(&fDLDroppedPackets); } void plNetCoreStatsSummary::Write(hsStream* s, hsResMgr*) { - s->WriteSwap(StreamVersion); - s->WriteSwap(fULBitsPS); - s->WriteSwap(fDLBitsPS); - s->WriteSwap(fULPeakBitsPS); - s->WriteSwap(fDLPeakBitsPS); - s->WriteSwap(fULPeakPktsPS); - s->WriteSwap(fDLPeakPktsPS); - s->WriteSwap(fDLDroppedPackets); + s->WriteLE(StreamVersion); + s->WriteLE(fULBitsPS); + s->WriteLE(fDLBitsPS); + s->WriteLE(fULPeakBitsPS); + s->WriteLE(fDLPeakBitsPS); + s->WriteLE(fULPeakPktsPS); + s->WriteLE(fDLPeakPktsPS); + s->WriteLE(fDLDroppedPackets); } #endif // SERVER @@ -224,19 +224,19 @@ void plCreatableListHelper::Read( hsStream* s, hsResMgr* mgr ) s->LogSubStreamStart("CreatableListHelper"); - s->LogReadSwap( &fFlags, "Flags" ); + s->LogReadLE( &fFlags, "Flags" ); fFlags &= ~kWritten; UInt32 bufSz; - s->LogReadSwap( &bufSz, "BufSz" ); + s->LogReadLE( &bufSz, "BufSz" ); std::string buf; buf.resize( bufSz ); if ( fFlags&kCompressed ) { UInt32 zBufSz; - s->LogReadSwap( &zBufSz, "Compressed BufSz" ); + s->LogReadLE( &zBufSz, "Compressed BufSz" ); std::string zBuf; zBuf.resize( zBufSz ); s->LogSubStreamPushDesc("Compressed Data"); @@ -258,13 +258,13 @@ void plCreatableListHelper::Read( hsStream* s, hsResMgr* mgr ) hsReadOnlyStream ram( bufSz, (void*)buf.data() ); UInt16 nItems; - ram.ReadSwap( &nItems ); + ram.ReadLE( &nItems ); for ( int i=0; i::iterator ii=fItems.begin(); ii!=fItems.end(); ++ii ) { UInt16 id = ii->first; plCreatable * item = ii->second; UInt16 classIdx = item->ClassIndex(); - ram.WriteSwap( id ); - ram.WriteSwap( classIdx ); + ram.WriteLE( id ); + ram.WriteLE( classIdx ); item->Write( &ram, mgr ); } @@ -322,13 +322,13 @@ void plCreatableListHelper::Write( hsStream* s, hsResMgr* mgr ) ram.Truncate(); - ram.WriteSwap( fFlags ); - ram.WriteSwap( bufSz ); + ram.WriteLE( fFlags ); + ram.WriteLE( bufSz ); if ( fFlags&kCompressed ) { UInt32 zBufSz = buf.size(); - ram.WriteSwap( zBufSz ); + ram.WriteLE( zBufSz ); } ram.Write( buf.size(), buf.data() ); diff --git a/Sources/Plasma/PubUtilLib/plNetCommon/plNetServerSessionInfo.cpp b/Sources/Plasma/PubUtilLib/plNetCommon/plNetServerSessionInfo.cpp index 1d25a5b4..acadfe3f 100644 --- a/Sources/Plasma/PubUtilLib/plNetCommon/plNetServerSessionInfo.cpp +++ b/Sources/Plasma/PubUtilLib/plNetCommon/plNetServerSessionInfo.cpp @@ -60,7 +60,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com void plAgeInfoStruct::Read( hsStream * s, hsResMgr* ) { s->LogSubStreamStart("push me"); - s->LogReadSwap( &fFlags ,"AgeInfoStruct Flags"); + s->LogReadLE( &fFlags ,"AgeInfoStruct Flags"); if ( IsFlagSet( kHasAgeFilename ) ) { s->LogSubStreamPushDesc("AgeFilename"); plMsgStdStringHelper::Peek(fAgeFilename,s); @@ -78,14 +78,14 @@ void plAgeInfoStruct::Read( hsStream * s, hsResMgr* ) plMsgStdStringHelper::Peek(fAgeUserDefinedName,s); } if ( IsFlagSet( kHasAgeSequenceNumber ) ) { - s->LogReadSwap( &fAgeSequenceNumber ,"AgeSequenceNumber"); + s->LogReadLE( &fAgeSequenceNumber ,"AgeSequenceNumber"); } if ( IsFlagSet( kHasAgeDescription ) ) { s->LogSubStreamPushDesc("AgeDescription"); plMsgStdStringHelper::Peek(fAgeDescription,s); } if ( IsFlagSet( kHasAgeLanguage ) ) { - s->LogReadSwap( &fAgeLanguage ,"AgeLanguage"); + s->LogReadLE( &fAgeLanguage ,"AgeLanguage"); } UpdateFlags(); s->LogSubStreamEnd(); @@ -94,7 +94,7 @@ void plAgeInfoStruct::Read( hsStream * s, hsResMgr* ) void plAgeInfoStruct::Write( hsStream * s, hsResMgr* ) { UpdateFlags(); - s->WriteSwap( fFlags ); + s->WriteLE( fFlags ); if ( IsFlagSet( kHasAgeFilename ) ) plMsgStdStringHelper::Poke(fAgeFilename,s); if ( IsFlagSet( kHasAgeInstanceName ) ) @@ -104,11 +104,11 @@ void plAgeInfoStruct::Write( hsStream * s, hsResMgr* ) if ( IsFlagSet( kHasAgeUserDefinedName ) ) plMsgStdStringHelper::Poke(fAgeUserDefinedName,s); if ( IsFlagSet( kHasAgeSequenceNumber ) ) - s->WriteSwap( fAgeSequenceNumber ); + s->WriteLE( fAgeSequenceNumber ); if ( IsFlagSet( kHasAgeDescription ) ) plMsgStdStringHelper::Poke(fAgeDescription,s); if ( IsFlagSet( kHasAgeLanguage ) ) - s->WriteSwap( fAgeLanguage ); + s->WriteLE( fAgeLanguage ); } bool plAgeInfoStruct::IsEqualTo( const plAgeInfoStruct * other ) const @@ -379,13 +379,13 @@ plAgeLinkStruct::plAgeLinkStruct() void plAgeLinkStruct::Read( hsStream * s, hsResMgr* m) { s->LogSubStreamStart("push me"); - s->LogReadSwap( &fFlags ,"AgeLinkStruct Flags"); + s->LogReadLE( &fFlags ,"AgeLinkStruct Flags"); if ( IsFlagSet( kHasAgeInfo ) ) { s->LogSubStreamPushDesc("AgeInfo"); fAgeInfo.Read( s,m ); } if ( IsFlagSet( kHasLinkingRules ) ) - s->LogReadSwap( &fLinkingRules ,"LinkingRules"); + s->LogReadLE( &fLinkingRules ,"LinkingRules"); if ( IsFlagSet( kHasSpawnPt_DEAD ) ) { std::string str; @@ -412,7 +412,7 @@ void plAgeLinkStruct::Read( hsStream * s, hsResMgr* m) fSpawnPoint.Read( s ); } if ( IsFlagSet( kHasAmCCR ) ) - s->LogReadSwap( &fAmCCR ,"AmCCR"); + s->LogReadLE( &fAmCCR ,"AmCCR"); if ( IsFlagSet( kHasParentAgeFilename ) ) { @@ -423,15 +423,15 @@ void plAgeLinkStruct::Read( hsStream * s, hsResMgr* m) void plAgeLinkStruct::Write( hsStream * s, hsResMgr* m) { - s->WriteSwap( fFlags ); + s->WriteLE( fFlags ); if ( IsFlagSet( kHasAgeInfo ) ) fAgeInfo.Write( s,m ); if ( IsFlagSet( kHasLinkingRules ) ) - s->WriteSwap( fLinkingRules ); + s->WriteLE( fLinkingRules ); if ( IsFlagSet( kHasSpawnPt ) ) fSpawnPoint.Write( s ); if ( IsFlagSet( kHasAmCCR ) ) - s->WriteSwap( fAmCCR ); + s->WriteLE( fAmCCR ); if ( IsFlagSet( kHasParentAgeFilename ) ) plMsgStdStringHelper::Poke(fParentAgeFilename,s); } @@ -543,19 +543,19 @@ void plNetServerSessionInfo::Read(hsStream* s, hsResMgr*) { Clear(); s->LogSubStreamStart("push me"); - s->LogReadSwap(&fFlags,"ServerSessionInfo Flags"); + s->LogReadLE(&fFlags,"ServerSessionInfo Flags"); if (IsFlagSet(kHasServerName)){ s->LogSubStreamPushDesc("ServerName"); plMsgStdStringHelper::Peek(fServerName,s); } if (IsFlagSet(kHasServerType)) - s->LogReadSwap(&fServerType,"ServerType"); + s->LogReadLE(&fServerType,"ServerType"); if (IsFlagSet(kHasServerAddr)){ s->LogSubStreamPushDesc("ServerAddr"); plMsgStdStringHelper::Peek(fServerAddr,s); } if (IsFlagSet(kHasServerPort)) - s->LogReadSwap(&fServerPort,"ServerPort"); + s->LogReadLE(&fServerPort,"ServerPort"); if (IsFlagSet(kHasServerGuid)){ s->LogSubStreamPushDesc("ServerGuid"); fServerGuid.Read(s); @@ -564,15 +564,15 @@ void plNetServerSessionInfo::Read(hsStream* s, hsResMgr*) void plNetServerSessionInfo::Write(hsStream* s, hsResMgr*) { - s->WriteSwap(fFlags); + s->WriteLE(fFlags); if (IsFlagSet(kHasServerName)) plMsgStdStringHelper::Poke(fServerName,s); if (IsFlagSet(kHasServerType)) - s->WriteSwap(fServerType); + s->WriteLE(fServerType); if (IsFlagSet(kHasServerAddr)) plMsgStdStringHelper::Poke(fServerAddr,s); if (IsFlagSet(kHasServerPort)) - s->WriteSwap(fServerPort); + s->WriteLE(fServerPort); if (IsFlagSet(kHasServerGuid)) fServerGuid.Write(s); } diff --git a/Sources/Plasma/PubUtilLib/plNetMessage/plNetMessage.cpp b/Sources/Plasma/PubUtilLib/plNetMessage/plNetMessage.cpp index 2535c21a..ea91c3b7 100644 --- a/Sources/Plasma/PubUtilLib/plNetMessage/plNetMessage.cpp +++ b/Sources/Plasma/PubUtilLib/plNetMessage/plNetMessage.cpp @@ -165,7 +165,7 @@ plNetMessage* plNetMessage::Create(const plNetCommonMessage* msg) hsReadOnlyStream readStream; ClassIndexType classIndex; readStream.Init(sizeof(classIndex), msg->GetData()); - readStream.ReadSwap(&classIndex); + readStream.ReadLE(&classIndex); if (!plFactory::IsValidClassIndex(classIndex)) return nil; plNetMessage* pnm = plNetMessage::ConvertNoRef(plFactory::Create(classIndex)); @@ -247,7 +247,7 @@ void plNetMessage::IWriteClassIndex(hsStream* stream) { ClassIndexType classIndex=ClassIndex(); hsAssert(sizeof(classIndex)==sizeof(plNetMessageClassIndex), "somebody changed the size of plCreatable::ClassIndex"); - stream->WriteSwap(classIndex); + stream->WriteLE(classIndex); } // put in buffer @@ -255,7 +255,7 @@ int plNetMessage::IPokeBuffer(hsStream* stream, UInt32 peekOptions) { IWriteClassIndex(stream); - stream->WriteSwap32(fFlags); + stream->WriteLE32(fFlags); if (IsBitSet(kHasVersion)) { @@ -265,11 +265,11 @@ int plNetMessage::IPokeBuffer(hsStream* stream, UInt32 peekOptions) if (IsBitSet(kHasTimeSent)) fTimeSent.Write(stream); if (IsBitSet(kHasContext)) - stream->WriteSwap(fContext); + stream->WriteLE(fContext); if (IsBitSet(kHasTransactionID)) - stream->WriteSwap(fTransactionID); + stream->WriteLE(fTransactionID); if (IsBitSet(kHasPlayerID)) - stream->WriteSwap(fPlayerID); + stream->WriteLE(fPlayerID); if (IsBitSet(kHasAcctUUID)) fAcctUUID.Write(stream); @@ -280,7 +280,7 @@ void plNetMessage::IReadClassIndex(hsStream* stream) { ClassIndexType classIndex; hsAssert(sizeof(classIndex)==sizeof(plNetMessageClassIndex), "somebody changed the size of plCreatable::ClassIndex"); - stream->LogReadSwap(&classIndex,"ClassIndex"); + stream->LogReadLE(&classIndex,"ClassIndex"); } // get out of buffer @@ -288,13 +288,13 @@ int plNetMessage::IPeekBuffer(hsStream* stream, UInt32 peekOptions) { IReadClassIndex(stream); - stream->LogReadSwap(&fFlags,"Flags"); + stream->LogReadLE(&fFlags,"Flags"); // verify version first if (IsBitSet(kHasVersion)) { - stream->LogReadSwap(&fProtocolVerMajor, "Protocol major version"); - stream->LogReadSwap(&fProtocolVerMinor, "Protocol minor version"); + stream->LogReadLE(&fProtocolVerMajor, "Protocol major version"); + stream->LogReadLE(&fProtocolVerMinor, "Protocol minor version"); if (fProtocolVerMajor != kVerMajor || fProtocolVerMinor != kVerMinor) return 0; // this will cause derived classes to stop reading @@ -308,11 +308,11 @@ int plNetMessage::IPeekBuffer(hsStream* stream, UInt32 peekOptions) if (IsBitSet(kHasTimeSent)) fTimeSent.Read(stream); if (IsBitSet(kHasContext)) - stream->LogReadSwap(&fContext,"Context"); + stream->LogReadLE(&fContext,"Context"); if (IsBitSet(kHasTransactionID)) - stream->LogReadSwap(&fTransactionID,"TransactionID"); + stream->LogReadLE(&fTransactionID,"TransactionID"); if (IsBitSet(kHasPlayerID)) - stream->LogReadSwap(&fPlayerID,"PlayerID"); + stream->LogReadLE(&fPlayerID,"PlayerID"); if (IsBitSet(kHasAcctUUID)) fAcctUUID.Read( stream ); return stream->GetPosition(); @@ -324,14 +324,14 @@ void plNetMessage::ReadVersion(hsStream* s, hsResMgr* mgr) contentFlags.Read(s); if (contentFlags.IsBitSet(kNetMsgFlags)) - s->LogReadSwap(&fFlags,"Flags"); + s->LogReadLE(&fFlags,"Flags"); if (contentFlags.IsBitSet(kNetMsgVersion)) { if (IsBitSet(kHasVersion)) { - s->LogReadSwap(&fProtocolVerMajor, "Protocol major version"); - s->LogReadSwap(&fProtocolVerMinor, "Protocol minor version"); + s->LogReadLE(&fProtocolVerMajor, "Protocol major version"); + s->LogReadLE(&fProtocolVerMinor, "Protocol minor version"); } } @@ -344,19 +344,19 @@ void plNetMessage::ReadVersion(hsStream* s, hsResMgr* mgr) if (contentFlags.IsBitSet(kNetMsgContext)) { if (IsBitSet(kHasContext)) - s->LogReadSwap(&fContext,"Context"); + s->LogReadLE(&fContext,"Context"); } if (contentFlags.IsBitSet(kNetMsgTransactionID)) { if (IsBitSet(kHasTransactionID)) - s->LogReadSwap(&fTransactionID,"TransactionID"); + s->LogReadLE(&fTransactionID,"TransactionID"); } if (contentFlags.IsBitSet(kNetMsgPlayerID)) { if (IsBitSet(kHasPlayerID)) - s->LogReadSwap(&fPlayerID,"PlayerID"); + s->LogReadLE(&fPlayerID,"PlayerID"); } } @@ -372,7 +372,7 @@ void plNetMessage::WriteVersion(hsStream* s, hsResMgr* mgr) contentFlags.Write(s); // kNetMsgFlags - s->WriteSwap32(fFlags); + s->WriteLE32(fFlags); // version if (IsBitSet(kHasVersion)) @@ -387,15 +387,15 @@ void plNetMessage::WriteVersion(hsStream* s, hsResMgr* mgr) // kNetMsgContext if (IsBitSet(kHasContext)) - s->WriteSwap(fContext); + s->WriteLE(fContext); // kNetMsgTransactionID if (IsBitSet(kHasTransactionID)) - s->WriteSwap(fTransactionID); + s->WriteLE(fTransactionID); // kNetMsgPlayerID if (IsBitSet(kHasPlayerID)) - s->WriteSwap(fPlayerID); + s->WriteLE(fPlayerID); } // Get the Packed Size @@ -738,18 +738,18 @@ int plNetMsgSDLState::IPokeBuffer(hsStream* stream, UInt32 peekOptions) { ISetDescName(); // stash away the descName before poke/compress plNetMsgStreamedObject::IPokeBuffer(stream, peekOptions); - stream->WriteSwap( fIsInitialState ); - stream->WriteSwap(fPersistOnServer); - stream->WriteSwap(fIsAvatarState); + stream->WriteLE( fIsInitialState ); + stream->WriteLE(fPersistOnServer); + stream->WriteLE(fIsAvatarState); return stream->GetPosition(); } int plNetMsgSDLState::IPeekBuffer(hsStream* stream, UInt32 peekOptions) { plNetMsgStreamedObject::IPeekBuffer(stream, peekOptions); - stream->LogReadSwap( &fIsInitialState, "IsInitialAgeState" ); - stream->LogReadSwap(&fPersistOnServer, "SDLState PersistOnServer"); - stream->LogReadSwap(&fIsAvatarState, "SDLState IsAvatarState"); + stream->LogReadLE( &fIsInitialState, "IsInitialAgeState" ); + stream->LogReadLE(&fPersistOnServer, "SDLState PersistOnServer"); + stream->LogReadLE(&fIsAvatarState, "SDLState IsAvatarState"); ISetDescName(); // stash away the descName after peek/uncompress return stream->GetPosition(); } @@ -764,7 +764,7 @@ void plNetMsgSDLState::ReadVersion(hsStream* s, hsResMgr* mgr) if (contentFlags.IsBitSet(kSDLStateStream)) { UInt32 len; - s->LogReadSwap(&len,"SDLState StreamLen"); + s->LogReadLE(&len,"SDLState StreamLen"); UInt8* buf = TRACKED_NEW UInt8[len]; s->LogRead(len, buf,"SDLState StreamData"); @@ -772,11 +772,11 @@ void plNetMsgSDLState::ReadVersion(hsStream* s, hsResMgr* mgr) StreamInfo()->SetStreamBuf(buf); } if (contentFlags.IsBitSet(kSDLIsInitialState)) - s->LogReadSwap( &fIsInitialState, "IsInitialAgeState" ); + s->LogReadLE( &fIsInitialState, "IsInitialAgeState" ); if (contentFlags.IsBitSet(kSDLPersist)) - s->ReadSwap(&fPersistOnServer); + s->ReadLE(&fPersistOnServer); if (contentFlags.IsBitSet(kSDLAvatarState)) - s->ReadSwap(&fIsAvatarState); + s->ReadLE(&fIsAvatarState); } void plNetMsgSDLState::WriteVersion(hsStream* s, hsResMgr* mgr) @@ -791,11 +791,11 @@ void plNetMsgSDLState::WriteVersion(hsStream* s, hsResMgr* mgr) contentFlags.Write(s); // kSDLStateStream - s->WriteSwap32(StreamInfo()->GetStreamLen()); + s->WriteLE32(StreamInfo()->GetStreamLen()); s->Write(StreamInfo()->GetStreamLen(), StreamInfo()->GetStreamBuf()); - s->WriteSwap( fIsInitialState ); - s->WriteSwap(fPersistOnServer); - s->WriteSwap(fIsAvatarState); + s->WriteLE( fIsInitialState ); + s->WriteLE(fPersistOnServer); + s->WriteLE(fIsAvatarState); } //////////////////////////////////////////////////////// @@ -848,7 +848,7 @@ int plNetMsgRoomsList::IPokeBuffer(hsStream* stream, UInt32 peekOptions) if (bytes) { int i, numRooms=fRooms.size(); - stream->WriteSwap(numRooms); + stream->WriteLE(numRooms); for(i=0;iLogReadSwap(&numRooms,"RoomList NumRooms"); + stream->LogReadLE(&numRooms,"RoomList NumRooms"); fRooms.resize(numRooms); int oldSize = fRoomNames.size(); fRoomNames.resize(numRooms); @@ -914,7 +914,7 @@ int plNetMsgPagingRoom::IPokeBuffer(hsStream* stream, UInt32 peekOptions) int bytes=plNetMsgRoomsList::IPokeBuffer(stream, peekOptions); if (bytes) { - stream->WriteSwap(fPageFlags); + stream->WriteLE(fPageFlags); bytes=stream->GetPosition(); } return bytes; @@ -925,7 +925,7 @@ int plNetMsgPagingRoom::IPeekBuffer(hsStream* stream, UInt32 peekOptions) int bytes=plNetMsgRoomsList::IPeekBuffer(stream, peekOptions); if (bytes) { - stream->LogReadSwap(&fPageFlags,"PageFlags"); + stream->LogReadLE(&fPageFlags,"PageFlags"); bytes=stream->GetPosition(); } return bytes; @@ -940,7 +940,7 @@ int plNetMsgGroupOwner::IPokeBuffer(hsStream* stream, UInt32 peekOptions) if (bytes) { int i, numGroups=fGroups.size(); - stream->WriteSwap(numGroups); + stream->WriteLE(numGroups); for(i=0;iLogReadSwap(&num,"GroupOwnerNum"); + stream->LogReadLE(&num,"GroupOwnerNum"); fGroups.resize(num); for(i=0;iWriteSwap(fLockRequest); + stream->WriteLE(fLockRequest); bytes=stream->GetPosition(); } return bytes; @@ -997,7 +997,7 @@ int plNetMsgSharedState::IPeekBuffer(hsStream* stream, UInt32 peekOptions) int bytes=plNetMsgStreamedObject::IPeekBuffer(stream, peekOptions); if (bytes) { - stream->LogReadSwap(&fLockRequest,"SharedState LockRequest"); + stream->LogReadLE(&fLockRequest,"SharedState LockRequest"); bytes=stream->GetPosition(); } return bytes; @@ -1011,7 +1011,7 @@ void plNetMsgSharedState::ReadVersion(hsStream* s, hsResMgr* mgr) contentFlags.Read(s); if (contentFlags.IsBitSet(kLockRequest)) - s->ReadSwap(&fLockRequest); + s->ReadLE(&fLockRequest); } void plNetMsgSharedState::WriteVersion(hsStream* s, hsResMgr* mgr) @@ -1022,7 +1022,7 @@ void plNetMsgSharedState::WriteVersion(hsStream* s, hsResMgr* mgr) contentFlags.SetBit(kLockRequest); contentFlags.Write(s); - s->WriteSwap(fLockRequest); + s->WriteLE(fLockRequest); } @@ -1062,7 +1062,7 @@ int plNetMsgObjectUpdateFilter::IPokeBuffer(hsStream* stream, UInt32 peekOptions if (bytes) { fObjectListHelper.Poke(stream, peekOptions); - stream->WriteSwap(fMaxUpdateFreq); + stream->WriteLE(fMaxUpdateFreq); bytes=stream->GetPosition(); } @@ -1076,7 +1076,7 @@ int plNetMsgObjectUpdateFilter::IPeekBuffer(hsStream* stream, UInt32 peekOptions { stream->LogSubStreamPushDesc("ObjectUpdateFilter"); fObjectListHelper.Peek(stream, peekOptions); - stream->LogReadSwap(&fMaxUpdateFreq,"MsgObjectUpdateFilter MaxUpdateFreq"); + stream->LogReadLE(&fMaxUpdateFreq,"MsgObjectUpdateFilter MaxUpdateFreq"); bytes=stream->GetPosition(); } @@ -1149,8 +1149,8 @@ int plNetMsgMemberUpdate::IPeekBuffer(hsStream* stream, UInt32 peekOptions) int plNetMsgVoice::IPokeBuffer(hsStream* stream, UInt32 peekOptions) { plNetMessage::IPokeBuffer(stream, peekOptions); - stream->WriteSwap(fFlags); - stream->WriteSwap(fNumFrames); + stream->WriteLE(fFlags); + stream->WriteLE(fNumFrames); plMsgStdStringHelper::Poke(fVoiceData, stream, peekOptions); fReceivers.Poke(stream, peekOptions); return stream->GetPosition(); @@ -1161,8 +1161,8 @@ int plNetMsgVoice::IPeekBuffer(hsStream* stream, UInt32 peekOptions) int bytes=plNetMessage::IPeekBuffer(stream, peekOptions); if (bytes) { - stream->LogReadSwap(&fFlags,"Voice Flags"); - stream->LogReadSwap(&fNumFrames, "Number of encoded frames"); + stream->LogReadLE(&fFlags,"Voice Flags"); + stream->LogReadLE(&fNumFrames, "Number of encoded frames"); stream->LogSubStreamPushDesc("Voice Data"); plMsgStdStringHelper::Peek(fVoiceData, stream, peekOptions); stream->LogSubStreamPushDesc("Voice Receivers"); @@ -1181,11 +1181,11 @@ void plNetMsgVoice::ReadVersion(hsStream* s, hsResMgr* mgr) contentFlags.Read(s); if (contentFlags.IsBitSet(kDead_FrameSize)) - s->ReadSwap(&old); + s->ReadLE(&old); if (contentFlags.IsBitSet(kReceivers)) fReceivers.ReadVersion(s,mgr); if (contentFlags.IsBitSet(kVoiceFlags)) - s->ReadSwap(&fFlags); + s->ReadLE(&fFlags); if(contentFlags.IsBitSet(kVoiceData)) plMsgStdStringHelper::Peek(fVoiceData, s); } @@ -1202,7 +1202,7 @@ void plNetMsgVoice::WriteVersion(hsStream* s, hsResMgr* mgr) contentFlags.Write(s); fReceivers.WriteVersion(s,mgr); - s->WriteSwap(fFlags); + s->WriteLE(fFlags); plMsgStdStringHelper::Poke(fVoiceData, s); } @@ -1225,7 +1225,7 @@ const char *plNetMsgVoice::GetVoiceData() const int plNetMsgListenListUpdate::IPokeBuffer(hsStream* stream, UInt32 peekOptions) { int bytes=plNetMessage::IPokeBuffer(stream, peekOptions); - stream->WriteSwap(fAdding); + stream->WriteLE(fAdding); fReceivers.Poke(stream, peekOptions); return stream->GetPosition(); } @@ -1235,7 +1235,7 @@ int plNetMsgListenListUpdate::IPeekBuffer(hsStream* stream, UInt32 peekOptions) int bytes=plNetMessage::IPeekBuffer(stream, peekOptions); if (bytes) { - stream->LogReadSwap(&fAdding,"ListenListUpdate Adding"); + stream->LogReadLE(&fAdding,"ListenListUpdate Adding"); stream->LogSubStreamPushDesc("ListenListUpdate Reveivers"); fReceivers.Peek(stream, peekOptions); bytes=stream->GetPosition(); @@ -1250,7 +1250,7 @@ int plNetMsgListenListUpdate::IPeekBuffer(hsStream* stream, UInt32 peekOptions) int plNetMsgPlayerPage::IPokeBuffer( hsStream* stream, UInt32 peekOptions ) { plNetMessage::IPokeBuffer( stream, peekOptions ); - stream->WriteSwap( fUnload ); + stream->WriteLE( fUnload ); fUoid.Write(stream); return stream->GetPosition(); @@ -1261,7 +1261,7 @@ int plNetMsgPlayerPage::IPeekBuffer( hsStream* stream, UInt32 peekOptions ) int bytes = plNetMessage::IPeekBuffer(stream, peekOptions ); if ( bytes ) { - stream->LogReadSwap( &fUnload,"PlayersPage Unload"); + stream->LogReadLE( &fUnload,"PlayersPage Unload"); fUoid.Read(stream); bytes = stream->GetPosition(); } @@ -1279,9 +1279,9 @@ int plNetMsgLoadClone::IPokeBuffer( hsStream* stream, UInt32 peekOptions ) if ( bytes ) { fObjectHelper.Poke(stream, peekOptions); - stream->WriteSwap( fIsPlayer ); - stream->WriteSwap( fIsLoading ); - stream->WriteSwap( fIsInitialState ); + stream->WriteLE( fIsPlayer ); + stream->WriteLE( fIsLoading ); + stream->WriteLE( fIsInitialState ); bytes = stream->GetPosition(); } return bytes; @@ -1296,9 +1296,9 @@ int plNetMsgLoadClone::IPeekBuffer( hsStream* stream, UInt32 peekOptions ) stream->LogSubStreamPushDesc("MsgObject"); fObjectHelper.Peek(stream, peekOptions); - stream->LogReadSwap( &fIsPlayer,"LoadClone IsPlayer"); - stream->LogReadSwap( &fIsLoading,"LoadClone IsLoading"); - stream->LogReadSwap( &fIsInitialState, "LoadClone IsInitialState" ); + stream->LogReadLE( &fIsPlayer,"LoadClone IsPlayer"); + stream->LogReadLE( &fIsLoading,"LoadClone IsLoading"); + stream->LogReadLE( &fIsInitialState, "LoadClone IsInitialState" ); bytes = stream->GetPosition(); } @@ -1315,11 +1315,11 @@ void plNetMsgLoadClone::ReadVersion(hsStream* s, hsResMgr* mgr) if (contentFlags.IsBitSet(kObjectHelper)) fObjectHelper.ReadVersion(s,mgr); if (contentFlags.IsBitSet(kIsPlayer)) - s->ReadSwap(&fIsPlayer); + s->ReadLE(&fIsPlayer); if (contentFlags.IsBitSet(kIsLoading)) - s->ReadSwap(&fIsLoading); + s->ReadLE(&fIsLoading); if (contentFlags.IsBitSet(kIsInitialState)) - s->ReadSwap(&fIsInitialState); + s->ReadLE(&fIsInitialState); } void plNetMsgLoadClone::WriteVersion(hsStream* s, hsResMgr* mgr) @@ -1334,9 +1334,9 @@ void plNetMsgLoadClone::WriteVersion(hsStream* s, hsResMgr* mgr) contentFlags.Write(s); fObjectHelper.WriteVersion(s,mgr); - s->WriteSwap(fIsPlayer); - s->WriteSwap(fIsLoading); - s->WriteSwap(fIsInitialState); + s->WriteLE(fIsPlayer); + s->WriteLE(fIsLoading); + s->WriteLE(fIsInitialState); } //////////////////////////////////////////////////////////////////// @@ -1344,7 +1344,7 @@ void plNetMsgLoadClone::WriteVersion(hsStream* s, hsResMgr* mgr) int plNetMsgInitialAgeStateSent::IPokeBuffer( hsStream* stream, UInt32 peekOptions ) { plNetMessage::IPokeBuffer( stream, peekOptions ); - stream->WriteSwap( fNumInitialSDLStates ); + stream->WriteLE( fNumInitialSDLStates ); return stream->GetPosition(); } @@ -1354,7 +1354,7 @@ int plNetMsgInitialAgeStateSent::IPeekBuffer( hsStream* stream, UInt32 peekOptio int bytes=plNetMessage::IPeekBuffer(stream, peekOptions ); if (bytes) { - stream->LogReadSwap( &fNumInitialSDLStates, "NumInitialSDLStates" ); + stream->LogReadLE( &fNumInitialSDLStates, "NumInitialSDLStates" ); bytes=stream->GetPosition(); } return bytes; diff --git a/Sources/Plasma/PubUtilLib/plNetMessage/plNetMessage.h b/Sources/Plasma/PubUtilLib/plNetMessage/plNetMessage.h index 4c9b00db..ad0d7820 100644 --- a/Sources/Plasma/PubUtilLib/plNetMessage/plNetMessage.h +++ b/Sources/Plasma/PubUtilLib/plNetMessage/plNetMessage.h @@ -691,8 +691,8 @@ public: plNetGroupId fGroupID; bool fOwnIt; // else not the owner - void Read(hsStream* s) { fGroupID.Read(s); s->LogReadSwap(&fOwnIt,"GroupOwner OwnIt"); } - void Write(hsStream* s) { fGroupID.Write(s); s->WriteSwap(fOwnIt); } + void Read(hsStream* s) { fGroupID.Read(s); s->LogReadLE(&fOwnIt,"GroupOwner OwnIt"); } + void Write(hsStream* s) { fGroupID.Write(s); s->WriteLE(fOwnIt); } GroupInfo() : fGroupID(plNetGroup::kNetGroupUnknown), fOwnIt(false) {} GroupInfo(plNetGroupId gID, hsBool o) : fGroupID(gID),fOwnIt(o) {} diff --git a/Sources/Plasma/PubUtilLib/plNetMessage/plNetMsgHelpers.cpp b/Sources/Plasma/PubUtilLib/plNetMessage/plNetMsgHelpers.cpp index f5997d69..b02277a4 100644 --- a/Sources/Plasma/PubUtilLib/plNetMessage/plNetMsgHelpers.cpp +++ b/Sources/Plasma/PubUtilLib/plNetMessage/plNetMsgHelpers.cpp @@ -121,7 +121,7 @@ int plNetMsgCreatableHelper::Poke(hsStream * s, UInt32 peekOptions) { hsAssert(fCreatable,"plNetMsgCreatableHelper::Poke: fCreatable not set"); UInt16 classIndex = fCreatable->ClassIndex(); - s->WriteSwap(classIndex); + s->WriteLE(classIndex); fCreatable->Write(s,nil); return s->GetPosition(); } @@ -130,7 +130,7 @@ int plNetMsgCreatableHelper::Peek(hsStream * s, UInt32 peekOptions) { UInt16 classIndex; s->LogSubStreamStart("push me"); - s->LogReadSwap(&classIndex,"ClassIdx"); + s->LogReadLE(&classIndex,"ClassIdx"); SetObject(plFactory::Create(classIndex)); fWeCreatedIt = true; hsAssert(fCreatable,"plNetMsgCreatableHelper::Peek: Failed to create plCreatable. Invalid ClassIndex?"); @@ -164,9 +164,9 @@ int plNetMsgStreamHelper::Poke(hsStream* stream, UInt32 peekOptions) { if ( !(peekOptions & plNetMessage::kDontCompress) ) Compress(); - stream->WriteSwap(fUncompressedSize); - stream->WriteSwap(fCompressionType); - stream->WriteSwap(fStreamLen); + stream->WriteLE(fUncompressedSize); + stream->WriteLE(fCompressionType); + stream->WriteLE(fStreamLen); stream->Write(fStreamLen, fStreamBuf); return stream->GetPosition(); } @@ -174,9 +174,9 @@ int plNetMsgStreamHelper::Poke(hsStream* stream, UInt32 peekOptions) int plNetMsgStreamHelper::Peek(hsStream* stream, const UInt32 peekOptions) { stream->LogSubStreamStart("Stream Helper"); - stream->LogReadSwap(&fUncompressedSize,"UncompressedSize"); - stream->LogReadSwap(&fCompressionType,"CompressionType"); - stream->LogReadSwap(&fStreamLen,"StreamLen"); + stream->LogReadLE(&fUncompressedSize,"UncompressedSize"); + stream->LogReadLE(&fCompressionType,"CompressionType"); + stream->LogReadLE(&fStreamLen,"StreamLen"); if (fStreamLen) // stream data exists { @@ -191,7 +191,7 @@ int plNetMsgStreamHelper::Peek(hsStream* stream, const UInt32 peekOptions) } else { - stream->ReadSwap(&fStreamType); // never compressed, set by reading directly from stream + stream->ReadLE(&fStreamType); // never compressed, set by reading directly from stream stream->LogSkip(fStreamLen-sizeof(fStreamType),"SkippedStreamHelper"); } } @@ -205,11 +205,11 @@ void plNetMsgStreamHelper::ReadVersion(hsStream* s, hsResMgr* mgr) contentFlags.Read(s); if (contentFlags.IsBitSet(kUncompressedSize)) - s->ReadSwap(&fUncompressedSize); + s->ReadLE(&fUncompressedSize); if (contentFlags.IsBitSet(kCompressionType)) - s->ReadSwap(&fCompressionType); + s->ReadLE(&fCompressionType); if (contentFlags.IsBitSet(kStreamLen)) - s->ReadSwap(&fStreamLen); + s->ReadLE(&fStreamLen); if (contentFlags.IsBitSet(kStreamBuf)) { if (!fStreamBuf) @@ -227,9 +227,9 @@ void plNetMsgStreamHelper::WriteVersion(hsStream* s, hsResMgr* mgr) contentFlags.SetBit(kStreamBuf); contentFlags.Write(s); - s->WriteSwap(fUncompressedSize); - s->WriteSwap(fCompressionType); - s->WriteSwap(fStreamLen); + s->WriteLE(fUncompressedSize); + s->WriteLE(fCompressionType); + s->WriteLE(fStreamLen); s->Write(fStreamLen,fStreamBuf); } @@ -414,7 +414,7 @@ void plNetMsgObjectListHelper::Reset() int plNetMsgObjectListHelper::Poke(hsStream* stream, UInt32 peekOptions) { Int16 num = GetNumObjects(); - stream->WriteSwap(num); + stream->WriteLE(num); int i; for( i=0 ;iLogSubStreamStart("push me"); Int16 num; - stream->LogReadSwap(&num,"ObjectListHelper Num"); + stream->LogReadLE(&num,"ObjectListHelper Num"); int i; for( i=0 ;iLogSubStreamStart("push me"); - s->LogReadSwap(&fFlags,"MemberInfoHelper Flags"); + s->LogReadLE(&fFlags,"MemberInfoHelper Flags"); fClientGuid.Read( s, nil ); fAvatarUoid.Read(s); s->LogSubStreamEnd(); @@ -463,7 +463,7 @@ int plNetMsgMemberInfoHelper::Peek(hsStream* s, const UInt32 peekOptions) int plNetMsgMemberInfoHelper::Poke(hsStream* s, const UInt32 peekOptions) { - s->WriteSwap(fFlags); + s->WriteLE(fFlags); fClientGuid.Write( s, nil ); fAvatarUoid.Write(s); return s->GetPosition(); @@ -484,7 +484,7 @@ int plNetMsgMemberListHelper::Peek(hsStream* stream, const UInt32 peekOptions) { Int16 numMembers; stream->LogSubStreamStart("push me"); - stream->LogReadSwap(&numMembers,"MemberListHelper NumMembers"); + stream->LogReadLE(&numMembers,"MemberListHelper NumMembers"); fMembers.clear(); int i; for(i=0;iWriteSwap(numMembers); + stream->WriteLE(numMembers); int i; for(i=0;iLogSubStreamStart("push me"); - stream->LogReadSwap(&numIDs,"ReceiversListHelper NumIDs"); + stream->LogReadLE(&numIDs,"ReceiversListHelper NumIDs"); fPlayerIDList.clear(); int i; for(i=0;iLogReadSwap(&ID,"ReceiversListHelper ID"); + stream->LogReadLE(&ID,"ReceiversListHelper ID"); AddReceiverPlayerID(ID); } stream->LogSubStreamEnd(); @@ -540,11 +540,11 @@ int plNetMsgReceiversListHelper::Peek(hsStream* stream, const UInt32 peekOptions int plNetMsgReceiversListHelper::Poke(hsStream* stream, const UInt32 peekOptions) { UInt8 numIDs = (UInt8)GetNumReceivers(); - stream->WriteSwap(numIDs); + stream->WriteLE(numIDs); int i; for(i=0;iWriteSwap(GetReceiverPlayerID(i)); + stream->WriteLE(GetReceiverPlayerID(i)); return stream->GetPosition(); } diff --git a/Sources/Plasma/PubUtilLib/plParticleSystem/plConvexVolume.cpp b/Sources/Plasma/PubUtilLib/plParticleSystem/plConvexVolume.cpp index f42ad9b8..056ebf16 100644 --- a/Sources/Plasma/PubUtilLib/plParticleSystem/plConvexVolume.cpp +++ b/Sources/Plasma/PubUtilLib/plParticleSystem/plConvexVolume.cpp @@ -188,22 +188,22 @@ hsBool plConvexVolume::BouncePoint(hsPoint3 &pos, hsVector3 &velocity, hsScalar void plConvexVolume::Read(hsStream* s, hsResMgr *mgr) { - SetNumPlanesAndClear(s->ReadSwap32()); + SetNumPlanesAndClear(s->ReadLE32()); int i; for (i = 0; i < fNumPlanes; i++) { fLocalPlanes[i].Read(s); - //fFlags[i] = s->ReadSwap32(); + //fFlags[i] = s->ReadLE32(); } } void plConvexVolume::Write(hsStream* s, hsResMgr *mgr) { - s->WriteSwap32(fNumPlanes); + s->WriteLE32(fNumPlanes); int i; for (i = 0; i < fNumPlanes; i++) { fLocalPlanes[i].Write(s); - //s->WriteSwap32(fFlags[i]); + //s->WriteLE32(fFlags[i]); } } diff --git a/Sources/Plasma/PubUtilLib/plParticleSystem/plParticleEffect.cpp b/Sources/Plasma/PubUtilLib/plParticleSystem/plParticleEffect.cpp index 30d8da3d..7e0b9fbf 100644 --- a/Sources/Plasma/PubUtilLib/plParticleSystem/plParticleEffect.cpp +++ b/Sources/Plasma/PubUtilLib/plParticleSystem/plParticleEffect.cpp @@ -174,16 +174,16 @@ void plParticleCollisionEffectBounce::Read(hsStream *s, hsResMgr *mgr) { plParticleCollisionEffect::Read(s, mgr); - fBounce = s->ReadSwapScalar(); - fFriction = s->ReadSwapScalar(); + fBounce = s->ReadLEScalar(); + fFriction = s->ReadLEScalar(); } void plParticleCollisionEffectBounce::Write(hsStream *s, hsResMgr *mgr) { plParticleCollisionEffect::Write(s, mgr); - s->WriteSwapScalar(fBounce); - s->WriteSwapScalar(fFriction); + s->WriteLEScalar(fBounce); + s->WriteLEScalar(fFriction); } @@ -350,7 +350,7 @@ void plParticleFadeVolumeEffect::Read(hsStream *s, hsResMgr *mgr) { hsKeyedObject::Read(s, mgr); - fLength = s->ReadSwapScalar(); + fLength = s->ReadLEScalar(); fIgnoreZ = s->ReadBool(); } @@ -358,7 +358,7 @@ void plParticleFadeVolumeEffect::Write(hsStream *s, hsResMgr *mgr) { hsKeyedObject::Write(s, mgr); - s->WriteSwapScalar(fLength); + s->WriteLEScalar(fLength); s->WriteBool(fIgnoreZ); } @@ -385,9 +385,9 @@ void plParticleWindEffect::Read(hsStream *s, hsResMgr *mgr) { hsKeyedObject::Read(s, mgr); - fStrength = s->ReadSwapScalar(); - fConstancy = s->ReadSwapScalar(); - fSwirl = s->ReadSwapScalar(); + fStrength = s->ReadLEScalar(); + fConstancy = s->ReadLEScalar(); + fSwirl = s->ReadLEScalar(); fHorizontal = s->ReadBool(); fRefDir.Read(s); fDir.Read(s); @@ -398,9 +398,9 @@ void plParticleWindEffect::Write(hsStream *s, hsResMgr *mgr) { hsKeyedObject::Write(s, mgr); - s->WriteSwapScalar(fStrength); - s->WriteSwapScalar(fConstancy); - s->WriteSwapScalar(fSwirl); + s->WriteLEScalar(fStrength); + s->WriteLEScalar(fConstancy); + s->WriteLEScalar(fSwirl); s->WriteBool(fHorizontal); fRefDir.Write(s); fDir.Write(s); @@ -456,7 +456,7 @@ void plParticleLocalWind::Read(hsStream *s, hsResMgr *mgr) plParticleWindEffect::Read(s, mgr); fScale.Read(s); - fSpeed = s->ReadSwapScalar(); + fSpeed = s->ReadLEScalar(); } void plParticleLocalWind::Write(hsStream *s, hsResMgr *mgr) @@ -464,7 +464,7 @@ void plParticleLocalWind::Write(hsStream *s, hsResMgr *mgr) plParticleWindEffect::Write(s, mgr); fScale.Write(s); - s->WriteSwapScalar(fSpeed); + s->WriteLEScalar(fSpeed); } void plParticleLocalWind::PrepareEffect(const plEffectTargetInfo& target) @@ -546,9 +546,9 @@ void plParticleUniformWind::Read(hsStream *s, hsResMgr *mgr) { plParticleWindEffect::Read(s, mgr); - fFreqMin = s->ReadSwapScalar(); - fFreqMax = s->ReadSwapScalar(); - fFreqRate = s->ReadSwapScalar(); + fFreqMin = s->ReadLEScalar(); + fFreqMax = s->ReadLEScalar(); + fFreqRate = s->ReadLEScalar(); #if 0 fFreqMin = 1.f / 6.f; @@ -564,9 +564,9 @@ void plParticleUniformWind::Write(hsStream *s, hsResMgr *mgr) { plParticleWindEffect::Write(s, mgr); - s->WriteSwapScalar(fFreqMin); - s->WriteSwapScalar(fFreqMax); - s->WriteSwapScalar(fFreqRate); + s->WriteLEScalar(fFreqMin); + s->WriteLEScalar(fFreqMax); + s->WriteLEScalar(fFreqRate); } void plParticleUniformWind::SetFrequencyRange(hsScalar minSecsPerCycle, hsScalar maxSecsPerCycle) @@ -822,17 +822,17 @@ void plParticleFlockEffect::Read(hsStream *s, hsResMgr *mgr) fTargetOffset.Read(s); fDissenterTarget.Read(s); - fInfAvgRadSq = s->ReadSwapScalar(); - fInfRepRadSq = s->ReadSwapScalar(); - fGoalDistSq = s->ReadSwapScalar(); - fFullChaseDistSq = s->ReadSwapScalar(); - fAvgVelStr = s->ReadSwapScalar(); - fRepDirStr = s->ReadSwapScalar(); - fGoalOrbitStr = s->ReadSwapScalar(); - fGoalChaseStr = s->ReadSwapScalar(); - SetMaxOrbitSpeed(s->ReadSwapScalar()); - SetMaxChaseSpeed(s->ReadSwapScalar()); - SetMaxParticles((UInt16)s->ReadSwapScalar()); + fInfAvgRadSq = s->ReadLEScalar(); + fInfRepRadSq = s->ReadLEScalar(); + fGoalDistSq = s->ReadLEScalar(); + fFullChaseDistSq = s->ReadLEScalar(); + fAvgVelStr = s->ReadLEScalar(); + fRepDirStr = s->ReadLEScalar(); + fGoalOrbitStr = s->ReadLEScalar(); + fGoalChaseStr = s->ReadLEScalar(); + SetMaxOrbitSpeed(s->ReadLEScalar()); + SetMaxChaseSpeed(s->ReadLEScalar()); + SetMaxParticles((UInt16)s->ReadLEScalar()); } void plParticleFlockEffect::Write(hsStream *s, hsResMgr *mgr) @@ -841,17 +841,17 @@ void plParticleFlockEffect::Write(hsStream *s, hsResMgr *mgr) fTargetOffset.Write(s); fDissenterTarget.Write(s); - s->WriteSwapScalar(fInfAvgRadSq); - s->WriteSwapScalar(fInfRepRadSq); - s->WriteSwapScalar(fGoalDistSq); - s->WriteSwapScalar(fFullChaseDistSq); - s->WriteSwapScalar(fAvgVelStr); - s->WriteSwapScalar(fRepDirStr); - s->WriteSwapScalar(fGoalOrbitStr); - s->WriteSwapScalar(fGoalChaseStr); - s->WriteSwapScalar(fMaxOrbitSpeed); - s->WriteSwapScalar(fMaxChaseSpeed); - s->WriteSwapScalar(fMaxParticles); + s->WriteLEScalar(fInfAvgRadSq); + s->WriteLEScalar(fInfRepRadSq); + s->WriteLEScalar(fGoalDistSq); + s->WriteLEScalar(fFullChaseDistSq); + s->WriteLEScalar(fAvgVelStr); + s->WriteLEScalar(fRepDirStr); + s->WriteLEScalar(fGoalOrbitStr); + s->WriteLEScalar(fGoalChaseStr); + s->WriteLEScalar(fMaxOrbitSpeed); + s->WriteLEScalar(fMaxChaseSpeed); + s->WriteLEScalar(fMaxParticles); } hsBool plParticleFlockEffect::MsgReceive(plMessage *msg) diff --git a/Sources/Plasma/PubUtilLib/plParticleSystem/plParticleEmitter.cpp b/Sources/Plasma/PubUtilLib/plParticleSystem/plParticleEmitter.cpp index 86dd97cc..06ffa6ce 100644 --- a/Sources/Plasma/PubUtilLib/plParticleSystem/plParticleEmitter.cpp +++ b/Sources/Plasma/PubUtilLib/plParticleSystem/plParticleEmitter.cpp @@ -545,9 +545,9 @@ void plParticleEmitter::Read(hsStream *s, hsResMgr *mgr) plCreatable::Read(s, mgr); fGenerator = plParticleGenerator::ConvertNoRef(mgr->ReadCreatable(s)); - fSpanIndex = s->ReadSwap32(); - fMaxParticles = s->ReadSwap32(); - fMiscFlags = s->ReadSwap32(); + fSpanIndex = s->ReadLE32(); + fMaxParticles = s->ReadLE32(); + fMiscFlags = s->ReadLE32(); fColor.Read(s); if( fMiscFlags & kOnReserve ) @@ -561,9 +561,9 @@ void plParticleEmitter::Write(hsStream *s, hsResMgr *mgr) plCreatable::Write(s, mgr); mgr->WriteCreatable(s, fGenerator); - s->WriteSwap32(fSpanIndex); - s->WriteSwap32(fMaxParticles); - s->WriteSwap32(fMiscFlags); + s->WriteLE32(fSpanIndex); + s->WriteLE32(fMaxParticles); + s->WriteLE32(fMiscFlags); fColor.Write(s); } diff --git a/Sources/Plasma/PubUtilLib/plParticleSystem/plParticleGenerator.cpp b/Sources/Plasma/PubUtilLib/plParticleSystem/plParticleGenerator.cpp index 752716d7..49351249 100644 --- a/Sources/Plasma/PubUtilLib/plParticleSystem/plParticleGenerator.cpp +++ b/Sources/Plasma/PubUtilLib/plParticleSystem/plParticleGenerator.cpp @@ -295,11 +295,11 @@ void plSimpleParticleGenerator::UpdateParam(UInt32 paramID, hsScalar paramValue) void plSimpleParticleGenerator::Read(hsStream* s, hsResMgr *mgr) { - hsScalar genLife = s->ReadSwapScalar(); - hsScalar partLifeMin = s->ReadSwapScalar(); - hsScalar partLifeMax = s->ReadSwapScalar(); - hsScalar pps = s->ReadSwapScalar(); - UInt32 numSources = s->ReadSwap32(); + hsScalar genLife = s->ReadLEScalar(); + hsScalar partLifeMin = s->ReadLEScalar(); + hsScalar partLifeMax = s->ReadLEScalar(); + hsScalar pps = s->ReadLEScalar(); + UInt32 numSources = s->ReadLE32(); hsPoint3 *pos = TRACKED_NEW hsPoint3[numSources]; hsScalar *pitch = TRACKED_NEW hsScalar[numSources]; hsScalar *yaw = TRACKED_NEW hsScalar[numSources]; @@ -307,18 +307,18 @@ void plSimpleParticleGenerator::Read(hsStream* s, hsResMgr *mgr) for (i = 0; i < numSources; i++) { pos[i].Read(s); - pitch[i] = s->ReadSwapScalar(); - yaw[i] = s->ReadSwapScalar(); + pitch[i] = s->ReadLEScalar(); + yaw[i] = s->ReadLEScalar(); } - hsScalar angleRange = s->ReadSwapScalar(); - hsScalar velMin = s->ReadSwapScalar(); - hsScalar velMax = s->ReadSwapScalar(); - hsScalar xSize = s->ReadSwapScalar(); - hsScalar ySize = s->ReadSwapScalar(); - hsScalar scaleMin = s->ReadSwapScalar(); - hsScalar scaleMax = s->ReadSwapScalar(); - hsScalar massRange = s->ReadSwapScalar(); - hsScalar radsPerSec = s->ReadSwapScalar(); + hsScalar angleRange = s->ReadLEScalar(); + hsScalar velMin = s->ReadLEScalar(); + hsScalar velMax = s->ReadLEScalar(); + hsScalar xSize = s->ReadLEScalar(); + hsScalar ySize = s->ReadLEScalar(); + hsScalar scaleMin = s->ReadLEScalar(); + hsScalar scaleMax = s->ReadLEScalar(); + hsScalar massRange = s->ReadLEScalar(); + hsScalar radsPerSec = s->ReadLEScalar(); Init(genLife, partLifeMin, partLifeMax, pps, numSources, pos, pitch, yaw, angleRange, velMin, velMax, xSize, ySize, scaleMin, scaleMax, massRange, radsPerSec); @@ -326,29 +326,29 @@ void plSimpleParticleGenerator::Read(hsStream* s, hsResMgr *mgr) void plSimpleParticleGenerator::Write(hsStream* s, hsResMgr *mgr) { - s->WriteSwapScalar(fGenLife); - s->WriteSwapScalar(fPartLifeMin); - s->WriteSwapScalar(fPartLifeMax); - s->WriteSwapScalar(fParticlesPerSecond); - s->WriteSwap32(fNumSources); + s->WriteLEScalar(fGenLife); + s->WriteLEScalar(fPartLifeMin); + s->WriteLEScalar(fPartLifeMax); + s->WriteLEScalar(fParticlesPerSecond); + s->WriteLE32(fNumSources); int i; for (i = 0; i < fNumSources; i++) { fInitPos[i].Write(s); - s->WriteSwapScalar(fInitPitch[i]); - s->WriteSwapScalar(fInitYaw[i]); + s->WriteLEScalar(fInitPitch[i]); + s->WriteLEScalar(fInitYaw[i]); } - s->WriteSwapScalar(fAngleRange); - s->WriteSwapScalar(fVelMin); - s->WriteSwapScalar(fVelMax); - s->WriteSwapScalar(fXSize); - s->WriteSwapScalar(fYSize); - s->WriteSwapScalar(fScaleMin); - s->WriteSwapScalar(fScaleMax); + s->WriteLEScalar(fAngleRange); + s->WriteLEScalar(fVelMin); + s->WriteLEScalar(fVelMax); + s->WriteLEScalar(fXSize); + s->WriteLEScalar(fYSize); + s->WriteLEScalar(fScaleMin); + s->WriteLEScalar(fScaleMax); hsScalar massRange = 1.f / fPartInvMassMin - DEFAULT_INVERSE_MASS; - s->WriteSwapScalar(massRange); - s->WriteSwapScalar(fPartRadsPerSecRange); + s->WriteLEScalar(massRange); + s->WriteLEScalar(fPartRadsPerSecRange); } //////////////////////////////////////////////////////////////////////////////////////////////////// @@ -416,12 +416,12 @@ hsBool plOneTimeParticleGenerator::AddAutoParticles(plParticleEmitter *emitter, void plOneTimeParticleGenerator::Read(hsStream* s, hsResMgr *mgr) { - UInt32 count = s->ReadSwap32(); - hsScalar xSize = s->ReadSwapScalar(); - hsScalar ySize = s->ReadSwapScalar(); - hsScalar scaleMin = s->ReadSwapScalar(); - hsScalar scaleMax = s->ReadSwapScalar(); - hsScalar radsPerSecRange = s->ReadSwapScalar(); + UInt32 count = s->ReadLE32(); + hsScalar xSize = s->ReadLEScalar(); + hsScalar ySize = s->ReadLEScalar(); + hsScalar scaleMin = s->ReadLEScalar(); + hsScalar scaleMax = s->ReadLEScalar(); + hsScalar radsPerSecRange = s->ReadLEScalar(); hsPoint3 *pos = TRACKED_NEW hsPoint3[count]; hsVector3 *dir = TRACKED_NEW hsVector3[count]; @@ -438,12 +438,12 @@ void plOneTimeParticleGenerator::Read(hsStream* s, hsResMgr *mgr) void plOneTimeParticleGenerator::Write(hsStream* s, hsResMgr *mgr) { - s->WriteSwap32((UInt32)fCount); - s->WriteSwapScalar(fXSize); - s->WriteSwapScalar(fYSize); - s->WriteSwapScalar(fScaleMin); - s->WriteSwapScalar(fScaleMax); - s->WriteSwapScalar(fPartRadsPerSecRange); + s->WriteLE32((UInt32)fCount); + s->WriteLEScalar(fXSize); + s->WriteLEScalar(fYSize); + s->WriteLEScalar(fScaleMin); + s->WriteLEScalar(fScaleMax); + s->WriteLEScalar(fPartRadsPerSecRange); int i; for (i = 0; i < fCount; i++) diff --git a/Sources/Plasma/PubUtilLib/plParticleSystem/plParticleSystem.cpp b/Sources/Plasma/PubUtilLib/plParticleSystem/plParticleSystem.cpp index 97fde7f0..243dc6e3 100644 --- a/Sources/Plasma/PubUtilLib/plParticleSystem/plParticleSystem.cpp +++ b/Sources/Plasma/PubUtilLib/plParticleSystem/plParticleSystem.cpp @@ -597,7 +597,7 @@ void plParticleSystem::IReadEffectsArray(hsTArray &effects, { plGenRefMsg *msg; effects.Reset(); - UInt32 count = s->ReadSwap32(); + UInt32 count = s->ReadLE32(); int i; for (i = 0; i < count; i++) { @@ -620,18 +620,18 @@ void plParticleSystem::Read(hsStream *s, hsResMgr *mgr) fWidthCtl = plController::ConvertNoRef(mgr->ReadCreatable(s)); fHeightCtl = plController::ConvertNoRef(mgr->ReadCreatable(s)); - UInt32 xTiles = s->ReadSwap32(); - UInt32 yTiles = s->ReadSwap32(); - UInt32 maxTotal = s->ReadSwap32(); - UInt32 maxEmitters = s->ReadSwap32(); + UInt32 xTiles = s->ReadLE32(); + UInt32 yTiles = s->ReadLE32(); + UInt32 maxTotal = s->ReadLE32(); + UInt32 maxEmitters = s->ReadLE32(); Init(xTiles, yTiles, maxTotal, maxEmitters, fAmbientCtl, fDiffuseCtl, fOpacityCtl, fWidthCtl, fHeightCtl); - fPreSim = s->ReadSwapScalar(); + fPreSim = s->ReadLEScalar(); fAccel.Read(s); - fDrag = s->ReadSwapScalar(); - fWindMult = s->ReadSwapScalar(); + fDrag = s->ReadLEScalar(); + fWindMult = s->ReadLEScalar(); - fNumValidEmitters = s->ReadSwap32(); + fNumValidEmitters = s->ReadLE32(); int i; for (i = 0; i < fNumValidEmitters; i++) { @@ -643,7 +643,7 @@ void plParticleSystem::Read(hsStream *s, hsResMgr *mgr) IReadEffectsArray(fEffects, kEffectMisc, s, mgr); IReadEffectsArray(fConstraints, kEffectConstraint, s, mgr); - int count = s->ReadSwap32(); + int count = s->ReadLE32(); fPermaLights.SetCount(count); for( i = 0; i < count; i++ ) { @@ -666,17 +666,17 @@ void plParticleSystem::Write(hsStream *s, hsResMgr *mgr) mgr->WriteCreatable(s, fWidthCtl); mgr->WriteCreatable(s, fHeightCtl); - s->WriteSwap32(fXTiles); - s->WriteSwap32(fYTiles); - s->WriteSwap32(fMaxTotalParticles); - s->WriteSwap32(fMaxEmitters); + s->WriteLE32(fXTiles); + s->WriteLE32(fYTiles); + s->WriteLE32(fMaxTotalParticles); + s->WriteLE32(fMaxEmitters); - s->WriteSwapScalar(fPreSim); + s->WriteLEScalar(fPreSim); fAccel.Write(s); - s->WriteSwapScalar(fDrag); - s->WriteSwapScalar(fWindMult); + s->WriteLEScalar(fDrag); + s->WriteLEScalar(fWindMult); - s->WriteSwap32(fNumValidEmitters); + s->WriteLE32(fNumValidEmitters); for (i = 0; i < fNumValidEmitters; i++) { mgr->WriteCreatable(s, fEmitters[i]); @@ -684,22 +684,22 @@ void plParticleSystem::Write(hsStream *s, hsResMgr *mgr) int count; count = fForces.GetCount(); - s->WriteSwap32(count); + s->WriteLE32(count); for (i = 0; i < count; i++) mgr->WriteKey(s, fForces.Get(i)); count = fEffects.GetCount(); - s->WriteSwap32(count); + s->WriteLE32(count); for (i = 0; i < count; i++) mgr->WriteKey(s, fEffects.Get(i)); count = fConstraints.GetCount(); - s->WriteSwap32(count); + s->WriteLE32(count); for (i = 0; i < count; i++) mgr->WriteKey(s, fConstraints.Get(i)); count = fPermaLights.GetCount(); - s->WriteSwap32(count); + s->WriteLE32(count); for( i = 0; i < count; i++ ) mgr->WriteKey(s, fPermaLights[i]); } diff --git a/Sources/Plasma/PubUtilLib/plPhysX/plPXPhysical.cpp b/Sources/Plasma/PubUtilLib/plPhysX/plPXPhysical.cpp index 21ab39f6..343d757c 100644 --- a/Sources/Plasma/PubUtilLib/plPhysX/plPXPhysical.cpp +++ b/Sources/Plasma/PubUtilLib/plPhysX/plPXPhysical.cpp @@ -1025,13 +1025,13 @@ void plPXPhysical::Read(hsStream* stream, hsResMgr* mgr) ClearMatrix(fCachedLocal2World); PhysRecipe recipe; - recipe.mass = stream->ReadSwapScalar(); - recipe.friction = stream->ReadSwapScalar(); - recipe.restitution = stream->ReadSwapScalar(); + recipe.mass = stream->ReadLEScalar(); + recipe.friction = stream->ReadLEScalar(); + recipe.restitution = stream->ReadLEScalar(); recipe.bounds = (plSimDefs::Bounds)stream->ReadByte(); recipe.group = (plSimDefs::Group)stream->ReadByte(); - recipe.reportsOn = stream->ReadSwap32(); - fLOSDBs = stream->ReadSwap16(); + recipe.reportsOn = stream->ReadLE32(); + fLOSDBs = stream->ReadLE16(); //hack for swim regions currently they are labeled as static av blockers if(fLOSDBs==plSimDefs::kLOSDBSwimRegion) { @@ -1055,7 +1055,7 @@ void plPXPhysical::Read(hsStream* stream, hsResMgr* mgr) if (recipe.bounds == plSimDefs::kSphereBounds) { - recipe.radius = stream->ReadSwapScalar(); + recipe.radius = stream->ReadLEScalar(); recipe.offset.Read(stream); } else if (recipe.bounds == plSimDefs::kBoxBounds) @@ -1142,13 +1142,13 @@ void plPXPhysical::Write(hsStream* stream, hsResMgr* mgr) float friction = mat->getStaticFriction(); float restitution = mat->getRestitution(); - stream->WriteSwapScalar(fActor->getMass()); - stream->WriteSwapScalar(friction); - stream->WriteSwapScalar(restitution); + stream->WriteLEScalar(fActor->getMass()); + stream->WriteLEScalar(friction); + stream->WriteLEScalar(restitution); stream->WriteByte(fBoundsType); stream->WriteByte(fGroup); - stream->WriteSwap32(fReportsOn); - stream->WriteSwap16(fLOSDBs); + stream->WriteLE32(fReportsOn); + stream->WriteLE16(fLOSDBs); mgr->WriteKey(stream, fObjectKey); mgr->WriteKey(stream, fSceneNode); mgr->WriteKey(stream, fWorldKey); @@ -1166,7 +1166,7 @@ void plPXPhysical::Write(hsStream* stream, hsResMgr* mgr) if (fBoundsType == plSimDefs::kSphereBounds) { const NxSphereShape* sphereShape = shape->isSphere(); - stream->WriteSwapScalar(sphereShape->getRadius()); + stream->WriteLEScalar(sphereShape->getRadius()); hsPoint3 localPos = plPXConvert::Point(sphereShape->getLocalPosition()); localPos.Write(stream); } diff --git a/Sources/Plasma/PubUtilLib/plPhysX/plPXStream.h b/Sources/Plasma/PubUtilLib/plPhysX/plPXStream.h index 2cbd8494..1eebf55e 100644 --- a/Sources/Plasma/PubUtilLib/plPhysX/plPXStream.h +++ b/Sources/Plasma/PubUtilLib/plPhysX/plPXStream.h @@ -53,17 +53,17 @@ public: plPXStream(hsStream* s) : fStream(s) {} virtual NxU8 readByte() const { return fStream->ReadByte(); } - virtual NxU16 readWord() const { return fStream->ReadSwap16(); } - virtual NxU32 readDword() const { return fStream->ReadSwap32(); } - virtual float readFloat() const { return fStream->ReadSwapScalar(); } - virtual double readDouble() const { return fStream->ReadSwapDouble(); } + virtual NxU16 readWord() const { return fStream->ReadLE16(); } + virtual NxU32 readDword() const { return fStream->ReadLE32(); } + virtual float readFloat() const { return fStream->ReadLEScalar(); } + virtual double readDouble() const { return fStream->ReadLEDouble(); } virtual void readBuffer(void* buffer, NxU32 size) const { fStream->Read(size, buffer); } virtual NxStream& storeByte(NxU8 b) { fStream->WriteByte(b); return *this; } - virtual NxStream& storeWord(NxU16 w) { fStream->WriteSwap16(w); return *this; } - virtual NxStream& storeDword(NxU32 d) { fStream->WriteSwap32(d); return *this; } - virtual NxStream& storeFloat(NxReal f) { fStream->WriteSwapScalar(f); return *this; } - virtual NxStream& storeDouble(NxF64 f) { fStream->WriteSwapDouble(f); return *this; } + virtual NxStream& storeWord(NxU16 w) { fStream->WriteLE16(w); return *this; } + virtual NxStream& storeDword(NxU32 d) { fStream->WriteLE32(d); return *this; } + virtual NxStream& storeFloat(NxReal f) { fStream->WriteLEScalar(f); return *this; } + virtual NxStream& storeDouble(NxF64 f) { fStream->WriteLEDouble(f); return *this; } virtual NxStream& storeBuffer(const void* buffer, NxU32 size) { fStream->Write(size, buffer); return *this; } protected: diff --git a/Sources/Plasma/PubUtilLib/plPhysical/plCollisionDetector.cpp b/Sources/Plasma/PubUtilLib/plPhysical/plCollisionDetector.cpp index 06d9ac62..96e247d2 100644 --- a/Sources/Plasma/PubUtilLib/plPhysical/plCollisionDetector.cpp +++ b/Sources/Plasma/PubUtilLib/plPhysical/plCollisionDetector.cpp @@ -220,12 +220,12 @@ hsBool plCollisionDetector::MsgReceive(plMessage* msg) void plCollisionDetector::Read(hsStream* stream, hsResMgr* mgr) { plDetectorModifier::Read(stream, mgr); - stream->ReadSwap(&fType); + stream->ReadLE(&fType); } void plCollisionDetector::Write(hsStream* stream, hsResMgr* mgr) { plDetectorModifier::Write(stream, mgr); - stream->WriteSwap(fType); + stream->WriteLE(fType); } ///////////////////////////////// @@ -371,7 +371,7 @@ hsBool plCameraRegionDetector::MsgReceive(plMessage* msg) void plCameraRegionDetector::Read(hsStream* stream, hsResMgr* mgr) { plDetectorModifier::Read(stream, mgr); - int n = stream->ReadSwap32(); + int n = stream->ReadLE32(); fMessages.SetCountAndZero(n); for(int i = 0; i < n; i++ ) { @@ -383,7 +383,7 @@ void plCameraRegionDetector::Read(hsStream* stream, hsResMgr* mgr) void plCameraRegionDetector::Write(hsStream* stream, hsResMgr* mgr) { plDetectorModifier::Write(stream, mgr); - stream->WriteSwap32(fMessages.GetCount()); + stream->WriteLE32(fMessages.GetCount()); for(int i = 0; i < fMessages.GetCount(); i++ ) mgr->WriteCreatable( stream, fMessages[i] ); @@ -842,7 +842,7 @@ void plObjectInVolumeAndFacingDetector::Read(hsStream* stream, hsResMgr* mgr) { plObjectInVolumeDetector::Read(stream, mgr); - fFacingTolerance = stream->ReadSwapScalar(); + fFacingTolerance = stream->ReadLEScalar(); fNeedWalkingForward = stream->Readbool(); } @@ -850,7 +850,7 @@ void plObjectInVolumeAndFacingDetector::Write(hsStream* stream, hsResMgr* mgr) { plObjectInVolumeDetector::Write(stream, mgr); - stream->WriteSwapScalar(fFacingTolerance); + stream->WriteLEScalar(fFacingTolerance); stream->Writebool(fNeedWalkingForward); } @@ -1088,8 +1088,8 @@ void plSwimDetector::Write(hsStream *stream, hsResMgr *mgr) plSimpleRegionSensor::Write(stream, mgr); stream->WriteByte(0); - stream->WriteSwapScalar(0); - stream->WriteSwapScalar(0); + stream->WriteLEScalar(0); + stream->WriteLEScalar(0); } void plSwimDetector::Read(hsStream *stream, hsResMgr *mgr) @@ -1097,8 +1097,8 @@ void plSwimDetector::Read(hsStream *stream, hsResMgr *mgr) plSimpleRegionSensor::Read(stream, mgr); stream->ReadByte(); - stream->ReadSwapScalar(); - stream->ReadSwapScalar(); + stream->ReadLEScalar(); + stream->ReadLEScalar(); } hsBool plSwimDetector::MsgReceive(plMessage *msg) { diff --git a/Sources/Plasma/PubUtilLib/plPhysical/plDetectorModifier.h b/Sources/Plasma/PubUtilLib/plPhysical/plDetectorModifier.h index 78eb0def..3e6b2f16 100644 --- a/Sources/Plasma/PubUtilLib/plPhysical/plDetectorModifier.h +++ b/Sources/Plasma/PubUtilLib/plPhysical/plDetectorModifier.h @@ -75,7 +75,7 @@ public: void Read(hsStream* stream, hsResMgr* mgr) { plSingleModifier::Read(stream, mgr); - int n = stream->ReadSwap32(); + int n = stream->ReadLE32(); fReceivers.Reset(); for(int i = 0; i < n; i++ ) { @@ -88,7 +88,7 @@ public: void Write(hsStream* stream, hsResMgr* mgr) { plSingleModifier::Write(stream, mgr); - stream->WriteSwap32(fReceivers.GetCount()); + stream->WriteLE32(fReceivers.GetCount()); for( int i = 0; i < fReceivers.GetCount(); i++ ) mgr->WriteKey(stream, fReceivers[i]); diff --git a/Sources/Plasma/PubUtilLib/plPhysical/plPhysicalSndGroup.cpp b/Sources/Plasma/PubUtilLib/plPhysical/plPhysicalSndGroup.cpp index 67694413..012a08eb 100644 --- a/Sources/Plasma/PubUtilLib/plPhysical/plPhysicalSndGroup.cpp +++ b/Sources/Plasma/PubUtilLib/plPhysical/plPhysicalSndGroup.cpp @@ -89,15 +89,15 @@ void plPhysicalSndGroup::Read( hsStream *s, hsResMgr *mgr ) { hsKeyedObject::Read( s, mgr ); - s->ReadSwap( &fGroup ); + s->ReadLE( &fGroup ); - UInt32 i, count = s->ReadSwap32(); + UInt32 i, count = s->ReadLE32(); fImpactSounds.Reset(); for( i = 0; i < count; i++ ) fImpactSounds.Append( mgr->ReadKey( s ) ); - count = s->ReadSwap32(); + count = s->ReadLE32(); fSlideSounds.Reset(); for( i = 0; i < count; i++ ) fSlideSounds.Append( mgr->ReadKey( s ) ); @@ -108,14 +108,14 @@ void plPhysicalSndGroup::Write( hsStream *s, hsResMgr *mgr ) { hsKeyedObject::Write( s, mgr ); - s->WriteSwap( fGroup ); + s->WriteLE( fGroup ); UInt32 i; - s->WriteSwap32( fImpactSounds.GetCount() ); + s->WriteLE32( fImpactSounds.GetCount() ); for( i = 0; i < fImpactSounds.GetCount(); i++ ) mgr->WriteKey( s, fImpactSounds[ i ] ); - s->WriteSwap32( fSlideSounds.GetCount() ); + s->WriteLE32( fSlideSounds.GetCount() ); for( i = 0; i < fSlideSounds.GetCount(); i++ ) mgr->WriteKey( s, fSlideSounds[ i ] ); } diff --git a/Sources/Plasma/PubUtilLib/plPipeline/hsG3DDeviceSelector.cpp b/Sources/Plasma/PubUtilLib/plPipeline/hsG3DDeviceSelector.cpp index 2e14e6ab..2b27b634 100644 --- a/Sources/Plasma/PubUtilLib/plPipeline/hsG3DDeviceSelector.cpp +++ b/Sources/Plasma/PubUtilLib/plPipeline/hsG3DDeviceSelector.cpp @@ -107,15 +107,15 @@ void hsG3DDeviceMode::Read( hsStream* s ) { Clear(); - fFlags = s->ReadSwap32(); - fWidth = s->ReadSwap32(); - fHeight = s->ReadSwap32(); - fDepth = s->ReadSwap32(); + fFlags = s->ReadLE32(); + fWidth = s->ReadLE32(); + fHeight = s->ReadLE32(); + fDepth = s->ReadLE32(); fZStencilDepths.Reset(); UInt8 count= s->ReadByte(); while( count-- ) - fZStencilDepths.Append( s->ReadSwap16() ); + fZStencilDepths.Append( s->ReadLE16() ); /// Version 9 fFSAATypes.Reset(); @@ -128,15 +128,15 @@ void hsG3DDeviceMode::Read( hsStream* s ) void hsG3DDeviceMode::Write( hsStream* s ) const { - s->WriteSwap32(fFlags); - s->WriteSwap32(fWidth); - s->WriteSwap32(fHeight); - s->WriteSwap32(fDepth); + s->WriteLE32(fFlags); + s->WriteLE32(fWidth); + s->WriteLE32(fHeight); + s->WriteLE32(fDepth); UInt8 i, count = (UInt8)fZStencilDepths.GetCount(); s->WriteByte( count ); for( i = 0; i < count; i++ ) - s->WriteSwap16( fZStencilDepths[ i ] ); + s->WriteLE16( fZStencilDepths[ i ] ); /// Version 9 count = (UInt8)fFSAATypes.GetCount(); @@ -330,11 +330,11 @@ void hsG3DDeviceRecord::Read(hsStream* s) Clear(); /// Read version - fRecordVersion = s->ReadSwap32(); + fRecordVersion = s->ReadLE32(); hsAssert( fRecordVersion <= kCurrRecordVersion, "Invalid version number in hsG3DDeviceRecord::Read()" ); if( fRecordVersion == kCurrRecordVersion ) { - fFlags = s->ReadSwap32(); + fFlags = s->ReadLE32(); } else { @@ -346,53 +346,53 @@ void hsG3DDeviceRecord::Read(hsStream* s) } /// Now read everything else in as normal - fG3DDeviceType = s->ReadSwap32(); + fG3DDeviceType = s->ReadLE32(); int len; - len = s->ReadSwap32(); + len = s->ReadLE32(); fG3DDriverDesc = TRACKED_NEW char[len + 1]; s->Read(len, fG3DDriverDesc); fG3DDriverDesc[len] = 0; - len = s->ReadSwap32(); + len = s->ReadLE32(); fG3DDriverName = TRACKED_NEW char[len + 1]; s->Read(len, fG3DDriverName); fG3DDriverName[len] = 0; - len = s->ReadSwap32(); + len = s->ReadLE32(); fG3DDriverVersion = TRACKED_NEW char[len + 1]; s->Read(len, fG3DDriverVersion); fG3DDriverVersion[len] = 0; - len = s->ReadSwap32(); + len = s->ReadLE32(); fG3DDeviceDesc = TRACKED_NEW char[len + 1]; s->Read(len, fG3DDeviceDesc); fG3DDeviceDesc[len] = 0; fCaps.Read(s); - fLayersAtOnce = s->ReadSwap32(); - fMemoryBytes = s->ReadSwap32(); + fLayersAtOnce = s->ReadLE32(); + fMemoryBytes = s->ReadLE32(); - len = s->ReadSwap32(); + len = s->ReadLE32(); fModes.SetCount(len); int i; for( i = 0; i < len; i++ ) fModes[i].Read( s ); /// Version 3 stuff - fZBiasRating = s->ReadSwapFloat(); - fLODBiasRating = s->ReadSwapFloat(); - fFogExpApproxStart = s->ReadSwapFloat(); - fFogExp2ApproxStart = s->ReadSwapFloat(); - fFogEndBias = s->ReadSwapFloat(); + fZBiasRating = s->ReadLEFloat(); + fLODBiasRating = s->ReadLEFloat(); + fFogExpApproxStart = s->ReadLEFloat(); + fFogExp2ApproxStart = s->ReadLEFloat(); + fFogEndBias = s->ReadLEFloat(); /// Version 7 stuff float knee, kneeVal; - knee = s->ReadSwapFloat(); kneeVal = s->ReadSwapFloat(); + knee = s->ReadLEFloat(); kneeVal = s->ReadLEFloat(); SetFogKneeParams( kFogExp, knee, kneeVal ); - knee = s->ReadSwapFloat(); kneeVal = s->ReadSwapFloat(); + knee = s->ReadLEFloat(); kneeVal = s->ReadLEFloat(); SetFogKneeParams( kFogExp2, knee, kneeVal ); /// Version 9 stuff @@ -407,51 +407,51 @@ void hsG3DDeviceRecord::Read(hsStream* s) void hsG3DDeviceRecord::Write(hsStream* s) const { - s->WriteSwap32( fRecordVersion ); + s->WriteLE32( fRecordVersion ); - s->WriteSwap32(fFlags); + s->WriteLE32(fFlags); - s->WriteSwap32(fG3DDeviceType); + s->WriteLE32(fG3DDeviceType); int len; len = hsStrlen(fG3DDriverDesc); - s->WriteSwap32(len); + s->WriteLE32(len); s->Write(len, fG3DDriverDesc); len = hsStrlen(fG3DDriverName); - s->WriteSwap32(len); + s->WriteLE32(len); s->Write(len, fG3DDriverName); len = hsStrlen(fG3DDriverVersion); - s->WriteSwap32(len); + s->WriteLE32(len); s->Write(len, fG3DDriverVersion); len = hsStrlen(fG3DDeviceDesc); - s->WriteSwap32(len); + s->WriteLE32(len); s->Write(len, fG3DDeviceDesc); fCaps.Write(s); - s->WriteSwap32(fLayersAtOnce); - s->WriteSwap32(fMemoryBytes); + s->WriteLE32(fLayersAtOnce); + s->WriteLE32(fMemoryBytes); - s->WriteSwap32(fModes.GetCount()); + s->WriteLE32(fModes.GetCount()); int i; for( i = 0; i < fModes.GetCount(); i++ ) fModes[i].Write( s ); /// Version 3 data - s->WriteSwapFloat( fZBiasRating ); - s->WriteSwapFloat( fLODBiasRating ); - s->WriteSwapFloat( fFogExpApproxStart ); - s->WriteSwapFloat( fFogExp2ApproxStart ); - s->WriteSwapFloat( fFogEndBias ); + s->WriteLEFloat( fZBiasRating ); + s->WriteLEFloat( fLODBiasRating ); + s->WriteLEFloat( fFogExpApproxStart ); + s->WriteLEFloat( fFogExp2ApproxStart ); + s->WriteLEFloat( fFogEndBias ); /// Version 7 data - s->WriteSwapFloat( fFogKnees[ kFogExp ] ); - s->WriteSwapFloat( fFogKneeVals[ kFogExp ] ); - s->WriteSwapFloat( fFogKnees[ kFogExp2 ] ); - s->WriteSwapFloat( fFogKneeVals[ kFogExp2 ] ); + s->WriteLEFloat( fFogKnees[ kFogExp ] ); + s->WriteLEFloat( fFogKneeVals[ kFogExp ] ); + s->WriteLEFloat( fFogKnees[ kFogExp2 ] ); + s->WriteLEFloat( fFogKneeVals[ kFogExp2 ] ); /// Version 9 data s->WriteByte( fAASetting ); diff --git a/Sources/Plasma/PubUtilLib/plPipeline/plDynamicEnvMap.cpp b/Sources/Plasma/PubUtilLib/plPipeline/plDynamicEnvMap.cpp index c3d7bea7..3d4489dd 100644 --- a/Sources/Plasma/PubUtilLib/plPipeline/plDynamicEnvMap.cpp +++ b/Sources/Plasma/PubUtilLib/plPipeline/plDynamicEnvMap.cpp @@ -418,12 +418,12 @@ void plDynamicEnvMap::Read(hsStream* s, hsResMgr* mgr) UInt32 sz = plCubicRenderTarget::Read(s); fPos.Read(s); - fHither = s->ReadSwapScalar(); - fYon = s->ReadSwapScalar(); - fFogStart = s->ReadSwapScalar(); + fHither = s->ReadLEScalar(); + fYon = s->ReadLEScalar(); + fFogStart = s->ReadLEScalar(); fColor.Read(s); - fRefreshRate = s->ReadSwapScalar(); + fRefreshRate = s->ReadLEScalar(); SetPosition(fPos); @@ -431,12 +431,12 @@ void plDynamicEnvMap::Read(hsStream* s, hsResMgr* mgr) fIncCharacters = s->ReadByte(); SetIncludeCharacters(fIncCharacters); - int nVis = s->ReadSwap32(); + int nVis = s->ReadLE32(); int i; for( i = 0; i < nVis; i++ ) mgr->ReadKeyNotifyMe(s, TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, -1, kRefVisSet), plRefFlags::kActiveRef); - nVis = s->ReadSwap32(); + nVis = s->ReadLE32(); for( i = 0; i < nVis; i++) { char *name = s->ReadSafeString(); @@ -458,22 +458,22 @@ void plDynamicEnvMap::Write(hsStream* s, hsResMgr* mgr) UInt32 sz = plCubicRenderTarget::Write(s); fPos.Write(s); - s->WriteSwapScalar(fHither); - s->WriteSwapScalar(fYon); - s->WriteSwapScalar(fFogStart); + s->WriteLEScalar(fHither); + s->WriteLEScalar(fYon); + s->WriteLEScalar(fFogStart); fColor.Write(s); - s->WriteSwapScalar(fRefreshRate); + s->WriteLEScalar(fRefreshRate); sz += sizeof(fPos) + sizeof(fHither) + sizeof(fYon) + sizeof(fFogStart) + sizeof(fColor) + sizeof(fRefreshRate); s->WriteByte(fIncCharacters); - s->WriteSwap32(fVisRegions.GetCount()); + s->WriteLE32(fVisRegions.GetCount()); int i; for( i = 0; i < fVisRegions.GetCount(); i++ ) mgr->WriteKey(s, fVisRegions[i]); - s->WriteSwap32(fVisRegionNames.Count()); + s->WriteLE32(fVisRegionNames.Count()); for( i = 0; i < fVisRegionNames.Count(); i++) { s->WriteSafeString(fVisRegionNames[i]); @@ -887,12 +887,12 @@ void plDynamicCamMap::Read(hsStream* s, hsResMgr* mgr) hsKeyedObject::Read(s, mgr); plRenderTarget::Read(s); - fHither = s->ReadSwapScalar(); - fYon = s->ReadSwapScalar(); - fFogStart = s->ReadSwapScalar(); + fHither = s->ReadLEScalar(); + fYon = s->ReadLEScalar(); + fFogStart = s->ReadLEScalar(); fColor.Read(s); - fRefreshRate = s->ReadSwapScalar(); + fRefreshRate = s->ReadLEScalar(); fIncCharacters = s->ReadBool(); SetIncludeCharacters(fIncCharacters); mgr->ReadKeyNotifyMe(s, TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, 0, kRefCamera), plRefFlags::kPassiveRef); @@ -903,11 +903,11 @@ void plDynamicCamMap::Read(hsStream* s, hsResMgr* mgr) for (i = 0; i < numTargs; i++) mgr->ReadKeyNotifyMe(s, TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, i, kRefTargetNode), plRefFlags::kPassiveRef); - int nVis = s->ReadSwap32(); + int nVis = s->ReadLE32(); for( i = 0; i < nVis; i++ ) mgr->ReadKeyNotifyMe(s, TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, 0, kRefVisSet), plRefFlags::kActiveRef); - nVis = s->ReadSwap32(); + nVis = s->ReadLE32(); for( i = 0; i < nVis; i++) { char *name = s->ReadSafeString(); @@ -933,12 +933,12 @@ void plDynamicCamMap::Write(hsStream* s, hsResMgr* mgr) hsKeyedObject::Write(s, mgr); plRenderTarget::Write(s); - s->WriteSwapScalar(fHither); - s->WriteSwapScalar(fYon); - s->WriteSwapScalar(fFogStart); + s->WriteLEScalar(fHither); + s->WriteLEScalar(fYon); + s->WriteLEScalar(fFogStart); fColor.Write(s); - s->WriteSwapScalar(fRefreshRate); + s->WriteLEScalar(fRefreshRate); s->WriteByte(fIncCharacters); mgr->WriteKey(s, (fCamera ? fCamera->GetKey() : nil)); mgr->WriteKey(s, (fRootNode ? fRootNode->GetKey() : nil)); @@ -948,11 +948,11 @@ void plDynamicCamMap::Write(hsStream* s, hsResMgr* mgr) for (i = 0; i < fTargetNodes.GetCount(); i++) mgr->WriteKey(s, fTargetNodes[i]); - s->WriteSwap32(fVisRegions.GetCount()); + s->WriteLE32(fVisRegions.GetCount()); for( i = 0; i < fVisRegions.GetCount(); i++ ) mgr->WriteKey(s, fVisRegions[i]); - s->WriteSwap32(fVisRegionNames.Count()); + s->WriteLE32(fVisRegionNames.Count()); for( i = 0; i < fVisRegionNames.Count(); i++) { s->WriteSafeString(fVisRegionNames[i]); diff --git a/Sources/Plasma/PubUtilLib/plPipeline/plFogEnvironment.cpp b/Sources/Plasma/PubUtilLib/plPipeline/plFogEnvironment.cpp index 8299a14d..f074136b 100644 --- a/Sources/Plasma/PubUtilLib/plPipeline/plFogEnvironment.cpp +++ b/Sources/Plasma/PubUtilLib/plPipeline/plFogEnvironment.cpp @@ -192,9 +192,9 @@ void plFogEnvironment::Read( hsStream *s, hsResMgr *mgr ) hsKeyedObject::Read( s, mgr ); fType = s->ReadByte(); - fStart = s->ReadSwapFloat(); - fEnd = s->ReadSwapFloat(); - fDensity = s->ReadSwapFloat(); + fStart = s->ReadLEFloat(); + fEnd = s->ReadLEFloat(); + fDensity = s->ReadLEFloat(); fColor.Read( s ); } @@ -205,9 +205,9 @@ void plFogEnvironment::Write( hsStream *s, hsResMgr *mgr ) hsKeyedObject::Write( s, mgr ); s->WriteByte( fType ); - s->WriteSwapFloat( fStart ); - s->WriteSwapFloat( fEnd ); - s->WriteSwapFloat( fDensity ); + s->WriteLEFloat( fStart ); + s->WriteLEFloat( fEnd ); + s->WriteLEFloat( fDensity ); fColor.Write( s ); } diff --git a/Sources/Plasma/PubUtilLib/plPipeline/plGBufferGroup.cpp b/Sources/Plasma/PubUtilLib/plPipeline/plGBufferGroup.cpp index d9157233..93a15e44 100644 --- a/Sources/Plasma/PubUtilLib/plPipeline/plGBufferGroup.cpp +++ b/Sources/Plasma/PubUtilLib/plPipeline/plGBufferGroup.cpp @@ -76,19 +76,19 @@ const UInt32 plGBufferGroup::kMaxNumIndicesPerBuffer = 32000; void plGBufferTriangle::Read( hsStream *s ) { - fIndex1 = s->ReadSwap16(); - fIndex2 = s->ReadSwap16(); - fIndex3 = s->ReadSwap16(); - fSpanIndex = s->ReadSwap16(); + fIndex1 = s->ReadLE16(); + fIndex2 = s->ReadLE16(); + fIndex3 = s->ReadLE16(); + fSpanIndex = s->ReadLE16(); fCenter.Read( s ); } void plGBufferTriangle::Write( hsStream *s ) { - s->WriteSwap16( fIndex1 ); - s->WriteSwap16( fIndex2 ); - s->WriteSwap16( fIndex3 ); - s->WriteSwap16( fSpanIndex ); + s->WriteLE16( fIndex1 ); + s->WriteLE16( fIndex2 ); + s->WriteLE16( fIndex3 ); + s->WriteLE16( fSpanIndex ); fCenter.Write( s ); } @@ -96,16 +96,16 @@ void plGBufferTriangle::Write( hsStream *s ) void plGBufferCell::Read( hsStream *s ) { - fVtxStart = s->ReadSwap32(); - fColorStart = s->ReadSwap32(); - fLength = s->ReadSwap32(); + fVtxStart = s->ReadLE32(); + fColorStart = s->ReadLE32(); + fLength = s->ReadLE32(); } void plGBufferCell::Write( hsStream *s ) { - s->WriteSwap32( fVtxStart ); - s->WriteSwap32( fColorStart ); - s->WriteSwap32( fLength ); + s->WriteLE32( fVtxStart ); + s->WriteLE32( fColorStart ); + s->WriteLE32( fLength ); } //// Constructor ////////////////////////////////////////////////////////////// @@ -367,8 +367,8 @@ void plGBufferGroup::Read( hsStream *s ) plGBufferColor *cData; - s->ReadSwap( &fFormat ); - totalDynSize = s->ReadSwap32(); + s->ReadLE( &fFormat ); + totalDynSize = s->ReadLE32(); fStride = ICalcVertexSize( fLiteStride ); fVertBuffSizes.Reset(); @@ -383,12 +383,12 @@ void plGBufferGroup::Read( hsStream *s ) plVertCoder coder; /// Create buffers and read in as we go - count = s->ReadSwap32(); + count = s->ReadLE32(); for( i = 0; i < count; i++ ) { if( fFormat & kEncoded ) { - const UInt16 numVerts = s->ReadSwap16(); + const UInt16 numVerts = s->ReadLE16(); const UInt32 size = numVerts * fStride; fVertBuffSizes.Append(size); @@ -407,7 +407,7 @@ void plGBufferGroup::Read( hsStream *s ) } else { - temp = s->ReadSwap32(); + temp = s->ReadLE32(); fVertBuffSizes.Append( temp ); fVertBuffStarts.Append(0); @@ -419,7 +419,7 @@ void plGBufferGroup::Read( hsStream *s ) fVertBuffStorage.Append( vData ); plProfile_NewMem(MemBufGrpVertex, temp); - temp = s->ReadSwap32(); + temp = s->ReadLE32(); fColorBuffCounts.Append( temp ); if( temp > 0 ) @@ -435,17 +435,17 @@ void plGBufferGroup::Read( hsStream *s ) } } - count = s->ReadSwap32(); + count = s->ReadLE32(); for( i = 0; i < count; i++ ) { - temp = s->ReadSwap32(); + temp = s->ReadLE32(); fIdxBuffCounts.Append( temp ); fIdxBuffStarts.Append(0); fIdxBuffEnds.Append(-1); iData = TRACKED_NEW UInt16[ temp ]; hsAssert( iData != nil, "Not enough memory to read in indices" ); - s->ReadSwap16( temp, (UInt16 *)iData ); + s->ReadLE16( temp, (UInt16 *)iData ); fIdxBuffStorage.Append( iData ); plProfile_NewMem(MemBufGrpIndex, temp * sizeof(UInt16)); } @@ -453,7 +453,7 @@ void plGBufferGroup::Read( hsStream *s ) /// Read in cell arrays, one per vBuffer for( i = 0; i < fVertBuffStorage.GetCount(); i++ ) { - temp = s->ReadSwap32(); + temp = s->ReadLE32(); fCells.Append( TRACKED_NEW hsTArray ); fCells[ i ]->SetCount( temp ); @@ -487,20 +487,20 @@ void plGBufferGroup::Write( hsStream *s ) for( i = 0; i < fIdxBuffCounts.GetCount(); i++ ) totalDynSize += sizeof( UInt16 ) * fIdxBuffCounts[ i ]; - s->WriteSwap( fFormat ); - s->WriteSwap32( totalDynSize ); + s->WriteLE( fFormat ); + s->WriteLE32( totalDynSize ); plVertCoder coder; /// Write out dyanmic data - s->WriteSwap32( (UInt32)fVertBuffStorage.GetCount() ); + s->WriteLE32( (UInt32)fVertBuffStorage.GetCount() ); for( i = 0; i < fVertBuffStorage.GetCount(); i++ ) { #ifdef MF_VERTCODE_ENABLED hsAssert(fCells[i]->GetCount() == 1, "Data must be interleaved for compression"); UInt32 numVerts = fVertBuffSizes[i] / fStride; - s->WriteSwap16((UInt16)numVerts); + s->WriteLE16((UInt16)numVerts); coder.Write(s, fVertBuffStorage[i], fFormat, fStride, (UInt16)numVerts); #ifdef VERT_LOG @@ -518,27 +518,27 @@ void plGBufferGroup::Write( hsStream *s ) #else // MF_VERTCODE_ENABLED - s->WriteSwap32( fVertBuffSizes[ i ] ); + s->WriteLE32( fVertBuffSizes[ i ] ); s->Write( fVertBuffSizes[ i ], (void *)fVertBuffStorage[ i ] ); - s->WriteSwap32( fColorBuffCounts[ i ] ); + s->WriteLE32( fColorBuffCounts[ i ] ); s->Write( fColorBuffCounts[ i ] * sizeof( plGBufferColor ), (void *)fColorBuffStorage[ i ] ); #endif // MF_VERTCODE_ENABLED } - s->WriteSwap32( (UInt32)fIdxBuffCounts.GetCount() ); + s->WriteLE32( (UInt32)fIdxBuffCounts.GetCount() ); for( i = 0; i < fIdxBuffStorage.GetCount(); i++ ) { - s->WriteSwap32( fIdxBuffCounts[ i ] ); - s->WriteSwap16( fIdxBuffCounts[ i ], fIdxBuffStorage[ i ] ); + s->WriteLE32( fIdxBuffCounts[ i ] ); + s->WriteLE16( fIdxBuffCounts[ i ], fIdxBuffStorage[ i ] ); } /// Write out cell arrays for( i = 0; i < fVertBuffStorage.GetCount(); i++ ) { - s->WriteSwap32( fCells[ i ]->GetCount() ); + s->WriteLE32( fCells[ i ]->GetCount() ); for( j = 0; j < fCells[ i ]->GetCount(); j++ ) (*fCells[ i ])[ j ].Write( s ); } diff --git a/Sources/Plasma/PubUtilLib/plPipeline/plRenderTarget.cpp b/Sources/Plasma/PubUtilLib/plPipeline/plRenderTarget.cpp index 6c546cc3..2b5fa7f7 100644 --- a/Sources/Plasma/PubUtilLib/plPipeline/plRenderTarget.cpp +++ b/Sources/Plasma/PubUtilLib/plPipeline/plRenderTarget.cpp @@ -94,23 +94,23 @@ UInt32 plRenderTarget::Read( hsStream *s ) { UInt32 total = plBitmap::Read( s ); - fWidth = s->ReadSwap16(); - fHeight = s->ReadSwap16(); + fWidth = s->ReadLE16(); + fHeight = s->ReadLE16(); fProportionalViewport = s->ReadBool(); if( fProportionalViewport ) { - fViewport.fProportional.fLeft = s->ReadSwapScalar(); - fViewport.fProportional.fTop = s->ReadSwapScalar(); - fViewport.fProportional.fRight = s->ReadSwapScalar(); - fViewport.fProportional.fBottom = s->ReadSwapScalar(); + fViewport.fProportional.fLeft = s->ReadLEScalar(); + fViewport.fProportional.fTop = s->ReadLEScalar(); + fViewport.fProportional.fRight = s->ReadLEScalar(); + fViewport.fProportional.fBottom = s->ReadLEScalar(); } else { - fViewport.fAbsolute.fLeft = s->ReadSwap16(); - fViewport.fAbsolute.fTop = s->ReadSwap16(); - fViewport.fAbsolute.fRight = s->ReadSwap16(); - fViewport.fAbsolute.fBottom = s->ReadSwap16(); + fViewport.fAbsolute.fLeft = s->ReadLE16(); + fViewport.fAbsolute.fTop = s->ReadLE16(); + fViewport.fAbsolute.fRight = s->ReadLE16(); + fViewport.fAbsolute.fBottom = s->ReadLE16(); } fZDepth = s->ReadByte(); @@ -123,23 +123,23 @@ UInt32 plRenderTarget::Write( hsStream *s ) { UInt32 total = plBitmap::Write( s ); - s->WriteSwap16( fWidth ); - s->WriteSwap16( fHeight ); + s->WriteLE16( fWidth ); + s->WriteLE16( fHeight ); s->WriteBool( fProportionalViewport ); if( fProportionalViewport ) { - s->WriteSwapScalar( fViewport.fProportional.fLeft ); - s->WriteSwapScalar( fViewport.fProportional.fTop ); - s->WriteSwapScalar( fViewport.fProportional.fRight ); - s->WriteSwapScalar( fViewport.fProportional.fBottom ); + s->WriteLEScalar( fViewport.fProportional.fLeft ); + s->WriteLEScalar( fViewport.fProportional.fTop ); + s->WriteLEScalar( fViewport.fProportional.fRight ); + s->WriteLEScalar( fViewport.fProportional.fBottom ); } else { - s->WriteSwap16( fViewport.fAbsolute.fLeft ); - s->WriteSwap16( fViewport.fAbsolute.fTop ); - s->WriteSwap16( fViewport.fAbsolute.fRight ); - s->WriteSwap16( fViewport.fAbsolute.fBottom ); + s->WriteLE16( fViewport.fAbsolute.fLeft ); + s->WriteLE16( fViewport.fAbsolute.fTop ); + s->WriteLE16( fViewport.fAbsolute.fRight ); + s->WriteLE16( fViewport.fAbsolute.fBottom ); } s->WriteByte( fZDepth ); diff --git a/Sources/Plasma/PubUtilLib/plPipeline/plVertCoder.cpp b/Sources/Plasma/PubUtilLib/plPipeline/plVertCoder.cpp index eb687582..43e3485c 100644 --- a/Sources/Plasma/PubUtilLib/plPipeline/plVertCoder.cpp +++ b/Sources/Plasma/PubUtilLib/plPipeline/plVertCoder.cpp @@ -118,14 +118,14 @@ static inline void IWriteFloat(hsStream* s, const UInt8*& src, const hsScalar of // hsAssert(fval < hsScalar(UInt16(0xffff)), "Bad offset?"); const UInt16 ival = UInt16(floor(fval + 0.5f)); - s->WriteSwap16(ival); + s->WriteLE16(ival); src += 4; } static inline void IReadFloat(hsStream* s, UInt8*& dst, const hsScalar offset, const hsScalar quantum) { - const UInt16 ival = s->ReadSwap16(); + const UInt16 ival = s->ReadLE16(); float fval = float(ival) * quantum; fval += offset; @@ -141,9 +141,9 @@ inline void plVertCoder::IEncodeFloat(hsStream* s, const UInt32 vertsLeft, const { ICountFloats(src, (UInt16)vertsLeft, kQuanta[field], stride, fFloats[field][chan].fOffset, fFloats[field][chan].fAllSame, fFloats[field][chan].fCount); - s->WriteSwapScalar(fFloats[field][chan].fOffset); + s->WriteLEScalar(fFloats[field][chan].fOffset); s->WriteBool(fFloats[field][chan].fAllSame); - s->WriteSwap16(fFloats[field][chan].fCount); + s->WriteLE16(fFloats[field][chan].fCount); } if (!fFloats[field][chan].fAllSame) @@ -158,9 +158,9 @@ inline void plVertCoder::IDecodeFloat(hsStream* s, const int field, const int ch { if( !fFloats[field][chan].fCount ) { - fFloats[field][chan].fOffset = s->ReadSwapScalar(); + fFloats[field][chan].fOffset = s->ReadLEScalar(); fFloats[field][chan].fAllSame = s->ReadBool(); - fFloats[field][chan].fCount = s->ReadSwap16(); + fFloats[field][chan].fCount = s->ReadLE16(); } if (!fFloats[field][chan].fAllSame) @@ -283,7 +283,7 @@ inline void plVertCoder::IEncodeByte(hsStream* s, const int chan, const UInt32 v UInt16 cnt = fColors[chan].fCount; if( fColors[chan].fSame ) cnt |= kSameMask; - s->WriteSwap16(cnt); + s->WriteLE16(cnt); if( fColors[chan].fSame ) s->WriteByte(*src); @@ -300,7 +300,7 @@ inline void plVertCoder::IDecodeByte(hsStream* s, const int chan, UInt8*& dst, c { if( !fColors[chan].fCount ) { - UInt16 cnt = s->ReadSwap16(); + UInt16 cnt = s->ReadLE16(); if( cnt & kSameMask ) { fColors[chan].fSame = true; @@ -356,7 +356,7 @@ inline void plVertCoder::IEncode(hsStream* s, const UInt32 vertsLeft, const UInt if( format & plGBufferGroup::kSkinIndices ) { const UInt32 idx = *(UInt32*)src; - s->WriteSwap32(idx); + s->WriteLE32(idx); src += 4; } } @@ -395,7 +395,7 @@ inline void plVertCoder::IDecode(hsStream* s, UInt8*& dst, const UInt32 stride, if( format & plGBufferGroup::kSkinIndices ) { UInt32* idx = (UInt32*)dst; - *idx = s->ReadSwap32(); + *idx = s->ReadLE32(); dst += 4; } } diff --git a/Sources/Plasma/PubUtilLib/plResMgr/plDiffBuffer.cpp b/Sources/Plasma/PubUtilLib/plResMgr/plDiffBuffer.cpp index 5dc87c60..0df726ba 100644 --- a/Sources/Plasma/PubUtilLib/plResMgr/plDiffBuffer.cpp +++ b/Sources/Plasma/PubUtilLib/plResMgr/plDiffBuffer.cpp @@ -87,7 +87,7 @@ plDiffBuffer::plDiffBuffer( UInt32 newLength, UInt32 oldLength ) fNewLength = newLength; fStream = TRACKED_NEW hsRAMStream(); - fStream->WriteSwap32( fNewLength ); + fStream->WriteLE32( fNewLength ); fStream->WriteBool( f16BitMode ); fWriting = true; } @@ -118,7 +118,7 @@ plDiffBuffer::plDiffBuffer( void *buffer, UInt32 length ) fStream->Write( length, buffer ); fStream->Rewind(); - fNewLength = fStream->ReadSwap32(); + fNewLength = fStream->ReadLE32(); f16BitMode = fStream->ReadBool(); } } @@ -148,9 +148,9 @@ void plDiffBuffer::Add( Int32 length, void *newData ) // We flag our two different op types by the sign of the length. Negative // lengths are an add operation, positive ones are copy ops. if( f16BitMode ) - fStream->WriteSwap16( -( (Int16)length ) ); + fStream->WriteLE16( -( (Int16)length ) ); else - fStream->WriteSwap32( -length ); + fStream->WriteLE32( -length ); fStream->Write( length, newData ); } @@ -165,13 +165,13 @@ void plDiffBuffer::Copy( Int32 length, UInt32 oldOffset ) // lengths are an add operation, positive ones are copy ops. if( f16BitMode ) { - fStream->WriteSwap16( (Int16)length ); - fStream->WriteSwap16( (UInt16)oldOffset ); + fStream->WriteLE16( (Int16)length ); + fStream->WriteLE16( (UInt16)oldOffset ); } else { - fStream->WriteSwap32( length ); - fStream->WriteSwap32( oldOffset ); + fStream->WriteLE32( length ); + fStream->WriteLE32( oldOffset ); } } @@ -231,14 +231,14 @@ void plDiffBuffer::Apply( UInt32 oldLength, void *oldBuffer, UInt32 &newLengt // Read in the op length if( f16BitMode ) { - Int16 opLen16 = fStream->ReadSwap16(); + Int16 opLen16 = fStream->ReadLE16(); if( opLen16 < 0 ) opLength = -( (Int32)( -opLen16 ) ); else opLength = (UInt32)opLen16; } else - opLength = fStream->ReadSwap32(); + opLength = fStream->ReadLE32(); // As defined, negative ops are add ops, positive ones are copys if( opLength < 0 ) @@ -252,7 +252,7 @@ void plDiffBuffer::Apply( UInt32 oldLength, void *oldBuffer, UInt32 &newLengt else { // Copy op, so get the old offset and copy from there - UInt32 oldOffset = f16BitMode ? fStream->ReadSwap16() : fStream->ReadSwap32(); + UInt32 oldOffset = f16BitMode ? fStream->ReadLE16() : fStream->ReadLE32(); hsAssertAndBreak( newBufferPos + opLength > newLength, "Destination buffer offset in plDiffBuffer() is out of range!" ); hsAssertAndBreak( oldOffset + opLength > oldLength, "Difference buffer offset in plDiffBuffer() is out of range of the old buffer!" ); diff --git a/Sources/Plasma/PubUtilLib/plResMgr/plPageInfo.cpp b/Sources/Plasma/PubUtilLib/plResMgr/plPageInfo.cpp index 47d20897..f01176c8 100644 --- a/Sources/Plasma/PubUtilLib/plResMgr/plPageInfo.cpp +++ b/Sources/Plasma/PubUtilLib/plResMgr/plPageInfo.cpp @@ -135,7 +135,7 @@ void plPageInfo::Read( hsStream *s ) // 5 is the earliest version since we began working again on the P20 codebase in Sep 2005, // after Uru's online component was cancelled in Feb 2004, so I've removed support for // anything prior to that to clean things up a bit. - UInt32 version = s->ReadSwap32(); + UInt32 version = s->ReadLE32(); if (version > sCurrPageInfoVersion || version < 5) { hsAssert( false, "Invalid header version in plPageInfo::Read()" ); @@ -149,32 +149,32 @@ void plPageInfo::Read( hsStream *s ) delete s->ReadSafeString(); // fChapter was never used, and always "District". fPage = s->ReadSafeString(); - s->ReadSwap( &fMajorVersion ); + s->ReadLE( &fMajorVersion ); if (version < 6) { UInt16 unusedMinorVersion; - s->ReadSwap(&unusedMinorVersion); + s->ReadLE(&unusedMinorVersion); Int32 unusedReleaseVersion; - s->ReadSwap(&unusedReleaseVersion); // This was always zero... yanked. + s->ReadLE(&unusedReleaseVersion); // This was always zero... yanked. UInt32 unusedFlags; - s->ReadSwap(&unusedFlags); + s->ReadLE(&unusedFlags); } - s->ReadSwap( &fChecksum ); - s->ReadSwap( &fDataStart ); - s->ReadSwap( &fIndexStart ); + s->ReadLE( &fChecksum ); + s->ReadLE( &fDataStart ); + s->ReadLE( &fIndexStart ); } if (version >= 6) { - UInt16 numClassVersions = s->ReadSwap16(); + UInt16 numClassVersions = s->ReadLE16(); fClassVersions.reserve(numClassVersions); for (UInt16 i = 0; i < numClassVersions; i++) { ClassVersion cv; - cv.Class = s->ReadSwap16(); - cv.Version = s->ReadSwap16(); + cv.Class = s->ReadLE16(); + cv.Version = s->ReadLE16(); fClassVersions.push_back(cv); } } @@ -182,21 +182,21 @@ void plPageInfo::Read( hsStream *s ) void plPageInfo::Write( hsStream *s ) { - s->WriteSwap32( sCurrPageInfoVersion ); + s->WriteLE32( sCurrPageInfoVersion ); fLocation.Write( s ); s->WriteSafeString( fAge ); s->WriteSafeString( fPage ); - s->WriteSwap( fMajorVersion ); - s->WriteSwap( fChecksum ); - s->WriteSwap( fDataStart ); - s->WriteSwap( fIndexStart ); + s->WriteLE( fMajorVersion ); + s->WriteLE( fChecksum ); + s->WriteLE( fDataStart ); + s->WriteLE( fIndexStart ); UInt16 numClassVersions = UInt16(fClassVersions.size()); - s->WriteSwap16(numClassVersions); + s->WriteLE16(numClassVersions); for (UInt16 i = 0; i < numClassVersions; i++) { ClassVersion& cv = fClassVersions[i]; - s->WriteSwap16(cv.Class); - s->WriteSwap16(cv.Version); + s->WriteLE16(cv.Class); + s->WriteLE16(cv.Version); } } diff --git a/Sources/Plasma/PubUtilLib/plResMgr/plRegistryKeyList.cpp b/Sources/Plasma/PubUtilLib/plResMgr/plRegistryKeyList.cpp index 108a3167..eaf3c840 100644 --- a/Sources/Plasma/PubUtilLib/plResMgr/plRegistryKeyList.cpp +++ b/Sources/Plasma/PubUtilLib/plResMgr/plRegistryKeyList.cpp @@ -318,7 +318,7 @@ void plRegistryKeyList::PrepForWrite() void plRegistryKeyList::Read(hsStream* s) { - UInt32 keyListLen = s->ReadSwap32(); + UInt32 keyListLen = s->ReadLE32(); if (!fStaticKeys.empty()) { s->Skip(keyListLen); @@ -327,7 +327,7 @@ void plRegistryKeyList::Read(hsStream* s) fFlags = s->ReadByte(); - UInt32 numKeys = s->ReadSwap32(); + UInt32 numKeys = s->ReadLE32(); fStaticKeys.resize(numKeys); for (int i = 0; i < numKeys; i++) @@ -342,11 +342,11 @@ void plRegistryKeyList::Write(hsStream* s) { // Save space for the length of our data UInt32 beginPos = s->GetPosition(); - s->WriteSwap32(0); + s->WriteLE32(0); s->WriteByte(fFlags); int numKeys = fStaticKeys.size(); - s->WriteSwap32(numKeys); + s->WriteLE32(numKeys); // Write out all our keys (anything in dynamic is unused, so just ignore those) for (int i = 0; i < numKeys; i++) @@ -358,6 +358,6 @@ void plRegistryKeyList::Write(hsStream* s) // Go back to the start and write the length of our data UInt32 endPos = s->GetPosition(); s->SetPosition(beginPos); - s->WriteSwap32(endPos-beginPos-sizeof(UInt32)); + s->WriteLE32(endPos-beginPos-sizeof(UInt32)); s->SetPosition(endPos); } diff --git a/Sources/Plasma/PubUtilLib/plResMgr/plRegistryNode.cpp b/Sources/Plasma/PubUtilLib/plResMgr/plRegistryNode.cpp index 54b74cdc..060df37a 100644 --- a/Sources/Plasma/PubUtilLib/plResMgr/plRegistryNode.cpp +++ b/Sources/Plasma/PubUtilLib/plResMgr/plRegistryNode.cpp @@ -179,10 +179,10 @@ void plRegistryPageNode::LoadKeys() stream->SetPosition(GetPageInfo().GetIndexStart()); // Read in the number of key types - UInt32 numTypes = stream->ReadSwap32(); + UInt32 numTypes = stream->ReadLE32(); for (UInt32 i = 0; i < numTypes; i++) { - UInt16 classType = stream->ReadSwap16(); + UInt16 classType = stream->ReadLE16(); plRegistryKeyList* keyList = IGetKeyList(classType); if (!keyList) { @@ -265,11 +265,11 @@ void plRegistryPageNode::Write() fPageInfo.SetIndexStart(fStream.GetPosition()); // Write our keys - fStream.WriteSwap32(fKeyLists.size()); + fStream.WriteLE32(fKeyLists.size()); for (it = fKeyLists.begin(); it != fKeyLists.end(); it++) { plRegistryKeyList* keyList = it->second; - fStream.WriteSwap16(keyList->GetClassType()); + fStream.WriteLE16(keyList->GetClassType()); keyList->Write(&fStream); } diff --git a/Sources/Plasma/PubUtilLib/plResMgr/plResManager.cpp b/Sources/Plasma/PubUtilLib/plResMgr/plResManager.cpp index 20c25b09..effccaef 100644 --- a/Sources/Plasma/PubUtilLib/plResMgr/plResManager.cpp +++ b/Sources/Plasma/PubUtilLib/plResMgr/plResManager.cpp @@ -951,7 +951,7 @@ hsBool plResManager::Unload(const plKey& objKey) plCreatable* plResManager::IReadCreatable(hsStream* s) const { - UInt16 hClass = s->ReadSwap16(); + UInt16 hClass = s->ReadLE16(); plCreatable* pCre = plFactory::Create(hClass); if (!pCre) hsAssert( hClass == 0x8000, "Invalid creatable index" ); @@ -979,7 +979,7 @@ inline void IWriteCreatable(hsStream* s, plCreatable* pCre) { Int16 hClass = pCre ? pCre->ClassIndex() : 0x8000; hsAssert(pCre == nil || plFactory::IsValidClassIndex(hClass), "Invalid class index on write"); - s->WriteSwap16(hClass); + s->WriteLE16(hClass); } void plResManager::WriteCreatable(hsStream* s, plCreatable* pCre) diff --git a/Sources/Plasma/PubUtilLib/plSDL/plSDLMgr.cpp b/Sources/Plasma/PubUtilLib/plSDL/plSDLMgr.cpp index 162f5664..7584f876 100644 --- a/Sources/Plasma/PubUtilLib/plSDL/plSDLMgr.cpp +++ b/Sources/Plasma/PubUtilLib/plSDL/plSDLMgr.cpp @@ -146,7 +146,7 @@ int plSDLMgr::Write(hsStream* s, const plSDL::DescriptorList* dl) dl=&fDescriptors; UInt16 num=dl->size(); - s->WriteSwap(num); + s->WriteLE(num); plSDL::DescriptorList::const_iterator it; for(it=dl->begin(); it!= dl->end(); it++) @@ -178,7 +178,7 @@ int plSDLMgr::Read(hsStream* s, plSDL::DescriptorList* dl) try { // read dtor list - s->ReadSwap(&num); + s->ReadLE(&num); int i; for(i=0;iReadByte(); else if (size < (1<<16)) - *val = s->ReadSwap16(); + *val = s->ReadLE16(); else - *val = s->ReadSwap32(); + *val = s->ReadLE32(); } // @@ -86,10 +86,10 @@ void plSDL::VariableLengthWrite(hsStream* s, int size, int val) if (size < (1<<16)) { hsAssert(val < (1<<16), "SDL data loss"); - s->WriteSwap16(val); + s->WriteLE16(val); } else - s->WriteSwap32(val); + s->WriteLE32(val); } ///////////////////////////////////////////////////////////////////////////////// @@ -236,7 +236,7 @@ bool plStateDataRecord::IHasUsedVars(const VarsList& vars) const // bool plStateDataRecord::Read(hsStream* s, float timeConvert, UInt32 readOptions) { - fFlags = s->ReadSwap16(); + fFlags = s->ReadLE16(); UInt8 ioVersion = s->ReadByte(); if (ioVersion != kIOVersion) return false; @@ -343,7 +343,7 @@ void plStateDataRecord::Write(hsStream* s, float timeConvert, UInt32 writeOption } #endif - s->WriteSwap16((UInt16)fFlags); + s->WriteLE16((UInt16)fFlags); s->WriteByte(kIOVersion); // @@ -395,7 +395,7 @@ void plStateDataRecord::Write(hsStream* s, float timeConvert, UInt32 writeOption bool plStateDataRecord::ReadStreamHeader(hsStream* s, char** name, int* version, plUoid* objUoid) { UInt16 savFlags; - s->ReadSwap(&savFlags); + s->ReadLE(&savFlags); if (!(savFlags & plSDL::kAddedVarLengthIO)) // using to establish a new version in the header, can delete in 8/03 { *name = nil; @@ -403,7 +403,7 @@ bool plStateDataRecord::ReadStreamHeader(hsStream* s, char** name, int* version, } *name = s->ReadSafeString(); - *version = s->ReadSwap16(); + *version = s->ReadLE16(); if (objUoid) { @@ -433,9 +433,9 @@ void plStateDataRecord::WriteStreamHeader(hsStream* s, plUoid* objUoid) const if (objUoid) savFlags |= plSDL::kHasUoid; - s->WriteSwap(savFlags); + s->WriteLE(savFlags); s->WriteSafeString(GetDescriptor()->GetName()); - s->WriteSwap16((Int16)GetDescriptor()->GetVersion()); + s->WriteLE16((Int16)GetDescriptor()->GetVersion()); if (objUoid) objUoid->Write(s); } diff --git a/Sources/Plasma/PubUtilLib/plSDL/plStateDescriptor.cpp b/Sources/Plasma/PubUtilLib/plSDL/plStateDescriptor.cpp index 83b53541..0e4d69c5 100644 --- a/Sources/Plasma/PubUtilLib/plSDL/plStateDescriptor.cpp +++ b/Sources/Plasma/PubUtilLib/plSDL/plStateDescriptor.cpp @@ -86,7 +86,7 @@ plVarDescriptor* plStateDescriptor::FindVar(const char* name, int* idx) const bool plStateDescriptor::Read(hsStream* s) { UInt8 rwVersion; - s->ReadSwap(&rwVersion); + s->ReadLE(&rwVersion); if (rwVersion != kVersion) { plNetApp::StaticWarningMsg("StateDescriptor Read/Write version mismatch, mine %d, read %d", kVersion, rwVersion); @@ -98,10 +98,10 @@ bool plStateDescriptor::Read(hsStream* s) delete [] fName; fName = s->ReadSafeString(); - UInt16 version=s->ReadSwap16(); + UInt16 version=s->ReadLE16(); fVersion=version; - UInt16 numVars=s->ReadSwap16(); + UInt16 numVars=s->ReadLE16(); fVarsList.reserve(numVars); int i; @@ -126,15 +126,15 @@ bool plStateDescriptor::Read(hsStream* s) // void plStateDescriptor::Write(hsStream* s) const { - s->WriteSwap(kVersion); + s->WriteLE(kVersion); s->WriteSafeString(fName); UInt16 version=fVersion; - s->WriteSwap(version); + s->WriteLE(version); UInt16 numVars=fVarsList.size(); - s->WriteSwap(numVars); + s->WriteLE(numVars); VarsList::const_iterator it; for(it=fVarsList.begin(); it!=fVarsList.end(); it++) diff --git a/Sources/Plasma/PubUtilLib/plSDL/plStateVariable.cpp b/Sources/Plasma/PubUtilLib/plSDL/plStateVariable.cpp index b21ab0bb..2440534f 100644 --- a/Sources/Plasma/PubUtilLib/plSDL/plStateVariable.cpp +++ b/Sources/Plasma/PubUtilLib/plSDL/plStateVariable.cpp @@ -118,7 +118,7 @@ void plStateVarNotificationInfo::Read(hsStream* s, UInt32 readOptions) void plStateVarNotificationInfo::Write(hsStream* s, UInt32 writeOptions) const { UInt8 saveFlags=0; // unused - s->WriteSwap(saveFlags); + s->WriteLE(saveFlags); s->WriteSafeString(fHintString.c_str()); } @@ -128,7 +128,7 @@ void plStateVarNotificationInfo::Write(hsStream* s, UInt32 writeOptions) const bool plStateVariable::ReadData(hsStream* s, float timeConvert, UInt32 readOptions) { UInt8 saveFlags; - s->ReadSwap(&saveFlags); + s->ReadLE(&saveFlags); if (saveFlags & plSDL::kHasNotificationInfo) { GetNotificationInfo().Read(s, readOptions); @@ -144,7 +144,7 @@ bool plStateVariable::WriteData(hsStream* s, float timeConvert, UInt32 writeOpti if (writeNotificationInfo) saveFlags |= plSDL::kHasNotificationInfo; - s->WriteSwap(saveFlags); + s->WriteLE(saveFlags); if (writeNotificationInfo) { GetNotificationInfo().Write(s, writeOptions); @@ -1814,11 +1814,11 @@ bool plSimpleStateVariable::IWriteData(hsStream* s, float timeConvert, int idx, break; case plVarDescriptor::kInt: for(i=0;iWriteSwap32(fI[j+i]); + s->WriteLE32(fI[j+i]); break; case plVarDescriptor::kShort: for(i=0;iWriteSwap16(fS[j+i]); + s->WriteLE16(fS[j+i]); break; case plVarDescriptor::kByte: for(i=0;iWriteSwapScalar(fF[j+i]); + s->WriteLEScalar(fF[j+i]); break; case plVarDescriptor::kTime: for(i=0;iWriteSwapDouble(fD[j+i]); + s->WriteLEDouble(fD[j+i]); break; case plVarDescriptor::kBool: for(i=0;iWriteSwap16(cre ? cre->ClassIndex() : 0x8000); // creatable class index + s->WriteLE16(cre ? cre->ClassIndex() : 0x8000); // creatable class index if (cre) { hsRAMStream ramStream; cre->Write(&ramStream, hsgResMgr::ResMgr()); - s->WriteSwap32(ramStream.GetEOF()); // write length + s->WriteLE32(ramStream.GetEOF()); // write length cre->Write(s, hsgResMgr::ResMgr()); // write data } } @@ -1889,11 +1889,11 @@ bool plSimpleStateVariable::IReadData(hsStream* s, float timeConvert, int idx, U break; case plVarDescriptor::kInt: for(i=0;iReadSwap32(); + fI[j+i]=s->ReadLE32(); break; case plVarDescriptor::kShort: for(i=0;iReadSwap16(); + fS[j+i]=s->ReadLE16(); break; case plVarDescriptor::kByte: for(i=0;iReadSwapScalar(); + fF[j+i]=s->ReadLEScalar(); break; case plVarDescriptor::kTime: for(i=0;iReadSwapDouble(); + fD[j+i]=s->ReadLEDouble(); break; case plVarDescriptor::kBool: for(i=0;iReadSwap16(); // class index + UInt16 hClass = s->ReadLE16(); // class index if (hClass != 0x8000) { - UInt32 len = s->ReadSwap32(); // length + UInt32 len = s->ReadLE32(); // length if (plFactory::CanCreate(hClass)) { delete fC[j]; @@ -2007,7 +2007,7 @@ bool plSimpleStateVariable::WriteData(hsStream* s, float timeConvert, UInt32 wri if (sameAsDefaults) saveFlags |= plSDL::kSameAsDefault; - s->WriteSwap(saveFlags); + s->WriteLE(saveFlags); if (needTimeStamp) { // timestamp on write @@ -2024,7 +2024,7 @@ bool plSimpleStateVariable::WriteData(hsStream* s, float timeConvert, UInt32 wri { // list size if (GetVarDescriptor()->IsVariableLength()) - s->WriteSwap32(GetVarDescriptor()->GetCount()); // have to write out as long since we don't know how big the list is + s->WriteLE32(GetVarDescriptor()->GetCount()); // have to write out as long since we don't know how big the list is // list int i; @@ -2046,7 +2046,7 @@ bool plSimpleStateVariable::ReadData(hsStream* s, float timeConvert, UInt32 read ut.ToEpoch(); UInt8 saveFlags; - s->ReadSwap(&saveFlags); + s->ReadLE(&saveFlags); bool isDirty = ( saveFlags & plSDL::kHasDirtyFlag )!=0; bool setDirty = ( isDirty && ( readOptions & plSDL::kKeepDirty ) ) || ( readOptions & plSDL::kMakeDirty ); @@ -2068,7 +2068,7 @@ bool plSimpleStateVariable::ReadData(hsStream* s, float timeConvert, UInt32 read if (GetVarDescriptor()->IsVariableLength()) { UInt32 cnt; - s->ReadSwap(&cnt); // have to read as long since we don't know how big the list is + s->ReadLE(&cnt); // have to read as long since we don't know how big the list is if (cnt>=0 && cntReadSwap(&saveFlags); // unused + s->ReadLE(&saveFlags); // unused // read total list size if (GetVarDescriptor()->IsVariableLength()) { UInt32 total; - s->ReadSwap(&total); + s->ReadLE(&total); Resize(total); } @@ -2647,12 +2647,12 @@ bool plSDStateVariable::WriteData(hsStream* s, float timeConvert, UInt32 writeOp plStateVariable::WriteData(s, timeConvert, writeOptions); UInt8 saveFlags=0; // unused - s->WriteSwap(saveFlags); + s->WriteLE(saveFlags); // write total list size UInt32 total=GetCount(); if (GetVarDescriptor()->IsVariableLength()) - s->WriteSwap(total); + s->WriteLE(total); // write dirty list size bool dirtyOnly = (writeOptions & plSDL::kDirtyOnly) != 0; diff --git a/Sources/Plasma/PubUtilLib/plSDL/plVarDescriptor.cpp b/Sources/Plasma/PubUtilLib/plSDL/plVarDescriptor.cpp index 87542957..e76b36ed 100644 --- a/Sources/Plasma/PubUtilLib/plSDL/plVarDescriptor.cpp +++ b/Sources/Plasma/PubUtilLib/plSDL/plVarDescriptor.cpp @@ -169,7 +169,7 @@ void plVarDescriptor::CopyFrom(const plVarDescriptor* other) bool plVarDescriptor::Read(hsStream* s) { UInt8 version; - s->ReadSwap(&version); + s->ReadLE(&version); if (version != kVersion) { if (plSDLMgr::GetInstance()->GetNetApp()) @@ -183,14 +183,14 @@ bool plVarDescriptor::Read(hsStream* s) plMsgStdStringHelper::Peek(fDisplayOptions, s); - fCount=s->ReadSwap32(); + fCount=s->ReadLE32(); fType=(Type)s->ReadByte(); delete [] fDefault; fDefault = s->ReadSafeString(); - fFlags = s->ReadSwap32(); + fFlags = s->ReadLE32(); return true; } @@ -199,13 +199,13 @@ bool plVarDescriptor::Read(hsStream* s) // void plVarDescriptor::Write(hsStream* s) const { - s->WriteSwap(kVersion); + s->WriteLE(kVersion); s->WriteSafeString(fName); plMsgStdStringHelper::Poke(fDisplayOptions, s); - s->WriteSwap32(fCount); + s->WriteLE32(fCount); s->WriteByte((UInt8)fType); s->WriteSafeString(fDefault); - s->WriteSwap32(fFlags); + s->WriteLE32(fFlags); } ///////////////////////////////////////////////////////////////////////////////// @@ -363,7 +363,7 @@ bool plSimpleVarDescriptor::Read(hsStream* s) if (!plVarDescriptor::Read(s)) return false; - fAtomicCount=s->ReadSwap16(); + fAtomicCount=s->ReadLE16(); fAtomicType=(Type)s->ReadByte(); return true; } @@ -375,7 +375,7 @@ void plSimpleVarDescriptor::Write(hsStream* s) const { plVarDescriptor::Write(s); - s->WriteSwap16((Int16)fAtomicCount); + s->WriteLE16((Int16)fAtomicCount); s->WriteByte((UInt8)fAtomicType); } @@ -399,7 +399,7 @@ bool plSDVarDescriptor::Read(hsStream* s) return false; char* sdName=s->ReadSafeString(); - UInt16 version = s->ReadSwap16(); + UInt16 version = s->ReadLE16(); plStateDescriptor* sd=plSDLMgr::GetInstance()->FindDescriptor(sdName, version); hsAssert( sd, xtl::format("Failed to find sdl descriptor: %s,%d. Missing legacy descriptor?", sdName, version ).c_str() ); SetStateDesc(sd); @@ -416,5 +416,5 @@ void plSDVarDescriptor::Write(hsStream* s) const s->WriteSafeString(GetStateDescriptor()->GetName()); UInt16 version=GetStateDescriptor()->GetVersion(); - s->WriteSwap(version); + s->WriteLE(version); } diff --git a/Sources/Plasma/PubUtilLib/plScene/plCullPoly.cpp b/Sources/Plasma/PubUtilLib/plScene/plCullPoly.cpp index 8011c364..82f95558 100644 --- a/Sources/Plasma/PubUtilLib/plScene/plCullPoly.cpp +++ b/Sources/Plasma/PubUtilLib/plScene/plCullPoly.cpp @@ -131,15 +131,15 @@ plCullPoly& plCullPoly::Transform(const hsMatrix44& l2w, const hsMatrix44& w2l, void plCullPoly::Read(hsStream* s, hsResMgr* mgr) { - fFlags = s->ReadSwap32(); + fFlags = s->ReadLE32(); fNorm.Read(s); - fDist = s->ReadSwapScalar(); + fDist = s->ReadLEScalar(); fCenter.Read(s); - fRadius = s->ReadSwapScalar(); + fRadius = s->ReadLEScalar(); - int n = s->ReadSwap32(); + int n = s->ReadLE32(); fVerts.SetCount(n); int i; for( i = 0; i < n; i++ ) @@ -148,15 +148,15 @@ void plCullPoly::Read(hsStream* s, hsResMgr* mgr) void plCullPoly::Write(hsStream* s, hsResMgr* mgr) { - s->WriteSwap32(fFlags); + s->WriteLE32(fFlags); fNorm.Write(s); - s->WriteSwapScalar(fDist); + s->WriteLEScalar(fDist); fCenter.Write(s); - s->WriteSwapScalar(fRadius); + s->WriteLEScalar(fRadius); - s->WriteSwap32(fVerts.GetCount()); + s->WriteLE32(fVerts.GetCount()); int i; for( i = 0; i < fVerts.GetCount(); i++ ) fVerts[i].Write(s); diff --git a/Sources/Plasma/PubUtilLib/plScene/plOccluder.cpp b/Sources/Plasma/PubUtilLib/plScene/plOccluder.cpp index d2901e50..f9493bc6 100644 --- a/Sources/Plasma/PubUtilLib/plScene/plOccluder.cpp +++ b/Sources/Plasma/PubUtilLib/plScene/plOccluder.cpp @@ -287,10 +287,10 @@ void plOccluder::Read(hsStream* s, hsResMgr* mgr) plObjInterface::Read(s, mgr); fWorldBounds.Read(s); - fPriority = s->ReadSwapScalar(); + fPriority = s->ReadLEScalar(); hsTArray& localPolys = IGetLocalPolyList(); - UInt16 n = s->ReadSwap16(); + UInt16 n = s->ReadLE16(); localPolys.SetCount(n); int i; for( i = 0; i < n; i++ ) @@ -299,7 +299,7 @@ void plOccluder::Read(hsStream* s, hsResMgr* mgr) plKey nodeKey = mgr->ReadKey(s); ISetSceneNode(nodeKey); - n = s->ReadSwap16(); + n = s->ReadLE16(); fVisRegions.SetCountAndZero(n); for( i = 0; i < n; i++ ) mgr->ReadKeyNotifyMe(s, TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, 0, kRefVisRegion), plRefFlags::kActiveRef); @@ -310,17 +310,17 @@ void plOccluder::Write(hsStream* s, hsResMgr* mgr) plObjInterface::Write(s, mgr); fWorldBounds.Write(s); - s->WriteSwapScalar(fPriority); + s->WriteLEScalar(fPriority); const hsTArray& localPolys = IGetLocalPolyList(); - s->WriteSwap16(localPolys.GetCount()); + s->WriteLE16(localPolys.GetCount()); int i; for( i = 0; i < localPolys.GetCount(); i++ ) localPolys[i].Write(s, mgr); mgr->WriteKey(s, fSceneNode); - s->WriteSwap16(fVisRegions.GetCount()); + s->WriteLE16(fVisRegions.GetCount()); for( i = 0; i < fVisRegions.GetCount(); i++ ) mgr->WriteKey(s, fVisRegions[i]); } diff --git a/Sources/Plasma/PubUtilLib/plScene/plPostEffectMod.cpp b/Sources/Plasma/PubUtilLib/plScene/plPostEffectMod.cpp index d5dce6f5..3614ee09 100644 --- a/Sources/Plasma/PubUtilLib/plScene/plPostEffectMod.cpp +++ b/Sources/Plasma/PubUtilLib/plScene/plPostEffectMod.cpp @@ -300,10 +300,10 @@ void plPostEffectMod::Read(hsStream* s, hsResMgr* mgr) ISetEnable(true); #endif // FORCE ENABLE ON LOAD - ONLY FOR DEBUGGING - fHither = s->ReadSwapScalar(); - fYon = s->ReadSwapScalar(); - fFovX = s->ReadSwapScalar(); - fFovY = s->ReadSwapScalar(); + fHither = s->ReadLEScalar(); + fYon = s->ReadLEScalar(); + fFovX = s->ReadLEScalar(); + fFovY = s->ReadLEScalar(); fNodeKey = mgr->ReadKeyNotifyMe(s, TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, -1, kNodeRef), plRefFlags::kPassiveRef); @@ -319,10 +319,10 @@ void plPostEffectMod::Write(hsStream* s, hsResMgr* mgr) fState.Write(s); - s->WriteSwapScalar(fHither); - s->WriteSwapScalar(fYon); - s->WriteSwapScalar(fFovX); - s->WriteSwapScalar(fFovY); + s->WriteLEScalar(fHither); + s->WriteLEScalar(fYon); + s->WriteLEScalar(fFovX); + s->WriteLEScalar(fFovY); mgr->WriteKey(s, fNodeKey); diff --git a/Sources/Plasma/PubUtilLib/plScene/plRenderRequest.cpp b/Sources/Plasma/PubUtilLib/plScene/plRenderRequest.cpp index a9c5dcdb..34fa3b6c 100644 --- a/Sources/Plasma/PubUtilLib/plScene/plRenderRequest.cpp +++ b/Sources/Plasma/PubUtilLib/plScene/plRenderRequest.cpp @@ -90,28 +90,28 @@ void plRenderRequest::Read(hsStream* s, hsResMgr* mgr) fRenderTarget = nil; fPageMgr = nil; - fDrawableMask = s->ReadSwap32(); - fSubDrawableMask = s->ReadSwap32(); + fDrawableMask = s->ReadLE32(); + fSubDrawableMask = s->ReadLE32(); - fRenderState = s->ReadSwap32(); + fRenderState = s->ReadLE32(); fLocalToWorld.Read(s); fWorldToLocal.Read(s); - fPriority = s->ReadSwapScalar(); + fPriority = s->ReadLEScalar(); } void plRenderRequest::Write(hsStream* s, hsResMgr* mgr) { - s->WriteSwap32(fDrawableMask); - s->WriteSwap32(fSubDrawableMask); + s->WriteLE32(fDrawableMask); + s->WriteLE32(fSubDrawableMask); - s->WriteSwap32(fRenderState); + s->WriteLE32(fRenderState); fLocalToWorld.Write(s); fWorldToLocal.Write(s); - s->WriteSwapScalar(fPriority); + s->WriteLEScalar(fPriority); } void plRenderRequest::Render(plPipeline* pipe, plPageTreeMgr* pageMgr) diff --git a/Sources/Plasma/PubUtilLib/plScene/plSceneNode.cpp b/Sources/Plasma/PubUtilLib/plScene/plSceneNode.cpp index 103bd83d..18fa9668 100644 --- a/Sources/Plasma/PubUtilLib/plScene/plSceneNode.cpp +++ b/Sources/Plasma/PubUtilLib/plScene/plSceneNode.cpp @@ -99,7 +99,7 @@ void plSceneNode::Read(hsStream* s, hsResMgr* mgr) UInt32 n; int i; - n = s->ReadSwap32(); + n = s->ReadLE32(); fSceneObjects.Reset(); for( i = 0; i < n; i++ ) { @@ -107,7 +107,7 @@ void plSceneNode::Read(hsStream* s, hsResMgr* mgr) plKey key = mgr->ReadKeyNotifyMe(s, refMsg, plRefFlags::kActiveRef); } - n = s->ReadSwap32(); + n = s->ReadLE32(); fGenericPool.Reset(); for( i = 0; i < n; i++ ) { @@ -122,11 +122,11 @@ void plSceneNode::Write(hsStream* s, hsResMgr* mgr) int i; - s->WriteSwap32(fSceneObjects.GetCount()); + s->WriteLE32(fSceneObjects.GetCount()); for( i = 0; i < fSceneObjects.GetCount(); i++ ) mgr->WriteKey(s,fSceneObjects[i]); - s->WriteSwap32(fGenericPool.GetCount()); + s->WriteLE32(fGenericPool.GetCount()); for( i = 0; i < fGenericPool.GetCount(); i++ ) mgr->WriteKey(s, fGenericPool[i]); } diff --git a/Sources/Plasma/PubUtilLib/plStreamLogger/plStreamLogger.cpp b/Sources/Plasma/PubUtilLib/plStreamLogger/plStreamLogger.cpp index 3911dffe..77712839 100644 --- a/Sources/Plasma/PubUtilLib/plStreamLogger/plStreamLogger.cpp +++ b/Sources/Plasma/PubUtilLib/plStreamLogger/plStreamLogger.cpp @@ -176,7 +176,7 @@ char *hsReadOnlyLoggingStream::LogReadSafeString() { LogSubStreamStart("push me"); UInt16 numChars; - LogReadSwap(&numChars,"NumChars"); + LogReadLE(&numChars,"NumChars"); numChars &= ~0xf000; // XXX: remove when hsStream no longer does this. if (numChars > 0) @@ -200,7 +200,7 @@ char *hsReadOnlyLoggingStream::LogReadSafeStringLong() { LogSubStreamStart("push me"); UInt32 numChars; - LogReadSwap(&numChars,"NumChars"); + LogReadLE(&numChars,"NumChars"); if (numChars > 0) { char *name = TRACKED_NEW char[numChars+1]; diff --git a/Sources/Plasma/PubUtilLib/plStreamLogger/plStreamLogger.h b/Sources/Plasma/PubUtilLib/plStreamLogger/plStreamLogger.h index 1bd4fbe8..6e33f57c 100644 --- a/Sources/Plasma/PubUtilLib/plStreamLogger/plStreamLogger.h +++ b/Sources/Plasma/PubUtilLib/plStreamLogger/plStreamLogger.h @@ -98,13 +98,13 @@ public: #define LogSetList(l) LogVoidFunc() #else -#define LOG_READ_SWAP(type, enumtype) \ - void LogReadSwap(type* value, const char* desc) \ - { ILogEntryWaiting(); ReadSwap(value); LogEntry(plGenericType::enumtype,sizeof(type),value, desc);} +#define LOG_READ_LE(type, enumtype) \ + void LogReadLE(type* value, const char* desc) \ + { ILogEntryWaiting(); ReadLE(value); LogEntry(plGenericType::enumtype,sizeof(type),value, desc);} -#define LOG_READ_SWAP_ARRAY(type, enumtype) \ - void LogReadSwapV(int count, type values[], const char* desc) \ - { ILogEntryWaiting(); ReadSwap(count,values); int i; for (i=0; i < count; i++) LogEntry(plGenericType::enumtype,sizeof(type),&(values[i]), desc);} +#define LOG_READ_LE_ARRAY(type, enumtype) \ + void LogReadLEV(int count, type values[], const char* desc) \ + { ILogEntryWaiting(); ReadLE(count,values); int i; for (i=0; i < count; i++) LogEntry(plGenericType::enumtype,sizeof(type),&(values[i]), desc);} class hsReadOnlyLoggingStream : public hsReadOnlyStream, public plStreamLogger { @@ -127,29 +127,29 @@ public: void LogSubStreamEnd(); void LogSubStreamPushDesc(const char* desc); - LOG_READ_SWAP(bool, kBool) - LOG_READ_SWAP(UInt8, kUInt) - LOG_READ_SWAP(UInt16, kUInt) - LOG_READ_SWAP(UInt32, kUInt) - LOG_READ_SWAP_ARRAY(UInt8, kUInt) - LOG_READ_SWAP_ARRAY(UInt16, kUInt) - LOG_READ_SWAP_ARRAY(UInt32, kUInt) - - LOG_READ_SWAP(Int8, kInt) - LOG_READ_SWAP(char, kChar) - LOG_READ_SWAP(Int16, kInt) - LOG_READ_SWAP(Int32, kInt) - LOG_READ_SWAP(int, kInt) - LOG_READ_SWAP_ARRAY(Int8, kInt) - LOG_READ_SWAP_ARRAY(char, kChar) - LOG_READ_SWAP_ARRAY(Int16, kInt) - LOG_READ_SWAP_ARRAY(Int32, kInt) - LOG_READ_SWAP_ARRAY(int, kInt) - - LOG_READ_SWAP(float, kFloat) - LOG_READ_SWAP(double, kDouble) - LOG_READ_SWAP_ARRAY(float, kFloat) - LOG_READ_SWAP_ARRAY(double, kDouble) + LOG_READ_LE(bool, kBool) + LOG_READ_LE(UInt8, kUInt) + LOG_READ_LE(UInt16, kUInt) + LOG_READ_LE(UInt32, kUInt) + LOG_READ_LE_ARRAY(UInt8, kUInt) + LOG_READ_LE_ARRAY(UInt16, kUInt) + LOG_READ_LE_ARRAY(UInt32, kUInt) + + LOG_READ_LE(Int8, kInt) + LOG_READ_LE(char, kChar) + LOG_READ_LE(Int16, kInt) + LOG_READ_LE(Int32, kInt) + LOG_READ_LE(int, kInt) + LOG_READ_LE_ARRAY(Int8, kInt) + LOG_READ_LE_ARRAY(char, kChar) + LOG_READ_LE_ARRAY(Int16, kInt) + LOG_READ_LE_ARRAY(Int32, kInt) + LOG_READ_LE_ARRAY(int, kInt) + + LOG_READ_LE(float, kFloat) + LOG_READ_LE(double, kDouble) + LOG_READ_LE_ARRAY(float, kFloat) + LOG_READ_LE_ARRAY(double, kDouble) }; diff --git a/Sources/Plasma/PubUtilLib/plSurface/hsGMaterial.cpp b/Sources/Plasma/PubUtilLib/plSurface/hsGMaterial.cpp index aecc31cf..fc738d65 100644 --- a/Sources/Plasma/PubUtilLib/plSurface/hsGMaterial.cpp +++ b/Sources/Plasma/PubUtilLib/plSurface/hsGMaterial.cpp @@ -219,22 +219,22 @@ void hsGMaterial::SetLayer(plLayerInterface* layer, Int32 which, hsBool insert, void hsGMaterial::Write(hsStream* s) { - s->WriteSwap32(fLoadFlags); - s->WriteSwap32(fCompFlags); + s->WriteLE32(fLoadFlags); + s->WriteLE32(fCompFlags); - s->WriteSwap32(GetNumLayers()); - s->WriteSwap32(GetNumPiggyBacks()); + s->WriteLE32(GetNumLayers()); + s->WriteLE32(GetNumPiggyBacks()); } void hsGMaterial::Read(hsStream* s) { - fLoadFlags = s->ReadSwap32(); - fCompFlags = s->ReadSwap32(); + fLoadFlags = s->ReadLE32(); + fCompFlags = s->ReadLE32(); IClearLayers(); - int n = s->ReadSwap32(); + int n = s->ReadLE32(); fLayers.SetCountAndZero(n); - n = s->ReadSwap32(); + n = s->ReadLE32(); fPiggyBacks.SetCountAndZero(n); } diff --git a/Sources/Plasma/PubUtilLib/plSurface/plGrassShaderMod.cpp b/Sources/Plasma/PubUtilLib/plSurface/plGrassShaderMod.cpp index aa79249b..21462f6d 100644 --- a/Sources/Plasma/PubUtilLib/plSurface/plGrassShaderMod.cpp +++ b/Sources/Plasma/PubUtilLib/plSurface/plGrassShaderMod.cpp @@ -65,22 +65,22 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com void plGrassWave::Write(hsStream *s) { - s->WriteSwapScalar(fDistX); - s->WriteSwapScalar(fDistY); - s->WriteSwapScalar(fDistZ); - s->WriteSwapScalar(fDirX); - s->WriteSwapScalar(fDirY); - s->WriteSwapScalar(fSpeed); + s->WriteLEScalar(fDistX); + s->WriteLEScalar(fDistY); + s->WriteLEScalar(fDistZ); + s->WriteLEScalar(fDirX); + s->WriteLEScalar(fDirY); + s->WriteLEScalar(fSpeed); } void plGrassWave::Read(hsStream *s) { - fDistX = s->ReadSwapScalar(); - fDistY = s->ReadSwapScalar(); - fDistZ = s->ReadSwapScalar(); - fDirX = s->ReadSwapScalar(); - fDirY = s->ReadSwapScalar(); - fSpeed = s->ReadSwapScalar(); + fDistX = s->ReadLEScalar(); + fDistY = s->ReadLEScalar(); + fDistZ = s->ReadLEScalar(); + fDirX = s->ReadLEScalar(); + fDirY = s->ReadLEScalar(); + fSpeed = s->ReadLEScalar(); } ///////////////////////////////////////////////////////////////////////////////////////////// diff --git a/Sources/Plasma/PubUtilLib/plSurface/plLayer.cpp b/Sources/Plasma/PubUtilLib/plSurface/plLayer.cpp index f42c494f..2d38d408 100644 --- a/Sources/Plasma/PubUtilLib/plSurface/plLayer.cpp +++ b/Sources/Plasma/PubUtilLib/plSurface/plLayer.cpp @@ -123,10 +123,10 @@ void plLayer::Read(hsStream* s, hsResMgr* mgr) fAmbientColor->Read(s); fSpecularColor->Read( s ); - *fUVWSrc = s->ReadSwap32(); - *fOpacity = s->ReadSwapScalar(); - *fLODBias = s->ReadSwapScalar(); - *fSpecularPower = s->ReadSwapScalar(); + *fUVWSrc = s->ReadLE32(); + *fOpacity = s->ReadLEScalar(); + *fLODBias = s->ReadLEScalar(); + *fSpecularPower = s->ReadLEScalar(); plLayRefMsg* refMsg = TRACKED_NEW plLayRefMsg(GetKey(), plRefMsg::kOnCreate, 0, plLayRefMsg::kTexture); mgr->ReadKeyNotifyMe(s,refMsg, plRefFlags::kActiveRef); @@ -154,10 +154,10 @@ void plLayer::Write(hsStream* s, hsResMgr* mgr) fAmbientColor->Write(s); fSpecularColor->Write( s ); - s->WriteSwap32(*fUVWSrc); - s->WriteSwapScalar(*fOpacity); - s->WriteSwapScalar(*fLODBias); - s->WriteSwapScalar(*fSpecularPower); + s->WriteLE32(*fUVWSrc); + s->WriteLEScalar(*fOpacity); + s->WriteLEScalar(*fLODBias); + s->WriteLEScalar(*fSpecularPower); mgr->WriteKey(s, GetTexture()); diff --git a/Sources/Plasma/PubUtilLib/plSurface/plLayerMultiply.cpp b/Sources/Plasma/PubUtilLib/plSurface/plLayerMultiply.cpp index c6d182b0..7f39a6c5 100644 --- a/Sources/Plasma/PubUtilLib/plSurface/plLayerMultiply.cpp +++ b/Sources/Plasma/PubUtilLib/plSurface/plLayerMultiply.cpp @@ -57,11 +57,11 @@ void plLayerMultiply::Read(hsStream* s, hsResMgr* mgr) { plLayerInterface::Read(s, mgr); - fOwnedChannels = s->ReadSwap32(); + fOwnedChannels = s->ReadLE32(); if (fOwnedChannels & kOpacity) { fOpacity = TRACKED_NEW hsScalar; - *fOpacity = fSrcOpacity = s->ReadSwapScalar(); + *fOpacity = fSrcOpacity = s->ReadLEScalar(); fDirtyChannels |= kOpacity; } @@ -102,9 +102,9 @@ void plLayerMultiply::Write(hsStream* s, hsResMgr* mgr) { plLayerInterface::Write(s, mgr); - s->WriteSwap32(fOwnedChannels); + s->WriteLE32(fOwnedChannels); if (fOwnedChannels & kOpacity) - s->WriteSwapScalar(fSrcOpacity); + s->WriteLEScalar(fSrcOpacity); if (fOwnedChannels & kPreshadeColor) fSrcPreshadeColor.Write(s); diff --git a/Sources/Plasma/PubUtilLib/plSurface/plShader.cpp b/Sources/Plasma/PubUtilLib/plSurface/plShader.cpp index 0fe20241..312bcc75 100644 --- a/Sources/Plasma/PubUtilLib/plSurface/plShader.cpp +++ b/Sources/Plasma/PubUtilLib/plSurface/plShader.cpp @@ -55,18 +55,18 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // Little shader const helper void plShaderConst::Read(hsStream* s) { - fX = s->ReadSwapScalar(); - fY = s->ReadSwapScalar(); - fZ = s->ReadSwapScalar(); - fW = s->ReadSwapScalar(); + fX = s->ReadLEScalar(); + fY = s->ReadLEScalar(); + fZ = s->ReadLEScalar(); + fW = s->ReadLEScalar(); } void plShaderConst::Write(hsStream* s) { - s->WriteSwapScalar(fX); - s->WriteSwapScalar(fY); - s->WriteSwapScalar(fZ); - s->WriteSwapScalar(fW); + s->WriteLEScalar(fX); + s->WriteLEScalar(fY); + s->WriteLEScalar(fZ); + s->WriteLEScalar(fW); } ////////////////////////////////////////////////////////////////////////////////// @@ -287,13 +287,13 @@ void plShader::Read(hsStream* s, hsResMgr* mgr) hsKeyedObject::Read(s, mgr); - UInt32 n = s->ReadSwap32(); + UInt32 n = s->ReadLE32(); fConsts.SetCount(n); int i; for( i = 0; i < n; i++ ) fConsts[i].Read(s); - plShaderID::ID id = plShaderID::ID(s->ReadSwap32()); + plShaderID::ID id = plShaderID::ID(s->ReadLE32()); SetDecl(plShaderTable::Decl(id)); fInput = s->ReadByte(); @@ -304,12 +304,12 @@ void plShader::Write(hsStream* s, hsResMgr* mgr) { hsKeyedObject::Write(s, mgr); - s->WriteSwap32(fConsts.GetCount()); + s->WriteLE32(fConsts.GetCount()); int i; for( i = 0; i < fConsts.GetCount(); i++ ) fConsts[i].Write(s); - s->WriteSwap32(fDecl->GetID()); + s->WriteLE32(fDecl->GetID()); s->WriteByte(fInput); s->WriteByte(fOutput); diff --git a/Sources/Plasma/PubUtilLib/plTransform/hsAffineParts.cpp b/Sources/Plasma/PubUtilLib/plTransform/hsAffineParts.cpp index a1fee2eb..9ee5c99e 100644 --- a/Sources/Plasma/PubUtilLib/plTransform/hsAffineParts.cpp +++ b/Sources/Plasma/PubUtilLib/plTransform/hsAffineParts.cpp @@ -426,7 +426,7 @@ void hsAffineParts::Read(hsStream *stream) fQ.Read(stream); fU.Read(stream); fK.Read(stream); - fF = stream->ReadSwapFloat(); + fF = stream->ReadLEFloat(); } // @@ -438,5 +438,5 @@ void hsAffineParts::Write(hsStream *stream) fQ.Write(stream); fU.Write(stream); fK.Write(stream); - stream->WriteSwapFloat(fF); + stream->WriteLEFloat(fF); } diff --git a/Sources/Plasma/PubUtilLib/plUnifiedTime/plUnifiedTime.cpp b/Sources/Plasma/PubUtilLib/plUnifiedTime/plUnifiedTime.cpp index c348b195..e1302d01 100644 --- a/Sources/Plasma/PubUtilLib/plUnifiedTime/plUnifiedTime.cpp +++ b/Sources/Plasma/PubUtilLib/plUnifiedTime/plUnifiedTime.cpp @@ -381,17 +381,17 @@ void plUnifiedTime::Read(hsStream* s) { s->LogSubStreamStart("UnifiedTime"); UInt32 secs; - s->LogReadSwap(&secs,"Seconds"); + s->LogReadLE(&secs,"Seconds"); fSecs = (time_t)secs; - s->LogReadSwap(&fMicros,"MicroSeconds"); + s->LogReadLE(&fMicros,"MicroSeconds"); s->LogSubStreamEnd(); // preserve fMode } void plUnifiedTime::Write(hsStream* s) const { - s->WriteSwap((UInt32)fSecs); - s->WriteSwap(fMicros); + s->WriteLE((UInt32)fSecs); + s->WriteLE(fMicros); // preserve fMode } diff --git a/Sources/Plasma/PubUtilLib/plVault/plDniCoordinateInfo.cpp b/Sources/Plasma/PubUtilLib/plVault/plDniCoordinateInfo.cpp index f0c065d9..93628d3d 100644 --- a/Sources/Plasma/PubUtilLib/plVault/plDniCoordinateInfo.cpp +++ b/Sources/Plasma/PubUtilLib/plVault/plDniCoordinateInfo.cpp @@ -74,21 +74,21 @@ void plDniCoordinateInfo::CopyFrom( const plDniCoordinateInfo * other ) void plDniCoordinateInfo::Read( hsStream* s, hsResMgr* mgr ) { UInt8 streamVer; - s->ReadSwap( &streamVer ); + s->ReadLE( &streamVer ); if ( streamVer==StreamVersion ) { - s->ReadSwap( &fHSpans ); - s->ReadSwap( &fVSpans ); - s->ReadSwap( &fTorans ); + s->ReadLE( &fHSpans ); + s->ReadLE( &fVSpans ); + s->ReadLE( &fTorans ); } } void plDniCoordinateInfo::Write( hsStream* s, hsResMgr* mgr ) { - s->WriteSwap( StreamVersion ); - s->WriteSwap( fHSpans ); - s->WriteSwap( fVSpans ); - s->WriteSwap( fTorans ); + s->WriteLE( StreamVersion ); + s->WriteLE( fHSpans ); + s->WriteLE( fVSpans ); + s->WriteLE( fTorans ); } std::string plDniCoordinateInfo::AsStdString( int level ) const