Browse Source

Fix several errors and warnings from GCC compilation

Michael Hansen 13 years ago
parent
commit
ad66286a17
  1. 11
      Sources/Plasma/Apps/plClient/plClient.cpp
  2. 8
      Sources/Plasma/CoreLib/plGeneric.h
  3. 2
      Sources/Plasma/CoreLib/plString.h
  4. 14
      Sources/Plasma/FeatureLib/pfAnimation/plAnimDebugList.cpp
  5. 4
      Sources/Plasma/FeatureLib/pfAudio/plRandomSoundMod.cpp
  6. 2
      Sources/Plasma/FeatureLib/pfCamera/plCameraBrain.cpp
  7. 2
      Sources/Plasma/FeatureLib/pfConsole/pfAvatarConsoleCommands.cpp
  8. 26
      Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp
  9. 2
      Sources/Plasma/FeatureLib/pfConsole/pfDispatchLog.cpp
  10. 2
      Sources/Plasma/FeatureLib/pfConsoleCore/pfConsoleEngine.cpp
  11. 2
      Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIListElement.cpp
  12. 2
      Sources/Plasma/FeatureLib/pfPython/cyAvatar.cpp
  13. 3
      Sources/Plasma/FeatureLib/pfPython/cyMisc.cpp
  14. 12
      Sources/Plasma/FeatureLib/pfPython/cyPhysics.cpp
  15. 4
      Sources/Plasma/FeatureLib/pfPython/plPythonFileMod.cpp
  16. 6
      Sources/Plasma/FeatureLib/pfPython/pyCritterBrain.cpp
  17. 48
      Sources/Plasma/FeatureLib/pfPython/pySceneObject.cpp
  18. 2
      Sources/Plasma/NucleusLib/pnMessage/plMessage.h
  19. 28
      Sources/Plasma/NucleusLib/pnModifier/plLogicModBase.cpp
  20. 30
      Sources/Plasma/NucleusLib/pnNetCommon/plNetServers.h
  21. 4
      Sources/Plasma/NucleusLib/pnUUID/pnUUID_Unix.cpp
  22. 10
      Sources/Plasma/PubUtilLib/plAgeLoader/plAgeLoaderPaging.cpp
  23. 3
      Sources/Plasma/PubUtilLib/plAudible/plWinAudible.cpp
  24. 6
      Sources/Plasma/PubUtilLib/plAudio/plAudioSystem.cpp
  25. 4
      Sources/Plasma/PubUtilLib/plAudio/plSound.cpp
  26. 2
      Sources/Plasma/PubUtilLib/plAudio/plWin32GroupedSound.cpp
  27. 2
      Sources/Plasma/PubUtilLib/plAudio/plWin32Sound.cpp
  28. 2
      Sources/Plasma/PubUtilLib/plAudio/plWin32StaticSound.cpp
  29. 15
      Sources/Plasma/PubUtilLib/plAudio/plWin32StreamingSound.cpp
  30. 10
      Sources/Plasma/PubUtilLib/plAudioCore/plAudioFileReader.cpp
  31. 4
      Sources/Plasma/PubUtilLib/plAvatar/plAGMasterMod.cpp
  32. 2
      Sources/Plasma/PubUtilLib/plAvatar/plArmatureMod.cpp
  33. 9
      Sources/Plasma/PubUtilLib/plAvatar/plAvLadderModifier.cpp
  34. 10
      Sources/Plasma/PubUtilLib/plAvatar/plAvatarMgr.cpp
  35. 8
      Sources/Plasma/PubUtilLib/plAvatar/plMatrixChannel.cpp
  36. 2
      Sources/Plasma/PubUtilLib/plDrawable/plCluster.h
  37. 2
      Sources/Plasma/PubUtilLib/plDrawable/plDrawableSpans.h
  38. 2
      Sources/Plasma/PubUtilLib/plDrawable/plDynaDecalMgr.cpp
  39. 2
      Sources/Plasma/PubUtilLib/plDrawable/plWaveSet7.cpp
  40. 2
      Sources/Plasma/PubUtilLib/plFile/plFileUtils.cpp
  41. 2
      Sources/Plasma/PubUtilLib/plGLight/plLightKonstants.h
  42. 2
      Sources/Plasma/PubUtilLib/plInputCore/plInputDevice.cpp
  43. 14
      Sources/Plasma/PubUtilLib/plInputCore/plSceneInputInterface.cpp
  44. 4
      Sources/Plasma/PubUtilLib/plMath/plRandom.h
  45. 2
      Sources/Plasma/PubUtilLib/plMessage/plLoadCloneMsg.cpp
  46. 8
      Sources/Plasma/PubUtilLib/plModifier/plLogicModifier.cpp
  47. 2
      Sources/Plasma/PubUtilLib/plModifier/plResponderModifier.h
  48. 10
      Sources/Plasma/PubUtilLib/plModifier/plSDLModifier.cpp
  49. 6
      Sources/Plasma/PubUtilLib/plNetClient/plLinkEffectsMgr.cpp
  50. 10
      Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgr.cpp
  51. 4
      Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrLoad.cpp
  52. 2
      Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrSend.cpp
  53. 8
      Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrShow.cpp
  54. 3
      Sources/Plasma/PubUtilLib/plNetClient/plNetClientMsgHandler.cpp
  55. 4
      Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.cpp
  56. 8
      Sources/Plasma/PubUtilLib/plNetClientComm/plNetClientComm.cpp
  57. 8
      Sources/Plasma/PubUtilLib/plNetClientComm/plNetClientComm.h
  58. 4
      Sources/Plasma/PubUtilLib/plNetCommon/plNetCommon.h
  59. 2
      Sources/Plasma/PubUtilLib/plNetMessage/plNetMessage.cpp
  60. 4
      Sources/Plasma/PubUtilLib/plParticleSystem/plParticleGenerator.cpp
  61. 4
      Sources/Plasma/PubUtilLib/plParticleSystem/plParticleGenerator.h
  62. 38
      Sources/Plasma/PubUtilLib/plPhysical/plCollisionDetector.cpp
  63. 18
      Sources/Plasma/PubUtilLib/plPhysical/plPhysicalSDLModifier.cpp
  64. 2
      Sources/Plasma/PubUtilLib/plPhysical/plPickingDetector.cpp
  65. 2
      Sources/Plasma/PubUtilLib/plPipeline/plCullTree.h
  66. 4
      Sources/Plasma/PubUtilLib/plPipeline/plDebugText.h
  67. 8
      Sources/Plasma/PubUtilLib/plPipeline/plDynamicEnvMap.cpp
  68. 6
      Sources/Plasma/PubUtilLib/plPipeline/plPlates.h
  69. 2
      Sources/Plasma/PubUtilLib/plResMgr/plResManager.cpp
  70. 2
      Sources/Plasma/PubUtilLib/plResMgr/plResManager.h
  71. 2
      Sources/Plasma/PubUtilLib/plSDL/plStateVariable.cpp
  72. 7
      Sources/Plasma/PubUtilLib/plStatGather/plAutoProfile.cpp
  73. 2
      Sources/Plasma/PubUtilLib/plSurface/plShader.cpp
  74. 2
      Sources/Plasma/PubUtilLib/plSurface/plShader.h
  75. 2
      Sources/Plasma/PubUtilLib/plSurface/plShaderTable.h

11
Sources/Plasma/Apps/plClient/plClient.cpp

@ -1094,14 +1094,16 @@ void plClient::IUnloadRooms(const std::vector<plLocation>& locs)
if (node) if (node)
{ {
#ifndef PLASMA_EXTERNAL_RELEASE #ifndef PLASMA_EXTERNAL_RELEASE
plStatusLog::AddLineS("pageouts.log", "SceneNode for %s loaded; Removing node", node->GetKey()->GetUoid().GetObjectName()); plStatusLog::AddLineS("pageouts.log", "SceneNode for %s loaded; Removing node",
node->GetKey()->GetUoid().GetObjectName().c_str());
#endif #endif
fPageMgr->RemoveNode(node); fPageMgr->RemoveNode(node);
} }
else else
{ {
#ifndef PLASMA_EXTERNAL_RELEASE #ifndef PLASMA_EXTERNAL_RELEASE
plStatusLog::AddLineS("pageouts.log", "SceneNode for %s NOT loaded", nodeKey->GetUoid().GetObjectName()); plStatusLog::AddLineS("pageouts.log", "SceneNode for %s NOT loaded",
nodeKey->GetUoid().GetObjectName().c_str());
#endif #endif
} }
GetKey()->Release(nodeKey); // release notify interest in scene node GetKey()->Release(nodeKey); // release notify interest in scene node
@ -1117,7 +1119,8 @@ void plClient::IUnloadRooms(const std::vector<plLocation>& locs)
fCurrentNode = nil; fCurrentNode = nil;
#ifndef PLASMA_EXTERNAL_RELEASE #ifndef PLASMA_EXTERNAL_RELEASE
plStatusLog::AddLineS("pageouts.log", "Telling netClientMgr about paging out %s", nodeKey->GetUoid().GetObjectName()); plStatusLog::AddLineS("pageouts.log", "Telling netClientMgr about paging out %s",
nodeKey->GetUoid().GetObjectName().c_str());
#endif #endif
if (plNetClientMgr::GetInstance() != nil) if (plNetClientMgr::GetInstance() != nil)
@ -1241,7 +1244,7 @@ void plClient::IRoomLoaded(plSceneNode* node, bool hold)
plgDispatch::MsgSend(loadmsg); plgDispatch::MsgSend(loadmsg);
} }
else else
hsStatusMessageF("Done loading hold room %s, t=%f\n", pRmKey->GetName(), hsTimer::GetSeconds()); hsStatusMessageF("Done loading hold room %s, t=%f\n", pRmKey->GetName().c_str(), hsTimer::GetSeconds());
plLocation loc = pRmKey->GetUoid().GetLocation(); plLocation loc = pRmKey->GetUoid().GetLocation();
for (int i = 0; i < fRoomsLoading.size(); i++) for (int i = 0; i < fRoomsLoading.size(); i++)

8
Sources/Plasma/CoreLib/plGeneric.h

@ -88,11 +88,11 @@ public:
// the cast functions will NOT cast from one type to another, use // the cast functions will NOT cast from one type to another, use
// GetType() to determine the type of parameter, then cast it to that type // GetType() to determine the type of parameter, then cast it to that type
GenericType GetType() const {return fType;} GenericType GetType() const {return fType;}
operator const bool() const {return fBoolVal;} operator bool() const {return fBoolVal;}
operator const int() const {return fIntVal;} operator int() const {return fIntVal;}
operator const double() const {return fFloatVal;} operator double() const {return fFloatVal;}
operator const wchar_t*() const {return fStringVal.c_str();} operator const wchar_t*() const {return fStringVal.c_str();}
operator const std::wstring() const {return fStringVal;} operator std::wstring() const {return fStringVal;}
int Write(hsStream* stream); int Write(hsStream* stream);
int Read(hsStream* stream); int Read(hsStream* stream);

2
Sources/Plasma/CoreLib/plString.h

@ -112,7 +112,7 @@ public:
} }
const _Ch *GetData() const { return fData ? fData->fStringData : 0; } const _Ch *GetData() const { return fData ? fData->fStringData : 0; }
const size_t GetSize() const { return fData ? fData->fSize : 0; } size_t GetSize() const { return fData ? fData->fSize : 0; }
}; };

14
Sources/Plasma/FeatureLib/pfAnimation/plAnimDebugList.cpp

@ -104,7 +104,7 @@ void plAnimDebugList::ShowReport()
int y,x,i,j; int y,x,i,j;
const int yOff=10, startY=40, startX=10; const int yOff=10, startY=40, startX=10;
char str[256]; plString str;
x = startX; x = startX;
y = startY; y = startY;
@ -124,10 +124,10 @@ void plAnimDebugList::ShowReport()
plLayerAnimation *layerAnim = plLayerAnimation::ConvertNoRef(layer); plLayerAnimation *layerAnim = plLayerAnimation::ConvertNoRef(layer);
if (layerAnim) if (layerAnim)
{ {
sprintf(str, "%s: %s %.3f (%.3f)", mat->GetKeyName(), layerAnim->GetKeyName(), str = plString::Format("%s: %s %.3f (%.3f)", mat->GetKeyName().c_str(), layerAnim->GetKeyName().c_str(),
layerAnim->GetTimeConvert().CurrentAnimTime(), layerAnim->GetTimeConvert().CurrentAnimTime(),
layerAnim->GetTimeConvert().WorldToAnimTimeNoUpdate(hsTimer::GetSysSeconds())); layerAnim->GetTimeConvert().WorldToAnimTimeNoUpdate(hsTimer::GetSysSeconds()));
txt.DrawString(x, y, str); txt.DrawString(x, y, _TEMP_CONVERT_TO_CONST_CHAR(str));
y += yOff; y += yOff;
} }
layer = layer->GetOverLay(); layer = layer->GetOverLay();
@ -148,17 +148,17 @@ void plAnimDebugList::ShowReport()
if (!mod) if (!mod)
continue; continue;
sprintf(str, " %s", so->GetKeyName()); str = plString::Format(" %s", so->GetKeyName().c_str());
txt.DrawString(x, y, str); txt.DrawString(x, y, _TEMP_CONVERT_TO_CONST_CHAR(str));
y += yOff; y += yOff;
for (j = 0; j < mod->GetNumATCAnimations(); j++) for (j = 0; j < mod->GetNumATCAnimations(); j++)
{ {
plAGAnimInstance *anim = mod->GetATCAnimInstance(j); plAGAnimInstance *anim = mod->GetATCAnimInstance(j);
sprintf(str, " %s: %.3f (%.3f)", anim->GetAnimation()->GetName(), str = plString::Format(" %s: %.3f (%.3f)", anim->GetAnimation()->GetName().c_str(),
anim->GetTimeConvert()->CurrentAnimTime(), anim->GetTimeConvert()->CurrentAnimTime(),
anim->GetTimeConvert()->WorldToAnimTimeNoUpdate(hsTimer::GetSysSeconds())); anim->GetTimeConvert()->WorldToAnimTimeNoUpdate(hsTimer::GetSysSeconds()));
txt.DrawString(x, y, str); txt.DrawString(x, y, _TEMP_CONVERT_TO_CONST_CHAR(str));
y += yOff; y += yOff;
} }
} }

4
Sources/Plasma/FeatureLib/pfAudio/plRandomSoundMod.cpp

@ -253,9 +253,9 @@ void plRandomSoundMod::IPlayNext()
if (plgAudioSys::AreExtendedLogsEnabled()) if (plgAudioSys::AreExtendedLogsEnabled())
{ {
if (fGroups) if (fGroups)
plStatusLog::AddLineS("audio.log", "%s: Playing sound #%d from group %d", GetTarget(0)->GetKeyName(), fCurrent, fCurrentGroup); plStatusLog::AddLineS("audio.log", "%s: Playing sound #%d from group %d", GetTarget(0)->GetKeyName().c_str(), fCurrent, fCurrentGroup);
else else
plStatusLog::AddLineS("audio.log", "%s: Playing sound #%d", GetTarget(0)->GetKeyName(), fCurrent); plStatusLog::AddLineS("audio.log", "%s: Playing sound #%d", GetTarget(0)->GetKeyName().c_str(), fCurrent);
} }
fEndTimes[fCurrent] = hsTimer::GetSysSeconds() + currLen; fEndTimes[fCurrent] = hsTimer::GetSysSeconds() + currLen;

