* Changes the Display Width option. * @param action Pointer to an action. */
| 386 | * @param action Pointer to an action. |
| 387 | */ |
| 388 | void OptionsVideoState::txtDisplayWidthChange(Action *) |
| 389 | { |
| 390 | std::wstringstream ss; |
| 391 | int width = 0; |
| 392 | ss << std::dec << _txtDisplayWidth->getText(); |
| 393 | ss >> std::dec >> width; |
| 394 | Options::newDisplayWidth = width; |
| 395 | // Update resolution mode |
| 396 | if (_res != (SDL_Rect**)-1 && _res != (SDL_Rect**)0) |
| 397 | { |
| 398 | int i; |
| 399 | _resCurrent = -1; |
| 400 | for (i = 0; _res[i]; ++i) |
| 401 | { |
| 402 | if (_resCurrent == -1 && |
| 403 | ((_res[i]->w == Options::newDisplayWidth && _res[i]->h <= Options::newDisplayHeight) || _res[i]->w < Options::newDisplayWidth)) |
| 404 | { |
| 405 | _resCurrent = i; |
| 406 | } |
| 407 | } |
| 408 | } |
| 409 | } |
| 410 | |
| 411 | /** |
| 412 | * Changes the Display Height option. |