From 2c5e01464ee03ea31cd2cdd6af4b7215e763e9bd Mon Sep 17 00:00:00 2001 From: Branan Purvine-Riley Date: Sun, 10 Apr 2011 23:20:08 -0700 Subject: [PATCH 1/4] STL fixes needed to link from StartUp to Personal --- .../Plasma/PubUtilLib/plAvatar/plAGAnimInstance.cpp | 4 ++-- .../Sources/Plasma/PubUtilLib/plAvatar/plAGModifier.cpp | 9 ++++----- .../Plasma/PubUtilLib/plPhysical/plCollisionDetector.cpp | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plAvatar/plAGAnimInstance.cpp b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plAvatar/plAGAnimInstance.cpp index e6323803..261801f8 100644 --- a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plAvatar/plAGAnimInstance.cpp +++ b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plAvatar/plAGAnimInstance.cpp @@ -242,10 +242,10 @@ void plAGAnimInstance::DetachChannels() do { plAGChannel *channel = (*i).second; channelMod->DetachChannel(channel); - } while (i != fManualDetachChannels.end() && (*++i).first == channelName); + } while (++i != fManualDetachChannels.end() && i->first == channelName); } else { do { - } while (i != fManualDetachChannels.end() && (*++i).first == channelName); + } while (++i != fManualDetachChannels.end() && i->first == channelName); } } diff --git a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plAvatar/plAGModifier.cpp b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plAvatar/plAGModifier.cpp index aec162f9..682be7d5 100644 --- a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plAvatar/plAGModifier.cpp +++ b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plAvatar/plAGModifier.cpp @@ -227,12 +227,12 @@ plAGChannel * plAGModifier::MergeChannel(plAGApplicator *app, // DETACHCHANNEL hsBool plAGModifier::DetachChannel(plAGChannel * channel) { - plAppTable::iterator i = fApps.begin(); + size_t i = 0; hsBool done = false; - for( ; i != fApps.end(); i++) + for( ; i != fApps.size(); i++) { - plAGApplicator *app = *i; + plAGApplicator *app = fApps[i]; plAGChannel *existingChannel = app->GetChannel(); if(existingChannel) { @@ -243,9 +243,8 @@ hsBool plAGModifier::DetachChannel(plAGChannel * channel) app->SetChannel(replacementChannel); if( ! replacementChannel && app->AutoDelete()) { - plAppTable::iterator old = i; + fApps.erase(fApps.begin()+i); i--; - fApps.erase(old); delete app; } done = true; diff --git a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plPhysical/plCollisionDetector.cpp b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plPhysical/plCollisionDetector.cpp index ca53c76c..13180bc4 100644 --- a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plPhysical/plCollisionDetector.cpp +++ b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plPhysical/plCollisionDetector.cpp @@ -624,7 +624,7 @@ void plObjectInVolumeDetector::IHandleEval(plEvalMsg* pEval) { plgDispatch::Dispatch()->UnRegisterForExactType(plEvalMsg::Index(), GetKey()); fWaitingForEval = false; - for(bookKeepingList::iterator it= (--fCollisionList.end());it!=(--fCollisionList.begin()); it--) + for(bookKeepingList::iterator it= fCollisionList.begin();it!=fCollisionList.end(); it++) { bool alreadyInside; ResidentSet::iterator HitIt; From d5df395e2aac47713343296f7040fc2a97121460 Mon Sep 17 00:00:00 2001 From: Michael Hansen Date: Mon, 11 Apr 2011 01:44:53 -0700 Subject: [PATCH 2/4] Don't change the iteration order --- .../Plasma/PubUtilLib/plPhysical/plCollisionDetector.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plPhysical/plCollisionDetector.cpp b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plPhysical/plCollisionDetector.cpp index 13180bc4..fc73ee4c 100644 --- a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plPhysical/plCollisionDetector.cpp +++ b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plPhysical/plCollisionDetector.cpp @@ -624,7 +624,7 @@ void plObjectInVolumeDetector::IHandleEval(plEvalMsg* pEval) { plgDispatch::Dispatch()->UnRegisterForExactType(plEvalMsg::Index(), GetKey()); fWaitingForEval = false; - for(bookKeepingList::iterator it= fCollisionList.begin();it!=fCollisionList.end(); it++) + for(bookKeepingList::reverse_iterator it= fCollisionList.rbegin();it!=fCollisionList.rend(); it++) { bool alreadyInside; ResidentSet::iterator HitIt; @@ -1152,4 +1152,4 @@ hsBool plRidingAnimatedPhysicalDetector::MsgReceive(plMessage *msg) return true; } return plSimpleRegionSensor::MsgReceive(msg); -} \ No newline at end of file +} From 942fc3e77acb3992a120c243bc0ca5d32989c611 Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Mon, 11 Apr 2011 15:35:18 -0400 Subject: [PATCH 3/4] Fix a pfSurface explosion if the Bink SDK is enabled --- .../Sources/Plasma/FeatureLib/pfSurface/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfSurface/CMakeLists.txt b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfSurface/CMakeLists.txt index cead1f95..99101a6e 100644 --- a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfSurface/CMakeLists.txt +++ b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/FeatureLib/pfSurface/CMakeLists.txt @@ -3,6 +3,11 @@ include_directories(../../NucleusLib) include_directories(../../NucleusLib/inc) include_directories(../../PubUtilLib) +if(Bink_SDK_AVAILABLE) + include_directories(${Bink_INCLUDE_DIR}) +endif() +include_directories(${DirectX_INCLUDE_DIR}) + if(WIN32) add_definitions(-DWIN32) endif(WIN32) From 07ecb7d616797b37a9136872f410ba4a0382a269 Mon Sep 17 00:00:00 2001 From: Michael Hansen Date: Mon, 11 Apr 2011 11:53:11 -0700 Subject: [PATCH 4/4] Don't need to de-iteratorize this one --- .../Plasma/PubUtilLib/plAvatar/plAGModifier.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plAvatar/plAGModifier.cpp b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plAvatar/plAGModifier.cpp index 682be7d5..42fdc50e 100644 --- a/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plAvatar/plAGModifier.cpp +++ b/MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plAvatar/plAGModifier.cpp @@ -227,12 +227,11 @@ plAGChannel * plAGModifier::MergeChannel(plAGApplicator *app, // DETACHCHANNEL hsBool plAGModifier::DetachChannel(plAGChannel * channel) { - size_t i = 0; - hsBool done = false; + plAppTable::iterator i = fApps.begin(); - for( ; i != fApps.size(); i++) + while( i != fApps.end() ) { - plAGApplicator *app = fApps[i]; + plAGApplicator *app = *i; plAGChannel *existingChannel = app->GetChannel(); if(existingChannel) { @@ -243,16 +242,16 @@ hsBool plAGModifier::DetachChannel(plAGChannel * channel) app->SetChannel(replacementChannel); if( ! replacementChannel && app->AutoDelete()) { - fApps.erase(fApps.begin()+i); - i--; + // Don't need to adjust the iterator since we're about to exit the loop + fApps.erase(i); delete app; } - done = true; - break; + return true; } } + ++i; } - return done; + return false; } // READ