2
Sources/Plasma/FeatureLib/pfCamera/plCameraBrain.cpp

@ -1026,7 +1026,7 @@ void plCameraBrain1_Avatar::Update(hsBool forced)
if (fFlags.IsBitSet(kIsTransitionCamera)) if (fFlags.IsBitSet(kIsTransitionCamera))
{ {
if (GetKey()) if (GetKey())
hsStatusMessageF("%s thinks it's the transition camera\n",GetKeyName()); hsStatusMessageF("%s thinks it's the transition camera\n", GetKeyName().c_str());
} }
else else
{ {

2
Sources/Plasma/FeatureLib/pfConsole/pfAvatarConsoleCommands.cpp

@ -173,7 +173,7 @@ PF_CONSOLE_CMD( Avatar_Spawn, Show, "", "Print a list of spawn points.")
const plSpawnModifier * spawn = mgr->GetSpawnPoint(i); const plSpawnModifier * spawn = mgr->GetSpawnPoint(i);
if(spawn) if(spawn)
{ {
PrintStringF(PrintString, "%d. %s", i, spawn->GetKey()->GetName()); PrintStringF(PrintString, "%d. %s", i, spawn->GetKey()->GetName().c_str());
} }
} }
} }

26
Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp

@ -2723,12 +2723,12 @@ void MyHandyPrintFunction( const plKey &obj, void (*PrintString)( const char
if( peeker->GetUoid().IsClone() ) if( peeker->GetUoid().IsClone() )
PrintStringF( PrintString, "%d refs on %s, clone %d:%d: loaded=%d", PrintStringF( PrintString, "%d refs on %s, clone %d:%d: loaded=%d",
peeker->PeekNumNotifies(), obj->GetUoid().GetObjectName(), peeker->PeekNumNotifies(), obj->GetUoid().GetObjectName().c_str(),
peeker->GetUoid().GetCloneID(), peeker->GetUoid().GetClonePlayerID(), peeker->GetUoid().GetCloneID(), peeker->GetUoid().GetClonePlayerID(),
obj->ObjectIsLoaded() ? 1 : 0); obj->ObjectIsLoaded() ? 1 : 0);
else else
PrintStringF( PrintString, "%d refs on %s: loaded=%d", PrintStringF( PrintString, "%d refs on %s: loaded=%d",
peeker->PeekNumNotifies(), obj->GetUoid().GetObjectName(), obj->ObjectIsLoaded() ? 1 : 0 ); peeker->PeekNumNotifies(), obj->GetUoid().GetObjectName().c_str(), obj->ObjectIsLoaded() ? 1 : 0 );
if( peeker->PeekNumNotifies() == 0 ) if( peeker->PeekNumNotifies() == 0 )
return; return;
@ -2754,7 +2754,8 @@ void MyHandyPrintFunction( const plKey &obj, void (*PrintString)( const char
limit--; limit--;
const plKey rcvr = msg->GetReceiver( j ); const plKey rcvr = msg->GetReceiver( j );
PrintStringF( PrintString, " %s:%s", plFactory::GetNameOfClass( rcvr->GetUoid().GetClassType() ), rcvr->GetUoid().GetObjectName() ); PrintStringF( PrintString, " %s:%s", plFactory::GetNameOfClass( rcvr->GetUoid().GetClassType() ),
rcvr->GetUoid().GetObjectName().c_str() );
} }
} }
} }
@ -2946,7 +2947,7 @@ PF_CONSOLE_CMD( Camera, // groupName
PF_CONSOLE_CMD( Camera, SwitchTo, "string cameraName", "Switch to the named camera") PF_CONSOLE_CMD( Camera, SwitchTo, "string cameraName", "Switch to the named camera")
{ {
char str[256]; char str[256];
plString foo = plString::Format("%s_", plString::FromUtf8(params[0])); plString foo = plString::Format("%s_", (char*)params[0]);
plKey key = FindObjectByNameAndType(foo, "plCameraModifier1", nil, str, true); plKey key = FindObjectByNameAndType(foo, "plCameraModifier1", nil, str, true);
PrintString(str); PrintString(str);
@ -4338,7 +4339,7 @@ PF_CONSOLE_CMD( Access,
seq->Activate(); seq->Activate();
sprintf(str, "%s Active\n", name); sprintf(str, "%s Active\n", name.c_str());
PrintString(str); PrintString(str);
} }
@ -4359,7 +4360,7 @@ PF_CONSOLE_CMD( Access,
seq->DeActivate(); seq->DeActivate();
sprintf(str, "%s Unactive\n", name); sprintf(str, "%s Unactive\n", name.c_str());
PrintString(str); PrintString(str);
} }
////////////////// //////////////////
@ -4504,9 +4505,7 @@ PF_CONSOLE_CMD( Access,
seq->Activate(); seq->Activate();
char str[256]; PrintString(plString::Format("%s Active\n", seq->GetKey()->GetName().c_str()).c_str());
sprintf(str, "%s Active\n", seq->GetKey()->GetName());
PrintString(str);
} }
PF_CONSOLE_CMD( Access, PF_CONSOLE_CMD( Access,
@ -4523,9 +4522,7 @@ PF_CONSOLE_CMD( Access,
seq->DeActivate(); seq->DeActivate();
char str[256]; PrintString(plString::Format("%s Unactive\n", seq->GetKey()->GetName().c_str()).c_str());
sprintf(str, "%s Unactive\n", seq->GetKey()->GetName());
PrintString(str);
} }
PF_CONSOLE_CMD( Access, PF_CONSOLE_CMD( Access,
@ -4533,7 +4530,6 @@ PF_CONSOLE_CMD( Access,
"string clothItem", "string clothItem",
"Set face morphMod to affect a clothing item" ) "Set face morphMod to affect a clothing item" )
{ {
char str[256];
plMorphSequence* seq = LocalMorphSequence(); plMorphSequence* seq = LocalMorphSequence();
if( !seq ) if( !seq )
{ {
@ -4548,8 +4544,8 @@ PF_CONSOLE_CMD( Access,
seq->SetUseSharedMesh(true); seq->SetUseSharedMesh(true);
seq->AddSharedMesh(item->fMeshes[plClothingItem::kLODHigh]); seq->AddSharedMesh(item->fMeshes[plClothingItem::kLODHigh]);
sprintf(str, "%s on item %s\n", seq->GetKey()->GetName(), (char *)params[0]); PrintString(plString::Format("%s on item %s\n", seq->GetKey()->GetName().c_str(),
PrintString(str); (char *)params[0]).c_str());
} }
#include "pfSurface/plFadeOpacityMod.h" #include "pfSurface/plFadeOpacityMod.h"

2
Sources/Plasma/FeatureLib/pfConsole/pfDispatchLog.cpp

@ -319,7 +319,7 @@ static bool DumpSpecificMsgInfo(plMessage* msg, std::string& info)
GetType(kOnRequest); GetType(kOnRequest);
GetType(kOnRemove); GetType(kOnRemove);
GetType(kOnReplace); GetType(kOnReplace);
xtl::format(info, "Obj: %s RefType: %s", refMsg->GetRef()->GetKeyName(), typeName); xtl::format(info, "Obj: %s RefType: %s", refMsg->GetRef()->GetKeyName().c_str(), typeName);
return true; return true;
} }

2
Sources/Plasma/FeatureLib/pfConsoleCore/pfConsoleEngine.cpp

@ -279,7 +279,7 @@ hsBool pfConsoleEngine::ExecuteFile( const wchar_t *fileName )
if( !RunCommand( string, DummyPrintFn ) ) if( !RunCommand( string, DummyPrintFn ) )
{ {
sprintf( string, "Error in console file %s, command line %d: %s", fileName, line, fErrorMsg ); sprintf( string, "Error in console file %S, command line %d: %s", fileName, line, fErrorMsg );
ISetErrorMsg( string ); ISetErrorMsg( string );
stream->Close(); stream->Close();
delete stream; delete stream;

2
Sources/Plasma/FeatureLib/pfGameGUIMgr/pfGUIListElement.cpp

@ -221,7 +221,7 @@ pfGUIListPicture::pfGUIListPicture( plKey mipKey, hsBool respectAlpha ) : pfGUIL
{ {
// Gotta make and grab an uncompressed one // Gotta make and grab an uncompressed one
plMipmap *uncompBuffer = hsCodecManager::Instance().CreateUncompressedMipmap( mip, hsCodecManager::k32BitDepth ); plMipmap *uncompBuffer = hsCodecManager::Instance().CreateUncompressedMipmap( mip, hsCodecManager::k32BitDepth );
plString str = plString::Format( "%s_uncomp", mip->GetKeyName() ); plString str = plString::Format( "%s_uncomp", mip->GetKeyName().c_str() );
fMipmapKey = hsgResMgr::ResMgr()->NewKey( str, uncompBuffer, fMipmapKey->GetUoid().GetLocation() ); fMipmapKey = hsgResMgr::ResMgr()->NewKey( str, uncompBuffer, fMipmapKey->GetUoid().GetLocation() );
fMipmapKey->RefObject(); fMipmapKey->RefObject();
} }

2
Sources/Plasma/FeatureLib/pfPython/cyAvatar.cpp

@ -1274,7 +1274,7 @@ PyObject* cyAvatar::GetTintClothingItemL(const char* clothing_name, uint8_t laye
} }
char errmsg[256]; char errmsg[256];
sprintf(errmsg,"Cannot find clothing item %d to find out what tint it is",clothing_name); sprintf(errmsg,"Cannot find clothing item %s to find out what tint it is",clothing_name);
PyErr_SetString(PyExc_KeyError, errmsg); PyErr_SetString(PyExc_KeyError, errmsg);
// returning nil means an error occurred // returning nil means an error occurred
return nil; return nil;

3
Sources/Plasma/FeatureLib/pfPython/cyMisc.cpp

@ -2362,7 +2362,7 @@ public:
if ( guid ) if ( guid )
{ {
PyObject* retVal = PyObject_CallMethod(fPyObject, "publicAgeRemoved", "s", guid->AsString()); PyObject* retVal = PyObject_CallMethod(fPyObject, "publicAgeRemoved", "s", guid->AsString().c_str());
Py_XDECREF(retVal); Py_XDECREF(retVal);
} }
} }
@ -2454,7 +2454,6 @@ const char* cyMisc::GetCameraNumber(int number)
if (pCam->GetTarget()) if (pCam->GetTarget())
{ {
const char* ret = pCam->GetTarget()->GetKeyName().c_str(); const char* ret = pCam->GetTarget()->GetKeyName().c_str();
(ret==nil) ? "empty" : ret;
plString str = plString::Format("saving camera named %s to chronicle\n",ret); plString str = plString::Format("saving camera named %s to chronicle\n",ret);
plVirtualCam1::Instance()->AddMsgToLog(str.c_str()); plVirtualCam1::Instance()->AddMsgToLog(str.c_str());
return ret; return ret;

12
Sources/Plasma/FeatureLib/pfPython/cyPhysics.cpp

@ -334,9 +334,9 @@ void cyPhysics::Move(pyVector3& direction, float distance)
} }
else else
{ {
char errmsg[256]; plString errmsg = plString::Format("Sceneobject %s does not have a coordinate interface.",
sprintf(errmsg,"Sceneobject %s does not have a coordinate interface.",obj->GetKeyName()); obj->GetKeyName().c_str());
PyErr_SetString(PyExc_RuntimeError, errmsg); PyErr_SetString(PyExc_RuntimeError, errmsg.c_str());
} }
} }
} }
@ -404,9 +404,9 @@ void cyPhysics::Rotate(float rad, pyVector3& axis)
} }
else else
{ {
char errmsg[256]; plString errmsg = plString::Format("Sceneobject %s does not have a coordinate interface.",
sprintf(errmsg,"Sceneobject %s does not have a coordinate interface.",obj->GetKeyName()); obj->GetKeyName().c_str());
PyErr_SetString(PyExc_RuntimeError, errmsg); PyErr_SetString(PyExc_RuntimeError, errmsg.c_str());
} }
} }
} }

4
Sources/Plasma/FeatureLib/pfPython/plPythonFileMod.cpp

@ -410,12 +410,12 @@ plPythonFileMod::~plPythonFileMod()
PyObject *modules = PyImport_GetModuleDict(); PyObject *modules = PyImport_GetModuleDict();
if( modules && (m = PyDict_GetItemString(modules, fModuleName.c_str())) && PyModule_Check(m)) if( modules && (m = PyDict_GetItemString(modules, fModuleName.c_str())) && PyModule_Check(m))
{ {
hsStatusMessageF("Module %s removed from python dictionary",fModuleName); hsStatusMessageF("Module %s removed from python dictionary",fModuleName.c_str());
PyDict_DelItemString(modules, fModuleName.c_str()); PyDict_DelItemString(modules, fModuleName.c_str());
} }
else else
{ {
hsStatusMessageF("Module %s not found in python dictionary. Already removed?",fModuleName); hsStatusMessageF("Module %s not found in python dictionary. Already removed?",fModuleName.c_str());
} }
// the above code should have unloaded the module from python, so it will delete itself, therefore // the above code should have unloaded the module from python, so it will delete itself, therefore
// we need to set our pointer to nil to make sure we don't try to use it // we need to set our pointer to nil to make sure we don't try to use it

6
Sources/Plasma/FeatureLib/pfPython/pyCritterBrain.cpp

@ -105,7 +105,7 @@ bool pyCritterBrain::RunningBehavior(const std::string& behaviorName) const
std::string pyCritterBrain::BehaviorName(int behavior) const std::string pyCritterBrain::BehaviorName(int behavior) const
{ {
if (!fBrain) if (!fBrain)
return false; return nil;
return fBrain->BehaviorName(behavior); return fBrain->BehaviorName(behavior);
} }
@ -133,14 +133,14 @@ int pyCritterBrain::NextBehavior() const
std::string pyCritterBrain::IdleBehaviorName() const std::string pyCritterBrain::IdleBehaviorName() const
{ {
if (!fBrain) if (!fBrain)
return false; return nil;
return fBrain->IdleBehaviorName(); return fBrain->IdleBehaviorName();
} }
std::string pyCritterBrain::RunBehaviorName() const std::string pyCritterBrain::RunBehaviorName() const
{ {
if (!fBrain) if (!fBrain)
return false; return nil;
return fBrain->RunBehaviorName(); return fBrain->RunBehaviorName();
} }

48
Sources/Plasma/FeatureLib/pfPython/pySceneObject.cpp

