added TEXTURE token, rule, and node type

git-svn-id: svn://anubis/fart/trunk@383 7f9b0f55-74a9-4bce-be96-3c2cd072584d
This commit is contained in:
Josh Holtrop committed 2010-10-13 20:40:44 +00:00
1 parent 48e2900e1f
commit 7472d6c53c
4 files changed
+11 -1

No files matched your search

+7
View File
@@ -552,6 +552,13 @@ class SubtractNode : public Node
virtual NodeRef evaluate() { return new SubtractNode(); }
};
class TextureNode : public IdentifierNode
{
public:
TextureNode(const std::string & str) : IdentifierNode(str) {}
virtual NodeRef evaluate() { return new TextureNode(m_string); }
};
class TranslateNode : public VectorNode
{
public:
+1
View File
@@ -90,6 +90,7 @@ size return SIZE;
specular return SPECULAR;
sphere return SPHERE;
subtract return SUBTRACT;
texture return TEXTURE;
translate return TRANSLATE;
transparency return TRANSPARENCY;
union return UNION;
+2
View File
@@ -103,6 +103,7 @@ refptr<Scope> parser_scope;
%token SPECULAR;
%token SPHERE;
%token SUBTRACT;
%token TEXTURE;
%token TRANSLATE;
%token TRANSPARENCY;
%token UNION;
@@ -208,6 +209,7 @@ general_item: AMBIENT vector3 { $$ = new AmbientNode($2); }
| SIZE vector3 { $$ = new SizeNode($2); }
| SPECULAR vector3 { $$ = new SpecularNode($2); }
| stmt_expression { $$ = $1; }
| TEXTURE STRING { $$ = new TextureNode($2->getString()); }
| transform_block { $$ = $1; }
| TRANSLATE vector3 { $$ = new TranslateNode($2); }
| TRANSPARENCY expression { $$ = new TransparencyNode($2); }