added Scene::processForNode() to process for nodes
git-svn-id: svn://anubis/fart/branches/scene-file-scripting@332 7f9b0f55-74a9-4bce-be96-3c2cd072584d
This commit is contained in:
1 parent
71e40b0277
commit
01a713af98
4 files changed
+62
-11
No files matched your search
+17
-2
@@ -42,6 +42,11 @@ class Node
|
||||
std::cerr << "Warning: Node::getString() called!" << std::endl;
|
||||
return "";
|
||||
}
|
||||
virtual refptr<Node> getNode(int idx)
|
||||
{
|
||||
std::cerr << "Warning: Node::getNode() called!" << std::endl;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
virtual bool isShape() { return false; }
|
||||
virtual bool isMaterial() { return false; }
|
||||
@@ -550,11 +555,21 @@ class ForNode : public Node
|
||||
{
|
||||
public:
|
||||
ForNode(refptr<Node> e1, refptr<Node> e2, refptr<Node> e3)
|
||||
: m_e1(e1), m_e2(e2), m_e3(e3)
|
||||
{
|
||||
m_nodes[0] = e1;
|
||||
m_nodes[1] = e2;
|
||||
m_nodes[2] = e3;
|
||||
}
|
||||
refptr<Node> getNode(int idx)
|
||||
{
|
||||
if (0 <= idx && idx <= 2)
|
||||
{
|
||||
return m_nodes[idx];
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
protected:
|
||||
refptr<Node> m_e1, m_e2, m_e3;
|
||||
refptr<Node> m_nodes[3];
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
+5
-1
@@ -593,6 +593,10 @@ expression: term { $$ = $1; }
|
||||
| stmt_expression { $$ = $1; }
|
||||
;
|
||||
|
||||
maybe_expression: /* empty */
|
||||
| expression { $$ = $1; }
|
||||
;
|
||||
|
||||
stmt_expression: assignment { $$ = $1; }
|
||||
| local_assignment { $$ = $1; }
|
||||
| local_decl { $$ = $1; }
|
||||
@@ -640,7 +644,7 @@ local_decl: LOCAL VARREF {
|
||||
}
|
||||
;
|
||||
|
||||
for: FOR LPAREN expression SEMICOLON bool_expression SEMICOLON expression RPAREN LCURLY general_items RCURLY {
|
||||
for: FOR LPAREN maybe_expression SEMICOLON bool_expression SEMICOLON maybe_expression RPAREN LCURLY general_items RCURLY {
|
||||
$$ = new ForNode($3, $5, $7);
|
||||
$$->addChildren($10);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user