From 95e765703941c262a75c82c1f58bdab6fb01c6e1 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sun, 27 May 2007 07:25:33 +0000 Subject: [PATCH] unused param and code path --- stepmania/src/ActorUtil.cpp | 52 ++++--------------------------------- stepmania/src/ActorUtil.h | 2 +- 2 files changed, 6 insertions(+), 48 deletions(-) diff --git a/stepmania/src/ActorUtil.cpp b/stepmania/src/ActorUtil.cpp index 00d59d354e..89f9186949 100644 --- a/stepmania/src/ActorUtil.cpp +++ b/stepmania/src/ActorUtil.cpp @@ -160,43 +160,6 @@ Actor* ActorUtil::LoadFromNode( const XNode* pNode, Actor *pParentActor ) return pReturn; } -/* - * Merge commands from a parent into a child. For example, - * - * parent.xml: - * child.xml: - * - * results in: - * - * - * - * Warn about duplicate commands. - */ -static void MergeActorXML( XNode *pChild, const XNode *pParent ) -{ - FOREACH_CONST_Child( pParent, p ) - pChild->AppendChild( new XNode(*p) ); - - FOREACH_CONST_Attr( pParent, p ) - { - const RString &sName = p->first; - if( !EndsWith(sName, "Command") ) - continue; - - if( pChild->GetAttr(p->first) != NULL ) - { - RString sWarning = - ssprintf( "%s: overriding \"%s\" in %s node \"%s\"", - ActorUtil::GetWhere(pParent).c_str(), - sName.c_str(), - ActorUtil::GetWhere(pChild).c_str(), - pParent->GetName().c_str() ); - Dialog::OK( sWarning, "XML_ATTRIB_OVERRIDE" ); - } - pChild->AppendAttrFrom( p->first, p->second->Copy() ); - } -} - namespace { XNode *LoadXNodeFromLuaShowErrors( const RString &sFile ) @@ -263,12 +226,8 @@ bool ActorUtil::LoadTableFromStackShowErrors( Lua *L ) * If pParent is non-NULL, it's the parent node when nesting XML, which is * used only by ActorUtil::LoadFromNode. */ -Actor* ActorUtil::MakeActor( const RString &sPath_, Actor *pParentActor, const XNode *pParent ) +Actor* ActorUtil::MakeActor( const RString &sPath_, Actor *pParentActor ) { - static const XNode dummy; - if( pParent == NULL ) - pParent = &dummy; - RString sPath( sPath_ ); FileType ft = GetFileType( sPath ); @@ -286,13 +245,12 @@ Actor* ActorUtil::MakeActor( const RString &sPath_, Actor *pParentActor, const X return new Actor; } - MergeActorXML( pNode.get(), pParent ); Actor *pRet = ActorUtil::LoadFromNode( pNode.get(), pParentActor ); return pRet; } case FT_Directory: { - XNode xml( *pParent ); + XNode xml; xml.AppendAttr( "AniDir", sPath ); return ActorUtil::Create( "BGAnimation", &xml, pParentActor ); @@ -300,14 +258,14 @@ Actor* ActorUtil::MakeActor( const RString &sPath_, Actor *pParentActor, const X case FT_Bitmap: case FT_Movie: { - XNode xml( *pParent ); + XNode xml; xml.AppendAttr( "Texture", sPath ); return ActorUtil::Create( "Sprite", &xml, pParentActor ); } case FT_Model: { - XNode xml( *pParent ); + XNode xml; xml.AppendAttr( "Meshes", sPath ); xml.AppendAttr( "Materials", sPath ); xml.AppendAttr( "Bones", sPath ); @@ -318,7 +276,7 @@ Actor* ActorUtil::MakeActor( const RString &sPath_, Actor *pParentActor, const X { LOG->Warn( "File \"%s\" has unknown type, \"%s\".", sPath.c_str(), FileTypeToString(ft).c_str() ); - XNode xml( *pParent ); + XNode xml; return ActorUtil::Create( "Actor", &xml, pParentActor ); } } diff --git a/stepmania/src/ActorUtil.h b/stepmania/src/ActorUtil.h index 3d1c5dfcaa..bd4e82eb46 100644 --- a/stepmania/src/ActorUtil.h +++ b/stepmania/src/ActorUtil.h @@ -104,7 +104,7 @@ namespace ActorUtil // Return a Sprite, BitmapText, or Model depending on the file type Actor* LoadFromNode( const XNode* pNode, Actor *pParentActor = NULL ); - Actor* MakeActor( const RString &sPath, Actor *pParentActor = NULL, const XNode *pParent = NULL ); + Actor* MakeActor( const RString &sPath, Actor *pParentActor = NULL ); RString GetSourcePath( const XNode *pNode ); RString GetWhere( const XNode *pNode ); bool GetAttrPath( const XNode *pNode, const RString &sName, RString &sOut );