@ -284,9 +284,9 @@ PyObject* pySceneObject::GetLocalToWorld()
return pyMatrix44::New((hsMatrix44)ci->GetLocalToWorld()); return pyMatrix44::New((hsMatrix44)ci->GetLocalToWorld());
else else
{ {
char errmsg[256]; plString errmsg = plString::Format("Sceneobject %s does not have a coordinate interface.",
sprintf(errmsg,"Sceneobject %s does not have a coordinate interface.",obj->GetKeyName()); obj->GetKeyName().c_str());
PyErr_SetString(PyExc_RuntimeError, errmsg); PyErr_SetString(PyExc_RuntimeError, errmsg.c_str());
return nil; // return nil to tell python we errored return nil; // return nil to tell python we errored
} }
} }
@ -313,9 +313,9 @@ PyObject* pySceneObject::GetWorldToLocal()
return pyMatrix44::New((hsMatrix44)ci->GetWorldToLocal()); return pyMatrix44::New((hsMatrix44)ci->GetWorldToLocal());
else else
{ {
char errmsg[256]; plString errmsg = plString::Format("Sceneobject %s does not have a coordinate interface.",
sprintf(errmsg,"Sceneobject %s does not have a coordinate interface.",obj->GetKeyName()); obj->GetKeyName().c_str());
PyErr_SetString(PyExc_RuntimeError, errmsg); PyErr_SetString(PyExc_RuntimeError, errmsg.c_str());
return nil; // return nil to tell python we errored return nil; // return nil to tell python we errored
} }
} }
@ -342,9 +342,9 @@ PyObject* pySceneObject::GetLocalToParent()
return pyMatrix44::New((hsMatrix44)ci->GetLocalToParent()); return pyMatrix44::New((hsMatrix44)ci->GetLocalToParent());
else else
{ {
char errmsg[256]; plString errmsg = plString::Format("Sceneobject %s does not have a coordinate interface.",
sprintf(errmsg,"Sceneobject %s does not have a coordinate interface.",obj->GetKeyName()); obj->GetKeyName().c_str());
PyErr_SetString(PyExc_RuntimeError, errmsg); PyErr_SetString(PyExc_RuntimeError, errmsg.c_str());
return nil; // return nil to tell python we errored return nil; // return nil to tell python we errored
} }
} }
@ -371,9 +371,9 @@ PyObject* pySceneObject::GetParentToLocal()
return pyMatrix44::New((hsMatrix44)ci->GetParentToLocal()); return pyMatrix44::New((hsMatrix44)ci->GetParentToLocal());
else else
{ {
char errmsg[256]; plString errmsg = plString::Format("Sceneobject %s does not have a coordinate interface.",
sprintf(errmsg,"Sceneobject %s does not have a coordinate interface.",obj->GetKeyName()); obj->GetKeyName().c_str());
PyErr_SetString(PyExc_RuntimeError, errmsg); PyErr_SetString(PyExc_RuntimeError, errmsg.c_str());
return nil; // return nil to tell python we errored return nil; // return nil to tell python we errored
} }
} }
@ -416,9 +416,9 @@ PyObject* pySceneObject::GetWorldPosition()
return pyPoint3::New((hsPoint3)ci->GetWorldPos()); return pyPoint3::New((hsPoint3)ci->GetWorldPos());
else else
{ {
char errmsg[256]; plString errmsg = plString::Format("Sceneobject %s does not have a coordinate interface.",
sprintf(errmsg,"Sceneobject %s does not have a coordinate interface.",obj->GetKeyName()); obj->GetKeyName().c_str());
PyErr_SetString(PyExc_RuntimeError, errmsg); PyErr_SetString(PyExc_RuntimeError, errmsg.c_str());
return nil; // return nil to tell python we errored return nil; // return nil to tell python we errored
} }
} }
@ -445,9 +445,9 @@ PyObject* pySceneObject::GetViewVector()
return pyVector3::New(ci->GetLocalToWorld().GetAxis(hsMatrix44::kView)); return pyVector3::New(ci->GetLocalToWorld().GetAxis(hsMatrix44::kView));
else else
{ {
char errmsg[256]; plString errmsg = plString::Format("Sceneobject %s does not have a coordinate interface.",
sprintf(errmsg,"Sceneobject %s does not have a coordinate interface.",obj->GetKeyName()); obj->GetKeyName().c_str());
PyErr_SetString(PyExc_RuntimeError, errmsg); PyErr_SetString(PyExc_RuntimeError, errmsg.c_str());
return nil; // return nil to tell python we errored return nil; // return nil to tell python we errored
} }
} }
@ -474,9 +474,9 @@ PyObject* pySceneObject::GetUpVector()
return pyVector3::New(ci->GetLocalToWorld().GetAxis(hsMatrix44::kUp)); return pyVector3::New(ci->GetLocalToWorld().GetAxis(hsMatrix44::kUp));
else else
{ {
char errmsg[256]; plString errmsg = plString::Format("Sceneobject %s does not have a coordinate interface.",
sprintf(errmsg,"Sceneobject %s does not have a coordinate interface.",obj->GetKeyName()); obj->GetKeyName().c_str());
PyErr_SetString(PyExc_RuntimeError, errmsg); PyErr_SetString(PyExc_RuntimeError, errmsg.c_str());
return nil; // return nil to tell python we errored return nil; // return nil to tell python we errored
} }
} }
@ -503,9 +503,9 @@ PyObject* pySceneObject::GetRightVector()
return pyVector3::New(ci->GetLocalToWorld().GetAxis(hsMatrix44::kRight)); return pyVector3::New(ci->GetLocalToWorld().GetAxis(hsMatrix44::kRight));
else else
{ {
char errmsg[256]; plString errmsg = plString::Format("Sceneobject %s does not have a coordinate interface.",
sprintf(errmsg,"Sceneobject %s does not have a coordinate interface.",obj->GetKeyName()); obj->GetKeyName().c_str());
PyErr_SetString(PyExc_RuntimeError, errmsg); PyErr_SetString(PyExc_RuntimeError, errmsg.c_str());
return nil; // return nil to tell python we errored return nil; // return nil to tell python we errored
} }
} }

2
Sources/Plasma/NucleusLib/pnMessage/plMessage.h

@ -135,7 +135,7 @@ public:
hsBool Send(const plKey r=nil, hsBool async=false); // Message will self-destruct after send. hsBool Send(const plKey r=nil, hsBool async=false); // Message will self-destruct after send.
hsBool SendAndKeep(const plKey r=nil, hsBool async=false); // Message won't self-destruct after send. hsBool SendAndKeep(const plKey r=nil, hsBool async=false); // Message won't self-destruct after send.
const double GetTimeStamp() const { return fTimeStamp; } double GetTimeStamp() const { return fTimeStamp; }
plMessage& SetTimeStamp(double t) { fTimeStamp = t; return *this; } plMessage& SetTimeStamp(double t) { fTimeStamp = t; return *this; }
hsBool HasBCastFlag(uint32_t f) const { return 0 != (fBCastFlags & f); } hsBool HasBCastFlag(uint32_t f) const { return 0 != (fBCastFlags & f); }

28
Sources/Plasma/NucleusLib/pnModifier/plLogicModBase.cpp

@ -141,11 +141,10 @@ hsBool plLogicModBase::MsgReceive(plMessage* msg)
hsAssert(pSMsg->GetType() != plServerReplyMsg::kUnInit, "uninit server reply msg"); hsAssert(pSMsg->GetType() != plServerReplyMsg::kUnInit, "uninit server reply msg");
#if 1 #if 1
char str[256]; plNetClientApp::GetInstance()->DebugMsg("LM: LogicModifier %s recvd trigger request reply:%s, wasRequesting=%d, t=%f\n",
sprintf(str, "LM: LogicModifier %s recvd trigger request reply:%s, wasRequesting=%d, t=%f\n", GetKeyName(), GetKeyName().c_str(),
pSMsg->GetType() == plServerReplyMsg::kDeny ? "denied" : "confirmed", pSMsg->GetType() == plServerReplyMsg::kDeny ? "denied" : "confirmed",
HasFlag(kRequestingTrigger), hsTimer::GetSysSeconds()); HasFlag(kRequestingTrigger), hsTimer::GetSysSeconds());
plNetClientApp::GetInstance()->DebugMsg(str);
#endif #endif
if (pSMsg->GetType() == plServerReplyMsg::kDeny) if (pSMsg->GetType() == plServerReplyMsg::kDeny)
@ -191,10 +190,8 @@ void plLogicModBase::RequestTrigger(hsBool netRequest)
if (HasFlag(kTriggered)) if (HasFlag(kTriggered))
{ {
#if 1 #if 1
char str[256]; plNetClientApp::GetInstance()->DebugMsg("LM: %s ignoring RequestTrigger(), already triggered, t=%f\n",
sprintf(str, "LM: %s ignoring RequestTrigger(), already triggered, t=%f\n", GetKeyName(), GetKeyName().c_str(), hsTimer::GetSysSeconds());
hsTimer::GetSysSeconds());
plNetClientApp::GetInstance()->DebugMsg(str);
#endif #endif
return; return;
} }
@ -202,10 +199,8 @@ void plLogicModBase::RequestTrigger(hsBool netRequest)
if (HasFlag(kRequestingTrigger)) if (HasFlag(kRequestingTrigger))
{ {
#if 1 #if 1
char str[256]; plNetClientApp::GetInstance()->DebugMsg("LM: %s ignoring RequestTrigger(), already requesting trigger, t=%f\n",
sprintf(str, "LM: %s ignoring RequestTrigger(), already requesting trigger, t=%f\n", GetKeyName(), GetKeyName().c_str(), hsTimer::GetSysSeconds());
hsTimer::GetSysSeconds());
plNetClientApp::GetInstance()->DebugMsg(str);
#endif #endif
return; return;
@ -220,9 +215,8 @@ void plLogicModBase::RequestTrigger(hsBool netRequest)
SetFlag(kRequestingTrigger); SetFlag(kRequestingTrigger);
#if 1 #if 1
char str[256]; plNetClientApp::GetInstance()->DebugMsg("LM: %s Setting RequestingTriggert=%f\n",
sprintf(str, "LM: %s Setting RequestingTriggert=%f\n", GetKeyName(), hsTimer::GetSysSeconds()); GetKeyName().c_str(), hsTimer::GetSysSeconds());
plNetClientApp::GetInstance()->DebugMsg(str);
#endif #endif
} }
@ -256,10 +250,8 @@ void plLogicModBase::PreTrigger(hsBool netRequest)
void plLogicModBase::Trigger(hsBool netRequest) void plLogicModBase::Trigger(hsBool netRequest)
{ {
#if 1 #if 1
char str[256]; plNetClientApp::GetInstance()->DebugMsg("LogicModifier %s is triggering, activatorType=%d\n",
sprintf(str, "LogicModifier %s is triggering, activatorType=%d\n", GetKeyName().c_str(), HasFlag(kTypeActivator));
GetKeyName(), HasFlag(kTypeActivator));
plNetClientApp::GetInstance()->DebugMsg(str);
#endif #endif
ClearFlag(kRequestingTrigger); ClearFlag(kRequestingTrigger);

30
Sources/Plasma/NucleusLib/pnNetCommon/plNetServers.h

@ -102,8 +102,8 @@ class plNetServerAgentConstants
{ {
public: public:
static const char* GetName() { return "Server_Agent"; } static const char* GetName() { return "Server_Agent"; }
static const uint16_t GetPort() { return 4800; } static uint16_t GetPort() { return 4800; }
static const plNetServerConstants::ServerTypes GetType() { return plNetServerConstants::kAgent; } static plNetServerConstants::ServerTypes GetType() { return plNetServerConstants::kAgent; }
}; };
@ -111,8 +111,8 @@ class plNetLookupServerConstants
{ {
public: public:
static const char* GetName() { return "Lookup_Server"; } static const char* GetName() { return "Lookup_Server"; }
static const uint16_t GetPort() { return 2000; } static uint16_t GetPort() { return 2000; }
static const plNetServerConstants::ServerTypes GetType() { return plNetServerConstants::kLookup; } static plNetServerConstants::ServerTypes GetType() { return plNetServerConstants::kLookup; }
}; };
@ -120,8 +120,8 @@ class plNetLobbyServerConstants
{ {
public: public:
static const char* GetName() { return "Generated_Lobby"; } static const char* GetName() { return "Generated_Lobby"; }
static const uint16_t GetPort() { return 5000; } static uint16_t GetPort() { return 5000; }
static const plNetServerConstants::ServerTypes GetType() { return plNetServerConstants::kLobby; } static plNetServerConstants::ServerTypes GetType() { return plNetServerConstants::kLobby; }
}; };
@ -129,8 +129,8 @@ class plNetVaultServerConstants
{ {
public: public:
static const char* GetName() { return "Vault_Server"; } static const char* GetName() { return "Vault_Server"; }
static const uint16_t GetPort() { return 2001; } static uint16_t GetPort() { return 2001; }
static const plNetServerConstants::ServerTypes GetType() { return plNetServerConstants::kVault; } static plNetServerConstants::ServerTypes GetType() { return plNetServerConstants::kVault; }
}; };
@ -138,8 +138,8 @@ class plNetAuthServerConstants
{ {
public: public:
static const char* GetName() { return "Auth_Server"; } static const char* GetName() { return "Auth_Server"; }
static const uint16_t GetPort() { return 2002; } static uint16_t GetPort() { return 2002; }
static const plNetServerConstants::ServerTypes GetType() { return plNetServerConstants::kAuth; } static plNetServerConstants::ServerTypes GetType() { return plNetServerConstants::kAuth; }
}; };
@ -147,17 +147,17 @@ class plNetAdminServerConstants
{ {
public: public:
static const char* GetName() { return "Admin_Server"; } static const char* GetName() { return "Admin_Server"; }
static const uint16_t GetPort() { return 2003; } static uint16_t GetPort() { return 2003; }
static const plNetServerConstants::ServerTypes GetType() { return plNetServerConstants::kAdmin; } static plNetServerConstants::ServerTypes GetType() { return plNetServerConstants::kAdmin; }
}; };
class plNetGameServerConstants class plNetGameServerConstants
{ {
public: public:
static const char* GetName() { return "Game_Server"; } static const char* GetName() { return "Game_Server"; }
static const uint16_t GetLowPort() { return 5001;} static uint16_t GetLowPort() { return 5001;}
static const uint16_t GetHighPort() { return 6001;} static uint16_t GetHighPort() { return 6001;}
static const plNetServerConstants::ServerTypes GetType() { return plNetServerConstants::kGame; } static plNetServerConstants::ServerTypes GetType() { return plNetServerConstants::kGame; }
}; };

4
Sources/Plasma/NucleusLib/pnUUID/pnUUID_Unix.cpp

@ -106,13 +106,13 @@ bool plUUID::FromString( const char * str )
return true; return true;
} }
bool plUUID::ToStdString( std::string & out ) const bool plUUID::ToString( plString & out ) const
{ {
uuid_t g; uuid_t g;
plUUIDHelper::CopyToNative( g, this ); plUUIDHelper::CopyToNative( g, this );
char buf[40]; char buf[40];
uuid_unparse( g, buf ); uuid_unparse( g, buf );
out = buf; out = _TEMP_CONVERT_FROM_LITERAL( buf );
return true; return true;
} }

10
Sources/Plasma/PubUtilLib/plAgeLoader/plAgeLoaderPaging.cpp

