Ticket #8932: gamma.patch
File gamma.patch, 8.0 KB (added by , 16 years ago) |
---|
-
scummvm/trunk/backends/platform/sdl/graphics.cpp
307 307 } 308 308 } 309 309 310 void OSystem_SDL::resetGamma() { 311 SDL_SetGamma(1.0f, 1.0f, 1.0f); 312 } 313 314 void OSystem_SDL::setGamma(float gamma) { 315 SDL_SetGamma(gamma, gamma, gamma); 316 } 317 310 318 void OSystem_SDL::loadGFXMode() { 311 319 assert(_inited); 312 320 _forceFull = true; -
scummvm/trunk/backends/platform/sdl/sdl.h
91 91 // Typically, 320x200 92 92 virtual void initSize(uint w, uint h); // overloaded by CE backend 93 93 94 void resetGamma(); 95 void setGamma(float gamma); 96 94 97 virtual int getScreenChangeID() const { return _screenChangeCount; } 95 98 96 99 // Set colors of the palette -
scummvm/trunk/common/system.h
398 398 */ 399 399 virtual void endGFXTransaction() {} 400 400 401 virtual void resetGamma() {} 402 403 virtual void setGamma(float gamma) {} 401 404 402 405 /** 403 406 * Returns the currently set virtual screen height. -
scummvm/trunk/gui/options.cpp
56 56 kChooseThemeDirCmd = 'chth', 57 57 kChooseExtraDirCmd = 'chex', 58 58 kChoosePluginsDirCmd = 'chpl', 59 kChooseThemeCmd = 'chtf' 59 kChooseThemeCmd = 'chtf', 60 kGammaChanged = 'gach' 60 61 }; 61 62 62 63 #ifdef SMALL_SCREEN_DEVICE … … 161 162 _renderModePopUp->setSelected(sel); 162 163 } 163 164 165 _gammaSlider->setValue(ConfMan.getInt("gamma", _domain)); 166 _gammaLabel->setValue(_gammaSlider->getValue()); 167 _gammaLabel->draw(); 168 // Change gamma 169 g_system->setGamma(_gammaSlider->getValue() / 100.0f); 170 164 171 #ifndef SMALL_SCREEN_DEVICE 165 172 // Fullscreen setting 166 173 _fullscreenCheckbox->setState(ConfMan.getBool("fullscreen", _domain)); … … 284 291 285 292 if ((int32)_renderModePopUp->getSelectedTag() >= 0) 286 293 ConfMan.set("render_mode", Common::getRenderModeCode((Common::RenderMode)_renderModePopUp->getSelectedTag()), _domain); 294 ConfMan.setInt("gamma", _gammaSlider->getValue(), _domain); 287 295 } else { 288 296 ConfMan.removeKey("fullscreen", _domain); 289 297 ConfMan.removeKey("aspect_ratio", _domain); 290 298 ConfMan.removeKey("gfx_mode", _domain); 291 299 ConfMan.removeKey("render_mode", _domain); 300 ConfMan.removeKey("gamma", _domain); 292 301 } 293 302 } 294 303 … … 433 442 _subSpeedLabel->setValue(_subSpeedSlider->getValue()); 434 443 _subSpeedLabel->draw(); 435 444 break; 445 case kGammaChanged: 446 _gammaLabel->setValue(_gammaSlider->getValue()); 447 _gammaLabel->draw(); 448 // Change gamma 449 g_system->setGamma(_gammaSlider->getValue() / 100.0f); 450 break; 436 451 case kOKCmd: 437 452 setResult(1); 438 453 close(); … … 533 548 // Aspect ratio checkbox 534 549 _aspectCheckbox = new CheckboxWidget(boss, prefix + "grAspectCheckbox", "Aspect ratio correction", 0, 0); 535 550 551 _gammaSlider = new SliderWidget(boss, prefix + "grGammaSlider", kGammaChanged); 552 _gammaSlider->setMinValue(0); 553 _gammaSlider->setMaxValue(200); 554 _gammaLabel = new StaticTextWidget(boss, prefix + "gammaLabel", "100%"); 555 536 556 #ifdef SMALL_SCREEN_DEVICE 537 557 _fullscreenCheckbox->setState(true); 538 558 _fullscreenCheckbox->setEnabled(false); -
scummvm/trunk/gui/options.h
93 93 PopUpWidget *_gfxPopUp; 94 94 CheckboxWidget *_fullscreenCheckbox; 95 95 CheckboxWidget *_aspectCheckbox; 96 SliderWidget *_gammaSlider; 97 StaticTextWidget *_gammaLabel; 96 98 PopUpWidget *_renderModePopUp; 97 99 98 100 // -
scummvm/trunk/gui/themes/scummclassic/classic_layout.stx
176 176 <widget name = 'grFullscreenCheckbox' 177 177 type = 'Checkbox' 178 178 /> 179 <layout type = 'horizontal' padding = '0, 0, 0, 0'> 180 <widget name = 'grGammaSlider' 181 type = 'Slider' 182 /> 183 <widget name = 'gammaLabel' 184 type = 'SmallLabel' 185 /> 186 </layout> 179 187 </layout> 180 188 </dialog> 181 189 … … 464 472 height = 'Globals.Button.Height' 465 473 /> 466 474 <space size = '10'/> 475 <widget name = 'Load' 476 width = '150' 477 height = 'Globals.Button.Height' 478 /> 479 <widget name = 'Save' 480 width = '150' 481 height = 'Globals.Button.Height' 482 /> 483 <space size = '10'/> 467 484 <widget name = 'Options' 468 485 width = '150' 469 486 height = 'Globals.Button.Height' -
scummvm/trunk/gui/themes/scummclassic/classic_layout_320.stx
174 174 <widget name = 'grFullscreenCheckbox' 175 175 type = 'Checkbox' 176 176 /> 177 <layout type = 'horizontal' padding = '0, 0, 0, 0'> 178 <widget name = 'grGammaSlider' 179 type = 'Slider' 180 /> 181 <widget name = 'gammaLabel' 182 type = 'SmallLabel' 183 /> 184 </layout> 177 185 </layout> 178 186 </dialog> 179 187 … … 465 473 height = 'Globals.Button.Height' 466 474 /> 467 475 <space size = '4'/> 476 <widget name = 'Load' 477 width = '70' 478 height = 'Globals.Button.Height' 479 /> 480 <widget name = 'Save' 481 width = '70' 482 height = 'Globals.Button.Height' 483 /> 484 <space size = '4'/> 468 485 <widget name = 'Options' 469 486 width = '70' 470 487 height = 'Globals.Button.Height' -
scummvm/trunk/gui/themes/scummmodern/scummmodern_layout.stx
188 188 <widget name = 'grFullscreenCheckbox' 189 189 type = 'Checkbox' 190 190 /> 191 <layout type = 'horizontal' padding = '0, 0, 0, 0'> 192 <widget name = 'grGammaSlider' 193 type = 'Slider' 194 /> 195 <widget name = 'gammaLabel' 196 type = 'SmallLabel' 197 /> 198 </layout> 191 199 </layout> 192 200 </dialog> 193 201 … … 476 484 height = 'Globals.Button.Height' 477 485 /> 478 486 <space size = '10'/> 487 <widget name = 'Load' 488 width = '150' 489 height = 'Globals.Button.Height' 490 /> 491 <widget name = 'Save' 492 width = '150' 493 height = 'Globals.Button.Height' 494 /> 495 <space size = '10'/> 479 496 <widget name = 'Options' 480 497 width = '150' 481 498 height = 'Globals.Button.Height' -
scummvm/trunk/gui/themes/scummmodern/scummmodern_layout_320.stx
171 171 <widget name = 'grFullscreenCheckbox' 172 172 type = 'Checkbox' 173 173 /> 174 <layout type = 'horizontal' padding = '0, 0, 0, 0'> 175 <widget name = 'grGammaSlider' 176 type = 'Slider' 177 /> 178 <widget name = 'gammaLabel' 179 type = 'SmallLabel' 180 /> 181 </layout> 174 182 </layout> 175 183 </dialog> 176 184 … … 462 470 height = 'Globals.Button.Height' 463 471 /> 464 472 <space size = '4'/> 473 <widget name = 'Load' 474 width = '70' 475 height = 'Globals.Button.Height' 476 /> 477 <widget name = 'Save' 478 width = '70' 479 height = 'Globals.Button.Height' 480 /> 481 <space size = '4'/> 465 482 <widget name = 'Options' 466 483 width = '70' 467 484 height = 'Globals.Button.Height'