From Glenn Waldrom, addition of .ive support for PriorityOffset and PriorityScale.
This commit is contained in:
parent
c67e74f2f6
commit
7f101c37ad
@ -23,9 +23,10 @@
|
||||
#define VERSION_0012 12
|
||||
#define VERSION_0013 13
|
||||
#define VERSION_0014 14
|
||||
#define VERSION_0015 15
|
||||
|
||||
#define VERSION VERSION_0014
|
||||
|
||||
//#define VERSION VERSION_0014
|
||||
#define VERSION VERSION_0015
|
||||
|
||||
/* The BYTE_SEX tag is used to check the endian
|
||||
of the IVE file being read in. The IVE format
|
||||
|
@ -82,6 +82,25 @@ void PagedLOD::write(DataOutputStream* out)
|
||||
for(i=0;i<size;i++){
|
||||
out->writeString(getFileName(i));
|
||||
}
|
||||
|
||||
// PagedLOD priority settings
|
||||
// 2006/03/10 GW
|
||||
if ( out->getVersion() >= VERSION_0015 )
|
||||
{
|
||||
size = getNumPriorityOffsets();
|
||||
out->writeInt( size );
|
||||
for(int i=0; i<size; i++)
|
||||
{
|
||||
out->writeFloat( getPriorityOffset( i ) );
|
||||
}
|
||||
|
||||
size = getNumPriorityScales();
|
||||
out->writeInt( size );
|
||||
for( int i=0; i<size; i++ )
|
||||
{
|
||||
out->writeFloat( getPriorityScale( i ) );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void PagedLOD::read(DataInputStream* in)
|
||||
@ -148,6 +167,29 @@ void PagedLOD::read(DataInputStream* in)
|
||||
for(i=0;i<size;i++){
|
||||
setFileName(i, in->readString());
|
||||
}
|
||||
|
||||
|
||||
// PagedLOD priority settings
|
||||
// 2006/03/10 GW
|
||||
if ( in->getVersion() >= VERSION_0015 )
|
||||
{
|
||||
// priority offsets:
|
||||
size = in->readInt();
|
||||
for( int i=0; i<size; i++ )
|
||||
{
|
||||
float pri_offset = in->readFloat();
|
||||
setPriorityOffset( i, pri_offset );
|
||||
}
|
||||
|
||||
// priority scales:
|
||||
size = in->readInt();
|
||||
for( int i=0; i<size; i++ )
|
||||
{
|
||||
float pri_scale = in->readFloat();
|
||||
setPriorityScale( i, pri_scale );
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
else{
|
||||
throw Exception("LOD::read(): Expected LOD identification.");
|
||||
|
Loading…
Reference in New Issue
Block a user