Browse Source

Deprecate and remove hsStlSortUtils

Michael Hansen 12 years ago
parent
commit
74e06e3984
  1. 1
      Sources/Plasma/CoreLib/CMakeLists.txt
  2. 65
      Sources/Plasma/CoreLib/hsStlSortUtils.h
  3. 2
      Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp
  4. 1
      Sources/Plasma/FeatureLib/pfPython/Pch.h
  5. 1
      Sources/Plasma/FeatureLib/pfPython/plPythonPack.cpp
  6. 1
      Sources/Plasma/PubUtilLib/plAvatar/plAGAnim.h
  7. 2
      Sources/Plasma/PubUtilLib/plAvatar/plAGAnimInstance.h
  8. 3
      Sources/Plasma/PubUtilLib/plAvatar/plAGMasterMod.h
  9. 3
      Sources/Plasma/PubUtilLib/plAvatar/plAGModifier.h
  10. 1
      Sources/Plasma/PubUtilLib/plAvatar/plAvatarMgr.h
  11. 30
      Sources/Plasma/PubUtilLib/plStatGather/plProfileManagerFull.cpp
  12. 5
      Sources/Plasma/PubUtilLib/plStatGather/plProfileManagerFull.h
  13. 1
      Sources/Tools/MaxComponent/Pch.h
  14. 235
      Sources/Tools/MaxComponent/plBipedKiller.cpp
  15. 3
      Sources/Tools/MaxComponent/plMaxAnimUtils.h
  16. 3
      Sources/Tools/MaxComponent/plResponderComponent.cpp
  17. 1
      Sources/Tools/MaxExport/Pch.h
  18. 1
      Sources/Tools/MaxExport/plExportDlg.cpp
  19. 4
      Sources/Tools/MaxMain/plMtlCollector.h
  20. 6
      Sources/Tools/MaxMain/plResCollector.cpp

1
Sources/Plasma/CoreLib/CMakeLists.txt

