From f9675bd2b4d48b9517cd4939a5cfe1ea9c775b6c Mon Sep 17 00:00:00 2001 From: MirceaKitsune Date: Wed, 24 Oct 2012 00:11:24 +0300 Subject: Add a subfolder for models and transfer models from server to client (obj, md2 and md3 are currently allowed) Get rid of the texture string and use the existing textures array. Segmented meshes have multiple materials, and this will allow us to texture each. Do not switch to this commit yet! If a texture string is left empty in LUA, don't modify that material. Useful so a script can change specific textures without affecting others --- src/client.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/client.cpp') diff --git a/src/client.cpp b/src/client.cpp index e47bce142..504297a6d 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -860,6 +860,25 @@ bool Client::loadMedia(const std::string &data, const std::string &filename) return true; } + const char *model_ext[] = { + ".b3d", ".md2", ".obj", + NULL + }; + name = removeStringEnd(filename, model_ext); + if(name != "") + { + verbosestream<<"Client: Storing model into Irrlicht: " + <<"file \""<getFileSystem(); + + // Create an irrlicht memory file + io::IReadFile *rfile = irrfs->createMemoryReadFile(*data_rw, data_rw.getSize(), filename.c_str(), true); + assert(rfile); + //rfile->drop(); + return true; + } + errorstream<<"Client: Don't know how to load file \"" <