@ -79,7 +79,7 @@ bool ReportRoomToServer(const plKey &key)
if (skip) if (skip)
hsLogEntry(plNetApp::StaticDebugMsg("Not reporting room %s to server, reserved=%d, virtual=%d", hsLogEntry(plNetApp::StaticDebugMsg("Not reporting room %s to server, reserved=%d, virtual=%d",
key->GetName(), keyLoc.IsReserved(), keyLoc.IsVirtual())); key->GetName().c_str(), keyLoc.IsReserved(), keyLoc.IsVirtual()));
return !skip; return !skip;
} }
@ -110,7 +110,7 @@ void plAgeLoader::FinishedPagingInRoom(plKey* rmKey, int numRms)
continue; continue;
pagingMsg->AddRoom(key); pagingMsg->AddRoom(key);
hsLogEntry(nc->DebugMsg("\tSending PageIn/RequestState msg, room=%s\n", key->GetName())); hsLogEntry(nc->DebugMsg("\tSending PageIn/RequestState msg, room=%s\n", key->GetName().c_str()));
} }
if( pagingMsg->GetNumRooms() > 0 ) // all rooms were reserved if( pagingMsg->GetNumRooms() > 0 ) // all rooms were reserved
{ {
@ -148,7 +148,7 @@ void plAgeLoader::FinishedPagingOutRoom(plKey* rmKey, int numRms)
if( found != fPendingPageOuts.end() ) if( found != fPendingPageOuts.end() )
{ {
fPendingPageOuts.erase( found ); fPendingPageOuts.erase( found );
nc->DebugMsg("Finished paging out room %s", rmKey[i]->GetName()); nc->DebugMsg("Finished paging out room %s", rmKey[i]->GetName().c_str());
} }
} }
@ -179,7 +179,7 @@ void plAgeLoader::StartPagingOutRoom(plKey* rmKey, int numRms)
continue; continue;
pagingMsg.AddRoom(rmKey[i]); pagingMsg.AddRoom(rmKey[i]);
nc->DebugMsg("\tSending PageOut msg, room=%s", rmKey[i]->GetName()); nc->DebugMsg("\tSending PageOut msg, room=%s", rmKey[i]->GetName().c_str());
} }
if (!pagingMsg.GetNumRooms()) // all rooms were reserved if (!pagingMsg.GetNumRooms()) // all rooms were reserved
@ -205,7 +205,7 @@ void plAgeLoader::IgnorePagingOutRoom(plKey* rmKey, int numRms)
if( found != fPendingPageOuts.end() ) if( found != fPendingPageOuts.end() )
{ {
fPendingPageOuts.erase( found ); fPendingPageOuts.erase( found );
nc->DebugMsg("Ignoring paged out room %s", rmKey[i]->GetName()); nc->DebugMsg("Ignoring paged out room %s", rmKey[i]->GetName().c_str());
} }
} }

3
Sources/Plasma/PubUtilLib/plAudible/plWinAudible.cpp

@ -421,7 +421,8 @@ void plWinAudible::SetFilename(int index, const char *filename, hsBool isCompres
} }
else else
{ {
plStatusLog::AddLineS("audio.log", "Cannot set filename of non-streaming sound. %s", fSoundObjs[ index ]->GetKeyName()); plStatusLog::AddLineS("audio.log", "Cannot set filename of non-streaming sound. %s",
fSoundObjs[ index ]->GetKeyName().c_str());
} }
} }

6
Sources/Plasma/PubUtilLib/plAudio/plAudioSystem.cpp

@ -798,7 +798,7 @@ void plAudioSystem::IUpdateSoftSounds( const hsPoint3 &newPosition )
sortedList->fRank, sortedList->fRank,
sound->GetVolume() ? sound->GetVolumeRank() / sound->GetVolume() : 0, sound->GetVolume() ? sound->GetVolumeRank() / sound->GetVolume() : 0,
sound->GetEAXSettings().GetCurrSofts().GetOcclusion(), sound->GetEAXSettings().GetCurrSofts().GetOcclusion(),
sound->GetKeyName() sound->GetKeyName().c_str()
); );
} }
else else
@ -809,7 +809,7 @@ void plAudioSystem::IUpdateSoftSounds( const hsPoint3 &newPosition )
sound->GetPriority(), sound->GetPriority(),
sortedList->fRank, sortedList->fRank,
sound->GetVolume() ? sound->GetVolumeRank() / sound->GetVolume() : 0, sound->GetVolume() ? sound->GetVolumeRank() / sound->GetVolume() : 0,
sound->GetKeyName() sound->GetKeyName().c_str()
); );
} }
i++; i++;
@ -833,7 +833,7 @@ void plAudioSystem::IUpdateSoftSounds( const hsPoint3 &newPosition )
"%d %1.2f %s", "%d %1.2f %s",
sound->GetPriority(), sound->GetPriority(),
sound->GetVolume() ? sound->GetVolumeRank() / sound->GetVolume() : 0, sound->GetVolume() ? sound->GetVolumeRank() / sound->GetVolume() : 0,
sound->GetKeyName() sound->GetKeyName().c_str()
); );
} }

4
Sources/Plasma/PubUtilLib/plAudio/plSound.cpp

@ -590,7 +590,7 @@ void plSound::IStartFade( plFadeParams *params, float offsetIntoFade )
fFadeInParams.fVolStart = fCurrVolume; // Hopefully, we got to fFadedVolume, but maybe not fFadeInParams.fVolStart = fCurrVolume; // Hopefully, we got to fFadedVolume, but maybe not
fFadeInParams.fVolEnd = fDesiredVol; fFadeInParams.fVolEnd = fDesiredVol;
fCurrFadeParams = &fFadeInParams; fCurrFadeParams = &fFadeInParams;
plStatusLog::AddLineS("audio.log", "Fading in %s", GetKeyName()); plStatusLog::AddLineS("audio.log", "Fading in %s", GetKeyName().c_str());
} }
else else
fCurrFadeParams = params; fCurrFadeParams = params;
@ -809,7 +809,7 @@ bool plSound::ILoadDataBuffer( void )
if(!buffer) if(!buffer)
{ {
hsAssert(false, "unable to load sound buffer"); hsAssert(false, "unable to load sound buffer");
plStatusLog::AddLineS("audio.log", "Unable to load sound buffer: %s", GetKeyName()); plStatusLog::AddLineS("audio.log", "Unable to load sound buffer: %s", GetKeyName().c_str());
return false; return false;
} }
SetLength( buffer->GetDataLengthInSecs() ); SetLength( buffer->GetDataLengthInSecs() );

2
Sources/Plasma/PubUtilLib/plAudio/plWin32GroupedSound.cpp

@ -241,7 +241,7 @@ hsBool plWin32GroupedSound::LoadSound( hsBool is3D )
if( GetKey() != nil && GetKeyName().Find( "Footstep" ) >= 0 ) if( GetKey() != nil && GetKeyName().Find( "Footstep" ) >= 0 )
; ;
else else
plStatusLog::AddLineS( "audioTimes.log", "%s (%s)", str, GetKey() ? GetKeyName().c_str() : "unkeyed" ); plStatusLog::AddLineS( "audioTimes.log", "%s (%s)", str.c_str(), GetKey() ? GetKeyName().c_str() : "unkeyed" );
fTotalBytes = bufferSize; fTotalBytes = bufferSize;

2
Sources/Plasma/PubUtilLib/plAudio/plWin32Sound.cpp

@ -159,7 +159,7 @@ void plWin32Sound::IActuallyStop()
--fIncidentalsPlaying; --fIncidentalsPlaying;
} }
fDSoundBuffer->Stop(); fDSoundBuffer->Stop();
plStatusLog::AddLineS("impacts.log", "Stopping %s", GetKeyName()); plStatusLog::AddLineS("impacts.log", "Stopping %s", GetKeyName().c_str());
} }
fReallyPlaying = false; fReallyPlaying = false;

2
Sources/Plasma/PubUtilLib/plAudio/plWin32StaticSound.cpp

@ -169,7 +169,7 @@ hsBool plWin32StaticSound::LoadSound( hsBool is3D )
{ {
delete fDSoundBuffer; delete fDSoundBuffer;
fDSoundBuffer = nil; fDSoundBuffer = nil;
plStatusLog::AddLineS("audio.log", "Could not play static sound, no voices left %s", GetKeyName()); plStatusLog::AddLineS("audio.log", "Could not play static sound, no voices left %s", GetKeyName().c_str());
return false; return false;
} }

15
Sources/Plasma/PubUtilLib/plAudio/plWin32StreamingSound.cpp

@ -214,7 +214,7 @@ plSoundBuffer::ELoadReturnVal plWin32StreamingSound::IPreLoadBuffer( hsBool play
return fDataStream ? plSoundBuffer::kSuccess : plSoundBuffer::kError; return fDataStream ? plSoundBuffer::kSuccess : plSoundBuffer::kError;
} }
plStatusLog::AddLineS("audio.log", "EnsureLoadable failed for streaming sound %d", fDataBufferKey->GetName()); plStatusLog::AddLineS("audio.log", "EnsureLoadable failed for streaming sound %d", fDataBufferKey->GetName().c_str());
return plSoundBuffer::kError; return plSoundBuffer::kError;
} }
@ -263,9 +263,9 @@ hsBool plWin32StreamingSound::LoadSound( hsBool is3D )
if( retVal == plSoundBuffer::kError ) if( retVal == plSoundBuffer::kError )
{ {
char str[ 256 ]; plString str = plString::Format( "Unable to open streaming source %s",
sprintf( str, "Unable to open streaming source %s", fDataBufferKey->GetName() ); fDataBufferKey->GetName().c_str() );
IPrintDbgMessage( str, true ); IPrintDbgMessage( str.c_str(), true );
fFailed = true; fFailed = true;
return false; return false;
} }
@ -349,7 +349,7 @@ hsBool plWin32StreamingSound::LoadSound( hsBool is3D )
delete fDSoundBuffer; delete fDSoundBuffer;
fDSoundBuffer = nil; fDSoundBuffer = nil;
plStatusLog::AddLineS("audio.log", "Could not play streaming sound, no voices left %s", GetKeyName()); plStatusLog::AddLineS("audio.log", "Could not play streaming sound, no voices left %s", GetKeyName().c_str());
return false; return false;
} }
FreeSoundData(); FreeSoundData();
@ -361,7 +361,8 @@ hsBool plWin32StreamingSound::LoadSound( hsBool is3D )
sprintf( str, " Streaming %s.", fSrcFilename); sprintf( str, " Streaming %s.", fSrcFilename);
IPrintDbgMessage( str ); IPrintDbgMessage( str );
plStatusLog::AddLineS( "audioTimes.log", 0xffffffff, "Streaming %4.2f secs of %s", fDataStream->GetLengthInSecs(), GetKey()->GetUoid().GetObjectName() ); plStatusLog::AddLineS( "audioTimes.log", 0xffffffff, "Streaming %4.2f secs of %s",
fDataStream->GetLengthInSecs(), GetKey()->GetUoid().GetObjectName().c_str() );
// Get pertinent info // Get pertinent info
SetLength( (float)fDataStream->GetLengthInSecs() ); SetLength( (float)fDataStream->GetLengthInSecs() );
@ -404,7 +405,7 @@ void plWin32StreamingSound::IStreamUpdate()
if(!fDSoundBuffer->StreamingFillBuffer(fDataStream)) if(!fDSoundBuffer->StreamingFillBuffer(fDataStream))
{ {
plStatusLog::AddLineS("audio.log", "%s Streaming buffer fill failed", GetKeyName()); plStatusLog::AddLineS("audio.log", "%s Streaming buffer fill failed", GetKeyName().c_str());
} }
} }
plProfile_EndTiming( StreamSndShoveTime ); plProfile_EndTiming( StreamSndShoveTime );

10
Sources/Plasma/PubUtilLib/plAudioCore/plAudioFileReader.cpp

@ -66,16 +66,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#define kCacheDirName "temp" #define kCacheDirName "temp"
static void hsStrUpper(char *s)
{
if (s)
{
int len = hsStrlen(s);
for (int i = 0; i < len; i++)
s[i] = toupper(s[i]);
}
}
plAudioFileReader* plAudioFileReader::CreateReader(const char* path, plAudioCore::ChannelSelect whichChan, StreamType type) plAudioFileReader* plAudioFileReader::CreateReader(const char* path, plAudioCore::ChannelSelect whichChan, StreamType type)
{ {
const char* ext = plFileUtils::GetFileExt(path); const char* ext = plFileUtils::GetFileExt(path);

4
Sources/Plasma/PubUtilLib/plAvatar/plAGMasterMod.cpp

@ -312,7 +312,7 @@ void plAGMasterMod::DumpAniGraph(const char *justThisChannel, bool optimized, do
plMatrixChannel *topChannel = plMatrixChannel::ConvertNoRef(channel); plMatrixChannel *topChannel = plMatrixChannel::ConvertNoRef(channel);
if(topChannel) if(topChannel)
{ {
hsStatusMessageF("AGModifier: <%s>", mod->GetChannelName()); hsStatusMessageF("AGModifier: <%s>", mod->GetChannelName().c_str());
topChannel->Dump(1, optimized, time); topChannel->Dump(1, optimized, time);
} }
} }
@ -718,7 +718,7 @@ hsBool plAGMasterMod::MsgReceive(plMessage* msg)
if (genRefMsg->fType == kPrivateAnim) if (genRefMsg->fType == kPrivateAnim)
{ {
plAnimVector::iterator i = fPrivateAnims.begin(); plAnimVector::iterator i = fPrivateAnims.begin();
for (i; i != fPrivateAnims.end(); i++) for ( ; i != fPrivateAnims.end(); i++)
{ {
plAGAnim *currAnim = *i; plAGAnim *currAnim = *i;

2
Sources/Plasma/PubUtilLib/plAvatar/plArmatureMod.cpp

@ -2652,7 +2652,7 @@ int plArmatureMod::RefreshDebugDisplay()
void plArmatureMod::DumpToDebugDisplay(int &x, int &y, int lineHeight, char *strBuf, plDebugText &debugTxt) void plArmatureMod::DumpToDebugDisplay(int &x, int &y, int lineHeight, char *strBuf, plDebugText &debugTxt)
{ {
sprintf(strBuf, "Armature <%s>:", fRootName); sprintf(strBuf, "Armature <%s>:", fRootName.c_str());
debugTxt.DrawString(x, y, strBuf, 255, 128, 128); debugTxt.DrawString(x, y, strBuf, 255, 128, 128);
y += lineHeight; y += lineHeight;

9
Sources/Plasma/PubUtilLib/plAvatar/plAvLadderModifier.cpp

@ -135,7 +135,8 @@ bool plAvLadderMod::IIsReadyToClimb()
if (dot >= kTolerance && movingForward) if (dot >= kTolerance && movingForward)
{ {
DetectorLogSpecial("%s: Ladder starting climb (%f)", GetKeyName(), hsRadiansToDegrees(acos(dot))); DetectorLogSpecial("%s: Ladder starting climb (%f)",
GetKeyName().c_str(), hsRadiansToDegrees(acos(dot)));
return true; return true;
} }
else if (movingForward) else if (movingForward)
@ -179,7 +180,7 @@ hsBool plAvLadderMod::MsgReceive(plMessage* msg)
// we can check every frame // we can check every frame
if (fAvatarInBox) if (fAvatarInBox)
{ {
DetectorLogSpecial("%s: Avatar entered ladder region", GetKeyName()); DetectorLogSpecial("%s: Avatar entered ladder region", GetKeyName().c_str());
if (IIsReadyToClimb()) if (IIsReadyToClimb())
ITriggerSelf(collMsg->fOtherKey); ITriggerSelf(collMsg->fOtherKey);
@ -188,7 +189,7 @@ hsBool plAvLadderMod::MsgReceive(plMessage* msg)
} }
else else
{ {
DetectorLogSpecial("%s: Avatar exited ladder region", GetKeyName()); DetectorLogSpecial("%s: Avatar exited ladder region", GetKeyName().c_str());
plgDispatch::Dispatch()->UnRegisterForExactType(plEvalMsg::Index(), GetKey()); plgDispatch::Dispatch()->UnRegisterForExactType(plEvalMsg::Index(), GetKey());
} }
@ -215,7 +216,7 @@ hsBool plAvLadderMod::MsgReceive(plMessage* msg)
} }
else if (notifyMsg->fID == kNotifyAvatarOnLadder) else if (notifyMsg->fID == kNotifyAvatarOnLadder)
{ {
DetectorLogSpecial("%s: Avatar mounted ladder", GetKeyName()); DetectorLogSpecial("%s: Avatar mounted ladder", GetKeyName().c_str());
fAvatarMounting = false; fAvatarMounting = false;
} }

10
Sources/Plasma/PubUtilLib/plAvatar/plAvatarMgr.cpp

@ -621,14 +621,14 @@ void plAvatarMgr::RemoveOneShot(plOneShotMod *oneshot)
while (i != fOneShots.end()) while (i != fOneShots.end())
{ {
plString name = (*i).first; plString name = i->first;
plOneShotMod *thisOneshot = (*i).second; plOneShotMod *thisOneshot = i->second;
if(oneshot == thisOneshot) if(oneshot == thisOneshot)
{ {
i = fOneShots.erase(i); fOneShots.erase(i++);
} else { } else {
i++; ++i;
} }
} }
} }
@ -642,7 +642,7 @@ plOneShotMod *plAvatarMgr::FindOneShot(const plString &name)
{ {
return nil; return nil;
} else { } else {
return (*found).second; return found->second;
} }
} }

8
Sources/Plasma/PubUtilLib/plAvatar/plMatrixChannel.cpp

@ -170,7 +170,7 @@ void plMatrixChannel::Dump(int indent, bool optimized, double time)
{ {
indentStr += "- "; indentStr += "- ";
} }
hsStatusMessageF("%s matChan<%s>", indentStr.c_str(), fName); hsStatusMessageF("%s matChan<%s>", indentStr.c_str(), fName.c_str());
} }
///////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////
@ -300,7 +300,7 @@ void plMatrixTimeScale::Dump(int indent, bool optimized, double time)
{ {
indentStr += "- "; indentStr += "- ";
} }
hsStatusMessageF("%s matTimeScale <%s> at time <%f>", indentStr.c_str(), fName, fTimeSource->Value(time, true)); hsStatusMessageF("%s matTimeScale <%s> at time <%f>", indentStr.c_str(), fName.c_str(), fTimeSource->Value(time, true));
fChannelIn->Dump(indent + 1, optimized, time); fChannelIn->Dump(indent + 1, optimized, time);
} }
@ -470,7 +470,7 @@ void plMatrixBlend::Dump(int indent, bool optimized, double time)
{ {
indentStr += "- "; indentStr += "- ";
} }
hsStatusMessageF("%s matBlend<%s>, bias:<%f>", indentStr.c_str(), fName, fChannelBias->Value(time, true)); hsStatusMessageF("%s matBlend<%s>, bias:<%f>", indentStr.c_str(), fName.c_str(), fChannelBias->Value(time, true));
if(optimized) if(optimized)
{ {
fOptimizedB->Dump(indent + 1, optimized, time); fOptimizedB->Dump(indent + 1, optimized, time);
@ -569,7 +569,7 @@ void plMatrixControllerChannel::Dump(int indent, bool optimized, double time)
{ {
indentStr += "- "; indentStr += "- ";
} }
hsStatusMessageF("%s MatController<%s>", indentStr.c_str(), fName); hsStatusMessageF("%s MatController<%s>", indentStr.c_str(), fName.c_str());
} }
// Write ------------------------------------------------------------- // Write -------------------------------------------------------------

