diff options
author | Martin Kiewitz | 2009-10-14 12:53:57 +0000 |
---|---|---|
committer | Martin Kiewitz | 2009-10-14 12:53:57 +0000 |
commit | 2284932e359a48277821e95eeedf2da61eebe7f1 (patch) | |
tree | 07b6cecd2a895a0798f9da0ca32450ae027d52e5 /engines | |
parent | d9de73e725b1bf5a3734260757ad6d0283079723 (diff) | |
download | scummvm-rg350-2284932e359a48277821e95eeedf2da61eebe7f1.tar.gz scummvm-rg350-2284932e359a48277821e95eeedf2da61eebe7f1.tar.bz2 scummvm-rg350-2284932e359a48277821e95eeedf2da61eebe7f1.zip |
SCI/newgui: changed step-count to half to minimize cpu load
svn-id: r45075
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sci/gui/gui_transitions.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/engines/sci/gui/gui_transitions.cpp b/engines/sci/gui/gui_transitions.cpp index 0e22f41b5f..b7507051be 100644 --- a/engines/sci/gui/gui_transitions.cpp +++ b/engines/sci/gui/gui_transitions.cpp @@ -90,29 +90,31 @@ void SciGuiTransitions::setNewScreen() { g_system->updateScreen(); } +// Note: dont do too many steps in here, otherwise cpu will crap out because of the load void SciGuiTransitions::fadeOut() { byte oldPalette[4 * 256], workPalette[4 * 256]; int16 stepNr, colorNr; g_system->grabPalette(oldPalette, 0, 256); - for (stepNr = 100; stepNr >= 0; stepNr -= 5) { + for (stepNr = 100; stepNr >= 0; stepNr -= 10) { for (colorNr = 0; colorNr < 256; colorNr++){ workPalette[colorNr * 4 + 0] = oldPalette[colorNr * 4] * stepNr / 100; workPalette[colorNr * 4 + 1] = oldPalette[colorNr * 4 + 1] * stepNr / 100; workPalette[colorNr * 4 + 2] = oldPalette[colorNr * 4 + 2] * stepNr / 100; } g_system->setPalette(workPalette, 0, 256); - _gui->wait(1); + _gui->wait(2); } } +// Note: dont do too many steps in here, otherwise cpu will crap out because of the load void SciGuiTransitions::fadeIn() { byte workPalette[4 * 256]; GuiPalette *newPalette = &_palette->_sysPalette; int16 stepNr, colorNr; - for (stepNr = 0; stepNr <= 100; stepNr += 5) { + for (stepNr = 0; stepNr <= 100; stepNr += 10) { for (colorNr = 0; colorNr < 256; colorNr++){ workPalette[colorNr * 4 + 0] = newPalette->colors[colorNr].r * stepNr / 100; workPalette[colorNr * 4 + 1] = newPalette->colors[colorNr].g * stepNr / 100; @@ -120,7 +122,7 @@ void SciGuiTransitions::fadeIn() { workPalette[colorNr * 4 + 3] = 100; } g_system->setPalette(workPalette, 0, 256); - _gui->wait(1); + _gui->wait(2); } } |