| 452 | |
| 453 | |
| 454 | void DisplayMenu::callback(HUDuiControl* w, void* data) { |
| 455 | HUDuiList* list = (HUDuiList*)w; |
| 456 | switch (((const char*)data)[0]) { |
| 457 | case 'Q': { |
| 458 | RENDERER.setQuality(list->getIndex()); |
| 459 | if (list->getIndex() > 3) { |
| 460 | BZDB.set("zbuffer", "1"); |
| 461 | setSceneDatabase(); |
| 462 | } |
| 463 | BZDB.set("texturereplace", (!BZDBCache::lighting && |
| 464 | RENDERER.useQuality() < _MEDIUM_QUALITY) ? "1" : "0"); |
| 465 | BZDB.setPersistent("texturereplace", false); |
| 466 | RENDERER.notifyStyleChange(); |
| 467 | break; |
| 468 | } |
| 469 | case 'T': { |
| 470 | TextureManager& tm = TextureManager::instance(); |
| 471 | tm.setMaxFilter((OpenGLTexture::Filter)list->getIndex()); |
| 472 | BZDB.set("texture", tm.getMaxFilterName()); |
| 473 | RENDERER.notifyStyleChange(); |
| 474 | break; |
| 475 | } |
| 476 | case 'R': { |
| 477 | BZDB.setBool("remapTexCoords", list->getIndex() == 1); |
| 478 | setSceneDatabase(); |
| 479 | break; |
| 480 | } |
| 481 | case 'A': { |
| 482 | int aniso = list->getIndex() + 1; |
| 483 | BZDB.setInt("aniso", aniso); |
| 484 | TextureManager& tm = TextureManager::instance(); |
| 485 | tm.setMaxFilter(tm.getMaxFilter()); |
| 486 | RENDERER.notifyStyleChange(); |
| 487 | break; |
| 488 | } |
| 489 | case 'L': { |
| 490 | bool oldLighting = BZDBCache::lighting; |
| 491 | BZDB.set("lighting", list->getIndex() == 0 ? "0" : "1"); |
| 492 | BZDB.set("tesselation", list->getIndex() == 2 ? "1" : "0"); |
| 493 | if (oldLighting != BZDBCache::lighting) { |
| 494 | BZDB.set("texturereplace", (!BZDBCache::lighting && |
| 495 | RENDERER.useQuality() < _MEDIUM_QUALITY) ? "1" : "0"); |
| 496 | BZDB.setPersistent("texturereplace", false); |
| 497 | RENDERER.notifyStyleChange(); |
| 498 | } |
| 499 | break; |
| 500 | } |
| 501 | case 'S': { |
| 502 | const int shadowVal = list->getIndex(); |
| 503 | BZDB.setInt("shadowMode", shadowVal); |
| 504 | RENDERER.notifyStyleChange(); |
| 505 | break; |
| 506 | } |
| 507 | case 'B': { |
| 508 | BZDB.set("blend", list->getIndex() ? "1" : "0"); |
| 509 | RENDERER.notifyStyleChange(); |
| 510 | break; |
| 511 | } |
nothing calls this directly
no test coverage detected