Example #1
0
MainWindow * FApplication::loadWindows(int & loaded, bool lockFiles) {
	// our MainWindows use WA_DeleteOnClose so this has to be added to the heap (via new) rather than the stack (for local vars)
	MainWindow * mainWindow = MainWindow::newMainWindow(m_paletteBinModel, m_referenceModel, "", false, lockFiles);   // this is also slow
	mainWindow->setReportMissingModules(false);

	loaded = 0;
	initFilesToLoad();
	foreach (QString file, m_filesToLoad) {
		loadOne(mainWindow, file, loaded++);
	}
		void ArchetypeEditorManager::load()
		{
			Directory dir;
			const bool success = dir.open(_libraryFolder.c_str());
			AGE_ASSERT(success);
			for (auto it = dir.recursive_begin(); it != dir.recursive_end(); ++it)
			{
				if (Directory::IsFile(*it))
				{
					auto extension = FileUtils::GetExtension(*it);

					if (extension != "raw_archetype")
					{
						continue;
					}
					loadOne(FileUtils::RemoveExtension(FileUtils::GetName(*it)));
				}
			}
			dir.close();
		}
Example #3
0
void BinaryEntity::load(cereal::PortableBinaryInputArchive &ar, const std::uint32_t version)
{
    ENTITY_FLAGS flags;

    AGE_ASSERT(typesMap != nullptr);

    ar(entity->getLink()
       , children
       , flags
       , componentTypes
       , archetypesDependency);

    auto archetypeManager = entity->getScene()->getInstance<AGE::IArchetypeManager>();

    // we load archetypes dependency
    if (!archetypesDependency.empty())
    {
        for (auto &dep : archetypesDependency)
        {
            archetypeManager->loadOne(dep);
        }
    }

    entity->getLink().setPosition(entity->getLink().getPosition());
    entity->getLink().setOrientation(entity->getLink().getOrientation());
    entity->getLink().setScale(entity->getLink().getScale());
    //entity.setFlags(f);
    for (auto &e : componentTypes)
    {
        auto hashType = (*typesMap)[e];
        auto newComponent = ComponentRegistrationManager::getInstance().loadBinary(hashType, entity, ar);
    }
    if (entity->haveComponent<ArchetypeComponent>())
    {
        auto archetypeName = entity->getComponent<ArchetypeComponent>()->archetypeName;
        archetypeManager->spawn(entity, archetypeName);
    }
}