[Scummvm-cvs-logs] SF.net SVN: scummvm: [31560] scummvm/trunk/engines/kyra
athrxx at users.sourceforge.net
athrxx at users.sourceforge.net
Fri Apr 18 21:11:58 CEST 2008
Revision: 31560
http://scummvm.svn.sourceforge.net/scummvm/?rev=31560&view=rev
Author: athrxx
Date: 2008-04-18 12:11:58 -0700 (Fri, 18 Apr 2008)
Log Message:
-----------
- complete support for the playable HOF demo
Modified Paths:
--------------
scummvm/trunk/engines/kyra/kyra_v2.h
scummvm/trunk/engines/kyra/resource.cpp
scummvm/trunk/engines/kyra/resource.h
scummvm/trunk/engines/kyra/script_v2.cpp
scummvm/trunk/engines/kyra/staticres.cpp
Modified: scummvm/trunk/engines/kyra/kyra_v2.h
===================================================================
--- scummvm/trunk/engines/kyra/kyra_v2.h 2008-04-18 15:58:49 UTC (rev 31559)
+++ scummvm/trunk/engines/kyra/kyra_v2.h 2008-04-18 19:11:58 UTC (rev 31560)
@@ -1088,6 +1088,7 @@
int o2_isVoicePlaying(ScriptState *script);
int o2_stopVoicePlaying(ScriptState *script);
int o2_getGameLanguage(ScriptState *script);
+ int o2_demoFinale(ScriptState *script);
int o2_dummy(ScriptState *script);
// opcodes temporary
Modified: scummvm/trunk/engines/kyra/resource.cpp
===================================================================
--- scummvm/trunk/engines/kyra/resource.cpp 2008-04-18 15:58:49 UTC (rev 31559)
+++ scummvm/trunk/engines/kyra/resource.cpp 2008-04-18 19:11:58 UTC (rev 31560)
@@ -306,22 +306,24 @@
if (iter == _map.end())
return 0;
- if (!iter->_value.parent.empty()) {
- Common::SeekableReadStream *parent = getFileStream(iter->_value.parent);
- assert(parent);
+ Common::File *stream = new Common::File();
+ if (stream->open(file)) {
+ return stream;
+ } else {
+ delete stream;
+ if (!iter->_value.parent.empty()) {
+ Common::SeekableReadStream *parent = getFileStream(iter->_value.parent);
+ assert(parent);
- ResFileMap::const_iterator parentIter = _map.find(iter->_value.parent);
- const ResArchiveLoader *loader = getLoader(parentIter->_value.type);
- assert(loader);
+ ResFileMap::const_iterator parentIter = _map.find(iter->_value.parent);
+ const ResArchiveLoader *loader = getLoader(parentIter->_value.type);
+ assert(loader);
- return loader->loadFileFromArchive(file, parent, iter->_value);
- } else {
- Common::File *stream = new Common::File();
- if (!stream->open(file)) {
+ return loader->loadFileFromArchive(file, parent, iter->_value);
+ } else {
warning("Couldn't open file '%s'", file.c_str());
return 0;
}
- return stream;
}
return 0;
Modified: scummvm/trunk/engines/kyra/resource.h
===================================================================
--- scummvm/trunk/engines/kyra/resource.h 2008-04-18 15:58:49 UTC (rev 31559)
+++ scummvm/trunk/engines/kyra/resource.h 2008-04-18 19:11:58 UTC (rev 31560)
@@ -226,6 +226,7 @@
k2IngameTalkObjIndex,
k2IngameTimJpStrings,
k2IngameShapeAnimData,
+ k2IngameTlkDemoStrings,
kMaxResIDs
};
Modified: scummvm/trunk/engines/kyra/script_v2.cpp
===================================================================
--- scummvm/trunk/engines/kyra/script_v2.cpp 2008-04-18 15:58:49 UTC (rev 31559)
+++ scummvm/trunk/engines/kyra/script_v2.cpp 2008-04-18 19:11:58 UTC (rev 31560)
@@ -1748,6 +1748,40 @@
return _lang;
}
+int KyraEngine_v2::o2_demoFinale(ScriptState *script) {
+ debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_demoFinale(%p) ()", (const void *)script);
+ if (!_flags.isDemo)
+ return 0;
+
+ int tmpSize;
+ const char *const *strings = _staticres->loadStrings(k2IngameTlkDemoStrings, tmpSize);
+ assert(strings);
+
+ _screen->clearPage(0);
+ _screen->loadPalette("THANKS.COL", _screen->_currentPalette);
+ _screen->loadBitmap("THANKS.CPS", 3, 3, 0);
+ _screen->copyRegion(0, 0, 0, 0, 320, 200, 2, 0);
+
+ _screen->_curPage = 0;
+ _screen->setFont(Screen::FID_6_FNT);
+ int y = _lang == 1 ? 70 : 65;
+ for (int i = 0; i < 6; i++)
+ _text->printText(strings[i], _text->getCenterStringX(strings[i], 1, 319), y + i * 10, 255, 207, 0);
+
+ _screen->setScreenPalette(_screen->_currentPalette);
+ _screen->updateScreen();
+
+ _eventList.clear();
+ while (!skipFlag())
+ delay(10);
+
+ _sound->beginFadeOut();
+ _screen->fadeToBlack();
+
+ _runFlag = 0;
+ return 0;
+}
+
int KyraEngine_v2::o2_dummy(ScriptState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_v2::o2_dummy(%p) ()", (const void *)script);
return 0;
@@ -2023,8 +2057,8 @@
// 0xac
Opcode(o2_stopVoicePlaying),
Opcode(o2_getGameLanguage),
+ Opcode(o2_demoFinale),
Opcode(o2_dummy),
- Opcode(o2_dummy),
};
for (int i = 0; i < ARRAYSIZE(opcodeTable); ++i)
Modified: scummvm/trunk/engines/kyra/staticres.cpp
===================================================================
--- scummvm/trunk/engines/kyra/staticres.cpp 2008-04-18 15:58:49 UTC (rev 31559)
+++ scummvm/trunk/engines/kyra/staticres.cpp 2008-04-18 19:11:58 UTC (rev 31560)
@@ -39,7 +39,7 @@
namespace Kyra {
-#define RESFILE_VERSION 23
+#define RESFILE_VERSION 24
bool StaticResource::checkKyraDat() {
Common::File kyraDat;
@@ -257,6 +257,7 @@
{ k2IngameTalkObjIndex, kRawData, "I_TALKOBJECTS.MAP" },
{ k2IngameTimJpStrings, kStringList, "I_TIMJPSTR.TXT" },
{ k2IngameShapeAnimData, k2ShpAnimDataV2, "I_INVANIM.SHP" },
+ { k2IngameTlkDemoStrings, kLanguageList, "I_TLKDEMO.TXT." },
{ 0, 0, 0 }
};
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