@@ -116,10 +116,10 @@ void Options::ApplyCfg(
116116
117117 if (window)
118118 {
119- auto windowScale = toml_int_in (window, " scale" );
119+ auto windowScale = toml_double_in (window, " scale" );
120120 if (windowScale.ok )
121121 {
122- SetWindowScale ((int32_t )windowScale.u .i );
122+ SetWindowScale ((float )windowScale.u .d );
123123 }
124124
125125 auto windowPosition = toml_array_in (window, " position" );
@@ -178,8 +178,21 @@ void Options::ApplyCommandLine(
178178 static_cast <unsigned int >(upscale[11 ]) - static_cast <unsigned int >(' 0' )));
179179 }
180180
181- if (strstr (cmdLine, " -dxscale3" )) SetWindowScale (3 );
182- else if (strstr (cmdLine, " -dxscale2" )) SetWindowScale (2 );
181+ char const * scale = strstr (cmdLine, " -dxscale=" );
182+ if (scale)
183+ {
184+ scale = scale + 9 ;
185+ auto end = const_cast <char *>(scale);
186+ while (*end != 0 && *end != ' ' && *end != ' \t ' )
187+ {
188+ ++end;
189+ }
190+ float s = strtof (scale, &end);
191+ if (scale != end)
192+ {
193+ SetWindowScale (s);
194+ }
195+ }
183196
184197 if (strstr (cmdLine, " -dxdbg_dump_textures" )) SetFlag (OptionsFlag::DbgDumpTextures, true );
185198}
@@ -204,13 +217,13 @@ void Options::SetFlag(
204217 }
205218}
206219
207- int32_t Options::GetWindowScale () const
220+ float Options::GetWindowScale () const
208221{
209222 return _windowScale;
210223}
211224
212225void Options::SetWindowScale (
213- _In_ int32_t windowScale)
226+ _In_ float windowScale)
214227{
215228 _windowScale = min (3 , max (1 , windowScale));
216229}
0 commit comments