1
0
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-17 10:52:46 +00:00

Fix Endian functions names in hsTypes and hsStream.

Function and macro names for endianness were previously vague,
and on big-endian systems entirely misleading.  The names are
now properly descriptive of what they actually do.
This commit is contained in:
2011-10-23 14:01:54 -07:00
committed by Darryl Pogue
parent ab37a4a486
commit e462ef04b3
255 changed files with 2676 additions and 2676 deletions

View File

@ -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);
}

View File

@ -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: