diff --git a/Engine.cc b/Engine.cc index e6bf924..263b76a 100644 --- a/Engine.cc +++ b/Engine.cc @@ -231,7 +231,7 @@ int Engine::loadModel(const string & name, bool static_data, float scale) FileLoader::Path model_path("", name + ".obj"); 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)) { diff --git a/Engine.h b/Engine.h index 99d14e5..eac0940 100644 --- a/Engine.h +++ b/Engine.h @@ -7,6 +7,7 @@ #include #include #include "OdeWorld/OdeWorld.h" +#include "TextureCache/TextureCache.h" #include "wfobj/WFObj.h" class Engine @@ -101,21 +102,22 @@ class Engine return new Object(is_static, m_world, display_list, scale); } + TextureCache m_textureCache; EngineFileLoader * m_fileLoader; - lua_State * m_luaState; - std::string m_program_path; - std::string m_engine_path; - OdeWorld m_world; + lua_State * m_luaState; + std::string m_program_path; + std::string m_engine_path; + OdeWorld m_world; std::map m_objects; - int m_next_object_index; - GLdouble m_eye[3]; - GLdouble m_center[3]; - GLdouble m_up[3]; - bool m_drawing; - bool m_autoPhysics; - bool m_autoStartFrame; - bool m_autoEndFrame; - bool m_autoDrawObjects; + int m_next_object_index; + GLdouble m_eye[3]; + GLdouble m_center[3]; + GLdouble m_up[3]; + bool m_drawing; + bool m_autoPhysics; + bool m_autoStartFrame; + bool m_autoEndFrame; + bool m_autoDrawObjects; }; extern Engine * g_engine; diff --git a/Makefile b/Makefile index f9bdba2..3842e1c 100644 --- a/Makefile +++ b/Makefile @@ -24,7 +24,7 @@ LUALIBS := -llua5.1 endif SDLINCLUDE := $(shell sdl-config --cflags) -SDLLIBS := $(shell sdl-config --libs) +SDLLIBS := $(shell sdl-config --libs) -lSDL_image ODEINCLUDE := $(shell ode-config --cflags) ODELIBS := $(shell ode-config --libs) @@ -51,7 +51,7 @@ endif all: $(TARGET) -$(TARGET): $(OBJS) wfobj/WFObj.o OdeWorld/OdeWorld.o +$(TARGET): $(OBJS) wfobj/WFObj.o OdeWorld/OdeWorld.o TextureCache/TextureCache.o $(CXX) -o $@ $^ $(LDFLAGS) .PHONY: wfobj/WFObj.o @@ -62,6 +62,10 @@ wfobj/WFObj.o: OdeWorld/OdeWorld.o: $(MAKE) -C OdeWorld +.PHONY: TextureCache/TextureCache.o +TextureCache/TextureCache.o: + $(MAKE) -C TextureCache + %.o: %.c $(CC) -c -o $@ $(CPPFLAGS) $(CFLAGS) $< diff --git a/anaglym.h b/anaglym.h index d5cc2cb..b89d8df 100644 --- a/anaglym.h +++ b/anaglym.h @@ -2,6 +2,6 @@ #ifndef ANAGLYM_H #define ANAGLYM_H -#define FILENAME_SAFE_CHARS "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-" +#define FILENAME_SAFE_CHARS "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-." #endif