Update of /cvsroot/plib/plib/src/ssg
In directory sc8-pr-cvs1:/tmp/cvs-serv3590/plib/src/ssg
Modified Files:
ssgLoadFLT.cxx ssgLoadMDL.cxx ssgSaveFLT.cxx
Log Message:
Committed numerous patches from 3rd parties:
Added JS support for Mac OS-X.
Removed JS support for HPUX.
Fixes for IRIX sound support.
Compile problems fixed in ul.h.
Load/Save FLT fixed to include byte-swapping.
Several fixes to MDL loader.
Fixed 'frozen particle' bug in ssgaParticleSystem.
Index: ssgLoadFLT.cxx
===================================================================
RCS file: /cvsroot/plib/plib/src/ssg/ssgLoadFLT.cxx,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -d -r1.36 -r1.37
--- ssgLoadFLT.cxx 12 Dec 2002 15:25:48 -0000 1.36
+++ ssgLoadFLT.cxx 4 Jan 2003 02:55:55 -0000 1.37
@@ -167,7 +167,6 @@
#if !defined(BYTE_ORDER) || BYTE_ORDER != BIG_ENDIAN
-#if !defined(BYTE_ORDER)
static void _swab16(const void *src, void *dst, int n)
{
ushort *s = (ushort *)src;
@@ -178,7 +177,6 @@
((t & 0x00ffU) << 8));
}
}
-#endif
static void _swab32(const void *src, void *dst, int n)
{
Index: ssgLoadMDL.cxx
===================================================================
RCS file: /cvsroot/plib/plib/src/ssg/ssgLoadMDL.cxx,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -d -r1.43 -r1.44
--- ssgLoadMDL.cxx 2 Sep 2002 06:05:48 -0000 1.43
+++ ssgLoadMDL.cxx 4 Jan 2003 02:55:55 -0000 1.44
@@ -732,10 +732,11 @@
// Find beginning of BGL Code segment
unsigned short op1, op2;
- fread(&op1, 2, 1, fp);
+ op1 = ulEndianReadLittle16(fp);
+
while(!feof(fp))
{
- fread(&op2, 2, 1, fp);
+ op2 = ulEndianReadLittle16(fp);
if(op1 == 0x76 && op2 == 0x3a)
{
fseek(fp, -4, SEEK_CUR);
@@ -784,8 +785,7 @@
while(!feof(fp) && !done)
{
unsigned int skip_offset = 0;
- unsigned short opcode;
- fread(&opcode, 2, 1, fp);
+ unsigned short opcode = ulEndianReadLittle16(fp);
DEBUGPRINT( "opcode = " << std::hex << opcode << std::dec << std::endl );
@@ -1437,8 +1437,7 @@
case 0x03:
{
//DEBUGPRINT( "BGL_CASE\n" );
- unsigned short number_cases;
- fread(&number_cases, 2, 1, fp);
+ unsigned short number_cases = ulEndianReadLittle16(fp);
skip_offset = 6 + 2 * number_cases;
}
break;
Index: ssgSaveFLT.cxx
===================================================================
RCS file: /cvsroot/plib/plib/src/ssg/ssgSaveFLT.cxx,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- ssgSaveFLT.cxx 29 Oct 2002 23:39:09 -0000 1.3
+++ ssgSaveFLT.cxx 4 Jan 2003 02:55:55 -0000 1.4
@@ -355,10 +355,12 @@
static void writeLeaf ( ssgLeaf *leaf )
{
+ int i ;
+
writeObject () ;
writePush () ;
- for ( int i = 0 ; i < leaf -> getNumLines () ; i++ )
+ for ( i = 0 ; i < leaf -> getNumLines () ; i++ )
{
writeFace ( leaf, TRUE ) ;
@@ -384,7 +386,7 @@
writePop () ;
}
- for ( int i = 0 ; i < leaf -> getNumTriangles () ; i++ )
+ for ( i = 0 ; i < leaf -> getNumTriangles () ; i++ )
{
writeFace ( leaf, FALSE ) ;
|