Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/gameengine')
-rw-r--r--source/gameengine/Expressions/InputParser.cpp24
-rw-r--r--source/gameengine/Expressions/InputParser.h1
2 files changed, 24 insertions, 1 deletions
diff --git a/source/gameengine/Expressions/InputParser.cpp b/source/gameengine/Expressions/InputParser.cpp
index 8187ff6a9e8..1d3a50601a5 100644
--- a/source/gameengine/Expressions/InputParser.cpp
+++ b/source/gameengine/Expressions/InputParser.cpp
@@ -151,6 +151,28 @@ void CParser::GrabString(int start)
+void CParser::GrabRealString(int start)
+{
+ // works like GrabString but converting \\n to \n
+ // puts part of the input string into the global variable
+ // const_as_string, from position start, to position chchount
+
+ int i;
+ char tmpch;
+
+ const_as_string = STR_String();
+ for (i=start;i<chcount;i++) {
+ tmpch= text[i];
+ if ((tmpch =='\\') && (text[i+1] == 'n')){
+ tmpch = '\n';
+ i++;
+ }
+ const_as_string += tmpch;
+ }
+}
+
+
+
void CParser::NextSym()
{
// sets the global variable sym to the next symbol, and
@@ -244,7 +266,7 @@ void CParser::NextSym()
start = chcount;
while ((ch != '\"') && (ch != 0x0))
NextCh();
- GrabString(start);
+ GrabRealString(start);
TermChar('\"'); // check for eol before '\"'
break;
}
diff --git a/source/gameengine/Expressions/InputParser.h b/source/gameengine/Expressions/InputParser.h
index b640d4eedc7..4c47677034b 100644
--- a/source/gameengine/Expressions/InputParser.h
+++ b/source/gameengine/Expressions/InputParser.h
@@ -93,6 +93,7 @@ private:
void DigRep();
void CharRep();
void GrabString(int start);
+ void GrabRealString(int start);
void NextSym();
#if 0 /* not used yet */
int MakeInt();