#include "HECL/HMDLMeta.hpp" #include "HECL/Runtime.hpp" #include namespace HECL { namespace Runtime { static LogVisor::LogModule Log("HMDL"); HMDLData::HMDLData(boo::IGraphicsDataFactory* factory, const void* metaData, const void* vbo, const void* ibo) { HMDLMeta meta; { Athena::io::MemoryReader r((atUint8*)metaData, HECL_HMDL_META_SZ); meta.read(r); } if (meta.magic != 'TACO') Log.report(LogVisor::FatalError, "invalid HMDL magic"); m_vbo = factory->newStaticBuffer(boo::BufferUseVertex, vbo, meta.vertStride, meta.vertCount); m_ibo = factory->newStaticBuffer(boo::BufferUseIndex, ibo, 4, meta.indexCount); size_t elemCount = 2 + meta.colorCount + meta.uvCount + meta.weightCount; std::unique_ptr vdescs(new boo::VertexElementDescriptor[elemCount]); for (size_t i=0 ; inewVertexFormat(elemCount, vdescs.get()); } } }