mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-17 10:52:46 +00:00
Merge remote-tracking branch 'origin/master' into plString
Conflicts: Sources/Plasma/CoreLib/hsStream.h Sources/Plasma/FeatureLib/pfAudio/plListener.cpp Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp Sources/Plasma/FeatureLib/pfConsole/pfDispatchLog.cpp Sources/Plasma/FeatureLib/pfJournalBook/pfJournalBook.cpp Sources/Plasma/FeatureLib/pfPython/cyMisc.cpp Sources/Plasma/FeatureLib/pfPython/cyMisc.h Sources/Plasma/FeatureLib/pfPython/cyMiscGlue4.cpp Sources/Plasma/FeatureLib/pfPython/plPythonFileMod.cpp Sources/Plasma/FeatureLib/pfPython/plPythonFileMod.h Sources/Plasma/FeatureLib/pfPython/pyImage.cpp Sources/Plasma/FeatureLib/pfPython/pyJournalBook.cpp Sources/Plasma/FeatureLib/pfPython/pyNetServerSessionInfo.h Sources/Plasma/NucleusLib/pnKeyedObject/plFixedKey.cpp Sources/Plasma/NucleusLib/pnKeyedObject/plKeyImp.cpp Sources/Plasma/NucleusLib/pnKeyedObject/plUoid.cpp Sources/Plasma/NucleusLib/pnKeyedObject/plUoid.h Sources/Plasma/NucleusLib/pnMessage/plMessage.h Sources/Plasma/NucleusLib/pnNetCommon/plNetApp.h Sources/Plasma/PubUtilLib/plAvatar/plCoopCoordinator.cpp Sources/Plasma/PubUtilLib/plDrawable/plDrawableSpansExport.cpp Sources/Plasma/PubUtilLib/plDrawable/plDynaDecalMgr.cpp Sources/Plasma/PubUtilLib/plDrawable/plWaveSet7.cpp Sources/Plasma/PubUtilLib/plInputCore/plInputDevice.h Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgr.h Sources/Plasma/PubUtilLib/plNetCommon/plClientGuid.h Sources/Plasma/PubUtilLib/plNetMessage/plNetMessage.cpp Sources/Plasma/PubUtilLib/plNetMessage/plNetMsgHelpers.h Sources/Plasma/PubUtilLib/plNetTransport/plNetTransportMember.h Sources/Plasma/PubUtilLib/plPhysX/plSimulationMgr.cpp Sources/Plasma/PubUtilLib/plPipeline/plDXPipeline.cpp Sources/Plasma/PubUtilLib/plPipeline/plPlates.cpp Sources/Plasma/PubUtilLib/plResMgr/plKeyFinder.cpp Sources/Plasma/PubUtilLib/plResMgr/plKeyFinder.h Sources/Plasma/PubUtilLib/plResMgr/plRegistryNode.cpp Sources/Plasma/PubUtilLib/plResMgr/plRegistryNode.h Sources/Plasma/PubUtilLib/plScene/plRelevanceMgr.cpp Sources/Plasma/PubUtilLib/plScene/plRelevanceMgr.h Sources/Plasma/PubUtilLib/plSurface/plGrassShaderMod.cpp
This commit is contained in:
@ -40,7 +40,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
|
||||
*==LICENSE==*/
|
||||
#include "hsMatrix44.h"
|
||||
#include "hsTypes.h"
|
||||
#include "HeadSpin.h"
|
||||
#include "plListener.h"
|
||||
#include "plgDispatch.h"
|
||||
#include "plAudio/plAudioSystem.h"
|
||||
@ -61,7 +61,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
|
||||
hsBool plListener::fPrintDbgInfo = false;
|
||||
|
||||
hsBool plListener::IEval(double secs, hsScalar del, UInt32 dirty)
|
||||
hsBool plListener::IEval(double secs, float del, uint32_t dirty)
|
||||
{
|
||||
// if (!plgAudioSys::Active())
|
||||
// return true;
|
||||
@ -69,7 +69,7 @@ hsBool plListener::IEval(double secs, hsScalar del, UInt32 dirty)
|
||||
|
||||
int y = 16 + 12, x = 400;
|
||||
if( fPrintDbgInfo )
|
||||
plDebugText::Instance().DrawString( x, 16, "Listener:", (UInt32)0xffffffff, plDebugText::kStyleBold );
|
||||
plDebugText::Instance().DrawString( x, 16, "Listener:", (uint32_t)0xffffffff, plDebugText::kStyleBold );
|
||||
|
||||
// Get the avatar's SceneObject
|
||||
plKey key = plNetClientMgr::GetInstance()->GetLocalPlayerKey();
|
||||
@ -80,7 +80,7 @@ hsBool plListener::IEval(double secs, hsScalar del, UInt32 dirty)
|
||||
{
|
||||
// We don't have a position to init by, so do NOT eval yet!!!
|
||||
if( fPrintDbgInfo )
|
||||
plDebugText::Instance().DrawString( x, y, "Not eval-ing yet", (UInt32)0xffffffff );
|
||||
plDebugText::Instance().DrawString( x, y, "Not eval-ing yet", (uint32_t)0xffffffff );
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -165,12 +165,12 @@ hsBool plListener::IEval(double secs, hsScalar del, UInt32 dirty)
|
||||
if( facingType == kInvalid || posType == kInvalid || velType == kInvalid )
|
||||
{
|
||||
if( fPrintDbgInfo )
|
||||
plDebugText::Instance().DrawString( x, y, "Not eval-ing: missing one or more parameter bases", (UInt32)0xff0000ff );
|
||||
plDebugText::Instance().DrawString( x, y, "Not eval-ing: missing one or more parameter bases", (uint32_t)0xff0000ff );
|
||||
return true;
|
||||
}
|
||||
|
||||
// Got the params, now construct and send out the message, as well as update the audio system
|
||||
plListenerMsg* msg = TRACKED_NEW plListenerMsg;
|
||||
plListenerMsg* msg = new plListenerMsg;
|
||||
msg->SetDirection( dir );
|
||||
msg->SetUp( up );
|
||||
msg->SetPosition( position );
|
||||
@ -184,19 +184,19 @@ hsBool plListener::IEval(double secs, hsScalar del, UInt32 dirty)
|
||||
{
|
||||
plString str;
|
||||
str = plString::Format( "Direction: (%3.2f,%3.2f,%3.2f) from %s", dir.fX, dir.fY, dir.fZ, ( facingType == kObject ) ? pRefObject->GetKey()->GetUoid().GetObjectName().c_str() : "VCam" );
|
||||
plDebugText::Instance().DrawString( x, y, str.c_str(), (UInt32)0xffffffff );
|
||||
plDebugText::Instance().DrawString( x, y, str.c_str(), (uint32_t)0xffffffff );
|
||||
y += 12;
|
||||
|
||||
str = plString::Format( "Up: (%3.2f,%3.2f,%3.2f) from %s", up.fX, up.fY, up.fZ, ( facingType == kObject ) ? pRefObject->GetKey()->GetUoid().GetObjectName().c_str() : "VCam" );
|
||||
plDebugText::Instance().DrawString( x, y, str.c_str(), (UInt32)0xffffffff );
|
||||
plDebugText::Instance().DrawString( x, y, str.c_str(), (uint32_t)0xffffffff );
|
||||
y += 12;
|
||||
|
||||
str = plString::Format( "Position: (%3.2f,%3.2f,%3.2f) from %s", position.fX, position.fY, position.fZ, ( posType == kObject ) ? pRefObject->GetKey()->GetUoid().GetObjectName().c_str() : "VCam" );
|
||||
plDebugText::Instance().DrawString( x, y, str.c_str(), (UInt32)0xffffffff );
|
||||
plDebugText::Instance().DrawString( x, y, str.c_str(), (uint32_t)0xffffffff );
|
||||
y += 12;
|
||||
|
||||
str = plString::Format( "Velocity: (%3.2f,%3.2f,%3.2f) from %s", velocity.fX, velocity.fY, velocity.fZ, ( velType == kObject ) ? pRefObject->GetKey()->GetUoid().GetObjectName().c_str() : "VCam" );
|
||||
plDebugText::Instance().DrawString( x, y, str.c_str(), (UInt32)0xffffffff );
|
||||
plDebugText::Instance().DrawString( x, y, str.c_str(), (uint32_t)0xffffffff );
|
||||
y += 12;
|
||||
}
|
||||
plgDispatch::MsgSend( msg );
|
||||
@ -207,7 +207,7 @@ hsBool plListener::IEval(double secs, hsScalar del, UInt32 dirty)
|
||||
void plListener::ISetRef( const plKey &ref, hsBool binding, int type )
|
||||
{
|
||||
if( binding )
|
||||
hsgResMgr::ResMgr()->AddViaNotify( ref, TRACKED_NEW plGenRefMsg( GetKey(), plGenRefMsg::kOnReplace, -1, type ), plRefFlags::kPassiveRef );
|
||||
hsgResMgr::ResMgr()->AddViaNotify( ref, new plGenRefMsg( GetKey(), plGenRefMsg::kOnReplace, -1, type ), plRefFlags::kPassiveRef );
|
||||
else
|
||||
GetKey()->Release( ref );
|
||||
}
|
||||
@ -293,9 +293,9 @@ hsBool plListener::MsgReceive(plMessage* msg)
|
||||
if( fInitMe )
|
||||
{
|
||||
// By default, position and orientation are camera based
|
||||
plSetListenerMsg *set = TRACKED_NEW plSetListenerMsg( plSetListenerMsg::kVCam | plSetListenerMsg::kFacing, nil, true );
|
||||
plSetListenerMsg *set = new plSetListenerMsg( plSetListenerMsg::kVCam | plSetListenerMsg::kFacing, nil, true );
|
||||
set->Send();
|
||||
set = TRACKED_NEW plSetListenerMsg( plSetListenerMsg::kVCam | plSetListenerMsg::kPosition, nil, true );
|
||||
set = new plSetListenerMsg( plSetListenerMsg::kVCam | plSetListenerMsg::kPosition, nil, true );
|
||||
set->Send();
|
||||
|
||||
fInitMe = false;
|
||||
|
@ -63,9 +63,9 @@ public:
|
||||
static void ShowDebugInfo( hsBool s ) { fPrintDbgInfo = s; }
|
||||
|
||||
// Get info for which object these things are attached to - camera or refObject
|
||||
UInt8 GetAttachedPosType() { return (UInt8)fPosRatio; }
|
||||
UInt8 GetAttachedFacingType() { return (UInt8)fFacingRatio; }
|
||||
UInt8 GetAttachedVelType() { return (UInt8)fVelRatio; }
|
||||
uint8_t GetAttachedPosType() { return (uint8_t)fPosRatio; }
|
||||
uint8_t GetAttachedFacingType() { return (uint8_t)fFacingRatio; }
|
||||
uint8_t GetAttachedVelType() { return (uint8_t)fVelRatio; }
|
||||
|
||||
enum
|
||||
{
|
||||
@ -83,12 +83,12 @@ protected:
|
||||
|
||||
plVirtualCam1* fVCam;
|
||||
|
||||
hsScalar fPosRatio, fFacingRatio, fVelRatio; // 0 is vCam, 1 is refObject
|
||||
float fPosRatio, fFacingRatio, fVelRatio; // 0 is vCam, 1 is refObject
|
||||
hsBool fInitMe;
|
||||
|
||||
static hsBool fPrintDbgInfo;
|
||||
|
||||
virtual hsBool IEval(double secs, hsScalar del, UInt32 dirty);
|
||||
virtual hsBool IEval(double secs, float del, uint32_t dirty);
|
||||
void ISetRef( const plKey &ref, hsBool binding, int type );
|
||||
void ICheckAudio( void ) const;
|
||||
|
||||
|
@ -40,7 +40,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
|
||||
*==LICENSE==*/
|
||||
|
||||
#include "hsTypes.h"
|
||||
#include "HeadSpin.h"
|
||||
#include "plRandomSoundMod.h"
|
||||
#include "pnSceneObject/plSceneObject.h"
|
||||
#include "pnSceneObject/plAudioInterface.h"
|
||||
@ -66,7 +66,7 @@ void plRandomSoundModGroup::Read(hsStream *s)
|
||||
{
|
||||
fNumSounds = s->ReadLE16();
|
||||
fGroupedIdx = s->ReadLE16();
|
||||
fIndices = TRACKED_NEW UInt16[fNumSounds];
|
||||
fIndices = new uint16_t[fNumSounds];
|
||||
|
||||
int i;
|
||||
for (i = 0; i < fNumSounds; i++)
|
||||
@ -119,7 +119,7 @@ void plRandomSoundMod::IStop()
|
||||
|
||||
if( fGroups != nil && fGroups[ fCurrentGroup ].fGroupedIdx != -1 )
|
||||
{
|
||||
plSoundMsg *msg = TRACKED_NEW plSoundMsg();
|
||||
plSoundMsg *msg = new plSoundMsg();
|
||||
msg->SetCmd(plSoundMsg::kStop);
|
||||
msg->fIndex = fGroups[ fCurrentGroup ].fIndices[ fCurrent ];
|
||||
plgDispatch::MsgSend(msg);
|
||||
@ -127,8 +127,8 @@ void plRandomSoundMod::IStop()
|
||||
else
|
||||
{
|
||||
if(fCurrent == -1) return;
|
||||
UInt16 currentSndIdx = ( fGroups != nil ) ? fGroups[fCurrentGroup].fIndices[fCurrent] : fActiveList[fCurrent];
|
||||
plSoundMsg* snd = TRACKED_NEW plSoundMsg(GetKey(), GetTarget()->GetKey(), nil);
|
||||
uint16_t currentSndIdx = ( fGroups != nil ) ? fGroups[fCurrentGroup].fIndices[fCurrent] : fActiveList[fCurrent];
|
||||
plSoundMsg* snd = new plSoundMsg(GetKey(), GetTarget()->GetKey(), nil);
|
||||
snd->SetCmd(plSoundMsg::kStop);
|
||||
snd->fIndex = currentSndIdx;
|
||||
plgDispatch::MsgSend(snd);
|
||||
@ -151,7 +151,7 @@ void plRandomSoundMod::IPlayNext()
|
||||
}
|
||||
|
||||
int i;
|
||||
UInt16 currentSndIdx;
|
||||
uint16_t currentSndIdx;
|
||||
int nSounds = (fGroups == nil ? ai->GetNumSounds() : fGroups[fCurrentGroup].fNumSounds);
|
||||
fEndTimes.ExpandAndZero(nSounds);
|
||||
plSound *pSound = nil;
|
||||
@ -185,10 +185,10 @@ void plRandomSoundMod::IPlayNext()
|
||||
fFirstTimePlay = false;
|
||||
if( !(fMode & kOneCmd) )
|
||||
{
|
||||
hsScalar delay = IGetDelay(0);
|
||||
float delay = IGetDelay(0);
|
||||
double t = hsTimer::GetSysSeconds() + delay;
|
||||
|
||||
plAnimCmdMsg* anim = TRACKED_NEW plAnimCmdMsg(GetKey(), GetKey(), &t);
|
||||
plAnimCmdMsg* anim = new plAnimCmdMsg(GetKey(), GetKey(), &t);
|
||||
anim->SetCmd(plAnimCmdMsg::kContinue);
|
||||
plgDispatch::MsgSend(anim);
|
||||
return;
|
||||
@ -203,7 +203,7 @@ void plRandomSoundMod::IPlayNext()
|
||||
|
||||
// We don't want random sounds to synch, since we don't synch the randomness. So force this next
|
||||
// sound to not synch
|
||||
hsScalar currLen;
|
||||
float currLen;
|
||||
if( fGroups != nil && fGroups[ fCurrentGroup ].fGroupedIdx != -1 )
|
||||
{
|
||||
currentSndIdx = fGroups[ fCurrentGroup ].fIndices[ fCurrent ];
|
||||
@ -217,13 +217,13 @@ void plRandomSoundMod::IPlayNext()
|
||||
sound->SetLocalOnly(true);
|
||||
|
||||
// Send msg to the grouped sound to switch sounds
|
||||
plSoundMsg *snd = TRACKED_NEW plSoundMsg();
|
||||
plSoundMsg *snd = new plSoundMsg();
|
||||
snd->SetCmd( plSoundMsg::kSelectFromGroup );
|
||||
snd->fIndex = currentSndIdx;
|
||||
snd->Send( sound->GetKey() );
|
||||
|
||||
// Now tell the audio interface to play the sound (probably should change this....)
|
||||
snd = TRACKED_NEW plSoundMsg(GetKey(), GetTarget()->GetKey(), nil);
|
||||
snd = new plSoundMsg(GetKey(), GetTarget()->GetKey(), nil);
|
||||
snd->SetCmd(plSoundMsg::kGoToTime);
|
||||
snd->fTime = (0);
|
||||
snd->SetCmd(plSoundMsg::kStop);
|
||||
@ -245,7 +245,7 @@ void plRandomSoundMod::IPlayNext()
|
||||
}
|
||||
|
||||
if (ai->GetSound(currentSndIdx))
|
||||
currLen = (hsScalar)(ai->GetSound(currentSndIdx)->GetLength());
|
||||
currLen = (float)(ai->GetSound(currentSndIdx)->GetLength());
|
||||
else
|
||||
currLen = 0;
|
||||
}
|
||||
@ -262,11 +262,11 @@ void plRandomSoundMod::IPlayNext()
|
||||
|
||||
if( !(fMode & kOneCmd) )
|
||||
{
|
||||
hsScalar delay = IGetDelay(currLen);
|
||||
float delay = IGetDelay(currLen);
|
||||
|
||||
double t = hsTimer::GetSysSeconds() + delay;
|
||||
|
||||
plAnimCmdMsg* anim = TRACKED_NEW plAnimCmdMsg(GetKey(), GetKey(), &t);
|
||||
plAnimCmdMsg* anim = new plAnimCmdMsg(GetKey(), GetKey(), &t);
|
||||
anim->SetCmd(plAnimCmdMsg::kContinue);
|
||||
plgDispatch::MsgSend(anim);
|
||||
}
|
||||
@ -276,7 +276,7 @@ void plRandomSoundMod::IPlayNext()
|
||||
}
|
||||
}
|
||||
|
||||
void plRandomSoundMod::SetCurrentGroup(UInt16 group)
|
||||
void plRandomSoundMod::SetCurrentGroup(uint16_t group)
|
||||
{
|
||||
hsAssert(group < fNumGroups, "Setting an invalid group on a random sound modifier");
|
||||
|
||||
@ -297,7 +297,7 @@ void plRandomSoundMod::Read(hsStream *s, hsResMgr *mgr)
|
||||
fNumGroups = s->ReadLE16();
|
||||
if (fNumGroups > 0)
|
||||
{
|
||||
fGroups = TRACKED_NEW plRandomSoundModGroup[fNumGroups];
|
||||
fGroups = new plRandomSoundModGroup[fNumGroups];
|
||||
int i;
|
||||
for (i = 0; i < fNumGroups; i++)
|
||||
fGroups[i].Read(s);
|
||||
@ -319,7 +319,7 @@ void plRandomSoundMod::Write(hsStream *s, hsResMgr *mgr)
|
||||
|
||||
void plRandomSoundMod::ForceSoundLoadState( hsBool loaded )
|
||||
{
|
||||
UInt16 i, j;
|
||||
uint16_t i, j;
|
||||
|
||||
plAudioInterface* ai = IGetTargetAudioInterface(0);
|
||||
if( ai == nil )
|
||||
@ -386,7 +386,7 @@ hsBool plRandomSoundMod::MsgReceive(plMessage* msg)
|
||||
return plRandomCommandMod::MsgReceive(msg);
|
||||
}
|
||||
|
||||
void plRandomSoundMod::ISetVolume(hsScalar volume)
|
||||
void plRandomSoundMod::ISetVolume(float volume)
|
||||
{
|
||||
plSound *pSound = nil;
|
||||
|
||||
@ -428,4 +428,4 @@ plSound *plRandomSoundMod::IGetSoundPtr()
|
||||
|
||||
pSound = ai->GetSound( currentSndIdx );
|
||||
return pSound;
|
||||
}
|
||||
}
|
||||
|
@ -51,10 +51,10 @@ class plRandomSoundModGroup
|
||||
{
|
||||
public:
|
||||
hsBitVector fExcluded;
|
||||
Int8 fCurrent;
|
||||
UInt16 fNumSounds;
|
||||
UInt16 *fIndices;
|
||||
Int16 fGroupedIdx; // Only used if we point to a groupedSound, in which case fIndices are indices into
|
||||
int8_t fCurrent;
|
||||
uint16_t fNumSounds;
|
||||
uint16_t *fIndices;
|
||||
int16_t fGroupedIdx; // Only used if we point to a groupedSound, in which case fIndices are indices into
|
||||
// that sound. -1 if unused.
|
||||
|
||||
plRandomSoundModGroup();
|
||||
@ -67,17 +67,17 @@ public:
|
||||
class plRandomSoundMod : public plRandomCommandMod
|
||||
{
|
||||
protected:
|
||||
UInt16 fCurrentGroup;
|
||||
UInt16 fNumGroups;
|
||||
uint16_t fCurrentGroup;
|
||||
uint16_t fNumGroups;
|
||||
plRandomSoundModGroup *fGroups;
|
||||
std::vector<UInt16> fActiveList; // list of sounds we're allowed to choose
|
||||
std::vector<uint16_t> fActiveList; // list of sounds we're allowed to choose
|
||||
int fOldPriority; // old sound priority
|
||||
hsBool fFirstTimePlay;
|
||||
|
||||
virtual void IPlayNext();
|
||||
virtual void IPlayNextIfMaster();
|
||||
virtual void IStop();
|
||||
void ISetVolume(hsScalar volume);
|
||||
void ISetVolume(float volume);
|
||||
void ISetPosition(hsPoint3);
|
||||
plSound *IGetSoundPtr();
|
||||
|
||||
@ -91,14 +91,14 @@ public:
|
||||
virtual void Read(hsStream* s, hsResMgr* mgr);
|
||||
virtual void Write(hsStream* s, hsResMgr* mgr);
|
||||
|
||||
void SetCurrentGroup(UInt16 group);
|
||||
void SetCurrentGroup(uint16_t group);
|
||||
|
||||
void ForceSoundLoadState( hsBool loaded );
|
||||
hsBool MsgReceive(plMessage* msg);
|
||||
float GetVolume();
|
||||
|
||||
// EXPORT ONLY
|
||||
void SetGroupInfo(UInt16 numGroups, plRandomSoundModGroup *groups) { fNumGroups = numGroups; fGroups = groups; }
|
||||
void SetGroupInfo(uint16_t numGroups, plRandomSoundModGroup *groups) { fNumGroups = numGroups; fGroups = groups; }
|
||||
};
|
||||
|
||||
#endif // plRandomSoundMod_inc
|
||||
|
Reference in New Issue
Block a user