From 396c34d44bc2369953485de1b0d1dca4dd30337f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20G=C3=B6ffringmann?= Date: Thu, 3 Jul 2003 22:32:18 +0000 Subject: [PATCH] fixed showGameQuitMsg() and temporarily disabled sfx looping svn-id: r8728 --- sky/control.cpp | 31 +++++++++++++++++++++++-------- sky/control.h | 2 ++ sky/skydefs.h | 13 ------------- sky/sound.cpp | 4 ++-- 4 files changed, 27 insertions(+), 23 deletions(-) diff --git a/sky/control.cpp b/sky/control.cpp index 74ba6e403a2..14afe2ebed7 100644 --- a/sky/control.cpp +++ b/sky/control.cpp @@ -1313,21 +1313,21 @@ void SkyControl::showGameQuitMsg(bool useScreen) { uint8 *textBuf1 = (uint8*)malloc(GAME_SCREEN_WIDTH * 14 + sizeof(dataFileHeader)); uint8 *textBuf2 = (uint8*)malloc(GAME_SCREEN_WIDTH * 14 + sizeof(dataFileHeader)); - char *vText1, *vText2; + uint8 textNum; uint8 *screenData; if (useScreen) screenData = _skyScreen->giveCurrent(); else screenData = _screenBuf; switch (SkyState::_systemVars.language) { - case DE_DEU: vText1 = VIG_DE1; vText2 = VIG_DE2; break; - case FR_FRA: vText1 = VIG_FR1; vText2 = VIG_FR2; break; - case IT_ITA: vText1 = VIG_IT1; vText2 = VIG_IT2; break; - case PT_BRA: vText1 = VIG_PT1; vText2 = VIG_PT2; break; - default: vText1 = VIG_EN1; vText2 = VIG_EN2; break; + case DE_DEU: textNum = 1; break; + case FR_FRA: textNum = 2; break; + case IT_ITA: textNum = 4; break; + case PT_BRA: textNum = 5; break; + default: textNum = 0; break; } - _skyText->displayText(vText1, textBuf1, true, 320, 255); - _skyText->displayText(vText2, textBuf2, true, 320, 255); + _skyText->displayText(_quitTexts[textNum + 0], textBuf1, true, 320, 255); + _skyText->displayText(_quitTexts[textNum + 1], textBuf2, true, 320, 255); uint8 *curLine1 = textBuf1 + sizeof(dataFileHeader); uint8 *curLine2 = textBuf2 + sizeof(dataFileHeader); uint8 *targetLine = screenData + GAME_SCREEN_WIDTH * 80; @@ -1348,3 +1348,18 @@ void SkyControl::showGameQuitMsg(bool useScreen) { delay(1500); _system->quit(); } + +char SkyControl::_quitTexts[12][30] = { + "Game over player one", + "BE VIGILANT", + "Das Spiel ist aus.", + "SEI WACHSAM", + "Game over joueur 1", + "SOYEZ VIGILANTS", + "Spelet r slut, Agent 1.", + "VAR VAKSAM", + "Game over giocatore 1", + "SIATE VIGILANTI", + "Fim de jogo para o jogador um", + "BE VIGILANT" +}; diff --git a/sky/control.h b/sky/control.h index 44a9d44a048..40590828d77 100644 --- a/sky/control.h +++ b/sky/control.h @@ -245,6 +245,8 @@ private: SkyConResource *_upFastButton, *_upSlowButton, *_quitButton, *_restoreButton; SkyConResource *_savePanLookList[6], *_restorePanLookList[6]; + + static char _quitTexts[12][30]; }; #endif // CONTROL_H diff --git a/sky/skydefs.h b/sky/skydefs.h index 08a68227969..7e1fdc90014 100644 --- a/sky/skydefs.h +++ b/sky/skydefs.h @@ -26,19 +26,6 @@ //This file is incomplete, several flags still missing. -#define VIG_EN1 "Game over player one" -#define VIG_EN2 "BE VIGILANT" -#define VIG_DE1 "Das Spiel ist aus." -#define VIG_DE2 "SEI WACHSAM" -#define VIG_FR1 "Game over joueur 1" -#define VIG_FR2 "SOYEZ VIGILANTS" -#define VIG_SE1 "Spelet r slut, Agent 1." -#define VIG_SE2 "VAR VAKSAM" -#define VIG_IT1 "Game over giocatore 1" -#define VIG_IT2 "SIATE VIGILANTI" -#define VIG_PT1 "Fim de jogo para o jogador um" -#define VIG_PT2 "BE VIGILANT" - #define ST_COLLISION_BIT 5 #define S_COUNT 0 diff --git a/sky/sound.cpp b/sky/sound.cpp index 8eed6c863ba..6cd1ead09f5 100644 --- a/sky/sound.cpp +++ b/sky/sound.cpp @@ -1086,8 +1086,8 @@ void SkySound::playSound(uint16 sound, uint16 volume) { uint16 dataLoop = (_sfxInfo[(sound << 3) | 6] << 8) | _sfxInfo[(sound << 3) | 7]; byte flags = SoundMixer::FLAG_UNSIGNED; - if (dataSize == dataLoop) - flags |= SoundMixer::FLAG_LOOP; + /*if (dataSize == dataLoop) + flags |= SoundMixer::FLAG_LOOP;*/ if (_ingameSound > 0) _mixer->stop(_ingameSound - 1); _mixer->setVolume(volume);