mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-24 21:21:05 +00:00
BBVS: Support for the Loogie demo
This commit is contained in:
parent
1aa0367b8a
commit
886e3544e3
@ -177,6 +177,20 @@ Common::Error BbvsEngine::run() {
|
||||
_spriteModule = new SpriteModule();
|
||||
_sound = new SoundMan();
|
||||
|
||||
if (isLoogieDemo()) {
|
||||
Minigame *minigame = new MinigameBbLoogie(this);
|
||||
|
||||
minigame->run(true);
|
||||
|
||||
delete minigame;
|
||||
delete _sound;
|
||||
delete _spriteModule;
|
||||
delete _gameModule;
|
||||
delete _screen;
|
||||
|
||||
return Common::kNoError;
|
||||
}
|
||||
|
||||
allocSnapshot();
|
||||
|
||||
newGame();
|
||||
|
@ -229,6 +229,8 @@ public:
|
||||
const Common::String getTargetName() { return _targetName; }
|
||||
const ADGameDescription *_gameDescription;
|
||||
|
||||
bool isLoogieDemo() const;
|
||||
|
||||
private:
|
||||
Graphics::PixelFormat _pixelFormat;
|
||||
|
||||
|
@ -34,8 +34,16 @@ static const PlainGameDescriptor bbvsGames[] = {
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
||||
enum BBVSGameFeatures {
|
||||
GF_LOOGIE_DEMO = (1 << 0)
|
||||
};
|
||||
|
||||
namespace Bbvs {
|
||||
|
||||
bool BbvsEngine::isLoogieDemo() const {
|
||||
return _gameDescription->flags & GF_LOOGIE_DEMO;
|
||||
}
|
||||
|
||||
static const ADGameDescription gameDescriptions[] = {
|
||||
{
|
||||
"bbvs",
|
||||
@ -46,6 +54,7 @@ static const ADGameDescription gameDescriptions[] = {
|
||||
ADGF_DROPPLATFORM,
|
||||
GUIO1(GUIO_NOMIDI)
|
||||
},
|
||||
|
||||
{
|
||||
"bbvs",
|
||||
"Demo",
|
||||
@ -55,6 +64,17 @@ static const ADGameDescription gameDescriptions[] = {
|
||||
ADGF_DEMO | ADGF_DROPPLATFORM,
|
||||
GUIO1(GUIO_NOMIDI)
|
||||
},
|
||||
|
||||
{
|
||||
"bbvs",
|
||||
"Loogie Demo",
|
||||
AD_ENTRY1s("BBLOOGIE.000", "607d3bf55ec6458dce484473b1eecb4d", 324416),
|
||||
Common::EN_ANY,
|
||||
Common::kPlatformWindows,
|
||||
GF_LOOGIE_DEMO | ADGF_DEMO | ADGF_DROPPLATFORM,
|
||||
GUIO1(GUIO_NOMIDI)
|
||||
},
|
||||
|
||||
{
|
||||
"bbvs",
|
||||
0,
|
||||
|
@ -1310,6 +1310,12 @@ void MinigameBbLoogie::playRndSound() {
|
||||
|
||||
bool MinigameBbLoogie::run(bool fromMainGame) {
|
||||
|
||||
if (!_vm->isLoogieDemo()) {
|
||||
Common::strlcpy(_prefix, "bbloogie/", 20);
|
||||
} else {
|
||||
_prefix[0] = 0;
|
||||
}
|
||||
|
||||
memset(_objects, 0, sizeof(_objects));
|
||||
|
||||
_numbersAnim = getAnimation(9);
|
||||
@ -1336,7 +1342,7 @@ bool MinigameBbLoogie::run(bool fromMainGame) {
|
||||
initVars();
|
||||
|
||||
_spriteModule = new SpriteModule();
|
||||
_spriteModule->load("bbloogie/bbloogie.000");
|
||||
_spriteModule->load(Common::String::format("%sbbloogie.000", _prefix).c_str());
|
||||
|
||||
Palette palette = _spriteModule->getPalette();
|
||||
_vm->_screen->setPalette(palette);
|
||||
@ -1399,12 +1405,12 @@ void MinigameBbLoogie::update() {
|
||||
void MinigameBbLoogie::loadSounds() {
|
||||
if (_vm->_gameDescription->flags & ADGF_DEMO) {
|
||||
for (uint i = 0; i < kDemoSoundFilenamesCount; ++i) {
|
||||
Common::String filename = Common::String::format("bbloogie/%s", kDemoSoundFilenames[i]);
|
||||
Common::String filename = Common::String::format("%s%s", _prefix, kDemoSoundFilenames[i]);
|
||||
_vm->_sound->loadSound(filename.c_str());
|
||||
}
|
||||
} else {
|
||||
for (uint i = 0; i < kSoundFilenamesCount; ++i) {
|
||||
Common::String filename = Common::String::format("bbloogie/%s", kSoundFilenames[i]);
|
||||
Common::String filename = Common::String::format("%s%s", _prefix, kSoundFilenames[i]);
|
||||
_vm->_sound->loadSound(filename.c_str());
|
||||
}
|
||||
}
|
||||
|
@ -82,6 +82,8 @@ public:
|
||||
int _principalCtr, _principalFirstFrameIndex, _principalLastFrameIndex;
|
||||
bool _principalAngry;
|
||||
|
||||
char _prefix[20];
|
||||
|
||||
const ObjAnimation *getAnimation(int animIndex);
|
||||
|
||||
void buildDrawList(DrawList &drawList);
|
||||
|
Loading…
x
Reference in New Issue
Block a user