bool save_opentyrian_config( void )
{
	cJSON *root = load_json("opentyrian.conf");
	if (root == NULL)
		root = cJSON_CreateObject();
	
	cJSON *section;
	
	section = cJSON_CreateOrGetObjectItem(root, "video");
	cJSON_ForceType(section, cJSON_Object);
	
	{
		cJSON *setting;
		
		setting = cJSON_CreateOrGetObjectItem(section, "fullscreen");
		cJSON_SetBoolean(setting, fullscreen_enabled);
		
		setting = cJSON_CreateOrGetObjectItem(section, "scaler");
		cJSON_SetString(setting, scalers[scaler].name);
	}
	
	save_json(root, "opentyrian.conf");
	
	cJSON_Delete(root);
	
	return true;
}
Beispiel #2
0
bool save_opentyrian_config( void )
{
#ifdef __BLACKBERRY__
#else
#ifdef ENABLE_CONFIGURATION
    cJSON *root = load_json("opentyrian.conf");
    if (root == NULL)
        root = cJSON_CreateObject();

    cJSON *section;

    section = cJSON_CreateOrGetObjectItem(root, "video");
    cJSON_ForceType(section, cJSON_Object);

    {
        cJSON *setting;

        setting = cJSON_CreateOrGetObjectItem(section, "fullscreen");
        cJSON_SetBoolean(setting, fullscreen_enabled);

        setting = cJSON_CreateOrGetObjectItem(section, "scaler");
        cJSON_SetString(setting, scalers[scaler].name);
    }

    save_json(root, "opentyrian.conf");

    cJSON_Delete(root);
#endif /*ENABLE_CONFIGURATION*/
#endif
    return true;
}