[wpdev-commits] wolfpack/muls maps.cpp,1.5,1.6 multiscache.cpp,1.5,1.6
Brought to you by:
rip,
thiagocorrea
From: Correa <thi...@us...> - 2004-08-10 03:20:43
|
Update of /cvsroot/wpdev/wolfpack/muls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18793 Modified Files: maps.cpp multiscache.cpp Log Message: applied coding standard rules. Index: maps.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/muls/maps.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** maps.cpp 4 Aug 2004 23:17:38 -0000 1.5 --- maps.cpp 10 Aug 2004 03:20:29 -0000 1.6 *************** *** 49,53 **** #pragma pack (1) ! struct stIndexRecord { unsigned int offset; unsigned int blocklength; --- 49,54 ---- #pragma pack (1) ! struct stIndexRecord ! { unsigned int offset; unsigned int blocklength; *************** *** 147,158 **** QFile stadifindex( basepath + QString( "stadifi%1.mul" ).arg( id ) ); ! if (stadifindex.open(IO_ReadOnly) && stadiflist.open(IO_ReadOnly)) { ! QDataStream listinput(&stadiflist); ! QDataStream indexinput(&stadifindex); ! listinput.setByteOrder(QDataStream::LittleEndian); ! indexinput.setByteOrder(QDataStream::LittleEndian); stIndexRecord record; ! while (!listinput.atEnd()) { unsigned int id; listinput >> id; --- 148,161 ---- QFile stadifindex( basepath + QString( "stadifi%1.mul" ).arg( id ) ); ! if ( stadifindex.open( IO_ReadOnly ) && stadiflist.open( IO_ReadOnly ) ) ! { ! QDataStream listinput( &stadiflist ); ! QDataStream indexinput( &stadifindex ); ! listinput.setByteOrder( QDataStream::LittleEndian ); ! indexinput.setByteOrder( QDataStream::LittleEndian ); stIndexRecord record; ! while ( !listinput.atEnd() ) ! { unsigned int id; listinput >> id; *************** *** 162,176 **** indexinput >> record.extra; ! if (!staticpatches.contains(id)) { ! staticpatches.insert( id, record ); } } } ! if (stadiflist.isOpen()) { stadiflist.close(); } ! if (stadifindex.isOpen()) { stadifindex.close(); } --- 165,182 ---- indexinput >> record.extra; ! if ( !staticpatches.contains( id ) ) ! { ! staticpatches.insert( id, record ); } } } ! if ( stadiflist.isOpen() ) ! { stadiflist.close(); } ! if ( stadifindex.isOpen() ) ! { stadifindex.close(); } *************** *** 625,691 **** #if !defined(_DEBUG) if ( !p ) ! #else ! if ( true ) ! #endif ! { ! QDataStream staticStream; ! staticStream.setByteOrder( QDataStream::LittleEndian ); ! unsigned int blockLength; ! ! // See if this particular block is patched. ! if ( mapRecord->staticpatches.contains( indexPos / 12 ) ) { ! const stIndexRecord& index = mapRecord->staticpatches[indexPos / 12]; ! if ( index.offset == 0xFFFFFFFF ) ! return; // No statics for this block ! mapRecord->stadifdata.at( index.offset ); ! staticStream.setDevice( &mapRecord->stadifdata ); ! blockLength = index.blocklength; ! } ! else ! { ! stIndexRecord indexStructure; ! mapRecord->idxfile.at( indexPos ); ! mapRecord->idxfile.readBlock( ( char * ) &indexStructure, sizeof( indexStructure ) ); ! if ( indexStructure.offset == 0xFFFFFFFF ) ! return; // No statics for this block ! mapRecord->staticsfile.at( indexStructure.offset ); ! staticStream.setDevice( &mapRecord->staticsfile ); ! blockLength = indexStructure.blocklength; ! } ! const uint remainX = x % 8; ! const uint remainY = y % 8; ! for ( Q_UINT32 i = 0; i < blockLength / 7; ++i ) ! { ! staticrecord r; ! staticStream >> r.itemid; ! staticStream >> r.xoff; ! staticStream >> r.yoff; ! staticStream >> r.zoff; ! Q_UINT16 unknown; ! staticStream >> unknown; ! if ( exact ) { ! if ( r.xoff == remainX && r.yoff == remainY ) staticArray.push_back( r ); } - else - staticArray.push_back( r ); - } ! // update cache; ! QValueVector<staticrecord>* temp = new QValueVector<staticrecord>( staticArray ); ! if ( !mapRecord->staticsCache.insert( cachePos, temp ) ) ! delete temp; ! } ! else ! { ! staticArray = *p; ! } } --- 631,697 ---- #if !defined(_DEBUG) if ( !p ) ! #else ! if ( true ) ! #endif { ! QDataStream staticStream; ! staticStream.setByteOrder( QDataStream::LittleEndian ); ! unsigned int blockLength; ! // See if this particular block is patched. ! if ( mapRecord->staticpatches.contains( indexPos / 12 ) ) ! { ! const stIndexRecord& index = mapRecord->staticpatches[indexPos / 12]; ! if ( index.offset == 0xFFFFFFFF ) ! return; // No statics for this block ! mapRecord->stadifdata.at( index.offset ); ! staticStream.setDevice( &mapRecord->stadifdata ); ! blockLength = index.blocklength; ! } ! else ! { ! stIndexRecord indexStructure; ! mapRecord->idxfile.at( indexPos ); ! mapRecord->idxfile.readBlock( ( char * ) &indexStructure, sizeof( indexStructure ) ); ! if ( indexStructure.offset == 0xFFFFFFFF ) ! return; // No statics for this block ! mapRecord->staticsfile.at( indexStructure.offset ); ! staticStream.setDevice( &mapRecord->staticsfile ); ! blockLength = indexStructure.blocklength; ! } ! ! const uint remainX = x % 8; ! const uint remainY = y % 8; ! for ( Q_UINT32 i = 0; i < blockLength / 7; ++i ) { ! staticrecord r; ! staticStream >> r.itemid; ! staticStream >> r.xoff; ! staticStream >> r.yoff; ! staticStream >> r.zoff; ! Q_UINT16 unknown; ! staticStream >> unknown; ! if ( exact ) ! { ! if ( r.xoff == remainX && r.yoff == remainY ) ! staticArray.push_back( r ); ! } ! else staticArray.push_back( r ); } ! // update cache; ! QValueVector<staticrecord>* temp = new QValueVector<staticrecord>( staticArray ); ! if ( !mapRecord->staticsCache.insert( cachePos, temp ) ) ! delete temp; ! } ! else ! { ! staticArray = *p; ! } } Index: multiscache.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/muls/multiscache.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** multiscache.cpp 6 Aug 2004 22:27:03 -0000 1.5 --- multiscache.cpp 10 Aug 2004 03:20:29 -0000 1.6 *************** *** 197,201 **** multiStream.setByteOrder( QDataStream::LittleEndian ); ! for (int i = 0; i < indexData.length / 12; ++i ) { multiItem_st item; --- 197,201 ---- multiStream.setByteOrder( QDataStream::LittleEndian ); ! for ( int i = 0; i < indexData.length / 12; ++i ) { multiItem_st item; |