diff --git a/hecl/extern/boo b/hecl/extern/boo index 10988fa37..51a097da6 160000 --- a/hecl/extern/boo +++ b/hecl/extern/boo @@ -1 +1 @@ -Subproject commit 10988fa37efa49b77d3f361b91faf1ab7d87ced5 +Subproject commit 51a097da6bf0c2b3f101aa922e2597eaed239c54 diff --git a/hecl/include/hecl/Blender/BlenderConnection.hpp b/hecl/include/hecl/Blender/BlenderConnection.hpp index 04f055dbf..8586945a8 100644 --- a/hecl/include/hecl/Blender/BlenderConnection.hpp +++ b/hecl/include/hecl/Blender/BlenderConnection.hpp @@ -581,6 +581,12 @@ public: ColMesh(BlenderConnection& conn); }; + /** Intermediate world representation */ + struct World + { + World(BlenderConnection& conn); + }; + /** Intermediate lamp representation */ struct Light { @@ -630,6 +636,9 @@ public: Mesh compileAllMeshes(HMDLTopology topology, int skinSlotCount=10, float maxOctantLength=5.0, Mesh::SurfProgFunc surfProg=[](int){}); + /** Compile world intermediate (WORLD blends only) */ + World compileWorld(); + /** Gather all lights in scene (AREA blends only) */ std::vector compileLights(); diff --git a/hecl/lib/Blender/BlenderConnection.cpp b/hecl/lib/Blender/BlenderConnection.cpp index e9186add3..6ea5da43e 100644 --- a/hecl/lib/Blender/BlenderConnection.cpp +++ b/hecl/lib/Blender/BlenderConnection.cpp @@ -1001,6 +1001,10 @@ BlenderConnection::DataStream::ColMesh::Triangle::Triangle(BlenderConnection& co conn._readBuf(this, 16); } +BlenderConnection::DataStream::World::World(BlenderConnection& conn) +{ +} + BlenderConnection::DataStream::Light::Light(BlenderConnection& conn) : sceneXf(conn), color(conn) { @@ -1306,6 +1310,23 @@ BlenderConnection::DataStream::Actor BlenderConnection::DataStream::compileActor return Actor(*m_parent); } +BlenderConnection::DataStream::World +BlenderConnection::DataStream::compileWorld() +{ + if (m_parent->m_loadedType != BlendType::World) + BlenderLog.report(logvisor::Fatal, _S("%s is not an WORLD blend"), + m_parent->m_loadedBlend.getAbsolutePath().c_str()); + + m_parent->_writeLine("WORLDCOMPILE"); + + char readBuf[256]; + m_parent->_readLine(readBuf, 256); + if (strcmp(readBuf, "OK")) + BlenderLog.report(logvisor::Fatal, "unable to compile world: %s", readBuf); + + return World(*m_parent); +} + std::vector BlenderConnection::DataStream::getArmatureNames() { if (m_parent->m_loadedType != BlendType::Actor)