2
Sources/Plasma/PubUtilLib/plDrawable/plCluster.h

@ -102,7 +102,7 @@ public:
const hsBitVector& GetVisSet() const { return fGroup->GetVisSet(); } const hsBitVector& GetVisSet() const { return fGroup->GetVisSet(); }
const hsBitVector& GetVisNot() const { return fGroup->GetVisNot(); } const hsBitVector& GetVisNot() const { return fGroup->GetVisNot(); }
const hsTArray<plLightInfo*>& GetLights() const { fGroup->GetLights(); } const hsTArray<plLightInfo*>& GetLights() const { return fGroup->GetLights(); }
const plLODDist& GetLOD() const { return fGroup->GetLOD(); } const plLODDist& GetLOD() const { return fGroup->GetLOD(); }
}; };

2
Sources/Plasma/PubUtilLib/plDrawable/plDrawableSpans.h

@ -280,7 +280,7 @@ class plDrawableSpans : public plDrawable
virtual const plSpan *GetSpan( uint32_t index ) const { return fSpans[ index ]; } virtual const plSpan *GetSpan( uint32_t index ) const { return fSpans[ index ]; }
virtual const plSpan *GetSpan( uint32_t diIndex, uint32_t index ) const { return fSpans[ (*fDIIndices[ diIndex ])[ index ] ]; } virtual const plSpan *GetSpan( uint32_t diIndex, uint32_t index ) const { return fSpans[ (*fDIIndices[ diIndex ])[ index ] ]; }
virtual const uint32_t GetNumSpans( void ) const { return fSpans.GetCount(); } virtual uint32_t GetNumSpans( void ) const { return fSpans.GetCount(); }
virtual const hsTArray<plSpan *> &GetSpanArray( void ) const { return fSpans; } virtual const hsTArray<plSpan *> &GetSpanArray( void ) const { return fSpans; }
hsMatrix44* GetMatrixPalette(int baseMatrix) const { return &fLocalToWorlds[baseMatrix]; } hsMatrix44* GetMatrixPalette(int baseMatrix) const { return &fLocalToWorlds[baseMatrix]; }

2
Sources/Plasma/PubUtilLib/plDrawable/plDynaDecalMgr.cpp

@ -737,7 +737,7 @@ void plDynaDecalMgr::IAllocAuxSpan(plAuxSpan* aux, uint32_t maxNumVerts, uint32_
uint16_t* dataPtr = nil; uint16_t* dataPtr = nil;
grp->ReserveIndexStorage(maxNumIdx, &aux->fIBufferIdx, &aux->fIStartIdx, &dataPtr); grp->ReserveIndexStorage(maxNumIdx, &aux->fIBufferIdx, &aux->fIStartIdx, &dataPtr);
aux->fIStartIdx; aux->fIStartIdx /* should be assigning something? */;
aux->fILength = 0; aux->fILength = 0;

2
Sources/Plasma/PubUtilLib/plDrawable/plWaveSet7.cpp

@ -1806,7 +1806,7 @@ hsGMaterial* plWaveSet7::ICreateBumpLayersPS()
// Create a blank material // Create a blank material
hsGMaterial* bumpMat = new hsGMaterial; hsGMaterial* bumpMat = new hsGMaterial;
plString buff = plString::Format("%s_BumpMatPS", GetKey()->GetName()); plString buff = plString::Format("%s_BumpMatPS", GetKey()->GetName().c_str());
hsgResMgr::ResMgr()->NewKey(buff, bumpMat, GetKey()->GetUoid().GetLocation()); hsgResMgr::ResMgr()->NewKey(buff, bumpMat, GetKey()->GetUoid().GetLocation());
plMipmap* mipMap = ICreateBumpMipmapPS(); plMipmap* mipMap = ICreateBumpMipmapPS();

2
Sources/Plasma/PubUtilLib/plFile/plFileUtils.cpp

@ -520,7 +520,7 @@ bool plFileUtils::GetSecureEncryptionKey(const wchar_t* filename, uint32_t* key,
std::wstring sFilename = filename; std::wstring sFilename = filename;
// grab parent directory // grab parent directory
unsigned loc = sFilename.rfind(L"\\"); size_t loc = sFilename.rfind(L"\\");
if (loc == std::wstring::npos) if (loc == std::wstring::npos)
loc = sFilename.rfind(L"/"); loc = sFilename.rfind(L"/");

2
Sources/Plasma/PubUtilLib/plGLight/plLightKonstants.h

@ -46,7 +46,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
class plSillyLightKonstants class plSillyLightKonstants
{ {
public: public:
static const float GetFarPowerKonst( void ) static float GetFarPowerKonst( void )
{ {
// arbitrary const, make light drop to 1/kFarPower at attenEnd. 15 just looked good to me. mf // arbitrary const, make light drop to 1/kFarPower at attenEnd. 15 just looked good to me. mf
// Done as a function so we don't have to worry about a separate .cpp file // Done as a function so we don't have to worry about a separate .cpp file

2
Sources/Plasma/PubUtilLib/plInputCore/plInputDevice.cpp

@ -166,7 +166,7 @@ void plKeyboardDevice::HandleKeyEvent(plOSMsg message, plKeyDef key, bool bKeyDo
{ {
// update the internal keyboard state // update the internal keyboard state
unsigned int keyCode = (unsigned int)key; unsigned int keyCode = (unsigned int)key;
if ((key >= 0) && (key < 256)) if (key < 256)
fKeyboardState[key] = bKeyDown; fKeyboardState[key] = bKeyDown;
if (key == KEY_SHIFT) if (key == KEY_SHIFT)

14
Sources/Plasma/PubUtilLib/plInputCore/plSceneInputInterface.cpp

@ -182,7 +182,7 @@ void plSceneInputInterface::IHalfFadeAvatar(hsBool out)
plIfaceFadeAvatarMsg* pMsg = new plIfaceFadeAvatarMsg(); plIfaceFadeAvatarMsg* pMsg = new plIfaceFadeAvatarMsg();
pMsg->SetSubjectKey(plNetClientMgr::GetInstance()->GetLocalPlayerKey()); pMsg->SetSubjectKey(plNetClientMgr::GetInstance()->GetLocalPlayerKey());
pMsg->SetBCastFlag(plMessage::kBCastByExactType); pMsg->SetBCastFlag(plMessage::kBCastByExactType);
pMsg->SetBCastFlag(plMessage::kNetPropagate, FALSE); pMsg->SetBCastFlag(plMessage::kNetPropagate, false);
pMsg->SetFadeOut(out); pMsg->SetFadeOut(out);
pMsg->Send(); pMsg->Send();
fFadedLocalAvatar = out; fFadedLocalAvatar = out;
@ -270,9 +270,9 @@ hsBool plSceneInputInterface::MsgReceive( plMessage *msg )
if (fShowLOS) if (fShowLOS)
{ {
if (pLOSMsg->fNoHit) if (pLOSMsg->fNoHit)
DetectorLogSpecial("%s: LOS miss", pObj->GetKeyName()); DetectorLogSpecial("%s: LOS miss", pObj->GetKeyName().c_str());
else else
DetectorLogSpecial("%s: LOS hit", pObj->GetKeyName()); DetectorLogSpecial("%s: LOS hit", pObj->GetKeyName().c_str());
} }
int i; int i;
const plInterfaceInfoModifier* pMod = 0; const plInterfaceInfoModifier* pMod = 0;
@ -840,12 +840,12 @@ void plSceneInputInterface::ILinkOffereeToAge()
unsigned nameLen = plNetClientMgr::GetInstance()->GetPlayerName().GetSize(); unsigned nameLen = plNetClientMgr::GetInstance()->GetPlayerName().GetSize();
if (plNetClientMgr::GetInstance()->GetPlayerName().CharAt(nameLen - 1) == 's' || plNetClientMgr::GetInstance()->GetPlayerName().CharAt(nameLen - 1) == 'S') { if (plNetClientMgr::GetInstance()->GetPlayerName().CharAt(nameLen - 1) == 's' || plNetClientMgr::GetInstance()->GetPlayerName().CharAt(nameLen - 1) == 'S') {
xtl::format( title, "%s'", plNetClientMgr::GetInstance()->GetPlayerName() ); xtl::format( title, "%s'", plNetClientMgr::GetInstance()->GetPlayerName().c_str() );
xtl::format( desc, "%s' %s", plNetClientMgr::GetInstance()->GetPlayerName(), link.GetAgeInfo()->GetAgeInstanceName() ); xtl::format( desc, "%s' %s", plNetClientMgr::GetInstance()->GetPlayerName().c_str(), link.GetAgeInfo()->GetAgeInstanceName() );
} }
else { else {
xtl::format( title, "%s's", plNetClientMgr::GetInstance()->GetPlayerName() ); xtl::format( title, "%s's", plNetClientMgr::GetInstance()->GetPlayerName().c_str() );
xtl::format( desc, "%s's %s", plNetClientMgr::GetInstance()->GetPlayerName(), link.GetAgeInfo()->GetAgeInstanceName() ); xtl::format( desc, "%s's %s", plNetClientMgr::GetInstance()->GetPlayerName().c_str(), link.GetAgeInfo()->GetAgeInstanceName() );
} }
info.SetAgeUserDefinedName( title.c_str() ); info.SetAgeUserDefinedName( title.c_str() );

4
Sources/Plasma/PubUtilLib/plMath/plRandom.h

@ -103,7 +103,7 @@ inline float plRandom::RandZeroToOne() const
return Rand() * RandNorm(); return Rand() * RandNorm();
#else // FAST_Q #else // FAST_Q
const uint32_t kOneExp = 0x3f800000; const uint32_t kOneExp = 0x3f800000;
register uint32_t temp = kOneExp | (uint32_t(Rand()) >> 9); uint32_t temp = kOneExp | (uint32_t(Rand()) >> 9);
return (*(float*)&temp) - 1.f; return (*(float*)&temp) - 1.f;
#endif // FAST_Q #endif // FAST_Q
} }
@ -117,7 +117,7 @@ inline float plRandom::RandMinusOneToOne() const
return RandZeroToOne() * 2.f - 1.f; return RandZeroToOne() * 2.f - 1.f;
#else // FAST_Q #else // FAST_Q
const uint32_t kTwoExp = 0x40000000; const uint32_t kTwoExp = 0x40000000;
register uint32_t temp = kTwoExp | (uint32_t(Rand()) >> 9); uint32_t temp = kTwoExp | (uint32_t(Rand()) >> 9);
return (*(float*)&temp) - 3.f; return (*(float*)&temp) - 3.f;
#endif // FAST_Q #endif // FAST_Q
} }

2
Sources/Plasma/PubUtilLib/plMessage/plLoadCloneMsg.cpp

@ -89,7 +89,7 @@ plLoadCloneMsg::plLoadCloneMsg(const plUoid &uoidToClone, const plKey &requestor
this->AddReceiver(plNetApp::GetInstance()->GetKey()); this->AddReceiver(plNetApp::GetInstance()->GetKey());
} else { } else {
char buffer[128]; char buffer[128];
sprintf(buffer, "Can't find key named %s", uoidToClone.GetObjectName()); sprintf(buffer, "Can't find key named %s", uoidToClone.GetObjectName().c_str());
hsAssert(0, buffer); hsAssert(0, buffer);
} }
} else { } else {

8
Sources/Plasma/PubUtilLib/plModifier/plLogicModifier.cpp

@ -171,7 +171,7 @@ hsBool plLogicModifier::MsgReceive(plMessage* msg)
{ {
if ( Disabled() ) if ( Disabled() )
{ {
DetectorLogRed("%s: LogicMod is disabled", GetKeyName()); DetectorLogRed("%s: LogicMod is disabled", GetKeyName().c_str());
} }
else else
{ {
@ -180,11 +180,11 @@ hsBool plLogicModifier::MsgReceive(plMessage* msg)
if (!fConditionList[i]->Verify(msg)) if (!fConditionList[i]->Verify(msg))
{ {
if ( plObjectInBoxConditionalObject::ConvertNoRef(fConditionList[i]) ) if ( plObjectInBoxConditionalObject::ConvertNoRef(fConditionList[i]) )
DetectorLogRed("%s: LogicMod InRegion conditional not met", fConditionList[i]->GetKeyName()); DetectorLogRed("%s: LogicMod InRegion conditional not met", fConditionList[i]->GetKeyName().c_str());
else if ( plFacingConditionalObject::ConvertNoRef(fConditionList[i]) ) else if ( plFacingConditionalObject::ConvertNoRef(fConditionList[i]) )
DetectorLogRed("%s: LogicMod Facing conditional not met", fConditionList[i]->GetKeyName()); DetectorLogRed("%s: LogicMod Facing conditional not met", fConditionList[i]->GetKeyName().c_str());
else else
DetectorLogRed("%s: LogicMod <unknown> conditional not met", fConditionList[i]->GetKeyName()); DetectorLogRed("%s: LogicMod <unknown> conditional not met", fConditionList[i]->GetKeyName().c_str());
} }
} }
} }

2
Sources/Plasma/PubUtilLib/plModifier/plResponderModifier.h

@ -143,7 +143,7 @@ public:
// Restore callback state after load // Restore callback state after load
void Restore(); void Restore();
const int8_t GetState() const { return fCurState; } int8_t GetState() const { return fCurState; }
// //
// Export time only // Export time only
// //

10
Sources/Plasma/PubUtilLib/plModifier/plSDLModifier.cpp

@ -178,8 +178,8 @@ void plSDLModifier::SendState(uint32_t sendFlags)
{ {
gMooseDump=true; gMooseDump=true;
plNetObjectDebugger::GetInstance()->SetDebugging(true); plNetObjectDebugger::GetInstance()->SetDebugging(true);
curState->DumpToObjectDebugger(xtl::format("Object %s SENDS SDL state", curState->DumpToObjectDebugger(plString::Format("Object %s SENDS SDL state",
GetStateOwnerKey()->GetName(), dirtyOnly).c_str()); GetStateOwnerKey()->GetName().c_str(), dirtyOnly).c_str());
gMooseDump=false; gMooseDump=false;
} }
@ -203,8 +203,8 @@ void plSDLModifier::ReceiveState(const plStateDataRecord* srcState)
{ {
gMooseDump=true; gMooseDump=true;
plNetObjectDebugger::GetInstance()->SetDebugging(true); plNetObjectDebugger::GetInstance()->SetDebugging(true);
srcState->DumpToObjectDebugger(xtl::format("Object %s RECVS SDL state", srcState->DumpToObjectDebugger(plString::Format("Object %s RECVS SDL state",
GetStateOwnerKey()->GetName()).c_str()); GetStateOwnerKey()->GetName().c_str()).c_str());
gMooseDump=false; gMooseDump=false;
} }
@ -222,7 +222,7 @@ void plSDLModifier::ReceiveState(const plStateDataRecord* srcState)
else else
{ {
plNetClientApp::GetInstance()->DebugMsg("\tReceiving and ignoring unused SDL state msg: type %s, object %s", plNetClientApp::GetInstance()->DebugMsg("\tReceiving and ignoring unused SDL state msg: type %s, object %s",
GetSDLName(), GetStateOwnerKey()->GetName()); GetSDLName(), GetStateOwnerKey()->GetName().c_str());
} }
if (plNetObjectDebugger::GetInstance()) if (plNetObjectDebugger::GetInstance())

6
Sources/Plasma/PubUtilLib/plNetClient/plLinkEffectsMgr.cpp

@ -328,7 +328,7 @@ hsBool plLinkEffectsMgr::MsgReceive(plMessage *msg)
plSceneObject *avatar = plSceneObject::ConvertNoRef(linkKey->ObjectIsLoaded()); plSceneObject *avatar = plSceneObject::ConvertNoRef(linkKey->ObjectIsLoaded());
if (avatar == nil) if (avatar == nil)
{ {
plNetApp::GetInstance()->DebugMsg("Can't find avatar, mod=%s\n", linkKey->GetName()); plNetApp::GetInstance()->DebugMsg("Can't find avatar, mod=%s\n", linkKey->GetName().c_str());
return true; return true;
} }
@ -470,12 +470,12 @@ hsBool plLinkEffectsMgr::MsgReceive(plMessage *msg)
else if (pTriggerMsg->fEffects < 0 ) else if (pTriggerMsg->fEffects < 0 )
{ {
plNetApp::GetInstance()->DebugMsg("Too many link callbacks received for avatar %s. Ignoring extras.\n", plNetApp::GetInstance()->DebugMsg("Too many link callbacks received for avatar %s. Ignoring extras.\n",
pTriggerMsg->GetLinkKey()->GetName()); pTriggerMsg->GetLinkKey()->GetName().c_str());
} }
else else
{ {
plNetApp::GetInstance()->DebugMsg("%d link callbacks left until avatar %s links...\n", plNetApp::GetInstance()->DebugMsg("%d link callbacks left until avatar %s links...\n",
pTriggerMsg->fEffects, pTriggerMsg->GetLinkKey()->GetName()); pTriggerMsg->fEffects, pTriggerMsg->GetLinkKey()->GetName().c_str());
} }
return true; return true;
} }

10
Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgr.cpp

@ -1333,7 +1333,7 @@ bool plNetClientMgr::IHandlePlayerPageMsg(plPlayerPageMsg *playerMsg)
if (GetLocalPlayerKey() == playerKey) if (GetLocalPlayerKey() == playerKey)
{ {
fLocalPlayerKey = nil; fLocalPlayerKey = nil;
DebugMsg("Net: Unloading local player %s", playerKey->GetName()); DebugMsg("Net: Unloading local player %s", playerKey->GetName().c_str());
// notify server - NOTE: he might not still be around to get this... // notify server - NOTE: he might not still be around to get this...
plNetMsgPlayerPage npp (playerKey->GetUoid(), playerMsg->fUnload); plNetMsgPlayerPage npp (playerKey->GetUoid(), playerMsg->fUnload);
@ -1343,7 +1343,7 @@ bool plNetClientMgr::IHandlePlayerPageMsg(plPlayerPageMsg *playerMsg)
else if (IsRemotePlayerKey(playerKey, &idx)) else if (IsRemotePlayerKey(playerKey, &idx))
{ {
fRemotePlayerKeys.erase(fRemotePlayerKeys.begin()+idx); // remove key from list fRemotePlayerKeys.erase(fRemotePlayerKeys.begin()+idx); // remove key from list
DebugMsg("Net: Unloading remote player %s", playerKey->GetName()); DebugMsg("Net: Unloading remote player %s", playerKey->GetName().c_str());
} }
} }
else else
@ -1362,7 +1362,7 @@ bool plNetClientMgr::IHandlePlayerPageMsg(plPlayerPageMsg *playerMsg)
GetLocalPlayerKey() == playerKey, GetLocalPlayerKey() == playerKey,
"Different local player already loaded"); "Different local player already loaded");
hsLogEntry(DebugMsg("Adding LOCAL player %s\n", playerKey->GetName())); hsLogEntry(DebugMsg("Adding LOCAL player %s\n", playerKey->GetName().c_str()));
playerSO->SetNetGroupConstant(plNetGroup::kNetGroupLocalPlayer); playerSO->SetNetGroupConstant(plNetGroup::kNetGroupLocalPlayer);
// don't save avatar state permanently on server // don't save avatar state permanently on server
@ -1385,7 +1385,7 @@ bool plNetClientMgr::IHandlePlayerPageMsg(plPlayerPageMsg *playerMsg)
} }
else else
{ {
hsLogEntry(DebugMsg("Adding REMOTE player %s\n", playerKey->GetName())); hsLogEntry(DebugMsg("Adding REMOTE player %s\n", playerKey->GetName().c_str()));
playerSO->SetNetGroupConstant(plNetGroup::kNetGroupRemotePlayer); playerSO->SetNetGroupConstant(plNetGroup::kNetGroupRemotePlayer);
idx=fTransport.FindMember(playerMsg->fClientID); idx=fTransport.FindMember(playerMsg->fClientID);
if( idx != -1 ) if( idx != -1 )
@ -1396,7 +1396,7 @@ bool plNetClientMgr::IHandlePlayerPageMsg(plPlayerPageMsg *playerMsg)
} }
else else
{ {
hsLogEntry(DebugMsg("Ignoring player page msg (player not found in member list) : %s\n", playerKey->GetName())); hsLogEntry(DebugMsg("Ignoring player page msg (player not found in member list) : %s\n", playerKey->GetName().c_str()));
} }
} }

