[Scummvm-cvs-logs] CVS: scummvm/kyra gui.cpp,1.10,1.11 kyra.cpp,1.134,1.135 kyra.h,1.75,1.76 sprites.cpp,1.24,1.25
Oystein Eftevaag
vinterstum at users.sourceforge.net
Fri Jan 27 21:10:02 CET 2006
Update of /cvsroot/scummvm/scummvm/kyra
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27288
Modified Files:
gui.cpp kyra.cpp kyra.h sprites.cpp
Log Message:
Fixes the kyra GUI palette issues, implements background fading when the GUI's up,
and a couple of very minor optimizations.
Index: gui.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/kyra/gui.cpp,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- gui.cpp 27 Jan 2006 08:23:53 -0000 1.10
+++ gui.cpp 28 Jan 2006 05:09:38 -0000 1.11
@@ -403,6 +403,7 @@
}
_screen->savePageToDisk("SEENPAGE.TMP", 0);
+ gui_fadePalette();
calcCoords(_menu[0]);
calcCoords(_menu[1]);
@@ -425,6 +426,7 @@
}
if (_menuRestoreScreen) {
+ gui_restorePalette();
_screen->loadPageFromDisk("SEENPAGE.TMP", 0);
_animator->_updateScreen = true;
}
@@ -715,6 +717,7 @@
initMenu(_menu[0]);
processAllMenuButtons();
} else {
+ gui_restorePalette();
loadGame(getSavegameFilename(_gameToLoad));
_displayMenu = false;
_menuRestoreScreen = false;
@@ -724,7 +727,13 @@
void KyraEngine::gui_redrawTextfield() {
_screen->fillRect(38, 91, 287, 102, 250);
- _text->printText(_savegameName, 38, 91, 30, 0, 0);
+ _text->printText(_savegameName, 38, 92, 253, 0, 0);
+
+ _screen->_charWidth = -2;
+ int width = _screen->getTextWidth(_savegameName);
+ _screen->fillRect(39 + width, 93, 45 + width, 100, 254);
+ _screen->_charWidth = 0;
+
_screen->updateScreen();
}
@@ -830,8 +839,8 @@
int KyraEngine::gui_quitPlaying(Button *button) {
debug(9, "KyraEngine::gui_quitPlaying()");
-
processMenuButton(button);
+
if (gui_quitConfirm("Are you sure you want to quit playing?"))
quitGame();
else {
@@ -973,5 +982,29 @@
_text->printText(menu.item[i].itemString, textX, textY, menu.item[i].highlightColor, 0, 0);
}
+void KyraEngine::gui_fadePalette() {
+ static int16 menuPalIndexes[] = {248, 249, 250, 251, 252, 253, 254, -1};
+ int index = 0;
+
+ memcpy(_screen->getPalette(2), _screen->_currentPalette, 768);
+
+ for (int i = 0; i < 768; i++) {
+ _screen->_currentPalette[i] /= 2;
+ }
+
+ while( menuPalIndexes[index] != -1) {
+ memcpy(&_screen->_currentPalette[menuPalIndexes[index]*3], &_screen->getPalette(2)[menuPalIndexes[index]*3], 3);
+ index++;
+ }
+
+ _screen->fadePalette(_screen->_currentPalette, 2);
+}
+
+void KyraEngine::gui_restorePalette() {
+ memcpy(_screen->_currentPalette, _screen->getPalette(2), 768);
+ _screen->fadePalette(_screen->_currentPalette, 2);
+}
+
+
} // end of namespace Kyra
Index: kyra.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/kyra/kyra.cpp,v
retrieving revision 1.134
retrieving revision 1.135
diff -u -d -r1.134 -r1.135
--- kyra.cpp 27 Jan 2006 08:23:53 -0000 1.134
+++ kyra.cpp 28 Jan 2006 05:09:39 -0000 1.135
@@ -730,8 +730,6 @@
processButtonList(_buttonList);
updateMousePointer();
updateGameTimers();
- _sprites->updateSceneAnims();
- _animator->updateAllObjectShapes();
updateTextFade();
_handleInput = true;
Index: kyra.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/kyra/kyra.h,v
retrieving revision 1.75
retrieving revision 1.76
diff -u -d -r1.75 -r1.76
--- kyra.h 27 Jan 2006 08:23:53 -0000 1.75
+++ kyra.h 28 Jan 2006 05:09:39 -0000 1.76
@@ -687,6 +687,8 @@
void gui_processHighlights(Menu &menu);
void gui_updateSavegameString();
void gui_redrawTextfield();
+ void gui_fadePalette();
+ void gui_restorePalette();
uint8 _game;
bool _fastMode;
Index: sprites.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/kyra/sprites.cpp,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- sprites.cpp 18 Jan 2006 17:39:37 -0000 1.24
+++ sprites.cpp 28 Jan 2006 05:09:39 -0000 1.25
@@ -129,6 +129,9 @@
uint32 currTime = _system->getMillis();
uint8 *data;
bool endLoop;
+ uint16 rndNr;
+ uint16 anim;
+ uint16 sound;
for (int i = 0; i < MAX_NUM_ANIMS; i++) {
if (_anims[i].script == 0 || !_anims[i].play || _anims[i].nextRun != 0 && _anims[i].nextRun > currTime)
@@ -145,9 +148,6 @@
endLoop = false;
while (READ_LE_UINT16(data) != 0xFF87 && !endLoop) {
- uint16 rndNr;
- uint16 anim;
- uint16 sound;
assert((data - _anims[i].script) < _anims[i].length);
switch (READ_LE_UINT16(data)) {
case 0xFF88:
@@ -408,8 +408,8 @@
_engine->_northExitHeight = READ_LE_UINT16(_dat + 0x15);
if (_engine->_northExitHeight & 1)
_engine->_northExitHeight += 1;
- // XXX
- memcpy(_screen->_currentPalette + 745 - 0x3D, _dat + 0x17, 0x3D);
+ // XXX
+ memcpy(_screen->_currentPalette + 744 - 60, _dat + 0x17, 60);
uint8 *data = _dat + 0x6B;
uint16 length = READ_LE_UINT16(data);
More information about the Scummvm-git-logs
mailing list