@ -68,7 +68,6 @@ set(CoreLib_HEADERS
hsQuat.h
hsRefCnt.h
hsSafeRefCnt.h
hsStlSortUtils.h
hsSTLStream.h
hsStream.h
hsStringTokenizer.h

65
Sources/Plasma/CoreLib/hsStlSortUtils.h

@ -1,65 +0,0 @@
/*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Additional permissions under GNU GPL version 3 section 7
If you modify this Program, or any covered work, by linking or
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
(or a modified version of those libraries),
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
licensors of this Program grant you additional
permission to convey the resulting work. Corresponding Source for a
non-source form of such a combination shall include the source code for
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
work.
You can contact Cyan Worlds, Inc. by email legal@cyan.com
or by snail mail at:
Cyan Worlds, Inc.
14617 N Newport Hwy
Mead, WA 99021
*==LICENSE==*/
#ifndef hsStlSortUtils_inc
#define hsStlSortUtils_inc
// These get used a lot in char * STL maps, so lets just have them in one place
class stringSorter
{
public:
bool operator() (const char *s1, const char *s2) const
{
return (strcmp(s1,s2) < 0);
}
};
class stringISorter
{
public:
bool operator() (const char *s1, const char *s2) const
{
return (stricmp(s1,s2) < 0);
}
};
#endif // hsStlSortUtils_inc

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

@ -537,7 +537,7 @@ PF_CONSOLE_CMD(Stats, ListGroups, "", "Prints the names of all the stat groups t
plProfileManagerFull::GroupSet::iterator it;
for (it = groups.begin(); it != groups.end(); it++)
PrintString((char*)*it);
PrintString(it->c_str());
}
PF_CONSOLE_CMD(Stats, ListLaps, "", "Prints the names of all the stats with laps to the console")

1
Sources/Plasma/FeatureLib/pfPython/Pch.h

@ -70,7 +70,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "hsGeometry3.h"
#include "hsQuat.h"
#include "hsResMgr.h"
#include "hsStlSortUtils.h"
#include "hsStream.h"
#include "hsTemplates.h"
#include "hsTimer.h"

1
Sources/Plasma/FeatureLib/pfPython/plPythonPack.cpp

@ -49,7 +49,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "HeadSpin.h"
#include "hsStream.h"
#include "hsStlSortUtils.h"
#pragma hdrstop
#include "plPythonPack.h"

1
Sources/Plasma/PubUtilLib/plAvatar/plAGAnim.h

@ -52,7 +52,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include <map>
#include "pnNetCommon/plSynchedObject.h"
#include "hsStlSortUtils.h"
class plTMController;
class hsAffineParts;

2
Sources/Plasma/PubUtilLib/plAvatar/plAGAnimInstance.h

@ -56,8 +56,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "HeadSpin.h"
#include <map>
#include "hsStlSortUtils.h"
// local
#include "plScalarChannel.h"

3
Sources/Plasma/PubUtilLib/plAvatar/plAGMasterMod.h

@ -58,9 +58,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "plAvDefs.h"
#include "pnKeyedObject/plMsgForwarder.h"
// templates
#include "hsStlSortUtils.h"
class plAGModifier;
class plAGAnimInstance;

3
Sources/Plasma/PubUtilLib/plAvatar/plAGModifier.h

@ -53,9 +53,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
// local
#include "plAvatar/plScalarChannel.h"
// stl
#include "hsStlSortUtils.h"
class plSceneObject;
class plAGAnimInstance;

1
Sources/Plasma/PubUtilLib/plAvatar/plAvatarMgr.h

@ -48,7 +48,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "HeadSpin.h"
#include <map>
#include "hsStlSortUtils.h"
#include "hsGeometry3.h"
#include "pnKeyedObject/hsKeyedObject.h"

30
Sources/Plasma/PubUtilLib/plStatGather/plProfileManagerFull.cpp

@ -110,17 +110,17 @@ void plProfileManagerFull::ShowGroup(const char* groupName)
void plProfileManagerFull::ShowNextGroup()
{
const char* curGroup = nil;
plString curGroup;
if (fShowGroups.begin() != fShowGroups.end())
curGroup = *(fShowGroups.begin());
GroupSet groups;
GetGroups(groups);
const char* nextGroup = nil;
if (curGroup)
plString nextGroup;
if (!curGroup.IsNull())
{
CreateStandardGraphs(curGroup, false);
CreateStandardGraphs(curGroup.c_str(), false);
GroupSet::iterator it = groups.find(curGroup);
it++;
@ -128,7 +128,7 @@ void plProfileManagerFull::ShowNextGroup()
{
nextGroup = *it;
}
ISetActive(curGroup,false);
ISetActive(curGroup.c_str(), false);
}
else
{
@ -136,10 +136,10 @@ void plProfileManagerFull::ShowNextGroup()
}
fShowGroups.clear();
if (nextGroup)
if (!nextGroup.IsNull())
{
ISetActive(nextGroup, true);
CreateStandardGraphs(nextGroup, true);
ISetActive(nextGroup.c_str(), true);
CreateStandardGraphs(nextGroup.c_str(), true);
fShowGroups.insert(nextGroup);
}
}
@ -305,16 +305,16 @@ void plProfileManagerFull::Update()
GroupSet::iterator it;
for (it = fShowGroups.begin(); it != fShowGroups.end(); it++)
{
const char* groupName = *it;
plString groupName = *it;
std::vector<plProfileBase*> group;
for (int i = 0; i < fVars.size(); i++)
if (strcmp(fVars[i]->GetGroup(), groupName) == 0)
if (groupName.Compare(fVars[i]->GetGroup()) == 0)
group.push_back(fVars[i]);
int x = 10;
PrintGroup(group, groupName, x, y);
PrintGroup(group, groupName.c_str(), x, y);
maxX = hsMaximum(maxX, x);
y += 10;
@ -480,8 +480,8 @@ void plProfileManagerFull::ILogStats()
for (it = groups.begin(); it != groups.end(); it++)
{
const char* groupName = *it;
IPrintGroup(&s, groupName, true);
plString groupName = *it;
IPrintGroup(&s, groupName.c_str(), true);
}
s.WriteByte('\r');
s.WriteByte('\n');
@ -492,8 +492,8 @@ void plProfileManagerFull::ILogStats()
for (it = groups.begin(); it != groups.end(); it++)
{
const char* groupName = *it;
IPrintGroup(&s, groupName);
plString groupName = *it;
IPrintGroup(&s, groupName.c_str());
}
s.WriteByte('\r');
s.WriteByte('\n');

5
Sources/Plasma/PubUtilLib/plStatGather/plProfileManagerFull.h

@ -44,11 +44,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include <set>
#include <string>
#include "plString.h"
#include "plProfileManager.h"
#include "hsStlSortUtils.h"
class plProfileManager;
class plGraphPlate;
class plStatusLog;
@ -58,7 +57,7 @@ class plProfileVar;
class plProfileManagerFull
{
public:
typedef std::set<const char*, stringISorter> GroupSet;
typedef std::set<plString, plString::less_i> GroupSet;
protected:
plProfileManager::VarVec& fVars;

1
Sources/Tools/MaxComponent/Pch.h

@ -68,7 +68,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "plPhysical.h"
#include "plQuality.h"
#include "hsResMgr.h"
#include "hsStlSortUtils.h"
#include "hsStream.h"
#include "hsStringTokenizer.h"
#include "hsTemplates.h"

235
Sources/Tools/MaxComponent/plBipedKiller.cpp

@ -40,7 +40,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/
#include "HeadSpin.h"
#include "hsStlSortUtils.h"
#include "plComponent.h"
#include "plComponentReg.h"
@ -77,10 +76,6 @@ struct nodeTMInfo
// A vector of matrix samples
typedef std::vector<nodeTMInfo *> plSampleVec;
// PLSAMPLEVECMAP
// A map relating bone names to plSampleVecs
typedef std::map<char *, plSampleVec *, stringSorter> plSampleVecMap;
/////////////
//
// PROTOTYPES
@ -530,233 +525,3 @@ int LimitTransform(INode* node, Matrix3* nodeTM)
*/
return false;
}
/*
//////////
// ARCHIVE
//////////
// Stuff we're not using but that looks kind of handy and which we might use again at some point.
/////////////////////////////////
/////////////////////////////////
/// SAMPLETREEMOTION
/// Sample motion for all of the non-bip bones in the heirarchy.
/// Need to sample the motion before rearranging the hierarchy and then
/// apply it after rearranging; hence the intermediate storage format.
// SAMPLETREEMOTION
// Sample all the (non-bip) motion in the whole tree
plSampleVecMap *SampleTreeMotion(INode* node, INode* parent, int sampleRate, Interface *theInterface)
{
Interval interval = theInterface->GetAnimRange();
TimeValue start = interval.Start(); // in ticks
TimeValue end = interval.End();
plSampleVecMap *ourMap = new plSampleVecMap();
sampleRate *= GetTicksPerFrame(); // convert sample rate to ticks
SampleTreeMotionRecurse(node, parent, sampleRate, start, end, ourMap);
return ourMap;
}
// SAMPLETREEMOTIONRECURSE
void SampleTreeMotionRecurse(INode * node, INode* parent, int sampleRate,
TimeValue start, TimeValue end, plSampleVecMap *ourMap)
{
// if it's not a bip, sample the fuck out of it
if(!HasBipController(node))
{
char *nodeName = node->GetName();
char *nameCopy = new char[strlen(nodeName) + 1];
strcpy(nameCopy, nodeName);
plSampleVec *branch = SampleNodeMotion(node, parent, sampleRate, start, end);
(*ourMap)[nameCopy] = branch;
}
// whether it's a bip or not, paw through its children
for(int i = 0; i < node->NumberOfChildren(); i++)
{
INode *child = node->GetChildNode(i);
SampleTreeMotionRecurse(child, node, sampleRate, start, end, ourMap);
}
}
// GETPARTS
void GetParts(int32_t i, std::vector<nodeTMInfo *>& mat3Array, hsAffineParts* parts)
{
hsAssert(parts, "nil parts");
// decomp matrix
gemAffineParts ap;
hsMatrix44 tXform = plMaxNodeBase::Matrix3ToMatrix44(mat3Array[i]->fMat3);
decomp_affine(tXform.fMap, &ap);
AP_SET((*parts), ap);
}
// MAKEROTKEY
Quat MakeRotKey(INode *node, INode *parent, TimeValue t)
{
AffineParts parts = GetLocalNodeParts(node, parent, t);
Quat q(parts.q.x, parts.q.y, parts.q.z, parts.q.w);
if( parts.f < 0.f )
{
// q = Quat(parts.q.x, parts.q.y, parts.q.z, -parts.q.w);
}
else
{
// q=Quat(-parts.q.x, -parts.q.y, -parts.q.z, parts.q.w);
}
return q;
}
Quat GetRotKey(int32_t i, std::vector<nodeTMInfo *>& mat3Array)
{
Matrix3 m = mat3Array[i]->fMat3;
AffineParts parts;
decomp_affine(m, &parts);
Quat q(parts.q.x, parts.q.y, parts.q.z, parts.q.w);
return q;
}
// GETROTKEY
Quat GetRotKey(int32_t i, std::vector<nodeTMInfo *>& mat3Array, hsAffineParts* parts)
{
hsAffineParts myParts;
if (!parts)
{
parts=&myParts;
GetParts(i, mat3Array, parts);
}
Quat q;
if( parts->fF < 0.f )
{
q = Quat(parts->fQ.fX, parts->fQ.fY, parts->fQ.fZ, -parts->fQ.fW); // ??? why are we inverting W?
#if 0
if( false)
{
Point3 ax;
float ang;
AngAxisFromQ(q, &ang, ax);
//ang -= M_PI;
ax = -ax;
q = QFromAngAxis(ang, ax);
}
#endif
}
else
{
q=Quat(-parts->fQ.fX, -parts->fQ.fY, -parts->fQ.fZ, parts->fQ.fW);
}
return q;
}
// MAKEPOSKEY
Point3 MakePosKey(INode *node, INode *parent, TimeValue t)
{
AffineParts parts = GetLocalNodeParts(node, parent, t);
return Point3(parts.t.x, parts.t.y, parts.t.z);
}
// GETPOSKEY
Point3 GetPosKey(int32_t i, std::vector<nodeTMInfo *>& mat3Array, hsAffineParts* parts)
{
hsAffineParts myParts;
if (!parts)
{
parts=&myParts;
GetParts(i, mat3Array, parts);
}
return Point3(parts->fT.fX, parts->fT.fY, parts->fT.fZ);
}
// MAKESCALEKEY
ScaleValue MakeScaleKey(INode *node, INode *parent, TimeValue t)
{
Matrix3 m1 = node->GetNodeTM(t);
hsMatrix44 hsM = plMaxNodeBase::Matrix3ToMatrix44(m1);
gemAffineParts ap;
hsAffineParts hsParts;
decomp_affine(hsM.fMap, &ap);
AP_SET(hsParts, ap);
Point3 sAx1;
sAx1=Point3(hsParts.fK.fX, hsParts.fK.fY, hsParts.fK.fZ);
if( hsParts.fF < 0.f )
{
sAx1=-sAx1;
}
Quat sQ1(hsParts.fU.fX, hsParts.fU.fY, hsParts.fU.fZ, hsParts.fU.fW);
// return ScaleValue(sAx, sQ);
AffineParts parts = GetLocalNodeParts(node, parent, t);
Point3 sAx(parts.k.x, parts.k.y, parts.k.z);
if( parts.f < 0.f )
{
sAx=-sAx;
}
Quat sQ(parts.u.x, parts.u.y, parts.u.z, parts.u.w);
return ScaleValue(sAx, sQ);
}
// GETSCALEKEY
ScaleValue GetScaleKey(int32_t i, std::vector<nodeTMInfo *>& mat3Array, hsAffineParts* parts)
{
hsAffineParts myParts;
if (!parts)
{
parts=&myParts;
GetParts(i, mat3Array, parts);
}
Point3 sAx;
sAx=Point3(parts->fK.fX, parts->fK.fY, parts->fK.fZ);
if( parts->fF < 0.f )
{
sAx=-sAx;
}
Quat sQ(parts->fU.fX, parts->fU.fY, parts->fU.fZ, parts->fU.fW);
return ScaleValue(sAx, sQ);
}
// GETLOCALNODEPARTS
AffineParts GetLocalNodeParts(INode *node, INode *parent, TimeValue t)
{
Matrix3 localTM = node->GetNodeTM(t); // world transform of source node
INode *parent2 = node->GetParentNode();
// localize it
Matrix3 parentTMX = parent->GetNodeTM(t);
Matrix3 parentTM = parent2->GetNodeTM(t);
Matrix3 invParent = Inverse(parentTM);
localTM *= invParent;
AffineParts parts;
decomp_affine(localTM, &parts);
return parts;
}
*/

3
Sources/Tools/MaxComponent/plMaxAnimUtils.h

@ -44,7 +44,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include <map>
#include <vector>
#include "hsStlSortUtils.h"
#include "plString.h"
class plErrorMsg;
@ -88,4 +87,4 @@ void GetSegment(const char *note, float time, SegmentMap *segMap, plErrorMsg *pE
bool DoesHaveStopPoints(Animatable *anim);
#endif
#endif

3
Sources/Tools/MaxComponent/plResponderComponent.cpp

@ -41,7 +41,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/
#include "HeadSpin.h"
#include "hsResMgr.h"
#include "hsStlSortUtils.h"
#include "hsWindows.h"
#include <iparamm2.h>
@ -597,7 +596,7 @@ void plResponderProc::ICreateMenu()
{
fhMenu = CreatePopupMenu();
std::map<const char *, HMENU, stringSorter> menus;
std::map<plString, HMENU> menus;
int cmdID = 0;
for (int i = 0; i < gResponderCmds.size(); i++)

1
Sources/Tools/MaxExport/Pch.h

@ -59,7 +59,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "hsExceptionStack.h"
#include "hsExceptions.h"
#include "plFile/plFileUtils.h"
#include "hsStlSortUtils.h"
#include "hsStream.h"
// Windows

1
Sources/Tools/MaxExport/plExportDlg.cpp

@ -41,7 +41,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/
#include "HeadSpin.h"
#include "hsStlSortUtils.h"
#include "hsWindows.h"
#include <bitmap.h>

4
Sources/Tools/MaxMain/plMtlCollector.h

@ -43,7 +43,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#define plMtlCollector_h_inc
#include <set>
#include "hsStlSortUtils.h"
#include "plString.h"
class PBBitmap;
class Mtl;
@ -55,7 +55,7 @@ typedef std::set<Mtl*> MtlSet;
typedef std::set<Texmap*> TexSet;
typedef std::set<plPlasmaMAXLayer*> LayerSet;
typedef std::set<PBBitmap*> PBSet;
typedef std::set<const char*, stringISorter> TexNameSet;
typedef std::set<plString, plString::less_i> TexNameSet;
class plMtlCollector
{

6
Sources/Tools/MaxMain/plResCollector.cpp

@ -80,10 +80,10 @@ void plResCollector::Collect()
TexNameSet::iterator it = texNames.begin();
for (; it != texNames.end(); it++)
{
const char *texName = *it;
plString texName = *it;
char outpath[MAX_PATH], name[_MAX_FNAME+_MAX_EXT], ext[_MAX_EXT];
_splitpath(texName, NULL, NULL, name, ext);
_splitpath(texName.c_str(), NULL, NULL, name, ext);
strcat(name, ext);
if (bar.Update(name))
@ -92,7 +92,7 @@ void plResCollector::Collect()
strcpy(outpath, path);
strcat(outpath, name);
CopyFile(texName, outpath, TRUE);
CopyFile(texName.c_str(), outpath, TRUE);
}
// Get the filename to save to

Loading…
Cancel
Save