mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-11-04 06:26:39 +00:00 
			
		
		
		
	The 'fixing' for so-called dirty GMSTs does not work properly in its current state anyway, so it should be removed. Fixing the 'GMST fixing' might not be possible, because whether or not a GMST is 'dirty' depends on the language version of MW. Therefore different 'fixing' algorithms would be required for the different MW localisations, and I do not see a good reason why GMST values should be hard-coded in the GMST load procedure. In my opinion, it only clutters the code. Last but not least, I believe that it is not the task of the engine to clean ESM files from dirty entries. That is a job for the modders, who should only release clean ESM/ESP files in the first place. The engine should not need to worry about whether a file is 'dirty' or not. That is why I believe a feature for cleaning ESM/ESP files shall not be part of the engine.
		
			
				
	
	
		
			42 lines
		
	
	
	
		
			757 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			42 lines
		
	
	
	
		
			757 B
		
	
	
	
		
			C++
		
	
	
	
	
	
#ifndef OPENMW_ESM_GMST_H
 | 
						|
#define OPENMW_ESM_GMST_H
 | 
						|
 | 
						|
#include <string>
 | 
						|
 | 
						|
#include "defs.hpp"
 | 
						|
 | 
						|
namespace ESM
 | 
						|
{
 | 
						|
 | 
						|
class ESMReader;
 | 
						|
class ESMWriter;
 | 
						|
 | 
						|
/*
 | 
						|
 *  Game setting, with automatic cleaning of "dirty" entries.
 | 
						|
 *
 | 
						|
 */
 | 
						|
 | 
						|
struct GameSetting
 | 
						|
{
 | 
						|
    std::string mId;
 | 
						|
    // One of these is used depending on the variable type
 | 
						|
    std::string mStr;
 | 
						|
    int mI;
 | 
						|
    float mF;
 | 
						|
    VarType mType;
 | 
						|
 | 
						|
    void load(ESMReader &esm);
 | 
						|
    
 | 
						|
    int getInt() const;
 | 
						|
    ///< Throws an exception if GMST is not of type int or float.
 | 
						|
    
 | 
						|
    float getFloat() const;
 | 
						|
    ///< Throws an exception if GMST is not of type int or float.
 | 
						|
    
 | 
						|
    std::string getString() const;
 | 
						|
    ///< Throwns an exception if GMST is not of type string.
 | 
						|
 | 
						|
    void save(ESMWriter &esm);
 | 
						|
};
 | 
						|
}
 | 
						|
#endif
 |