SCUMM HE: Started code for loading FOW resources

This commit is contained in:
Eugene Sandulenko 2016-05-10 17:12:13 +02:00
parent 35335b253e
commit 543920a1d6
8 changed files with 28 additions and 4 deletions

View File

@ -186,6 +186,11 @@ Common::String ScummEngine_v70he::generateFilename(const int room) const {
}
if (_filenamePattern.genMethod == kGenHEPC || _filenamePattern.genMethod == kGenHEIOS) {
if (id == '3' && _game.id == GID_MOONBASE) {
result = Common::String::format("%s.u32", _filenamePattern.pattern);
break;
}
// For HE >= 98, we already called snprintf above.
if (_game.heversion < 98 || room < 0)
result = Common::String::format("%s.he%c", _filenamePattern.pattern, id);

View File

@ -27,8 +27,6 @@
#ifdef ENABLE_HE
#include "scumm/he/floodfill_he.h"
#include "scumm/he/wiz_he.h"
#include "scumm/he/moonbase/moonbase.h"
#endif
#include "scumm/actor_he.h" // For AuxBlock & AuxEntry
@ -186,6 +184,8 @@ protected:
};
#ifdef ENABLE_HE
class Moonbase;
class ScummEngine_v71he : public ScummEngine_v70he {
friend class Wiz;
friend class Moonbase;

View File

@ -22,6 +22,7 @@
#include "scumm/he/intern_he.h"
#include "scumm/he/logic_he.h"
#include "scumm/he/moonbase/moonbase.h"
namespace Scumm {
@ -214,7 +215,7 @@ void LogicHEmoonbase::op_set_fow_information(int op, int numArgs, int32 *args) {
}
int LogicHEmoonbase::op_set_fow_image(int op, int numArgs, int32 *args) {
debug(2, "STUB: op_set_fow_image(%d)", args[0]);
debug(2, "op_set_fow_image(%d)", args[0]);
return _vm->_moonbase->setFOWImage(args[0]) ? 1 : 0;
}

View File

@ -21,6 +21,7 @@
*/
#include "scumm/he/intern_he.h"
#include "scumm/he/moonbase/moonbase.h"
namespace Scumm {

View File

@ -25,6 +25,8 @@
#ifdef ENABLE_HE
#include "common/winexe_pe.h"
namespace Scumm {
class Moonbase {
@ -86,6 +88,9 @@ private:
bool _fowBlackMode;
int _fowRenderTable[32768];
Common::PEResources _exe;
Common::String _fileName;
};
#endif

View File

@ -21,7 +21,9 @@
*/
#include "common/config-manager.h"
#include "scumm/he/intern_he.h"
#include "scumm/he/moonbase/moonbase.h"
namespace Scumm {
@ -108,10 +110,18 @@ bool Moonbase::setFOWImage(int image) {
// PIECES BUBBLES CIRCLES SIMPLE* WEDGEY BUBBLE2
// WEDGE2 SPIKEY ANGLES SMOOTHED WUZZY SYS7-BEVELED
if (image >= -1 && image <= 12)
if (image >= -12 && image <= -1)
resType = 210 - image; // 211-222 range
else
resType = 214; // default, SIMPLE
if (_fileName.empty()) { // We are running for the first time
_fileName = _vm->generateFilename(-3);
if (!_exe.loadFromEXE(_fileName))
error("Cannot open file %s", _fileName.c_str());
}
#if 0 // TODO
HRSRC hResource = FindResource(g_hInst, resType, 10);
if (hResource) {

View File

@ -31,6 +31,7 @@
#include "scumm/scumm.h"
#include "scumm/util.h"
#include "scumm/he/wiz_he.h"
#include "scumm/he/moonbase/moonbase.h"
namespace Scumm {

View File

@ -66,6 +66,7 @@
#include "scumm/players/player_v5m.h"
#include "scumm/resource.h"
#include "scumm/he/resource_he.h"
#include "scumm/he/moonbase/moonbase.h"
#include "scumm/scumm_v0.h"
#include "scumm/scumm_v8.h"
#include "scumm/sound.h"