|
|
@@ -5,17 +5,17 @@ namespace BansheeEngine
|
|
|
{
|
|
|
String D3D9EmulatedParamBlockParser::parse(const String& gpuProgSource, Vector<D3D9EmulatedParamBlock>& paramBlocks)
|
|
|
{
|
|
|
- static std::regex paramBlockRegex("BS_PARAM_BLOCK\\s*(.*})");
|
|
|
- static std::regex blockNameRegex("([^\\s{]*)");
|
|
|
- static std::regex paramNameRegex("(?:{ *([^\\, ]*))|(?:\\, *([^\\, }]*))");
|
|
|
- static std::regex replaceRegex("BS_PARAM_BLOCK\\s*(.*}\\n?)");
|
|
|
+ static std::regex paramBlockRegex("BS_PARAM_BLOCK\\s*(.*\\})");
|
|
|
+ static std::regex blockNameRegex("([^\\s\\{]*)");
|
|
|
+ static std::regex paramNameRegex("(?:\\{ *([^\\, ]*))|(?:\\, *([^\\, \\}]*))");
|
|
|
+ static std::regex replaceRegex("BS_PARAM_BLOCK\\s*(.*\\}\\n?)");
|
|
|
|
|
|
std::sregex_iterator paramBlockIter(gpuProgSource.begin(), gpuProgSource.end(), paramBlockRegex);
|
|
|
std::sregex_iterator iterEnd;
|
|
|
|
|
|
while (paramBlockIter != iterEnd)
|
|
|
{
|
|
|
- std::string stdString = paramBlockIter->str();
|
|
|
+ std::string stdString = (*paramBlockIter)[1];
|
|
|
String paramBlockString = String(stdString.begin(), stdString.end());
|
|
|
|
|
|
paramBlocks.push_back(D3D9EmulatedParamBlock());
|
|
|
@@ -24,15 +24,16 @@ namespace BansheeEngine
|
|
|
std::smatch nameMatch;
|
|
|
if (std::regex_search(paramBlockString, nameMatch, blockNameRegex))
|
|
|
{
|
|
|
- stdString = nameMatch.str();
|
|
|
+ stdString = nameMatch[1];
|
|
|
block.blockName = String(stdString.begin(), stdString.end());
|
|
|
}
|
|
|
|
|
|
std::sregex_iterator paramNameIter(paramBlockString.begin(), paramBlockString.end(), paramNameRegex);
|
|
|
while (paramNameIter != iterEnd)
|
|
|
{
|
|
|
- stdString = paramNameIter->str();
|
|
|
+ stdString = (*paramNameIter)[1];
|
|
|
block.paramNames.push_back(String(stdString.begin(), stdString.end()));
|
|
|
+ paramNameIter++;
|
|
|
}
|
|
|
|
|
|
paramBlockIter++;
|