Beispiel #1
0
void FillPreferences(FRPreferences * Preferences, FILE * ConfigFile)
{
	Preferences->brightness = AssignFloat("brightness=",ConfigFile);
	Preferences->combat_difficulty = (char)AssignInteger("combat_difficulty=",ConfigFile);
	Preferences->combat_looks = (char)AssignInteger("combat_looks=",ConfigFile);
	Preferences->combat_messages = (char)AssignInteger("combat_messages=",ConfigFile);
	Preferences->combat_speed = (char)AssignInteger("combat_speed=",ConfigFile);
	Preferences->game_difficulty = (char)AssignInteger("game_difficulty=",ConfigFile);
	Preferences->item_highlight = (char)AssignInteger("item_highlight=",ConfigFile);
	Preferences->language_filter = (char)AssignInteger("language_filter=",ConfigFile);
	Preferences->mouse_sensitivity = AssignFloat("mouse_sensitivity=",ConfigFile);
	Preferences->player_speedup = (char)AssignInteger("player_speedup=",ConfigFile);
	Preferences->running = (char)AssignInteger("running=",ConfigFile);
	Preferences->subtitles = (char)AssignInteger("subtitles=",ConfigFile);
	Preferences->target_hightlight = (char)AssignInteger("target_hightlight=",ConfigFile);
	Preferences->text_base_delay = AssignFloat("text_base_delay=",ConfigFile);
	Preferences->text_line_delay = AssignFloat("text_line_delay=",ConfigFile);
	Preferences->violence_level = (char)AssignInteger("violence_level=",ConfigFile);
}
Beispiel #2
0
bool		 
CommandLineParser::ExecuteOption(__CBS *option,char *buff)
{
	
	if(option==NULL)
		return false;

  	int  len=0;
  	bool retval = false;
  	
	
  	if(buff!=NULL)
  	{
  		 len   = strlen(buff)-option->KeyLen;
  		 buff += option->KeyLen;
  	}
  	
	
  	switch(option->CommandType)
  	{
  	case	CT_NOP              :
  			return true;
  	case	CT_USE_FUNCTION 	:
  	case	CT_USE_FUNCTION_NULL:
  			retval = option->Value.ActionFunc(buff,len);
  			break;
  	case	CT_USE_FLAG 		:
  			retval = AssignFlag(option,buff,len);
  		    break;
  	case	CT_USE_INT			:
  			retval = AssignInt(option,buff,len);
  			break;
  	case	CT_USE_FLOAT		:
  			retval = AssignFloat(option,buff,len);
  			break;
  	case	CT_USE_STRING		:
  			retval = AssignString(option,buff,len);
  			break;
  	default:
  		    return false;
  	}
  	
  	return retval;
}