4
Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrLoad.cpp

@ -135,7 +135,7 @@ plKey plNetClientMgr::ILoadClone(plLoadCloneMsg *pCloneMsg)
{ {
if (!cloneKey->ObjectIsLoaded()) if (!cloneKey->ObjectIsLoaded())
{ {
DebugMsg("ILoadClone: object %s is already unloaded, ignoring", cloneKey->GetName()); DebugMsg("ILoadClone: object %s is already unloaded, ignoring", cloneKey->GetName().c_str());
return cloneKey; return cloneKey;
} }
@ -185,7 +185,7 @@ void plNetClientMgr::IPlayerChangeAge(hsBool exitAge, int32_t spawnPt)
} }
else if (fLocalPlayerKey) else if (fLocalPlayerKey)
{ {
ErrorMsg("Can't find avatarMod %s", fLocalPlayerKey->GetName()); ErrorMsg("Can't find avatarMod %s", fLocalPlayerKey->GetName().c_str());
} }
} }

2
Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrSend.cpp

@ -120,7 +120,7 @@ int plNetClientMgr::ISendDirtyState(double secs)
if (localOwned==plSynchedObject::kNo) if (localOwned==plSynchedObject::kNo)
{ {
DebugMsg("Late rejection of queued SDL state, obj %s, sdl %s", DebugMsg("Late rejection of queued SDL state, obj %s, sdl %s",
state->fObjKey->GetName(), state->fSDLName.c_str()); state->fObjKey->GetName().c_str(), state->fSDLName.c_str());
continue; continue;
} }
} }

8
Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrShow.cpp

@ -74,7 +74,7 @@ void plNetClientMgr::IShowLists()
sprintf(str, "%s%s PlyrName=%s PlyrID=%d AcctID=%d P2P=%d Join#=%d Peers=%d %.1f,%.1f,%.1f", sprintf(str, "%s%s PlyrName=%s PlyrID=%d AcctID=%d P2P=%d Join#=%d Peers=%d %.1f,%.1f,%.1f",
GetFlagsBit(kSendingVoice) ? "V" : " ", GetFlagsBit(kSendingVoice) ? "V" : " ",
GetFlagsBit(kSendingActions) ? "A" : " ", GetFlagsBit(kSendingActions) ? "A" : " ",
GetPlayerName(), GetPlayerID(), 0, GetPlayerName().c_str(), GetPlayerID(), 0,
IsPeerToPeer(), GetJoinOrder(), 0, IsPeerToPeer(), GetJoinOrder(), 0,
pos.fX, pos.fY, pos.fZ); pos.fX, pos.fY, pos.fZ);
txt.DrawString(x,y,str,255,255,255,255); txt.DrawString(x,y,str,255,255,255,255);
@ -316,7 +316,7 @@ void plNetClientMgr::IShowAvatars()
hsPoint3 pos = (player ? player->GetLocalToWorld() * hsPoint3(0, 0, 0) : hsPoint3(0, 0, 0)); hsPoint3 pos = (player ? player->GetLocalToWorld() * hsPoint3(0, 0, 0) : hsPoint3(0, 0, 0));
hsVector3 ori = (player ? player->GetLocalToWorld() * hsVector3(0, -1, 0) : hsVector3(0, 0, 0)); hsVector3 ori = (player ? player->GetLocalToWorld() * hsVector3(0, -1, 0) : hsVector3(0, 0, 0));
sprintf(str, "%s: pos(%.2f, %.2f, %.2f) ori(%.2f, %.2f, %.2f)", sprintf(str, "%s: pos(%.2f, %.2f, %.2f) ori(%.2f, %.2f, %.2f)",
GetPlayerName(), pos.fX, pos.fY, pos.fZ, ori.fX, ori.fY, ori.fZ); GetPlayerName().c_str(), pos.fX, pos.fY, pos.fZ, ori.fX, ori.fY, ori.fZ);
txt.DrawString(x,y,str,255,255,255,255); txt.DrawString(x,y,str,255,255,255,255);
@ -334,7 +334,7 @@ void plNetClientMgr::IShowAvatars()
hsPoint3 pos = (pObj ? pObj->GetLocalToWorld() * hsPoint3(0, 0, 0) : hsPoint3(0, 0, 0)); hsPoint3 pos = (pObj ? pObj->GetLocalToWorld() * hsPoint3(0, 0, 0) : hsPoint3(0, 0, 0));
hsVector3 ori = (pObj ? pObj->GetLocalToWorld() * hsVector3(0, -1, 0) : hsVector3(0, 0, 0)); hsVector3 ori = (pObj ? pObj->GetLocalToWorld() * hsVector3(0, -1, 0) : hsVector3(0, 0, 0));
sprintf(str, "%s: pos(%.2f, %.2f, %.2f) ori(%.2f, %.2f, %.2f)", sprintf(str, "%s: pos(%.2f, %.2f, %.2f) ori(%.2f, %.2f, %.2f)",
pObj->GetKeyName(), pos.fX, pos.fY, pos.fZ, ori.fX, ori.fY, ori.fZ); pObj->GetKeyName().c_str(), pos.fX, pos.fY, pos.fZ, ori.fX, ori.fY, ori.fZ);
txt.DrawString(x,y,str,255,255,255,255); txt.DrawString(x,y,str,255,255,255,255);
} }
} }
@ -377,7 +377,7 @@ void plNetClientMgr::IShowAvatars()
hsPoint3 pos = (pObj ? pObj->GetLocalToWorld() * hsPoint3(0, 0, 0) : hsPoint3(0, 0, 0)); hsPoint3 pos = (pObj ? pObj->GetLocalToWorld() * hsPoint3(0, 0, 0) : hsPoint3(0, 0, 0));
hsVector3 ori = (pObj ? pObj->GetLocalToWorld() * hsVector3(0, -1, 0) : hsVector3(0, 0, 0)); hsVector3 ori = (pObj ? pObj->GetLocalToWorld() * hsVector3(0, -1, 0) : hsVector3(0, 0, 0));
sprintf(str, "%s: pos(%.2f, %.2f, %.2f) ori(%.2f, %.2f, %.2f)", sprintf(str, "%s: pos(%.2f, %.2f, %.2f) ori(%.2f, %.2f, %.2f)",
pObj->GetKeyName(), pos.fX, pos.fY, pos.fZ, ori.fX, ori.fY, ori.fZ); pObj->GetKeyName().c_str(), pos.fX, pos.fY, pos.fZ, ori.fX, ori.fY, ori.fZ);
txt.DrawString(x,y,str,255,255,255,255); txt.DrawString(x,y,str,255,255,255,255);
} }
} }

