added some setters to Scene, including some modules in parser, ready to do something with the parse results

git-svn-id: svn://anubis/fart/trunk@89 7f9b0f55-74a9-4bce-be96-3c2cd072584d
This commit is contained in:
Josh Holtrop 2009-02-09 02:55:02 +00:00
parent 70eeff90fb
commit fc8a46853b
3 changed files with 16 additions and 3 deletions

View File

@ -31,6 +31,14 @@ class Scene
const char * filename);
~Scene();
void render();
void setWidth(int width) { m_width = width; }
void setHeight(int height) { m_height = height; }
void setMultisampleLevel(int level) { m_multisample_level = level; }
void setVFOV(double vfov) { m_vfov = vfov; }
void setAmbientLight(const Color & al) { m_ambient_light = al; }
void addShape(Shape * shape) { m_shapes.push_back(shape); }
void addLight(Light * light) { m_lights.push_back(light); }
Transform & getTransform() { return m_transform; }
protected:
/* private methods */

View File

@ -10,10 +10,10 @@ CXXOBJS := $(PARSER).tab.o
all: $(COBJS) $(CXXOBJS)
%.o: %.c
$(CC) -c -o $@ $<
$(CC) -c -o $@ $(CPPFLAGS) $<
%.o: %.cc
$(CXX) -c -o $@ $<
$(CXX) -c -o $@ $(CPPFLAGS) $<
$(PARSER).tab.cc $(PARSER).tab.hh: $(PARSER).yy
$(BISON) -d $<

View File

@ -2,6 +2,8 @@
%{
#include <stdio.h>
#include <iostream>
#include "main/Scene.h"
#include "util/Vector.h"
using namespace std;
extern "C" {
@ -29,6 +31,8 @@ class Node
void * ptr;
};
static Scene * g_scene;
#define YYSTYPE Node
%}
@ -183,8 +187,9 @@ vector: LESS number COMMA number COMMA number GREATER
%%
int parse(const char * fileName)
int parse(Scene * scene, const char * fileName)
{
g_scene = scene;
yyin = fopen(fileName, "r");
if (yyin == NULL)
{