Browse Source

- Minor renaming of the preprocessor definition for the asset-scope token.

MelvMay-GG 12 years ago
parent
commit
f784d57

+ 5 - 2
engine/source/assets/assetFieldTypes.h

@@ -34,8 +34,11 @@ DefineConsoleType( TypeAssetLooseFilePath )
 
 //-----------------------------------------------------------------------------
 
-#define ASSET_ASSIGNMENT_SEPARATOR      "="
-#define ASSET_SCOPE_SEPARATOR           ":"
+/// Asset scope.
+#define ASSET_SCOPE_TOKEN				":"
+
+/// Asset assignment.
+#define ASSET_ASSIGNMENT_TOKEN			"="
 
 /// Asset Id.
 #define ASSET_ID_SIGNATURE              "@asset"

+ 9 - 9
engine/source/assets/assetManager.cc

@@ -703,7 +703,7 @@ bool AssetManager::isReferencedAsset( const char* pAssetId )
     StringTableEntry assetId = StringTable->insert( pAssetId );
 
     // Is asset Id the correct format?
-    if ( StringUnit::getUnitCount( assetId, ASSET_SCOPE_SEPARATOR ) != 2 )
+    if ( StringUnit::getUnitCount( assetId, ASSET_SCOPE_TOKEN ) != 2 )
     {
         // No, so warn.
         Con::warnf( "Asset Manager: Cannot check if asset Id '%s' is referenced as it is not the correct format.", assetId );
@@ -729,7 +729,7 @@ bool AssetManager::renameDeclaredAsset( const char* pAssetIdFrom, const char* pA
     StringTableEntry assetIdTo   = StringTable->insert( pAssetIdTo );
 
     // Is asset Id from the correct format?
-    if ( StringUnit::getUnitCount( assetIdFrom, ASSET_SCOPE_SEPARATOR ) != 2 )
+    if ( StringUnit::getUnitCount( assetIdFrom, ASSET_SCOPE_TOKEN ) != 2 )
     {
         // No, so warn.
         Con::warnf("Asset Manager: Cannot rename declared asset Id '%s' to asset Id '%s' as source asset Id is not the correct format.", assetIdFrom, assetIdTo );
@@ -737,7 +737,7 @@ bool AssetManager::renameDeclaredAsset( const char* pAssetIdFrom, const char* pA
     }
 
     // Is asset Id to the correct format?
-    if ( StringUnit::getUnitCount( assetIdTo, ASSET_SCOPE_SEPARATOR ) != 2 )
+    if ( StringUnit::getUnitCount( assetIdTo, ASSET_SCOPE_TOKEN ) != 2 )
     {
         // No, so warn.
         Con::warnf("Asset Manager: Cannot rename declared asset Id '%s' to asset Id '%s' as target asset Id is not the correct format.", assetIdFrom, assetIdTo );
@@ -761,8 +761,8 @@ bool AssetManager::renameDeclaredAsset( const char* pAssetIdFrom, const char* pA
     }
 
     // Split module Ids from asset Ids.
-    StringTableEntry moduleIdFrom = StringTable->insert( StringUnit::getUnit( assetIdFrom, 0, ASSET_SCOPE_SEPARATOR ) );
-    StringTableEntry moduleIdTo   = StringTable->insert( StringUnit::getUnit( assetIdTo, 0, ASSET_SCOPE_SEPARATOR ) );
+    StringTableEntry moduleIdFrom = StringTable->insert( StringUnit::getUnit( assetIdFrom, 0, ASSET_SCOPE_TOKEN ) );
+    StringTableEntry moduleIdTo   = StringTable->insert( StringUnit::getUnit( assetIdTo, 0, ASSET_SCOPE_TOKEN ) );
 
     // Are the module Ids the same?
     if ( moduleIdFrom != moduleIdTo )
@@ -805,7 +805,7 @@ bool AssetManager::renameDeclaredAsset( const char* pAssetIdFrom, const char* pA
 
     // Update asset definition.
     pAssetDefinition->mAssetId = assetIdTo;
-    pAssetDefinition->mAssetName = StringTable->insert( StringUnit::getUnit( assetIdTo, 1, ASSET_SCOPE_SEPARATOR ) );
+    pAssetDefinition->mAssetName = StringTable->insert( StringUnit::getUnit( assetIdTo, 1, ASSET_SCOPE_TOKEN ) );
 
     // Reinsert declared asset.
     mDeclaredAssets.erase( assetIdFrom );
@@ -850,7 +850,7 @@ bool AssetManager::renameReferencedAsset( const char* pAssetIdFrom, const char*
     StringTableEntry assetIdTo   = StringTable->insert( pAssetIdTo );
 
     // Is asset Id from the correct format?
-    if ( StringUnit::getUnitCount( assetIdFrom, ASSET_SCOPE_SEPARATOR ) != 2 )
+    if ( StringUnit::getUnitCount( assetIdFrom, ASSET_SCOPE_TOKEN ) != 2 )
     {
         // No, so warn.
         Con::warnf("Asset Manager: Cannot rename referenced asset Id '%s' to asset Id '%s' as source asset Id is not the correct format.", assetIdFrom, assetIdTo );
@@ -858,7 +858,7 @@ bool AssetManager::renameReferencedAsset( const char* pAssetIdFrom, const char*
     }
 
     // Is asset Id to the correct format?
-    if ( StringUnit::getUnitCount( assetIdTo, ASSET_SCOPE_SEPARATOR ) != 2 )
+    if ( StringUnit::getUnitCount( assetIdTo, ASSET_SCOPE_TOKEN ) != 2 )
     {
         // No, so warn.
         Con::warnf("Asset Manager: Cannot rename referenced asset Id '%s' to asset Id '%s' as target asset Id is not the correct format.", assetIdFrom, assetIdTo );
@@ -2556,7 +2556,7 @@ bool AssetManager::scanDeclaredAssets( const char* pPath, const char* pExtension
         char assetIdBuffer[1024];
         dSprintf(assetIdBuffer, sizeof(assetIdBuffer), "%s%s%s",
             pModuleDefinition->getModuleId(),
-            ASSET_SCOPE_SEPARATOR,
+            ASSET_SCOPE_TOKEN,
             foundAssetDefinition.mAssetName );
 
         // Set asset Id.

+ 4 - 4
engine/source/assets/tamlAssetDeclaredUpdateVisitor.h

@@ -112,7 +112,7 @@ public:
         mAssetNameFrom = StringTable->EmptyString;
 
         // Is asset Id the correct format?
-        if ( StringUnit::getUnitCount( pAssetIdFrom, ASSET_SCOPE_SEPARATOR ) != 2 )
+        if ( StringUnit::getUnitCount( pAssetIdFrom, ASSET_SCOPE_TOKEN ) != 2 )
         {
             // No, so warn.
             Con::warnf( "TamlAssetDeclaredUpdateVisitor::setAssetIdFrom() - Cannot use asset Id '%s' as it is not the correct format.", pAssetIdFrom );
@@ -121,7 +121,7 @@ public:
 
         // Set asset Id.
         mAssetIdFrom = StringTable->insert( pAssetIdFrom );
-        mAssetNameFrom = StringTable->insert( StringUnit::getUnit( pAssetIdFrom, 1, ASSET_SCOPE_SEPARATOR ) );
+        mAssetNameFrom = StringTable->insert( StringUnit::getUnit( pAssetIdFrom, 1, ASSET_SCOPE_TOKEN ) );
     }
     StringTableEntry getAssetIdFrom( void ) const { return mAssetIdFrom; }
 
@@ -135,7 +135,7 @@ public:
         mAssetNameTo = StringTable->EmptyString;
 
         // Is asset Id the correct format?
-        if ( StringUnit::getUnitCount( pAssetIdTo, ASSET_SCOPE_SEPARATOR ) != 2 )
+        if ( StringUnit::getUnitCount( pAssetIdTo, ASSET_SCOPE_TOKEN ) != 2 )
         {
             // No, so warn.
             Con::warnf( "TamlAssetDeclaredUpdateVisitor::setAssetIdTo() - Cannot use asset Id '%s' as it is not the correct format.", pAssetIdTo );
@@ -144,7 +144,7 @@ public:
 
         // Set asset Id.
         mAssetIdTo = StringTable->insert( pAssetIdTo );
-        mAssetNameTo = StringTable->insert( StringUnit::getUnit( pAssetIdTo, 1, ASSET_SCOPE_SEPARATOR ) );
+        mAssetNameTo = StringTable->insert( StringUnit::getUnit( pAssetIdTo, 1, ASSET_SCOPE_TOKEN ) );
     }
     const char* getAssetIdTo( void ) const { return mAssetIdTo; }
 

+ 4 - 4
engine/source/assets/tamlAssetDeclaredVisitor.h

@@ -137,20 +137,20 @@ protected:
         const char* pAssetReference = pAttribute->Value();
 
         // Fetch field word count.
-        const U32 fieldWordCount = StringUnit::getUnitCount( pAssetReference, ASSET_ASSIGNMENT_SEPARATOR );
+        const U32 fieldWordCount = StringUnit::getUnitCount( pAssetReference, ASSET_ASSIGNMENT_TOKEN );
 
         // Finish if there are not two words.
         if ( fieldWordCount != 2 )
             return true;
 
         // Fetch the asset signature.
-        StringTableEntry assetSignature = StringTable->insert( StringUnit::getUnit( pAssetReference, 0, ASSET_ASSIGNMENT_SEPARATOR ) );
+        StringTableEntry assetSignature = StringTable->insert( StringUnit::getUnit( pAssetReference, 0, ASSET_ASSIGNMENT_TOKEN ) );
 
         // Is this an asset Id signature?
         if ( assetSignature == StringTable->insert(ASSET_ID_SIGNATURE) )
         {
             // Yes, so get asset Id.
-            typeAssetId assetId = StringTable->insert( StringUnit::getUnit( pAssetReference, 1, ASSET_ASSIGNMENT_SEPARATOR ) );
+            typeAssetId assetId = StringTable->insert( StringUnit::getUnit( pAssetReference, 1, ASSET_ASSIGNMENT_TOKEN ) );
 
             // Finish if the dependency is itself!
             if ( mAssetDefinition.mAssetId == assetId )
@@ -171,7 +171,7 @@ protected:
         else if ( assetSignature == StringTable->insert(ASSET_LOOSEFILE_SIGNATURE) )
         {
             // Yes, so get loose-file reference.
-            const char* pAssetLooseFile = StringUnit::getUnit( pAssetReference, 1, ASSET_ASSIGNMENT_SEPARATOR );
+            const char* pAssetLooseFile = StringUnit::getUnit( pAssetReference, 1, ASSET_ASSIGNMENT_TOKEN );
 
             char assetFilePathBuffer[1024];
 

+ 4 - 4
engine/source/assets/tamlAssetReferencedUpdateVisitor.h

@@ -58,18 +58,18 @@ protected:
         const char* pAttributeValue = pAttribute->Value();
 
         // Fetch attribute value word count.
-        const U32 valueWordCount = StringUnit::getUnitCount( pAttributeValue, ASSET_ASSIGNMENT_SEPARATOR );
+        const U32 valueWordCount = StringUnit::getUnitCount( pAttributeValue, ASSET_ASSIGNMENT_TOKEN );
 
         // Finish if not two words.
         if ( valueWordCount != 2 )
             return true;
 
         // Skip if this is not an asset signature.
-        if ( dStricmp( StringUnit::getUnit( pAttributeValue, 0, ASSET_ASSIGNMENT_SEPARATOR), ASSET_ID_SIGNATURE ) != 0 )
+        if ( dStricmp( StringUnit::getUnit( pAttributeValue, 0, ASSET_ASSIGNMENT_TOKEN), ASSET_ID_SIGNATURE ) != 0 )
             return true;
 
         // Get the asset value.
-        const char* pAssetValue = StringUnit::getUnit( pAttributeValue, 1, ASSET_ASSIGNMENT_SEPARATOR );
+        const char* pAssetValue = StringUnit::getUnit( pAttributeValue, 1, ASSET_ASSIGNMENT_TOKEN );
 
         // Finish if not the asset Id we're looking for.
         if ( dStricmp( pAssetValue, mAssetIdFrom ) != 0 )
@@ -85,7 +85,7 @@ protected:
 
         // Format asset.
         char assetBuffer[1024];
-        dSprintf( assetBuffer, sizeof(assetBuffer), "%s%s%s", ASSET_ID_SIGNATURE, ASSET_ASSIGNMENT_SEPARATOR, mAssetIdTo );
+        dSprintf( assetBuffer, sizeof(assetBuffer), "%s%s%s", ASSET_ID_SIGNATURE, ASSET_ASSIGNMENT_TOKEN, mAssetIdTo );
 
         // Assign new value.
         pAttribute->SetValue( assetBuffer );

+ 3 - 3
engine/source/assets/tamlAssetReferencedVisitor.h

@@ -50,18 +50,18 @@ protected:
         const char* pAssetReference = pAttribute->Value();
 
         // Fetch field word count.
-        const U32 fieldWordCount = StringUnit::getUnitCount( pAssetReference, ASSET_ASSIGNMENT_SEPARATOR );
+        const U32 fieldWordCount = StringUnit::getUnitCount( pAssetReference, ASSET_ASSIGNMENT_TOKEN );
 
         // Finish if there are not two words.
         if ( fieldWordCount != 2 )
             return true;
 
         // Finish if the first word is not an asset signature.
-        if ( StringTable->insert( StringUnit::getUnit( pAssetReference, 0, ASSET_ASSIGNMENT_SEPARATOR ) ) != StringTable->insert(ASSET_ID_SIGNATURE) )
+        if ( StringTable->insert( StringUnit::getUnit( pAssetReference, 0, ASSET_ASSIGNMENT_TOKEN ) ) != StringTable->insert(ASSET_ID_SIGNATURE) )
             return true;
 
         // Get asset Id.
-        typeAssetId assetId = StringTable->insert( StringUnit::getUnit( pAssetReference, 1, ASSET_ASSIGNMENT_SEPARATOR ) );
+        typeAssetId assetId = StringTable->insert( StringUnit::getUnit( pAssetReference, 1, ASSET_ASSIGNMENT_TOKEN ) );
 
         // Finish if we already have this asset Id.
         if ( mAssetReferenced.contains( assetId ) )