void RenderObject::Load(KeyedArchive * archive, SceneFileV2 *sceneFile) { if(NULL != archive) { if(archive->IsKeyExists("ro.type")) type = archive->GetUInt32("ro.type"); if(archive->IsKeyExists("ro.flags")) flags = archive->GetUInt32("ro.flags"); if(archive->IsKeyExists("ro.debugflags")) debugFlags = archive->GetUInt32("ro.debugflags"); if(archive->IsKeyExists("ro.batchCount")) { KeyedArchive *batchesArch = archive->GetArchive("ro.batches"); for(uint32 i = 0; i < archive->GetUInt32("ro.batchCount"); ++i) { KeyedArchive *batchArch = batchesArch->GetArchive(KeyedArchive::GenKeyFromIndex(i)); if(NULL != batchArch) { RenderBatch *batch = (RenderBatch *) ObjectFactory::Instance()->New(batchArch->GetString("rb.classname")); if(NULL != batch) { batch->Load(batchArch, sceneFile); AddRenderBatch(batch); batch->Release(); } } } } } AnimatedObject::Load(archive); }
void ParticleEmitter::AddLayer(ParticleLayer * layer) { if (layer) { layers.push_back(layer); layer->Retain(); layer->SetEmitter(this); AddRenderBatch(layer->GetRenderBatch()); } }
void Mesh::AddPolygonGroup(PolygonGroup * polygonGroup, Material * material) { RenderBatch * batch = new RenderBatch(); batch->SetPolygonGroup(polygonGroup); batch->SetMaterial(material); batch->SetRenderDataObject(polygonGroup->renderDataObject); batch->SetStartIndex(0); batch->SetIndexCount(polygonGroup->GetIndexCount()); AddRenderBatch(batch); batch->Release(); //polygonGroups.push_back(polygonGroup); }