[Scummvm-cvs-logs] SF.net SVN: scummvm: [23614] scummvm/trunk/engines/kyra
vinterstum at users.sourceforge.net
vinterstum at users.sourceforge.net
Fri Jul 28 13:43:12 CEST 2006
Revision: 23614
Author: vinterstum
Date: 2006-07-28 04:42:53 -0700 (Fri, 28 Jul 2006)
ViewCVS: http://svn.sourceforge.net/scummvm/?rev=23614&view=rev
Log Message:
-----------
Moves the kyra2 code to kyra2.cpp and kyra2.h, renames WSAMovieV3 to WSAMovie2 (kyra2 uses the same format), renames a define in kyra3.h for consistency, and adds a case for CMDS in the VQA player to avoid the constant warning (the tag is always present and empty). Credit/blame for the last one goes to Clemmy :). Starting kyra2 will now show the title animation.
Modified Paths:
--------------
scummvm/trunk/engines/kyra/kyra.cpp
scummvm/trunk/engines/kyra/kyra.h
scummvm/trunk/engines/kyra/kyra3.cpp
scummvm/trunk/engines/kyra/kyra3.h
scummvm/trunk/engines/kyra/module.mk
scummvm/trunk/engines/kyra/plugin.cpp
scummvm/trunk/engines/kyra/vqa.cpp
scummvm/trunk/engines/kyra/wsamovie.cpp
scummvm/trunk/engines/kyra/wsamovie.h
Added Paths:
-----------
scummvm/trunk/engines/kyra/kyra2.cpp
scummvm/trunk/engines/kyra/kyra2.h
Modified: scummvm/trunk/engines/kyra/kyra.cpp
===================================================================
--- scummvm/trunk/engines/kyra/kyra.cpp 2006-07-27 20:39:52 UTC (rev 23613)
+++ scummvm/trunk/engines/kyra/kyra.cpp 2006-07-28 11:42:53 UTC (rev 23614)
@@ -111,10 +111,6 @@
: KyraEngine(system) {
}
-KyraEngine_v2::KyraEngine_v2(OSystem *system)
- : KyraEngine(system) {
-}
-
int KyraEngine::init() {
// Setup mixer
if (!_mixer->isReady()) {
@@ -383,15 +379,11 @@
}
-KyraEngine_v2::~KyraEngine_v2() {
-}
-
void KyraEngine::errorString(const char *buf1, char *buf2) {
strcpy(buf2, buf1);
}
int KyraEngine::go() {
- _quitFlag = false;
if (_features & GF_FLOPPY && !(_features & GF_AMIGA)) {
_screen->loadFont(Screen::FID_6_FNT, "6.FNT");
@@ -419,15 +411,6 @@
return 0;
}
-int KyraEngine_v2::go() {
- // Kyra2 goes here :)
- loadPalette("palette.col", _screen->_currentPalette);
- _screen->setScreenPalette(_screen->_currentPalette);
- _screen->loadBitmap("_playfld.cps", 0, 0, 0);
- _screen->updateScreen();
- waitForEvent();
- return 0;
-}
void KyraEngine::startup() {
debugC(9, kDebugLevelMain, "KyraEngine::startup()");
Modified: scummvm/trunk/engines/kyra/kyra.h
===================================================================
--- scummvm/trunk/engines/kyra/kyra.h 2006-07-27 20:39:52 UTC (rev 23613)
+++ scummvm/trunk/engines/kyra/kyra.h 2006-07-28 11:42:53 UTC (rev 23614)
@@ -1014,16 +1014,6 @@
int setupGameFlags();
};
-class KyraEngine_v2 : public KyraEngine {
-public:
- KyraEngine_v2(OSystem *system);
- ~KyraEngine_v2();
-
- int setupGameFlags() { _game = GI_KYRA2; return 0; }
-
- int go();
-};
-
} // End of namespace Kyra
#endif
Added: scummvm/trunk/engines/kyra/kyra2.cpp
===================================================================
--- scummvm/trunk/engines/kyra/kyra2.cpp (rev 0)
+++ scummvm/trunk/engines/kyra/kyra2.cpp 2006-07-28 11:42:53 UTC (rev 23614)
@@ -0,0 +1,62 @@
+/* ScummVM - Scumm Interpreter
+ * Copyright (C) 2006 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#include "kyra/kyra.h"
+#include "kyra/kyra2.h"
+#include "kyra/screen.h"
+#include "kyra/wsamovie.h"
+
+#include "common/system.h"
+
+namespace Kyra {
+
+KyraEngine_v2::KyraEngine_v2(OSystem *system)
+ : KyraEngine(system) {
+}
+
+KyraEngine_v2::~KyraEngine_v2() {
+}
+
+int KyraEngine_v2::go() {
+ uint8 pal[768];
+
+ WSAMovieV2 *title = new WSAMovieV2(this);
+ title->open("title.WSA", 0, pal);
+ assert(title->opened());
+
+ _screen->setScreenPalette(pal);
+ title->setX(0); title->setY(0);
+ title->setDrawPage(0);
+ for (int i = 0; i < 26; ++i) {
+ uint32 nextRun = _system->getMillis() + 6 * _tickLength;
+ title->displayFrame(i);
+ _screen->updateScreen();
+ delayUntil(nextRun);
+ }
+
+ delete title;
+
+ waitForEvent();
+ return 0;
+}
+
+} // end of namespace Kyra
Property changes on: scummvm/trunk/engines/kyra/kyra2.cpp
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Rev Author URL Id
Name: svn:eol-style
+ native
Added: scummvm/trunk/engines/kyra/kyra2.h
===================================================================
--- scummvm/trunk/engines/kyra/kyra2.h (rev 0)
+++ scummvm/trunk/engines/kyra/kyra2.h 2006-07-28 11:42:53 UTC (rev 23614)
@@ -0,0 +1,40 @@
+/* ScummVM - Scumm Interpreter
+ * Copyright (C) 2006 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * $URL$
+ * $Id$
+ *
+ */
+
+#ifndef KYRA2_H
+#define KYRA2_H
+
+namespace Kyra {
+
+class KyraEngine_v2 : public KyraEngine {
+public:
+ KyraEngine_v2(OSystem *system);
+ ~KyraEngine_v2();
+
+ int setupGameFlags() { _game = GI_KYRA2; return 0; }
+
+ int go();
+};
+
+} // end of namespace Kyra
+
+#endif
Property changes on: scummvm/trunk/engines/kyra/kyra2.h
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Date Rev Author URL Id
Name: svn:eol-style
+ native
Modified: scummvm/trunk/engines/kyra/kyra3.cpp
===================================================================
--- scummvm/trunk/engines/kyra/kyra3.cpp 2006-07-27 20:39:52 UTC (rev 23613)
+++ scummvm/trunk/engines/kyra/kyra3.cpp 2006-07-28 11:42:53 UTC (rev 23614)
@@ -83,7 +83,7 @@
}
Movie *KyraEngine_v3::createWSAMovie() {
- return new WSAMovieV3(this);
+ return new WSAMovieV2(this);
}
int KyraEngine_v3::init() {
@@ -105,7 +105,7 @@
uint8 *pal = _screen->getPalette(1);
assert(pal);
- WSAMovieV3 *logo = new WSAMovieV3(this);
+ WSAMovieV2 *logo = new WSAMovieV2(this);
assert(logo);
logo->open("REVENGE.WSA", 1, pal);
assert(logo->opened());
@@ -293,7 +293,7 @@
#pragma mark -
-int KyraEngine_v3::handleMainMenu(WSAMovieV3 *logo) {
+int KyraEngine_v3::handleMainMenu(WSAMovieV2 *logo) {
debugC(9, kDebugLevelMain, "KyraEngine::handleMainMenu(%p)", (const void*)logo);
int command = -1;
Modified: scummvm/trunk/engines/kyra/kyra3.h
===================================================================
--- scummvm/trunk/engines/kyra/kyra3.h 2006-07-27 20:39:52 UTC (rev 23613)
+++ scummvm/trunk/engines/kyra/kyra3.h 2006-07-28 11:42:53 UTC (rev 23614)
@@ -20,15 +20,15 @@
*
*/
-#ifndef KYRA_KYRA3_H
-#define KYRA_KYRA3_H
+#ifndef KYRA3_H
+#define KYRA3_H
#include "kyra/kyra.h"
namespace Kyra {
// maybe subclass KyraEngine_v2 later
-class WSAMovieV3;
+class WSAMovieV2;
class KyraEngine_v3 : public KyraEngine {
public:
@@ -74,7 +74,7 @@
// gui/menu specific
private:
static const char *_mainMenuStrings[];
- int handleMainMenu(WSAMovieV3 *logo);
+ int handleMainMenu(WSAMovieV2 *logo);
void drawMainMenu(const char * const *strings, int select);
void drawMainBox(int x, int y, int w, int h, int fill);
Modified: scummvm/trunk/engines/kyra/module.mk
===================================================================
--- scummvm/trunk/engines/kyra/module.mk 2006-07-27 20:39:52 UTC (rev 23613)
+++ scummvm/trunk/engines/kyra/module.mk 2006-07-28 11:42:53 UTC (rev 23614)
@@ -6,6 +6,7 @@
gui.o \
items.o \
kyra.o \
+ kyra2.o \
kyra3.o \
plugin.o \
resource.o \
Modified: scummvm/trunk/engines/kyra/plugin.cpp
===================================================================
--- scummvm/trunk/engines/kyra/plugin.cpp 2006-07-27 20:39:52 UTC (rev 23613)
+++ scummvm/trunk/engines/kyra/plugin.cpp 2006-07-28 11:42:53 UTC (rev 23614)
@@ -20,6 +20,7 @@
*/
#include "kyra/kyra.h"
+#include "kyra/kyra2.h"
#include "kyra/kyra3.h"
#include "common/config-manager.h"
Modified: scummvm/trunk/engines/kyra/vqa.cpp
===================================================================
--- scummvm/trunk/engines/kyra/vqa.cpp 2006-07-27 20:39:52 UTC (rev 23613)
+++ scummvm/trunk/engines/kyra/vqa.cpp 2006-07-28 11:42:53 UTC (rev 23614)
@@ -398,6 +398,9 @@
}
break;
+ case MKID_BE('CMDS'): // Unused tag, always empty in kyra3
+ debugC(9, kDebugLevelMovie, "VQAMovie::open: skipping CMDS tag");
+ break;
default:
warning("VQAMovie::open: Unknown tag `%c%c%c%c'", (tag >> 24) & 0xFF, (tag >> 16) & 0xFF, (tag >> 8) & 0xFF, tag & 0xFF);
Modified: scummvm/trunk/engines/kyra/wsamovie.cpp
===================================================================
--- scummvm/trunk/engines/kyra/wsamovie.cpp 2006-07-27 20:39:52 UTC (rev 23613)
+++ scummvm/trunk/engines/kyra/wsamovie.cpp 2006-07-28 11:42:53 UTC (rev 23614)
@@ -208,9 +208,9 @@
#pragma mark -
-WSAMovieV3::WSAMovieV3(KyraEngine_v3 *vm) : WSAMovieV1(vm), _vm3(vm), _xAdd(0), _yAdd(0) {}
+WSAMovieV2::WSAMovieV2(KyraEngine *vm) : WSAMovieV1(vm), _xAdd(0), _yAdd(0) {}
-void WSAMovieV3::open(const char *filename, int unk1, uint8 *palBuf) {
+void WSAMovieV2::open(const char *filename, int unk1, uint8 *palBuf) {
debugC(9, kDebugLevelMovie, "WSAMovieV3::open('%s', %d, %p)", filename, unk1, (const void *)palBuf);
close();
Modified: scummvm/trunk/engines/kyra/wsamovie.h
===================================================================
--- scummvm/trunk/engines/kyra/wsamovie.h 2006-07-27 20:39:52 UTC (rev 23613)
+++ scummvm/trunk/engines/kyra/wsamovie.h 2006-07-28 11:42:53 UTC (rev 23614)
@@ -90,12 +90,9 @@
uint8 *_frameData;
};
-class KyraEngine_v3;
-
-// it could be possible that Kyrandia2 uses exactly the same format
-class WSAMovieV3 : public WSAMovieV1 {
+class WSAMovieV2 : public WSAMovieV1 {
public:
- WSAMovieV3(KyraEngine_v3 *vm);
+ WSAMovieV2(KyraEngine *vm);
void open(const char *filename, int unk1, uint8 *palette);
@@ -108,7 +105,6 @@
int width() const { return _width; }
int height() const { return _height; }
protected:
- KyraEngine_v3 *_vm3;
int16 _xAdd;
int16 _yAdd;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list