1
0
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-17 10:52:46 +00:00

Merge remote-tracking branch 'origin/master' into plString

Conflicts:
	Sources/Plasma/CoreLib/hsStream.h
	Sources/Plasma/FeatureLib/pfAudio/plListener.cpp
	Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp
	Sources/Plasma/FeatureLib/pfConsole/pfDispatchLog.cpp
	Sources/Plasma/FeatureLib/pfJournalBook/pfJournalBook.cpp
	Sources/Plasma/FeatureLib/pfPython/cyMisc.cpp
	Sources/Plasma/FeatureLib/pfPython/cyMisc.h
	Sources/Plasma/FeatureLib/pfPython/cyMiscGlue4.cpp
	Sources/Plasma/FeatureLib/pfPython/plPythonFileMod.cpp
	Sources/Plasma/FeatureLib/pfPython/plPythonFileMod.h
	Sources/Plasma/FeatureLib/pfPython/pyImage.cpp
	Sources/Plasma/FeatureLib/pfPython/pyJournalBook.cpp
	Sources/Plasma/FeatureLib/pfPython/pyNetServerSessionInfo.h
	Sources/Plasma/NucleusLib/pnKeyedObject/plFixedKey.cpp
	Sources/Plasma/NucleusLib/pnKeyedObject/plKeyImp.cpp
	Sources/Plasma/NucleusLib/pnKeyedObject/plUoid.cpp
	Sources/Plasma/NucleusLib/pnKeyedObject/plUoid.h
	Sources/Plasma/NucleusLib/pnMessage/plMessage.h
	Sources/Plasma/NucleusLib/pnNetCommon/plNetApp.h
	Sources/Plasma/PubUtilLib/plAvatar/plCoopCoordinator.cpp
	Sources/Plasma/PubUtilLib/plDrawable/plDrawableSpansExport.cpp
	Sources/Plasma/PubUtilLib/plDrawable/plDynaDecalMgr.cpp
	Sources/Plasma/PubUtilLib/plDrawable/plWaveSet7.cpp
	Sources/Plasma/PubUtilLib/plInputCore/plInputDevice.h
	Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgr.h
	Sources/Plasma/PubUtilLib/plNetCommon/plClientGuid.h
	Sources/Plasma/PubUtilLib/plNetMessage/plNetMessage.cpp
	Sources/Plasma/PubUtilLib/plNetMessage/plNetMsgHelpers.h
	Sources/Plasma/PubUtilLib/plNetTransport/plNetTransportMember.h
	Sources/Plasma/PubUtilLib/plPhysX/plSimulationMgr.cpp
	Sources/Plasma/PubUtilLib/plPipeline/plDXPipeline.cpp
	Sources/Plasma/PubUtilLib/plPipeline/plPlates.cpp
	Sources/Plasma/PubUtilLib/plResMgr/plKeyFinder.cpp
	Sources/Plasma/PubUtilLib/plResMgr/plKeyFinder.h
	Sources/Plasma/PubUtilLib/plResMgr/plRegistryNode.cpp
	Sources/Plasma/PubUtilLib/plResMgr/plRegistryNode.h
	Sources/Plasma/PubUtilLib/plScene/plRelevanceMgr.cpp
	Sources/Plasma/PubUtilLib/plScene/plRelevanceMgr.h
	Sources/Plasma/PubUtilLib/plSurface/plGrassShaderMod.cpp
This commit is contained in:
2012-01-28 17:20:01 -08:00
1722 changed files with 24149 additions and 27599 deletions

View File

