@@ -73,7 +73,7 @@ std::vector<GenericPatch::Config> GenericPatch::GetConfigs()
7373 {
7474 DBOUT (" ValueType=" << params.second );
7575 config.valType = params.second ;
76- if (config.valType != " float" && config.valType != " byte" && config.valType != " int" )
76+ if (config.valType != " float" && config.valType != " byte" && config.valType != " int" && config. valType != " double " )
7777 {
7878 DBOUT (" ValueType unsupported. Supported types are: float, byte...Skipping patch..." );
7979 goto CONTINUE;
@@ -104,15 +104,15 @@ std::vector<GenericPatch::Config> GenericPatch::GetConfigs()
104104 DBOUT (" No pattern found, skipping patch..." );
105105 goto CONTINUE;
106106 }
107- if (config.valType == " float" || config.valType == " int" )
107+ if (config.valType == " float" || config.valType == " int" || config. valType == " double " )
108108 {
109109 try
110110 {
111111 boost::replace_all (config.val , " width" , std::to_string (UserSettings::config.width ));
112112 boost::replace_all (config.val , " height" , std::to_string (UserSettings::config.height ));
113113 boost::replace_all (config.val , " aspectratio" , std::to_string (UserSettings::config.aspectratio ));
114114 int error = -1 ;
115- float f = te_interp (config.val .c_str (), &error);
115+ double d = te_interp (config.val .c_str (), &error);
116116
117117 if (error != 0 )
118118 {
@@ -122,13 +122,18 @@ std::vector<GenericPatch::Config> GenericPatch::GetConfigs()
122122
123123 if (config.valType == " float" )
124124 {
125+ float f = static_cast <float >(d);
125126 config.val = hexStr (reinterpret_cast <BYTE*>(&f), sizeof (float ));
126127 }
127128 else if (config.valType == " int" )
128129 {
129- int i = static_cast <int >(f );
130+ int i = static_cast <int >(d );
130131 config.val = hexStr (reinterpret_cast <BYTE*>(&i), sizeof (int ));
131132 }
133+ else if (config.valType == " double" )
134+ {
135+ config.val = hexStr (reinterpret_cast <BYTE*>(&d), sizeof (double ));
136+ }
132137 }
133138 catch (std::exception const & e)
134139 {
0 commit comments