updated Engine to use TextureCache

git-svn-id: svn://anubis/anaglym/trunk@95 99a6e188-d820-4881-8870-2d33a10e2619
This commit is contained in:
Josh Holtrop 2009-10-18 16:33:58 +00:00
parent e537e89568
commit 79b11ba619
4 changed files with 23 additions and 17 deletions

View File

@ -231,7 +231,7 @@ int Engine::loadModel(const string & name, bool static_data, float scale)
FileLoader::Path model_path("", name + ".obj"); FileLoader::Path model_path("", name + ".obj");
string phys_path = locateResource(name + ".phy"); string phys_path = locateResource(name + ".phy");
WFObj * obj = new WFObj(*m_fileLoader /* TODO: texture loaders */); WFObj * obj = new WFObj(*m_fileLoader, m_textureCache);
if (obj->load(model_path)) if (obj->load(model_path))
{ {

View File

@ -7,6 +7,7 @@
#include <map> #include <map>
#include <SDL.h> #include <SDL.h>
#include "OdeWorld/OdeWorld.h" #include "OdeWorld/OdeWorld.h"
#include "TextureCache/TextureCache.h"
#include "wfobj/WFObj.h" #include "wfobj/WFObj.h"
class Engine class Engine
@ -101,21 +102,22 @@ class Engine
return new Object(is_static, m_world, display_list, scale); return new Object(is_static, m_world, display_list, scale);
} }
TextureCache m_textureCache;
EngineFileLoader * m_fileLoader; EngineFileLoader * m_fileLoader;
lua_State * m_luaState; lua_State * m_luaState;
std::string m_program_path; std::string m_program_path;
std::string m_engine_path; std::string m_engine_path;
OdeWorld m_world; OdeWorld m_world;
std::map<int, Object *> m_objects; std::map<int, Object *> m_objects;
int m_next_object_index; int m_next_object_index;
GLdouble m_eye[3]; GLdouble m_eye[3];
GLdouble m_center[3]; GLdouble m_center[3];
GLdouble m_up[3]; GLdouble m_up[3];
bool m_drawing; bool m_drawing;
bool m_autoPhysics; bool m_autoPhysics;
bool m_autoStartFrame; bool m_autoStartFrame;
bool m_autoEndFrame; bool m_autoEndFrame;
bool m_autoDrawObjects; bool m_autoDrawObjects;
}; };
extern Engine * g_engine; extern Engine * g_engine;

View File

@ -24,7 +24,7 @@ LUALIBS := -llua5.1
endif endif
SDLINCLUDE := $(shell sdl-config --cflags) SDLINCLUDE := $(shell sdl-config --cflags)
SDLLIBS := $(shell sdl-config --libs) SDLLIBS := $(shell sdl-config --libs) -lSDL_image
ODEINCLUDE := $(shell ode-config --cflags) ODEINCLUDE := $(shell ode-config --cflags)
ODELIBS := $(shell ode-config --libs) ODELIBS := $(shell ode-config --libs)
@ -51,7 +51,7 @@ endif
all: $(TARGET) all: $(TARGET)
$(TARGET): $(OBJS) wfobj/WFObj.o OdeWorld/OdeWorld.o $(TARGET): $(OBJS) wfobj/WFObj.o OdeWorld/OdeWorld.o TextureCache/TextureCache.o
$(CXX) -o $@ $^ $(LDFLAGS) $(CXX) -o $@ $^ $(LDFLAGS)
.PHONY: wfobj/WFObj.o .PHONY: wfobj/WFObj.o
@ -62,6 +62,10 @@ wfobj/WFObj.o:
OdeWorld/OdeWorld.o: OdeWorld/OdeWorld.o:
$(MAKE) -C OdeWorld $(MAKE) -C OdeWorld
.PHONY: TextureCache/TextureCache.o
TextureCache/TextureCache.o:
$(MAKE) -C TextureCache
%.o: %.c %.o: %.c
$(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $< $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $<

View File

@ -2,6 +2,6 @@
#ifndef ANAGLYM_H #ifndef ANAGLYM_H
#define ANAGLYM_H #define ANAGLYM_H
#define FILENAME_SAFE_CHARS "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-" #define FILENAME_SAFE_CHARS "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-."
#endif #endif