3
Sources/Plasma/PubUtilLib/plNetClient/plNetClientMsgHandler.cpp

@ -286,7 +286,8 @@ MSG_HANDLER_DEFN(plNetClientMsgHandler,plNetMsgSDLState)
// queue up state // queue up state
nc->fPendingLoads.push_back(pl); nc->fPendingLoads.push_back(pl);
hsLogEntry( nc->DebugMsg( "Added pending SDL delivery for %s:%s", m->ObjectInfo()->GetObjectName(), des->GetName() ) ); hsLogEntry( nc->DebugMsg( "Added pending SDL delivery for %s:%s",
m->ObjectInfo()->GetObjectName().c_str(), des->GetName() ) );
} }
else else
delete sdRec; delete sdRec;

4
Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.cpp

@ -951,9 +951,9 @@ uint8_t plNetLinkingMgr::IPreProcessLink(void)
plString title; plString title;
unsigned nameLen = nc->GetPlayerName().GetSize(); unsigned nameLen = nc->GetPlayerName().GetSize();
if (nc->GetPlayerName().CharAt(nameLen - 1) == 's' || nc->GetPlayerName().CharAt(nameLen - 1) == 'S') if (nc->GetPlayerName().CharAt(nameLen - 1) == 's' || nc->GetPlayerName().CharAt(nameLen - 1) == 'S')
title = plString::Format("%s'", nc->GetPlayerName()); title = plString::Format("%s'", nc->GetPlayerName().c_str());
else else
title = plString::Format("%s's", nc->GetPlayerName()); title = plString::Format("%s's", nc->GetPlayerName().c_str());
info->SetAgeUserDefinedName(_TEMP_CONVERT_TO_CONST_CHAR(title)); info->SetAgeUserDefinedName(_TEMP_CONVERT_TO_CONST_CHAR(title));
} }
if (!info->HasAgeDescription()) if (!info->HasAgeDescription())

8
Sources/Plasma/PubUtilLib/plNetClientComm/plNetClientComm.cpp

@ -875,7 +875,7 @@ static void FileSrvIpAddressCallback (
***/ ***/
//============================================================================ //============================================================================
const NetCommPlayer * const NetCommGetPlayer () { const NetCommPlayer * NetCommGetPlayer () {
static NetCommPlayer s_nilPlayer; static NetCommPlayer s_nilPlayer;
return s_player ? s_player : &s_nilPlayer; return s_player ? s_player : &s_nilPlayer;
} }
@ -891,7 +891,7 @@ unsigned NetCommGetPlayerCount () {
} }
//============================================================================ //============================================================================
const NetCommAccount * const NetCommGetAccount () { const NetCommAccount * NetCommGetAccount () {
return &s_account; return &s_account;
} }
@ -901,12 +901,12 @@ bool NetCommIsLoginComplete() {
} }
//============================================================================ //============================================================================
const NetCommAge * const NetCommGetAge () { const NetCommAge * NetCommGetAge () {
return &s_age; return &s_age;
} }
//============================================================================ //============================================================================
const NetCommAge * const NetCommGetStartupAge () { const NetCommAge * NetCommGetStartupAge () {
return &s_startupAge; return &s_startupAge;
} }

8
Sources/Plasma/PubUtilLib/plNetClientComm/plNetClientComm.h

@ -94,10 +94,10 @@ struct NetCommAge {
char spawnPtName[64]; char spawnPtName[64];
}; };
const NetCommAge * const NetCommGetAge (); const NetCommAge * NetCommGetAge ();
const NetCommAge * const NetCommGetStartupAge (); const NetCommAge * NetCommGetStartupAge ();
const NetCommAccount * const NetCommGetAccount (); const NetCommAccount * NetCommGetAccount ();
const NetCommPlayer * const NetCommGetPlayer (); const NetCommPlayer * NetCommGetPlayer ();
const ARRAY(NetCommPlayer) & NetCommGetPlayerList (); const ARRAY(NetCommPlayer) & NetCommGetPlayerList ();
unsigned NetCommGetPlayerCount (); unsigned NetCommGetPlayerCount ();
bool NetCommIsLoginComplete (); bool NetCommIsLoginComplete ();

4
Sources/Plasma/PubUtilLib/plNetCommon/plNetCommon.h

@ -199,7 +199,7 @@ namespace plNetCommon
kChildAgeBook, kChildAgeBook,
}; };
static const char * LinkingRuleStr( int rule ) inline const char * LinkingRuleStr( int rule )
{ {
switch ( rule ) switch ( rule )
{ {
@ -238,7 +238,7 @@ namespace plNetCommon
kExternalRelease kExternalRelease
}; };
static const char * BuildTypeStr( int rule ) inline const char * BuildTypeStr( int rule )
{ {
switch ( rule ) switch ( rule )
{ {

2
Sources/Plasma/PubUtilLib/plNetMessage/plNetMessage.cpp

@ -705,7 +705,7 @@ plString plNetMsgSDLState::AsString() const
ISetDescName(); // set desc name for debug if necessary ISetDescName(); // set desc name for debug if necessary
return plString::Format("object:%s, initial:%d, %s", return plString::Format("object:%s, initial:%d, %s",
ObjectInfo()->GetObjectName(), fIsInitialState, plNetMsgStreamedObject::AsString().c_str() ); ObjectInfo()->GetObjectName().c_str(), fIsInitialState, plNetMsgStreamedObject::AsString().c_str() );
} }
// //

4
Sources/Plasma/PubUtilLib/plParticleSystem/plParticleGenerator.cpp

@ -58,7 +58,7 @@ static const float DEFAULT_INVERSE_MASS = 1.f;
static plRandom sRandom; static plRandom sRandom;
const void plParticleGenerator::ComputeDirection(float pitch, float yaw, hsVector3 &direction) void plParticleGenerator::ComputeDirection(float pitch, float yaw, hsVector3 &direction)
{ {
float cosPitch, sinPitch; float cosPitch, sinPitch;
float cosYaw, sinYaw; float cosYaw, sinYaw;
@ -70,7 +70,7 @@ const void plParticleGenerator::ComputeDirection(float pitch, float yaw, hsVecto
// Inverse function of ComputeDirection. Give it a normalized vector, and it will tell you a // Inverse function of ComputeDirection. Give it a normalized vector, and it will tell you a
// pitch and yaw (angles for the unit Z vector) to get there. // pitch and yaw (angles for the unit Z vector) to get there.
const void plParticleGenerator::ComputePitchYaw(float &pitch, float &yaw, const hsVector3 &dir) void plParticleGenerator::ComputePitchYaw(float &pitch, float &yaw, const hsVector3 &dir)
{ {
const float PI = 3.14159f; const float PI = 3.14159f;
pitch = asin(dir.fY); pitch = asin(dir.fY);

4
Sources/Plasma/PubUtilLib/plParticleSystem/plParticleGenerator.h

@ -63,8 +63,8 @@ public:
CLASSNAME_REGISTER( plParticleGenerator ); CLASSNAME_REGISTER( plParticleGenerator );
GETINTERFACE_ANY( plParticleGenerator, plCreatable ); GETINTERFACE_ANY( plParticleGenerator, plCreatable );
static const void ComputeDirection(float pitch, float yaw, hsVector3 &direction); static void ComputeDirection(float pitch, float yaw, hsVector3 &direction);
static const void ComputePitchYaw(float &pitch, float &yaw, const hsVector3 &dir); static void ComputePitchYaw(float &pitch, float &yaw, const hsVector3 &dir);
static inline float GetRandomVar() { return 2.0f * (float)hsRand() / RAND_MAX - 1; } // returns a num between +/- 1.0 static inline float GetRandomVar() { return 2.0f * (float)hsRand() / RAND_MAX - 1; } // returns a num between +/- 1.0
}; };

38
Sources/Plasma/PubUtilLib/plPhysical/plCollisionDetector.cpp

@ -252,22 +252,22 @@ void plCameraRegionDetector::ITrigger(plKey hitter, bool entering, bool immediat
// PHYSX_FIXME hack for PhysX turd that sends bunches of enter/exits over one frame // PHYSX_FIXME hack for PhysX turd that sends bunches of enter/exits over one frame
if (entering && fNumEvals - fLastExitEval <= 1 && fSavingSendMsg) if (entering && fNumEvals - fLastExitEval <= 1 && fSavingSendMsg)
{ {
DetectorLog("%s: Skipping Camera Entering volume", GetKeyName()); DetectorLog("%s: Skipping Camera Entering volume", GetKeyName().c_str());
fLastEnterEval = fNumEvals; fLastEnterEval = fNumEvals;
if (fSavingSendMsg) if (fSavingSendMsg)
{ {
DetectorLog("%s: Dumping saved Camera Exiting volume", GetKeyName()); DetectorLog("%s: Dumping saved Camera Exiting volume", GetKeyName().c_str());
} }
fSavingSendMsg = false; fSavingSendMsg = false;
return; return;
} }
if (!entering && fNumEvals - fLastEnterEval <= 1 && fSavingSendMsg) if (!entering && fNumEvals - fLastEnterEval <= 1 && fSavingSendMsg)
{ {
DetectorLog("%s: Skipping Exiting volume", GetKeyName()); DetectorLog("%s: Skipping Exiting volume", GetKeyName().c_str());
fLastExitEval = fNumEvals; fLastExitEval = fNumEvals;
if (fSavingSendMsg) if (fSavingSendMsg)
{ {
DetectorLog("%s: Dumping saved Camera Entering volume", GetKeyName()); DetectorLog("%s: Dumping saved Camera Entering volume", GetKeyName().c_str());
} }
fSavingSendMsg = false; fSavingSendMsg = false;
return; return;
@ -276,7 +276,7 @@ void plCameraRegionDetector::ITrigger(plKey hitter, bool entering, bool immediat
// get rid of any saved messages... this should happen though // get rid of any saved messages... this should happen though
if (fSavingSendMsg) if (fSavingSendMsg)
{ {
DetectorLog("%s: Killing saved camera message... shouldn't happen", GetKeyName()); DetectorLog("%s: Killing saved camera message... shouldn't happen", GetKeyName().c_str());
} }
// end PHYSX_FIXME hack for PhysX turd that sends bunches of enter/exits over one frame // end PHYSX_FIXME hack for PhysX turd that sends bunches of enter/exits over one frame
#endif // USE_PHYSX_COLLISION_FLUTTER_WORKAROUND #endif // USE_PHYSX_COLLISION_FLUTTER_WORKAROUND
@ -285,12 +285,12 @@ void plCameraRegionDetector::ITrigger(plKey hitter, bool entering, bool immediat
fSavedMsgEnterFlag = entering; fSavedMsgEnterFlag = entering;
if (entering) if (entering)
{ {
//DetectorLog("%s: Saving camera Entering volume - Evals=%d", GetKeyName(),fNumEvals); //DetectorLog("%s: Saving camera Entering volume - Evals=%d", GetKeyName().c_str(),fNumEvals);
fLastEnterEval = fNumEvals; fLastEnterEval = fNumEvals;
} }
else else
{ {
//DetectorLog("%s: Saving camera Exiting volume - Evals=%d", GetKeyName(),fNumEvals); //DetectorLog("%s: Saving camera Exiting volume - Evals=%d", GetKeyName().c_str(),fNumEvals);
fLastExitEval = fNumEvals; fLastExitEval = fNumEvals;
} }
@ -322,13 +322,13 @@ void plCameraRegionDetector::ISendSavedTriggerMsgs()
if (fSavedMsgEnterFlag) if (fSavedMsgEnterFlag)
{ {
fMessages[i]->SetCmd(plCameraMsg::kEntering); fMessages[i]->SetCmd(plCameraMsg::kEntering);
sprintf(str, "Entering cameraRegion: %s - Evals=%d -msg %d of %d\n", GetKeyName(),fNumEvals,i+1,fMessages.Count()); sprintf(str, "Entering cameraRegion: %s - Evals=%d -msg %d of %d\n", GetKeyName().c_str(),fNumEvals,i+1,fMessages.Count());
fIsInside = true; fIsInside = true;
} }
else else
{ {
fMessages[i]->ClearCmd(plCameraMsg::kEntering); fMessages[i]->ClearCmd(plCameraMsg::kEntering);
sprintf(str, "Exiting cameraRegion: %s - Evals=%d -msg %d of %d\n", GetKeyName(),fNumEvals,i+1,fMessages.Count()); sprintf(str, "Exiting cameraRegion: %s - Evals=%d -msg %d of %d\n", GetKeyName().c_str(),fNumEvals,i+1,fMessages.Count());
fIsInside = false; fIsInside = false;
} }
plgDispatch::MsgSend(fMessages[i]); plgDispatch::MsgSend(fMessages[i]);
@ -401,7 +401,7 @@ void plCameraRegionDetector::IHandleEval(plEvalMsg *pEval)
{ {
if(fSavedActivatorMsg) if(fSavedActivatorMsg)
DetectorLog("%s didn't send its message. fNumEvals=%d fLastEnterEval=%d, fLastExit=%d", DetectorLog("%s didn't send its message. fNumEvals=%d fLastEnterEval=%d, fLastExit=%d",
GetKeyName(),fNumEvals, fLastEnterEval, fLastExitEval); GetKeyName().c_str(),fNumEvals, fLastEnterEval, fLastExitEval);
} }
} }
@ -663,11 +663,11 @@ void plObjectInVolumeDetector::IHandleEval(plEvalMsg* pEval)
fCurrentResidents.insert((*it)->hitter); fCurrentResidents.insert((*it)->hitter);
actout->AddReceivers(fReceivers); actout->AddReceivers(fReceivers);
actout->Send(); actout->Send();
DetectorLog("%s sent an Enter ActivatorMsg. To: %s", GetKeyName(), GetTarget()->GetKeyName() ); DetectorLog("%s sent an Enter ActivatorMsg. To: %s", GetKeyName().c_str(), GetTarget()->GetKeyName().c_str() );
} }
else else
{ {
DetectorLog("%s squelched an Enter ActivatorMsg.", GetKeyName()); DetectorLog("%s squelched an Enter ActivatorMsg.", GetKeyName().c_str());
delete actout; delete actout;
} }
} }
@ -680,11 +680,11 @@ void plObjectInVolumeDetector::IHandleEval(plEvalMsg* pEval)
fCurrentResidents.erase((*it)->hitter); fCurrentResidents.erase((*it)->hitter);
actout->AddReceivers(fReceivers); actout->AddReceivers(fReceivers);
actout->Send(); actout->Send();
DetectorLog("%s sent an Exit ActivatorMsg. To: %s", GetKeyName(), GetTarget()->GetKeyName()); DetectorLog("%s sent an Exit ActivatorMsg. To: %s", GetKeyName().c_str(), GetTarget()->GetKeyName().c_str());
} }
else else
{ {
DetectorLog("%s squelched an Exit ActivatorMsg.", GetKeyName()); DetectorLog("%s squelched an Exit ActivatorMsg.", GetKeyName().c_str());
delete actout; delete actout;
} }
} }
@ -697,7 +697,7 @@ void plObjectInVolumeDetector::IHandleEval(plEvalMsg* pEval)
DetectorLog("This is the regions inhabitants after the op"); DetectorLog("This is the regions inhabitants after the op");
for(ResidentSet::iterator it = fCurrentResidents.begin(); it!= fCurrentResidents.end(); it++) for(ResidentSet::iterator it = fCurrentResidents.begin(); it!= fCurrentResidents.end(); it++)
{ {
DetectorLog("%s", (*it)->GetName()); DetectorLog("%s", (*it)->GetName().c_str());
} }
DetectorLog("*********"); DetectorLog("*********");
@ -778,13 +778,13 @@ void plObjectInVolumeAndFacingDetector::ICheckForTrigger()
if (facing && movingForward && !fTriggered) if (facing && movingForward && !fTriggered)
{ {
DetectorLog("%s: Trigger InVolume&Facing", GetKeyName()); DetectorLog("%s: Trigger InVolume&Facing", GetKeyName().c_str());
fTriggered = true; fTriggered = true;
ITrigger(avatar->GetKey(), true, true); ITrigger(avatar->GetKey(), true, true);
} }
else if (!facing && fTriggered) else if (!facing && fTriggered)
{ {
DetectorLog("%s: Untrigger InVolume&Facing", GetKeyName()); DetectorLog("%s: Untrigger InVolume&Facing", GetKeyName().c_str());
fTriggered = false; fTriggered = false;
ITrigger(avatar->GetKey(), false, true); ITrigger(avatar->GetKey(), false, true);
} }
@ -877,7 +877,7 @@ hsBool plSubworldRegionDetector::MsgReceive(plMessage* msg)
plArmatureMod* avMod = IGetAvatarModifier(pCollMsg->fOtherKey); plArmatureMod* avMod = IGetAvatarModifier(pCollMsg->fOtherKey);
if (avMod) if (avMod)
{ {
DetectorLog("%s subworld detector %s", pCollMsg->fEntering ? "Entering" : "Exiting", GetKeyName()); DetectorLog("%s subworld detector %s", pCollMsg->fEntering ? "Entering" : "Exiting", GetKeyName().c_str());
if ((pCollMsg->fEntering && !fOnExit) || if ((pCollMsg->fEntering && !fOnExit) ||
(!pCollMsg->fEntering && fOnExit)) (!pCollMsg->fEntering && fOnExit))
@ -887,7 +887,7 @@ hsBool plSubworldRegionDetector::MsgReceive(plMessage* msg)
plSceneObject* SO = plSceneObject::ConvertNoRef(fSub->ObjectIsLoaded()); plSceneObject* SO = plSceneObject::ConvertNoRef(fSub->ObjectIsLoaded());
if (SO) if (SO)
{ {
DetectorLogSpecial("Switching to subworld %s", fSub->GetName()); DetectorLogSpecial("Switching to subworld %s", fSub->GetName().c_str());
plKey nilKey; plKey nilKey;
plSubWorldMsg* msg = new plSubWorldMsg(GetKey(), avMod->GetKey(), fSub); plSubWorldMsg* msg = new plSubWorldMsg(GetKey(), avMod->GetKey(), fSub);

18
Sources/Plasma/PubUtilLib/plPhysical/plPhysicalSDLModifier.cpp

@ -215,27 +215,27 @@ void plPhysicalSDLModifier::ILogState(const plStateDataRecord* state, bool useDi
plPhysical* phys = IGetPhysical(); plPhysical* phys = IGetPhysical();
std::string log = xtl::format("%s: %s", phys->GetKeyName(), prefix); plString log = plString::Format("%s: %s", phys->GetKeyName().c_str(), prefix);
if (isPosSet) if (isPosSet)
log += xtl::format(" Pos=%.1f %.1f %.1f", pos.fX, pos.fY, pos.fZ); log += plString::Format(" Pos=%.1f %.1f %.1f", pos.fX, pos.fY, pos.fZ);
else else
log += " Pos=None"; log += _TEMP_CONVERT_FROM_LITERAL(" Pos=None");
if (isLinVSet) if (isLinVSet)
log += xtl::format(" LinV=%.1f %.1f %.1f", linV.fX, linV.fY, linV.fZ); log += plString::Format(" LinV=%.1f %.1f %.1f", linV.fX, linV.fY, linV.fZ);
else else
log += " LinV=None"; log += _TEMP_CONVERT_FROM_LITERAL(" LinV=None");
if (isAngVSet) if (isAngVSet)
log += xtl::format(" AngV=%.1f %.1f %.1f", angV.fX, angV.fY, angV.fZ); log += plString::Format(" AngV=%.1f %.1f %.1f", angV.fX, angV.fY, angV.fZ);
else else
log += " AngV=None"; log += _TEMP_CONVERT_FROM_LITERAL(" AngV=None");
if (isRotSet) if (isRotSet)
log += xtl::format(" Rot=%.1f %.1f %.1f %.1f", rot.fX, rot.fY, rot.fZ, rot.fW); log += plString::Format(" Rot=%.1f %.1f %.1f %.1f", rot.fX, rot.fY, rot.fZ, rot.fW);
else else
log += " Rot=None"; log += _TEMP_CONVERT_FROM_LITERAL(" Rot=None");
IGetLog()->AddLine(log.c_str(), color); IGetLog()->AddLine(log.c_str(), color);
} }

2
Sources/Plasma/PubUtilLib/plPhysical/plPickingDetector.cpp

@ -99,7 +99,7 @@ hsBool plPickingDetector::MsgReceive(plMessage* msg)
pMsg->SetSender(GetKey()); pMsg->SetSender(GetKey());
plgDispatch::MsgSend( pMsg ); plgDispatch::MsgSend( pMsg );
hsStatusMessageF("%s sending activate message to %s\n",GetKey()->GetName(), fReceivers[i]->GetName()); hsStatusMessageF("%s sending activate message to %s\n",GetKey()->GetName().c_str(), fReceivers[i]->GetName().c_str());
} }
} }

2
Sources/Plasma/PubUtilLib/plPipeline/plCullTree.h

@ -209,7 +209,7 @@ public:
void SetPlane(const hsVector3& n, float d) { fNorm = n; fDist = d; } void SetPlane(const hsVector3& n, float d) { fNorm = n; fDist = d; }
const hsVector3& GetNormal() const { return fNorm; } const hsVector3& GetNormal() const { return fNorm; }
const float GetDist() const { return fDist; } float GetDist() const { return fDist; }
plCullStatus TestBounds(const hsBounds3Ext& bnd) const; plCullStatus TestBounds(const hsBounds3Ext& bnd) const;
plCullStatus TestSphere(const hsPoint3& center, float rad) const; plCullStatus TestSphere(const hsPoint3& center, float rad) const;

4
Sources/Plasma/PubUtilLib/plPipeline/plDebugText.h

@ -139,12 +139,12 @@ class plDebugText
void SetFont(const char *face, uint16_t size ) { hsStrncpy( fFontFace, face, sizeof( fFontFace ) ); fFontSize = size; } void SetFont(const char *face, uint16_t size ) { hsStrncpy( fFontFace, face, sizeof( fFontFace ) ); fFontSize = size; }
const char *GetFontFace( void ) { return fFontFace; } const char *GetFontFace( void ) { return fFontFace; }
const uint16_t GetFontSize( void ) { return fFontSize; } uint16_t GetFontSize( void ) { return fFontSize; }
uint16_t GetFontHeight(); uint16_t GetFontHeight();
void SetEnable( hsBool on ) { fEnabled = on; } void SetEnable( hsBool on ) { fEnabled = on; }
void DisablePermanently( void ) { fEnabled = false; fLockEnable = true; } void DisablePermanently( void ) { fEnabled = false; fLockEnable = true; }
const hsBool IsEnabled( void ) { return fEnabled; } hsBool IsEnabled( void ) { return fEnabled; }
void GetScreenSize( uint32_t *width, uint32_t *height ); void GetScreenSize( uint32_t *width, uint32_t *height );
}; };

