コード例 #1
0
ファイル: Mod.cpp プロジェクト: bananaoomarang/Aquaria
void Mod::load(const std::string &p)
{	
	clear();

	refreshBaseModPath();

	name = p;
	path = baseModPath + p + "/";

	setActive(true);
	
	TiXmlDocument d;
	loadModXML(&d, p);
	
	TiXmlElement *mod = d.FirstChildElement("AquariaMod");
	if (mod)
	{
		TiXmlElement *props = mod->FirstChildElement("Properties");
		if (props)
		{
			if (props->Attribute("recache")){
				props->Attribute("recache", &doRecache);
			}

			if (props->Attribute("runBG")){
				int runBG = 0;
				props->Attribute("runBG", &runBG);
				if (runBG){
					core->settings.runInBackground = true;
				}
			}

			if (props->Attribute("debugMenu")) {
				props->Attribute("debugMenu", &debugMenu);
			}
		}
	}

#ifdef BBGE_BUILD_WINDOWS
	dsq->secondaryTexturePath = "./" + path + "graphics/";
#elif defined(BBGE_BUILD_UNIX)
	dsq->secondaryTexturePath = path + "graphics/";
#else
	errorLog("secondary texture path code not defined for this platform");
#endif

	dsq->sound->audioPath2 = path + "audio/";
	dsq->sound->setVoicePath2(path + "audio/");

	SkeletalSprite::secondaryAnimationPath = path + "animations/";

	dsq->particleBank2 = path + "particles/";
	dsq->shotBank2 = path + "shots/";

	Shot::loadShotBank(dsq->shotBank1, dsq->shotBank2);
	particleManager->loadParticleBank(dsq->particleBank1, dsq->particleBank2);
}
コード例 #2
0
ファイル: Mod.cpp プロジェクト: simonfork/aquaria
void Mod::load(const std::string &p)
{
    clear();

    refreshBaseModPath();

    name = p;
    path = baseModPath + p + "/";

    setLocalisationModPath(path);

    setActive(true);

    TiXmlDocument d;
    loadModXML(&d, p);

    TiXmlElement *mod = d.FirstChildElement("AquariaMod");
    if (mod)
    {
        TiXmlElement *props = mod->FirstChildElement("Properties");
        if (props)
        {
            if (props->Attribute("recache")) {
                props->Attribute("recache", &doRecache);
            }

            if (props->Attribute("runBG")) {
                int runBG = 0;
                props->Attribute("runBG", &runBG);
                if (runBG) {
                    core->settings.runInBackground = true;
                }
            }

            if (props->Attribute("debugMenu")) {
                props->Attribute("debugMenu", &debugMenu);
            }

            if (props->Attribute("hasWorldMap")) {
                int t;
                props->Attribute("hasWorldMap", &t);
                hasMap = t;
            }
            if (props->Attribute("blockEditor")) {
                int t;
                props->Attribute("blockEditor", &t);
                blockEditor = t;
            }
            if (props->Attribute("worldMapRevealMethod")) {
                int t;
                props->Attribute("worldMapRevealMethod", &t);
                mapRevealMethod = (WorldMapRevealMethod)t;
            }
        }
    }

    dsq->secondaryTexturePath = path + "graphics/";

    dsq->sound->audioPath2 = path + "audio/";
    dsq->sound->setVoicePath2(path + "audio/");

    SkeletalSprite::secondaryAnimationPath = path + "animations/";

    dsq->particleBank2 = path + "particles/";
    dsq->shotBank2 = path + "shots/";

    Shot::loadShotBank(dsq->shotBank1, dsq->shotBank2);
    particleManager->loadParticleBank(dsq->particleBank1, dsq->particleBank2);
}