Commit 128a9af3 authored by Dipl.-Ing. Jonas Stienen's avatar Dipl.-Ing. Jonas Stienen
Browse files

Restructuring method impls

parent 187257d6
......@@ -490,7 +490,7 @@ void CVANetMessage::WriteException( const CVAException& oException )
// (returns number of bytes read if successfull, otherwise -1)
CVAException CVANetMessage::ReadException()
{
int nType = ReadInt();
const int nType = ReadInt();
return CVAException( nType, ReadString() );
}
......@@ -791,6 +791,20 @@ void CVANetMessage::WriteAudioRenderingModuleInfo( const CVAAudioRendererInfo& o
WriteVAStruct( oRenderer.oParams );
}
CVAAudioRendererInfo CVANetMessage::ReadAudioRenderingModuleInfo()
{
CVAAudioRendererInfo oRenderer;
oRenderer.sID = ReadString();
oRenderer.sClass = ReadString();
oRenderer.sDescription = ReadString();
oRenderer.bEnabled = ReadBool();
oRenderer.bOutputDetectorEnabled = ReadBool();
oRenderer.bOutputRecordingEnabled = ReadBool();
oRenderer.sOutputRecordingFilePath = ReadString();
ReadVAStruct( oRenderer.oParams );
return oRenderer;
}
void CVANetMessage::WriteAudioReproductionModuleInfo( const CVAAudioReproductionInfo& oRepro )
{
WriteString( oRepro.sID );
......@@ -806,6 +820,23 @@ void CVANetMessage::WriteAudioReproductionModuleInfo( const CVAAudioReproduction
WriteVAStruct( oRepro.oParams );
}
CVAAudioReproductionInfo CVANetMessage::ReadAudioReproductionModuleInfo()
{
CVAAudioReproductionInfo oRepro;
oRepro.sID = ReadString();
oRepro.sClass = ReadString();
oRepro.sDescription = ReadString();
oRepro.bEnabled = ReadBool();
oRepro.bInputDetectorEnabled = ReadBool();
oRepro.bInputRecordingEnabled = ReadBool();
oRepro.sInputRecordingFilePath = ReadString();
oRepro.bOutputDetectorEnabled = ReadBool();
oRepro.bOutputRecordingEnabled = ReadBool();
oRepro.sOutputRecordingFilePath = ReadString();
ReadVAStruct( oRepro.oParams );
return oRepro;
}
void CVANetMessage::WriteSoundSourceInfo( const CVASoundSourceInfo& oInfo )
{
WriteBool( oInfo.bMuted );
......@@ -822,6 +853,24 @@ void CVANetMessage::WriteSoundSourceInfo( const CVASoundSourceInfo& oInfo )
WriteVec3( oInfo.v3View );
}
CVASoundSourceInfo CVANetMessage::ReadSoundSourceInfo()
{
CVASoundSourceInfo oInfo;
oInfo.bMuted = ReadBool();
oInfo.dSpoundPower = ReadDouble();
oInfo.iAuraMode = ReadInt();
oInfo.iDirectivityID = ReadInt();
oInfo.iID = ReadInt();
oInfo.iSignalSourceID = ReadInt();
ReadVAStruct( oInfo.oParams );
oInfo.qOrient = ReadQuat();
oInfo.sName = ReadString();
oInfo.v3Pos = ReadVec3();
oInfo.v3Up = ReadVec3();
oInfo.v3View = ReadVec3();
return oInfo;
}
void CVANetMessage::WriteSoundReceiverInfo( const CVASoundReceiverInfo& oInfo )
{
WriteInt( oInfo.iID );
......@@ -843,80 +892,6 @@ void CVANetMessage::WriteSoundReceiverInfo( const CVASoundReceiverInfo& oInfo )
WriteVAStruct( oInfo.oParams );
}
void CVANetMessage::WriteSoundPortalInfo( const CVASoundPortalInfo& oInfo )
{
WriteBool( oInfo.bEnabled );
WriteInt( oInfo.iMaterialID );
WriteInt( oInfo.iNextPortalID );
WriteInt( oInfo.iSoundReceiverID );
WriteInt( oInfo.iID );
WriteInt( oInfo.iSoundSourceID );
WriteVAStruct( oInfo.oParams );
WriteQuat( oInfo.qOrient );
WriteString( oInfo.sName );
WriteVec3( oInfo.v3Pos );
WriteVec3( oInfo.v3View );
WriteVec3( oInfo.v3Up );
}
void CVANetMessage::WriteGeometryMesh( const CVAGeometryMesh& oMesh )
{
WriteBool( oMesh.bEnabled );
WriteInt( oMesh.iID );
WriteVAStruct( oMesh.oParams );
WriteInt( int( oMesh.voFaces.size() ) );
for( size_t i = 0; i < oMesh.voFaces.size(); i++ )
WriteGeometryMeshFace( ( oMesh.voFaces[ i ] ) );
WriteInt( int( oMesh.voVertices.size() ) );
for( size_t i = 0; i < oMesh.voVertices.size(); i++ )
WriteGeometryMeshVertex( oMesh.voVertices[ i ] );
}
void CVANetMessage::WriteGeometryMeshFace( const CVAGeometryMesh::CVAFace & oFace )
{
WriteInt( oFace.iID );
WriteInt( oFace.iMaterialID );
WriteInt( int( oFace.viVertexList.size() ) );
for( size_t i = 0; i < oFace.viVertexList.size(); i++ )
WriteInt( oFace.viVertexList[ i ] );
}
void CVANetMessage::WriteGeometryMeshVertex( const CVAGeometryMesh::CVAVertex & oVertex )
{
WriteInt( oVertex.iID );
WriteVec3( oVertex.v3Point );
}
CVAAudioRendererInfo CVANetMessage::ReadAudioRenderingModuleInfo()
{
CVAAudioRendererInfo oRenderer;
oRenderer.sID = ReadString();
oRenderer.sClass = ReadString();
oRenderer.sDescription = ReadString();
oRenderer.bEnabled = ReadBool();
oRenderer.bOutputDetectorEnabled = ReadBool();
oRenderer.bOutputRecordingEnabled = ReadBool();
oRenderer.sOutputRecordingFilePath = ReadString();
ReadVAStruct( oRenderer.oParams );
return oRenderer;
}
CVAAudioReproductionInfo CVANetMessage::ReadAudioReproductionModuleInfo()
{
CVAAudioReproductionInfo oRepro;
oRepro.sID = ReadString();
oRepro.sClass = ReadString();
oRepro.sDescription = ReadString();
oRepro.bEnabled = ReadBool();
oRepro.bInputDetectorEnabled = ReadBool();
oRepro.bInputRecordingEnabled = ReadBool();
oRepro.sInputRecordingFilePath = ReadString();
oRepro.bOutputDetectorEnabled = ReadBool();
oRepro.bOutputRecordingEnabled = ReadBool();
oRepro.sOutputRecordingFilePath = ReadString();
ReadVAStruct( oRepro.oParams );
return oRepro;
}
CVASoundReceiverInfo CVANetMessage::ReadSoundReceiverInfo()
{
CVASoundReceiverInfo oInfo;
......@@ -940,22 +915,20 @@ CVASoundReceiverInfo CVANetMessage::ReadSoundReceiverInfo()
return oInfo;
}
CVASoundSourceInfo CVANetMessage::ReadSoundSourceInfo()
void CVANetMessage::WriteSoundPortalInfo( const CVASoundPortalInfo& oInfo )
{
CVASoundSourceInfo oInfo;
oInfo.bMuted = ReadBool();
oInfo.dSpoundPower = ReadDouble();
oInfo.iAuraMode = ReadInt();
oInfo.iDirectivityID = ReadInt();
oInfo.iID = ReadInt();
oInfo.iSignalSourceID = ReadInt();
ReadVAStruct( oInfo.oParams );
oInfo.qOrient = ReadQuat();
oInfo.sName = ReadString();
oInfo.v3Pos = ReadVec3();
oInfo.v3Up = ReadVec3();
oInfo.v3View = ReadVec3();
return oInfo;
WriteBool( oInfo.bEnabled );
WriteInt( oInfo.iMaterialID );
WriteInt( oInfo.iNextPortalID );
WriteInt( oInfo.iSoundReceiverID );
WriteInt( oInfo.iID );
WriteInt( oInfo.iSoundSourceID );
WriteVAStruct( oInfo.oParams );
WriteQuat( oInfo.qOrient );
WriteString( oInfo.sName );
WriteVec3( oInfo.v3Pos );
WriteVec3( oInfo.v3View );
WriteVec3( oInfo.v3Up );
}
CVASoundPortalInfo CVANetMessage::ReadSoundPortalInfo()
......@@ -976,6 +949,19 @@ CVASoundPortalInfo CVANetMessage::ReadSoundPortalInfo()
return oInfo;
}
void CVANetMessage::WriteGeometryMesh( const CVAGeometryMesh& oMesh )
{
WriteBool( oMesh.bEnabled );
WriteInt( oMesh.iID );
WriteVAStruct( oMesh.oParams );
WriteInt( int( oMesh.voFaces.size() ) );
for( size_t i = 0; i < oMesh.voFaces.size(); i++ )
WriteGeometryMeshFace( ( oMesh.voFaces[ i ] ) );
WriteInt( int( oMesh.voVertices.size() ) );
for( size_t i = 0; i < oMesh.voVertices.size(); i++ )
WriteGeometryMeshVertex( oMesh.voVertices[ i ] );
}
CVAGeometryMesh CVANetMessage::ReadGeometryMesh()
{
CVAGeometryMesh oMesh;
......@@ -991,6 +977,15 @@ CVAGeometryMesh CVANetMessage::ReadGeometryMesh()
return oMesh;
}
void CVANetMessage::WriteGeometryMeshFace( const CVAGeometryMesh::CVAFace & oFace )
{
WriteInt( oFace.iID );
WriteInt( oFace.iMaterialID );
WriteInt( int( oFace.viVertexList.size() ) );
for( size_t i = 0; i < oFace.viVertexList.size(); i++ )
WriteInt( oFace.viVertexList[ i ] );
}
CVAGeometryMesh::CVAFace CVANetMessage::ReadGeometryMeshFace()
{
CVAGeometryMesh::CVAFace oFace;
......@@ -1002,6 +997,12 @@ CVAGeometryMesh::CVAFace CVANetMessage::ReadGeometryMeshFace()
return oFace;
}
void CVANetMessage::WriteGeometryMeshVertex( const CVAGeometryMesh::CVAVertex & oVertex )
{
WriteInt( oVertex.iID );
WriteVec3( oVertex.v3Point );
}
CVAGeometryMesh::CVAVertex CVANetMessage::ReadGeometryMeshVertex()
{
CVAGeometryMesh::CVAVertex oVertex;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment