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

Convert SDL (mostly) to plStrings

This commit is contained in:
2012-11-18 16:49:39 -08:00
parent 188171235e
commit 49dfb4e546
45 changed files with 456 additions and 488 deletions

View File

@ -387,14 +387,14 @@ void plAgeLinkStruct::Read( hsStream * s, hsResMgr* m)
s->LogReadLE( &fLinkingRules ,"LinkingRules");
if ( IsFlagSet( kHasSpawnPt_DEAD ) )
{
std::string str;
plString str;
s->LogSubStreamPushDesc("SpawnPt_DEAD");
plMsgStdStringHelper::Peek(str,s);
fSpawnPoint.SetName( str.c_str() );
if ( strcmp( fSpawnPoint.GetName(), kDefaultSpawnPtName )==0 )
fSpawnPoint.SetName( str );
if ( fSpawnPoint.GetName() == kDefaultSpawnPtName )
fSpawnPoint.SetTitle( kDefaultSpawnPtTitle );
else
fSpawnPoint.SetTitle( str.c_str() );
fSpawnPoint.SetTitle( str );
ClearFlag( kHasSpawnPt_DEAD );
SetFlag( kHasSpawnPt );
}
@ -520,7 +520,7 @@ plString plAgeLinkStruct::AsString() const
{
ss << spacer
<< "Spwn:"
<< fSpawnPoint.AsStdString().c_str();
<< fSpawnPoint.AsString();
spacer = kComma;
}
if (HasAmCCR())

View File

@ -120,10 +120,10 @@ void plSpawnPointInfo::Reset()
(*this)=kDefaultSpawnPoint;
}
std::string plSpawnPointInfo::AsStdString() const
plString plSpawnPointInfo::AsString() const
{
return xtl::format( "t:%s,n:%s,c:%s",
fTitle.size()?fTitle.c_str():"(nil)",
fSpawnPt.size()?fSpawnPt.c_str():"(nil)",
fCameraStack.size()?fCameraStack.c_str():"(nil)" );
return plString::Format( "t:%s,n:%s,c:%s",
fTitle.c_str("(nil)"),
fSpawnPt.c_str("(nil)"),
fCameraStack.c_str("(nil)") );
}

View File

@ -43,6 +43,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#define plSpawnPointInfo_h_inc
#include "hsStlUtils.h"
#include "plString.h"
///////////////////////////////////////////////////////////////////
@ -55,24 +56,24 @@ class hsStream;
struct plSpawnPointInfo
{
std::string fTitle; // friendly title for GUIs
std::string fSpawnPt; // name of spawn point in dataset
std::string fCameraStack;
plString fTitle; // friendly title for GUIs
plString fSpawnPt; // name of spawn point in dataset
plString fCameraStack;
plSpawnPointInfo(){}
plSpawnPointInfo( const plSpawnPointInfo & other ) { (*this)=other; }
plSpawnPointInfo( const char * title, const char * spawnPt )
plSpawnPointInfo( const plString & title, const plString & spawnPt )
: fTitle( title ), fSpawnPt( spawnPt ) {}
const char * GetTitle() const { return fTitle.c_str(); }
void SetTitle( const char * v ) { fTitle=v; }
const char * GetName() const { return fSpawnPt.c_str(); }
void SetName( const char * v ) { fSpawnPt = v; }
const char * GetCameraStack() const { return fCameraStack.c_str(); }
void SetCameraStack( const char * v ) { fCameraStack=v; }
plString GetTitle() const { return fTitle; }
void SetTitle( const plString & v ) { fTitle=v; }
plString GetName() const { return fSpawnPt; }
void SetName( const plString & v ) { fSpawnPt = v; }
plString GetCameraStack() const { return fCameraStack; }
void SetCameraStack( const plString & v ) { fCameraStack=v; }
void Reset();
void Read( hsStream * s );
void ReadOld( hsStream * s );
void Write( hsStream * s ) const;
std::string AsStdString() const;
plString AsString() const;
};
typedef std::vector<plSpawnPointInfo> plSpawnPointVec;