Beispiel #1
0
ETH_WINDOW_ENML_FILE::ETH_WINDOW_ENML_FILE(const str_type::string& fileName, const Platform::FileManagerPtr& fileManager) :
	width(640),
	height(480),
	windowed(true),
	vsync(true),
	title(GS_L("Ethanon Engine")),
	richLighting(true)
{
	str_type::string out;
	fileManager->GetAnsiFileString(fileName, out);
	enml::File file(out);
	if (file.getError() == enml::enmlevSUCCESS)
	{
		file.getUInt(GS_L("window"), GS_L("width"), &width);
		file.getUInt(GS_L("window"), GS_L("height"), &height);
		windowed = ETHGlobal::IsTrue(file.get(GS_L("window"), GS_L("windowed")));
		vsync = ETHGlobal::IsTrue(file.get(GS_L("window"), GS_L("vsync")));
		const str_type::string newTitle = file.get(GS_L("window"), GS_L("title"));
		richLighting = ETHGlobal::IsTrue(file.get(GS_L("rendering"), GS_L("richLighting")));
		title = newTitle.empty() ? title : newTitle;

		densityManager.FillParametersFromFile(file);
	}
	else
	{
		#ifdef GS2D_STR_TYPE_WCHAR
		std::wcerr
		#else
		std::cerr
		#endif
		 << file.getErrorString() << std::endl;
	}
}
Beispiel #2
0
ETH_WINDOW_ENML_FILE::ETH_WINDOW_ENML_FILE(const str_type::string& fileName, const Platform::FileManagerPtr& fileManager)
{
    width = 640;
    height = 480;
    windowed = true;
    vsync = true;
    title = GS_L("Ethanon Engine");

    str_type::string out;
    fileManager->GetAnsiFileString(fileName, out);
    enml::File file(out);
    if (file.getError() == enml::enmlevSUCCESS)
    {
        file.getUInt(GS_L("window"), GS_L("width"), &width);
        file.getUInt(GS_L("window"), GS_L("height"), &height);
        windowed = (file.get(GS_L("window"), GS_L("windowed")) == GS_L("false")) ? false : true;
        vsync = (file.get(GS_L("window"), GS_L("vsync")) == GS_L("false")) ? false : true;

        const str_type::string newTitle = file.get(GS_L("window"), GS_L("title"));
        title = newTitle.empty() ? title : newTitle;
    }
    else
    {
#ifdef GS2D_STR_TYPE_WCHAR
        std::wcerr
#else
        std::cerr
#endif
                << file.getErrorString() << std::endl;
    }
}
Beispiel #3
0
ETHAppEnmlFile::ETHAppEnmlFile(const str_type::string& fileName, const Platform::FileManagerPtr& fileManager,
							   const gs2d::str_type::string& platformName) :
	hdDensityValue(2.0f),
	fullHdDensityValue(4.0f),
	width(640),
	height(480),
	windowed(true),
	vsync(true),
	title(GS_L("Ethanon Engine")),
	richLighting(true),
	minScreenHeightForHdVersion(720),
	minScreenHeightForFullHdVersion(1080)
{
	str_type::string out;
	fileManager->GetAnsiFileString(fileName, out);
	enml::File file(out);
	if (file.GetError() == enml::RV_SUCCESS)
	{
		LoadProperties(ETH_DEFAULT_PROPERTY_APP_ENML_ENTITY, file);

		// also read "window" entity for backwards project compatibility
		LoadProperties(ETH_OLDER_DEFAULT_PROPERTY_APP_ENML_ENTITY, file);

		// now read platform specific properties
		if (platformName != GS_L(""))
			LoadProperties(platformName, file);

		densityManager.FillParametersFromFile(*this);
	}
	else
	{
#		ifdef GS2D_STR_TYPE_WCHAR
			std::wcerr
#		else
			std::cerr
#		endif
			<< file.GetErrorString() << std::endl;
	}
}
Beispiel #4
0
ETH_STARTUP_RESOURCES_ENML_FILE::ETH_STARTUP_RESOURCES_ENML_FILE(const str_type::string& fileName, const Platform::FileManagerPtr& fileManager)
{
    emtprojFilename = GS_L("");
    escFilename = GS_L("");

    str_type::string out;
    fileManager->GetAnsiFileString(fileName, out);
    enml::File file(out);
    if (file.getError() == enml::enmlevSUCCESS)
    {
        emtprojFilename = file.get(GS_L("startup"), GS_L("project"));
        escFilename = file.get(GS_L("startup"), GS_L("scene"));
    }
    else
    {
#ifdef GS2D_STR_TYPE_WCHAR
        std::wcerr
#else
        std::cerr
#endif
                << file.getErrorString() << std::endl;
    }
}