aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/bbvs/bbvs.cpp98
-rw-r--r--engines/bbvs/bbvs.h78
-rw-r--r--engines/bbvs/detection.cpp2
-rw-r--r--engines/bbvs/dialogs.cpp8
-rw-r--r--engines/bbvs/dialogs.h6
-rw-r--r--engines/bbvs/gamemodule.cpp40
-rw-r--r--engines/bbvs/gamemodule.h50
-rw-r--r--engines/bbvs/graphics.cpp4
-rw-r--r--engines/bbvs/minigames/bbairguitar.cpp62
-rw-r--r--engines/bbvs/minigames/bbairguitar.h34
-rw-r--r--engines/bbvs/minigames/bbant.cpp64
-rw-r--r--engines/bbvs/minigames/bbant.h26
-rw-r--r--engines/bbvs/minigames/bbloogie.cpp68
-rw-r--r--engines/bbvs/minigames/bbloogie.h36
-rw-r--r--engines/bbvs/minigames/bbtennis.cpp44
-rw-r--r--engines/bbvs/minigames/bbtennis.h22
-rw-r--r--engines/bbvs/minigames/minigame.cpp6
-rw-r--r--engines/bbvs/minigames/minigame.h14
-rw-r--r--engines/bbvs/saveload.cpp26
-rw-r--r--engines/bbvs/scene.cpp20
-rw-r--r--engines/bbvs/spritemodule.cpp12
-rw-r--r--engines/bbvs/videoplayer.cpp4
-rw-r--r--engines/bbvs/walk.cpp24
23 files changed, 374 insertions, 374 deletions
diff --git a/engines/bbvs/bbvs.cpp b/engines/bbvs/bbvs.cpp
index d2e13e525c..11e4b6cea7 100644
--- a/engines/bbvs/bbvs.cpp
+++ b/engines/bbvs/bbvs.cpp
@@ -60,7 +60,7 @@ static const BBPoint kInventorySlotPositions[] = {
{135, 93}, {134, 145}, { 96, 224}, {128, 224}, {160, 224},
{192, 224}, {224, 224}, {240, 224}, {256, 224}, { 0, 0}
};
-
+
static const BBRect kVerbRects[6] = {
{-32, -2, 19, 27}, {-33, -33, 19, 27}, { 12, -2, 19, 27},
{ 13, -33, 19, 27}, {-10, 8, 19, 27}, {-11, -49, 19, 27}
@@ -77,7 +77,7 @@ bool WalkArea::contains(const Common::Point &pt) const {
BbvsEngine::BbvsEngine(OSystem *syst, const ADGameDescription *gd) :
Engine(syst), _gameDescription(gd) {
-
+
_random = new Common::RandomSource("bbvs");
_currActionCommandIndex = -1;
_buttheadObject = nullptr;
@@ -148,14 +148,14 @@ Common::Error BbvsEngine::run() {
_gameModule = new GameModule();
_spriteModule = new SpriteModule();
_sound = new SoundMan();
-
+
allocSnapshot();
memset(_easterEggInput, 0, sizeof(_easterEggInput));
-
+
_gameTicks = 0;
_playVideoNumber = 0;
_bootSaveSlot = -1;
-
+
memset(_inventoryItemStatus, 0, sizeof(_inventoryItemStatus));
memset(_gameVars, 0, sizeof(_gameVars));
memset(_sceneVisited, 0, sizeof(_sceneVisited));
@@ -189,7 +189,7 @@ Common::Error BbvsEngine::run() {
_playVideoNumber = 0;
}
}
-
+
writeContinueSavegame();
freeSnapshot();
@@ -282,20 +282,20 @@ void BbvsEngine::updateGame() {
inputTicks = 1;
_gameTicks = _system->getMillis();
}
-
+
if (inputTicks > 20) {
inputTicks = 20;
_gameTicks = _system->getMillis();
}
-
+
if (inputTicks == 0)
return;
-
+
if (_mouseX >= 320 || _mouseY >= 240) {
_mouseY = -1;
_mouseX = -1;
}
-
+
bool done;
do {
@@ -304,14 +304,14 @@ void BbvsEngine::updateGame() {
_mouseButtons &= ~kRightButtonClicked;
_keyCode = Common::KEYCODE_INVALID;
} while (--inputTicks && _playVideoNumber == 0 && _gameTicks > 0 && !done);
-
+
if (!done && _playVideoNumber == 0 && _gameTicks > 0) {
DrawList drawList;
buildDrawList(drawList);
_screen->drawDrawList(drawList, _spriteModule);
drawScreen();
}
-
+
_system->delayMillis(10);
}
@@ -329,7 +329,7 @@ void BbvsEngine::updateBackgroundSounds() {
_backgroundSoundsActive[i] = 0;
}
}
-}
+}
bool BbvsEngine::update(int mouseX, int mouseY, uint mouseButtons, Common::KeyCode keyCode) {
@@ -339,7 +339,7 @@ bool BbvsEngine::update(int mouseX, int mouseY, uint mouseButtons, Common::KeyCo
_bootSaveSlot = -1;
return false;
}
-
+
if (_newSceneNum != 0) {
_gameTicks = 0;
return changeScene();
@@ -413,7 +413,7 @@ bool BbvsEngine::update(int mouseX, int mouseY, uint mouseButtons, Common::KeyCo
}
updateInventory(mouseButtons & kLeftButtonClicked);
break;
-
+
case kGSVerbs:
_isSaveAllowed = false;
updateVerbs();
@@ -426,7 +426,7 @@ bool BbvsEngine::update(int mouseX, int mouseY, uint mouseButtons, Common::KeyCo
}
}
break;
-
+
case kGSWait:
case kGSWaitDialog:
_isSaveAllowed = false;
@@ -438,14 +438,14 @@ bool BbvsEngine::update(int mouseX, int mouseY, uint mouseButtons, Common::KeyCo
else
updateCommon();
break;
-
+
case kGSDialog:
_isSaveAllowed = true;
saveSnapshot();
updateDialog(mouseButtons & kLeftButtonClicked);
updateCommon();
break;
-
+
}
return true;
@@ -503,7 +503,7 @@ void BbvsEngine::buildDrawList(DrawList &drawList) {
// Verbs background
drawList.add(_gameModule->getGuiSpriteIndex(13), _verbPos.x - _cameraPos.x,
_verbPos.y - _cameraPos.y, 500);
- // Selected inventory item
+ // Selected inventory item
if (_currInventoryItem >= 0) {
drawList.add(_gameModule->getInventoryItemSpriteIndex(2 * _currInventoryItem), _verbPos.x - _cameraPos.x,
_verbPos.y - _cameraPos.y + 27, 500);
@@ -538,7 +538,7 @@ void BbvsEngine::updateVerbs() {
_mouseCursorSpriteIndex = 0;
return;
}
-
+
for (int i = 0; i < 6; ++i) {
const BBRect &verbRect = kVerbRects[i];
const int16 x = _verbPos.x + verbRect.x;
@@ -551,7 +551,7 @@ void BbvsEngine::updateVerbs() {
break;
}
}
-
+
switch (_currVerbNum) {
case kVerbLook:
case kVerbUse:
@@ -585,7 +585,7 @@ void BbvsEngine::updateDialog(bool clicked) {
_gameState = kGSScene;
return;
}
-
+
int slotX = (_mousePos.x - _cameraPos.x) / 32;
if (slotX >= _dialogSlotCount) {
@@ -597,7 +597,7 @@ void BbvsEngine::updateDialog(bool clicked) {
_mouseCursorSpriteIndex = _gameModule->getGuiSpriteIndex(5);
_activeItemType = kITDialog;
-
+
// Find the selected dialog item index
for (int i = 0; i < 50 && slotX >= 0; ++i) {
if (_dialogItemStatus[i]) {
@@ -605,7 +605,7 @@ void BbvsEngine::updateDialog(bool clicked) {
_activeItemIndex = i;
}
}
-
+
// Select the dialog item action if it was clicked
if (clicked) {
for (int i = 0; i < _gameModule->getActionsCount(); ++i) {
@@ -622,7 +622,7 @@ void BbvsEngine::updateDialog(bool clicked) {
}
void BbvsEngine::updateInventory(bool clicked) {
-
+
Common::Rect kInvButtonRects[3] = {
Common::Rect(97, 13, 97 + 20, 13 + 26),
Common::Rect(135, 15, 135 + 46, 15 + 25),
@@ -636,10 +636,10 @@ void BbvsEngine::updateInventory(bool clicked) {
if (_currVerbNum != kVerbLook && _currVerbNum != kVerbUse && _currVerbNum != kVerbInvItem)
_currVerbNum = kVerbUse;
-
+
const int16 mx = _mousePos.x - _cameraPos.x;
const int16 my = _mousePos.y - _cameraPos.y;
-
+
// Check inventory exit left/right edge of screen
if (mx < 40 || mx > 280) {
_mouseCursorSpriteIndex = _gameModule->getGuiSpriteIndex(10);
@@ -652,7 +652,7 @@ void BbvsEngine::updateInventory(bool clicked) {
return;
}
- // Check hovered/clicked inventory button
+ // Check hovered/clicked inventory button
_inventoryButtonIndex = -1;
if (kInvButtonRects[0].contains(mx, my)) {
_inventoryButtonIndex = 0;
@@ -677,10 +677,10 @@ void BbvsEngine::updateInventory(bool clicked) {
// Find hovered/clicked inventory item
int currItem = -1;
-
+
if (_currVerbNum == kVerbInvItem)
currItem = _currInventoryItem;
-
+
_activeItemType = kITEmpty;
for (int i = 0; i < 50; ++i) {
@@ -769,7 +769,7 @@ void BbvsEngine::updateScene(bool clicked) {
}
}
}
-
+
for (int i = 0; i < _gameModule->getBgObjectsCount(); ++i) {
BgObject *bgObject = _gameModule->getBgObject(i);
if (lastPriority <= bgObject->rect.bottom && bgObject->rect.contains(_mousePos)) {
@@ -921,7 +921,7 @@ bool BbvsEngine::performActionCommand(ActionCommand *actionCommand) {
return false;
case kActionCmdWalkObject:
- {
+ {
SceneObject *sceneObject = &_sceneObjects[actionCommand->sceneObjectIndex];
debug(5, "[%s] walks from (%d, %d) to (%d, %d)", sceneObject->sceneObjectDef->name,
sceneObject->x >> 16, sceneObject->y >> 16, actionCommand->walkDest.x, actionCommand->walkDest.y);
@@ -998,14 +998,14 @@ bool BbvsEngine::performActionCommand(ActionCommand *actionCommand) {
bool BbvsEngine::processCurrAction() {
bool actionsFinished = false;
-
+
if (_sceneObjectActions.size() == 0) {
-
+
for (uint i = 0; i < _currAction->actionCommands.size(); ++i) {
ActionCommand *actionCommand = &_currAction->actionCommands[i];
if (actionCommand->timeStamp != 0)
break;
-
+
if (actionCommand->cmd == kActionCmdMoveObject || actionCommand->cmd == kActionCmdAnimObject) {
SceneObjectAction *sceneObjectAction = 0;
// See if there's already an entry for the SceneObject
@@ -1027,14 +1027,14 @@ bool BbvsEngine::processCurrAction() {
sceneObjectAction->animationIndex = actionCommand->param;
}
}
-
+
if (actionCommand->cmd == kActionCmdSetCameraPos) {
_currCameraNum = actionCommand->param;
_newCameraPos = _gameModule->getCameraInit(actionCommand->param)->cameraPos;
}
}
-
+
// Delete entries for SceneObjects without anim
for (uint i = 0; i < _sceneObjectActions.size();) {
if (!_sceneObjects[_sceneObjectActions[i].sceneObjectIndex].anim)
@@ -1107,7 +1107,7 @@ void BbvsEngine::updateCommon() {
if (doActionCommands) {
ActionCommand *actionCommand = &_currAction->actionCommands[_currActionCommandIndex];
-
+
while (actionCommand->timeStamp == _currActionCommandTimeStamp &&
_currActionCommandIndex < (int)_currAction->actionCommands.size()) {
if (!performActionCommand(actionCommand)) {
@@ -1161,7 +1161,7 @@ void BbvsEngine::updateCommon() {
}
updateWalkObject(sceneObject);
}
-
+
if (sceneObject->walkCount > 0 && sceneObject->turnCount == 0) {
debug(5, "walk step, xIncr: %d, yIncr: %d", sceneObject->xIncr, sceneObject->yIncr);
sceneObject->x += sceneObject->xIncr;
@@ -1226,7 +1226,7 @@ void BbvsEngine::updateCommon() {
}
}
}
-
+
if (_cameraPos.x < _newCameraPos.x)
++_cameraPos.x;
if (_cameraPos.x > _newCameraPos.x)
@@ -1235,7 +1235,7 @@ void BbvsEngine::updateCommon() {
++_cameraPos.y;
if (_cameraPos.y > _newCameraPos.y)
--_cameraPos.y;
-
+
// Check if Butthead is inside a scene exit
if (_newSceneNum == 0 && !_currAction && _buttheadObject) {
int16 buttheadX = _buttheadObject->x >> 16;
@@ -1314,13 +1314,13 @@ void BbvsEngine::stopSounds() {
bool BbvsEngine::runMinigame(int minigameNum) {
debug(0, "BbvsEngine::runMinigame() minigameNum: %d", minigameNum);
-
+
bool fromMainGame = _currSceneNum != kMainMenu;
-
+
_sound->unloadSounds();
-
+
Minigame *minigame = 0;
-
+
switch (minigameNum) {
case kMinigameBbLoogie:
minigame = new MinigameBbLoogie(this);
@@ -1338,9 +1338,9 @@ bool BbvsEngine::runMinigame(int minigameNum) {
error("Incorrect minigame number %d", minigameNum);
break;
}
-
+
bool minigameResult = minigame->run(fromMainGame);
-
+
delete minigame;
// Check if the principal was hit with a megaloogie in the loogie minigame
@@ -1370,11 +1370,11 @@ void BbvsEngine::checkEasterEgg(char key) {
"SKCUS",
"NAMTAH"
};
-
+
static const int kEasterEggLengths[] = {
7, 5, 5, 6
};
-
+
if (_currSceneNum == kCredits) {
memcpy(&_easterEggInput[1], &_easterEggInput[0], 6);
_easterEggInput[0] = key;
diff --git a/engines/bbvs/bbvs.h b/engines/bbvs/bbvs.h
index 6a9a13905c..bbd8046a8b 100644
--- a/engines/bbvs/bbvs.h
+++ b/engines/bbvs/bbvs.h
@@ -149,7 +149,7 @@ struct BBPoint {
struct BBRect {
int16 x, y, width, height;
-};
+};
struct BBPolygon {
const BBPoint *points;
@@ -229,66 +229,66 @@ public:
private:
const ADGameDescription *_gameDescription;
Graphics::PixelFormat _pixelFormat;
-public:
+public:
Common::RandomSource *_random;
-
+
GameModule *_gameModule;
SpriteModule *_spriteModule;
SoundMan *_sound;
-
+
Screen *_screen;
-
+
int _bootSaveSlot;
-
+
int _mouseX, _mouseY;
uint _mouseButtons;
Common::KeyCode _keyCode;
-
+
int _mouseCursorSpriteIndex;
int _gameState;
int _gameTicks;
-
+
Common::Point _mousePos;
Common::Point _verbPos;
Common::Point _walkMousePos;
-
+
int _activeItemType;
int _activeItemIndex;
int _currTalkObjectIndex;
-
+
Common::Point _cameraPos, _newCameraPos;
-
+
int _newSceneNum, _prevSceneNum, _currSceneNum;
int _playVideoNumber;
-
+
int _dialogSlotCount;
byte _dialogItemStatus[kDialogItemStatusCount];
-
+
byte _gameVars[kGameVarsCount];
byte _sceneVisited[kSceneVisitedCount];
int _currVerbNum;
-
+
int _currInventoryItem;
byte _inventoryItemStatus[kInventoryItemStatusCount];
int _inventoryButtonIndex;
-
+
Action *_currAction;
uint32 _currActionCommandTimeStamp;
int _currActionCommandIndex;
-
+
Common::Array<Action*> _walkAreaActions;
-
+
SceneObject _sceneObjects[kSceneObjectsCount];
Common::Array<SceneObjectAction> _sceneObjectActions;
-
+
SceneObject *_buttheadObject, *_beavisObject;
int _currCameraNum;
-
+
byte _backgroundSoundsActive[kSceneSoundsCount];
Audio::SoundHandle _speechSoundHandle;
-
+
int _walkAreasCount;
WalkArea _walkAreas[80];
int _walkInfosCount;
@@ -298,40 +298,40 @@ public:
Common::Rect _tempWalkableRects1[256];
Common::Rect _tempWalkableRects2[256];
WalkInfo *_walkInfoPtrs[256];
-
+
WalkArea *_sourceWalkArea, *_destWalkArea;
Common::Point _sourceWalkAreaPt, _destWalkAreaPt, _finalWalkPt;
int _currWalkDistance;
bool _walkReachedDestArea;
-
+
bool _hasSnapshot;
byte *_snapshot;
Common::SeekableMemoryWriteStream *_snapshotStream;
-
+
char _easterEggInput[7];
-
+
void updateEvents();
int getRandom(int max);
void drawDebugInfo();
void drawScreen();
-
+
void updateGame();
bool evalCondition(Conditions &conditions);
bool evalCameraCondition(Conditions &conditions, int value);
int evalDialogCondition(Conditions &conditions);
void evalActionResults(ActionResults &results);
-
+
void updateBackgroundSounds();
void loadScene(int sceneNum);
void initScene(bool sounds);
- bool changeScene();
+ bool changeScene();
bool update(int mouseX, int mouseY, uint mouseButtons, Common::KeyCode keyCode);
-
+
void buildDrawList(DrawList &drawList);
-
+
void updateVerbs();
void updateDialog(bool clicked);
void updateInventory(bool clicked);
@@ -342,7 +342,7 @@ public:
void skipCurrAction();
void updateCommon();
-
+
void updateWalkableRects();
void startWalkObject(SceneObject *sceneObject);
void updateWalkObject(SceneObject *sceneObject);
@@ -360,20 +360,20 @@ public:
void walkFindPath(WalkArea *sourceWalkArea, int infoCount);
int calcDistance(const Common::Point &pt1, const Common::Point &pt2);
void walkFoundPath(int count);
-
+
void updateSceneObjectsTurnValue();
void updateDialogConditions();
-
- void playSpeech(int soundNum);
+
+ void playSpeech(int soundNum);
void stopSpeech();
-
+
void playSound(uint soundNum, bool loop = false);
void stopSound(uint soundNum);
void stopSounds();
-
+
bool runMinigame(int minigameNum);
void playVideo(int videoNum);
-
+
void runMainMenu();
void checkEasterEgg(char key);
@@ -409,13 +409,13 @@ public:
bool existsSavegame(int num);
static Common::String getSavegameFilename(const Common::String &target, int num);
static kReadSaveHeaderError readSaveHeader(Common::SeekableReadStream *in, bool loadThumbnail, SaveHeader &header);
-
+
void allocSnapshot();
void freeSnapshot();
void saveSnapshot();
-
+
void writeContinueSavegame();
-
+
};
} // End of namespace Bbvs
diff --git a/engines/bbvs/detection.cpp b/engines/bbvs/detection.cpp
index e7383163f5..3e247aad99 100644
--- a/engines/bbvs/detection.cpp
+++ b/engines/bbvs/detection.cpp
@@ -133,7 +133,7 @@ SaveStateDescriptor BbvsMetaEngine::querySaveMetaInfos(const char *target, int s
Bbvs::BbvsEngine::kReadSaveHeaderError error;
error = Bbvs::BbvsEngine::readSaveHeader(in, true, header);
delete in;
- if (error == Bbvs::BbvsEngine::kRSHENoError) {
+ if (error == Bbvs::BbvsEngine::kRSHENoError) {
SaveStateDescriptor desc(slot, header.description);
// Slot 0 is used for the "Continue" save
desc.setDeletableFlag(slot != 0);
diff --git a/engines/bbvs/dialogs.cpp b/engines/bbvs/dialogs.cpp
index 5247a58ec8..af95f06c1e 100644
--- a/engines/bbvs/dialogs.cpp
+++ b/engines/bbvs/dialogs.cpp
@@ -34,7 +34,7 @@ struct MenuButton {
static const MenuButton kMenuButtons[] = {
// Main menu
- {"New Game", kCmdNewGame},
+ {"New Game", kCmdNewGame},
{"Continue", kCmdContinue},
{"Options", kCmdOptions},
{"Mini Games", kCmdMiniGames},
@@ -61,7 +61,7 @@ MainMenu::~MainMenu() {
}
void MainMenu::init() {
- _buttons[0] = new GUI::ButtonWidget(this, 0, 0, 1, 1, "", 0, 0);
+ _buttons[0] = new GUI::ButtonWidget(this, 0, 0, 1, 1, "", 0, 0);
_buttons[1] = new GUI::ButtonWidget(this, 0, 0, 1, 1, "", 0, 0);
_buttons[2] = new GUI::ButtonWidget(this, 0, 0, 1, 1, "", 0, 0);
_buttons[3] = new GUI::ButtonWidget(this, 0, 0, 1, 1, "", 0, 0);
@@ -76,14 +76,14 @@ void MainMenu::reflowLayout() {
const int buttonWidth = screenW * 70 / 320;
const int buttonHeight = screenH * 14 / 240;
const int buttonPadding = screenW * 3 / 320;
-
+
_w = 2 * buttonWidth + buttonPadding;
_h = 3 * buttonHeight + 3 * buttonPadding;
_x = (screenW - _w) / 2;
_y = screenH - _h;
int x = 0, y = 0;
-
+
x = 0;
y = 0;
_buttons[0]->resize(x, y, buttonWidth, buttonHeight);
diff --git a/engines/bbvs/dialogs.h b/engines/bbvs/dialogs.h
index 2dce2a110b..7db0b182b7 100644
--- a/engines/bbvs/dialogs.h
+++ b/engines/bbvs/dialogs.h
@@ -67,13 +67,13 @@ protected:
BbvsEngine *_vm;
void init();
-
+
GUI::ButtonWidget *_buttons[5];
-
+
void gotoMenuScreen(int index);
bool canContinue();
void gotoScene(int sceneNum);
-
+
};
}
diff --git a/engines/bbvs/gamemodule.cpp b/engines/bbvs/gamemodule.cpp
index d6343084ab..80f0e81450 100644
--- a/engines/bbvs/gamemodule.cpp
+++ b/engines/bbvs/gamemodule.cpp
@@ -39,11 +39,11 @@ GameModule::~GameModule() {
void GameModule::load(const char *filename) {
debug(0, "GameModule::load()");
-
+
unload();
Common::File fd;
-
+
if (!fd.open(filename))
error("GameModule::load() Could not open %s", filename);
@@ -68,7 +68,7 @@ void GameModule::load(const char *filename) {
fd.seek(0x1A8);
_buttheadObjectIndex = fd.readUint32LE();
-
+
fd.close();
debug(0, "GameModule::load() OK");
@@ -177,7 +177,7 @@ int GameModule::getBgSpritePriority(int index) {
int GameModule::getSceneSoundsCount() {
return _sceneSoundsCount;
}
-
+
SceneSound *GameModule::getSceneSound(int index) {
assert(index < _sceneSoundsCount);
return &_sceneSounds[index];
@@ -257,7 +257,7 @@ void GameModule::unload() {
void GameModule::loadBgSprites(Common::SeekableReadStream &s) {
debug(0, "GameModule::loadBgSprites()");
-
+
s.seek(0x14);
_bgSpriteCount = s.readUint32LE();
uint32 bgSpriteIndicesOffs = s.readUint32LE();
@@ -275,7 +275,7 @@ void GameModule::loadBgSprites(Common::SeekableReadStream &s) {
void GameModule::loadCameraInits(Common::SeekableReadStream &s) {
debug(0, "GameModule::loadCameraInits()");
-
+
s.seek(0x20);
for (int i = 0; i < kCameraInitsCount; ++i) {
CameraInit &cameraInit = _cameraInits[i];
@@ -283,13 +283,13 @@ void GameModule::loadCameraInits(Common::SeekableReadStream &s) {
for (int j = 0; j < 8; ++j)
cameraInit.cameraLinks[j] = s.readByte();
for (int j = 0; j < 8; ++j)
- cameraInit.rects[j] = readRect(s);
+ cameraInit.rects[j] = readRect(s);
}
}
void GameModule::loadWalkRects(Common::SeekableReadStream &s) {
debug(0, "GameModule::loadWalkRects()");
-
+
s.seek(0x150);
_walkRectsCount = s.readUint32LE();
uint32 offs = s.readUint32LE();
@@ -301,7 +301,7 @@ void GameModule::loadWalkRects(Common::SeekableReadStream &s) {
void GameModule::loadSceneExits(Common::SeekableReadStream &s) {
debug(0, "GameModule::loadSceneExits()");
-
+
s.seek(0x158);
_sceneExitsCount = s.readUint32LE();
uint32 offs = s.readUint32LE();
@@ -329,13 +329,13 @@ void GameModule::loadBgObjects(Common::SeekableReadStream &s) {
void GameModule::loadAnimations(Common::SeekableReadStream &s) {
debug(0, "GameModule::loadAnimations()");
-
+
s.seek(0x168);
_animationsCount = s.readUint32LE();
uint32 offs = s.readUint32LE();
_animations = new Animation[_animationsCount];
for (int i = 0; i < _animationsCount; ++i) {
- Animation &anim = _animations[i];
+ Animation &anim = _animations[i];
s.seek(offs + i * 20);
anim.frameCount = s.readUint32LE();
uint32 frameSpriteIndicesOffs = s.readUint32LE();
@@ -363,7 +363,7 @@ void GameModule::loadAnimations(Common::SeekableReadStream &s) {
void GameModule::loadSceneObjectDefs(Common::SeekableReadStream &s) {
debug(0, "GameModule::loadSceneObjectDefs()");
-
+
s.seek(0x170);
_sceneObjectDefsCount = s.readUint32LE();
uint32 offs = s.readUint32LE();
@@ -379,7 +379,7 @@ void GameModule::loadSceneObjectDefs(Common::SeekableReadStream &s) {
void GameModule::loadSceneObjectInits(Common::SeekableReadStream &s) {
debug(0, "GameModule::loadSceneObjectInits()");
-
+
s.seek(0x178);
_sceneObjectInitsCount = s.readUint32LE();
uint32 offs = s.readUint32LE();
@@ -396,7 +396,7 @@ void GameModule::loadSceneObjectInits(Common::SeekableReadStream &s) {
void GameModule::loadActions(Common::SeekableReadStream &s) {
debug(0, "GameModule::loadActions()");
-
+
s.seek(0x180);
_actionsCount = s.readUint32LE();
uint32 offs = s.readUint32LE();
@@ -427,7 +427,7 @@ void GameModule::loadActions(Common::SeekableReadStream &s) {
void GameModule::loadGuiSpriteIndices(Common::SeekableReadStream &s) {
debug(0, "GameModule::loadGuiSpriteIndices()");
-
+
s.seek(0x188);
uint32 offs = s.readUint32LE();
s.seek(offs);
@@ -437,7 +437,7 @@ void GameModule::loadGuiSpriteIndices(Common::SeekableReadStream &s) {
void GameModule::loadInventoryItemSpriteIndices(Common::SeekableReadStream &s) {
debug(0, "GameModule::loadInventoryItemSpriteIndices()");
-
+
s.seek(0x18C);
uint32 offs = s.readUint32LE();
s.seek(offs);
@@ -447,7 +447,7 @@ void GameModule::loadInventoryItemSpriteIndices(Common::SeekableReadStream &s) {
void GameModule::loadInventoryItemInfos(Common::SeekableReadStream &s) {
debug(0, "GameModule::loadInventoryItemInfos()");
-
+
s.seek(0x190);
uint32 offs = s.readUint32LE();
s.seek(offs);
@@ -462,7 +462,7 @@ void GameModule::loadInventoryItemInfos(Common::SeekableReadStream &s) {
void GameModule::loadDialogItemSpriteIndices(Common::SeekableReadStream &s) {
debug(0, "GameModule::loadDialogItemSpriteIndices()");
-
+
s.seek(0x194);
uint32 offs = s.readUint32LE();
s.seek(offs);
@@ -473,7 +473,7 @@ void GameModule::loadDialogItemSpriteIndices(Common::SeekableReadStream &s) {
void GameModule::loadSceneSounds(Common::SeekableReadStream &s) {
debug(0, "GameModule::loadSceneSounds()");
-
+
s.seek(0x1A0);
_sceneSoundsCount = s.readUint32LE();
uint32 offs = s.readUint32LE();
@@ -487,7 +487,7 @@ void GameModule::loadSceneSounds(Common::SeekableReadStream &s) {
void GameModule::loadPreloadSounds(Common::SeekableReadStream &s) {
debug(0, "GameModule::loadPreloadSounds()");
-
+
s.seek(0x198);
_preloadSoundsCount = s.readUint32LE();
uint32 offs = s.readUint32LE();
diff --git a/engines/bbvs/gamemodule.h b/engines/bbvs/gamemodule.h
index 4d4f5b90a1..b31b95dcee 100644
--- a/engines/bbvs/gamemodule.h
+++ b/engines/bbvs/gamemodule.h
@@ -134,29 +134,29 @@ class GameModule {
public:
GameModule();
~GameModule();
-
+
void load(const char *filename);
-
+
int getFieldC();
int getButtheadObjectIndex();
-
+
int getGuiSpriteIndex(int index);
int getInventoryItemSpriteIndex(int index);
int getDialogItemSpriteIndex(int index);
-
+
int getActionsCount();
Action *getAction(int index);
-
+
InventoryItemInfo *getInventoryItemInfo(int index);
CameraInit *getCameraInit(int cameraNum);
-
+
int getSceneExitsCount();
SceneExit *getSceneExit(int index);
-
+
int getWalkRectsCount();
Common::Rect *getWalkRects();
-
+
int getSceneObjectDefsCount();
SceneObjectDef *getSceneObjectDef(int index);
@@ -170,44 +170,44 @@ public:
int getBgSpriteIndex(int index);
int getBgSpritePriority(int index);
- int getSceneSoundsCount();
+ int getSceneSoundsCount();
SceneSound *getSceneSound(int index);
- uint getSceneSoundIndex(uint soundNum);
-
+ uint getSceneSoundIndex(uint soundNum);
+
uint getPreloadSoundsCount();
uint getPreloadSound(uint index);
Animation *getAnimation(int index);
-
+
protected:
-
+
int _bgSpriteCount;
int *_bgSpriteIndices;
int16 *_bgSpritePriorities;
-
+
CameraInit _cameraInits[kCameraInitsCount];
-
+
int _walkRectsCount;
Common::Rect *_walkRects;
-
+
int _sceneExitsCount;
SceneExit *_sceneExits;
-
+
int _bgObjectsCount;
BgObject *_bgObjects;
-
+
int _animationsCount;
Animation *_animations;
-
+
int _sceneObjectDefsCount;
SceneObjectDef *_sceneObjectDefs;
-
+
int _sceneObjectInitsCount;
SceneObjectInit *_sceneObjectInits;
int _actionsCount;
Action *_actions;
-
+
int _sceneSoundsCount;
SceneSound *_sceneSounds;
@@ -218,16 +218,16 @@ protected:
int _inventoryItemSpriteIndices[kInventoryItemSpriteCount];
InventoryItemInfo _inventoryItemInfos[kInventoryItemCount];
int _dialogItemSpriteIndices[kDialogItemSpriteCount];
-
+
int _fieldC;
int _buttheadObjectIndex;
Common::Point readPoint(Common::SeekableReadStream &s);
Common::Rect readRect(Common::SeekableReadStream &s);
Conditions readConditions(Common::SeekableReadStream &s);
-
+
void unload();
-
+
void loadBgSprites(Common::SeekableReadStream &s);
void loadCameraInits(Common::SeekableReadStream &s);
void loadWalkRects(Common::SeekableReadStream &s);
@@ -243,7 +243,7 @@ protected:
void loadDialogItemSpriteIndices(Common::SeekableReadStream &s);
void loadSceneSounds(Common::SeekableReadStream &s);
void loadPreloadSounds(Common::SeekableReadStream &s);
-
+
};
} // End of namespace Bbvs
diff --git a/engines/bbvs/graphics.cpp b/engines/bbvs/graphics.cpp
index 810d910abf..43840607c8 100644
--- a/engines/bbvs/graphics.cpp
+++ b/engines/bbvs/graphics.cpp
@@ -104,9 +104,9 @@ void Screen::drawSprite(Sprite &sprite, int x, int y) {
}
if (destX + width >= _surface->w)
width = _surface->w - destX;
-
+
debug(0, "drawSprite() (%d, %d, %d, %d); skipX: %d; skipY: %d; %d", destX, destY, width, height, skipX, skipY, sprite.type);
-
+
if (sprite.type == 1) {
for (int yc = 0; yc < height; ++yc) {
byte *source = sprite.getRow(skipY + yc);
diff --git a/engines/bbvs/minigames/bbairguitar.cpp b/engines/bbvs/minigames/bbairguitar.cpp
index f2e42313e3..1984dbb0fd 100644
--- a/engines/bbvs/minigames/bbairguitar.cpp
+++ b/engines/bbvs/minigames/bbairguitar.cpp
@@ -198,12 +198,12 @@ void MinigameBbAirGuitar::buildDrawList1(DrawList &drawList) {
if (_trackBarX > kTrackBarMaxX)
_trackBarX = kTrackBarMaxX;
-
+
_trackBarThumbRect.top = 208;
_trackBarThumbRect.bottom = 218;
_trackBarThumbRect.left = _trackBarX;
_trackBarThumbRect.right = _trackBarX + 6;
-
+
drawList.add(_objects[5].anim->frameIndices[0], _trackBarX, 208, 100);
if (_playerMode != 0) {
@@ -228,7 +228,7 @@ void MinigameBbAirGuitar::buildDrawList1(DrawList &drawList) {
drawList.add(_objects[i].anim->frameIndices[frameIndex], kPointsTbl2[i - 47].x, kPointsTbl2[i - 47].y, 254);
}
}
-
+
if (_backgroundSpriteIndex > 0)
drawList.add(_backgroundSpriteIndex, 0, 0, 0);
@@ -394,7 +394,7 @@ void MinigameBbAirGuitar::initObjects1() {
_track[0].noteNum = -1;
stop();
changePatch(0);
-
+
}
bool MinigameBbAirGuitar::updateStatus(int mouseX, int mouseY, uint mouseButtons) {
@@ -408,7 +408,7 @@ bool MinigameBbAirGuitar::updateStatus(int mouseX, int mouseY, uint mouseButtons
}
bool MinigameBbAirGuitar::updateStatus0(int mouseX, int mouseY, uint mouseButtons) {
-
+
if (mouseButtons & kAnyButtonDown) {
stopSound(1);
_rockTunePlaying = false;
@@ -436,14 +436,14 @@ bool MinigameBbAirGuitar::updateStatus0(int mouseX, int mouseY, uint mouseButton
}
}
-
+
return true;
}
bool MinigameBbAirGuitar::updateStatus1(int mouseX, int mouseY, uint mouseButtons) {
-
+
int currTicks = _vm->_system->getMillis();
-
+
if (_playerMode == 1 && _track[_trackIndex].ticks <= currTicks - _noteStartTime) {
noteOff(_track[_trackIndex].noteNum);
if (_trackIndex < _trackCount && _track[++_trackIndex].noteNum != -1)
@@ -481,17 +481,17 @@ bool MinigameBbAirGuitar::updateStatus1(int mouseX, int mouseY, uint mouseButton
} else {
++_vuMeterRight2;
}
-
+
if (_resetAnims && _vm->_system->getMillis() - _noteStartTime >= 1000)
resetObjs();
-
+
_objects[0].x = mouseX;
_objects[0].y = mouseY;
-
+
_trackBarMouseX = CLIP(mouseX, kTrackBarMinX, kTrackBarMaxX);
-
+
bool checkClick = false;
-
+
if (mouseButtons & kAnyButtonClicked) {
checkClick = true;
} else if (!(mouseButtons & kAnyButtonDown)) {
@@ -506,14 +506,14 @@ bool MinigameBbAirGuitar::updateStatus1(int mouseX, int mouseY, uint mouseButton
}
} else if (!_movingTrackBar)
checkClick = true;
-
+
if (checkClick) {
afterButtonReleased();
_objects[0].frameIndex = 1;
-
+
if (ptInRect(&kRect2, mouseX, mouseY)) {
-
+
if (_playerMode != 1 && ptInRect(&kPianoRect, mouseX, mouseY)) {
for (int i = 0; i <= 12; ++i) {
if (ptInPoly(&kPianoKeyAreas[i], mouseX, mouseY)) {
@@ -538,7 +538,7 @@ bool MinigameBbAirGuitar::updateStatus1(int mouseX, int mouseY, uint mouseButton
break;
}
}
-
+
if (playerButtonNum >= 0) {
_currButtonNum = playerButtonNum;
_currPlayerButtonRect = &kPlayerButtonRects[playerButtonNum];
@@ -673,12 +673,12 @@ bool MinigameBbAirGuitar::updateStatus1(int mouseX, int mouseY, uint mouseButton
}
}
}
-
+
if (_buttonClickTicks + 1000 < currTicks)
_buttonClickTicks = currTicks;
-
+
int newKind = _buttonClickTicks + 500 < currTicks ? 1 : 0;
-
+
switch (_playerMode) {
case 1:
@@ -770,20 +770,20 @@ bool MinigameBbAirGuitar::run(bool fromMainGame) {
_gameResult = false;
_gameDone = false;
initObjects();
-
+
_spriteModule = new SpriteModule();
_spriteModule->load("bbairg/bbairg.000");
Palette palette = _spriteModule->getPalette();
_vm->_screen->setPalette(palette);
-
+
loadSounds();
-
+
while (!_vm->shouldQuit() &&!_gameDone) {
_vm->updateEvents();
update();
}
-
+
_vm->_sound->unloadSounds();
delete _spriteModule;
@@ -803,15 +803,15 @@ void MinigameBbAirGuitar::update() {
inputTicks = 1;
_gameTicks = _vm->_system->getMillis();
}
-
+
if (_vm->_keyCode == Common::KEYCODE_ESCAPE) {
_gameDone = true;
return;
}
-
+
if (inputTicks == 0)
return;
-
+
bool done;
do {
@@ -820,9 +820,9 @@ void MinigameBbAirGuitar::update() {
_vm->_mouseButtons &= ~kRightButtonClicked;
_vm->_keyCode = Common::KEYCODE_INVALID;
} while (--inputTicks && _gameTicks > 0 && !done);
-
+
drawSprites();
-
+
_vm->_system->delayMillis(10);
}
@@ -1001,7 +1001,7 @@ void MinigameBbAirGuitar::calcTotalTicks1() {
}
void MinigameBbAirGuitar::noteOn(int noteNum) {
-
+
if (_currNoteNum != -2) {
if (noteNum == _currNoteNum)
return;
@@ -1087,7 +1087,7 @@ void MinigameBbAirGuitar::noteOn(int noteNum) {
}
void MinigameBbAirGuitar::noteOff(int noteNum) {
-
+
if (_currNoteNum != noteNum)
return;
diff --git a/engines/bbvs/minigames/bbairguitar.h b/engines/bbvs/minigames/bbairguitar.h
index d4fd6ec30c..40b8a50a03 100644
--- a/engines/bbvs/minigames/bbairguitar.h
+++ b/engines/bbvs/minigames/bbairguitar.h
@@ -32,7 +32,7 @@ public:
MinigameBbAirGuitar(BbvsEngine *vm) : Minigame(vm) {};
bool run(bool fromMainGame);
public:
-
+
struct Obj {
int kind;
int x, y;
@@ -44,24 +44,24 @@ public:
int16 frameIndexAdd;
int16 unk2;
};
-
+
enum {
kMaxObjectsCount = 256,
kMaxTracks = 2049
};
-
+
struct PianoKeyInfo {
int x, y;
int frameIndex;
};
-
+
struct TrackEvt {
int8 noteNum;
int16 ticks;
};
-
+
Obj _objects[kMaxObjectsCount];
-
+
int _playerMode;
bool _modified;
@@ -82,24 +82,24 @@ public:
int *_currFrameIndex;
int _btn3KindToggle;
-
+
const BBPolygon *_currPianoKeyArea;
const Rect *_currPlayerButtonRect;
-
+
bool _movingTrackBar;
int _trackBarMouseX;
int _trackBarX;
Rect _trackBarThumbRect;
-
+
int _currTrackPos, _totalTrackLength;
int _ticksDelta;
-
+
int _actionStartTrackPos, _actionTrackPos;
int _actionStartTime;
int _currNoteNum;
int _currPatchNum;
-
+
const ObjAnimation *getAnimation(int animIndex);
bool ptInRect(const Rect *r, int x, int y);
bool ptInPoly(const BBPolygon *poly, int x, int y);
@@ -109,14 +109,14 @@ public:
void buildDrawList1(DrawList &drawList);
void drawSprites();
-
+
void initObjs();
Obj *getFreeObject();
-
+
void initObjects();
void initObjects0();
void initObjects1();
-
+
bool updateStatus(int mouseX, int mouseY, uint mouseButtons);
bool updateStatus0(int mouseX, int mouseY, uint mouseButtons);
bool updateStatus1(int mouseX, int mouseY, uint mouseButtons);
@@ -124,7 +124,7 @@ public:
void updateObjs();
void update();
-
+
void play();
void record();
void setPlayerMode3();
@@ -136,9 +136,9 @@ public:
void noteOn(int noteNum);
void noteOff(int noteNum);
void resetObjs();
-
+
void loadSounds();
- void playNote(int noteNum);
+ void playNote(int noteNum);
void stopNote(int noteNum);
};
diff --git a/engines/bbvs/minigames/bbant.cpp b/engines/bbvs/minigames/bbant.cpp
index 9786682ada..3678934345 100644
--- a/engines/bbvs/minigames/bbant.cpp
+++ b/engines/bbvs/minigames/bbant.cpp
@@ -94,7 +94,7 @@ void MinigameBbAnt::buildDrawList1(DrawList &drawList) {
drawNumber(drawList, _score, 68, 16);
drawList.add(getAnimation(166)->frameIndices[0], 230, 2, 2000);
drawNumber(drawList, _levelTimeLeft, 280, 16);
-
+
for (int i = 0; i < _stompCount; ++i)
drawList.add(getAnimation(130)->frameIndices[0], 20 + i * 30, 230, 2000);
@@ -116,7 +116,7 @@ void MinigameBbAnt::buildDrawList3(DrawList &drawList) {
drawNumber(drawList, _hiScore, 208, 107);
}
-void MinigameBbAnt::drawMagnifyingGlass(DrawList &drawList) {
+void MinigameBbAnt::drawMagnifyingGlass(DrawList &drawList) {
scale2x(_objects[0].x - 28, _objects[0].y - 27);
drawList.clear();
drawList.add(_objects[0].anim->frameIndices[0], _objects[0].x, _objects[0].y, _objects[0].priority);
@@ -358,7 +358,7 @@ bool MinigameBbAnt::updateStatus0(int mouseX, int mouseY, uint mouseButtons) {
_objects[0].x = 0;
if (_objects[0].y < 0)
_objects[0].y = 0;
-
+
if ((mouseButtons & kLeftButtonDown) || (mouseButtons & kRightButtonDown)) {
_gameState = 1;
initObjects();
@@ -447,7 +447,7 @@ bool MinigameBbAnt::updateStatus1(int mouseX, int mouseY, uint mouseButtons) {
int maxKindCount = 0, objKind = 0;
_stompCounter2 = _stompCounter1;
-
+
for (int i = 0; i < 4; ++i)
testTbl[i] = _vm->getRandom(_bugsChanceByKind[i] - _bugsCountByKind[i]);
@@ -471,7 +471,7 @@ bool MinigameBbAnt::updateStatus1(int mouseX, int mouseY, uint mouseButtons) {
if (_stompCounter1 > 20)
--_stompCounter1;
}
-
+
return true;
}
@@ -701,7 +701,7 @@ void MinigameBbAnt::updateBugObjAnim(int objIndex) {
void MinigameBbAnt::updateObjAnim2(int objIndex) {
Obj *obj = &_objects[objIndex];
-
+
obj->animIndexIncr += _vm->getRandom(3) - 1;
if (obj->animIndexIncr < 0)
obj->animIndexIncr = 7;
@@ -736,7 +736,7 @@ bool MinigameBbAnt::isBugOutOfScreen(int objIndex) {
void MinigameBbAnt::updateObjAnim3(int objIndex) {
Obj *obj = &_objects[objIndex];
-
+
obj->animIndexIncr += _vm->getRandom(3) - 1;
if (obj->animIndexIncr < 0)
obj->animIndexIncr = 7;
@@ -752,7 +752,7 @@ void MinigameBbAnt::updateBugObj1(int objIndex) {
Obj *obj = &_objects[objIndex];
bool flag1 = false;
bool flag2 = false;
-
+
if (--obj->ticks == 0) {
++obj->frameIndex;
if (obj->anim->frameCount == obj->frameIndex) {
@@ -911,7 +911,7 @@ void MinigameBbAnt::updateStompObj(int objIndex) {
void MinigameBbAnt::updateSmokeObj(int objIndex) {
Obj *obj = &_objects[objIndex];
-
+
obj->x += obj->xIncr;
obj->y += obj->yIncr;
@@ -1047,7 +1047,7 @@ bool MinigameBbAnt::isMagGlassAtBug(int objIndex) {
Obj *obj = &_objects[objIndex];
Obj *obj0 = &_objects[0];
bool result = false;
-
+
if (obj->kind >= 1 && obj->kind <= 5) {
const BBRect &frameRect1 = obj0->anim->frameRects[0];
const int obj1X1 = obj0->x + frameRect1.x;
@@ -1102,7 +1102,7 @@ bool MinigameBbAnt::testObj5(int objIndex) {
}
void MinigameBbAnt::updateObjs(uint mouseButtons) {
-
+
for (int i = 12; i < kMaxObjectsCount; ++i) {
Obj *obj = &_objects[i];
@@ -1162,7 +1162,7 @@ void MinigameBbAnt::updateObjs(uint mouseButtons) {
}
}
-
+
}
}
@@ -1170,9 +1170,9 @@ void MinigameBbAnt::updateObjs(uint mouseButtons) {
bool MinigameBbAnt::run(bool fromMainGame) {
memset(_objects, 0, sizeof(_objects));
-
+
_numbersAnim = getAnimation(167);
-
+
_backgroundSpriteIndex = 303;
_titleScreenSpriteIndex = 304;
@@ -1187,23 +1187,23 @@ bool MinigameBbAnt::run(bool fromMainGame) {
_gameDone = false;
initObjects();
initVars();
-
+
_spriteModule = new SpriteModule();
_spriteModule->load("bbant/bbant.000");
Palette palette = _spriteModule->getPalette();
_vm->_screen->setPalette(palette);
-
+
loadSounds();
_gameTicks = 0;
playSound(12, true);
-
+
while (!_vm->shouldQuit() &&!_gameDone) {
_vm->updateEvents();
update();
}
-
+
_vm->_sound->unloadSounds();
if (!_fromMainGame)
@@ -1243,19 +1243,19 @@ void MinigameBbAnt::update() {
_vm->_mouseButtons &= ~kRightButtonClicked;
_vm->_keyCode = Common::KEYCODE_INVALID;
} while (--inputTicks && _gameTicks > 0 && !done);
-
+
drawSprites();
-
+
_vm->_system->delayMillis(10);
}
void MinigameBbAnt::scale2x(int x, int y) {
- Graphics::Surface *surface = _vm->_screen->_surface;
-
+ Graphics::Surface *surface = _vm->_screen->_surface;
+
int srcX = x + 14, srcY = y + 14;
int srcW = kScaleDim, srcH = kScaleDim;
-
+
if (srcX < 0) {
srcW += srcX;
srcX = 0;
@@ -1265,21 +1265,21 @@ void MinigameBbAnt::scale2x(int x, int y) {
srcH += srcY;
srcY = 0;
}
-
+
if (srcX + srcW >= 320)
srcW = 320 - srcX - 1;
-
+
if (srcY + srcH >= 240)
srcH = 240 - srcY - 1;
-
+
for (int yc = 0; yc < srcH; ++yc) {
byte *src = (byte*)surface->getBasePtr(srcX, srcY + yc);
memcpy(&_scaleBuf[yc * kScaleDim], src, srcW);
}
-
+
int dstX = x, dstY = y;
int dstW = 2 * kScaleDim, dstH = 2 * kScaleDim;
-
+
if (dstX < 0) {
dstW += dstX;
dstX = 0;
@@ -1289,15 +1289,15 @@ void MinigameBbAnt::scale2x(int x, int y) {
dstH += dstY;
dstY = 0;
}
-
+
if (dstX + dstW >= 320)
dstW = 320 - dstX - 1;
-
+
if (dstY + dstH >= 240)
dstH = 240 - dstY - 1;
-
+
int w = MIN(srcW * 2, dstW), h = MIN(srcH * 2, dstH);
-
+
for (int yc = 0; yc < h; ++yc) {
byte *src = _scaleBuf + kScaleDim * (yc / 2);
byte *dst = (byte*)surface->getBasePtr(dstX, dstY + yc);
diff --git a/engines/bbvs/minigames/bbant.h b/engines/bbvs/minigames/bbant.h
index be2afe688d..88b4af9c71 100644
--- a/engines/bbvs/minigames/bbant.h
+++ b/engines/bbvs/minigames/bbant.h
@@ -32,7 +32,7 @@ public:
MinigameBbAnt(BbvsEngine *vm) : Minigame(vm) {};
bool run(bool fromMainGame);
public:
-
+
struct Obj {
int kind;
int x, y, priority;
@@ -55,21 +55,21 @@ public:
int status2;
int flag;
};
-
+
enum {
kMaxObjectsCount = 256,
kScaleDim = 28
};
-
+
struct ObjInit {
const ObjAnimation *anim1;
const ObjAnimation *anim2;
const ObjAnimation *anim3;
int x, y;
};
-
+
Obj _objects[kMaxObjectsCount];
-
+
int _score, _hiScore;
int _totalBugsCount;
@@ -96,37 +96,37 @@ public:
int _countdown6;
int _countdown5;
int _countdown7;
-
+
byte _scaleBuf[kScaleDim * kScaleDim];
const ObjAnimation *getAnimation(int animIndex);
const ObjInit *getObjInit(int index);
const ObjAnimation * const *getObjKindAnimTable(int kind);
const ObjAnimation *getObjAnim(int index);
-
+
void buildDrawList0(DrawList &drawList);
void buildDrawList1(DrawList &drawList);
void buildDrawList2(DrawList &drawList);
void buildDrawList3(DrawList &drawList);
void drawMagnifyingGlass(DrawList &drawList);
-
+
void drawSprites();
void drawSprites0();
void drawSprites1();
void drawSprites2();
void drawSprites3();
-
+
Obj *getFreeObject();
-
+
void initObjects();
void initObjects0();
void initObjects1();
-
+
void initVars();
void initVars1();
void initVars2();
void initVars3();
-
+
bool updateStatus(int mouseX, int mouseY, uint mouseButtons);
bool updateStatus0(int mouseX, int mouseY, uint mouseButtons);
bool updateStatus1(int mouseX, int mouseY, uint mouseButtons);
@@ -161,7 +161,7 @@ public:
void updateObjs(uint mouseButtons);
void update();
-
+
void scale2x(int x, int y);
void loadSounds();
diff --git a/engines/bbvs/minigames/bbloogie.cpp b/engines/bbvs/minigames/bbloogie.cpp
index 4601e9ff93..68a3147f9a 100644
--- a/engines/bbvs/minigames/bbloogie.cpp
+++ b/engines/bbvs/minigames/bbloogie.cpp
@@ -117,7 +117,7 @@ void MinigameBbLoogie::buildDrawList0(DrawList &drawList) {
}
void MinigameBbLoogie::buildDrawList1(DrawList &drawList) {
-
+
for (int i = 0; i < kMaxObjectsCount; ++i) {
Obj *obj = &_objects[i];
switch (obj->kind) {
@@ -163,7 +163,7 @@ void MinigameBbLoogie::buildDrawList1(DrawList &drawList) {
}
void MinigameBbLoogie::buildDrawList2(DrawList &drawList) {
-
+
buildDrawList1(drawList);
if (_level > 0 && (_bonusDisplayDelay1 > 0 || _bonusDisplayDelay2 > 0)) {
@@ -180,7 +180,7 @@ void MinigameBbLoogie::buildDrawList2(DrawList &drawList) {
}
void MinigameBbLoogie::buildDrawList3(DrawList &drawList) {
-
+
for (int i = 0; i < kMaxObjectsCount; ++i) {
Obj *obj = &_objects[i];
if (obj->kind == 2)
@@ -191,7 +191,7 @@ void MinigameBbLoogie::buildDrawList3(DrawList &drawList) {
if (_backgroundSpriteIndex)
drawList.add(_backgroundSpriteIndex, 0, 0, 0);
-
+
drawList.add(getAnimation(10)->frameIndices[0], 230, 2, 2000);
drawNumber(drawList, _levelTimeLeft, 280, 16);
@@ -201,7 +201,7 @@ void MinigameBbLoogie::buildDrawList3(DrawList &drawList) {
int numberX2 = drawNumber(drawList, _currScore, 68, 16);
drawList.add(getAnimation(9)->frameIndices[10], numberX2, 16, 2000);
drawNumber(drawList, _dispLevelScore, numberX2 + 10, 16);
-
+
drawList.add(getAnimation(20)->frameIndices[0], 120, 70, 2000);
drawList.add(getAnimation(13)->frameIndices[0], 95, 95, 2000);
@@ -416,7 +416,7 @@ bool MinigameBbLoogie::updateStatus(int mouseX, int mouseY, uint mouseButtons) {
}
bool MinigameBbLoogie::updateStatus0(int mouseX, int mouseY, uint mouseButtons) {
-
+
_objects[0].x = mouseX;
_objects[0].y = mouseY;
@@ -445,7 +445,7 @@ bool MinigameBbLoogie::updateStatus0(int mouseX, int mouseY, uint mouseButtons)
_objects[4].kind = 0;
_objects[2].kind = 1;
}
-
+
for (int i = 0; i < kMaxObjectsCount; ++i) {
Obj *obj = &_objects[i];
if (obj->kind == 11) {
@@ -487,12 +487,12 @@ bool MinigameBbLoogie::updateStatus0(int mouseX, int mouseY, uint mouseButtons)
initVars();
_gameTicks = 0;
}
-
+
return true;
}
bool MinigameBbLoogie::updateStatus1(int mouseX, int mouseY, uint mouseButtons) {
-
+
if (--_levelTimeDelay == 0) {
_levelTimeDelay = 58;
--_levelTimeLeft;
@@ -568,9 +568,9 @@ bool MinigameBbLoogie::updateStatus2(int mouseX, int mouseY, uint mouseButtons)
}
bool MinigameBbLoogie::updateStatus3(int mouseX, int mouseY, uint mouseButtons) {
-
+
_objects[0].x = mouseX;
-
+
for (int i = 0; i < kMaxObjectsCount; ++i) {
Obj *obj = &_objects[i];
if (obj->kind == 2) {
@@ -582,7 +582,7 @@ bool MinigameBbLoogie::updateStatus3(int mouseX, int mouseY, uint mouseButtons)
}
}
}
-
+
return true;
}
@@ -620,7 +620,7 @@ void MinigameBbLoogie::updateObjs(uint mouseButtons) {
break;
}
}
-
+
if (--_carDelay == 0) {
// Car
Obj *obj = getFreeObject();
@@ -633,7 +633,7 @@ void MinigameBbLoogie::updateObjs(uint mouseButtons) {
obj->yIncr = 0;
_carDelay = _vm->getRandom(256) + 800;
}
-
+
if (--_bikeDelay == 0) {
// Bike
Obj *obj = getFreeObject();
@@ -646,7 +646,7 @@ void MinigameBbLoogie::updateObjs(uint mouseButtons) {
obj->yIncr = 0;
_bikeDelay = _vm->getRandom(512) + 500;
}
-
+
if (--_squirrelDelay == 0) {
// Squirrel
Obj *obj = getFreeObject();
@@ -662,7 +662,7 @@ void MinigameBbLoogie::updateObjs(uint mouseButtons) {
playSound(9);
_squirrelDelay = _vm->getRandom(512) + 300;
}
-
+
if (--_paperPlaneDelay == 0) {
// Paper plane
Obj *obj = getFreeObject();
@@ -685,7 +685,7 @@ void MinigameBbLoogie::updateObjs(uint mouseButtons) {
}
_paperPlaneDelay = 400;
}
-
+
if (_principalDelay >= 0 && --_principalDelay == 0) {
// Principal
Obj *obj = getFreeObject();
@@ -703,13 +703,13 @@ void MinigameBbLoogie::updateObjs(uint mouseButtons) {
_principalFirstFrameIndex = 11;
_principalLastFrameIndex = 16;
}
-
+
}
void MinigameBbLoogie::updatePlayer(int objIndex, uint mouseButtons) {
Obj *obj = &_objects[0];
-
+
switch (obj->status) {
case 1:
@@ -817,7 +817,7 @@ void MinigameBbLoogie::updateLoogie(int objIndex) {
obj->y -= kLoogieOffY[obj->unk2 / 8];
--obj->unk2;
}
-
+
if (obj->ticks-- == 0) {
obj->ticks = getAnimation(5)->frameTicks[0];
++obj->frameIndex;
@@ -832,9 +832,9 @@ void MinigameBbLoogie::updateLoogie(int objIndex) {
void MinigameBbLoogie::updateCar(int objIndex) {
Obj *obj = &_objects[objIndex];
-
+
obj->x += obj->xIncr;
-
+
if (obj->ticks-- == 0) {
if (obj->frameIndex++ == 3 || obj->frameIndex == 6)
obj->frameIndex = 0;
@@ -867,7 +867,7 @@ void MinigameBbLoogie::updateCar(int objIndex) {
void MinigameBbLoogie::updateBike(int objIndex) {
Obj *obj = &_objects[objIndex];
-
+
obj->x += obj->xIncr;
if (obj->ticks-- == 0) {
@@ -965,7 +965,7 @@ void MinigameBbLoogie::updatePaperPlane(int objIndex) {
loogieObj = findLoogieObj(loogieObjIndex++);
}
}
-
+
}
void MinigameBbLoogie::updateIndicator(int objIndex) {
@@ -995,7 +995,7 @@ void MinigameBbLoogie::updateIndicator(int objIndex) {
obj->kind = 0;
obj->anim = getAnimation(6);
}
-
+
}
void MinigameBbLoogie::updatePrincipal(int objIndex) {
@@ -1281,22 +1281,22 @@ bool MinigameBbLoogie::run(bool fromMainGame) {
_gameDone = false;
initObjects();
initVars();
-
+
_spriteModule = new SpriteModule();
_spriteModule->load("bbloogie/bbloogie.000");
Palette palette = _spriteModule->getPalette();
_vm->_screen->setPalette(palette);
-
+
loadSounds();
playSound(32, true);
-
+
while (!_vm->shouldQuit() &&!_gameDone) {
_vm->updateEvents();
update();
}
-
+
_vm->_sound->unloadSounds();
if (!_fromMainGame)
@@ -1319,15 +1319,15 @@ void MinigameBbLoogie::update() {
inputTicks = 1;
_gameTicks = _vm->_system->getMillis();
}
-
+
if (_vm->_keyCode == Common::KEYCODE_ESCAPE) {
_gameDone = true;
return;
}
-
+
if (inputTicks == 0)
return;
-
+
bool done;
do {
@@ -1336,9 +1336,9 @@ void MinigameBbLoogie::update() {
_vm->_mouseButtons &= ~kRightButtonClicked;
_vm->_keyCode = Common::KEYCODE_INVALID;
} while (--inputTicks && _gameTicks > 0 && !done);
-
+
drawSprites();
-
+
_vm->_system->delayMillis(10);
}
diff --git a/engines/bbvs/minigames/bbloogie.h b/engines/bbvs/minigames/bbloogie.h
index 1dd4049b41..04ead51a1e 100644
--- a/engines/bbvs/minigames/bbloogie.h
+++ b/engines/bbvs/minigames/bbloogie.h
@@ -32,7 +32,7 @@ public:
MinigameBbLoogie(BbvsEngine *vm) : Minigame(vm) {};
bool run(bool fromMainGame);
public:
-
+
struct Obj {
int kind;
int x, y;
@@ -44,33 +44,33 @@ public:
int16 frameIndexAdd;
int16 unk2;
};
-
+
enum {
kMaxObjectsCount = 256
};
-
+
enum {
kGSTitleScreen = 0, // Title screen
kGSMainGame = 1, // Game when called as part of the main game
kGSStandaloneGame = 2, // Game when called as standalone game
kGSScoreCountUp = 3 // Score countup and next level text
};
-
+
Obj _objects[kMaxObjectsCount];
-
+
int _playerKind;
const ObjAnimation *_playerAnim;
const uint *_playerSounds1, *_playerSounds2;
uint _playerSounds1Count, _playerSounds2Count;
-
+
int _level, _levelTimeLeft, _levelTimeDelay;
- int _numberOfHits, _currScore, _hiScore;
+ int _numberOfHits, _currScore, _hiScore;
int _doubleScore, _megaLoogieCount;
-
+
int _dispLevelScore, _nextLevelScore;
int _timeBonusCtr, _bonusDisplayDelay1, _bonusDisplayDelay2, _bonusDisplayDelay3;
-
+
int _carDelay;
int _bikeDelay;
int _squirrelDelay;
@@ -78,37 +78,37 @@ public:
int _paperPlaneDelay;
int _principalDelay;
- int _prevPrincipalStatus;
+ int _prevPrincipalStatus;
int _principalCtr, _principalFirstFrameIndex, _principalLastFrameIndex;
bool _principalAngry;
-
+
const ObjAnimation *getAnimation(int animIndex);
-
+
void buildDrawList(DrawList &drawList);
void buildDrawList0(DrawList &drawList);
void buildDrawList1(DrawList &drawList);
void buildDrawList2(DrawList &drawList);
void buildDrawList3(DrawList &drawList);
-
+
void drawSprites();
-
+
void initObjs();
Obj *getFreeObject();
Obj *findLoogieObj(int startObjIndex);
bool isHit(Obj *obj1, Obj *obj2);
bool isCursorAtObj(int objIndex);
-
+
void initObjects();
void initObjects0();
void initObjects1();
void initObjects3();
-
+
void initVars();
void initVars0();
void initVars1();
void initVars2();
void initVars3();
-
+
bool updateStatus(int mouseX, int mouseY, uint mouseButtons);
bool updateStatus0(int mouseX, int mouseY, uint mouseButtons);
bool updateStatus1(int mouseX, int mouseY, uint mouseButtons);
@@ -129,7 +129,7 @@ public:
void incNumberOfHits();
void incScore(int incrAmount);
void playRndSound();
-
+
void update();
void loadSounds();
diff --git a/engines/bbvs/minigames/bbtennis.cpp b/engines/bbvs/minigames/bbtennis.cpp
index ddd5cfc804..7763548330 100644
--- a/engines/bbvs/minigames/bbtennis.cpp
+++ b/engines/bbvs/minigames/bbtennis.cpp
@@ -86,7 +86,7 @@ void MinigameBbTennis::buildDrawList(DrawList &drawList) {
}
void MinigameBbTennis::buildDrawList0(DrawList &drawList) {
-
+
drawList.add(_objects[0].anim->frameIndices[_objects[0].frameIndex], _objects[0].x, _objects[0].y, 2000);
for (int i = 0; i < kMaxObjectsCount; ++i) {
@@ -154,7 +154,7 @@ void MinigameBbTennis::buildDrawList1(DrawList &drawList) {
break;
}
-
+
drawList.add(index, x, y, priority);
}
@@ -174,16 +174,16 @@ void MinigameBbTennis::buildDrawList1(DrawList &drawList) {
drawList.add(getAnimation(9)->frameIndices[0], 256, 52, 500);
drawList.add(getAnimation(10)->frameIndices[0], 60, 162, 500);
drawList.add(getAnimation(21)->frameIndices[0], 36, 18, 2000);
-
+
drawNumber(drawList, _score, 70, 18);
-
+
for (int i = 0; i < _numHearts; ++i)
drawList.add(getAnimation(7)->frameIndices[0], 20 + i * 20, 236, 990);
}
void MinigameBbTennis::buildDrawList2(DrawList &drawList) {
-
+
for (int i = 0; i < kMaxObjectsCount; ++i) {
Obj *obj = &_objects[i];
if (obj->kind)
@@ -384,7 +384,7 @@ bool MinigameBbTennis::updateStatus1(int mouseX, int mouseY, uint mouseButtons)
_objects[0].x = mouseX;
_objects[0].y = mouseY;
-
+
if (_allHeartsGone) {
_gameState = 2;
initObjects();
@@ -427,13 +427,13 @@ bool MinigameBbTennis::updateStatus1(int mouseX, int mouseY, uint mouseButtons)
if (_newBallTimer > 0)
--_newBallTimer;
-
+
if (++_delayDecreaseTimer == 30) {
_delayDecreaseTimer = 0;
if (_playerDecrease < 199)
++_playerDecrease;
}
-
+
updateObjs();
if (!_playedThisIsTheCoolest && _score > 3 && _vm->getRandom(10) == 1 && !isAnySoundPlaying(kAllSounds, 11)) {
@@ -482,7 +482,7 @@ void MinigameBbTennis::updateObjs() {
break;
}
}
-
+
if (_rapidFireBallsCount == 0) {
--_squirrelDelay;
if (--_squirrelDelay == 0) {
@@ -763,7 +763,7 @@ void MinigameBbTennis::updateTennisPlayer(int objIndex) {
}
++_tennisPlayerDelay;
break;
-
+
case 2:
if (--obj->ticks == 0) {
++obj->frameIndex;
@@ -1077,7 +1077,7 @@ void MinigameBbTennis::updateNetPlayer(int objIndex) {
void MinigameBbTennis::updateEnemyTennisBall(int objIndex) {
Obj *obj = &_objects[objIndex];
-
+
if (--obj->ticks == 0) {
--obj->frameIndex;
obj->ticks = getAnimation(6)->frameTicks[obj->frameIndex];
@@ -1103,7 +1103,7 @@ void MinigameBbTennis::updateEnemyTennisBall(int objIndex) {
obj->x = (int)obj->fltX;
obj->fltY = obj->fltY - obj->fltStepY;
obj->y = (int)obj->fltY;
-
+
}
void MinigameBbTennis::makeEnemyBall(int x, int y, int frameIndex) {
@@ -1184,7 +1184,7 @@ void MinigameBbTennis::hitSomething() {
bool MinigameBbTennis::run(bool fromMainGame) {
memset(_objects, 0, sizeof(_objects));
-
+
_numbersAnim = getAnimation(20);
_backgroundSpriteIndex = 272;
@@ -1201,23 +1201,23 @@ bool MinigameBbTennis::run(bool fromMainGame) {
_gameDone = false;
initObjects();
initVars();
-
+
_spriteModule = new SpriteModule();
_spriteModule->load("bbtennis/bbtennis.000");
Palette palette = _spriteModule->getPalette();
_vm->_screen->setPalette(palette);
-
+
loadSounds();
_gameTicks = 0;
playSound(29, true);
-
+
while (!_vm->shouldQuit() &&!_gameDone) {
_vm->updateEvents();
update();
}
-
+
_vm->_sound->unloadSounds();
if (!_fromMainGame)
@@ -1240,15 +1240,15 @@ void MinigameBbTennis::update() {
inputTicks = 1;
_gameTicks = _vm->_system->getMillis();
}
-
+
if (_vm->_keyCode == Common::KEYCODE_ESCAPE) {
_gameDone = true;
return;
}
-
+
if (inputTicks == 0)
return;
-
+
bool done;
do {
@@ -1257,9 +1257,9 @@ void MinigameBbTennis::update() {
_vm->_mouseButtons &= ~kRightButtonClicked;
_vm->_keyCode = Common::KEYCODE_INVALID;
} while (--inputTicks && _gameTicks > 0 && !done);
-
+
drawSprites();
-
+
_vm->_system->delayMillis(10);
}
diff --git a/engines/bbvs/minigames/bbtennis.h b/engines/bbvs/minigames/bbtennis.h
index 690bd724a0..7eac904c4d 100644
--- a/engines/bbvs/minigames/bbtennis.h
+++ b/engines/bbvs/minigames/bbtennis.h
@@ -32,7 +32,7 @@ public:
MinigameBbTennis(BbvsEngine *vm) : Minigame(vm) {};
bool run(bool fromMainGame);
public:
-
+
struct Obj {
int kind;
int x, y;
@@ -51,20 +51,20 @@ public:
int ballStepCtr;
int netPlayDirection;
};
-
+
enum {
kMaxObjectsCount = 256
};
-
+
enum {
kGSTitleScreen = 0, // Title screen
kGSMainGame = 1, // Game when called as part of the main game
kGSStandaloneGame = 2, // Game when called as standalone game
kGSScoreCountUp = 3 // Score countup and next level text
};
-
+
Obj _objects[kMaxObjectsCount];
-
+
int _numHearts;
int _squirrelDelay;
int _tennisPlayerDelay;
@@ -85,29 +85,29 @@ public:
bool _endSoundPlaying;
const ObjAnimation *getAnimation(int animIndex);
-
+
void buildDrawList(DrawList &drawList);
void buildDrawList0(DrawList &drawList);
void buildDrawList1(DrawList &drawList);
void buildDrawList2(DrawList &drawList);
-
+
void drawSprites();
-
+
void initObjs();
Obj *getFreeObject();
Obj *findTennisBall(int startObjIndex);
bool isHit(Obj *obj1, Obj *obj2);
-
+
void initObjects();
void initObjects0();
void initObjects1();
void initObjects2();
-
+
void initVars();
void initVars0();
void initVars1();
void initVars2();
-
+
bool updateStatus(int mouseX, int mouseY, uint mouseButtons);
bool updateStatus0(int mouseX, int mouseY, uint mouseButtons);
bool updateStatus1(int mouseX, int mouseY, uint mouseButtons);
diff --git a/engines/bbvs/minigames/minigame.cpp b/engines/bbvs/minigames/minigame.cpp
index aae18072d9..58d98a9df8 100644
--- a/engines/bbvs/minigames/minigame.cpp
+++ b/engines/bbvs/minigames/minigame.cpp
@@ -44,13 +44,13 @@ Minigame::~Minigame() {
int Minigame::drawNumber(DrawList &drawList, int number, int x, int y) {
int digits = 1, rightX = x;
-
+
for (int mag = 10; number / mag != 0; mag *= 10)
++digits;
-
+
rightX = x + digits * 10;
x = rightX;
-
+
while (digits--) {
const int n = number % 10;
x -= 10;
diff --git a/engines/bbvs/minigames/minigame.h b/engines/bbvs/minigames/minigame.h
index 675dec360d..1c24110519 100644
--- a/engines/bbvs/minigames/minigame.h
+++ b/engines/bbvs/minigames/minigame.h
@@ -51,30 +51,30 @@ public:
virtual ~Minigame();
virtual bool run(bool fromMainGame) = 0;
protected:
- BbvsEngine *_vm;
+ BbvsEngine *_vm;
SpriteModule *_spriteModule;
-
+
int _gameState;
int _gameTicks;
bool _gameResult;
bool _gameDone;
bool _fromMainGame;
int _hiScoreTable[kMinigameCount];
-
+
int _backgroundSpriteIndex, _titleScreenSpriteIndex;
-
+
const ObjAnimation *_numbersAnim;
-
+
int drawNumber(DrawList &drawList, int number, int x, int y);
void playSound(uint index, bool loop = false);
void stopSound(uint index);
bool isSoundPlaying(uint index);
bool isAnySoundPlaying(const uint *indices, uint count);
-
+
void saveHiscore(int minigameNum, int score);
int loadHiscore(int minigameNum);
-
+
};
} // End of namespace Bbvs
diff --git a/engines/bbvs/saveload.cpp b/engines/bbvs/saveload.cpp
index ff53cc457b..e7725713fd 100644
--- a/engines/bbvs/saveload.cpp
+++ b/engines/bbvs/saveload.cpp
@@ -73,7 +73,7 @@ void BbvsEngine::savegame(const char *filename, const char *description) {
byte descriptionLen = strlen(description);
out->writeByte(descriptionLen);
out->write(description, descriptionLen);
-
+
Graphics::saveThumbnail(*out);
// Not used yet, reserved for future usage
@@ -86,7 +86,7 @@ void BbvsEngine::savegame(const char *filename, const char *description) {
out->writeUint32LE(saveTime);
out->writeUint32LE(playTime);
// Header end
-
+
out->write(_snapshot, _snapshotStream->pos());
out->finalize();
@@ -103,15 +103,15 @@ void BbvsEngine::loadgame(const char *filename) {
SaveHeader header;
kReadSaveHeaderError errorCode = readSaveHeader(in, false, header);
-
+
if (errorCode != kRSHENoError) {
warning("Error loading savegame '%s'", filename);
delete in;
return;
}
-
+
g_engine->setTotalPlayTime(header.playTime * 1000);
-
+
memset(_sceneObjects, 0, sizeof(_sceneObjects));
for (int i = 0; i < kSceneObjectsCount; ++i) {
_sceneObjects[i].walkDestPt.x = -1;
@@ -120,7 +120,7 @@ void BbvsEngine::loadgame(const char *filename) {
_currSceneNum = 0;
_newSceneNum = in->readUint32LE();
-
+
initScene(false);
_prevSceneNum = in->readUint32LE();
@@ -157,16 +157,16 @@ void BbvsEngine::loadgame(const char *filename) {
obj->frameIndex = in->readUint32LE();
obj->frameTicks = in->readUint32LE();
obj->walkCount = in->readUint32LE();
- obj->xIncr = in->readUint32LE();
+ obj->xIncr = in->readUint32LE();
obj->yIncr = in->readUint32LE();
- obj->turnValue = in->readUint32LE();
- obj->turnCount = in->readUint32LE();
+ obj->turnValue = in->readUint32LE();
+ obj->turnCount = in->readUint32LE();
obj->turnTicks = in->readUint32LE();
obj->walkDestPt.x = in->readUint16LE();
obj->walkDestPt.y = in->readUint16LE();
obj->anim = obj->animIndex > 0 ? _gameModule->getAnimation(obj->animIndex) : 0;
}
-
+
updateWalkableRects();
// Restart scene background sounds
@@ -259,10 +259,10 @@ void BbvsEngine::saveSnapshot() {
_snapshotStream->writeUint32LE(obj->frameIndex);
_snapshotStream->writeUint32LE(obj->frameTicks);
_snapshotStream->writeUint32LE(obj->walkCount);
- _snapshotStream->writeUint32LE(obj->xIncr);
+ _snapshotStream->writeUint32LE(obj->xIncr);
_snapshotStream->writeUint32LE(obj->yIncr);
- _snapshotStream->writeUint32LE(obj->turnValue);
- _snapshotStream->writeUint32LE(obj->turnCount);
+ _snapshotStream->writeUint32LE(obj->turnValue);
+ _snapshotStream->writeUint32LE(obj->turnCount);
_snapshotStream->writeUint32LE(obj->turnTicks);
_snapshotStream->writeUint16LE(obj->walkDestPt.x);
_snapshotStream->writeUint16LE(obj->walkDestPt.y);
diff --git a/engines/bbvs/scene.cpp b/engines/bbvs/scene.cpp
index 0d86eb4dbc..a89c88fd82 100644
--- a/engines/bbvs/scene.cpp
+++ b/engines/bbvs/scene.cpp
@@ -34,7 +34,7 @@ static const int kAfterVideoSceneNum[] = {
void BbvsEngine::loadScene(int sceneNum) {
debug(0, "BbvsEngine::loadScene() sceneNum: %d", sceneNum);
-
+
Common::String sprFilename = Common::String::format("vnm/vspr%04d.vnm", sceneNum);
Common::String gamFilename = Common::String::format("vnm/game%04d.vnm", sceneNum);
@@ -42,7 +42,7 @@ void BbvsEngine::loadScene(int sceneNum) {
_spriteModule->load(sprFilename.c_str());
_gameModule->load(gamFilename.c_str());
-
+
Palette palette = _spriteModule->getPalette();
_screen->setPalette(palette);
@@ -106,10 +106,10 @@ void BbvsEngine::initScene(bool sounds) {
loadScene(_newSceneNum);
_currSceneNum = _newSceneNum;
_newSceneNum = 0;
-
+
for (int i = 0; i < _gameModule->getSceneObjectDefsCount(); ++i)
_sceneObjects[i].sceneObjectDef = _gameModule->getSceneObjectDef(i);
-
+
for (int i = 0; i < _gameModule->getSceneObjectInitsCount(); ++i) {
SceneObjectInit *soInit = _gameModule->getSceneObjectInit(i);
if (evalCondition(soInit->conditions)) {
@@ -149,10 +149,10 @@ void BbvsEngine::initScene(bool sounds) {
}
}
}
-
+
_cameraPos = _gameModule->getCameraInit(_currCameraNum)->cameraPos;
_newCameraPos = _cameraPos;
-
+
_walkAreaActions.clear();
for (int i = 0; i < _gameModule->getActionsCount(); ++i) {
Action *action = _gameModule->getAction(i);
@@ -165,7 +165,7 @@ void BbvsEngine::initScene(bool sounds) {
_activeItemIndex = 0;
_activeItemType = kITEmpty;
-
+
for (int i = 0; i < _gameModule->getActionsCount(); ++i) {
Action *action = _gameModule->getAction(i);
if (evalCondition(action->conditions)) {
@@ -183,7 +183,7 @@ void BbvsEngine::initScene(bool sounds) {
break;
}
}
-
+
if (sounds)
updateBackgroundSounds();
@@ -192,7 +192,7 @@ void BbvsEngine::initScene(bool sounds) {
bool BbvsEngine::changeScene() {
writeContinueSavegame();
-
+
if (_newSceneNum >= 27 && _newSceneNum <= 30) {
// Run minigames
stopSpeech();
@@ -221,7 +221,7 @@ bool BbvsEngine::changeScene() {
}
return true;
-
+
}
} // End of namespace Bbvs
diff --git a/engines/bbvs/spritemodule.cpp b/engines/bbvs/spritemodule.cpp
index 8eae7f9a6a..f8b0d9afd5 100644
--- a/engines/bbvs/spritemodule.cpp
+++ b/engines/bbvs/spritemodule.cpp
@@ -41,15 +41,15 @@ SpriteModule::~SpriteModule() {
void SpriteModule::load(const char *filename) {
unload();
-
+
Common::File fd;
if (!fd.open(filename))
error("SpriteModule::load() Could not open %s", filename);
-
+
fd.readUint32LE(); // Skip magic
fd.readUint32LE(); // Skip unused
fd.readUint32LE(); // Skip filesize
-
+
_paletteOffs = fd.readUint32LE();
fd.readUint32LE(); // Skip unused flagsTbl1Ofs
fd.readUint32LE(); // Skip unused flagsTbl2Ofs
@@ -57,18 +57,18 @@ void SpriteModule::load(const char *filename) {
_paletteStart = fd.readUint32LE();
_paletteCount = fd.readUint32LE();
_spritesCount = fd.readUint32LE();
-
+
debug(0, "_paletteOffs: %08X", _paletteOffs);
debug(0, "_spriteTblOffs: %08X", _spriteTblOffs);
debug(0, "_paletteStart: %d", _paletteStart);
debug(0, "_paletteCount: %d", _paletteCount);
debug(0, "_spritesCount: %d", _spritesCount);
-
+
_spriteDataSize = fd.size();
_spriteData = new byte[_spriteDataSize];
fd.seek(0);
fd.read(_spriteData, _spriteDataSize);
-
+
// Convert palette
byte *palette = _spriteData + _paletteOffs;
for (int i = 0; i < _paletteCount; ++i) {
diff --git a/engines/bbvs/videoplayer.cpp b/engines/bbvs/videoplayer.cpp
index fda9372ade..9ea73ad10b 100644
--- a/engines/bbvs/videoplayer.cpp
+++ b/engines/bbvs/videoplayer.cpp
@@ -42,7 +42,7 @@ void BbvsEngine::playVideo(int videoNum) {
warning("Couldn't switch to a RGB color video mode to play a video.");
return;
}
-
+
Video::VideoDecoder *videoDecoder = new Video::AVIDecoder();
if (!videoDecoder->loadFile(videoFilename)) {
delete videoDecoder;
@@ -74,7 +74,7 @@ void BbvsEngine::playVideo(int videoNum) {
}
delete videoDecoder;
-
+
initGraphics(320, 240, false);
}
diff --git a/engines/bbvs/walk.cpp b/engines/bbvs/walk.cpp
index 077110b867..5ef14101a0 100644
--- a/engines/bbvs/walk.cpp
+++ b/engines/bbvs/walk.cpp
@@ -46,7 +46,7 @@ static const int8 kWalkAnimTbl[32] = {
void BbvsEngine::startWalkObject(SceneObject *sceneObject) {
if (_buttheadObject != sceneObject && _beavisObject != sceneObject)
return;
-
+
initWalkAreas(sceneObject);
_sourceWalkAreaPt.x = sceneObject->x >> 16;
_sourceWalkAreaPt.y = sceneObject->y >> 16;
@@ -60,7 +60,7 @@ void BbvsEngine::startWalkObject(SceneObject *sceneObject) {
_destWalkArea = getWalkAreaAtPos(_destWalkAreaPt);
if (!_destWalkArea)
return;
-
+
if (_sourceWalkArea != _destWalkArea) {
_currWalkDistance = kMaxDistance;
walkFindPath(_sourceWalkArea, 0);
@@ -68,12 +68,12 @@ void BbvsEngine::startWalkObject(SceneObject *sceneObject) {
}
walkObject(sceneObject, _destWalkAreaPt, sceneObject->sceneObjectDef->walkSpeed);
-
+
}
void BbvsEngine::updateWalkObject(SceneObject *sceneObject) {
int animIndex;
-
+
if (sceneObject->walkCount > 0 && (sceneObject->xIncr != 0 || sceneObject->yIncr != 0)) {
if (ABS(sceneObject->xIncr) <= ABS(sceneObject->yIncr))
sceneObject->turnValue = sceneObject->yIncr >= 0 ? 0 : 4;
@@ -89,7 +89,7 @@ void BbvsEngine::updateWalkObject(SceneObject *sceneObject) {
Animation *anim = 0;
if (animIndex > 0)
anim = _gameModule->getAnimation(animIndex);
-
+
if (sceneObject->anim != anim) {
if (anim) {
sceneObject->anim = anim;
@@ -305,12 +305,12 @@ bool BbvsEngine::canButtheadWalkToDest(const Common::Point &destPt) {
}
void BbvsEngine::canWalkToDest(WalkArea *walkArea, int infoCount) {
-
+
if (_destWalkArea == walkArea) {
_walkReachedDestArea = true;
return;
}
-
+
if (_gameModule->getFieldC() <= 320 || infoCount <= 20) {
walkArea->checked = true;
for (int linkIndex = 0; linkIndex < walkArea->linksCount; ++linkIndex) {
@@ -364,10 +364,10 @@ int BbvsEngine::calcDistance(const Common::Point &pt1, const Common::Point &pt2)
void BbvsEngine::walkFoundPath(int count) {
debug(5, "BbvsEngine::walkFoundPath(%d)", count);
-
+
Common::Point midPt = _sourceWalkAreaPt;
int totalMidPtDistance = 0;
-
+
if (count > 0) {
Common::Point lastMidPt;
int halfCount = (count + 1) >> 1;
@@ -384,13 +384,13 @@ void BbvsEngine::walkFoundPath(int count) {
if (distance >= _currWalkDistance)
return;
-
+
debug(5, "BbvsEngine::walkFoundPath() distance smaller");
_currWalkDistance = distance;
Common::Point destPt = _destWalkAreaPt, newDestPt;
-
+
while (1) {
int index = 0;
@@ -408,7 +408,7 @@ void BbvsEngine::walkFoundPath(int count) {
WalkInfo *walkInfo = _walkInfoPtrs[--count];
destPt.x = walkInfo->x;
destPt.y = walkInfo->y;
-
+
if (walkInfo->direction) {
newDestPt.x = walkInfo->x;
newDestPt.y = walkInfo->y + walkInfo->delta - 1;