mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-15 10:54:18 +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:
@ -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 )
|
||||
|
@ -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 );
|
||||
}
|
||||
|
||||
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -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));
|
||||
|
@ -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 ] );
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user