aboutsummaryrefslogtreecommitdiff
path: root/engines/mads
diff options
context:
space:
mode:
Diffstat (limited to 'engines/mads')
-rw-r--r--engines/mads/game.cpp2
-rw-r--r--engines/mads/menu_views.cpp24
-rw-r--r--engines/mads/msurface.h4
-rw-r--r--engines/mads/nebular/dialogs_nebular.cpp2
-rw-r--r--engines/mads/nebular/dialogs_nebular.h4
-rw-r--r--engines/mads/nebular/game_nebular.cpp2
-rw-r--r--engines/mads/nebular/menu_nebular.cpp16
-rw-r--r--engines/mads/nebular/nebular_scenes6.cpp2
-rw-r--r--engines/mads/nebular/nebular_scenes7.cpp2
-rw-r--r--engines/mads/nebular/nebular_scenes8.cpp2
-rw-r--r--engines/mads/palette.cpp4
-rw-r--r--engines/mads/scene.cpp6
-rw-r--r--engines/mads/scene_data.cpp2
-rw-r--r--engines/mads/sequence.cpp2
14 files changed, 36 insertions, 38 deletions
diff --git a/engines/mads/game.cpp b/engines/mads/game.cpp
index 63a7e40d1b..94653f9a39 100644
--- a/engines/mads/game.cpp
+++ b/engines/mads/game.cpp
@@ -556,7 +556,7 @@ void Game::writeSavegameHeader(Common::OutSaveFile *out, MADSSavegameHeader &hea
if (!_saveThumb)
createThumbnail();
Graphics::saveThumbnail(*out, *_saveThumb);
-
+
_saveThumb->free();
delete _saveThumb;
_saveThumb = nullptr;
diff --git a/engines/mads/menu_views.cpp b/engines/mads/menu_views.cpp
index 03afc70c3e..ee4268a650 100644
--- a/engines/mads/menu_views.cpp
+++ b/engines/mads/menu_views.cpp
@@ -37,7 +37,7 @@ MenuView::MenuView(MADSEngine *vm) : FullScreenDialog(vm) {
}
void MenuView::show() {
- Scene &scene = _vm->_game->_scene;
+ Scene &scene = _vm->_game->_scene;
EventsManager &events = *_vm->_events;
_vm->_screenFade = SCREEN_FADE_FAST;
@@ -195,7 +195,7 @@ void TextView::processCommand() {
paramP = commandStr + 10;
resetPalette();
int screenId = getParameter(&paramP);
-
+
SceneInfo *sceneInfo = SceneInfo::init(_vm);
sceneInfo->load(screenId, 0, "", 0, scene._depthSurface, scene._backgroundSurface);
scene._spriteSlots.fullRefresh();
@@ -230,7 +230,7 @@ void TextView::processCommand() {
int soundId = getParameter(&paramP);
_vm->_sound->command(soundId);
- } else if (!strncmp(commandStr, "COLOR", 5) && ((commandStr[5] == '0') ||
+ } else if (!strncmp(commandStr, "COLOR", 5) && ((commandStr[5] == '0') ||
(commandStr[5] == '1'))) {
// Set the text colors
int index = commandStr[5] - '0';
@@ -254,7 +254,7 @@ void TextView::processCommand() {
sceneInfo->_width = MADS_SCREEN_WIDTH;
sceneInfo->_height = MADS_SCENE_HEIGHT;
_spareScreens[spareIndex].setSize(MADS_SCREEN_WIDTH, MADS_SCENE_HEIGHT);
- sceneInfo->loadMadsV1Background(screenId, "", SCENEFLAG_TRANSLATE,
+ sceneInfo->loadMadsV1Background(screenId, "", SCENEFLAG_TRANSLATE,
_spareScreens[spareIndex]);
delete sceneInfo;
@@ -409,7 +409,7 @@ void TextView::doFrame() {
Common::copy(srcP, srcP + MADS_SCREEN_WIDTH, destP);
}
- Common::copy(linesTemp, linesTemp + _pan.y * MADS_SCREEN_WIDTH,
+ Common::copy(linesTemp, linesTemp + _pan.y * MADS_SCREEN_WIDTH,
(byte *)scene._backgroundSurface.getPixels());
delete[] linesTemp;
}
@@ -429,7 +429,7 @@ void TextView::doFrame() {
if (tl._pos.y < 0) {
_textLines.remove_at(i);
} else {
- tl._textDisplayIndex = scene._textDisplay.add(tl._pos.x, tl._pos.y,
+ tl._textDisplayIndex = scene._textDisplay.add(tl._pos.x, tl._pos.y,
0x605, -1, tl._line, _font);
}
}
@@ -537,7 +537,7 @@ bool AnimationView::onEvent(Common::Event &event) {
void AnimationView::doFrame() {
Scene &scene = _vm->_game->_scene;
-
+
if (_resourceIndex == -1 || _currentAnimation->freeFlag()) {
if (++_resourceIndex == (int)_resources.size()) {
scriptDone();
@@ -565,7 +565,7 @@ void AnimationView::loadNextResource() {
if (resEntry._bgFlag)
palette.resetGamePalette(1, 8);
- palette._mainPalette[253 * 3] = palette._mainPalette[253 * 3 + 1]
+ palette._mainPalette[253 * 3] = palette._mainPalette[253 * 3 + 1]
= palette._mainPalette[253 * 3 + 2] = 0xb4;
palette.setPalette(&palette._mainPalette[253 * 3], 253, 1);
@@ -587,7 +587,7 @@ void AnimationView::loadNextResource() {
delete _currentAnimation;
_currentAnimation = Animation::init(_vm, &scene);
int flags = ANIMFLAG_ANIMVIEW | (resEntry._bgFlag ? ANIMFLAG_LOAD_BACKGROUND : 0);
- _currentAnimation->load(scene._backgroundSurface, scene._depthSurface,
+ _currentAnimation->load(scene._backgroundSurface, scene._depthSurface,
resEntry._resourceName, flags, &paletteCycles, _sceneInfo);
// Signal for a screen refresh
@@ -656,7 +656,7 @@ void AnimationView::processLines() {
if (c != '\r' && c != '\0')
_currentLine += c;
}
-
+
// Process the line
while (!_currentLine.empty()) {
if (_currentLine.hasPrefix("-")) {
@@ -672,7 +672,7 @@ void AnimationView::processLines() {
}
// Add resource into list along with any set state information
- _resources.push_back(ResourceEntry(resName, _sfx, _soundFlag,
+ _resources.push_back(ResourceEntry(resName, _sfx, _soundFlag,
_bgLoadFlag, _showWhiteBars));
// Fx resets between resource entries
@@ -753,7 +753,7 @@ int AnimationView::getParameter() {
while (!_currentLine.empty()) {
char c = _currentLine[0];
-
+
if (c >= '0' && c <= '9') {
_currentLine.deleteChar(0);
result = result * 10 + (c - '0');
diff --git a/engines/mads/msurface.h b/engines/mads/msurface.h
index ebfb1f437a..650d7fdaee 100644
--- a/engines/mads/msurface.h
+++ b/engines/mads/msurface.h
@@ -223,8 +223,6 @@ public:
};
class DepthSurface : public MSurface {
-private:
- MADSEngine *_vm;
public:
/**
* Depth style
@@ -234,7 +232,7 @@ public:
/**
* Constructor
*/
- DepthSurface(MADSEngine *vm) : _vm(vm), _depthStyle(0) {}
+ DepthSurface() : _depthStyle(0) {}
/**
* Returns the depth at a given position
diff --git a/engines/mads/nebular/dialogs_nebular.cpp b/engines/mads/nebular/dialogs_nebular.cpp
index f51d046951..f5355517bd 100644
--- a/engines/mads/nebular/dialogs_nebular.cpp
+++ b/engines/mads/nebular/dialogs_nebular.cpp
@@ -908,7 +908,7 @@ void GameDialog::refreshText() {
}
if (!skipFlag) {
- _lines[i]._textDisplayIndex = scene._textDisplay.add(_lines[i]._pos.x, _lines[i]._pos.y,
+ _lines[i]._textDisplayIndex = scene._textDisplay.add(_lines[i]._pos.x, _lines[i]._pos.y,
fontColor, _lines[i]._widthAdjust, _lines[i]._msg, _lines[i]._font);
}
}
diff --git a/engines/mads/nebular/dialogs_nebular.h b/engines/mads/nebular/dialogs_nebular.h
index d00cd87ead..5dbe4da6f0 100644
--- a/engines/mads/nebular/dialogs_nebular.h
+++ b/engines/mads/nebular/dialogs_nebular.h
@@ -116,7 +116,7 @@ class GameDialog: public FullScreenDialog {
Common::String _msg;
Font *_font;
int _widthAdjust;
-
+
DialogLine();
DialogLine(const Common::String &s);
};
@@ -130,7 +130,7 @@ protected:
int _menuSpritesIndex;
int _lineIndex;
int _textLineCount;
-
+
/**
* Display the dialog
*/
diff --git a/engines/mads/nebular/game_nebular.cpp b/engines/mads/nebular/game_nebular.cpp
index eae74d6da0..fd669bc5cf 100644
--- a/engines/mads/nebular/game_nebular.cpp
+++ b/engines/mads/nebular/game_nebular.cpp
@@ -625,7 +625,7 @@ void GameNebular::doObjectAction() {
_objects.addToInventory(OBJ_DURAFAIL_CELLS);
if (_difficulty == DIFFICULTY_HARD) {
dialogs.showItem(OBJ_DURAFAIL_CELLS, 416);
- }
+ }
_globals[kHandsetCellStatus] = 0;
break;
case 3:
diff --git a/engines/mads/nebular/menu_nebular.cpp b/engines/mads/nebular/menu_nebular.cpp
index f2f90e2291..28de4e5650 100644
--- a/engines/mads/nebular/menu_nebular.cpp
+++ b/engines/mads/nebular/menu_nebular.cpp
@@ -48,7 +48,7 @@ MainMenu::MainMenu(MADSEngine *vm): MenuView(vm) {
_highlightedIndex = -1;
_selectedIndex = -1;
_buttonDown = false;
-
+
for (int i = 0; i < 7; ++i)
_menuItems[i] = nullptr;
}
@@ -85,7 +85,7 @@ void MainMenu::display() {
Common::Point pt(frame0->_offset.x - (frame0->w / 2),
frame0->_offset.y - frame0->h);
screenObjects.add(
- Common::Rect(pt.x, pt.y + DIALOG_TOP, pt.x + frame0->w,
+ Common::Rect(pt.x, pt.y + DIALOG_TOP, pt.x + frame0->w,
pt.y + frame0->h + DIALOG_TOP), LAYER_GUI, CAT_COMMAND, i);
}
@@ -126,7 +126,7 @@ void MainMenu::doFrame() {
// If the user has chosen to skip the animation, show the full menu immediately
if (_skipFlag && _menuItemIndex >= 0) {
- // Quickly loop through all the menu items to display each's final frame
+ // Quickly loop through all the menu items to display each's final frame
for (; _menuItemIndex < 6; ++_menuItemIndex) {
if (_menuItemIndex == 4 && !shouldShowQuotes())
continue;
@@ -161,7 +161,7 @@ void MainMenu::doFrame() {
void MainMenu::addSpriteSlot() {
Scene &scene = _vm->_game->_scene;
SpriteSlots &spriteSlots = scene._spriteSlots;
-
+
int seqIndex = (_menuItemIndex < 6) ? _menuItemIndex : _frameIndex;
spriteSlots.deleteTimer(seqIndex);
@@ -255,7 +255,7 @@ bool MainMenu::onEvent(Common::Event &event) {
}
return true;
- case Common::EVENT_MOUSEMOVE:
+ case Common::EVENT_MOUSEMOVE:
if (_buttonDown) {
int menuIndex = getHighlightedItem(event.mouse);
if (menuIndex != _highlightedIndex) {
@@ -287,7 +287,7 @@ bool MainMenu::onEvent(Common::Event &event) {
default:
break;
}
-
+
return false;
}
@@ -317,7 +317,7 @@ void MainMenu::handleAction(MADSGameAction action) {
break;
case RESUME_GAME:
- // The original resumed the most recently saved game. Instead,
+ // The original resumed the most recently saved game. Instead,
// just show the load game scren
_vm->_dialogs->_pendingDialog = DIALOG_RESTORE;
return;
@@ -354,7 +354,7 @@ void AdvertView::show() {
uint32 expiryTime = g_system->getMillis() + 10 * 1000;
_vm->_palette->resetGamePalette(4, 8);
-
+
// Load the advert background onto the screen
SceneInfo *sceneInfo = SceneInfo::init(_vm);
sceneInfo->load(screenId, 0, Common::String(), 0, _vm->_game->_scene._depthSurface,
diff --git a/engines/mads/nebular/nebular_scenes6.cpp b/engines/mads/nebular/nebular_scenes6.cpp
index 13ee1a3dc1..679039535f 100644
--- a/engines/mads/nebular/nebular_scenes6.cpp
+++ b/engines/mads/nebular/nebular_scenes6.cpp
@@ -3155,7 +3155,7 @@ bool Scene611::check2ChargedBatteries() {
}
bool Scene611::check4ChargedBatteries() {
- if (_game._objects.isInInventory(OBJ_DURAFAIL_CELLS) && _game._objects.isInInventory(OBJ_PHONE_CELLS)
+ if (_game._objects.isInInventory(OBJ_DURAFAIL_CELLS) && _game._objects.isInInventory(OBJ_PHONE_CELLS)
&& _globals[kDurafailRecharged])
return true;
diff --git a/engines/mads/nebular/nebular_scenes7.cpp b/engines/mads/nebular/nebular_scenes7.cpp
index 930bb7c250..0f019c4b19 100644
--- a/engines/mads/nebular/nebular_scenes7.cpp
+++ b/engines/mads/nebular/nebular_scenes7.cpp
@@ -2616,7 +2616,7 @@ void Scene752::actions() {
default:
break;
}
- } else if (_action.isAction(VERB_TAKE, NOUN_BONES) && (_action._savedFields._mainObjectSource == CAT_HOTSPOT) &&
+ } else if (_action.isAction(VERB_TAKE, NOUN_BONES) && (_action._savedFields._mainObjectSource == CAT_HOTSPOT) &&
(!_game._objects.isInInventory(OBJ_BONES) || _game._trigger)) {
switch (_game._trigger) {
case 0:
diff --git a/engines/mads/nebular/nebular_scenes8.cpp b/engines/mads/nebular/nebular_scenes8.cpp
index 14f36756de..62a1a262b0 100644
--- a/engines/mads/nebular/nebular_scenes8.cpp
+++ b/engines/mads/nebular/nebular_scenes8.cpp
@@ -1098,7 +1098,7 @@ void Scene804::actions() {
_action.isAction(VERB_OPEN, NOUN_SERVICE_PANEL)) {
_scene->_nextSceneId = 805;
} else if ((_action.isAction(VERB_ACTIVATE, NOUN_REMOTE)) && _globals[kTopButtonPushed]) {
- if (!_globals[kInSpace]) {
+ if (!_globals[kInSpace]) {
// Top button pressed on panel in hanger control
if (!_globals[kBeamIsUp]) {
_globals[kFromCockpit] = true;
diff --git a/engines/mads/palette.cpp b/engines/mads/palette.cpp
index 1787b3c298..836d04f7c0 100644
--- a/engines/mads/palette.cpp
+++ b/engines/mads/palette.cpp
@@ -233,7 +233,7 @@ int PaletteUsage::process(Common::Array<RGB6> &palette, uint flags) {
// CHECKME: When pressing on F1 in the first screen, newPalIndex is set to 0xFF at this point
// which is a valid value for the index. Maybe a better check would be "< 256" ?
//assert(newPalIndex != -1);
-
+
int var52 = (noUsageFlag && palette[palIndex]._u2) ? 2 : 0;
_vm->_palette->_palFlags[newPalIndex] |= var52 | rgbMask;
@@ -342,7 +342,7 @@ int PaletteUsage::checkRGB(const byte *rgb, int palStart, bool flag, int *palInd
if ((!(*flagsP & 1) || flag) && !(*flagsP & 2)) {
if (!memcmp(palP, rgb, 3)) {
*flagsP |= mask;
-
+
if (palIndex)
*palIndex = result;
match = true;
diff --git a/engines/mads/scene.cpp b/engines/mads/scene.cpp
index 18ceb3c813..d2b4b29622 100644
--- a/engines/mads/scene.cpp
+++ b/engines/mads/scene.cpp
@@ -31,7 +31,7 @@
namespace MADS {
Scene::Scene(MADSEngine *vm)
- : _vm(vm), _action(_vm), _depthSurface(vm),
+ : _vm(vm), _action(_vm), _depthSurface(),
_dirtyAreas(_vm), _dynamicHotspots(vm), _hotspots(vm),
_kernelMessages(vm), _sequences(vm), _sprites(vm), _spriteSlots(vm),
_textDisplay(vm), _userInterface(vm) {
@@ -182,7 +182,7 @@ void Scene::loadScene(int sceneId, const Common::String &prefix, bool palFlag) {
flags |= ANIMFLAG_LOAD_BACKGROUND_ONLY;
_animationData = Animation::init(_vm, this);
- DepthSurface depthSurface(_vm);
+ DepthSurface depthSurface;
_animationData->load(_userInterface, depthSurface, prefix, flags, nullptr, nullptr);
_vm->_palette->_paletteUsage.load(&_scenePaletteUsage);
@@ -611,7 +611,7 @@ void Scene::loadAnimation(const Common::String &resName, int trigger) {
if (_activeAnimation)
freeAnimation();
- DepthSurface depthSurface(_vm);
+ DepthSurface depthSurface;
UserInterface interfaceSurface(_vm);
_activeAnimation = Animation::init(_vm, this);
diff --git a/engines/mads/scene_data.cpp b/engines/mads/scene_data.cpp
index b0a5aa35c6..b5e219ed04 100644
--- a/engines/mads/scene_data.cpp
+++ b/engines/mads/scene_data.cpp
@@ -264,7 +264,7 @@ void SceneInfo::load(int sceneId, int variant, const Common::String &resName,
assert(asset && _depthStyle != 2);
MSprite *spr = asset->getFrame(asset->getCount() - 1);
- bgSurface.copyFrom(spr, si._position, si._depth, &depthSurface,
+ bgSurface.copyFrom(spr, si._position, si._depth, &depthSurface,
si._scale, spr->getTransparencyIndex());
}
diff --git a/engines/mads/sequence.cpp b/engines/mads/sequence.cpp
index 07b1451718..05f00afb5a 100644
--- a/engines/mads/sequence.cpp
+++ b/engines/mads/sequence.cpp
@@ -473,7 +473,7 @@ int SequenceList::startReverseCycle(int srcSpriteIndex, bool flipped, int numTic
int depth = _vm->_game->_scene._depthSurface.getDepth(Common::Point(
frame->_offset.x + frame->w / 2, frame->_offset.y + frame->h / 2));
- return add(srcSpriteIndex, flipped, sprites->getCount(), triggerCountdown, timeoutTicks,
+ return add(srcSpriteIndex, flipped, sprites->getCount(), triggerCountdown, timeoutTicks,
extraTicks, numTicks, 0, 0, true, 100, depth - 1, -1, ANIMTYPE_REVERSIBLE, 0, 0);
}