Removed the smnew macro and the call to _CrtSetDbgFlag() to get ready for
merging with the main branch.
This commit is contained in:
+6
-6
@@ -38,7 +38,7 @@ vector<float> Actor::g_vfCurrentBGMBeatPlayer(NUM_PlayerNumber, 0);
|
||||
vector<float> Actor::g_vfCurrentBGMBeatPlayerNoOffset(NUM_PlayerNumber, 0);
|
||||
|
||||
|
||||
Actor *Actor::Copy() const { return smnew Actor(*this); }
|
||||
Actor *Actor::Copy() const { return new Actor(*this); }
|
||||
|
||||
static float g_fCabinetLights[NUM_CabinetLight];
|
||||
|
||||
@@ -149,7 +149,7 @@ static bool GetMessageNameFromCommandName( const RString &sCommandName, RString
|
||||
|
||||
Actor::Actor()
|
||||
{
|
||||
m_pLuaInstance = smnew LuaClass;
|
||||
m_pLuaInstance = new LuaClass;
|
||||
Lua *L = LUA->Get();
|
||||
m_pLuaInstance->PushSelf( L );
|
||||
lua_newtable( L );
|
||||
@@ -192,7 +192,7 @@ Actor::Actor( const Actor &cpy ):
|
||||
CPY( m_current );
|
||||
CPY( m_start );
|
||||
for( unsigned i = 0; i < cpy.m_Tweens.size(); ++i )
|
||||
m_Tweens.push_back( smnew TweenStateAndInfo(*cpy.m_Tweens[i]) );
|
||||
m_Tweens.push_back( new TweenStateAndInfo(*cpy.m_Tweens[i]) );
|
||||
|
||||
CPY( m_bFirstUpdate );
|
||||
|
||||
@@ -260,7 +260,7 @@ void Actor::LoadFromNode( const XNode* pNode )
|
||||
else if( sKeyName == "BaseZoomZ" ) SetBaseZoomZ( pValue->GetValue<float>() );
|
||||
else if( EndsWith(sKeyName,"Command") )
|
||||
{
|
||||
LuaReference *pRef = smnew LuaReference;
|
||||
LuaReference *pRef = new LuaReference;
|
||||
pValue->PushValue( L );
|
||||
pRef->SetFromStack( L );
|
||||
RString sCmdName = sKeyName.Left( sKeyName.size()-7 );
|
||||
@@ -762,7 +762,7 @@ void Actor::BeginTweening( float time, ITween *pTween )
|
||||
}
|
||||
|
||||
// add a new TweenState to the tail, and initialize it
|
||||
m_Tweens.push_back( smnew TweenStateAndInfo );
|
||||
m_Tweens.push_back( new TweenStateAndInfo );
|
||||
|
||||
// latest
|
||||
TweenState &TS = m_Tweens.back()->state;
|
||||
@@ -1474,7 +1474,7 @@ public:
|
||||
static int queuemessage( T* p, lua_State *L ) { p->QueueMessage(SArg(1)); return 0; }
|
||||
static int addcommand( T* p, lua_State *L )
|
||||
{
|
||||
LuaReference *pRef = smnew LuaReference;
|
||||
LuaReference *pRef = new LuaReference;
|
||||
pRef->SetFromStack( L );
|
||||
p->AddCommand( SArg(1), apActorCommands(pRef) );
|
||||
return 0;
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@
|
||||
*/
|
||||
//REGISTER_ACTOR_CLASS( ActorFrame );
|
||||
REGISTER_ACTOR_CLASS_WITH_NAME( ActorFrameAutoDeleteChildren, ActorFrame );
|
||||
ActorFrame *ActorFrame::Copy() const { return smnew ActorFrame(*this); }
|
||||
ActorFrame *ActorFrame::Copy() const { return new ActorFrame(*this); }
|
||||
|
||||
|
||||
ActorFrame::ActorFrame()
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include "ActorUtil.h"
|
||||
|
||||
REGISTER_ACTOR_CLASS_WITH_NAME( ActorFrameTextureAutoDeleteChildren, ActorFrameTexture );
|
||||
ActorFrameTexture *ActorFrameTexture::Copy() const { return smnew ActorFrameTexture(*this); }
|
||||
ActorFrameTexture *ActorFrameTexture::Copy() const { return new ActorFrameTexture(*this); }
|
||||
|
||||
ActorFrameTexture::ActorFrameTexture()
|
||||
{
|
||||
@@ -44,7 +44,7 @@ void ActorFrameTexture::Create()
|
||||
param.bFloat = m_bFloat;
|
||||
param.iWidth = (int) m_size.x;
|
||||
param.iHeight = (int) m_size.y;
|
||||
m_pRenderTarget = smnew RageTextureRenderTarget( id, param );
|
||||
m_pRenderTarget = new RageTextureRenderTarget( id, param );
|
||||
m_pRenderTarget->m_bWasUsed = true;
|
||||
|
||||
/* This passes ownership of m_pRenderTarget to TEXTUREMAN, but we retain
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
* that string instead create an ActorFrameAutoDeleteChildren object. */
|
||||
//REGISTER_ACTOR_CLASS( ActorScroller );
|
||||
REGISTER_ACTOR_CLASS_WITH_NAME( ActorScrollerAutoDeleteChildren, ActorScroller );
|
||||
ActorScroller *ActorScroller::Copy() const { return smnew ActorScroller(*this); }
|
||||
ActorScroller *ActorScroller::Copy() const { return new ActorScroller(*this); }
|
||||
|
||||
|
||||
ActorScroller::ActorScroller()
|
||||
|
||||
+3
-3
@@ -132,7 +132,7 @@ Actor* ActorUtil::LoadFromNode( const XNode* pNode, Actor *pParentActor )
|
||||
RString sError = ssprintf( "%s: invalid Class \"%s\"",
|
||||
ActorUtil::GetWhere(pNode).c_str(), sClass.c_str() );
|
||||
Dialog::OK( sError );
|
||||
return smnew Actor; // Return a dummy object so that we don't crash in AutoActor later.
|
||||
return new Actor; // Return a dummy object so that we don't crash in AutoActor later.
|
||||
}
|
||||
|
||||
const CreateActorFn &pfn = iter->second;
|
||||
@@ -220,7 +220,7 @@ Actor* ActorUtil::MakeActor( const RString &sPath_, Actor *pParentActor )
|
||||
if( pNode.get() == NULL )
|
||||
{
|
||||
// XNode will warn about the error
|
||||
return smnew Actor;
|
||||
return new Actor;
|
||||
}
|
||||
|
||||
Actor *pRet = ActorUtil::LoadFromNode( pNode.get(), pParentActor );
|
||||
@@ -310,7 +310,7 @@ apActorCommands ActorUtil::ParseActorCommands( const RString &sCommands, const R
|
||||
{
|
||||
Lua *L = LUA->Get();
|
||||
LuaHelpers::ParseCommandList( L, sCommands, sName );
|
||||
LuaReference *pRet = smnew LuaReference;
|
||||
LuaReference *pRet = new LuaReference;
|
||||
pRet->SetFromStack( L );
|
||||
LUA->Release( L );
|
||||
|
||||
|
||||
+2
-2
@@ -9,7 +9,7 @@ class XNode;
|
||||
typedef Actor* (*CreateActorFn)();
|
||||
|
||||
template<typename T>
|
||||
Actor *CreateActor() { return smnew T; }
|
||||
Actor *CreateActor() { return new T; }
|
||||
|
||||
/**
|
||||
* @brief Register the requested Actor with the specified external name.
|
||||
@@ -19,7 +19,7 @@ Actor *CreateActor() { return smnew T; }
|
||||
struct Register##className { \
|
||||
Register##className() { ActorUtil::Register(#externalClassName, CreateActor<className>); } \
|
||||
}; \
|
||||
className *className::Copy() const { return smnew className(*this); } \
|
||||
className *className::Copy() const { return new className(*this); } \
|
||||
static Register##className register##className
|
||||
|
||||
/**
|
||||
|
||||
+1
-1
@@ -42,7 +42,7 @@ void AutoActor::Load( const RString &sPath )
|
||||
|
||||
// If a Condition is false, MakeActor will return NULL.
|
||||
if( m_pActor == NULL )
|
||||
m_pActor = smnew Actor;
|
||||
m_pActor = new Actor;
|
||||
}
|
||||
|
||||
void AutoActor::LoadB( const RString &sMetricsGroup, const RString &sElement )
|
||||
|
||||
+19
-19
@@ -154,13 +154,13 @@ void AutoKeysounds::LoadTracks( const Song *pSong, RageSoundReader *&pShared, Ra
|
||||
RageSoundReader *pSongReader = vpSounds[0];
|
||||
|
||||
// Load the buffering filter before the effects filters, so effects aren't delayed.
|
||||
pSongReader = smnew RageSoundReader_Extend( pSongReader );
|
||||
pSongReader = smnew RageSoundReader_ThreadedBuffer( pSongReader );
|
||||
pSongReader = new RageSoundReader_Extend( pSongReader );
|
||||
pSongReader = new RageSoundReader_ThreadedBuffer( pSongReader );
|
||||
pShared = pSongReader;
|
||||
}
|
||||
else if( !vpSounds.empty() )
|
||||
{
|
||||
RageSoundReader_Merge *pMerge = smnew RageSoundReader_Merge;
|
||||
RageSoundReader_Merge *pMerge = new RageSoundReader_Merge;
|
||||
|
||||
FOREACH( RageSoundReader *, vpSounds, so )
|
||||
pMerge->AddSound( *so );
|
||||
@@ -169,8 +169,8 @@ void AutoKeysounds::LoadTracks( const Song *pSong, RageSoundReader *&pShared, Ra
|
||||
RageSoundReader *pSongReader = pMerge;
|
||||
|
||||
// Load the buffering filter before the effects filters, so effects aren't delayed.
|
||||
pSongReader = smnew RageSoundReader_Extend( pSongReader );
|
||||
pSongReader = smnew RageSoundReader_ThreadedBuffer( pSongReader );
|
||||
pSongReader = new RageSoundReader_Extend( pSongReader );
|
||||
pSongReader = new RageSoundReader_ThreadedBuffer( pSongReader );
|
||||
pShared = pSongReader;
|
||||
}
|
||||
|
||||
@@ -180,8 +180,8 @@ void AutoKeysounds::LoadTracks( const Song *pSong, RageSoundReader *&pShared, Ra
|
||||
RString sError;
|
||||
RageSoundReader *pGuitarTrackReader = RageSoundReader_FileReader::OpenFile( pSong->GetInstrumentTrackPath(InstrumentTrack_Guitar), sError );
|
||||
// Load the buffering filter before the effects filters, so effects aren't delayed.
|
||||
pGuitarTrackReader = smnew RageSoundReader_Extend( pGuitarTrackReader );
|
||||
pGuitarTrackReader = smnew RageSoundReader_ThreadedBuffer( pGuitarTrackReader );
|
||||
pGuitarTrackReader = new RageSoundReader_Extend( pGuitarTrackReader );
|
||||
pGuitarTrackReader = new RageSoundReader_ThreadedBuffer( pGuitarTrackReader );
|
||||
pPlayer1 = pGuitarTrackReader;
|
||||
}
|
||||
|
||||
@@ -259,7 +259,7 @@ void AutoKeysounds::FinishLoading()
|
||||
|
||||
// Load autoplay sounds, if any.
|
||||
{
|
||||
RageSoundReader_Chain *pChain = smnew RageSoundReader_Chain;
|
||||
RageSoundReader_Chain *pChain = new RageSoundReader_Chain;
|
||||
pChain->SetPreferredSampleRate( SOUNDMAN->GetDriverSampleRate() );
|
||||
LoadAutoplaySoundsInto( pChain );
|
||||
|
||||
@@ -271,7 +271,7 @@ void AutoKeysounds::FinishLoading()
|
||||
pChain->AddSound( iIndex, 0.0f, 0 );
|
||||
}
|
||||
pChain->Finish();
|
||||
m_pSharedSound = smnew RageSoundReader_Extend(pChain);
|
||||
m_pSharedSound = new RageSoundReader_Extend(pChain);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -280,24 +280,24 @@ void AutoKeysounds::FinishLoading()
|
||||
}
|
||||
ASSERT_M( m_pSharedSound != NULL, ssprintf("No keysounds were loaded for the song %s!", pSong->m_sMainTitle.c_str() ));
|
||||
|
||||
m_pSharedSound = smnew RageSoundReader_PitchChange( m_pSharedSound );
|
||||
m_pSharedSound = smnew RageSoundReader_PostBuffering( m_pSharedSound );
|
||||
m_pSharedSound = smnew RageSoundReader_Pan( m_pSharedSound );
|
||||
m_pSharedSound = new RageSoundReader_PitchChange( m_pSharedSound );
|
||||
m_pSharedSound = new RageSoundReader_PostBuffering( m_pSharedSound );
|
||||
m_pSharedSound = new RageSoundReader_Pan( m_pSharedSound );
|
||||
apSounds.push_back( m_pSharedSound );
|
||||
|
||||
if( m_pPlayerSounds[0] != NULL )
|
||||
{
|
||||
m_pPlayerSounds[0] = smnew RageSoundReader_PitchChange( m_pPlayerSounds[0] );
|
||||
m_pPlayerSounds[0] = smnew RageSoundReader_PostBuffering( m_pPlayerSounds[0] );
|
||||
m_pPlayerSounds[0] = smnew RageSoundReader_Pan( m_pPlayerSounds[0] );
|
||||
m_pPlayerSounds[0] = new RageSoundReader_PitchChange( m_pPlayerSounds[0] );
|
||||
m_pPlayerSounds[0] = new RageSoundReader_PostBuffering( m_pPlayerSounds[0] );
|
||||
m_pPlayerSounds[0] = new RageSoundReader_Pan( m_pPlayerSounds[0] );
|
||||
apSounds.push_back( m_pPlayerSounds[0] );
|
||||
}
|
||||
|
||||
if( m_pPlayerSounds[1] != NULL )
|
||||
{
|
||||
m_pPlayerSounds[1] = smnew RageSoundReader_PitchChange( m_pPlayerSounds[1] );
|
||||
m_pPlayerSounds[1] = smnew RageSoundReader_PostBuffering( m_pPlayerSounds[1] );
|
||||
m_pPlayerSounds[1] = smnew RageSoundReader_Pan( m_pPlayerSounds[1] );
|
||||
m_pPlayerSounds[1] = new RageSoundReader_PitchChange( m_pPlayerSounds[1] );
|
||||
m_pPlayerSounds[1] = new RageSoundReader_PostBuffering( m_pPlayerSounds[1] );
|
||||
m_pPlayerSounds[1] = new RageSoundReader_Pan( m_pPlayerSounds[1] );
|
||||
apSounds.push_back( m_pPlayerSounds[1] );
|
||||
}
|
||||
|
||||
@@ -306,7 +306,7 @@ void AutoKeysounds::FinishLoading()
|
||||
|
||||
if( apSounds.size() > 1 )
|
||||
{
|
||||
RageSoundReader_Merge *pMerge = smnew RageSoundReader_Merge;
|
||||
RageSoundReader_Merge *pMerge = new RageSoundReader_Merge;
|
||||
|
||||
FOREACH( RageSoundReader *, apSounds, ps )
|
||||
pMerge->AddSound( *ps );
|
||||
|
||||
+3
-3
@@ -78,7 +78,7 @@ void BGAnimation::AddLayersFromAniDir( const RString &_sAniDir, const XNode *pNo
|
||||
else
|
||||
{
|
||||
// import as a single layer
|
||||
BGAnimationLayer* bgLayer = smnew BGAnimationLayer;
|
||||
BGAnimationLayer* bgLayer = new BGAnimationLayer;
|
||||
bgLayer->LoadFromNode( pKey );
|
||||
this->AddChild( bgLayer );
|
||||
}
|
||||
@@ -149,7 +149,7 @@ void BGAnimation::LoadFromAniDir( const RString &_sAniDir )
|
||||
const RString sPath = asImagePaths[i];
|
||||
if( Basename(sPath).Left(1) == "_" )
|
||||
continue; // don't directly load files starting with an underscore
|
||||
BGAnimationLayer* pLayer = smnew BGAnimationLayer;
|
||||
BGAnimationLayer* pLayer = new BGAnimationLayer;
|
||||
pLayer->LoadFromAniLayerFile( asImagePaths[i] );
|
||||
AddChild( pLayer );
|
||||
}
|
||||
@@ -169,7 +169,7 @@ void BGAnimation::LoadFromNode( const XNode* pNode )
|
||||
float fLengthSeconds = 0;
|
||||
if( pNode->GetAttrValue( "LengthSeconds", fLengthSeconds ) )
|
||||
{
|
||||
Actor *pActor = smnew Actor;
|
||||
Actor *pActor = new Actor;
|
||||
pActor->SetName( "BGAnimation dummy" );
|
||||
pActor->SetVisible( false );
|
||||
apActorCommands ap = ActorUtil::ParseActorCommands( ssprintf("sleep,%f",fLengthSeconds) );
|
||||
|
||||
@@ -86,7 +86,7 @@ void BGAnimationLayer::LoadFromAniLayerFile( const RString& sPath )
|
||||
else
|
||||
sSongBGPath = THEME->GetPathG("Common","fallback background");
|
||||
|
||||
Sprite* pSprite = smnew Sprite;
|
||||
Sprite* pSprite = new Sprite;
|
||||
pSprite->Load( Sprite::SongBGTexture(sSongBGPath) );
|
||||
pSprite->StretchTo( FullScreenRectF );
|
||||
this->AddChild( pSprite );
|
||||
@@ -163,7 +163,7 @@ void BGAnimationLayer::LoadFromAniLayerFile( const RString& sPath )
|
||||
case EFFECT_CENTER:
|
||||
{
|
||||
m_Type = TYPE_SPRITE;
|
||||
Sprite* pSprite = smnew Sprite;
|
||||
Sprite* pSprite = new Sprite;
|
||||
this->AddChild( pSprite );
|
||||
pSprite->Load( sPath );
|
||||
pSprite->SetXY( SCREEN_CENTER_X, SCREEN_CENTER_Y );
|
||||
@@ -179,7 +179,7 @@ void BGAnimationLayer::LoadFromAniLayerFile( const RString& sPath )
|
||||
case EFFECT_STRETCH_TWIST:
|
||||
{
|
||||
m_Type = TYPE_SPRITE;
|
||||
Sprite* pSprite = smnew Sprite;
|
||||
Sprite* pSprite = new Sprite;
|
||||
this->AddChild( pSprite );
|
||||
RageTextureID ID(sPath);
|
||||
ID.bStretch = true;
|
||||
@@ -200,7 +200,7 @@ void BGAnimationLayer::LoadFromAniLayerFile( const RString& sPath )
|
||||
case EFFECT_STRETCH_SPIN:
|
||||
{
|
||||
m_Type = TYPE_SPRITE;
|
||||
Sprite* pSprite = smnew Sprite;
|
||||
Sprite* pSprite = new Sprite;
|
||||
this->AddChild( pSprite );
|
||||
pSprite->Load( Sprite::SongBGTexture(sPath) );
|
||||
const RectF StretchedFullScreenRectF(
|
||||
@@ -231,7 +231,7 @@ void BGAnimationLayer::LoadFromAniLayerFile( const RString& sPath )
|
||||
|
||||
for( int i=0; i<iNumParticles; i++ )
|
||||
{
|
||||
Sprite* pSprite = smnew Sprite;
|
||||
Sprite* pSprite = new Sprite;
|
||||
this->AddChild( pSprite );
|
||||
pSprite->Load( sPath );
|
||||
pSprite->SetZoom( 0.7f + 0.6f*i/(float)iNumParticles );
|
||||
@@ -303,7 +303,7 @@ void BGAnimationLayer::LoadFromAniLayerFile( const RString& sPath )
|
||||
{
|
||||
for( int y=0; y<m_iNumTilesHigh; y++ )
|
||||
{
|
||||
Sprite* pSprite = smnew Sprite;
|
||||
Sprite* pSprite = new Sprite;
|
||||
this->AddChild( pSprite );
|
||||
pSprite->Load( ID );
|
||||
pSprite->SetTextureWrapping( true ); // gets rid of some "cracks"
|
||||
|
||||
+3
-3
@@ -211,7 +211,7 @@ void BackgroundImpl::Init()
|
||||
}
|
||||
|
||||
if( bOneOrMoreChars && !bShowingBeginnerHelper && SHOW_DANCING_CHARACTERS )
|
||||
m_pDancingCharacters = smnew DancingCharacters;
|
||||
m_pDancingCharacters = new DancingCharacters;
|
||||
|
||||
RageColor c = GetBrightnessColor(0);
|
||||
|
||||
@@ -318,7 +318,7 @@ bool BackgroundImpl::Layer::CreateBackground( const Song *pSong, const Backgroun
|
||||
|
||||
ASSERT( !sResolved.empty() );
|
||||
|
||||
vsResolvedRef[i] = smnew LuaThreadVariable( ssprintf("File%d",i+1), sResolved );
|
||||
vsResolvedRef[i] = new LuaThreadVariable( ssprintf("File%d",i+1), sResolved );
|
||||
}
|
||||
|
||||
RString sEffect = bd.m_sEffect;
|
||||
@@ -947,7 +947,7 @@ void BrightnessOverlay::FadeToActualBrightness()
|
||||
SetActualBrightness();
|
||||
}
|
||||
|
||||
Background::Background() { m_pImpl = smnew BackgroundImpl; this->AddChild(m_pImpl); }
|
||||
Background::Background() { m_pImpl = new BackgroundImpl; this->AddChild(m_pImpl); }
|
||||
Background::~Background() { SAFE_DELETE( m_pImpl ); }
|
||||
void Background::Init() { m_pImpl->Init(); }
|
||||
void Background::LoadFromSong( const Song *pSong ) { m_pImpl->LoadFromSong(pSong); }
|
||||
|
||||
@@ -33,7 +33,7 @@ bool BackgroundDef::operator==( const BackgroundDef &other ) const
|
||||
|
||||
XNode *BackgroundDef::CreateNode() const
|
||||
{
|
||||
XNode* pNode = smnew XNode( "BackgroundDef" );
|
||||
XNode* pNode = new XNode( "BackgroundDef" );
|
||||
|
||||
if( !m_sEffect.empty() )
|
||||
pNode->AppendAttr( "Effect", m_sEffect );
|
||||
|
||||
+1
-1
@@ -307,7 +307,7 @@ RageTextureID BannerCache::LoadCachedBanner( RString sBannerPath )
|
||||
|
||||
LOG->Trace( "Loading banner texture %s; src %ix%i; image %ix%i",
|
||||
ID.filename.c_str(), iSourceWidth, iSourceHeight, pImage->w, pImage->h );
|
||||
RageTexture *pTexture = smnew BannerTexture( ID, pImage, iSourceWidth, iSourceHeight );
|
||||
RageTexture *pTexture = new BannerTexture( ID, pImage, iSourceWidth, iSourceHeight );
|
||||
|
||||
ID.Policy = RageTextureID::TEX_VOLATILE;
|
||||
TEXTUREMAN->RegisterTexture( ID, pTexture );
|
||||
|
||||
@@ -641,7 +641,7 @@ CBaseFilter::EnumPins(IEnumPins **ppEnum)
|
||||
|
||||
/* Create a new ref counted enumerator */
|
||||
|
||||
*ppEnum = smnew CEnumPins(this,
|
||||
*ppEnum = new CEnumPins(this,
|
||||
NULL);
|
||||
|
||||
return *ppEnum == NULL ? E_OUTOFMEMORY : NOERROR;
|
||||
@@ -733,7 +733,7 @@ CBaseFilter::JoinFilterGraph(
|
||||
|
||||
if (pName) {
|
||||
DWORD nameLen = lstrlenW(pName)+1;
|
||||
m_pName = smnew WCHAR[nameLen];
|
||||
m_pName = new WCHAR[nameLen];
|
||||
if (m_pName) {
|
||||
CopyMemory(m_pName, pName, nameLen*sizeof(WCHAR));
|
||||
} else {
|
||||
@@ -1026,7 +1026,7 @@ CEnumPins::Clone(IEnumPins **ppEnum)
|
||||
hr = VFW_E_ENUM_OUT_OF_SYNC;
|
||||
} else {
|
||||
|
||||
*ppEnum = smnew CEnumPins(m_pFilter,
|
||||
*ppEnum = new CEnumPins(m_pFilter,
|
||||
this);
|
||||
if (*ppEnum == NULL) {
|
||||
hr = E_OUTOFMEMORY;
|
||||
@@ -1286,7 +1286,7 @@ CEnumMediaTypes::Clone(IEnumMediaTypes **ppEnum)
|
||||
hr = VFW_E_ENUM_OUT_OF_SYNC;
|
||||
} else {
|
||||
|
||||
*ppEnum = smnew CEnumMediaTypes(m_pPin,
|
||||
*ppEnum = new CEnumMediaTypes(m_pPin,
|
||||
this);
|
||||
|
||||
if (*ppEnum == NULL) {
|
||||
@@ -1478,7 +1478,7 @@ CBasePin::CBasePin(TCHAR *pObjectName,
|
||||
|
||||
if (pName) {
|
||||
DWORD nameLen = lstrlenW(pName)+1;
|
||||
m_pName = smnew WCHAR[nameLen];
|
||||
m_pName = new WCHAR[nameLen];
|
||||
if (m_pName) {
|
||||
CopyMemory(m_pName, pName, nameLen*sizeof(WCHAR));
|
||||
}
|
||||
@@ -1524,7 +1524,7 @@ CBasePin::CBasePin(CHAR *pObjectName,
|
||||
|
||||
if (pName) {
|
||||
DWORD nameLen = lstrlenW(pName)+1;
|
||||
m_pName = smnew WCHAR[nameLen];
|
||||
m_pName = new WCHAR[nameLen];
|
||||
if (m_pName) {
|
||||
CopyMemory(m_pName, pName, nameLen*sizeof(WCHAR));
|
||||
}
|
||||
@@ -2244,7 +2244,7 @@ CBasePin::EnumMediaTypes(
|
||||
|
||||
/* Create a new ref counted enumerator */
|
||||
|
||||
*ppEnum = smnew CEnumMediaTypes(this,
|
||||
*ppEnum = new CEnumMediaTypes(this,
|
||||
NULL);
|
||||
|
||||
if (*ppEnum == NULL) {
|
||||
@@ -4889,7 +4889,7 @@ CBaseAllocator::CSampleList::Remove(CMediaSample * pSample)
|
||||
/* This goes in the factory template table to create new instances */
|
||||
CUnknown *CMemAllocator::CreateInstance(LPUNKNOWN pUnk, HRESULT *phr)
|
||||
{
|
||||
CUnknown *pUnkRet = smnew CMemAllocator(NAME("CMemAllocator"), pUnk, phr);
|
||||
CUnknown *pUnkRet = new CMemAllocator(NAME("CMemAllocator"), pUnk, phr);
|
||||
return pUnkRet;
|
||||
}
|
||||
|
||||
@@ -5047,7 +5047,7 @@ CMemAllocator::Alloc(void)
|
||||
for (; m_lAllocated < m_lCount; m_lAllocated++, pNext += lAlignedSize) {
|
||||
|
||||
|
||||
pSample = smnew CMediaSample(
|
||||
pSample = new CMediaSample(
|
||||
NAME("Default memory media sample"),
|
||||
this,
|
||||
&hr,
|
||||
|
||||
@@ -25,7 +25,7 @@ b. Make a static CreateInstance function that takes an LPUNKNOWN, an HRESULT *
|
||||
as we do not copy the string. To stop large amounts of memory being used
|
||||
in retail builds by all these static strings use the NAME macro,
|
||||
|
||||
CMyFilter = smnew CImplFilter(NAME("My filter"),pUnknown,phr);
|
||||
CMyFilter = new CImplFilter(NAME("My filter"),pUnknown,phr);
|
||||
if (FAILED(hr)) {
|
||||
return hr;
|
||||
}
|
||||
|
||||
@@ -1618,7 +1618,7 @@ CDispParams::CDispParams(UINT nArgs, VARIANT* pArgs, HRESULT *phr) {
|
||||
cArgs = nArgs;
|
||||
|
||||
if(cArgs) {
|
||||
rgvarg = smnew VARIANT[cArgs];
|
||||
rgvarg = new VARIANT[cArgs];
|
||||
if(NULL == rgvarg) {
|
||||
cArgs = 0;
|
||||
if(phr) {
|
||||
@@ -1681,7 +1681,7 @@ CDispParams::CDispParams(UINT nArgs, VARIANT* pArgs, HRESULT *phr) {
|
||||
// the pointer points just after the WORD
|
||||
|
||||
WORD len = * (WORD*) (pSrc->bstrVal - (sizeof(WORD) / sizeof(OLECHAR)));
|
||||
OLECHAR* pch = smnew OLECHAR[len + (sizeof(WORD)/sizeof(OLECHAR))];
|
||||
OLECHAR* pch = new OLECHAR[len + (sizeof(WORD)/sizeof(OLECHAR))];
|
||||
if(pch) {
|
||||
WORD *pui = (WORD*)pch;
|
||||
*pui = len;
|
||||
@@ -2041,7 +2041,7 @@ CCmdQueue::New(
|
||||
*ppCmd = NULL;
|
||||
|
||||
CDeferredCommand* pCmd;
|
||||
pCmd = smnew CDeferredCommand(this,
|
||||
pCmd = new CDeferredCommand(this,
|
||||
NULL, // not aggregated
|
||||
&hr,
|
||||
pUnk, // this guy will execute
|
||||
|
||||
@@ -194,7 +194,7 @@ DllGetClassObject(
|
||||
// found a template - make a class factory based on this
|
||||
// template
|
||||
|
||||
*pv = (LPVOID) (LPUNKNOWN) smnew CClassFactory(pT);
|
||||
*pv = (LPVOID) (LPUNKNOWN) new CClassFactory(pT);
|
||||
if(*pv == NULL) {
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ public:
|
||||
void PutThreadMsg(UINT uMsg, DWORD dwMsgFlags,
|
||||
LPVOID lpMsgParam, CAMEvent *pEvent = NULL) {
|
||||
CAutoLock lck(&m_Lock);
|
||||
CMsg* pMsg = smnew CMsg(uMsg, dwMsgFlags, lpMsgParam, pEvent);
|
||||
CMsg* pMsg = new CMsg(uMsg, dwMsgFlags, lpMsgParam, pEvent);
|
||||
m_ThreadQueue.AddTail(pMsg);
|
||||
|
||||
if (m_lWaiting != 0) {
|
||||
|
||||
@@ -92,7 +92,7 @@ COutputQueue::COutputQueue(
|
||||
|
||||
// Create our sample batch
|
||||
|
||||
m_ppSamples = smnew PMEDIASAMPLE[m_lBatchSize];
|
||||
m_ppSamples = new PMEDIASAMPLE[m_lBatchSize];
|
||||
if(m_ppSamples == NULL) {
|
||||
*phr = E_OUTOFMEMORY;
|
||||
return;
|
||||
@@ -108,7 +108,7 @@ COutputQueue::COutputQueue(
|
||||
*phr = AmHresultFromWin32(dwError);
|
||||
return;
|
||||
}
|
||||
m_List = smnew CSampleList(NAME("Sample Queue List"),
|
||||
m_List = new CSampleList(NAME("Sample Queue List"),
|
||||
lListSize,
|
||||
FALSE // No lock
|
||||
);
|
||||
@@ -411,7 +411,7 @@ COutputQueue::NewSegment(
|
||||
// critical section) that the packet immediately following a
|
||||
// NEW_SEGMENT value is a NewSegmentPacket containing the
|
||||
// parameters.
|
||||
NewSegmentPacket * ppack = smnew NewSegmentPacket;
|
||||
NewSegmentPacket * ppack = new NewSegmentPacket;
|
||||
if(ppack == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ CBaseReferenceClock::CBaseReferenceClock( TCHAR *pName, LPUNKNOWN pUnk, HRESULT
|
||||
, m_rtLastGotTime(0)
|
||||
, m_TimerResolution(0)
|
||||
, m_bAbort( FALSE )
|
||||
, m_pSchedule( pShed ? pShed : smnew CAMSchedule(CreateEvent(NULL, FALSE, FALSE, NULL)) )
|
||||
, m_pSchedule( pShed ? pShed : new CAMSchedule(CreateEvent(NULL, FALSE, FALSE, NULL)) )
|
||||
, m_hThread(0) {
|
||||
|
||||
|
||||
|
||||
@@ -107,7 +107,7 @@ HRESULT CBaseRenderer::GetMediaPositionInterface(REFIID riid,void **ppv)
|
||||
// control interface (IMediaPosition) which in fact simply takes the
|
||||
// calls normally from the filter graph and passes them upstream
|
||||
|
||||
m_pPosition = smnew CRendererPosPassThru(NAME("Renderer CPosPassThru"),
|
||||
m_pPosition = new CRendererPosPassThru(NAME("Renderer CPosPassThru"),
|
||||
CBaseFilter::GetOwner(),
|
||||
(HRESULT *) &hr,
|
||||
GetPin(0));
|
||||
@@ -598,7 +598,7 @@ CBasePin *CBaseRenderer::GetPin(int n)
|
||||
// hr's value if an error occurs.
|
||||
HRESULT hr = NOERROR;
|
||||
|
||||
m_pInputPin = smnew CRendererInputPin(this,&hr,L"In");
|
||||
m_pInputPin = new CRendererInputPin(this,&hr,L"In");
|
||||
if (NULL == m_pInputPin) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ DWORD_PTR CAMSchedule::AddAdvisePacket
|
||||
--m_dwCacheCount;
|
||||
}
|
||||
else {
|
||||
p = smnew CAdvisePacket();
|
||||
p = new CAdvisePacket();
|
||||
}
|
||||
if(p) {
|
||||
p->m_rtEventTime = time1; p->m_rtPeriod = time2;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
CUnknown * CSeekingPassThru::CreateInstance(LPUNKNOWN pUnk, HRESULT *phr)
|
||||
{
|
||||
return smnew CSeekingPassThru(NAME("Seeking PassThru"),pUnk, phr);
|
||||
return new CSeekingPassThru(NAME("Seeking PassThru"),pUnk, phr);
|
||||
}
|
||||
|
||||
|
||||
@@ -59,12 +59,12 @@ STDMETHODIMP CSeekingPassThru::Init(BOOL bRendererSeeking, IPin *pPin)
|
||||
} else {
|
||||
m_pPosPassThru =
|
||||
bRendererSeeking ?
|
||||
smnew CRendererPosPassThru(
|
||||
new CRendererPosPassThru(
|
||||
NAME("Render Seeking COM object"),
|
||||
(IUnknown *)this,
|
||||
&hr,
|
||||
pPin) :
|
||||
smnew CPosPassThru(
|
||||
new CPosPassThru(
|
||||
NAME("Render Seeking COM object"),
|
||||
(IUnknown *)this,
|
||||
&hr,
|
||||
|
||||
@@ -75,7 +75,7 @@ HRESULT CSource::AddPin(CSourceStream *pStream) {
|
||||
CAutoLock lock(&m_cStateLock);
|
||||
|
||||
/* Allocate space for this pin and the old ones */
|
||||
CSourceStream **paStreams = smnew CSourceStream *[m_iPins + 1];
|
||||
CSourceStream **paStreams = new CSourceStream *[m_iPins + 1];
|
||||
if(paStreams == NULL) {
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ int g_cTemplates = sizeof(g_Templates) / sizeof(g_Templates[0]);
|
||||
/* This goes in the factory template table to create new instances */
|
||||
CUnknown * WINAPI CSystemClock::CreateInstance(LPUNKNOWN pUnk,HRESULT *phr)
|
||||
{
|
||||
return smnew CSystemClock(NAME("System reference clock"),pUnk, phr);
|
||||
return new CSystemClock(NAME("System reference clock"),pUnk, phr);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ CTransformFilter::GetPin(int n) {
|
||||
|
||||
if(m_pInput == NULL) {
|
||||
|
||||
m_pInput = smnew CTransformInputPin(NAME("Transform input pin"),
|
||||
m_pInput = new CTransformInputPin(NAME("Transform input pin"),
|
||||
this, // Owner filter
|
||||
&hr, // Result code
|
||||
L"XForm In"); // Pin name
|
||||
@@ -101,7 +101,7 @@ CTransformFilter::GetPin(int n) {
|
||||
return NULL;
|
||||
}
|
||||
m_pOutput = (CTransformOutputPin *)
|
||||
smnew CTransformOutputPin(NAME("Transform output pin"),
|
||||
new CTransformOutputPin(NAME("Transform output pin"),
|
||||
this, // Owner filter
|
||||
&hr, // Result code
|
||||
L"XForm Out"); // Pin name
|
||||
|
||||
@@ -310,7 +310,7 @@ CTransInPlaceFilter::GetPin(int n) {
|
||||
|
||||
if(m_pInput == NULL) {
|
||||
|
||||
m_pInput = smnew CTransInPlaceInputPin(NAME("TransInPlace input pin")
|
||||
m_pInput = new CTransInPlaceInputPin(NAME("TransInPlace input pin")
|
||||
, this // Owner filter
|
||||
, &hr // Result code
|
||||
, L"Input" // Pin name
|
||||
@@ -324,7 +324,7 @@ CTransInPlaceFilter::GetPin(int n) {
|
||||
|
||||
if(m_pInput!=NULL && m_pOutput == NULL) {
|
||||
|
||||
m_pOutput = smnew CTransInPlaceOutputPin(NAME("TransInPlace output pin")
|
||||
m_pOutput = new CTransInPlaceOutputPin(NAME("TransInPlace output pin")
|
||||
, this // Owner filter
|
||||
, &hr // Result code
|
||||
, L"Output" // Pin name
|
||||
|
||||
@@ -1615,7 +1615,7 @@ CImageSample *CImageAllocator::CreateImageSample(LPBYTE pData,LONG Length)
|
||||
|
||||
// Allocate the new sample and check the return codes
|
||||
|
||||
pSample = smnew CImageSample((CBaseAllocator *) this, // Base class
|
||||
pSample = new CImageSample((CBaseAllocator *) this, // Base class
|
||||
NAME("Video sample"), // DEBUG name
|
||||
(HRESULT *) &hr, // Return code
|
||||
(LPBYTE) pData, // DIB address
|
||||
@@ -2023,7 +2023,7 @@ HPALETTE CImagePalette::MakePalette(const VIDEOINFOHEADER *pVideoInfo, LPSTR szD
|
||||
LOGPALETTE *lp; // Used to create a palette
|
||||
HPALETTE hPalette; // Logical palette object
|
||||
|
||||
lp = (LOGPALETTE *) smnew BYTE[sizeof(LOGPALETTE) + SIZE_PALETTE];
|
||||
lp = (LOGPALETTE *) new BYTE[sizeof(LOGPALETTE) + SIZE_PALETTE];
|
||||
if (lp == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -757,7 +757,7 @@ DWORD WINAPI DbgRegisterObjectCreation(const CHAR *szObjectName,
|
||||
|
||||
/* Create a place holder for this object description */
|
||||
|
||||
ObjectDesc *pObject = smnew ObjectDesc;
|
||||
ObjectDesc *pObject = new ObjectDesc;
|
||||
ASSERT(pObject);
|
||||
|
||||
/* It is valid to pass a NULL object name */
|
||||
@@ -1047,7 +1047,7 @@ CDisp::CDisp(IPin *pPin) {
|
||||
lstrcpy(str, TEXT("NULL IPin"));
|
||||
}
|
||||
|
||||
m_pString = (PTCHAR) smnew TCHAR[lstrlen(str)+64];
|
||||
m_pString = (PTCHAR) new TCHAR[lstrlen(str)+64];
|
||||
if(!m_pString) {
|
||||
return;
|
||||
}
|
||||
@@ -1065,7 +1065,7 @@ CDisp::CDisp(IUnknown *pUnk) {
|
||||
if(SUCCEEDED(hr)) {
|
||||
QueryFilterInfoReleaseGraph(fi);
|
||||
|
||||
m_pString = smnew TCHAR[lstrlenW(fi.achName) + 1];
|
||||
m_pString = new TCHAR[lstrlenW(fi.achName) + 1];
|
||||
if(m_pString) {
|
||||
wsprintf(m_pString, TEXT("%ls"), fi.achName);
|
||||
}
|
||||
|
||||
@@ -396,7 +396,7 @@ POSITION CBaseList::AddTailI(void *pObject)
|
||||
|
||||
pNode = (CNode *) m_Cache.RemoveFromCache();
|
||||
if (pNode == NULL) {
|
||||
pNode = smnew CNode;
|
||||
pNode = new CNode;
|
||||
}
|
||||
|
||||
/* Check we have a valid object */
|
||||
@@ -445,7 +445,7 @@ POSITION CBaseList::AddHeadI(void *pObject)
|
||||
|
||||
pNode = (CNode *) m_Cache.RemoveFromCache();
|
||||
if (pNode == NULL) {
|
||||
pNode = smnew CNode;
|
||||
pNode = new CNode;
|
||||
}
|
||||
|
||||
/* Check we have a valid object */
|
||||
@@ -549,7 +549,7 @@ POSITION CBaseList::AddAfterI(POSITION pos, void * pObj)
|
||||
|
||||
CNode *pNode = (CNode *) m_Cache.RemoveFromCache();
|
||||
if (pNode == NULL) {
|
||||
pNode = smnew CNode;
|
||||
pNode = new CNode;
|
||||
}
|
||||
|
||||
/* Check we have a valid object */
|
||||
@@ -616,7 +616,7 @@ POSITION CBaseList::AddBeforeI(POSITION pos, void * pObj)
|
||||
|
||||
CNode * pNode = (CNode *) m_Cache.RemoveFromCache();
|
||||
if (pNode == NULL) {
|
||||
pNode = smnew CNode;
|
||||
pNode = new CNode;
|
||||
}
|
||||
|
||||
/* Check we have a valid object */
|
||||
|
||||
@@ -263,7 +263,7 @@ private:
|
||||
InitializeCriticalSection(&CritSect);
|
||||
hSemPut = CreateSemaphore(NULL, n, n, NULL);
|
||||
hSemGet = CreateSemaphore(NULL, 0, n, NULL);
|
||||
QueueObjects = smnew T[n];
|
||||
QueueObjects = new T[n];
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -64,8 +64,8 @@ BeginnerHelper::BeginnerHelper()
|
||||
FOREACH_PlayerNumber( pn )
|
||||
m_bPlayerEnabled[pn] = false;
|
||||
FOREACH_PlayerNumber( pn )
|
||||
m_pDancer[pn] = smnew Model;
|
||||
m_pDancePad = smnew Model;
|
||||
m_pDancer[pn] = new Model;
|
||||
m_pDancePad = new Model;
|
||||
}
|
||||
|
||||
BeginnerHelper::~BeginnerHelper()
|
||||
|
||||
@@ -39,7 +39,7 @@ CharacterManager::CharacterManager()
|
||||
if( sCharName.CompareNoCase("default")==0 )
|
||||
FoundDefault = true;
|
||||
|
||||
Character* pChar = smnew Character;
|
||||
Character* pChar = new Character;
|
||||
if( pChar->Load( as[i] ) )
|
||||
m_pCharacters.push_back( pChar );
|
||||
else
|
||||
|
||||
@@ -472,7 +472,7 @@ bool CourseLoaderCRS::LoadEditFromFile( const RString &sEditFilePath, ProfileSlo
|
||||
LOG->UserLog( "Edit file", sEditFilePath, "couldn't be opened: %s", msd.GetError().c_str() );
|
||||
return false;
|
||||
}
|
||||
Course *pCourse = smnew Course;
|
||||
Course *pCourse = new Course;
|
||||
|
||||
pCourse->m_sPath = sEditFilePath;
|
||||
LoadFromMsd( sEditFilePath, msd, *pCourse, true );
|
||||
@@ -485,7 +485,7 @@ bool CourseLoaderCRS::LoadEditFromFile( const RString &sEditFilePath, ProfileSlo
|
||||
|
||||
bool CourseLoaderCRS::LoadEditFromBuffer( const RString &sBuffer, const RString &sPath, ProfileSlot slot )
|
||||
{
|
||||
Course *pCourse = smnew Course;
|
||||
Course *pCourse = new Course;
|
||||
if( !LoadFromBuffer(sPath, sBuffer, *pCourse) )
|
||||
{
|
||||
delete pCourse;
|
||||
|
||||
+1
-1
@@ -573,7 +573,7 @@ Course *CourseID::ToCourse() const
|
||||
|
||||
XNode* CourseID::CreateNode() const
|
||||
{
|
||||
XNode* pNode = smnew XNode( "Course" );;
|
||||
XNode* pNode = new XNode( "Course" );;
|
||||
|
||||
if( !sPath.empty() )
|
||||
pNode->AppendAttr( "Path", sPath );
|
||||
|
||||
+4
-4
@@ -676,7 +676,7 @@ ZRESULT TZip::open_file(const TCHAR *fn)
|
||||
hfin=0; bufin=0; crc=CRCVAL_INITIAL; isize=0; csize=0; ired=0;
|
||||
if (fn==0)
|
||||
return ZR_ARGS;
|
||||
hfin = smnew RageFile();
|
||||
hfin = new RageFile();
|
||||
if( !hfin->Open(fn) )
|
||||
{
|
||||
SAFE_DELETE( hfin );
|
||||
@@ -933,8 +933,8 @@ ZRESULT TZip::Add(const TCHAR *odstzn, const TCHAR *src,unsigned long flags)
|
||||
return oerr;
|
||||
|
||||
// Keep a copy of the zipfileinfo, for our end-of-zip directory
|
||||
char *cextra = smnew char[zfi.cext]; memcpy(cextra,zfi.cextra,zfi.cext); zfi.cextra=cextra;
|
||||
TZipFileInfo *pzfi = smnew TZipFileInfo; memcpy(pzfi,&zfi,sizeof(zfi));
|
||||
char *cextra = new char[zfi.cext]; memcpy(cextra,zfi.cextra,zfi.cext); zfi.cextra=cextra;
|
||||
TZipFileInfo *pzfi = new TZipFileInfo; memcpy(pzfi,&zfi,sizeof(zfi));
|
||||
if (zfis==NULL)
|
||||
zfis=pzfi;
|
||||
else
|
||||
@@ -999,7 +999,7 @@ CreateZip::CreateZip()
|
||||
|
||||
bool CreateZip::Start( RageFile *f)
|
||||
{
|
||||
hz = smnew TZip();
|
||||
hz = new TZip();
|
||||
lasterrorZ = hz->Start(f);
|
||||
return lasterrorZ == ZR_OK;
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ CryptManager::CryptManager()
|
||||
|
||||
ltc_mp = ltm_desc;
|
||||
|
||||
g_pPRNG = smnew PRNGWrapper( &yarrow_desc );
|
||||
g_pPRNG = new PRNGWrapper( &yarrow_desc );
|
||||
}
|
||||
|
||||
void CryptManager::GenerateGlobalKeys()
|
||||
|
||||
@@ -52,7 +52,7 @@ DancingCharacters::DancingCharacters(): m_bDrawDangerLight(false),
|
||||
{
|
||||
FOREACH_PlayerNumber( p )
|
||||
{
|
||||
m_pCharacter[p] = smnew Model;
|
||||
m_pCharacter[p] = new Model;
|
||||
m_2DIdleTimer[p].SetZero();
|
||||
m_i2DAnimState[p] = AS2D_IDLE; // start on idle state
|
||||
if( !GAMESTATE->IsPlayerEnabled(p) )
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ const RString &CourseDifficultyToLocalizedString( CourseDifficulty x )
|
||||
{
|
||||
FOREACH_ENUM( Difficulty,i)
|
||||
{
|
||||
auto_ptr<LocalizedString> ap( smnew LocalizedString("CourseDifficulty", DifficultyToString(i)) );
|
||||
auto_ptr<LocalizedString> ap( new LocalizedString("CourseDifficulty", DifficultyToString(i)) );
|
||||
g_CourseDifficultyName[i] = ap;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
#include "RageUtil.h"
|
||||
#include "LuaBinding.h"
|
||||
|
||||
DynamicActorScroller *DynamicActorScroller::Copy() const { return smnew DynamicActorScroller(*this); }
|
||||
DynamicActorScroller *DynamicActorScroller::Copy() const { return new DynamicActorScroller(*this); }
|
||||
|
||||
void DynamicActorScroller::LoadFromNode( const XNode *pNode )
|
||||
{
|
||||
|
||||
+2
-2
@@ -57,11 +57,11 @@ const RString &EnumToString( int iVal, int iMax, const char **szNameArray, auto_
|
||||
{
|
||||
for( int i = 0; i < iMax; ++i )
|
||||
{
|
||||
auto_ptr<RString> ap( smnew RString( szNameArray[i] ) );
|
||||
auto_ptr<RString> ap( new RString( szNameArray[i] ) );
|
||||
pNameCache[i] = ap;
|
||||
}
|
||||
|
||||
auto_ptr<RString> ap( smnew RString );
|
||||
auto_ptr<RString> ap( new RString );
|
||||
pNameCache[iMax+1] = ap;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -84,7 +84,7 @@ const RString &X##ToLocalizedString( X x ) \
|
||||
if( g_##X##Name[0].get() == NULL ) { \
|
||||
for( unsigned i = 0; i < NUM_##X; ++i ) \
|
||||
{ \
|
||||
auto_ptr<LocalizedString> ap( smnew LocalizedString(#X, X##ToString((X)i)) ); \
|
||||
auto_ptr<LocalizedString> ap( new LocalizedString(#X, X##ToString((X)i)) ); \
|
||||
g_##X##Name[i] = ap; \
|
||||
} \
|
||||
} \
|
||||
|
||||
+1
-1
@@ -749,7 +749,7 @@ void Font::Load( const RString &sIniPath, RString sChars )
|
||||
continue;
|
||||
|
||||
// Create this down here so it doesn't leak if the continue gets triggered.
|
||||
FontPage *pPage = smnew FontPage;
|
||||
FontPage *pPage = new FontPage;
|
||||
|
||||
// Load settings for this page from the INI.
|
||||
FontPageSettings cfg;
|
||||
|
||||
+1
-1
@@ -47,7 +47,7 @@ Font* FontManager::LoadFont( const RString &sFontOrTextureFilePath, RString sCha
|
||||
return pFont;
|
||||
}
|
||||
|
||||
Font *f = smnew Font;
|
||||
Font *f = new Font;
|
||||
f->Load(sFontOrTextureFilePath, sChars);
|
||||
g_mapPathToFont[NewName] = f;
|
||||
return f;
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@
|
||||
|
||||
static LocalizedString COULD_NOT_LAUNCH_BROWSER( "GameCommand", "Could not launch web browser." );
|
||||
|
||||
REGISTER_CLASS_TRAITS( GameCommand, smnew GameCommand(*pCopy) );
|
||||
REGISTER_CLASS_TRAITS( GameCommand, new GameCommand(*pCopy) );
|
||||
|
||||
void GameCommand::Init()
|
||||
{
|
||||
|
||||
+2
-2
@@ -141,7 +141,7 @@ namespace
|
||||
// Apply the new window title, icon and aspect ratio.
|
||||
StepMania::ApplyGraphicOptions();
|
||||
|
||||
SCREENMAN = smnew ScreenManager();
|
||||
SCREENMAN = new ScreenManager();
|
||||
|
||||
StepMania::ResetGame();
|
||||
SCREENMAN->ThemeChanged();
|
||||
@@ -340,7 +340,7 @@ int ConcurrentRenderer::StartRenderThread( void *p )
|
||||
void GameLoop::StartConcurrentRendering()
|
||||
{
|
||||
if( g_pConcurrentRenderer == NULL )
|
||||
g_pConcurrentRenderer = smnew ConcurrentRenderer;
|
||||
g_pConcurrentRenderer = new ConcurrentRenderer;
|
||||
g_pConcurrentRenderer->Start();
|
||||
}
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@ static void StartMusic( MusicToPlay &ToPlay )
|
||||
/* StopPlaying() can take a while, so don't hold the lock while we stop the sound.
|
||||
* Be sure to leave the rest of g_Playing in place. */
|
||||
RageSound *pOldSound = g_Playing->m_Music;
|
||||
g_Playing->m_Music = smnew RageSound;
|
||||
g_Playing->m_Music = new RageSound;
|
||||
L.Unlock();
|
||||
|
||||
delete pOldSound;
|
||||
@@ -125,13 +125,13 @@ static void StartMusic( MusicToPlay &ToPlay )
|
||||
MusicPlaying *NewMusic;
|
||||
{
|
||||
g_Mutex->Unlock();
|
||||
RageSound *pSound = smnew RageSound;
|
||||
RageSound *pSound = new RageSound;
|
||||
RageSoundLoadParams params;
|
||||
params.m_bSupportRateChanging = ToPlay.bApplyMusicRate;
|
||||
pSound->Load( ToPlay.m_sFile, false, ¶ms );
|
||||
g_Mutex->Lock();
|
||||
|
||||
NewMusic = smnew MusicPlaying( pSound );
|
||||
NewMusic = new MusicPlaying( pSound );
|
||||
}
|
||||
|
||||
NewMusic->m_Timing = g_Playing->m_Timing;
|
||||
@@ -273,7 +273,7 @@ static void StartMusic( MusicToPlay &ToPlay )
|
||||
static void DoPlayOnce( RString sPath )
|
||||
{
|
||||
/* We want this to start quickly, so don't try to prebuffer it. */
|
||||
RageSound *pSound = smnew RageSound;
|
||||
RageSound *pSound = new RageSound;
|
||||
pSound->Load( sPath, false );
|
||||
|
||||
pSound->Play();
|
||||
@@ -357,7 +357,7 @@ static void StartQueuedSounds()
|
||||
/* StopPlaying() can take a while, so don't hold the lock while we stop the sound. */
|
||||
g_Mutex->Lock();
|
||||
RageSound *pOldSound = g_Playing->m_Music;
|
||||
g_Playing->m_Music = smnew RageSound;
|
||||
g_Playing->m_Music = new RageSound;
|
||||
g_Mutex->Unlock();
|
||||
|
||||
delete pOldSound;
|
||||
@@ -412,8 +412,8 @@ GameSoundManager::GameSoundManager()
|
||||
/* Init RageSoundMan first: */
|
||||
ASSERT( SOUNDMAN != NULL );
|
||||
|
||||
g_Mutex = smnew RageEvent("GameSoundManager");
|
||||
g_Playing = smnew MusicPlaying( smnew RageSound );
|
||||
g_Mutex = new RageEvent("GameSoundManager");
|
||||
g_Playing = new MusicPlaying( new RageSound );
|
||||
|
||||
g_UpdatingTimer = true;
|
||||
|
||||
|
||||
+4
-4
@@ -131,7 +131,7 @@ GameState::GameState() :
|
||||
m_iEditCourseEntryIndex( Message_EditCourseEntryIndexChanged ),
|
||||
m_sEditLocalProfileID( Message_EditLocalProfileIDChanged )
|
||||
{
|
||||
g_pImpl = smnew GameStateImpl;
|
||||
g_pImpl = new GameStateImpl;
|
||||
|
||||
SetCurrentStyle( NULL );
|
||||
|
||||
@@ -148,17 +148,17 @@ GameState::GameState() :
|
||||
|
||||
FOREACH_PlayerNumber( p )
|
||||
{
|
||||
m_pPlayerState[p] = smnew PlayerState;
|
||||
m_pPlayerState[p] = new PlayerState;
|
||||
m_pPlayerState[p]->m_PlayerNumber = p;
|
||||
}
|
||||
FOREACH_MultiPlayer( p )
|
||||
{
|
||||
m_pMultiPlayerState[p] = smnew PlayerState;
|
||||
m_pMultiPlayerState[p] = new PlayerState;
|
||||
m_pMultiPlayerState[p]->m_PlayerNumber = PLAYER_1;
|
||||
m_pMultiPlayerState[p]->m_mp = p;
|
||||
}
|
||||
|
||||
m_Environment = smnew LuaTable;
|
||||
m_Environment = new LuaTable;
|
||||
|
||||
m_bDopefish = false;
|
||||
|
||||
|
||||
@@ -228,10 +228,10 @@ void GraphDisplay::Load( RString sMetricsGroup )
|
||||
m_sprBacking->ZoomToHeight( m_size.y );
|
||||
this->AddChild( m_sprBacking );
|
||||
|
||||
m_pGraphBody = smnew GraphBody( THEME->GetPathG(sMetricsGroup,"Body") );
|
||||
m_pGraphBody = new GraphBody( THEME->GetPathG(sMetricsGroup,"Body") );
|
||||
this->AddChild( m_pGraphBody );
|
||||
|
||||
m_pGraphLine = smnew GraphLine;
|
||||
m_pGraphLine = new GraphLine;
|
||||
m_pGraphLine->SetName("Line");
|
||||
ActorUtil::LoadAllCommands( m_pGraphLine, sMetricsGroup );
|
||||
this->AddChild( m_pGraphLine );
|
||||
|
||||
+6
-6
@@ -91,7 +91,7 @@ HighScoreImpl::HighScoreImpl()
|
||||
|
||||
XNode *HighScoreImpl::CreateNode() const
|
||||
{
|
||||
XNode *pNode = smnew XNode( "HighScore" );
|
||||
XNode *pNode = new XNode( "HighScore" );
|
||||
const bool bWriteSimpleValues = RadarValues::WRITE_SIMPLE_VALIES;
|
||||
const bool bWriteComplexValues = RadarValues::WRITE_COMPLEX_VALIES;
|
||||
|
||||
@@ -162,16 +162,16 @@ void HighScoreImpl::LoadFromNode( const XNode *pNode )
|
||||
grade = clamp( grade, Grade_Tier01, Grade_Failed );
|
||||
}
|
||||
|
||||
REGISTER_CLASS_TRAITS( HighScoreImpl, smnew HighScoreImpl(*pCopy) )
|
||||
REGISTER_CLASS_TRAITS( HighScoreImpl, new HighScoreImpl(*pCopy) )
|
||||
|
||||
HighScore::HighScore()
|
||||
{
|
||||
m_Impl = smnew HighScoreImpl;
|
||||
m_Impl = new HighScoreImpl;
|
||||
}
|
||||
|
||||
void HighScore::Unset()
|
||||
{
|
||||
m_Impl = smnew HighScoreImpl;
|
||||
m_Impl = new HighScoreImpl;
|
||||
}
|
||||
|
||||
bool HighScore::IsEmpty() const
|
||||
@@ -328,7 +328,7 @@ const HighScore& HighScoreList::GetTopScore() const
|
||||
|
||||
XNode* HighScoreList::CreateNode() const
|
||||
{
|
||||
XNode* pNode = smnew XNode( "HighScoreList" );
|
||||
XNode* pNode = new XNode( "HighScoreList" );
|
||||
|
||||
pNode->AppendChild( "NumTimesPlayed", iNumTimesPlayed );
|
||||
pNode->AppendChild( "LastPlayed", dtLastPlayed.GetString() );
|
||||
@@ -408,7 +408,7 @@ void HighScoreList::ClampSize( bool bIsMachine )
|
||||
|
||||
XNode* Screenshot::CreateNode() const
|
||||
{
|
||||
XNode* pNode = smnew XNode( "Screenshot" );
|
||||
XNode* pNode = new XNode( "Screenshot" );
|
||||
|
||||
// TRICKY: Don't write "name to fill in" markers.
|
||||
pNode->AppendChild( "FileName", sFileName );
|
||||
|
||||
+1
-1
@@ -93,7 +93,7 @@ static float g_fTimeBeforeRepeats, g_fTimeBetweenRepeats;
|
||||
|
||||
InputFilter::InputFilter()
|
||||
{
|
||||
queuemutex = smnew RageMutex("InputFilter");
|
||||
queuemutex = new RageMutex("InputFilter");
|
||||
|
||||
Reset();
|
||||
ResetRepeatRate();
|
||||
|
||||
+1
-1
@@ -78,7 +78,7 @@ void Inventory::Load( PlayerState* pPlayerState )
|
||||
m_soundAcquireItem.Load( THEME->GetPathS("Inventory","aquire item") );
|
||||
for( unsigned i=0; i<g_Items.size(); i++ )
|
||||
{
|
||||
RageSound* pSound = smnew RageSound;
|
||||
RageSound* pSound = new RageSound;
|
||||
pSound->Load( THEME->GetPathS("Inventory",ssprintf("use item %u",i+1)) );
|
||||
m_vpSoundUseItem.push_back( pSound );
|
||||
}
|
||||
|
||||
+3
-3
@@ -163,7 +163,7 @@ namespace JsonUtil
|
||||
v.resize(root.size());
|
||||
for(unsigned i=0; i<v.size(); i++)
|
||||
{
|
||||
v[i] = smnew T;
|
||||
v[i] = new T;
|
||||
fn(*v[i], root[i]);
|
||||
}
|
||||
}
|
||||
@@ -176,7 +176,7 @@ namespace JsonUtil
|
||||
v.resize(root.size());
|
||||
for(unsigned i=0; i<v.size(); i++)
|
||||
{
|
||||
v[i] = smnew T;
|
||||
v[i] = new T;
|
||||
fn(*v[i], root[i]);
|
||||
}
|
||||
}
|
||||
@@ -190,7 +190,7 @@ namespace JsonUtil
|
||||
v.resize(root.size());
|
||||
for(unsigned i=0; i<v.size(); i++)
|
||||
{
|
||||
v[i] = smnew T(param);
|
||||
v[i] = new T(param);
|
||||
fn(*v[i], root[i]);
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -8,9 +8,9 @@ LifeMeter *LifeMeter::MakeLifeMeter( SongOptions::LifeType t )
|
||||
{
|
||||
switch( t )
|
||||
{
|
||||
case SongOptions::LIFE_BAR: return smnew LifeMeterBar;
|
||||
case SongOptions::LIFE_BATTERY: return smnew LifeMeterBattery;
|
||||
case SongOptions::LIFE_TIME: return smnew LifeMeterTime;
|
||||
case SongOptions::LIFE_BAR: return new LifeMeterBar;
|
||||
case SongOptions::LIFE_BATTERY: return new LifeMeterBattery;
|
||||
case SongOptions::LIFE_TIME: return new LifeMeterTime;
|
||||
default:
|
||||
FAIL_M(ssprintf("Unrecognized LifeMeter type: %i", t));
|
||||
}
|
||||
|
||||
@@ -74,7 +74,7 @@ LifeMeterBar::LifeMeterBar()
|
||||
ActorUtil::LoadAllCommandsAndSetXY( m_sprDanger, sType );
|
||||
this->AddChild( m_sprDanger );
|
||||
|
||||
m_pStream = smnew StreamDisplay;
|
||||
m_pStream = new StreamDisplay;
|
||||
m_pStream->Load( bExtra ? "StreamDisplayExtra" : "StreamDisplay" );
|
||||
m_pStream->SetName( "Stream" );
|
||||
ActorUtil::LoadAllCommandsAndSetXY( m_pStream, sType );
|
||||
|
||||
@@ -77,7 +77,7 @@ void LifeMeterTime::Load( const PlayerState *pPlayerState, PlayerStageStats *pPl
|
||||
m_quadDangerGlow.SetEffectClock( Actor::CLOCK_BGM_BEAT );
|
||||
this->AddChild( &m_quadDangerGlow );
|
||||
|
||||
m_pStream = smnew StreamDisplay;
|
||||
m_pStream = new StreamDisplay;
|
||||
bool bExtra = GAMESTATE->IsAnExtraStage();
|
||||
m_pStream->Load( bExtra ? "StreamDisplayExtra" : "StreamDisplay" );
|
||||
this->AddChild( m_pStream );
|
||||
|
||||
@@ -13,7 +13,7 @@ SubscriptionManager<LocalizedString> & GetSubscribers()
|
||||
class LocalizedStringImplDefault: public ILocalizedStringImpl
|
||||
{
|
||||
public:
|
||||
static ILocalizedStringImpl *Create() { return smnew LocalizedStringImplDefault; }
|
||||
static ILocalizedStringImpl *Create() { return new LocalizedStringImplDefault; }
|
||||
|
||||
void Load( const RString& sGroup, const RString& sName )
|
||||
{
|
||||
|
||||
+1
-1
@@ -306,7 +306,7 @@ void LuaBinding::ApplyDerivedType( Lua *L, const RString &sClassName, void *pSel
|
||||
}
|
||||
|
||||
#include "RageUtil_AutoPtr.h"
|
||||
REGISTER_CLASS_TRAITS( LuaClass, smnew LuaClass(*pCopy) )
|
||||
REGISTER_CLASS_TRAITS( LuaClass, new LuaClass(*pCopy) )
|
||||
|
||||
void *LuaBinding::GetPointerFromStack( Lua *L, const RString &sType, int iArg )
|
||||
{
|
||||
|
||||
+9
-9
@@ -239,7 +239,7 @@ void LuaManager::Register( RegisterWithLuaFn pfn )
|
||||
|
||||
LuaManager::LuaManager()
|
||||
{
|
||||
pImpl = smnew Impl;
|
||||
pImpl = new Impl;
|
||||
LUA = this; // so that LUA is available when we call the Register functions
|
||||
|
||||
lua_State *L = lua_open();
|
||||
@@ -373,8 +373,8 @@ void LuaManager::RegisterTypes()
|
||||
|
||||
LuaThreadVariable::LuaThreadVariable( const RString &sName, const RString &sValue )
|
||||
{
|
||||
m_Name = smnew LuaReference;
|
||||
m_pOldValue = smnew LuaReference;
|
||||
m_Name = new LuaReference;
|
||||
m_pOldValue = new LuaReference;
|
||||
|
||||
Lua *L = LUA->Get();
|
||||
LuaHelpers::Push( L, sName );
|
||||
@@ -386,8 +386,8 @@ LuaThreadVariable::LuaThreadVariable( const RString &sName, const RString &sValu
|
||||
|
||||
LuaThreadVariable::LuaThreadVariable( const RString &sName, const LuaReference &Value )
|
||||
{
|
||||
m_Name = smnew LuaReference;
|
||||
m_pOldValue = smnew LuaReference;
|
||||
m_Name = new LuaReference;
|
||||
m_pOldValue = new LuaReference;
|
||||
|
||||
Lua *L = LUA->Get();
|
||||
LuaHelpers::Push( L, sName );
|
||||
@@ -401,8 +401,8 @@ LuaThreadVariable::LuaThreadVariable( const RString &sName, const LuaReference &
|
||||
// name and value are on the stack
|
||||
LuaThreadVariable::LuaThreadVariable( lua_State *L )
|
||||
{
|
||||
m_Name = smnew LuaReference;
|
||||
m_pOldValue = smnew LuaReference;
|
||||
m_Name = new LuaReference;
|
||||
m_pOldValue = new LuaReference;
|
||||
|
||||
lua_pushvalue( L, -2 );
|
||||
m_Name->SetFromStack( L );
|
||||
@@ -547,7 +547,7 @@ namespace
|
||||
|
||||
XNode *LuaHelpers::GetLuaInformation()
|
||||
{
|
||||
XNode *pLuaNode = smnew XNode( "Lua" );
|
||||
XNode *pLuaNode = new XNode( "Lua" );
|
||||
|
||||
XNode *pGlobalsNode = pLuaNode->AppendChild( "GlobalFunctions" );
|
||||
XNode *pClassesNode = pLuaNode->AppendChild( "Classes" );
|
||||
@@ -1042,7 +1042,7 @@ namespace
|
||||
FOREACH_LUATABLE( L, 2 )
|
||||
{
|
||||
lua_pushvalue( L, -2 );
|
||||
LuaThreadVariable *pVar = smnew LuaThreadVariable( L );
|
||||
LuaThreadVariable *pVar = new LuaThreadVariable( L );
|
||||
apVars.push_back( pVar );
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "global.h"
|
||||
#include "LuaReference.h"
|
||||
|
||||
REGISTER_CLASS_TRAITS( LuaReference, smnew LuaReference(*pCopy) )
|
||||
REGISTER_CLASS_TRAITS( LuaReference, new LuaReference(*pCopy) )
|
||||
|
||||
LuaReference::LuaReference()
|
||||
{
|
||||
@@ -170,7 +170,7 @@ namespace LuaHelpers
|
||||
|
||||
template<> bool FromStack<apActorCommands>( lua_State *L, apActorCommands &Object, int iOffset )
|
||||
{
|
||||
LuaReference *pRef = smnew LuaReference;
|
||||
LuaReference *pRef = new LuaReference;
|
||||
FromStack( L, *pRef, iOffset );
|
||||
Object = apActorCommands( pRef );
|
||||
return true;
|
||||
|
||||
@@ -142,7 +142,7 @@ ThreadedMemoryCardWorker::ThreadedMemoryCardWorker():
|
||||
if( g_bMemoryCards )
|
||||
m_pDriver = MemoryCardDriver::Create();
|
||||
else
|
||||
m_pDriver = smnew MemoryCardDriver_Null;
|
||||
m_pDriver = new MemoryCardDriver_Null;
|
||||
|
||||
m_MountThreadState = detect_and_mount;
|
||||
SetHeartbeat( 0.1f );
|
||||
@@ -268,7 +268,7 @@ MemoryCardManager::MemoryCardManager()
|
||||
LUA->Release( L );
|
||||
}
|
||||
|
||||
g_pWorker = smnew ThreadedMemoryCardWorker;
|
||||
g_pWorker = new ThreadedMemoryCardWorker;
|
||||
|
||||
FOREACH_PlayerNumber( p )
|
||||
{
|
||||
|
||||
+1
-1
@@ -58,7 +58,7 @@ void MenuTimer::Load( RString sMetricsGroup )
|
||||
if(WARNING_COMMAND)
|
||||
WARNING_COMMAND->Clear();
|
||||
|
||||
WARNING_COMMAND = smnew ThemeMetric1D<apActorCommands>(sMetricsGroup, WARNING_COMMAND_NAME, WARNING_START+1);
|
||||
WARNING_COMMAND = new ThemeMetric1D<apActorCommands>(sMetricsGroup, WARNING_COMMAND_NAME, WARNING_START+1);
|
||||
|
||||
m_fStallSecondsLeft = MAX_STALL_SECONDS;
|
||||
}
|
||||
|
||||
@@ -96,7 +96,7 @@ static map<RString,SubscribersSet> g_MessageToSubscribers;
|
||||
Message::Message( const RString &s )
|
||||
{
|
||||
m_sName = s;
|
||||
m_pParams = smnew LuaTable;
|
||||
m_pParams = new LuaTable;
|
||||
m_bBroadcast = false;
|
||||
}
|
||||
|
||||
@@ -105,11 +105,11 @@ Message::Message( const RString &s, const LuaReference ¶ms )
|
||||
m_sName = s;
|
||||
m_bBroadcast = false;
|
||||
Lua *L = LUA->Get();
|
||||
m_pParams = smnew LuaTable; // XXX: creates an extra table
|
||||
m_pParams = new LuaTable; // XXX: creates an extra table
|
||||
params.PushSelf( L );
|
||||
m_pParams->SetFromStack( L );
|
||||
LUA->Release( L );
|
||||
// m_pParams = smnew LuaTable( params );
|
||||
// m_pParams = new LuaTable( params );
|
||||
}
|
||||
|
||||
Message::~Message()
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@ void ModIconRow::Load( const RString &sMetricsGroup, PlayerNumber pn )
|
||||
|
||||
for( int i=0; i<NUM_OPTION_ICONS; i++ )
|
||||
{
|
||||
ModIcon *p = smnew ModIcon;
|
||||
ModIcon *p = new ModIcon;
|
||||
p->SetName( "ModIcon" );
|
||||
float fOffset = SCALE( i, 0, NUM_OPTION_ICONS-1, -(NUM_OPTION_ICONS-1)/2.0f, (float)(NUM_OPTION_ICONS-1)/2.0f );
|
||||
p->SetXY( fOffset*SPACING_X, fOffset*SPACING_Y );
|
||||
|
||||
@@ -36,7 +36,7 @@ RageModelGeometry* ModelManager::LoadMilkshapeAscii( const RString& sFile, bool
|
||||
return pGeom;
|
||||
}
|
||||
|
||||
RageModelGeometry* pGeom = smnew RageModelGeometry;
|
||||
RageModelGeometry* pGeom = new RageModelGeometry;
|
||||
pGeom->LoadMilkshapeAscii( sFile, bNeedNormals );
|
||||
|
||||
m_mapFileToGeometry[sFile] = pGeom;
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@ void MsdFile::ReadBuf( const char *buf, int len, bool bUnescape )
|
||||
|
||||
bool ReadingValue=false;
|
||||
int i = 0;
|
||||
char *cProcessed = smnew char[len];
|
||||
char *cProcessed = new char[len];
|
||||
int iProcessedLen = -1;
|
||||
while( i < len )
|
||||
{
|
||||
|
||||
+13
-13
@@ -66,7 +66,7 @@ static SortOrder ForceAppropriateSort( PlayMode pm, SortOrder so )
|
||||
|
||||
MusicWheelItem *MusicWheel::MakeItem()
|
||||
{
|
||||
return smnew MusicWheelItem;
|
||||
return new MusicWheelItem;
|
||||
}
|
||||
|
||||
void MusicWheel::Load( RString sType )
|
||||
@@ -503,7 +503,7 @@ void MusicWheel::BuildWheelItemDatas( vector<MusicWheelItemData *> &arrayWheelIt
|
||||
for( unsigned i=0; i<vsNames.size(); ++i )
|
||||
{
|
||||
MusicWheelItemData wid( WheelItemDataType_Sort, NULL, "", NULL, SORT_MENU_COLOR, 0 );
|
||||
wid.m_pAction = HiddenPtr<GameCommand>( smnew GameCommand );
|
||||
wid.m_pAction = HiddenPtr<GameCommand>( new GameCommand );
|
||||
wid.m_pAction->m_sName = vsNames[i];
|
||||
wid.m_pAction->Load( i, ParseCommands(CHOICE.GetValue(vsNames[i])) );
|
||||
wid.m_sLabel = WHEEL_TEXT( vsNames[i] );
|
||||
@@ -511,7 +511,7 @@ void MusicWheel::BuildWheelItemDatas( vector<MusicWheelItemData *> &arrayWheelIt
|
||||
if( !wid.m_pAction->IsPlayable() )
|
||||
continue;
|
||||
|
||||
arrayWheelItemDatas.push_back( smnew MusicWheelItemData(wid) );
|
||||
arrayWheelItemDatas.push_back( new MusicWheelItemData(wid) );
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -676,18 +676,18 @@ void MusicWheel::BuildWheelItemDatas( vector<MusicWheelItemData *> &arrayWheelIt
|
||||
// In certain situations (e.g. simulating Pump it Up), themes may
|
||||
// want to only show one group at a time.
|
||||
if( !HIDE_INACTIVE_SECTIONS )
|
||||
arrayWheelItemDatas.push_back( smnew MusicWheelItemData(WheelItemDataType_Section, NULL, sThisSection, NULL, colorSection, iSectionCount) );
|
||||
arrayWheelItemDatas.push_back( new MusicWheelItemData(WheelItemDataType_Section, NULL, sThisSection, NULL, colorSection, iSectionCount) );
|
||||
sLastSection = sThisSection;
|
||||
}
|
||||
}
|
||||
arrayWheelItemDatas.push_back( smnew MusicWheelItemData(WheelItemDataType_Song, pSong, sLastSection, NULL, SONGMAN->GetSongColor(pSong), 0) );
|
||||
arrayWheelItemDatas.push_back( new MusicWheelItemData(WheelItemDataType_Song, pSong, sLastSection, NULL, SONGMAN->GetSongColor(pSong), 0) );
|
||||
}
|
||||
|
||||
if( so != SORT_ROULETTE )
|
||||
{
|
||||
// todo: allow themers to change the order of the items. -aj
|
||||
if( SHOW_ROULETTE )
|
||||
arrayWheelItemDatas.push_back( smnew MusicWheelItemData(WheelItemDataType_Roulette, NULL, "", NULL, ROULETTE_COLOR, 0) );
|
||||
arrayWheelItemDatas.push_back( new MusicWheelItemData(WheelItemDataType_Roulette, NULL, "", NULL, ROULETTE_COLOR, 0) );
|
||||
|
||||
// Only add WheelItemDataType_Random and WheelItemDataType_Portal if there's at least
|
||||
// one song on the list.
|
||||
@@ -697,10 +697,10 @@ void MusicWheel::BuildWheelItemDatas( vector<MusicWheelItemData *> &arrayWheelIt
|
||||
bFoundAnySong = true;
|
||||
|
||||
if( SHOW_RANDOM && bFoundAnySong )
|
||||
arrayWheelItemDatas.push_back( smnew MusicWheelItemData(WheelItemDataType_Random, NULL, "", NULL, RANDOM_COLOR, 0) );
|
||||
arrayWheelItemDatas.push_back( new MusicWheelItemData(WheelItemDataType_Random, NULL, "", NULL, RANDOM_COLOR, 0) );
|
||||
|
||||
if( SHOW_PORTAL && bFoundAnySong )
|
||||
arrayWheelItemDatas.push_back( smnew MusicWheelItemData(WheelItemDataType_Portal, NULL, "", NULL, PORTAL_COLOR, 0) );
|
||||
arrayWheelItemDatas.push_back( new MusicWheelItemData(WheelItemDataType_Portal, NULL, "", NULL, PORTAL_COLOR, 0) );
|
||||
|
||||
// add custom wheel items
|
||||
vector<RString> vsNames;
|
||||
@@ -708,7 +708,7 @@ void MusicWheel::BuildWheelItemDatas( vector<MusicWheelItemData *> &arrayWheelIt
|
||||
for( unsigned i=0; i<vsNames.size(); ++i )
|
||||
{
|
||||
MusicWheelItemData wid( WheelItemDataType_Custom, NULL, "", NULL, CUSTOM_CHOICE_COLORS.GetValue(vsNames[i]), 0 );
|
||||
wid.m_pAction = HiddenPtr<GameCommand>( smnew GameCommand );
|
||||
wid.m_pAction = HiddenPtr<GameCommand>( new GameCommand );
|
||||
wid.m_pAction->m_sName = vsNames[i];
|
||||
wid.m_pAction->Load( i, ParseCommands(CUSTOM_CHOICES.GetValue(vsNames[i])) );
|
||||
wid.m_sLabel = CUSTOM_ITEM_WHEEL_TEXT( vsNames[i] );
|
||||
@@ -716,7 +716,7 @@ void MusicWheel::BuildWheelItemDatas( vector<MusicWheelItemData *> &arrayWheelIt
|
||||
if( !wid.m_pAction->IsPlayable() )
|
||||
continue;
|
||||
|
||||
arrayWheelItemDatas.push_back( smnew MusicWheelItemData(wid) );
|
||||
arrayWheelItemDatas.push_back( new MusicWheelItemData(wid) );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -833,12 +833,12 @@ void MusicWheel::BuildWheelItemDatas( vector<MusicWheelItemData *> &arrayWheelIt
|
||||
{
|
||||
RageColor c = SECTION_COLORS.GetValue(iSectionColorIndex);
|
||||
iSectionColorIndex = (iSectionColorIndex+1) % NUM_SECTION_COLORS;
|
||||
arrayWheelItemDatas.push_back( smnew MusicWheelItemData(WheelItemDataType_Section, NULL, sThisSection, NULL, c, 0) );
|
||||
arrayWheelItemDatas.push_back( new MusicWheelItemData(WheelItemDataType_Section, NULL, sThisSection, NULL, c, 0) );
|
||||
sLastSection = sThisSection;
|
||||
}
|
||||
|
||||
RageColor c = ( pCourse->m_sGroupName.size() == 0 ) ? pCourse->GetColor() : SONGMAN->GetCourseColor(pCourse);
|
||||
arrayWheelItemDatas.push_back( smnew MusicWheelItemData(WheelItemDataType_Course, NULL, sThisSection, pCourse, c, 0) );
|
||||
arrayWheelItemDatas.push_back( new MusicWheelItemData(WheelItemDataType_Course, NULL, sThisSection, pCourse, c, 0) );
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -1052,7 +1052,7 @@ void MusicWheel::FilterWheelItemDatas(vector<MusicWheelItemData *> &aUnFilteredD
|
||||
|
||||
// If we've filtered all items, insert a dummy.
|
||||
if( aFilteredData.empty() )
|
||||
aFilteredData.push_back( smnew MusicWheelItemData(WheelItemDataType_Section, NULL, EMPTY_STRING, NULL, EMPTY_COLOR, 0) );
|
||||
aFilteredData.push_back( new MusicWheelItemData(WheelItemDataType_Section, NULL, EMPTY_STRING, NULL, EMPTY_COLOR, 0) );
|
||||
}
|
||||
|
||||
void MusicWheel::UpdateSwitch()
|
||||
|
||||
@@ -81,7 +81,7 @@ MusicWheelItem::MusicWheelItem( RString sType ):
|
||||
if( i == MusicWheelItemType_Song )
|
||||
continue;
|
||||
|
||||
m_pText[i] = smnew BitmapText;
|
||||
m_pText[i] = new BitmapText;
|
||||
m_pText[i]->SetName( MusicWheelItemTypeToString(i) );
|
||||
ActorUtil::LoadAllCommands( m_pText[i], "MusicWheelItem" );
|
||||
m_pText[i]->LoadFromFont( THEME->GetPathF(sType,MusicWheelItemTypeToString(i)) );
|
||||
@@ -90,7 +90,7 @@ MusicWheelItem::MusicWheelItem( RString sType ):
|
||||
this->AddChild( m_pText[i] );
|
||||
}
|
||||
|
||||
m_pTextSectionCount = smnew BitmapText;
|
||||
m_pTextSectionCount = new BitmapText;
|
||||
m_pTextSectionCount->SetName( "SectionCount" );
|
||||
ActorUtil::LoadAllCommands( m_pTextSectionCount, "MusicWheelItem" );
|
||||
m_pTextSectionCount->LoadFromFont( THEME->GetPathF(sType,"SectionCount") );
|
||||
@@ -151,12 +151,12 @@ MusicWheelItem::MusicWheelItem( const MusicWheelItem &cpy ):
|
||||
}
|
||||
else
|
||||
{
|
||||
m_pText[i] = smnew BitmapText( *cpy.m_pText[i] );
|
||||
m_pText[i] = new BitmapText( *cpy.m_pText[i] );
|
||||
this->AddChild( m_pText[i] );
|
||||
}
|
||||
}
|
||||
|
||||
m_pTextSectionCount = smnew BitmapText( *cpy.m_pTextSectionCount );
|
||||
m_pTextSectionCount = new BitmapText( *cpy.m_pTextSectionCount );
|
||||
this->AddChild( m_pTextSectionCount );
|
||||
|
||||
this->AddChild( &m_WheelNotifyIcon );
|
||||
|
||||
@@ -39,7 +39,7 @@ public:
|
||||
MusicWheelItem(RString sType = "MusicWheelItem");
|
||||
MusicWheelItem( const MusicWheelItem &cpy );
|
||||
virtual ~MusicWheelItem();
|
||||
virtual MusicWheelItem *Copy() const { return smnew MusicWheelItem(*this); }
|
||||
virtual MusicWheelItem *Copy() const { return new MusicWheelItem(*this); }
|
||||
|
||||
virtual void LoadFromWheelItemData( const WheelItemBaseData* pWID, int iIndex, bool bHasFocus, int iDrawIndex );
|
||||
virtual void HandleMessage( const Message &msg );
|
||||
|
||||
@@ -72,7 +72,7 @@ NetworkSyncManager::NetworkSyncManager( LoadingWindow *ld )
|
||||
BroadcastReception = NULL;
|
||||
|
||||
ld->SetText( INITIALIZING_CLIENT_NETWORK );
|
||||
NetPlayerClient = smnew EzSockets;
|
||||
NetPlayerClient = new EzSockets;
|
||||
NetPlayerClient->blocking = false;
|
||||
m_ServerVersion = 0;
|
||||
|
||||
@@ -212,7 +212,7 @@ void NetworkSyncManager::StartUp()
|
||||
if( GetCommandlineArgument( "netip", &ServerIP ) )
|
||||
PostStartUp( ServerIP );
|
||||
|
||||
BroadcastReception = smnew EzSockets;
|
||||
BroadcastReception = new EzSockets;
|
||||
BroadcastReception->create( IPPROTO_UDP );
|
||||
BroadcastReception->bind( 8765 );
|
||||
BroadcastReception->blocking = false;
|
||||
@@ -868,7 +868,7 @@ unsigned long NetworkSyncManager::GetCurrentSMBuild( LoadingWindow* ld )
|
||||
|
||||
unsigned long uCurrentSMBuild = version_num;
|
||||
bool bSuccess = false;
|
||||
EzSockets* socket = smnew EzSockets();
|
||||
EzSockets* socket = new EzSockets();
|
||||
socket->create();
|
||||
socket->blocking = true;
|
||||
|
||||
@@ -892,7 +892,7 @@ unsigned long NetworkSyncManager::GetCurrentSMBuild( LoadingWindow* ld )
|
||||
// Aldo: EzSocket::pReadData() is a lower level function, I used it because I was having issues
|
||||
// with EzSocket::ReadData() in 3.9, feel free to refactor this function, the low lever character
|
||||
// manipulation might look scary to people not used to it.
|
||||
char* cBuffer = smnew char[NETMAXBUFFERSIZE];
|
||||
char* cBuffer = new char[NETMAXBUFFERSIZE];
|
||||
// Reading the first NETMAXBUFFERSIZE bytes (usually 1024), should be enough to get the HTTP Header only
|
||||
int iBytes = socket->pReadData(cBuffer);
|
||||
if( iBytes )
|
||||
@@ -903,7 +903,7 @@ unsigned long NetworkSyncManager::GetCurrentSMBuild( LoadingWindow* ld )
|
||||
{
|
||||
// Get the HTTP Header only
|
||||
int iHeaderLength = cBodyStart - cBuffer;
|
||||
char* cHeader = smnew char[iHeaderLength+1];
|
||||
char* cHeader = new char[iHeaderLength+1];
|
||||
strncpy( cHeader, cBuffer, iHeaderLength );
|
||||
cHeader[iHeaderLength] = '\0'; // needed to make it a valid C String
|
||||
|
||||
|
||||
+2
-2
@@ -13,7 +13,7 @@
|
||||
#include "Foreach.h"
|
||||
#include "RageUtil_AutoPtr.h"
|
||||
|
||||
REGISTER_CLASS_TRAITS( NoteData, smnew NoteData(*pCopy) )
|
||||
REGISTER_CLASS_TRAITS( NoteData, new NoteData(*pCopy) )
|
||||
|
||||
void NoteData::Init()
|
||||
{
|
||||
@@ -1156,7 +1156,7 @@ bool NoteData::GetPrevTapNoteRowForAllTracks( int &rowInOut ) const
|
||||
|
||||
XNode* NoteData::CreateNode() const
|
||||
{
|
||||
XNode *p = smnew XNode( "NoteData" );
|
||||
XNode *p = new XNode( "NoteData" );
|
||||
|
||||
all_tracks_const_iterator iter = GetTapNoteRangeAllTracks( 0, GetLastRow() );
|
||||
|
||||
|
||||
+2
-2
@@ -142,7 +142,7 @@ static NoteResource *MakeNoteResource( const RString &sButton, const RString &sE
|
||||
map<NoteSkinAndPath, NoteResource *>::iterator it = g_NoteResource.find( nsap );
|
||||
if( it == g_NoteResource.end() )
|
||||
{
|
||||
NoteResource *pRes = smnew NoteResource( nsap );
|
||||
NoteResource *pRes = new NoteResource( nsap );
|
||||
|
||||
pRes->m_pActor = NOTESKIN->LoadActor( sButton, sElement, NULL, bSpriteOnly );
|
||||
ASSERT( pRes->m_pActor != NULL );
|
||||
@@ -233,7 +233,7 @@ XToString( ActiveType );
|
||||
|
||||
NoteDisplay::NoteDisplay()
|
||||
{
|
||||
cache = smnew NoteMetricCache_t;
|
||||
cache = new NoteMetricCache_t;
|
||||
}
|
||||
|
||||
NoteDisplay::~NoteDisplay()
|
||||
|
||||
+1
-1
@@ -92,7 +92,7 @@ void NoteField::CacheNoteSkin( const RString &sNoteSkin_ )
|
||||
LockNoteSkin l( sNoteSkinLower );
|
||||
|
||||
LOG->Trace("NoteField::CacheNoteSkin: cache %s", sNoteSkinLower.c_str() );
|
||||
NoteDisplayCols *nd = smnew NoteDisplayCols( GAMESTATE->GetCurrentStyle()->m_iColsPerPlayer );
|
||||
NoteDisplayCols *nd = new NoteDisplayCols( GAMESTATE->GetCurrentStyle()->m_iColsPerPlayer );
|
||||
|
||||
for( int c=0; c<GAMESTATE->GetCurrentStyle()->m_iColsPerPlayer; c++ )
|
||||
nd->display[c].Load( c, m_pPlayerState, m_fYReverseOffsetPixels );
|
||||
|
||||
+1
-1
@@ -87,7 +87,7 @@ protected:
|
||||
NoteDisplay *display;
|
||||
ReceptorArrowRow m_ReceptorArrowRow;
|
||||
GhostArrowRow m_GhostArrowRow;
|
||||
NoteDisplayCols( int iNumCols ) { display = smnew NoteDisplay[iNumCols]; }
|
||||
NoteDisplayCols( int iNumCols ) { display = new NoteDisplay[iNumCols]; }
|
||||
~NoteDisplayCols() { delete [] display; }
|
||||
};
|
||||
|
||||
|
||||
@@ -401,14 +401,14 @@ Actor *NoteSkinManager::LoadActor( const RString &sButton, const RString &sEleme
|
||||
if( !PushActorTemplate(L, sButton, sElement, bSpriteOnly) )
|
||||
{
|
||||
// ActorUtil will warn about the error
|
||||
return smnew Actor;
|
||||
return new Actor;
|
||||
}
|
||||
|
||||
auto_ptr<XNode> pNode( XmlFileUtil::XNodeFromTable(L) );
|
||||
if( pNode.get() == NULL )
|
||||
{
|
||||
// XNode will warn about the error
|
||||
return smnew Actor;
|
||||
return new Actor;
|
||||
}
|
||||
|
||||
LUA->Release( L );
|
||||
|
||||
+3
-3
@@ -123,7 +123,7 @@ bool IsNoteOfType( int row, NoteType t )
|
||||
|
||||
XNode* TapNoteResult::CreateNode() const
|
||||
{
|
||||
XNode *p = smnew XNode( "TapNoteResult" );
|
||||
XNode *p = new XNode( "TapNoteResult" );
|
||||
|
||||
p->AppendAttr( "TapNoteScore", TapNoteScoreToString(tns) );
|
||||
p->AppendAttr( "TapNoteOffset", fTapNoteOffset );
|
||||
@@ -139,7 +139,7 @@ void TapNoteResult::LoadFromNode( const XNode* pNode )
|
||||
XNode* HoldNoteResult::CreateNode() const
|
||||
{
|
||||
// XXX: Should this do anything?
|
||||
return smnew XNode( "HoldNoteResult" );
|
||||
return new XNode( "HoldNoteResult" );
|
||||
}
|
||||
|
||||
void HoldNoteResult::LoadFromNode( const XNode* pNode )
|
||||
@@ -149,7 +149,7 @@ void HoldNoteResult::LoadFromNode( const XNode* pNode )
|
||||
|
||||
XNode* TapNote::CreateNode() const
|
||||
{
|
||||
XNode *p = smnew XNode( "TapNote" );
|
||||
XNode *p = new XNode( "TapNote" );
|
||||
|
||||
p->AppendChild( result.CreateNode() );
|
||||
p->AppendChild( HoldResult.CreateNode() );
|
||||
|
||||
@@ -695,9 +695,9 @@ bool BMSChartReader::ReadNoteData()
|
||||
td.SetBPMAtRow( 0, currentBPM = initialBPM );
|
||||
|
||||
// set up note transformation vector.
|
||||
int *transform = smnew int[tracks];
|
||||
int *holdStart = smnew int[tracks];
|
||||
int *lastNote = smnew int[tracks];
|
||||
int *transform = new int[tracks];
|
||||
int *holdStart = new int[tracks];
|
||||
int *lastNote = new int[tracks];
|
||||
|
||||
for( int i = 0; i < tracks; i ++ ) holdStart[i] = -1;
|
||||
for( int i = 0; i < tracks; i ++ ) lastNote[i] = -1;
|
||||
|
||||
@@ -301,7 +301,7 @@ bool SMALoader::LoadFromSimfile( const RString &sPath, Song &out, bool bFromCach
|
||||
else
|
||||
{
|
||||
state = SMA_GETTING_STEP_INFO;
|
||||
pNewNotes = smnew Steps(&out);
|
||||
pNewNotes = new Steps(&out);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+6
-6
@@ -243,7 +243,7 @@ void OptionRow::InitText( RowType type )
|
||||
FOREACH_PlayerNumber( p )
|
||||
m_Underline[p].clear();
|
||||
|
||||
m_textTitle = smnew BitmapText( m_pParentType->m_textTitle );
|
||||
m_textTitle = new BitmapText( m_pParentType->m_textTitle );
|
||||
m_Frame.AddChild( m_textTitle );
|
||||
|
||||
m_sprFrame = m_pParentType->m_sprFrame->Copy();
|
||||
@@ -257,7 +257,7 @@ void OptionRow::InitText( RowType type )
|
||||
case RowType_Normal:
|
||||
FOREACH_PlayerNumber( p )
|
||||
{
|
||||
m_ModIcons[p] = smnew ModIcon( m_pParentType->m_ModIcon );
|
||||
m_ModIcons[p] = new ModIcon( m_pParentType->m_ModIcon );
|
||||
m_ModIcons[p]->SetDrawOrder(-1); // under title
|
||||
m_ModIcons[p]->PlayCommand( "On" );
|
||||
|
||||
@@ -310,7 +310,7 @@ void OptionRow::InitText( RowType type )
|
||||
// init text
|
||||
FOREACH_PlayerNumber( p )
|
||||
{
|
||||
BitmapText *pText = smnew BitmapText( m_pParentType->m_textItem );
|
||||
BitmapText *pText = new BitmapText( m_pParentType->m_textItem );
|
||||
m_textItems.push_back( pText );
|
||||
|
||||
pText->PlayCommand( "On" );
|
||||
@@ -331,7 +331,7 @@ void OptionRow::InitText( RowType type )
|
||||
// init underlines
|
||||
if( m_pParentType->SHOW_UNDERLINES && GetRowType() != OptionRow::RowType_Exit )
|
||||
{
|
||||
OptionsCursor *pCursor = smnew OptionsCursor( m_pParentType->m_Underline[p] );
|
||||
OptionsCursor *pCursor = new OptionsCursor( m_pParentType->m_Underline[p] );
|
||||
m_Underline[p].push_back( pCursor );
|
||||
|
||||
int iWidth, iX, iY;
|
||||
@@ -348,7 +348,7 @@ void OptionRow::InitText( RowType type )
|
||||
for( unsigned c=0; c<m_pHand->m_Def.m_vsChoices.size(); c++ )
|
||||
{
|
||||
// init text
|
||||
BitmapText *bt = smnew BitmapText( m_pParentType->m_textItem );
|
||||
BitmapText *bt = new BitmapText( m_pParentType->m_textItem );
|
||||
m_textItems.push_back( bt );
|
||||
bt->SetBaseZoomX( fBaseZoom );
|
||||
bt->PlayCommand( "On" );
|
||||
@@ -366,7 +366,7 @@ void OptionRow::InitText( RowType type )
|
||||
{
|
||||
FOREACH_PlayerNumber( p )
|
||||
{
|
||||
OptionsCursor *ul = smnew OptionsCursor( m_pParentType->m_Underline[p] );
|
||||
OptionsCursor *ul = new OptionsCursor( m_pParentType->m_Underline[p] );
|
||||
m_Underline[p].push_back( ul );
|
||||
ul->SetX( fX );
|
||||
ul->SetBarWidth( int(fItemWidth) );
|
||||
|
||||
@@ -809,7 +809,7 @@ public:
|
||||
LuaReference *m_pLuaTable;
|
||||
LuaReference m_EnabledForPlayersFunc;
|
||||
|
||||
OptionRowHandlerLua() { m_pLuaTable = smnew LuaReference; Init(); }
|
||||
OptionRowHandlerLua() { m_pLuaTable = new LuaReference; Init(); }
|
||||
virtual ~OptionRowHandlerLua() { delete m_pLuaTable; }
|
||||
void Init()
|
||||
{
|
||||
@@ -1336,7 +1336,7 @@ OptionRowHandler* OptionRowHandlerUtil::Make( const Commands &cmds )
|
||||
|
||||
const RString &name = cmds.v[0].GetName();
|
||||
|
||||
#define MAKE( type ) { type *p = smnew type; p->Load( cmds ); pHand = p; }
|
||||
#define MAKE( type ) { type *p = new type; p->Load( cmds ); pHand = p; }
|
||||
|
||||
// XXX: merge these, and merge "Steps" and "list,Steps"
|
||||
if( name == "list" )
|
||||
|
||||
+9
-9
@@ -246,7 +246,7 @@ Player::Player( NoteData &nd, bool bVisibleParts ) : m_NoteData(nd)
|
||||
m_pAttackDisplay = NULL;
|
||||
if( bVisibleParts )
|
||||
{
|
||||
m_pAttackDisplay = smnew AttackDisplay;
|
||||
m_pAttackDisplay = new AttackDisplay;
|
||||
this->AddChild( m_pAttackDisplay );
|
||||
}
|
||||
|
||||
@@ -255,10 +255,10 @@ Player::Player( NoteData &nd, bool bVisibleParts ) : m_NoteData(nd)
|
||||
m_pNoteField = NULL;
|
||||
if( bVisibleParts )
|
||||
{
|
||||
m_pNoteField = smnew NoteField;
|
||||
m_pNoteField = new NoteField;
|
||||
m_pNoteField->SetName( "NoteField" );
|
||||
}
|
||||
m_pJudgedRows = smnew JudgedRows;
|
||||
m_pJudgedRows = new JudgedRows;
|
||||
|
||||
m_bSendJudgmentAndComboMessages = true;
|
||||
}
|
||||
@@ -517,7 +517,7 @@ void Player::Init(
|
||||
{
|
||||
for( int i = 0; i < GAMESTATE->GetCurrentStyle()->m_iColsPerPlayer; ++i )
|
||||
{
|
||||
HoldJudgment *pJudgment = smnew HoldJudgment;
|
||||
HoldJudgment *pJudgment = new HoldJudgment;
|
||||
// xxx: assumes sprite; todo: don't force 1x2 -aj
|
||||
pJudgment->Load( THEME->GetPathG("HoldJudgment","label 1x2") );
|
||||
m_vpHoldJudgment[i] = pJudgment;
|
||||
@@ -754,19 +754,19 @@ void Player::Load()
|
||||
SendComboMessages( m_pPlayerStageStats->m_iCurCombo, m_pPlayerStageStats->m_iCurMissCombo );
|
||||
|
||||
SAFE_DELETE( m_pIterNeedsTapJudging );
|
||||
m_pIterNeedsTapJudging = smnew NoteData::all_tracks_iterator( m_NoteData.GetTapNoteRangeAllTracks(iNoteRow, MAX_NOTE_ROW) );
|
||||
m_pIterNeedsTapJudging = new NoteData::all_tracks_iterator( m_NoteData.GetTapNoteRangeAllTracks(iNoteRow, MAX_NOTE_ROW) );
|
||||
|
||||
SAFE_DELETE( m_pIterNeedsHoldJudging );
|
||||
m_pIterNeedsHoldJudging = smnew NoteData::all_tracks_iterator( m_NoteData.GetTapNoteRangeAllTracks(iNoteRow, MAX_NOTE_ROW ) );
|
||||
m_pIterNeedsHoldJudging = new NoteData::all_tracks_iterator( m_NoteData.GetTapNoteRangeAllTracks(iNoteRow, MAX_NOTE_ROW ) );
|
||||
|
||||
SAFE_DELETE( m_pIterUncrossedRows );
|
||||
m_pIterUncrossedRows = smnew NoteData::all_tracks_iterator( m_NoteData.GetTapNoteRangeAllTracks(iNoteRow, MAX_NOTE_ROW ) );
|
||||
m_pIterUncrossedRows = new NoteData::all_tracks_iterator( m_NoteData.GetTapNoteRangeAllTracks(iNoteRow, MAX_NOTE_ROW ) );
|
||||
|
||||
SAFE_DELETE( m_pIterUnjudgedRows );
|
||||
m_pIterUnjudgedRows = smnew NoteData::all_tracks_iterator( m_NoteData.GetTapNoteRangeAllTracks(iNoteRow, MAX_NOTE_ROW ) );
|
||||
m_pIterUnjudgedRows = new NoteData::all_tracks_iterator( m_NoteData.GetTapNoteRangeAllTracks(iNoteRow, MAX_NOTE_ROW ) );
|
||||
|
||||
SAFE_DELETE( m_pIterUnjudgedMineRows );
|
||||
m_pIterUnjudgedMineRows = smnew NoteData::all_tracks_iterator( m_NoteData.GetTapNoteRangeAllTracks(iNoteRow, MAX_NOTE_ROW ) );
|
||||
m_pIterUnjudgedMineRows = new NoteData::all_tracks_iterator( m_NoteData.GetTapNoteRangeAllTracks(iNoteRow, MAX_NOTE_ROW ) );
|
||||
}
|
||||
|
||||
void Player::SendComboMessages( int iOldCombo, int iOldMissCombo )
|
||||
|
||||
+1
-1
@@ -234,7 +234,7 @@ class PlayerPlus
|
||||
Player *m_pPlayer;
|
||||
NoteData m_NoteData;
|
||||
public:
|
||||
PlayerPlus() { m_pPlayer = smnew Player(m_NoteData); }
|
||||
PlayerPlus() { m_pPlayer = new Player(m_NoteData); }
|
||||
~PlayerPlus() { delete m_pPlayer; }
|
||||
void Load( const NoteData &nd ) { m_NoteData = nd; m_pPlayer->Load(); }
|
||||
Player *operator->() { return m_pPlayer; }
|
||||
|
||||
+1
-1
@@ -138,7 +138,7 @@ public:
|
||||
RString sName;
|
||||
T defaultValue;
|
||||
pfn( i, sName, defaultValue );
|
||||
m_v.push_back( smnew Preference<T>(sName, defaultValue) );
|
||||
m_v.push_back( new Preference<T>(sName, defaultValue) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+14
-14
@@ -940,7 +940,7 @@ bool Profile::SaveAllToDir( RString sDir, bool bSignData ) const
|
||||
|
||||
XNode *Profile::SaveStatsXmlCreateNode() const
|
||||
{
|
||||
XNode *xml = smnew XNode( "Stats" );
|
||||
XNode *xml = new XNode( "Stats" );
|
||||
|
||||
xml->AppendChild( SaveGeneralDataCreateNode() );
|
||||
xml->AppendChild( SaveSongScoresCreateNode() );
|
||||
@@ -1023,7 +1023,7 @@ void Profile::SaveEditableDataToDir( RString sDir ) const
|
||||
|
||||
XNode* Profile::SaveGeneralDataCreateNode() const
|
||||
{
|
||||
XNode* pGeneralDataNode = smnew XNode( "GeneralData" );
|
||||
XNode* pGeneralDataNode = new XNode( "GeneralData" );
|
||||
|
||||
// TRICKY: These are write-only elements that are normally never read again.
|
||||
// This data is required by other apps (like internet ranking), but is
|
||||
@@ -1384,7 +1384,7 @@ XNode* Profile::SaveSongScoresCreateNode() const
|
||||
const Profile* pProfile = this;
|
||||
ASSERT( pProfile != NULL );
|
||||
|
||||
XNode* pNode = smnew XNode( "SongScores" );
|
||||
XNode* pNode = new XNode( "SongScores" );
|
||||
|
||||
FOREACHM_CONST( SongID, HighScoresForASong, m_SongHighScores, i )
|
||||
{
|
||||
@@ -1465,7 +1465,7 @@ XNode* Profile::SaveCourseScoresCreateNode() const
|
||||
const Profile* pProfile = this;
|
||||
ASSERT( pProfile != NULL );
|
||||
|
||||
XNode* pNode = smnew XNode( "CourseScores" );
|
||||
XNode* pNode = new XNode( "CourseScores" );
|
||||
|
||||
FOREACHM_CONST( CourseID, HighScoresForACourse, m_CourseHighScores, i )
|
||||
{
|
||||
@@ -1573,7 +1573,7 @@ XNode* Profile::SaveCategoryScoresCreateNode() const
|
||||
const Profile* pProfile = this;
|
||||
ASSERT( pProfile != NULL );
|
||||
|
||||
XNode* pNode = smnew XNode( "CategoryScores" );
|
||||
XNode* pNode = new XNode( "CategoryScores" );
|
||||
|
||||
FOREACH_ENUM( StepsType,st )
|
||||
{
|
||||
@@ -1681,7 +1681,7 @@ XNode* Profile::SaveScreenshotDataCreateNode() const
|
||||
const Profile* pProfile = this;
|
||||
ASSERT( pProfile != NULL );
|
||||
|
||||
XNode* pNode = smnew XNode( "ScreenshotData" );
|
||||
XNode* pNode = new XNode( "ScreenshotData" );
|
||||
|
||||
FOREACH_CONST( Screenshot, m_vScreenshots, ss )
|
||||
{
|
||||
@@ -1723,7 +1723,7 @@ XNode* Profile::SaveCalorieDataCreateNode() const
|
||||
const Profile* pProfile = this;
|
||||
ASSERT( pProfile != NULL );
|
||||
|
||||
XNode* pNode = smnew XNode( "CalorieData" );
|
||||
XNode* pNode = new XNode( "CalorieData" );
|
||||
|
||||
FOREACHM_CONST( DateTime, Calories, m_mapDayToCaloriesBurned, i )
|
||||
{
|
||||
@@ -1760,7 +1760,7 @@ static void SaveRecentScore( XNode* xml )
|
||||
|
||||
XNode* Profile::HighScoreForASongAndSteps::CreateNode() const
|
||||
{
|
||||
XNode* pNode = smnew XNode( "HighScoreForASongAndSteps" );
|
||||
XNode* pNode = new XNode( "HighScoreForASongAndSteps" );
|
||||
|
||||
pNode->AppendChild( songID.CreateNode() );
|
||||
pNode->AppendChild( stepsID.CreateNode() );
|
||||
@@ -1780,9 +1780,9 @@ void Profile::SaveStepsRecentScore( const Song* pSong, const Steps* pSteps, High
|
||||
ASSERT( h.stepsID.IsValid() );
|
||||
h.hs = hs;
|
||||
|
||||
auto_ptr<XNode> xml( smnew XNode("Stats") );
|
||||
auto_ptr<XNode> xml( new XNode("Stats") );
|
||||
xml->AppendChild( "MachineGuid", PROFILEMAN->GetMachineProfile()->m_sGuid );
|
||||
XNode *recent = xml->AppendChild( smnew XNode("RecentSongScores") );
|
||||
XNode *recent = xml->AppendChild( new XNode("RecentSongScores") );
|
||||
recent->AppendChild( h.CreateNode() );
|
||||
|
||||
SaveRecentScore( xml.get() );
|
||||
@@ -1791,7 +1791,7 @@ void Profile::SaveStepsRecentScore( const Song* pSong, const Steps* pSteps, High
|
||||
|
||||
XNode* Profile::HighScoreForACourseAndTrail::CreateNode() const
|
||||
{
|
||||
XNode* pNode = smnew XNode( "HighScoreForACourseAndTrail" );
|
||||
XNode* pNode = new XNode( "HighScoreForACourseAndTrail" );
|
||||
|
||||
pNode->AppendChild( courseID.CreateNode() );
|
||||
pNode->AppendChild( trailID.CreateNode() );
|
||||
@@ -1807,9 +1807,9 @@ void Profile::SaveCourseRecentScore( const Course* pCourse, const Trail* pTrail,
|
||||
h.trailID.FromTrail( pTrail );
|
||||
h.hs = hs;
|
||||
|
||||
auto_ptr<XNode> xml( smnew XNode("Stats") );
|
||||
auto_ptr<XNode> xml( new XNode("Stats") );
|
||||
xml->AppendChild( "MachineGuid", PROFILEMAN->GetMachineProfile()->m_sGuid );
|
||||
XNode *recent = xml->AppendChild( smnew XNode("RecentCourseScores") );
|
||||
XNode *recent = xml->AppendChild( new XNode("RecentCourseScores") );
|
||||
recent->AppendChild( h.CreateNode() );
|
||||
SaveRecentScore( xml.get() );
|
||||
}
|
||||
@@ -1846,7 +1846,7 @@ XNode* Profile::SaveCoinDataCreateNode() const
|
||||
const Profile* pProfile = this;
|
||||
ASSERT( pProfile != NULL );
|
||||
|
||||
XNode* pNode = smnew XNode( "CoinData" );
|
||||
XNode* pNode = new XNode( "CoinData" );
|
||||
|
||||
return pNode;
|
||||
}
|
||||
|
||||
@@ -65,9 +65,9 @@ static ThemeMetric<int> NUM_FIXED_PROFILES ( "ProfileManager", "NumFixedProfile
|
||||
|
||||
ProfileManager::ProfileManager()
|
||||
{
|
||||
m_pMachineProfile = smnew Profile;
|
||||
m_pMachineProfile = new Profile;
|
||||
FOREACH_PlayerNumber(pn)
|
||||
m_pMemoryCardProfile[pn] = smnew Profile;
|
||||
m_pMemoryCardProfile[pn] = new Profile;
|
||||
|
||||
// Register with Lua.
|
||||
{
|
||||
@@ -435,7 +435,7 @@ bool ProfileManager::CreateLocalProfile( RString sName, RString &sProfileIDOut )
|
||||
RString sProfileID = ssprintf( "%08d", iProfileNumber );
|
||||
|
||||
// Create the new profile.
|
||||
Profile *pProfile = smnew Profile;
|
||||
Profile *pProfile = new Profile;
|
||||
pProfile->m_sDisplayName = sName;
|
||||
pProfile->m_sCharacterID = CHARMAN->GetRandomCharacter()->m_sCharacterID;
|
||||
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ void RadarValues::Zero()
|
||||
|
||||
XNode* RadarValues::CreateNode( bool bIncludeSimpleValues, bool bIncludeComplexValues ) const
|
||||
{
|
||||
XNode* pNode = smnew XNode( "RadarValues" );
|
||||
XNode* pNode = new XNode( "RadarValues" );
|
||||
|
||||
// TRICKY: Don't print a remainder for the integer values.
|
||||
FOREACH_ENUM( RadarCategory, rc )
|
||||
|
||||
@@ -807,7 +807,7 @@ protected:
|
||||
|
||||
RageCompiledGeometry* RageDisplay_D3D::CreateCompiledGeometry()
|
||||
{
|
||||
return smnew RageCompiledGeometrySWD3D;
|
||||
return new RageCompiledGeometrySWD3D;
|
||||
}
|
||||
|
||||
void RageDisplay_D3D::DeleteCompiledGeometry( RageCompiledGeometry* p )
|
||||
|
||||
@@ -135,7 +135,7 @@ public:
|
||||
|
||||
RageCompiledGeometry* RageDisplay_Null::CreateCompiledGeometry()
|
||||
{
|
||||
return smnew RageCompiledGeometryNull;
|
||||
return new RageCompiledGeometryNull;
|
||||
}
|
||||
|
||||
void RageDisplay_Null::DeleteCompiledGeometry( RageCompiledGeometry* p )
|
||||
|
||||
@@ -273,7 +273,7 @@ RString GetInfoLog( GLhandleARB h )
|
||||
if (!iLength)
|
||||
return RString();
|
||||
|
||||
GLcharARB *pInfoLog = smnew GLcharARB[iLength];
|
||||
GLcharARB *pInfoLog = new GLcharARB[iLength];
|
||||
glGetInfoLogARB( h, iLength, &iLength, pInfoLog );
|
||||
RString sRet = pInfoLog;
|
||||
delete [] pInfoLog;
|
||||
@@ -873,10 +873,10 @@ static void SetupVertices( const RageSpriteVertex v[], int iNumVerts )
|
||||
delete [] Color;
|
||||
delete [] Texture;
|
||||
delete [] Normal;
|
||||
Vertex = smnew float[Size*3];
|
||||
Color = smnew GLubyte[Size*4];
|
||||
Texture = smnew float[Size*2];
|
||||
Normal = smnew float[Size*3];
|
||||
Vertex = new float[Size*3];
|
||||
Color = new GLubyte[Size*4];
|
||||
Texture = new float[Size*2];
|
||||
Normal = new float[Size*3];
|
||||
}
|
||||
|
||||
for( unsigned i = 0; i < unsigned(iNumVerts); ++i )
|
||||
@@ -1380,9 +1380,9 @@ void RageCompiledGeometryHWOGL::Draw( int iMeshIndex ) const
|
||||
RageCompiledGeometry* RageDisplay_Legacy::CreateCompiledGeometry()
|
||||
{
|
||||
if (GLEW_ARB_vertex_buffer_object)
|
||||
return smnew RageCompiledGeometryHWOGL;
|
||||
return new RageCompiledGeometryHWOGL;
|
||||
else
|
||||
return smnew RageCompiledGeometrySWOGL;
|
||||
return new RageCompiledGeometrySWOGL;
|
||||
}
|
||||
|
||||
void RageDisplay_Legacy::DeleteCompiledGeometry( RageCompiledGeometry* p )
|
||||
@@ -2279,7 +2279,7 @@ RageTextureLock *RageDisplay_Legacy::CreateTextureLock()
|
||||
if (!GLEW_ARB_pixel_buffer_object)
|
||||
return NULL;
|
||||
|
||||
return smnew RageTextureLock_OGL;
|
||||
return new RageTextureLock_OGL;
|
||||
}
|
||||
|
||||
void RageDisplay_Legacy::UpdateTexture(
|
||||
@@ -2452,7 +2452,7 @@ unsigned RageDisplay_Legacy::CreateRenderTarget( const RenderTargetParam ¶m,
|
||||
{
|
||||
RenderTarget *pTarget;
|
||||
if (GLEW_EXT_framebuffer_object)
|
||||
pTarget = smnew RenderTarget_FramebufferObject;
|
||||
pTarget = new RenderTarget_FramebufferObject;
|
||||
else
|
||||
pTarget = g_pWind->CreateRenderTarget();
|
||||
|
||||
|
||||
+2
-2
@@ -27,7 +27,7 @@ RageFile::RageFile( const RageFile &cpy ):
|
||||
|
||||
RageFile *RageFile::Copy() const
|
||||
{
|
||||
return smnew RageFile( *this );
|
||||
return new RageFile( *this );
|
||||
}
|
||||
|
||||
RString RageFile::GetPath() const
|
||||
@@ -430,7 +430,7 @@ namespace RageFileUtil
|
||||
{
|
||||
int CreateRageFile( lua_State *L )
|
||||
{
|
||||
RageFile *pFile = smnew RageFile;
|
||||
RageFile *pFile = new RageFile;
|
||||
pFile->PushSelf( L );
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ RageFileObj::RageFileObj( const RageFileObj &cpy ):
|
||||
/* If the original file has a buffer, copy it. */
|
||||
if( cpy.m_pReadBuffer != NULL )
|
||||
{
|
||||
m_pReadBuffer = smnew char[BSIZE];
|
||||
m_pReadBuffer = new char[BSIZE];
|
||||
memcpy( m_pReadBuffer, cpy.m_pReadBuffer, BSIZE );
|
||||
|
||||
int iOffsetIntoBuffer = cpy.m_pReadBuf - cpy.m_pReadBuffer;
|
||||
@@ -40,7 +40,7 @@ RageFileObj::RageFileObj( const RageFileObj &cpy ):
|
||||
|
||||
if( cpy.m_pWriteBuffer != NULL )
|
||||
{
|
||||
m_pWriteBuffer = smnew char[cpy.m_iWriteBufferSize];
|
||||
m_pWriteBuffer = new char[cpy.m_iWriteBufferSize];
|
||||
memcpy( m_pWriteBuffer, cpy.m_pWriteBuffer, m_iWriteBufferUsed );
|
||||
}
|
||||
else
|
||||
@@ -286,14 +286,14 @@ int RageFileObj::Flush()
|
||||
void RageFileObj::EnableReadBuffering()
|
||||
{
|
||||
if( m_pReadBuffer == NULL )
|
||||
m_pReadBuffer = smnew char[BSIZE];
|
||||
m_pReadBuffer = new char[BSIZE];
|
||||
}
|
||||
|
||||
void RageFileObj::EnableWriteBuffering( int iBytes )
|
||||
{
|
||||
if( m_pWriteBuffer == NULL )
|
||||
{
|
||||
m_pWriteBuffer = smnew char[iBytes];
|
||||
m_pWriteBuffer = new char[iBytes];
|
||||
m_iWriteBufferPos = m_iFilePos;
|
||||
m_iWriteBufferSize = iBytes;
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ RageFileObjInflate::RageFileObjInflate( RageFileBasic *pFile, int iUncompressedS
|
||||
m_bFileOwned = false;
|
||||
m_pFile = pFile;
|
||||
decomp_buf_avail = 0;
|
||||
m_pInflate = smnew z_stream;
|
||||
m_pInflate = new z_stream;
|
||||
memset( m_pInflate, 0, sizeof(z_stream) );
|
||||
|
||||
m_iUncompressedSize = iUncompressedSize;
|
||||
@@ -44,7 +44,7 @@ RageFileObjInflate::RageFileObjInflate( const RageFileObjInflate &cpy ):
|
||||
/* Copy the entire decode state. */
|
||||
m_pFile = cpy.m_pFile->Copy();
|
||||
m_bFileOwned = true;
|
||||
m_pInflate = smnew z_stream;
|
||||
m_pInflate = new z_stream;
|
||||
m_iUncompressedSize = cpy.m_iUncompressedSize;
|
||||
m_iFilePos = cpy.m_iFilePos;
|
||||
inflateCopy( m_pInflate, const_cast<z_stream*>(cpy.m_pInflate) );
|
||||
@@ -56,7 +56,7 @@ RageFileObjInflate::RageFileObjInflate( const RageFileObjInflate &cpy ):
|
||||
|
||||
RageFileObjInflate *RageFileObjInflate::Copy() const
|
||||
{
|
||||
return smnew RageFileObjInflate( *this );
|
||||
return new RageFileObjInflate( *this );
|
||||
}
|
||||
|
||||
|
||||
@@ -186,7 +186,7 @@ RageFileObjDeflate::RageFileObjDeflate( RageFileBasic *pFile )
|
||||
m_pFile = pFile;
|
||||
m_bFileOwned = false;
|
||||
|
||||
m_pDeflate = smnew z_stream;
|
||||
m_pDeflate = new z_stream;
|
||||
memset( m_pDeflate, 0, sizeof(z_stream) );
|
||||
|
||||
int err = deflateInit2( m_pDeflate,
|
||||
@@ -408,9 +408,9 @@ RageFileObjInflate *GunzipFile( RageFileBasic *pFile_, RString &sError, uint32_t
|
||||
if( sError != "" )
|
||||
return NULL;
|
||||
|
||||
RageFileDriverSlice *pSliceFile = smnew RageFileDriverSlice( pFile.release(), iDataPos, iFooterPos-iDataPos );
|
||||
RageFileDriverSlice *pSliceFile = new RageFileDriverSlice( pFile.release(), iDataPos, iFooterPos-iDataPos );
|
||||
pSliceFile->DeleteFileWhenFinished();
|
||||
RageFileObjInflate *pInflateFile = smnew RageFileObjInflate( pSliceFile, iUncompressedSize );
|
||||
RageFileObjInflate *pInflateFile = new RageFileObjInflate( pSliceFile, iUncompressedSize );
|
||||
pInflateFile->DeleteFileWhenFinished();
|
||||
|
||||
/* Enable CRC calculation only if the caller is interested. */
|
||||
@@ -517,7 +517,7 @@ void GzipString( const RString &sIn, RString &sOut )
|
||||
|
||||
bool GunzipString( const RString &sIn, RString &sOut, RString &sError )
|
||||
{
|
||||
RageFileObjMem *mem = smnew RageFileObjMem;
|
||||
RageFileObjMem *mem = new RageFileObjMem;
|
||||
mem->PutString( sIn );
|
||||
|
||||
uint32_t iCRC32;
|
||||
|
||||
@@ -24,18 +24,18 @@
|
||||
static struct FileDriverEntry_DIR: public FileDriverEntry
|
||||
{
|
||||
FileDriverEntry_DIR(): FileDriverEntry( "DIR" ) { }
|
||||
RageFileDriver *Create( const RString &sRoot ) const { return smnew RageFileDriverDirect( sRoot ); }
|
||||
RageFileDriver *Create( const RString &sRoot ) const { return new RageFileDriverDirect( sRoot ); }
|
||||
} const g_RegisterDriver;
|
||||
|
||||
/* Direct read-only filesystem access: */
|
||||
static struct FileDriverEntry_DIRRO: public FileDriverEntry
|
||||
{
|
||||
FileDriverEntry_DIRRO(): FileDriverEntry( "DIRRO" ) { }
|
||||
RageFileDriver *Create( const RString &sRoot ) const { return smnew RageFileDriverDirectReadOnly( sRoot ); }
|
||||
RageFileDriver *Create( const RString &sRoot ) const { return new RageFileDriverDirectReadOnly( sRoot ); }
|
||||
} const g_RegisterDriver2;
|
||||
|
||||
RageFileDriverDirect::RageFileDriverDirect( const RString &sRoot ):
|
||||
RageFileDriver( smnew DirectFilenameDB(sRoot) )
|
||||
RageFileDriver( new DirectFilenameDB(sRoot) )
|
||||
{
|
||||
Remount( sRoot );
|
||||
}
|
||||
@@ -89,7 +89,7 @@ static RageFileObjDirect *MakeFileObjDirect( RString sPath, int iMode, int &iErr
|
||||
}
|
||||
#endif
|
||||
|
||||
return smnew RageFileObjDirect( sPath, iFD, iMode );
|
||||
return new RageFileObjDirect( sPath, iFD, iMode );
|
||||
}
|
||||
|
||||
RageFileBasic *RageFileDriverDirect::Open( const RString &sPath_, int iMode, int &iError )
|
||||
|
||||
@@ -37,7 +37,7 @@ struct RageFileObjMemFile
|
||||
RageFileObjMem::RageFileObjMem( RageFileObjMemFile *pFile )
|
||||
{
|
||||
if( pFile == NULL )
|
||||
pFile = smnew RageFileObjMemFile;
|
||||
pFile = new RageFileObjMemFile;
|
||||
|
||||
m_pFile = pFile;
|
||||
m_iFilePos = 0;
|
||||
@@ -95,7 +95,7 @@ RageFileObjMem::RageFileObjMem( const RageFileObjMem &cpy ):
|
||||
|
||||
RageFileObjMem *RageFileObjMem::Copy() const
|
||||
{
|
||||
RageFileObjMem *pRet = smnew RageFileObjMem( *this );
|
||||
RageFileObjMem *pRet = new RageFileObjMem( *this );
|
||||
return pRet;
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ void RageFileObjMem::PutString( const RString &sBuf )
|
||||
}
|
||||
|
||||
RageFileDriverMem::RageFileDriverMem():
|
||||
RageFileDriver( smnew NullFilenameDB ),
|
||||
RageFileDriver( new NullFilenameDB ),
|
||||
m_Mutex("RageFileDriverMem")
|
||||
{
|
||||
}
|
||||
@@ -135,7 +135,7 @@ RageFileBasic *RageFileDriverMem::Open( const RString &sPath, int mode, int &err
|
||||
/* If the file exists, delete it. */
|
||||
Remove( sPath );
|
||||
|
||||
RageFileObjMemFile *pFile = smnew RageFileObjMemFile;
|
||||
RageFileObjMemFile *pFile = new RageFileObjMemFile;
|
||||
|
||||
/* Add one reference, representing the file in the filesystem. */
|
||||
RageFileObjMemFile::AddReference( pFile );
|
||||
@@ -143,7 +143,7 @@ RageFileBasic *RageFileDriverMem::Open( const RString &sPath, int mode, int &err
|
||||
m_Files.push_back( pFile );
|
||||
FDB->AddFile( sPath, 0, 0, pFile );
|
||||
|
||||
return smnew RageFileObjMem( pFile );
|
||||
return new RageFileObjMem( pFile );
|
||||
}
|
||||
|
||||
RageFileObjMemFile *pFile = (RageFileObjMemFile *) FDB->GetFilePriv( sPath );
|
||||
@@ -153,7 +153,7 @@ RageFileBasic *RageFileDriverMem::Open( const RString &sPath, int mode, int &err
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return smnew RageFileObjMem( pFile );
|
||||
return new RageFileObjMem( pFile );
|
||||
}
|
||||
|
||||
bool RageFileDriverMem::Remove( const RString &sPath )
|
||||
@@ -178,7 +178,7 @@ bool RageFileDriverMem::Remove( const RString &sPath )
|
||||
static struct FileDriverEntry_MEM: public FileDriverEntry
|
||||
{
|
||||
FileDriverEntry_MEM(): FileDriverEntry( "MEM" ) { }
|
||||
RageFileDriver *Create( const RString &sRoot ) const { return smnew RageFileDriverMem(); }
|
||||
RageFileDriver *Create( const RString &sRoot ) const { return new RageFileDriverMem(); }
|
||||
} const g_RegisterDriver;
|
||||
|
||||
/*
|
||||
|
||||
@@ -90,7 +90,7 @@ RageFileDriverReadAhead::~RageFileDriverReadAhead()
|
||||
|
||||
RageFileDriverReadAhead *RageFileDriverReadAhead::Copy() const
|
||||
{
|
||||
RageFileDriverReadAhead *pRet = smnew RageFileDriverReadAhead( *this );
|
||||
RageFileDriverReadAhead *pRet = new RageFileDriverReadAhead( *this );
|
||||
return pRet;
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ RageFileDriverSlice::~RageFileDriverSlice()
|
||||
|
||||
RageFileDriverSlice *RageFileDriverSlice::Copy() const
|
||||
{
|
||||
RageFileDriverSlice *pRet = smnew RageFileDriverSlice( *this );
|
||||
RageFileDriverSlice *pRet = new RageFileDriverSlice( *this );
|
||||
return pRet;
|
||||
}
|
||||
|
||||
|
||||
@@ -461,7 +461,7 @@ int ThreadedFileWorker::Read( RageFileBasic *&pFile, void *pBuf, int iSize, RStr
|
||||
|
||||
m_pRequestFile = pFile;
|
||||
m_iRequestSize = iSize;
|
||||
m_pResultBuffer = smnew char[iSize];
|
||||
m_pResultBuffer = new char[iSize];
|
||||
|
||||
if( !DoRequest(REQ_READ) )
|
||||
{
|
||||
@@ -503,7 +503,7 @@ int ThreadedFileWorker::Write( RageFileBasic *&pFile, const void *pBuf, int iSiz
|
||||
|
||||
m_pRequestFile = pFile;
|
||||
m_iRequestSize = iSize;
|
||||
m_pRequestBuffer = smnew char[iSize];
|
||||
m_pRequestBuffer = new char[iSize];
|
||||
memcpy( m_pRequestBuffer, pBuf, iSize );
|
||||
|
||||
if( !DoRequest(REQ_WRITE) )
|
||||
@@ -756,7 +756,7 @@ public:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return smnew RageFileObjTimeout( m_pWorker, pCopy, m_iFileSize, m_iMode );
|
||||
return new RageFileObjTimeout( m_pWorker, pCopy, m_iFileSize, m_iMode );
|
||||
}
|
||||
|
||||
protected:
|
||||
@@ -868,9 +868,9 @@ private:
|
||||
};
|
||||
|
||||
RageFileDriverTimeout::RageFileDriverTimeout( const RString &sPath ):
|
||||
RageFileDriver( smnew TimedFilenameDB() )
|
||||
RageFileDriver( new TimedFilenameDB() )
|
||||
{
|
||||
m_pWorker = smnew ThreadedFileWorker( sPath );
|
||||
m_pWorker = new ThreadedFileWorker( sPath );
|
||||
|
||||
((TimedFilenameDB *) FDB)->SetWorker( m_pWorker );
|
||||
}
|
||||
@@ -896,7 +896,7 @@ RageFileBasic *RageFileDriverTimeout::Open( const RString &sPath, int iMode, int
|
||||
}
|
||||
}
|
||||
|
||||
return smnew RageFileObjTimeout( m_pWorker, pChildFile, iSize, iMode );
|
||||
return new RageFileObjTimeout( m_pWorker, pChildFile, iSize, iMode );
|
||||
}
|
||||
|
||||
void RageFileDriverTimeout::FlushDirCache( const RString &sPath )
|
||||
@@ -937,7 +937,7 @@ RageFileDriverTimeout::~RageFileDriverTimeout()
|
||||
static struct FileDriverEntry_Timeout: public FileDriverEntry
|
||||
{
|
||||
FileDriverEntry_Timeout(): FileDriverEntry( "TIMEOUT" ) { }
|
||||
RageFileDriver *Create( const RString &sRoot ) const { return smnew RageFileDriverTimeout( sRoot ); }
|
||||
RageFileDriver *Create( const RString &sRoot ) const { return new RageFileDriverTimeout( sRoot ); }
|
||||
} const g_RegisterDriver;
|
||||
|
||||
/*
|
||||
|
||||
@@ -15,12 +15,12 @@
|
||||
static struct FileDriverEntry_ZIP: public FileDriverEntry
|
||||
{
|
||||
FileDriverEntry_ZIP(): FileDriverEntry( "ZIP" ) { }
|
||||
RageFileDriver *Create( const RString &sRoot ) const { return smnew RageFileDriverZip( sRoot ); }
|
||||
RageFileDriver *Create( const RString &sRoot ) const { return new RageFileDriverZip( sRoot ); }
|
||||
} const g_RegisterDriver;
|
||||
|
||||
|
||||
RageFileDriverZip::RageFileDriverZip():
|
||||
RageFileDriver( smnew NullFilenameDB ),
|
||||
RageFileDriver( new NullFilenameDB ),
|
||||
m_Mutex( "RageFileDriverZip" )
|
||||
{
|
||||
m_bFileOwned = false;
|
||||
@@ -28,7 +28,7 @@ RageFileDriverZip::RageFileDriverZip():
|
||||
}
|
||||
|
||||
RageFileDriverZip::RageFileDriverZip( const RString &sPath ):
|
||||
RageFileDriver( smnew NullFilenameDB ),
|
||||
RageFileDriver( new NullFilenameDB ),
|
||||
m_Mutex( "RageFileDriverZip" )
|
||||
{
|
||||
m_bFileOwned = false;
|
||||
@@ -44,7 +44,7 @@ bool RageFileDriverZip::Load( const RString &sPath )
|
||||
m_sPath = sPath;
|
||||
m_Mutex.SetName( ssprintf("RageFileDriverZip(%s)", sPath.c_str()) );
|
||||
|
||||
RageFile *pFile = smnew RageFile;
|
||||
RageFile *pFile = new RageFile;
|
||||
|
||||
if( !pFile->Open(sPath) )
|
||||
{
|
||||
@@ -154,7 +154,7 @@ bool RageFileDriverZip::ParseZipfile()
|
||||
if( got == 0 ) /* skip */
|
||||
continue;
|
||||
|
||||
FileInfo *pInfo = smnew FileInfo( info );
|
||||
FileInfo *pInfo = new FileInfo( info );
|
||||
m_pFiles.push_back( pInfo );
|
||||
FDB->AddFile( "/" + pInfo->m_sName, pInfo->m_iUncompressedSize, pInfo->m_iCRC32, pInfo );
|
||||
}
|
||||
@@ -322,7 +322,7 @@ RageFileBasic *RageFileDriverZip::Open( const RString &sPath, int iMode, int &iE
|
||||
* threadsafe), so we can unlock now. */
|
||||
m_Mutex.Unlock();
|
||||
|
||||
RageFileDriverSlice *pSlice = smnew RageFileDriverSlice( m_pZip->Copy(), info->m_iDataOffset, info->m_iCompressedSize );
|
||||
RageFileDriverSlice *pSlice = new RageFileDriverSlice( m_pZip->Copy(), info->m_iDataOffset, info->m_iCompressedSize );
|
||||
pSlice->DeleteFileWhenFinished();
|
||||
|
||||
switch( info->m_iCompressionMethod )
|
||||
@@ -331,7 +331,7 @@ RageFileBasic *RageFileDriverZip::Open( const RString &sPath, int iMode, int &iE
|
||||
return pSlice;
|
||||
case DEFLATED:
|
||||
{
|
||||
RageFileObjInflate *pInflate = smnew RageFileObjInflate( pSlice, info->m_iUncompressedSize );
|
||||
RageFileObjInflate *pInflate = new RageFileObjInflate( pSlice, info->m_iUncompressedSize );
|
||||
pInflate->DeleteFileWhenFinished();
|
||||
return pInflate;
|
||||
}
|
||||
|
||||
@@ -150,7 +150,7 @@ static bool GrabDriver( RageFileDriver *pDriver )
|
||||
class RageFileDriverMountpoints: public RageFileDriver
|
||||
{
|
||||
public:
|
||||
RageFileDriverMountpoints(): RageFileDriver( smnew FilenameDB ) { }
|
||||
RageFileDriverMountpoints(): RageFileDriver( new FilenameDB ) { }
|
||||
RageFileBasic *Open( const RString &sPath, int iMode, int &iError )
|
||||
{
|
||||
iError = (iMode == RageFile::WRITE)? ERROR_WRITING_NOT_SUPPORTED:ENOENT;
|
||||
@@ -264,10 +264,10 @@ RageFileManager::RageFileManager( const RString &argv0 )
|
||||
CHECKPOINT_M( argv0 );
|
||||
ChangeToDirOfExecutable( argv0 );
|
||||
|
||||
g_Mutex = smnew RageEvent("RageFileManager");
|
||||
g_Mutex = new RageEvent("RageFileManager");
|
||||
|
||||
g_Mountpoints = smnew RageFileDriverMountpoints;
|
||||
LoadedDriver *pLoadedDriver = smnew LoadedDriver;
|
||||
g_Mountpoints = new RageFileDriverMountpoints;
|
||||
LoadedDriver *pLoadedDriver = new LoadedDriver;
|
||||
pLoadedDriver->m_pDriver = g_Mountpoints;
|
||||
pLoadedDriver->m_sMountPoint = "/";
|
||||
pLoadedDriver->m_sType = "mountpoints";
|
||||
@@ -515,7 +515,7 @@ bool RageFileManager::Mount( const RString &sType, const RString &sRoot_, const
|
||||
|
||||
CHECKPOINT;
|
||||
|
||||
LoadedDriver *pLoadedDriver = smnew LoadedDriver;
|
||||
LoadedDriver *pLoadedDriver = new LoadedDriver;
|
||||
pLoadedDriver->m_pDriver = pDriver;
|
||||
pLoadedDriver->m_sType = sType;
|
||||
pLoadedDriver->m_sRoot = sRoot;
|
||||
@@ -532,7 +532,7 @@ void RageFileManager::Mount( RageFileDriver *pDriver, const RString &sMountPoint
|
||||
|
||||
AdjustMountpoint( sMountPoint );
|
||||
|
||||
LoadedDriver *pLoadedDriver = smnew LoadedDriver;
|
||||
LoadedDriver *pLoadedDriver = new LoadedDriver;
|
||||
pLoadedDriver->m_pDriver = pDriver;
|
||||
pLoadedDriver->m_sType = "";
|
||||
pLoadedDriver->m_sRoot = "";
|
||||
|
||||
@@ -129,7 +129,7 @@ void RageFileManagerReadAhead::ReadAhead( RageFileBasic *pFile, int iBytes )
|
||||
|
||||
int iStart = lseek( iFD, 0, SEEK_CUR );
|
||||
|
||||
RageFileReadAheadThread *pReadAhead = smnew RageFileReadAheadThread( iFD, iStart, iBytes );
|
||||
RageFileReadAheadThread *pReadAhead = new RageFileReadAheadThread( iFD, iStart, iBytes );
|
||||
g_apReadAheads.push_back( pReadAhead );
|
||||
|
||||
for( size_t i = 0; i < g_apReadAheads.size(); ++i )
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user