aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2014-06-26 22:07:33 -0400
committerPaul Gilbert2014-06-26 22:07:33 -0400
commit456ce2a678557c7b9e15493448a18be3040efcf7 (patch)
treec5b7ea6742e7524053b9103a59e51d007b0a3437
parentbdee71f27922d1ba146323374e4501ec462d687d (diff)
downloadscummvm-rg350-456ce2a678557c7b9e15493448a18be3040efcf7.tar.gz
scummvm-rg350-456ce2a678557c7b9e15493448a18be3040efcf7.tar.bz2
scummvm-rg350-456ce2a678557c7b9e15493448a18be3040efcf7.zip
MADS: Implement the difficulty selection dialog
-rw-r--r--engines/mads/messages.cpp6
-rw-r--r--engines/mads/nebular/dialogs_nebular.cpp21
-rw-r--r--engines/mads/nebular/dialogs_nebular.h2
-rw-r--r--engines/mads/screen.cpp4
-rw-r--r--engines/mads/sprites.cpp2
5 files changed, 24 insertions, 11 deletions
diff --git a/engines/mads/messages.cpp b/engines/mads/messages.cpp
index 9b2d6f3114..d41696044b 100644
--- a/engines/mads/messages.cpp
+++ b/engines/mads/messages.cpp
@@ -546,10 +546,10 @@ void TextDisplayList::draw(MSurface *s) {
for (uint idx = 0; idx < size(); ++idx) {
TextDisplay &td = (*this)[idx];
if (td._active && (td._expire >= 0)) {
+ Common::Point destPos(td._bounds.left + _vm->_screen._offset.x,
+ td._bounds.top + _vm->_screen._offset.y);
td._font->setColors(0xFF, td._color1, td._color2, 0);
- td._font->writeString(s, td._msg,
- Common::Point(td._bounds.left, td._bounds.top),
- td._spacing, td._bounds.width());
+ td._font->writeString(s, td._msg, destPos, td._spacing, td._bounds.width());
}
}
}
diff --git a/engines/mads/nebular/dialogs_nebular.cpp b/engines/mads/nebular/dialogs_nebular.cpp
index 36858a4940..6f75c21fd4 100644
--- a/engines/mads/nebular/dialogs_nebular.cpp
+++ b/engines/mads/nebular/dialogs_nebular.cpp
@@ -270,11 +270,9 @@ void DialogsNebular::showDialog() {
//GameMenuDialog::show();
break;
case DIALOG_DIFFICULTY: {
-/*
DifficultyDialog *dlg = new DifficultyDialog(_vm);
dlg->show();
delete dlg;
-*/
break;
}
default:
@@ -526,7 +524,7 @@ ScreenDialog::ScreenDialog(MADSEngine *vm) : _vm(vm) {
scene._priorSceneId = priorSceneId;
scene._currentSceneId = currentSceneId;
scene._nextSceneId = nextSceneId;
- scene._posAdjust.y = 22;
+ _vm->_screen._offset.y = 22;
_vm->_sound->pauseNewCommands();
_vm->_events->initVars();
game._kernelMode = KERNEL_ROOM_INIT;
@@ -544,7 +542,8 @@ ScreenDialog::ScreenDialog(MADSEngine *vm) : _vm(vm) {
}
_vm->_screen.empty();
- _vm->_screen.hLine(0, 0, MADS_SCREEN_WIDTH, 2);
+ _vm->_screen.hLine(0, 20, MADS_SCREEN_WIDTH, 2);
+ _vm->_screen.hLine(0, 179, MADS_SCREEN_WIDTH, 2);
game._fx = _vm->_screenFade == SCREEN_FADE_SMOOTH ? kTransitionFadeIn : kCenterVertTransition;
game._trigger = 0;
@@ -560,6 +559,10 @@ ScreenDialog::ScreenDialog(MADSEngine *vm) : _vm(vm) {
_lineIndex = -1;
}
+ScreenDialog::~ScreenDialog() {
+ _vm->_screen._offset.y = 0;
+}
+
void ScreenDialog::clearLines() {
Scene &scene = _vm->_game->_scene;
_v2 = 0;
@@ -704,11 +707,17 @@ void ScreenDialog::chooseBackground() {
void ScreenDialog::setFrame(int frameNumber, int depth) {
Scene &scene = _vm->_game->_scene;
+ SpriteAsset *menuSprites = scene._sprites[_menuSpritesIndex];
+ MSprite *frame = menuSprites->getFrame(frameNumber - 1);
+
SpriteSlot &spriteSlot = scene._spriteSlots[scene._spriteSlots.add()];
spriteSlot._flags = IMG_UPDATE;
spriteSlot._seqIndex = 1;
spriteSlot._spritesIndex = _menuSpritesIndex;
spriteSlot._frameNumber = frameNumber;
+ spriteSlot._position = frame->_offset;
+ spriteSlot._depth = depth;
+ spriteSlot._scale = 100;
}
void ScreenDialog::show() {
@@ -861,13 +870,13 @@ void DifficultyDialog::show() {
switch (_selectedLine) {
case 1:
- game._difficulty = Nebular::DIFFICULTY_HARD;
+ game._difficulty = Nebular::DIFFICULTY_EASY;
break;
case 2:
game._difficulty = Nebular::DIFFICULTY_MEDIUM;
break;
case 3:
- game._difficulty = Nebular::DIFFICULTY_EASY;
+ game._difficulty = Nebular::DIFFICULTY_HARD;
break;
default:
_vm->quitGame();
diff --git a/engines/mads/nebular/dialogs_nebular.h b/engines/mads/nebular/dialogs_nebular.h
index a144ee9d83..39d0a31670 100644
--- a/engines/mads/nebular/dialogs_nebular.h
+++ b/engines/mads/nebular/dialogs_nebular.h
@@ -182,7 +182,7 @@ public:
/**
* Destructor
*/
- virtual ~ScreenDialog() {}
+ virtual ~ScreenDialog();
/**
* Show the dialog
diff --git a/engines/mads/screen.cpp b/engines/mads/screen.cpp
index 7e8710db56..284268648a 100644
--- a/engines/mads/screen.cpp
+++ b/engines/mads/screen.cpp
@@ -212,9 +212,11 @@ void DirtyAreas::copy(MSurface *srcSurface, MSurface *destSurface, const Common:
Common::Rect bounds(srcBounds.left + posAdjust.x, srcBounds.top + posAdjust.y,
srcBounds.right + posAdjust.x, srcBounds.bottom + posAdjust.y);
+ Common::Point destPos(bounds.left + _vm->_screen._offset.x,
+ bounds.top + _vm->_screen._offset.y);
if ((*this)[i]._active && bounds.isValidRect()) {
- srcSurface->copyTo(destSurface, bounds, Common::Point(bounds.left, bounds.top));
+ srcSurface->copyTo(destSurface, bounds, destPos);
}
}
}
diff --git a/engines/mads/sprites.cpp b/engines/mads/sprites.cpp
index cd358077b5..2bf13eeb5a 100644
--- a/engines/mads/sprites.cpp
+++ b/engines/mads/sprites.cpp
@@ -331,6 +331,8 @@ void SpriteSlots::drawSprites(MSurface *s) {
xp = slot._position.x - (sprite->w / 2) - scene._posAdjust.x;
yp = slot._position.y - sprite->h - scene._posAdjust.y + 1;
}
+ xp += _vm->_screen._offset.x;
+ yp += _vm->_screen._offset.y;
if (slot._depth > 1) {
// Draw the frame with depth processing