@ -51,9 +51,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
//
//////////////////////////////////////////////////////////////////////////////
#include "hsTypes.h"
#include "HeadSpin.h"
#include "plBSDiffBuffer.h"
#include "hsUtils.h"
#include "hsStream.h"
#define plBSDiffBuffer_MIN(x,y) (((x)<(y)) ? (x) : (y))
@ -68,7 +68,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
// buffer, but if you do, it'll help this class do some internal space
// optimization.
plBSDiffBuffer::plBSDiffBuffer( UInt32 newLength, UInt32 oldLength )
plBSDiffBuffer::plBSDiffBuffer( uint32_t newLength, uint32_t oldLength )
: fNewLength( newLength )
, fPatchLength( 0 )
{
@ -82,7 +82,7 @@ plBSDiffBuffer::plBSDiffBuffer( UInt32 newLength, UInt32 oldLength )
// will be copied, so you don't need to keep it around after you construct
// this object.
plBSDiffBuffer::plBSDiffBuffer( void *buffer, UInt32 length )
plBSDiffBuffer::plBSDiffBuffer( void *buffer, uint32_t length )
: fNewLength( 0 )
, fPatchLength( 0 )
, fPatchBuffer( nil )
@ -91,7 +91,7 @@ plBSDiffBuffer::plBSDiffBuffer( void *buffer, UInt32 length )
if (!buffer || length < 32)
hsAssert(false, "Corrupt Patch Buffer!");
if((fPatchBuffer=TRACKED_NEW unsigned char[length+1])!=nil)
if((fPatchBuffer=new unsigned char[length+1])!=nil)
{
fPatchLength = length;
memcpy(fPatchBuffer, buffer, fPatchLength);
@ -111,21 +111,21 @@ plBSDiffBuffer::~plBSDiffBuffer()
//// Diff /////////////////////////////////////////////////////////////////////
// Diff() creates the diff buffer from the new and old.
UInt32 plBSDiffBuffer::Diff( UInt32 oldLength, void *oldBuffer, UInt32 newLength, void *newBuffer )
uint32_t plBSDiffBuffer::Diff( uint32_t oldLength, void *oldBuffer, uint32_t newLength, void *newBuffer )
{
hsAssert( fWriting, "Trying to Add() to a difference buffer that's reading" );
Int32 *I,*V;
int32_t *I,*V;
Int32 scan,pos,len;
Int32 lastscan,lastpos,lastoffset;
Int32 oldscore,scsc;
int32_t scan,pos,len;
int32_t lastscan,lastpos,lastoffset;
int32_t oldscore,scsc;
Int32 s,Sf,lenf,Sb,lenb;
Int32 overlap,Ss,lens;
Int32 i;
int32_t s,Sf,lenf,Sb,lenb;
int32_t overlap,Ss,lens;
int32_t i;
UInt32 cblen,dblen,eblen;
uint32_t cblen,dblen,eblen;
unsigned char *oldbuf, *newbuf;
unsigned char *cb,*db,*eb;
@ -142,8 +142,8 @@ UInt32 plBSDiffBuffer::Diff( UInt32 oldLength, void *oldBuffer, UInt32 newLength
oldbuf = (unsigned char *)oldBuffer;
newbuf = (unsigned char *)newBuffer;
if(((I=TRACKED_NEW Int32[oldLength+1])==nil) ||
((V=TRACKED_NEW Int32[oldLength+1])==nil))
if(((I=new int32_t[oldLength+1])==nil) ||
((V=new int32_t[oldLength+1])==nil))
{
delete[] I;
delete[] V;
@ -157,9 +157,9 @@ UInt32 plBSDiffBuffer::Diff( UInt32 oldLength, void *oldBuffer, UInt32 newLength
/*
* These could probably be smaller, especially cb.
*/
if(((cb=TRACKED_NEW unsigned char[newLength+1])==nil) ||
((db=TRACKED_NEW unsigned char[newLength+1])==nil) ||
((eb=TRACKED_NEW unsigned char[newLength+1])==nil))
if(((cb=new unsigned char[newLength+1])==nil) ||
((db=new unsigned char[newLength+1])==nil) ||
((eb=new unsigned char[newLength+1])==nil))
{
delete[] I;
delete[] cb;
@ -246,9 +246,9 @@ UInt32 plBSDiffBuffer::Diff( UInt32 oldLength, void *oldBuffer, UInt32 newLength
dblen+=lenf;
eblen+=(scan-lenb)-(lastscan+lenf);
IWriteUnsignedInt8(lenf,cb+cblen);
IWriteUnsignedInt8((scan-lenb)-(lastscan+lenf),cb+cblen+8);
IWriteUnsignedInt8((pos-lenb)-(lastpos+lenf),cb+cblen+16);
IWriteUnsignedint8_t(lenf,cb+cblen);
IWriteUnsignedint8_t((scan-lenb)-(lastscan+lenf),cb+cblen+8);
IWriteUnsignedint8_t((pos-lenb)-(lastpos+lenf),cb+cblen+16);
cblen+=24;
lastscan=scan-lenb;
@ -257,13 +257,13 @@ UInt32 plBSDiffBuffer::Diff( UInt32 oldLength, void *oldBuffer, UInt32 newLength
};
};
IWriteUnsignedInt8(cblen,header+8);
IWriteUnsignedInt8(dblen,header+16);
IWriteUnsignedInt8(newLength,header+24);
IWriteUnsignedint8_t(cblen,header+8);
IWriteUnsignedint8_t(dblen,header+16);
IWriteUnsignedint8_t(newLength,header+24);
fPatchLength = 32 + cblen + dblen + eblen;
fPatchBuffer = nil;
if((fPatchBuffer=TRACKED_NEW unsigned char[fPatchLength])!=nil)
if((fPatchBuffer=new unsigned char[fPatchLength])!=nil)
{
memcpy(fPatchBuffer,header,32);
memcpy(fPatchBuffer+32,cb,cblen);
@ -290,7 +290,7 @@ UInt32 plBSDiffBuffer::Diff( UInt32 oldLength, void *oldBuffer, UInt32 newLength
// function will rewind the diff stream, so once you call it, you can't do
// anything else on the object.
void plBSDiffBuffer::GetBuffer( UInt32 &length, void *&bufferPtr )
void plBSDiffBuffer::GetBuffer( uint32_t &length, void *&bufferPtr )
{
hsAssert( fWriting, "Trying to GetBuffer() on a difference buffer that's reading" );
@ -315,20 +315,20 @@ void plBSDiffBuffer::GetBuffer( UInt32 &length, void *&bufferPtr )
// Patch() will take this diff buffer and apply it to the given old buffer,
// allocating and producing a new buffer. You are responsible for freeing the new buffer.
UInt32 plBSDiffBuffer::Patch( UInt32 oldLength, void *oldBuffer, UInt32 &newLength, void *&newBuffer )
uint32_t plBSDiffBuffer::Patch( uint32_t oldLength, void *oldBuffer, uint32_t &newLength, void *&newBuffer )
{
hsAssert( !fWriting, "Trying to Patch() a difference buffer that's writing" );
unsigned char *ctrlpipe, *ctrlend;
unsigned char *diffpipe, *diffend;
unsigned char *extrapipe;
UInt32 ctrllen,datalen;
uint32_t ctrllen,datalen;
int version=0;
unsigned char *newpos, *newend;
unsigned char *oldpos, *oldend;
unsigned char *patchend;
UInt32 ctrl[3];
UInt32 i;
uint32_t ctrl[3];
uint32_t i;
if (oldBuffer == nil ||
oldLength < 0 ||
@ -375,9 +375,9 @@ UInt32 plBSDiffBuffer::Patch( UInt32 oldLength, void *oldBuffer, UInt32 &newLeng
if(!version) return (-1);
ctrllen=IReadUnsignedInt8(fPatchBuffer+8);
datalen=IReadUnsignedInt8(fPatchBuffer+16);
newLength=IReadUnsignedInt8(fPatchBuffer+24);
ctrllen=IReadUnsignedint8_t(fPatchBuffer+8);
datalen=IReadUnsignedint8_t(fPatchBuffer+16);
newLength=IReadUnsignedint8_t(fPatchBuffer+24);
if((ctrllen<0) || (datalen<0) || (newLength<0) ||
((version==1) && (32+ctrllen+datalen!=fPatchLength)))
return (-1);
@ -390,7 +390,7 @@ UInt32 plBSDiffBuffer::Patch( UInt32 oldLength, void *oldBuffer, UInt32 &newLeng
extrapipe=diffpipe+datalen;
};
if((newBuffer=(void *)TRACKED_NEW unsigned char[newLength+1])==nil) return(-1);
if((newBuffer=(void *)new unsigned char[newLength+1])==nil) return(-1);
newpos = (unsigned char *)newBuffer;
newend = (unsigned char *)newBuffer + newLength;
oldpos = (unsigned char *)oldBuffer;
@ -398,7 +398,7 @@ UInt32 plBSDiffBuffer::Patch( UInt32 oldLength, void *oldBuffer, UInt32 &newLeng
while(newpos<newend) {
for(i=0;i<=version;i++) {
if(ctrlend-ctrlpipe < 8) return (-1);
ctrl[i]=IReadUnsignedInt8(ctrlpipe);
ctrl[i]=IReadUnsignedint8_t(ctrlpipe);
ctrlpipe += 8;
};
@ -443,11 +443,11 @@ UInt32 plBSDiffBuffer::Patch( UInt32 oldLength, void *oldBuffer, UInt32 &newLeng
//// Private Helper Functions ///////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
// Reads in an 8-byte unsigned integer least significant byte first and returns a
// UInt32. We'll ignore the top four bytes.
UInt32 plBSDiffBuffer::IReadUnsignedInt8(unsigned char *buf)
// Reads in an 8-uint8_t unsigned integer least significant uint8_t first and returns a
// uint32_t. We'll ignore the top four bytes.
uint32_t plBSDiffBuffer::IReadUnsignedint8_t(unsigned char *buf)
{
UInt32 y;
uint32_t y;
y=buf[7]&0x7F;
y=y*256;y+=buf[6];
@ -459,21 +459,21 @@ UInt32 plBSDiffBuffer::IReadUnsignedInt8(unsigned char *buf)
y=y*256;y+=buf[0];
// casting added so compiler doesn't warn about negating an unsigned value
Int32 signedY = (Int32)y;
int32_t signedY = (int32_t)y;
if(buf[7]&0x80) signedY=-signedY;
y = (UInt32)signedY;
y = (uint32_t)signedY;
return y;
}
void plBSDiffBuffer::IWriteUnsignedInt8(UInt32 x,unsigned char *buf)
void plBSDiffBuffer::IWriteUnsignedint8_t(uint32_t x,unsigned char *buf)
{
UInt32 y;
Int32 signedY, signedX = (Int32)x;
uint32_t y;
int32_t signedY, signedX = (int32_t)x;
// casting added so compiler doesn't warn about negating an unsigned value
if(x<0) signedY=-signedX; else signedY=signedX;
y = (UInt32)signedY;
y = (uint32_t)signedY;
buf[0]=(unsigned char)(y%256);y-=buf[0];
y=y/256;buf[1]=(unsigned char)(y%256);y-=buf[1];
@ -489,22 +489,22 @@ void plBSDiffBuffer::IWriteUnsignedInt8(UInt32 x,unsigned char *buf)
/*
* This function will ensure that no boundary errors occur. It also increments *src
* by nbytes when done.
* by nBytes when done.
*/
void plBSDiffBuffer::ISafeMemcpy(unsigned char *dest, unsigned char *src, size_t nbytes,
void plBSDiffBuffer::ISafeMemcpy(unsigned char *dest, unsigned char *src, size_t nBytes,
unsigned char *destend, unsigned char *srcend)
{
if((destend - dest < nbytes) ||
(srcend - src < nbytes))
if((destend - dest < nBytes) ||
(srcend - src < nBytes))
{
hsAssert(false,"Corrupt patch\n");
}
memcpy(dest,src,nbytes);
memcpy(dest,src,nBytes);
}
void plBSDiffBuffer::ISplit(Int32 *I,Int32 *V,UInt32 start,UInt32 len,UInt32 h)
void plBSDiffBuffer::ISplit(int32_t *I,int32_t *V,uint32_t start,uint32_t len,uint32_t h)
{
UInt32 i,j,k,x,tmp,jj,kk;
uint32_t i,j,k,x,tmp,jj,kk;
if(len<16) {
for(k=start;k<start+len;k+=j) {
@ -563,10 +563,10 @@ void plBSDiffBuffer::ISplit(Int32 *I,Int32 *V,UInt32 start,UInt32 len,UInt32 h)
if(start+len>kk) ISplit(I,V,kk,start+len-kk,h);
}
void plBSDiffBuffer::IQSuffixSort(Int32 *I,Int32 *V,unsigned char *old,UInt32 oldsize)
void plBSDiffBuffer::IQSuffixSort(int32_t *I,int32_t *V,unsigned char *old,uint32_t oldsize)
{
UInt32 buckets[256];
UInt32 i,h,len;
uint32_t buckets[256];
uint32_t i,h,len;
for(i=0;i<256;i++) buckets[i]=0;
for(i=0;i<oldsize;i++) buckets[old[i]]++;
@ -581,33 +581,33 @@ void plBSDiffBuffer::IQSuffixSort(Int32 *I,Int32 *V,unsigned char *old,UInt32 ol
for(i=1;i<256;i++) if(buckets[i]==buckets[i-1]+1) I[buckets[i]]=-1;
I[0]=-1;
// oldsize converted to Int32 to stop warning about negating unsigned numbers
for(h=1;I[0]!=-(Int32)(oldsize+1);h+=h) {
// oldsize converted to int32_t to stop warning about negating unsigned numbers
for(h=1;I[0]!=-(int32_t)(oldsize+1);h+=h) {
len=0;
for(i=0;i<oldsize+1;) {
if(I[i]<0) {
len-=I[i];
i-=I[i];
} else {
// len converted to Int32 to stop the warning about negating an unsigned number
if(len) I[i-len]=-(Int32)len;
// len converted to int32_t to stop the warning about negating an unsigned number
if(len) I[i-len]=-(int32_t)len;
len=V[I[i]]+1-i;
ISplit(I,V,i,len,h);
i+=len;
len=0;
};
};
// len converted to Int32 to stop the warning about negating an unsigned number
if(len) I[i-len]=-(Int32)len;
// len converted to int32_t to stop the warning about negating an unsigned number
if(len) I[i-len]=-(int32_t)len;
};
for(i=0;i<oldsize+1;i++) I[V[i]]=i;
}
UInt32 plBSDiffBuffer::IMatchLen( unsigned char *oldBuffer, UInt32 oldLength,
unsigned char *newBuffer, UInt32 newLength)
uint32_t plBSDiffBuffer::IMatchLen( unsigned char *oldBuffer, uint32_t oldLength,
unsigned char *newBuffer, uint32_t newLength)
{
UInt32 i;
uint32_t i;
for(i=0;(i<oldLength)&&(i<newLength);i++)
if(oldBuffer[i]!=newBuffer[i]) break;
@ -615,12 +615,12 @@ UInt32 plBSDiffBuffer::IMatchLen( unsigned char *oldBuffer, UInt32 oldLength,
return i;
}
UInt32 plBSDiffBuffer::ISearch( Int32 *I,
unsigned char *oldBuffer, UInt32 oldLength,
unsigned char *newBuffer, UInt32 newLength,
UInt32 st, UInt32 en, Int32 *pos)
uint32_t plBSDiffBuffer::ISearch( int32_t *I,
unsigned char *oldBuffer, uint32_t oldLength,
unsigned char *newBuffer, uint32_t newLength,
uint32_t st, uint32_t en, int32_t *pos)
{
UInt32 x,y;
uint32_t x,y;
if(en-st<2) {
x=IMatchLen(oldBuffer+I[st],oldLength-I[st],newBuffer,newLength);

View File

@ -65,7 +65,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#ifndef _plBSDiffBuffer_h
#define _plBSDiffBuffer_h
#include "hsTypes.h"
#include "HeadSpin.h"
#include "hsStream.h"
//// Class Definition ////////////////////////////////////////////////////////
@ -76,13 +76,13 @@ class plBSDiffBuffer
protected:
hsBool fWriting;
UInt32 fNewLength, fPatchLength;
uint32_t fNewLength, fPatchLength;
unsigned char* fPatchBuffer;
public:
plBSDiffBuffer( UInt32 newLength, UInt32 oldLength = 0 ); // Constructor for writing new buffers. oldLength isn't required but helpful for optimizations
plBSDiffBuffer( void *buffer, UInt32 length ); // Constructor for applying a given diff set
plBSDiffBuffer( uint32_t newLength, uint32_t oldLength = 0 ); // Constructor for writing new buffers. oldLength isn't required but helpful for optimizations
plBSDiffBuffer( void *buffer, uint32_t length ); // Constructor for applying a given diff set
// to an old buffer
virtual ~plBSDiffBuffer();
@ -90,36 +90,36 @@ class plBSDiffBuffer
/// Creation/write functions
// Diff() creates the diff buffer from the new and old.
UInt32 Diff( UInt32 oldLength, void *oldBuffer, UInt32 newLength, void *newBuffer );
uint32_t Diff( uint32_t oldLength, void *oldBuffer, uint32_t newLength, void *newBuffer );
// GetBuffer() will copy the diff stream into a new buffer and return it. You are responsible for freeing the buffer.
void GetBuffer( UInt32 &length, void *&bufferPtr );
void GetBuffer( uint32_t &length, void *&bufferPtr );
/// Apply functions
// Apply() is another way to call Patch().
UInt32 Apply( UInt32 oldLength, void *oldBuffer, UInt32 &newLength, void *&newBuffer )
uint32_t Apply( uint32_t oldLength, void *oldBuffer, uint32_t &newLength, void *&newBuffer )
{ return Patch(oldLength, oldBuffer, newLength, newBuffer); };
// Patch() will take this diff buffer and apply it to the given old buffer,
// allocating and producing a new buffer. You are responsible for freeing the new buffer.
UInt32 Patch( UInt32 oldLength, void *oldBuffer, UInt32 &newLength, void *&newBuffer );
uint32_t Patch( uint32_t oldLength, void *oldBuffer, uint32_t &newLength, void *&newBuffer );
private:
UInt32 IReadUnsignedInt8(unsigned char *buf);
void IWriteUnsignedInt8(UInt32 x,unsigned char *buf);
void ISafeMemcpy(unsigned char *dest, unsigned char *src, size_t nbytes,
uint32_t IReadUnsignedint8_t(unsigned char *buf);
void IWriteUnsignedint8_t(uint32_t x,unsigned char *buf);
void ISafeMemcpy(unsigned char *dest, unsigned char *src, size_t nBytes,
unsigned char *destend, unsigned char *srcend);
void ISplit(Int32 *I,Int32 *V,UInt32 start,UInt32 len,UInt32 h);
void IQSuffixSort(Int32 *I,Int32 *V,unsigned char *old,UInt32 oldsize);
UInt32 IMatchLen( unsigned char *oldBuffer, UInt32 oldLength,
unsigned char *newBuffer, UInt32 newLength);
UInt32 ISearch( Int32 *I,
unsigned char *oldBuffer, UInt32 oldLength,
unsigned char *newBuffer, UInt32 newLength,
UInt32 st, UInt32 en, Int32 *pos);
void ISplit(int32_t *I,int32_t *V,uint32_t start,uint32_t len,uint32_t h);
void IQSuffixSort(int32_t *I,int32_t *V,unsigned char *old,uint32_t oldsize);
uint32_t IMatchLen( unsigned char *oldBuffer, uint32_t oldLength,
unsigned char *newBuffer, uint32_t newLength);
uint32_t ISearch( int32_t *I,
unsigned char *oldBuffer, uint32_t oldLength,
unsigned char *newBuffer, uint32_t newLength,
uint32_t st, uint32_t en, int32_t *pos);
};

View File

@ -56,10 +56,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
//
//////////////////////////////////////////////////////////////////////////////
#include "hsTypes.h"
#include "HeadSpin.h"
#include "plDiffBuffer.h"
#include "plBSDiffBuffer.h"
#include "hsUtils.h"
#include "hsStream.h"
@ -73,7 +73,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
// buffer, but if you do, it'll help this class do some internal space
// optimization.
plDiffBuffer::plDiffBuffer( UInt32 newLength, UInt32 oldLength )
plDiffBuffer::plDiffBuffer( uint32_t newLength, uint32_t oldLength )
: fBSDiffBuffer( nil )
, fIsBSDiff( false )
{
@ -86,7 +86,7 @@ plDiffBuffer::plDiffBuffer( UInt32 newLength, UInt32 oldLength )
f16BitMode = false;
fNewLength = newLength;
fStream = TRACKED_NEW hsRAMStream();
fStream = new hsRAMStream();
fStream->WriteLE32( fNewLength );
fStream->WriteBool( f16BitMode );
fWriting = true;
@ -98,7 +98,7 @@ plDiffBuffer::plDiffBuffer( UInt32 newLength, UInt32 oldLength )
// will be copied, so you don't need to keep it around after you construct
// this object.
plDiffBuffer::plDiffBuffer( void *buffer, UInt32 length )
plDiffBuffer::plDiffBuffer( void *buffer, uint32_t length )
: fBSDiffBuffer( nil )
, fStream( nil )
, fIsBSDiff( false )
@ -109,12 +109,12 @@ plDiffBuffer::plDiffBuffer( void *buffer, UInt32 length )
memcmp(buffer,"BSDIFF40",8)==0 )
{
// This is a bsdiff buffer. Use plBSDiffBuffer to handle it.
fBSDiffBuffer = TRACKED_NEW plBSDiffBuffer(buffer, length);
fBSDiffBuffer = new plBSDiffBuffer(buffer, length);
fIsBSDiff = true;
}
else
{
fStream = TRACKED_NEW hsRAMStream();
fStream = new hsRAMStream();
fStream->Write( length, buffer );
fStream->Rewind();
@ -141,14 +141,14 @@ plDiffBuffer::~plDiffBuffer()
// supplied will be copied internally, so you can discard it after you call
// this function.
void plDiffBuffer::Add( Int32 length, void *newData )
void plDiffBuffer::Add( int32_t length, void *newData )
{
hsAssert( fWriting, "Trying to Add() to a difference buffer that's reading" );
// We flag our two different op types by the sign of the length. Negative
// lengths are an add operation, positive ones are copy ops.
if( f16BitMode )
fStream->WriteLE16( -( (Int16)length ) );
fStream->WriteLE16( -( (int16_t)length ) );
else
fStream->WriteLE32( -length );
fStream->Write( length, newData );
@ -157,7 +157,7 @@ void plDiffBuffer::Add( Int32 length, void *newData )
//// Copy ////////////////////////////////////////////////////////////////////
// Copy() appends a Copy-Data-From-Old operation to the diff buffer.
void plDiffBuffer::Copy( Int32 length, UInt32 oldOffset )
void plDiffBuffer::Copy( int32_t length, uint32_t oldOffset )
{
hsAssert( fWriting, "Trying to Copy() to a difference buffer that's reading" );
@ -165,8 +165,8 @@ void plDiffBuffer::Copy( Int32 length, UInt32 oldOffset )
// lengths are an add operation, positive ones are copy ops.
if( f16BitMode )
{
fStream->WriteLE16( (Int16)length );
fStream->WriteLE16( (UInt16)oldOffset );
fStream->WriteLE16( (int16_t)length );
fStream->WriteLE16( (uint16_t)oldOffset );
}
else
{
@ -182,12 +182,12 @@ void plDiffBuffer::Copy( Int32 length, UInt32 oldOffset )
// function will rewind the diff stream, so once you call it, you can't do
// anything else on the object.
void plDiffBuffer::GetBuffer( UInt32 &length, void *&bufferPtr )
void plDiffBuffer::GetBuffer( uint32_t &length, void *&bufferPtr )
{
hsAssert( fWriting, "Trying to GetBuffer() on a difference buffer that's reading" );
length = fStream->GetPosition();
bufferPtr = (void *)TRACKED_NEW UInt8[ length ];
bufferPtr = (void *)new uint8_t[ length ];
fStream->Rewind();
fStream->Read( length, bufferPtr );
@ -205,7 +205,7 @@ void plDiffBuffer::GetBuffer( UInt32 &length, void *&bufferPtr )
#define hsAssertAndBreak( cond, msg ) { if( cond ) { hsAssert( false, msg ); break; } }
void plDiffBuffer::Apply( UInt32 oldLength, void *oldBuffer, UInt32 &newLength, void *&newBuffer )
void plDiffBuffer::Apply( uint32_t oldLength, void *oldBuffer, uint32_t &newLength, void *&newBuffer )
{
hsAssert( !fWriting, "Trying to Apply() a difference buffer that's writing" );
@ -218,24 +218,24 @@ void plDiffBuffer::Apply( UInt32 oldLength, void *oldBuffer, UInt32 &newLengt
/// Step 1: Allocate the new buffer
newLength = fNewLength;
UInt8 *new8Buffer = TRACKED_NEW UInt8[ newLength ];
UInt8 *old8Buffer = (UInt8 *)oldBuffer;
uint8_t *new8Buffer = new uint8_t[ newLength ];
uint8_t *old8Buffer = (uint8_t *)oldBuffer;
newBuffer = (void *)new8Buffer;
/// Step 2: Loop through the difference stream
Int32 opLength;
UInt32 newBufferPos = 0;
int32_t opLength;
uint32_t newBufferPos = 0;
while( newBufferPos < newLength )
{
// Read in the op length
if( f16BitMode )
{
Int16 opLen16 = fStream->ReadLE16();
int16_t opLen16 = fStream->ReadLE16();
if( opLen16 < 0 )
opLength = -( (Int32)( -opLen16 ) );
opLength = -( (int32_t)( -opLen16 ) );
else
opLength = (UInt32)opLen16;
opLength = (uint32_t)opLen16;
}
else
opLength = fStream->ReadLE32();
@ -252,7 +252,7 @@ void plDiffBuffer::Apply( UInt32 oldLength, void *oldBuffer, UInt32 &newLengt
else
{
// Copy op, so get the old offset and copy from there
UInt32 oldOffset = f16BitMode ? fStream->ReadLE16() : fStream->ReadLE32();
uint32_t oldOffset = f16BitMode ? fStream->ReadLE16() : fStream->ReadLE32();
hsAssertAndBreak( newBufferPos + opLength > newLength, "Destination buffer offset in plDiffBuffer() is out of range!" );
hsAssertAndBreak( oldOffset + opLength > oldLength, "Difference buffer offset in plDiffBuffer() is out of range of the old buffer!" );

View File

@ -70,7 +70,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#ifndef _plDiffBuffer_h
#define _plDiffBuffer_h
#include "hsTypes.h"
#include "HeadSpin.h"
#include "hsStream.h"
//// Class Definition ////////////////////////////////////////////////////////
@ -82,7 +82,7 @@ class plDiffBuffer
protected:
hsBool fWriting, f16BitMode;
UInt32 fNewLength;
uint32_t fNewLength;
hsRAMStream *fStream;
// Support for BSDiff patch buffers (Patching only)
@ -91,8 +91,8 @@ class plDiffBuffer
public:
plDiffBuffer( UInt32 newLength, UInt32 oldLength = 0 ); // Constructor for writing new buffers. oldLength isn't required but helpful for optimizations
plDiffBuffer( void *buffer, UInt32 length ); // Constructor for applying a given diff set
plDiffBuffer( uint32_t newLength, uint32_t oldLength = 0 ); // Constructor for writing new buffers. oldLength isn't required but helpful for optimizations
plDiffBuffer( void *buffer, uint32_t length ); // Constructor for applying a given diff set
// to an old buffer
virtual ~plDiffBuffer();
@ -100,19 +100,19 @@ class plDiffBuffer
/// Creation/write functions
// Add() appends an Add-New-Data operation to the diff buffer. The data supplied will be copied internally.
void Add( Int32 length, void *newData );
void Add( int32_t length, void *newData );
// Copy() appends a Copy-Data-From-Old operation to the diff buffer
void Copy( Int32 length, UInt32 oldOffset );
void Copy( int32_t length, uint32_t oldOffset );
// GetBuffer() will copy the diff stream into a new buffer and return it. You are responsible for freeing the buffer.
void GetBuffer( UInt32 &length, void *&bufferPtr );
void GetBuffer( uint32_t &length, void *&bufferPtr );
/// Apply functions
// Apply() will take this diff buffer and apply it to the given old buffer, allocating and producing a new buffer. You are responsible for freeing the new buffer.
void Apply( UInt32 oldLength, void *oldBuffer, UInt32 &newLength, void *&newBuffer );
void Apply( uint32_t oldLength, void *oldBuffer, uint32_t &newLength, void *&newBuffer );
};

View File

@ -52,7 +52,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "plRegistryKeyList.h"
#include "plPageInfo.h"
#include "pnFactory/plFactory.h"
#include "hsUtils.h"
#include "plCreatableIndex.h"
plResManager* IGetResMgr() { return (plResManager*)hsgResMgr::ResMgr(); }
@ -119,14 +119,14 @@ hsBool NameMatches(const char* obName, const char* pKName, hsBool subString)
plKey plKeyFinder::StupidSearch(const char * age, const char * rm,
const char *className, const plString &obName, hsBool subString)
{
UInt16 ty = plFactory::FindClassIndex(className);
uint16_t ty = plFactory::FindClassIndex(className);
return StupidSearch(age, rm, ty, obName, subString);
}
class plKeyFinderIter : public plRegistryKeyIterator, public plRegistryPageIterator
{
protected:
UInt16 fClassType;
uint16_t fClassType;
plString fObjName;
hsBool fSubstr;
plKey fFoundKey;
@ -135,10 +135,10 @@ protected:
public:
plKey GetFoundKey( void ) const { return fFoundKey; }
plKeyFinderIter( UInt16 classType, const plString &obName, hsBool substr )
plKeyFinderIter( uint16_t classType, const plString &obName, hsBool substr )
: fFoundKey( nil ), fClassType( classType ), fObjName( obName ), fSubstr( substr ) { }
plKeyFinderIter( UInt16 classType, const plString &obName, hsBool substr, const char *ageName )
plKeyFinderIter( uint16_t classType, const plString &obName, hsBool substr, const char *ageName )
: fFoundKey( nil ), fClassType( classType ), fObjName( obName ), fSubstr( substr ),
fAgeName( ageName ) {}
@ -182,7 +182,7 @@ public:
};
plKey plKeyFinder::StupidSearch(const char * age, const char * rm,
UInt16 classType, const plString &obName, hsBool subString)
uint16_t classType, const plString &obName, hsBool subString)
{
if (obName.IsNull())
return nil;
@ -191,9 +191,9 @@ plKey plKeyFinder::StupidSearch(const char * age, const char * rm,
fLastError = kOk;
UInt16 maxClasses = plFactory::GetNumClasses();
uint16_t maxClasses = plFactory::GetNumClasses();
UInt16 ty = classType;
uint16_t ty = classType;
if (ty == maxClasses) // error
{ fLastError = kInvalidClass;
return nil;
@ -276,14 +276,14 @@ class plKeyFinderIterator : public plRegistryKeyIterator, public plRegistryPageI
{
protected:
UInt16 fClassType;
uint16_t fClassType;
plString fObjName;
std::vector<plKey> &fFoundKeys;
public:
plKeyFinderIterator( UInt16 classType, const plString &obName, std::vector<plKey>& foundKeys )
plKeyFinderIterator( uint16_t classType, const plString &obName, std::vector<plKey>& foundKeys )
: fClassType( classType ), fObjName( obName ), fFoundKeys( foundKeys ) { }
virtual hsBool EatKey( const plKey& key )
@ -304,7 +304,7 @@ class plKeyFinderIterator : public plRegistryKeyIterator, public plRegistryPageI
}
};
void plKeyFinder::ReallyStupidSubstringSearch(const plString &name, UInt16 objType, std::vector<plKey>& foundKeys, const plLocation &hintLocation )
void plKeyFinder::ReallyStupidSubstringSearch(const plString &name, uint16_t objType, std::vector<plKey>& foundKeys, const plLocation &hintLocation )
{
if (name.IsNull())
return;

View File

@ -63,7 +63,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
//
//----------------------------
#include "hsTypes.h"
#include "HeadSpin.h"
#include "pnKeyedObject/plKey.h"
#include "pnKeyedObject/plUoid.h"
#include "hsStlUtils.h"
@ -90,7 +90,7 @@ public:
// These are Stupid search because they just do string searchs on the objects.
plKey StupidSearch(const char * age, const char * rm, const char *className, const plString &obName, hsBool subString=false);
plKey StupidSearch(const char * age, const char * rm, UInt16 objType, const plString &obName, hsBool subString=false);
plKey StupidSearch(const char * age, const char * rm, uint16_t objType, const plString &obName, hsBool subString=false);
eErrCodes GetLastErrorCode() { return fLastError; }
const char* GetLastErrorString(); // For Console display
@ -98,7 +98,7 @@ public:
void ReallyStupidResponderSearch(const plString& name, std::vector<plKey>& foundKeys, const plLocation& hintLocation = plLocation::kInvalidLoc);
void ReallyStupidActivatorSearch(const plString& name, std::vector<plKey>& foundKeys, const plLocation& hintLocation = plLocation::kInvalidLoc);
void ReallyStupidSubstringSearch(const plString& name, UInt16 objType, std::vector<plKey>& foundKeys, const plLocation& hintLocation = plLocation::kInvalidLoc);
void ReallyStupidSubstringSearch(const plString& name, uint16_t objType, std::vector<plKey>& foundKeys, const plLocation& hintLocation = plLocation::kInvalidLoc);
void GetActivatorNames(std::vector<plString>& names);
void GetResponderNames(std::vector<plString>& names);

View File

@ -43,7 +43,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#define PLLOC_H
#include "HeadSpin.h"
#include "hsUtils.h"
// Values for UOID, such as AGE, District Room
@ -65,7 +64,7 @@ class plLocFileParser
public:
plLocFileParser();
~plLocFileParser() { if (fpFile) fclose(fpFile); fpFile = 0; }
void ThrowBack(char *p,UInt8 lev) { fThrowBack = p; fThrowBackLevel = lev; }
void ThrowBack(char *p,uint8_t lev) { fThrowBack = p; fThrowBackLevel = lev; }
void ClearThrowBack() { fThrowBack = NULL; fThrowBackLevel = 0; }
bool ThrowBackAvailable() { return (fThrowBack == NULL) ? false: true; }
int NextLine(char **pP); // returns an Allocated string in pP of next valid line, and Level #, or LOC_EOF

View File

@ -39,10 +39,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
Mead, WA 99021
*==LICENSE==*/
#include "hsTypes.h"
#include "HeadSpin.h"
#include "plLocalization.h"
#include "plFile/plFileUtils.h"
#include "hsUtils.h"
plLocalization::Language plLocalization::fLanguage = plLocalization::kEnglish;

View File

@ -40,12 +40,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/
#include "plPageInfo.h"
#include "hsUtils.h"
#include "hsStream.h"
#include "pnKeyedObject/plUoid.h"
#include "plVersion.h"
static UInt32 sCurrPageInfoVersion = 6;
static uint32_t sCurrPageInfoVersion = 6;
//// Constructor/Destructor //////////////////////////////////////////////////
plPageInfo::plPageInfo()
@ -112,7 +112,7 @@ void plPageInfo::SetLocation( const plLocation &loc )
fLocation = loc;
}
void plPageInfo::AddClassVersion(UInt16 classIdx, UInt16 version)
void plPageInfo::AddClassVersion(uint16_t classIdx, uint16_t version)
{
ClassVersion cv;
cv.Class = classIdx;
@ -135,7 +135,7 @@ void plPageInfo::Read( hsStream *s )
// 5 is the earliest version since we began working again on the P20 codebase in Sep 2005,
// after Uru's online component was cancelled in Feb 2004, so I've removed support for
// anything prior to that to clean things up a bit.
UInt32 version = s->ReadLE32();
uint32_t version = s->ReadLE32();
if (version > sCurrPageInfoVersion || version < 5)
{
hsAssert( false, "Invalid header version in plPageInfo::Read()" );
@ -153,11 +153,11 @@ void plPageInfo::Read( hsStream *s )
if (version < 6)
{
UInt16 unusedMinorVersion;
uint16_t unusedMinorVersion;
s->ReadLE(&unusedMinorVersion);
Int32 unusedReleaseVersion;
int32_t unusedReleaseVersion;
s->ReadLE(&unusedReleaseVersion); // This was always zero... yanked.
UInt32 unusedFlags;
uint32_t unusedFlags;
s->ReadLE(&unusedFlags);
}
@ -168,9 +168,9 @@ void plPageInfo::Read( hsStream *s )
if (version >= 6)
{
UInt16 numClassVersions = s->ReadLE16();
uint16_t numClassVersions = s->ReadLE16();
fClassVersions.reserve(numClassVersions);
for (UInt16 i = 0; i < numClassVersions; i++)
for (uint16_t i = 0; i < numClassVersions; i++)
{
ClassVersion cv;
cv.Class = s->ReadLE16();
@ -190,9 +190,9 @@ void plPageInfo::Write( hsStream *s )
s->WriteLE( fChecksum );
s->WriteLE( fDataStart );
s->WriteLE( fIndexStart );
UInt16 numClassVersions = UInt16(fClassVersions.size());
uint16_t numClassVersions = uint16_t(fClassVersions.size());
s->WriteLE16(numClassVersions);
for (UInt16 i = 0; i < numClassVersions; i++)
for (uint16_t i = 0; i < numClassVersions; i++)
{
ClassVersion& cv = fClassVersions[i];
s->WriteLE16(cv.Class);

View File

@ -47,7 +47,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#ifndef _plPageInfo_h
#define _plPageInfo_h
#include "hsTypes.h"
#include "HeadSpin.h"
#include "pnKeyedObject/plUoid.h"
#include <vector>
@ -56,17 +56,17 @@ class plLocation;
class plPageInfo
{
public:
struct ClassVersion { UInt16 Class; UInt16 Version; };
struct ClassVersion { uint16_t Class; uint16_t Version; };
typedef std::vector<ClassVersion> ClassVerVec;
protected:
plLocation fLocation;
char* fAge;
char* fPage;
UInt16 fMajorVersion;
uint16_t fMajorVersion;
ClassVerVec fClassVersions;
UInt32 fChecksum;
UInt32 fDataStart, fIndexStart;
uint32_t fChecksum;
uint32_t fDataStart, fIndexStart;
void IInit( void );
void ISetFrom( const plPageInfo &src );
@ -84,7 +84,7 @@ public:
plPageInfo &operator=( const plPageInfo &src );
void ClearClassVersions() { fClassVersions.clear(); }
void AddClassVersion(UInt16 classIdx, UInt16 version);
void AddClassVersion(uint16_t classIdx, uint16_t version);
const ClassVerVec& GetClassVersions() const { return fClassVersions; }
void SetStrings( const char *age, const char *page );
@ -92,21 +92,21 @@ public:
void SetLocation(const plLocation& loc);
const plLocation& GetLocation() const;
UInt16 GetMajorVersion() const { return fMajorVersion; }
void SetMajorVersion(UInt16 major) { fMajorVersion = major; }
uint16_t GetMajorVersion() const { return fMajorVersion; }
void SetMajorVersion(uint16_t major) { fMajorVersion = major; }
void SetChecksum( UInt32 c ) { fChecksum = c; }
UInt32 GetChecksum( void ) const { return fChecksum; }
void SetChecksum( uint32_t c ) { fChecksum = c; }
uint32_t GetChecksum( void ) const { return fChecksum; }
void Read( hsStream *s );
void Write( hsStream *s );
hsBool IsValid( void ) const;
UInt32 GetDataStart( void ) const { return fDataStart; }
void SetDataStart( UInt32 s ) { fDataStart = s; }
uint32_t GetDataStart( void ) const { return fDataStart; }
void SetDataStart( uint32_t s ) { fDataStart = s; }
UInt32 GetIndexStart( void ) const { return fIndexStart; }
void SetIndexStart( UInt32 s ) { fIndexStart = s; }
uint32_t GetIndexStart( void ) const { return fIndexStart; }
void SetIndexStart( uint32_t s ) { fIndexStart = s; }
};
#endif // _plPageInfo_h

View File

@ -52,7 +52,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#ifndef _plRegistryHelpers_h
#define _plRegistryHelpers_h
#include "hsTypes.h"
#include "HeadSpin.h"
#include "hsTemplates.h"
#include "pnKeyedObject/plKey.h"

View File

@ -44,7 +44,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "hsStream.h"
#include <algorithm>
plRegistryKeyList::plRegistryKeyList(UInt16 classType)
plRegistryKeyList::plRegistryKeyList(uint16_t classType)
{
fClassType = classType;
fReffedStaticKeys = 0;
@ -108,7 +108,7 @@ plKeyImp* plRegistryKeyList::FindKey(const plString& keyName)
plKeyImp* plRegistryKeyList::FindKey(const plUoid& uoid)
{
UInt32 objectID = uoid.GetObjectID();
uint32_t objectID = uoid.GetObjectID();
// Key is dynamic or doesn't know it's index. Do a find by name.
if (objectID == 0)
@ -202,7 +202,7 @@ void plRegistryKeyList::AddKey(plKeyImp* key, LoadStatus& loadStatusChange)
void plRegistryKeyList::SetKeyUsed(plKeyImp* key)
{
// If this is a static key, mark that we used it. Otherwise, just ignore it.
UInt32 id = key->GetUoid().GetObjectID();
uint32_t id = key->GetUoid().GetObjectID();
if (id > 0)
fReffedStaticKeys++;
}
@ -220,7 +220,7 @@ bool plRegistryKeyList::SetKeyUnused(plKeyImp* key, LoadStatus& loadStatusChange
}
// Check if it's a static key
UInt32 id = key->GetUoid().GetObjectID();
uint32_t id = key->GetUoid().GetObjectID();
hsAssert(id <= fStaticKeys.size(), "Bad static key id");
if (id != 0 && id <= fStaticKeys.size())
{
@ -293,7 +293,7 @@ void plRegistryKeyList::PrepForWrite()
}
// Start our new object id's after any already created ones
UInt32 objectID = fStaticKeys.size()+1;
uint32_t objectID = fStaticKeys.size()+1;
// Make room for our new keys
fStaticKeys.resize(fStaticKeys.size()+numDynKeys);
@ -318,7 +318,7 @@ void plRegistryKeyList::PrepForWrite()
void plRegistryKeyList::Read(hsStream* s)
{
UInt32 keyListLen = s->ReadLE32();
uint32_t keyListLen = s->ReadLE32();
if (!fStaticKeys.empty())
{
s->Skip(keyListLen);
@ -327,12 +327,12 @@ void plRegistryKeyList::Read(hsStream* s)
fFlags = s->ReadByte();
UInt32 numKeys = s->ReadLE32();
uint32_t numKeys = s->ReadLE32();
fStaticKeys.resize(numKeys);
for (int i = 0; i < numKeys; i++)
{
plKeyImp* newKey = TRACKED_NEW plKeyImp;
plKeyImp* newKey = new plKeyImp;
newKey->Read(s);
fStaticKeys[i] = newKey;
}
@ -341,7 +341,7 @@ void plRegistryKeyList::Read(hsStream* s)
void plRegistryKeyList::Write(hsStream* s)
{
// Save space for the length of our data
UInt32 beginPos = s->GetPosition();
uint32_t beginPos = s->GetPosition();
s->WriteLE32(0);
s->WriteByte(fFlags);
@ -356,8 +356,8 @@ void plRegistryKeyList::Write(hsStream* s)
}
// Go back to the start and write the length of our data
UInt32 endPos = s->GetPosition();
uint32_t endPos = s->GetPosition();
s->SetPosition(beginPos);
s->WriteLE32(endPos-beginPos-sizeof(UInt32));
s->WriteLE32(endPos-beginPos-sizeof(uint32_t));
s->SetPosition(endPos);
}

View File

@ -42,7 +42,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#ifndef plRegistryKeyList_h_inc
#define plRegistryKeyList_h_inc
#include "hsTypes.h"
#include "HeadSpin.h"
#include "pnKeyedObject/plKeyImp.h"
#include <vector>
#include <set>
@ -67,19 +67,19 @@ class plRegistryKeyList
protected:
friend class plKeyFinder;
UInt16 fClassType;
uint16_t fClassType;
// Lock counter for iterating. If this is >0, don't do any ops that
// can change key positions in the array (instead, just leave holes)
UInt16 fLocked;
uint16_t fLocked;
enum Flags { kStaticUnsorted = 0x1 };
UInt8 fFlags;
uint8_t fFlags;
// Static keys are one's we read off disk. These don't change and are
// assumed to be already sorted when they're read in.
typedef std::vector<plKeyImp*> StaticVec;
StaticVec fStaticKeys;
UInt32 fReffedStaticKeys; // Number of static keys that are loaded
uint32_t fReffedStaticKeys; // Number of static keys that are loaded
// Dynamic keys are anything created at runtime. They are put in the
// correct sorted position when they are added
@ -94,10 +94,10 @@ protected:
void IRepack();
public:
plRegistryKeyList(UInt16 classType);
plRegistryKeyList(uint16_t classType);
~plRegistryKeyList();
UInt16 GetClassType() const { return fClassType; }
uint16_t GetClassType() const { return fClassType; }
// Find a key by name (case-insensitive)
plKeyImp* FindKey(const plString& keyName);

View File

@ -106,7 +106,7 @@ plRegistryPageNode::~plRegistryPageNode()
PageCond plRegistryPageNode::IVerify()
{
// Check the checksum values first, to make sure the files aren't corrupt
UInt32 ourChecksum = 0;
uint32_t ourChecksum = 0;
hsStream* stream = OpenStream();
if (stream)
{
@ -127,7 +127,7 @@ PageCond plRegistryPageNode::IVerify()
for (int i = 0; i < classVersions.size(); i++)
{
const plPageInfo::ClassVersion& cv = classVersions[i];
UInt16 curVersion = plVersion::GetCreatableVersion(cv.Class);
uint16_t curVersion = plVersion::GetCreatableVersion(cv.Class);
if (curVersion > cv.Version)
return kPageOutOfDate;
@ -175,18 +175,18 @@ void plRegistryPageNode::LoadKeys()
// If we're loading keys in the middle of a read because FindKey() failed, we'd better
// make note of our stream position and restore it when we're done.
UInt32 oldPos = stream->GetPosition();
uint32_t oldPos = stream->GetPosition();
stream->SetPosition(GetPageInfo().GetIndexStart());
// Read in the number of key types
UInt32 numTypes = stream->ReadLE32();
for (UInt32 i = 0; i < numTypes; i++)
uint32_t numTypes = stream->ReadLE32();
for (uint32_t i = 0; i < numTypes; i++)
{
UInt16 classType = stream->ReadLE16();
uint16_t classType = stream->ReadLE16();
plRegistryKeyList* keyList = IGetKeyList(classType);
if (!keyList)
{
keyList = TRACKED_NEW plRegistryKeyList(classType);
keyList = new plRegistryKeyList(classType);
fKeyLists[classType] = keyList;
}
keyList->Read(stream);
@ -300,7 +300,7 @@ hsBool plRegistryPageNode::IterateKeys(plRegistryKeyIterator* iterator) const
// Restricted version that only iterates through the keys of a given class
// type.
hsBool plRegistryPageNode::IterateKeys(plRegistryKeyIterator* iterator, UInt16 classToRestrictTo) const
hsBool plRegistryPageNode::IterateKeys(plRegistryKeyIterator* iterator, uint16_t classToRestrictTo) const
{
plRegistryKeyList* keyList = IGetKeyList(classToRestrictTo);
if (keyList != nil)
@ -309,7 +309,7 @@ hsBool plRegistryPageNode::IterateKeys(plRegistryKeyIterator* iterator, UInt16 c
return true;
}
plKeyImp* plRegistryPageNode::FindKey(UInt16 classType, const plString& name) const
plKeyImp* plRegistryPageNode::FindKey(uint16_t classType, const plString& name) const
{
plRegistryKeyList* keys = IGetKeyList(classType);
if (keys == nil)
@ -329,11 +329,11 @@ plKeyImp* plRegistryPageNode::FindKey(const plUoid& uoid) const
void plRegistryPageNode::AddKey(plKeyImp* key)
{
UInt16 classType = key->GetUoid().GetClassType();
uint16_t classType = key->GetUoid().GetClassType();
plRegistryKeyList* keys = fKeyLists[classType];
if (keys == nil)
{
keys = TRACKED_NEW plRegistryKeyList(classType);
keys = new plRegistryKeyList(classType);
fKeyLists[classType] = keys;
}
@ -401,7 +401,7 @@ hsBool plRegistryPageNode::SetKeyUnused(plKeyImp* key)
return removed;
}
plRegistryKeyList* plRegistryPageNode::IGetKeyList(UInt16 classType) const
plRegistryKeyList* plRegistryPageNode::IGetKeyList(uint16_t classType) const
{
KeyMap::const_iterator it = fKeyLists.find(classType);
if (it != fKeyLists.end())

View File

@ -42,7 +42,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#ifndef plRegistryNode_h_inc
#define plRegistryNode_h_inc
#include "hsTypes.h"
#include "HeadSpin.h"
#include "hsStream.h"
#include "plPageInfo.h"
@ -71,7 +71,7 @@ protected:
friend class plKeyFinder;
// Map from class type to a list of keys of that type
typedef std::map<UInt16, plRegistryKeyList*> KeyMap;
typedef std::map<uint16_t, plRegistryKeyList*> KeyMap;
KeyMap fKeyLists;
int fDynLoadedTypes; // The number of key types that have dynamic keys loaded
int fStaticLoadedTypes; // The number of key types that have all their keys loaded
@ -81,13 +81,13 @@ protected:
plPageInfo fPageInfo; // Info about this page
hsBufferedStream fStream; // Stream for reading/writing our page
UInt8 fOpenRequests; // How many handles there are to fStream (or
uint8_t fOpenRequests; // How many handles there are to fStream (or
// zero if it's closed)
hsBool fIsNewPage; // True if this page is new (not read off disk)
plRegistryPageNode() {}
plRegistryKeyList* IGetKeyList(UInt16 classType) const;
plRegistryKeyList* IGetKeyList(uint16_t classType) const;
PageCond IVerify();
public:
@ -118,7 +118,7 @@ public:
void UnloadKeys(); // Frees all our keys
// Find a key by type and name
plKeyImp* FindKey(UInt16 classType, const plString& name) const;
plKeyImp* FindKey(uint16_t classType, const plString& name) const;
// Find a key by direct uoid lookup (or fallback to name lookup if that doesn't work)
plKeyImp* FindKey(const plUoid& uoid) const;
@ -131,7 +131,7 @@ public:
hsBool SetKeyUnused(plKeyImp* key);
hsBool IterateKeys(plRegistryKeyIterator* iterator) const;
hsBool IterateKeys(plRegistryKeyIterator* iterator, UInt16 classToRestrictTo) const;
hsBool IterateKeys(plRegistryKeyIterator* iterator, uint16_t classToRestrictTo) const;
// Call this to get a read stream for the page. If a valid pointer is
// returned, make sure to call CloseStream when you're done using it.

View File

@ -71,7 +71,7 @@ hsBool gDataServerLocal = false;
/// Logging #define for easier use
#define kResMgrLog(level, log) if (plResMgrSettings::Get().GetLoggingLevel() >= level) log
static void ILog(UInt8 level, const char* format, ...)
static void ILog(uint8_t level, const char* format, ...)
{
static plStatusLog* log = plStatusLogMgr::GetInstance().CreateStatusLog
(
@ -83,7 +83,7 @@ static void ILog(UInt8 level, const char* format, ...)
va_list arguments;
va_start(arguments, format);
UInt32 color = 0;
uint32_t color = 0;
switch (level)
{
case 1: color = 0xffffffff; break;
@ -139,7 +139,7 @@ hsBool plResManager::IInit()
char fileName[kFolderIterator_MaxPath];
pathIterator.GetPathAndName(fileName);
plRegistryPageNode* node = TRACKED_NEW plRegistryPageNode(fileName);
plRegistryPageNode* node = new plRegistryPageNode(fileName);
fAllPages.insert(node);
}
}
@ -148,12 +148,12 @@ hsBool plResManager::IInit()
CreatePage(plLocation::kGlobalFixedLoc, "Global", "FixedKeys");
hsAssert(!fDispatch, "Dispatch already set");
fDispatch = TRACKED_NEW plDispatch;
fDispatch = new plDispatch;
plgTimerCallbackMgr::Init();
// Init our helper
fMyHelper = TRACKED_NEW plResManagerHelper(this);
fMyHelper = new plResManagerHelper(this);
fMyHelper->Init();
hsAssert(fMyHelper->GetKey() != nil, "ResManager helper didn't init properly!" );
@ -234,7 +234,7 @@ void plResManager::IShutdown()
void plResManager::AddSinglePage(const char* pagePath)
{
plRegistryPageNode* node = TRACKED_NEW plRegistryPageNode(pagePath);
plRegistryPageNode* node = new plRegistryPageNode(pagePath);
AddPage(node);
}
@ -280,8 +280,8 @@ hsKeyedObject* plResManager::IGetSharedObject(plKeyImp* pKey)
plKeyImp* origKey = (plKeyImp*)pKey->GetCloneOwner();
// Find the first non-nil key and ask it to clone itself
UInt32 count = origKey->GetNumClones();
for (UInt32 i = 0; i < count; i++)
uint32_t count = origKey->GetNumClones();
for (uint32_t i = 0; i < count; i++)
{
plKey cloneKey = origKey->GetCloneByIdx(i);
if (cloneKey)
@ -351,10 +351,10 @@ hsBool plResManager::ReadObject(plKeyImp* key)
hsBool plResManager::IReadObject(plKeyImp* pKey, hsStream *stream)
{
static UInt64 totalTime = 0;
static uint64_t totalTime = 0;
UInt64 startTotalTime = totalTime;
UInt64 startTime = 0;
uint64_t startTotalTime = totalTime;
uint64_t startTime = 0;
if (fLogReadTimes)
startTime = hsTimer::GetFullTickCount();
@ -364,10 +364,10 @@ hsBool plResManager::IReadObject(plKeyImp* pKey, hsStream *stream)
if (pKey->GetUoid().GetLoadMask().DontLoad())
return nil;
hsAssert(pKey->GetStartPos() != UInt32(-1), "Missing StartPos");
hsAssert(pKey->GetDataLen() != UInt32(-1), "Missing Data Length");
hsAssert(pKey->GetStartPos() != uint32_t(-1), "Missing StartPos");
hsAssert(pKey->GetDataLen() != uint32_t(-1), "Missing Data Length");
if (pKey->GetStartPos() == UInt32(-1) || pKey->GetDataLen() == UInt32(-1))
if (pKey->GetStartPos() == uint32_t(-1) || pKey->GetDataLen() == uint32_t(-1))
return false; // Try to recover from this by just not reading an object
kResMgrLog(3, ILog(3, " Reading object %s::%s", plFactory::GetNameOfClass(pKey->GetUoid().GetClassType()), pKey->GetUoid().GetObjectName()));
@ -444,8 +444,8 @@ hsBool plResManager::IReadObject(plKeyImp* pKey, hsStream *stream)
if (fLogReadTimes)
{
UInt64 ourTime = hsTimer::GetFullTickCount() - startTime;
UInt64 childTime = totalTime - startTotalTime;
uint64_t ourTime = hsTimer::GetFullTickCount() - startTime;
uint64_t childTime = totalTime - startTotalTime;
ourTime -= childTime;
plStatusLog::AddLineS("readtimings.log", plStatusLog::kWhite, "%s, %s, %u, %.1f",
@ -466,10 +466,10 @@ class plPageOutIterator : public plRegistryPageIterator
{
protected:
plResManager* fResMgr;
UInt16 fHint;
uint16_t fHint;
public:
plPageOutIterator(plResManager* resMgr, UInt16 hint) : fResMgr(resMgr), fHint(hint)
plPageOutIterator(plResManager* resMgr, uint16_t hint) : fResMgr(resMgr), fHint(hint)
{
fResMgr->IterateAllPages(this);
}
@ -511,7 +511,7 @@ void plResManager::IPageOutSceneNodes(hsBool forceAll)
if (forceAll)
{
hsStatusMessage( "--- plResManager Object Leak Report (BEGIN) ---" );
plPageOutIterator iter(this, UInt16(-1));
plPageOutIterator iter(this, uint16_t(-1));
hsStatusMessage( "--- plResManager Object Leak Report (END) ---" );
}
else
@ -572,7 +572,7 @@ plKey plResManager::FindOriginalKey(const plUoid& uoid)
// Note: startPos of -1 means we didn't read it from disk, but 0 length
// is our special key that we're a passively created key
foundKey = TRACKED_NEW plKeyImp(uoid, UInt32(-1), UInt32(0));
foundKey = new plKeyImp(uoid, uint32_t(-1), uint32_t(0));
key = plKey::Make(foundKey);
}
@ -754,7 +754,7 @@ plKey plResManager::NewKey(plUoid& newUoid, hsKeyedObject* object)
{
hsAssert(fInited, "Attempting to create a new key before we're inited!");
plKeyImp* newKey = TRACKED_NEW plKeyImp;
plKeyImp* newKey = new plKeyImp;
newKey->SetUoid(newUoid);
AddKey(newKey);
@ -815,7 +815,7 @@ plKey plResManager::ReRegister(const plString& nm, const plUoid& oid)
}
}
plKeyImp* pKey = TRACKED_NEW plKeyImp;
plKeyImp* pKey = new plKeyImp;
if (canClone && pOrigKey)
{
pKey->CopyForClone((plKeyImp*)pOrigKey, fCurClonePlayerID, fCurCloneID);
@ -913,7 +913,7 @@ plKey plResManager::CloneKey(const plKey& objKey)
return ICloneKey(objKey->GetUoid(), plNetClientApp::GetInstance()->GetPlayerID(), fCloningCounter);
}
plKey plResManager::ICloneKey(const plUoid& objUoid, UInt32 playerID, UInt32 cloneID)
plKey plResManager::ICloneKey(const plUoid& objUoid, uint32_t playerID, uint32_t cloneID)
{
hsAssert(fCurCloneID == 0, "Recursive clone");
fCurCloneID = cloneID;
@ -925,7 +925,7 @@ plKey plResManager::ICloneKey(const plUoid& objUoid, UInt32 playerID, UInt32 clo
fCurCloneID = 0;
// Then notify NetClientMgr when object loads
plObjRefMsg* refMsg = TRACKED_NEW plObjRefMsg(plNetClientApp::GetInstance()->GetKey(), plRefMsg::kOnCreate, 0, 0);
plObjRefMsg* refMsg = new plObjRefMsg(plNetClientApp::GetInstance()->GetKey(), plRefMsg::kOnCreate, 0, 0);
AddViaNotify(cloneKey, refMsg, plRefFlags::kPassiveRef);
return cloneKey;
@ -950,7 +950,7 @@ hsBool plResManager::Unload(const plKey& objKey)
plCreatable* plResManager::IReadCreatable(hsStream* s) const
{
UInt16 hClass = s->ReadLE16();
uint16_t hClass = s->ReadLE16();
plCreatable* pCre = plFactory::Create(hClass);
if (!pCre)
hsAssert( hClass == 0x8000, "Invalid creatable index" );
@ -976,7 +976,7 @@ plCreatable* plResManager::ReadCreatableVersion(hsStream* s)
inline void IWriteCreatable(hsStream* s, plCreatable* pCre)
{
Int16 hClass = pCre ? pCre->ClassIndex() : 0x8000;
int16_t hClass = pCre ? pCre->ClassIndex() : 0x8000;
hsAssert(pCre == nil || plFactory::IsValidClassIndex(hClass), "Invalid class index on write");
s->WriteLE16(hClass);
}
@ -1063,7 +1063,7 @@ void plResManager::LoadAgeKeys(const char* age)
kResMgrLog(1, ILog(1, "Loading age keys for age %s", age));
hsStatusMessageF("*** Loading age keys for age %s ***\n", age);
plResAgeHolder* holder = TRACKED_NEW plResAgeHolder(age);
plResAgeHolder* holder = new plResAgeHolder(age);
fHeldAgeKeys[age] = holder;
// Go find pages that match this age, load the keys, and ref them all
plResHolderIterator iter(age, holder->fKeys, this);
@ -1127,12 +1127,12 @@ void plResManager::IDropAllAgeKeys()
class plOurRefferAndFinder : public plRegistryKeyIterator
{
hsTArray<plKey> &fRefArray;
UInt16 fClassToFind;
uint16_t fClassToFind;
plKey &fFoundKey;
public:
plOurRefferAndFinder( hsTArray<plKey> &refArray, UInt16 classToFind, plKey &foundKey )
plOurRefferAndFinder( hsTArray<plKey> &refArray, uint16_t classToFind, plKey &foundKey )
: fRefArray( refArray ), fClassToFind( classToFind ), fFoundKey( foundKey ) { }
virtual hsBool EatKey( const plKey& key )
@ -1150,9 +1150,9 @@ class plOurRefferAndFinder : public plRegistryKeyIterator
}
};
void plResManager::PageInRoom(const plLocation& page, UInt16 objClassToRef, plRefMsg* refMsg)
void plResManager::PageInRoom(const plLocation& page, uint16_t objClassToRef, plRefMsg* refMsg)
{
UInt64 readRoomTime = 0;
uint64_t readRoomTime = 0;
if (fLogReadTimes)
readRoomTime = hsTimer::GetFullTickCount();
@ -1259,7 +1259,7 @@ public:
plPageInAgeIter(plKey destKey, const char *ageName) : fDestKey(destKey), fAgeName(ageName) {}
~plPageInAgeIter()
{
plClientMsg* pMsg1 = TRACKED_NEW plClientMsg(plClientMsg::kLoadRoomHold);
plClientMsg* pMsg1 = new plClientMsg(plClientMsg::kLoadRoomHold);
for (int i = 0; i < fLocations.size(); i++)
{
pMsg1->AddRoomLoc(fLocations[i]);
@ -1286,7 +1286,7 @@ void plResManager::PageInAge(const char *age)
plKey clientKey = hsgResMgr::ResMgr()->FindKey(lu);
// Tell the client to load all the keys for this age, to make the loading process work better
plClientMsg *loadAgeKeysMsg = TRACKED_NEW plClientMsg(plClientMsg::kLoadAgeKeys);
plClientMsg *loadAgeKeysMsg = new plClientMsg(plClientMsg::kLoadAgeKeys);
loadAgeKeysMsg->SetAgeName(age);
loadAgeKeysMsg->Send(clientKey);
@ -1510,7 +1510,7 @@ void plResManager::DumpUnusedKeys(plRegistryPageNode* page) const
plRegistryPageNode* plResManager::CreatePage(const plLocation& location, const char* age, const char* page)
{
plRegistryPageNode* pageNode = TRACKED_NEW plRegistryPageNode(location, age, page, fDataPath.c_str());
plRegistryPageNode* pageNode = new plRegistryPageNode(location, age, page, fDataPath.c_str());
fAllPages.insert(pageNode);
return pageNode;
@ -1549,7 +1549,7 @@ static void sIReportLeak(plKeyImp* key, plRegistryPageNode* page)
class plKeyImpRef : public plKeyImp
{
public:
UInt16 GetRefCnt() const { return fRefCount; }
uint16_t GetRefCnt() const { return fRefCount; }
};
static bool alreadyDone = false;
@ -1594,7 +1594,7 @@ static void sIReportLeak(plKeyImp* key, plRegistryPageNode* page)
// Update 5.20: since there are so many problems with doing this, don't
// delete the objects, just print out a memleak report. -mcn
void plResManager::UnloadPageObjects(plRegistryPageNode* pageNode, UInt16 classIndexHint)
void plResManager::UnloadPageObjects(plRegistryPageNode* pageNode, uint16_t classIndexHint)
{
if (!pageNode->IsLoaded())
return;
@ -1613,7 +1613,7 @@ void plResManager::UnloadPageObjects(plRegistryPageNode* pageNode, UInt16 classI
plUnloadObjectsIterator iterator;
if (classIndexHint != UInt16(-1))
if (classIndexHint != uint16_t(-1))
pageNode->IterateKeys(&iterator, classIndexHint);
else
pageNode->IterateKeys(&iterator);

View File

@ -135,7 +135,7 @@ public:
//---------------------------
void LoadAgeKeys(const char* age);
void DropAgeKeys(const char* age);
void PageInRoom(const plLocation& page, UInt16 objClassToRef, plRefMsg* refMsg);
void PageInRoom(const plLocation& page, uint16_t objClassToRef, plRefMsg* refMsg);
void PageInAge(const char* age);
// Usually, a page file is kept open during load because the first keyed object
@ -161,7 +161,7 @@ public:
// Helpers for key iterators
void LoadPageKeys(plRegistryPageNode* pageNode);
void UnloadPageObjects(plRegistryPageNode* pageNode, UInt16 classIndexHint);
void UnloadPageObjects(plRegistryPageNode* pageNode, uint16_t classIndexHint);
void DumpUnusedKeys(plRegistryPageNode* page) const;
plRegistryPageNode* FindPage(const plLocation& location) const;
plRegistryPageNode* FindPage(const char* age, const char* page) const;
@ -179,7 +179,7 @@ protected:
virtual hsBool IReadObject(plKeyImp* pKey, hsStream *stream);
plCreatable* IReadCreatable(hsStream* s) const;
plKey ICloneKey(const plUoid& objUoid, UInt32 playerID, UInt32 cloneID);
plKey ICloneKey(const plUoid& objUoid, uint32_t playerID, uint32_t cloneID);
virtual void IKeyReffed(plKeyImp* key);
virtual void IKeyUnreffed(plKeyImp* key);
@ -209,7 +209,7 @@ protected:
plRegistryPageNode* CreatePage(const plLocation& location, const char* age, const char* page);
hsBool fInited;
UInt16 fPageOutHint;
uint16_t fPageOutHint;
// True if we're reading in an object. We only read one object at a time
hsBool fReadingObject;
@ -219,9 +219,9 @@ protected:
plDispatch* fDispatch;
UInt32 fCurCloneID; // Current clone ID. If it isn't zero, we're cloning
UInt32 fCurClonePlayerID;
UInt32 fCloningCounter; // Next clone ID to use.
uint32_t fCurCloneID; // Current clone ID. If it isn't zero, we're cloning
uint32_t fCurClonePlayerID;
uint32_t fCloningCounter; // Next clone ID to use.
typedef std::map<std::string,plResAgeHolder*> HeldAgeKeyMap;
HeldAgeKeyMap fHeldAgeKeys;
@ -231,7 +231,7 @@ protected:
hsBool fLogReadTimes;
UInt8 fPageListLock; // Number of locks on the page lists. If it's greater than zero, they can't be modified
uint8_t fPageListLock; // Number of locks on the page lists. If it's greater than zero, they can't be modified
hsBool fPagesNeedCleanup; // True if something modified the page lists while they were locked.
typedef std::set<plRegistryPageNode*> PageSet;

View File

@ -50,7 +50,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
//
//////////////////////////////////////////////////////////////////////////////
#include "hsTypes.h"
#include "HeadSpin.h"
#include "plResManagerHelper.h"
#include "plResManager.h"
#include "plRegistryNode.h"
@ -174,8 +174,8 @@ void plResManagerHelper::LoadAndHoldPageKeys( plRegistryPageNode *page )
hsAssert( GetKey() != nil, "Can't load and hold keys when we don't have a key for the helper" );
// Create our msg
plResMgrHelperMsg *refferMsg = TRACKED_NEW plResMgrHelperMsg( plResMgrHelperMsg::kKeyRefList );
refferMsg->fKeyList = TRACKED_NEW plResPageKeyRefList;
plResMgrHelperMsg *refferMsg = new plResMgrHelperMsg( plResMgrHelperMsg::kKeyRefList );
refferMsg->fKeyList = new plResPageKeyRefList;
fResManager->LoadPageKeys(page);
page->IterateKeys( refferMsg->fKeyList );
@ -214,7 +214,7 @@ class plResMgrDebugInterface : public plInputInterface
plResMgrDebugInterface( plResManagerHelper * const mgr ) : fParent( mgr ) { SetEnabled( true ); }
virtual UInt32 GetPriorityLevel( void ) const { return kGUISystemPriority + 10; }
virtual uint32_t GetPriorityLevel( void ) const { return kGUISystemPriority + 10; }
virtual hsBool InterpretInputEvent( plInputEventMsg *pMsg )
{
plKeyEventMsg *pKeyMsg = plKeyEventMsg::ConvertNoRef( pMsg );
@ -240,7 +240,7 @@ class plResMgrDebugInterface : public plInputInterface
}
else if( pKeyMsg->GetKeyCode() == KEY_ESCAPE )
{
plResMgrHelperMsg *msg = TRACKED_NEW plResMgrHelperMsg( plResMgrHelperMsg::kDisableDebugScreen );
plResMgrHelperMsg *msg = new plResMgrHelperMsg( plResMgrHelperMsg::kDisableDebugScreen );
msg->Send( fParent->GetKey() );
return true;
}
@ -268,7 +268,7 @@ class plResMgrDebugInterface : public plInputInterface
return false;
}
virtual UInt32 GetCurrentCursorID( void ) const { return 0; }
virtual uint32_t GetCurrentCursorID( void ) const { return 0; }
virtual hsBool HasInterestingCursorID( void ) const { return false; }
};
@ -286,12 +286,12 @@ void plResManagerHelper::EnableDebugScreen( hsBool enable )
fDebugScreen = plStatusLogMgr::GetInstance().CreateStatusLog( kLogSize, "ResManager Status", plStatusLog::kFilledBackground | plStatusLog::kDontWriteFile );
fRefreshing = true;
plResMgrHelperMsg *msg = TRACKED_NEW plResMgrHelperMsg( plResMgrHelperMsg::kUpdateDebugScreen );
plResMgrHelperMsg *msg = new plResMgrHelperMsg( plResMgrHelperMsg::kUpdateDebugScreen );
// msg->SetTimeStamp( hsTimer::GetSysSeconds() + kUpdateDelay );
msg->Send( GetKey() );
fDebugInput = TRACKED_NEW plResMgrDebugInterface( this );
plInputIfaceMgrMsg *imsg = TRACKED_NEW plInputIfaceMgrMsg( plInputIfaceMgrMsg::kAddInterface );
fDebugInput = new plResMgrDebugInterface( this );
plInputIfaceMgrMsg *imsg = new plInputIfaceMgrMsg( plInputIfaceMgrMsg::kAddInterface );
imsg->SetIFace( fDebugInput );
imsg->Send();
}
@ -304,7 +304,7 @@ void plResManagerHelper::EnableDebugScreen( hsBool enable )
delete fDebugScreen;
fDebugScreen = nil;
plInputIfaceMgrMsg *imsg = TRACKED_NEW plInputIfaceMgrMsg( plInputIfaceMgrMsg::kRemoveInterface );
plInputIfaceMgrMsg *imsg = new plInputIfaceMgrMsg( plInputIfaceMgrMsg::kRemoveInterface );
imsg->SetIFace( fDebugInput );
imsg->Send();
@ -322,14 +322,14 @@ class plDebugPrintIterator : public plRegistryPageIterator, plRegistryKeyIterato
{
public:
plStatusLog *fLog;
UInt8 fStep, fLines;
UInt32 &fLoadedCount, &fHoldingCount, fPageCount, fAgeIndex;
uint8_t fStep, fLines;
uint32_t &fLoadedCount, &fHoldingCount, fPageCount, fAgeIndex;
char fCurrAge[ 128 ];
UInt32 fLoadedKeys, fTotalKeys, fTotalSize, fLoadedSize;
uint32_t fLoadedKeys, fTotalKeys, fTotalSize, fLoadedSize;
plResManagerHelper *fParent;
plDebugPrintIterator( plResManagerHelper *parent, plStatusLog *log, UInt32 &loadedCount, UInt32 &holdingCount )
plDebugPrintIterator( plResManagerHelper *parent, plStatusLog *log, uint32_t &loadedCount, uint32_t &holdingCount )
: fParent( parent ), fLog( log ), fStep( 0 ), fLines( 0 ), fLoadedCount( loadedCount ), fHoldingCount( holdingCount )
{
fLoadedCount = fHoldingCount = 0;
@ -368,7 +368,7 @@ class plDebugPrintIterator : public plRegistryPageIterator, plRegistryKeyIterato
{
if( fLines < kLogSize - 4 )
{
UInt32 color = plStatusLog::kWhite;
uint32_t color = plStatusLog::kWhite;
if( fParent->fCurrAge == fAgeIndex )
color = plStatusLog::kYellow;
@ -491,7 +491,7 @@ void plResManagerHelper::IUpdateDebugScreen( hsBool force )
return;
plRegistry *reg = fResManager->IGetRegistry();
UInt32 loadedCnt, holdingCnt;
uint32_t loadedCnt, holdingCnt;
fDebugScreen->Clear();
@ -507,7 +507,7 @@ void plResManagerHelper::IUpdateDebugScreen( hsBool force )
// Repump our update
if( !force )
{
plResMgrHelperMsg *msg = TRACKED_NEW plResMgrHelperMsg( plResMgrHelperMsg::kUpdateDebugScreen );
plResMgrHelperMsg *msg = new plResMgrHelperMsg( plResMgrHelperMsg::kUpdateDebugScreen );
msg->SetTimeStamp( hsTimer::GetSysSeconds() + kUpdateDelay );
msg->Send( GetKey() );
}

View File

@ -53,7 +53,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#ifndef _plResManagerHelper_h
#define _plResManagerHelper_h
#include "hsTypes.h"
#include "HeadSpin.h"
#include "hsTemplates.h"
#include "plRegistryHelpers.h"
#include "pnKeyedObject/hsKeyedObject.h"

View File

@ -53,7 +53,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#ifndef _plResMgrSettings_h
#define _plResMgrSettings_h
#include "hsTypes.h"
#include "HeadSpin.h"
class plResMgrSettings
{
@ -63,7 +63,7 @@ protected:
bool fFilterOlderPageVersions;
bool fFilterNewerPageVersions;
UInt8 fLoggingLevel;
uint8_t fLoggingLevel;
bool fPassiveKeyRead;
bool fLoadPagesOnInit;
@ -93,8 +93,8 @@ public:
bool GetFilterNewerPageVersions() const { return fFilterNewerPageVersions; }
void SetFilterNewerPageVersions(bool f) { fFilterNewerPageVersions = f; }
UInt8 GetLoggingLevel() const { return fLoggingLevel; }
void SetLoggingLevel(UInt8 level) { fLoggingLevel = level; }
uint8_t GetLoggingLevel() const { return fLoggingLevel; }
void SetLoggingLevel(uint8_t level) { fLoggingLevel = level; }
bool GetPassiveKeyRead() const { return fPassiveKeyRead; }
void SetPassiveKeyRead(bool p) { fPassiveKeyRead = p; }

View File

@ -52,7 +52,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
// creatable that was changed. Every time the minor version is reset (for a
// major version change), delete all the entries.
//
static void GetChangedCreatables(int minorVersion, std::vector<UInt16>& creatables)
static void GetChangedCreatables(int minorVersion, std::vector<uint16_t>& creatables)
{
ChangedCreatable(1, plLoadAvatarMsg);
ChangedCreatable(1, plArmatureMod);
@ -72,18 +72,18 @@ static void CalcCreatableVersions()
for (int minorVer = 1; minorVer <= PLASMA2_MINOR_VERSION; minorVer++)
{
std::vector<UInt16> changedTypes;
std::vector<uint16_t> changedTypes;
changedTypes.reserve(10);
GetChangedCreatables(minorVer, changedTypes);
for (int i = 0; i < changedTypes.size(); i++)
{
UInt16 changedType = changedTypes[i];
uint16_t changedType = changedTypes[i];
CreatableVersions[changedType] = minorVer;
// Bump any classes that derive from this one
for (UInt16 toCheck = 0; toCheck < plFactory::GetNumClasses(); toCheck++)
for (uint16_t toCheck = 0; toCheck < plFactory::GetNumClasses(); toCheck++)
{
if (plFactory::DerivesFrom(changedType, toCheck))
CreatableVersions[toCheck] = minorVer;
@ -92,10 +92,10 @@ static void CalcCreatableVersions()
}
}
UInt16 plVersion::GetMajorVersion() { return PLASMA2_MAJOR_VERSION; }
UInt16 plVersion::GetMinorVersion() { return PLASMA2_MINOR_VERSION; }
uint16_t plVersion::GetMajorVersion() { return PLASMA2_MAJOR_VERSION; }
uint16_t plVersion::GetMinorVersion() { return PLASMA2_MINOR_VERSION; }
int plVersion::GetCreatableVersion(UInt16 creatableIndex)
int plVersion::GetCreatableVersion(uint16_t creatableIndex)
{
static bool calced = false;
if (!calced)

View File

@ -42,7 +42,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#ifndef plVersion_h_inc
#define plVersion_h_inc
#include "hsTypes.h"
#include "HeadSpin.h"
// RULES:
// Log your change
@ -59,14 +59,14 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
class plVersion
{
public:
static UInt16 GetMajorVersion();
static UInt16 GetMinorVersion();
static uint16_t GetMajorVersion();
static uint16_t GetMinorVersion();
// Pass in a creatable index to get its current version. Zero means it
// hasn't changed since the last major version change, anything else is the
// last minor version it changed at. This takes into account the version of
// parent classes.
static int GetCreatableVersion(UInt16 creatableIndex);
static int GetCreatableVersion(uint16_t creatableIndex);
};
/* Major Log ---Death to those who do not log changes---
@ -138,7 +138,7 @@ public:
64 10/28/05 jeff changed plLocation to handle more pages and plUoid for optimization reasons
65 2/22/06 bob animation key rewrite to save space
66 2/27/06 bob 64-bit quaternion anim keys
67 2/28/06 bob Anims store UInt16 frame numbers, not 32-bit float times.
67 2/28/06 bob Anims store uint16_t frame numbers, not 32-bit float times.
68 3/03/06 bob constant anim channels (plMatrixConstant, plScalarConstant had no R/W methods)
69 5/08/06 bob changed plVertCoder and hsMatrix44::Read/Write
70 2/12/07 bob Merged in several registry/resMangaer fixes