[Scummvm-cvs-logs] CVS: scummvm/sky intro.h,NONE,1.1 intro.cpp,1.31,1.32 module.mk,1.18,1.19 sky.cpp,1.98,1.99 sky.h,1.46,1.47 cd_intro.cpp,1.13,NONE
Robert G?ffringmann
lavosspawn at users.sourceforge.net
Wed Jul 16 17:18:31 CEST 2003
Update of /cvsroot/scummvm/scummvm/sky
In directory sc8-pr-cvs1:/tmp/cvs-serv20607/sky
Modified Files:
intro.cpp module.mk sky.cpp sky.h
Added Files:
intro.h
Removed Files:
cd_intro.cpp
Log Message:
reprogrammed sky intros.
--- NEW FILE: intro.h ---
/* ScummVM - Scumm Interpreter
* Copyright (C) 2003 The ScummVM project
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
* $Header: /cvsroot/scummvm/scummvm/sky/intro.h,v 1.1 2003/07/17 00:17:42 lavosspawn Exp $
*
*/
#ifndef INTRO_H
#define INTRO_H
#include "sky/screen.h"
#include "sky/disk.h"
class SkyIntro {
public:
SkyIntro(SkyDisk *disk, SkyScreen *screen, SkyMusicBase *music, SkySound *sound, SkyText *text, SoundMixer *mixer, OSystem *system);
~SkyIntro(void);
bool doIntro(bool floppyIntro);
bool _quitProg;
private:
static uint16 _mainIntroSeq[];
static uint16 _floppyIntroSeq[];
static uint16 _cdIntroSeq[];
SkyDisk *_skyDisk;
SkyScreen *_skyScreen;
SkyMusicBase *_skyMusic;
SkySound *_skySound;
SkyText *_skyText;
OSystem *_system;
SoundMixer *_mixer;
uint8 *_textBuf, *_saveBuf;
uint8 *_bgBuf;
uint32 _bgSize;
PlayingSoundHandle _voice, _bgSfx;
bool escDelay(uint32 msecs);
bool nextPart(uint16 *&data);
bool floppyScrollFlirt(void);
bool commandFlirt(uint16 *&data);
void showTextBuf(void);
void restoreScreen(void);
};
#endif // INTRO_H
Index: intro.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sky/intro.cpp,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -d -r1.31 -r1.32
--- intro.cpp 7 Jul 2003 16:40:27 -0000 1.31
+++ intro.cpp 17 Jul 2003 00:17:42 -0000 1.32
@@ -20,503 +20,881 @@
*/
#include "stdafx.h"
-#include <string.h>
-#include "common/scummsys.h"
-#include "sky/skydefs.h"
+#include "sky/intro.h"
#include "sky/sky.h"
-#define FREE_IF_NOT_0(ptr) if (ptr != NULL) { free (ptr); ptr = 0; }
-#define REMOVE_INTRO commandPtr = (uint32 *)zeroCommands; \
[...1298 lines suppressed...]
- _mixer->stopAll();
- _skySound->playSound(1, (uint16)(cmdPtr[2] & 0x7F), 0);
- cmdPtr += 3;
+ OSystem::Event event;
+ do {
+ while (_system->poll_event(&event)) {
+ if (event.event_code == OSystem::EVENT_KEYDOWN) {
+ if (event.kbd.keycode == 27)
+ return false;
+ } else if (event.event_code == OSystem::EVENT_QUIT) {
+ _quitProg = true;
+ return false;
+ }
+ }
+ uint8 nDelay = (msecs > 50)?(50):((uint8)msecs);
+ _system->delay_msecs(nDelay);
+ msecs -= nDelay;
+ } while (msecs > 0);
+ return true;
}
Index: module.mk
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sky/module.mk,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- module.mk 5 Jul 2003 02:52:11 -0000 1.18
+++ module.mk 17 Jul 2003 00:17:42 -0000 1.19
@@ -2,7 +2,6 @@
MODULE_OBJS = \
sky/autoroute.o \
- sky/cd_intro.o \
sky/compact.o \
sky/debug.o \
sky/disk.o \
Index: sky.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sky/sky.cpp,v
retrieving revision 1.98
retrieving revision 1.99
diff -u -d -r1.98 -r1.99
--- sky.cpp 15 Jul 2003 16:40:24 -0000 1.98
+++ sky.cpp 17 Jul 2003 00:17:42 -0000 1.99
@@ -92,9 +92,6 @@
_detector = detector;
_floppyIntro = detector->_floppyIntro;
-
- _introTextSpace = 0;
- _introTextSave = 0;
}
SkyState::~SkyState() {
@@ -111,6 +108,12 @@
strcpy(buf2, buf1);
}
+void SkyState::initVirgin() {
+
+ _skyScreen->setPalette(60111);
+ _skyScreen->showScreen(60110);
+}
+
uint8 SkyState::_languageTable[11] = {
SKY_USA, // EN_USA
SKY_GERMAN, // DE_DEU
@@ -179,11 +182,15 @@
bool introSkipped = false;
if (!_quickLaunch) {
- if (_systemVars.gameVersion > 267) // don't do intro for floppydemos
- introSkipped = !intro();
-
- _skyDisk->flushPrefetched();
-
+ if (_systemVars.gameVersion > 267) {// don't do intro for floppydemos
+ _skyIntro = new SkyIntro(_skyDisk, _skyScreen, _skyMusic, _skySound, _skyText, _mixer, _system);
+ introSkipped = !_skyIntro->doIntro(_floppyIntro);
+ if (_skyIntro->_quitProg) {
+ delete _skyIntro;
+ _skyControl->showGameQuitMsg();
+ }
+ delete _skyIntro;
+ }
loadBase0();
}
Index: sky.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sky/sky.h,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -d -r1.46 -r1.47
--- sky.h 15 Jul 2003 16:40:24 -0000 1.46
+++ sky.h 17 Jul 2003 00:17:42 -0000 1.47
@@ -38,6 +38,7 @@
#include "sky/music/mt32music.h"
#include "sky/mouse.h"
#include "sky/control.h"
+#include "sky/intro.h"
#include "common/config-file.h"
struct SystemVars {
@@ -55,6 +56,7 @@
class SkyLogic;
class SkyScreen;
class SkyControl;
+class SkyIntro;
class SkyState : public Engine {
void errorString(const char *buf_input, char *buf_output);
@@ -63,12 +65,6 @@
byte _key_pressed;
static uint8 _languageTable[11];
bool _quickLaunch; // set when starting with -x
-
- //intro related
-
- byte *_introTextSpace;
- byte *_introTextSave;
-
bool _floppyIntro;
uint16 _debugMode;
@@ -92,6 +88,7 @@
SkyControl *_skyControl;
SkyMusicBase *_skyMusic;
+ SkyIntro *_skyIntro;
GameDetector *_detector; // necessary for music
public:
@@ -108,13 +105,6 @@
static SystemVars _systemVars;
- //intro related
- void prepareText(uint32 *&cmdPtr);
- void showIntroText(uint32 *&cmdPtr);
- void removeText(uint32 *&cmdPtr);
- void introFx(uint32 *&cmdPtr);
- void introVol(uint32 *&cmdPtr);
-
protected:
void logic_engine();
void delay(uint amount);
@@ -122,12 +112,8 @@
void doCheat(uint8 num);
void handleKey(void);
- //intro related
static uint8 fosterImg[297 * 143];
static uint8 fosterPal[256 * 3];
- void checkCommands(uint32 *&cmdPtr);
- void introFrame(uint8 **diffPtr, uint8 **vgaPtr, uint8 *screenData);
- void escDelay(uint32 pDelay);
uint32 _lastSaveTime;
SkyText *getSkyText();
@@ -135,17 +121,12 @@
void initItemList();
void initVirgin();
- bool intro();
- bool doCDIntro();
- void startTimerSequence(byte *sequence);
static void timerHandler(void *ptr);
void gotTimerTick();
void loadFixedItems();
void loadBase0();
static int CDECL game_thread_proc(void *param);
-
- void shutdown();
};
#endif
--- cd_intro.cpp DELETED ---
More information about the Scummvm-git-logs
mailing list