8
Sources/Plasma/PubUtilLib/plPipeline/plDynamicEnvMap.cpp

@ -573,7 +573,10 @@ void plDynamicCamMap::ISetupRenderRequest(plPipeline *pipe)
hsMatrix44 w2c, c2w; hsMatrix44 w2c, c2w;
if (fCamera) if (fCamera)
{ {
w2c.MakeCamera(&fCamera->GetTargetPos(), &fCamera->GetTargetPOA(), &hsVector3(0.f, 0.f, 1.f)); hsPoint3 pos = fCamera->GetTargetPos();
hsPoint3 poa = fCamera->GetTargetPOA();
hsVector3 vec(0.f, 0.f, 1.f);
w2c.MakeCamera(&pos, &poa, &vec);
w2c.GetInverse(&c2w); w2c.GetInverse(&c2w);
} }
else else
@ -584,7 +587,8 @@ void plDynamicCamMap::ISetupRenderRequest(plPipeline *pipe)
// Could be optimized, but the matrix construction work here seems cheap relative to the cost // Could be optimized, but the matrix construction work here seems cheap relative to the cost
// of rerendering all this stuff to a separate target, so I doubt we'd notice. // of rerendering all this stuff to a separate target, so I doubt we'd notice.
hsMatrix44 invert; hsMatrix44 invert;
invert.MakeScaleMat(&(hsVector3(1.f, 1.f, -1.f))); hsVector3 vec(1.f, 1.f, -1.f);
invert.MakeScaleMat(&vec);
w2c = pipe->GetWorldToCamera(); w2c = pipe->GetWorldToCamera();
c2w = pipe->GetCameraToWorld(); c2w = pipe->GetCameraToWorld();

6
Sources/Plasma/PubUtilLib/plPipeline/plPlates.h

@ -182,9 +182,9 @@ class plGraphPlate : public plPlate
void SetDataColors( const std::vector<uint32_t> & hexColors ); void SetDataColors( const std::vector<uint32_t> & hexColors );
const char *GetLabelText( int i ) { return fLabelText[ i ].c_str(); } const char *GetLabelText( int i ) { return fLabelText[ i ].c_str(); }
const uint32_t GetDataColor( int i ) { return fDataHexColors[ i ]; } uint32_t GetDataColor( int i ) { return fDataHexColors[ i ]; }
const uint32_t GetNumLabels() { return fLabelText.size(); } uint32_t GetNumLabels() { return fLabelText.size(); }
const uint32_t GetNumColors() { return fDataHexColors.size(); } uint32_t GetNumColors() { return fDataHexColors.size(); }
}; };
//// plPlateManager Class Definition ///////////////////////////////////////// //// plPlateManager Class Definition /////////////////////////////////////////

2
Sources/Plasma/PubUtilLib/plResMgr/plResManager.cpp

@ -612,7 +612,7 @@ const plLocation& plResManager::FindLocation(const char* age, const char* page)
return invalidLoc; return invalidLoc;
} }
const void plResManager::GetLocationStrings(const plLocation& loc, char* ageBuffer, char* pageBuffer) const void plResManager::GetLocationStrings(const plLocation& loc, char* ageBuffer, char* pageBuffer) const
{ {
plRegistryPageNode* page = FindPage(loc); plRegistryPageNode* page = FindPage(loc);
const plPageInfo& info = page->GetPageInfo(); const plPageInfo& info = page->GetPageInfo();

2
Sources/Plasma/PubUtilLib/plResMgr/plResManager.h

@ -88,7 +88,7 @@ public:
virtual plKey FindKey(const plUoid&); // Same as above, but will check the uoid for clones virtual plKey FindKey(const plUoid&); // Same as above, but will check the uoid for clones
const plLocation& FindLocation(const char* age, const char* page) const; const plLocation& FindLocation(const char* age, const char* page) const;
// Use nil for any strings you don't need // Use nil for any strings you don't need
const void GetLocationStrings(const plLocation& loc, char* ageBuffer, char* pageBuffer) const; void GetLocationStrings(const plLocation& loc, char* ageBuffer, char* pageBuffer) const;
//--------------------------- //---------------------------
// Establish reference linkage // Establish reference linkage

2
Sources/Plasma/PubUtilLib/plSDL/plStateVariable.cpp

@ -2068,7 +2068,7 @@ bool plSimpleStateVariable::ReadData(hsStream* s, float timeConvert, uint32_t re
uint32_t cnt; uint32_t cnt;
s->ReadLE(&cnt); // have to read as long since we don't know how big the list is s->ReadLE(&cnt); // have to read as long since we don't know how big the list is
if (cnt>=0 && cnt<plSDL::kMaxListSize) if (cnt<plSDL::kMaxListSize)
fVar.SetCount(cnt); fVar.SetCount(cnt);
else else
return false; return false;

7
Sources/Plasma/PubUtilLib/plStatGather/plAutoProfile.cpp

@ -224,13 +224,12 @@ void plAutoProfileImp::INextProfile()
plMipmap mipmap; plMipmap mipmap;
if (plClient::GetInstance()->GetPipeline()->CaptureScreen(&mipmap)) if (plClient::GetInstance()->GetPipeline()->CaptureScreen(&mipmap))
{ {
char fileName[256]; plString fileName = plString::Format("%S%s_%s.jpg",
sprintf(fileName, "%s%s_%s.jpg",
plProfileManagerFull::Instance().GetProfilePath(), plProfileManagerFull::Instance().GetProfilePath(),
ageName, fLastSpawnPointName); ageName, fLastSpawnPointName.c_str());
plJPEG::Instance().SetWriteQuality(100); plJPEG::Instance().SetWriteQuality(100);
plJPEG::Instance().WriteToFile(fileName, &mipmap); plJPEG::Instance().WriteToFile(fileName.c_str(), &mipmap);
} }
fLastSpawnPointName = plString::Null; fLastSpawnPointName = plString::Null;

2
Sources/Plasma/PubUtilLib/plSurface/plShader.cpp

@ -276,7 +276,7 @@ float plShader::GetFloat(int i, int chan) const
return fConsts[i].fArray[chan]; return fConsts[i].fArray[chan];
} }
const float* const plShader::GetFloat4(int i) const const float* plShader::GetFloat4(int i) const
{ {
return fConsts[i].fArray; return fConsts[i].fArray;
} }

2
Sources/Plasma/PubUtilLib/plSurface/plShader.h

@ -227,7 +227,7 @@ public:
hsVector3 GetVector(int i) const; hsVector3 GetVector(int i) const;
void GetVector(int i, float& x, float& y, float& z, float& w) const; void GetVector(int i, float& x, float& y, float& z, float& w) const;
float GetFloat(int i, int chan) const; float GetFloat(int i, int chan) const;
const float* const GetFloat4(int i) const; const float* GetFloat4(int i) const;
void SetMatrix(int i, const plFloat44& xfm); // Will transpose void SetMatrix(int i, const plFloat44& xfm); // Will transpose
void SetMatrix3(int i, const plFloat44& xfm); // Will transpose void SetMatrix3(int i, const plFloat44& xfm); // Will transpose

2
Sources/Plasma/PubUtilLib/plSurface/plShaderTable.h

@ -113,7 +113,7 @@ public:
plShaderID::ID GetID() const { return fID; } plShaderID::ID GetID() const { return fID; }
uint32_t GetByteLen() const { return fbyteLen; } uint32_t GetByteLen() const { return fbyteLen; }
const uint8_t* GetCodes() const { return fCodes; } const uint8_t* GetCodes() const { return fCodes; }
const char* const GetFileName() const { return fFileName; } const char* GetFileName() const { return fFileName; }
}; };
class plShaderTableInst class plShaderTableInst

Loading…
Cancel
Save