From 7e5ddf4ca2cae23fa81e6a3cbc5581a55f901bf7 Mon Sep 17 00:00:00 2001 From: thecelloman Date: Wed, 27 Mar 2013 21:36:17 -0400 Subject: [PATCH] Resolve issue #163 Fixed and assert on changing material, and we now map the material to the MATMGR by name instead of type. --- Engine/source/T3D/shapeBase.cpp | 4 ++-- Engine/source/T3D/tsStatic.cpp | 4 ++-- Engine/source/core/tokenizer.cpp | 24 ++++++++++++++++++++++++ 3 files changed, 28 insertions(+), 4 deletions(-) diff --git a/Engine/source/T3D/shapeBase.cpp b/Engine/source/T3D/shapeBase.cpp index 598e3c26c..a68ed764d 100644 --- a/Engine/source/T3D/shapeBase.cpp +++ b/Engine/source/T3D/shapeBase.cpp @@ -5127,8 +5127,8 @@ DefineEngineMethod( ShapeBase, changeMaterial, void, ( const char* mapTo, Materi newMat->mMapTo = mapTo; - // Map the material in the in the matmgr - MATMGR->mapMaterial( mapTo, newMat->mMapTo ); + // Map the material by name in the matmgr + MATMGR->mapMaterial( mapTo, newMat->getName() ); // Replace instances with the new material being traded in. For ShapeBase // class we have to update the server/client objects separately so both diff --git a/Engine/source/T3D/tsStatic.cpp b/Engine/source/T3D/tsStatic.cpp index ad7a3164c..9a36b15f2 100644 --- a/Engine/source/T3D/tsStatic.cpp +++ b/Engine/source/T3D/tsStatic.cpp @@ -1120,8 +1120,8 @@ DefineEngineMethod( TSStatic, changeMaterial, void, ( const char* mapTo, Materia newMat->mMapTo = mapTo; - // Map the material in the in the matmgr - MATMGR->mapMaterial( mapTo, newMat->mMapTo ); + // Map the material by name in the matmgr + MATMGR->mapMaterial( mapTo, newMat->getName() ); // Replace instances with the new material being traded in. Lets make sure that we only // target the specific targets per inst, this is actually doing more than we thought diff --git a/Engine/source/core/tokenizer.cpp b/Engine/source/core/tokenizer.cpp index adbb14fff..a51d3d5ad 100644 --- a/Engine/source/core/tokenizer.cpp +++ b/Engine/source/core/tokenizer.cpp @@ -384,6 +384,30 @@ bool Tokenizer::advanceToken(const bool crossLine, const bool assertAvail) cont = false; } } + else if (c == '/' && mpBuffer[mCurrPos+1] == '*') + { + // Block quote... + if (currPosition == 0) + { + // continue to end of block, then let crossLine determine on the next pass + while (mCurrPos < mBufferSize - 1 && (mpBuffer[mCurrPos] != '*' || mpBuffer[mCurrPos + 1] != '/')) + mCurrPos++; + + if (mCurrPos < mBufferSize - 1) + mCurrPos += 2; + } + else + { + // This is the end of the token. Continue to EOL + while (mCurrPos < mBufferSize - 1 && (mpBuffer[mCurrPos] != '*' || mpBuffer[mCurrPos + 1] != '/')) + mCurrPos++; + + if (mCurrPos < mBufferSize - 1) + mCurrPos += 2; + + cont = false; + } + } else { // If this is the first non-token character then store the