aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--audio/decoders/mp3.cpp22
-rw-r--r--backends/cloud/cloudicon.cpp (renamed from backends/networking/curl/cloudicon.cpp)143
-rw-r--r--backends/cloud/cloudicon.h (renamed from backends/networking/curl/cloudicon.h)78
-rw-r--r--backends/cloud/cloudicon_data.h (renamed from backends/networking/curl/cloudicon_data.h)0
-rw-r--r--backends/cloud/cloudicon_disabled_data.h (renamed from backends/networking/curl/cloudicon_disabled_data.h)0
-rw-r--r--backends/cloud/cloudmanager.cpp24
-rw-r--r--backends/cloud/cloudmanager.h22
-rw-r--r--backends/cloud/onedrive/onedrivestorage.cpp2
-rw-r--r--backends/cloud/storage.cpp6
-rw-r--r--backends/graphics/opengl/opengl-graphics.cpp46
-rw-r--r--backends/graphics/opengl/opengl-graphics.h18
-rw-r--r--backends/graphics/openglsdl/openglsdl-graphics.cpp11
-rw-r--r--backends/graphics/surfacesdl/surfacesdl-graphics.cpp6
-rw-r--r--backends/module.mk2
-rw-r--r--backends/networking/curl/connectionmanager.cpp7
-rw-r--r--backends/networking/curl/connectionmanager.h5
-rw-r--r--backends/saves/default/default-saves.cpp13
-rw-r--r--engines/adl/adl.cpp2
-rw-r--r--engines/adl/detection.cpp6
-rw-r--r--engines/adl/hires4.cpp2
-rw-r--r--engines/dm/TODOs/methodtree.txt50
-rw-r--r--engines/dm/TODOs/todo.txt5
-rw-r--r--engines/dm/champion.cpp421
-rw-r--r--engines/dm/champion.h58
-rw-r--r--engines/dm/console.cpp4
-rw-r--r--engines/dm/dialog.cpp122
-rw-r--r--engines/dm/dm.cpp178
-rw-r--r--engines/dm/dm.h95
-rw-r--r--engines/dm/dungeonman.cpp62
-rw-r--r--engines/dm/eventman.cpp96
-rw-r--r--engines/dm/eventman.h16
-rw-r--r--engines/dm/gfx.cpp753
-rw-r--r--engines/dm/gfx.h540
-rw-r--r--engines/dm/group.cpp422
-rw-r--r--engines/dm/group.h149
-rw-r--r--engines/dm/inventory.cpp146
-rw-r--r--engines/dm/inventory.h28
-rw-r--r--engines/dm/loadsave.cpp43
-rw-r--r--engines/dm/loadsave.h2
-rw-r--r--engines/dm/menus.cpp185
-rw-r--r--engines/dm/menus.h22
-rw-r--r--engines/dm/movesens.cpp127
-rw-r--r--engines/dm/movesens.h7
-rw-r--r--engines/dm/objectman.cpp34
-rw-r--r--engines/dm/objectman.h13
-rw-r--r--engines/dm/projexpl.cpp68
-rw-r--r--engines/dm/projexpl.h46
-rw-r--r--engines/dm/sounds.cpp12
-rw-r--r--engines/dm/sounds.h50
-rw-r--r--engines/dm/text.cpp39
-rw-r--r--engines/dm/text.h6
-rw-r--r--engines/dm/timeline.cpp137
-rw-r--r--engines/dm/timeline.h108
-rw-r--r--engines/drascula/saveload.cpp2
-rw-r--r--engines/engine.cpp2
-rw-r--r--engines/fullpipe/fullpipe.cpp13
-rw-r--r--engines/fullpipe/gameloader.cpp37
-rw-r--r--engines/fullpipe/gameloader.h19
-rw-r--r--engines/fullpipe/gfx.cpp12
-rw-r--r--engines/fullpipe/gfx.h2
-rw-r--r--engines/fullpipe/interaction.cpp6
-rw-r--r--engines/fullpipe/inventory.cpp16
-rw-r--r--engines/fullpipe/inventory.h1
-rw-r--r--engines/fullpipe/lift.cpp6
-rw-r--r--engines/fullpipe/messages.cpp8
-rw-r--r--engines/fullpipe/modal.cpp12
-rw-r--r--engines/fullpipe/module.mk1
-rw-r--r--engines/fullpipe/motion.cpp5
-rw-r--r--engines/fullpipe/objects.h2
-rw-r--r--engines/fullpipe/scenes/scene04.cpp26
-rw-r--r--engines/fullpipe/scenes/scene06.cpp2
-rw-r--r--engines/fullpipe/scenes/scene09.cpp10
-rw-r--r--engines/fullpipe/scenes/scene14.cpp2
-rw-r--r--engines/fullpipe/scenes/scene16.cpp2
-rw-r--r--engines/fullpipe/scenes/scene18and19.cpp2
-rw-r--r--engines/fullpipe/scenes/scene25.cpp2
-rw-r--r--engines/fullpipe/scenes/scene28.cpp19
-rw-r--r--engines/fullpipe/scenes/scene34.cpp2
-rw-r--r--engines/fullpipe/scenes/scene35.cpp4
-rw-r--r--engines/fullpipe/scenes/sceneDbg.cpp20
-rw-r--r--engines/fullpipe/stateloader.cpp233
-rw-r--r--engines/fullpipe/statesaver.cpp200
-rw-r--r--engines/fullpipe/statics.cpp15
-rw-r--r--engines/fullpipe/statics.h2
-rw-r--r--engines/fullpipe/utils.cpp61
-rw-r--r--engines/fullpipe/utils.h38
-rw-r--r--engines/kyra/saveload_eob.cpp8
-rw-r--r--engines/sci/detection_tables.h14
-rw-r--r--engines/sci/engine/kernel.cpp7
-rw-r--r--engines/sci/engine/script_patches.cpp31
-rw-r--r--engines/sherlock/debugger.cpp23
-rw-r--r--engines/sherlock/debugger.h5
-rw-r--r--engines/sword1/control.cpp10
-rw-r--r--engines/titanic/core/dont_save_file_item.h5
-rw-r--r--engines/titanic/star_control/fpoint.cpp9
-rw-r--r--engines/titanic/star_control/fpoint.h19
-rw-r--r--engines/xeen/character.cpp199
-rw-r--r--engines/xeen/combat.cpp37
-rw-r--r--engines/xeen/cutscenes.cpp213
-rw-r--r--engines/xeen/cutscenes.h102
-rw-r--r--engines/xeen/debugger.cpp31
-rw-r--r--engines/xeen/debugger.h1
-rw-r--r--engines/xeen/detection.cpp2
-rw-r--r--engines/xeen/dialogs.cpp125
-rw-r--r--engines/xeen/dialogs.h22
-rw-r--r--engines/xeen/dialogs_automap.cpp4
-rw-r--r--engines/xeen/dialogs_automap.h4
-rw-r--r--engines/xeen/dialogs_char_info.cpp74
-rw-r--r--engines/xeen/dialogs_char_info.h3
-rw-r--r--engines/xeen/dialogs_control_panel.h4
-rw-r--r--engines/xeen/dialogs_dismiss.cpp2
-rw-r--r--engines/xeen/dialogs_dismiss.h3
-rw-r--r--engines/xeen/dialogs_error.cpp6
-rw-r--r--engines/xeen/dialogs_error.h8
-rw-r--r--engines/xeen/dialogs_exchange.cpp2
-rw-r--r--engines/xeen/dialogs_exchange.h3
-rw-r--r--engines/xeen/dialogs_fight_options.h4
-rw-r--r--engines/xeen/dialogs_info.cpp30
-rw-r--r--engines/xeen/dialogs_info.h3
-rw-r--r--engines/xeen/dialogs_input.cpp4
-rw-r--r--engines/xeen/dialogs_input.h6
-rw-r--r--engines/xeen/dialogs_items.cpp111
-rw-r--r--engines/xeen/dialogs_items.h4
-rw-r--r--engines/xeen/dialogs_options.cpp13
-rw-r--r--engines/xeen/dialogs_party.cpp94
-rw-r--r--engines/xeen/dialogs_query.cpp2
-rw-r--r--engines/xeen/dialogs_query.h8
-rw-r--r--engines/xeen/dialogs_quests.cpp32
-rw-r--r--engines/xeen/dialogs_quests.h3
-rw-r--r--engines/xeen/dialogs_quick_ref.cpp12
-rw-r--r--engines/xeen/dialogs_quick_ref.h4
-rw-r--r--engines/xeen/dialogs_spells.cpp104
-rw-r--r--engines/xeen/dialogs_spells.h31
-rw-r--r--engines/xeen/dialogs_whowill.cpp8
-rw-r--r--engines/xeen/dialogs_whowill.h4
-rw-r--r--engines/xeen/events.cpp2
-rw-r--r--engines/xeen/events.h3
-rw-r--r--engines/xeen/files.cpp72
-rw-r--r--engines/xeen/files.h71
-rw-r--r--engines/xeen/font.cpp4
-rw-r--r--engines/xeen/interface.cpp75
-rw-r--r--engines/xeen/interface_map.cpp455
-rw-r--r--engines/xeen/map.cpp44
-rw-r--r--engines/xeen/module.mk2
-rw-r--r--engines/xeen/music.cpp260
-rw-r--r--engines/xeen/music.h50
-rw-r--r--engines/xeen/party.cpp18
-rw-r--r--engines/xeen/resources.cpp618
-rw-r--r--engines/xeen/resources.h837
-rw-r--r--engines/xeen/screen.cpp119
-rw-r--r--engines/xeen/screen.h14
-rw-r--r--engines/xeen/scripts.cpp15
-rw-r--r--engines/xeen/sound.cpp60
-rw-r--r--engines/xeen/sound.h58
-rw-r--r--engines/xeen/spells.cpp40
-rw-r--r--engines/xeen/sprites.cpp15
-rw-r--r--engines/xeen/sprites.h10
-rw-r--r--engines/xeen/town.cpp156
-rw-r--r--engines/xeen/town.h4
-rw-r--r--engines/xeen/worldofxeen/clouds_cutscenes.cpp436
-rw-r--r--engines/xeen/worldofxeen/clouds_cutscenes.h15
-rw-r--r--engines/xeen/worldofxeen/darkside_cutscenes.cpp1100
-rw-r--r--engines/xeen/worldofxeen/darkside_cutscenes.h21
-rw-r--r--engines/xeen/worldofxeen/worldofxeen.cpp7
-rw-r--r--engines/xeen/worldofxeen/worldofxeen.h2
-rw-r--r--engines/xeen/worldofxeen/worldofxeen_resources.cpp62
-rw-r--r--engines/xeen/worldofxeen/worldofxeen_resources.h50
-rw-r--r--engines/xeen/xeen.cpp26
-rw-r--r--engines/xeen/xeen.h3
-rw-r--r--gui/editgamedialog.cpp2
-rw-r--r--gui/options.cpp4
-rw-r--r--gui/saveload-dialog.cpp4
-rw-r--r--gui/themes/translations.datbin582141 -> 587494 bytes
-rw-r--r--image/codecs/indeo/vlc.cpp2
-rw-r--r--image/png.cpp18
-rw-r--r--image/png.h1
-rw-r--r--po/be_BY.po94
-rw-r--r--po/ca_ES.po94
-rw-r--r--po/cs_CZ.po94
-rw-r--r--po/da_DK.po94
-rw-r--r--po/de_DE.po94
-rw-r--r--po/es_ES.po94
-rw-r--r--po/eu.po94
-rw-r--r--po/fi_FI.po94
-rw-r--r--po/fr_FR.po94
-rw-r--r--po/gl_ES.po94
-rw-r--r--po/hu_HU.po96
-rw-r--r--po/it_IT.po94
-rw-r--r--po/nb_NO.po94
-rw-r--r--po/nl_NL.po255
-rw-r--r--po/nn_NO.po94
-rw-r--r--po/pl_PL.po94
-rw-r--r--po/pt_BR.po94
-rw-r--r--po/ru_RU.po94
-rw-r--r--po/scummvm.pot94
-rw-r--r--po/sv_SE.po94
-rw-r--r--po/uk_UA.po308
-rw-r--r--po/zh-Latn_CN.po94
198 files changed, 8223 insertions, 5673 deletions
diff --git a/audio/decoders/mp3.cpp b/audio/decoders/mp3.cpp
index 36233a2e13..93c21b9072 100644
--- a/audio/decoders/mp3.cpp
+++ b/audio/decoders/mp3.cpp
@@ -438,6 +438,7 @@ PacketizedMP3Stream::PacketizedMP3Stream(uint channels, uint rate) :
}
PacketizedMP3Stream::~PacketizedMP3Stream() {
+ Common::StackLock lock(_mutex);
while (!_queue.empty()) {
delete _queue.front();
_queue.pop();
@@ -447,12 +448,13 @@ PacketizedMP3Stream::~PacketizedMP3Stream() {
int PacketizedMP3Stream::readBuffer(int16 *buffer, const int numSamples) {
int samples = 0;
+ Common::StackLock lock(_mutex);
while (samples < numSamples) {
- Common::StackLock lock(_mutex);
-
- // Empty? Bail out for now
- if (_queue.empty())
+ // Empty? Bail out for now, and mark the stream as ended
+ if (_queue.empty()) {
+ _state = MP3_STATE_EOS;
return samples;
+ }
Common::SeekableReadStream *packet = _queue.front();
@@ -473,6 +475,12 @@ int PacketizedMP3Stream::readBuffer(int16 *buffer, const int numSamples) {
}
}
+ // This will happen if the audio runs out just as the last sample is
+ // decoded. But there may still be more audio queued up.
+ if (_state == MP3_STATE_EOS && !_queue.empty()) {
+ _state = MP3_STATE_READY;
+ }
+
return samples;
}
@@ -492,6 +500,12 @@ void PacketizedMP3Stream::queuePacket(Common::SeekableReadStream *packet) {
Common::StackLock lock(_mutex);
assert(!_finished);
_queue.push(packet);
+
+ // If the audio had finished (buffer underrun?), there is more to
+ // decode now.
+ if (_state == MP3_STATE_EOS) {
+ _state = MP3_STATE_READY;
+ }
}
void PacketizedMP3Stream::finish() {
diff --git a/backends/networking/curl/cloudicon.cpp b/backends/cloud/cloudicon.cpp
index 9aa08af9fb..972efae57b 100644
--- a/backends/networking/curl/cloudicon.cpp
+++ b/backends/cloud/cloudicon.cpp
@@ -20,23 +20,21 @@
*
*/
-#include "backends/networking/curl/cloudicon.h"
-#include "backends/cloud/cloudmanager.h"
+#include "backends/cloud/cloudicon.h"
#include "common/memstream.h"
-#include "gui/ThemeEngine.h"
-#include "gui/gui-manager.h"
+#include "common/system.h"
#include "image/png.h"
-namespace Networking {
+namespace Cloud {
-const float CloudIcon::ALPHA_STEP = 0.025;
+const float CloudIcon::ALPHA_SPEED = 0.0005;
const float CloudIcon::ALPHA_MAX = 1;
const float CloudIcon::ALPHA_MIN = 0.6;
-CloudIcon::CloudIcon():
- _wasVisible(false), _iconsInited(false), _showingDisabled(false),
- _currentAlpha(0), _alphaRising(true), _disabledFrames(0) {
+CloudIcon::CloudIcon() {
initIcons();
+ hide();
+ _lastUpdateTime = g_system->getMillis();
}
CloudIcon::~CloudIcon() {
@@ -45,72 +43,95 @@ CloudIcon::~CloudIcon() {
_alphaIcon.free();
}
-bool CloudIcon::draw() {
- bool stop = false;
- initIcons();
+void CloudIcon::show(CloudIcon::Type icon, int duration) {
+ if (_type == icon) {
+ return; // Nothing to do
+ }
- if (CloudMan.isWorking() || _disabledFrames > 0) {
- if (g_system) {
- if (!_wasVisible) {
- _wasVisible = true;
- }
- --_disabledFrames;
- if (_alphaRising) {
- if (_currentAlpha < ALPHA_MIN)
- _currentAlpha += 5 * ALPHA_STEP;
- else
- _currentAlpha += ALPHA_STEP;
- if (_currentAlpha > ALPHA_MAX) {
- _currentAlpha = ALPHA_MAX;
- _alphaRising = false;
- }
- } else {
- _currentAlpha -= ALPHA_STEP;
- if (_currentAlpha < ALPHA_MIN) {
- _currentAlpha = ALPHA_MIN;
- _alphaRising = true;
- }
- }
+ if (icon != kNone) {
+ _state = kShown;
+ _type = icon;
+
+ if (duration) {
+ _hideTime = g_system->getMillis() + duration;
} else {
- _wasVisible = false;
+ _hideTime = 0;
}
} else {
- _wasVisible = false;
- _currentAlpha -= 5 * ALPHA_STEP;
- if (_currentAlpha <= 0) {
- _currentAlpha = 0;
- stop = true;
- }
+ _state = kGoingToHide;
}
+}
+
+void CloudIcon::hide() {
+ _state = kHidden;
+ _type = kNone;
+ _hideTime = 0;
+ _currentAlpha = 0;
+ _alphaRising = true;
+}
- if (g_system) {
- if (!stop) {
- makeAlphaIcon((_showingDisabled ? _disabledIcon : _icon), _currentAlpha);
- g_system->displayActivityIconOnOSD(&_alphaIcon);
+CloudIcon::Type CloudIcon::getShownType() const {
+ return _type;
+}
+
+bool CloudIcon::needsUpdate() const {
+ uint32 delaySinceLastUpdate = g_system->getMillis() - _lastUpdateTime;
+ return delaySinceLastUpdate >= UPDATE_DELAY_MIN_MILLIS;
+}
+
+void CloudIcon::update() {
+ uint32 currentTime = g_system->getMillis();
+ uint32 delaySinceLastUpdate = currentTime - _lastUpdateTime;
+ _lastUpdateTime = currentTime;
+
+ switch (_state) {
+ case kHidden:
+ return; // Nothing to do
+ case kShown:
+ if (_alphaRising) {
+ if (_currentAlpha < ALPHA_MIN)
+ _currentAlpha += 5 * ALPHA_SPEED * delaySinceLastUpdate;
+ else
+ _currentAlpha += ALPHA_SPEED * delaySinceLastUpdate;
+ if (_currentAlpha > ALPHA_MAX) {
+ _currentAlpha = ALPHA_MAX;
+ _alphaRising = false;
+ }
} else {
- g_system->displayActivityIconOnOSD(nullptr);
+ _currentAlpha -= ALPHA_SPEED * delaySinceLastUpdate;
+ if (_currentAlpha < ALPHA_MIN) {
+ _currentAlpha = ALPHA_MIN;
+ _alphaRising = true;
+ }
}
- }
- if (stop)
- _showingDisabled = false;
- return stop;
-}
+ if (_hideTime != 0 && _hideTime <= currentTime) {
+ _hideTime = 0;
+ _state = kGoingToHide;
+ }
+ break;
+ case kGoingToHide:
+ _currentAlpha -= 5 * ALPHA_SPEED * delaySinceLastUpdate;
+ if (_currentAlpha <= 0) {
+ hide();
+ }
+ break;
+ }
-void CloudIcon::showDisabled() {
- _showingDisabled = true;
- _disabledFrames = 20 * 3; //3 seconds 20 fps
+ if (_state != kHidden) {
+ makeAlphaIcon((_type == kDisabled ? _disabledIcon : _icon), _currentAlpha);
+ g_system->displayActivityIconOnOSD(&_alphaIcon);
+ } else {
+ g_system->displayActivityIconOnOSD(nullptr);
+ }
}
-#include "backends/networking/curl/cloudicon_data.h"
-#include "backends/networking/curl/cloudicon_disabled_data.h"
+#include "backends/cloud/cloudicon_data.h"
+#include "backends/cloud/cloudicon_disabled_data.h"
void CloudIcon::initIcons() {
- if (_iconsInited)
- return;
loadIcon(_icon, cloudicon_data, ARRAYSIZE(cloudicon_data));
loadIcon(_disabledIcon, cloudicon_disabled_data, ARRAYSIZE(cloudicon_disabled_data));
- _iconsInited = true;
}
void CloudIcon::loadIcon(Graphics::Surface &icon, byte *data, uint32 size) {
@@ -123,7 +144,7 @@ void CloudIcon::loadIcon(Graphics::Surface &icon, byte *data, uint32 size) {
return icon.copyFrom(*s);
}
-void CloudIcon::makeAlphaIcon(Graphics::Surface &icon, float alpha) {
+void CloudIcon::makeAlphaIcon(const Graphics::Surface &icon, float alpha) {
_alphaIcon.copyFrom(icon);
byte *pixels = (byte *)_alphaIcon.getPixels();
@@ -154,4 +175,4 @@ void CloudIcon::makeAlphaIcon(Graphics::Surface &icon, float alpha) {
}
}
-} // End of namespace Networking
+} // End of namespace Cloud
diff --git a/backends/networking/curl/cloudicon.h b/backends/cloud/cloudicon.h
index d6ea60bd51..2b2f9cfd57 100644
--- a/backends/networking/curl/cloudicon.h
+++ b/backends/cloud/cloudicon.h
@@ -25,46 +25,66 @@
#include "graphics/surface.h"
-namespace Networking {
+namespace Cloud {
class CloudIcon {
- static const float ALPHA_STEP, ALPHA_MAX, ALPHA_MIN;
-
- bool _wasVisible, _iconsInited, _showingDisabled;
- Graphics::Surface _icon, _disabledIcon, _alphaIcon;
- float _currentAlpha;
- bool _alphaRising;
- int _disabledFrames;
-
- void initIcons();
- void loadIcon(Graphics::Surface &icon, byte *data, uint32 size);
- void makeAlphaIcon(Graphics::Surface &icon, float alpha);
-
public:
CloudIcon();
~CloudIcon();
/**
- * This method is called from ConnectionManager every time
- * its own timer calls the handle() method. The primary
- * responsibility of this draw() method is to draw cloud icon
- * on ScummVM's OSD when current cloud Storage is working.
- *
- * As we don't want ConnectionManager to work when no
- * Requests are running, we'd like to stop the timer. But then
- * this icon wouldn't have time to disappear smoothly. So,
- * in order to do that, ConnectionManager stop its timer
- * only when this draw() method returns true, indicating that
- * the CloudIcon has disappeared and the timer could be stopped.
+ * The type of cloud icon to show
+ */
+ enum Type {
+ kNone, /** Hide the currently shown icon if any */
+ kSyncing, /** Cloud syncing icon */
+ kDisabled /** Cloud syncing not available icon */
+ };
+
+ /**
+ * Select the icon to show on the OSD
*
- * @return true if ConnMan's timer could be stopped.
+ * @param icon Icon type to show. Use kNone to hide the current icon if any.
+ * @param duration Duration in milliseconds the icon stays visible on screen. 0 means the icon stays indefinitely.
*/
- bool draw();
+ void show(Type icon, int duration = 0);
+
+ /** The currently visible icon. kNone means no icon is shown. */
+ Type getShownType() const;
+
+ /** Returns true if the icon state needs to be checked for changes */
+ bool needsUpdate() const;
+
+ /** Update the icon visible on the OSD */
+ void update();
+
+private:
+ static const float ALPHA_SPEED, ALPHA_MAX, ALPHA_MIN;
+ static const int UPDATE_DELAY_MIN_MILLIS = 10;
+
+ enum State {
+ kHidden,
+ kShown,
+ kGoingToHide
+ };
+
+ State _state;
+ Type _type;
+
+ Graphics::Surface _icon, _disabledIcon, _alphaIcon;
+ float _currentAlpha;
+ bool _alphaRising;
+
+ uint32 _hideTime;
+ uint32 _lastUpdateTime;
+
+ void initIcons();
+ void loadIcon(Graphics::Surface &icon, byte *data, uint32 size);
+ void makeAlphaIcon(const Graphics::Surface &icon, float alpha);
- /** Draw a "cloud disabled" icon instead of "cloud syncing" one. */
- void showDisabled();
+ void hide();
};
-} // End of namespace Networking
+} // End of namespace Cloud
#endif
diff --git a/backends/networking/curl/cloudicon_data.h b/backends/cloud/cloudicon_data.h
index 21d88182a3..21d88182a3 100644
--- a/backends/networking/curl/cloudicon_data.h
+++ b/backends/cloud/cloudicon_data.h
diff --git a/backends/networking/curl/cloudicon_disabled_data.h b/backends/cloud/cloudicon_disabled_data.h
index 4340a8a37c..4340a8a37c 100644
--- a/backends/networking/curl/cloudicon_disabled_data.h
+++ b/backends/cloud/cloudicon_disabled_data.h
diff --git a/backends/cloud/cloudmanager.cpp b/backends/cloud/cloudmanager.cpp
index 3456b99ab7..5f7d6942ca 100644
--- a/backends/cloud/cloudmanager.cpp
+++ b/backends/cloud/cloudmanager.cpp
@@ -45,6 +45,8 @@ const char *const CloudManager::kStoragePrefix = "storage_";
CloudManager::CloudManager() : _currentStorageIndex(0), _activeStorage(nullptr) {}
CloudManager::~CloudManager() {
+ g_system->getEventManager()->getEventDispatcher()->unregisterSource(this);
+
delete _activeStorage;
freeStorages();
}
@@ -108,6 +110,8 @@ void CloudManager::init() {
_currentStorageIndex = ConfMan.getInt("current_storage", ConfMan.kCloudDomain);
loadStorage();
+
+ g_system->getEventManager()->getEventDispatcher()->registerSource(this, false);
}
void CloudManager::save() {
@@ -383,6 +387,10 @@ void CloudManager::setSyncTarget(GUI::CommandReceiver *target) const {
storage->setSyncTarget(target);
}
+void CloudManager::showCloudDisabledIcon() {
+ _icon.show(CloudIcon::kDisabled, 3000);
+}
+
///// DownloadFolderRequest-related /////
bool CloudManager::startDownload(Common::String remotePath, Common::String localPath) const {
@@ -453,4 +461,20 @@ Common::String CloudManager::getDownloadLocalDirectory() const {
return "";
}
+bool CloudManager::pollEvent(Common::Event &event) {
+ if (_icon.needsUpdate()) {
+ if (_icon.getShownType() != CloudIcon::kDisabled) {
+ if (isWorking()) {
+ _icon.show(CloudIcon::kSyncing);
+ } else {
+ _icon.show(CloudIcon::kNone);
+ }
+ }
+
+ _icon.update();
+ }
+
+ return false;
+}
+
} // End of namespace Cloud
diff --git a/backends/cloud/cloudmanager.h b/backends/cloud/cloudmanager.h
index 8a99d5bebb..f58ea8373a 100644
--- a/backends/cloud/cloudmanager.h
+++ b/backends/cloud/cloudmanager.h
@@ -24,9 +24,12 @@
#define CLOUD_CLOUDMANAGER_H
#include "backends/cloud/storage.h"
+#include "backends/cloud/cloudicon.h"
+
#include "common/array.h"
#include "common/singleton.h"
#include "common/str-array.h"
+#include "common/events.h"
namespace GUI {
@@ -47,7 +50,7 @@ enum StorageID {
kStorageTotal
};
-class CloudManager : public Common::Singleton<CloudManager> {
+class CloudManager : public Common::Singleton<CloudManager>, public Common::EventSource {
static const char *const kStoragePrefix;
struct StorageConfig {
@@ -61,6 +64,8 @@ class CloudManager : public Common::Singleton<CloudManager> {
Storage *_activeStorage;
Common::Array<Storage *> _storagesToRemove;
+ CloudIcon _icon;
+
void loadStorage();
Common::String getStorageConfigName(uint32 index) const;
@@ -71,6 +76,18 @@ class CloudManager : public Common::Singleton<CloudManager> {
/** Calls the error callback with a special "no storage connected" message. */
void passNoStorageConnected(Networking::ErrorCallback errorCallback) const;
+ /**
+ * Common::EventSource interface
+ *
+ * The cloud manager registers itself as an event source even if does not
+ * actually produce events as a mean to be polled periodically by the GUI
+ * or engine code.
+ *
+ * The periodical polling is used to update the OSD icon indicating
+ * background sync activity.
+ */
+ virtual bool pollEvent(Common::Event &event) override;
+
public:
CloudManager();
virtual ~CloudManager();
@@ -233,6 +250,9 @@ public:
/** Sets SavesSyncRequest's target to given CommandReceiver. */
void setSyncTarget(GUI::CommandReceiver *target) const;
+ /** Shows a "cloud disabled" icon for three seconds. */
+ void showCloudDisabledIcon();
+
///// DownloadFolderRequest-related /////
/** Starts a folder download. */
diff --git a/backends/cloud/onedrive/onedrivestorage.cpp b/backends/cloud/onedrive/onedrivestorage.cpp
index 3ffdcc67f8..8799f3d69f 100644
--- a/backends/cloud/onedrive/onedrivestorage.cpp
+++ b/backends/cloud/onedrive/onedrivestorage.cpp
@@ -196,7 +196,7 @@ void OneDriveStorage::infoInnerCallback(StorageInfoCallback outerCallback, Netwo
Common::JSONObject info = json->asObject();
Common::String uid, name, email;
- uint64 quotaUsed = 0, quotaAllocated = 26843545600L; // 25 GB, because I actually don't know any way to find out the real one
+ uint64 quotaUsed = 0, quotaAllocated = 26843545600LL; // 25 GB, because I actually don't know any way to find out the real one
if (Networking::CurlJsonRequest::jsonContainsObject(info, "createdBy", "OneDriveStorage::infoInnerCallback")) {
Common::JSONObject createdBy = info.getVal("createdBy")->asObject();
diff --git a/backends/cloud/storage.cpp b/backends/cloud/storage.cpp
index f2d432a820..4cccacf6d6 100644
--- a/backends/cloud/storage.cpp
+++ b/backends/cloud/storage.cpp
@@ -207,7 +207,7 @@ void Storage::savesSyncDefaultCallback(BoolResponse response) {
if (!response.value)
warning("SavesSyncRequest called success callback with `false` argument");
- g_system->displayMessageOnOSD(_("Saves sync complete."));
+ g_system->displayMessageOnOSD(_("Saved games sync complete."));
}
void Storage::savesSyncDefaultErrorCallback(Networking::ErrorResponse error) {
@@ -218,9 +218,9 @@ void Storage::savesSyncDefaultErrorCallback(Networking::ErrorResponse error) {
printErrorResponse(error);
if (error.interrupted)
- g_system->displayMessageOnOSD(_("Saves sync was cancelled."));
+ g_system->displayMessageOnOSD(_("Saved games sync was cancelled."));
else
- g_system->displayMessageOnOSD(_("Saves sync failed.\nCheck your Internet connection."));
+ g_system->displayMessageOnOSD(_("Saved games sync failed.\nCheck your Internet connection."));
}
///// DownloadFolderRequest-related /////
diff --git a/backends/graphics/opengl/opengl-graphics.cpp b/backends/graphics/opengl/opengl-graphics.cpp
index e4df94c52d..41f35e29eb 100644
--- a/backends/graphics/opengl/opengl-graphics.cpp
+++ b/backends/graphics/opengl/opengl-graphics.cpp
@@ -58,7 +58,7 @@ OpenGLGraphicsManager::OpenGLGraphicsManager()
_forceRedraw(false), _scissorOverride(3)
#ifdef USE_OSD
, _osdMessageChangeRequest(false), _osdMessageAlpha(0), _osdMessageFadeStartTime(0), _osdMessageSurface(nullptr),
- _osdIconChangeRequest(false), _osdIconSurface(nullptr)
+ _osdIconSurface(nullptr)
#endif
{
memset(_gamePalette, 0, sizeof(_gamePalette));
@@ -72,7 +72,6 @@ OpenGLGraphicsManager::~OpenGLGraphicsManager() {
#ifdef USE_OSD
delete _osdMessageSurface;
delete _osdIconSurface;
- _osdIconNextData.free();
#endif
#if !USE_FORCED_GLES
ShaderManager::destroy();
@@ -368,14 +367,13 @@ void OpenGLGraphicsManager::updateScreen() {
#ifdef USE_OSD
{
Common::StackLock lock(_osdMutex);
-
if (_osdMessageChangeRequest) {
osdMessageUpdateSurface();
}
+ }
- if (_osdIconChangeRequest) {
- osdIconUpdateSurface();
- }
+ if (_osdIconSurface) {
+ _osdIconSurface->updateGLTexture();
}
#endif
@@ -810,30 +808,16 @@ void OpenGLGraphicsManager::osdMessageUpdateSurface() {
void OpenGLGraphicsManager::displayActivityIconOnOSD(const Graphics::Surface *icon) {
#ifdef USE_OSD
- // HACK: Actually no client code should use graphics functions from
- // another thread. But the MT-32 emulator and network synchronization still do,
- // thus we need to make sure this doesn't happen while a updateScreen call is done.
- // HACK: We can't make OpenGL calls outside of the main thread. This method
- // stores a copy of the icon. The main thread will pick up the changed icon,
- // and copy it to an OpenGL texture.
- Common::StackLock lock(_osdMutex);
-
- _osdIconChangeRequest = true;
-
- _osdIconNextData.free();
- if (icon)
- _osdIconNextData.copyFrom(*icon);
-#endif
-}
+ if (_osdIconSurface) {
+ delete _osdIconSurface;
+ _osdIconSurface = nullptr;
-#ifdef USE_OSD
-void OpenGLGraphicsManager::osdIconUpdateSurface() {
- delete _osdIconSurface;
- _osdIconSurface = nullptr;
+ // Make sure the icon is cleared on the next update
+ _forceRedraw = true;
+ }
- if (_osdIconNextData.getPixels()) {
- Graphics::Surface *converted = _osdIconNextData.convertTo(_defaultFormatAlpha);
- _osdIconNextData.free();
+ if (icon) {
+ Graphics::Surface *converted = icon->convertTo(_defaultFormatAlpha);
_osdIconSurface = createSurface(_defaultFormatAlpha);
assert(_osdIconSurface);
@@ -851,13 +835,9 @@ void OpenGLGraphicsManager::osdIconUpdateSurface() {
converted->free();
delete converted;
-
- _osdIconSurface->updateGLTexture();
}
-
- _osdIconChangeRequest = false;
-}
#endif
+}
void OpenGLGraphicsManager::setPalette(const byte *colors, uint start, uint num) {
assert(_gameScreen->hasPalette());
diff --git a/backends/graphics/opengl/opengl-graphics.h b/backends/graphics/opengl/opengl-graphics.h
index 366ad48fad..7900f06fb7 100644
--- a/backends/graphics/opengl/opengl-graphics.h
+++ b/backends/graphics/opengl/opengl-graphics.h
@@ -587,24 +587,6 @@ private:
};
/**
- * Request for the OSD icon surface to be updated.
- */
- bool _osdIconChangeRequest;
-
- /**
- * The next OSD background activity icon.
- *
- * The OSD icon will be updated with this data on the next frame.
- * Can be an unallocated surface if the OSD icon should not be displayed.
- */
- Graphics::Surface _osdIconNextData;
-
- /**
- * Set the OSD icon surface with the value of the next OSD icon.
- */
- void osdIconUpdateSurface();
-
- /**
* The OSD background activity icon's contents.
*/
Surface *_osdIconSurface;
diff --git a/backends/graphics/openglsdl/openglsdl-graphics.cpp b/backends/graphics/openglsdl/openglsdl-graphics.cpp
index 7ea1860d93..33c82b9fd6 100644
--- a/backends/graphics/openglsdl/openglsdl-graphics.cpp
+++ b/backends/graphics/openglsdl/openglsdl-graphics.cpp
@@ -348,6 +348,17 @@ void OpenGLSdlGraphicsManager::notifyVideoExpose() {
void OpenGLSdlGraphicsManager::notifyResize(const uint width, const uint height) {
#if SDL_VERSION_ATLEAST(2, 0, 0)
+ // We sometime get outdated resize events from SDL2. So check that the size we get
+ // is the actual current window size. If not ignore the resize.
+ // The issue for example occurs when switching from fullscreen to windowed mode or
+ // when switching between different fullscreen resolutions because SDL_DestroyWindow
+ // for a fullscreen window that doesn't have the SDL_WINDOW_FULLSCREEN_DESKTOP flag
+ // causes a SDL_WINDOWEVENT_RESIZED event with the old resolution to be sent, and this
+ // event is processed after recreating the window at the new resolution.
+ int currentWidth, currentHeight;
+ getWindowDimensions(&currentWidth, &currentHeight);
+ if (width != currentWidth || height != currentHeight)
+ return;
setActualScreenSize(width, height);
_eventSource->resetKeyboadEmulation(width - 1, height - 1);
#else
diff --git a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
index cd89440929..adb84bfb24 100644
--- a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
+++ b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
@@ -2175,6 +2175,12 @@ void SurfaceSdlGraphicsManager::displayActivityIconOnOSD(const Graphics::Surface
Common::StackLock lock(_graphicsMutex); // Lock the mutex until this function ends
+ if (_osdIconSurface && !icon) {
+ // Add a dirty rect to clear the icon on the next update
+ SDL_Rect dstRect = getOSDIconRect();
+ addDirtyRect(dstRect.x, dstRect.y, dstRect.w, dstRect.h, true);
+ }
+
if (_osdIconSurface) {
SDL_FreeSurface(_osdIconSurface);
_osdIconSurface = nullptr;
diff --git a/backends/module.mk b/backends/module.mk
index 9ee61ea388..10dde0be8f 100644
--- a/backends/module.mk
+++ b/backends/module.mk
@@ -21,6 +21,7 @@ MODULE_OBJS := \
ifdef USE_LIBCURL
MODULE_OBJS += \
+ cloud/cloudicon.o \
cloud/cloudmanager.o \
cloud/iso8601.o \
cloud/storage.o \
@@ -54,7 +55,6 @@ MODULE_OBJS += \
cloud/onedrive/onedriveuploadrequest.o \
networking/curl/connectionmanager.o \
networking/curl/networkreadstream.o \
- networking/curl/cloudicon.o \
networking/curl/curlrequest.o \
networking/curl/curljsonrequest.o \
networking/curl/request.o
diff --git a/backends/networking/curl/connectionmanager.cpp b/backends/networking/curl/connectionmanager.cpp
index 2b2c84fed3..e1761bddc6 100644
--- a/backends/networking/curl/connectionmanager.cpp
+++ b/backends/networking/curl/connectionmanager.cpp
@@ -78,11 +78,6 @@ Request *ConnectionManager::addRequest(Request *request, RequestCallback callbac
return request;
}
-void ConnectionManager::showCloudDisabledIcon() {
- _icon.showDisabled();
- startTimer();
-}
-
Common::String ConnectionManager::urlEncode(Common::String s) const {
if (!_multi)
return "";
@@ -137,7 +132,7 @@ void ConnectionManager::handle() {
if (_frame % CURL_PERIOD == 0)
processTransfers();
- if (_icon.draw() && _requests.empty() && !hasAddedRequests())
+ if (_requests.empty() && !hasAddedRequests())
stopTimer();
_handleMutex.unlock();
}
diff --git a/backends/networking/curl/connectionmanager.h b/backends/networking/curl/connectionmanager.h
index fd90b637db..f6a9fcb36f 100644
--- a/backends/networking/curl/connectionmanager.h
+++ b/backends/networking/curl/connectionmanager.h
@@ -23,7 +23,6 @@
#ifndef BACKENDS_NETWORKING_CURL_CONNECTIONMANAGER_H
#define BACKENDS_NETWORKING_CURL_CONNECTIONMANAGER_H
-#include "backends/networking/curl/cloudicon.h"
#include "backends/networking/curl/request.h"
#include "common/str.h"
#include "common/singleton.h"
@@ -79,7 +78,6 @@ class ConnectionManager : public Common::Singleton<ConnectionManager> {
bool _timerStarted;
Common::Array<RequestWithCallback> _requests, _addedRequests;
Common::Mutex _handleMutex, _addedRequestsMutex;
- CloudIcon _icon;
uint32 _frame;
void startTimer(int interval = TIMER_INTERVAL);
@@ -115,9 +113,6 @@ public:
*/
Request *addRequest(Request *request, RequestCallback callback = nullptr);
- /** Shows a "cloud disabled" icon for a three seconds. */
- void showCloudDisabledIcon();
-
/** Return URL-encoded version of given string. */
Common::String urlEncode(Common::String s) const;
diff --git a/backends/saves/default/default-saves.cpp b/backends/saves/default/default-saves.cpp
index 8a7fba46f7..a958974209 100644
--- a/backends/saves/default/default-saves.cpp
+++ b/backends/saves/default/default-saves.cpp
@@ -181,6 +181,16 @@ bool DefaultSaveFileManager::removeSavefile(const Common::String &filename) {
assureCached(getSavePath());
if (getError().getCode() != Common::kNoError)
return false;
+
+#ifdef USE_LIBCURL
+ // Update file's timestamp
+ Common::HashMap<Common::String, uint32> timestamps = loadTimestamps();
+ Common::HashMap<Common::String, uint32>::iterator it = timestamps.find(filename);
+ if (it != timestamps.end()) {
+ timestamps.erase(it);
+ saveTimestamps(timestamps);
+ }
+#endif
// Obtain node if exists.
SaveFileCache::const_iterator file = _saveFileCache.find(filename);
@@ -330,7 +340,8 @@ Common::HashMap<Common::String, uint32> DefaultSaveFileManager::loadTimestamps()
//parse timestamp
uint32 timestamp = buffer.asUint64();
if (buffer == "" || timestamp == 0) break;
- timestamps[filename] = timestamp;
+ if (timestamps.contains(filename))
+ timestamps[filename] = timestamp;
}
delete file;
diff --git a/engines/adl/adl.cpp b/engines/adl/adl.cpp
index 9afb2c6700..62f07ad639 100644
--- a/engines/adl/adl.cpp
+++ b/engines/adl/adl.cpp
@@ -673,7 +673,7 @@ Common::Error AdlEngine::loadGameState(int slot) {
// NOTE: _state.curPicture is part of the save state in the original engine. We
// reconstruct it instead. This is believed to be safe for at least hires 0-2, but
// this may need to be re-evaluated for later games.
- _state.curPicture = _state.rooms[_state.room].curPicture;
+ _state.curPicture = getCurRoom().curPicture;
size = inFile->readUint32BE();
if (size != _state.items.size())
diff --git a/engines/adl/detection.cpp b/engines/adl/detection.cpp
index 10812d79ea..2d568b28d7 100644
--- a/engines/adl/detection.cpp
+++ b/engines/adl/detection.cpp
@@ -145,11 +145,13 @@ static const AdlGameDescription gameDescriptions[] = {
"hires4", 0,
{
{ "ULYS1A.XFD", 0, "26365d2b06509fd21e7a7919e33f7199", 92160 },
- // FIXME: Add sides 1B and 2C
+ { "ULYS1B.XFD", 0, "37919c72a4103e6f897ee7daa8261d1d", 92160 },
+ // Load 'N' Go Software release XAG-0646 appears to be missing the second disk
+ { "ULYS2C.XFD", 0, "ff33830246e65dc71c954acb7fd5621a", 92160 },
AD_LISTEND
},
Common::EN_ANY,
- Common::kPlatformAtariST, // FIXME
+ Common::kPlatformAtari8Bit,
ADGF_UNSTABLE,
GUIO2(GAMEOPTION_COLOR_DEFAULT_ON, GAMEOPTION_SCANLINES)
},
diff --git a/engines/adl/hires4.cpp b/engines/adl/hires4.cpp
index ddfc868e9a..3775a2d1eb 100644
--- a/engines/adl/hires4.cpp
+++ b/engines/adl/hires4.cpp
@@ -261,7 +261,7 @@ void HiRes4Engine_Atari::adjustDataBlockPtr(byte &track, byte &sector, byte &off
Engine *HiRes4Engine_create(OSystem *syst, const AdlGameDescription *gd) {
switch (gd->desc.platform) {
- case Common::kPlatformAtariST:
+ case Common::kPlatformAtari8Bit:
return new HiRes4Engine_Atari(syst, gd);
default:
error("Unsupported platform");
diff --git a/engines/dm/TODOs/methodtree.txt b/engines/dm/TODOs/methodtree.txt
index cbd8d1fbba..9a5a856a24 100644
--- a/engines/dm/TODOs/methodtree.txt
+++ b/engines/dm/TODOs/methodtree.txt
@@ -7,28 +7,28 @@ F0115_DUNGEONVIEW_DrawObjectsCreaturesProjectilesExplosions_CPSEF
F0114_DUNGEONVIEW_GetExplosionBitmap // done
F0133_VIDEO_BlitBoxFilledWithMaskedBitmap // dummy
F0141_DUNGEON_GetObjectInfoIndex // done
- F0142_DUNGEON_GetProjectileAspect // done
+ F0142_DUNGEON_GetProjectileAspect // done
F0158_DUNGEON_GetWeaponInfo // done
M66_PROJECTILE_ASPECT_ORDINAL // done
F0176_GROUP_GetCreatureOrdinalInCell // done
F0145_DUNGEON_GetGroupCells // done
F0147_DUNGEON_GetGroupDirections // done
- GROUP // done
- CreatureType // done
+ GROUP // done
+ CreatureType // done
G0077_B_DoNotDrawFluxcagesDuringEndgame // done
G0105_s_Graphic558_Box_ExplosionPattern_D0C // one
G0188_as_Graphic558_FieldAspects // done
G0216_auc_Graphic558_ExplosionBaseScales // done
- G0217_aauc_Graphic558_ObjectPileShiftSetIndices // done
- G0218_aaaauc_Graphic558_ObjectCoordinateSets // done
+ G0217_aauc_Graphic558_ObjectPileShiftSetIndices // done
+ G0218_aaaauc_Graphic558_ObjectCoordinateSets // done
G0223_aac_Graphic558_ShiftSets // done
- G0224_aaaauc_Graphic558_CreatureCoordinateSets // done
+ G0224_aaaauc_Graphic558_CreatureCoordinateSets // done
G0225_aai_Graphic558_CenteredExplosionCoordinates // done
G0226_aaai_Graphic558_ExplosionCoordinates // done
G0227_aai_Graphic558_RebirthStep2ExplosionCoordinates // done
G0228_aai_Graphic558_RebirthStep1ExplosionCoordinates // done
G0292_aT_PileTopObject // done
- G0370_ps_Events // done
+ G0370_ps_Events // done
@@ -39,7 +39,7 @@ F0380_COMMAND_ProcessQueue_CPSC // in progress
F0372_COMMAND_ProcessType80_ClickInDungeonView_TouchFrontWall // done so-so
F0275_SENSOR_IsTriggeredByClickOnWall // done so-so
F0280_CHAMPION_AddCandidateChampionToParty // done, so-so
-
+
F0378_COMMAND_ProcessType81_ClickInPanel // done so-so
F0282_CHAMPION_ProcessCommands160To162_ClickInResurrectReincarnatePanel // done
@@ -76,9 +76,9 @@ F0280_CHAMPION_AddCandidateChampionToParty // done, so-so
F0345_INVENTORY_DrawPanel_FoodWaterPoisoned // done
F0344_INVENTORY_DrawPanel_FoodOrWaterBar // done
F0343_INVENTORY_DrawPanel_HorizontalBar // done
- G0032_s_Graphic562_Box_Panel // done
- G0035_s_Graphic562_Box_Food // done
- G0036_s_Graphic562_Box_Water // done
+ G0032_s_Graphic562_Box_Panel // done
+ G0035_s_Graphic562_Box_Food // done
+ G0036_s_Graphic562_Box_Water // done
G0037_s_Graphic562_Box_Poisoned // done
F0351_INVENTORY_DrawChampionSkillsAndStatistics // skip -----------------
F0347_INVENTORY_DrawPanel // done
@@ -87,12 +87,12 @@ F0280_CHAMPION_AddCandidateChampionToParty // done, so-so
F0340_INVENTORY_DrawPanel_ScrollTextLine // done
F0333_INVENTORY_OpenAndDrawChest // done
F0303_CHAMPION_GetSkillLevel // done
- F0332_INVENTORY_DrawIconToViewport // done
+ F0332_INVENTORY_DrawIconToViewport // done
F0336_INVENTORY_DrawPanel_BuildObjectAttributesString // done
- F0335_INVENTORY_DrawPanel_ObjectDescriptionString // done
+ F0335_INVENTORY_DrawPanel_ObjectDescriptionString // done
G0421_i_ObjectDescriptionTextX // done
G0422_i_ObjectDescriptionTextY // done
- F0339_INVENTORY_DrawPanel_ArrowOrEye // done
+ F0339_INVENTORY_DrawPanel_ArrowOrEye // done
G0430_apc_DirectionNames // done
G0034_s_Graphic562_Box_ObjectDescriptionCircle // done
G0032_s_Graphic562_Box_Panel // done
@@ -116,8 +116,8 @@ F0280_CHAMPION_AddCandidateChampionToParty // done, so-so
F0292_CHAMPION_DrawState // done
G0508_B_RefreshActionArea // done
G0506_ui_ActingChampionOrdinal // done
- F0386_MENUS_DrawActionIcon // done
- F0141_DUNGEON_GetObjectInfoIndex // done
+ F0386_MENUS_DrawActionIcon // done
+ F0141_DUNGEON_GetObjectInfoIndex // done
F0033_OBJECT_GetIconIndex // done
F0032_OBJECT_GetType // done
G0237_as_Graphic559_ObjectInfo // done
@@ -126,7 +126,7 @@ F0280_CHAMPION_AddCandidateChampionToParty // done, so-so
F0134_VIDEO_FillBitmap // done
D24_FillScreenBox // done
F0036_OBJECT_ExtractIconFromBitmap // done
- G0026_ai_Graphic562_IconGraphicFirstIconIndex // done
+ G0026_ai_Graphic562_IconGraphicFirstIconIndex // done
F0129_VIDEO_BlitShrinkWithPaletteChanges // eeeh
F0136_VIDEO_ShadeScreenBox // skip
G0498_auc_Graphic560_PaletteChanges_ActionAreaObjectIcon // done
@@ -134,18 +134,18 @@ F0280_CHAMPION_AddCandidateChampionToParty // done, so-so
G0509_B_ActionAreaContainsIcons // done
F0301_CHAMPION_AddObjectInSlot // done
F0299_CHAMPION_ApplyObjectModifiersToStatistics // done
- F0296_CHAMPION_DrawChangedObjectIcons // done
+ F0296_CHAMPION_DrawChangedObjectIcons // done
F0068_MOUSE_SetPointerToObject // skip
F0077_MOUSE_HidePointer_CPSE // skip
F0078_MOUSE_ShowPointer // skip
F0034_OBJECT_DrawLeaderHandObjectName // done
F0386_MENUS_DrawActionIcon // done
- F0295_CHAMPION_HasObjectIconInSlotBoxChanged // done
- F0039_OBJECT_GetIconIndexInSlotBox // done
+ F0295_CHAMPION_HasObjectIconInSlotBoxChanged // done
+ F0039_OBJECT_GetIconIndexInSlotBox // done
M70_HAND_SLOT_INDEX // done
G0420_B_MousePointerHiddenToDrawChangedObjectIconOnScreen // done
G0412_puc_Bitmap_ObjectIconForMousePointer // done
- G0413_i_LeaderHandObjectIconIndex // done
+ G0413_i_LeaderHandObjectIconIndex // done
G0414_T_LeaderHandObject // done
F0337_INVENTORY_SetDungeonViewPalette // skip
G0407_s_Party // done
@@ -166,7 +166,7 @@ F0280_CHAMPION_AddCandidateChampionToParty // done, so-so
G0326_B_RefreshMousePointerInMainLoop // lol you wat m8
G0002_s_Graphic562_Box_MovementArrows // done
G0041_s_Graphic562_Box_ViewportFloppyZzzCross // done
- G0296_puc_Bitmap_Viewport // done
+ G0296_puc_Bitmap_Viewport // done
G0598_B_MousePointerBitmapUpdated // done
F0456_START_DrawDisabledMenus // done
G0415_B_LeaderEmptyHanded // done
@@ -174,15 +174,15 @@ F0280_CHAMPION_AddCandidateChampionToParty // done, so-so
G0578_B_UseByteBoxCoordinates // done
G0047_s_Graphic562_Box_ChampionPortrait // done
G0308_i_PartyDirection // done
- G0306_i_PartyMapX // done
+ G0306_i_PartyMapX // done
G0307_i_PartyMapY // done
G0299_ui_CandidateChampionOrdinal // done
G0508_B_RefreshActionArea // done
- G0233_ai_Graphic559_DirectionToStepEastCount // done
+ G0233_ai_Graphic559_DirectionToStepEastCount // done
G0234_ai_Graphic559_DirectionToStepNorthCount // done
G0237_as_Graphic559_ObjectInfo // done
G0038_ai_Graphic562_SlotMasks // done
-
+
F0462_START_StartGame_CPSF
F0003_MAIN_ProcessNewPartyMap_CPSE // partially done
diff --git a/engines/dm/TODOs/todo.txt b/engines/dm/TODOs/todo.txt
index def2956c8e..074ccf0599 100644
--- a/engines/dm/TODOs/todo.txt
+++ b/engines/dm/TODOs/todo.txt
@@ -5,12 +5,12 @@ Bugs:
DisplayMan::blitBoxFilledWithMaskedBitmap does not produce the same effect as the original
Logic:
- Items thrown on the right side end up on the left side
+ Items thrown on the right side end up on the left side
Restarting the game after the party is dead segfaults
Todo:
Add wiki entry for DM
-
+
Double check enums with hex literals
Double check strcat, strstr usages
I forgot to add a bunch of warning for show/hide mouse pointer and other mouse functions
@@ -19,4 +19,3 @@ Code stuff todo:
Complete stub methods(blitShrink)
Add proper save header, add error handling to it
Add translations to f433_processCommand140_saveGame 'LOAD'
- \ No newline at end of file
diff --git a/engines/dm/champion.cpp b/engines/dm/champion.cpp
index cc7a4ed876..1fe6e8749b 100644
--- a/engines/dm/champion.cpp
+++ b/engines/dm/champion.cpp
@@ -51,7 +51,7 @@ void Champion::resetToZero() {
memset(_name, '\0', 8);
memset(_title, '\0', 20);
_dir = kDMDirNorth;
- _cell = k0_ViewCellFronLeft;
+ _cell = kDMViewCellFronLeft;
_actionIndex = kDMActionN;
_symbolStep = 0;
memset(_symbols, '\0', 5);
@@ -76,9 +76,9 @@ void Champion::setAttributeFlag(ChampionAttribute flag, bool value) {
}
void ChampionMan::initConstants() {
- static const char *g417_baseSkillName_EN_ANY[4] = {"FIGHTER", "NINJA", "PRIEST", "WIZARD"};
- static const char *g417_baseSkillName_DE_DEU[4] = {"KAEMPFER", "NINJA", "PRIESTER", "MAGIER"};
- static const char *g417_baseSkillName_FR_FRA[4] = {"GUERRIER", "NINJA", "PRETRE", "SORCIER"};
+ static const char *baseSkillNameEN[4] = {"FIGHTER", "NINJA", "PRIEST", "WIZARD"};
+ static const char *baseSkillNameDE[4] = {"KAEMPFER", "NINJA", "PRIESTER", "MAGIER"};
+ static const char *baseSkillNameFR[4] = {"GUERRIER", "NINJA", "PRETRE", "SORCIER"};
static Box boxChampionIcons[4] = {
Box(281, 299, 0, 13),
Box(301, 319, 0, 13),
@@ -86,7 +86,7 @@ void ChampionMan::initConstants() {
Box(281, 299, 15, 28)
};
- static Color championColor[4] = {(Color)7, (Color)11, (Color)8, (Color)14};
+ static Color championColor[4] = {kDMColorLightGreen, kDMColorYellow, kDMColorRed, kDMColorBlue};
int16 lightPowerToLightAmount[16] = {0, 5, 12, 24, 33, 40, 46, 51, 59, 68, 76, 82, 89, 94, 97, 100};
uint16 slotMasks[38] = { // @ G0038_ai_Graphic562_SlotMasks
/* 30 for champion inventory, 8 for chest */
@@ -135,13 +135,13 @@ void ChampionMan::initConstants() {
const char **baseSkillName;
switch (_vm->getGameLanguage()) { // localized
case Common::EN_ANY:
- baseSkillName = g417_baseSkillName_EN_ANY;
+ baseSkillName = baseSkillNameEN;
break;
case Common::DE_DEU:
- baseSkillName = g417_baseSkillName_DE_DEU;
+ baseSkillName = baseSkillNameDE;
break;
case Common::FR_FRA:
- baseSkillName = g417_baseSkillName_FR_FRA;
+ baseSkillName = baseSkillNameFR;
break;
default:
error("Unexpected language used");
@@ -217,14 +217,15 @@ bool ChampionMan::isObjectThrown(uint16 champIndex, int16 slotIndex, int16 side)
return false;
}
- _vm->_sound->requestPlay(k16_soundCOMBAT_ATTACK_SKELETON_ANIMATED_ARMOUR_DETH_KNIGHT, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, kDMSoundModePlayIfPrioritized);
+ DungeonMan &dungeon = *_vm->_dungeonMan;
+ _vm->_sound->requestPlay(kDMSoundIndexAttackSkelettonAnimatedArmorDethKnight, dungeon._partyMapX, dungeon._partyMapY, kDMSoundModePlayIfPrioritized);
decrementStamina(champIndex, getThrowingStaminaCost(curThing));
disableAction(champIndex, 4);
int16 experience = 8;
int16 weaponKineticEnergy = 1;
if (curThing.getType() == kDMThingTypeWeapon) {
experience += 4;
- WeaponInfo *curWeapon = _vm->_dungeonMan->getWeaponInfo(curThing);
+ WeaponInfo *curWeapon = dungeon.getWeaponInfo(curThing);
if (curWeapon->_class <= kDMWeaponClassPoisinDart) {
weaponKineticEnergy = curWeapon->_kineticEnergy;
experience += weaponKineticEnergy >> 2;
@@ -236,11 +237,11 @@ bool ChampionMan::isObjectThrown(uint16 champIndex, int16 slotIndex, int16 side)
kineticEnergy += _vm->getRandomNumber(16) + (kineticEnergy >> 1) + skillLevel;
int16 attack = CLIP<int16>(40, ((skillLevel << 3) + _vm->getRandomNumber(32)), 200);
int16 stepEnergy = MAX(5, 11 - skillLevel);
- _vm->_projexpl->createProjectile(curThing, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY,
- _vm->normalizeModulo4(_vm->_dungeonMan->_partyDir + side),
- _vm->_dungeonMan->_partyDir, kineticEnergy, attack, stepEnergy);
+ _vm->_projexpl->createProjectile(curThing, dungeon._partyMapX, dungeon._partyMapY,
+ _vm->normalizeModulo4(dungeon._partyDir + side),
+ dungeon._partyDir, kineticEnergy, attack, stepEnergy);
_vm->_projectileDisableMovementTicks = 4;
- _vm->_lastProjectileDisabledMovementDirection = _vm->_dungeonMan->_partyDir;
+ _vm->_lastProjectileDisabledMovementDirection = dungeon._partyDir;
drawChampionState((ChampionIndex)champIndex);
return true;
}
@@ -263,10 +264,10 @@ int16 ChampionMan::getDecodedValue(char *string, uint16 characterCount) {
void ChampionMan::drawHealthOrStaminaOrManaValue(int16 posY, int16 currVal, int16 maxVal) {
Common::String tmp = getStringFromInteger(currVal, true, 3);
- _vm->_textMan->printToViewport(55, posY, k13_ColorLightestGray, tmp.c_str());
- _vm->_textMan->printToViewport(73, posY, k13_ColorLightestGray, "/");
+ _vm->_textMan->printToViewport(55, posY, kDMColorLightestGray, tmp.c_str());
+ _vm->_textMan->printToViewport(73, posY, kDMColorLightestGray, "/");
tmp = getStringFromInteger(maxVal, true, 3);
- _vm->_textMan->printToViewport(79, posY, k13_ColorLightestGray, tmp.c_str());
+ _vm->_textMan->printToViewport(79, posY, kDMColorLightestGray, tmp.c_str());
}
uint16 ChampionMan::getHandSlotIndex(uint16 slotBoxIndex) {
@@ -440,7 +441,7 @@ bool ChampionMan::hasObjectIconInSlotBoxChanged(int16 slotBoxIndex, Thing thing)
|| (currIconIndex == kDMIconIndicePotionEmptyFlask)) {
IconIndice newIconIndex = objMan.getIconIndex(thing);
if (newIconIndex != currIconIndex) {
- if ((slotBoxIndex < k8_SlotBoxInventoryFirstSlot) && !_mousePointerHiddenToDrawChangedObjIconOnScreen) {
+ if ((slotBoxIndex < kDMSlotBoxInventoryFirstSlot) && !_mousePointerHiddenToDrawChangedObjIconOnScreen) {
_mousePointerHiddenToDrawChangedObjIconOnScreen = true;
_vm->_eventMan->hideMouse();
}
@@ -456,6 +457,7 @@ void ChampionMan::drawChangedObjectIcons() {
InventoryMan &invMan = *_vm->_inventoryMan;
ObjectMan &objMan = *_vm->_objectMan;
MenuMan &menuMan = *_vm->_menuMan;
+ EventManager &eventMan = *_vm->_eventMan;
uint16 invChampOrdinal = invMan._inventoryChampionOrdinal;
if (_candidateChampionOrdinal && !invChampOrdinal)
@@ -470,9 +472,9 @@ void ChampionMan::drawChangedObjectIcons() {
IconIndice iconIndex = objMan.getIconIndex(_leaderHandObject);
if (iconIndex != leaderHandObjIconIndex) {
_mousePointerHiddenToDrawChangedObjIconOnScreen = true;
- _vm->_eventMan->hideMouse();
+ eventMan.hideMouse();
objMan.extractIconFromBitmap(iconIndex, objMan._objectIconForMousePointer);
- _vm->_eventMan->setPointerToObject(_vm->_objectMan->_objectIconForMousePointer);
+ eventMan.setPointerToObject(_vm->_objectMan->_objectIconForMousePointer);
_leaderHandObjectIconIndex = iconIndex;
objMan.drawLeaderObjectName(_leaderHandObject);
}
@@ -496,17 +498,17 @@ void ChampionMan::drawChangedObjectIcons() {
uint16 drawViewport = 0;
for (uint16 slotIndex = kDMSlotReadyHand; slotIndex < kDMSlotChest1; slotIndex++, thing++) {
- uint16 objIconChanged = hasObjectIconInSlotBoxChanged(slotIndex + k8_SlotBoxInventoryFirstSlot, *thing) ? 1 : 0;
+ uint16 objIconChanged = hasObjectIconInSlotBoxChanged(slotIndex + kDMSlotBoxInventoryFirstSlot, *thing) ? 1 : 0;
drawViewport |= objIconChanged;
if (objIconChanged && (slotIndex == kDMSlotActionHand)) {
menuMan.drawActionIcon((ChampionIndex)_vm->ordinalToIndex(invChampOrdinal));
}
}
- if (invMan._panelContent == k4_PanelContentChest) {
+ if (invMan._panelContent == kDMPanelContentChest) {
thing = invMan._chestSlots;
for (int16 slotIndex = 0; slotIndex < 8; ++slotIndex, thing++) {
- drawViewport |= (hasObjectIconInSlotBoxChanged(slotIndex + k38_SlotBoxChestFirstSlot, *thing) ? 1 : 0);
+ drawViewport |= (hasObjectIconInSlotBoxChanged(slotIndex + kDMSlotBoxChestFirstSlot, *thing) ? 1 : 0);
}
}
@@ -517,25 +519,23 @@ void ChampionMan::drawChangedObjectIcons() {
}
if (_mousePointerHiddenToDrawChangedObjIconOnScreen)
- _vm->_eventMan->showMouse();
+ eventMan.showMouse();
}
void ChampionMan::addObjectInSlot(ChampionIndex champIndex, Thing thing, ChampionSlot slotIndex) {
+ if (thing == Thing::_none)
+ return;
+
InventoryMan &invMan = *_vm->_inventoryMan;
DungeonMan &dunMan = *_vm->_dungeonMan;
ObjectMan &objMan = *_vm->_objectMan;
MenuMan &menuMan = *_vm->_menuMan;
-
- if (thing == Thing::_none)
- return;
-
Champion *champ = &_champions[champIndex];
- if (slotIndex >= kDMSlotChest1) {
+ if (slotIndex >= kDMSlotChest1)
invMan._chestSlots[slotIndex - kDMSlotChest1] = thing;
- } else {
+ else
champ->setSlot(slotIndex, thing);
- }
champ->_load += dunMan.getObjectWeight(thing);
champ->setAttributeFlag(kDMAttributeLoad, true);
@@ -558,7 +558,7 @@ void ChampionMan::addObjectInSlot(ChampionIndex champIndex, Thing thing, Champio
if (iconIndex == kDMIconIndiceWeaponTorchUnlit) {
((Weapon *)rawObjPtr)->setLit(true);
- _vm->_inventoryMan->setDungeonViewPalette();
+ invMan.setDungeonViewPalette();
drawChangedObjectIcons();
} else if (isInventoryChampion && (slotIndex == kDMSlotActionHand) &&
((iconIndex == kDMIconIndiceContainerChestClosed) || ((iconIndex >= kDMIconIndiceScrollOpen) && (iconIndex <= kDMIconIndiceScrollClosed)))) {
@@ -568,7 +568,7 @@ void ChampionMan::addObjectInSlot(ChampionIndex champIndex, Thing thing, Champio
if ((iconIndex >= kDMIconIndiceJunkIllumuletUnequipped) && (iconIndex <= kDMIconIndiceJunkIllumuletEquipped)) {
((Junk *)rawObjPtr)->setChargeCount(1);
_party._magicalLightAmount += _lightPowerToLightAmount[2];
- _vm->_inventoryMan->setDungeonViewPalette();
+ invMan.setDungeonViewPalette();
iconIndex = (IconIndice)(iconIndex + 1);
} else if ((iconIndex >= kDMIconIndiceJunkJewelSymalUnequipped) && (iconIndex <= kDMIconIndiceJunkJewelSymalEquipped)) {
((Junk *)rawObjPtr)->setChargeCount(1);
@@ -592,25 +592,25 @@ int16 ChampionMan::getScentOrdinal(int16 mapX, int16 mapY) {
uint16 searchedScentRedEagle = searchedScent.toUint16();
Scent *scent = &_party._scents[scentIndex--];
do {
- if ((*(--scent)).toUint16() == searchedScentRedEagle) {
+ if ((*(--scent)).toUint16() == searchedScentRedEagle)
return _vm->indexToOrdinal(scentIndex);
- }
} while (scentIndex--);
}
return 0;
}
Thing ChampionMan::getObjectRemovedFromLeaderHand() {
+ EventManager &eventMan = *_vm->_eventMan;
_leaderEmptyHanded = true;
Thing leaderHandObject = _leaderHandObject;
if (leaderHandObject != Thing::_none) {
_leaderHandObject = Thing::_none;
_leaderHandObjectIconIndex = kDMIconIndiceNone;
- _vm->_eventMan->showMouse();
+ eventMan.showMouse();
_vm->_objectMan->clearLeaderObjectName();
- _vm->_eventMan->setMousePointer();
- _vm->_eventMan->hideMouse();
+ eventMan.setMousePointer();
+ eventMan.hideMouse();
if (_leaderIndex != kDMChampionNone) {
_champions[_leaderIndex]._load -= _vm->_dungeonMan->getObjectWeight(leaderHandObject);
setFlag(_champions[_leaderIndex]._attributes, kDMAttributeLoad);
@@ -622,46 +622,48 @@ Thing ChampionMan::getObjectRemovedFromLeaderHand() {
uint16 ChampionMan::getStrength(int16 champIndex, int16 slotIndex) {
Champion *curChampion = &_champions[champIndex];
+ DungeonMan &dungeon = *_vm->_dungeonMan;
int16 strength = _vm->getRandomNumber(16) + curChampion->_statistics[kDMStatStrength][kDMStatCurrent];
Thing curThing = curChampion->_slots[slotIndex];
- uint16 objectWeight = _vm->_dungeonMan->getObjectWeight(curThing);
+ uint16 objectWeight = dungeon.getObjectWeight(curThing);
uint16 oneSixteenthMaximumLoad = getMaximumLoad(curChampion) >> 4;
- if (objectWeight <= oneSixteenthMaximumLoad) {
+ if (objectWeight <= oneSixteenthMaximumLoad)
strength += objectWeight - 12;
- } else {
+ else {
int16 loadThreshold = oneSixteenthMaximumLoad + ((oneSixteenthMaximumLoad - 12) >> 1);
- if (objectWeight <= loadThreshold) {
+ if (objectWeight <= loadThreshold)
strength += (objectWeight - oneSixteenthMaximumLoad) >> 1;
- } else {
+ else
strength -= (objectWeight - loadThreshold) << 1;
- }
}
+
if (curThing.getType() == kDMThingTypeWeapon) {
- WeaponInfo *weaponInfo = _vm->_dungeonMan->getWeaponInfo(curThing);
+ WeaponInfo *weaponInfo = dungeon.getWeaponInfo(curThing);
strength += weaponInfo->_strength;
uint16 skillLevel = 0;
uint16 weaponClass = weaponInfo->_class;
- if ((weaponClass == kDMWeaponClassSwingWeapon) || (weaponClass == kDMWeaponClassDaggerAndAxes)) {
+ if ((weaponClass == kDMWeaponClassSwingWeapon) || (weaponClass == kDMWeaponClassDaggerAndAxes))
skillLevel = getSkillLevel(champIndex, kDMSkillSwing);
- }
- if ((weaponClass != kDMWeaponClassSwingWeapon) && (weaponClass < kDMWeaponClassFirstBow)) {
+
+ if ((weaponClass != kDMWeaponClassSwingWeapon) && (weaponClass < kDMWeaponClassFirstBow))
skillLevel += getSkillLevel(champIndex, kDMSkillThrow);
- }
- if ((weaponClass >= kDMWeaponClassFirstBow) && (weaponClass < kDMWeaponClassFirstMagicWeapon)) {
+
+ if ((weaponClass >= kDMWeaponClassFirstBow) && (weaponClass < kDMWeaponClassFirstMagicWeapon))
skillLevel += getSkillLevel(champIndex, kDMSkillShoot);
- }
+
strength += skillLevel << 1;
}
strength = getStaminaAdjustedValue(curChampion, strength);
- if (getFlag(curChampion->_wounds, (slotIndex == kDMSlotReadyHand) ? kDMWoundReadHand : kDMWoundActionHand)) {
+ if (getFlag(curChampion->_wounds, (slotIndex == kDMSlotReadyHand) ? kDMWoundReadHand : kDMWoundActionHand))
strength >>= 1;
- }
+
return CLIP(0, strength >> 1, 100);
}
Thing ChampionMan::getObjectRemovedFromSlot(uint16 champIndex, uint16 slotIndex) {
Champion *curChampion = &_champions[champIndex];
+ DungeonMan &dungeon = *_vm->_dungeonMan;
Thing curThing;
if (slotIndex >= kDMSlotChest1) {
@@ -680,7 +682,7 @@ Thing ChampionMan::getObjectRemovedFromSlot(uint16 champIndex, uint16 slotIndex)
// Remove object modifiers
applyModifiersToStatistics(curChampion, slotIndex, curIconIndex, -1, curThing);
- Weapon *curWeapon = (Weapon *)_vm->_dungeonMan->getThingData(curThing);
+ Weapon *curWeapon = (Weapon *)dungeon.getThingData(curThing);
if (slotIndex == kDMSlotNeck) {
if ((curIconIndex >= kDMIconIndiceJunkIllumuletUnequipped) && (curIconIndex <= kDMIconIndiceJunkIllumuletEquipped)) {
((Junk *)curWeapon)->setChargeCount(0);
@@ -727,7 +729,7 @@ Thing ChampionMan::getObjectRemovedFromSlot(uint16 champIndex, uint16 slotIndex)
}
}
}
- curChampion->_load -= _vm->_dungeonMan->getObjectWeight(curThing);
+ curChampion->_load -= dungeon.getObjectWeight(curThing);
setFlag(curChampion->_attributes, kDMAttributeLoad);
return curThing;
}
@@ -743,9 +745,8 @@ void ChampionMan::decrementStamina(int16 championIndex, int16 decrement) {
if (stamina <= 0) {
curChampion->_currStamina = 0;
addPendingDamageAndWounds_getDamage(championIndex, (-stamina) >> 1, kDMWoundNone, kDMAttackTypeNormal);
- } else if (stamina > curChampion->_maxStamina) {
+ } else if (stamina > curChampion->_maxStamina)
curChampion->_currStamina = curChampion->_maxStamina;
- }
setFlag(curChampion->_attributes, kDMAttributeLoad | kDMAttributeStatistics);
}
@@ -775,11 +776,10 @@ int16 ChampionMan::addPendingDamageAndWounds_getDamage(int16 champIndex, int16 a
case kDMAttackTypePsychic:
{
int16 wisdomFactor = 115 - curChampion->_statistics[kDMStatWisdom][kDMStatCurrent];
- if (wisdomFactor <= 0) {
+ if (wisdomFactor <= 0)
attack = 0;
- } else {
+ else
attack = _vm->getScaledProduct(attack, 6, wisdomFactor);
- }
skipScaling = true;
}
@@ -842,6 +842,7 @@ int16 ChampionMan::addPendingDamageAndWounds_getDamage(int16 champIndex, int16 a
int16 ChampionMan::getWoundDefense(int16 champIndex, uint16 woundIndex) {
static const byte woundDefenseFactor[6] = {5, 5, 4, 6, 3, 1}; // @ G0050_auc_Graphic562_WoundDefenseFactor
+ DungeonMan &dungeon = *_vm->_dungeonMan;
Champion *curChampion = &_champions[champIndex];
bool useSharpDefense = getFlag(woundIndex, kDMMaskSharpDefense);
if (useSharpDefense)
@@ -851,10 +852,10 @@ int16 ChampionMan::getWoundDefense(int16 champIndex, uint16 woundIndex) {
for (int16 slotIndex = kDMSlotReadyHand; slotIndex <= kDMSlotActionHand; slotIndex++) {
Thing curThing = curChampion->_slots[slotIndex];
if (curThing.getType() == kDMThingTypeArmour) {
- ArmourInfo *armorInfo = (ArmourInfo *)_vm->_dungeonMan->getThingData(curThing);
- armorInfo = &_vm->_dungeonMan->_armourInfos[((Armour *)armorInfo)->getType()];
+ ArmourInfo *armorInfo = (ArmourInfo *)dungeon.getThingData(curThing);
+ armorInfo = &dungeon._armourInfos[((Armour *)armorInfo)->getType()];
if (getFlag(armorInfo->_attributes, kDMArmourAttributeShield))
- armorShieldDefense += ((getStrength(champIndex, slotIndex) + _vm->_dungeonMan->getArmourDefense(armorInfo, useSharpDefense)) * woundDefenseFactor[woundIndex]) >> ((slotIndex == woundIndex) ? 4 : 5);
+ armorShieldDefense += ((getStrength(champIndex, slotIndex) + dungeon.getArmourDefense(armorInfo, useSharpDefense)) * woundDefenseFactor[woundIndex]) >> ((slotIndex == woundIndex) ? 4 : 5);
}
}
@@ -866,8 +867,8 @@ int16 ChampionMan::getWoundDefense(int16 champIndex, uint16 woundIndex) {
if (woundIndex > kDMSlotActionHand) {
Thing curThing = curChampion->_slots[woundIndex];
if (curThing.getType() == kDMThingTypeArmour) {
- ArmourInfo *armourInfo = (ArmourInfo *)_vm->_dungeonMan->getThingData(curThing);
- woundDefense += _vm->_dungeonMan->getArmourDefense(&_vm->_dungeonMan->_armourInfos[((Armour *)armourInfo)->getType()], useSharpDefense);
+ ArmourInfo *armourInfo = (ArmourInfo *)dungeon.getThingData(curThing);
+ woundDefense += dungeon.getArmourDefense(&dungeon._armourInfos[((Armour *)armourInfo)->getType()], useSharpDefense);
}
}
@@ -925,34 +926,34 @@ void ChampionMan::disableAction(uint16 champIndex, uint16 ticks) {
int32 updatedEnableActionEventTime = _vm->_gameTime + ticks;
TimelineEvent curEvent;
- curEvent._type = k11_TMEventTypeEnableChampionAction;
+ curEvent._type = kDMEventTypeEnableChampionAction;
curEvent._priority = champIndex;
curEvent._Bu._slotOrdinal = 0;
int16 eventIndex = curChampion->_enableActionEventIndex;
if (eventIndex >= 0) {
int32 currentEnableActionEventTime = _vm->filterTime(_vm->_timeline->_events[eventIndex]._mapTime);
- if (updatedEnableActionEventTime >= currentEnableActionEventTime) {
+ if (updatedEnableActionEventTime >= currentEnableActionEventTime)
updatedEnableActionEventTime += (currentEnableActionEventTime - _vm->_gameTime) >> 1;
- } else {
+ else
updatedEnableActionEventTime = currentEnableActionEventTime + (ticks >> 1);
- }
_vm->_timeline->deleteEvent(eventIndex);
} else {
setFlag(curChampion->_attributes, kDMAttributeActionHand | kDMAttributeDisableAction);
drawChampionState((ChampionIndex)champIndex);
}
- _vm->setMapAndTime(curEvent._mapTime, _vm->_dungeonMan->_partyMapIndex, updatedEnableActionEventTime);
+ curEvent._mapTime = _vm->setMapAndTime(_vm->_dungeonMan->_partyMapIndex, updatedEnableActionEventTime);
curChampion->_enableActionEventIndex = _vm->_timeline->addEventGetEventIndex(&curEvent);
}
void ChampionMan::addSkillExperience(uint16 champIndex, uint16 skillIndex, uint16 exp) {
+ DungeonMan &dungeon = *_vm->_dungeonMan;
if ((skillIndex >= kDMSkillSwing) && (skillIndex <= kDMSkillShoot) && (_vm->_projexpl->_lastCreatureAttackTime < _vm->_gameTime - 150))
exp >>= 1;
if (exp) {
- if (_vm->_dungeonMan->_currMap->_difficulty)
- exp *= _vm->_dungeonMan->_currMap->_difficulty;
+ if (dungeon._currMap->_difficulty)
+ exp *= dungeon._currMap->_difficulty;
Champion *curChampion = &_champions[champIndex];
uint16 baseSkillIndex;
@@ -1070,9 +1071,11 @@ int16 ChampionMan::getDamagedChampionCount(uint16 attack, int16 wounds, int16 at
}
int16 ChampionMan::getTargetChampionIndex(int16 mapX, int16 mapY, uint16 cell) {
- if (_partyChampionCount && (_vm->getDistance(mapX, mapY, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY) <= 1)) {
+ DungeonMan &dungeon = *_vm->_dungeonMan;
+
+ if (_partyChampionCount && (_vm->getDistance(mapX, mapY, dungeon._partyMapX, dungeon._partyMapY) <= 1)) {
signed char orderedCellsToAttack[4];
- _vm->_groupMan->setOrderedCellsToAttack(orderedCellsToAttack, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, mapX, mapY, cell);
+ _vm->_groupMan->setOrderedCellsToAttack(orderedCellsToAttack, dungeon._partyMapX, dungeon._partyMapY, mapX, mapY, cell);
for (uint16 i = 0; i < 4; i++) {
int16 championIndex = getIndexInCell(orderedCellsToAttack[i]);
if (championIndex >= 0)
@@ -1108,16 +1111,16 @@ void ChampionMan::championPoison(int16 champIndex, uint16 attack) {
Champion *curChampion = &_champions[champIndex];
addPendingDamageAndWounds_getDamage(champIndex, MAX(1, attack >> 6), kDMWoundNone, kDMAttackTypeNormal);
setFlag(curChampion->_attributes, kDMAttributeStatistics);
- if ((_vm->indexToOrdinal(champIndex) == _vm->_inventoryMan->_inventoryChampionOrdinal) && (_vm->_inventoryMan->_panelContent == k0_PanelContentFoodWaterPoisoned)) {
+ if ((_vm->indexToOrdinal(champIndex) == _vm->_inventoryMan->_inventoryChampionOrdinal) && (_vm->_inventoryMan->_panelContent == kDMPanelContentFoodWaterPoisoned)) {
setFlag(curChampion->_attributes, kDMAttributePanel);
}
if (--attack) {
curChampion->_poisonEventCount++;
TimelineEvent newEvent;
- newEvent._type = k75_TMEventTypePoisonChampion;
+ newEvent._type = kDMEventTypePoisonChampion;
newEvent._priority = champIndex;
- _vm->setMapAndTime(newEvent._mapTime, _vm->_dungeonMan->_partyMapIndex, _vm->_gameTime + 36);
+ newEvent._mapTime = _vm->setMapAndTime(_vm->_dungeonMan->_partyMapIndex, _vm->_gameTime + 36);
newEvent._Bu._attack = attack;
_vm->_timeline->addEventGetEventIndex(&newEvent);
}
@@ -1126,10 +1129,12 @@ void ChampionMan::championPoison(int16 champIndex, uint16 attack) {
}
void ChampionMan::setPartyDirection(int16 dir) {
- if (dir == _vm->_dungeonMan->_partyDir)
+ DungeonMan &dungeon = *_vm->_dungeonMan;
+
+ if (dir == dungeon._partyDir)
return;
- int16 dirDiff = dir - _vm->_dungeonMan->_partyDir;
+ int16 dirDiff = dir - dungeon._partyDir;
if (dirDiff < 0)
dirDiff += 4;
@@ -1140,7 +1145,7 @@ void ChampionMan::setPartyDirection(int16 dir) {
curChampion++;
}
- _vm->_dungeonMan->_partyDir = (Direction)dir;
+ dungeon._partyDir = (Direction)dir;
drawChangedObjectIcons();
}
@@ -1246,11 +1251,13 @@ int16 ChampionMan::getMovementTicks(Champion *champ) {
bool ChampionMan::isAmmunitionCompatibleWithWeapon(uint16 champIndex, uint16 weaponSlotIndex, uint16 ammunitionSlotIndex) {
Champion *curChampion = &_champions[champIndex];
+ DungeonMan &dungeon = *_vm->_dungeonMan;
Thing curThing = curChampion->_slots[weaponSlotIndex];
+
if (curThing.getType() != kDMThingTypeWeapon)
return false;
- WeaponInfo *weaponInfo = _vm->_dungeonMan->getWeaponInfo(curThing);
+ WeaponInfo *weaponInfo = dungeon.getWeaponInfo(curThing);
int16 weaponClass = kDMWeaponClassNone;
if ((weaponInfo->_class >= kDMWeaponClassFirstBow) && (weaponInfo->_class <= kDMWeaponClassLastBow))
@@ -1262,7 +1269,7 @@ bool ChampionMan::isAmmunitionCompatibleWithWeapon(uint16 champIndex, uint16 wea
return false;
curThing = curChampion->_slots[ammunitionSlotIndex];
- weaponInfo = _vm->_dungeonMan->getWeaponInfo(curThing);
+ weaponInfo = dungeon.getWeaponInfo(curThing);
return ((curThing.getType() == kDMThingTypeWeapon) && (weaponInfo->_class == weaponClass));
}
@@ -1294,7 +1301,7 @@ void ChampionMan::clickOnSlotBox(uint16 slotBoxIndex) {
uint16 champIndex;
uint16 slotIndex;
- if (slotBoxIndex < k8_SlotBoxInventoryFirstSlot) {
+ if (slotBoxIndex < kDMSlotBoxInventoryFirstSlot) {
if (_candidateChampionOrdinal)
return;
@@ -1305,21 +1312,21 @@ void ChampionMan::clickOnSlotBox(uint16 slotBoxIndex) {
slotIndex = getHandSlotIndex(slotBoxIndex);
} else {
champIndex = _vm->ordinalToIndex(_vm->_inventoryMan->_inventoryChampionOrdinal);
- slotIndex = slotBoxIndex - k8_SlotBoxInventoryFirstSlot;
+ slotIndex = slotBoxIndex - kDMSlotBoxInventoryFirstSlot;
}
+ DungeonMan &dungeon = *_vm->_dungeonMan;
Thing leaderHandObject = _leaderHandObject;
Thing slotThing;
- if (slotIndex >= kDMSlotChest1) {
+ if (slotIndex >= kDMSlotChest1)
slotThing = _vm->_inventoryMan->_chestSlots[slotIndex - kDMSlotChest1];
- } else {
+ else
slotThing = _champions[champIndex]._slots[slotIndex];
- }
if ((slotThing == Thing::_none) && (leaderHandObject == Thing::_none))
return;
- if ((leaderHandObject != Thing::_none) && (!(_vm->_dungeonMan->_objectInfos[_vm->_dungeonMan->getObjectInfoIndex(leaderHandObject)]._allowedSlots & _slotMasks[slotIndex])))
+ if ((leaderHandObject != Thing::_none) && (!(dungeon._objectInfos[dungeon.getObjectInfoIndex(leaderHandObject)]._allowedSlots & _slotMasks[slotIndex])))
return;
_vm->_eventMan->showMouse();
@@ -1357,7 +1364,8 @@ bool ChampionMan::isProjectileSpellCast(uint16 champIndex, Thing thing, int16 ki
void ChampionMan::championShootProjectile(Champion *champ, Thing thing, int16 kineticEnergy, int16 attack, int16 stepEnergy) {
Direction newDirection = champ->_dir;
- _vm->_projexpl->createProjectile(thing, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, _vm->normalizeModulo4((((champ->_cell - newDirection + 1) & 0x0002) >> 1) + newDirection), newDirection, kineticEnergy, attack, stepEnergy);
+ DungeonMan &dungeon = *_vm->_dungeonMan;
+ _vm->_projexpl->createProjectile(thing, dungeon._partyMapX, dungeon._partyMapY, _vm->normalizeModulo4((((champ->_cell - newDirection + 1) & 0x0002) >> 1) + newDirection), newDirection, kineticEnergy, attack, stepEnergy);
_vm->_projectileDisableMovementTicks = 4;
_vm->_lastProjectileDisabledMovementDirection = newDirection;
}
@@ -1381,27 +1389,26 @@ void ChampionMan::applyAndDrawPendingDamageAndWounds() {
if (_vm->_console->_debugGodmodeHP == false)
curHealth -= pendingDamage;
- if (curHealth <= 0) {
+ if (curHealth <= 0)
championKill(championIndex);
- } else {
+ else {
championPtr->_currHealth = curHealth;
setFlag(championPtr->_attributes, kDMAttributeStatistics);
- if (pendingWounds) {
+ if (pendingWounds)
setFlag(championPtr->_attributes, kDMAttributeWounds);
- }
- int16 textPosX = championIndex * k69_ChampionStatusBoxSpacing;
+ int16 textPosX = championIndex * kDMChampionStatusBoxSpacing;
int16 textPosY;
Box blitBox;
- blitBox._y1 = 0;
+ blitBox._rect.top = 0;
_vm->_eventMan->showMouse();
if (_vm->indexToOrdinal(championIndex) == _vm->_inventoryMan->_inventoryChampionOrdinal) {
- blitBox._y2 = 28;
- blitBox._x1 = textPosX + 7;
- blitBox._x2 = blitBox._x1 + 31; /* Box is over the champion portrait in the status box */
- _vm->_displayMan->blitToScreen(_vm->_displayMan->getNativeBitmapOrGraphic(k16_damageToChampionBig), &blitBox, k16_byteWidth, k10_ColorFlesh, 29);
+ blitBox._rect.bottom = 28;
+ blitBox._rect.left = textPosX + 7;
+ blitBox._rect.right = blitBox._rect.left + 31; /* Box is over the champion portrait in the status box */
+ _vm->_displayMan->blitToScreen(_vm->_displayMan->getNativeBitmapOrGraphic(kDMGraphicIdxDamageToChampionBig), &blitBox, k16_byteWidth, kDMColorFlesh, 29);
// Check the number of digits and sets the position accordingly.
if (pendingDamage < 10) // 1 digit
textPosX += 21;
@@ -1412,10 +1419,10 @@ void ChampionMan::applyAndDrawPendingDamageAndWounds() {
textPosY = 16;
} else {
- blitBox._y2 = 6;
- blitBox._x1 = textPosX;
- blitBox._x2 = blitBox._x1 + 47; /* Box is over the champion name in the status box */
- _vm->_displayMan->blitToScreen(_vm->_displayMan->getNativeBitmapOrGraphic(k15_damageToChampionSmallIndice), &blitBox, k24_byteWidth, k10_ColorFlesh, 7);
+ blitBox._rect.bottom = 6;
+ blitBox._rect.left = textPosX;
+ blitBox._rect.right = blitBox._rect.left + 47; /* Box is over the champion name in the status box */
+ _vm->_displayMan->blitToScreen(_vm->_displayMan->getNativeBitmapOrGraphic(kDMGraphicIdxDamageToChampionSmall), &blitBox, k24_byteWidth, kDMColorFlesh, 7);
// Check the number of digits and sets the position accordingly.
if (pendingDamage < 10) // 1 digit
textPosX += 19;
@@ -1426,18 +1433,18 @@ void ChampionMan::applyAndDrawPendingDamageAndWounds() {
textPosY = 5;
}
- _vm->_textMan->printToLogicalScreen(textPosX, textPosY, k15_ColorWhite, k8_ColorRed, getStringFromInteger(pendingDamage, false, 3).c_str());
+ _vm->_textMan->printToLogicalScreen(textPosX, textPosY, kDMColorWhite, kDMColorRed, getStringFromInteger(pendingDamage, false, 3).c_str());
int16 eventIndex = championPtr->_hideDamageReceivedIndex;
if (eventIndex == -1) {
TimelineEvent newEvent;
- newEvent._type = k12_TMEventTypeHideDamageReceived;
- _vm->setMapAndTime(newEvent._mapTime, _vm->_dungeonMan->_partyMapIndex, _vm->_gameTime + 5);
+ newEvent._type = kDMEventTypeHideDamageReceived;
+ newEvent._mapTime = _vm->setMapAndTime(_vm->_dungeonMan->_partyMapIndex, _vm->_gameTime + 5);
newEvent._priority = championIndex;
championPtr->_hideDamageReceivedIndex = _vm->_timeline->addEventGetEventIndex(&newEvent);
} else {
TimelineEvent *curEvent = &_vm->_timeline->_events[eventIndex];
- _vm->setMapAndTime(curEvent->_mapTime, _vm->_dungeonMan->_partyMapIndex, _vm->_gameTime + 5);
+ curEvent->_mapTime = _vm->setMapAndTime(_vm->_dungeonMan->_partyMapIndex, _vm->_gameTime + 5);
_vm->_timeline->fixChronology(_vm->_timeline->getIndex(eventIndex));
}
drawChampionState((ChampionIndex)championIndex);
@@ -1447,7 +1454,9 @@ void ChampionMan::applyAndDrawPendingDamageAndWounds() {
}
void ChampionMan::championKill(uint16 champIndex) {
+ DungeonMan &dungeon = *_vm->_dungeonMan;
Champion *curChampion = &_champions[champIndex];
+
curChampion->_currHealth = 0;
setFlag(curChampion->_attributes, kDMAttributeStatusBox);
if (_vm->indexToOrdinal(champIndex) == _vm->_inventoryMan->_inventoryChampionOrdinal) {
@@ -1468,21 +1477,21 @@ void ChampionMan::championKill(uint16 champIndex) {
_vm->_inventoryMan->toggleInventory(kDMChampionCloseInventory);
}
dropAllObjects(champIndex);
- Thing unusedThing = _vm->_dungeonMan->getUnusedThing(kDMMaskChampionBones | kDMThingTypeJunk);
+ Thing unusedThing = dungeon.getUnusedThing(kDMMaskChampionBones | kDMThingTypeJunk);
uint16 curCell = 0;
if (unusedThing != Thing::_none) {
- Junk *L0966_ps_Junk = (Junk *)_vm->_dungeonMan->getThingData(unusedThing);
+ Junk *L0966_ps_Junk = (Junk *)dungeon.getThingData(unusedThing);
L0966_ps_Junk->setType(kDMJunkTypeBones);
L0966_ps_Junk->setDoNotDiscard(true);
L0966_ps_Junk->setChargeCount(champIndex);
curCell = curChampion->_cell;
- _vm->_moveSens->getMoveResult(_vm->thingWithNewCell(unusedThing, curCell), kDMMapXNotOnASquare, 0, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY);
+ _vm->_moveSens->getMoveResult(_vm->thingWithNewCell(unusedThing, curCell), kDMMapXNotOnASquare, 0, dungeon._partyMapX, dungeon._partyMapY);
}
curChampion->_symbolStep = 0;
curChampion->_symbols[0] = '\0';
- curChampion->_dir = _vm->_dungeonMan->_partyDir;
+ curChampion->_dir = dungeon._partyDir;
curChampion->_maximumDamageReceived = 0;
- uint16 curChampionIconIndex = getChampionIconIndex(curCell, _vm->_dungeonMan->_partyDir);
+ uint16 curChampionIconIndex = getChampionIconIndex(curCell, dungeon._partyDir);
if (_vm->indexToOrdinal(curChampionIconIndex) == _vm->_eventMan->_useChampionIconOrdinalAsMousePointerBitmap) {
_vm->_eventMan->_mousePointerBitmapUpdated = true;
_vm->_eventMan->_useChampionIconOrdinalAsMousePointerBitmap = _vm->indexToOrdinal(kDMChampionNone);
@@ -1492,7 +1501,7 @@ void ChampionMan::championKill(uint16 champIndex) {
unpoison(champIndex);
_vm->_displayMan->_useByteBoxCoordinates = false;
- _vm->_displayMan->fillScreenBox(_boxChampionIcons[curChampionIconIndex], k0_ColorBlack);
+ _vm->_displayMan->fillScreenBox(_boxChampionIcons[curChampionIconIndex], kDMColorBlack);
drawChampionState((ChampionIndex)champIndex);
ChampionIndex aliveChampionIndex;
@@ -1550,10 +1559,11 @@ void ChampionMan::dropAllObjects(uint16 champIndex) {
};
uint16 curCell = _champions[champIndex]._cell;
+ DungeonMan &dungeon = *_vm->_dungeonMan;
for (uint16 slotIndex = kDMSlotReadyHand; slotIndex < kDMSlotChest1; slotIndex++) {
Thing curThing = getObjectRemovedFromSlot(champIndex, slotDropOrder[slotIndex]);
if (curThing != Thing::_none)
- _vm->_moveSens->getMoveResult(_vm->thingWithNewCell(curThing, curCell), kDMMapXNotOnASquare, 0, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY);
+ _vm->_moveSens->getMoveResult(_vm->thingWithNewCell(curThing, curCell), kDMMapXNotOnASquare, 0, dungeon._partyMapX, dungeon._partyMapY);
}
}
@@ -1563,7 +1573,7 @@ void ChampionMan::unpoison(int16 champIndex) {
TimelineEvent *eventPtr = _vm->_timeline->_events;
for (uint16 eventIndex = 0; eventIndex < _vm->_timeline->_eventMaxCount; eventPtr++, eventIndex++) {
- if ((eventPtr->_type == k75_TMEventTypePoisonChampion) && (eventPtr->_priority == champIndex))
+ if ((eventPtr->_type == kDMEventTypePoisonChampion) && (eventPtr->_priority == champIndex))
_vm->_timeline->deleteEvent(eventIndex);
}
_champions[champIndex]._poisonEventCount = 0;
@@ -1573,10 +1583,11 @@ void ChampionMan::applyTimeEffects() {
if (!_partyChampionCount)
return;
+ DungeonMan &dungeon = *_vm->_dungeonMan;
Scent checkScent;
- checkScent.setMapX(_vm->_dungeonMan->_partyMapX);
- checkScent.setMapY(_vm->_dungeonMan->_partyMapY);
- checkScent.setMapIndex(_vm->_dungeonMan->_partyMapIndex);
+ checkScent.setMapX(dungeon._partyMapX);
+ checkScent.setMapY(dungeon._partyMapY);
+ checkScent.setMapIndex(dungeon._partyMapIndex);
for (byte loopScentIndex = 0; loopScentIndex + 1 < _party._scentCount; loopScentIndex++) {
if (&_party._scents[loopScentIndex] != &checkScent) {
@@ -1678,14 +1689,14 @@ void ChampionMan::applyTimeEffects() {
curStatistic[kDMStatCurrent] -= curStatistic[kDMStatCurrent] / statisticMaximum;
}
}
- if (!_partyIsSleeping && (championPtr->_dir != _vm->_dungeonMan->_partyDir) && (_vm->_projexpl->_lastCreatureAttackTime + 60 < _vm->_gameTime)) {
- championPtr->_dir = _vm->_dungeonMan->_partyDir;
+ if (!_partyIsSleeping && (championPtr->_dir != dungeon._partyDir) && (_vm->_projexpl->_lastCreatureAttackTime + 60 < _vm->_gameTime)) {
+ championPtr->_dir = dungeon._partyDir;
championPtr->_maximumDamageReceived = 0;
setFlag(championPtr->_attributes, kDMAttributeIcon);
}
setFlag(championPtr->_attributes, kDMAttributeStatistics);
if (_vm->indexToOrdinal(championIndex) == _vm->_inventoryMan->_inventoryChampionOrdinal) {
- if (_vm->_pressingMouth || _vm->_pressingEye || (_vm->_inventoryMan->_panelContent == k0_PanelContentFoodWaterPoisoned)) {
+ if (_vm->_pressingMouth || _vm->_pressingEye || (_vm->_inventoryMan->_panelContent == kDMPanelContentFoodWaterPoisoned)) {
setFlag(championPtr->_attributes, kDMAttributePanel);
}
}
@@ -1828,7 +1839,7 @@ ChampionIndex ChampionMan::getIndexInCell(int16 cell) {
}
void ChampionMan::resetDataToStartGame() {
- if (!_vm->_newGameFl) {
+ if (_vm->_gameMode == kDMModeLoadSavedGame) {
Thing handThing = _leaderHandObject;
if (handThing == Thing::_none) {
_leaderEmptyHanded = true;
@@ -1870,35 +1881,36 @@ void ChampionMan::addCandidateChampionToParty(uint16 championPortraitIndex) {
if (_partyChampionCount == 4)
return;
+ DungeonMan &dungeon = *_vm->_dungeonMan;
uint16 previousPartyChampionCount = _partyChampionCount;
Champion *championPtr = &_champions[previousPartyChampionCount];
championPtr->resetToZero();
// Strangerke - TODO: Check if the new code is possible to run on the older version (example: the portraits could be missing in the data)
_vm->_displayMan->_useByteBoxCoordinates = true;
- _vm->_displayMan->blitToBitmap(_vm->_displayMan->getNativeBitmapOrGraphic(k26_ChampionPortraitsIndice), championPtr->_portrait, _boxChampionPortrait, getChampionPortraitX(championPortraitIndex), getChampionPortraitY(championPortraitIndex), k128_byteWidth, k16_byteWidth, kM1_ColorNoTransparency, 87, 29);
+ _vm->_displayMan->blitToBitmap(_vm->_displayMan->getNativeBitmapOrGraphic(kDMGraphicIdxChampionPortraits), championPtr->_portrait, _boxChampionPortrait, getChampionPortraitX(championPortraitIndex), getChampionPortraitY(championPortraitIndex), k128_byteWidth, k16_byteWidth, kDMColorNoTransparency, 87, 29);
championPtr->_actionIndex = kDMActionNone;
championPtr->_enableActionEventIndex = -1;
championPtr->_hideDamageReceivedIndex = -1;
- championPtr->_dir = _vm->_dungeonMan->_partyDir;
- uint16 viewCell = k0_ViewCellFronLeft;
- while (getIndexInCell(_vm->normalizeModulo4(viewCell + _vm->_dungeonMan->_partyDir)) != kDMChampionNone)
+ championPtr->_dir = dungeon._partyDir;
+ uint16 viewCell = kDMViewCellFronLeft;
+ while (getIndexInCell(_vm->normalizeModulo4(viewCell + dungeon._partyDir)) != kDMChampionNone)
viewCell++;
- championPtr->_cell = (ViewCell)_vm->normalizeModulo4(viewCell + _vm->_dungeonMan->_partyDir);
+ championPtr->_cell = (ViewCell)_vm->normalizeModulo4(viewCell + dungeon._partyDir);
championPtr->_attributes = kDMAttributeIcon;
- championPtr->_directionMaximumDamageReceived = _vm->_dungeonMan->_partyDir;
+ championPtr->_directionMaximumDamageReceived = dungeon._partyDir;
championPtr->_food = 1500 + _vm->getRandomNumber(256);
championPtr->_water = 1500 + _vm->getRandomNumber(256);
for (int16 slotIdx = kDMSlotReadyHand; slotIdx < kDMSlotChest1; slotIdx++)
championPtr->_slots[slotIdx] = Thing::_none;
- Thing curThing = _vm->_dungeonMan->getSquareFirstThing(_vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY);
+ Thing curThing = dungeon.getSquareFirstThing(dungeon._partyMapX, dungeon._partyMapY);
while (curThing.getType() != kDMstringTypeText)
- curThing = _vm->_dungeonMan->getNextThing(curThing);
+ curThing = dungeon.getNextThing(curThing);
char L0807_ac_DecodedChampionText[77];
char *decodedStringPtr = L0807_ac_DecodedChampionText;
- _vm->_dungeonMan->decodeText(decodedStringPtr, curThing, (TextType)(kDMTextTypeScroll | kDMMaskDecodeEvenIfInvisible));
+ dungeon.decodeText(decodedStringPtr, curThing, (TextType)(kDMTextTypeScroll | kDMMaskDecodeEvenIfInvisible));
uint16 charIdx = 0;
char tmpChar;
@@ -1958,16 +1970,16 @@ void ChampionMan::addCandidateChampionToParty(uint16 championPortraitIndex) {
_vm->_menuMan->drawActionIcon((ChampionIndex)(_partyChampionCount - 1));
}
- int16 curMapX = _vm->_dungeonMan->_partyMapX;
- int16 curMapY = _vm->_dungeonMan->_partyMapY;
- uint16 championObjectsCell = _vm->returnOppositeDir(_vm->_dungeonMan->_partyDir);
- curMapX += _vm->_dirIntoStepCountEast[_vm->_dungeonMan->_partyDir], curMapY += _vm->_dirIntoStepCountNorth[_vm->_dungeonMan->_partyDir];
- curThing = _vm->_dungeonMan->getSquareFirstThing(curMapX, curMapY);
+ int16 curMapX = dungeon._partyMapX;
+ int16 curMapY = dungeon._partyMapY;
+ uint16 championObjectsCell = _vm->returnOppositeDir(dungeon._partyDir);
+ curMapX += _vm->_dirIntoStepCountEast[dungeon._partyDir], curMapY += _vm->_dirIntoStepCountNorth[dungeon._partyDir];
+ curThing = dungeon.getSquareFirstThing(curMapX, curMapY);
int16 slotIdx = kDMSlotBackpackLine1_1;
while (curThing != Thing::_endOfList) {
ThingType thingType = curThing.getType();
if ((thingType > kDMThingTypeSensor) && (curThing.getCell() == championObjectsCell)) {
- int16 objectAllowedSlots = _vm->_dungeonMan->_objectInfos[_vm->_dungeonMan->getObjectInfoIndex(curThing)]._allowedSlots;
+ int16 objectAllowedSlots = dungeon._objectInfos[dungeon.getObjectInfoIndex(curThing)]._allowedSlots;
uint16 curSlotIndex = kDMSlotReadyHand;
switch (thingType) {
case kDMThingTypeArmour: {
@@ -2028,7 +2040,7 @@ void ChampionMan::addCandidateChampionToParty(uint16 championPortraitIndex) {
}
addObjectInSlot((ChampionIndex)previousPartyChampionCount, curThing, (ChampionSlot)curSlotIndex);
}
- curThing = _vm->_dungeonMan->getNextThing(curThing);
+ curThing = dungeon.getNextThing(curThing);
}
_vm->_inventoryMan->toggleInventory((ChampionIndex)previousPartyChampionCount);
_vm->_menuMan->drawDisabledMenu();;
@@ -2064,24 +2076,24 @@ void ChampionMan::drawChampionBarGraphs(ChampionIndex champIndex) {
// Strangerke - TO CHECK: if portraits, maybe the old (assembly) code is required for older versions
Box box;
- box._x1 = champIndex * k69_ChampionStatusBoxSpacing + 46;
- box._x2 = box._x1 + 3;
- box._y1 = 2;
- box._y2 = 26;
+ box._rect.left = champIndex * kDMChampionStatusBoxSpacing + 46;
+ box._rect.right = box._rect.left + 3;
+ box._rect.top = 2;
+ box._rect.bottom = 26;
for (int16 barGraphIndex = 0; barGraphIndex < 3; barGraphIndex++) {
int16 barGraphHeight = barGraphHeights[barGraphIndex];
if (barGraphHeight < 25) {
- box._y1 = 2;
- box._y2 = 27 - barGraphHeight;
- _vm->_displayMan->fillScreenBox(box, k12_ColorDarkestGray);
+ box._rect.top = 2;
+ box._rect.bottom = 27 - barGraphHeight;
+ _vm->_displayMan->fillScreenBox(box, kDMColorDarkestGray);
}
if (barGraphHeight) {
- box._y1 = 27 - barGraphHeight;
- box._y2 = 26;
+ box._rect.top = 27 - barGraphHeight;
+ box._rect.bottom = 26;
_vm->_displayMan->fillScreenBox(box, _championColor[champIndex]);
}
- box._x1 += 7;
- box._x2 += 7;
+ box._rect.left += 7;
+ box._rect.right += 7;
}
_vm->_eventMan->hideMouse();
}
@@ -2116,7 +2128,7 @@ void ChampionMan::drawChampionState(ChampionIndex champIndex) {
static Box boxMouth = Box(55, 72, 12, 29); // @ G0048_s_Graphic562_Box_Mouth
static Box boxEye = Box(11, 28, 12, 29); // @ G0049_s_Graphic562_Box_Eye
- int16 championStatusBoxX = champIndex * k69_ChampionStatusBoxSpacing;
+ int16 championStatusBoxX = champIndex * kDMChampionStatusBoxSpacing;
Champion *curChampion = &_champions[champIndex];
uint16 championAttributes = curChampion->_attributes;
if (!getFlag(championAttributes, kDMAttributeNameTitle | kDMAttributeStatistics | kDMAttributeLoad | kDMAttributeIcon | kDMAttributePanel | kDMAttributeStatusBox | kDMAttributeWounds | kDMAttributeViewport | kDMAttributeActionHand))
@@ -2127,28 +2139,28 @@ void ChampionMan::drawChampionState(ChampionIndex champIndex) {
_vm->_eventMan->showMouse();
if (getFlag(championAttributes, kDMAttributeStatusBox)) {
Box box;
- box._y1 = 0;
- box._y2 = 28;
- box._x1 = championStatusBoxX;
- box._x2 = box._x1 + 66;
+ box._rect.top = 0;
+ box._rect.bottom = 28;
+ box._rect.left = championStatusBoxX;
+ box._rect.right = box._rect.left + 66;
if (curChampion->_currHealth) {
- _vm->_displayMan->fillScreenBox(box, k12_ColorDarkestGray);
+ _vm->_displayMan->fillScreenBox(box, kDMColorDarkestGray);
int16 nativeBitmapIndices[3];
for (uint16 i = 0; i < 3; ++i)
nativeBitmapIndices[i] = 0;
uint16 borderCount = 0;
if (_party._fireShieldDefense > 0)
- nativeBitmapIndices[borderCount++] = k38_BorderPartyFireshieldIndice;
+ nativeBitmapIndices[borderCount++] = kDMGraphicIdxBorderPartyFireshield;
if (_party._spellShieldDefense > 0)
- nativeBitmapIndices[borderCount++] = k39_BorderPartySpellshieldIndice;
+ nativeBitmapIndices[borderCount++] = kDMGraphicIdxBorderPartySpellshield;
if ((_party._shieldDefense > 0) || curChampion->_shieldDefense)
- nativeBitmapIndices[borderCount++] = k37_BorderPartyShieldIndice;
+ nativeBitmapIndices[borderCount++] = kDMGraphicIdxBorderPartyShield;
while (borderCount--)
- _vm->_displayMan->blitToScreen(_vm->_displayMan->getNativeBitmapOrGraphic(nativeBitmapIndices[borderCount]), &box, k40_byteWidth, k10_ColorFlesh, 29);
+ _vm->_displayMan->blitToScreen(_vm->_displayMan->getNativeBitmapOrGraphic(nativeBitmapIndices[borderCount]), &box, k40_byteWidth, kDMColorFlesh, 29);
if (isInventoryChampion) {
_vm->_inventoryMan->drawStatusBoxPortrait(champIndex);
@@ -2156,8 +2168,8 @@ void ChampionMan::drawChampionState(ChampionIndex champIndex) {
} else
setFlag(championAttributes, kDMAttributeNameTitle | kDMAttributeStatistics | kDMAttributeWounds | kDMAttributeActionHand);
} else {
- _vm->_displayMan->blitToScreen(_vm->_displayMan->getNativeBitmapOrGraphic(k8_StatusBoxDeadChampion), &box, k40_byteWidth, kM1_ColorNoTransparency, 29);
- _vm->_textMan->printToLogicalScreen(championStatusBoxX + 1, 5, k13_ColorLightestGray, k1_ColorDarkGary, curChampion->_name);
+ _vm->_displayMan->blitToScreen(_vm->_displayMan->getNativeBitmapOrGraphic(kDMGraphicIdxStatusBoxDeadChampion), &box, k40_byteWidth, kDMColorNoTransparency, 29);
+ _vm->_textMan->printToLogicalScreen(championStatusBoxX + 1, 5, kDMColorLightestGray, kDMColorDarkGary, curChampion->_name);
_vm->_menuMan->drawActionIcon(champIndex);
clearFlag(curChampion->_attributes, kDMAttributeNameTitle | kDMAttributeStatistics | kDMAttributeLoad | kDMAttributeIcon | kDMAttributePanel | kDMAttributeStatusBox | kDMAttributeWounds | kDMAttributeViewport | kDMAttributeActionHand);
@@ -2172,7 +2184,7 @@ void ChampionMan::drawChampionState(ChampionIndex champIndex) {
}
if (getFlag(championAttributes, kDMAttributeNameTitle)) {
- Color nameColor = (champIndex == _leaderIndex) ? k9_ColorGold : k13_ColorLightestGray;
+ Color nameColor = (champIndex == _leaderIndex) ? kDMColorGold : kDMColorLightestGray;
if (isInventoryChampion) {
char *championName = curChampion->_name;
_vm->_textMan->printToViewport(3, 7, nameColor, championName);
@@ -2185,12 +2197,12 @@ void ChampionMan::drawChampionState(ChampionIndex champIndex) {
setFlag(championAttributes, kDMAttributeViewport);
} else {
Box box;
- box._y1 = 0;
- box._y2 = 6;
- box._x1 = championStatusBoxX;
- box._x2 = box._x1 + 42;
- _vm->_displayMan->fillScreenBox(box, k1_ColorDarkGary);
- _vm->_textMan->printToLogicalScreen(championStatusBoxX + 1, 5, nameColor, k1_ColorDarkGary, curChampion->_name);
+ box._rect.top = 0;
+ box._rect.bottom = 6;
+ box._rect.left = championStatusBoxX;
+ box._rect.right = box._rect.left + 42;
+ _vm->_displayMan->fillScreenBox(box, kDMColorDarkGary);
+ _vm->_textMan->printToLogicalScreen(championStatusBoxX + 1, 5, nameColor, kDMColorDarkGary, curChampion->_name);
}
}
if (getFlag(championAttributes, kDMAttributeStatistics)) {
@@ -2199,19 +2211,19 @@ void ChampionMan::drawChampionState(ChampionIndex champIndex) {
drawHealthStaminaManaValues(curChampion);
int16 nativeBitmapIndex;
if ((curChampion->_food < 0) || (curChampion->_water < 0) || (curChampion->_poisonEventCount))
- nativeBitmapIndex = k34_SlotBoxWoundedIndice;
+ nativeBitmapIndex = kDMGraphicIdxSlotBoxWounded;
else
- nativeBitmapIndex = k33_SlotBoxNormalIndice;
+ nativeBitmapIndex = kDMGraphicIdxSlotBoxNormal;
- _vm->_displayMan->blitToViewport(_vm->_displayMan->getNativeBitmapOrGraphic(nativeBitmapIndex), boxMouth, k16_byteWidth, k12_ColorDarkestGray, 18);
- nativeBitmapIndex = k33_SlotBoxNormalIndice;
+ _vm->_displayMan->blitToViewport(_vm->_displayMan->getNativeBitmapOrGraphic(nativeBitmapIndex), boxMouth, k16_byteWidth, kDMColorDarkestGray, 18);
+ nativeBitmapIndex = kDMGraphicIdxSlotBoxNormal;
for (int i = kDMStatStrength; i <= kDMStatAntifire; i++) {
if ((curChampion->_statistics[i][kDMStatCurrent] < curChampion->_statistics[i][kDMStatMaximum])) {
- nativeBitmapIndex = k34_SlotBoxWoundedIndice;
+ nativeBitmapIndex = kDMGraphicIdxSlotBoxWounded;
break;
}
}
- _vm->_displayMan->blitToViewport(_vm->_displayMan->getNativeBitmapOrGraphic(nativeBitmapIndex), boxEye, k16_byteWidth, k12_ColorDarkestGray, 18);
+ _vm->_displayMan->blitToViewport(_vm->_displayMan->getNativeBitmapOrGraphic(nativeBitmapIndex), boxEye, k16_byteWidth, kDMColorDarkestGray, 18);
setFlag(championAttributes, kDMAttributeViewport);
}
}
@@ -2226,11 +2238,11 @@ void ChampionMan::drawChampionState(ChampionIndex champIndex) {
uint16 maxLoad = getMaximumLoad(curChampion);
Color loadColor;
if (curChampion->_load > maxLoad)
- loadColor = k8_ColorRed;
+ loadColor = kDMColorRed;
else if (((long)curChampion->_load << 3) > ((long)maxLoad * 5))
- loadColor = k11_ColorYellow;
+ loadColor = kDMColorYellow;
else
- loadColor = k13_ColorLightestGray;
+ loadColor = kDMColorLightestGray;
switch (_vm->getGameLanguage()) { // localized
default:
@@ -2258,10 +2270,11 @@ void ChampionMan::drawChampionState(ChampionIndex champIndex) {
_vm->_textMan->printToViewport(148, 132, loadColor, _vm->_stringBuildBuffer);
setFlag(championAttributes, kDMAttributeViewport);
}
- uint16 championIconIndex = getChampionIconIndex(curChampion->_cell, _vm->_dungeonMan->_partyDir);
+ DungeonMan &dungeon = *_vm->_dungeonMan;
+ uint16 championIconIndex = getChampionIconIndex(curChampion->_cell, dungeon._partyDir);
if (getFlag(championAttributes, kDMAttributeIcon) && (_vm->_eventMan->_useChampionIconOrdinalAsMousePointerBitmap != _vm->indexToOrdinal(championIconIndex))) {
_vm->_displayMan->fillScreenBox(_boxChampionIcons[championIconIndex], _championColor[champIndex]);
- _vm->_displayMan->blitToBitmap(_vm->_displayMan->getNativeBitmapOrGraphic(k28_ChampionIcons), _vm->_displayMan->_bitmapScreen, _boxChampionIcons[championIconIndex], getChampionIconIndex(curChampion->_dir, _vm->_dungeonMan->_partyDir) * 19, 0, k40_byteWidth, k160_byteWidthScreen, k12_ColorDarkestGray, 14, k200_heightScreen);
+ _vm->_displayMan->blitToBitmap(_vm->_displayMan->getNativeBitmapOrGraphic(kDMGraphicIdxChampionIcons), _vm->_displayMan->_bitmapScreen, _boxChampionIcons[championIconIndex], getChampionIconIndex(curChampion->_dir, dungeon._partyDir) * 19, 0, k40_byteWidth, k160_byteWidthScreen, kDMColorDarkestGray, 14, k200_heightScreen);
}
if (getFlag(championAttributes, kDMAttributePanel) && isInventoryChampion) {
if (_vm->_pressingMouth)
@@ -2309,7 +2322,7 @@ void ChampionMan::drawSlot(uint16 champIndex, int16 slotIndex) {
return;
slotBoxIndex = (champIndex << 1) + slotIndex;
} else
- slotBoxIndex = k8_SlotBoxInventoryFirstSlot + slotIndex;
+ slotBoxIndex = kDMSlotBoxInventoryFirstSlot + slotIndex;
Thing thing;
if (slotIndex >= kDMSlotChest1)
@@ -2319,10 +2332,10 @@ void ChampionMan::drawSlot(uint16 champIndex, int16 slotIndex) {
SlotBox *slotBox = &_vm->_objectMan->_slotBoxes[slotBoxIndex];
Box box;
- box._x1 = slotBox->_x - 1;
- box._y1 = slotBox->_y - 1;
- box._x2 = box._x1 + 17;
- box._y2 = box._y1 + 17;
+ box._rect.left = slotBox->_x - 1;
+ box._rect.top = slotBox->_y - 1;
+ box._rect.right = box._rect.left + 17;
+ box._rect.bottom = box._rect.top + 17;
if (!isInventoryChamp)
_vm->_eventMan->hideMouse();
@@ -2333,9 +2346,9 @@ void ChampionMan::drawSlot(uint16 champIndex, int16 slotIndex) {
iconIndex = kDMIconIndiceReadyHand + (slotIndex << 1);
if (champ->getWoundsFlag((ChampionWound)(1 << slotIndex))) {
iconIndex++;
- nativeBitmapIndex = k34_SlotBoxWoundedIndice;
+ nativeBitmapIndex = kDMGraphicIdxSlotBoxWounded;
} else
- nativeBitmapIndex = k33_SlotBoxNormalIndice;
+ nativeBitmapIndex = kDMGraphicIdxSlotBoxNormal;
} else {
if ((slotIndex >= kDMSlotNeck) && (slotIndex <= kDMSlotBackpackLine1_1))
iconIndex = kDMIconIndiceNeck + (slotIndex - kDMSlotNeck);
@@ -2349,25 +2362,25 @@ void ChampionMan::drawSlot(uint16 champIndex, int16 slotIndex) {
} // BUG2_00
if (slotIndex <= kDMSlotFeet) {
if (champ->getWoundsFlag((ChampionWound)(1 << slotIndex)))
- nativeBitmapIndex = k34_SlotBoxWoundedIndice;
+ nativeBitmapIndex = kDMGraphicIdxSlotBoxWounded;
else
- nativeBitmapIndex = k33_SlotBoxNormalIndice;
+ nativeBitmapIndex = kDMGraphicIdxSlotBoxNormal;
}
}
if ((slotIndex == kDMSlotActionHand) && (_vm->indexToOrdinal(champIndex) == _actingChampionOrdinal))
- nativeBitmapIndex = k35_SlotBoxActingHandIndice;
+ nativeBitmapIndex = kDMGraphicIdxSlotBoxActingHand;
if (nativeBitmapIndex != -1) {
_vm->_displayMan->_useByteBoxCoordinates = false;
if (isInventoryChamp) {
_vm->_displayMan->blitToBitmap(_vm->_displayMan->getNativeBitmapOrGraphic(nativeBitmapIndex),
_vm->_displayMan->_bitmapViewport, box, 0, 0, 16, k112_byteWidthViewport,
- k12_ColorDarkestGray, _vm->_displayMan->getPixelHeight(nativeBitmapIndex), k136_heightViewport);
+ kDMColorDarkestGray, _vm->_displayMan->getPixelHeight(nativeBitmapIndex), k136_heightViewport);
} else {
_vm->_displayMan->blitToBitmap(_vm->_displayMan->getNativeBitmapOrGraphic(nativeBitmapIndex),
_vm->_displayMan->_bitmapScreen, box, 0, 0, 16, k160_byteWidthScreen,
- k12_ColorDarkestGray, _vm->_displayMan->getPixelHeight(nativeBitmapIndex), k136_heightViewport);
+ kDMColorDarkestGray, _vm->_displayMan->getPixelHeight(nativeBitmapIndex), k136_heightViewport);
}
}
@@ -2385,15 +2398,15 @@ void ChampionMan::renameChampion(Champion *champ) {
static const char reincarnateSpecialCharacters[6] = {',', '.', ';', ':', ' '};
Box displayBox;
- displayBox._y1 = 3;
- displayBox._y2 = 8;
- displayBox._x1 = 3;
- displayBox._x2 = displayBox._x1 + 167;
-
- _vm->_displayMan->fillBoxBitmap(_vm->_displayMan->_bitmapViewport, displayBox, k12_ColorDarkestGray, k112_byteWidthViewport, k136_heightViewport);
- _vm->_displayMan->blitToViewport(_vm->_displayMan->getNativeBitmapOrGraphic(k27_PanelRenameChampionIndice), _vm->_inventoryMan->_boxPanel, k72_byteWidth, k4_ColorCyan, 73);
- _vm->_textMan->printToViewport(177, 58, k13_ColorLightestGray, "_______");
- _vm->_textMan->printToViewport(105, 76, k13_ColorLightestGray, "___________________");
+ displayBox._rect.top = 3;
+ displayBox._rect.bottom = 8;
+ displayBox._rect.left = 3;
+ displayBox._rect.right = displayBox._rect.left + 167;
+
+ _vm->_displayMan->fillBoxBitmap(_vm->_displayMan->_bitmapViewport, displayBox, kDMColorDarkestGray, k112_byteWidthViewport, k136_heightViewport);
+ _vm->_displayMan->blitToViewport(_vm->_displayMan->getNativeBitmapOrGraphic(kDMGraphicIdxPanelRenameChampion), _vm->_inventoryMan->_boxPanel, k72_byteWidth, kDMColorCyan, 73);
+ _vm->_textMan->printToViewport(177, 58, kDMColorLightestGray, "_______");
+ _vm->_textMan->printToViewport(105, 76, kDMColorLightestGray, "___________________");
_vm->_eventMan->showMouse();
_vm->_displayMan->drawViewport(k0_viewportNotDungeonView);
_vm->_eventMan->setMousePointerToNormal(k0_pointerArrow);
@@ -2410,7 +2423,7 @@ void ChampionMan::renameChampion(Champion *champ) {
bool championTitleIsFull = ((renamedChampionStringMode == k2_RENAME_CHAMPION_TITLE) && (curCharacterIndex == 19));
if (!championTitleIsFull) {
_vm->_eventMan->showMouse();
- _vm->_textMan->printTextToBitmap(_vm->_displayMan->_bitmapScreen, k160_byteWidthScreen, textPosX, textPosY, k9_ColorGold, k12_ColorDarkestGray, underscoreCharacterString, k200_heightScreen);
+ _vm->_textMan->printTextToBitmap(_vm->_displayMan->_bitmapScreen, k160_byteWidthScreen, textPosX, textPosY, kDMColorGold, kDMColorDarkestGray, underscoreCharacterString, k200_heightScreen);
_vm->_eventMan->hideMouse();
}
@@ -2495,7 +2508,7 @@ void ChampionMan::renameChampion(Champion *champ) {
if (!championTitleIsFull) {
renameChampionInputCharacterString[0] = curCharacter;
_vm->_eventMan->showMouse();
- _vm->_textMan->printTextToBitmap(_vm->_displayMan->_bitmapScreen, k160_byteWidthScreen, textPosX, textPosY, k13_ColorLightestGray, k12_ColorDarkestGray, renameChampionInputCharacterString, k200_heightScreen);
+ _vm->_textMan->printTextToBitmap(_vm->_displayMan->_bitmapScreen, k160_byteWidthScreen, textPosX, textPosY, kDMColorLightestGray, kDMColorDarkestGray, renameChampionInputCharacterString, k200_heightScreen);
_vm->_eventMan->hideMouse();
renamedChampionString[curCharacterIndex++] = curCharacter;
renamedChampionString[curCharacterIndex] = '\0';
@@ -2512,7 +2525,7 @@ void ChampionMan::renameChampion(Champion *champ) {
} else if (curCharacter == '\r') { // Carriage return
if ((renamedChampionStringMode == k1_RENAME_CHAMPION_NAME) && (curCharacterIndex > 0)) {
_vm->_eventMan->showMouse();
- _vm->_textMan->printTextToBitmap(_vm->_displayMan->_bitmapScreen, k160_byteWidthScreen, textPosX, textPosY, k13_ColorLightestGray, k12_ColorDarkestGray, underscoreCharacterString, k200_heightScreen);
+ _vm->_textMan->printTextToBitmap(_vm->_displayMan->_bitmapScreen, k160_byteWidthScreen, textPosX, textPosY, kDMColorLightestGray, kDMColorDarkestGray, underscoreCharacterString, k200_heightScreen);
_vm->_eventMan->hideMouse();
renamedChampionStringMode = k2_RENAME_CHAMPION_TITLE;
renamedChampionString = champ->_title;
@@ -2526,7 +2539,7 @@ void ChampionMan::renameChampion(Champion *champ) {
if (!championTitleIsFull) {
_vm->_eventMan->showMouse();
- _vm->_textMan->printTextToBitmap(_vm->_displayMan->_bitmapScreen, k160_byteWidthScreen, textPosX, textPosY, k13_ColorLightestGray, k12_ColorDarkestGray, underscoreCharacterString, k200_heightScreen);
+ _vm->_textMan->printTextToBitmap(_vm->_displayMan->_bitmapScreen, k160_byteWidthScreen, textPosX, textPosY, kDMColorLightestGray, kDMColorDarkestGray, underscoreCharacterString, k200_heightScreen);
_vm->_eventMan->hideMouse();
}
if (curCharacterIndex == 0) {
diff --git a/engines/dm/champion.h b/engines/dm/champion.h
index fe565123fa..ffcd7abc42 100644
--- a/engines/dm/champion.h
+++ b/engines/dm/champion.h
@@ -35,8 +35,8 @@
namespace DM {
-#define kDMIgnoreObjectModifiers 0x4000 // @ MASK0x4000_IGNORE_OBJECT_MODIFIERS
-#define kDMIgnoreTemporaryExperience 0x8000 // @ MASK0x8000_IGNORE_TEMPORARY_EXPERIENCE
+#define kDMIgnoreObjectModifiers 0x4000 // @ MASK0x4000_IGNORE_OBJECT_MODIFIERS
+#define kDMIgnoreTemporaryExperience 0x8000 // @ MASK0x8000_IGNORE_TEMPORARY_EXPERIENCE
class Scent {
uint16 _scent;
@@ -349,50 +349,50 @@ enum AttackType {
};
enum SpellCastResult {
- kDMSpellCastFailure = 0, // @ C0_SPELL_CAST_FAILURE
- kDMSpellCastSuccess = 1, // @ C1_SPELL_CAST_SUCCESS
- kDMSpellCastFailureNeedsFlask = 3 // @ C3_SPELL_CAST_FAILURE_NEEDS_FLASK
+ kDMSpellCastFailure = 0, // @ C0_SPELL_CAST_FAILURE
+ kDMSpellCastSuccess = 1, // @ C1_SPELL_CAST_SUCCESS
+ kDMSpellCastFailureNeedsFlask = 3 // @ C3_SPELL_CAST_FAILURE_NEEDS_FLASK
};
enum SpellFailure {
- kDMFailureNeedsMorePractice = 0, // @ C00_FAILURE_NEEDS_MORE_PRACTICE
- kDMFailureMeaninglessSpell = 1, // @ C01_FAILURE_MEANINGLESS_SPELL
- kDMFailureNeedsFlaskInHand = 10, // @ C10_FAILURE_NEEDS_FLASK_IN_HAND
- kDMFailureNeedsMagicMapInHand = 11 // @ C11_FAILURE_NEEDS_MAGIC_MAP_IN_HAND
+ kDMFailureNeedsMorePractice = 0, // @ C00_FAILURE_NEEDS_MORE_PRACTICE
+ kDMFailureMeaninglessSpell = 1, // @ C01_FAILURE_MEANINGLESS_SPELL
+ kDMFailureNeedsFlaskInHand = 10, // @ C10_FAILURE_NEEDS_FLASK_IN_HAND
+ kDMFailureNeedsMagicMapInHand = 11 // @ C11_FAILURE_NEEDS_MAGIC_MAP_IN_HAND
};
enum SpellKind {
- kDMSpellKindPotion = 1, // @ C1_SPELL_KIND_POTION
+ kDMSpellKindPotion = 1, // @ C1_SPELL_KIND_POTION
kDMSpellKindProjectile = 2, // @ C2_SPELL_KIND_PROJECTILE
- kDMSpellKindOther = 3, // @ C3_SPELL_KIND_OTHER
- kDMSpellKindMagicMap = 4 // @ C4_SPELL_KIND_MAGIC_MAP
+ kDMSpellKindOther = 3, // @ C3_SPELL_KIND_OTHER
+ kDMSpellKindMagicMap = 4 // @ C4_SPELL_KIND_MAGIC_MAP
};
enum SpellType {
kDMSpellTypeProjectileOpenDoor = 4, // @ C4_SPELL_TYPE_PROJECTILE_OPEN_DOOR
- kDMSpellTypeOtherLight = 0, // @ C0_SPELL_TYPE_OTHER_LIGHT
- kDMSpellTypeOtherDarkness = 1, // @ C1_SPELL_TYPE_OTHER_DARKNESS
- kDMSpellTypeOtherThievesEye = 2, // @ C2_SPELL_TYPE_OTHER_THIEVES_EYE
- kDMSpellTypeOtherInvisibility = 3, // @ C3_SPELL_TYPE_OTHER_INVISIBILITY
- kDMSpellTypeOtherPartyShield = 4, // @ C4_SPELL_TYPE_OTHER_PARTY_SHIELD
- kDMSpellTypeOtherMagicTorch = 5, // @ C5_SPELL_TYPE_OTHER_MAGIC_TORCH
- kDMSpellTypeOtherFootprints = 6, // @ C6_SPELL_TYPE_OTHER_FOOTPRINTS
- kDMSpellTypeOtherZokathra = 7, // @ C7_SPELL_TYPE_OTHER_ZOKATHRA
- kDMSpellTypeOtherFireshield = 8, // @ C8_SPELL_TYPE_OTHER_FIRESHIELD
- kDMSpellTypeMagicMap0 = 0, // @ C0_SPELL_TYPE_MAGIC_MAP
- kDMSpellTypeMagicMap1 = 1, // @ C1_SPELL_TYPE_MAGIC_MAP
- kDMSpellTypeMagicMap2 = 2, // @ C2_SPELL_TYPE_MAGIC_MAP
- kDMSpellTypeMagicMap3 = 3 // @ C3_SPELL_TYPE_MAGIC_MAP
+ kDMSpellTypeOtherLight = 0, // @ C0_SPELL_TYPE_OTHER_LIGHT
+ kDMSpellTypeOtherDarkness = 1, // @ C1_SPELL_TYPE_OTHER_DARKNESS
+ kDMSpellTypeOtherThievesEye = 2, // @ C2_SPELL_TYPE_OTHER_THIEVES_EYE
+ kDMSpellTypeOtherInvisibility = 3, // @ C3_SPELL_TYPE_OTHER_INVISIBILITY
+ kDMSpellTypeOtherPartyShield = 4, // @ C4_SPELL_TYPE_OTHER_PARTY_SHIELD
+ kDMSpellTypeOtherMagicTorch = 5, // @ C5_SPELL_TYPE_OTHER_MAGIC_TORCH
+ kDMSpellTypeOtherFootprints = 6, // @ C6_SPELL_TYPE_OTHER_FOOTPRINTS
+ kDMSpellTypeOtherZokathra = 7, // @ C7_SPELL_TYPE_OTHER_ZOKATHRA
+ kDMSpellTypeOtherFireshield = 8, // @ C8_SPELL_TYPE_OTHER_FIRESHIELD
+ kDMSpellTypeMagicMap0 = 0, // @ C0_SPELL_TYPE_MAGIC_MAP
+ kDMSpellTypeMagicMap1 = 1, // @ C1_SPELL_TYPE_MAGIC_MAP
+ kDMSpellTypeMagicMap2 = 2, // @ C2_SPELL_TYPE_MAGIC_MAP
+ kDMSpellTypeMagicMap3 = 3 // @ C3_SPELL_TYPE_MAGIC_MAP
};
-#define kDMMaskNoSharpDefense 0x0000 // @ MASK0x0000_DO_NOT_USE_SHARP_DEFENSE
-#define kDMMaskSharpDefense 0x8000 // @ MASK0x8000_USE_SHARP_DEFENSE
+#define kDMMaskNoSharpDefense 0x0000 // @ MASK0x0000_DO_NOT_USE_SHARP_DEFENSE
+#define kDMMaskSharpDefense 0x8000 // @ MASK0x8000_USE_SHARP_DEFENSE
class Skill {
public:
int16 _temporaryExperience;
int32 _experience;
-
+
void resetToZero() { _temporaryExperience = _experience = 0; }
}; // @ SKILL
@@ -524,7 +524,7 @@ public:
void addObjectInSlot(ChampionIndex champIndex, Thing thing, ChampionSlot slotIndex); // @ F0301_CHAMPION_AddObjectInSlot
int16 getScentOrdinal(int16 mapX, int16 mapY); // @ F0315_CHAMPION_GetScentOrdinal
Thing getObjectRemovedFromLeaderHand(); // @ F0298_CHAMPION_GetObjectRemovedFromLeaderHand
- uint16 getStrength(int16 champIndex, int16 slotIndex); // @ F0312_CHAMPION_GetStrength
+ uint16 getStrength(int16 champIndex, int16 slotIndex); // @ F0312_CHAMPION_GetStrength
Thing getObjectRemovedFromSlot(uint16 champIndex, uint16 slotIndex); // @ F0300_CHAMPION_GetObjectRemovedFromSlot
void decrementStamina(int16 championIndex, int16 decrement); // @ F0325_CHAMPION_DecrementStamina
int16 addPendingDamageAndWounds_getDamage(int16 champIndex, int16 attack, int16 allowedWounds,
diff --git a/engines/dm/console.cpp b/engines/dm/console.cpp
index c4bef55216..978fadb750 100644
--- a/engines/dm/console.cpp
+++ b/engines/dm/console.cpp
@@ -139,7 +139,7 @@ bool Console::Cmd_pos(int argc, const char** argv) {
Map &currMap = *_vm->_dungeonMan->_currMap;
// not >= because dimensions are inslucsive
- if (x < currMap._offsetMapX || x > currMap._width + currMap._offsetMapX
+ if (x < currMap._offsetMapX || x > currMap._width + currMap._offsetMapX
|| y < currMap._offsetMapY || y > currMap._height + currMap._offsetMapY) {
debugPrintf("Position (%d, %d) is out of bounds, possible values: ([1-%d],[1-%d])\n", x, y,
currMap._width + currMap._offsetMapX, currMap._height + currMap._offsetMapY);
@@ -218,7 +218,7 @@ bool Console::Cmd_listItems(int argc, const char** argv) {
if(strstr(_vm->_objectMan->_objectNames[0], searchedString.c_str()) != nullptr)
debugPrintf("| %s", _vm->_objectMan->_objectNames[0]);
- for (uint16 i = 1; i < k199_ObjectNameCount; ++i) {
+ for (uint16 i = 1; i < kDMObjectNameCount; ++i) {
const char *name = _vm->_objectMan->_objectNames[i - 1];
const char *prevName = _vm->_objectMan->_objectNames[i];
diff --git a/engines/dm/dialog.cpp b/engines/dm/dialog.cpp
index 47888090f9..3fbab203d3 100644
--- a/engines/dm/dialog.cpp
+++ b/engines/dm/dialog.cpp
@@ -43,10 +43,10 @@ void DialogMan::dialogDraw(const char *msg1, const char *msg2, const char *choic
static Box dialog2ChoicesPatch = Box(102, 122, 89, 125);
static Box dialog4ChoicesPatch = Box(102, 122, 62, 97);
- _vm->_displayMan->loadIntoBitmap(k0_dialogBoxGraphicIndice, _vm->_displayMan->_bitmapViewport);
+ _vm->_displayMan->loadIntoBitmap(kDMGraphicIdxDialogBox, _vm->_displayMan->_bitmapViewport);
//Strangerke: the version should be replaced by a ScummVM/RogueVM (?) string
// TODO: replace with ScummVM version string
- _vm->_textMan->printTextToBitmap(_vm->_displayMan->_bitmapViewport, k112_byteWidthViewport, 192, 7, k2_ColorLightGray, k1_ColorDarkGary, "V2.2", k136_heightViewport);
+ _vm->_textMan->printTextToBitmap(_vm->_displayMan->_bitmapViewport, k112_byteWidthViewport, 192, 7, kDMColorLightGray, kDMColorDarkGary, "V2.2", k136_heightViewport);
int16 choiceCount = 1;
if (choice2)
choiceCount++;
@@ -61,16 +61,16 @@ void DialogMan::dialogDraw(const char *msg1, const char *msg2, const char *choic
_vm->_displayMan->startEndFadeToPalette(_vm->_displayMan->_blankBuffer);
if (clearScreen)
- _vm->_displayMan->fillScreen(k0_ColorBlack);
+ _vm->_displayMan->fillScreen(kDMColorBlack);
_vm->_displayMan->_useByteBoxCoordinates = false;
if (choiceCount == 1) {
- _vm->_displayMan->blitToBitmap(_vm->_displayMan->_bitmapViewport, _vm->_displayMan->_bitmapViewport, constBox1, 0, 64, k112_byteWidthViewport, k112_byteWidthViewport, kM1_ColorNoTransparency, k136_heightViewport, k136_heightViewport);
- _vm->_displayMan->blitToBitmap(_vm->_displayMan->_bitmapViewport, _vm->_displayMan->_bitmapViewport, constBox2, 0, 39, k112_byteWidthViewport, k112_byteWidthViewport, kM1_ColorNoTransparency, k136_heightViewport, k136_heightViewport);
- _vm->_displayMan->blitToBitmap(_vm->_displayMan->_bitmapViewport, _vm->_displayMan->_bitmapViewport, constBox3, 0, 14, k112_byteWidthViewport, k112_byteWidthViewport, kM1_ColorNoTransparency, k136_heightViewport, k136_heightViewport);
+ _vm->_displayMan->blitToBitmap(_vm->_displayMan->_bitmapViewport, _vm->_displayMan->_bitmapViewport, constBox1, 0, 64, k112_byteWidthViewport, k112_byteWidthViewport, kDMColorNoTransparency, k136_heightViewport, k136_heightViewport);
+ _vm->_displayMan->blitToBitmap(_vm->_displayMan->_bitmapViewport, _vm->_displayMan->_bitmapViewport, constBox2, 0, 39, k112_byteWidthViewport, k112_byteWidthViewport, kDMColorNoTransparency, k136_heightViewport, k136_heightViewport);
+ _vm->_displayMan->blitToBitmap(_vm->_displayMan->_bitmapViewport, _vm->_displayMan->_bitmapViewport, constBox3, 0, 14, k112_byteWidthViewport, k112_byteWidthViewport, kDMColorNoTransparency, k136_heightViewport, k136_heightViewport);
printCenteredChoice(_vm->_displayMan->_bitmapViewport, choice1, 112, 114);
} else if (choiceCount == 2) {
- _vm->_displayMan->blitToBitmap(_vm->_displayMan->_bitmapViewport, _vm->_displayMan->_bitmapViewport, dialog2ChoicesPatch, 102, 52, k112_byteWidthViewport, k112_byteWidthViewport, kM1_ColorNoTransparency, k136_heightViewport, k136_heightViewport);
+ _vm->_displayMan->blitToBitmap(_vm->_displayMan->_bitmapViewport, _vm->_displayMan->_bitmapViewport, dialog2ChoicesPatch, 102, 52, k112_byteWidthViewport, k112_byteWidthViewport, kDMColorNoTransparency, k136_heightViewport, k136_heightViewport);
printCenteredChoice(_vm->_displayMan->_bitmapViewport, choice1, 112, 77);
printCenteredChoice(_vm->_displayMan->_bitmapViewport, choice2, 112, 114);
} else if (choiceCount == 3) {
@@ -78,7 +78,7 @@ void DialogMan::dialogDraw(const char *msg1, const char *msg2, const char *choic
printCenteredChoice(_vm->_displayMan->_bitmapViewport, choice2, 59, 114);
printCenteredChoice(_vm->_displayMan->_bitmapViewport, choice3, 166, 114);
} else if (choiceCount == 4) {
- _vm->_displayMan->blitToBitmap(_vm->_displayMan->_bitmapViewport, _vm->_displayMan->_bitmapViewport, dialog4ChoicesPatch, 102, 99, k112_byteWidthViewport, k112_byteWidthViewport, kM1_ColorNoTransparency, k136_heightViewport, k136_heightViewport);
+ _vm->_displayMan->blitToBitmap(_vm->_displayMan->_bitmapViewport, _vm->_displayMan->_bitmapViewport, dialog4ChoicesPatch, 102, 99, k112_byteWidthViewport, k112_byteWidthViewport, kDMColorNoTransparency, k136_heightViewport, k136_heightViewport);
printCenteredChoice(_vm->_displayMan->_bitmapViewport, choice1, 59, 77);
printCenteredChoice(_vm->_displayMan->_bitmapViewport, choice2, 166, 77);
printCenteredChoice(_vm->_displayMan->_bitmapViewport, choice3, 59, 114);
@@ -93,14 +93,14 @@ void DialogMan::dialogDraw(const char *msg1, const char *msg2, const char *choic
if (isMessageOnTwoLines(msg1, L1312_ac_StringPart1, L1313_ac_StringPart2)) {
textPosY = 21;
textPosX = 113 - ((strlen(L1312_ac_StringPart1) * 6) >> 1);
- _vm->_textMan->printTextToBitmap(_vm->_displayMan->_bitmapViewport, k112_byteWidthViewport, textPosX, textPosY, k11_ColorYellow, k5_ColorLightBrown, L1312_ac_StringPart1, k136_heightViewport);
+ _vm->_textMan->printTextToBitmap(_vm->_displayMan->_bitmapViewport, k112_byteWidthViewport, textPosX, textPosY, kDMColorYellow, kDMColorLightBrown, L1312_ac_StringPart1, k136_heightViewport);
textPosY += 8;
textPosX = 113 - ((strlen(L1313_ac_StringPart2) * 6) >> 1);
- _vm->_textMan->printTextToBitmap(_vm->_displayMan->_bitmapViewport, k112_byteWidthViewport, textPosX, textPosY, k11_ColorYellow, k5_ColorLightBrown, L1313_ac_StringPart2, k136_heightViewport);
+ _vm->_textMan->printTextToBitmap(_vm->_displayMan->_bitmapViewport, k112_byteWidthViewport, textPosX, textPosY, kDMColorYellow, kDMColorLightBrown, L1313_ac_StringPart2, k136_heightViewport);
textPosY += 8;
} else {
textPosX = 113 - ((strlen(msg1) * 6) >> 1);
- _vm->_textMan->printTextToBitmap(_vm->_displayMan->_bitmapViewport, k112_byteWidthViewport, textPosX, textPosY, k11_ColorYellow, k5_ColorLightBrown, msg1, k136_heightViewport);
+ _vm->_textMan->printTextToBitmap(_vm->_displayMan->_bitmapViewport, k112_byteWidthViewport, textPosX, textPosY, kDMColorYellow, kDMColorLightBrown, msg1, k136_heightViewport);
textPosY += 8;
}
}
@@ -109,23 +109,19 @@ void DialogMan::dialogDraw(const char *msg1, const char *msg2, const char *choic
char L1313_ac_StringPart2[70];
if (isMessageOnTwoLines(msg2, L1312_ac_StringPart1, L1313_ac_StringPart2)) {
textPosX = 113 - ((strlen(L1312_ac_StringPart1) * 6) >> 1);
- _vm->_textMan->printTextToBitmap(_vm->_displayMan->_bitmapViewport, k112_byteWidthViewport, textPosX, textPosY, k9_ColorGold, k5_ColorLightBrown, L1312_ac_StringPart1, k136_heightViewport);
+ _vm->_textMan->printTextToBitmap(_vm->_displayMan->_bitmapViewport, k112_byteWidthViewport, textPosX, textPosY, kDMColorGold, kDMColorLightBrown, L1312_ac_StringPart1, k136_heightViewport);
textPosY += 8;
textPosX = 113 - ((strlen(L1313_ac_StringPart2) * 6) >> 1);
- _vm->_textMan->printTextToBitmap(_vm->_displayMan->_bitmapViewport, k112_byteWidthViewport, textPosX, textPosY, k9_ColorGold, k5_ColorLightBrown, L1313_ac_StringPart2, k136_heightViewport);
+ _vm->_textMan->printTextToBitmap(_vm->_displayMan->_bitmapViewport, k112_byteWidthViewport, textPosX, textPosY, kDMColorGold, kDMColorLightBrown, L1313_ac_StringPart2, k136_heightViewport);
} else {
textPosX = 113 - ((strlen(msg2) * 6) >> 1);
- _vm->_textMan->printTextToBitmap(_vm->_displayMan->_bitmapViewport, k112_byteWidthViewport, textPosX, textPosY, k9_ColorGold, k5_ColorLightBrown, msg2, k136_heightViewport);
+ _vm->_textMan->printTextToBitmap(_vm->_displayMan->_bitmapViewport, k112_byteWidthViewport, textPosX, textPosY, kDMColorGold, kDMColorLightBrown, msg2, k136_heightViewport);
}
}
if (screenDialog) {
- Box displayBox;
- displayBox._y1 = 33;
- displayBox._y2 = 168;
- displayBox._x1 = 47;
- displayBox._x2 = 270;
+ Box displayBox(47, 270, 33, 168);
_vm->_eventMan->showMouse();
- _vm->_displayMan->blitToScreen(_vm->_displayMan->_bitmapViewport, &displayBox, k112_byteWidthViewport, kM1_ColorNoTransparency, k136_heightViewport);
+ _vm->_displayMan->blitToScreen(_vm->_displayMan->_bitmapViewport, &displayBox, k112_byteWidthViewport, kDMColorNoTransparency, k136_heightViewport);
_vm->_eventMan->hideMouse();
} else {
_vm->_displayMan->drawViewport(k0_viewportNotDungeonView);
@@ -142,7 +138,7 @@ void DialogMan::dialogDraw(const char *msg1, const char *msg2, const char *choic
void DialogMan::printCenteredChoice(byte *bitmap, const char *str, int16 posX, int16 posY) {
if (str) {
posX -= (strlen(str) * 6) >> 1;
- _vm->_textMan->printTextToBitmap(bitmap, k112_byteWidthViewport, posX, posY, k9_ColorGold, k5_ColorLightBrown, str, k136_heightViewport);
+ _vm->_textMan->printTextToBitmap(bitmap, k112_byteWidthViewport, posX, posY, kDMColorGold, kDMColorLightBrown, str, k136_heightViewport);
}
}
@@ -179,7 +175,7 @@ int16 DialogMan::getChoice(uint16 choiceCount, uint16 dialogSetIndex, int16 driv
_vm->_eventMan->processCommandQueue();
_vm->delay(1);
_vm->_displayMan->updateScreen();
- if ((_selectedDialogChoice == 99) && (choiceCount == 1)
+ if ((_selectedDialogChoice == 99) && (choiceCount == 1)
&& (eventType != Common::EVENT_INVALID) && key.kbd.keycode == Common::KEYCODE_RETURN) {
/* If a choice has not been made yet with the mouse and the dialog has only one possible choice and carriage return was pressed on the keyboard */
_selectedDialogChoice = kDMDialogChoice1;
@@ -187,64 +183,64 @@ int16 DialogMan::getChoice(uint16 choiceCount, uint16 dialogSetIndex, int16 driv
} while (_selectedDialogChoice == 99);
_vm->_displayMan->_useByteBoxCoordinates = false;
Box boxA = _vm->_eventMan->_primaryMouseInput[_selectedDialogChoice - 1]._hitbox;
- boxA._x1 -= 3;
- boxA._x2 += 3;
- boxA._y1 -= 3;
- boxA._y2 += 4;
+ boxA._rect.left -= 3;
+ boxA._rect.right += 3;
+ boxA._rect.top -= 3;
+ boxA._rect.bottom += 4;
_vm->_eventMan->showMouse();
_vm->_displayMan->_drawFloorAndCeilingRequested = true;
- Box boxB(0, 0, boxA._x2 - boxA._x1 + 3, boxA._y2 - boxA._y1 + 3);
+ Box boxB(0, 0, boxA._rect.right - boxA._rect.left + 3, boxA._rect.bottom - boxA._rect.top + 3);
_vm->_displayMan->blitToBitmap(_vm->_displayMan->_bitmapScreen, _vm->_displayMan->_bitmapViewport,
- boxB, boxA._x1, boxA._y1, k160_byteWidthScreen, k160_byteWidthScreen, kM1_ColorNoTransparency, 200, 25);
+ boxB, boxA._rect.left, boxA._rect.top, k160_byteWidthScreen, k160_byteWidthScreen, kDMColorNoTransparency, 200, 25);
_vm->delay(1);
boxB = boxA;
- boxB._y2 = boxB._y1;
- _vm->_displayMan->fillScreenBox(boxB, k5_ColorLightBrown);
+ boxB._rect.bottom = boxB._rect.top;
+ _vm->_displayMan->fillScreenBox(boxB, kDMColorLightBrown);
boxB = boxA;
- boxB._x2 = boxB._x1;
- boxB._y2--;
- _vm->_displayMan->fillScreenBox(boxB, k5_ColorLightBrown);
+ boxB._rect.right = boxB._rect.left;
+ boxB._rect.bottom--;
+ _vm->_displayMan->fillScreenBox(boxB, kDMColorLightBrown);
boxB = boxA;
- boxB._y2--;
- boxB._y1 = boxB._y2;
- boxB._x1 -= 2;
- _vm->_displayMan->fillScreenBox(boxB, k0_ColorBlack);
+ boxB._rect.bottom--;
+ boxB._rect.top = boxB._rect.bottom;
+ boxB._rect.left -= 2;
+ _vm->_displayMan->fillScreenBox(boxB, kDMColorBlack);
boxB = boxA;
- boxB._x1 = boxB._x2;
- _vm->_displayMan->fillScreenBox(boxB, k0_ColorBlack);
+ boxB._rect.left = boxB._rect.right;
+ _vm->_displayMan->fillScreenBox(boxB, kDMColorBlack);
_vm->delay(2);
boxB = boxA;
- boxB._y1++;
- boxB._y2 = boxB._y1;
- boxB._x2 -= 2;
- _vm->_displayMan->fillScreenBox(boxB, k5_ColorLightBrown);
+ boxB._rect.top++;
+ boxB._rect.bottom = boxB._rect.top;
+ boxB._rect.right -= 2;
+ _vm->_displayMan->fillScreenBox(boxB, kDMColorLightBrown);
boxB = boxA;
- boxB._x1++;
- boxB._x2 = boxB._x1;
- boxB._y2--;
- _vm->_displayMan->fillScreenBox(boxB, k5_ColorLightBrown);
+ boxB._rect.left++;
+ boxB._rect.right = boxB._rect.left;
+ boxB._rect.bottom--;
+ _vm->_displayMan->fillScreenBox(boxB, kDMColorLightBrown);
boxB = boxA;
- boxB._x2--;
- boxB._x1 = boxB._x2;
- _vm->_displayMan->fillScreenBox(boxB, k0_ColorBlack);
+ boxB._rect.right--;
+ boxB._rect.left = boxB._rect.right;
+ _vm->_displayMan->fillScreenBox(boxB, kDMColorBlack);
boxB = boxA;
- boxB._y1 = boxB._y2 = boxB._y2 - 2;
- boxB._x1++;
- _vm->_displayMan->fillScreenBox(boxB, k0_ColorBlack);
+ boxB._rect.top = boxB._rect.bottom = boxB._rect.bottom - 2;
+ boxB._rect.left++;
+ _vm->_displayMan->fillScreenBox(boxB, kDMColorBlack);
boxB = boxA;
- boxB._y1 = boxB._y2 = boxB._y2 + 2;
- boxB._x1--;
- boxB._x2 += 2;
- _vm->_displayMan->fillScreenBox(boxB, k13_ColorLightestGray);
+ boxB._rect.top = boxB._rect.bottom = boxB._rect.bottom + 2;
+ boxB._rect.left--;
+ boxB._rect.right += 2;
+ _vm->_displayMan->fillScreenBox(boxB, kDMColorLightestGray);
boxB = boxA;
- boxB._x1 = boxB._x2 = boxB._x2 + 3;
- boxB._y2 += 2;
- _vm->_displayMan->fillScreenBox(boxB, k13_ColorLightestGray);
+ boxB._rect.left = boxB._rect.right = boxB._rect.right + 3;
+ boxB._rect.bottom += 2;
+ _vm->_displayMan->fillScreenBox(boxB, kDMColorLightestGray);
_vm->delay(2);
- boxA._x2 += 3;
- boxA._y2 += 3;
+ boxA._rect.right += 3;
+ boxA._rect.bottom += 3;
_vm->_displayMan->blitToBitmap(_vm->_displayMan->_bitmapViewport, _vm->_displayMan->_bitmapScreen,
- boxA, 0, 0, k160_byteWidthScreen, k160_byteWidthScreen, kM1_ColorNoTransparency, 25, k200_heightScreen);
+ boxA, 0, 0, k160_byteWidthScreen, k160_byteWidthScreen, kDMColorNoTransparency, 25, k200_heightScreen);
_vm->_eventMan->hideMouse();
_vm->_eventMan->_primaryMouseInput = primaryMouseInputBackup;
_vm->_eventMan->_secondaryMouseInput = secondaryMouseInputBackup;
diff --git a/engines/dm/dm.cpp b/engines/dm/dm.cpp
index f8d8844cea..e9b27246ae 100644
--- a/engines/dm/dm.cpp
+++ b/engines/dm/dm.cpp
@@ -95,12 +95,16 @@ int32 DMEngine::filterTime(int32 mapTime) {
return mapTime & 0x00FFFFFF;
}
-int32 DMEngine::setMapAndTime(int32 &mapTime, uint32 map, uint32 time) {
- return (mapTime) = ((time) | (((long)(map)) << 24));
+int32 DMEngine::setMapAndTime(uint32 map, uint32 time) {
+ return (time | (map << 24));
}
uint16 DMEngine::getMap(int32 mapTime) {
- return ((uint16)((mapTime) >> 24));
+ return ((uint16)(mapTime >> 24));
+}
+
+int32 DMEngine::setMap(int32 mapTime, uint32 map) {
+ return ((mapTime & 0x00FFFFFF) | (map << 24));
}
Thing DMEngine::thingWithNewCell(Thing thing, int16 cell) {
@@ -133,12 +137,11 @@ DMEngine::DMEngine(OSystem *syst, const DMADGameDescription *desc) : Engine(syst
_engineShouldQuit = false;
_dungeonId = 0;
- _newGameFl = 0;
+ _gameMode = kDMModeLoadSavedGame;
_restartGameRequest = false;
_stopWaitingForPlayerInput = true;
_gameTimeTicking = false;
_restartGameAllowed = false;
- _gameId = 0;
_pressingEye = false;
_stopPressingEye = false;
_pressingMouth = false;
@@ -162,6 +165,7 @@ DMEngine::DMEngine(OSystem *syst, const DMADGameDescription *desc) : Engine(syst
_saveThumbnail = nullptr;
_canLoadFromGMM = false;
_loadSaveSlotAtRuntime = -1;
+ _dialog = nullptr;
}
DMEngine::~DMEngine() {
@@ -200,9 +204,9 @@ bool DMEngine::hasFeature(EngineFeature f) const {
Common::Error DMEngine::loadGameState(int slot) {
if (loadgame(slot) != kDMLoadgameFailure) {
- _displayMan->fillScreen(k0_ColorBlack);
+ _displayMan->fillScreen(kDMColorBlack);
_displayMan->startEndFadeToPalette(_displayMan->_palDungeonView[0]);
- _newGameFl = k0_modeLoadSavedGame;
+ _gameMode = kDMModeLoadSavedGame;
startGame();
_restartGameRequest = false;
@@ -256,7 +260,7 @@ void DMEngine::initializeGame() {
if (_engineShouldQuit)
return;
- if (_newGameFl == k0_modeLoadSavedGame) { // if resume was clicked, bring up ScummVM load screen
+ if (_gameMode == kDMModeLoadSavedGame) { // if resume was clicked, bring up ScummVM load screen
GUI::SaveLoadChooser *dialog = new GUI::SaveLoadChooser(_("Restore game:"), _("Restore"), false);
saveSlot = dialog->runModalWithCurrentTarget();
delete dialog;
@@ -264,13 +268,13 @@ void DMEngine::initializeGame() {
}
} while (loadgame(saveSlot) != kDMLoadgameSuccess);
- _displayMan->loadIntoBitmap(k11_MenuSpellAreLinesIndice, _menuMan->_bitmapSpellAreaLines); // @ F0396_MENUS_LoadSpellAreaLinesBitmap
+ _displayMan->loadIntoBitmap(kDMGraphicIdxMenuSpellAreLines, _menuMan->_bitmapSpellAreaLines); // @ F0396_MENUS_LoadSpellAreaLinesBitmap
// There was some memory wizardy for the Amiga platform, I skipped that part
_displayMan->allocateFlippedWallBitmaps();
startGame();
- if (_newGameFl)
+ if (_gameMode != kDMModeLoadSavedGame)
_moveSens->getMoveResult(Thing::_party, kDMMapXNotOnASquare, 0, _dungeonMan->_partyMapX, _dungeonMan->_partyMapY);
_eventMan->showMouse();
_eventMan->discardAllInput();
@@ -309,18 +313,18 @@ void DMEngine::startGame() {
processNewPartyMap(_dungeonMan->_partyMapIndex);
- if (!_newGameFl) {
+ if (_gameMode == kDMModeLoadSavedGame) {
_displayMan->startEndFadeToPalette(_displayMan->_paletteTopAndBottomScreen);
_displayMan->_useByteBoxCoordinates = false;
delay(1);
- _displayMan->fillScreenBox(boxScreenTop, k0_ColorBlack);
- _displayMan->fillScreenBox(boxScreenRight, k0_ColorBlack);
- _displayMan->fillScreenBox(boxScreenBottom, k0_ColorBlack);
+ _displayMan->fillScreenBox(boxScreenTop, kDMColorBlack);
+ _displayMan->fillScreenBox(boxScreenRight, kDMColorBlack);
+ _displayMan->fillScreenBox(boxScreenBottom, kDMColorBlack);
} else {
_displayMan->_useByteBoxCoordinates = false;
- _displayMan->fillScreenBox(boxScreenTop, k0_ColorBlack);
- _displayMan->fillScreenBox(boxScreenRight, k0_ColorBlack);
- _displayMan->fillScreenBox(boxScreenBottom, k0_ColorBlack);
+ _displayMan->fillScreenBox(boxScreenTop, kDMColorBlack);
+ _displayMan->fillScreenBox(boxScreenRight, kDMColorBlack);
+ _displayMan->fillScreenBox(boxScreenBottom, kDMColorBlack);
}
_displayMan->buildPaletteChangeCopperList(_displayMan->_palDungeonView[0], _displayMan->_paletteTopAndBottomScreen);
@@ -416,7 +420,7 @@ void DMEngine::gameloop() {
if (!_inventoryMan->_inventoryChampionOrdinal && !_championMan->_partyIsSleeping) {
Box box(0, 223, 0, 135);
- _displayMan->fillBoxBitmap(_displayMan->_bitmapViewport, box, k0_ColorBlack, k112_byteWidthViewport, k136_heightViewport); // (possibly dummy code)
+ _displayMan->fillBoxBitmap(_displayMan->_bitmapViewport, box, kDMColorBlack, k112_byteWidthViewport, k136_heightViewport); // (possibly dummy code)
_displayMan->drawDungeon(_dungeonMan->_partyDir, _dungeonMan->_partyMapX, _dungeonMan->_partyMapY);
if (_setMousePointerToObjectInMainLoop) {
_setMousePointerToObjectInMainLoop = false;
@@ -513,40 +517,40 @@ void DMEngine::processEntrance() {
_entranceDoorAnimSteps[8] = _entranceDoorAnimSteps[7] + 128 * 161;
_entranceDoorAnimSteps[9] = _entranceDoorAnimSteps[8] + 128 * 161 * 2;
- _displayMan->loadIntoBitmap(k3_entranceRightDoorGraphicIndice, _entranceDoorAnimSteps[4]);
- _displayMan->loadIntoBitmap(k2_entranceLeftDoorGraphicIndice, _entranceDoorAnimSteps[0]);
- _interfaceCredits = _displayMan->getNativeBitmapOrGraphic(k5_creditsGraphicIndice);
+ _displayMan->loadIntoBitmap(kDMGraphicIdxEntranceRightDoor, _entranceDoorAnimSteps[4]);
+ _displayMan->loadIntoBitmap(kDMGraphicIdxEntranceLeftDoor, _entranceDoorAnimSteps[0]);
+ _interfaceCredits = _displayMan->getNativeBitmapOrGraphic(kDMGraphicIdxCredits);
_displayMan->_useByteBoxCoordinates = false;
Box displayBox(0, 100, 0, 160);
for (uint16 idx = 1; idx < 4; idx++) {
- _displayMan->blitToBitmap(_entranceDoorAnimSteps[0], _entranceDoorAnimSteps[idx], displayBox, idx << 2, 0, k64_byteWidth, k64_byteWidth, kM1_ColorNoTransparency, 161, 161);
- displayBox._x2 -= 4;
+ _displayMan->blitToBitmap(_entranceDoorAnimSteps[0], _entranceDoorAnimSteps[idx], displayBox, idx << 2, 0, k64_byteWidth, k64_byteWidth, kDMColorNoTransparency, 161, 161);
+ displayBox._rect.right -= 4;
}
- displayBox._x2 = 127;
+ displayBox._rect.right = 127;
for (uint16 idx = 5; idx < 8; idx++) {
- displayBox._x1 += 4;
- _displayMan->blitToBitmap(_entranceDoorAnimSteps[4], _entranceDoorAnimSteps[idx], displayBox, 0, 0, k64_byteWidth, k64_byteWidth, kM1_ColorNoTransparency, 161, 161);
+ displayBox._rect.left += 4;
+ _displayMan->blitToBitmap(_entranceDoorAnimSteps[4], _entranceDoorAnimSteps[idx], displayBox, 0, 0, k64_byteWidth, k64_byteWidth, kDMColorNoTransparency, 161, 161);
}
do {
drawEntrance();
_eventMan->showMouse();
_eventMan->discardAllInput();
- _newGameFl = k99_modeWaitingOnEntrance;
+ _gameMode = kDMModeWaitingOnEntrance;
do {
_eventMan->processInput();
if (_engineShouldQuit)
return;
_eventMan->processCommandQueue();
_displayMan->updateScreen();
- } while (_newGameFl == k99_modeWaitingOnEntrance);
- } while (_newGameFl == kDMCommandEntranceDrawCredits);
+ } while (_gameMode == kDMModeWaitingOnEntrance);
+ } while (_gameMode == kDMModeEntranceDrawCredits);
//Strangerke: CHECKME: Earlier versions were using G0566_puc_Graphic534_Sound01Switch
- _sound->play(k01_soundSWITCH, 112, 0x40, 0x40);
+ _sound->play(kDMSoundIndexSwitch, 112, 0x40, 0x40);
delay(20);
_eventMan->showMouse();
- if (_newGameFl)
+ if (_gameMode != kDMModeLoadSavedGame)
openEntranceDoors();
delete[] _entranceDoorAnimSteps[0];
@@ -596,7 +600,7 @@ void DMEngine::endGame(bool doNotDrawCreditsOnly) {
_eventMan->_primaryKeyboardInput = nullptr;
_eventMan->_secondaryKeyboardInput = nullptr;
if (doNotDrawCreditsOnly && !_gameWon) {
- _sound->requestPlay(k06_soundSCREAM, _dungeonMan->_partyMapX, _dungeonMan->_partyMapY, kDMSoundModePlayImmediately);
+ _sound->requestPlay(kDMSoundIndexScream, _dungeonMan->_partyMapX, _dungeonMan->_partyMapY, kDMSoundModePlayImmediately);
delay(240);
}
@@ -622,39 +626,39 @@ void DMEngine::endGame(bool doNotDrawCreditsOnly) {
if (doNotDrawCreditsOnly) {
if (_gameWon) {
// Strangerke: Related to portraits. Game data could be missing for earlier versions of the game.
- _displayMan->fillScreen(k12_ColorDarkestGray);
+ _displayMan->fillScreen(kDMColorDarkestGray);
for (int16 championIndex = kDMChampionFirst; championIndex < _championMan->_partyChampionCount; championIndex++) {
int16 textPosY = championIndex * 48;
Champion *curChampion = &_championMan->_champions[championIndex];
- _displayMan->blitToScreen(_displayMan->getNativeBitmapOrGraphic(k208_wallOrn_43_champMirror), &championMirrorBox, k32_byteWidth, k10_ColorFlesh, 43);
- _displayMan->blitToScreen(curChampion->_portrait, &championPortraitBox, k16_byteWidth, k1_ColorDarkGary, 29);
- _textMan->printEndGameString(87, textPosY += 14, k9_ColorGold, curChampion->_name);
+ _displayMan->blitToScreen(_displayMan->getNativeBitmapOrGraphic(kDMGraphicIdxWallOrnChampMirror), &championMirrorBox, k32_byteWidth, kDMColorFlesh, 43);
+ _displayMan->blitToScreen(curChampion->_portrait, &championPortraitBox, k16_byteWidth, kDMColorDarkGary, 29);
+ _textMan->printEndGameString(87, textPosY += 14, kDMColorGold, curChampion->_name);
int textPosX = (6 * strlen(curChampion->_name)) + 87;
char championTitleFirstCharacter = curChampion->_title[0];
if ((championTitleFirstCharacter != ',') && (championTitleFirstCharacter != ';') && (championTitleFirstCharacter != '-'))
textPosX += 6;
- _textMan->printEndGameString(textPosX, textPosY++, k9_ColorGold, curChampion->_title);
+ _textMan->printEndGameString(textPosX, textPosY++, kDMColorGold, curChampion->_title);
for (int16 idx = kDMSkillFighter; idx <= kDMSkillWizard; idx++) {
uint16 skillLevel = MIN<uint16>(16, _championMan->getSkillLevel(championIndex, idx | (kDMIgnoreObjectModifiers | kDMIgnoreTemporaryExperience)));
if (skillLevel == 1)
continue;
Common::String displStr = Common::String::format("%s %s", _inventoryMan->_skillLevelNames[skillLevel - 2], _championMan->_baseSkillName[idx]);
- _textMan->printEndGameString(105, textPosY = textPosY + 8, k13_ColorLightestGray, displStr.c_str());
+ _textMan->printEndGameString(105, textPosY = textPosY + 8, kDMColorLightestGray, displStr.c_str());
}
- championMirrorBox._y1 += 48;
- championMirrorBox._y2 += 48;
- championPortraitBox._y1 += 48;
- championPortraitBox._y1 += 48;
+ championMirrorBox._rect.top += 48;
+ championMirrorBox._rect.bottom += 48;
+ championPortraitBox._rect.top += 48;
+ championPortraitBox._rect.top += 48;
}
_displayMan->startEndFadeToPalette(_displayMan->_paletteTopAndBottomScreen);
_engineShouldQuit = true;
return;
}
T0444017:
- _displayMan->fillScreen(k0_ColorBlack);
- _displayMan->blitToScreen(_displayMan->getNativeBitmapOrGraphic(k6_theEndIndice), &theEndBox, k40_byteWidth, kM1_ColorNoTransparency, 14);
+ _displayMan->fillScreen(kDMColorBlack);
+ _displayMan->blitToScreen(_displayMan->getNativeBitmapOrGraphic(kDMGraphicIdxTheEnd), &theEndBox, k40_byteWidth, kDMColorNoTransparency, 14);
for (uint16 i = 0; i < 16; ++i)
darkBluePalette[i] = D01_RGB_DARK_BLUE;
uint16 curPalette[16];
@@ -668,19 +672,19 @@ T0444017:
if (_restartGameAllowed) {
_displayMan->_useByteBoxCoordinates = false;
- _displayMan->fillScreenBox(restartOuterBox, k12_ColorDarkestGray);
- _displayMan->fillScreenBox(restartInnerBox, k0_ColorBlack);
+ _displayMan->fillScreenBox(restartOuterBox, kDMColorDarkestGray);
+ _displayMan->fillScreenBox(restartInnerBox, kDMColorBlack);
switch (getGameLanguage()) { // localized
default:
case Common::EN_ANY:
- _textMan->printToLogicalScreen(110, 154, k4_ColorCyan, k0_ColorBlack, "RESTART THIS GAME");
+ _textMan->printToLogicalScreen(110, 154, kDMColorCyan, kDMColorBlack, "RESTART THIS GAME");
break;
case Common::DE_DEU:
- _textMan->printToLogicalScreen(110, 154, k4_ColorCyan, k0_ColorBlack, "DIESES SPIEL NEU STARTEN");
+ _textMan->printToLogicalScreen(110, 154, kDMColorCyan, kDMColorBlack, "DIESES SPIEL NEU STARTEN");
break;
case Common::FR_FRA:
- _textMan->printToLogicalScreen(110, 154, k4_ColorCyan, k0_ColorBlack, "RECOMMENCER CE JEU");
+ _textMan->printToLogicalScreen(110, 154, kDMColorCyan, kDMColorBlack, "RECOMMENCER CE JEU");
break;
}
@@ -696,9 +700,9 @@ T0444017:
_eventMan->showMouse();
if (_restartGameRequest) {
_displayMan->startEndFadeToPalette(darkBluePalette);
- _displayMan->fillScreen(k0_ColorBlack);
+ _displayMan->fillScreen(kDMColorBlack);
_displayMan->startEndFadeToPalette(_displayMan->_palDungeonView[0]);
- _newGameFl = k0_modeLoadSavedGame;
+ _gameMode = kDMModeLoadSavedGame;
if (loadgame(1) != kDMLoadgameFailure) {
startGame();
_restartGameRequest = false;
@@ -712,7 +716,7 @@ T0444017:
_displayMan->startEndFadeToPalette(darkBluePalette);
}
Box box(0, 319, 0, 199);
- _displayMan->blitToScreen(_displayMan->getNativeBitmapOrGraphic(k5_creditsGraphicIndice), &box, k160_byteWidthScreen, kM1_ColorNoTransparency, k200_heightScreen);
+ _displayMan->blitToScreen(_displayMan->getNativeBitmapOrGraphic(kDMGraphicIdxCredits), &box, k160_byteWidthScreen, kDMColorNoTransparency, k200_heightScreen);
_displayMan->startEndFadeToPalette(_displayMan->_palCredits);
_eventMan->waitForMouseOrKeyActivity();
@@ -760,47 +764,47 @@ void DMEngine::drawEntrance() {
_displayMan->startEndFadeToPalette(_displayMan->_blankBuffer);
// note, a global variable is used here in the original
- _displayMan->loadIntoBitmap(k4_entranceGraphicIndice, _displayMan->_bitmapScreen);
+ _displayMan->loadIntoBitmap(kDMGraphicIdxEntrance, _displayMan->_bitmapScreen);
_displayMan->drawDungeon(kDMDirSouth, 2, 0);
if (!_savedScreenForOpenEntranceDoors)
_savedScreenForOpenEntranceDoors = new byte[k200_heightScreen * k160_byteWidthScreen * 2];
memcpy(_savedScreenForOpenEntranceDoors, _displayMan->_bitmapScreen, 320 * 200);
- _displayMan->_useByteBoxCoordinates = false, _displayMan->blitToBitmap(_displayMan->_bitmapScreen, _entranceDoorAnimSteps[8], doorsUpperHalfBox, 0, 30, k160_byteWidthScreen, k128_byteWidth, kM1_ColorNoTransparency, 200, 161);
- _displayMan->_useByteBoxCoordinates = false, _displayMan->blitToBitmap(_displayMan->_bitmapScreen, _entranceDoorAnimSteps[8], doorsLowerHalfBox, 0, 111, k160_byteWidthScreen, k128_byteWidth, kM1_ColorNoTransparency, 200, 161);
+ _displayMan->_useByteBoxCoordinates = false, _displayMan->blitToBitmap(_displayMan->_bitmapScreen, _entranceDoorAnimSteps[8], doorsUpperHalfBox, 0, 30, k160_byteWidthScreen, k128_byteWidth, kDMColorNoTransparency, 200, 161);
+ _displayMan->_useByteBoxCoordinates = false, _displayMan->blitToBitmap(_displayMan->_bitmapScreen, _entranceDoorAnimSteps[8], doorsLowerHalfBox, 0, 111, k160_byteWidthScreen, k128_byteWidth, kDMColorNoTransparency, 200, 161);
- _displayMan->blitToScreen(_entranceDoorAnimSteps[0], &closedDoorLeftBox, k64_byteWidth, kM1_ColorNoTransparency, 161);
- _displayMan->blitToScreen(_entranceDoorAnimSteps[4], &closedDoorRightBox, k64_byteWidth, kM1_ColorNoTransparency, 161);
+ _displayMan->blitToScreen(_entranceDoorAnimSteps[0], &closedDoorLeftBox, k64_byteWidth, kDMColorNoTransparency, 161);
+ _displayMan->blitToScreen(_entranceDoorAnimSteps[4], &closedDoorRightBox, k64_byteWidth, kDMColorNoTransparency, 161);
_displayMan->startEndFadeToPalette(palEntrance);
}
void DMEngine::openEntranceDoors() {
Box rightDoorBox(109, 231, 30, 193);
- byte *rightDoorBitmap = _displayMan->getNativeBitmapOrGraphic(k3_entranceRightDoorGraphicIndice);
+ byte *rightDoorBitmap = _displayMan->getNativeBitmapOrGraphic(kDMGraphicIdxEntranceRightDoor);
Box leftDoorBox(0, 100, 30, 193);
uint16 leftDoorBlitFrom = 0;
- byte *leftDoorBitmap = _displayMan->getNativeBitmapOrGraphic(k2_entranceLeftDoorGraphicIndice);
+ byte *leftDoorBitmap = _displayMan->getNativeBitmapOrGraphic(kDMGraphicIdxEntranceLeftDoor);
Box screenBox(0, 319, 0, 199);
for (uint16 animStep = 1; animStep < 32; ++animStep) {
if ((animStep % 3) == 1) {
// Strangerke: CHECKME: Earlier versions of the game were using G0565_puc_Graphic535_Sound02DoorRattle instead of k02_soundDOOR_RATTLE 2
- _sound->play(k02_soundDOOR_RATTLE, 145, 0x40, 0x40);
+ _sound->play(kDMSoundIndexDoorRattle, 145, 0x40, 0x40);
}
- _displayMan->blitToScreen(_savedScreenForOpenEntranceDoors, &screenBox, 160, kM1_ColorNoTransparency, 200);
+ _displayMan->blitToScreen(_savedScreenForOpenEntranceDoors, &screenBox, 160, kDMColorNoTransparency, 200);
_displayMan->blitToBitmap(leftDoorBitmap, _displayMan->_bitmapScreen, leftDoorBox, leftDoorBlitFrom, 0, 64, k160_byteWidthScreen,
- kM1_ColorNoTransparency, 161, k200_heightScreen);
+ kDMColorNoTransparency, 161, k200_heightScreen);
_displayMan->blitToBitmap(rightDoorBitmap, _displayMan->_bitmapScreen, rightDoorBox, 0, 0, 64, k160_byteWidthScreen,
- kM1_ColorNoTransparency, 161, k200_heightScreen);
+ kDMColorNoTransparency, 161, k200_heightScreen);
_eventMan->discardAllInput();
_displayMan->updateScreen();
- leftDoorBox._x2 -= 4;
+ leftDoorBox._rect.right -= 4;
leftDoorBlitFrom += 4;
- rightDoorBox._x1 += 4;
+ rightDoorBox._rect.left += 4;
delay(3);
}
@@ -819,7 +823,7 @@ void DMEngine::drawTittle() {
byte *allocatedMem = new byte[145600 * 2];
byte *titleSteps = allocatedMem;
byte *bitmapTitle = titleSteps;
- _displayMan->loadIntoBitmap(k1_titleGraphicsIndice, titleSteps);
+ _displayMan->loadIntoBitmap(kDMGraphicIdxTitle, titleSteps);
titleSteps += 320 * 200;
uint16 blitPalette[16];
@@ -827,16 +831,16 @@ void DMEngine::drawTittle() {
blitPalette[i] = D01_RGB_DARK_BLUE;
_displayMan->startEndFadeToPalette(blitPalette);
- _displayMan->fillScreen(k0_ColorBlack);
+ _displayMan->fillScreen(kDMColorBlack);
// uncomment this to draw 'Presents'
//_displayMan->f132_blitToBitmap(L1384_puc_Bitmap_Title, _displayMan->_g348_bitmapScreen, G0005_s_Graphic562_Box_Title_Presents, 0, 137, k160_byteWidthScreen, k160_byteWidthScreen, kM1_ColorNoTransparency, k200_heightScreen, k200_heightScreen);
blitPalette[15] = D09_RGB_WHITE;
_displayMan->startEndFadeToPalette(blitPalette);
byte *masterStrikesBack = titleSteps;
- _displayMan->blitToBitmap(bitmapTitle, masterStrikesBack, boxTitleStrikesBackSource, 0, 80, k160_byteWidthScreen, k160_byteWidthScreen, kM1_ColorNoTransparency, 200, 57);
+ _displayMan->blitToBitmap(bitmapTitle, masterStrikesBack, boxTitleStrikesBackSource, 0, 80, k160_byteWidthScreen, k160_byteWidthScreen, kDMColorNoTransparency, 200, 57);
titleSteps += 320 * 57;
byte *bitmapDungeonChaos = titleSteps; /* Unreferenced on Atari ST */
- _displayMan->blitToBitmap(bitmapTitle, bitmapDungeonChaos, boxTitleDungeonChaos, 0, 0, k160_byteWidthScreen, k160_byteWidthScreen, kM1_ColorNoTransparency, 200, 80);
+ _displayMan->blitToBitmap(bitmapTitle, bitmapDungeonChaos, boxTitleDungeonChaos, 0, 0, k160_byteWidthScreen, k160_byteWidthScreen, kDMColorNoTransparency, 200, 80);
titleSteps += 320 * 80;
bitmapTitle = bitmapDungeonChaos;
uint16 destinationHeight = 12;
@@ -856,7 +860,7 @@ void DMEngine::drawTittle() {
}
blitPalette[15] = D01_RGB_DARK_BLUE;
_displayMan->startEndFadeToPalette(blitPalette);
- _displayMan->fillScreen(k0_ColorBlack);
+ _displayMan->fillScreen(kDMColorBlack);
blitPalette[3] = D05_RGB_DARK_GOLD;
blitPalette[4] = D02_RGB_LIGHT_BROWN;
blitPalette[5] = D06_RGB_GOLD;
@@ -869,11 +873,11 @@ void DMEngine::drawTittle() {
delay(1);
for (int16 i = 0; i < 18; i++) {
delay(2);
- Box box(blitCoordinates[i]);
- _displayMan->blitToBitmap(shrinkedTitle[i], _displayMan->_bitmapScreen, box, 0, 0, blitCoordinates[i][4], k160_byteWidthScreen, kM1_ColorNoTransparency, blitCoordinates[i][3] - blitCoordinates[i][2] + 1, k200_heightScreen);
+ Box box(blitCoordinates[i][0], blitCoordinates[i][1], blitCoordinates[i][2], blitCoordinates[i][3]);
+ _displayMan->blitToBitmap(shrinkedTitle[i], _displayMan->_bitmapScreen, box, 0, 0, blitCoordinates[i][4], k160_byteWidthScreen, kDMColorNoTransparency, blitCoordinates[i][3] - blitCoordinates[i][2] + 1, k200_heightScreen);
}
delay(25);
- _displayMan->blitToBitmap(masterStrikesBack, _displayMan->_bitmapScreen, boxTitleStrikesBackDestination, 0, 0, k160_byteWidthScreen, k160_byteWidthScreen, k0_ColorBlack, 57, k200_heightScreen);
+ _displayMan->blitToBitmap(masterStrikesBack, _displayMan->_bitmapScreen, boxTitleStrikesBackDestination, 0, 0, k160_byteWidthScreen, k160_byteWidthScreen, kDMColorBlack, 57, k200_heightScreen);
blitPalette[10] = D00_RGB_BLACK;
blitPalette[12] = D07_RGB_RED;
_displayMan->startEndFadeToPalette(blitPalette);
@@ -884,11 +888,11 @@ void DMEngine::drawTittle() {
void DMEngine::entranceDrawCredits() {
_eventMan->showMouse();
_displayMan->startEndFadeToPalette(_displayMan->_blankBuffer);
- _displayMan->loadIntoBitmap(k5_creditsGraphicIndice, _displayMan->_bitmapScreen);
+ _displayMan->loadIntoBitmap(kDMGraphicIdxCredits, _displayMan->_bitmapScreen);
_displayMan->startEndFadeToPalette(_displayMan->_palCredits);
delay(50);
_eventMan->waitForMouseOrKeyActivity();
- _newGameFl = k202_modeEntranceDrawCredits;
+ _gameMode = kDMModeEntranceDrawCredits;
}
void DMEngine::fuseSequence() {
@@ -908,7 +912,7 @@ void DMEngine::fuseSequence() {
Thing lordChaosThing = _groupMan->groupGetThing(lordChaosMapX, lordChaosMapY);
Group *lordGroup = (Group*)_dungeonMan->getThingData(lordChaosThing);
lordGroup->_health[0] = 10000;
- _dungeonMan->setGroupCells(lordGroup, k255_CreatureTypeSingleCenteredCreature, _dungeonMan->_partyMapIndex);
+ _dungeonMan->setGroupCells(lordGroup, kDMCreatureTypeSingleCenteredCreature, _dungeonMan->_partyMapIndex);
_dungeonMan->setGroupDirections(lordGroup, returnOppositeDir(_dungeonMan->_partyDir), _dungeonMan->_partyMapIndex);
bool removeFluxcagesFromLordChaosSquare = true;
@@ -937,28 +941,28 @@ void DMEngine::fuseSequence() {
}
fuseSequenceUpdate();
for (int16 attackId = 55; attackId <= 255; attackId += 40) {
- _projexpl->createExplosion(Thing::_explFireBall, attackId, lordChaosMapX, lordChaosMapY, k255_CreatureTypeSingleCenteredCreature);
+ _projexpl->createExplosion(Thing::_explFireBall, attackId, lordChaosMapX, lordChaosMapY, kDMCreatureTypeSingleCenteredCreature);
fuseSequenceUpdate();
}
- _sound->requestPlay(k17_soundBUZZ, lordChaosMapX, lordChaosMapY, kDMSoundModePlayIfPrioritized);
- lordGroup->_type = k25_CreatureTypeLordOrder;
+ _sound->requestPlay(kDMSoundIndexBuzz, lordChaosMapX, lordChaosMapY, kDMSoundModePlayIfPrioritized);
+ lordGroup->_type = kDMCreatureTypeLordOrder;
fuseSequenceUpdate();
for (int16 attackId = 55; attackId <= 255; attackId += 40) {
- _projexpl->createExplosion(Thing::_explHarmNonMaterial, attackId, lordChaosMapX, lordChaosMapY, k255_CreatureTypeSingleCenteredCreature);
+ _projexpl->createExplosion(Thing::_explHarmNonMaterial, attackId, lordChaosMapX, lordChaosMapY, kDMCreatureTypeSingleCenteredCreature);
fuseSequenceUpdate();
}
for (int16 cycleCount = 3; cycleCount > 0; cycleCount--) {
for (int16 switchCount = 4; switchCount > 0; switchCount--) {
- _sound->requestPlay(k17_soundBUZZ, lordChaosMapX, lordChaosMapY, kDMSoundModePlayIfPrioritized);
- lordGroup->_type = (switchCount & 0x0001) ? k25_CreatureTypeLordOrder : k23_CreatureTypeLordChaos;
+ _sound->requestPlay(kDMSoundIndexBuzz, lordChaosMapX, lordChaosMapY, kDMSoundModePlayIfPrioritized);
+ lordGroup->_type = (switchCount & 0x0001) ? kDMCreatureTypeLordOrder : kDMCreatureTypeLordChaos;
for (int16 fuseSequenceUpdateCount = cycleCount - 1; fuseSequenceUpdateCount >= 0; fuseSequenceUpdateCount--)
fuseSequenceUpdate();
}
}
- _projexpl->createExplosion(Thing::_explFireBall, 255, lordChaosMapX, lordChaosMapY, k255_CreatureTypeSingleCenteredCreature);
- _projexpl->createExplosion(Thing::_explHarmNonMaterial, 255, lordChaosMapX, lordChaosMapY, k255_CreatureTypeSingleCenteredCreature);
+ _projexpl->createExplosion(Thing::_explFireBall, 255, lordChaosMapX, lordChaosMapY, kDMCreatureTypeSingleCenteredCreature);
+ _projexpl->createExplosion(Thing::_explHarmNonMaterial, 255, lordChaosMapX, lordChaosMapY, kDMCreatureTypeSingleCenteredCreature);
fuseSequenceUpdate();
- lordGroup->_type = k26_CreatureTypeGreyLord;
+ lordGroup->_type = kDMCreatureTypeGreyLord;
fuseSequenceUpdate();
_displayMan->_doNotDrawFluxcagesDuringEndgame = true;
fuseSequenceUpdate();
@@ -990,7 +994,7 @@ void DMEngine::fuseSequence() {
if (decodedString[1] == textFirstChar) {
_textMan->clearAllRows();
decodedString[1] = '\n'; /* New line */
- _textMan->printMessage(k15_ColorWhite, &decodedString[1]);
+ _textMan->printMessage(kDMColorWhite, &decodedString[1]);
fuseSequenceUpdate();
delay(780);
textFirstChar++;
@@ -1000,7 +1004,7 @@ void DMEngine::fuseSequence() {
}
for (int16 attackId = 55; attackId <= 255; attackId += 40) {
- _projexpl->createExplosion(Thing::_explHarmNonMaterial, attackId, lordChaosMapX, lordChaosMapY, k255_CreatureTypeSingleCenteredCreature);
+ _projexpl->createExplosion(Thing::_explHarmNonMaterial, attackId, lordChaosMapX, lordChaosMapY, kDMCreatureTypeSingleCenteredCreature);
fuseSequenceUpdate();
}
diff --git a/engines/dm/dm.h b/engines/dm/dm.h
index 0a73c05ff0..6549db13b5 100644
--- a/engines/dm/dm.h
+++ b/engines/dm/dm.h
@@ -76,11 +76,11 @@ enum OriginalSavePlatform {
kDMSavePlatformAcceptAny = -1,
kDMSavePlatformEndOfList = 0,
kDMSavePlatformNone = 0,
- kDMSavePlatformAtariSt = 1, // @ C1_PLATFORM_ATARI_ST
- kDMSavePlatformAppleIIgs = 2, // @ C2_PLATFORM_APPLE_IIGS
- kDMSavePlatformAmiga = 3, // @ C3_PLATFORM_AMIGA
- kDMSavePlatformPC98 = 5, // @ C5_PLATFORM_PC98
- kDMSavePlatformX68000 = 6, // @ C6_PLATFORM_X68000
+ kDMSavePlatformAtariSt = 1, // @ C1_PLATFORM_ATARI_ST
+ kDMSavePlatformAppleIIgs = 2, // @ C2_PLATFORM_APPLE_IIGS
+ kDMSavePlatformAmiga = 3, // @ C3_PLATFORM_AMIGA
+ kDMSavePlatformPC98 = 5, // @ C5_PLATFORM_PC98
+ kDMSavePlatformX68000 = 6, // @ C6_PLATFORM_X68000
kDMSavePlatformFmTownsEN = 7, // @ C7_PLATFORM_FM_TOWNS_EN
kDMSavePlatformFmTownsJP = 8, // @ C8_PLATFORM_FM_TOWNS_JP
kDMSavePlatformPC = 9, // @ C9_PLATFORM_PC
@@ -104,35 +104,35 @@ enum Direction {
enum ThingType {
kDMThingTypeParty = -1, // @ CM1_THING_TYPE_PARTY
- kDMThingTypeDoor = 0, // @ C00_THING_TYPE_DOOR
- kDMThingTypeTeleporter = 1, // @ C01_THING_TYPE_TELEPORTER
- kDMstringTypeText = 2, // @ C02_THING_TYPE_TEXTSTRING
- kDMThingTypeSensor = 3, // @ C03_THING_TYPE_SENSOR
- kDMThingTypeGroup = 4, // @ C04_THING_TYPE_GROUP
+ kDMThingTypeDoor = 0, // @ C00_THING_TYPE_DOOR
+ kDMThingTypeTeleporter = 1, // @ C01_THING_TYPE_TELEPORTER
+ kDMstringTypeText = 2, // @ C02_THING_TYPE_TEXTSTRING
+ kDMThingTypeSensor = 3, // @ C03_THING_TYPE_SENSOR
+ kDMThingTypeGroup = 4, // @ C04_THING_TYPE_GROUP
kDMThingTypeWeapon = 5, // @ C05_THING_TYPE_WEAPON
kDMThingTypeArmour = 6, // @ C06_THING_TYPE_ARMOUR
- kDMThingTypeScroll = 7, // @ C07_THING_TYPE_SCROLL
- kDMThingTypePotion = 8, // @ C08_THING_TYPE_POTION
- kDMThingTypeContainer = 9, // @ C09_THING_TYPE_CONTAINER
- kDMThingTypeJunk = 10, // @ C10_THING_TYPE_JUNK
+ kDMThingTypeScroll = 7, // @ C07_THING_TYPE_SCROLL
+ kDMThingTypePotion = 8, // @ C08_THING_TYPE_POTION
+ kDMThingTypeContainer = 9, // @ C09_THING_TYPE_CONTAINER
+ kDMThingTypeJunk = 10, // @ C10_THING_TYPE_JUNK
kDMThingTypeProjectile = 14, // @ C14_THING_TYPE_PROJECTILE
- kDMThingTypeExplosion = 15, // @ C15_THING_TYPE_EXPLOSION
+ kDMThingTypeExplosion = 15, // @ C15_THING_TYPE_EXPLOSION
kDMThingTypeTotal = 16 // +1 than the last (explosionThingType)
}; // @ C[00..15]_THING_TYPE_...
enum Cell {
- kDMCellAny = -1, // @ CM1_CELL_ANY
- kDMCellNorthWest = 0, // @ C00_CELL_NORTHWEST
- kDMCellNorthEast = 1, // @ C01_CELL_NORTHEAST
- kDMCellSouthEast = 2, // @ C02_CELL_SOUTHEAST
- kDMCellSouthWest = 3 // @ C03_CELL_SOUTHWEST
+ kDMCellAny = -1, // @ CM1_CELL_ANY
+ kDMCellNorthWest = 0, // @ C00_CELL_NORTHWEST
+ kDMCellNorthEast = 1, // @ C01_CELL_NORTHEAST
+ kDMCellSouthEast = 2, // @ C02_CELL_SOUTHEAST
+ kDMCellSouthWest = 3 // @ C03_CELL_SOUTHWEST
};
enum GameMode {
- k0_modeLoadSavedGame = 0, // @ C000_MODE_LOAD_SAVED_GAME
- k1_modeLoadDungeon = 1, // @ C001_MODE_LOAD_DUNGEON
- k99_modeWaitingOnEntrance = 99, // @ C099_MODE_WAITING_ON_ENTRANCE
- k202_modeEntranceDrawCredits = 202 // @ C202_MODE_ENTRANCE_DRAW_CREDITS
+ kDMModeLoadSavedGame = 0, // @ C000_MODE_LOAD_SAVED_GAME
+ kDMModeLoadDungeon = 1, // @ C001_MODE_LOAD_DUNGEON
+ kDMModeWaitingOnEntrance = 99, // @ C099_MODE_WAITING_ON_ENTRANCE
+ kDMModeEntranceDrawCredits = 202 // @ C202_MODE_ENTRANCE_DRAW_CREDITS
};
enum LoadgameResult {
@@ -141,13 +141,17 @@ enum LoadgameResult {
};
enum MapIndice {
- kDMMapIndexNone = -1, // @ CM1_MAP_INDEX_NONE
- kDMMapIndexEntrance = 255 // @ C255_MAP_INDEX_ENTRANCE
+ kDMMapIndexNone = -1, // @ CM1_MAP_INDEX_NONE
+ kDMMapIndexEntrance = 255 // @ C255_MAP_INDEX_ENTRANCE
};
#define kDMMaskDecodeEvenIfInvisible 0x8000 // @ MASK0x8000_DECODE_EVEN_IF_INVISIBLE
#define kDMMaskMergeCycles 0x8000 // @ MASK0x8000_MERGE_CYCLES
+#define kDMSlotBoxInventoryFirstSlot 8 // @ C08_SLOT_BOX_INVENTORY_FIRST_SLOT
+#define kDMSlotBoxInventoryActionHand 9 // @ C09_SLOT_BOX_INVENTORY_ACTION_HAND
+#define kDMSlotBoxChestFirstSlot 38 // @ C38_SLOT_BOX_CHEST_FIRST_SLOT
+
struct DMADGameDescription {
ADGameDescription _desc;
@@ -165,19 +169,19 @@ public:
uint16 _data;
static const Thing _none; // @ C0xFFFF_THING_NONE
static const Thing _endOfList; // @ C0xFFFE_THING_ENDOFLIST
- static const Thing _firstExplosion; // @ C0xFF80_THING_FIRST_EXPLOSION
- static const Thing _explFireBall; // @ C0xFF80_THING_EXPLOSION_FIREBALL
- static const Thing _explSlime; // @ C0xFF81_THING_EXPLOSION_SLIME
- static const Thing _explLightningBolt; // @ C0xFF82_THING_EXPLOSION_LIGHTNING_BOLT
+ static const Thing _firstExplosion; // @ C0xFF80_THING_FIRST_EXPLOSION
+ static const Thing _explFireBall; // @ C0xFF80_THING_EXPLOSION_FIREBALL
+ static const Thing _explSlime; // @ C0xFF81_THING_EXPLOSION_SLIME
+ static const Thing _explLightningBolt; // @ C0xFF82_THING_EXPLOSION_LIGHTNING_BOLT
static const Thing _explHarmNonMaterial; // @ C0xFF83_THING_EXPLOSION_HARM_NON_MATERIAL
- static const Thing _explOpenDoor; // @ C0xFF84_THING_EXPLOSION_OPEN_DOOR
- static const Thing _explPoisonBolt; // @ C0xFF86_THING_EXPLOSION_POISON_BOLT
- static const Thing _explPoisonCloud; // @ C0xFF87_THING_EXPLOSION_POISON_CLOUD
- static const Thing _explSmoke; // @ C0xFFA8_THING_EXPLOSION_SMOKE
- static const Thing _explFluxcage; // @ C0xFFB2_THING_EXPLOSION_FLUXCAGE
- static const Thing _explRebirthStep1; // @ C0xFFE4_THING_EXPLOSION_REBIRTH_STEP1
- static const Thing _explRebirthStep2; // @ C0xFFE5_THING_EXPLOSION_REBIRTH_STEP2
- static const Thing _party; // @ C0xFFFF_THING_PARTY
+ static const Thing _explOpenDoor; // @ C0xFF84_THING_EXPLOSION_OPEN_DOOR
+ static const Thing _explPoisonBolt; // @ C0xFF86_THING_EXPLOSION_POISON_BOLT
+ static const Thing _explPoisonCloud; // @ C0xFF87_THING_EXPLOSION_POISON_CLOUD
+ static const Thing _explSmoke; // @ C0xFFA8_THING_EXPLOSION_SMOKE
+ static const Thing _explFluxcage; // @ C0xFFB2_THING_EXPLOSION_FLUXCAGE
+ static const Thing _explRebirthStep1; // @ C0xFFE4_THING_EXPLOSION_REBIRTH_STEP1
+ static const Thing _explRebirthStep2; // @ C0xFFE5_THING_EXPLOSION_REBIRTH_STEP2
+ static const Thing _party; // @ C0xFFFF_THING_PARTY
Thing() : _data(0) {}
Thing(const Thing &other) { set(other._data); }
@@ -261,18 +265,20 @@ public:
bool isOrientedWestEast(int16 dir); // @ M16_IS_ORIENTED_WEST_EAST
uint16 normalizeModulo4(int16 dir); // @ M21_NORMALIZE
- int32 filterTime(int32 map_time); // @ M30_TIME
- int32 setMapAndTime(int32 &map_time, uint32 map, uint32 time); // @ M33_SET_MAP_AND_TIME
- uint16 getMap(int32 map_time); // @ M29_MAP
+ int32 filterTime(int32 mapTime); // @ M30_TIME
+ int32 setMapAndTime(uint32 map, uint32 time); // @ M33_SET_MAP_AND_TIME
+ uint16 getMap(int32 mapTime); // @ M29_MAP
Thing thingWithNewCell(Thing thing, int16 cell); // @ M15_THING_WITH_NEW_CELL
- int16 getDistance(int16 mapx1, int16 mapy1, int16 mapx2, int16 mapy2);// @ M38_DISTANCE
+ int16 getDistance(int16 mapx1, int16 mapy1, int16 mapx2, int16 mapy2); // @ M38_DISTANCE
+ int32 setMap(int32 mapTime, uint32 map); // @ M31_setMap
+
private:
uint16 _dungeonId; // @ G0526_ui_DungeonID
byte *_entranceDoorAnimSteps[10]; // @ G0562_apuc_Bitmap_EntranceDoorAnimationSteps
byte *_interfaceCredits; // @ G0564_puc_Graphic5_InterfaceCredits
Common::RandomSource *_rnd;
-
+
byte *_savedScreenForOpenEntranceDoors; // ad-hoc HACK
const DMADGameDescription *_gameVersion;
bool _canLoadFromGMM;
@@ -298,13 +304,12 @@ public:
bool _engineShouldQuit;
int _loadSaveSlotAtRuntime;
- int16 _newGameFl; // @ G0298_B_NewGame
+ GameMode _gameMode; // @ G0298_B_NewGame
bool _restartGameRequest; // @ G0523_B_RestartGameRequested
bool _stopWaitingForPlayerInput; // @ G0321_B_StopWaitingForPlayerInput
bool _gameTimeTicking; // @ G0301_B_GameTimeTicking
bool _restartGameAllowed; // @ G0524_B_RestartGameAllowed
- int32 _gameId; // @ G0525_l_GameID, probably useless here
bool _pressingEye; // @ G0331_B_PressingEye
bool _stopPressingEye; // @ G0332_B_StopPressingEye
bool _pressingMouth; // @ G0333_B_PressingMouth
diff --git a/engines/dm/dungeonman.cpp b/engines/dm/dungeonman.cpp
index f6cd250f6d..9ee86eda90 100644
--- a/engines/dm/dungeonman.cpp
+++ b/engines/dm/dungeonman.cpp
@@ -443,10 +443,20 @@ DungeonMan::DungeonMan(DMEngine *dmEngine) : _vm(dmEngine) {
_isFacingViAltar = false;
_isFacingFountain = false;
_squareAheadElement = (ElementType)0;
+
+ _dungeonFileHeader._ornamentRandomSeed = 0;
+ _dungeonFileHeader._rawMapDataSize = 0;
+ _dungeonFileHeader._mapCount = 0;
+ _dungeonFileHeader._textDataWordCount = 0;
+ _dungeonFileHeader._partyStartLocation = 0;
+ _dungeonFileHeader._squareFirstThingCount = 0;
+
for (uint16 i = 0; i < 5; ++i)
_pileTopObject[i] = Thing(0);
for (uint16 i = 0; i < 2; ++i)
_currMapDoorInfo[i].resetToZero();
+ for (uint16 i = 0; i < 16; i++)
+ _dungeonFileHeader._thingCounts[i] = 0;
setupConstants();
}
@@ -528,19 +538,19 @@ void DungeonMan::decompressDungeonFile() {
const Thing Thing::_none(0); // @ C0xFFFF_THING_NONE
const Thing Thing::_endOfList(0xFFFE); // @ C0xFFFE_THING_ENDOFLIST
-const Thing Thing::_firstExplosion(0xFF80); // @ C0xFF80_THING_FIRST_EXPLOSION
-const Thing Thing::_explFireBall(0xFF80); // @ C0xFF80_THING_EXPLOSION_FIREBALL
-const Thing Thing::_explSlime(0xFF81); // @ C0xFF81_THING_EXPLOSION_SLIME
-const Thing Thing::_explLightningBolt(0xFF82); // @ C0xFF82_THING_EXPLOSION_LIGHTNING_BOLT
+const Thing Thing::_firstExplosion(0xFF80); // @ C0xFF80_THING_FIRST_EXPLOSION
+const Thing Thing::_explFireBall(0xFF80); // @ C0xFF80_THING_EXPLOSION_FIREBALL
+const Thing Thing::_explSlime(0xFF81); // @ C0xFF81_THING_EXPLOSION_SLIME
+const Thing Thing::_explLightningBolt(0xFF82); // @ C0xFF82_THING_EXPLOSION_LIGHTNING_BOLT
const Thing Thing::_explHarmNonMaterial(0xFF83); // @ C0xFF83_THING_EXPLOSION_HARM_NON_MATERIAL
-const Thing Thing::_explOpenDoor(0xFF84); // @ C0xFF84_THING_EXPLOSION_OPEN_DOOR
-const Thing Thing::_explPoisonBolt(0xFF86); // @ C0xFF86_THING_EXPLOSION_POISON_BOLT
-const Thing Thing::_explPoisonCloud(0xFF87); // @ C0xFF87_THING_EXPLOSION_POISON_CLOUD
-const Thing Thing::_explSmoke(0xFFA8); // @ C0xFFA8_THING_EXPLOSION_SMOKE
-const Thing Thing::_explFluxcage(0xFFB2); // @ C0xFFB2_THING_EXPLOSION_FLUXCAGE
-const Thing Thing::_explRebirthStep1(0xFFE4); // @ C0xFFE4_THING_EXPLOSION_REBIRTH_STEP1
-const Thing Thing::_explRebirthStep2(0xFFE5); // @ C0xFFE5_THING_EXPLOSION_REBIRTH_STEP2
-const Thing Thing::_party(0xFFFF); // @ C0xFFFF_THING_PARTY
+const Thing Thing::_explOpenDoor(0xFF84); // @ C0xFF84_THING_EXPLOSION_OPEN_DOOR
+const Thing Thing::_explPoisonBolt(0xFF86); // @ C0xFF86_THING_EXPLOSION_POISON_BOLT
+const Thing Thing::_explPoisonCloud(0xFF87); // @ C0xFF87_THING_EXPLOSION_POISON_CLOUD
+const Thing Thing::_explSmoke(0xFFA8); // @ C0xFFA8_THING_EXPLOSION_SMOKE
+const Thing Thing::_explFluxcage(0xFFB2); // @ C0xFFB2_THING_EXPLOSION_FLUXCAGE
+const Thing Thing::_explRebirthStep1(0xFFE4); // @ C0xFFE4_THING_EXPLOSION_REBIRTH_STEP1
+const Thing Thing::_explRebirthStep2(0xFFE5); // @ C0xFFE5_THING_EXPLOSION_REBIRTH_STEP2
+const Thing Thing::_party(0xFFFF); // @ C0xFFFF_THING_PARTY
void DungeonMan::loadDungeonFile(Common::InSaveFile *file) {
static const byte additionalThingCounts[16] = { // @ G0236_auc_Graphic559_AdditionalThingCounts{
@@ -562,12 +572,12 @@ void DungeonMan::loadDungeonFile(Common::InSaveFile *file) {
50 /* Explosion */
};
- if (_vm->_newGameFl)
+ if (_vm->_gameMode != kDMModeLoadSavedGame)
decompressDungeonFile();
Common::ReadStream *dunDataStream = nullptr;
if (file) {
- // if loading a save
+ // if loading a save
dunDataStream = file;
} else {
// else read dungeon.dat
@@ -587,7 +597,7 @@ void DungeonMan::loadDungeonFile(Common::InSaveFile *file) {
_dungeonFileHeader._thingCounts[i] = dunDataStream->readUint16BE();
// init party position and mapindex
- if (_vm->_newGameFl) {
+ if (_vm->_gameMode != kDMModeLoadSavedGame) {
uint16 startLoc = _dungeonFileHeader._partyStartLocation;
_partyDir = (Direction)((startLoc >> 10) & 3);
_partyMapX = startLoc & 0x1F;
@@ -606,7 +616,7 @@ void DungeonMan::loadDungeonFile(Common::InSaveFile *file) {
dunDataStream->readUint32BE(); // discard 4 bytes
_dungeonMaps[i]._offsetMapX = dunDataStream->readByte();
_dungeonMaps[i]._offsetMapY = dunDataStream->readByte();
-
+
uint16 tmp = dunDataStream->readUint16BE();
_dungeonMaps[i]._height = tmp >> 11;
_dungeonMaps[i]._width = (tmp >> 6) & 0x1F;
@@ -643,7 +653,7 @@ void DungeonMan::loadDungeonFile(Common::InSaveFile *file) {
_dungeonColumCount = columCount;
uint32 actualSquareFirstThingCount = _dungeonFileHeader._squareFirstThingCount;
- if (_vm->_newGameFl)
+ if (_vm->_gameMode != kDMModeLoadSavedGame)
_dungeonFileHeader._squareFirstThingCount += 300;
if (!_vm->_restartGameRequest) {
@@ -662,7 +672,7 @@ void DungeonMan::loadDungeonFile(Common::InSaveFile *file) {
for (uint16 i = 0; i < actualSquareFirstThingCount; ++i)
_squareFirstThings[i].set(dunDataStream->readUint16BE());
- if (_vm->_newGameFl) {
+ if (_vm->_gameMode != kDMModeLoadSavedGame) {
for (uint16 i = 0; i < 300; ++i)
_squareFirstThings[actualSquareFirstThingCount + i] = Thing::_none;
}
@@ -676,13 +686,13 @@ void DungeonMan::loadDungeonFile(Common::InSaveFile *file) {
for (uint16 i = 0; i < _dungeonFileHeader._textDataWordCount; ++i)
_dungeonTextData[i] = dunDataStream->readUint16BE();
- if (_vm->_newGameFl)
+ if (_vm->_gameMode != kDMModeLoadSavedGame)
_vm->_timeline->_eventMaxCount = 100;
// load things
for (uint16 thingType = kDMThingTypeDoor; thingType < kDMThingTypeTotal; ++thingType) {
uint16 thingCount = _dungeonFileHeader._thingCounts[thingType];
- if (_vm->_newGameFl)
+ if (_vm->_gameMode != kDMModeLoadSavedGame)
_dungeonFileHeader._thingCounts[thingType] = MIN((thingType == kDMThingTypeExplosion) ? 768 : 1024, thingCount + additionalThingCounts[thingType]);
uint16 thingStoreWordCount = _thingDataWordCount[thingType];
@@ -695,7 +705,7 @@ void DungeonMan::loadDungeonFile(Common::InSaveFile *file) {
_thingData[thingType] = new uint16[_dungeonFileHeader._thingCounts[thingType] * thingStoreWordCount];
}
- if ((thingType == kDMThingTypeGroup || thingType == kDMThingTypeProjectile) && !file) { // !file because save files have diff. structure than dungeon.dat
+ if ((thingType == kDMThingTypeGroup || thingType == kDMThingTypeProjectile) && !file) { // !file because save files have diff. structure than dungeon.dat
for (uint16 i = 0; i < thingCount; ++i) {
uint16 *nextSlot = _thingData[thingType] + i *thingStoreWordCount;
for (uint16 j = 0; j < thingStoreWordCount; ++j) {
@@ -713,7 +723,7 @@ void DungeonMan::loadDungeonFile(Common::InSaveFile *file) {
}
}
- if (_vm->_newGameFl) {
+ if (_vm->_gameMode != kDMModeLoadSavedGame) {
if ((thingType == kDMThingTypeGroup) || thingType >= kDMThingTypeProjectile)
_vm->_timeline->_eventMaxCount += _dungeonFileHeader._thingCounts[thingType];
@@ -846,7 +856,7 @@ Thing DungeonMan::getSquareFirstThing(int16 mapX, int16 mapY) {
return _squareFirstThings[index];
}
-void DungeonMan::setSquareAspect(uint16 *aspectArray, Direction dir, int16 mapX, int16 mapY) {
+void DungeonMan::setSquareAspect(uint16 *aspectArray, Direction dir, int16 mapX, int16 mapY) {
unsigned char L0307_uc_Multiple;
#define AL0307_uc_Square L0307_uc_Multiple
#define AL0307_uc_FootprintsAllowed L0307_uc_Multiple
@@ -889,7 +899,7 @@ void DungeonMan::setSquareAspect(uint16 *aspectArray, Direction dir, int16 mapX,
default:
assert(false);
}
- _vm->_displayMan->_championPortraitOrdinal = 0;
+ _vm->_displayMan->_championPortraitOrdinal = 0;
squareIsFakeWall = false;
T0172010_ClosedFakeWall:
setSquareAspectOrnOrdinals(aspectArray, leftRandomWallOrnamentAllowed, frontRandomWallOrnamentAllowed, rightRandomWallOrnamentAllowed, dir, mapX, mapY, squareIsFakeWall);
@@ -1432,7 +1442,7 @@ Thing DungeonMan::getDiscardThing(uint16 thingType) {
uint16 mapHeight = _dungeonMaps[mapIndex]._height;
byte *currSquare = _dungeonMapData[mapIndex][0];
Thing *squareFirstThing = &_squareFirstThings[_dungeonColumnsCumulativeSquareThingCount[_dungeonMapsFirstColumnIndex[mapIndex]]];
-
+
for (int16 currMapX = 0; currMapX <= mapWidth; currMapX++) {
for (int16 currMapY = 0; currMapY <= mapHeight; currMapY++) {
if (getFlag(*currSquare++, kDMSquareMaskThingListPresent)) {
@@ -1535,7 +1545,7 @@ void DungeonMan::setGroupDirections(Group *group, int16 dir, uint16 mapIndex) {
}
bool DungeonMan::isCreatureAllowedOnMap(Thing thing, uint16 mapIndex) {
- int16 creatureType = ((Group *)getThingData(thing))->_type;
+ CreatureType creatureType = ((Group *)getThingData(thing))->_type;
Map *map = &_dungeonMaps[mapIndex];
byte *allowedCreatureType = _dungeonMapData[mapIndex][map->_width] + map->_height + 1;
for (int16 L0234_i_Counter = map->_creatureTypeCount; L0234_i_Counter > 0; L0234_i_Counter--) {
diff --git a/engines/dm/eventman.cpp b/engines/dm/eventman.cpp
index 65aae1debf..2fc0e5e0ab 100644
--- a/engines/dm/eventman.cpp
+++ b/engines/dm/eventman.cpp
@@ -458,9 +458,9 @@ void EventManager::setPointerToObject(byte *bitmap) {
memset(L0051_puc_Bitmap, 0, 32 * 18);
_vm->_displayMan->blitToBitmapShrinkWithPalChange(bitmap, _mousePointerTempBuffer, 16, 16, 16, 16, palChangesMousepointerOjbectIconShadow);
- _vm->_displayMan->blitToBitmap(_mousePointerTempBuffer, L0051_puc_Bitmap, boxMousePointerObjectShadow, 0, 0, 8, 16, kM1_ColorNoTransparency, 16, 18);
+ _vm->_displayMan->blitToBitmap(_mousePointerTempBuffer, L0051_puc_Bitmap, boxMousePointerObjectShadow, 0, 0, 8, 16, kDMColorNoTransparency, 16, 18);
_vm->_displayMan->blitToBitmapShrinkWithPalChange(bitmap, _mousePointerTempBuffer, 16, 16, 16, 16, palChangesMousePointerIcon);
- _vm->_displayMan->blitToBitmap(_mousePointerTempBuffer, L0051_puc_Bitmap, boxMousePointerObject, 0, 0, 8, 16, k0_ColorBlack, 16, 18);
+ _vm->_displayMan->blitToBitmap(_mousePointerTempBuffer, L0051_puc_Bitmap, boxMousePointerObject, 0, 0, 8, 16, kDMColorBlack, 16, 18);
_preventBuildPointerScreenArea = false;
buildpointerScreenArea(_mousePos.x, _mousePos.y);
@@ -472,7 +472,7 @@ void EventManager::mouseDropChampionIcon() {
_useChampionIconOrdinalAsMousePointerBitmap = _vm->indexToOrdinal(kDMChampionNone);
_mousePointerBitmapUpdated = true;
bool useByteBoxCoordinatesBackup = _vm->_displayMan->_useByteBoxCoordinates;
- _vm->_displayMan->blitToScreen(_mousePointerOriginalColorsChampionIcon, &_vm->_championMan->_boxChampionIcons[championIconIndex << 2], 16, k12_ColorDarkestGray, 18);
+ _vm->_displayMan->blitToScreen(_mousePointerOriginalColorsChampionIcon, &_vm->_championMan->_boxChampionIcons[championIconIndex << 2], 16, kDMColorDarkestGray, 18);
_vm->_displayMan->_useByteBoxCoordinates = useByteBoxCoordinatesBackup;
_preventBuildPointerScreenArea = false;
}
@@ -862,20 +862,20 @@ void EventManager::processCommandQueue() {
if (cmdType == kDMCommandFreezeGame) {
_vm->_gameTimeTicking = false;
_vm->_menuMan->drawDisabledMenu();
- _vm->_displayMan->fillBitmap(_vm->_displayMan->_bitmapViewport, k0_ColorBlack, 112, 136);
+ _vm->_displayMan->fillBitmap(_vm->_displayMan->_bitmapViewport, kDMColorBlack, 112, 136);
switch (_vm->getGameLanguage()) { // localized
default:
case Common::EN_ANY:
- _vm->_textMan->printTextToBitmap(_vm->_displayMan->_bitmapViewport, k112_byteWidthViewport, 81, 69, k4_ColorCyan, k0_ColorBlack,
+ _vm->_textMan->printTextToBitmap(_vm->_displayMan->_bitmapViewport, k112_byteWidthViewport, 81, 69, kDMColorCyan, kDMColorBlack,
"GAME FROZEN", k136_heightViewport);
break;
case Common::DE_DEU:
- _vm->_textMan->printTextToBitmap(_vm->_displayMan->_bitmapViewport, k112_byteWidthViewport, 66, 69, k4_ColorCyan, k0_ColorBlack,
+ _vm->_textMan->printTextToBitmap(_vm->_displayMan->_bitmapViewport, k112_byteWidthViewport, 66, 69, kDMColorCyan, kDMColorBlack,
"SPIEL ANGEHALTEN", k136_heightViewport);
break;
case Common::FR_FRA:
- _vm->_textMan->printTextToBitmap(_vm->_displayMan->_bitmapViewport, k112_byteWidthViewport, 84, 69, k4_ColorCyan, k0_ColorBlack,
+ _vm->_textMan->printTextToBitmap(_vm->_displayMan->_bitmapViewport, k112_byteWidthViewport, 84, 69, kDMColorCyan, kDMColorBlack,
"JEU BLOQUE", k136_heightViewport);
break;
}
@@ -904,12 +904,12 @@ void EventManager::processCommandQueue() {
}
if (cmdType == kDMCommandEntranceEnterDungeon) {
- _vm->_newGameFl = k1_modeLoadDungeon;
+ _vm->_gameMode = kDMModeLoadDungeon;
return;
}
if (cmdType == kDMCommandEntranceResume) {
- _vm->_newGameFl = k0_modeLoadSavedGame;
+ _vm->_gameMode = kDMModeLoadSavedGame;
return;
}
@@ -976,7 +976,7 @@ void EventManager::commandMoveParty(CommandType cmdType) {
}
uint16 movementArrowIdx = cmdType - kDMCommandMoveForward;
Box *highlightBox = &boxMovementArrows[movementArrowIdx];
- commandHighlightBoxEnable(highlightBox->_x1, highlightBox->_x2, highlightBox->_y1, highlightBox->_y2);
+ commandHighlightBoxEnable(highlightBox->_rect.left, highlightBox->_rect.right, highlightBox->_rect.top, highlightBox->_rect.bottom);
int16 partyMapX = _vm->_dungeonMan->_partyMapX;
int16 partyMapY = _vm->_dungeonMan->_partyMapY;
@@ -1028,11 +1028,11 @@ void EventManager::commandMoveParty(CommandType cmdType) {
damage |= _vm->_championMan->addPendingDamageAndWounds_getDamage(secondDamagedChampionIndex, 1, kDMWoundTorso | kDMWoundLegs, kDMAttackTypeSelf);
if (damage)
- _vm->_sound->requestPlay(k18_soundPARTY_DAMAGED, partyMapX, partyMapY, kDMSoundModePlayImmediately);
+ _vm->_sound->requestPlay(kDMSoundIndexPartyDamaged, partyMapX, partyMapY, kDMSoundModePlayImmediately);
} else {
isMovementBlocked = (_vm->_groupMan->groupGetThing(partyMapX, partyMapY) != Thing::_endOfList);
if (isMovementBlocked)
- _vm->_groupMan->processEvents29to41(partyMapX, partyMapY, kM1_TMEventTypeCreateReactionEvent31ParyIsAdjacent, 0);
+ _vm->_groupMan->processEvents29to41(partyMapX, partyMapY, kDMEventTypeCreateReactionPartyIsAdjacent, 0);
}
}
@@ -1172,10 +1172,10 @@ void EventManager::commandProcessType80ClickInDungeonView(int16 posX, int16 posY
if (_vm->_championMan->_leaderEmptyHanded) {
Junk *junkPtr = (Junk*)_vm->_dungeonMan->getSquareFirstThingData(mapX, mapY);
- if ((((Door*)junkPtr)->hasButton()) && _vm->_dungeonMan->_dungeonViewClickableBoxes[k5_ViewCellDoorButtonOrWallOrn].isPointInside(posX, posY - 33)) {
+ if ((((Door*)junkPtr)->hasButton()) && _vm->_dungeonMan->_dungeonViewClickableBoxes[kDMViewCellDoorButtonOrWallOrn].isPointInside(posX, posY - 33)) {
_vm->_stopWaitingForPlayerInput = true;
- _vm->_sound->requestPlay(k01_soundSWITCH, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, kDMSoundModePlayIfPrioritized);
- _vm->_moveSens->addEvent(k10_TMEventTypeDoor, mapX, mapY, kDMCellNorthWest, kDMSensorEffectToggle, _vm->_gameTime + 1);
+ _vm->_sound->requestPlay(kDMSoundIndexSwitch, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, kDMSoundModePlayIfPrioritized);
+ _vm->_moveSens->addEvent(kDMEventTypeDoor, mapX, mapY, kDMCellNorthWest, kDMSensorEffectToggle, _vm->_gameTime + 1);
return;
}
} else if (isLeaderHandObjThrown(posX, posY))
@@ -1183,9 +1183,9 @@ void EventManager::commandProcessType80ClickInDungeonView(int16 posX, int16 posY
}
if (_vm->_championMan->_leaderEmptyHanded) {
- for (uint16 currViewCell = k0_ViewCellFronLeft; currViewCell < k5_ViewCellDoorButtonOrWallOrn + 1; currViewCell++) {
+ for (uint16 currViewCell = kDMViewCellFronLeft; currViewCell < kDMViewCellDoorButtonOrWallOrn + 1; currViewCell++) {
if (_vm->_dungeonMan->_dungeonViewClickableBoxes[currViewCell].isPointInside(posX, posY - 33)) {
- if (currViewCell == k5_ViewCellDoorButtonOrWallOrn) {
+ if (currViewCell == kDMViewCellDoorButtonOrWallOrn) {
if (!_vm->_dungeonMan->_isFacingAlcove)
commandProcessType80ClickInDungeonViewTouchFrontWall();
} else
@@ -1198,15 +1198,15 @@ void EventManager::commandProcessType80ClickInDungeonView(int16 posX, int16 posY
Thing thingHandObject = _vm->_championMan->_leaderHandObject;
Junk *junkPtr = (Junk*)_vm->_dungeonMan->getThingData(thingHandObject);
if (_vm->_dungeonMan->_squareAheadElement == kDMElementTypeWall) {
- for (uint16 currViewCell = k0_ViewCellFronLeft; currViewCell < k1_ViewCellFrontRight + 1; currViewCell++) {
+ for (uint16 currViewCell = kDMViewCellFronLeft; currViewCell < kDMViewCellFrontRight + 1; currViewCell++) {
if (boxObjectPiles[currViewCell].isPointInside(posX, posY)) {
- processType80_clickInDungeonViewDropLeaderHandObject(currViewCell);
+ clickInDungeonViewDropLeaderHandObject(currViewCell);
return;
}
}
- if (_vm->_dungeonMan->_dungeonViewClickableBoxes[k5_ViewCellDoorButtonOrWallOrn].isPointInside(posX, posY - 33)) {
+ if (_vm->_dungeonMan->_dungeonViewClickableBoxes[kDMViewCellDoorButtonOrWallOrn].isPointInside(posX, posY - 33)) {
if (_vm->_dungeonMan->_isFacingAlcove)
- processType80_clickInDungeonViewDropLeaderHandObject(k4_ViewCellAlcove);
+ clickInDungeonViewDropLeaderHandObject(kDMViewCellAlcove);
else {
if (_vm->_dungeonMan->_isFacingFountain) {
uint16 iconIdx = _vm->_objectMan->getIconIndex(thingHandObject);
@@ -1229,9 +1229,9 @@ void EventManager::commandProcessType80ClickInDungeonView(int16 posX, int16 posY
if (isLeaderHandObjThrown(posX, posY))
return;
- for (uint16 currViewCell = k0_ViewCellFronLeft; currViewCell < k3_ViewCellBackLeft + 1; currViewCell++) {
+ for (uint16 currViewCell = kDMViewCellFronLeft; currViewCell < kDMViewCellBackLeft + 1; currViewCell++) {
if (boxObjectPiles[currViewCell].isPointInside(posX, posY)) {
- processType80_clickInDungeonViewDropLeaderHandObject(currViewCell);
+ clickInDungeonViewDropLeaderHandObject(currViewCell);
return;
}
}
@@ -1255,13 +1255,13 @@ void EventManager::commandProcessCommands160To162ClickInResurrectReincarnatePane
}
champMan._partyChampionCount--;
Box box;
- box._y1 = 0;
- box._y2 = 28;
- box._x1 = championIndex * k69_ChampionStatusBoxSpacing;
- box._x2 = box._x1 + 66;
+ box._rect.top = 0;
+ box._rect.bottom = 28;
+ box._rect.left = championIndex * kDMChampionStatusBoxSpacing;
+ box._rect.right = box._rect.left + 66;
dispMan._useByteBoxCoordinates = false;
- dispMan.fillScreenBox(box, k0_ColorBlack);
- dispMan.fillScreenBox(_vm->_championMan->_boxChampionIcons[champMan.getChampionIconIndex(champ->_cell, dunMan._partyDir) * 2], k0_ColorBlack);
+ dispMan.fillScreenBox(box, kDMColorBlack);
+ dispMan.fillScreenBox(_vm->_championMan->_boxChampionIcons[champMan.getChampionIconIndex(champ->_cell, dunMan._partyDir) * 2], kDMColorBlack);
_vm->_menuMan->drawEnabledMenus();
showMouse();
return;
@@ -1334,14 +1334,14 @@ void EventManager::commandProcess81ClickInPanel(int16 x, int16 y) {
CommandType commandType;
switch (invMan._panelContent) {
- case k4_PanelContentChest:
+ case kDMPanelContentChest:
if (champMan._leaderIndex == kDMChampionNone) // if no leader
return;
commandType = getCommandTypeFromMouseInput(_mouseInputPanelChest, Common::Point(x, y), kDMMouseButtonLeft);
if (commandType != kDMCommandNone)
_vm->_championMan->clickOnSlotBox(commandType - kDMCommandClickOnSlotBoxChampion0StatusBoxReadyHand);
break;
- case k5_PanelContentResurrectReincarnate:
+ case kDMPanelContentResurrectReincarnate:
if (!champMan._leaderEmptyHanded)
break;
commandType = getCommandTypeFromMouseInput(_mouseInputPanelResurrectReincarnateCancel, Common::Point(x, y), kDMMouseButtonLeft);
@@ -1359,7 +1359,7 @@ void EventManager::processType80_clickInDungeonView_grabLeaderHandObject(uint16
int16 mapX = _vm->_dungeonMan->_partyMapX;
int16 mapY = _vm->_dungeonMan->_partyMapY;
- if (viewCell >= k2_ViewCellBackRight) {
+ if (viewCell >= kDMViewCellBackRight) {
mapX += _vm->_dirIntoStepCountEast[_vm->_dungeonMan->_partyDir], mapY += _vm->_dirIntoStepCountNorth[_vm->_dungeonMan->_partyDir];
Thing groupThing = _vm->_groupMan->groupGetThing(mapX, mapY);
if ((groupThing != Thing::_endOfList) &&
@@ -1378,17 +1378,17 @@ void EventManager::processType80_clickInDungeonView_grabLeaderHandObject(uint16
_vm->_stopWaitingForPlayerInput = true;
}
-void EventManager::processType80_clickInDungeonViewDropLeaderHandObject(uint16 viewCell) {
+void EventManager::clickInDungeonViewDropLeaderHandObject(uint16 viewCell) {
if (_vm->_championMan->_leaderIndex == kDMChampionNone)
return;
int16 mapX = _vm->_dungeonMan->_partyMapX;
int16 mapY = _vm->_dungeonMan->_partyMapY;
- bool droppingIntoAnAlcove = (viewCell == k4_ViewCellAlcove);
+ bool droppingIntoAnAlcove = (viewCell == kDMViewCellAlcove);
if (droppingIntoAnAlcove)
- viewCell = k2_ViewCellBackRight;
+ viewCell = kDMViewCellBackRight;
- if (viewCell > k1_ViewCellFrontRight)
+ if (viewCell > kDMViewCellFrontRight)
mapX += _vm->_dirIntoStepCountEast[_vm->_dungeonMan->_partyDir], mapY += _vm->_dirIntoStepCountNorth[_vm->_dungeonMan->_partyDir];
uint16 currCell = _vm->normalizeModulo4(_vm->_dungeonMan->_partyDir + viewCell);
@@ -1397,8 +1397,8 @@ void EventManager::processType80_clickInDungeonViewDropLeaderHandObject(uint16 v
if (droppingIntoAnAlcove && _vm->_dungeonMan->_isFacingViAltar && (_vm->_objectMan->getIconIndex(removedThing) == kDMIconIndiceJunkChampionBones)) {
Junk *removedJunk = (Junk*)_vm->_dungeonMan->getThingData(removedThing);
TimelineEvent newEvent;
- _vm->setMapAndTime(newEvent._mapTime, _vm->_dungeonMan->_partyMapIndex, _vm->_gameTime + 1);
- newEvent._type = k13_TMEventTypeViAltarRebirth;
+ newEvent._mapTime = _vm->setMapAndTime(_vm->_dungeonMan->_partyMapIndex, _vm->_gameTime + 1);
+ newEvent._type = kDMEventTypeViAltarRebirth;
newEvent._priority = removedJunk->getChargeCount();
newEvent._Bu._location._mapX = mapX;
newEvent._Bu._location._mapY = mapY;
@@ -1417,17 +1417,17 @@ bool EventManager::hasPendingClick(Common::Point& point, MouseButton button) {
}
void EventManager::drawSleepScreen() {
- _vm->_displayMan->fillBitmap(_vm->_displayMan->_bitmapViewport, k0_ColorBlack, 112, 136);
+ _vm->_displayMan->fillBitmap(_vm->_displayMan->_bitmapViewport, kDMColorBlack, 112, 136);
switch (_vm->getGameLanguage()) { // localized
default:
case Common::EN_ANY:
- _vm->_textMan->printTextToBitmap(_vm->_displayMan->_bitmapViewport, k112_byteWidthViewport, 93, 69, k4_ColorCyan, k0_ColorBlack, "WAKE UP", k136_heightViewport);
+ _vm->_textMan->printTextToBitmap(_vm->_displayMan->_bitmapViewport, k112_byteWidthViewport, 93, 69, kDMColorCyan, kDMColorBlack, "WAKE UP", k136_heightViewport);
break;
case Common::DE_DEU:
- _vm->_textMan->printTextToBitmap(_vm->_displayMan->_bitmapViewport, k112_byteWidthViewport, 96, 69, k4_ColorCyan, k0_ColorBlack, "WECKEN", k136_heightViewport);
+ _vm->_textMan->printTextToBitmap(_vm->_displayMan->_bitmapViewport, k112_byteWidthViewport, 96, 69, kDMColorCyan, kDMColorBlack, "WECKEN", k136_heightViewport);
break;
case Common::FR_FRA:
- _vm->_textMan->printTextToBitmap(_vm->_displayMan->_bitmapViewport, k112_byteWidthViewport, 72, 69, k4_ColorCyan, k0_ColorBlack, "REVEILLEZ-VOUS", k136_heightViewport);
+ _vm->_textMan->printTextToBitmap(_vm->_displayMan->_bitmapViewport, k112_byteWidthViewport, 72, 69, kDMColorCyan, kDMColorBlack, "REVEILLEZ-VOUS", k136_heightViewport);
break;
}
}
@@ -1479,10 +1479,10 @@ void EventManager::mouseProcessCommands125To128_clickOnChampionIcon(uint16 champ
memset(tmpBitmap, 0, 32 * 18);
Box *curChampionIconBox = &_vm->_championMan->_boxChampionIcons[champIconIndex];
- _vm->_displayMan->blitToBitmap(_vm->_displayMan->_bitmapScreen, tmpBitmap, championIconShadowBox, curChampionIconBox->_x1, curChampionIconBox->_y1, k160_byteWidthScreen, k16_byteWidth, k0_ColorBlack, 200, 18);
+ _vm->_displayMan->blitToBitmap(_vm->_displayMan->_bitmapScreen, tmpBitmap, championIconShadowBox, curChampionIconBox->_rect.left, curChampionIconBox->_rect.top, k160_byteWidthScreen, k16_byteWidth, kDMColorBlack, 200, 18);
_vm->_displayMan->blitToBitmapShrinkWithPalChange(tmpBitmap, _mousePointerOriginalColorsChampionIcon, 32, 18, 32, 18, mousePointerIconShadowBox);
- _vm->_displayMan->blitToBitmap(_vm->_displayMan->_bitmapScreen, _mousePointerOriginalColorsChampionIcon, championIconBox, curChampionIconBox->_x1, curChampionIconBox->_y1, k160_byteWidthScreen, k16_byteWidth, k0_ColorBlack, 200, 18);
- _vm->_displayMan->fillScreenBox(*curChampionIconBox, k0_ColorBlack);
+ _vm->_displayMan->blitToBitmap(_vm->_displayMan->_bitmapScreen, _mousePointerOriginalColorsChampionIcon, championIconBox, curChampionIconBox->_rect.left, curChampionIconBox->_rect.top, k160_byteWidthScreen, k16_byteWidth, kDMColorBlack, 200, 18);
+ _vm->_displayMan->fillScreenBox(*curChampionIconBox, kDMColorBlack);
_useChampionIconOrdinalAsMousePointerBitmap = _vm->indexToOrdinal(champIconIndex);
} else {
_mousePointerBitmapUpdated = true;
@@ -1499,7 +1499,7 @@ void EventManager::mouseProcessCommands125To128_clickOnChampionIcon(uint16 champ
setFlag(_vm->_championMan->_champions[championIndex]._attributes, kDMAttributeIcon);
_vm->_championMan->drawChampionState((ChampionIndex)championIndex);
} else
- _vm->_displayMan->fillScreenBox(_vm->_championMan->_boxChampionIcons[championIconIndex], k0_ColorBlack);
+ _vm->_displayMan->fillScreenBox(_vm->_championMan->_boxChampionIcons[championIconIndex], kDMColorBlack);
_vm->_championMan->_champions[championCellIndex]._cell = (ViewCell)_vm->normalizeModulo4(champIconIndex + _vm->_dungeonMan->_partyDir);
setFlag(_vm->_championMan->_champions[championCellIndex]._attributes, kDMAttributeIcon);
@@ -1587,7 +1587,7 @@ void EventManager::commandProcessTypes101To108_clickInSpellSymbolsArea(CommandTy
uint16 symbolIndex = cmdType - kDMCommandClickInSpellAreaSymbol1;
Box *highlightBox = &spellSymbolsAndDelete[symbolIndex];
- commandHighlightBoxEnable(highlightBox->_x1, highlightBox->_x2, highlightBox->_y1, highlightBox->_y2);
+ commandHighlightBoxEnable(highlightBox->_rect.left, highlightBox->_rect.right, highlightBox->_rect.top, highlightBox->_rect.bottom);
_vm->delay(1);
highlightBoxDisable();
@@ -1665,7 +1665,7 @@ void EventManager::commandHighlightBoxEnable(int16 x1, int16 x2, int16 y1, int16
void EventManager::highlightBoxDisable() {
if (_highlightBoxEnabled == true) {
- highlightScreenBox(_highlightScreenBox._x1, _highlightScreenBox._x2, _highlightScreenBox._y1, _highlightScreenBox._y2);
+ highlightScreenBox(_highlightScreenBox._rect.left, _highlightScreenBox._rect.right, _highlightScreenBox._rect.top, _highlightScreenBox._rect.bottom);
_highlightBoxEnabled = false;
}
}
diff --git a/engines/dm/eventman.h b/engines/dm/eventman.h
index ac0ed7459e..826333e1df 100644
--- a/engines/dm/eventman.h
+++ b/engines/dm/eventman.h
@@ -189,14 +189,14 @@ public:
class DMEngine;
-#define k0_pointerArrow 0 // @ C0_POINTER_ARROW
-#define k1_pointerHand 1 // @ C1_POINTER_HAND
+#define k0_pointerArrow 0 // @ C0_POINTER_ARROW
+#define k1_pointerHand 1 // @ C1_POINTER_HAND
-#define k0_pointerTypeArrow 0 // @ C0_POINTER_TYPE_ARROW
-#define k1_pointerTypeObjectIcon 1 // @ C1_POINTER_TYPE_OBJECT_ICON
-#define k2_pointerTypeChampionIcon 2 // @ C2_POINTER_TYPE_CHAMPION_ICON
-#define k3_pointerTypeHand 3 // @ C3_POINTER_TYPE_HAND
-#define k4_pointerTypeAutoselect 4 // @ C4_POINTER_TYPE_AUTOSELECT
+#define k0_pointerTypeArrow 0 // @ C0_POINTER_TYPE_ARROW
+#define k1_pointerTypeObjectIcon 1 // @ C1_POINTER_TYPE_OBJECT_ICON
+#define k2_pointerTypeChampionIcon 2 // @ C2_POINTER_TYPE_CHAMPION_ICON
+#define k3_pointerTypeHand 3 // @ C3_POINTER_TYPE_HAND
+#define k4_pointerTypeAutoselect 4 // @ C4_POINTER_TYPE_AUTOSELECT
class EventManager {
DMEngine *_vm;
@@ -272,7 +272,7 @@ public:
void commandProcessCommands160To162ClickInResurrectReincarnatePanel(CommandType commandType); // @ F0282_CHAMPION_ProcessCommands160To162_ClickInResurrectReincarnatePanel
void commandProcess81ClickInPanel(int16 x, int16 y); // @ F0378_COMMAND_ProcessType81_ClickInPanel
void processType80_clickInDungeonView_grabLeaderHandObject(uint16 viewCell); // @ F0373_COMMAND_ProcessType80_ClickInDungeonView_GrabLeaderHandObject
- void processType80_clickInDungeonViewDropLeaderHandObject(uint16 viewCell); // @ F0374_COMMAND_ProcessType80_ClickInDungeonView_DropLeaderHandObject
+ void clickInDungeonViewDropLeaderHandObject(uint16 viewCell); // @ F0374_COMMAND_ProcessType80_ClickInDungeonView_DropLeaderHandObject
bool hasPendingClick(Common::Point &point, MouseButton button); // @ F0360_COMMAND_ProcessPendingClick
void drawSleepScreen(); // @ F0379_COMMAND_DrawSleepScreen
diff --git a/engines/dm/gfx.cpp b/engines/dm/gfx.cpp
index 875d3c780c..d8d680c6a9 100644
--- a/engines/dm/gfx.cpp
+++ b/engines/dm/gfx.cpp
@@ -41,6 +41,29 @@
#include "dm/text.h"
namespace DM {
+
+FieldAspect::FieldAspect(uint16 native, uint16 base, uint16 transparent, byte mask, uint16 byteWidth, uint16 height, uint16 xPos, uint16 bitplane)
+ : _nativeBitmapRelativeIndex(native), _baseStartUnitIndex(base), _transparentColor(transparent), _mask(mask),
+ _byteWidth(byteWidth), _height(height), _xPos(xPos), _bitplaneWordCount(bitplane) {}
+
+FieldAspect::FieldAspect() : _nativeBitmapRelativeIndex(0), _baseStartUnitIndex(0), _transparentColor(0),
+ _mask(0), _byteWidth(0), _height(0), _xPos(0), _bitplaneWordCount(0) {}
+
+DoorFrames::DoorFrames(Frame f1, Frame f2_1, Frame f2_2, Frame f2_3,
+ Frame f3_1, Frame f3_2, Frame f3_3,
+ Frame f4_1, Frame f4_2, Frame f4_3) {
+ _closedOrDestroyed = f1;
+ _vertical[0] = f2_1;
+ _vertical[1] = f2_2;
+ _vertical[2] = f2_3;
+ _leftHorizontal[0] = f3_1;
+ _leftHorizontal[1] = f3_2;
+ _leftHorizontal[2] = f3_3;
+ _rightHorizontal[0] = f4_1;
+ _rightHorizontal[1] = f4_2;
+ _rightHorizontal[2] = f4_3;
+}
+
DisplayMan::DisplayMan(DMEngine *dmEngine) : _vm(dmEngine) {
_bitmapScreen = nullptr;
_bitmaps = nullptr;
@@ -475,7 +498,7 @@ void DisplayMan::setUpScreens(uint16 width, uint16 height) {
delete[] _tmpBitmap;
delete[] _bitmapScreen;
_bitmapScreen = new byte[_screenWidth * _screenHeight];
- fillScreen(k0_ColorBlack);
+ fillScreen(kDMColorBlack);
_tmpBitmap = new byte[_screenWidth * _screenHeight];
}
@@ -509,26 +532,26 @@ void DisplayMan::initializeGraphicData() {
_derivedBitmaps[i] = nullptr;
}
- _derivedBitmapByteCount[k0_DerivedBitmapViewport] = 112 * 136;
- _derivedBitmapByteCount[k1_DerivedBitmapThievesEyeVisibleArea] = 48 * 95;
- _derivedBitmapByteCount[k2_DerivedBitmapDamageToCreatureMedium] = 32 * 37;
- _derivedBitmapByteCount[k3_DerivedBitmapDamageToCreatureSmall] = 24 * 37;
+ _derivedBitmapByteCount[kDMDerivedBitmapViewport] = 112 * 136;
+ _derivedBitmapByteCount[kDMDerivedBitmapThievesEyeVisibleArea] = 48 * 95;
+ _derivedBitmapByteCount[kDMDerivedBitmapDamageToCreatureMedium] = 32 * 37;
+ _derivedBitmapByteCount[kDMDerivedBitmapDamageToCreatureSmall] = 24 * 37;
for (int16 doorOrnamentIndex = k15_DoorOrnDestroyedMask; doorOrnamentIndex <= k16_DoorOrnThivesEyeMask; doorOrnamentIndex++) {
- _currMapDoorOrnInfo[doorOrnamentIndex].nativeIndice = doorOrnamentIndex + (k301_DoorMaskDestroyedIndice - k15_DoorOrnDestroyedMask);
+ _currMapDoorOrnInfo[doorOrnamentIndex].nativeIndice = doorOrnamentIndex + (kDMGraphicIdxDoorMaskDestroyed - k15_DoorOrnDestroyedMask);
_currMapDoorOrnInfo[doorOrnamentIndex].coordinateSet = 1;
- _derivedBitmapByteCount[doorOrnamentIndex * 2 + k68_DerivedBitmapFirstDoorOrnament_D3] = 24 * 41;
- _derivedBitmapByteCount[doorOrnamentIndex * 2 + k69_DerivedBitmapFirstDoorOrnament_D2] = 32 * 61;
+ _derivedBitmapByteCount[doorOrnamentIndex * 2 + kDMDerivedBitmapFirstDoorOrnamentD3] = 24 * 41;
+ _derivedBitmapByteCount[doorOrnamentIndex * 2 + kDMDerivedBitmapFirstDoorOrnamentD2] = 32 * 61;
}
- _currMapFloorOrnInfo[k15_FloorOrnFootprints].nativeIndice = k241_FloorOrn_15_D3L_footprints;
+ _currMapFloorOrnInfo[k15_FloorOrnFootprints].nativeIndice = kDMGraphicIdxFloorOrnD3LFootprints;
_currMapFloorOrnInfo[k15_FloorOrnFootprints].coordinateSet = 1;
ObjectAspect *objectAspect = _objectAspects209;
int16 derivedBitmapIndex;
for (int16 objectAspectIndex = 0; objectAspectIndex < k85_ObjAspectCount; ++objectAspectIndex, ++objectAspect) {
- derivedBitmapIndex = k104_DerivedBitmapFirstObject + objectAspect->_firstDerivedBitmapRelativeIndex;
+ derivedBitmapIndex = kDMDerivedBitmapFirstObject + objectAspect->_firstDerivedBitmapRelativeIndex;
_derivedBitmapByteCount[derivedBitmapIndex++] = getScaledBitmapByteCount(objectAspect->_byteWidth, objectAspect->_height, k16_Scale_D3);
_derivedBitmapByteCount[derivedBitmapIndex++] = getScaledBitmapByteCount(objectAspect->_byteWidth, objectAspect->_height, k20_Scale_D2);
@@ -550,7 +573,7 @@ void DisplayMan::initializeGraphicData() {
ProjectileAspect *projectileAspect = _projectileAspect;
for (int16 projectileAspectIndex = 0; projectileAspectIndex < k14_ProjectileAspectCount; projectileAspectIndex++, projectileAspect++) {
if (!getFlag(projectileAspect->_graphicInfo, k0x0100_ProjectileScaleWithKineticEnergyMask)) {
- derivedBitmapIndex = k282_DerivedBitmapFirstProjectile + projectileAspect->_firstDerivedBitmapRelativeIndex;
+ derivedBitmapIndex = kDMDerivedBitmapFirstProjectile + projectileAspect->_firstDerivedBitmapRelativeIndex;
for (int16 projectileScaleIndex = 0; projectileScaleIndex < 6; projectileScaleIndex++) {
int16 bitmapByteCount = getScaledBitmapByteCount(projectileAspect->_byteWidth, projectileAspect->_height, _projectileScales[projectileScaleIndex]);
@@ -570,17 +593,17 @@ void DisplayMan::initializeGraphicData() {
_palChangesProjectile[1] = _palChangesFloorOrnD2;
_palChangesProjectile[2] = _palChangesProjectile[3] = _palChangesNoChanges;
- derivedBitmapIndex = k438_DerivedBitmapFirstExplosion;
+ derivedBitmapIndex = kDMDerivedBitmapFirstExplosion;
ExplosionAspect *expAsp = _explosionAspects;
for (uint16 expAspIndex = 0; expAspIndex < k4_ExplosionAspectCount; ++expAspIndex, expAsp++) {
for (int16 scale = 4; scale < 32; scale += 2)
_derivedBitmapByteCount[derivedBitmapIndex++] = getScaledBitmapByteCount(expAsp->_byteWidth, expAsp->_height, scale);
- if (expAspIndex == k3_ExplosionAspectSmoke)
+ if (expAspIndex == kDMExplosionAspectSmoke)
_derivedBitmapByteCount[derivedBitmapIndex++] = expAsp->_byteWidth * expAsp->_height;
}
- derivedBitmapIndex = k495_DerivedBitmapFirstCreature;
+ derivedBitmapIndex = kDMDerivedBitmapFirstCreature;
CreatureAspect *creatureAsp;
for (int16 creatureIndex = 0; creatureIndex < k27_CreatureTypeCount; creatureIndex++) {
creatureAsp = &_creatureAspects219[creatureIndex];
@@ -594,22 +617,22 @@ void DisplayMan::initializeGraphicData() {
int16 creatureFrontBitmapD2PixelCount = getScaledBitmapByteCount(creatureAsp->_byteWidthFront, creatureAsp->_heightFront, k20_Scale_D2);
_derivedBitmapByteCount[derivedBitmapIndex++] = creatureFrontBitmapD2PixelCount;
- if (getFlag(creatureGraphicInfo, k0x0008_CreatureInfoGraphicMaskSide)) {
+ if (getFlag(creatureGraphicInfo, kDMCreatureMaskSide)) {
_derivedBitmapByteCount[derivedBitmapIndex++] = getScaledBitmapByteCount(creatureAsp->_byteWidthSide, creatureAsp->_heightSide, k16_Scale_D3);
_derivedBitmapByteCount[derivedBitmapIndex++] = getScaledBitmapByteCount(creatureAsp->_byteWidthSide, creatureAsp->_heightSide, k20_Scale_D2);
}
- if (getFlag(creatureGraphicInfo, k0x0010_CreatureInfoGraphicMaskBack)) {
+ if (getFlag(creatureGraphicInfo, kDMCreatureMaskBack)) {
_derivedBitmapByteCount[derivedBitmapIndex++] = creatureFrontBitmapD3PixelCount;
_derivedBitmapByteCount[derivedBitmapIndex++] = creatureFrontBitmapD2PixelCount;
}
- if (getFlag(creatureGraphicInfo, k0x0020_CreatureInfoGraphicMaskAttack)) {
+ if (getFlag(creatureGraphicInfo, kDMCreatureMaskAttack)) {
_derivedBitmapByteCount[derivedBitmapIndex++] = getScaledBitmapByteCount(creatureAsp->_byteWidthAttack, creatureAsp->_heightAttack, k16_Scale_D3);
_derivedBitmapByteCount[derivedBitmapIndex++] = getScaledBitmapByteCount(creatureAsp->_byteWidthAttack, creatureAsp->_heightAttack, k20_Scale_D2);
}
- int16 additionalFronGraphicCount = getFlag(creatureGraphicInfo, k0x0003_CreatureInfoGraphicMaskAdditional);
+ int16 additionalFronGraphicCount = getFlag(creatureGraphicInfo, kDMCreatureMaskAdditional);
if (additionalFronGraphicCount) {
do {
_derivedBitmapByteCount[derivedBitmapIndex++] = creatureAsp->_byteWidthFront * creatureAsp->_heightFront;
@@ -687,16 +710,16 @@ void DisplayMan::unpackGraphics() {
_bitmaps[i] = _bitmaps[i - 1] + getPixelWidth(i - 1) * getPixelHeight(i - 1);
loadIntoBitmap(i, _bitmaps[i]);
}
- _bitmaps[k557_FontGraphicIndice] = _bitmaps[532] + getPixelWidth(532) * getPixelHeight(532);
- loadFNT1intoBitmap(k557_FontGraphicIndice, _bitmaps[k557_FontGraphicIndice]);
+ _bitmaps[kDMGraphicIdxFont] = _bitmaps[532] + getPixelWidth(532) * getPixelHeight(532);
+ loadFNT1intoBitmap(kDMGraphicIdxFont, _bitmaps[kDMGraphicIdxFont]);
}
-void DisplayMan::loadFNT1intoBitmap(uint16 index, byte * destBitmap) {
+void DisplayMan::loadFNT1intoBitmap(uint16 index, byte *destBitmap) {
uint8 *data = _packedBitmaps + _packedItemPos[index];
for (uint16 i = 0; i < 6; i++) {
for (uint16 w = 0; w < 128; ++w) {
- *destBitmap++ = k0_ColorBlack;
+ *destBitmap++ = kDMColorBlack;
uint16 nextByte = *data++;
for (int16 pixel = 4; pixel >= 0; --pixel) {
@@ -714,10 +737,10 @@ void DisplayMan::allocateFlippedWallBitmaps() {
_bitmapWallD0RFlipped = new byte[32 * 136];
}
-void DisplayMan::drawDoorBitmap(Frame* frame) {
+void DisplayMan::drawDoorBitmap(Frame *frame) {
if (frame->_srcByteWidth) {
blitToBitmap(_tmpBitmap, _bitmapViewport, frame->_box, frame->_srcX, frame->_srcY,
- frame->_srcByteWidth, k112_byteWidthViewport, k10_ColorFlesh, frame->_srcHeight, k136_heightViewport);
+ frame->_srcByteWidth, k112_byteWidthViewport, kDMColorFlesh, frame->_srcHeight, k136_heightViewport);
}
}
@@ -725,7 +748,7 @@ void DisplayMan::drawDoorFrameBitmapFlippedHorizontally(byte *bitmap, Frame *fra
if (frame->_srcByteWidth) {
flipBitmapHorizontal(bitmap, frame->_srcByteWidth, frame->_srcHeight);
blitToBitmap(bitmap, _bitmapViewport, frame->_box, frame->_srcX, frame->_srcY,
- frame->_srcByteWidth, k112_byteWidthViewport, k10_ColorFlesh, frame->_srcHeight, k136_heightViewport);
+ frame->_srcByteWidth, k112_byteWidthViewport, kDMColorFlesh, frame->_srcHeight, k136_heightViewport);
}
}
@@ -745,7 +768,7 @@ void DisplayMan::drawDoorButton(int16 doorButtonOrdinal, DoorButton doorButton)
assert(doorButtonOrdinal == 0);
- int16 nativeBitmapIndex = doorButtonOrdinal + k315_firstDoorButton_GraphicIndice;
+ int16 nativeBitmapIndex = doorButtonOrdinal + kDMGraphicIdxFirstDoorButton;
int coordSet = doorButtonCoordSet[doorButtonOrdinal];
uint16 *coordSetRedEagle = doorButtonCoordSets[coordSet][doorButton];
@@ -753,12 +776,12 @@ void DisplayMan::drawDoorButton(int16 doorButtonOrdinal, DoorButton doorButton)
if (doorButton == kDMDoorButtonD1C) {
bitmap = getNativeBitmapOrGraphic(nativeBitmapIndex);
- _vm->_dungeonMan->_dungeonViewClickableBoxes[k5_ViewCellDoorButtonOrWallOrn]._x1 = coordSetRedEagle[0];
- _vm->_dungeonMan->_dungeonViewClickableBoxes[k5_ViewCellDoorButtonOrWallOrn]._x2 = coordSetRedEagle[1];
- _vm->_dungeonMan->_dungeonViewClickableBoxes[k5_ViewCellDoorButtonOrWallOrn]._y1 = coordSetRedEagle[2];
- _vm->_dungeonMan->_dungeonViewClickableBoxes[k5_ViewCellDoorButtonOrWallOrn]._y2 = coordSetRedEagle[3];
+ _vm->_dungeonMan->_dungeonViewClickableBoxes[kDMViewCellDoorButtonOrWallOrn]._rect.left = coordSetRedEagle[0];
+ _vm->_dungeonMan->_dungeonViewClickableBoxes[kDMViewCellDoorButtonOrWallOrn]._rect.right = coordSetRedEagle[1];
+ _vm->_dungeonMan->_dungeonViewClickableBoxes[kDMViewCellDoorButtonOrWallOrn]._rect.top = coordSetRedEagle[2];
+ _vm->_dungeonMan->_dungeonViewClickableBoxes[kDMViewCellDoorButtonOrWallOrn]._rect.bottom = coordSetRedEagle[3];
} else {
- doorButtonOrdinal = k102_DerivedBitmapFirstDoorButton + (doorButtonOrdinal * 2) + ((doorButton != kDMDoorButtonD3R) ? 0 : (int16)doorButton - 1);
+ doorButtonOrdinal = kDMDerivedBitmapFirstDoorButton + (doorButtonOrdinal * 2) + ((doorButton != kDMDoorButtonD3R) ? 0 : (int16)doorButton - 1);
if (!isDerivedBitmapInCache(doorButtonOrdinal)) {
uint16 *coordSetBlueGoat = doorButtonCoordSets[coordSet][kDMDoorButtonD1C];
byte *bitmapNative = getNativeBitmapOrGraphic(nativeBitmapIndex);
@@ -773,12 +796,13 @@ void DisplayMan::drawDoorButton(int16 doorButtonOrdinal, DoorButton doorButton)
}
bitmap = getDerivedBitmap(doorButtonOrdinal);
}
- blitToBitmap(bitmap, _bitmapViewport, *(Box *)coordSetRedEagle, 0, 0,
- coordSetRedEagle[4], k112_byteWidthViewport, k10_ColorFlesh, coordSetRedEagle[5], k136_heightViewport);
+ Box blitBox(coordSetRedEagle[0], coordSetRedEagle[1], coordSetRedEagle[2], coordSetRedEagle[3]);
+ blitToBitmap(bitmap, _bitmapViewport, blitBox, 0, 0,
+ coordSetRedEagle[4], k112_byteWidthViewport, kDMColorFlesh, coordSetRedEagle[5], k136_heightViewport);
}
}
-void DisplayMan::viewportSetPalette(uint16* middleScreenPalette, uint16* topAndBottomScreen) {
+void DisplayMan::viewportSetPalette(uint16 *middleScreenPalette, uint16 *topAndBottomScreen) {
if (middleScreenPalette && topAndBottomScreen)
buildPaletteChangeCopperList(middleScreenPalette, topAndBottomScreen);
@@ -788,7 +812,7 @@ void DisplayMan::viewportSetPalette(uint16* middleScreenPalette, uint16* topAndB
void DisplayMan::viewportBlitToScreen() {
Box box(0, 223, 33, 168);
- blitToBitmap(_bitmapViewport, _bitmapScreen, box, 0, 0, k112_byteWidthViewport, k160_byteWidthScreen, kM1_ColorNoTransparency,
+ blitToBitmap(_bitmapViewport, _bitmapScreen, box, 0, 0, k112_byteWidthViewport, k160_byteWidthScreen, kDMColorNoTransparency,
k136_heightViewport, k200_heightScreen);
}
@@ -846,27 +870,27 @@ void DisplayMan::blitToBitmap(byte *srcBitmap, byte *destBitmap, const Box &box,
uint16 destByteWidth, Color transparent, int16 srcHeight, int16 destHight) {
uint16 srcWidth = srcByteWidth * 2;
uint16 destWidth = destByteWidth * 2;
- for (uint16 y = 0; y < box._y2 + 1 - box._y1; ++y) { // + 1 for inclusive boundaries
- for (uint16 x = 0; x < box._x2 + 1 - box._x1; ++x) { // + 1 for inclusive boundaries
+ for (uint16 y = 0; y < box._rect.bottom + 1 - box._rect.top; ++y) { // + 1 for inclusive boundaries
+ for (uint16 x = 0; x < box._rect.right + 1 - box._rect.left; ++x) { // + 1 for inclusive boundaries
if (srcX + x < srcWidth && y + srcY < srcHeight
- && box._x1 + x < destWidth && y + box._y1 < destHight) {
+ && box._rect.left + x < destWidth && y + box._rect.top < destHight) {
byte srcPixel = srcBitmap[srcWidth * (y + srcY) + srcX + x];
if (srcPixel != transparent)
- destBitmap[destWidth * (y + box._y1) + box._x1 + x] = srcPixel;
+ destBitmap[destWidth * (y + box._rect.top) + box._rect.left + x] = srcPixel;
}
}
}
}
void DisplayMan::fillScreenBox(Box &box, Color color) {
- uint16 width = box._x2 + 1 - box._x1; // + 1 for inclusive boundaries
- for (int16 y = box._y1; y < box._y2 + 1; ++y) // + 1 for inclusive boundaries
- memset(_bitmapScreen + y * _screenWidth + box._x1, color, sizeof(byte) * width);
+ uint16 width = box._rect.right + 1 - box._rect.left; // + 1 for inclusive boundaries
+ for (int16 y = box._rect.top; y < box._rect.bottom + 1; ++y) // + 1 for inclusive boundaries
+ memset(_bitmapScreen + y * _screenWidth + box._rect.left, color, sizeof(byte) * width);
}
void DisplayMan::fillBoxBitmap(byte *destBitmap, Box &box, Color color, int16 byteWidth, int16 height) {
- for (int16 y = box._y1; y < box._y2 + 1; ++y) // + 1 for inclusive boundaries
- memset(destBitmap + y * byteWidth * 2 + box._x1, color, sizeof(byte) * (box._x2 - box._x1 + 1)); // + 1 for inclusive boundaries
+ for (int16 y = box._rect.top; y < box._rect.bottom + 1; ++y) // + 1 for inclusive boundaries
+ memset(destBitmap + y * byteWidth * 2 + box._rect.left, color, sizeof(byte) * (box._rect.right - box._rect.left + 1)); // + 1 for inclusive boundaries
}
void DisplayMan::blitBoxFilledWithMaskedBitmap(byte *src, byte *dest, byte *mask, byte *tmp, Box& box,
@@ -878,8 +902,8 @@ void DisplayMan::blitBoxFilledWithMaskedBitmap(byte *src, byte *dest, byte *mask
byte nextUnitIndex = firstUnitIndex;
bool useMask = !(transparent & k0x0080_BlitDoNotUseMask);
transparent = (Color)(transparent & ~(k0x0080_BlitDoNotUseMask)); // clear flag 0x0080
- for (byte next_y = box._y1; next_y <= box._y2; next_y++) { // '<=' for inclusive boundaries
- for (byte next_x = box._x1; next_x <= box._x2; next_x++) { // '<=' for inclusive boundaries
+ for (byte next_y = box._rect.top; next_y <= box._rect.bottom; next_y++) { // '<=' for inclusive boundaries
+ for (byte next_x = box._rect.left; next_x <= box._rect.right; next_x++) { // '<=' for inclusive boundaries
byte *nextDestPixel = dest + next_y * destByteWidth * 2 + next_x;
byte nextSrcPixel = src[nextUnitIndex];
@@ -924,16 +948,16 @@ byte *DisplayMan::getExplosionBitmap(uint16 explosionAspIndex, uint16 scale, int
int16 pixelWidth = getScaledDimension(explAsp->_byteWidth, scale);
int16 height = getScaledDimension(explAsp->_height, scale);
byte *bitmap;
- int16 derBitmapIndex = (explosionAspIndex * 14) + scale / 2 + k438_DerivedBitmapFirstExplosion - 2;
- if ((scale == 32) && (explosionAspIndex != k3_ExplosionAspectSmoke))
- bitmap = getNativeBitmapOrGraphic(explosionAspIndex + k348_FirstExplosionGraphicIndice);
+ int16 derBitmapIndex = (explosionAspIndex * 14) + scale / 2 + kDMDerivedBitmapFirstExplosion - 2;
+ if ((scale == 32) && (explosionAspIndex != kDMExplosionAspectSmoke))
+ bitmap = getNativeBitmapOrGraphic(explosionAspIndex + kDMGraphicIdxFirstExplosion);
else if (isDerivedBitmapInCache(derBitmapIndex))
bitmap = getDerivedBitmap(derBitmapIndex);
else {
- byte *nativeBitmap = getNativeBitmapOrGraphic(MIN(explosionAspIndex, (uint16)k2_ExplosionAspectPoison) + k348_FirstExplosionGraphicIndice);
+ byte *nativeBitmap = getNativeBitmapOrGraphic(MIN(explosionAspIndex, (uint16)kDMExplosionAspectPoison) + kDMGraphicIdxFirstExplosion);
bitmap = getDerivedBitmap(derBitmapIndex);
blitToBitmapShrinkWithPalChange(nativeBitmap, bitmap, explAsp->_byteWidth, explAsp->_height, pixelWidth * 2, height,
- (explosionAspIndex == k3_ExplosionAspectSmoke) ? _palChangeSmoke : _palChangesNoChanges);
+ (explosionAspIndex == kDMExplosionAspectSmoke) ? _palChangeSmoke : _palChangesNoChanges);
addDerivedBitmap(derBitmapIndex);
}
@@ -1072,15 +1096,15 @@ void DisplayMan::drawFloorOrnament(uint16 floorOrnOrdinal, ViewFloor viewFloorIn
} else
bitmap = getNativeBitmapOrGraphic(nativeBitmapIndex);
- blitToBitmap(bitmap, _bitmapViewport,
- *(Box *)coordSets, 0, 0, coordSets[4], k112_byteWidthViewport, k10_ColorFlesh, coordSets[5], k136_heightViewport);
+ Box blitBox(coordSets[0], coordSets[1], coordSets[2], coordSets[3]);
+ blitToBitmap(bitmap, _bitmapViewport, blitBox, 0, 0, coordSets[4], k112_byteWidthViewport, kDMColorFlesh, coordSets[5], k136_heightViewport);
}
if (drawFootprints)
drawFloorOrnament(_vm->indexToOrdinal(k15_FloorOrnFootprints), viewFloorIndex);
}
-void DisplayMan::drawDoor(uint16 doorThingIndex, DoorState doorState, int16* doorNativeBitmapIndices, int16 byteCount, DoorOrnament doorOrnament, DoorFrames* doorFrames) {
+void DisplayMan::drawDoor(uint16 doorThingIndex, DoorState doorState, int16 *doorNativeBitmapIndices, int16 byteCount, DoorOrnament doorOrnament, DoorFrames *doorFrames) {
if (doorState == kDMDoorStateOpen)
return;
@@ -1160,7 +1184,7 @@ void DisplayMan::drawDoorOrnament(int16 doorOrnOrdinal, DoorOrnament doorOrnamen
byteWidth = k48_byteWidth;
height = 88;
} else {
- height = k68_DerivedBitmapFirstDoorOrnament_D3 + (height * 2) + doorOrnament;
+ height = kDMDerivedBitmapFirstDoorOrnamentD3 + (height * 2) + doorOrnament;
if (!isDerivedBitmapInCache(height)) {
uint16 *coordSetRedEagle = &doorOrnCoordSets[coordSetGreenToad][kDMDoorOrnamentD1LCR][0];
byte *nativeBitmap = getNativeBitmapOrGraphic(nativeBitmapIndex);
@@ -1178,7 +1202,7 @@ void DisplayMan::drawDoorOrnament(int16 doorOrnOrdinal, DoorOrnament doorOrnamen
}
Box box(coordSetOrangeElk[0], coordSetOrangeElk[1], coordSetOrangeElk[2], coordSetOrangeElk[3]);
- blitToBitmap(blitBitmap, _tmpBitmap, box, 0, 0, coordSetOrangeElk[4], byteWidth, k9_ColorGold, coordSetOrangeElk[5], height);
+ blitToBitmap(blitBitmap, _tmpBitmap, box, 0, 0, coordSetOrangeElk[4], byteWidth, kDMColorGold, coordSetOrangeElk[5], height);
}
void DisplayMan::drawCeilingPit(int16 nativeBitmapIndex, Frame *frame, int16 mapX, int16 mapY, bool flipHorizontal) {
@@ -1214,14 +1238,14 @@ void DisplayMan::drawWallSetBitmapWithoutTransparency(byte *bitmap, Frame &f) {
if (!f._srcByteWidth)
return;
- blitToBitmap(bitmap, _bitmapViewport, f._box, f._srcX, f._srcY, f._srcByteWidth, k112_byteWidthViewport, kM1_ColorNoTransparency, f._srcHeight, k136_heightViewport);
+ blitToBitmap(bitmap, _bitmapViewport, f._box, f._srcX, f._srcY, f._srcByteWidth, k112_byteWidthViewport, kDMColorNoTransparency, f._srcHeight, k136_heightViewport);
}
void DisplayMan::drawWallSetBitmap(byte *bitmap, Frame &f) {
if (!f._srcByteWidth)
return;
- blitToBitmap(bitmap, _bitmapViewport, f._box, f._srcX, f._srcY, f._srcByteWidth, k112_byteWidthViewport, k10_ColorFlesh, f._srcHeight, k136_heightViewport);
+ blitToBitmap(bitmap, _bitmapViewport, f._box, f._srcX, f._srcY, f._srcByteWidth, k112_byteWidthViewport, kDMColorFlesh, f._srcHeight, k136_heightViewport);
}
@@ -1245,7 +1269,7 @@ void DisplayMan::drawSquareD3L(Direction dir, int16 posX, int16 posY) {
);
uint16 squareAspect[5];
- int16 order;
+ CellOrder order;
bool skip = false;
_vm->_dungeonMan->setSquareAspect(squareAspect, dir, posX, posY);
switch (squareAspect[kDMSquareAspectElement]) {
@@ -1254,39 +1278,39 @@ void DisplayMan::drawSquareD3L(Direction dir, int16 posX, int16 posY) {
drawFloorPitOrStairsBitmap(_stairsNativeBitmapIndexUpFrontD3L, frameStairsUpFrontD3L);
else
drawFloorPitOrStairsBitmap(_stairsNativeBitmapIndexDownFrontD3L, frameStairsDownFrontD3L);
- order = k0x3421_CellOrder_BackLeft_BackRight_FrontLeft_FrontRight;
+ order = kDMCellOrderBackLeftBackRightFrontLeftFrontRight;
/* BUG0_64 Floor ornaments are drawn over open pits. There is no check to prevent drawing floor ornaments over open pits */
drawFloorOrnament(squareAspect[kDMSquareAspectFloorOrn], kDMViewFloorD3L);
break;
case kDMElementTypeWall:
- drawWallSetBitmap(_bitmapWallSetD3LCR, _frameWalls163[k1_ViewSquare_D3L]);
+ drawWallSetBitmap(_bitmapWallSetD3LCR, _frameWalls163[kDMViewSquareD3L]);
isDrawnWallOrnAnAlcove(squareAspect[kDMSquareAspectRightWallOrnOrd], kDMViewWallD3LRight);
if (isDrawnWallOrnAnAlcove(squareAspect[kDMSquareFrontWallOrnOrd], kDMViewWallD3LFront))
- order = k0x0000_CellOrder_Alcove;
+ order = kDMCellOrderAlcove;
else
return;
break;
case kDMElementTypeDoorSide:
case kDMElementTypeStairsSide:
- order = k0x0321_CellOrder_BackLeft_BackRight_FrontRight;
+ order = kDMCellOrderBackLeftBackRightFrontRight;
/* BUG0_64 Floor ornaments are drawn over open pits. There is no check to prevent drawing floor ornaments over open pits */
drawFloorOrnament(squareAspect[kDMSquareAspectFloorOrn], kDMViewFloorD3L);
break;
case kDMElementTypeDoorFront:
drawFloorOrnament(squareAspect[kDMSquareAspectFloorOrn], kDMViewFloorD3L);
- drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[kDMSquareAspectFirstGroupOrObject]), dir, posX, posY, k1_ViewSquare_D3L, k0x0218_CellOrder_DoorPass1_BackLeft_BackRight);
+ drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[kDMSquareAspectFirstGroupOrObject]), dir, posX, posY, kDMViewSquareD3L, kDMCellOrderDoorPass1BackLeftBackRight);
drawWallSetBitmap(_bitmapWallSetDoorFrameLeftD3L, doorFrameLeftD3L);
drawDoor(squareAspect[kDMSquareAspectDoorThingIndex], (DoorState)squareAspect[kDMSquareAspectDoorState],
_doorNativeBitmapIndexFrontD3LCR, getBitmapByteCount(48, 41), kDMDoorOrnamentD3LCR, &doorFrameD3L);
- order = k0x0349_CellOrder_DoorPass2_FrontLeft_FrontRight;
+ order = kDMCellOrderDoorPass2FrontLeftFrontRight;
break;
case kDMElementTypePit:
if (!squareAspect[kDMSquareAspectPitInvisible])
- drawFloorPitOrStairsBitmap(k49_FloorPit_D3L_GraphicIndice, frameFloorPitD3L);
+ drawFloorPitOrStairsBitmap(kDMGraphicIdxFloorPitD3L, frameFloorPitD3L);
// no break on purpose
case kDMElementTypeTeleporter:
case kDMElementTypeCorridor:
- order = k0x3421_CellOrder_BackLeft_BackRight_FrontLeft_FrontRight;
+ order = kDMCellOrderBackLeftBackRightFrontLeftFrontRight;
/* BUG0_64 Floor ornaments are drawn over open pits. There is no check to prevent drawing floor ornaments over open pits */
drawFloorOrnament(squareAspect[kDMSquareAspectFloorOrn], kDMViewFloorD3L);
break;
@@ -1296,10 +1320,10 @@ void DisplayMan::drawSquareD3L(Direction dir, int16 posX, int16 posY) {
}
if (!skip)
- drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[kDMSquareAspectFirstGroupOrObject]), dir, posX, posY, k1_ViewSquare_D3L, order);
+ drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[kDMSquareAspectFirstGroupOrObject]), dir, posX, posY, kDMViewSquareD3L, order);
if ((squareAspect[kDMSquareAspectElement] == kDMElementTypeTeleporter) && squareAspect[kDMSquareAspectTeleporterVisible])
- drawField(&_fieldAspects188[k1_ViewSquare_D3L], _frameWalls163[k1_ViewSquare_D3L]._box);
+ drawField(&_fieldAspects188[kDMViewSquareD3L], _frameWalls163[kDMViewSquareD3L]._box);
}
void DisplayMan::drawSquareD3R(Direction dir, int16 posX, int16 posY) {
@@ -1321,7 +1345,7 @@ void DisplayMan::drawSquareD3R(Direction dir, int16 posX, int16 posY) {
Frame(180, 197, 28, 67, 24, 41, 24, 0) /* Right Horizontal Closed three fourth */
);
- int16 order;
+ CellOrder order = kDMCellOrderNone;
uint16 squareAspect[5];
bool skip = false;
@@ -1333,27 +1357,27 @@ void DisplayMan::drawSquareD3R(Direction dir, int16 posX, int16 posY) {
else
drawFloorPitOrStairsBitmapFlippedHorizontally(_stairsNativeBitmapIndexDownFrontD3L, frameStairsDownFrontD3R);
- order = k0x4312_CellOrder_BackRight_BackLeft_FrontRight_FrontLeft;
+ order = kDMCellOrderBackRightBackLeftFrontRightFrontLeft;
/* BUG0_64 Floor ornaments are drawn over open pits. There is no check to prevent drawing floor ornaments over open pits */
drawFloorOrnament(squareAspect[kDMSquareAspectFloorOrn], kDMViewFloorD3R);
break;
case kDMElementTypeWall:
- drawWallSetBitmap(_bitmapWallSetD3LCR, _frameWalls163[k2_ViewSquare_D3R]);
+ drawWallSetBitmap(_bitmapWallSetD3LCR, _frameWalls163[kDMViewSquareD3R]);
isDrawnWallOrnAnAlcove(squareAspect[kDMSquareAspectLeftWallOrnOrd], kDMViewWallD3RLeft);
if (isDrawnWallOrnAnAlcove(squareAspect[kDMSquareFrontWallOrnOrd], kDMViewWallD3RFront))
- order = k0x0000_CellOrder_Alcove;
+ order = kDMCellOrderAlcove;
else
return;
break;
case kDMElementTypeDoorSide:
case kDMElementTypeStairsSide:
- order = k0x0412_CellOrder_BackRight_BackLeft_FrontLeft;
+ order = kDMCellOrderBackRightBackLeftFrontLeft;
/* BUG0_64 Floor ornaments are drawn over open pits. There is no check to prevent drawing floor ornaments over open pits */
drawFloorOrnament(squareAspect[kDMSquareAspectFloorOrn], kDMViewFloorD3R);
break;
case kDMElementTypeDoorFront:
drawFloorOrnament(squareAspect[kDMSquareAspectFloorOrn], kDMViewFloorD3R);
- drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[kDMSquareAspectFirstGroupOrObject]), dir, posX, posY, k2_ViewSquare_D3R, k0x0128_CellOrder_DoorPass1_BackRight_BackLeft);
+ drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[kDMSquareAspectFirstGroupOrObject]), dir, posX, posY, kDMViewSquareD3R, kDMCellOrderDoorPass1BackRightBackLeft);
memmove(_tmpBitmap, _bitmapWallSetDoorFrameLeftD3L, 32 * 44);
drawDoorFrameBitmapFlippedHorizontally(_tmpBitmap, &doorFrameRightD3R);
if (((Door *)_vm->_dungeonMan->_thingData[kDMThingTypeDoor])[squareAspect[kDMSquareAspectDoorThingIndex]].hasButton())
@@ -1365,11 +1389,11 @@ void DisplayMan::drawSquareD3R(Direction dir, int16 posX, int16 posY) {
break;;
case kDMElementTypePit:
if (!squareAspect[kDMSquareAspectPitInvisible])
- drawFloorPitOrStairsBitmapFlippedHorizontally(k49_FloorPit_D3L_GraphicIndice, frameFloorPitD3R);
+ drawFloorPitOrStairsBitmapFlippedHorizontally(kDMGraphicIdxFloorPitD3L, frameFloorPitD3R);
// No break on purpose
case kDMElementTypeTeleporter:
case kDMElementTypeCorridor:
- order = k0x4312_CellOrder_BackRight_BackLeft_FrontRight_FrontLeft;
+ order = kDMCellOrderBackRightBackLeftFrontRightFrontLeft;
/* BUG0_64 Floor ornaments are drawn over open pits. There is no check to prevent drawing floor ornaments over open pits */
drawFloorOrnament(squareAspect[kDMSquareAspectFloorOrn], kDMViewFloorD3R);
break;
@@ -1379,10 +1403,10 @@ void DisplayMan::drawSquareD3R(Direction dir, int16 posX, int16 posY) {
}
if (!skip)
- drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[kDMSquareAspectFirstGroupOrObject]), dir, posX, posY, k2_ViewSquare_D3R, order);
+ drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[kDMSquareAspectFirstGroupOrObject]), dir, posX, posY, kDMViewSquareD3R, order);
if ((squareAspect[kDMSquareAspectElement] == kDMElementTypeTeleporter) && squareAspect[kDMSquareAspectTeleporterVisible])
- drawField(&_fieldAspects188[k2_ViewSquare_D3R], _frameWalls163[k2_ViewSquare_D3R]._box);
+ drawField(&_fieldAspects188[kDMViewSquareD3R], _frameWalls163[kDMViewSquareD3R]._box);
}
void DisplayMan::drawSquareD3C(Direction dir, int16 posX, int16 posY) {
@@ -1406,7 +1430,7 @@ void DisplayMan::drawSquareD3C(Direction dir, int16 posX, int16 posY) {
);
uint16 squareAspect[5];
- int16 order;
+ CellOrder order;
bool skip = false;
_vm->_dungeonMan->setSquareAspect(squareAspect, dir, posX, posY);
@@ -1417,20 +1441,20 @@ void DisplayMan::drawSquareD3C(Direction dir, int16 posX, int16 posY) {
else
drawFloorPitOrStairsBitmap(_stairsNativeBitmapIndexDownFrontD3C, frameStairsDownFrontD3C);
- order = k0x3421_CellOrder_BackLeft_BackRight_FrontLeft_FrontRight;
+ order = kDMCellOrderBackLeftBackRightFrontLeftFrontRight;
drawFloorOrnament(squareAspect[kDMSquareAspectFloorOrn], kDMViewFloorD3C); /* BUG0_64 Floor ornaments are drawn over open pits. There is no check to prevent drawing floor ornaments over open pits */
break;
case kDMElementTypeWall:
- drawWallSetBitmapWithoutTransparency(_bitmapWallSetD3LCR, _frameWalls163[k0_ViewSquare_D3C]);
+ drawWallSetBitmapWithoutTransparency(_bitmapWallSetD3LCR, _frameWalls163[kDMViewSquareD3C]);
if (isDrawnWallOrnAnAlcove(squareAspect[kDMSquareFrontWallOrnOrd], kDMViewWallD3CFront))
- order = k0x0000_CellOrder_Alcove;
+ order = kDMCellOrderAlcove;
else
return;
break;
case kDMElementTypeDoorFront:
drawFloorOrnament(squareAspect[kDMSquareAspectFloorOrn], kDMViewFloorD3C);
- drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[kDMSquareAspectFirstGroupOrObject]), dir, posX, posY, k0_ViewSquare_D3C, k0x0218_CellOrder_DoorPass1_BackLeft_BackRight);
+ drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[kDMSquareAspectFirstGroupOrObject]), dir, posX, posY, kDMViewSquareD3C, kDMCellOrderDoorPass1BackLeftBackRight);
drawWallSetBitmap(_bitmapWallSetDoorFrameLeftD3C, doorFrameLeftD3C);
memmove(_tmpBitmap, _bitmapWallSetDoorFrameLeftD3C, 32 * 44);
drawDoorFrameBitmapFlippedHorizontally(_tmpBitmap, &doorFrameRightD3C);
@@ -1439,15 +1463,15 @@ void DisplayMan::drawSquareD3C(Direction dir, int16 posX, int16 posY) {
drawDoor(squareAspect[kDMSquareAspectDoorThingIndex], (DoorState)squareAspect[kDMSquareAspectDoorState],
_doorNativeBitmapIndexFrontD3LCR, getBitmapByteCount(48, 41), kDMDoorOrnamentD3LCR, &doorFrameD3C);
- order = k0x0349_CellOrder_DoorPass2_FrontLeft_FrontRight;
+ order = kDMCellOrderDoorPass2FrontLeftFrontRight;
break;
case kDMElementTypePit:
if (!squareAspect[kDMSquareAspectPitInvisible])
- drawFloorPitOrStairsBitmap(k50_FloorPit_D3C_GraphicIndice, frameFloorPitD3C);
+ drawFloorPitOrStairsBitmap(kDMGraphicIdxFloorPitD3C, frameFloorPitD3C);
// No break on purpose
case kDMElementTypeTeleporter:
case kDMElementTypeCorridor:
- order = k0x3421_CellOrder_BackLeft_BackRight_FrontLeft_FrontRight;
+ order = kDMCellOrderBackLeftBackRightFrontLeftFrontRight;
drawFloorOrnament(squareAspect[kDMSquareAspectFloorOrn], kDMViewFloorD3C); /* BUG0_64 Floor ornaments are drawn over open pits. There is no check to prevent drawing floor ornaments over open pits */
break;
default:
@@ -1456,10 +1480,10 @@ void DisplayMan::drawSquareD3C(Direction dir, int16 posX, int16 posY) {
}
if (!skip)
- drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[kDMSquareAspectFirstGroupOrObject]), dir, posX, posY, k0_ViewSquare_D3C, order);
+ drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[kDMSquareAspectFirstGroupOrObject]), dir, posX, posY, kDMViewSquareD3C, order);
if ((squareAspect[kDMSquareAspectElement] == kDMElementTypeTeleporter) && squareAspect[kDMSquareAspectTeleporterVisible])
- drawField(&_fieldAspects188[k0_ViewSquare_D3C], _frameWalls163[k0_ViewSquare_D3C]._box);
+ drawField(&_fieldAspects188[kDMViewSquareD3C], _frameWalls163[kDMViewSquareD3C]._box);
}
void DisplayMan::drawSquareD2L(Direction dir, int16 posX, int16 posY) {
@@ -1483,7 +1507,7 @@ void DisplayMan::drawSquareD2L(Direction dir, int16 posX, int16 posY) {
Frame(40, 63, 24, 82, 32, 61, 32, 0) /* Right Horizontal Closed three fourth */
);
- int16 order;
+ CellOrder order;
uint16 squareAspect[5];
bool skip = false;
@@ -1495,14 +1519,14 @@ void DisplayMan::drawSquareD2L(Direction dir, int16 posX, int16 posY) {
else
drawFloorPitOrStairsBitmap(_stairsNativeBitmapIndexDownFrontD2L, frameStairsDownFrontD2L);
- order = k0x3421_CellOrder_BackLeft_BackRight_FrontLeft_FrontRight;
+ order = kDMCellOrderBackLeftBackRightFrontLeftFrontRight;
drawFloorOrnament(squareAspect[kDMSquareAspectFloorOrn], kDMViewFloorD2L); /* BUG0_64 Floor ornaments are drawn over open pits. There is no check to prevent drawing floor ornaments over open pits */
break;
case kDMElementTypeWall:
- drawWallSetBitmap(_bitmapWallSetD2LCR, _frameWalls163[k4_ViewSquare_D2L]);
+ drawWallSetBitmap(_bitmapWallSetD2LCR, _frameWalls163[kDMViewSquareD2L]);
isDrawnWallOrnAnAlcove(squareAspect[kDMSquareAspectRightWallOrnOrd], kDMViewWallD2LRight);
if (isDrawnWallOrnAnAlcove(squareAspect[kDMSquareFrontWallOrnOrd], kDMViewWallD2LFront))
- order = k0x0000_CellOrder_Alcove;
+ order = kDMCellOrderAlcove;
else
return;
break;
@@ -1510,24 +1534,24 @@ void DisplayMan::drawSquareD2L(Direction dir, int16 posX, int16 posY) {
drawFloorPitOrStairsBitmap(_stairsNativeBitmapIndexSideD2L, frameStairsSideD2L);
// No break on purpose
case kDMElementTypeDoorSide:
- order = k0x0342_CellOrder_BackRight_FrontLeft_FrontRight;
+ order = kDMCellOrderBackRightFrontLeftFrontRight;
drawFloorOrnament(squareAspect[kDMSquareAspectFloorOrn], kDMViewFloorD2L); /* BUG0_64 Floor ornaments are drawn over open pits. There is no check to prevent drawing floor ornaments over open pits */
break;
case kDMElementTypeDoorFront:
drawFloorOrnament(squareAspect[kDMSquareAspectFloorOrn], kDMViewFloorD2L);
- drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[kDMSquareAspectFirstGroupOrObject]), dir, posX, posY, k4_ViewSquare_D2L, k0x0218_CellOrder_DoorPass1_BackLeft_BackRight);
+ drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[kDMSquareAspectFirstGroupOrObject]), dir, posX, posY, kDMViewSquareD2L, kDMCellOrderDoorPass1BackLeftBackRight);
drawWallSetBitmap(_bitmapWallSetDoorFrameTopD2LCR, doorFrameTopD2L);
drawDoor(squareAspect[kDMSquareAspectDoorThingIndex], (DoorState)squareAspect[kDMSquareAspectDoorState], _doorNativeBitmapIndexFrontD2LCR,
getBitmapByteCount(64, 61), kDMDoorOrnamentD2LCR, &doorFrameD2L);
- order = k0x0349_CellOrder_DoorPass2_FrontLeft_FrontRight;
+ order = kDMCellOrderDoorPass2FrontLeftFrontRight;
break;
case kDMElementTypePit:
- drawFloorPitOrStairsBitmap(squareAspect[kDMSquareAspectPitInvisible] ? k57_FloorPir_Invisible_D2L_GraphicIndice : k51_FloorPit_D2L_GraphicIndice,
+ drawFloorPitOrStairsBitmap(squareAspect[kDMSquareAspectPitInvisible] ? kDMGraphicIdxFloorPitInvisibleD2L : kDMGraphicIdxFloorPitD2L,
frameFloorPitD2L);
// No break on purpose
case kDMElementTypeTeleporter:
case kDMElementTypeCorridor:
- order = k0x3421_CellOrder_BackLeft_BackRight_FrontLeft_FrontRight;
+ order = kDMCellOrderBackLeftBackRightFrontLeftFrontRight;
drawFloorOrnament(squareAspect[kDMSquareAspectFloorOrn], kDMViewFloorD2L); /* BUG0_64 Floor ornaments are drawn over open pits. There is no check to prevent drawing floor ornaments over open pits */
break;
@@ -1537,12 +1561,12 @@ void DisplayMan::drawSquareD2L(Direction dir, int16 posX, int16 posY) {
}
if (!skip) {
- drawCeilingPit(k63_ceilingPit_D2L_GraphicIndice, &FrameCeilingPitD2L, posX, posY, false);
- drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[kDMSquareAspectFirstGroupOrObject]), dir, posX, posY, k4_ViewSquare_D2L, order);
+ drawCeilingPit(kDMGraphicIdxCeilingPitD2L, &FrameCeilingPitD2L, posX, posY, false);
+ drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[kDMSquareAspectFirstGroupOrObject]), dir, posX, posY, kDMViewSquareD2L, order);
}
if ((squareAspect[kDMSquareAspectElement] == kDMElementTypeTeleporter) && squareAspect[kDMSquareAspectTeleporterVisible])
- drawField(&_fieldAspects188[k4_ViewSquare_D2L], _frameWalls163[k4_ViewSquare_D2L]._box);
+ drawField(&_fieldAspects188[kDMViewSquareD2L], _frameWalls163[kDMViewSquareD2L]._box);
}
void DisplayMan::drawSquareD2R(Direction dir, int16 posX, int16 posY) {
@@ -1563,10 +1587,10 @@ void DisplayMan::drawSquareD2R(Direction dir, int16 posX, int16 posY) {
Frame(160, 183, 24, 82, 32, 61, 8, 0), /* Left Horizontal Closed three fourth */
Frame(216, 223, 24, 82, 32, 61, 32, 0), /* Right Horizontal Closed one fourth */
Frame(208, 223, 24, 82, 32, 61, 32, 0), /* Right Horizontal Closed half */
- Frame(200, 223, 24, 82, 32, 61, 32, 0) /* Right Horizontal Closed three fourth */
+ Frame(200, 223, 24, 82, 32, 61, 32, 0) /* Right Horizontal Closed three fourth */
);
- int16 order;
+ CellOrder order;
uint16 squareAspect[5];
bool skip = false;
@@ -1578,16 +1602,16 @@ void DisplayMan::drawSquareD2R(Direction dir, int16 posX, int16 posY) {
else
drawFloorPitOrStairsBitmapFlippedHorizontally(_stairsNativeBitmapIndexDownFrontD2L, frameStairsDownFrontD2R);
- order = k0x4312_CellOrder_BackRight_BackLeft_FrontRight_FrontLeft;
+ order = kDMCellOrderBackRightBackLeftFrontRightFrontLeft;
/* BUG0_64 Floor ornaments are drawn over open pits. There is no check to prevent drawing floor ornaments over open pits */
drawFloorOrnament(squareAspect[kDMSquareAspectFloorOrn], kDMViewFloorD2R);
- drawCeilingPit(k63_ceilingPit_D2L_GraphicIndice, &frameCeilingPitD2R, posX, posY, true);
+ drawCeilingPit(kDMGraphicIdxCeilingPitD2L, &frameCeilingPitD2R, posX, posY, true);
break;
case kDMElementTypeWall:
- drawWallSetBitmap(_bitmapWallSetD2LCR, _frameWalls163[k5_ViewSquare_D2R]);
+ drawWallSetBitmap(_bitmapWallSetD2LCR, _frameWalls163[kDMViewSquareD2R]);
isDrawnWallOrnAnAlcove(squareAspect[kDMSquareAspectLeftWallOrnOrd], kDMViewWallD2RLeft);
if (isDrawnWallOrnAnAlcove(squareAspect[kDMSquareFrontWallOrnOrd], kDMViewWallD2RFront))
- order = k0x0000_CellOrder_Alcove;
+ order = kDMCellOrderAlcove;
else
return;
break;
@@ -1595,29 +1619,29 @@ void DisplayMan::drawSquareD2R(Direction dir, int16 posX, int16 posY) {
drawFloorPitOrStairsBitmapFlippedHorizontally(_stairsNativeBitmapIndexSideD2L, frameStairsSideD2R);
// No break on purpose
case kDMElementTypeDoorSide:
- order = k0x0431_CellOrder_BackLeft_FrontRight_FrontLeft;
+ order = kDMCellOrderBackLeftFrontRightFrontLeft;
/* BUG0_64 Floor ornaments are drawn over open pits. There is no check to prevent drawing floor ornaments over open pits */
drawFloorOrnament(squareAspect[kDMSquareAspectFloorOrn], kDMViewFloorD2R);
- drawCeilingPit(k63_ceilingPit_D2L_GraphicIndice, &frameCeilingPitD2R, posX, posY, true);
+ drawCeilingPit(kDMGraphicIdxCeilingPitD2L, &frameCeilingPitD2R, posX, posY, true);
break;
case kDMElementTypeDoorFront:
drawFloorOrnament(squareAspect[kDMSquareAspectFloorOrn], kDMViewFloorD2R);
- drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[kDMSquareAspectFirstGroupOrObject]), dir, posX, posY, k5_ViewSquare_D2R, k0x0128_CellOrder_DoorPass1_BackRight_BackLeft);
+ drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[kDMSquareAspectFirstGroupOrObject]), dir, posX, posY, kDMViewSquareD2R, kDMCellOrderDoorPass1BackRightBackLeft);
drawWallSetBitmap(_bitmapWallSetDoorFrameTopD2LCR, doorFrameTopD2R);
drawDoor(squareAspect[kDMSquareAspectDoorThingIndex], (DoorState)squareAspect[kDMSquareAspectDoorState],
_doorNativeBitmapIndexFrontD2LCR, getBitmapByteCount(64, 61), kDMDoorOrnamentD2LCR, &doorFrameD2R);
- order = k0x0439_CellOrder_DoorPass2_FrontRight_FrontLeft;
+ order = kDMCellOrderDoorPass2FrontRightFrontLeft;
break;
case kDMElementTypePit:
drawFloorPitOrStairsBitmapFlippedHorizontally(
- squareAspect[kDMSquareAspectPitInvisible] ? k57_FloorPir_Invisible_D2L_GraphicIndice : k51_FloorPit_D2L_GraphicIndice, frameFloorPitD2R);
+ squareAspect[kDMSquareAspectPitInvisible] ? kDMGraphicIdxFloorPitInvisibleD2L : kDMGraphicIdxFloorPitD2L, frameFloorPitD2R);
// No break on purpose
case kDMElementTypeTeleporter:
case kDMElementTypeCorridor:
- order = k0x4312_CellOrder_BackRight_BackLeft_FrontRight_FrontLeft;
+ order = kDMCellOrderBackRightBackLeftFrontRightFrontLeft;
/* BUG0_64 Floor ornaments are drawn over open pits. There is no check to prevent drawing floor ornaments over open pits */
drawFloorOrnament(squareAspect[kDMSquareAspectFloorOrn], kDMViewFloorD2R);
- drawCeilingPit(k63_ceilingPit_D2L_GraphicIndice, &frameCeilingPitD2R, posX, posY, true);
+ drawCeilingPit(kDMGraphicIdxCeilingPitD2L, &frameCeilingPitD2R, posX, posY, true);
break;
default:
skip = true;
@@ -1625,10 +1649,10 @@ void DisplayMan::drawSquareD2R(Direction dir, int16 posX, int16 posY) {
}
if (!skip)
- drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[kDMSquareAspectFirstGroupOrObject]), dir, posX, posY, k5_ViewSquare_D2R, order);
+ drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[kDMSquareAspectFirstGroupOrObject]), dir, posX, posY, kDMViewSquareD2R, order);
if ((squareAspect[kDMSquareAspectElement] == kDMElementTypeTeleporter) && squareAspect[kDMSquareAspectTeleporterVisible])
- drawField(&_fieldAspects188[k5_ViewSquare_D2R], _frameWalls163[k5_ViewSquare_D2R]._box);
+ drawField(&_fieldAspects188[kDMViewSquareD2R], _frameWalls163[kDMViewSquareD2R]._box);
}
void DisplayMan::drawSquareD2C(Direction dir, int16 posX, int16 posY) {
@@ -1653,7 +1677,7 @@ void DisplayMan::drawSquareD2C(Direction dir, int16 posX, int16 posY) {
Frame(120, 143, 24, 82, 32, 61, 32, 0) /* Right Horizontal Closed three fourth */
);
- int16 order;
+ CellOrder order;
uint16 squareAspect[5];
bool skip = false;
@@ -1665,21 +1689,21 @@ void DisplayMan::drawSquareD2C(Direction dir, int16 posX, int16 posY) {
else
drawFloorPitOrStairsBitmap(_stairsNativeBitmapIndexDownFrontD2C, frameStairsDownFrontD2C);
- order = k0x3421_CellOrder_BackLeft_BackRight_FrontLeft_FrontRight;
+ order = kDMCellOrderBackLeftBackRightFrontLeftFrontRight;
/* BUG0_64 Floor ornaments are drawn over open pits. There is no check to prevent drawing floor ornaments over open pits */
drawFloorOrnament(squareAspect[kDMSquareAspectFloorOrn], kDMViewFloorD2C);
- drawCeilingPit(k64_ceilingPitD2C_GraphicIndice, &frameCeilingPitD2C, posX, posY, false);
+ drawCeilingPit(kDMGraphicIdxCeilingPitD2C, &frameCeilingPitD2C, posX, posY, false);
break;
case kDMElementTypeWall:
- drawWallSetBitmapWithoutTransparency(_bitmapWallSetD2LCR, _frameWalls163[k3_ViewSquare_D2C]);
+ drawWallSetBitmapWithoutTransparency(_bitmapWallSetD2LCR, _frameWalls163[kDMViewSquareD2C]);
if (isDrawnWallOrnAnAlcove(squareAspect[kDMSquareFrontWallOrnOrd], kDMViewWallD2CFront))
- order = k0x0000_CellOrder_Alcove;
+ order = kDMCellOrderAlcove;
else
return;
break;
case kDMElementTypeDoorFront:
drawFloorOrnament(squareAspect[kDMSquareAspectFloorOrn], kDMViewFloorD2C);
- drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[kDMSquareAspectFirstGroupOrObject]), dir, posX, posY, k3_ViewSquare_D2C, k0x0218_CellOrder_DoorPass1_BackLeft_BackRight);
+ drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[kDMSquareAspectFirstGroupOrObject]), dir, posX, posY, kDMViewSquareD2C, kDMCellOrderDoorPass1BackLeftBackRight);
drawWallSetBitmap(_bitmapWallSetDoorFrameTopD2LCR, doorFrameTopD2C);
drawWallSetBitmap(_bitmapWallSetDoorFrameLeftD2C, doorFrameLeftD2C);
memcpy(_tmpBitmap, _bitmapWallSetDoorFrameLeftD2C, 48 * 65);
@@ -1689,17 +1713,17 @@ void DisplayMan::drawSquareD2C(Direction dir, int16 posX, int16 posY) {
drawDoor(squareAspect[kDMSquareAspectDoorThingIndex], (DoorState)squareAspect[kDMSquareAspectDoorState],
_doorNativeBitmapIndexFrontD2LCR, getBitmapByteCount(64, 61), kDMDoorOrnamentD2LCR, &doorFrameD2C);
- order = k0x0349_CellOrder_DoorPass2_FrontLeft_FrontRight;
+ order = kDMCellOrderDoorPass2FrontLeftFrontRight;
break;
case kDMElementTypePit:
- drawFloorPitOrStairsBitmap(squareAspect[kDMSquareAspectPitInvisible] ? k58_FloorPit_invisible_D2C_GraphicIndice : k52_FloorPit_D2C_GraphicIndice, frameFloorPitD2C);
+ drawFloorPitOrStairsBitmap(squareAspect[kDMSquareAspectPitInvisible] ? kDMGraphicIdxFloorPitInvisibleD2C : kDMGraphicIdxFloorPitD2C, frameFloorPitD2C);
// No break on purpose
case kDMElementTypeTeleporter:
case kDMElementTypeCorridor:
- order = k0x3421_CellOrder_BackLeft_BackRight_FrontLeft_FrontRight;
+ order = kDMCellOrderBackLeftBackRightFrontLeftFrontRight;
/* BUG0_64 Floor ornaments are drawn over open pits. There is no check to prevent drawing floor ornaments over open pits */
drawFloorOrnament(squareAspect[kDMSquareAspectFloorOrn], kDMViewFloorD2C);
- drawCeilingPit(k64_ceilingPitD2C_GraphicIndice, &frameCeilingPitD2C, posX, posY, false);
+ drawCeilingPit(kDMGraphicIdxCeilingPitD2C, &frameCeilingPitD2C, posX, posY, false);
break;
default:
skip = true;
@@ -1707,10 +1731,10 @@ void DisplayMan::drawSquareD2C(Direction dir, int16 posX, int16 posY) {
}
if (!skip)
- drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[kDMSquareAspectFirstGroupOrObject]), dir, posX, posY, k3_ViewSquare_D2C, order);
+ drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[kDMSquareAspectFirstGroupOrObject]), dir, posX, posY, kDMViewSquareD2C, order);
if ((squareAspect[kDMSquareAspectElement] == kDMElementTypeTeleporter) && squareAspect[kDMSquareAspectTeleporterVisible])
- drawField(&_fieldAspects188[k3_ViewSquare_D2C], _frameWalls163[k3_ViewSquare_D2C]._box);
+ drawField(&_fieldAspects188[kDMViewSquareD2C], _frameWalls163[kDMViewSquareD2C]._box);
}
void DisplayMan::drawSquareD1L(Direction dir, int16 posX, int16 posY) {
@@ -1735,7 +1759,7 @@ void DisplayMan::drawSquareD1L(Direction dir, int16 posX, int16 posY) {
Frame(0, 31, 17, 102, 48, 88, 52, 0) /* Right Horizontal Closed three fourth */
);
- int16 order;
+ CellOrder order;
uint16 squareAspect[5];
bool skip = false;
@@ -1747,13 +1771,13 @@ void DisplayMan::drawSquareD1L(Direction dir, int16 posX, int16 posY) {
else
drawFloorPitOrStairsBitmap(_stairsNativeBitmapIndexDownFrontD1L, frameStairsDownFrontD1L);
- order = k0x0032_CellOrder_BackRight_FrontRight;
+ order = kDMCellOrderBackRightFrontRight;
/* BUG0_64 Floor ornaments are drawn over open pits. There is no check to prevent drawing floor ornaments over open pits */
drawFloorOrnament(squareAspect[kDMSquareAspectFloorOrn], kDMViewFloorD1L);
- drawCeilingPit(k65_ceilingPitD1L_GraphicIndice, &frameCeilingPitD1L, posX, posY, false);
+ drawCeilingPit(kDMGraphicIdxCeilingPitD1L, &frameCeilingPitD1L, posX, posY, false);
break;
case kDMElementTypeWall:
- drawWallSetBitmap(_bitmapWallSetD1LCR, _frameWalls163[k7_ViewSquare_D1L]);
+ drawWallSetBitmap(_bitmapWallSetD1LCR, _frameWalls163[kDMViewSquareD1L]);
isDrawnWallOrnAnAlcove(squareAspect[kDMSquareAspectRightWallOrnOrd], kDMViewWallD1LRight);
return;
case kDMElementTypeStairsSide:
@@ -1763,28 +1787,28 @@ void DisplayMan::drawSquareD1L(Direction dir, int16 posX, int16 posY) {
drawFloorPitOrStairsBitmap(_stairsNativeBitmapIndexDownSideD1L, frameStairsDownSideD1L);
// No break on purpose
case kDMElementTypeDoorSide:
- order = k0x0032_CellOrder_BackRight_FrontRight;
+ order = kDMCellOrderBackRightFrontRight;
/* BUG0_64 Floor ornaments are drawn over open pits. There is no check to prevent drawing floor ornaments over open pits */
drawFloorOrnament(squareAspect[kDMSquareAspectFloorOrn], kDMViewFloorD1L);
- drawCeilingPit(k65_ceilingPitD1L_GraphicIndice, &frameCeilingPitD1L, posX, posY, false);
+ drawCeilingPit(kDMGraphicIdxCeilingPitD1L, &frameCeilingPitD1L, posX, posY, false);
break;
case kDMElementTypeDoorFront:
drawFloorOrnament(squareAspect[kDMSquareAspectFloorOrn], kDMViewFloorD1L);
- drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[kDMSquareAspectFirstGroupOrObject]), dir, posX, posY, k7_ViewSquare_D1L, k0x0028_CellOrder_DoorPass1_BackRight);
+ drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[kDMSquareAspectFirstGroupOrObject]), dir, posX, posY, kDMViewSquareD1L, kDMCellOrderDoorPass1BackRight);
drawWallSetBitmap(_bitmapWallSetDoorFrameTopD1LCR, doorFrameTopD1L);
drawDoor(squareAspect[kDMSquareAspectDoorThingIndex], (DoorState)squareAspect[kDMSquareAspectDoorState],
_doorNativeBitmapIndexFrontD1LCR, getBitmapByteCount(96, 88), kDMDoorOrnamentD1LCR, &doorFrameD1L);
- order = k0x0039_CellOrder_DoorPass2_FrontRight;
+ order = kDMCellOrderDoorPass2FrontRight;
break;
case kDMElementTypePit:
- drawFloorPitOrStairsBitmap(squareAspect[kDMSquareAspectPitInvisible] ? k59_floorPit_invisible_D1L_GraphicIndice : k53_FloorPit_D1L_GraphicIndice, frameFloorPitD1L);
+ drawFloorPitOrStairsBitmap(squareAspect[kDMSquareAspectPitInvisible] ? kDMGraphicIdxFloorPitInvisibleD1L : kDMGraphicIdxFloorPitD1L, frameFloorPitD1L);
// No break on purpose
case kDMElementTypeTeleporter:
case kDMElementTypeCorridor:
- order = k0x0032_CellOrder_BackRight_FrontRight;
+ order = kDMCellOrderBackRightFrontRight;
/* BUG0_64 Floor ornaments are drawn over open pits. There is no check to prevent drawing floor ornaments over open pits */
drawFloorOrnament(squareAspect[kDMSquareAspectFloorOrn], kDMViewFloorD1L);
- drawCeilingPit(k65_ceilingPitD1L_GraphicIndice, &frameCeilingPitD1L, posX, posY, false);
+ drawCeilingPit(kDMGraphicIdxCeilingPitD1L, &frameCeilingPitD1L, posX, posY, false);
break;
default:
skip = true;
@@ -1792,10 +1816,10 @@ void DisplayMan::drawSquareD1L(Direction dir, int16 posX, int16 posY) {
}
if (!skip)
- drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[kDMSquareAspectFirstGroupOrObject]), dir, posX, posY, k7_ViewSquare_D1L, order);
+ drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[kDMSquareAspectFirstGroupOrObject]), dir, posX, posY, kDMViewSquareD1L, order);
if ((squareAspect[kDMSquareAspectElement] == kDMElementTypeTeleporter) && squareAspect[kDMSquareAspectTeleporterVisible])
- drawField(&_fieldAspects188[k7_ViewSquare_D1L], _frameWalls163[k7_ViewSquare_D1L]._box);
+ drawField(&_fieldAspects188[kDMViewSquareD1L], _frameWalls163[kDMViewSquareD1L]._box);
}
void DisplayMan::drawSquareD1R(Direction dir, int16 posX, int16 posY) {
@@ -1820,7 +1844,7 @@ void DisplayMan::drawSquareD1R(Direction dir, int16 posX, int16 posY) {
Frame(0, 0, 0, 0, 0, 0, 0, 0) /* Right Horizontal Closed three fourth */
);
- int16 order;
+ CellOrder order;
uint16 squareAspect[5];
bool skip = false;
@@ -1832,12 +1856,12 @@ void DisplayMan::drawSquareD1R(Direction dir, int16 posX, int16 posY) {
else
drawFloorPitOrStairsBitmapFlippedHorizontally(_stairsNativeBitmapIndexDownFrontD1L, frameStairsDownFrontD1R);
- order = k0x0041_CellOrder_BackLeft_FrontLeft;
+ order = kDMCellOrderBackLeftFrontLeft;
drawFloorOrnament(squareAspect[kDMSquareAspectFloorOrn], kDMViewFloorD1R); /* BUG0_64 Floor ornaments are drawn over open pits. There is no check to prevent drawing floor ornaments over open pits */
- drawCeilingPit(k65_ceilingPitD1L_GraphicIndice, &frameCeilingPitD1R, posX, posY, true);
+ drawCeilingPit(kDMGraphicIdxCeilingPitD1L, &frameCeilingPitD1R, posX, posY, true);
break;
case kDMElementTypeWall:
- drawWallSetBitmap(_bitmapWallSetD1LCR, _frameWalls163[k8_ViewSquare_D1R]);
+ drawWallSetBitmap(_bitmapWallSetD1LCR, _frameWalls163[kDMViewSquareD1R]);
isDrawnWallOrnAnAlcove(squareAspect[kDMSquareAspectLeftWallOrnOrd], kDMViewWallD1RLeft);
return;
case kDMElementTypeStairsSide:
@@ -1848,27 +1872,27 @@ void DisplayMan::drawSquareD1R(Direction dir, int16 posX, int16 posY) {
// No break on purpose
case kDMElementTypeDoorSide:
- order = k0x0041_CellOrder_BackLeft_FrontLeft;
+ order = kDMCellOrderBackLeftFrontLeft;
drawFloorOrnament(squareAspect[kDMSquareAspectFloorOrn], kDMViewFloorD1R); /* BUG0_64 Floor ornaments are drawn over open pits. There is no check to prevent drawing floor ornaments over open pits */
- drawCeilingPit(k65_ceilingPitD1L_GraphicIndice, &frameCeilingPitD1R, posX, posY, true);
+ drawCeilingPit(kDMGraphicIdxCeilingPitD1L, &frameCeilingPitD1R, posX, posY, true);
break;
case kDMElementTypeDoorFront:
drawFloorOrnament(squareAspect[kDMSquareAspectFloorOrn], kDMViewFloorD1R);
- drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[kDMSquareAspectFirstGroupOrObject]), dir, posX, posY, k8_ViewSquare_D1R, k0x0018_CellOrder_DoorPass1_BackLeft);
+ drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[kDMSquareAspectFirstGroupOrObject]), dir, posX, posY, kDMViewSquareD1R, kDMCellOrderDoorPass1BackLeft);
drawWallSetBitmap(_bitmapWallSetDoorFrameTopD1LCR, doorFrameTopD1R);
drawDoor(squareAspect[kDMSquareAspectDoorThingIndex], (DoorState)squareAspect[kDMSquareAspectDoorState],
_doorNativeBitmapIndexFrontD1LCR, getBitmapByteCount(96, 88), kDMDoorOrnamentD1LCR, &doorFrameD1R);
- order = k0x0049_CellOrder_DoorPass2_FrontLeft;
+ order = kDMCellOrderDoorPass2FrontLeft;
break;
case kDMElementTypePit:
- drawFloorPitOrStairsBitmapFlippedHorizontally(squareAspect[kDMSquareAspectPitInvisible] ? k59_floorPit_invisible_D1L_GraphicIndice
- : k53_FloorPit_D1L_GraphicIndice, frameFloorPitD1R);
+ drawFloorPitOrStairsBitmapFlippedHorizontally(squareAspect[kDMSquareAspectPitInvisible] ? kDMGraphicIdxFloorPitInvisibleD1L
+ : kDMGraphicIdxFloorPitD1L, frameFloorPitD1R);
// No break on purpose
case kDMElementTypeTeleporter:
case kDMElementTypeCorridor:
- order = k0x0041_CellOrder_BackLeft_FrontLeft;
+ order = kDMCellOrderBackLeftFrontLeft;
drawFloorOrnament(squareAspect[kDMSquareAspectFloorOrn], kDMViewFloorD1R); /* BUG0_64 Floor ornaments are drawn over open pits. There is no check to prevent drawing floor ornaments over open pits */
- drawCeilingPit(k65_ceilingPitD1L_GraphicIndice, &frameCeilingPitD1R, posX, posY, true);
+ drawCeilingPit(kDMGraphicIdxCeilingPitD1L, &frameCeilingPitD1R, posX, posY, true);
break;
default:
skip = true;
@@ -1876,10 +1900,10 @@ void DisplayMan::drawSquareD1R(Direction dir, int16 posX, int16 posY) {
}
if (!skip)
- drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[kDMSquareAspectFirstGroupOrObject]), dir, posX, posY, k8_ViewSquare_D1R, order);
+ drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[kDMSquareAspectFirstGroupOrObject]), dir, posX, posY, kDMViewSquareD1R, order);
if ((squareAspect[kDMSquareAspectElement] == kDMElementTypeTeleporter) && squareAspect[kDMSquareAspectTeleporterVisible])
- drawField(&_fieldAspects188[k8_ViewSquare_D1R], _frameWalls163[k8_ViewSquare_D1R]._box);
+ drawField(&_fieldAspects188[kDMViewSquareD1R], _frameWalls163[kDMViewSquareD1R]._box);
}
void DisplayMan::drawSquareD1C(Direction dir, int16 posX, int16 posY) {
@@ -1890,7 +1914,7 @@ void DisplayMan::drawSquareD1C(Direction dir, int16 posX, int16 posY) {
static Frame frameCeilingPitD1C = Frame(32, 191, 8, 16, 80, 9, 0, 0); // @ G0156_s_Graphic558_Frame_CeilingPit_D1C
static Box boxThievesEyeVisibleArea(0, 95, 0, 94); // @ G0107_s_Graphic558_Box_ThievesEye_VisibleArea
- int16 order;
+ CellOrder order;
uint16 squareAspect[5];
bool skip = false;
@@ -1902,39 +1926,39 @@ void DisplayMan::drawSquareD1C(Direction dir, int16 posX, int16 posY) {
else
drawFloorPitOrStairsBitmap(_stairsNativeBitmapIndexDownFrontD1C, frameStairsDownFrontD1C);
- order = k0x3421_CellOrder_BackLeft_BackRight_FrontLeft_FrontRight;
+ order = kDMCellOrderBackLeftBackRightFrontLeftFrontRight;
/* BUG0_64 Floor ornaments are drawn over open pits. There is no check to prevent drawing floor ornaments over open pits */
drawFloorOrnament(squareAspect[kDMSquareAspectFloorOrn], kDMViewFloorD1C);
- drawCeilingPit(k66_ceilingPitD1C_GraphicIndice, &frameCeilingPitD1C, posX, posY, false);
+ drawCeilingPit(kDMGraphicIdxCeilingPitD1C, &frameCeilingPitD1C, posX, posY, false);
break;
case kDMElementTypeWall:
_vm->_dungeonMan->_isFacingAlcove = false;
_vm->_dungeonMan->_isFacingViAltar = false;
_vm->_dungeonMan->_isFacingFountain = false;
if (_vm->_championMan->_party._event73Count_ThievesEye) {
- isDerivedBitmapInCache(k1_DerivedBitmapThievesEyeVisibleArea);
- blitToBitmap(_bitmapViewport, getDerivedBitmap(k1_DerivedBitmapThievesEyeVisibleArea),
- boxThievesEyeVisibleArea, _boxThievesEyeViewPortVisibleArea._x1, _boxThievesEyeViewPortVisibleArea._y1,
- k112_byteWidthViewport, 48, kM1_ColorNoTransparency, 136, 95);
- byte *bitmap = getNativeBitmapOrGraphic(k41_holeInWall_GraphicIndice);
- blitToBitmap(bitmap, getDerivedBitmap(k1_DerivedBitmapThievesEyeVisibleArea),
- boxThievesEyeVisibleArea, 0, 0, 48, 48, k10_ColorFlesh, 95, 95);
+ isDerivedBitmapInCache(kDMDerivedBitmapThievesEyeVisibleArea);
+ blitToBitmap(_bitmapViewport, getDerivedBitmap(kDMDerivedBitmapThievesEyeVisibleArea),
+ boxThievesEyeVisibleArea, _boxThievesEyeViewPortVisibleArea._rect.left, _boxThievesEyeViewPortVisibleArea._rect.top,
+ k112_byteWidthViewport, 48, kDMColorNoTransparency, 136, 95);
+ byte *bitmap = getNativeBitmapOrGraphic(kDMGraphicIdxHoleInWall);
+ blitToBitmap(bitmap, getDerivedBitmap(kDMDerivedBitmapThievesEyeVisibleArea),
+ boxThievesEyeVisibleArea, 0, 0, 48, 48, kDMColorFlesh, 95, 95);
}
- drawWallSetBitmapWithoutTransparency(_bitmapWallSetD1LCR, _frameWalls163[k6_ViewSquare_D1C]);
+ drawWallSetBitmapWithoutTransparency(_bitmapWallSetD1LCR, _frameWalls163[kDMViewSquareD1C]);
if (isDrawnWallOrnAnAlcove(squareAspect[kDMSquareFrontWallOrnOrd], kDMViewWallD1CFront))
- drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[kDMSquareAspectFirstGroupOrObject]), dir, posX, posY, k6_ViewSquare_D1C, k0x0000_CellOrder_Alcove);
+ drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[kDMSquareAspectFirstGroupOrObject]), dir, posX, posY, kDMViewSquareD1C, kDMCellOrderAlcove);
if (_vm->_championMan->_party._event73Count_ThievesEye) {
- blitToBitmap(getDerivedBitmap(k1_DerivedBitmapThievesEyeVisibleArea),
+ blitToBitmap(getDerivedBitmap(kDMDerivedBitmapThievesEyeVisibleArea),
_bitmapViewport, _boxThievesEyeViewPortVisibleArea, 0, 0,
- 48, k112_byteWidthViewport, k9_ColorGold, 95, k136_heightViewport); /* BUG0_74 */
- addDerivedBitmap(k1_DerivedBitmapThievesEyeVisibleArea);
- releaseBlock(k1_DerivedBitmapThievesEyeVisibleArea | 0x8000);
+ 48, k112_byteWidthViewport, kDMColorGold, 95, k136_heightViewport); /* BUG0_74 */
+ addDerivedBitmap(kDMDerivedBitmapThievesEyeVisibleArea);
+ releaseBlock(kDMDerivedBitmapThievesEyeVisibleArea | 0x8000);
}
return;
case kDMElementTypeDoorFront:
drawFloorOrnament(squareAspect[kDMSquareAspectFloorOrn], kDMViewFloorD1C);
- drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[kDMSquareAspectFirstGroupOrObject]), dir, posX, posY, k6_ViewSquare_D1C, k0x0218_CellOrder_DoorPass1_BackLeft_BackRight);
+ drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[kDMSquareAspectFirstGroupOrObject]), dir, posX, posY, kDMViewSquareD1C, kDMCellOrderDoorPass1BackLeftBackRight);
drawWallSetBitmap(_bitmapWallSetDoorFrameTopD1LCR, doorFrameTopD1C);
drawWallSetBitmap(_bitmapWallSetDoorFrameLeftD1C, _doorFrameLeftD1C);
drawWallSetBitmap(_bitmapWallSetDoorFrameRightD1C, _doorFrameRightD1C);
@@ -1943,17 +1967,17 @@ void DisplayMan::drawSquareD1C(Direction dir, int16 posX, int16 posY) {
drawDoor(squareAspect[kDMSquareAspectDoorThingIndex], (DoorState)squareAspect[kDMSquareAspectDoorState],
_doorNativeBitmapIndexFrontD1LCR, getBitmapByteCount(96, 88), kDMDoorOrnamentD1LCR, _doorFrameD1C);
- order = k0x0349_CellOrder_DoorPass2_FrontLeft_FrontRight;
+ order = kDMCellOrderDoorPass2FrontLeftFrontRight;
break;
case kDMElementTypePit:
- drawFloorPitOrStairsBitmap(squareAspect[kDMSquareAspectPitInvisible] ? k60_floorPitInvisibleD1C_GraphicIndice : k54_FloorPit_D1C_GraphicIndice, frameFloorPitD1C);
+ drawFloorPitOrStairsBitmap(squareAspect[kDMSquareAspectPitInvisible] ? kDMGraphicIdxFloorPitInvisibleD1C : kDMGraphicIdxFloorPitD1C, frameFloorPitD1C);
// No break on purpose
case kDMElementTypeTeleporter:
case kDMElementTypeCorridor:
- order = k0x3421_CellOrder_BackLeft_BackRight_FrontLeft_FrontRight;
+ order = kDMCellOrderBackLeftBackRightFrontLeftFrontRight;
/* BUG0_64 Floor ornaments are drawn over open pits. There is no check to prevent drawing floor ornaments over open pits */
drawFloorOrnament(squareAspect[kDMSquareAspectFloorOrn], kDMViewFloorD1C);
- drawCeilingPit(k66_ceilingPitD1C_GraphicIndice, &frameCeilingPitD1C, posX, posY, false);
+ drawCeilingPit(kDMGraphicIdxCeilingPitD1C, &frameCeilingPitD1C, posX, posY, false);
break;
default:
skip = true;
@@ -1961,10 +1985,10 @@ void DisplayMan::drawSquareD1C(Direction dir, int16 posX, int16 posY) {
}
if (!skip)
- drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[kDMSquareAspectFirstGroupOrObject]), dir, posX, posY, k6_ViewSquare_D1C, order);
+ drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[kDMSquareAspectFirstGroupOrObject]), dir, posX, posY, kDMViewSquareD1C, order);
if ((squareAspect[kDMSquareAspectElement] == kDMElementTypeTeleporter) && squareAspect[kDMSquareAspectTeleporterVisible])
- drawField(&_fieldAspects188[k6_ViewSquare_D1C], _frameWalls163[k6_ViewSquare_D1C]._box);
+ drawField(&_fieldAspects188[kDMViewSquareD1C], _frameWalls163[kDMViewSquareD1C]._box);
}
void DisplayMan::drawSquareD0L(Direction dir, int16 posX, int16 posY) {
@@ -1976,15 +2000,15 @@ void DisplayMan::drawSquareD0L(Direction dir, int16 posX, int16 posY) {
_vm->_dungeonMan->setSquareAspect(squareAspect, dir, posX, posY);
switch (squareAspect[kDMSquareAspectElement]) {
case kDMElementTypeWall:
- drawWallSetBitmap(bitmapWallSetWallD0L, _frameWalls163[k10_ViewSquare_D0L]);
+ drawWallSetBitmap(bitmapWallSetWallD0L, _frameWalls163[kDMViewSquareD0L]);
break;
case kDMElementTypeCorridor:
case kDMElementTypeTeleporter:
case kDMElementTypeDoorSide:
- drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[kDMSquareAspectFirstGroupOrObject]), dir, posX, posY, k10_ViewSquare_D0L, k0x0002_CellOrder_BackRight);
+ drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[kDMSquareAspectFirstGroupOrObject]), dir, posX, posY, kDMViewSquareD0L, kDMCellOrderBackRight);
break;
case kDMElementTypePit:
- drawFloorPitOrStairsBitmap(squareAspect[kDMSquareAspectPitInvisible] ? k61_floorPitInvisibleD0L_GraphicIndice : k55_FloorPit_D0L_GraphicIndice, frameFloorPitD0L);
+ drawFloorPitOrStairsBitmap(squareAspect[kDMSquareAspectPitInvisible] ? kDMGraphicIdxFloorPitInvisibleD0L : kDMGraphicIdxFloorPitD0L, frameFloorPitD0L);
case kDMElementTypeStairsSide:
if (squareAspect[kDMSquareAspectStairsUp])
drawFloorPitOrStairsBitmap(_stairsNativeBitmapIndexSideD0L, frameStairsSideD0L);
@@ -1993,9 +2017,9 @@ void DisplayMan::drawSquareD0L(Direction dir, int16 posX, int16 posY) {
break;
}
- drawCeilingPit(k67_ceilingPitD0L_grahicIndice, &frameCeilingPitD0L, posX, posY, false);
+ drawCeilingPit(kDMGraphicIdxCeilingPitD0L, &frameCeilingPitD0L, posX, posY, false);
if ((squareAspect[kDMSquareAspectElement] == kDMElementTypeTeleporter) && squareAspect[kDMSquareAspectTeleporterVisible])
- drawField(&_fieldAspects188[k10_ViewSquare_D0L], _frameWalls163[k10_ViewSquare_D0L]._box);
+ drawField(&_fieldAspects188[kDMViewSquareD0L], _frameWalls163[kDMViewSquareD0L]._box);
}
void DisplayMan::drawSquareD0R(Direction dir, int16 posX, int16 posY) {
@@ -2011,20 +2035,20 @@ void DisplayMan::drawSquareD0R(Direction dir, int16 posX, int16 posY) {
drawFloorPitOrStairsBitmapFlippedHorizontally(_stairsNativeBitmapIndexSideD0L, frameStairsSideD0R);
return;
case kDMElementTypePit:
- drawFloorPitOrStairsBitmapFlippedHorizontally(squareAspect[kDMSquareAspectPitInvisible] ? k61_floorPitInvisibleD0L_GraphicIndice
- : k55_FloorPit_D0L_GraphicIndice, frameFloorPitD0R);
+ drawFloorPitOrStairsBitmapFlippedHorizontally(squareAspect[kDMSquareAspectPitInvisible] ? kDMGraphicIdxFloorPitInvisibleD0L
+ : kDMGraphicIdxFloorPitD0L, frameFloorPitD0R);
case kDMElementTypeCorridor:
case kDMElementTypeDoorSide:
case kDMElementTypeTeleporter:
- drawCeilingPit(k67_ceilingPitD0L_grahicIndice, &frameCeilingPitD0R, posX, posY, true);
- drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[kDMSquareAspectFirstGroupOrObject]), dir, posX, posY, k11_ViewSquare_D0R, k0x0001_CellOrder_BackLeft);
+ drawCeilingPit(kDMGraphicIdxCeilingPitD0L, &frameCeilingPitD0R, posX, posY, true);
+ drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[kDMSquareAspectFirstGroupOrObject]), dir, posX, posY, kDMViewSquareD0R, kDMCellOrderBackLeft);
break;
case kDMElementTypeWall:
- drawWallSetBitmap(_bitmapWallSetWallD0R, _frameWalls163[k11_ViewSquare_D0R]);
+ drawWallSetBitmap(_bitmapWallSetWallD0R, _frameWalls163[kDMViewSquareD0R]);
return;
}
if ((squareAspect[kDMSquareAspectElement] == kDMElementTypeTeleporter) && squareAspect[kDMSquareAspectTeleporterVisible])
- drawField(&_fieldAspects188[k11_ViewSquare_D0R], _frameWalls163[k11_ViewSquare_D0R]._box);
+ drawField(&_fieldAspects188[kDMViewSquareD0R], _frameWalls163[kDMViewSquareD0R]._box);
}
void DisplayMan::drawSquareD0C(Direction dir, int16 posX, int16 posY) {
@@ -2044,9 +2068,9 @@ void DisplayMan::drawSquareD0C(Direction dir, int16 posX, int16 posY) {
case kDMElementTypeDoorSide:
if (_vm->_championMan->_party._event73Count_ThievesEye) {
memmove(_tmpBitmap, _bitmapWallSetDoorFrameFront, 32 * 123);
- blitToBitmap(getNativeBitmapOrGraphic(k41_holeInWall_GraphicIndice),
- _tmpBitmap, boxThievesEyeHoleInDoorFrame, doorFrameD0C._box._x1 - _boxThievesEyeViewPortVisibleArea._x1,
- 0, 48, 16, k9_ColorGold, 95, 123);
+ blitToBitmap(getNativeBitmapOrGraphic(kDMGraphicIdxHoleInWall),
+ _tmpBitmap, boxThievesEyeHoleInDoorFrame, doorFrameD0C._box._rect.left - _boxThievesEyeViewPortVisibleArea._rect.left,
+ 0, 48, 16, kDMColorGold, 95, 123);
drawWallSetBitmap(_tmpBitmap, doorFrameD0C);
} else
drawWallSetBitmap(_bitmapWallSetDoorFrameFront, doorFrameD0C);
@@ -2061,13 +2085,13 @@ void DisplayMan::drawSquareD0C(Direction dir, int16 posX, int16 posY) {
}
break;
case kDMElementTypePit:
- drawFloorPitOrStairsBitmap(squareAspect[kDMSquareAspectPitInvisible] ? k62_flootPitInvisibleD0C_graphicIndice : k56_FloorPit_D0C_GraphicIndice, frameFloorPitD0C);
+ drawFloorPitOrStairsBitmap(squareAspect[kDMSquareAspectPitInvisible] ? kDMGraphicIdxFloorPitInvisibleD0C : kDMGraphicIdxFloorPitD0C, frameFloorPitD0C);
break;
}
- drawCeilingPit(k68_ceilingPitD0C_graphicIndice, &frameCeilingPitD0C, posX, posY, false);
- drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[kDMSquareAspectFirstGroupOrObject]), dir, posX, posY, k9_ViewSquare_D0C, k0x0021_CellOrder_BackLeft_BackRight);
+ drawCeilingPit(kDMGraphicIdxCeilingPitD0C, &frameCeilingPitD0C, posX, posY, false);
+ drawObjectsCreaturesProjectilesExplosions(Thing(squareAspect[kDMSquareAspectFirstGroupOrObject]), dir, posX, posY, kDMViewSquareD0C, kDMCellOrderBackLeftBackRight);
if ((squareAspect[kDMSquareAspectElement] == kDMElementTypeTeleporter) && squareAspect[kDMSquareAspectTeleporterVisible])
- drawField(&_fieldAspects188[k9_ViewSquare_D0C], _frameWalls163[k9_ViewSquare_D0C]._box);
+ drawField(&_fieldAspects188[kDMViewSquareD0C], _frameWalls163[kDMViewSquareD0C]._box);
}
void DisplayMan::drawDungeon(Direction dir, int16 posX, int16 posY) {
@@ -2083,7 +2107,7 @@ void DisplayMan::drawDungeon(Direction dir, int16 posX, int16 posY) {
_vm->_dungeonMan->_dungeonViewClickableBoxes[i].setToZero();
for (uint16 i = 0; i < 6; ++i)
- _vm->_dungeonMan->_dungeonViewClickableBoxes[i]._x1 = 255;
+ _vm->_dungeonMan->_dungeonViewClickableBoxes[i]._rect.left = 255;
_useFlippedWallAndFootprintsBitmap = (posX + posY + dir) & 1;
if (_useFlippedWallAndFootprintsBitmap) {
@@ -2111,15 +2135,15 @@ void DisplayMan::drawDungeon(Direction dir, int16 posX, int16 posY) {
int16 tmpPosX = posX;
int16 tmpPosY = posY;
_vm->_dungeonMan->mapCoordsAfterRelMovement(dir, 4, -1, tmpPosX, tmpPosY);
- drawObjectsCreaturesProjectilesExplosions(_vm->_dungeonMan->getSquareFirstObject(tmpPosX, tmpPosY), dir, tmpPosX, tmpPosY, kM2_ViewSquare_D4L, k0x0001_CellOrder_BackLeft);
+ drawObjectsCreaturesProjectilesExplosions(_vm->_dungeonMan->getSquareFirstObject(tmpPosX, tmpPosY), dir, tmpPosX, tmpPosY, kViewSquareD4L, kDMCellOrderBackLeft);
tmpPosX = posX;
tmpPosY = posY;
_vm->_dungeonMan->mapCoordsAfterRelMovement(dir, 4, 1, tmpPosX, tmpPosY);
- drawObjectsCreaturesProjectilesExplosions(_vm->_dungeonMan->getSquareFirstObject(tmpPosX, tmpPosY), dir, tmpPosX, tmpPosY, kM1_ViewSquare_D4R, k0x0001_CellOrder_BackLeft);
+ drawObjectsCreaturesProjectilesExplosions(_vm->_dungeonMan->getSquareFirstObject(tmpPosX, tmpPosY), dir, tmpPosX, tmpPosY, kDMViewSquareD4R, kDMCellOrderBackLeft);
tmpPosX = posX;
tmpPosY = posY;
_vm->_dungeonMan->mapCoordsAfterRelMovement(dir, 4, 0, tmpPosX, tmpPosY);
- drawObjectsCreaturesProjectilesExplosions(_vm->_dungeonMan->getSquareFirstObject(tmpPosX, tmpPosY), dir, tmpPosX, tmpPosY, kM3_ViewSquare_D4C, k0x0001_CellOrder_BackLeft);
+ drawObjectsCreaturesProjectilesExplosions(_vm->_dungeonMan->getSquareFirstObject(tmpPosX, tmpPosY), dir, tmpPosX, tmpPosY, kDMViewSquareD4C, kDMCellOrderBackLeft);
tmpPosX = posX;
tmpPosY = posY;
_vm->_dungeonMan->mapCoordsAfterRelMovement(dir, 3, -1, tmpPosX, tmpPosY);
@@ -2181,7 +2205,7 @@ void DisplayMan::drawDungeon(Direction dir, int16 posX, int16 posY) {
void DisplayMan::drawFloorAndCeiling() {
Box box(0, 223, 0, 36);
- fillBoxBitmap(_bitmapViewport, box, k0_ColorBlack, k112_byteWidthViewport, k136_heightViewport);
+ fillBoxBitmap(_bitmapViewport, box, kDMColorBlack, k112_byteWidthViewport, k136_heightViewport);
_drawFloorAndCeilingRequested = false;
}
@@ -2333,21 +2357,21 @@ void DisplayMan::loadCurrentMapGraphics() {
_useByteBoxCoordinates = true;
copyBitmapAndFlipHorizontal(_bitmapWallD3LCRNative = _bitmapWallSetD3LCR, _tmpBitmap,
- _frameWalls163[k0_ViewSquare_D3C]._srcByteWidth, _frameWalls163[k0_ViewSquare_D3C]._srcHeight);
- fillBitmap(_bitmapWallD3LCRFlipped, k10_ColorFlesh, 64, 51);
- blitToBitmap(_tmpBitmap, _bitmapWallD3LCRFlipped, boxWallD3LCR, 11, 0, 64, 64, kM1_ColorNoTransparency, 51, 51);
+ _frameWalls163[kDMViewSquareD3C]._srcByteWidth, _frameWalls163[kDMViewSquareD3C]._srcHeight);
+ fillBitmap(_bitmapWallD3LCRFlipped, kDMColorFlesh, 64, 51);
+ blitToBitmap(_tmpBitmap, _bitmapWallD3LCRFlipped, boxWallD3LCR, 11, 0, 64, 64, kDMColorNoTransparency, 51, 51);
copyBitmapAndFlipHorizontal(_bitmapWallD2LCRNative = _bitmapWallSetD2LCR, _tmpBitmap,
- _frameWalls163[k3_ViewSquare_D2C]._srcByteWidth, _frameWalls163[k3_ViewSquare_D2C]._srcHeight);
- fillBitmap(_bitmapWallD2LCRFlipped, k10_ColorFlesh, 72, 71);
- blitToBitmap(_tmpBitmap, _bitmapWallD2LCRFlipped, boxWallD2LCR, 8, 0, 72, 72, kM1_ColorNoTransparency, 71, 71);
+ _frameWalls163[kDMViewSquareD2C]._srcByteWidth, _frameWalls163[kDMViewSquareD2C]._srcHeight);
+ fillBitmap(_bitmapWallD2LCRFlipped, kDMColorFlesh, 72, 71);
+ blitToBitmap(_tmpBitmap, _bitmapWallD2LCRFlipped, boxWallD2LCR, 8, 0, 72, 72, kDMColorNoTransparency, 71, 71);
copyBitmapAndFlipHorizontal(_bitmapWallD1LCRNative = _bitmapWallSetD1LCR, _bitmapWallD1LCRFlipped,
- _frameWalls163[k6_ViewSquare_D1C]._srcByteWidth, _frameWalls163[k6_ViewSquare_D1C]._srcHeight);
+ _frameWalls163[kDMViewSquareD1C]._srcByteWidth, _frameWalls163[kDMViewSquareD1C]._srcHeight);
copyBitmapAndFlipHorizontal(_bitmapWallD0LNative = bitmapWallSetWallD0L, _bitmapWallD0RFlipped,
- _frameWalls163[k10_ViewSquare_D0L]._srcByteWidth, _frameWalls163[k10_ViewSquare_D0L]._srcHeight);
+ _frameWalls163[kDMViewSquareD0L]._srcByteWidth, _frameWalls163[kDMViewSquareD0L]._srcHeight);
copyBitmapAndFlipHorizontal(_bitmapWallD0RNative = _bitmapWallSetWallD0R, _bitmapWallD0LFlipped,
- _frameWalls163[k10_ViewSquare_D0L]._srcByteWidth, _frameWalls163[k10_ViewSquare_D0L]._srcHeight);
+ _frameWalls163[kDMViewSquareD0L]._srcByteWidth, _frameWalls163[kDMViewSquareD0L]._srcHeight);
int16 val = _vm->_dungeonMan->_currMap->_wallSet * k18_StairsGraphicCount + k90_FirstStairs;
_stairsNativeBitmapIndexUpFrontD3L = val++;
@@ -2471,14 +2495,14 @@ void DisplayMan::applyCreatureReplColors(int replacedColor, int replacementColor
void DisplayMan::drawFloorPitOrStairsBitmap(uint16 nativeIndex, Frame &f) {
if (f._srcByteWidth)
blitToBitmap(getNativeBitmapOrGraphic(nativeIndex), _bitmapViewport, f._box, f._srcX, f._srcY,
- f._srcByteWidth, k112_byteWidthViewport, k10_ColorFlesh, f._srcHeight, k136_heightViewport);
+ f._srcByteWidth, k112_byteWidthViewport, kDMColorFlesh, f._srcHeight, k136_heightViewport);
}
void DisplayMan::drawFloorPitOrStairsBitmapFlippedHorizontally(uint16 nativeIndex, Frame &f) {
if (f._srcByteWidth) {
copyBitmapAndFlipHorizontal(getNativeBitmapOrGraphic(nativeIndex), _tmpBitmap, f._srcByteWidth, f._srcHeight);
blitToBitmap(_tmpBitmap, _bitmapViewport, f._box, f._srcX, f._srcY, f._srcByteWidth,
- k112_byteWidthViewport, k10_ColorFlesh, f._srcHeight, k136_heightViewport);
+ k112_byteWidthViewport, kDMColorFlesh, f._srcHeight, k136_heightViewport);
}
}
@@ -2514,7 +2538,7 @@ bool DisplayMan::isDrawnWallOrnAnAlcove(int16 wallOrnOrd, ViewWall viewWallIndex
46, 57, 68 /* D1L Right, D1R Left */
};
- static byte g205_WallOrnCoordSets[8][13][6] = { // @ G0205_aaauc_Graphic558_WallOrnamentCoordinateSets
+ static byte wallOrnamentCoordSets[8][13][6] = { // @ G0205_aaauc_Graphic558_WallOrnamentCoordinateSets
/* { X1, X2, Y1, Y2, ByteWidth, Height } */
{
{80, 83, 41, 45, 8, 5}, /* D3L */
@@ -2646,7 +2670,7 @@ bool DisplayMan::isDrawnWallOrnAnAlcove(int16 wallOrnOrd, ViewWall viewWallIndex
int16 wallOrnamentIndex = wallOrnOrd;
int16 ornNativeBitmapIndex = _currMapWallOrnInfo[wallOrnamentIndex].nativeIndice;
int16 wallOrnamentCoordinateSetIndex = _currMapWallOrnInfo[wallOrnamentIndex].coordinateSet;
- byte *ornCoordSet = g205_WallOrnCoordSets[wallOrnamentCoordinateSetIndex][viewWallIndex];
+ byte *ornCoordSet = wallOrnamentCoordSets[wallOrnamentCoordinateSetIndex][viewWallIndex];
bool isAlcove = _vm->_dungeonMan->isWallOrnAnAlcove(wallOrnamentIndex);
unsigned char inscriptionString[70];
bool isInscription = (wallOrnamentIndex == _vm->_dungeonMan->_currMapInscriptionWallOrnIndex);
@@ -2659,7 +2683,7 @@ bool DisplayMan::isDrawnWallOrnAnAlcove(int16 wallOrnOrd, ViewWall viewWallIndex
if (viewWallIndex >= kDMViewWallD1LRight) {
if (viewWallIndex == kDMViewWallD1CFront) {
if (isInscription) {
- blitToBitmap(_bitmapWallSetD1LCR, _bitmapViewport, boxWallPatchBehindInscription, 94, 28, _frameWalls163[k6_ViewSquare_D1C]._srcByteWidth, k112_byteWidthViewport, kM1_ColorNoTransparency, _frameWalls163[k6_ViewSquare_D1C]._srcHeight, k136_heightViewport);
+ blitToBitmap(_bitmapWallSetD1LCR, _bitmapViewport, boxWallPatchBehindInscription, 94, 28, _frameWalls163[kDMViewSquareD1C]._srcByteWidth, k112_byteWidthViewport, kDMColorNoTransparency, _frameWalls163[kDMViewSquareD1C]._srcHeight, k136_heightViewport);
byte *inscrString = inscriptionString;
byte *L0092_puc_Bitmap = getNativeBitmapOrGraphic(k120_InscriptionFont);
int16 textLineIndex = 0;
@@ -2670,19 +2694,21 @@ bool DisplayMan::isDrawnWallOrnAnAlcove(int16 wallOrnOrd, ViewWall viewWallIndex
characterCount++;
}
Frame blitFrame;
- blitFrame._box._x2 = (blitFrame._box._x1 = 112 - (characterCount << 2)) + 7;
- blitFrame._box._y1 = (blitFrame._box._y2 = inscriptionLineY[textLineIndex++]) - 7;
+ blitFrame._box._rect.left = 112 - (characterCount << 2);
+ blitFrame._box._rect.right = blitFrame._box._rect.left + 7;
+ blitFrame._box._rect.bottom = inscriptionLineY[textLineIndex++];
+ blitFrame._box._rect.top = blitFrame._box._rect.bottom - 7;
while (characterCount--) {
- blitToBitmap(L0092_puc_Bitmap, _bitmapViewport, blitFrame._box, *inscrString++ << 3, 0, k144_byteWidth, k112_byteWidthViewport, k10_ColorFlesh, 8, k136_heightViewport);
- blitFrame._box._x1 += 8;
- blitFrame._box._x2 += 8;
+ blitToBitmap(L0092_puc_Bitmap, _bitmapViewport, blitFrame._box, *inscrString++ << 3, 0, k144_byteWidth, k112_byteWidthViewport, kDMColorFlesh, 8, k136_heightViewport);
+ blitFrame._box._rect.left += 8;
+ blitFrame._box._rect.right += 8;
}
} while (*inscrString++ != 129); /* Hexadecimal: 0x81 (Megamax C does not support hexadecimal character constants) */
return isAlcove;
}
ornNativeBitmapIndex++;
- Box tmpBox(ornCoordSet);
- _vm->_dungeonMan->_dungeonViewClickableBoxes[k5_ViewCellDoorButtonOrWallOrn] = tmpBox;
+ Box tmpBox(ornCoordSet[0], ornCoordSet[1], ornCoordSet[2], ornCoordSet[3]);
+ _vm->_dungeonMan->_dungeonViewClickableBoxes[kDMViewCellDoorButtonOrWallOrn] = tmpBox;
_vm->_dungeonMan->_isFacingAlcove = isAlcove;
_vm->_dungeonMan->_isFacingViAltar =
(wallOrnamentIndex == _currMapViAltarIndex);
@@ -2704,19 +2730,20 @@ bool DisplayMan::isDrawnWallOrnAnAlcove(int16 wallOrnOrd, ViewWall viewWallIndex
int16 coordinateSetOffset = 0;
bool flipHorizontal = (viewWallIndex == kDMViewWallD2RLeft) || (viewWallIndex == kDMViewWallD3RLeft);
if (flipHorizontal)
- ornBlitBitmap = g205_WallOrnCoordSets[wallOrnamentCoordinateSetIndex][kDMViewWallD1RLeft];
+ ornBlitBitmap = wallOrnamentCoordSets[wallOrnamentCoordinateSetIndex][kDMViewWallD1RLeft];
else if ((viewWallIndex == kDMViewWallD2LRight) || (viewWallIndex == kDMViewWallD3LRight))
- ornBlitBitmap = g205_WallOrnCoordSets[wallOrnamentCoordinateSetIndex][kDMViewWallD1LRight];
+ ornBlitBitmap = wallOrnamentCoordSets[wallOrnamentCoordinateSetIndex][kDMViewWallD1LRight];
else {
ornNativeBitmapIndex++;
- ornBlitBitmap = g205_WallOrnCoordSets[wallOrnamentCoordinateSetIndex][kDMViewWallD1CFront];
+ ornBlitBitmap = wallOrnamentCoordSets[wallOrnamentCoordinateSetIndex][kDMViewWallD1CFront];
if (viewWallIndex == kDMViewWallD2LFront)
coordinateSetOffset = 6;
else if (viewWallIndex == kDMViewWallD2RFront)
coordinateSetOffset = -6;
}
blitPosX = (ornCoordSet + coordinateSetOffset)[1] - (ornCoordSet + coordinateSetOffset)[0];
- if (!isDerivedBitmapInCache(wallOrnamentIndex = k4_DerivedBitmapFirstWallOrnament + (wallOrnamentIndex << 2) + wallOrnDerivedBitmapIndexIncrement[viewWallIndex])) {
+ wallOrnamentIndex = kDMDerivedBitmapFirstWallOrnament + (wallOrnamentIndex << 2) + wallOrnDerivedBitmapIndexIncrement[viewWallIndex];
+ if (!isDerivedBitmapInCache(wallOrnamentIndex)) {
byte *blitBitmap = getNativeBitmapOrGraphic(ornNativeBitmapIndex);
blitToBitmapShrinkWithPalChange(blitBitmap, getDerivedBitmap(wallOrnamentIndex), ornBlitBitmap[4] << 1, ornBlitBitmap[5], ornCoordSet[4] << 1, ornCoordSet[5], (viewWallIndex <= kDMViewWallD3RFront) ? _palChangesDoorButtonAndWallOrnD3 : _palChangesDoorButtonAndWallOrnD2);
addDerivedBitmap(wallOrnamentIndex);
@@ -2751,15 +2778,14 @@ bool DisplayMan::isDrawnWallOrnAnAlcove(int16 wallOrnOrd, ViewWall viewWallIndex
}
}
- Box tmpBox(ornCoordSet);
- blitToBitmap(ornBlitBitmap, _bitmapViewport, tmpBox,
- blitPosX, 0,
- ornCoordSet[4], k112_byteWidthViewport, k10_ColorFlesh, ornCoordSet[5], k136_heightViewport);
+ Box tmpBox(ornCoordSet[0], ornCoordSet[1], ornCoordSet[2], ornCoordSet[3]);
+ blitToBitmap(ornBlitBitmap, _bitmapViewport, tmpBox, blitPosX, 0,
+ ornCoordSet[4], k112_byteWidthViewport, kDMColorFlesh, ornCoordSet[5], k136_heightViewport);
if ((viewWallIndex == kDMViewWallD1CFront) && _championPortraitOrdinal--) {
- blitToBitmap(getNativeBitmapOrGraphic(k26_ChampionPortraitsIndice), _bitmapViewport, boxChampionPortraitOnWall,
+ blitToBitmap(getNativeBitmapOrGraphic(kDMGraphicIdxChampionPortraits), _bitmapViewport, boxChampionPortraitOnWall,
(_championPortraitOrdinal & 0x0007) << 5, (_championPortraitOrdinal >> 3) * 29,
- k128_byteWidth, k112_byteWidthViewport, k1_ColorDarkGary, 87, k136_heightViewport); /* A portrait is 32x29 pixels */
+ k128_byteWidth, k112_byteWidthViewport, kDMColorDarkGary, 87, k136_heightViewport); /* A portrait is 32x29 pixels */
}
return isAlcove;
@@ -2800,25 +2826,25 @@ uint32 DisplayMan::getCompressedDataSize(uint16 index) {
return _packedItemPos[index + 1] - _packedItemPos[index];
}
-void DisplayMan::drawField(FieldAspect* fieldAspect, Box& box) {
+void DisplayMan::drawField(FieldAspect *fieldAspect, Box& box) {
byte *bitmapMask = nullptr;
if (fieldAspect->_mask != kMaskFieldAspectNoMask) {
bitmapMask = _tmpBitmap;
- memmove(bitmapMask, getNativeBitmapOrGraphic(k69_FieldMask_D3R_GraphicIndice + getFlag(fieldAspect->_mask, kMaskFieldAspectIndex)),
+ memmove(bitmapMask, getNativeBitmapOrGraphic(kDMGraphicIdxFieldMaskD3R + getFlag(fieldAspect->_mask, kMaskFieldAspectIndex)),
fieldAspect->_height * fieldAspect->_byteWidth * 2);
if (getFlag(fieldAspect->_mask, kMaskFieldAspectFlipMask)) {
flipBitmapHorizontal(bitmapMask, fieldAspect->_byteWidth, fieldAspect->_height);
}
}
- isDerivedBitmapInCache(k0_DerivedBitmapViewport);
- byte *bitmap = getNativeBitmapOrGraphic(k73_FieldTeleporterGraphicIndice + fieldAspect->_nativeBitmapRelativeIndex);
- blitBoxFilledWithMaskedBitmap(bitmap, _bitmapViewport, bitmapMask, getDerivedBitmap(k0_DerivedBitmapViewport), box,
+ isDerivedBitmapInCache(kDMDerivedBitmapViewport);
+ byte *bitmap = getNativeBitmapOrGraphic(kDMGraphicIdxFieldTeleporter + fieldAspect->_nativeBitmapRelativeIndex);
+ blitBoxFilledWithMaskedBitmap(bitmap, _bitmapViewport, bitmapMask, getDerivedBitmap(kDMDerivedBitmapViewport), box,
_vm->getRandomNumber(2) + fieldAspect->_baseStartUnitIndex, _vm->getRandomNumber(32), k112_byteWidthViewport,
(Color)fieldAspect->_transparentColor, fieldAspect->_xPos, 0, 136, fieldAspect->_bitplaneWordCount);
- addDerivedBitmap(k0_DerivedBitmapViewport);
- releaseBlock(k0_DerivedBitmapViewport | 0x8000);
+ addDerivedBitmap(kDMDerivedBitmapViewport);
+ releaseBlock(kDMDerivedBitmapViewport | 0x8000);
}
int16 DisplayMan::getScaledBitmapByteCount(int16 byteWidth, int16 height, int16 scale) {
@@ -2830,7 +2856,7 @@ int16 DisplayMan::getScaledDimension(int16 dimension, int16 scale) {
}
void DisplayMan::drawObjectsCreaturesProjectilesExplosions(Thing thingParam, Direction directionParam, int16 mapXpos,
- int16 mapYpos, int16 viewSquareIndex, uint16 orderedViewCellOrdinals) {
+ int16 mapYpos, int16 viewSquareIndex, CellOrder cellOrder) {
int16 AL_0_creatureIndexRed;
#define AL_1_viewSquareExplosionIndex viewSquareIndex
int16 L0126_i_Multiple;
@@ -2847,7 +2873,7 @@ void DisplayMan::drawObjectsCreaturesProjectilesExplosions(Thing thingParam, Dir
#define AL_4_projectileAspect L0127_i_Multiple
#define AL_4_explosionType L0127_i_Multiple
#define AL_4_explosionAspectIndex L0127_i_Multiple
- ObjectAspect* objectAspect;
+ ObjectAspect *objectAspect;
uint32 remainingViewCellOrdinalsToProcess;
byte *coordinateSet;
int16 derivedBitmapIndex = -1;
@@ -2871,10 +2897,10 @@ void DisplayMan::drawObjectsCreaturesProjectilesExplosions(Thing thingParam, Dir
uint16 L0150_ui_Multiple = 0;
#define AL_8_shiftSetIndex L0150_ui_Multiple
#define AL_8_projectileScaleIndex L0150_ui_Multiple
- CreatureAspect* creatureAspectStruct;
- int16 creatureSize;
+ CreatureAspect *creatureAspectStruct = nullptr;
+ int16 creatureSize = 0;
int16 creatureDirectionDelta;
- int16 creatureGraphicInfoGreen;
+ int16 creatureGraphicInfoGreen = 0;
int16 creatureGraphicInfoRed;
int16 creatureAspectInt;
int16 creatureIndexGreen;
@@ -2888,7 +2914,7 @@ void DisplayMan::drawObjectsCreaturesProjectilesExplosions(Thing thingParam, Dir
bool useFlippedHorizontallyCreatureFrontImage;
bool drawCreaturesCompleted; /* Set to true when the last creature that the function should draw is being drawn. This is used to avoid processing the code to draw creatures for the remaining square cells */
int16 doorFrontViewDrawingPass; /* Value 0, 1 or 2 */
- int16 projectilePosX;
+ int16 projectilePosX = 0;
int16 projectileDirection;
int16 projectileAspectType;
int16 projectileBitmapIndexDelta;
@@ -3079,28 +3105,30 @@ void DisplayMan::drawObjectsCreaturesProjectilesExplosions(Thing thingParam, Dir
if (thingParam == Thing::_endOfList)
return;
+ int16 orderedViewCellOrdinals = cellOrder;
Group *group = nullptr;
Thing groupThing = Thing::_none;
bool squareHasExplosion = drawCreaturesCompleted = false;
bool squareHasProjectile = false;
cellCounter = 0;
firstThingToDraw = thingParam;
- if (getFlag(orderedViewCellOrdinals, k0x0008_CellOrder_DoorFront)) { /* If the function call is to draw objects on a door square viewed from the front */
+ if (getFlag(orderedViewCellOrdinals, kDMMaskDoorFront)) { /* If the function call is to draw objects on a door square viewed from the front */
doorFrontViewDrawingPass = (orderedViewCellOrdinals & 0x0001) + 1; /* Two function calls are made in that case to draw objects on both sides of the door frame. The door and its frame are drawn between the two calls. This value indicates the drawing pass so that creatures are drawn in the right order and so that Fluxcages are not drawn twice */
orderedViewCellOrdinals >>= 4; /* Remove the first nibble that was used for the door front view pass */
} else
doorFrontViewDrawingPass = 0; /* The function call is not to draw objects on a door square viewed from the front */
- L0135_B_DrawAlcoveObjects = !(remainingViewCellOrdinalsToProcess = orderedViewCellOrdinals);
+ remainingViewCellOrdinalsToProcess = orderedViewCellOrdinals;
+ L0135_B_DrawAlcoveObjects = !(remainingViewCellOrdinalsToProcess);
AL_10_viewSquareIndexBackup = viewSquareIndex;
viewLane = (ViewLane)((viewSquareIndex + 3) % 3);
bool twoHalfSquareCreaturesFrontView;
- byte *bitmapRedBanana;
- byte *bitmapGreenAnt;
+ byte *bitmapRedBanana = nullptr;
+ byte *bitmapGreenAnt = nullptr;
do {
/* Draw objects */
if (L0135_B_DrawAlcoveObjects) {
- AL_2_viewCell = k4_ViewCellAlcove; /* Index of coordinates to draw objects in alcoves */
+ AL_2_viewCell = kDMViewCellAlcove; /* Index of coordinates to draw objects in alcoves */
cellYellowBear = _vm->returnOppositeDir(directionParam); /* Alcove is on the opposite direction of the viewing direction */
objectShiftIndex = 2;
} else {
@@ -3116,7 +3144,8 @@ void DisplayMan::drawObjectsCreaturesProjectilesExplosions(Thing thingParam, Dir
objectShiftIndex += (cellYellowBear & 0x0001) << 3;
drawProjectileAsObject = false;
do {
- if ((AL_4_thingType = thingParam.getType()) == kDMThingTypeGroup) {
+ AL_4_thingType = thingParam.getType();
+ if (AL_4_thingType == kDMThingTypeGroup) {
groupThing = thingParam;
continue;
}
@@ -3131,9 +3160,9 @@ void DisplayMan::drawObjectsCreaturesProjectilesExplosions(Thing thingParam, Dir
continue;
}
- if ((viewSquareIndex >= k0_ViewSquare_D3C) && (viewSquareIndex <= k9_ViewSquare_D0C) && (thingParam.getCell() == cellYellowBear)) { /* Square where objects are visible and object is located on cell being processed */
+ if ((viewSquareIndex >= kDMViewSquareD3C) && (viewSquareIndex <= kDMViewSquareD0C) && (thingParam.getCell() == cellYellowBear)) { /* Square where objects are visible and object is located on cell being processed */
objectAspect = &(_objectAspects209[_vm->_dungeonMan->_objectInfos[_vm->_dungeonMan->getObjectInfoIndex(thingParam)]._objectAspectIndex]);
- AL_4_nativeBitmapIndex = k360_FirstObjectGraphicIndice + objectAspect->_firstNativeBitmapRelativeIndex;
+ AL_4_nativeBitmapIndex = kDMGraphicIdxFirstObject + objectAspect->_firstNativeBitmapRelativeIndex;
useAlcoveObjectImage = (L0135_B_DrawAlcoveObjects && getFlag(objectAspect->_graphicInfo, k0x0010_ObjectAlcoveMask) && (viewLane == kDMViewLaneCenter));
if (useAlcoveObjectImage)
AL_4_nativeBitmapIndex++;
@@ -3144,11 +3173,11 @@ void DisplayMan::drawObjectsCreaturesProjectilesExplosions(Thing thingParam, Dir
T0115015_DrawProjectileAsObject:
flipHorizontal = getFlag(objectAspect->_graphicInfo, k0x0001_ObjectFlipOnRightMask) &&
!useAlcoveObjectImage &&
- ((viewLane == kDMViewLaneRight) || ((viewLane == kDMViewLaneCenter) && ((AL_2_viewCell == k1_ViewCellFrontRight) || (AL_2_viewCell == k2_ViewCellBackRight))));
+ ((viewLane == kDMViewLaneRight) || ((viewLane == kDMViewLaneCenter) && ((AL_2_viewCell == kDMViewCellFrontRight) || (AL_2_viewCell == kDMViewCellBackRight))));
/* Flip horizontally if object graphic requires it and is not being drawn in an alcove and the object is either on the right lane or on the right column of the center lane */
paddingPixelCount = 0;
- if ((viewSquareIndex == k9_ViewSquare_D0C) || ((viewSquareIndex >= k6_ViewSquare_D1C) && (AL_2_viewCell >= k2_ViewCellBackRight))) {
+ if ((viewSquareIndex == kDMViewSquareD0C) || ((viewSquareIndex >= kDMViewSquareD1C) && (AL_2_viewCell >= kDMViewCellBackRight))) {
drawingGrabbableObject = ((viewLane == kDMViewLaneCenter) && !drawProjectileAsObject); /* If object is in the center lane (only D0C or D1C with condition above) and is not a projectile */
AL_8_shiftSetIndex = k0_ShiftSet_D0BackD1Front;
bitmapRedBanana = getNativeBitmapOrGraphic(AL_4_nativeBitmapIndex); /* Use base graphic, no resizing */
@@ -3160,9 +3189,9 @@ T0115015_DrawProjectileAsObject:
}
} else {
drawingGrabbableObject = false;
- derivedBitmapIndex = k104_DerivedBitmapFirstObject + objectAspect->_firstDerivedBitmapRelativeIndex;
- byte* paletteChanges;
- if ((viewSquareIndex >= k6_ViewSquare_D1C) || ((viewSquareIndex >= k3_ViewSquare_D2C) && (AL_2_viewCell >= k2_ViewCellBackRight))) {
+ derivedBitmapIndex = kDMDerivedBitmapFirstObject + objectAspect->_firstDerivedBitmapRelativeIndex;
+ byte *paletteChanges;
+ if ((viewSquareIndex >= kDMViewSquareD1C) || ((viewSquareIndex >= kDMViewSquareD2C) && (AL_2_viewCell >= kDMViewCellBackRight))) {
derivedBitmapIndex++;
AL_8_shiftSetIndex = k1_ShiftSet_D1BackD2Front;
byteWidth = getScaledDimension(objectAspect->_byteWidth, k20_Scale_D2);
@@ -3184,7 +3213,8 @@ T0115015_DrawProjectileAsObject:
bitmapRedBanana = getDerivedBitmap(derivedBitmapIndex);
else {
bitmapGreenAnt = getNativeBitmapOrGraphic(AL_4_nativeBitmapIndex);
- blitToBitmapShrinkWithPalChange(bitmapGreenAnt, bitmapRedBanana = getDerivedBitmap(derivedBitmapIndex), objectAspect->_byteWidth << 1, objectAspect->_height, byteWidth << 1, heightRedEagle, paletteChanges);
+ bitmapRedBanana = getDerivedBitmap(derivedBitmapIndex);
+ blitToBitmapShrinkWithPalChange(bitmapGreenAnt, bitmapRedBanana, objectAspect->_byteWidth << 1, objectAspect->_height, byteWidth << 1, heightRedEagle, paletteChanges);
if (flipHorizontal)
flipBitmapHorizontal(bitmapRedBanana, getNormalizedByteWidth(byteWidth), heightRedEagle);
@@ -3192,10 +3222,10 @@ T0115015_DrawProjectileAsObject:
}
}
AL_4_xPos = coordinateSet[0];
- boxByteGreen._y2 = coordinateSet[1];
+ boxByteGreen._rect.bottom = coordinateSet[1];
if (!drawProjectileAsObject) { /* If drawing an object that is not a projectile */
AL_4_xPos += shiftSets[AL_8_shiftSetIndex][objectPileShiftSetIndices[objectShiftIndex][0]];
- boxByteGreen._y2 += shiftSets[AL_8_shiftSetIndex][objectPileShiftSetIndices[objectShiftIndex][1]];
+ boxByteGreen._rect.bottom += shiftSets[AL_8_shiftSetIndex][objectPileShiftSetIndices[objectShiftIndex][1]];
objectShiftIndex++; /* The next object drawn will use the next shift values */
if (L0135_B_DrawAlcoveObjects) {
if (objectShiftIndex >= 14)
@@ -3203,13 +3233,13 @@ T0115015_DrawProjectileAsObject:
} else
objectShiftIndex &= 0x000F;
}
- boxByteGreen._y1 = boxByteGreen._y2 - (heightRedEagle - 1);
- if (boxByteGreen._y2 > 135)
- boxByteGreen._y2 = 135;
+ boxByteGreen._rect.top = boxByteGreen._rect.bottom - (heightRedEagle - 1);
+ if (boxByteGreen._rect.bottom > 135)
+ boxByteGreen._rect.bottom = 135;
- boxByteGreen._x2 = MIN(223, AL_4_xPos + byteWidth);
- boxByteGreen._x1 = MAX(0, AL_4_xPos - byteWidth + 1);
- if (boxByteGreen._x1) {
+ boxByteGreen._rect.right = MIN(223, AL_4_xPos + byteWidth);
+ boxByteGreen._rect.left = MAX(0, AL_4_xPos - byteWidth + 1);
+ if (boxByteGreen._rect.left) {
if (flipHorizontal)
AL_4_xPos = paddingPixelCount;
else
@@ -3222,34 +3252,35 @@ T0115015_DrawProjectileAsObject:
Box *AL_6_box = &_vm->_dungeonMan->_dungeonViewClickableBoxes[AL_2_viewCell];
- if (AL_6_box->_x1 == 255) { /* If the grabbable object is the first */
+ if (AL_6_box->_rect.left == 255) { /* If the grabbable object is the first */
*AL_6_box = boxByteGreen;
- if ((heightGreenGoat = AL_6_box->_y2 - AL_6_box->_y1) < 14) { /* If the box is too small then enlarge it a little */
+ heightGreenGoat = AL_6_box->_rect.bottom - AL_6_box->_rect.top;
+ if (heightGreenGoat < 14) { /* If the box is too small then enlarge it a little */
heightGreenGoat = heightGreenGoat >> 1;
- AL_6_box->_y1 += heightGreenGoat - 7;
+ AL_6_box->_rect.top += heightGreenGoat - 7;
if (heightGreenGoat < 4)
- AL_6_box->_y2 -= heightGreenGoat - 3;
+ AL_6_box->_rect.bottom -= heightGreenGoat - 3;
}
} else { /* If there are several grabbable objects then enlarge the box so it includes all objects */
- AL_6_box->_x1 = MIN(AL_6_box->_x1, boxByteGreen._x1);
- AL_6_box->_x2 = MAX(AL_6_box->_x2, boxByteGreen._x2);
- AL_6_box->_y1 = MIN(AL_6_box->_y1, boxByteGreen._y1);
- AL_6_box->_y2 = MAX(AL_6_box->_y2, boxByteGreen._y2);
+ AL_6_box->_rect.left = MIN(AL_6_box->_rect.left, boxByteGreen._rect.left);
+ AL_6_box->_rect.right = MAX(AL_6_box->_rect.right, boxByteGreen._rect.right);
+ AL_6_box->_rect.top = MIN(AL_6_box->_rect.top, boxByteGreen._rect.top);
+ AL_6_box->_rect.bottom = MAX(AL_6_box->_rect.bottom, boxByteGreen._rect.bottom);
}
bitmapRedBanana = bitmapGreenAnt;
_vm->_dungeonMan->_pileTopObject[AL_2_viewCell] = thingParam; /* The object is at the top of the pile */
}
- blitToBitmap(bitmapRedBanana, _bitmapViewport, boxByteGreen, AL_4_xPos, 0, getNormalizedByteWidth(byteWidth), k112_byteWidthViewport, k10_ColorFlesh, heightRedEagle, k136_heightViewport);
+ blitToBitmap(bitmapRedBanana, _bitmapViewport, boxByteGreen, AL_4_xPos, 0, getNormalizedByteWidth(byteWidth), k112_byteWidthViewport, kDMColorFlesh, heightRedEagle, k136_heightViewport);
if (drawProjectileAsObject)
goto T0115171_BackFromT0115015_DrawProjectileAsObject;
}
} while ((thingParam = _vm->_dungeonMan->getNextThing(thingParam)) != Thing::_endOfList);
- if (AL_2_viewCell == k4_ViewCellAlcove)
+ if (AL_2_viewCell == kDMViewCellAlcove)
break; /* End of processing when drawing objects in an alcove */
- if (viewSquareIndex < k0_ViewSquare_D3C)
+ if (viewSquareIndex < kDMViewSquareD3C)
break; /* End of processing if square is too far away at D4 */
/* Draw creatures */
- drawingLastBackRowCell = ((AL_2_viewCell <= k1_ViewCellFrontRight) || (cellCounter == 1)) && (!remainingViewCellOrdinalsToProcess || ((remainingViewCellOrdinalsToProcess & 0x0000000F) >= 3)); /* If (draw cell on the back row or second cell being processed) and (no more cells to draw or next cell to draw is a cell on the front row) */
+ drawingLastBackRowCell = ((AL_2_viewCell <= kDMViewCellFrontRight) || (cellCounter == 1)) && (!remainingViewCellOrdinalsToProcess || ((remainingViewCellOrdinalsToProcess & 0x0000000F) >= 3)); /* If (draw cell on the back row or second cell being processed) and (no more cells to draw or next cell to draw is a cell on the front row) */
if ((groupThing == Thing::_none) || drawCreaturesCompleted)
goto T0115129_DrawProjectiles; /* Skip code to draw creatures */
@@ -3259,7 +3290,7 @@ T0115015_DrawProjectileAsObject:
activeGroup = &_vm->_groupMan->_activeGroups[group->getActiveGroupIndex()];
CreatureInfo *creatureInfo = &_vm->_dungeonMan->_creatureInfos[group->_type];
creatureAspectStruct = &_creatureAspects219[creatureInfo->_creatureAspectIndex];
- creatureSize = getFlag(creatureInfo->_attributes, k0x0003_MaskCreatureInfo_size);
+ creatureSize = getFlag(creatureInfo->_attributes, kDMCreatureMaskSize);
creatureGraphicInfoGreen = creatureInfo->_graphicInfo;
}
objectAspect = (ObjectAspect *)creatureAspectStruct;
@@ -3268,7 +3299,7 @@ T0115015_DrawProjectileAsObject:
if (AL_0_creatureIndexRed) { /* If there is a creature on the cell being processed */
AL_0_creatureIndexRed--; /* Convert ordinal to index */
creatureIndexGreen = AL_0_creatureIndexRed;
- } else if (creatureSize == k1_MaskCreatureSizeHalf) {
+ } else if (creatureSize == kDMCreatureSizeHalf) {
AL_0_creatureIndexRed = 0;
creatureIndexGreen = -1;
} else
@@ -3276,16 +3307,17 @@ T0115015_DrawProjectileAsObject:
creatureDirectionDelta = _vm->normalizeModulo4(directionParam - _vm->_groupMan->getCreatureValue(activeGroup->_directions, AL_0_creatureIndexRed));
twoHalfSquareCreaturesFrontView = false;
- if ((AL_4_groupCells = activeGroup->_cells) == k255_CreatureTypeSingleCenteredCreature) { /* If there is a single centered creature in the group */
+ AL_4_groupCells = activeGroup->_cells;
+ if (AL_4_groupCells == kDMCreatureTypeSingleCenteredCreature) { /* If there is a single centered creature in the group */
if (remainingViewCellOrdinalsToProcess || (doorFrontViewDrawingPass == 1))
goto T0115129_DrawProjectiles; /* Do not draw a single centered creature now, wait until second pass (for a front view door) or until all cells have been drawn so the creature is drawn over all the objects on the floor */
drawCreaturesCompleted = true;
- if ((creatureSize == k1_MaskCreatureSizeHalf) && (creatureDirectionDelta & 0x0001)) /* Side view of half square creature */
+ if ((creatureSize == kDMCreatureSizeHalf) && (creatureDirectionDelta & 0x0001)) /* Side view of half square creature */
AL_2_viewCell = k3_HalfSizedViewCell_CenterColumn;
else
AL_2_viewCell = k4_HalfSizedViewCell_FrontRow;
- } else if ((creatureSize == k1_MaskCreatureSizeHalf) && (drawingLastBackRowCell || !remainingViewCellOrdinalsToProcess || (creatureIndexGreen < 0))) {
+ } else if ((creatureSize == kDMCreatureSizeHalf) && (drawingLastBackRowCell || !remainingViewCellOrdinalsToProcess || (creatureIndexGreen < 0))) {
if (drawingLastBackRowCell && (doorFrontViewDrawingPass != 2)) {
if ((creatureIndexGreen >= 0) && (creatureDirectionDelta & 0x0001))
AL_2_viewCell = k2_HalfSizedViewCell_BackRow; /* Side view of a half square creature on the back row. Drawn during pass 1 for a door square */
@@ -3303,18 +3335,19 @@ T0115015_DrawProjectileAsObject:
creatureIndexGreen = 0;
twoHalfSquareCreaturesFrontView = group->getCount();
- if (((AL_4_groupCells = _vm->_groupMan->getCreatureValue(AL_4_groupCells, AL_0_creatureIndexRed)) == directionParam) || (AL_4_groupCells == _vm->turnDirLeft(directionParam)))
+ AL_4_groupCells = _vm->_groupMan->getCreatureValue(AL_4_groupCells, AL_0_creatureIndexRed);
+ if ((AL_4_groupCells == directionParam) || (AL_4_groupCells == _vm->turnDirLeft(directionParam)))
AL_2_viewCell = k0_HalfSizedViewCell_LeftColumn;
else
AL_2_viewCell = k1_HalfSizedViewCell_RightColumn;
}
} else
goto T0115129_DrawProjectiles;
- } else if (creatureSize != k0_MaskCreatureSizeQuarter)
+ } else if (creatureSize != kDMCreatureSizeQuarter)
goto T0115129_DrawProjectiles;
creatureAspectInt = activeGroup->_aspect[creatureIndexGreen];
- if (viewSquareIndex > k9_ViewSquare_D0C)
+ if (viewSquareIndex > kDMViewSquareD0C)
viewSquareIndex--;
T0115077_DrawSecondHalfSquareCreature:
@@ -3322,11 +3355,11 @@ T0115077_DrawSecondHalfSquareCreature:
if (!coordinateSet[1])
goto T0115126_CreatureNotVisible;
creatureGraphicInfoRed = creatureGraphicInfoGreen;
- AL_4_nativeBitmapIndex = k446_FirstCreatureGraphicIndice + ((CreatureAspect *)objectAspect)->_firstNativeBitmapRelativeIndex; /* By default, assume using the front image */
+ AL_4_nativeBitmapIndex = kDMGraphicIdxFirstCreature + ((CreatureAspect *)objectAspect)->_firstNativeBitmapRelativeIndex; /* By default, assume using the front image */
derivedBitmapIndex = ((CreatureAspect *)objectAspect)->_firstDerivedBitmapIndex;
int16 sourceByteWidth;
int16 sourceHeight;
- useCreatureSideBitmap = getFlag(creatureGraphicInfoRed, k0x0008_CreatureInfoGraphicMaskSide) && (creatureDirectionDelta & 0x0001);
+ useCreatureSideBitmap = getFlag(creatureGraphicInfoRed, kDMCreatureMaskSide) && (creatureDirectionDelta & 0x0001);
if (useCreatureSideBitmap) {
useCreatureAttackBitmap = useFlippedHorizontallyCreatureFrontImage = useCreatureBackBitmap = false;
AL_4_nativeBitmapIndex++; /* Skip the front image. Side image is right after the front image */
@@ -3334,20 +3367,20 @@ T0115077_DrawSecondHalfSquareCreature:
sourceByteWidth = byteWidth = ((CreatureAspect *)objectAspect)->_byteWidthSide;
sourceHeight = heightRedEagle = ((CreatureAspect *)objectAspect)->_heightSide;
} else {
- useCreatureBackBitmap = getFlag(creatureGraphicInfoRed, k0x0010_CreatureInfoGraphicMaskBack) && (creatureDirectionDelta == 0);
+ useCreatureBackBitmap = getFlag(creatureGraphicInfoRed, kDMCreatureMaskBack) && (creatureDirectionDelta == 0);
useCreatureAttackBitmap = !useCreatureBackBitmap;
- if (useCreatureAttackBitmap && getFlag(creatureAspectInt, k0x0080_MaskActiveGroupIsAttacking) && getFlag(creatureGraphicInfoRed, k0x0020_CreatureInfoGraphicMaskAttack)) {
+ if (useCreatureAttackBitmap && getFlag(creatureAspectInt, kDMAspectMaskActiveGroupIsAttacking) && getFlag(creatureGraphicInfoRed, kDMCreatureMaskAttack)) {
useFlippedHorizontallyCreatureFrontImage = false;
sourceByteWidth = byteWidth = ((CreatureAspect *)objectAspect)->_byteWidthAttack;
sourceHeight = heightRedEagle = ((CreatureAspect *)objectAspect)->_heightAttack;
AL_4_nativeBitmapIndex++; /* Skip the front image */
derivedBitmapIndex += 2;
- if (getFlag(creatureGraphicInfoRed, k0x0008_CreatureInfoGraphicMaskSide)) {
+ if (getFlag(creatureGraphicInfoRed, kDMCreatureMaskSide)) {
AL_4_nativeBitmapIndex++; /* If the creature has a side image, it preceeds the attack image */
derivedBitmapIndex += 2;
}
- if (getFlag(creatureGraphicInfoRed, k0x0010_CreatureInfoGraphicMaskBack)) {
+ if (getFlag(creatureGraphicInfoRed, kDMCreatureMaskBack)) {
AL_4_nativeBitmapIndex++; /* If the creature has a back image, it preceeds the attack image */
derivedBitmapIndex += 2;
}
@@ -3356,7 +3389,7 @@ T0115077_DrawSecondHalfSquareCreature:
sourceHeight = heightRedEagle = ((CreatureAspect *)objectAspect)->_heightFront;
if (useCreatureBackBitmap) {
useFlippedHorizontallyCreatureFrontImage = false;
- if (getFlag(creatureGraphicInfoRed, k0x0008_CreatureInfoGraphicMaskSide)) {
+ if (getFlag(creatureGraphicInfoRed, kDMCreatureMaskSide)) {
AL_4_nativeBitmapIndex += 2; /* If the creature has a side image, it preceeds the back image */
derivedBitmapIndex += 4;
} else {
@@ -3364,16 +3397,16 @@ T0115077_DrawSecondHalfSquareCreature:
derivedBitmapIndex += 2;
}
} else {
- useFlippedHorizontallyCreatureFrontImage = getFlag(creatureGraphicInfoRed, k0x0004_CreatureInfoGraphicMaskFlipNonAttack) && getFlag(creatureAspectInt, k0x0040_MaskActiveGroupFlipBitmap);
+ useFlippedHorizontallyCreatureFrontImage = getFlag(creatureGraphicInfoRed, kDMCreatureMaskFlipNonAttack) && getFlag(creatureAspectInt, kDMAspectMaskActiveGroupFlipBitmap);
if (useFlippedHorizontallyCreatureFrontImage) {
derivedBitmapIndex += 2;
- if (getFlag(creatureGraphicInfoRed, k0x0008_CreatureInfoGraphicMaskSide))
+ if (getFlag(creatureGraphicInfoRed, kDMCreatureMaskSide))
derivedBitmapIndex += 2;
- if (getFlag(creatureGraphicInfoRed, k0x0010_CreatureInfoGraphicMaskBack))
+ if (getFlag(creatureGraphicInfoRed, kDMCreatureMaskBack))
derivedBitmapIndex += 2;
- if (getFlag(creatureGraphicInfoRed, k0x0020_CreatureInfoGraphicMaskAttack))
+ if (getFlag(creatureGraphicInfoRed, kDMCreatureMaskAttack))
derivedBitmapIndex += 2;
}
}
@@ -3381,7 +3414,7 @@ T0115077_DrawSecondHalfSquareCreature:
}
int16 scale;
- if (viewSquareIndex >= k6_ViewSquare_D1C) { /* Creature is on D1 */
+ if (viewSquareIndex >= kDMViewSquareD1C) { /* Creature is on D1 */
creaturePaddingPixelCount = 0;
AL_8_shiftSetIndex = k0_ShiftSet_D0BackD1Front;
transparentColor = ((CreatureAspect *)objectAspect)->getTranspColour();
@@ -3393,7 +3426,7 @@ T0115077_DrawSecondHalfSquareCreature:
}
} else if (useCreatureBackBitmap || !useFlippedHorizontallyCreatureFrontImage) {
bitmapRedBanana = getNativeBitmapOrGraphic(AL_4_nativeBitmapIndex);
- if (useCreatureAttackBitmap && getFlag(creatureAspectInt, k0x0040_MaskActiveGroupFlipBitmap)) {
+ if (useCreatureAttackBitmap && getFlag(creatureAspectInt, kDMAspectMaskActiveGroupFlipBitmap)) {
copyBitmapAndFlipHorizontal(bitmapRedBanana, _tmpBitmap, byteWidth, heightRedEagle);
bitmapRedBanana = _tmpBitmap;
}
@@ -3401,20 +3434,21 @@ T0115077_DrawSecondHalfSquareCreature:
bitmapRedBanana = getDerivedBitmap(derivedBitmapIndex);
else {
bitmapGreenAnt = getNativeBitmapOrGraphic(AL_4_nativeBitmapIndex);
- if (getFlag(creatureGraphicInfoRed, k0x0004_CreatureInfoGraphicMaskFlipNonAttack))
- copyBitmapAndFlipHorizontal(bitmapGreenAnt, bitmapRedBanana = getDerivedBitmap(derivedBitmapIndex), byteWidth, heightRedEagle);
-
+ if (getFlag(creatureGraphicInfoRed, kDMCreatureMaskFlipNonAttack)) {
+ bitmapRedBanana = getDerivedBitmap(derivedBitmapIndex);
+ copyBitmapAndFlipHorizontal(bitmapGreenAnt, bitmapRedBanana, byteWidth, heightRedEagle);
+ }
addDerivedBitmap(derivedBitmapIndex);
}
} else { /* Creature is on D2 or D3 */
if (useFlippedHorizontallyCreatureFrontImage)
derivedBitmapIndex++; /* Skip front D1 image in additional graphics */
- byte* paletteChanges;
- if (viewSquareIndex >= k3_ViewSquare_D2C) { /* Creature is on D2 */
+ byte *paletteChanges;
+ if (viewSquareIndex >= kDMViewSquareD2C) { /* Creature is on D2 */
derivedBitmapIndex++; /* Skip front D3 image in additional graphics */
AL_8_shiftSetIndex = k1_ShiftSet_D1BackD2Front;
- useCreatureSpecialD2FrontBitmap = getFlag(creatureGraphicInfoRed, k0x0080_CreatureInfoGraphicMaskSpecialD2Front) && !useCreatureSideBitmap && !useCreatureBackBitmap && !useCreatureAttackBitmap;
+ useCreatureSpecialD2FrontBitmap = getFlag(creatureGraphicInfoRed, kDMCreatureMaskSpecialD2Front) && !useCreatureSideBitmap && !useCreatureBackBitmap && !useCreatureAttackBitmap;
paletteChanges = _palChangesCreatureD2;
scale = k20_Scale_D2;
} else { /* Creature is on D3 */
@@ -3433,13 +3467,14 @@ T0115077_DrawSecondHalfSquareCreature:
bitmapRedBanana = getDerivedBitmap(derivedBitmapIndex);
else {
bitmapGreenAnt = getNativeBitmapOrGraphic(AL_4_nativeBitmapIndex);
- blitToBitmapShrinkWithPalChange(bitmapGreenAnt, bitmapRedBanana = getDerivedBitmap(derivedBitmapIndex), sourceByteWidth << 1, sourceHeight, byteWidth << 1, heightRedEagle, paletteChanges);
+ bitmapRedBanana = getDerivedBitmap(derivedBitmapIndex);
+ blitToBitmapShrinkWithPalChange(bitmapGreenAnt, bitmapRedBanana, sourceByteWidth << 1, sourceHeight, byteWidth << 1, heightRedEagle, paletteChanges);
addDerivedBitmap(derivedBitmapIndex);
}
if ((useCreatureSideBitmap && (creatureDirectionDelta == 1)) || /* If creature is viewed from the right, the side view must be flipped */
- (useCreatureAttackBitmap && getFlag(creatureAspectInt, k0x0040_MaskActiveGroupFlipBitmap)) ||
- (useCreatureSpecialD2FrontBitmap && getFlag(creatureGraphicInfoRed, k0x0100_CreatureInfoGraphicMaskSpecialD2FrontIsFlipped)) ||
- (useFlippedHorizontallyCreatureFrontImage && getFlag(creatureGraphicInfoRed, k0x0004_CreatureInfoGraphicMaskFlipNonAttack))) { /* If the graphic should be flipped */
+ (useCreatureAttackBitmap && getFlag(creatureAspectInt, kDMAspectMaskActiveGroupFlipBitmap)) ||
+ (useCreatureSpecialD2FrontBitmap && getFlag(creatureGraphicInfoRed, kDMCreatureMaskSpecialD2FrontIsFlipped)) ||
+ (useFlippedHorizontallyCreatureFrontImage && getFlag(creatureGraphicInfoRed, kDMCreatureMaskFlipNonAttack))) { /* If the graphic should be flipped */
if (!useFlippedHorizontallyCreatureFrontImage || !derivedBitmapInCache) {
AL_4_normalizdByteWidth = getNormalizedByteWidth(byteWidth);
if (!useFlippedHorizontallyCreatureFrontImage) {
@@ -3454,8 +3489,8 @@ T0115077_DrawSecondHalfSquareCreature:
}
AL_4_yPos = coordinateSet[1];
AL_4_yPos += shiftSets[AL_8_shiftSetIndex][getVerticalOffsetM23(creatureAspectInt)];
- boxByteGreen._y2 = MIN(AL_4_yPos, (int16)135);
- boxByteGreen._y1 = MAX(0, AL_4_yPos - (heightRedEagle - 1));
+ boxByteGreen._rect.bottom = MIN(AL_4_yPos, (int16)135);
+ boxByteGreen._rect.top = MAX(0, AL_4_yPos - (heightRedEagle - 1));
AL_4_xPos = coordinateSet[0];
AL_4_xPos += shiftSets[AL_8_shiftSetIndex][getHorizontalOffsetM22(creatureAspectInt)];
@@ -3464,14 +3499,14 @@ T0115077_DrawSecondHalfSquareCreature:
else if (viewLane != kDMViewLaneCenter) /* Lane right */
AL_4_xPos += 100;
- boxByteGreen._x2 = CLIP(0, AL_4_xPos + byteWidth, 223);
+ boxByteGreen._rect.right = CLIP(0, AL_4_xPos + byteWidth, 223);
- if (!boxByteGreen._x2)
+ if (!boxByteGreen._rect.right)
goto T0115126_CreatureNotVisible;
int16 AL_0_creaturePosX;
- boxByteGreen._x1 = CLIP(0, AL_4_xPos - byteWidth + 1, 223);
- if (boxByteGreen._x1) {
- if (boxByteGreen._x1 == 223)
+ boxByteGreen._rect.left = CLIP(0, AL_4_xPos - byteWidth + 1, 223);
+ if (boxByteGreen._rect.left) {
+ if (boxByteGreen._rect.left == 223)
goto T0115126_CreatureNotVisible;
AL_0_creaturePosX = creaturePaddingPixelCount;
} else
@@ -3495,7 +3530,7 @@ T0115129_DrawProjectiles:
if (!squareHasProjectile)
continue;
viewSquareIndex = AL_10_viewSquareIndexBackup;
- if (viewSquareIndex > k9_ViewSquare_D0C)
+ if (viewSquareIndex > kDMViewSquareD0C)
continue;
AL_2_viewCell = currentViewCellToDraw;
projectilePosX = objectCoordinateSets[0][viewSquareIndex][AL_2_viewCell][0];
@@ -3506,13 +3541,14 @@ T0115129_DrawProjectiles:
do {
if ((thingParam.getType() == kDMThingTypeProjectile) && (thingParam.getCell() == cellYellowBear)) {
Projectile *projectile = (Projectile *)_vm->_dungeonMan->getThingData(thingParam);
- if ((AL_4_projectileAspect = _vm->_dungeonMan->getProjectileAspect(projectile->_slot)) < 0) { /* Negative value: projectile aspect is the ordinal of a PROJECTIL_ASPECT */
+ AL_4_projectileAspect = _vm->_dungeonMan->getProjectileAspect(projectile->_slot);
+ if (AL_4_projectileAspect < 0) { /* Negative value: projectile aspect is the ordinal of a PROJECTIL_ASPECT */
objectAspect = (ObjectAspect *)&_projectileAspect[_vm->ordinalToIndex(-AL_4_projectileAspect)];
- AL_4_nativeBitmapIndex = ((ProjectileAspect *)objectAspect)->_firstNativeBitmapRelativeIndex + k316_FirstProjectileGraphicIndice;
+ AL_4_nativeBitmapIndex = ((ProjectileAspect *)objectAspect)->_firstNativeBitmapRelativeIndex + kDMGraphicIdxFirstProjectile;
projectileAspectType = getFlag(((ProjectileAspect *)objectAspect)->_graphicInfo, k0x0003_ProjectileAspectTypeMask);
bool doNotScaleWithKineticEnergy = !getFlag(((ProjectileAspect *)objectAspect)->_graphicInfo, k0x0100_ProjectileScaleWithKineticEnergyMask);
- if ((doNotScaleWithKineticEnergy || (projectile->_kineticEnergy == 255)) && (viewSquareIndex == k9_ViewSquare_D0C)) {
+ if ((doNotScaleWithKineticEnergy || (projectile->_kineticEnergy == 255)) && (viewSquareIndex == kDMViewSquareD0C)) {
scale = 0; /* Use native bitmap without resizing */
byteWidth = ((ProjectileAspect *)objectAspect)->_byteWidth;
heightRedEagle = ((ProjectileAspect *)objectAspect)->_height;
@@ -3540,8 +3576,9 @@ T0115129_DrawProjectiles:
projectileBitmapIndexDelta = 2;
if (projectileAspectTypeHasBackGraphicAndRotation) {
- flipHorizontal = (AL_2_viewCell == k0_ViewCellFronLeft) || (AL_2_viewCell == k3_ViewCellBackLeft);
- if (!(flipVertical = projectileFlipVertical))
+ flipHorizontal = (AL_2_viewCell == kDMViewCellFronLeft) || (AL_2_viewCell == kDMViewCellBackLeft);
+ flipVertical = projectileFlipVertical;
+ if (!flipVertical)
flipHorizontal = !flipHorizontal;
} else {
flipVertical = false;
@@ -3553,8 +3590,8 @@ T0115129_DrawProjectiles:
else
projectileBitmapIndexDelta = 1;
- flipVertical = projectileAspectTypeHasBackGraphicAndRotation && (AL_2_viewCell < k2_ViewCellBackRight);
- flipHorizontal = getFlag(((ProjectileAspect *)objectAspect)->_graphicInfo, k0x0010_ProjectileSideMask) && !((viewLane == kDMViewLaneRight) || ((viewLane == kDMViewLaneCenter) && ((AL_2_viewCell == k1_ViewCellFrontRight) || (AL_2_viewCell == k2_ViewCellBackRight))));
+ flipVertical = projectileAspectTypeHasBackGraphicAndRotation && (AL_2_viewCell < kDMViewCellBackRight);
+ flipHorizontal = getFlag(((ProjectileAspect *)objectAspect)->_graphicInfo, k0x0010_ProjectileSideMask) && !((viewLane == kDMViewLaneRight) || ((viewLane == kDMViewLaneCenter) && ((AL_2_viewCell == kDMViewCellFrontRight) || (AL_2_viewCell == kDMViewCellBackRight))));
}
AL_4_nativeBitmapIndex += projectileBitmapIndexDelta;
@@ -3565,7 +3602,8 @@ T0115129_DrawProjectiles:
if (flipHorizontal)
paddingPixelCount = (7 - ((byteWidth - 1) & 0x0007)) << 1;
- if (doNotScaleWithKineticEnergy && isDerivedBitmapInCache(derivedBitmapIndex = k282_DerivedBitmapFirstProjectile + ((ProjectileAspect *)objectAspect)->_firstDerivedBitmapRelativeIndex + (projectileBitmapIndexDelta * 6) + AL_8_projectileScaleIndex)) {
+ derivedBitmapIndex = kDMDerivedBitmapFirstProjectile + ((ProjectileAspect *)objectAspect)->_firstDerivedBitmapRelativeIndex + (projectileBitmapIndexDelta * 6) + AL_8_projectileScaleIndex;
+ if (doNotScaleWithKineticEnergy && isDerivedBitmapInCache(derivedBitmapIndex)) {
bitmapRedBanana = getDerivedBitmap(derivedBitmapIndex);
} else {
bitmapGreenAnt = getNativeBitmapOrGraphic(AL_4_nativeBitmapIndex);
@@ -3592,11 +3630,11 @@ T0115129_DrawProjectiles:
if (flipHorizontal)
flipBitmapHorizontal(bitmapRedBanana, AL_4_normalizdByteWidth, heightRedEagle);
}
- boxByteGreen._y2 = (heightRedEagle >> 1) + 47;
- boxByteGreen._y1 = 47 - (heightRedEagle >> 1) + !(heightRedEagle & 0x0001);
- boxByteGreen._x2 = MIN(223, projectilePosX + byteWidth);
- boxByteGreen._x1 = MAX(0, projectilePosX - byteWidth + 1);
- if (boxByteGreen._x1) {
+ boxByteGreen._rect.bottom = (heightRedEagle >> 1) + 47;
+ boxByteGreen._rect.top = 47 - (heightRedEagle >> 1) + !(heightRedEagle & 0x0001);
+ boxByteGreen._rect.right = MIN(223, projectilePosX + byteWidth);
+ boxByteGreen._rect.left = MAX(0, projectilePosX - byteWidth + 1);
+ if (boxByteGreen._rect.left) {
if (flipHorizontal)
AL_4_xPos = paddingPixelCount;
else
@@ -3604,7 +3642,7 @@ T0115129_DrawProjectiles:
} else
AL_4_xPos = MAX(paddingPixelCount, int16(byteWidth - projectilePosX - 1)); /* BUG0_06 Graphical glitch when drawing projectiles or explosions. If a projectile or explosion bitmap is cropped because it is only partly visible on the left side of the viewport (boxByteGreen.X1 = 0) and the bitmap is flipped horizontally (flipHorizontal = true) then a wrong part of the bitmap is drawn on screen. To fix this bug, "+ paddingPixelCount" must be added to the second parameter of this function call */
- blitToBitmap(bitmapRedBanana, _bitmapViewport, boxByteGreen, AL_4_xPos, 0, getNormalizedByteWidth(byteWidth), k112_byteWidthViewport, k10_ColorFlesh, heightRedEagle, k136_heightViewport);
+ blitToBitmap(bitmapRedBanana, _bitmapViewport, boxByteGreen, AL_4_xPos, 0, getNormalizedByteWidth(byteWidth), k112_byteWidthViewport, kDMColorFlesh, heightRedEagle, k136_heightViewport);
} else { /* Positive value: projectile aspect is the index of a OBJECT_ASPECT */
useAlcoveObjectImage = false;
byte projectileCoordinates[2];
@@ -3612,7 +3650,7 @@ T0115129_DrawProjectiles:
projectileCoordinates[1] = 47;
coordinateSet = projectileCoordinates;
objectAspect = &_objectAspects209[AL_4_projectileAspect];
- AL_4_nativeBitmapIndex = objectAspect->_firstNativeBitmapRelativeIndex + k360_FirstObjectGraphicIndice;
+ AL_4_nativeBitmapIndex = objectAspect->_firstNativeBitmapRelativeIndex + kDMGraphicIdxFirstObject;
drawProjectileAsObject = true;
goto T0115015_DrawProjectileAsObject; /* Go to code section to draw an object. Once completed, it jumps back to T0115171_BackFromT0115015_DrawProjectileAsObject below */
}
@@ -3635,40 +3673,41 @@ T0115171_BackFromT0115015_DrawProjectileAsObject:;
if (thingParam.getType() == kDMThingTypeExplosion) {
AL_2_cellPurpleMan = thingParam.getCell();
Explosion *explosion = (Explosion *)_vm->_dungeonMan->getThingData(thingParam);
- bool rebirthExplosion = ((uint16)(AL_4_explosionType = explosion->getType()) >= kDMExplosionTypeRebirthStep1);
- if (rebirthExplosion && ((AL_1_viewSquareExplosionIndex < k3_ViewSquare_D3C_Explosion) || (AL_1_viewSquareExplosionIndex > k9_ViewSquare_D1C_Explosion) || (AL_2_cellPurpleMan != cellYellowBear))) /* If explosion is rebirth and is not visible */
+ AL_4_explosionType = explosion->getType();
+ bool rebirthExplosion = ((uint16)AL_4_explosionType >= kDMExplosionTypeRebirthStep1);
+ if (rebirthExplosion && ((AL_1_viewSquareExplosionIndex < kDMViewSquareD3CExplosion) || (AL_1_viewSquareExplosionIndex > kDMViewSquareD1CExplosion) || (AL_2_cellPurpleMan != cellYellowBear))) /* If explosion is rebirth and is not visible */
continue;
bool smoke = false;
if ((AL_4_explosionType == kDMExplosionTypeFireball) || (AL_4_explosionType == kDMExplosionTypeLightningBolt) || (AL_4_explosionType == kDMExplosionTypeRebirthStep2)) {
AL_4_explosionAspectIndex = kDMExplosionAspectFire;
} else {
if ((AL_4_explosionType == kDMExplosionTypePoisonBolt) || (AL_4_explosionType == kDMExplosionTypePoisonCloud)) {
- AL_4_explosionAspectIndex = k2_ExplosionAspectPoison;
+ AL_4_explosionAspectIndex = kDMExplosionAspectPoison;
} else if (AL_4_explosionType == kDMExplosionTypeSmoke) {
smoke = true;
- AL_4_explosionAspectIndex = k3_ExplosionAspectSmoke;
+ AL_4_explosionAspectIndex = kDMExplosionAspectSmoke;
} else {
if (AL_4_explosionType == kDMExplosionTypeRebirthStep1) {
objectAspect = (ObjectAspect *)&_projectileAspect[_vm->ordinalToIndex(-_vm->_dungeonMan->getProjectileAspect(Thing::_explLightningBolt))];
- bitmapRedBanana = getNativeBitmapOrGraphic(((ProjectileAspect *)objectAspect)->_firstNativeBitmapRelativeIndex + (k316_FirstProjectileGraphicIndice + 1));
+ bitmapRedBanana = getNativeBitmapOrGraphic(((ProjectileAspect *)objectAspect)->_firstNativeBitmapRelativeIndex + (kDMGraphicIdxFirstProjectile + 1));
explosionCoordinates = rebirthStep1ExplosionCoordinates[AL_1_viewSquareExplosionIndex - 3];
byteWidth = getScaledDimension((((ProjectileAspect *)objectAspect)->_byteWidth), explosionCoordinates[2]);
heightRedEagle = getScaledDimension((((ProjectileAspect *)objectAspect)->_height), explosionCoordinates[2]);
- if (AL_1_viewSquareExplosionIndex != k9_ViewSquare_D1C_Explosion) {
+ if (AL_1_viewSquareExplosionIndex != kDMViewSquareD1CExplosion) {
blitToBitmapShrinkWithPalChange(bitmapRedBanana, _tmpBitmap, ((ProjectileAspect *)objectAspect)->_byteWidth << 1, ((ProjectileAspect *)objectAspect)->_height, byteWidth << 1, heightRedEagle, _palChangesNoChanges);
bitmapRedBanana = _tmpBitmap;
}
goto T0115200_DrawExplosion;
}
if (AL_4_explosionType == kDMExplosionTypeFluxcage) {
- if (AL_1_viewSquareExplosionIndex >= k4_ViewSquare_D3L_Explosion)
+ if (AL_1_viewSquareExplosionIndex >= kDMViewSquareD3LExplosion)
fluxcageExplosion = explosion;
continue;
}
AL_4_explosionAspectIndex = kDMExplosionAspectSpell;
}
}
- if (AL_1_viewSquareExplosionIndex == k12_ViewSquare_D0C_Explosion) {
+ if (AL_1_viewSquareExplosionIndex == kDMViewSquareD0CExplosion) {
if (smoke)
AL_4_explosionAspectIndex--; /* Smoke uses the same graphics as Poison Cloud, but with palette changes */
@@ -3679,14 +3718,14 @@ T0115171_BackFromT0115015_DrawProjectileAsObject:;
if (AL_2_explosionSize > 3)
AL_4_explosionAspectIndex++; /* Use third graphic in the pattern for large explosion attack */
}
- isDerivedBitmapInCache(k0_DerivedBitmapViewport);
- bitmapRedBanana = getNativeBitmapOrGraphic(AL_4_explosionAspectIndex + k351_FirstExplosionPatternGraphicIndice);
+ isDerivedBitmapInCache(kDMDerivedBitmapViewport);
+ bitmapRedBanana = getNativeBitmapOrGraphic(AL_4_explosionAspectIndex + kDMGraphicIdxFirstExplosionPattern);
if (smoke) {
blitToBitmapShrinkWithPalChange(bitmapRedBanana, _tmpBitmap, 48, 32, 48, 32, _palChangeSmoke);
bitmapRedBanana = _tmpBitmap;
}
- blitBoxFilledWithMaskedBitmap(bitmapRedBanana, _bitmapViewport, 0, getDerivedBitmap(k0_DerivedBitmapViewport), boxExplosionPatternD0C, _vm->getRandomNumber(4) + 87, _vm->getRandomNumber(64), k112_byteWidthViewport, Color(k0x0080_BlitDoNotUseMask | k10_ColorFlesh), 0, 0, 136, 93);
- addDerivedBitmap(k0_DerivedBitmapViewport);
+ blitBoxFilledWithMaskedBitmap(bitmapRedBanana, _bitmapViewport, 0, getDerivedBitmap(kDMDerivedBitmapViewport), boxExplosionPatternD0C, _vm->getRandomNumber(4) + 87, _vm->getRandomNumber(64), k112_byteWidthViewport, Color(k0x0080_BlitDoNotUseMask | kDMColorFlesh), 0, 0, 136, 93);
+ addDerivedBitmap(kDMDerivedBitmapViewport);
warning("DISABLED CODE: f480_releaseBlock in drawObjectsCreaturesProjectilesExplosions");
//f480_releaseBlock(k0_DerivedBitmapViewport | 0x8000);
} else {
@@ -3699,9 +3738,9 @@ T0115171_BackFromT0115015_DrawProjectileAsObject:;
explosionCoordinates = centeredExplosionCoordinates[AL_1_viewSquareExplosionIndex];
} else {
if ((AL_2_cellPurpleMan == directionParam) || (AL_2_cellPurpleMan == _vm->turnDirLeft(directionParam)))
- AL_2_viewCell = k0_ViewCellFronLeft;
+ AL_2_viewCell = kDMViewCellFronLeft;
else
- AL_2_viewCell = k1_ViewCellFrontRight;
+ AL_2_viewCell = kDMViewCellFrontRight;
explosionCoordinates = explosionCoordinatesArray[AL_1_viewSquareExplosionIndex][AL_2_viewCell];
}
@@ -3715,19 +3754,19 @@ T0115200_DrawExplosion:
if (flipHorizontal)
paddingPixelCount = (7 - ((byteWidth - 1) & 0x0007)) << 1; /* Number of unused pixels in the units on the right of the bitmap */
- boxByteGreen._y2 = MIN(135, explosionCoordinates[1] + (heightRedEagle >> 1));
+ boxByteGreen._rect.bottom = MIN(135, explosionCoordinates[1] + (heightRedEagle >> 1));
AL_4_yPos = MAX(0, explosionCoordinates[1] - (heightRedEagle >> 1) + !(heightRedEagle & 0x0001));
if (AL_4_yPos >= 136)
continue;
- boxByteGreen._y1 = AL_4_yPos;
+ boxByteGreen._rect.top = AL_4_yPos;
AL_4_xPos = MIN(223, explosionCoordinates[0] + byteWidth);
if (AL_4_xPos < 0)
continue;
- boxByteGreen._x2 = AL_4_xPos;
+ boxByteGreen._rect.right = AL_4_xPos;
AL_4_xPos = explosionCoordinates[0];
- boxByteGreen._x1 = CLIP(0, AL_4_xPos - byteWidth + 1, 223);
+ boxByteGreen._rect.left = CLIP(0, AL_4_xPos - byteWidth + 1, 223);
- if (boxByteGreen._x1)
+ if (boxByteGreen._rect.left)
AL_4_xPos = paddingPixelCount;
else {
AL_4_xPos = MAX(paddingPixelCount, int16(byteWidth - AL_4_xPos - 1)); /* BUG0_07 Graphical glitch when drawing explosions. If an explosion bitmap is cropped because it is only partly visible on the left side of the viewport (boxByteGreen.X1 = 0) and the bitmap is not flipped horizontally (flipHorizontal = false) then the variable paddingPixelCount is not set before being used here. Its previous value (defined while drawing something else) is used and may cause an incorrect bitmap to be drawn */
@@ -3735,7 +3774,7 @@ T0115200_DrawExplosion:
/* BUG0_06 Graphical glitch when drawing projectiles or explosions. If a projectile or explosion bitmap is cropped because it is only partly visible on the left side of the viewport (boxByteGreen.X1 = 0) and the bitmap is flipped horizontally (flipHorizontal = true) then a wrong part of the bitmap is drawn on screen. To fix this bug, "+ paddingPixelCount" must be added to the second parameter of this function call */
}
- if (boxByteGreen._x2 <= boxByteGreen._x1)
+ if (boxByteGreen._rect.right <= boxByteGreen._rect.left)
continue;
byteWidth = getNormalizedByteWidth(byteWidth);
@@ -3750,7 +3789,7 @@ T0115200_DrawExplosion:
if (flipVertical)
flipBitmapVertical(bitmapRedBanana, byteWidth, heightRedEagle);
- blitToBitmap(bitmapRedBanana, _bitmapViewport, boxByteGreen, AL_4_xPos, 0, byteWidth, k112_byteWidthViewport, k10_ColorFlesh, heightRedEagle, k136_heightViewport);
+ blitToBitmap(bitmapRedBanana, _bitmapViewport, boxByteGreen, AL_4_xPos, 0, byteWidth, k112_byteWidthViewport, kDMColorFlesh, heightRedEagle, k136_heightViewport);
}
}
} while ((thingParam = _vm->_dungeonMan->getNextThing(thingParam))!= Thing::_endOfList);
@@ -3785,7 +3824,7 @@ bool DisplayMan::isDerivedBitmapInCache(int16 derivedBitmapIndex) {
return true;
}
-byte* DisplayMan::getDerivedBitmap(int16 derivedBitmapIndex) {
+byte *DisplayMan::getDerivedBitmap(int16 derivedBitmapIndex) {
return _derivedBitmaps[derivedBitmapIndex];
}
@@ -3810,7 +3849,7 @@ uint16 DisplayMan::getDarkenedColor(uint16 RGBcolor) {
return RGBcolor;
}
-void DisplayMan::startEndFadeToPalette(uint16* P0849_pui_Palette) {
+void DisplayMan::startEndFadeToPalette(uint16 *P0849_pui_Palette) {
uint16 *paletteRegister = _paletteFadeTemporary;
for (int16 i = 0; i < 16; i++)
@@ -3865,7 +3904,7 @@ void DisplayMan::startEndFadeToPalette(uint16* P0849_pui_Palette) {
}
}
-void DisplayMan::buildPaletteChangeCopperList(uint16* middleScreen, uint16* topAndBottom) {
+void DisplayMan::buildPaletteChangeCopperList(uint16 *middleScreen, uint16 *topAndBottom) {
_paletteFadeFrom = topAndBottom;
byte colorPalette[32 * 3];
for (int i = 0; i < 16; ++i) {
diff --git a/engines/dm/gfx.h b/engines/dm/gfx.h
index 46b68fc3c2..8c58ed8cbf 100644
--- a/engines/dm/gfx.h
+++ b/engines/dm/gfx.h
@@ -50,12 +50,12 @@ enum ViewFloor {
};
enum DoorState {
- kDMDoorStateOpen = 0, // @ C0_DOOR_STATE_OPEN
- kDMDoorStateOneFourth = 1, // @ C1_DOOR_STATE_CLOSED_ONE_FOURTH
- kDMDoorStateHalf = 2, // @ k2_DoorStateAspect_CLOSED_HALF
+ kDMDoorStateOpen = 0, // @ C0_DOOR_STATE_OPEN
+ kDMDoorStateOneFourth = 1, // @ C1_DOOR_STATE_CLOSED_ONE_FOURTH
+ kDMDoorStateHalf = 2, // @ k2_DoorStateAspect_CLOSED_HALF
kDMDoorStateThreeFourth = 3, // @ C3_DOOR_STATE_CLOSED_THREE_FOURTH
- kDMDoorStateClosed = 4, // @ C4_DOOR_STATE_CLOSED
- kDMDoorStateDestroyed = 5 // @ C5_DOOR_STATE_DESTROYED
+ kDMDoorStateClosed = 4, // @ C4_DOOR_STATE_CLOSED
+ kDMDoorStateDestroyed = 5 // @ C5_DOOR_STATE_DESTROYED
};
enum DoorOrnament {
@@ -73,17 +73,17 @@ enum DoorButton {
/* View lanes */
enum ViewLane {
- kDMViewLaneCenter = 0, // @ C0_VIEW_LANE_CENTER
- kDMViewLaneLeft = 1, // @ C1_VIEW_LANE_LEFT
- kDMViewLaneRight = 2 // @ C2_VIEW_LANE_RIGHT
+ kDMViewLaneCenter = 0, // @ C0_VIEW_LANE_CENTER
+ kDMViewLaneLeft = 1, // @ C1_VIEW_LANE_LEFT
+ kDMViewLaneRight = 2 // @ C2_VIEW_LANE_RIGHT
};
/* Explosion aspects */
enum ExplosionAspectEnum {
- kDMExplosionAspectFire = 0, // @ C0_EXPLOSION_ASPECT_FIRE
- kDMExplosionAspectSpell = 1, // @ C1_EXPLOSION_ASPECT_SPELL
- k2_ExplosionAspectPoison = 2, // @ C2_EXPLOSION_ASPECT_POISON
- k3_ExplosionAspectSmoke = 3 // @ C3_EXPLOSION_ASPECT_SMOKE
+ kDMExplosionAspectFire = 0, // @ C0_EXPLOSION_ASPECT_FIRE
+ kDMExplosionAspectSpell = 1, // @ C1_EXPLOSION_ASPECT_SPELL
+ kDMExplosionAspectPoison = 2, // @ C2_EXPLOSION_ASPECT_POISON
+ kDMExplosionAspectSmoke = 3 // @ C3_EXPLOSION_ASPECT_SMOKE
};
enum WallSet {
@@ -95,24 +95,209 @@ enum FloorSet {
};
enum ViewWall {
- kDMViewWallD3LRight = 0, // @ C00_VIEW_WALL_D3L_RIGHT
- kDMViewWallD3RLeft = 1, // @ C01_VIEW_WALL_D3R_LEFT
- kDMViewWallD3LFront = 2, // @ C02_VIEW_WALL_D3L_FRONT
- kDMViewWallD3CFront = 3, // @ C03_VIEW_WALL_D3C_FRONT
- kDMViewWallD3RFront = 4, // @ C04_VIEW_WALL_D3R_FRONT
- kDMViewWallD2LRight = 5, // @ C05_VIEW_WALL_D2L_RIGHT
- kDMViewWallD2RLeft = 6, // @ C06_VIEW_WALL_D2R_LEFT
- kDMViewWallD2LFront = 7, // @ C07_VIEW_WALL_D2L_FRONT
- kDMViewWallD2CFront = 8, // @ C08_VIEW_WALL_D2C_FRONT
- kDMViewWallD2RFront = 9, // @ C09_VIEW_WALL_D2R_FRONT
+ kDMViewWallD3LRight = 0, // @ C00_VIEW_WALL_D3L_RIGHT
+ kDMViewWallD3RLeft = 1, // @ C01_VIEW_WALL_D3R_LEFT
+ kDMViewWallD3LFront = 2, // @ C02_VIEW_WALL_D3L_FRONT
+ kDMViewWallD3CFront = 3, // @ C03_VIEW_WALL_D3C_FRONT
+ kDMViewWallD3RFront = 4, // @ C04_VIEW_WALL_D3R_FRONT
+ kDMViewWallD2LRight = 5, // @ C05_VIEW_WALL_D2L_RIGHT
+ kDMViewWallD2RLeft = 6, // @ C06_VIEW_WALL_D2R_LEFT
+ kDMViewWallD2LFront = 7, // @ C07_VIEW_WALL_D2L_FRONT
+ kDMViewWallD2CFront = 8, // @ C08_VIEW_WALL_D2C_FRONT
+ kDMViewWallD2RFront = 9, // @ C09_VIEW_WALL_D2R_FRONT
kDMViewWallD1LRight = 10, // @ C10_VIEW_WALL_D1L_RIGHT
- kDMViewWallD1RLeft = 11, // @ C11_VIEW_WALL_D1R_LEFT
+ kDMViewWallD1RLeft = 11, // @ C11_VIEW_WALL_D1R_LEFT
kDMViewWallD1CFront = 12 // @ C12_VIEW_WALL_D1C_FRONT
};
-#define kDMMaskDoorInfoCreaturesCanSeeThrough 0x0001 // @ MASK0x0001_CREATURES_CAN_SEE_THROUGH
+enum CellOrder {
+ kDMCellOrderNone = 0xFFFF,
+ kDMCellOrderAlcove = 0x0000, // @ C0000_CELL_ORDER_ALCOVE
+ kDMCellOrderBackLeft = 0x0001, // @ C0001_CELL_ORDER_BACKLEFT
+ kDMCellOrderBackRight = 0x0002, // @ C0002_CELL_ORDER_BACKRIGHT
+ kDMCellOrderDoorPass1BackLeft = 0x0018, // @ C0018_CELL_ORDER_DOORPASS1_BACKLEFT
+ kDMCellOrderBackLeftBackRight = 0x0021, // @ C0021_CELL_ORDER_BACKLEFT_BACKRIGHT
+ kDMCellOrderDoorPass1BackRight = 0x0028, // @ C0028_CELL_ORDER_DOORPASS1_BACKRIGHT
+ kDMCellOrderBackRightFrontRight = 0x0032, // @ C0032_CELL_ORDER_BACKRIGHT_FRONTRIGHT
+ kDMCellOrderDoorPass2FrontRight = 0x0039, // @ C0039_CELL_ORDER_DOORPASS2_FRONTRIGHT
+ kDMCellOrderBackLeftFrontLeft = 0x0041, // @ C0041_CELL_ORDER_BACKLEFT_FRONTLEFT
+ kDMCellOrderDoorPass2FrontLeft = 0x0049, // @ C0049_CELL_ORDER_DOORPASS2_FRONTLEFT
+ kDMCellOrderDoorPass1BackRightBackLeft = 0x0128, // @ C0128_CELL_ORDER_DOORPASS1_BACKRIGHT_BACKLEFT
+ kDMCellOrderDoorPass1BackLeftBackRight = 0x0218, // @ C0218_CELL_ORDER_DOORPASS1_BACKLEFT_BACKRIGHT
+ kDMCellOrderBackLeftBackRightFrontRight = 0x0321, // @ C0321_CELL_ORDER_BACKLEFT_BACKRIGHT_FRONTRIGHT
+ kDMCellOrderBackRightFrontLeftFrontRight = 0x0342, // @ C0342_CELL_ORDER_BACKRIGHT_FRONTLEFT_FRONTRIGHT
+ kDMCellOrderDoorPass2FrontLeftFrontRight = 0x0349, // @ C0349_CELL_ORDER_DOORPASS2_FRONTLEFT_FRONTRIGHT
+ kDMCellOrderBackRightBackLeftFrontLeft = 0x0412, // @ C0412_CELL_ORDER_BACKRIGHT_BACKLEFT_FRONTLEFT
+ kDMCellOrderBackLeftFrontRightFrontLeft = 0x0431, // @ C0431_CELL_ORDER_BACKLEFT_FRONTRIGHT_FRONTLEFT
+ kDMCellOrderDoorPass2FrontRightFrontLeft = 0x0439, // @ C0439_CELL_ORDER_DOORPASS2_FRONTRIGHT_FRONTLEFT
+ kDMCellOrderBackLeftBackRightFrontLeftFrontRight = 0x3421, // @ C3421_CELL_ORDER_BACKLEFT_BACKRIGHT_FRONTLEFT_FRONTRIGHT
+ kDMCellOrderBackRightBackLeftFrontRightFrontLeft = 0x4312 // @ C4312_CELL_ORDER_BACKRIGHT_BACKLEFT_FRONTRIGHT_FRONTLEFT
+};
+
+enum DerivedBitmap {
+ kDMDerivedBitmapViewport = 0, // @ C000_DERIVED_BITMAP_VIEWPORT
+ kDMDerivedBitmapThievesEyeVisibleArea = 1, // @ C001_DERIVED_BITMAP_THIEVES_EYE_VISIBLE_AREA
+ kDMDerivedBitmapDamageToCreatureMedium = 2, // @ C002_DERIVED_BITMAP_DAMAGE_TO_CREATURE_MEDIUM
+ kDMDerivedBitmapDamageToCreatureSmall = 3, // @ C003_DERIVED_BITMAP_DAMAGE_TO_CREATURE_SMALL
+ kDMDerivedBitmapFirstWallOrnament = 4, // @ C004_DERIVED_BITMAP_FIRST_WALL_ORNAMENT
+ kDMDerivedBitmapFirstDoorOrnamentD3 = 68, // @ C068_DERIVED_BITMAP_FIRST_DOOR_ORNAMENT_D3
+ kDMDerivedBitmapFirstDoorOrnamentD2 = 69, // @ C069_DERIVED_BITMAP_FIRST_DOOR_ORNAMENT_D2
+ kDMDerivedBitmapFirstDoorButton = 102, // @ C102_DERIVED_BITMAP_FIRST_DOOR_BUTTON
+ kDMDerivedBitmapFirstObject = 104, // @ C104_DERIVED_BITMAP_FIRST_OBJECT
+ kDMDerivedBitmapFirstProjectile = 282, // @ C282_DERIVED_BITMAP_FIRST_PROJECTILE
+ kDMDerivedBitmapFirstExplosion = 438, // @ C438_DERIVED_BITMAP_FIRST_EXPLOSION
+ kDMDerivedBitmapFirstCreature = 495 // @ C495_DERIVED_BITMAP_FIRST_CREATURE
+};
+
+enum ViewSquare {
+ kDMViewSquareD4C = -3, // @ CM3_VIEW_SQUARE_D4C
+ kViewSquareD4L = -2, // @ CM2_VIEW_SQUARE_D4L
+ kDMViewSquareD4R = -1, // @ CM1_VIEW_SQUARE_D4R
+ kDMViewSquareD3C = 0, // @ C00_VIEW_SQUARE_D3C
+ kDMViewSquareD3L = 1, // @ C01_VIEW_SQUARE_D3L
+ kDMViewSquareD3R = 2, // @ C02_VIEW_SQUARE_D3R
+ kDMViewSquareD2C = 3, // @ C03_VIEW_SQUARE_D2C
+ kDMViewSquareD2L = 4, // @ C04_VIEW_SQUARE_D2L
+ kDMViewSquareD2R = 5, // @ C05_VIEW_SQUARE_D2R
+ kDMViewSquareD1C = 6, // @ C06_VIEW_SQUARE_D1C
+ kDMViewSquareD1L = 7, // @ C07_VIEW_SQUARE_D1L
+ kDMViewSquareD1R = 8, // @ C08_VIEW_SQUARE_D1R
+ kDMViewSquareD0C = 9, // @ C09_VIEW_SQUARE_D0C
+ kDMViewSquareD0L = 10, // @ C10_VIEW_SQUARE_D0L
+ kDMViewSquareD0R = 11, // @ C11_VIEW_SQUARE_D0R
+ kDMViewSquareD3CExplosion = 3, // @ C03_VIEW_SQUARE_D3C_EXPLOSION
+ kDMViewSquareD3LExplosion = 4, // @ C04_VIEW_SQUARE_D3L_EXPLOSION
+ kDMViewSquareD1CExplosion = 9, // @ C09_VIEW_SQUARE_D1C_EXPLOSION
+ kDMViewSquareD0CExplosion = 12 // @ C12_VIEW_SQUARE_D0C_EXPLOSION
+};
+
+enum ViewCell {
+ kDMViewCellFronLeft = 0, // @ C00_VIEW_CELL_FRONT_LEFT
+ kDMViewCellFrontRight = 1, // @ C01_VIEW_CELL_FRONT_RIGHT
+ kDMViewCellBackRight = 2, // @ C02_VIEW_CELL_BACK_RIGHT
+ kDMViewCellBackLeft = 3, // @ C03_VIEW_CELL_BACK_LEFT
+ kDMViewCellAlcove = 4, // @ C04_VIEW_CELL_ALCOVE
+ kDMViewCellDoorButtonOrWallOrn = 5 // @ C05_VIEW_CELL_DOOR_BUTTON_OR_WALL_ORNAMENT
+};
+
+enum Color {
+ kDMColorNoTransparency = -1,
+ kDMColorBlack = 0,
+ kDMColorDarkGary = 1,
+ kDMColorLightGray = 2,
+ kDMColorDarkBrown = 3,
+ kDMColorCyan = 4,
+ kDMColorLightBrown = 5,
+ kDMColorDarkGreen = 6,
+ kDMColorLightGreen = 7,
+ kDMColorRed = 8,
+ kDMColorGold = 9,
+ kDMColorFlesh = 10,
+ kDMColorYellow = 11,
+ kDMColorDarkestGray = 12,
+ kDMColorLightestGray = 13,
+ kDMColorBlue = 14,
+ kDMColorWhite = 15
+};
+
+enum GraphicIndice {
+ kDMGraphicIdxDialogBox = 0, // @ C000_GRAPHIC_DIALOG_BOX
+ kDMGraphicIdxTitle = 1, // @ C001_GRAPHIC_TITLE
+ kDMGraphicIdxEntranceLeftDoor = 2, // @ C002_GRAPHIC_ENTRANCE_LEFT_DOOR
+ kDMGraphicIdxEntranceRightDoor = 3, // @ C003_GRAPHIC_ENTRANCE_RIGHT_DOOR
+ kDMGraphicIdxEntrance = 4, // @ C004_GRAPHIC_ENTRANCE
+ kDMGraphicIdxCredits = 5, // @ C005_GRAPHIC_CREDITS
+ kDMGraphicIdxTheEnd = 6, // @ C006_GRAPHIC_THE_END
+ kDMGraphicIdxStatusBoxDeadChampion = 8, // @ C008_GRAPHIC_STATUS_BOX_DEAD_CHAMPION
+ kDMGraphicIdxMenuSpellAreaBackground = 9, // @ C009_GRAPHIC_MENU_SPELL_AREA_BACKGROUND
+ kDMGraphicIdxMenuActionArea = 10, // @ C010_GRAPHIC_MENU_ACTION_AREA
+ kDMGraphicIdxMenuSpellAreLines = 11, // @ C011_GRAPHIC_MENU_SPELL_AREA_LINES
+ kDMGraphicIdxMovementArrows = 13, // @ C013_GRAPHIC_MOVEMENT_ARROWS
+ kDMGraphicIdxDamageToCreature = 14, // @ C014_GRAPHIC_DAMAGE_TO_CREATURE
+ kDMGraphicIdxDamageToChampionSmall = 15, // @ C015_GRAPHIC_DAMAGE_TO_CHAMPION_SMALL
+ kDMGraphicIdxDamageToChampionBig = 16, // @ C016_GRAPHIC_DAMAGE_TO_CHAMPION_BIG
+ kDMGraphicIdxInventory = 17, // @ C017_GRAPHIC_INVENTORY
+ kDMGraphicIdxArrowForChestContent = 18, // @ C018_GRAPHIC_ARROW_FOR_CHEST_CONTENT
+ kDMGraphicIdxEyeForObjectDescription = 19, // @ C019_GRAPHIC_EYE_FOR_OBJECT_DESCRIPTION
+ kDMGraphicIdxPanelEmpty = 20, // @ C020_GRAPHIC_PANEL_EMPTY
+ kDMGraphicIdxPanelOpenScroll = 23, // @ C023_GRAPHIC_PANEL_OPEN_SCROLL
+ kDMGraphicIdxPanelOpenChest = 25, // @ C025_GRAPHIC_PANEL_OPEN_CHEST
+ kDMGraphicIdxChampionPortraits = 26, // @ C026_GRAPHIC_CHAMPION_PORTRAITS
+ kDMGraphicIdxPanelRenameChampion = 27, // @ C027_GRAPHIC_PANEL_RENAME_CHAMPION
+ kDMGraphicIdxChampionIcons = 28, // @ C028_GRAPHIC_CHAMPION_ICONS
+ kDMGraphicIdxObjectDescCircle = 29, // @ C029_GRAPHIC_OBJECT_DESCRIPTION_CIRCLE
+ kDMGraphicIdxFoodLabel = 30, // @ C030_GRAPHIC_FOOD_LABEL
+ kDMGraphicIdxWaterLabel = 31, // @ C031_GRAPHIC_WATER_LABEL
+ kDMGraphicIdxPoisionedLabel = 32, // @ C032_GRAPHIC_POISONED_LABEL
+ kDMGraphicIdxSlotBoxNormal = 33, // @ C033_GRAPHIC_SLOT_BOX_NORMAL
+ kDMGraphicIdxSlotBoxWounded = 34, // @ C034_GRAPHIC_SLOT_BOX_WOUNDED
+ kDMGraphicIdxSlotBoxActingHand = 35, // @ C035_GRAPHIC_SLOT_BOX_ACTING_HAND
+ kDMGraphicIdxBorderPartyShield = 37, // @ C037_GRAPHIC_BORDER_PARTY_SHIELD
+ kDMGraphicIdxBorderPartyFireshield = 38, // @ C038_GRAPHIC_BORDER_PARTY_FIRESHIELD
+ kDMGraphicIdxBorderPartySpellshield = 39, // @ C039_GRAPHIC_BORDER_PARTY_SPELLSHIELD
+ kDMGraphicIdxPanelResurectReincarnate = 40, // @ C040_GRAPHIC_PANEL_RESURRECT_REINCARNATE
+ kDMGraphicIdxHoleInWall = 41, // @ C041_GRAPHIC_HOLE_IN_WALL
+ kDMGraphicIdxObjectIcons000To031 = 42, // @ C042_GRAPHIC_OBJECT_ICONS_000_TO_031
+ kDMGraphicIdxObjectIcons032To063 = 43, // @ C043_GRAPHIC_OBJECT_ICONS_032_TO_063
+ kDMGraphicIdxObjectIcons064To095 = 44, // @ C044_GRAPHIC_OBJECT_ICONS_064_TO_095
+ kDMGraphicIdxObjectIcons096To127 = 45, // @ C045_GRAPHIC_OBJECT_ICONS_096_TO_127
+ kDMGraphicIdxObjectIcons128To159 = 46, // @ C046_GRAPHIC_OBJECT_ICONS_128_TO_159
+ kDMGraphicIdxObjectIcons160To191 = 47, // @ C047_GRAPHIC_OBJECT_ICONS_160_TO_191
+ kDMGraphicIdxObjectIcons192To223 = 48, // @ C048_GRAPHIC_OBJECT_ICONS_192_TO_223
+ kDMGraphicIdxFloorPitD3L = 49, // @ C049_GRAPHIC_FLOOR_PIT_D3L
+ kDMGraphicIdxFloorPitD3C = 50, // @ C050_GRAPHIC_FLOOR_PIT_D3C
+ kDMGraphicIdxFloorPitD2L = 51, // @ C051_GRAPHIC_FLOOR_PIT_D2L
+ kDMGraphicIdxFloorPitD2C = 52, // @ C052_GRAPHIC_FLOOR_PIT_D2C
+ kDMGraphicIdxFloorPitD1L = 53, // @ C053_GRAPHIC_FLOOR_PIT_D1L
+ kDMGraphicIdxFloorPitD1C = 54, // @ C054_GRAPHIC_FLOOR_PIT_D1C
+ kDMGraphicIdxFloorPitD0L = 55, // @ C055_GRAPHIC_FLOOR_PIT_D0L
+ kDMGraphicIdxFloorPitD0C = 56, // @ C056_GRAPHIC_FLOOR_PIT_D0C
+ kDMGraphicIdxFloorPitInvisibleD2L = 57, // @ C057_GRAPHIC_FLOOR_PIT_INVISIBLE_D2L
+ kDMGraphicIdxFloorPitInvisibleD2C = 58, // @ C058_GRAPHIC_FLOOR_PIT_INVISIBLE_D2C
+ kDMGraphicIdxFloorPitInvisibleD1L = 59, // @ C059_GRAPHIC_FLOOR_PIT_INVISIBLE_D1L
+ kDMGraphicIdxFloorPitInvisibleD1C = 60, // @ C060_GRAPHIC_FLOOR_PIT_INVISIBLE_D1C
+ kDMGraphicIdxFloorPitInvisibleD0L = 61, // @ C061_GRAPHIC_FLOOR_PIT_INVISIBLE_D0L
+ kDMGraphicIdxFloorPitInvisibleD0C = 62, // @ C062_GRAPHIC_FLOOR_PIT_INVISIBLE_D0C
+ kDMGraphicIdxCeilingPitD2L = 63, // @ C063_GRAPHIC_CEILING_PIT_D2L
+ kDMGraphicIdxCeilingPitD2C = 64, // @ C064_GRAPHIC_CEILING_PIT_D2C
+ kDMGraphicIdxCeilingPitD1L = 65, // @ C065_GRAPHIC_CEILING_PIT_D1L
+ kDMGraphicIdxCeilingPitD1C = 66, // @ C066_GRAPHIC_CEILING_PIT_D1C
+ kDMGraphicIdxCeilingPitD0L = 67, // @ C067_GRAPHIC_CEILING_PIT_D0L
+ kDMGraphicIdxCeilingPitD0C = 68, // @ C068_GRAPHIC_CEILING_PIT_D0C
+ kDMGraphicIdxFieldMaskD3R = 69, // @ C069_GRAPHIC_FIELD_MASK_D3R
+ kDMGraphicIdxFieldTeleporter = 73, // @ C073_GRAPHIC_FIELD_TELEPORTER
+ kDMGraphicIdxInscriptionFont = 120, // @ C120_GRAPHIC_INSCRIPTION_FONT
+ kDMGraphicIdxWallOrnChampMirror = 208, // @ C208_GRAPHIC_WALL_ORNAMENT_43_CHAMPION_MIRROR
+ kDMGraphicIdxFloorOrnD3LFootprints = 241, // @ C241_GRAPHIC_FLOOR_ORNAMENT_15_D3L_FOOTPRINTS
+ kDMGraphicIdxDoorMaskDestroyed = 301, // @ C301_GRAPHIC_DOOR_MASK_DESTROYED
+ kDMGraphicIdxFirstDoorButton = 315, // @ C315_GRAPHIC_FIRST_DOOR_BUTTON
+ kDMGraphicIdxFirstProjectile = 316, // @ C316_GRAPHIC_FIRST_PROJECTILE
+ kDMGraphicIdxFirstExplosion = 348, // @ C348_GRAPHIC_FIRST_EXPLOSION
+ kDMGraphicIdxFirstExplosionPattern = 351, // @ C351_GRAPHIC_FIRST_EXPLOSION_PATTERN
+ kDMGraphicIdxFirstObject = 360, // @ C360_GRAPHIC_FIRST_OBJECT
+ kDMGraphicIdxFirstCreature = 446, // @ C446_GRAPHIC_FIRST_CREATURE
+ kDMGraphicIdxFont = 557 // @ C557_GRAPHIC_FONT
+};
+
+#define kDMMaskDoorInfoCreaturesCanSeeThrough 0x0001 // @ MASK0x0001_CREATURES_CAN_SEE_THROUGH
#define kDMMaskDoorInfoProjectilesCanPassThrough 0x0002 // @ MASK0x0002_PROJECTILES_CAN_PASS_THROUGH
-#define kDMMaskDoorInfoAnimated 0x0004 // @ MASK0x0004_ANIMATED
+#define kDMMaskDoorInfoAnimated 0x0004 // @ MASK0x0004_ANIMATED
+#define kDMMaskDoorFront 0x0008 // @ MASK0x0008_DOOR_FRONT
+
+/* Field Aspect Mask */
+#define kMaskFieldAspectFlipMask 0x0080 // @ MASK0x0080_FLIP_MASK
+#define kMaskFieldAspectIndex 0x007F // @ MASK0x007F_MASK_INDEX
+#define kMaskFieldAspectNoMask 255 // @ C255_NO_MASK
+
+#define kDMCreatureMaskAdditional 0x0003 // @ MASK0x0003_ADDITIONAL
+#define kDMCreatureMaskFlipNonAttack 0x0004 // @ MASK0x0004_FLIP_NON_ATTACK
+#define kDMCreatureMaskSide 0x0008 // @ MASK0x0008_SIDE
+#define kDMCreatureMaskBack 0x0010 // @ MASK0x0010_BACK
+#define kDMCreatureMaskAttack 0x0020 // @ MASK0x0020_ATTACK
+#define kDMCreatureMaskSpecialD2Front 0x0080 // @ MASK0x0080_SPECIAL_D2_FRONT
+#define kDMCreatureMaskSpecialD2FrontIsFlipped 0x0100 // @ MASK0x0100_SPECIAL_D2_FRONT_IS_FLIPPED_FRONT
+#define kDMCreatureMaskFlipAttack 0x0200 // @ MASK0x0200_FLIP_ATTACK
+#define kDMCreatureMaskFlipDuringAttack 0x0400 // @ MASK0x0400_FLIP_DURING_ATTACK
#define k2_FloorSetGraphicCount 2 // @ C002_FLOOR_SET_GRAPHIC_COUNT
#define k13_WallSetGraphicCount 13 // @ C013_WALL_SET_GRAPHIC_COUNT
@@ -126,50 +311,17 @@ enum ViewWall {
#define k14_ProjectileAspectCount 14 // @ C014_PROJECTILE_ASPECT_COUNT
#define k85_ObjAspectCount 85 // @ C085_OBJECT_ASPECT_COUNT
-#define k0_HalfSizedViewCell_LeftColumn 0 // @ C00_VIEW_CELL_LEFT_COLUMN
-#define k1_HalfSizedViewCell_RightColumn 1 // @ C01_VIEW_CELL_RIGHT_COLUMN
-#define k2_HalfSizedViewCell_BackRow 2 // @ C02_VIEW_CELL_BACK_ROW
+#define k0_HalfSizedViewCell_LeftColumn 0 // @ C00_VIEW_CELL_LEFT_COLUMN
+#define k1_HalfSizedViewCell_RightColumn 1 // @ C01_VIEW_CELL_RIGHT_COLUMN
+#define k2_HalfSizedViewCell_BackRow 2 // @ C02_VIEW_CELL_BACK_ROW
#define k3_HalfSizedViewCell_CenterColumn 3 // @ C03_VIEW_CELL_CENTER_COLUMN
-#define k4_HalfSizedViewCell_FrontRow 4 // @ C04_VIEW_CELL_FRONT_ROW
+#define k4_HalfSizedViewCell_FrontRow 4 // @ C04_VIEW_CELL_FRONT_ROW
/* Shift sets */
#define k0_ShiftSet_D0BackD1Front 0 // @ C0_SHIFT_SET_D0_BACK_OR_D1_FRONT
#define k1_ShiftSet_D1BackD2Front 1 // @ C1_SHIFT_SET_D1_BACK_OR_D2_FRONT
#define k2_ShiftSet_D2BackD3Front 2 // @ C2_SHIFT_SET_D2_BACK_OR_D3_FRONT
-#define k0x0008_CellOrder_DoorFront 0x0008 // @ MASK0x0008_DOOR_FRONT
-#define k0x0000_CellOrder_Alcove 0x0000 // @ C0000_CELL_ORDER_ALCOVE
-#define k0x0001_CellOrder_BackLeft 0x0001 // @ C0001_CELL_ORDER_BACKLEFT
-#define k0x0002_CellOrder_BackRight 0x0002 // @ C0002_CELL_ORDER_BACKRIGHT
-#define k0x0018_CellOrder_DoorPass1_BackLeft 0x0018 // @ C0018_CELL_ORDER_DOORPASS1_BACKLEFT
-#define k0x0021_CellOrder_BackLeft_BackRight 0x0021 // @ C0021_CELL_ORDER_BACKLEFT_BACKRIGHT
-#define k0x0028_CellOrder_DoorPass1_BackRight 0x0028 // @ C0028_CELL_ORDER_DOORPASS1_BACKRIGHT
-#define k0x0032_CellOrder_BackRight_FrontRight 0x0032 // @ C0032_CELL_ORDER_BACKRIGHT_FRONTRIGHT
-#define k0x0039_CellOrder_DoorPass2_FrontRight 0x0039 // @ C0039_CELL_ORDER_DOORPASS2_FRONTRIGHT
-#define k0x0041_CellOrder_BackLeft_FrontLeft 0x0041 // @ C0041_CELL_ORDER_BACKLEFT_FRONTLEFT
-#define k0x0049_CellOrder_DoorPass2_FrontLeft 0x0049 // @ C0049_CELL_ORDER_DOORPASS2_FRONTLEFT
-#define k0x0128_CellOrder_DoorPass1_BackRight_BackLeft 0x0128 // @ C0128_CELL_ORDER_DOORPASS1_BACKRIGHT_BACKLEFT
-#define k0x0218_CellOrder_DoorPass1_BackLeft_BackRight 0x0218 // @ C0218_CELL_ORDER_DOORPASS1_BACKLEFT_BACKRIGHT
-#define k0x0321_CellOrder_BackLeft_BackRight_FrontRight 0x0321 // @ C0321_CELL_ORDER_BACKLEFT_BACKRIGHT_FRONTRIGHT
-#define k0x0342_CellOrder_BackRight_FrontLeft_FrontRight 0x0342 // @ C0342_CELL_ORDER_BACKRIGHT_FRONTLEFT_FRONTRIGHT
-#define k0x0349_CellOrder_DoorPass2_FrontLeft_FrontRight 0x0349 // @ C0349_CELL_ORDER_DOORPASS2_FRONTLEFT_FRONTRIGHT
-#define k0x0412_CellOrder_BackRight_BackLeft_FrontLeft 0x0412 // @ C0412_CELL_ORDER_BACKRIGHT_BACKLEFT_FRONTLEFT
-#define k0x0431_CellOrder_BackLeft_FrontRight_FrontLeft 0x0431 // @ C0431_CELL_ORDER_BACKLEFT_FRONTRIGHT_FRONTLEFT
-#define k0x0439_CellOrder_DoorPass2_FrontRight_FrontLeft 0x0439 // @ C0439_CELL_ORDER_DOORPASS2_FRONTRIGHT_FRONTLEFT
-#define k0x3421_CellOrder_BackLeft_BackRight_FrontLeft_FrontRight 0x3421 // @ C3421_CELL_ORDER_BACKLEFT_BACKRIGHT_FRONTLEFT_FRONTRIGHT
-#define k0x4312_CellOrder_BackRight_BackLeft_FrontRight_FrontLeft 0x4312 // @ C4312_CELL_ORDER_BACKRIGHT_BACKLEFT_FRONTRIGHT_FRONTLEFT
-
-/* Creature info GraphicInfo */
-#define k0x0003_CreatureInfoGraphicMaskAdditional 0x0003 // @ MASK0x0003_ADDITIONAL
-#define k0x0004_CreatureInfoGraphicMaskFlipNonAttack 0x0004 // @ MASK0x0004_FLIP_NON_ATTACK
-#define k0x0008_CreatureInfoGraphicMaskSide 0x0008 // @ MASK0x0008_SIDE
-#define k0x0010_CreatureInfoGraphicMaskBack 0x0010 // @ MASK0x0010_BACK
-#define k0x0020_CreatureInfoGraphicMaskAttack 0x0020 // @ MASK0x0020_ATTACK
-#define k0x0080_CreatureInfoGraphicMaskSpecialD2Front 0x0080 // @ MASK0x0080_SPECIAL_D2_FRONT
-#define k0x0100_CreatureInfoGraphicMaskSpecialD2FrontIsFlipped 0x0100 // @ MASK0x0100_SPECIAL_D2_FRONT_IS_FLIPPED_FRONT
-#define k0x0200_CreatureInfoGraphicMaskFlipAttack 0x0200 // @ MASK0x0200_FLIP_ATTACK
-#define k0x0400_CreatureInfoGraphicMaskFlipDuringAttack 0x0400 // @ MASK0x0400_FLIP_DURING_ATTACK
-
#define k75_FirstFloorSet 75 // @ C075_GRAPHIC_FIRST_FLOOR_SET
#define k77_FirstWallSet 77 // @ C077_GRAPHIC_FIRST_WALL_SET
#define k90_FirstStairs 90 // @ C090_GRAPHIC_FIRST_STAIRS
@@ -180,200 +332,65 @@ enum ViewWall {
#define k303_FirstDoorOrn 303 // @ C303_GRAPHIC_FIRST_DOOR_ORNAMENT
#define k730_DerivedBitmapMaximumCount 730 // @ C730_DERIVED_BITMAP_MAXIMUM_COUNT
-/* Field Aspect Mask */
-#define kMaskFieldAspectFlipMask 0x0080 // @ MASK0x0080_FLIP_MASK
-#define kMaskFieldAspectIndex 0x007F // @ MASK0x007F_MASK_INDEX
-#define kMaskFieldAspectNoMask 255 // @ C255_NO_MASK
-
-enum ViewSquare {
- kM3_ViewSquare_D4C = -3, // @ CM3_VIEW_SQUARE_D4C
- kM2_ViewSquare_D4L = -2, // @ CM2_VIEW_SQUARE_D4L
- kM1_ViewSquare_D4R = -1, // @ CM1_VIEW_SQUARE_D4R
- k0_ViewSquare_D3C = 0, // @ C00_VIEW_SQUARE_D3C
- k1_ViewSquare_D3L = 1, // @ C01_VIEW_SQUARE_D3L
- k2_ViewSquare_D3R = 2, // @ C02_VIEW_SQUARE_D3R
- k3_ViewSquare_D2C = 3, // @ C03_VIEW_SQUARE_D2C
- k4_ViewSquare_D2L = 4, // @ C04_VIEW_SQUARE_D2L
- k5_ViewSquare_D2R = 5, // @ C05_VIEW_SQUARE_D2R
- k6_ViewSquare_D1C = 6, // @ C06_VIEW_SQUARE_D1C
- k7_ViewSquare_D1L = 7, // @ C07_VIEW_SQUARE_D1L
- k8_ViewSquare_D1R = 8, // @ C08_VIEW_SQUARE_D1R
- k9_ViewSquare_D0C = 9, // @ C09_VIEW_SQUARE_D0C
- k10_ViewSquare_D0L = 10, // @ C10_VIEW_SQUARE_D0L
- k11_ViewSquare_D0R = 11, // @ C11_VIEW_SQUARE_D0R
- k3_ViewSquare_D3C_Explosion = 3, // @ C03_VIEW_SQUARE_D3C_EXPLOSION
- k4_ViewSquare_D3L_Explosion = 4, // @ C04_VIEW_SQUARE_D3L_EXPLOSION
- k9_ViewSquare_D1C_Explosion = 9, // @ C09_VIEW_SQUARE_D1C_EXPLOSION
- k12_ViewSquare_D0C_Explosion = 12 // @ C12_VIEW_SQUARE_D0C_EXPLOSION
-};
-
-class ExplosionAspect {
-public:
- uint16 _byteWidth;
- uint16 _height;
-
- ExplosionAspect(uint16 byteWidth, uint16 height) :_byteWidth(byteWidth), _height(height) {}
- ExplosionAspect() : _byteWidth(0), _height(0) {}
-}; // @ EXPLOSION_ASPECT
-
-extern ExplosionAspect g211_ExplosionAspects[k4_ExplosionAspectCount]; // @ G0211_as_Graphic558_ExplosionAspects
-
-extern byte g215_ProjectileScales[7]; // @ G0215_auc_Graphic558_ProjectileScales
-
-
-#define k0_DerivedBitmapViewport 0 // @ C000_DERIVED_BITMAP_VIEWPORT
-#define k1_DerivedBitmapThievesEyeVisibleArea 1 // @ C001_DERIVED_BITMAP_THIEVES_EYE_VISIBLE_AREA
-#define k2_DerivedBitmapDamageToCreatureMedium 2 // @ C002_DERIVED_BITMAP_DAMAGE_TO_CREATURE_MEDIUM
-#define k3_DerivedBitmapDamageToCreatureSmall 3 // @ C003_DERIVED_BITMAP_DAMAGE_TO_CREATURE_SMALL
-#define k4_DerivedBitmapFirstWallOrnament 4 // @ C004_DERIVED_BITMAP_FIRST_WALL_ORNAMENT
-#define k68_DerivedBitmapFirstDoorOrnament_D3 68 // @ C068_DERIVED_BITMAP_FIRST_DOOR_ORNAMENT_D3
-#define k69_DerivedBitmapFirstDoorOrnament_D2 69 // @ C069_DERIVED_BITMAP_FIRST_DOOR_ORNAMENT_D2
-#define k102_DerivedBitmapFirstDoorButton 102 // @ C102_DERIVED_BITMAP_FIRST_DOOR_BUTTON
-#define k104_DerivedBitmapFirstObject 104 // @ C104_DERIVED_BITMAP_FIRST_OBJECT
-#define k282_DerivedBitmapFirstProjectile 282 // @ C282_DERIVED_BITMAP_FIRST_PROJECTILE
-#define k438_DerivedBitmapFirstExplosion 438 // @ C438_DERIVED_BITMAP_FIRST_EXPLOSION
-#define k495_DerivedBitmapFirstCreature 495 // @ C495_DERIVED_BITMAP_FIRST_CREATURE
-
-
-#define k16_Scale_D3 16 // @ C16_SCALE_D3
-#define k20_Scale_D2 20 // @ C20_SCALE_D2
+#define k16_Scale_D3 16 // @ C16_SCALE_D3
+#define k20_Scale_D2 20 // @ C20_SCALE_D2
/* Object aspect GraphicInfo */
-#define k0x0001_ObjectFlipOnRightMask 0x0001 // @ MASK0x0001_FLIP_ON_RIGHT
-#define k0x0010_ObjectAlcoveMask 0x0010 // @ MASK0x0010_ALCOVE
+#define k0x0001_ObjectFlipOnRightMask 0x0001 // @ MASK0x0001_FLIP_ON_RIGHT
+#define k0x0010_ObjectAlcoveMask 0x0010 // @ MASK0x0010_ALCOVE
/* Projectile aspect GraphicInfo */
-#define k0x0010_ProjectileSideMask 0x0010 // @ MASK0x0010_SIDE
-#define k0x0100_ProjectileScaleWithKineticEnergyMask 0x0100 // @ MASK0x0100_SCALE_WITH_KINETIC_ENERGY
-#define k0x0003_ProjectileAspectTypeMask 0x0003 // @ MASK0x0003_ASPECT_TYPE
+#define k0x0010_ProjectileSideMask 0x0010 // @ MASK0x0010_SIDE
+#define k0x0100_ProjectileScaleWithKineticEnergyMask 0x0100 // @ MASK0x0100_SCALE_WITH_KINETIC_ENERGY
+#define k0x0003_ProjectileAspectTypeMask 0x0003 // @ MASK0x0003_ASPECT_TYPE
/* Projectile aspect type */
-#define k0_ProjectileAspectHasBackGraphicRotation 0 // @ C0_PROJECTILE_ASPECT_TYPE_HAS_BACK_GRAPHIC_AND_ROTATION
+#define k0_ProjectileAspectHasBackGraphicRotation 0 // @ C0_PROJECTILE_ASPECT_TYPE_HAS_BACK_GRAPHIC_AND_ROTATION
#define k1_ProjectileAspectBackGraphic 1 // @ C1_PROJECTILE_ASPECT_TYPE_HAS_BACK_GRAPHIC_AND_NO_ROTATION
-#define k2_ProjectileAspectHasRotation 2 // @ C2_PROJECTILE_ASPECT_TYPE_NO_BACK_GRAPHIC_AND_ROTATION
-#define k3_ProjectileAspectHasNone 3 // @ C3_PROJECTILE_ASPECT_TYPE_NO_BACK_GRAPHIC_AND_NO_ROTATION
+#define k2_ProjectileAspectHasRotation 2 // @ C2_PROJECTILE_ASPECT_TYPE_NO_BACK_GRAPHIC_AND_ROTATION
+#define k3_ProjectileAspectHasNone 3 // @ C3_PROJECTILE_ASPECT_TYPE_NO_BACK_GRAPHIC_AND_NO_ROTATION
/* Projectile aspects */
-#define k3_ProjectileAspectExplosionLightningBolt 3 // @ C03_PROJECTILE_ASPECT_EXPLOSION_LIGHTNING_BOLT
-#define k10_ProjectileAspectExplosionFireBall 10 // @ C10_PROJECTILE_ASPECT_EXPLOSION_FIREBALL
-#define k11_ProjectileAspectExplosionDefault 11 // @ C11_PROJECTILE_ASPECT_EXPLOSION_DEFAULT
-#define k12_ProjectileAspectExplosionSlime 12 // @ C12_PROJECTILE_ASPECT_EXPLOSION_SLIME
+#define k3_ProjectileAspectExplosionLightningBolt 3 // @ C03_PROJECTILE_ASPECT_EXPLOSION_LIGHTNING_BOLT
+#define k10_ProjectileAspectExplosionFireBall 10 // @ C10_PROJECTILE_ASPECT_EXPLOSION_FIREBALL
+#define k11_ProjectileAspectExplosionDefault 11 // @ C11_PROJECTILE_ASPECT_EXPLOSION_DEFAULT
+#define k12_ProjectileAspectExplosionSlime 12 // @ C12_PROJECTILE_ASPECT_EXPLOSION_SLIME
#define k13_ProjectileAspectExplosionPoisonBoltCloud 13 // @ C13_PROJECTILE_ASPECT_EXPLOSION_POISON_BOLT_POISON_CLOUD
#define k0x0080_BlitDoNotUseMask 0x0080 // @ MASK0x0080_DO_NOT_USE_MASK
#define kScaleThreshold 32768
-enum ViewCell {
- k0_ViewCellFronLeft = 0, // @ C00_VIEW_CELL_FRONT_LEFT
- k1_ViewCellFrontRight = 1, // @ C01_VIEW_CELL_FRONT_RIGHT
- k2_ViewCellBackRight = 2, // @ C02_VIEW_CELL_BACK_RIGHT
- k3_ViewCellBackLeft = 3, // @ C03_VIEW_CELL_BACK_LEFT
- k4_ViewCellAlcove = 4, // @ C04_VIEW_CELL_ALCOVE
- k5_ViewCellDoorButtonOrWallOrn = 5 // @ C05_VIEW_CELL_DOOR_BUTTON_OR_WALL_ORNAMENT
-};
-
-enum GraphicIndice {
- k0_dialogBoxGraphicIndice = 0, // @ C000_GRAPHIC_DIALOG_BOX
- k1_titleGraphicsIndice = 1, // @ C001_GRAPHIC_TITLE
- k2_entranceLeftDoorGraphicIndice = 2, // @ C002_GRAPHIC_ENTRANCE_LEFT_DOOR
- k3_entranceRightDoorGraphicIndice = 3, // @ C003_GRAPHIC_ENTRANCE_RIGHT_DOOR
- k4_entranceGraphicIndice = 4, // @ C004_GRAPHIC_ENTRANCE
- k5_creditsGraphicIndice = 5, // @ C005_GRAPHIC_CREDITS
- k6_theEndIndice = 6, // @ C006_GRAPHIC_THE_END
- k8_StatusBoxDeadChampion = 8, // @ C008_GRAPHIC_STATUS_BOX_DEAD_CHAMPION
- k9_MenuSpellAreaBackground = 9, // @ C009_GRAPHIC_MENU_SPELL_AREA_BACKGROUND
- k10_MenuActionAreaIndice = 10, // @ C010_GRAPHIC_MENU_ACTION_AREA
- k11_MenuSpellAreLinesIndice = 11, // @ C011_GRAPHIC_MENU_SPELL_AREA_LINES
- k13_MovementArrowsIndice = 13, // @ C013_GRAPHIC_MOVEMENT_ARROWS
- k14_damageToCreatureIndice = 14, // @ C014_GRAPHIC_DAMAGE_TO_CREATURE
- k15_damageToChampionSmallIndice = 15, // @ C015_GRAPHIC_DAMAGE_TO_CHAMPION_SMALL
- k16_damageToChampionBig = 16, // @ C016_GRAPHIC_DAMAGE_TO_CHAMPION_BIG
- k17_InventoryGraphicIndice = 17, // @ C017_GRAPHIC_INVENTORY
- k18_ArrowForChestContentIndice = 18, // @ C018_GRAPHIC_ARROW_FOR_CHEST_CONTENT
- k19_EyeForObjectDescriptionIndice = 19, // @ C019_GRAPHIC_EYE_FOR_OBJECT_DESCRIPTION
- k20_PanelEmptyIndice = 20, // @ C020_GRAPHIC_PANEL_EMPTY
- k23_PanelOpenScrollIndice = 23, // @ C023_GRAPHIC_PANEL_OPEN_SCROLL
- k25_PanelOpenChestIndice = 25, // @ C025_GRAPHIC_PANEL_OPEN_CHEST
- k26_ChampionPortraitsIndice = 26, // @ C026_GRAPHIC_CHAMPION_PORTRAITS
- k27_PanelRenameChampionIndice = 27, // @ C027_GRAPHIC_PANEL_RENAME_CHAMPION
- k28_ChampionIcons = 28, // @ C028_GRAPHIC_CHAMPION_ICONS
- k29_ObjectDescCircleIndice = 29, // @ C029_GRAPHIC_OBJECT_DESCRIPTION_CIRCLE
- k30_FoodLabelIndice = 30, // @ C030_GRAPHIC_FOOD_LABEL
- k31_WaterLabelIndice = 31, // @ C031_GRAPHIC_WATER_LABEL
- k32_PoisionedLabelIndice = 32, // @ C032_GRAPHIC_POISONED_LABEL
- k33_SlotBoxNormalIndice = 33, // @ C033_GRAPHIC_SLOT_BOX_NORMAL
- k34_SlotBoxWoundedIndice = 34, // @ C034_GRAPHIC_SLOT_BOX_WOUNDED
- k35_SlotBoxActingHandIndice = 35, // @ C035_GRAPHIC_SLOT_BOX_ACTING_HAND
- k37_BorderPartyShieldIndice = 37, // @ C037_GRAPHIC_BORDER_PARTY_SHIELD
- k38_BorderPartyFireshieldIndice = 38, // @ C038_GRAPHIC_BORDER_PARTY_FIRESHIELD
- k39_BorderPartySpellshieldIndice = 39, // @ C039_GRAPHIC_BORDER_PARTY_SPELLSHIELD
- k40_PanelResurectReincaranteIndice = 40, // @ C040_GRAPHIC_PANEL_RESURRECT_REINCARNATE
- k41_holeInWall_GraphicIndice = 41, // @ C041_GRAPHIC_HOLE_IN_WALL
- k42_ObjectIcons_000_TO_031 = 42, // @ C042_GRAPHIC_OBJECT_ICONS_000_TO_031
- k43_ObjectIcons_032_TO_063 = 43, // @ C043_GRAPHIC_OBJECT_ICONS_032_TO_063
- k44_ObjectIcons_064_TO_095 = 44, // @ C044_GRAPHIC_OBJECT_ICONS_064_TO_095
- k45_ObjectIcons_096_TO_127 = 45, // @ C045_GRAPHIC_OBJECT_ICONS_096_TO_127
- k46_ObjectIcons_128_TO_159 = 46, // @ C046_GRAPHIC_OBJECT_ICONS_128_TO_159
- k47_ObjectIcons_160_TO_191 = 47, // @ C047_GRAPHIC_OBJECT_ICONS_160_TO_191
- k48_ObjectIcons_192_TO_223 = 48, // @ C048_GRAPHIC_OBJECT_ICONS_192_TO_223
- k49_FloorPit_D3L_GraphicIndice = 49, // @ C049_GRAPHIC_FLOOR_PIT_D3L
- k50_FloorPit_D3C_GraphicIndice = 50, // @ C050_GRAPHIC_FLOOR_PIT_D3C
- k51_FloorPit_D2L_GraphicIndice = 51, // @ C051_GRAPHIC_FLOOR_PIT_D2L
- k52_FloorPit_D2C_GraphicIndice = 52, // @ C052_GRAPHIC_FLOOR_PIT_D2C
- k53_FloorPit_D1L_GraphicIndice = 53, // @ C053_GRAPHIC_FLOOR_PIT_D1L
- k54_FloorPit_D1C_GraphicIndice = 54, // @ C054_GRAPHIC_FLOOR_PIT_D1C
- k55_FloorPit_D0L_GraphicIndice = 55, // @ C055_GRAPHIC_FLOOR_PIT_D0L
- k56_FloorPit_D0C_GraphicIndice = 56, // @ C056_GRAPHIC_FLOOR_PIT_D0C
- k57_FloorPir_Invisible_D2L_GraphicIndice = 57, // @ C057_GRAPHIC_FLOOR_PIT_INVISIBLE_D2L
- k58_FloorPit_invisible_D2C_GraphicIndice = 58, // @ C058_GRAPHIC_FLOOR_PIT_INVISIBLE_D2C
- k59_floorPit_invisible_D1L_GraphicIndice = 59, // @ C059_GRAPHIC_FLOOR_PIT_INVISIBLE_D1L
- k60_floorPitInvisibleD1C_GraphicIndice = 60, // @ C060_GRAPHIC_FLOOR_PIT_INVISIBLE_D1C
- k61_floorPitInvisibleD0L_GraphicIndice = 61, // @ C061_GRAPHIC_FLOOR_PIT_INVISIBLE_D0L
- k62_flootPitInvisibleD0C_graphicIndice = 62, // @ C062_GRAPHIC_FLOOR_PIT_INVISIBLE_D0C
- k63_ceilingPit_D2L_GraphicIndice = 63, // @ C063_GRAPHIC_CEILING_PIT_D2L
- k64_ceilingPitD2C_GraphicIndice = 64, // @ C064_GRAPHIC_CEILING_PIT_D2C
- k65_ceilingPitD1L_GraphicIndice = 65, // @ C065_GRAPHIC_CEILING_PIT_D1L
- k66_ceilingPitD1C_GraphicIndice = 66, // @ C066_GRAPHIC_CEILING_PIT_D1C
- k67_ceilingPitD0L_grahicIndice = 67, // @ C067_GRAPHIC_CEILING_PIT_D0L
- k68_ceilingPitD0C_graphicIndice = 68, // @ C068_GRAPHIC_CEILING_PIT_D0C
- k69_FieldMask_D3R_GraphicIndice = 69, // @ C069_GRAPHIC_FIELD_MASK_D3R
- k73_FieldTeleporterGraphicIndice = 73, // @ C073_GRAPHIC_FIELD_TELEPORTER
- k120_InscriptionFontIndice = 120, // @ C120_GRAPHIC_INSCRIPTION_FONT
- k208_wallOrn_43_champMirror = 208, // @ C208_GRAPHIC_WALL_ORNAMENT_43_CHAMPION_MIRROR
- k241_FloorOrn_15_D3L_footprints = 241, // @ C241_GRAPHIC_FLOOR_ORNAMENT_15_D3L_FOOTPRINTS
- k301_DoorMaskDestroyedIndice = 301, // @ C301_GRAPHIC_DOOR_MASK_DESTROYED
- k315_firstDoorButton_GraphicIndice = 315, // @ C315_GRAPHIC_FIRST_DOOR_BUTTON
- k316_FirstProjectileGraphicIndice = 316, // @ C316_GRAPHIC_FIRST_PROJECTILE
- k348_FirstExplosionGraphicIndice = 348, // @ C348_GRAPHIC_FIRST_EXPLOSION
- k351_FirstExplosionPatternGraphicIndice = 351, // @ C351_GRAPHIC_FIRST_EXPLOSION_PATTERN
- k360_FirstObjectGraphicIndice = 360, // @ C360_GRAPHIC_FIRST_OBJECT
- k446_FirstCreatureGraphicIndice = 446, // @ C446_GRAPHIC_FIRST_CREATURE
- k557_FontGraphicIndice = 557 // @ C557_GRAPHIC_FONT
-};
+class ExplosionAspect {
+public:
+ uint16 _byteWidth;
+ uint16 _height;
+ ExplosionAspect(uint16 byteWidth, uint16 height) :_byteWidth(byteWidth), _height(height) {}
+ ExplosionAspect() : _byteWidth(0), _height(0) {}
+}; // @ EXPLOSION_ASPECT
// in all cases, where a function takes a Box, it expects it to contain inclusive boundaries
class Box {
public:
- int16 _x1;
- int16 _x2;
- int16 _y1;
- int16 _y2;
+ Common::Rect _rect;
- Box(int16 x1, int16 x2, int16 y1, int16 y2) : _x1(x1), _x2(x2), _y1(y1), _y2(y2) {}
- Box() {}
- template <typename T>
- explicit Box(T *ptr) {
- _x1 = *ptr++;
- _x2 = *ptr++;
- _y1 = *ptr++;
- _y2 = *ptr++;
+ Box(int16 x1, int16 x2, int16 y1, int16 y2) {
+ // +1 because Rect.constains is not inclusive for right and bottom, at the opposite of the isPointInside
+ _rect = Common::Rect(x1, y1, x2, y2);
}
+
+ Box() {}
+
bool isPointInside(Common::Point point) {
- return (_x1 <= point.x) && (point.x <= _x2) && (_y1 <= point.y) && (point.y <= _y2); // <= because incluseive boundaries
+ // not using Common::Rect::contains() because we need both boundaries to be included
+ return (_rect.left <= point.x) && (point.x <= _rect.right) && (_rect.top <= point.y) && (point.y <= _rect.bottom);
}
- bool isPointInside(int16 x, int16 y) { return isPointInside(Common::Point(x, y)); }
- void setToZero() { _x1 = _x2 = _y1 = _y2 = 0; }
+
+ bool isPointInside(int16 x, int16 y) {
+ return isPointInside(Common::Point(x, y));
+ }
+
+ void setToZero() { _rect = Common::Rect(0, 0, 0, 0); }
}; // @ BOX_BYTE, BOX_WORD
extern Box g2_BoxMovementArrows; // @ G0002_s_Graphic562_Box_MovementArrows
@@ -391,26 +408,6 @@ public:
_srcByteWidth(srcWidth), _srcHeight(srcHeight), _srcX(srcX), _srcY(srcY) {}
};
-enum Color {
- kM1_ColorNoTransparency = -1,
- k0_ColorBlack = 0,
- k1_ColorDarkGary = 1,
- k2_ColorLightGray = 2,
- k3_ColorDarkBrown = 3,
- k4_ColorCyan = 4,
- k5_ColorLightBrown = 5,
- k6_ColorDarkGreen = 6,
- k7_ColorLightGreen = 7,
- k8_ColorRed = 8,
- k9_ColorGold = 9,
- k10_ColorFlesh = 10,
- k11_ColorYellow = 11,
- k12_ColorDarkestGray = 12,
- k13_ColorLightestGray = 13,
- k14_ColorBlue = 14,
- k15_ColorWhite = 15
-};
-
class FieldAspect {
public:
uint16 _nativeBitmapRelativeIndex;
@@ -421,10 +418,8 @@ public:
uint16 _height;
uint16 _xPos;
uint16 _bitplaneWordCount;
- FieldAspect(uint16 native, uint16 base, uint16 transparent, byte mask, uint16 byteWidth, uint16 height, uint16 xPos, uint16 bitplane)
- : _nativeBitmapRelativeIndex(native), _baseStartUnitIndex(base), _transparentColor(transparent), _mask(mask),
- _byteWidth(byteWidth), _height(height), _xPos(xPos), _bitplaneWordCount(bitplane) {}
- FieldAspect() {}
+ FieldAspect(uint16 native, uint16 base, uint16 transparent, byte mask, uint16 byteWidth, uint16 height, uint16 xPos, uint16 bitplane);
+ FieldAspect();
}; // @ FIELD_ASPECT
class CreatureAspect {
@@ -485,7 +480,7 @@ public:
_firstNativeBitmapRelativeIndex(firstN), _firstDerivedBitmapRelativeIndex(firstD),
_byteWidth(byteWidth), _height(h), _graphicInfo(grap) {}
- ProjectileAspect() : _firstNativeBitmapRelativeIndex(0),
+ ProjectileAspect() : _firstNativeBitmapRelativeIndex(0),
_firstDerivedBitmapRelativeIndex(0), _byteWidth(0), _height(0), _graphicInfo(0) {}
}; // @ PROJECTIL_ASPECT
@@ -518,16 +513,16 @@ struct OrnamentInfo {
#define k15_DoorOrnDestroyedMask 15 // @ C15_DOOR_ORNAMENT_DESTROYED_MASK
#define k16_DoorOrnThivesEyeMask 16 // @ C16_DOOR_ORNAMENT_THIEVES_EYE_MASK
-#define k0_viewportNotDungeonView 0 // @ C0_VIEWPORT_NOT_DUNGEON_VIEW
-#define k1_viewportDungeonView 1 // @ C1_VIEWPORT_DUNGEON_VIEW
-#define k2_viewportAsBeforeSleepOrFreezeGame 2 // @ C2_VIEWPORT_AS_BEFORE_SLEEP_OR_FREEZE_GAME
+#define k0_viewportNotDungeonView 0 // @ C0_VIEWPORT_NOT_DUNGEON_VIEW
+#define k1_viewportDungeonView 1 // @ C1_VIEWPORT_DUNGEON_VIEW
+#define k2_viewportAsBeforeSleepOrFreezeGame 2 // @ C2_VIEWPORT_AS_BEFORE_SLEEP_OR_FREEZE_GAME
#define k112_byteWidthViewport 112 // @ C112_BYTE_WIDTH_VIEWPORT
-#define k136_heightViewport 136 // @ C136_HEIGHT_VIEWPORT
+#define k136_heightViewport 136 // @ C136_HEIGHT_VIEWPORT
#define k160_byteWidthScreen 160 // @ C160_BYTE_WIDTH_SCREEN
-#define k200_heightScreen 200 // @ C200_HEIGHT_SCREEN
+#define k200_heightScreen 200 // @ C200_HEIGHT_SCREEN
#define k8_byteWidth 8 // @ C008_BYTE_WIDTH
#define k16_byteWidth 16 // @ C016_BYTE_WIDTH
@@ -549,18 +544,7 @@ public:
Frame _rightHorizontal[3];
DoorFrames(Frame f1, Frame f2_1, Frame f2_2, Frame f2_3,
Frame f3_1, Frame f3_2, Frame f3_3,
- Frame f4_1, Frame f4_2, Frame f4_3) {
- _closedOrDestroyed = f1;
- _vertical[0] = f2_1;
- _vertical[1] = f2_2;
- _vertical[2] = f2_3;
- _leftHorizontal[0] = f3_1;
- _leftHorizontal[1] = f3_2;
- _leftHorizontal[2] = f3_3;
- _rightHorizontal[0] = f4_1;
- _rightHorizontal[1] = f4_2;
- _rightHorizontal[2] = f4_3;
- }
+ Frame f4_1, Frame f4_2, Frame f4_3);
}; // @ DOOR_FRAMES
#define D00_RGB_BLACK 0x0000
@@ -656,7 +640,7 @@ class DisplayMan {
public:
byte *_bitmapWallSetD1LCR; // @ G0700_puc_Bitmap_WallSet_Wall_D1LCR
private:
- Box _boxThievesEyeViewPortVisibleArea; // @ G0106_s_Graphic558_Box_ThievesEye_ViewportVisibleArea
+ Box _boxThievesEyeViewPortVisibleArea; // @ G0106_s_Graphic558_Box_ThievesEye_ViewportVisibleArea
byte _palChangesDoorButtonAndWallOrnD3[16]; // @ G0198_auc_Graphic558_PaletteChanges_DoorButtonAndWallOrnament_D3
byte _palChangesDoorButtonAndWallOrnD2[16]; // @ G0199_auc_Graphic558_PaletteChanges_DoorButtonAndWallOrnament_D2
@@ -717,7 +701,7 @@ public:
void loadIntoBitmap(uint16 index, byte *destBitmap); // @ F0466_EXPAND_GraphicToBitmap
void setUpScreens(uint16 width, uint16 height);
- void loadGraphics(); // @ F0479_MEMORY_ReadGraphicsDatHeader
+ void loadGraphics(); // @ F0479_MEMORY_ReadGraphicsDatHeader
void initializeGraphicData(); // @ F0460_START_InitializeGraphicData
void loadCurrentMapGraphics(); // @ F0096_DUNGEONVIEW_LoadCurrentMapGraphics_CPSDF
void allocateFlippedWallBitmaps(); // @ F0461_START_AllocateFlippedWallBitmaps
@@ -779,7 +763,7 @@ public:
int16 getScaledDimension(int16 dimension, int16 scale); // @ M78_SCALED_DIMENSION
void drawObjectsCreaturesProjectilesExplosions(Thing thingParam, Direction directionParam,
int16 mapXpos, int16 mapYpos, int16 viewSquareIndex,
- uint16 orderedViewCellOrdinals); // @ F0115_DUNGEONVIEW_DrawObjectsCreaturesProjectilesExplosions_CPSEF
+ CellOrder orderedViewCellOrdinals); // @ F0115_DUNGEONVIEW_DrawObjectsCreaturesProjectilesExplosions_CPSEF
uint16 getNormalizedByteWidth(uint16 byteWidth); // @ M77_NORMALIZED_BYTE_WIDTH
uint16 getVerticalOffsetM23(uint16 val); // @ M23_VERTICAL_OFFSET
uint16 getHorizontalOffsetM22(uint16 val); // @ M22_HORIZONTAL_OFFSET
diff --git a/engines/dm/group.cpp b/engines/dm/group.cpp
index a302647c42..5eb00208c7 100644
--- a/engines/dm/group.cpp
+++ b/engines/dm/group.cpp
@@ -37,7 +37,8 @@
namespace DM {
-int32 M32_setTime(int32 &map_time, int32 time) {
+
+int32 GroupMan::setTime(int32 &map_time, int32 time) {
return map_time = (map_time & 0xFF000000) | time;
}
@@ -75,7 +76,7 @@ uint16 GroupMan::toggleFlag(uint16& val, uint16 mask) {
}
void GroupMan::initActiveGroups() {
- if (_vm->_newGameFl)
+ if (_vm->_gameMode != kDMModeLoadSavedGame)
_maxActiveGroupCount = 60;
if (_activeGroups)
@@ -105,12 +106,12 @@ uint16 GroupMan::getGroupDirections(Group *group, int16 mapIndex) {
int16 GroupMan::getCreatureOrdinalInCell(Group *group, uint16 cell) {
uint16 currMapIndex = _vm->_dungeonMan->_currMapIndex;
byte groupCells = getGroupCells(group, currMapIndex);
- if (groupCells == k255_CreatureTypeSingleCenteredCreature)
+ if (groupCells == kDMCreatureTypeSingleCenteredCreature)
return _vm->indexToOrdinal(0);
int retval = 0;
byte creatureIndex = group->getCount();
- if (getFlag(_vm->_dungeonMan->_creatureInfos[group->_type]._attributes, k0x0003_MaskCreatureInfo_size) == k1_MaskCreatureSizeHalf) {
+ if (getFlag(_vm->_dungeonMan->_creatureInfos[group->_type]._attributes, kDMCreatureMaskSize) == kDMCreatureSizeHalf) {
if ((getGroupDirections(group, currMapIndex) & 1) == (cell & 1))
cell = _vm->turnDirLeft(cell);
@@ -139,13 +140,13 @@ uint16 GroupMan::getCreatureValue(uint16 groupVal, uint16 creatureIndex) {
void GroupMan::dropGroupPossessions(int16 mapX, int16 mapY, Thing groupThing, SoundMode soundMode) {
Group *group = (Group *)_vm->_dungeonMan->getThingData(groupThing);
- uint16 creatureType = group->_type;
- if ((soundMode != kDMSoundModeDoNotPlaySound) && getFlag(_vm->_dungeonMan->_creatureInfos[creatureType]._attributes, k0x0200_MaskCreatureInfo_dropFixedPoss)) {
+ CreatureType creatureType = group->_type;
+ if ((soundMode != kDMSoundModeDoNotPlaySound) && getFlag(_vm->_dungeonMan->_creatureInfos[creatureType]._attributes, kDMCreatureMaskDropFixedPoss)) {
int16 creatureIndex = group->getCount();
uint16 groupCells = getGroupCells(group, _vm->_dungeonMan->_currMapIndex);
do {
dropCreatureFixedPossessions(creatureType, mapX, mapY,
- (groupCells == k255_CreatureTypeSingleCenteredCreature) ? k255_CreatureTypeSingleCenteredCreature : getCreatureValue(groupCells, creatureIndex), soundMode);
+ (groupCells == kDMCreatureTypeSingleCenteredCreature) ? (uint16)kDMCreatureTypeSingleCenteredCreature : getCreatureValue(groupCells, creatureIndex), soundMode);
} while (creatureIndex--);
}
@@ -163,11 +164,11 @@ void GroupMan::dropGroupPossessions(int16 mapX, int16 mapY, Thing groupThing, So
} while ((currentThing = nextThing) != Thing::_endOfList);
if (soundMode != kDMSoundModeDoNotPlaySound)
- _vm->_sound->requestPlay(weaponDropped ? k00_soundMETALLIC_THUD : k04_soundWOODEN_THUD_ATTACK_TROLIN_ANTMAN_STONE_GOLEM, mapX, mapY, soundMode);
+ _vm->_sound->requestPlay(weaponDropped ? kDMSoundIndexMetallicThud : kDMSoundIndexWoodenThudAttackTrolinAntmanStoneGolem, mapX, mapY, soundMode);
}
}
-void GroupMan::dropCreatureFixedPossessions(uint16 creatureType, int16 mapX, int16 mapY, uint16 cell, SoundMode soundMode) {
+void GroupMan::dropCreatureFixedPossessions(CreatureType creatureType, int16 mapX, int16 mapY, uint16 cell, SoundMode soundMode) {
static uint16 fixedPossessionCreature12Skeleton[3] = { // @ G0245_aui_Graphic559_FixedPossessionsCreature12Skeleton
kDMObjectInfoIndexFirstWeapon + kDMWeaponFalchion,
kDMObjectInfoIndexFirstArmour + kDMArmourWoodenShield,
@@ -192,25 +193,25 @@ void GroupMan::dropCreatureFixedPossessions(uint16 creatureType, int16 mapX, int
};
static uint16 fixedPossessionCreature7rockRockPile[5] = { // @ G0249_aui_Graphic559_FixedPossessionsCreature07Rock_RockPile
kDMObjectInfoIndexFirstJunk + kDMJunkTypeBoulder,
- kDMObjectInfoIndexFirstJunk + kDMJunkTypeBoulder | kDMMaskRandomDrop,
- kDMObjectInfoIndexFirstWeapon + kDMWeaponRock | kDMMaskRandomDrop,
- kDMObjectInfoIndexFirstWeapon + kDMWeaponRock | kDMMaskRandomDrop,
+ (kDMObjectInfoIndexFirstJunk + kDMJunkTypeBoulder) | kDMMaskRandomDrop,
+ (kDMObjectInfoIndexFirstWeapon + kDMWeaponRock) | kDMMaskRandomDrop,
+ (kDMObjectInfoIndexFirstWeapon + kDMWeaponRock) | kDMMaskRandomDrop,
0
};
static uint16 fixedPossessionCreature4PainRatHellHound[3] = { // @ G0250_aui_Graphic559_FixedPossessionsCreature04PainRat_Hellhound
kDMObjectInfoIndexFirstJunk + kDMJunkTypeDrumstickShank,
- kDMObjectInfoIndexFirstJunk + kDMJunkTypeDrumstickShank | kDMMaskRandomDrop,
+ (kDMObjectInfoIndexFirstJunk + kDMJunkTypeDrumstickShank) | kDMMaskRandomDrop,
0
};
static uint16 fixedPossessionCreature6screamer[3] = { // @ G0251_aui_Graphic559_FixedPossessionsCreature06Screamer
kDMObjectInfoIndexFirstJunk + kDMJunkTypeScreamerSlice,
- kDMObjectInfoIndexFirstJunk + kDMJunkTypeScreamerSlice | kDMMaskRandomDrop,
+ (kDMObjectInfoIndexFirstJunk + kDMJunkTypeScreamerSlice) | kDMMaskRandomDrop,
0
};
static uint16 fixedPossessionCreature15MagnetaWormWorm[4] = { // @ G0252_aui_Graphic559_FixedPossessionsCreature15MagentaWorm_Worm
kDMObjectInfoIndexFirstJunk + kDMJunkTypeWormRound,
- kDMObjectInfoIndexFirstJunk + kDMJunkTypeWormRound | kDMMaskRandomDrop,
- kDMObjectInfoIndexFirstJunk + kDMJunkTypeWormRound | kDMMaskRandomDrop,
+ (kDMObjectInfoIndexFirstJunk + kDMJunkTypeWormRound) | kDMMaskRandomDrop,
+ (kDMObjectInfoIndexFirstJunk + kDMJunkTypeWormRound) | kDMMaskRandomDrop,
0
};
static uint16 fixedPossessionCreature24RedDragon[11] = { // @ G0253_aui_Graphic559_FixedPossessionsCreature24RedDragon
@@ -222,38 +223,40 @@ void GroupMan::dropCreatureFixedPossessions(uint16 creatureType, int16 mapX, int
kDMObjectInfoIndexFirstJunk + kDMJunkTypeDragonSteak,
kDMObjectInfoIndexFirstJunk + kDMJunkTypeDragonSteak,
kDMObjectInfoIndexFirstJunk + kDMJunkTypeDragonSteak,
- kDMObjectInfoIndexFirstJunk + kDMJunkTypeDragonSteak | kDMMaskRandomDrop,
- kDMObjectInfoIndexFirstJunk + kDMJunkTypeDragonSteak | kDMMaskRandomDrop, 0};
+ (kDMObjectInfoIndexFirstJunk + kDMJunkTypeDragonSteak) | kDMMaskRandomDrop,
+ (kDMObjectInfoIndexFirstJunk + kDMJunkTypeDragonSteak) | kDMMaskRandomDrop,
+ 0
+ };
uint16 *fixedPossessions;
bool cursedPossessions = false;
switch (creatureType) {
- case k4_CreatureTypePainRatHellHound:
+ case kDMCreatureTypePainRat:
fixedPossessions = fixedPossessionCreature4PainRatHellHound;
break;
- case k6_CreatureTypeScreamer:
+ case kDMCreatureTypeScreamer:
fixedPossessions = fixedPossessionCreature6screamer;
break;
- case k7_CreatureTypeRockpile:
+ case kDMCreatureTypeRockpile:
fixedPossessions = fixedPossessionCreature7rockRockPile;
break;
- case k9_CreatureTypeStoneGolem:
+ case kDMCreatureTypeStoneGolem:
fixedPossessions = fixedPossessionCreature9StoneGolem;
break;
- case k12_CreatureTypeSkeleton:
+ case kDMCreatureTypeSkeleton:
fixedPossessions = fixedPossessionCreature12Skeleton;
break;
- case k16_CreatureTypeTrolinAntman:
+ case kDMCreatureTypeAntman:
fixedPossessions = fixedPossessionCreatur16TrolinAntman;
break;
- case k15_CreatureTypeMagnetaWormWorm:
+ case kDMCreatureTypeMagentaWorm:
fixedPossessions = fixedPossessionCreature15MagnetaWormWorm;
break;
- case k18_CreatureTypeAnimatedArmourDethKnight:
+ case kDMCreatureTypeAnimatedArmour:
cursedPossessions = true;
fixedPossessions = fixedPossessionCreature18AnimatedArmourDethKnight;
break;
- case k24_CreatureTypeRedDragon:
+ case kDMCreatureTypeRedDragon:
fixedPossessions = fixedPossessionCreature24RedDragon;
break;
default:
@@ -287,11 +290,11 @@ void GroupMan::dropCreatureFixedPossessions(uint16 creatureType, int16 mapX, int
/* The same pointer type is used no matter the actual type k5_WeaponThingType, k6_ArmourThingType or k10_JunkThingType */
currWeapon->setType(currFixedPossession);
currWeapon->setCursed(cursedPossessions);
- nextUnusedThing = _vm->thingWithNewCell(nextUnusedThing, ((cell == k255_CreatureTypeSingleCenteredCreature) || !_vm->getRandomNumber(4)) ? _vm->getRandomNumber(4) : cell);
+ nextUnusedThing = _vm->thingWithNewCell(nextUnusedThing, ((cell == kDMCreatureTypeSingleCenteredCreature) || !_vm->getRandomNumber(4)) ? _vm->getRandomNumber(4) : cell);
_vm->_moveSens->getMoveResult(nextUnusedThing, kDMMapXNotOnASquare, 0, mapX, mapY);
currFixedPossession = *fixedPossessions++;
}
- _vm->_sound->requestPlay(weaponDropped ? k00_soundMETALLIC_THUD : k04_soundWOODEN_THUD_ATTACK_TROLIN_ANTMAN_STONE_GOLEM, mapX, mapY, soundMode);
+ _vm->_sound->requestPlay(weaponDropped ? kDMSoundIndexMetallicThud : kDMSoundIndexWoodenThudAttackTrolinAntmanStoneGolem, mapX, mapY, soundMode);
}
int16 GroupMan::getDirsWhereDestIsVisibleFromSource(int16 srcMapX, int16 srcMapY, int16 destMapX, int16 destMapY) {
@@ -360,8 +363,8 @@ bool GroupMan::groupIsDoorDestoryedByAttack(uint16 mapX, uint16 mapY, int16 atta
if (Square(*curSquare).getDoorState() == kDMDoorStateClosed) {
if (ticks) {
TimelineEvent newEvent;
- _vm->setMapAndTime(newEvent._mapTime, _vm->_dungeonMan->_currMapIndex, _vm->_gameTime + ticks);
- newEvent._type = k2_TMEventTypeDoorDestruction;
+ newEvent._mapTime = _vm->setMapAndTime(_vm->_dungeonMan->_currMapIndex, _vm->_gameTime + ticks);
+ newEvent._type = kDMEventTypeDoorDestruction;
newEvent._priority = 0;
newEvent._Bu._location._mapX = mapX;
newEvent._Bu._location._mapY = mapY;
@@ -384,14 +387,14 @@ Thing GroupMan::groupGetThing(int16 mapX, int16 mapY) {
}
int16 GroupMan::groupGetDamageCreatureOutcome(Group *group, uint16 creatureIndex, int16 mapX, int16 mapY, int16 damage, bool notMoving) {
- uint16 creatureType = group->_type;
+ CreatureType creatureType = group->_type;
CreatureInfo *creatureInfo = &_vm->_dungeonMan->_creatureInfos[creatureType];
- if (getFlag(creatureInfo->_attributes, k0x2000_MaskCreatureInfo_archenemy)) /* Lord Chaos cannot be damaged */
- return k0_outcomeKilledNoCreaturesInGroup;
+ if (getFlag(creatureInfo->_attributes, kDMCreatureMaskArchenemy)) /* Lord Chaos cannot be damaged */
+ return kDMKillOutcomeNoCreaturesInGroup;
if (group->_health[creatureIndex] <= damage) {
uint16 groupCells = getGroupCells(group, _vm->_dungeonMan->_currMapIndex);
- uint16 cell = (groupCells == k255_CreatureTypeSingleCenteredCreature) ? k255_CreatureTypeSingleCenteredCreature : getCreatureValue(groupCells, creatureIndex);
+ uint16 cell = (groupCells == kDMCreatureTypeSingleCenteredCreature) ? (uint16)kDMCreatureTypeSingleCenteredCreature : getCreatureValue(groupCells, creatureIndex);
uint16 creatureCount = group->getCount();
uint16 retVal;
@@ -400,10 +403,10 @@ int16 GroupMan::groupGetDamageCreatureOutcome(Group *group, uint16 creatureIndex
dropGroupPossessions(mapX, mapY, groupGetThing(mapX, mapY), kDMSoundModePlayOneTickLater);
groupDelete(mapX, mapY);
}
- retVal = k2_outcomeKilledAllCreaturesInGroup;
+ retVal = kDMKillOutcomeAllCreaturesInGroup;
} else { /* If there are several creatures in the group */
uint16 groupDirections = getGroupDirections(group, _vm->_dungeonMan->_currMapIndex);
- if (getFlag(creatureInfo->_attributes, k0x0200_MaskCreatureInfo_dropFixedPoss)) {
+ if (getFlag(creatureInfo->_attributes, kDMCreatureMaskDropFixedPoss)) {
if (notMoving)
dropCreatureFixedPossessions(creatureType, mapX, mapY, cell, kDMSoundModePlayOneTickLater);
else
@@ -414,25 +417,26 @@ int16 GroupMan::groupGetDamageCreatureOutcome(Group *group, uint16 creatureIndex
if (currentMapIsPartyMap)
activeGroup = &_activeGroups[group->getActiveGroupIndex()];
- if (group->getBehaviour() == k6_behavior_ATTACK) {
+ if (group->getBehaviour() == kDMBehaviorAttack) {
TimelineEvent *curEvent = _vm->_timeline->_events;
for (uint16 eventIndex = 0; eventIndex < _vm->_timeline->_eventMaxCount; eventIndex++) {
uint16 curEventType = curEvent->_type;
if ((_vm->getMap(curEvent->_mapTime) == _vm->_dungeonMan->_currMapIndex) &&
(curEvent->_Bu._location._mapX == mapX) &&
(curEvent->_Bu._location._mapY == mapY) &&
- (curEventType > k32_TMEventTypeUpdateAspectGroup) &&
- (curEventType < k41_TMEventTypeUpdateBehaviour_3 + 1)) {
+ (curEventType > kDMEventTypeUpdateAspectGroup) &&
+ (curEventType < kDMEventTypeUpdateBehavior3 + 1)) {
uint16 nextCreatureIndex;
- if (curEventType < k37_TMEventTypeUpdateBehaviourGroup)
- nextCreatureIndex = curEventType - k33_TMEventTypeUpdateAspectCreature_0; /* Get creature index for events 33 to 36 */
+ if (curEventType < kDMEventTypeUpdateBehaviourGroup)
+ nextCreatureIndex = curEventType - kDMEventTypeUpdateAspectCreature0; /* Get creature index for events 33 to 36 */
else
- nextCreatureIndex = curEventType - k38_TMEventTypeUpdateBehaviour_0; /* Get creature index for events 38 to 41 */
+ nextCreatureIndex = curEventType - kDMEventTypeUpdateBehavior0; /* Get creature index for events 38 to 41 */
if (nextCreatureIndex == creatureIndex)
_vm->_timeline->deleteEvent(eventIndex);
else if (nextCreatureIndex > creatureIndex) {
- curEvent->_type -= 1;
+ int16 curType = curEvent->_type - 1;
+ curEvent->_type = (TimelineEventType)curType;
_vm->_timeline->fixChronology(_vm->_timeline->getIndex(eventIndex));
}
}
@@ -440,11 +444,11 @@ int16 GroupMan::groupGetDamageCreatureOutcome(Group *group, uint16 creatureIndex
}
uint16 fearResistance = creatureInfo->getFearResistance();
- if (currentMapIsPartyMap && (fearResistance) != k15_immuneToFear) {
+ if (currentMapIsPartyMap && (fearResistance != kDMImmuneToFear)) {
fearResistance += creatureCount - 1;
if (fearResistance < _vm->getRandomNumber(16)) { /* Test if the death of a creature frightens the remaining creatures in the group */
activeGroup->_delayFleeingFromTarget = _vm->getRandomNumber(100 - (fearResistance << 2)) + 20;
- group->setBehaviour(k5_behavior_FLEE);
+ group->setBehaviour(kDMBehaviorFlee);
}
}
}
@@ -461,14 +465,14 @@ int16 GroupMan::groupGetDamageCreatureOutcome(Group *group, uint16 creatureIndex
_vm->_dungeonMan->setGroupCells(group, groupCells, _vm->_dungeonMan->_currMapIndex);
_vm->_dungeonMan->setGroupDirections(group, groupDirections, _vm->_dungeonMan->_currMapIndex);
group->setCount(group->getCount() - 1);
- retVal = k1_outcomeKilledSomeCreaturesInGroup;
+ retVal = kDMKillOutcomeSomeCreaturesInGroup;
}
- uint16 creatureSize = getFlag(creatureInfo->_attributes, k0x0003_MaskCreatureInfo_size);
+ CreatureSize creatureSize = (CreatureSize)getFlag(creatureInfo->_attributes, kDMCreatureMaskSize);
uint16 attack;
- if (creatureSize == k0_MaskCreatureSizeQuarter)
+ if (creatureSize == kDMCreatureSizeQuarter)
attack = 110;
- else if (creatureSize == k1_MaskCreatureSizeHalf)
+ else if (creatureSize == kDMCreatureSizeHalf)
attack = 190;
else
attack = 255;
@@ -480,7 +484,7 @@ int16 GroupMan::groupGetDamageCreatureOutcome(Group *group, uint16 creatureIndex
if (damage > 0)
group->_health[creatureIndex] -= damage;
- return k0_outcomeKilledNoCreaturesInGroup;
+ return kDMKillOutcomeNoCreaturesInGroup;
}
void GroupMan::groupDelete(int16 mapX, int16 mapY) {
@@ -505,7 +509,7 @@ void GroupMan::groupDeleteEvents(int16 mapX, int16 mapY) {
for (int16 eventIndex = 0; eventIndex < _vm->_timeline->_eventMaxCount; eventIndex++) {
uint16 curEventType = curEvent->_type;
if ((_vm->getMap(curEvent->_mapTime) == _vm->_dungeonMan->_currMapIndex) &&
- (curEventType > k29_TMEventTypeGroupReactionDangerOnSquare - 1) && (curEventType < k41_TMEventTypeUpdateBehaviour_3 + 1) &&
+ (curEventType > kDMEventTypeGroupReactionDangerOnSquare - 1) && (curEventType < kDMEventTypeUpdateBehavior3 + 1) &&
(curEvent->_Bu._location._mapX == mapX) && (curEvent->_Bu._location._mapY == mapY)) {
_vm->_timeline->deleteEvent(eventIndex);
}
@@ -535,17 +539,17 @@ int16 GroupMan::getDamageAllCreaturesOutcome(Group *group, int16 mapX, int16 map
killedSomeCreatures = killedSomeCreatures || outcomeVal;
} while (creatureIndex--);
if (killedAllCreatures)
- return k2_outcomeKilledAllCreaturesInGroup;
+ return kDMKillOutcomeAllCreaturesInGroup;
if (killedSomeCreatures)
- return k1_outcomeKilledSomeCreaturesInGroup;
+ return kDMKillOutcomeSomeCreaturesInGroup;
}
- return k0_outcomeKilledNoCreaturesInGroup;
+ return kDMKillOutcomeNoCreaturesInGroup;
}
-int16 GroupMan::groupGetResistanceAdjustedPoisonAttack(uint16 creatreType, int16 poisonAttack) {
- int16 poisonResistance = _vm->_dungeonMan->_creatureInfos[creatreType].getPoisonResistance();
+int16 GroupMan::groupGetResistanceAdjustedPoisonAttack(CreatureType creatureType, int16 poisonAttack) {
+ int16 poisonResistance = _vm->_dungeonMan->_creatureInfos[creatureType].getPoisonResistance();
if (!poisonAttack || (poisonResistance == kDMImmuneToPoison))
return 0;
@@ -553,7 +557,7 @@ int16 GroupMan::groupGetResistanceAdjustedPoisonAttack(uint16 creatreType, int16
return ((poisonAttack + _vm->getRandomNumber(4)) << 3) / (poisonResistance + 1);
}
-void GroupMan::processEvents29to41(int16 eventMapX, int16 eventMapY, int16 eventType, uint16 ticks) {
+void GroupMan::processEvents29to41(int16 eventMapX, int16 eventMapY, TimelineEventType eventType, uint16 ticks) {
int16 L0446_i_Multiple = 0;
#define AL0446_i_Direction L0446_i_Multiple
#define AL0446_i_Ticks L0446_i_Multiple
@@ -579,8 +583,8 @@ void GroupMan::processEvents29to41(int16 eventMapX, int16 eventMapY, int16 event
/* If the party is not on the map specified in the event and the event type is not one of 32, 33, 37, 38 then the event is ignored */
if ((_vm->_dungeonMan->_currMapIndex != _vm->_dungeonMan->_partyMapIndex)
- && (eventType != k37_TMEventTypeUpdateBehaviourGroup) && (eventType != k32_TMEventTypeUpdateAspectGroup)
- && (eventType != k38_TMEventTypeUpdateBehaviour_0) && (eventType != k33_TMEventTypeUpdateAspectCreature_0))
+ && (eventType != kDMEventTypeUpdateBehaviourGroup) && (eventType != kDMEventTypeUpdateAspectGroup)
+ && (eventType != kDMEventTypeUpdateBehavior0) && (eventType != kDMEventTypeUpdateAspectCreature0))
return;
Thing groupThing = groupGetThing(eventMapX, eventMapY);
@@ -592,8 +596,8 @@ void GroupMan::processEvents29to41(int16 eventMapX, int16 eventMapY, int16 event
CreatureInfo creatureInfo = _vm->_dungeonMan->_creatureInfos[curGroup->_type];
/* Update the event */
TimelineEvent nextEvent;
- _vm->setMapAndTime(nextEvent._mapTime, _vm->_dungeonMan->_currMapIndex, _vm->_gameTime);
- nextEvent._priority = 255 - creatureInfo._movementTicks; /* The fastest creatures (with small MovementTicks value) get higher event priority */
+ nextEvent._mapTime = _vm->setMapAndTime(_vm->_dungeonMan->_currMapIndex, _vm->_gameTime);
+ nextEvent._priority = kDMMovementTicksImmobile - creatureInfo._movementTicks; /* The fastest creatures (with small MovementTicks value) get higher event priority */
nextEvent._Bu._location._mapX = eventMapX;
nextEvent._Bu._location._mapY = eventMapY;
/* If the creature is not on the party map then try and move the creature in a random direction and place a new event 37 in the timeline for the next creature movement */
@@ -608,7 +612,7 @@ void GroupMan::processEvents29to41(int16 eventMapX, int16 eventMapY, int16 event
nextEvent._Bu._location._mapX = _vm->_moveSens->_moveResultMapX;
nextEvent._Bu._location._mapY = _vm->_moveSens->_moveResultMapY;
}
- nextEvent._type = k37_TMEventTypeUpdateBehaviourGroup;
+ nextEvent._type = kDMEventTypeUpdateBehaviourGroup;
AL0446_i_Ticks = MAX(ABS(_vm->_dungeonMan->_currMapIndex - _vm->_dungeonMan->_partyMapIndex) << 4, creatureInfo._movementTicks << 1);
/* BUG0_68 A group moves or acts with a wrong timing. Event is added below but L0465_s_NextEvent.C.Ticks has not been initialized. No consequence while the group is not on the party map. When the party enters the group map the first group event may have a wrong timing */
T0209005_AddEventAndReturn:
@@ -617,7 +621,7 @@ T0209005_AddEventAndReturn:
return;
}
/* If the creature is Lord Chaos then ignore the event if the game is won. Initialize data to analyze Fluxcages */
- bool isArchEnemy = getFlag(creatureInfo._attributes, k0x2000_MaskCreatureInfo_archenemy);
+ bool isArchEnemy = getFlag(creatureInfo._attributes, kDMCreatureMaskArchenemy);
if (isArchEnemy) {
if (_vm->_gameWon)
return;
@@ -633,7 +637,7 @@ T0209005_AddEventAndReturn:
ticksSinceLastMove += 256;
int16 movementTicks = creatureInfo._movementTicks;
- if (movementTicks == k255_immobile)
+ if (movementTicks == kDMMovementTicksImmobile)
movementTicks = 100;
if (_vm->_championMan->_party._freezeLifeTicks && !isArchEnemy) { /* If life is frozen and the creature is not Lord Chaos (Lord Chaos is immune to Freeze Life) then reschedule the event later (except for reactions which are ignored when life if frozen) */
@@ -648,8 +652,9 @@ T0209005_AddEventAndReturn:
For event kM1_TMEventTypeCreateReactionEvent31ParyIsAdjacent, the reaction time is 1 tick
For event kM2_TMEventTypeCreateReactionEvent30HitByProjectile and kM3_TMEventTypeCreateReactionEvent29DangerOnSquare, the reaction time may be 1 tick or slower: slow moving creatures react more slowly. The more recent is the last creature move, the slower the reaction */
if (eventType < 0) {
- nextEvent._type = eventType + k32_TMEventTypeUpdateAspectGroup;
- if (eventType == kM1_TMEventTypeCreateReactionEvent31ParyIsAdjacent) {
+ int16 nextType = eventType + kDMEventTypeUpdateAspectGroup;
+ nextEvent._type = (TimelineEventType)nextType;
+ if (eventType == kDMEventTypeCreateReactionPartyIsAdjacent) {
AL0446_i_Ticks = 1; /* Retry in 1 tick */
} else {
AL0446_i_Ticks = ((movementTicks + 2) >> 2) - ticksSinceLastMove;
@@ -660,7 +665,7 @@ T0209005_AddEventAndReturn:
}
AL0447_i_Behavior = curGroup->getBehaviour();
uint16 creatureCount = curGroup->getCount();
- int16 creatureSize = getFlag(creatureInfo._attributes, k0x0003_MaskCreatureInfo_size);
+ int16 creatureSize = getFlag(creatureInfo._attributes, kDMCreatureMaskSize);
AL0450_i_DistanceXToParty = ABS(eventMapX - _vm->_dungeonMan->_partyMapX);
AL0451_i_DistanceYToParty = ABS(eventMapY - _vm->_dungeonMan->_partyMapY);
_currentGroupMapX = eventMapX;
@@ -677,49 +682,54 @@ T0209005_AddEventAndReturn:
bool moveToPriorLocation = false;
int16 distanceToVisibleParty = 0;
- if (eventType <= k31_TMEventTypeGroupReactionPartyIsAdjecent) { /* Process Reaction events 29 to 31 */
- switch (eventType = eventType - k32_TMEventTypeUpdateAspectGroup) {
- case kM1_TMEventTypeCreateReactionEvent31ParyIsAdjacent: /* This event is used when the party bumps into a group or attacks a group physically (not with a spell). It causes the creature behavior to change to attack if it is not already attacking the party or fleeing from target */
- if ((AL0447_i_Behavior != k6_behavior_ATTACK) && (AL0447_i_Behavior != k5_behavior_FLEE)) {
+ if (eventType <= kDMEventTypeGroupReactionPartyIsAdjecent) { /* Process Reaction events 29 to 31 */
+ int16 tmpType = eventType - kDMEventTypeUpdateAspectGroup;
+ eventType = (TimelineEventType) tmpType;
+ switch (eventType) {
+ case kDMEventTypeCreateReactionPartyIsAdjacent: /* This event is used when the party bumps into a group or attacks a group physically (not with a spell). It causes the creature behavior to change to attack if it is not already attacking the party or fleeing from target */
+ if ((AL0447_i_Behavior != kDMBehaviorAttack) && (AL0447_i_Behavior != kDMBehaviorFlee)) {
groupDeleteEvents(eventMapX, eventMapY);
goto T0209044_SetBehavior6_Attack;
}
activeGroup->_targetMapX = _vm->_dungeonMan->_partyMapX;
activeGroup->_targetMapY = _vm->_dungeonMan->_partyMapY;
return;
- case kM2_TMEventTypeCreateReactionEvent30HitByProjectile: /* This event is used for the reaction of a group after a projectile impacted with one creature in the group (some creatures may have been killed) */
- if ((AL0447_i_Behavior == k6_behavior_ATTACK) || (AL0447_i_Behavior == k5_behavior_FLEE)) /* If the creature is attacking the party or fleeing from the target then there is no reaction */
+ case kDMEventTypeCreateReactionHitByProjectile: /* This event is used for the reaction of a group after a projectile impacted with one creature in the group (some creatures may have been killed) */
+ if ((AL0447_i_Behavior == kDMBehaviorAttack) || (AL0447_i_Behavior == kDMBehaviorFlee)) /* If the creature is attacking the party or fleeing from the target then there is no reaction */
return;
- AL0446_i_Behavior2Or3 = ((AL0447_i_Behavior == k3_behavior_USELESS) || (AL0447_i_Behavior == k2_behavior_USELESS));
+ AL0446_i_Behavior2Or3 = ((AL0447_i_Behavior == kDMBehaviorUnknown3) || (AL0447_i_Behavior == kDMBehaviorUnknown2));
if (AL0446_i_Behavior2Or3 || (_vm->getRandomNumber(4))) { /* BUG0_00 Useless code. Behavior cannot be 2 nor 3 because these values are never used. The actual condition is thus: if 3/4 chances */
- if (!groupGetDistanceToVisibleParty(curGroup, kM1_wholeCreatureGroup, eventMapX, eventMapY)) { /* If the group cannot see the party then look in a random direction to try and search for the party */
+ if (!groupGetDistanceToVisibleParty(curGroup, kDMWholeCreatureGroup, eventMapX, eventMapY)) { /* If the group cannot see the party then look in a random direction to try and search for the party */
approachAfterReaction = newGroupDirectionFound = false;
goto T0209073_SetDirectionGroup;
}
if (AL0446_i_Behavior2Or3 || (_vm->getRandomNumber(4))) /* BUG0_00 Useless code. Behavior cannot be 2 nor 3 because these values are never used. The actual condition is thus: if 3/4 chances then no reaction */
return;
} /* No 'break': proceed to instruction after the next 'case' below. Reaction is to move in a random direction to try and avoid other projectiles */
- case kM3_TMEventTypeCreateReactionEvent29DangerOnSquare: /* This event is used when some creatures in the group were killed by a Poison Cloud or by a closing door or if Lord Chaos is surrounded by 3 Fluxcages. It causes the creature to move in a random direction to avoid the danger */
- approachAfterReaction = (AL0447_i_Behavior == k6_behavior_ATTACK); /* If the creature behavior is 'Attack' and it has to move to avoid danger then it will change its behavior to 'Approach' after the movement */
+ case kDMEventTypeCreateReactionDangerOnSquare: /* This event is used when some creatures in the group were killed by a Poison Cloud or by a closing door or if Lord Chaos is surrounded by 3 Fluxcages. It causes the creature to move in a random direction to avoid the danger */
+ approachAfterReaction = (AL0447_i_Behavior == kDMBehaviorAttack); /* If the creature behavior is 'Attack' and it has to move to avoid danger then it will change its behavior to 'Approach' after the movement */
newGroupDirectionFound = false;
goto T0209058_MoveInRandomDirection;
+ default:
+ break;
}
}
- if (eventType < k37_TMEventTypeUpdateBehaviourGroup) { /* Process Update Aspect events 32 to 36 */
- nextEvent._type = eventType + 5;
- if (groupGetDistanceToVisibleParty(curGroup, kM1_wholeCreatureGroup, eventMapX, eventMapY)) {
- if ((AL0447_i_Behavior != k6_behavior_ATTACK) && (AL0447_i_Behavior != k5_behavior_FLEE)) {
+ if (eventType < kDMEventTypeUpdateBehaviourGroup) { /* Process Update Aspect events 32 to 36 */
+ int16 nextType = eventType + 5;
+ nextEvent._type = (TimelineEventType)nextType;
+ if (groupGetDistanceToVisibleParty(curGroup, kDMWholeCreatureGroup, eventMapX, eventMapY)) {
+ if ((AL0447_i_Behavior != kDMBehaviorAttack) && (AL0447_i_Behavior != kDMBehaviorFlee)) {
if (_vm->getDistance(_vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, eventMapX, eventMapY) <= 1)
goto T0209044_SetBehavior6_Attack;
- if (((AL0447_i_Behavior == k0_behavior_WANDER) || (AL0447_i_Behavior == k3_behavior_USELESS)) && (AL0447_i_Behavior != k7_behavior_APPROACH)) /* BUG0_00 Useless code. Behavior cannot be 3 because this value is never used. Moreover, the second condition in the && is redundant (if the value is 0 or 3, it cannot be 7). The actual condition is: if (AL0447_i_Behavior == k0_behavior_WANDER) */
+ if (((AL0447_i_Behavior == kDMBehaviorWander) || (AL0447_i_Behavior == kDMBehaviorUnknown3)) && (AL0447_i_Behavior != kDMBehaviorApproach)) /* BUG0_00 Useless code. Behavior cannot be 3 because this value is never used. Moreover, the second condition in the && is redundant (if the value is 0 or 3, it cannot be 7). The actual condition is: if (AL0447_i_Behavior == k0_behavior_WANDER) */
goto T0209054_SetBehavior7_Approach;
}
activeGroup->_targetMapX = _vm->_dungeonMan->_partyMapX;
activeGroup->_targetMapY = _vm->_dungeonMan->_partyMapY;
}
- if (AL0447_i_Behavior == k6_behavior_ATTACK) {
- AL0446_i_CreatureAspectIndex = eventType - k33_TMEventTypeUpdateAspectCreature_0; /* Value -1 for event 32, meaning aspect will be updated for all creatures in the group */
- nextAspectUpdateTime = getCreatureAspectUpdateTime(activeGroup, AL0446_i_CreatureAspectIndex, getFlag(activeGroup->_aspect[AL0446_i_CreatureAspectIndex], k0x0080_MaskActiveGroupIsAttacking));
+ if (AL0447_i_Behavior == kDMBehaviorAttack) {
+ AL0446_i_CreatureAspectIndex = eventType - kDMEventTypeUpdateAspectCreature0; /* Value -1 for event 32, meaning aspect will be updated for all creatures in the group */
+ nextAspectUpdateTime = getCreatureAspectUpdateTime(activeGroup, AL0446_i_CreatureAspectIndex, getFlag(activeGroup->_aspect[AL0446_i_CreatureAspectIndex], kDMAspectMaskActiveGroupIsAttacking));
goto T0209136;
}
if ((AL0450_i_DistanceXToParty > 3) || (AL0451_i_DistanceYToParty > 3)) {
@@ -732,46 +742,47 @@ T0209005_AddEventAndReturn:
if (ticks)
nextAspectUpdateTime = _vm->_gameTime;
- if (eventType == k37_TMEventTypeUpdateBehaviourGroup) { /* Process event 37, Update Group Behavior */
+ if (eventType == kDMEventTypeUpdateBehaviourGroup) { /* Process event 37, Update Group Behavior */
bool allowMovementOverFakePitsAndFakeWalls;
- if ((AL0447_i_Behavior == k0_behavior_WANDER) || (AL0447_i_Behavior == k2_behavior_USELESS) || (AL0447_i_Behavior == k3_behavior_USELESS)) { /* BUG0_00 Useless code. Behavior cannot be 2 nor 3 because these values are never used. The actual condition is: if (AL0447_i_Behavior == k0_behavior_WANDER) */
- distanceToVisibleParty = groupGetDistanceToVisibleParty(curGroup, kM1_wholeCreatureGroup, eventMapX, eventMapY);
+ if ((AL0447_i_Behavior == kDMBehaviorWander) || (AL0447_i_Behavior == kDMBehaviorUnknown2) || (AL0447_i_Behavior == kDMBehaviorUnknown3)) { /* BUG0_00 Useless code. Behavior cannot be 2 nor 3 because these values are never used. The actual condition is: if (AL0447_i_Behavior == k0_behavior_WANDER) */
+ distanceToVisibleParty = groupGetDistanceToVisibleParty(curGroup, kDMWholeCreatureGroup, eventMapX, eventMapY);
if (distanceToVisibleParty) {
if ((distanceToVisibleParty <= (creatureInfo.getAttackRange())) && ((!AL0450_i_DistanceXToParty) || (!AL0451_i_DistanceYToParty))) { /* If the creature is in range for attack and on the same row or column as the party on the map */
T0209044_SetBehavior6_Attack:
- if (eventType == kM2_TMEventTypeCreateReactionEvent30HitByProjectile) {
+ if (eventType == kDMEventTypeCreateReactionHitByProjectile) {
groupDeleteEvents(eventMapX, eventMapY);
}
activeGroup->_targetMapX = _vm->_dungeonMan->_partyMapX;
activeGroup->_targetMapY = _vm->_dungeonMan->_partyMapY;
- curGroup->setBehaviour(k6_behavior_ATTACK);
+ curGroup->setBehaviour(kDMBehaviorAttack);
AL0446_i_Direction = _currGroupPrimaryDirToParty;
for (AL0447_i_CreatureIndex = creatureCount; AL0447_i_CreatureIndex >= 0; AL0447_i_CreatureIndex--) {
if ((getCreatureValue(activeGroup->_directions, AL0447_i_CreatureIndex) != AL0446_i_Direction) &&
((!AL0447_i_CreatureIndex) || (!_vm->getRandomNumber(2)))) {
- setGroupDirection(activeGroup, AL0446_i_Direction, AL0447_i_CreatureIndex, creatureCount && (creatureSize == k1_MaskCreatureSizeHalf));
- M32_setTime(nextEvent._mapTime, _vm->_gameTime + _vm->getRandomNumber(4) + 2); /* Random delay represents the time for the creature to turn */
+ setGroupDirection(activeGroup, AL0446_i_Direction, AL0447_i_CreatureIndex, creatureCount && (creatureSize == kDMCreatureSizeHalf));
+ setTime(nextEvent._mapTime, _vm->_gameTime + _vm->getRandomNumber(4) + 2); /* Random delay represents the time for the creature to turn */
} else {
- M32_setTime(nextEvent._mapTime, _vm->_gameTime + 1);
+ setTime(nextEvent._mapTime, _vm->_gameTime + 1);
}
if (notUpdateBehaviorFl) {
nextEvent._mapTime += MIN((uint16)((creatureInfo._attackTicks >> 1) + _vm->getRandomNumber(4)), ticks);
}
- nextEvent._type = k38_TMEventTypeUpdateBehaviour_0 + AL0447_i_CreatureIndex;
+ int16 nextType = kDMEventTypeUpdateBehavior0 + AL0447_i_CreatureIndex;
+ nextEvent._type = (TimelineEventType)nextType;
addGroupEvent(&nextEvent, getCreatureAspectUpdateTime(activeGroup, AL0447_i_CreatureIndex, false));
}
return;
}
- if (AL0447_i_Behavior != k2_behavior_USELESS) { /* BUG0_00 Useless code. Behavior cannot be 2 because this value is never used */
+ if (AL0447_i_Behavior != kDMBehaviorUnknown2) { /* BUG0_00 Useless code. Behavior cannot be 2 because this value is never used */
T0209054_SetBehavior7_Approach:
- curGroup->setBehaviour(k7_behavior_APPROACH);
+ curGroup->setBehaviour(kDMBehaviorApproach);
activeGroup->_targetMapX = _vm->_dungeonMan->_partyMapX;
activeGroup->_targetMapY = _vm->_dungeonMan->_partyMapY;
nextEvent._mapTime += 1;
goto T0209134_SetEvent37;
}
} else {
- if (AL0447_i_Behavior == k0_behavior_WANDER) {
+ if (AL0447_i_Behavior == kDMBehaviorWander) {
primaryDirectionToOrFromParty = getSmelledPartyPrimaryDirOrdinal(&creatureInfo, eventMapX, eventMapY);
if (primaryDirectionToOrFromParty) {
primaryDirectionToOrFromParty--;
@@ -809,8 +820,8 @@ T0209061_MoveGroup:
break;
}
if (_groupMovementBlockedByParty) {
- if ((eventType != kM3_TMEventTypeCreateReactionEvent29DangerOnSquare) &&
- ((curGroup->getBehaviour() != k5_behavior_FLEE) ||
+ if ((eventType != kDMEventTypeCreateReactionDangerOnSquare) &&
+ ((curGroup->getBehaviour() != kDMBehaviorFlee) ||
!getFirstPossibleMovementDirOrdinal(&creatureInfo, eventMapX, eventMapY, false) ||
_vm->getRandomNumber(2)))
goto T0209044_SetBehavior6_Attack;
@@ -823,11 +834,11 @@ T0209061_MoveGroup:
if (!newGroupDirectionFound &&
(ticksSinceLastMove != -1) &&
isArchEnemy &&
- ((eventType == kM3_TMEventTypeCreateReactionEvent29DangerOnSquare) || !_vm->getRandomNumber(4))) { /* BUG0_15 The game hangs when you close a door on Lord Chaos. A condition is missing in the code to manage creatures and this may create an infinite loop between two parts in the code */
+ ((eventType == kDMEventTypeCreateReactionDangerOnSquare) || !_vm->getRandomNumber(4))) { /* BUG0_15 The game hangs when you close a door on Lord Chaos. A condition is missing in the code to manage creatures and this may create an infinite loop between two parts in the code */
_vm->_projexpl->_secondaryDirToOrFromParty = _vm->turnDirRight(primaryDirectionToOrFromParty = _vm->getRandomNumber(4));
goto T0209089_DoubleSquareMove; /* BUG0_69 Memory corruption when you close a door on Lord Chaos. The local variable (L0454_i_PrimaryDirectionToOrFromParty) containing the direction where Lord Chaos tries to move may be used as an array index without being initialized and cause memory corruption */
}
- if (newGroupDirectionFound || ((!_vm->getRandomNumber(4) || (distanceToVisibleParty <= creatureInfo.getSmellRange())) && (eventType != kM3_TMEventTypeCreateReactionEvent29DangerOnSquare))) {
+ if (newGroupDirectionFound || ((!_vm->getRandomNumber(4) || (distanceToVisibleParty <= creatureInfo.getSmellRange())) && (eventType != kDMEventTypeCreateReactionDangerOnSquare))) {
T0209073_SetDirectionGroup:
if (!newGroupDirectionFound && (ticksSinceLastMove >= 0)) { /* If direction is not found yet then look around in a random direction */
AL0446_i_Direction = _vm->getRandomNumber(4);
@@ -835,19 +846,19 @@ T0209073_SetDirectionGroup:
setDirGroup(activeGroup, AL0446_i_Direction, creatureCount, creatureSize);
}
/* If event is kM3_TMEventTypeCreateReactionEvent29DangerOnSquare or kM2_TMEventTypeCreateReactionEvent30HitByProjectile */
- if (eventType < kM1_TMEventTypeCreateReactionEvent31ParyIsAdjacent) {
+ if (eventType < kDMEventTypeCreateReactionPartyIsAdjacent) {
if (!newGroupDirectionFound)
return;
if (approachAfterReaction)
- curGroup->setBehaviour(k7_behavior_APPROACH);
+ curGroup->setBehaviour(kDMBehaviorApproach);
stopAttacking(activeGroup, eventMapX, eventMapY);
}
}
}
} else {
- if (AL0447_i_Behavior == k7_behavior_APPROACH) {
- distanceToVisibleParty = groupGetDistanceToVisibleParty(curGroup, kM1_wholeCreatureGroup, eventMapX, eventMapY);
+ if (AL0447_i_Behavior == kDMBehaviorApproach) {
+ distanceToVisibleParty = groupGetDistanceToVisibleParty(curGroup, kDMWholeCreatureGroup, eventMapX, eventMapY);
if (distanceToVisibleParty) {
if ((distanceToVisibleParty <= creatureInfo.getAttackRange()) && ((!AL0450_i_DistanceXToParty) || (!AL0451_i_DistanceYToParty))) /* If the creature is in range for attack and on the same row or column as the party on the map */
goto T0209044_SetBehavior6_Attack;
@@ -863,7 +874,7 @@ T0209082_WalkTowardTarget:
/* If the creature reached its target but the party is not there anymore */
if ((eventMapX == AL0450_i_TargetMapX) && (eventMapY == AL0451_i_TargetMapY)) {
newGroupDirectionFound = false;
- curGroup->setBehaviour(k0_behavior_WANDER);
+ curGroup->setBehaviour(kDMBehaviorWander);
goto T0209073_SetDirectionGroup;
}
}
@@ -890,17 +901,17 @@ T0209089_DoubleSquareMove:
AL0450_i_DestinationMapX = eventMapX;
AL0451_i_DestinationMapY = eventMapY;
AL0450_i_DestinationMapX += _vm->_dirIntoStepCountEast[AL0446_i_Direction] * 2, AL0451_i_DestinationMapY += _vm->_dirIntoStepCountNorth[AL0446_i_Direction] * 2;
- _vm->_sound->requestPlay(k17_soundBUZZ, AL0450_i_DestinationMapX, AL0451_i_DestinationMapY, kDMSoundModePlayIfPrioritized);
+ _vm->_sound->requestPlay(kDMSoundIndexBuzz, AL0450_i_DestinationMapX, AL0451_i_DestinationMapY, kDMSoundModePlayIfPrioritized);
goto T0209061_MoveGroup;
}
}
setDirGroup(activeGroup, primaryDirectionToOrFromParty, creatureCount, creatureSize);
} else {
- if (AL0447_i_Behavior == k5_behavior_FLEE) {
+ if (AL0447_i_Behavior == kDMBehaviorFlee) {
T0209094_FleeFromTarget:
allowMovementOverFakePitsAndFakeWalls = true;
/* If the creature can see the party then update target coordinates */
- distanceToVisibleParty = groupGetDistanceToVisibleParty(curGroup, kM1_wholeCreatureGroup, eventMapX, eventMapY);
+ distanceToVisibleParty = groupGetDistanceToVisibleParty(curGroup, kDMWholeCreatureGroup, eventMapX, eventMapY);
if (distanceToVisibleParty) {
AL0450_i_TargetMapX = (activeGroup->_targetMapX = _vm->_dungeonMan->_partyMapX);
AL0451_i_TargetMapY = (activeGroup->_targetMapY = _vm->_dungeonMan->_partyMapY);
@@ -908,7 +919,7 @@ T0209094_FleeFromTarget:
if (!(--(activeGroup->_delayFleeingFromTarget))) { /* If the creature is not afraid anymore then stop fleeing from target */
T0209096_SetBehavior0_Wander:
newGroupDirectionFound = false;
- curGroup->setBehaviour(k0_behavior_WANDER);
+ curGroup->setBehaviour(kDMBehaviorWander);
goto T0209073_SetDirectionGroup;
}
if (_vm->getRandomNumber(2)) {
@@ -934,14 +945,14 @@ T0209096_SetBehavior0_Wander:
}
}
} else { /* Process events 38 to 41, Update Creature Behavior */
- if (AL0447_i_Behavior == k5_behavior_FLEE) {
+ if (AL0447_i_Behavior == kDMBehaviorFlee) {
if (creatureCount) {
stopAttacking(activeGroup, eventMapX, eventMapY);
}
goto T0209094_FleeFromTarget;
}
/* If the creature is attacking, then compute the next aspect update time and the next attack time */
- if (getFlag(activeGroup->_aspect[AL0447_i_CreatureIndex = eventType - k38_TMEventTypeUpdateBehaviour_0], k0x0080_MaskActiveGroupIsAttacking)) {
+ if (getFlag(activeGroup->_aspect[AL0447_i_CreatureIndex = eventType - kDMEventTypeUpdateBehavior0], kDMAspectMaskActiveGroupIsAttacking)) {
nextAspectUpdateTime = getCreatureAspectUpdateTime(activeGroup, AL0447_i_CreatureIndex, false);
nextEvent._mapTime += ((AL0447_i_Ticks = creatureInfo._attackTicks) + _vm->getRandomNumber(4) - 1);
if (AL0447_i_Ticks > 15)
@@ -958,37 +969,37 @@ T0209096_SetBehavior0_Wander:
activeGroup->_targetMapY = _vm->_dungeonMan->_partyMapY;
}
/* If there is a single creature in the group that is not full square sized and 1/4 chance */
- if (!creatureCount && (creatureSize != k2_MaskCreatureSizeFull) && !((AL0446_i_GroupCellsCriteria = _vm->getRandomNumber(65536)) & 0x00C0)) {
- if (activeGroup->_cells != k255_CreatureTypeSingleCenteredCreature) {
+ if (!creatureCount && (creatureSize != kDMCreatureSizeFull) && !((AL0446_i_GroupCellsCriteria = _vm->getRandomNumber(65536)) & 0x00C0)) {
+ if (activeGroup->_cells != kDMCreatureTypeSingleCenteredCreature) {
/* If the creature is not already on the center of the square then change its cell */
if (AL0446_i_GroupCellsCriteria & 0x0038) /* 7/8 chances of changing cell to the center of the square */
- activeGroup->_cells = k255_CreatureTypeSingleCenteredCreature;
+ activeGroup->_cells = kDMCreatureTypeSingleCenteredCreature;
else /* 1/8 chance of changing cell to the next or previous cell on the square */
AL0446_i_GroupCellsCriteria = _vm->normalizeModulo4(_vm->normalizeModulo4(activeGroup->_cells) + ((AL0446_i_GroupCellsCriteria & 0x0001) ? 1 : -1));
}
/* If 1/8 chance and the creature is not adjacent to the party and is a quarter square sized creature then process projectile impacts and update the creature cell if still alive. When the creature is not in front of the party, it has 7/8 chances of dodging a projectile by moving to another cell or staying in the center of the square */
- if (!(AL0446_i_GroupCellsCriteria & 0x0038) && (distanceToVisibleParty != 1) && (creatureSize == k0_MaskCreatureSizeQuarter)) {
- if (_vm->_projexpl->projectileGetImpactCount(kDMElementTypeCreature, eventMapX, eventMapY, activeGroup->_cells) && (_vm->_projexpl->_creatureDamageOutcome == k2_outcomeKilledAllCreaturesInGroup)) /* This call to F0218_PROJECTILE_GetImpactCount works fine because there is a single creature in the group so L0445_ps_ActiveGroup->Cells contains only one cell index */
+ if (!(AL0446_i_GroupCellsCriteria & 0x0038) && (distanceToVisibleParty != 1) && (creatureSize == kDMCreatureSizeQuarter)) {
+ if (_vm->_projexpl->projectileGetImpactCount(kDMElementTypeCreature, eventMapX, eventMapY, activeGroup->_cells) && (_vm->_projexpl->_creatureDamageOutcome == kDMKillOutcomeAllCreaturesInGroup)) /* This call to F0218_PROJECTILE_GetImpactCount works fine because there is a single creature in the group so L0445_ps_ActiveGroup->Cells contains only one cell index */
return;
activeGroup->_cells = _vm->normalizeModulo4(AL0446_i_GroupCellsCriteria);
}
}
/* If the creature can see the party and is looking in the party direction or can attack in all direction */
if (distanceToVisibleParty &&
- (getFlag(creatureInfo._attributes, k0x0004_MaskCreatureInfo_sideAttack) ||
+ (getFlag(creatureInfo._attributes, kDMCreatureMaskSideAttack) ||
getCreatureValue(activeGroup->_directions, AL0447_i_CreatureIndex) == primaryDirectionToOrFromParty)) {
/* If the creature is in range to attack the party and random test succeeds */
if ((distanceToVisibleParty <= (AL0446_i_Range = creatureInfo.getAttackRange())) &&
(!AL0450_i_DistanceXToParty || !AL0451_i_DistanceYToParty) &&
(AL0446_i_Range <= (_vm->getRandomNumber(16) + 1))) {
if ((AL0446_i_Range == 1) &&
- (!getFlag(AL0446_i_CreatureAttributes = creatureInfo._attributes, k0x0008_MaskCreatureInfo_preferBackRow) || !_vm->getRandomNumber(4) || !getFlag(AL0446_i_CreatureAttributes, k0x0010_MaskCreatureInfo_attackAnyChamp)) &&
- (creatureSize == k0_MaskCreatureSizeQuarter) &&
- (activeGroup->_cells != k255_CreatureTypeSingleCenteredCreature) &&
+ (!getFlag(AL0446_i_CreatureAttributes = creatureInfo._attributes, kDMCreatureMaskPreferBackRow) || !_vm->getRandomNumber(4) || !getFlag(AL0446_i_CreatureAttributes, kDMCreatureMaskAttackAnyChamp)) &&
+ (creatureSize == kDMCreatureSizeQuarter) &&
+ (activeGroup->_cells != kDMCreatureTypeSingleCenteredCreature) &&
((AL0446_i_Cell = getCreatureValue(activeGroup->_cells, AL0447_i_CreatureIndex)) != primaryDirectionToOrFromParty) &&
(AL0446_i_Cell != _vm->turnDirRight(primaryDirectionToOrFromParty))) { /* If the creature cannot cast spells (range = 1) and is not on a cell where it can attack the party directly and is a quarter square sized creature not in the center of the square then the creature moves to another cell and attack does not occur immediately */
if (!creatureCount && _vm->getRandomNumber(2)) {
- activeGroup->_cells = k255_CreatureTypeSingleCenteredCreature;
+ activeGroup->_cells = kDMCreatureTypeSingleCenteredCreature;
} else {
if ((primaryDirectionToOrFromParty & 0x0001) == (AL0446_i_Cell & 0x0001))
AL0446_i_Cell--;
@@ -998,9 +1009,9 @@ T0209096_SetBehavior0_Wander:
AL0446_i_Cell = _vm->normalizeModulo4(AL0446_i_Cell);
if (!getCreatureOrdinalInCell(curGroup, AL0446_i_Cell) ||
(_vm->getRandomNumber(2) && !getCreatureOrdinalInCell(curGroup, AL0446_i_Cell = _vm->returnOppositeDir((Direction)AL0446_i_Cell)))) { /* If the selected cell (or the opposite cell) is not already occupied by a creature */
- if (_vm->_projexpl->projectileGetImpactCount(kDMElementTypeCreature, eventMapX, eventMapY, activeGroup->_cells) && (_vm->_projexpl->_creatureDamageOutcome == k2_outcomeKilledAllCreaturesInGroup)) /* BUG0_70 A projectile impact on a creature may be ignored. The function F0218_PROJECTILE_GetImpactCount to detect projectile impacts when a quarter square sized creature moves inside a group (to another cell on the same square) may fail if there are several creatures in the group because the function expects a single cell index for its last parameter. The function should be called once for each cell where there is a creature */
+ if (_vm->_projexpl->projectileGetImpactCount(kDMElementTypeCreature, eventMapX, eventMapY, activeGroup->_cells) && (_vm->_projexpl->_creatureDamageOutcome == kDMKillOutcomeAllCreaturesInGroup)) /* BUG0_70 A projectile impact on a creature may be ignored. The function F0218_PROJECTILE_GetImpactCount to detect projectile impacts when a quarter square sized creature moves inside a group (to another cell on the same square) may fail if there are several creatures in the group because the function expects a single cell index for its last parameter. The function should be called once for each cell where there is a creature */
return;
- if (_vm->_projexpl->_creatureDamageOutcome != k1_outcomeKilledSomeCreaturesInGroup) {
+ if (_vm->_projexpl->_creatureDamageOutcome != kDMKillOutcomeSomeCreaturesInGroup) {
activeGroup->_cells = getGroupValueUpdatedWithCreatureValue(activeGroup->_cells, AL0447_i_CreatureIndex, AL0446_i_Cell);
}
}
@@ -1012,7 +1023,7 @@ T0209096_SetBehavior0_Wander:
nextAspectUpdateTime = getCreatureAspectUpdateTime(activeGroup, AL0447_i_CreatureIndex, isCreatureAttacking(curGroup, eventMapX, eventMapY, AL0447_i_CreatureIndex));
nextEvent._mapTime += (creatureInfo._animationTicks & 0xF) + _vm->getRandomNumber(2);
} else {
- curGroup->setBehaviour(k7_behavior_APPROACH);
+ curGroup->setBehaviour(kDMBehaviorApproach);
if (creatureCount) {
stopAttacking(activeGroup, eventMapX, eventMapY);
}
@@ -1020,14 +1031,14 @@ T0209096_SetBehavior0_Wander:
}
} else {
/* If the party is visible, update target coordinates */
- if (groupGetDistanceToVisibleParty(curGroup, kM1_wholeCreatureGroup, eventMapX, eventMapY)) {
+ if (groupGetDistanceToVisibleParty(curGroup, kDMWholeCreatureGroup, eventMapX, eventMapY)) {
activeGroup->_targetMapX = _vm->_dungeonMan->_partyMapX;
activeGroup->_targetMapY = _vm->_dungeonMan->_partyMapY;
- setGroupDirection(activeGroup, primaryDirectionToOrFromParty, AL0447_i_CreatureIndex, creatureCount && (creatureSize == k1_MaskCreatureSizeHalf));
+ setGroupDirection(activeGroup, primaryDirectionToOrFromParty, AL0447_i_CreatureIndex, creatureCount && (creatureSize == kDMCreatureSizeHalf));
nextEvent._mapTime += 2;
nextAspectUpdateTime = _vm->filterTime(nextEvent._mapTime);
} else { /* If the party is not visible, move to the target (last known party location) */
- curGroup->setBehaviour(k7_behavior_APPROACH);
+ curGroup->setBehaviour(kDMBehaviorApproach);
if (creatureCount) {
stopAttacking(activeGroup, eventMapX, eventMapY);
}
@@ -1040,11 +1051,11 @@ T0209096_SetBehavior0_Wander:
}
nextEvent._mapTime += MAX(1, _vm->getRandomNumber(4) + movementTicks - 1);
T0209134_SetEvent37:
- nextEvent._type = k37_TMEventTypeUpdateBehaviourGroup;
+ nextEvent._type = kDMEventTypeUpdateBehaviourGroup;
}
T0209135:
if (!nextAspectUpdateTime) {
- nextAspectUpdateTime = getCreatureAspectUpdateTime(activeGroup, kM1_wholeCreatureGroup, false);
+ nextAspectUpdateTime = getCreatureAspectUpdateTime(activeGroup, kDMWholeCreatureGroup, false);
}
T0209136:
if (notUpdateBehaviorFl) {
@@ -1060,7 +1071,7 @@ bool GroupMan::isMovementPossible(CreatureInfo *creatureInfo, int16 mapX, int16
_groupMovementBlockedByGroupThing = Thing::_endOfList;
_groupMovementBlockedByDoor = false;
_groupMovementBlockedByParty = false;
- if (creatureInfo->_movementTicks == k255_immobile)
+ if (creatureInfo->_movementTicks == kDMMovementTicksImmobile)
return false;
_vm->_dungeonMan->mapCoordsAfterRelMovement((Direction)dir, 1, 0, mapX, mapY);
@@ -1071,13 +1082,13 @@ bool GroupMan::isMovementPossible(CreatureInfo *creatureInfo, int16 mapX, int16
((mapY >= 0) && (mapY < _vm->_dungeonMan->_currMapHeight)) &&
(curSquareType != kDMElementTypeWall) &&
(curSquareType != kDMElementTypeStairs) &&
- ((curSquareType != kDMElementTypePit) || (getFlag(curSquare, kDMSquareMaskPitImaginary) && allowMovementOverImaginaryPitsAndFakeWalls) || !getFlag(curSquare, kDMSquareMaskPitOpen) || getFlag(creatureInfo->_attributes, k0x0020_MaskCreatureInfo_levitation)) &&
+ ((curSquareType != kDMElementTypePit) || (getFlag(curSquare, kDMSquareMaskPitImaginary) && allowMovementOverImaginaryPitsAndFakeWalls) || !getFlag(curSquare, kDMSquareMaskPitOpen) || getFlag(creatureInfo->_attributes, kDMCreatureMaskLevitation)) &&
((curSquareType != kDMElementTypeFakeWall) || getFlag(curSquare, kDMSquareMaskFakeWallOpen) || (getFlag(curSquare, kDMSquareMaskFakeWallImaginary) && allowMovementOverImaginaryPitsAndFakeWalls)));
if (_groupMovBlockedByWallStairsPitFakeWalFluxCageTeleporter)
return false;
- if (getFlag(creatureInfo->_attributes, k0x2000_MaskCreatureInfo_archenemy)) {
+ if (getFlag(creatureInfo->_attributes, kDMCreatureMaskArchenemy)) {
Thing curThing = _vm->_dungeonMan->getSquareFirstThing(mapX, mapY);
while (curThing != Thing::_endOfList) {
if ((curThing).getType() == kDMThingTypeExplosion) {
@@ -1106,7 +1117,7 @@ bool GroupMan::isMovementPossible(CreatureInfo *creatureInfo, int16 mapX, int16
if (curSquareType == kDMElementTypeDoor) {
Teleporter *curTeleporter = (Teleporter *)_vm->_dungeonMan->getSquareFirstThingData(mapX, mapY);
- if (((Square(curSquare).getDoorState()) > (((Door *)curTeleporter)->opensVertically() ? CreatureInfo::getHeight(creatureInfo->_attributes) : 1)) && ((Square(curSquare).getDoorState()) != kDMDoorStateDestroyed) && !getFlag(creatureInfo->_attributes, k0x0040_MaskCreatureInfo_nonMaterial)) {
+ if (((Square(curSquare).getDoorState()) > (((Door *)curTeleporter)->opensVertically() ? CreatureInfo::getHeight(creatureInfo->_attributes) : 1)) && ((Square(curSquare).getDoorState()) != kDMDoorStateDestroyed) && !getFlag(creatureInfo->_attributes, kDMCreatureMaskNonMaterial)) {
_groupMovementBlockedByDoor = true;
return false;
}
@@ -1123,13 +1134,13 @@ int16 GroupMan::getDistanceBetweenSquares(int16 srcMapX, int16 srcMapY, int16 de
int16 GroupMan::groupGetDistanceToVisibleParty(Group *group, int16 creatureIndex, int16 mapX, int16 mapY) {
uint16 groupDirections;
CreatureInfo *groupCreatureInfo = &_vm->_dungeonMan->_creatureInfos[group->_type];
- if (_vm->_championMan->_party._event71Count_Invisibility && !getFlag(groupCreatureInfo->_attributes, k0x0800_MaskCreatureInfo_seeInvisible))
+ if (_vm->_championMan->_party._event71Count_Invisibility && !getFlag(groupCreatureInfo->_attributes, kDMCreatureMaskSeeInvisible))
return 0;
bool alwaysSee = false;
int16 checkDirectionsCount; /* Count of directions to test in L0425_ai_CreatureViewDirections */
int16 creatureViewDirections[4]; /* List of directions to test */
- if (getFlag(groupCreatureInfo->_attributes, k0x0004_MaskCreatureInfo_sideAttack)) { /* If creature can see in all directions */
+ if (getFlag(groupCreatureInfo->_attributes, kDMCreatureMaskSideAttack)) { /* If creature can see in all directions */
alwaysSee = true;
checkDirectionsCount = 1;
creatureViewDirections[0] = kDMDirNorth;
@@ -1159,7 +1170,7 @@ int16 GroupMan::groupGetDistanceToVisibleParty(Group *group, int16 creatureIndex
while (checkDirectionsCount--) {
if (alwaysSee || isDestVisibleFromSource(creatureViewDirections[checkDirectionsCount], mapX, mapY, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY)) {
int16 sightRange = groupCreatureInfo->getSightRange();
- if (!getFlag(groupCreatureInfo->_attributes, k0x1000_MaskCreatureInfo_nightVision))
+ if (!getFlag(groupCreatureInfo->_attributes, kDMCreatureMaskNightVision))
sightRange -= _vm->_displayMan->_dungeonViewPaletteIndex >> 1;
if (_currGroupDistanceToParty > MAX<int16>(1, sightRange))
@@ -1244,7 +1255,7 @@ bool GroupMan::isViewPartyBlocked(uint16 mapX, uint16 mapY) {
int32 GroupMan::getCreatureAspectUpdateTime(ActiveGroup *activeGroup, int16 creatureIndex, bool isAttacking) {
Group *group = &(((Group *)_vm->_dungeonMan->_thingData[kDMThingTypeGroup])[activeGroup->_groupThingIndex]);
- uint16 creatureType = group->_type;
+ CreatureType creatureType = group->_type;
uint16 creatureGraphicInfo = _vm->_dungeonMan->_creatureInfos[creatureType]._graphicInfo;
bool processGroup = (creatureIndex < 0);
if (processGroup) /* If the creature index is negative then all creatures in the group are processed */
@@ -1252,7 +1263,7 @@ int32 GroupMan::getCreatureAspectUpdateTime(ActiveGroup *activeGroup, int16 crea
do {
uint16 aspect = activeGroup->_aspect[creatureIndex];
- aspect &= k0x0080_MaskActiveGroupIsAttacking | k0x0040_MaskActiveGroupFlipBitmap;
+ aspect &= kDMAspectMaskActiveGroupIsAttacking | kDMAspectMaskActiveGroupFlipBitmap;
int16 offset = ((creatureGraphicInfo >> 12) & 0x3);
if (offset) {
offset = _vm->getRandomNumber(offset);
@@ -1271,39 +1282,39 @@ int32 GroupMan::getCreatureAspectUpdateTime(ActiveGroup *activeGroup, int16 crea
aspect |= (offset << 3);
}
if (isAttacking) {
- if (getFlag(creatureGraphicInfo, k0x0200_CreatureInfoGraphicMaskFlipAttack)) {
- if (getFlag(aspect, k0x0080_MaskActiveGroupIsAttacking) && (creatureType == k18_CreatureTypeAnimatedArmourDethKnight)) {
+ if (getFlag(creatureGraphicInfo, kDMCreatureMaskFlipAttack)) {
+ if (getFlag(aspect, kDMAspectMaskActiveGroupIsAttacking) && (creatureType == kDMCreatureTypeAnimatedArmour)) {
if (_vm->getRandomNumber(2)) {
- toggleFlag(aspect, k0x0040_MaskActiveGroupFlipBitmap);
- _vm->_sound->requestPlay(k16_soundCOMBAT_ATTACK_SKELETON_ANIMATED_ARMOUR_DETH_KNIGHT, _currentGroupMapX, _currentGroupMapY, kDMSoundModePlayIfPrioritized);
+ toggleFlag(aspect, kDMAspectMaskActiveGroupFlipBitmap);
+ _vm->_sound->requestPlay(kDMSoundIndexAttackSkelettonAnimatedArmorDethKnight, _currentGroupMapX, _currentGroupMapY, kDMSoundModePlayIfPrioritized);
}
- } else if (!getFlag(aspect, k0x0080_MaskActiveGroupIsAttacking) || !getFlag(creatureGraphicInfo, k0x0400_CreatureInfoGraphicMaskFlipDuringAttack)) {
+ } else if (!getFlag(aspect, kDMAspectMaskActiveGroupIsAttacking) || !getFlag(creatureGraphicInfo, kDMCreatureMaskFlipDuringAttack)) {
if (_vm->getRandomNumber(2))
- setFlag(aspect, k0x0040_MaskActiveGroupFlipBitmap);
+ setFlag(aspect, kDMAspectMaskActiveGroupFlipBitmap);
else
- clearFlag(aspect, k0x0040_MaskActiveGroupFlipBitmap);
+ clearFlag(aspect, kDMAspectMaskActiveGroupFlipBitmap);
}
} else
- clearFlag(aspect, k0x0040_MaskActiveGroupFlipBitmap);
+ clearFlag(aspect, kDMAspectMaskActiveGroupFlipBitmap);
- setFlag(aspect, k0x0080_MaskActiveGroupIsAttacking);
+ setFlag(aspect, kDMAspectMaskActiveGroupIsAttacking);
} else {
- if (getFlag(creatureGraphicInfo, k0x0004_CreatureInfoGraphicMaskFlipNonAttack)) {
- if (creatureType == k13_CreatureTypeCouatl) {
+ if (getFlag(creatureGraphicInfo, kDMCreatureMaskFlipNonAttack)) {
+ if (creatureType == kDMCreatureTypeCouatl) {
if (_vm->getRandomNumber(2)) {
- toggleFlag(aspect, k0x0040_MaskActiveGroupFlipBitmap);
- uint16 soundIndex = _vm->_moveSens->getSound(k13_CreatureTypeCouatl);
- if (soundIndex <= k34_D13_soundCount)
+ toggleFlag(aspect, kDMAspectMaskActiveGroupFlipBitmap);
+ uint16 soundIndex = _vm->_moveSens->getSound(kDMCreatureTypeCouatl);
+ if (soundIndex <= kDMSoundCount)
_vm->_sound->requestPlay(soundIndex, _currentGroupMapX, _currentGroupMapY, kDMSoundModePlayIfPrioritized);
}
} else if (_vm->getRandomNumber(2))
- setFlag(aspect, k0x0040_MaskActiveGroupFlipBitmap);
+ setFlag(aspect, kDMAspectMaskActiveGroupFlipBitmap);
else
- clearFlag(aspect, k0x0040_MaskActiveGroupFlipBitmap);
+ clearFlag(aspect, kDMAspectMaskActiveGroupFlipBitmap);
} else
- clearFlag(aspect, k0x0040_MaskActiveGroupFlipBitmap);
+ clearFlag(aspect, kDMAspectMaskActiveGroupFlipBitmap);
- clearFlag(aspect, k0x0080_MaskActiveGroupIsAttacking);
+ clearFlag(aspect, kDMAspectMaskActiveGroupIsAttacking);
}
activeGroup->_aspect[creatureIndex] = aspect;
} while (processGroup && (creatureIndex--));
@@ -1338,9 +1349,10 @@ void GroupMan::setGroupDirection(ActiveGroup *activeGroup, int16 dir, int16 crea
void GroupMan::addGroupEvent(TimelineEvent *event, uint32 time) {
warning("potentially dangerous cast to uint32 below");
if (time < (uint32)_vm->filterTime(event->_mapTime)) {
- event->_type -= 5;
+ int16 tmpType = event->_type - 5;
+ event->_type = (TimelineEventType)tmpType;
event->_Cu._ticks = _vm->filterTime(event->_mapTime) - time;
- M32_setTime(event->_mapTime, time);
+ setTime(event->_mapTime, time);
} else
event->_Cu._ticks = time - _vm->filterTime(event->_mapTime);
@@ -1382,7 +1394,7 @@ int16 GroupMan::getFirstPossibleMovementDirOrdinal(CreatureInfo *info, int16 map
}
void GroupMan::setDirGroup(ActiveGroup *activeGroup, int16 dir, int16 creatureIndex, int16 creatureSize) {
- bool twoHalfSquareSizedCreatures = creatureIndex && (creatureSize == k1_MaskCreatureSizeHalf);
+ bool twoHalfSquareSizedCreatures = creatureIndex && (creatureSize == kDMCreatureSizeHalf);
if (twoHalfSquareSizedCreatures)
creatureIndex--;
@@ -1395,7 +1407,7 @@ void GroupMan::setDirGroup(ActiveGroup *activeGroup, int16 dir, int16 creatureIn
void GroupMan::stopAttacking(ActiveGroup *group, int16 mapX, int16 mapY) {
for (int16 creatureIndex = 0; creatureIndex < 4; creatureIndex++)
- clearFlag(group->_aspect[creatureIndex++], k0x0080_MaskActiveGroupIsAttacking);
+ clearFlag(group->_aspect[creatureIndex++], kDMAspectMaskActiveGroupIsAttacking);
groupDeleteEvents(mapX, mapY);
}
@@ -1413,13 +1425,13 @@ bool GroupMan::isCreatureAttacking(Group *group, int16 mapX, int16 mapY, uint16
_vm->_projexpl->_lastCreatureAttackTime = _vm->_gameTime;
ActiveGroup activeGroup = _activeGroups[group->getActiveGroupIndex()];
- uint16 creatureType = group->_type;
+ CreatureType creatureType = group->_type;
CreatureInfo *creatureInfo = &_vm->_dungeonMan->_creatureInfos[creatureType];
uint16 primaryDirectionToParty = _currGroupPrimaryDirToParty;
int16 targetCell;
byte groupCells = activeGroup._cells;
- if (groupCells == k255_CreatureTypeSingleCenteredCreature)
+ if (groupCells == kDMCreatureTypeSingleCenteredCreature)
targetCell = _vm->getRandomNumber(2);
else
targetCell = ((getCreatureValue(groupCells, creatureIndex) + 5 - primaryDirectionToParty) & 0x0002) >> 1;
@@ -1430,8 +1442,8 @@ bool GroupMan::isCreatureAttacking(Group *group, int16 mapX, int16 mapY, uint16
Thing projectileThing = Thing::_none;
switch (creatureType) {
- case k14_CreatureTypeVexirk:
- case k23_CreatureTypeLordChaos:
+ case kDMCreatureTypeVexirk:
+ case kDMCreatureTypeLordChaos:
if (_vm->getRandomNumber(2)) {
projectileThing = Thing::_explFireBall;
} else {
@@ -1450,33 +1462,36 @@ bool GroupMan::isCreatureAttacking(Group *group, int16 mapX, int16 mapY, uint16
}
}
break;
- case k1_CreatureTypeSwampSlimeSlime:
+ case kDMCreatureTypeSwampSlime:
projectileThing = Thing::_explSlime;
break;
- case k3_CreatureTypeWizardEyeFlyingEye:
+ case kDMCreatureTypeWizardEye:
if (_vm->getRandomNumber(8)) {
projectileThing = Thing::_explLightningBolt;
} else {
projectileThing = Thing::_explOpenDoor;
}
break;
- case k19_CreatureTypeMaterializerZytaz:
+ case kDMCreatureTypeMaterializerZytaz:
if (_vm->getRandomNumber(2)) {
projectileThing = Thing::_explPoisonCloud;
break;
}
- case k22_CreatureTypeDemon:
- case k24_CreatureTypeRedDragon:
+ case kDMCreatureTypeDemon:
+ case kDMCreatureTypeRedDragon:
projectileThing = Thing::_explFireBall;
+ break;
+ default:
+ break;
} /* BUG0_13 The game may crash when 'Lord Order' or 'Grey Lord' cast spells. This cannot happen with the original dungeons as they do not contain any groups of these types. 'Lord Order' and 'Grey Lord' creatures can cast spells (attack range > 1) but no projectile type is defined for them in the code. If these creatures are present in a dungeon they will cast projectiles containing undefined things because the variable is not initialized */
int16 kineticEnergy = (creatureInfo->_attack >> 2) + 1;
kineticEnergy += _vm->getRandomNumber(kineticEnergy);
kineticEnergy += _vm->getRandomNumber(kineticEnergy);
- _vm->_sound->requestPlay(k13_soundSPELL, mapX, mapY, kDMSoundModePlayImmediately);
+ _vm->_sound->requestPlay(kDMSoundIndexSpell, mapX, mapY, kDMSoundModePlayImmediately);
_vm->_projexpl->createProjectile(projectileThing, mapX, mapY, targetCell, (Direction)_currGroupPrimaryDirToParty, CLIP<byte>(20, kineticEnergy, 255), creatureInfo->_dexterity, 8);
} else {
int16 championIndex;
- if (getFlag(creatureInfo->_attributes, k0x0010_MaskCreatureInfo_attackAnyChamp)) {
+ if (getFlag(creatureInfo->_attributes, kDMCreatureMaskAttackAnyChamp)) {
championIndex = _vm->getRandomNumber(4);
int cpt;
for (cpt = 0; (cpt < 4) && !_vm->_championMan->_champions[championIndex]._currHealth; cpt++)
@@ -1490,7 +1505,7 @@ bool GroupMan::isCreatureAttacking(Group *group, int16 mapX, int16 mapY, uint16
return false;
}
- if (creatureType == k2_CreatureTypeGiggler)
+ if (creatureType == kDMCreatureTypeGiggler)
stealFromChampion(group, championIndex);
else {
int16 damage = getChampionDamage(group, championIndex) + 1;
@@ -1561,7 +1576,7 @@ void GroupMan::stealFromChampion(Group *group, uint16 championIndex) {
}
if (!_vm->getRandomNumber(8) || (objectStolen && _vm->getRandomNumber(2))) {
_activeGroups[group->getActiveGroupIndex()]._delayFleeingFromTarget = _vm->getRandomNumber(64) + 20;
- group->setBehaviour(k5_behavior_FLEE);
+ group->setBehaviour(kDMBehaviorFlee);
}
}
@@ -1612,7 +1627,7 @@ int16 GroupMan::getChampionDamage(Group *group, uint16 champIndex) {
int16 damage = _vm->_championMan->addPendingDamageAndWounds_getDamage(champIndex, attack, allowedWound, creatureInfo._attackType);
if (damage) {
- _vm->_sound->requestPlay(k09_soundCHAMPION_0_DAMAGED + champIndex, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, kDMSoundModePlayOneTickLater);
+ _vm->_sound->requestPlay(kDMSoundIndexChampion0Damaged + champIndex, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, kDMSoundModePlayOneTickLater);
uint16 poisonAttack = creatureInfo._poisonAttack;
if (poisonAttack && _vm->getRandomNumber(2)) {
@@ -1630,7 +1645,7 @@ int16 GroupMan::getChampionDamage(Group *group, uint16 champIndex) {
void GroupMan::dropMovingCreatureFixedPossession(Thing thing, int16 mapX, int16 mapY) {
if (_dropMovingCreatureFixedPossCellCount) {
Group *group = (Group *)_vm->_dungeonMan->getThingData(thing);
- int16 creatureType = group->_type;
+ CreatureType creatureType = group->_type;
while (_dropMovingCreatureFixedPossCellCount) {
dropCreatureFixedPossessions(creatureType, mapX, mapY, _dropMovingCreatureFixedPossessionsCell[--_dropMovingCreatureFixedPossCellCount], kDMSoundModePlayOneTickLater);
}
@@ -1639,13 +1654,13 @@ void GroupMan::dropMovingCreatureFixedPossession(Thing thing, int16 mapX, int16
void GroupMan::startWandering(int16 mapX, int16 mapY) {
Group *L0332_ps_Group = (Group *)_vm->_dungeonMan->getThingData(groupGetThing(mapX, mapY));
- if (L0332_ps_Group->getBehaviour() >= k4_behavior_USELESS) {
- L0332_ps_Group->setBehaviour(k0_behavior_WANDER);
+ if (L0332_ps_Group->getBehaviour() >= kDMBehaviorUnknown4) {
+ L0332_ps_Group->setBehaviour(kDMBehaviorWander);
}
TimelineEvent nextEvent;
- _vm->setMapAndTime(nextEvent._mapTime, _vm->_dungeonMan->_currMapIndex, (_vm->_gameTime + 1));
- nextEvent._type = k37_TMEventTypeUpdateBehaviourGroup;
- nextEvent._priority = 255 - _vm->_dungeonMan->_creatureInfos[L0332_ps_Group->_type]._movementTicks; /* The fastest creatures (with small MovementTicks value) get higher event priority */
+ nextEvent._mapTime = _vm->setMapAndTime(_vm->_dungeonMan->_currMapIndex, (_vm->_gameTime + 1));
+ nextEvent._type = kDMEventTypeUpdateBehaviourGroup;
+ nextEvent._priority = kDMMovementTicksImmobile - _vm->_dungeonMan->_creatureInfos[L0332_ps_Group->_type]._movementTicks; /* The fastest creatures (with small MovementTicks value) get higher event priority */
nextEvent._Cu._ticks = 0;
nextEvent._Bu._location._mapX = mapX;
nextEvent._Bu._location._mapY = mapY;
@@ -1677,7 +1692,7 @@ void GroupMan::addActiveGroup(Thing thing, int16 mapX, int16 mapY) {
activeGroup->_directions = (Direction)getGroupValueUpdatedWithCreatureValue(activeGroup->_directions, creatureIndex, curGroup->getDir());
activeGroup->_aspect[creatureIndex] = 0;
} while (creatureIndex--);
- getCreatureAspectUpdateTime(activeGroup, kM1_wholeCreatureGroup, false);
+ getCreatureAspectUpdateTime(activeGroup, kDMWholeCreatureGroup, false);
}
void GroupMan::removeActiveGroup(uint16 activeGroupIndex) {
@@ -1689,8 +1704,8 @@ void GroupMan::removeActiveGroup(uint16 activeGroupIndex) {
_currActiveGroupCount--;
group->_cells = activeGroup->_cells;
group->setDir(_vm->normalizeModulo4(activeGroup->_directions));
- if (group->getBehaviour() >= k4_behavior_USELESS) {
- group->setBehaviour(k0_behavior_WANDER);
+ if (group->getBehaviour() >= kDMBehaviorUnknown4) {
+ group->setBehaviour(kDMBehaviorWander);
}
activeGroup->_groupThingIndex = -1;
}
@@ -1724,7 +1739,7 @@ void GroupMan::addAllActiveGroups() {
}
}
-Thing GroupMan::groupGetGenerated(int16 creatureType, int16 healthMultiplier, uint16 creatureCount, Direction dir, int16 mapX, int16 mapY) {
+Thing GroupMan::groupGetGenerated(CreatureType creatureType, int16 healthMultiplier, uint16 creatureCount, Direction dir, int16 mapX, int16 mapY) {
Thing groupThing = _vm->_dungeonMan->getUnusedThing(kDMThingTypeGroup);
if (((_currActiveGroupCount >= (_maxActiveGroupCount - 5)) && (_vm->_dungeonMan->_currMapIndex == _vm->_dungeonMan->_partyMapIndex))
|| (groupThing == Thing::_none)) {
@@ -1741,15 +1756,16 @@ Thing GroupMan::groupGetGenerated(int16 creatureType, int16 healthMultiplier, ui
if (severalCreaturesInGroup)
cell = _vm->getRandomNumber(4);
else
- groupCells = k255_CreatureTypeSingleCenteredCreature;
+ groupCells = kDMCreatureTypeSingleCenteredCreature;
- CreatureInfo *creatureInfo = &_vm->_dungeonMan->_creatureInfos[group->_type = creatureType];
+ group->_type = creatureType;
+ CreatureInfo *creatureInfo = &_vm->_dungeonMan->_creatureInfos[group->_type];
uint16 baseHealth = creatureInfo->_baseHealth;
do {
group->_health[creatureCount] = (baseHealth * healthMultiplier) + _vm->getRandomNumber((baseHealth >> 2) + 1);
if (severalCreaturesInGroup) {
groupCells = getGroupValueUpdatedWithCreatureValue(groupCells, creatureCount, cell++);
- if (getFlag(creatureInfo->_attributes, k0x0003_MaskCreatureInfo_size) == k1_MaskCreatureSizeHalf)
+ if (getFlag(creatureInfo->_attributes, kDMCreatureMaskSize) == kDMCreatureSizeHalf)
cell++;
cell &= 0x0003;
@@ -1763,7 +1779,7 @@ Thing GroupMan::groupGetGenerated(int16 creatureType, int16 healthMultiplier, ui
(in which case the thing is referenced in the event) */
return Thing::_none;
}
- _vm->_sound->requestPlay(k17_soundBUZZ, mapX, mapY, kDMSoundModePlayIfPrioritized);
+ _vm->_sound->requestPlay(kDMSoundIndexBuzz, mapX, mapY, kDMSoundModePlayIfPrioritized);
return groupThing;
}
@@ -1807,11 +1823,11 @@ int16 GroupMan::getMeleeActionDamage(Champion *champ, int16 champIndex, Group *g
int16 doubledMapDifficulty = _vm->_dungeonMan->_currMap->_difficulty << 1;
CreatureInfo *creatureInfo = &_vm->_dungeonMan->_creatureInfos[group->_type];
int16 actionHandObjectIconIndex = _vm->_objectMan->getIconIndex(champ->_slots[kDMSlotActionHand]);
- bool actionHitsNonMaterialCreatures = getFlag(actionHitProbability, k0x8000_hitNonMaterialCreatures);
+ bool actionHitsNonMaterialCreatures = getFlag(actionHitProbability, kDMActionMaskHitNonMaterialCreatures);
if (actionHitsNonMaterialCreatures)
- clearFlag(actionHitProbability, k0x8000_hitNonMaterialCreatures);
+ clearFlag(actionHitProbability, kDMActionMaskHitNonMaterialCreatures);
- if ((!getFlag(creatureInfo->_attributes, k0x0040_MaskCreatureInfo_nonMaterial) || actionHitsNonMaterialCreatures) &&
+ if ((!getFlag(creatureInfo->_attributes, kDMCreatureMaskNonMaterial) || actionHitsNonMaterialCreatures) &&
((_vm->_championMan->getDexterity(champ) > (_vm->getRandomNumber(32) + creatureInfo->_dexterity + doubledMapDifficulty - 16)) ||
(!_vm->getRandomNumber(4)) ||
(_vm->_championMan->isLucky(champ, 75 - actionHitProbability)))) {
@@ -1851,7 +1867,7 @@ T0231009:
L0565_i_Damage >>= 2;
L0565_i_Damage += _vm->getRandomNumber(4) + 1;
if ((actionHandObjectIconIndex == kDMIconIndiceWeaponVorpalBlade)
- && !getFlag(creatureInfo->_attributes, k0x0040_MaskCreatureInfo_nonMaterial)
+ && !getFlag(creatureInfo->_attributes, kDMCreatureMaskNonMaterial)
&& !(L0565_i_Damage >>= 1))
goto T0231015;
@@ -1865,12 +1881,12 @@ T0231009:
}
T0231015:
L0565_i_Damage = 0;
- L0569_i_Outcome = k0_outcomeKilledNoCreaturesInGroup;
+ L0569_i_Outcome = kDMKillOutcomeNoCreaturesInGroup;
_vm->_championMan->decrementStamina(champIndex, _vm->getRandomNumber(2) + 2);
T0231016:
_vm->_championMan->drawChampionState((ChampionIndex)champIndex);
- if (L0569_i_Outcome != k2_outcomeKilledAllCreaturesInGroup) {
- processEvents29to41(mapX, mapY, kM1_TMEventTypeCreateReactionEvent31ParyIsAdjacent, 0);
+ if (L0569_i_Outcome != kDMKillOutcomeAllCreaturesInGroup) {
+ processEvents29to41(mapX, mapY, kDMEventTypeCreateReactionPartyIsAdjacent, 0);
}
return L0565_i_Damage;
}
@@ -1887,8 +1903,8 @@ void GroupMan::fluxCageAction(int16 mapX, int16 mapY) {
_vm->_dungeonMan->linkThingToList(unusedThing, Thing(0), mapX, mapY);
(((Explosion *)_vm->_dungeonMan->_thingData[kDMThingTypeExplosion])[unusedThing.getIndex()]).setType(kDMExplosionTypeFluxcage);
TimelineEvent newEvent;
- _vm->setMapAndTime(newEvent._mapTime, _vm->_dungeonMan->_currMapIndex, _vm->_gameTime + 100);
- newEvent._type = k24_TMEventTypeRemoveFluxcage;
+ newEvent._mapTime = _vm->setMapAndTime(_vm->_dungeonMan->_currMapIndex, _vm->_gameTime + 100);
+ newEvent._type = kDMEventTypeRemoveFluxcage;
newEvent._priority = 0;
newEvent._Cu._slot = unusedThing.toUint16();
newEvent._Bu._location._mapX = mapX;
@@ -1916,7 +1932,7 @@ void GroupMan::fluxCageAction(int16 mapX, int16 mapY) {
fluxcageCount = 0;
if (fluxcageCount == 2)
- processEvents29to41(mapX, mapY, kM3_TMEventTypeCreateReactionEvent29DangerOnSquare, 0);
+ processEvents29to41(mapX, mapY, kDMEventTypeCreateReactionDangerOnSquare, 0);
}
uint16 GroupMan::isLordChaosOnSquare(int16 mapX, int16 mapY) {
@@ -1925,7 +1941,7 @@ uint16 GroupMan::isLordChaosOnSquare(int16 mapX, int16 mapY) {
return 0;
Group *group = (Group *)_vm->_dungeonMan->getThingData(thing);
- if (group->_type == k23_CreatureTypeLordChaos)
+ if (group->_type == kDMCreatureTypeLordChaos)
return thing.toUint16();
return 0;
@@ -1947,10 +1963,10 @@ bool GroupMan::isFluxcageOnSquare(int16 mapX, int16 mapY) {
}
void GroupMan::fuseAction(uint16 mapX, uint16 mapY) {
- if ((mapX < 0) || (mapX >= _vm->_dungeonMan->_currMapWidth) || (mapY < 0) || (mapY >= _vm->_dungeonMan->_currMapHeight))
+ if ((mapX >= _vm->_dungeonMan->_currMapWidth) || (mapY >= _vm->_dungeonMan->_currMapHeight))
return;
- _vm->_projexpl->createExplosion(Thing::_explHarmNonMaterial, 255, mapX, mapY, k255_CreatureTypeSingleCenteredCreature); /* BUG0_17 The game crashes after the Fuse action is performed while looking at a wall on a map boundary. An explosion thing is created on the square in front of the party but there is no check to ensure the square coordinates are in the map bounds. This corrupts a memory location and leads to a game crash */
+ _vm->_projexpl->createExplosion(Thing::_explHarmNonMaterial, 255, mapX, mapY, kDMCreatureTypeSingleCenteredCreature); /* BUG0_17 The game crashes after the Fuse action is performed while looking at a wall on a map boundary. An explosion thing is created on the square in front of the party but there is no check to ensure the square coordinates are in the map bounds. This corrupts a memory location and leads to a game crash */
Thing lordChaosThing = Thing(isLordChaosOnSquare(mapX, mapY));
if (lordChaosThing.toUint16()) {
bool isFluxcages[4];
diff --git a/engines/dm/group.h b/engines/dm/group.h
index ad68a03216..f182c61123 100644
--- a/engines/dm/group.h
+++ b/engines/dm/group.h
@@ -29,71 +29,84 @@
#define DM_GROUP_H
#include "dm/dm.h"
+#include "dm/sounds.h"
+#include "dm/timeline.h"
namespace DM {
class Champion;
class TimelineEvent;
class CreatureInfo;
- // this doesn't seem to be used anywhere at all
/* Creature types */
enum CreatureType {
- k0_CreatureTypeGiantScorpionScorpion = 0, // @ C00_CREATURE_GIANT_SCORPION_SCORPION
- k1_CreatureTypeSwampSlimeSlime = 1, // @ C01_CREATURE_SWAMP_SLIME_SLIME_DEVIL
- k2_CreatureTypeGiggler = 2, // @ C02_CREATURE_GIGGLER
- k3_CreatureTypeWizardEyeFlyingEye = 3, // @ C03_CREATURE_WIZARD_EYE_FLYING_EYE
- k4_CreatureTypePainRatHellHound = 4, // @ C04_CREATURE_PAIN_RAT_HELLHOUND
- k5_CreatureTypeRuster = 5, // @ C05_CREATURE_RUSTER
- k6_CreatureTypeScreamer = 6, // @ C06_CREATURE_SCREAMER
- k7_CreatureTypeRockpile = 7, // @ C07_CREATURE_ROCK_ROCKPILE
- k8_CreatureTypeGhostRive = 8, // @ C08_CREATURE_GHOST_RIVE
- k9_CreatureTypeStoneGolem = 9, // @ C09_CREATURE_STONE_GOLEM
- k10_CreatureTypeMummy = 10, // @ C10_CREATURE_MUMMY
- k11_CreatureTypeBlackFlame = 11, // @ C11_CREATURE_BLACK_FLAME
- k12_CreatureTypeSkeleton = 12, // @ C12_CREATURE_SKELETON
- k13_CreatureTypeCouatl = 13, // @ C13_CREATURE_COUATL
- k14_CreatureTypeVexirk = 14, // @ C14_CREATURE_VEXIRK
- k15_CreatureTypeMagnetaWormWorm = 15, // @ C15_CREATURE_MAGENTA_WORM_WORM
- k16_CreatureTypeTrolinAntman = 16, // @ C16_CREATURE_TROLIN_ANTMAN
- k17_CreatureTypeGiantWaspMuncher = 17, // @ C17_CREATURE_GIANT_WASP_MUNCHER
- k18_CreatureTypeAnimatedArmourDethKnight = 18, // @ C18_CREATURE_ANIMATED_ARMOUR_DETH_KNIGHT
- k19_CreatureTypeMaterializerZytaz = 19, // @ C19_CREATURE_MATERIALIZER_ZYTAZ
- k20_CreatureTypeWaterElemental = 20, // @ C20_CREATURE_WATER_ELEMENTAL
- k21_CreatureTypeOitu = 21, // @ C21_CREATURE_OITU
- k22_CreatureTypeDemon = 22, // @ C22_CREATURE_DEMON
- k23_CreatureTypeLordChaos = 23, // @ C23_CREATURE_LORD_CHAOS
- k24_CreatureTypeRedDragon = 24, // @ C24_CREATURE_RED_DRAGON
- k25_CreatureTypeLordOrder = 25, // @ C25_CREATURE_LORD_ORDER
- k26_CreatureTypeGreyLord = 26, // @ C26_CREATURE_GREY_LORD
- k255_CreatureTypeSingleCenteredCreature = 255 // @ C255_SINGLE_CENTERED_CREATURE
+ kDMCreatureTypeGiantScorpion = 0, // @ C00_CREATURE_GIANT_SCORPION_SCORPION
+ kDMCreatureTypeSwampSlime = 1, // @ C01_CREATURE_SWAMP_SLIME_SLIME_DEVIL
+ kDMCreatureTypeGiggler = 2, // @ C02_CREATURE_GIGGLER
+ kDMCreatureTypeWizardEye = 3, // @ C03_CREATURE_WIZARD_EYE_FLYING_EYE
+ kDMCreatureTypePainRat = 4, // @ C04_CREATURE_PAIN_RAT_HELLHOUND
+ kDMCreatureTypeRuster = 5, // @ C05_CREATURE_RUSTER
+ kDMCreatureTypeScreamer = 6, // @ C06_CREATURE_SCREAMER
+ kDMCreatureTypeRockpile = 7, // @ C07_CREATURE_ROCK_ROCKPILE
+ kDMCreatureTypeGhostRive = 8, // @ C08_CREATURE_GHOST_RIVE
+ kDMCreatureTypeStoneGolem = 9, // @ C09_CREATURE_STONE_GOLEM
+ kDMCreatureTypeMummy = 10, // @ C10_CREATURE_MUMMY
+ kDMCreatureTypeBlackFlame = 11, // @ C11_CREATURE_BLACK_FLAME
+ kDMCreatureTypeSkeleton = 12, // @ C12_CREATURE_SKELETON
+ kDMCreatureTypeCouatl = 13, // @ C13_CREATURE_COUATL
+ kDMCreatureTypeVexirk = 14, // @ C14_CREATURE_VEXIRK
+ kDMCreatureTypeMagentaWorm = 15, // @ C15_CREATURE_MAGENTA_WORM_WORM
+ kDMCreatureTypeAntman = 16, // @ C16_CREATURE_TROLIN_ANTMAN
+ kDMCreatureTypeGiantWasp = 17, // @ C17_CREATURE_GIANT_WASP_MUNCHER
+ kDMCreatureTypeAnimatedArmour = 18, // @ C18_CREATURE_ANIMATED_ARMOUR_DETH_KNIGHT
+ kDMCreatureTypeMaterializerZytaz = 19, // @ C19_CREATURE_MATERIALIZER_ZYTAZ
+ kDMCreatureTypeWaterElemental = 20, // @ C20_CREATURE_WATER_ELEMENTAL
+ kDMCreatureTypeOitu = 21, // @ C21_CREATURE_OITU
+ kDMCreatureTypeDemon = 22, // @ C22_CREATURE_DEMON
+ kDMCreatureTypeLordChaos = 23, // @ C23_CREATURE_LORD_CHAOS
+ kDMCreatureTypeRedDragon = 24, // @ C24_CREATURE_RED_DRAGON
+ kDMCreatureTypeLordOrder = 25, // @ C25_CREATURE_LORD_ORDER
+ kDMCreatureTypeGreyLord = 26 // @ C26_CREATURE_GREY_LORD
};
-#define k0_MaskCreatureSizeQuarter 0 // @ C0_SIZE_QUARTER_SQUARE
-#define k1_MaskCreatureSizeHalf 1 // @ C1_SIZE_HALF_SQUARE
-#define k2_MaskCreatureSizeFull 2 // @ C2_SIZE_FULL_SQUARE
+enum CreatureSize {
+ kDMCreatureSizeQuarter = 0, // @ C0_SIZE_QUARTER_SQUARE
+ kDMCreatureSizeHalf = 1, // @ C1_SIZE_HALF_SQUARE
+ kDMCreatureSizeFull = 2 // @ C2_SIZE_FULL_SQUARE
+};
-#define k0x0003_MaskCreatureInfo_size 0x0003 // @ MASK0x0003_SIZE
-#define k0x0004_MaskCreatureInfo_sideAttack 0x0004 // @ MASK0x0004_SIDE_ATTACK
-#define k0x0008_MaskCreatureInfo_preferBackRow 0x0008 // @ MASK0x0008_PREFER_BACK_ROW
-#define k0x0010_MaskCreatureInfo_attackAnyChamp 0x0010 // @ MASK0x0010_ATTACK_ANY_CHAMPION
-#define k0x0020_MaskCreatureInfo_levitation 0x0020 // @ MASK0x0020_LEVITATION
-#define k0x0040_MaskCreatureInfo_nonMaterial 0x0040 // @ MASK0x0040_NON_MATERIAL
-#define k0x0200_MaskCreatureInfo_dropFixedPoss 0x0200 // @ MASK0x0200_DROP_FIXED_POSSESSIONS
-#define k0x0400_MaskCreatureInfo_keepThrownSharpWeapon 0x0400 // @ MASK0x0400_KEEP_THROWN_SHARP_WEAPONS
-#define k0x0800_MaskCreatureInfo_seeInvisible 0x0800 // @ MASK0x0800_SEE_INVISIBLE
-#define k0x1000_MaskCreatureInfo_nightVision 0x1000 // @ MASK0x1000_NIGHT_VISION
-#define k0x2000_MaskCreatureInfo_archenemy 0x2000 // @ MASK0x2000_ARCHENEMY
-#define k0x4000_MaskCreatureInfo_magicmap 0x4000 // @ MASK0x4000_MAGICMAP
+enum Behavior {
+ kDMBehaviorWander = 0, // @ C0_BEHAVIOR_WANDER
+ kDMBehaviorUnknown2 = 2, // @ C2_BEHAVIOR_USELESS
+ kDMBehaviorUnknown3 = 3, // @ C3_BEHAVIOR_USELESS
+ kDMBehaviorUnknown4 = 4, // @ C4_BEHAVIOR_USELESS
+ kDMBehaviorFlee = 5, // @ C5_BEHAVIOR_FLEE
+ kDMBehaviorAttack = 6, // @ C6_BEHAVIOR_ATTACK
+ kDMBehaviorApproach = 7 // @ C7_BEHAVIOR_APPROACH
+};
+#define kDMImmuneToFear 15 // @ C15_IMMUNE_TO_FEAR
+#define kDMMovementTicksImmobile 255 // @ C255_IMMOBILE
+#define kDMWholeCreatureGroup -1 // @ CM1_WHOLE_CREATURE_GROUP
+#define kDMCreatureTypeSingleCenteredCreature 255 // @ C255_SINGLE_CENTERED_CREATURE
-#define k0x0040_MaskActiveGroupFlipBitmap 0x0040 // @ MASK0x0040_FLIP_BITMAP
-#define k0x0080_MaskActiveGroupIsAttacking 0x0080 // @ MASK0x0080_IS_ATTACKING
+enum CreatureMask {
+ kDMCreatureMaskSize = 0x0003, // @ MASK0x0003_SIZE
+ kDMCreatureMaskSideAttack = 0x0004, // @ MASK0x0004_SIDE_ATTACK
+ kDMCreatureMaskPreferBackRow = 0x0008, // @ MASK0x0008_PREFER_BACK_ROW
+ kDMCreatureMaskAttackAnyChamp = 0x0010, // @ MASK0x0010_ATTACK_ANY_CHAMPION
+ kDMCreatureMaskLevitation = 0x0020, // @ MASK0x0020_LEVITATION
+ kDMCreatureMaskNonMaterial = 0x0040, // @ MASK0x0040_NON_MATERIAL
+ kDMCreatureMaskDropFixedPoss = 0x0200, // @ MASK0x0200_DROP_FIXED_POSSESSIONS
+ kDMCreatureMaskKeepThrownSharpWeapon = 0x0400, // @ MASK0x0400_KEEP_THROWN_SHARP_WEAPONS
+ kDMCreatureMaskSeeInvisible = 0x0800, // @ MASK0x0800_SEE_INVISIBLE
+ kDMCreatureMaskNightVision = 0x1000, // @ MASK0x1000_NIGHT_VISION
+ kDMCreatureMaskArchenemy = 0x2000, // @ MASK0x2000_ARCHENEMY
+ kDMCreatureMaskMagicMap = 0x4000 // @ MASK0x4000_MAGICMAP
+};
-enum SoundMode {
- kDMSoundModeDoNotPlaySound = -1, // @ CM1_MODE_DO_NOT_PLAY_SOUND
- kDMSoundModePlayImmediately = 0, // @ C00_MODE_PLAY_IMMEDIATELY
- kDMSoundModePlayIfPrioritized = 1, // @ C01_MODE_PLAY_IF_PRIORITIZED
- kDMSoundModePlayOneTickLater = 2 // @ C02_MODE_PLAY_ONE_TICK_LATER
+enum aspectMask {
+ kDMAspectMaskActiveGroupFlipBitmap = 0x0040, // @ MASK0x0040_FLIP_BITMAP
+ kDMAspectMaskActiveGroupIsAttacking = 0x0080 // @ MASK0x0080_IS_ATTACKING
};
class ActiveGroup {
@@ -112,18 +125,17 @@ public:
byte _aspect[4];
}; // @ ACTIVE_GROUP
-
class Group {
public:
Thing _nextThing;
Thing _slot;
- uint16 _type;
+ CreatureType _type;
uint16 _cells;
uint16 _health[4];
uint16 _flags;
public:
- explicit Group(uint16 *rawDat) : _nextThing(rawDat[0]), _slot(rawDat[1]), _type(rawDat[2]),
- _cells(rawDat[3]), _flags(rawDat[8]) {
+ explicit Group(uint16 *rawDat) : _nextThing(rawDat[0]), _slot(rawDat[1]), _cells(rawDat[3]), _flags(rawDat[8]) {
+ _type = (CreatureType)rawDat[2];
_health[0] = rawDat[4];
_health[1] = rawDat[5];
_health[2] = rawDat[6];
@@ -142,23 +154,6 @@ public:
void setDoNotDiscard(bool val) { _flags = (_flags & ~(1 << 10)) | ((val & 1) << 10); }
}; // @ GROUP
-#define k0_behavior_WANDER 0 // @ C0_BEHAVIOR_WANDER
-#define k2_behavior_USELESS 2 // @ C2_BEHAVIOR_USELESS
-#define k3_behavior_USELESS 3 // @ C3_BEHAVIOR_USELESS
-#define k4_behavior_USELESS 4 // @ C4_BEHAVIOR_USELESS
-#define k5_behavior_FLEE 5 // @ C5_BEHAVIOR_FLEE
-#define k6_behavior_ATTACK 6 // @ C6_BEHAVIOR_ATTACK
-#define k7_behavior_APPROACH 7 // @ C7_BEHAVIOR_APPROACH
-
-#define k15_immuneToFear 15 // @ C15_IMMUNE_TO_FEAR
-
-#define k255_immobile 255 // @ C255_IMMOBILE
-#define kM1_wholeCreatureGroup -1 // @ CM1_WHOLE_CREATURE_GROUP
-
-
-int32 M32_setTime(int32 &map_time, int32 time); // @ M32_SET_TIME
-
-
class GroupMan {
DMEngine *_vm;
byte _dropMovingCreatureFixedPossessionsCell[4]; // @ G0392_auc_DropMovingCreatureFixedPossessionsCells
@@ -179,6 +174,7 @@ class GroupMan {
bool _groupMovBlockedByWallStairsPitFakeWalFluxCageTeleporter; // @ G0387_B_GroupMovementBlockedByWallStairsPitFakeWallFluxcageTeleporter
int32 twoHalfSquareSizedCreaturesGroupLastDirectionSetTime; // @ G0395_l_TwoHalfSquareSizedCreaturesGroupLastDirectionSetTime
uint16 toggleFlag(uint16 &val, uint16 mask); // @ M10_TOGGLE
+ int32 setTime(int32 &map_time, int32 time); // @ M32_SET_TIME
public:
uint16 _maxActiveGroupCount; // @ G0376_ui_MaximumActiveGroupCount
@@ -193,7 +189,7 @@ public:
int16 getCreatureOrdinalInCell(Group *group, uint16 cell); // @ F0176_GROUP_GetCreatureOrdinalInCell
uint16 getCreatureValue(uint16 groupVal, uint16 creatureIndex); // @ M50_CREATURE_VALUE
void dropGroupPossessions(int16 mapX, int16 mapY, Thing groupThing, SoundMode mode); // @ F0188_GROUP_DropGroupPossessions
- void dropCreatureFixedPossessions(uint16 creatureType, int16 mapX, int16 mapY, uint16 cell,
+ void dropCreatureFixedPossessions(CreatureType creatureType, int16 mapX, int16 mapY, uint16 cell,
SoundMode soundMode); // @ F0186_GROUP_DropCreatureFixedPossessions
int16 getDirsWhereDestIsVisibleFromSource(int16 srcMapX, int16 srcMapY,
int16 destMapX, int16 destMapY); // @ F0228_GROUP_GetDirectionsWhereDestinationIsVisibleFromSource
@@ -208,8 +204,8 @@ public:
void groupDeleteEvents(int16 mapX, int16 mapY); // @ F0181_GROUP_DeleteEvents
uint16 getGroupValueUpdatedWithCreatureValue(uint16 groupVal, uint16 creatureIndex, uint16 creatureVal); // @ F0178_GROUP_GetGroupValueUpdatedWithCreatureValue
int16 getDamageAllCreaturesOutcome(Group *group, int16 mapX, int16 mapY, int16 attack, bool notMoving); // @ F0191_GROUP_GetDamageAllCreaturesOutcome
- int16 groupGetResistanceAdjustedPoisonAttack(uint16 creatreType, int16 poisonAttack); // @ F0192_GROUP_GetResistanceAdjustedPoisonAttack
- void processEvents29to41(int16 eventMapX, int16 eventMapY, int16 eventType, uint16 ticks); // @ F0209_GROUP_ProcessEvents29to41
+ int16 groupGetResistanceAdjustedPoisonAttack(CreatureType creatureType, int16 poisonAttack); // @ F0192_GROUP_GetResistanceAdjustedPoisonAttack
+ void processEvents29to41(int16 eventMapX, int16 eventMapY, TimelineEventType eventType, uint16 ticks); // @ F0209_GROUP_ProcessEvents29to41
bool isMovementPossible(CreatureInfo *creatureInfo, int16 mapX, int16 mapY,
uint16 dir, bool allowMovementOverImaginaryPitsAndFakeWalls); // @ F0202_GROUP_IsMovementPossible
int16 getDistanceBetweenSquares(int16 srcMapX, int16 srcMapY, int16 destMapX,
@@ -242,7 +238,7 @@ public:
void removeActiveGroup(uint16 activeGroupIndex); // @ F0184_GROUP_RemoveActiveGroup
void removeAllActiveGroups(); // @ F0194_GROUP_RemoveAllActiveGroups
void addAllActiveGroups(); // @ F0195_GROUP_AddAllActiveGroups
- Thing groupGetGenerated(int16 creatureType, int16 healthMultiplier, uint16 creatureCount, Direction dir, int16 mapX, int16 mapY); // @ F0185_GROUP_GetGenerated
+ Thing groupGetGenerated(CreatureType creatureType, int16 healthMultiplier, uint16 creatureCount, Direction dir, int16 mapX, int16 mapY); // @ F0185_GROUP_GetGenerated
bool isSquareACorridorTeleporterPitOrDoor(int16 mapX, int16 mapY); // @ F0223_GROUP_IsSquareACorridorTeleporterPitOrDoor
int16 getMeleeTargetCreatureOrdinal(int16 groupX, int16 groupY, int16 partyX, int16 paryY,
uint16 champCell); // @ F0177_GROUP_GetMeleeTargetCreatureOrdinal
@@ -255,7 +251,6 @@ public:
void saveActiveGroupPart(Common::OutSaveFile *file);
void loadActiveGroupPart(Common::InSaveFile *file);
};
-
}
#endif
diff --git a/engines/dm/inventory.cpp b/engines/dm/inventory.cpp
index 3fe3493172..a375494d35 100644
--- a/engines/dm/inventory.cpp
+++ b/engines/dm/inventory.cpp
@@ -71,7 +71,7 @@ void InventoryMan::initConstants() {
InventoryMan::InventoryMan(DMEngine *vm) : _vm(vm) {
_inventoryChampionOrdinal = 0;
- _panelContent = k0_PanelContentFoodWaterPoisoned;
+ _panelContent = kDMPanelContentFoodWaterPoisoned;
for (uint16 i = 0; i < 8; ++i)
_chestSlots[i] = Thing(0);
_openChest = Thing::_none;
@@ -125,30 +125,30 @@ void InventoryMan::toggleInventory(ChampionIndex championIndex) {
_vm->_displayMan->_useByteBoxCoordinates = false;
_inventoryChampionOrdinal = _vm->indexToOrdinal(championIndex);
if (!inventoryChampionOrdinal)
- _vm->_displayMan->shadeScreenBox(&_vm->_displayMan->_boxMovementArrows, k0_ColorBlack);
+ _vm->_displayMan->shadeScreenBox(&_vm->_displayMan->_boxMovementArrows, kDMColorBlack);
Champion *champion = &_vm->_championMan->_champions[championIndex];
- _vm->_displayMan->loadIntoBitmap(k17_InventoryGraphicIndice, _vm->_displayMan->_bitmapViewport);
+ _vm->_displayMan->loadIntoBitmap(kDMGraphicIdxInventory, _vm->_displayMan->_bitmapViewport);
if (_vm->_championMan->_candidateChampionOrdinal)
- _vm->_displayMan->fillBoxBitmap(_vm->_displayMan->_bitmapViewport, boxFloppyZzzCross, k12_ColorDarkestGray, k112_byteWidthViewport, k136_heightViewport);
+ _vm->_displayMan->fillBoxBitmap(_vm->_displayMan->_bitmapViewport, boxFloppyZzzCross, kDMColorDarkestGray, k112_byteWidthViewport, k136_heightViewport);
switch (_vm->getGameLanguage()) { // localized
default:
case Common::EN_ANY:
- _vm->_textMan->printToViewport(5, 116, k13_ColorLightestGray, "HEALTH");
- _vm->_textMan->printToViewport(5, 124, k13_ColorLightestGray, "STAMINA");
+ _vm->_textMan->printToViewport(5, 116, kDMColorLightestGray, "HEALTH");
+ _vm->_textMan->printToViewport(5, 124, kDMColorLightestGray, "STAMINA");
break;
case Common::DE_DEU:
- _vm->_textMan->printToViewport(5, 116, k13_ColorLightestGray, "GESUND");
- _vm->_textMan->printToViewport(5, 124, k13_ColorLightestGray, "KRAFT");
+ _vm->_textMan->printToViewport(5, 116, kDMColorLightestGray, "GESUND");
+ _vm->_textMan->printToViewport(5, 124, kDMColorLightestGray, "KRAFT");
break;
case Common::FR_FRA:
- _vm->_textMan->printToViewport(5, 116, k13_ColorLightestGray, "SANTE");
- _vm->_textMan->printToViewport(5, 124, k13_ColorLightestGray, "VIGUEUR");
+ _vm->_textMan->printToViewport(5, 116, kDMColorLightestGray, "SANTE");
+ _vm->_textMan->printToViewport(5, 124, kDMColorLightestGray, "VIGUEUR");
break;
}
- _vm->_textMan->printToViewport(5, 132, k13_ColorLightestGray, "MANA");
+ _vm->_textMan->printToViewport(5, 132, kDMColorLightestGray, "MANA");
for (uint16 i = kDMSlotReadyHand; i < kDMSlotChest1; i++)
_vm->_championMan->drawSlot(championIndex, i);
@@ -166,35 +166,35 @@ void InventoryMan::drawStatusBoxPortrait(ChampionIndex championIndex) {
DisplayMan &dispMan = *_vm->_displayMan;
dispMan._useByteBoxCoordinates = false;
Box box;
- box._y1 = 0;
- box._y2 = 28;
- box._x1 = championIndex * k69_ChampionStatusBoxSpacing + 7;
- box._x2 = box._x1 + 31;
- dispMan.blitToScreen(_vm->_championMan->_champions[championIndex]._portrait, &box, k16_byteWidth, kM1_ColorNoTransparency, 29);
+ box._rect.top = 0;
+ box._rect.bottom = 28;
+ box._rect.left = championIndex * kDMChampionStatusBoxSpacing + 7;
+ box._rect.right = box._rect.left + 31;
+ dispMan.blitToScreen(_vm->_championMan->_champions[championIndex]._portrait, &box, k16_byteWidth, kDMColorNoTransparency, 29);
}
void InventoryMan::drawPanelHorizontalBar(int16 x, int16 y, int16 pixelWidth, Color color) {
Box box;
- box._x1 = x;
- box._x2 = box._x1 + pixelWidth;
- box._y1 = y;
- box._y2 = box._y1 + 6;
+ box._rect.left = x;
+ box._rect.right = box._rect.left + pixelWidth;
+ box._rect.top = y;
+ box._rect.bottom = box._rect.top + 6;
_vm->_displayMan->_useByteBoxCoordinates = false;
_vm->_displayMan->fillBoxBitmap(_vm->_displayMan->_bitmapViewport, box, color, k112_byteWidthViewport, k136_heightViewport);
}
void InventoryMan::drawPanelFoodOrWaterBar(int16 amount, int16 y, Color color) {
if (amount < -512)
- color = k8_ColorRed;
+ color = kDMColorRed;
else if (amount < 0)
- color = k11_ColorYellow;
+ color = kDMColorYellow;
int16 pixelWidth = amount + 1024;
if (pixelWidth == 3072)
pixelWidth = 3071;
pixelWidth /= 32;
- drawPanelHorizontalBar(115, y + 2, pixelWidth, k0_ColorBlack);
+ drawPanelHorizontalBar(115, y + 2, pixelWidth, kDMColorBlack);
drawPanelHorizontalBar(113, y, pixelWidth, color);
}
@@ -206,36 +206,36 @@ void InventoryMan::drawPanelFoodWaterPoisoned() {
Champion &champ = _vm->_championMan->_champions[_inventoryChampionOrdinal];
closeChest();
DisplayMan &dispMan = *_vm->_displayMan;
- dispMan.blitToViewport(_vm->_displayMan->getNativeBitmapOrGraphic(k20_PanelEmptyIndice), _boxPanel, k72_byteWidth, k8_ColorRed, 73);
+ dispMan.blitToViewport(_vm->_displayMan->getNativeBitmapOrGraphic(kDMGraphicIdxPanelEmpty), _boxPanel, k72_byteWidth, kDMColorRed, 73);
switch (_vm->getGameLanguage()) { // localized
default:
case Common::EN_ANY:
- dispMan.blitToViewport(_vm->_displayMan->getNativeBitmapOrGraphic(k30_FoodLabelIndice), boxFood, k24_byteWidth, k12_ColorDarkestGray, 9);
- dispMan.blitToViewport(_vm->_displayMan->getNativeBitmapOrGraphic(k31_WaterLabelIndice), boxWater, k24_byteWidth, k12_ColorDarkestGray, 9);
+ dispMan.blitToViewport(_vm->_displayMan->getNativeBitmapOrGraphic(kDMGraphicIdxFoodLabel), boxFood, k24_byteWidth, kDMColorDarkestGray, 9);
+ dispMan.blitToViewport(_vm->_displayMan->getNativeBitmapOrGraphic(kDMGraphicIdxWaterLabel), boxWater, k24_byteWidth, kDMColorDarkestGray, 9);
break;
case Common::DE_DEU:
- dispMan.blitToViewport(_vm->_displayMan->getNativeBitmapOrGraphic(k30_FoodLabelIndice), boxFood, k32_byteWidth, k12_ColorDarkestGray, 9);
- dispMan.blitToViewport(_vm->_displayMan->getNativeBitmapOrGraphic(k31_WaterLabelIndice), boxWater, k32_byteWidth, k12_ColorDarkestGray, 9);
+ dispMan.blitToViewport(_vm->_displayMan->getNativeBitmapOrGraphic(kDMGraphicIdxFoodLabel), boxFood, k32_byteWidth, kDMColorDarkestGray, 9);
+ dispMan.blitToViewport(_vm->_displayMan->getNativeBitmapOrGraphic(kDMGraphicIdxWaterLabel), boxWater, k32_byteWidth, kDMColorDarkestGray, 9);
break;
case Common::FR_FRA:
- dispMan.blitToViewport(_vm->_displayMan->getNativeBitmapOrGraphic(k30_FoodLabelIndice), boxFood, k48_byteWidth, k12_ColorDarkestGray, 9);
- dispMan.blitToViewport(_vm->_displayMan->getNativeBitmapOrGraphic(k31_WaterLabelIndice), boxWater, k24_byteWidth, k12_ColorDarkestGray, 9);
+ dispMan.blitToViewport(_vm->_displayMan->getNativeBitmapOrGraphic(kDMGraphicIdxFoodLabel), boxFood, k48_byteWidth, kDMColorDarkestGray, 9);
+ dispMan.blitToViewport(_vm->_displayMan->getNativeBitmapOrGraphic(kDMGraphicIdxWaterLabel), boxWater, k24_byteWidth, kDMColorDarkestGray, 9);
break;
}
if (champ._poisonEventCount)
- dispMan.blitToViewport(_vm->_displayMan->getNativeBitmapOrGraphic(k32_PoisionedLabelIndice),
- boxPoisoned, k48_byteWidth, k12_ColorDarkestGray, 15);
+ dispMan.blitToViewport(_vm->_displayMan->getNativeBitmapOrGraphic(kDMGraphicIdxPoisionedLabel),
+ boxPoisoned, k48_byteWidth, kDMColorDarkestGray, 15);
- drawPanelFoodOrWaterBar(champ._food, 69, k5_ColorLightBrown);
- drawPanelFoodOrWaterBar(champ._water, 92, k14_ColorBlue);
+ drawPanelFoodOrWaterBar(champ._food, 69, kDMColorLightBrown);
+ drawPanelFoodOrWaterBar(champ._water, 92, kDMColorBlue);
}
void InventoryMan::drawPanelResurrectReincarnate() {
- _panelContent = k5_PanelContentResurrectReincarnate;
- _vm->_displayMan->blitToViewport(_vm->_displayMan->getNativeBitmapOrGraphic(k40_PanelResurectReincaranteIndice),
- _boxPanel, k72_byteWidth, k6_ColorDarkGreen, 73);
+ _panelContent = kDMPanelContentResurrectReincarnate;
+ _vm->_displayMan->blitToViewport(_vm->_displayMan->getNativeBitmapOrGraphic(kDMGraphicIdxPanelResurectReincarnate),
+ _boxPanel, k72_byteWidth, kDMColorDarkGreen, 73);
}
void InventoryMan::drawPanel() {
@@ -249,13 +249,13 @@ void InventoryMan::drawPanel() {
Thing thing = cm._champions[_vm->ordinalToIndex(_inventoryChampionOrdinal)].getSlot(kDMSlotActionHand);
- _panelContent = k0_PanelContentFoodWaterPoisoned;
+ _panelContent = kDMPanelContentFoodWaterPoisoned;
switch (thing.getType()) {
case kDMThingTypeContainer:
- _panelContent = k4_PanelContentChest;
+ _panelContent = kDMPanelContentChest;
break;
case kDMThingTypeScroll:
- _panelContent = k2_PanelContentScroll;
+ _panelContent = kDMPanelContentScroll;
break;
default:
thing = Thing::_none;
@@ -302,7 +302,7 @@ void InventoryMan::drawPanelScrollTextLine(int16 yPos, char *text) {
else if (*iter >= '{') // this branch is CHANGE5_03_IMPROVEMENT
*iter -= 96;
}
- _vm->_textMan->printToViewport(162 - (6 * strlen(text) / 2), yPos, k0_ColorBlack, text, k15_ColorWhite);
+ _vm->_textMan->printToViewport(162 - (6 * strlen(text) / 2), yPos, kDMColorBlack, text, kDMColorWhite);
}
void InventoryMan::drawPanelScroll(Scroll *scroll) {
@@ -315,8 +315,8 @@ void InventoryMan::drawPanelScroll(Scroll *scroll) {
charRed++;
*charRed = '\0';
- dispMan.blitToViewport(_vm->_displayMan->getNativeBitmapOrGraphic(k23_PanelOpenScrollIndice),
- _boxPanel, k72_byteWidth, k8_ColorRed, 73);
+ dispMan.blitToViewport(_vm->_displayMan->getNativeBitmapOrGraphic(kDMGraphicIdxPanelOpenScroll),
+ _boxPanel, k72_byteWidth, kDMColorRed, 73);
int16 lineCount = 1;
charRed++;
char *charGreen = charRed; // first char of the second line
@@ -365,10 +365,10 @@ void InventoryMan::openAndDrawChest(Thing thingToOpen, Container *chest, bool is
_openChest = thingToOpen;
if (!isPressingEye) {
- objMan.drawIconInSlotBox(k9_SlotBoxInventoryActionHand, kDMIconIndiceContainerChestOpen);
+ objMan.drawIconInSlotBox(kDMSlotBoxInventoryActionHand, kDMIconIndiceContainerChestOpen);
}
- dispMan.blitToViewport(_vm->_displayMan->getNativeBitmapOrGraphic(k25_PanelOpenChestIndice),
- _boxPanel, k72_byteWidth, k8_ColorRed, 73);
+ dispMan.blitToViewport(_vm->_displayMan->getNativeBitmapOrGraphic(kDMGraphicIdxPanelOpenChest),
+ _boxPanel, k72_byteWidth, kDMColorRed, 73);
int16 chestSlotIndex = 0;
Thing thing = chest->getSlot();
int16 thingCount = 0;
@@ -376,12 +376,12 @@ void InventoryMan::openAndDrawChest(Thing thingToOpen, Container *chest, bool is
if (++thingCount > 8)
break; // CHANGE8_08_FIX, make sure that no more than the first 8 objects in a chest are drawn
- objMan.drawIconInSlotBox(chestSlotIndex + k38_SlotBoxChestFirstSlot, objMan.getIconIndex(thing));
+ objMan.drawIconInSlotBox(chestSlotIndex + kDMSlotBoxChestFirstSlot, objMan.getIconIndex(thing));
_chestSlots[chestSlotIndex++] = thing;
thing = _vm->_dungeonMan->getNextThing(thing);
}
while (chestSlotIndex < 8) {
- objMan.drawIconInSlotBox(chestSlotIndex + k38_SlotBoxChestFirstSlot, kDMIconIndiceNone);
+ objMan.drawIconInSlotBox(chestSlotIndex + kDMSlotBoxChestFirstSlot, kDMIconIndiceNone);
_chestSlots[chestSlotIndex++] = Thing::_none;
}
}
@@ -391,7 +391,7 @@ void InventoryMan::drawIconToViewport(IconIndice iconIndex, int16 xPos, int16 yP
Box boxIcon(xPos, xPos + 15, yPos, yPos + 15);
_vm->_objectMan->extractIconFromBitmap(iconIndex, iconBitmap);
- _vm->_displayMan->blitToViewport(iconBitmap, boxIcon, k8_byteWidth, kM1_ColorNoTransparency, 16);
+ _vm->_displayMan->blitToViewport(iconBitmap, boxIcon, k8_byteWidth, kDMColorNoTransparency, 16);
}
void InventoryMan::buildObjectAttributeString(int16 potentialAttribMask, int16 actualAttribMask, const char **attribStrings, char *destString, const char *prefixString, const char *suffixString) {
@@ -454,7 +454,7 @@ void InventoryMan::drawPanelObjectDescriptionString(const char *descString) {
severalLines = true;
}
- _vm->_textMan->printToViewport(_objDescTextXpos, _objDescTextYpos, k13_ColorLightestGray, stringLine);
+ _vm->_textMan->printToViewport(_objDescTextXpos, _objDescTextYpos, kDMColorLightestGray, stringLine);
_objDescTextYpos += 7;
if (severalLines) {
severalLines = false;
@@ -470,8 +470,8 @@ void InventoryMan::drawPanelArrowOrEye(bool pressingEye) {
static Box boxArrowOrEye(83, 98, 57, 65); // @ G0033_s_Graphic562_Box_ArrowOrEye
DisplayMan &dispMan = *_vm->_displayMan;
- dispMan.blitToViewport(_vm->_displayMan->getNativeBitmapOrGraphic(pressingEye ? k19_EyeForObjectDescriptionIndice : k18_ArrowForChestContentIndice),
- boxArrowOrEye, k8_byteWidth, k8_ColorRed, 9);
+ dispMan.blitToViewport(_vm->_displayMan->getNativeBitmapOrGraphic(pressingEye ? kDMGraphicIdxEyeForObjectDescription : kDMGraphicIdxArrowForChestContent),
+ boxArrowOrEye, k8_byteWidth, kDMColorRed, 9);
}
void InventoryMan::drawPanelObject(Thing thingToDraw, bool pressingEye) {
@@ -495,10 +495,10 @@ void InventoryMan::drawPanelObject(Thing thingToDraw, bool pressingEye) {
openAndDrawChest(thingToDraw, (Container *)rawThingPtr, pressingEye);
else {
IconIndice iconIndex = objMan.getIconIndex(thingToDraw);
- dispMan.blitToViewport(_vm->_displayMan->getNativeBitmapOrGraphic(k20_PanelEmptyIndice),
- _boxPanel, k72_byteWidth, k8_ColorRed, 73);
- dispMan.blitToViewport(_vm->_displayMan->getNativeBitmapOrGraphic(k29_ObjectDescCircleIndice),
- boxObjectDescCircle, k16_byteWidth, k12_ColorDarkestGray, 27);
+ dispMan.blitToViewport(_vm->_displayMan->getNativeBitmapOrGraphic(kDMGraphicIdxPanelEmpty),
+ _boxPanel, k72_byteWidth, kDMColorRed, 73);
+ dispMan.blitToViewport(_vm->_displayMan->getNativeBitmapOrGraphic(kDMGraphicIdxObjectDescCircle),
+ boxObjectDescCircle, k16_byteWidth, kDMColorDarkestGray, 27);
Common::String descString;
Common::String str;
@@ -525,7 +525,7 @@ void InventoryMan::drawPanelObject(Thing thingToDraw, bool pressingEye) {
descString = objMan._objectNames[iconIndex];
}
- textMan.printToViewport(134, 68, k13_ColorLightestGray, descString.c_str());
+ textMan.printToViewport(134, 68, kDMColorLightestGray, descString.c_str());
drawIconToViewport(iconIndex, 111, 59);
@@ -535,7 +535,7 @@ void InventoryMan::drawPanelObject(Thing thingToDraw, bool pressingEye) {
uint16 actualAttribMask = 0;
switch (thingType) {
case kDMThingTypeWeapon: {
- potentialAttribMask = k0x0008_DescriptionMaskCursed | k0x0002_DescriptionMaskPoisoned | k0x0004_DescriptionMaskBroken;
+ potentialAttribMask = kDMDescriptionMaskCursed | kDMDescriptionMaskPoisoned | kDMDescriptionMaskBroken;
Weapon *weapon = (Weapon *)rawThingPtr;
actualAttribMask = (weapon->getCursed() << 3) | (weapon->getPoisoned() << 1) | (weapon->getBroken() << 2);
if ((iconIndex >= kDMIconIndiceWeaponTorchUnlit)
@@ -558,13 +558,13 @@ void InventoryMan::drawPanelObject(Thing thingToDraw, bool pressingEye) {
break;
}
case kDMThingTypeArmour: {
- potentialAttribMask = k0x0008_DescriptionMaskCursed | k0x0004_DescriptionMaskBroken;
+ potentialAttribMask = kDMDescriptionMaskCursed | kDMDescriptionMaskBroken;
Armour *armour = (Armour *)rawThingPtr;
actualAttribMask = (armour->getCursed() << 3) | (armour->getBroken() << 2);
break;
}
case kDMThingTypePotion: {
- potentialAttribMask = k0x0001_DescriptionMaskConsumable;
+ potentialAttribMask = kDMDescriptionMaskConsumable;
Potion *potion = (Potion *)rawThingPtr;
actualAttribMask = _vm->_dungeonMan->_objectInfos[kDMObjectInfoIndexFirstPotion + potion->getType()].getAllowedSlots();
break;
@@ -615,7 +615,7 @@ void InventoryMan::drawPanelObject(Thing thingToDraw, bool pressingEye) {
drawPanelObjectDescriptionString(str.c_str());
} else {
Junk *junk = (Junk *)rawThingPtr;
- potentialAttribMask = k0x0001_DescriptionMaskConsumable;
+ potentialAttribMask = kDMDescriptionMaskConsumable;
actualAttribMask = _vm->_dungeonMan->_objectInfos[kDMObjectInfoIndexFirstJunk + junk->getType()].getAllowedSlots();
}
break;
@@ -801,7 +801,7 @@ void InventoryMan::drawChampionSkillsAndStatistics() {
closeChest();
uint16 championIndex = _vm->ordinalToIndex(_inventoryChampionOrdinal);
Champion *curChampion = &_vm->_championMan->_champions[championIndex];
- _vm->_displayMan->blitToViewport(_vm->_displayMan->getNativeBitmapOrGraphic(k20_PanelEmptyIndice), _boxPanel, k72_byteWidth, k8_ColorRed, 73);
+ _vm->_displayMan->blitToViewport(_vm->_displayMan->getNativeBitmapOrGraphic(kDMGraphicIdxPanelEmpty), _boxPanel, k72_byteWidth, kDMColorRed, 73);
int16 textPosY = 58;
for (uint16 idx = kDMSkillFighter; idx <= kDMSkillWizard; idx++) {
int16 skillLevel = MIN((uint16)16, _vm->_championMan->getSkillLevel(championIndex, idx | kDMIgnoreTemporaryExperience));
@@ -819,25 +819,25 @@ void InventoryMan::drawChampionSkillsAndStatistics() {
displayString = Common::String::format("%s %s", _skillLevelNames[skillLevel - 2], _vm->_championMan->_baseSkillName[idx]);
break;
}
- _vm->_textMan->printToViewport(108, textPosY, k13_ColorLightestGray, displayString.c_str());
+ _vm->_textMan->printToViewport(108, textPosY, kDMColorLightestGray, displayString.c_str());
textPosY += 7;
}
textPosY = 86;
for (uint16 idx = kDMStatStrength; idx <= kDMStatAntifire; idx++) {
- _vm->_textMan->printToViewport(108, textPosY, k13_ColorLightestGray, statisticNames[idx]);
+ _vm->_textMan->printToViewport(108, textPosY, kDMColorLightestGray, statisticNames[idx]);
int16 statisticCurrentValue = curChampion->_statistics[idx][kDMStatCurrent];
uint16 statisticMaximumValue = curChampion->_statistics[idx][kDMStatMaximum];
int16 statisticColor;
if (statisticCurrentValue < statisticMaximumValue)
- statisticColor = k8_ColorRed;
+ statisticColor = kDMColorRed;
else if (statisticCurrentValue > statisticMaximumValue)
- statisticColor = k7_ColorLightGreen;
+ statisticColor = kDMColorLightGreen;
else
- statisticColor = k13_ColorLightestGray;
+ statisticColor = kDMColorLightestGray;
_vm->_textMan->printToViewport(174, textPosY, (Color)statisticColor, _vm->_championMan->getStringFromInteger(statisticCurrentValue, true, 3).c_str());
Common::String displayString = "/" + _vm->_championMan->getStringFromInteger(statisticMaximumValue, true, 3);
- _vm->_textMan->printToViewport(192, textPosY, k13_ColorLightestGray, displayString.c_str());
+ _vm->_textMan->printToViewport(192, textPosY, kDMColorLightestGray, displayString.c_str());
textPosY += 7;
}
}
@@ -877,7 +877,7 @@ void InventoryMan::clickOnMouth() {
};
if (_vm->_championMan->_leaderEmptyHanded) {
- if (_panelContent == k0_PanelContentFoodWaterPoisoned)
+ if (_panelContent == kDMPanelContentFoodWaterPoisoned)
return;
_vm->_eventMan->_ignoreMouseMovements = true;
@@ -957,8 +957,8 @@ void InventoryMan::clickOnMouth() {
curChampion->_shieldDefense += adjustedPotionPower;
TimelineEvent newEvent;
- newEvent._type = k72_TMEventTypeChampionShield;
- _vm->setMapAndTime(newEvent._mapTime, _vm->_dungeonMan->_partyMapIndex, _vm->_gameTime + (adjustedPotionPower * adjustedPotionPower));
+ newEvent._type = kDMEventTypeChampionShield;
+ newEvent._mapTime = _vm->setMapAndTime(_vm->_dungeonMan->_partyMapIndex, _vm->_gameTime + (adjustedPotionPower * adjustedPotionPower));
newEvent._priority = championIndex;
newEvent._Bu._defense = adjustedPotionPower;
_vm->_timeline->addEventGetEventIndex(&newEvent);
@@ -1018,10 +1018,10 @@ void InventoryMan::clickOnMouth() {
_vm->_championMan->_champions[_vm->_championMan->_leaderIndex]._load += _vm->_dungeonMan->getObjectWeight(handThing) - handThingWeight;
setFlag(_vm->_championMan->_champions[_vm->_championMan->_leaderIndex]._attributes, kDMAttributeLoad);
}
- _vm->_sound->requestPlay(k08_soundSWALLOW, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, kDMSoundModePlayImmediately);
+ _vm->_sound->requestPlay(kDMSoundIndexSwallow, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, kDMSoundModePlayImmediately);
setFlag(curChampion->_attributes, kDMAttributeStatistics);
- if (_panelContent == k0_PanelContentFoodWaterPoisoned)
+ if (_panelContent == kDMPanelContentFoodWaterPoisoned)
setFlag(curChampion->_attributes, kDMAttributePanel);
_vm->_championMan->drawChampionState((ChampionIndex)championIndex);
diff --git a/engines/dm/inventory.h b/engines/dm/inventory.h
index c4685575c2..92013fd0e7 100644
--- a/engines/dm/inventory.h
+++ b/engines/dm/inventory.h
@@ -35,21 +35,22 @@
namespace DM {
-#define k0x0001_DescriptionMaskConsumable 0x0001 // @ MASK0x0001_DESCRIPTION_CONSUMABLE
-#define k0x0002_DescriptionMaskPoisoned 0x0002 // @ MASK0x0002_DESCRIPTION_POISONED
-#define k0x0004_DescriptionMaskBroken 0x0004 // @ MASK0x0004_DESCRIPTION_BROKEN
-#define k0x0008_DescriptionMaskCursed 0x0008 // @ MASK0x0008_DESCRIPTION_CURSED
-
-#define k69_ChampionStatusBoxSpacing 69 // @ C69_CHAMPION_STATUS_BOX_SPACING
-#define k38_SlotBoxChestFirstSlot 38 // @ C38_SLOT_BOX_CHEST_FIRST_SLOT
+enum DescriptionMask {
+ kDMDescriptionMaskConsumable = 0x0001, // @ MASK0x0001_DESCRIPTION_CONSUMABLE
+ kDMDescriptionMaskPoisoned = 0x0002, // @ MASK0x0002_DESCRIPTION_POISONED
+ kDMDescriptionMaskBroken = 0x0004, // @ MASK0x0004_DESCRIPTION_BROKEN
+ kDMDescriptionMaskCursed = 0x0008 // @ MASK0x0008_DESCRIPTION_CURSED
+};
enum PanelContent {
- k0_PanelContentFoodWaterPoisoned = 0, // @ C00_PANEL_FOOD_WATER_POISONED
- k2_PanelContentScroll = 2, // @ C02_PANEL_SCROLL
- k4_PanelContentChest = 4, // @ C04_PANEL_CHEST
- k5_PanelContentResurrectReincarnate = 5 // @ C05_PANEL_RESURRECT_REINCARNATE
+ kDMPanelContentFoodWaterPoisoned = 0, // @ C00_PANEL_FOOD_WATER_POISONED
+ kDMPanelContentScroll = 2, // @ C02_PANEL_SCROLL
+ kDMPanelContentChest = 4, // @ C04_PANEL_CHEST
+ kDMPanelContentResurrectReincarnate = 5 // @ C05_PANEL_RESURRECT_REINCARNATE
};
+#define kDMChampionStatusBoxSpacing 69 // @ C69_CHAMPION_STATUS_BOX_SPACING
+
class InventoryMan {
DMEngine *_vm;
@@ -59,7 +60,7 @@ public:
explicit InventoryMan(DMEngine *vm);
int16 _inventoryChampionOrdinal; // @ G0423_i_InventoryChampionOrdinal
- PanelContent _panelContent; // @ G0424_i_PanelContent
+ PanelContent _panelContent; // @ G0424_i_PanelContent
Thing _chestSlots[8]; // @ G0425_aT_ChestSlots
Thing _openChest; // @ G0426_T_OpenChest
int16 _objDescTextXpos; // @ G0421_i_ObjectDescriptionTextX
@@ -70,7 +71,7 @@ public:
void toggleInventory(ChampionIndex championIndex); // @ F0355_INVENTORY_Toggle_CPSE
void drawStatusBoxPortrait(ChampionIndex championIndex); // @ F0354_INVENTORY_DrawStatusBoxPortrait
void drawPanelHorizontalBar(int16 x, int16 y, int16 pixelWidth, Color color); // @ F0343_INVENTORY_DrawPanel_HorizontalBar
- void drawPanelFoodOrWaterBar(int16 amount, int16 y, Color color); // @ F0344_INVENTORY_DrawPanel_FoodOrWaterBar
+ void drawPanelFoodOrWaterBar(int16 amount, int16 y, Color color); // @ F0344_INVENTORY_DrawPanel_FoodOrWaterBar
void drawPanelFoodWaterPoisoned(); // @ F0345_INVENTORY_DrawPanel_FoodWaterPoisoned
void drawPanelResurrectReincarnate(); // @ F0346_INVENTORY_DrawPanel_ResurrectReincarnate
void drawPanel(); // @ F0347_INVENTORY_DrawPanel
@@ -93,7 +94,6 @@ public:
void adjustStatisticCurrentValue(Champion *champ, uint16 statIndex, int16 valueDelta); // @ F0348_INVENTORY_AdjustStatisticCurrentValue
void clickOnEye(); // @ F0352_INVENTORY_ProcessCommand71_ClickOnEye
};
-
}
#endif
diff --git a/engines/dm/loadsave.cpp b/engines/dm/loadsave.cpp
index a0b1190ae2..111280c958 100644
--- a/engines/dm/loadsave.cpp
+++ b/engines/dm/loadsave.cpp
@@ -43,7 +43,7 @@
namespace DM {
LoadgameResult DMEngine::loadgame(int16 slot) {
- if (slot == -1 && _newGameFl == k0_modeLoadSavedGame)
+ if (slot == -1 && _gameMode == kDMModeLoadSavedGame)
return kDMLoadgameFailure;
bool fadePalette = true;
@@ -56,24 +56,19 @@ LoadgameResult DMEngine::loadgame(int16 slot) {
int32 _saveVersion;
OriginalSaveFormat _saveFormat;
OriginalSavePlatform _savePlatform;
-
- int32 _gameId;
uint16 _dungeonId;
} dmSaveHeader;
- if (!_newGameFl) {
- fileName = getSavefileName(slot);
- saveFileManager = _system->getSavefileManager();
- file = saveFileManager->openForLoading(fileName);
- }
-
- if (_newGameFl) {
+ if (_gameMode != kDMModeLoadSavedGame) {
//L1366_B_FadePalette = !F0428_DIALOG_RequireGameDiskInDrive_NoDialogDrawn(C0_DO_NOT_FORCE_DIALOG_DM_CSB, true);
_restartGameAllowed = false;
_championMan->_partyChampionCount = 0;
_championMan->_leaderHandObject = Thing::_none;
- _gameId = ((int32)getRandomNumber(65536)) * getRandomNumber(65536);
} else {
+ fileName = getSavefileName(slot);
+ saveFileManager = _system->getSavefileManager();
+ file = saveFileManager->openForLoading(fileName);
+
SaveGameHeader header;
readSaveGameHeader(file, &header);
@@ -83,10 +78,10 @@ LoadgameResult DMEngine::loadgame(int16 slot) {
dmSaveHeader._saveVersion = file->readSint32BE();
dmSaveHeader._saveFormat = (OriginalSaveFormat)file->readSint32BE();
dmSaveHeader._savePlatform = (OriginalSavePlatform)file->readSint32BE();
- dmSaveHeader._gameId = file->readSint32BE();
- dmSaveHeader._dungeonId = file->readUint16BE();
- _gameId = dmSaveHeader._gameId;
+ // Skip _gameId, which was useless
+ file->readSint32BE();
+ dmSaveHeader._dungeonId = file->readUint16BE();
_gameTime = file->readSint32BE();
// G0349_ul_LastRandomNumber = L1371_s_GlobalData.LastRandomNumber;
@@ -121,37 +116,36 @@ LoadgameResult DMEngine::loadgame(int16 slot) {
// read sentinel
uint32 sentinel = file->readUint32BE();
assert(sentinel == 0x6f85e3d3);
+
+ _dungeonId = dmSaveHeader._dungeonId;
}
_dungeonMan->loadDungeonFile(file);
delete file;
- if (_newGameFl) {
+ if (_gameMode != kDMModeLoadSavedGame) {
_timeline->initTimeline();
_groupMan->initActiveGroups();
if (fadePalette) {
_displayMan->startEndFadeToPalette(_displayMan->_blankBuffer);
delay(1);
- _displayMan->fillScreen(k0_ColorBlack);
+ _displayMan->fillScreen(kDMColorBlack);
_displayMan->startEndFadeToPalette(_displayMan->_paletteTopAndBottomScreen);
}
} else {
- _dungeonId = dmSaveHeader._dungeonId;
-
_restartGameAllowed = true;
switch (getGameLanguage()) { // localized
- default:
- case Common::EN_ANY:
- _dialog->dialogDraw(nullptr, "LOADING GAME . . .", nullptr, nullptr, nullptr, nullptr, true, true, true);
- break;
case Common::DE_DEU:
_dialog->dialogDraw(nullptr, "SPIEL WIRD GELADEN . . .", nullptr, nullptr, nullptr, nullptr, true, true, true);
break;
case Common::FR_FRA:
_dialog->dialogDraw(nullptr, "CHARGEMENT DU JEU . . .", nullptr, nullptr, nullptr, nullptr, true, true, true);
break;
+ default:
+ _dialog->dialogDraw(nullptr, "LOADING GAME . . .", nullptr, nullptr, nullptr, nullptr, true, true, true);
+ break;
}
}
_championMan->_partyDead = false;
@@ -189,6 +183,7 @@ void DMEngine::saveGame() {
if (saveAndPlayChoice == kLoad) {
GUI::SaveLoadChooser *dialog = new GUI::SaveLoadChooser(_("Restore game:"), _("Restore"), false);
int loadSlot = dialog->runModalWithCurrentTarget();
+ delete dialog;
if (loadSlot >= 0) {
_loadSaveSlotAtRuntime = loadSlot;
return;
@@ -298,7 +293,9 @@ bool DMEngine::writeCompleteSaveFile(int16 saveSlot, Common::String& saveDescrip
file->writeSint32BE(1); // save version
file->writeSint32BE(_gameVersion->_origSaveFormatToWrite);
file->writeSint32BE(_gameVersion->_origPlatformToWrite);
- file->writeSint32BE(_gameId);
+
+ // Was _gameID, useless.
+ file->writeSint32BE(0);
file->writeUint16BE(_dungeonId);
// write C0_SAVE_PART_GLOBAL_DATA part
diff --git a/engines/dm/loadsave.h b/engines/dm/loadsave.h
index ca8f4d6369..4f77726434 100644
--- a/engines/dm/loadsave.h
+++ b/engines/dm/loadsave.h
@@ -36,9 +36,7 @@ class LoadsaveMan {
DMEngine *_vm;
public:
explicit LoadsaveMan(DMEngine *vm);
-
};
-
}
#endif
diff --git a/engines/dm/menus.cpp b/engines/dm/menus.cpp
index faf61393ce..bfe9c35101 100644
--- a/engines/dm/menus.cpp
+++ b/engines/dm/menus.cpp
@@ -163,12 +163,13 @@ MenuMan::MenuMan(DMEngine *vm) : _vm(vm) {
MenuMan::~MenuMan() {
delete[] _bitmapSpellAreaLine;
+ delete[] _bitmapSpellAreaLines;
}
void MenuMan::drawMovementArrows() {
_vm->_eventMan->showMouse();
- _vm->_displayMan->blitToScreen(_vm->_displayMan->getNativeBitmapOrGraphic(k13_MovementArrowsIndice),
- &_vm->_displayMan->_boxMovementArrows, k48_byteWidth, kM1_ColorNoTransparency, 45);
+ _vm->_displayMan->blitToScreen(_vm->_displayMan->getNativeBitmapOrGraphic(kDMGraphicIdxMovementArrows),
+ &_vm->_displayMan->_boxMovementArrows, k48_byteWidth, kDMColorNoTransparency, 45);
_vm->_eventMan->hideMouse();
}
void MenuMan::clearActingChampion() {
@@ -191,13 +192,13 @@ void MenuMan::drawActionIcon(ChampionIndex championIndex) {
Champion &champion = _vm->_championMan->_champions[championIndex];
Box box;
- box._x1 = championIndex * 22 + 233;
- box._x2 = box._x1 + 19;
- box._y1 = 86;
- box._y2 = 120;
+ box._rect.left = championIndex * 22 + 233;
+ box._rect.right = box._rect.left + 19;
+ box._rect.top = 86;
+ box._rect.bottom = 120;
dm._useByteBoxCoordinates = false;
if (!champion._currHealth) {
- dm.fillScreenBox(box, k0_ColorBlack);
+ dm.fillScreenBox(box, kDMColorBlack);
return;
}
byte *bitmapIcon = dm._tmpBitmap;
@@ -208,21 +209,21 @@ void MenuMan::drawActionIcon(ChampionIndex championIndex) {
} else if (_vm->_dungeonMan->_objectInfos[_vm->_dungeonMan->getObjectInfoIndex(thing)]._actionSetIndex) {
iconIndex = _vm->_objectMan->getIconIndex(thing);
} else {
- dm.fillBitmap(bitmapIcon, k4_ColorCyan, 16, 16);
+ dm.fillBitmap(bitmapIcon, kDMColorCyan, 16, 16);
goto T0386006;
}
_vm->_objectMan->extractIconFromBitmap(iconIndex, bitmapIcon);
dm.blitToBitmapShrinkWithPalChange(bitmapIcon, bitmapIcon, 16, 16, 16, 16, palChangesActionAreaObjectIcon);
T0386006:
- dm.fillScreenBox(box, k4_ColorCyan);
+ dm.fillScreenBox(box, kDMColorCyan);
Box box2;
- box2._x1 = box._x1 + 2;
- box2._x2 = box._x2 - 2;
- box2._y1 = 95;
- box2._y2 = 110;
- dm.blitToScreen(bitmapIcon, &box2, k8_byteWidth, kM1_ColorNoTransparency, 16);
+ box2._rect.left = box._rect.left + 2;
+ box2._rect.right = box._rect.right - 2;
+ box2._rect.top = 95;
+ box2._rect.bottom = 110;
+ dm.blitToScreen(bitmapIcon, &box2, k8_byteWidth, kDMColorNoTransparency, 16);
if (champion.getAttributes(kDMAttributeDisableAction) || _vm->_championMan->_candidateChampionOrdinal || _vm->_championMan->_partyIsSleeping) {
- _vm->_displayMan->shadeScreenBox(&box, k0_ColorBlack);
+ _vm->_displayMan->shadeScreenBox(&box, kDMColorBlack);
}
}
@@ -231,14 +232,14 @@ void MenuMan::drawDisabledMenu() {
_vm->_eventMan->highlightBoxDisable();
_vm->_displayMan->_useByteBoxCoordinates = false;
if (_vm->_inventoryMan->_inventoryChampionOrdinal) {
- if (_vm->_inventoryMan->_panelContent == k4_PanelContentChest) {
+ if (_vm->_inventoryMan->_panelContent == kDMPanelContentChest) {
_vm->_inventoryMan->closeChest();
}
} else {
- _vm->_displayMan->shadeScreenBox(&_vm->_displayMan->_boxMovementArrows, k0_ColorBlack);
+ _vm->_displayMan->shadeScreenBox(&_vm->_displayMan->_boxMovementArrows, kDMColorBlack);
}
- _vm->_displayMan->shadeScreenBox(&_boxSpellArea, k0_ColorBlack);
- _vm->_displayMan->shadeScreenBox(&_boxActionArea, k0_ColorBlack);
+ _vm->_displayMan->shadeScreenBox(&_boxSpellArea, kDMColorBlack);
+ _vm->_displayMan->shadeScreenBox(&_boxActionArea, kDMColorBlack);
_vm->_eventMan->setMousePointerToNormal(k0_pointerArrow);
}
}
@@ -305,7 +306,7 @@ void MenuMan::drawActionArea() {
_vm->_eventMan->hideMouse();
dispMan._useByteBoxCoordinates = false;
- dispMan.fillScreenBox(_boxActionArea, k0_ColorBlack);
+ dispMan.fillScreenBox(_boxActionArea, kDMColorBlack);
if (_actionAreaContainsIcons) {
for (uint16 champIndex = kDMChampionFirst; champIndex < champMan._partyChampionCount; ++champIndex)
drawActionIcon((ChampionIndex)champIndex);
@@ -315,13 +316,13 @@ void MenuMan::drawActionArea() {
box = _boxActionArea2ActionMenu;
if (_actionList._actionIndices[1] == kDMActionNone)
box = _boxActionArea1ActionMenu;
- dispMan.blitToScreen(_vm->_displayMan->getNativeBitmapOrGraphic(k10_MenuActionAreaIndice),
- &box, k48_byteWidth, kM1_ColorNoTransparency, 45);
+ dispMan.blitToScreen(_vm->_displayMan->getNativeBitmapOrGraphic(kDMGraphicIdxMenuActionArea),
+ &box, k48_byteWidth, kDMColorNoTransparency, 45);
textMan.printWithTrailingSpaces(dispMan._bitmapScreen, k160_byteWidthScreen,
- 235, 83, k0_ColorBlack, k4_ColorCyan, champMan._champions[_vm->ordinalToIndex(champMan._actingChampionOrdinal)]._name,
+ 235, 83, kDMColorBlack, kDMColorCyan, champMan._champions[_vm->ordinalToIndex(champMan._actingChampionOrdinal)]._name,
k7_ChampionNameMaximumLength, k200_heightScreen);
for (uint16 actionListIndex = 0; actionListIndex < 3; actionListIndex++) {
- textMan.printWithTrailingSpaces(dispMan._bitmapScreen, k160_byteWidthScreen, 241, 93 + actionListIndex * 12, k4_ColorCyan, k0_ColorBlack,
+ textMan.printWithTrailingSpaces(dispMan._bitmapScreen, k160_byteWidthScreen, 241, 93 + actionListIndex * 12, kDMColorCyan, kDMColorBlack,
getActionName(_actionList._actionIndices[actionListIndex]),
k12_ActionNameMaximumLength, k200_heightScreen);
}
@@ -355,12 +356,12 @@ void MenuMan::drawSpellAreaControls(ChampionIndex champIndex) {
int16 champHP2 = _vm->_championMan->_champions[2]._currHealth;
int16 champHP3 = _vm->_championMan->_champions[3]._currHealth;
_vm->_eventMan->showMouse();
- _vm->_displayMan->fillScreenBox(boxSpellAreaControls, k0_ColorBlack);
+ _vm->_displayMan->fillScreenBox(boxSpellAreaControls, kDMColorBlack);
switch (champIndex) {
case 0:
_vm->_eventMan->highlightScreenBox(233, 277, 42, 49);
- _vm->_textMan->printToLogicalScreen(235, 48, k0_ColorBlack, k4_ColorCyan, champ->_name);
+ _vm->_textMan->printToLogicalScreen(235, 48, kDMColorBlack, kDMColorCyan, champ->_name);
if (_vm->_championMan->_partyChampionCount > 1) {
if (champHP1)
_vm->_eventMan->highlightScreenBox(280, 291, 42, 48);
@@ -379,7 +380,7 @@ void MenuMan::drawSpellAreaControls(ChampionIndex champIndex) {
_vm->_eventMan->highlightScreenBox(233, 244, 42, 48);
_vm->_eventMan->highlightScreenBox(247, 291, 42, 49);
- _vm->_textMan->printToLogicalScreen(249, 48, k0_ColorBlack, k4_ColorCyan, champ->_name);
+ _vm->_textMan->printToLogicalScreen(249, 48, kDMColorBlack, kDMColorCyan, champ->_name);
if (_vm->_championMan->_partyChampionCount > 2) {
if (champHP2)
_vm->_eventMan->highlightScreenBox(294, 305, 42, 48);
@@ -396,7 +397,7 @@ void MenuMan::drawSpellAreaControls(ChampionIndex champIndex) {
_vm->_eventMan->highlightScreenBox(247, 258, 42, 48);
_vm->_eventMan->highlightScreenBox(261, 305, 42, 49);
- _vm->_textMan->printToLogicalScreen(263, 48, k0_ColorBlack, k4_ColorCyan, champ->_name);
+ _vm->_textMan->printToLogicalScreen(263, 48, kDMColorBlack, kDMColorCyan, champ->_name);
if ((_vm->_championMan->_partyChampionCount > 3) && champHP3)
_vm->_eventMan->highlightScreenBox(308, 319, 42, 48);
break;
@@ -412,7 +413,7 @@ void MenuMan::drawSpellAreaControls(ChampionIndex champIndex) {
_vm->_eventMan->highlightScreenBox(261, 272, 42, 48);
_vm->_eventMan->highlightScreenBox(275, 319, 42, 49);
- _vm->_textMan->printToLogicalScreen(277, 48, k0_ColorBlack, k4_ColorCyan, champ->_name);
+ _vm->_textMan->printToLogicalScreen(277, 48, kDMColorBlack, kDMColorCyan, champ->_name);
break;
default:
break;
@@ -425,25 +426,25 @@ void MenuMan::buildSpellAreaLine(int16 spellAreaBitmapLine) {
char spellSymbolString[2] = {'\0', '\0'};
Champion *magicChampion = &_vm->_championMan->_champions[_vm->_championMan->_magicCasterChampionIndex];
- if (spellAreaBitmapLine == k2_SpellAreaAvailableSymbols) {
+ if (spellAreaBitmapLine == kDMSpellAreaAvailableSymbols) {
_vm->_displayMan->_useByteBoxCoordinates = false;
- _vm->_displayMan->blitToBitmap(_bitmapSpellAreaLines, _bitmapSpellAreaLine, boxSpellAreaLine, 0, 12, k48_byteWidth, k48_byteWidth, kM1_ColorNoTransparency, 36, 12);
+ _vm->_displayMan->blitToBitmap(_bitmapSpellAreaLines, _bitmapSpellAreaLine, boxSpellAreaLine, 0, 12, k48_byteWidth, k48_byteWidth, kDMColorNoTransparency, 36, 12);
int16 x = 1;
char character = 96 + (6 * magicChampion->_symbolStep);
for (uint16 symbolIndex = 0; symbolIndex < 6; symbolIndex++) {
spellSymbolString[0] = character++;
x += 14;
- _vm->_textMan->printTextToBitmap(_bitmapSpellAreaLine, 48, x, 8, k4_ColorCyan, k0_ColorBlack, spellSymbolString, 12);
+ _vm->_textMan->printTextToBitmap(_bitmapSpellAreaLine, 48, x, 8, kDMColorCyan, kDMColorBlack, spellSymbolString, 12);
}
- } else if (spellAreaBitmapLine == k3_SpellAreaChampionSymbols) {
+ } else if (spellAreaBitmapLine == kDMSpellAreaChampionSymbols) {
_vm->_displayMan->_useByteBoxCoordinates = false;
- _vm->_displayMan->blitToBitmap(_bitmapSpellAreaLines, _bitmapSpellAreaLine, boxSpellAreaLine, 0, 24, k48_byteWidth, k48_byteWidth, kM1_ColorNoTransparency, 36, 12);
+ _vm->_displayMan->blitToBitmap(_bitmapSpellAreaLines, _bitmapSpellAreaLine, boxSpellAreaLine, 0, 24, k48_byteWidth, k48_byteWidth, kDMColorNoTransparency, 36, 12);
int16 x = 8;
for (uint16 symbolIndex = 0; symbolIndex < 4; symbolIndex++) {
if ((spellSymbolString[0] = magicChampion->_symbols[symbolIndex]) == '\0')
break;
x += 9;
- _vm->_textMan->printTextToBitmap(_bitmapSpellAreaLine, 48, x, 8, k4_ColorCyan, k0_ColorBlack, spellSymbolString, 12);
+ _vm->_textMan->printTextToBitmap(_bitmapSpellAreaLine, 48, x, 8, kDMColorCyan, kDMColorBlack, spellSymbolString, 12);
}
}
}
@@ -458,24 +459,24 @@ void MenuMan::setMagicCasterAndDrawSpellArea(ChampionIndex champIndex) {
if (_vm->_championMan->_magicCasterChampionIndex == kDMChampionNone) {
_vm->_eventMan->showMouse();
- _vm->_displayMan->blitToScreen(_vm->_displayMan->getNativeBitmapOrGraphic(k9_MenuSpellAreaBackground), &_boxSpellArea, k48_byteWidth, kM1_ColorNoTransparency, 33);
+ _vm->_displayMan->blitToScreen(_vm->_displayMan->getNativeBitmapOrGraphic(kDMGraphicIdxMenuSpellAreaBackground), &_boxSpellArea, k48_byteWidth, kDMColorNoTransparency, 33);
_vm->_eventMan->hideMouse();
}
if (champIndex == kDMChampionNone) {
_vm->_championMan->_magicCasterChampionIndex = kDMChampionNone;
_vm->_eventMan->showMouse();
_vm->_displayMan->_useByteBoxCoordinates = false;
- _vm->_displayMan->fillScreenBox(_boxSpellArea, k0_ColorBlack);
+ _vm->_displayMan->fillScreenBox(_boxSpellArea, kDMColorBlack);
_vm->_eventMan->hideMouse();
return;
}
_vm->_championMan->_magicCasterChampionIndex = champIndex;
- buildSpellAreaLine(k2_SpellAreaAvailableSymbols);
+ buildSpellAreaLine(kDMSpellAreaAvailableSymbols);
_vm->_eventMan->showMouse();
drawSpellAreaControls(champIndex);
- _vm->_displayMan->blitToScreen(_bitmapSpellAreaLine, &boxSpellAreaLine2, k48_byteWidth, kM1_ColorNoTransparency, 12);
- buildSpellAreaLine(k3_SpellAreaChampionSymbols);
- _vm->_displayMan->blitToScreen(_bitmapSpellAreaLine, &boxSpellAreaLine3, k48_byteWidth, kM1_ColorNoTransparency, 12);
+ _vm->_displayMan->blitToScreen(_bitmapSpellAreaLine, &boxSpellAreaLine2, k48_byteWidth, kDMColorNoTransparency, 12);
+ buildSpellAreaLine(kDMSpellAreaChampionSymbols);
+ _vm->_displayMan->blitToScreen(_bitmapSpellAreaLine, &boxSpellAreaLine3, k48_byteWidth, kDMColorNoTransparency, 12);
_vm->_eventMan->hideMouse();
}
@@ -606,24 +607,24 @@ int16 MenuMan::getChampionSpellCastResult(uint16 champIndex) {
}
break;
case kDMSpellTypeOtherThievesEye: {
- newEvent._type = k73_TMEventTypeThievesEye;
+ newEvent._type = kDMEventTypeThievesEye;
_vm->_championMan->_party._event73Count_ThievesEye++;
spellPower = (spellPower >> 1);
uint16 spellTicks = spellPower * spellPower;
- _vm->setMapAndTime(newEvent._mapTime, _vm->_dungeonMan->_partyMapIndex, _vm->_gameTime + spellTicks);
+ newEvent._mapTime = _vm->setMapAndTime(_vm->_dungeonMan->_partyMapIndex, _vm->_gameTime + spellTicks);
_vm->_timeline->addEventGetEventIndex(&newEvent);
}
break;
case kDMSpellTypeOtherInvisibility: {
- newEvent._type = k71_TMEventTypeInvisibility;
+ newEvent._type = kDMEventTypeInvisibility;
_vm->_championMan->_party._event71Count_Invisibility++;
uint16 spellTicks = spellPower;
- _vm->setMapAndTime(newEvent._mapTime, _vm->_dungeonMan->_partyMapIndex, _vm->_gameTime + spellTicks);
+ newEvent._mapTime = _vm->setMapAndTime(_vm->_dungeonMan->_partyMapIndex, _vm->_gameTime + spellTicks);
_vm->_timeline->addEventGetEventIndex(&newEvent);
}
break;
case kDMSpellTypeOtherPartyShield: {
- newEvent._type = k74_TMEventTypePartyShield;
+ newEvent._type = kDMEventTypePartyShield;
newEvent._Bu._defense = spellPower;
if (_vm->_championMan->_party._shieldDefense > 50)
newEvent._Bu._defense >>= 2;
@@ -631,12 +632,12 @@ int16 MenuMan::getChampionSpellCastResult(uint16 champIndex) {
_vm->_championMan->_party._shieldDefense += newEvent._Bu._defense;
_vm->_timeline->refreshAllChampionStatusBoxes();
uint16 spellTicks = spellPower * spellPower;
- _vm->setMapAndTime(newEvent._mapTime, _vm->_dungeonMan->_partyMapIndex, _vm->_gameTime + spellTicks);
+ newEvent._mapTime = _vm->setMapAndTime(_vm->_dungeonMan->_partyMapIndex, _vm->_gameTime + spellTicks);
_vm->_timeline->addEventGetEventIndex(&newEvent);
}
break;
case kDMSpellTypeOtherFootprints: {
- newEvent._type = k79_TMEventTypeFootprints;
+ newEvent._type = kDMEventTypeFootprints;
_vm->_championMan->_party._event79Count_Footprints++;
_vm->_championMan->_party._firstScentIndex = _vm->_championMan->_party._scentCount;
if (powerSymbolOrdinal < 3)
@@ -645,7 +646,7 @@ int16 MenuMan::getChampionSpellCastResult(uint16 champIndex) {
_vm->_championMan->_party._lastScentIndex = 0;
uint16 spellTicks = spellPower * spellPower;
- _vm->setMapAndTime(newEvent._mapTime, _vm->_dungeonMan->_partyMapIndex, _vm->_gameTime + spellTicks);
+ newEvent._mapTime = _vm->setMapAndTime(_vm->_dungeonMan->_partyMapIndex, _vm->_gameTime + spellTicks);
_vm->_timeline->addEventGetEventIndex(&newEvent);
}
break;
@@ -762,7 +763,7 @@ void MenuMan::menusPrintSpellFailureMessage(Champion *champ, uint16 failureType,
skillIndex = (skillIndex - 4) / 4;
_vm->_textMan->printLineFeed();
- _vm->_textMan->printMessage(k4_ColorCyan, champ->_name);
+ _vm->_textMan->printMessage(kDMColorCyan, champ->_name);
Common::String *messages;
switch (_vm->getGameLanguage()) { // localized
@@ -780,8 +781,8 @@ void MenuMan::menusPrintSpellFailureMessage(Champion *champ, uint16 failureType,
Common::String message;
switch (failureType) {
case kDMFailureNeedsMorePractice:
- _vm->_textMan->printMessage(k4_ColorCyan, messages[0].c_str());
- _vm->_textMan->printMessage(k4_ColorCyan, _vm->_championMan->_baseSkillName[skillIndex]);
+ _vm->_textMan->printMessage(kDMColorCyan, messages[0].c_str());
+ _vm->_textMan->printMessage(kDMColorCyan, _vm->_championMan->_baseSkillName[skillIndex]);
if (_vm->getGameLanguage() != Common::FR_FRA || skillIndex == kDMSkillWizard)
message = messages[1];
else
@@ -797,7 +798,7 @@ void MenuMan::menusPrintSpellFailureMessage(Champion *champ, uint16 failureType,
default:
break;
}
- _vm->_textMan->printMessage(k4_ColorCyan, message.c_str());
+ _vm->_textMan->printMessage(kDMColorCyan, message.c_str());
}
Potion *MenuMan::getEmptyFlaskInHand(Champion *champ, Thing *potionThing) {
@@ -813,9 +814,9 @@ Potion *MenuMan::getEmptyFlaskInHand(Champion *champ, Thing *potionThing) {
void MenuMan::createEvent70_light(int16 lightPower, int16 ticks) {
TimelineEvent newEvent;
- newEvent._type = k70_TMEventTypeLight;
+ newEvent._type = kDMEventTypeLight;
newEvent._Bu._lightPower = lightPower;
- _vm->setMapAndTime(newEvent._mapTime, _vm->_dungeonMan->_partyMapIndex, _vm->_gameTime + ticks);
+ newEvent._mapTime = _vm->setMapAndTime(_vm->_dungeonMan->_partyMapIndex, _vm->_gameTime + ticks);
newEvent._priority = 0;
_vm->_timeline->addEventGetEventIndex(&newEvent);
_vm->_inventoryMan->setDungeonViewPalette();
@@ -837,20 +838,20 @@ bool MenuMan::isPartySpellOrFireShieldSuccessful(Champion *champ, bool spellShie
TimelineEvent newEvent;
newEvent._Bu._defense = ticks >> 5;
if (spellShield) {
- newEvent._type = k77_TMEventTypeSpellShield;
+ newEvent._type = kDMEventTypeSpellShield;
if (_vm->_championMan->_party._spellShieldDefense > 50)
newEvent._Bu._defense >>= 2;
_vm->_championMan->_party._spellShieldDefense += newEvent._Bu._defense;
} else {
- newEvent._type = k78_TMEventTypeFireShield;
+ newEvent._type = kDMEventTypeFireShield;
if (_vm->_championMan->_party._fireShieldDefense > 50)
newEvent._Bu._defense >>= 2;
_vm->_championMan->_party._fireShieldDefense += newEvent._Bu._defense;
}
newEvent._priority = 0;
- _vm->setMapAndTime(newEvent._mapTime, _vm->_dungeonMan->_partyMapIndex, _vm->_gameTime + ticks);
+ newEvent._mapTime = _vm->setMapAndTime(_vm->_dungeonMan->_partyMapIndex, _vm->_gameTime + ticks);
_vm->_timeline->addEventGetEventIndex(&newEvent);
_vm->_timeline->refreshAllChampionStatusBoxes();
@@ -865,7 +866,7 @@ void MenuMan::drawAvailableSymbols(uint16 symbolStep) {
for (uint16 L1214_ui_Counter = 0; L1214_ui_Counter < 6; L1214_ui_Counter++) {
displayBuffer[0] = curCharacter++;
textPosX += 14;
- _vm->_textMan->printToLogicalScreen(textPosX, 58, k4_ColorCyan, k0_ColorBlack, displayBuffer);
+ _vm->_textMan->printToLogicalScreen(textPosX, 58, kDMColorCyan, kDMColorBlack, displayBuffer);
}
}
@@ -882,7 +883,7 @@ void MenuMan::drawChampionSymbols(Champion *champ) {
displayBuffer[0] = champ->_symbols[symbolIndex];
textPosX += 9;
- _vm->_textMan->printToLogicalScreen(textPosX, 70, k4_ColorCyan, k0_ColorBlack, displayBuffer);
+ _vm->_textMan->printToLogicalScreen(textPosX, 70, kDMColorCyan, kDMColorBlack, displayBuffer);
}
}
@@ -1106,10 +1107,10 @@ bool MenuMan::isActionPerformed(uint16 champIndex, int16 actionIndex) {
case kDMActionSwing:
case kDMActionChop:
if ((Square(targetSquare).getType() == kDMElementTypeDoor) && (Square(targetSquare).getDoorState() == kDMDoorStateClosed)) {
- _vm->_sound->requestPlay(k16_soundCOMBAT_ATTACK_SKELETON_ANIMATED_ARMOUR_DETH_KNIGHT, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, kDMSoundModePlayIfPrioritized);
+ _vm->_sound->requestPlay(kDMSoundIndexAttackSkelettonAnimatedArmorDethKnight, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, kDMSoundModePlayIfPrioritized);
actionDisabledTicks = 6;
_vm->_groupMan->groupIsDoorDestoryedByAttack(nextMapX, nextMapY, _vm->_championMan->getStrength(champIndex, kDMSlotActionHand), false, 2);
- _vm->_sound->requestPlay(k04_soundWOODEN_THUD_ATTACK_TROLIN_ANTMAN_STONE_GOLEM, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, kDMSoundModePlayOneTickLater);
+ _vm->_sound->requestPlay(kDMSoundIndexWoodenThudAttackTrolinAntmanStoneGolem, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, kDMSoundModePlayOneTickLater);
break;
}
case kDMActionDisrupt:
@@ -1136,15 +1137,15 @@ bool MenuMan::isActionPerformed(uint16 champIndex, int16 actionIndex) {
case kDMActionBrandish:
case kDMActionBlowHorn:
if (actionIndex == kDMActionWarCry)
- _vm->_sound->requestPlay(k28_soundWAR_CRY, nextMapX, nextMapY, kDMSoundModePlayImmediately);
+ _vm->_sound->requestPlay(kDMSoundIndexWarCry, nextMapX, nextMapY, kDMSoundModePlayImmediately);
else if (actionIndex == kDMActionBlowHorn)
- _vm->_sound->requestPlay(k25_soundBLOW_HORN, nextMapX, nextMapY, kDMSoundModePlayImmediately);
+ _vm->_sound->requestPlay(kDMSoundIndexBlowHorn, nextMapX, nextMapY, kDMSoundModePlayImmediately);
actionPerformed = isGroupFrightenedByAction(champIndex, actionIndex, nextMapX, nextMapY);
break;
case kDMActionShoot: {
if (Thing(curChampion->_slots[kDMSlotReadyHand]).getType() != kDMThingTypeWeapon) {
- _actionDamage = kM2_damageNoAmmunition;
+ _actionDamage = kDMDamageNoAmmunition;
actionExperienceGain = 0;
actionPerformed = false;
break;
@@ -1157,7 +1158,7 @@ bool MenuMan::isActionPerformed(uint16 champIndex, int16 actionIndex) {
int16 stepEnergy = actionHandWeaponClass;
if ((actionHandWeaponClass >= kDMWeaponClassFirstBow) && (actionHandWeaponClass <= kDMWeaponClassLastBow)) {
if (readyHandWeaponClass != kDMWeaponClassBowAmmunition) {
- _actionDamage = kM2_damageNoAmmunition;
+ _actionDamage = kDMDamageNoAmmunition;
actionExperienceGain = 0;
actionPerformed = false;
break;
@@ -1165,7 +1166,7 @@ bool MenuMan::isActionPerformed(uint16 champIndex, int16 actionIndex) {
stepEnergy -= kDMWeaponClassFirstBow;
} else if ((actionHandWeaponClass >= kDMWeaponClassFirstSling) && (actionHandWeaponClass <= kDMWeaponClassLastSling)) {
if (readyHandWeaponClass != kDMWeaponClassSlingAmmunition) {
- _actionDamage = kM2_damageNoAmmunition;
+ _actionDamage = kDMDamageNoAmmunition;
actionExperienceGain = 0;
actionPerformed = false;
break;
@@ -1175,7 +1176,7 @@ bool MenuMan::isActionPerformed(uint16 champIndex, int16 actionIndex) {
setChampionDirectionToPartyDirection(curChampion);
Thing removedObject = _vm->_championMan->getObjectRemovedFromSlot(champIndex, kDMSlotReadyHand);
- _vm->_sound->requestPlay(k16_soundCOMBAT_ATTACK_SKELETON_ANIMATED_ARMOUR_DETH_KNIGHT, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, kDMSoundModePlayIfPrioritized);
+ _vm->_sound->requestPlay(kDMSoundIndexAttackSkelettonAnimatedArmorDethKnight, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, kDMSoundModePlayIfPrioritized);
_vm->_championMan->championShootProjectile(curChampion, removedObject, weaponInfoActionHand->_kineticEnergy + weaponInfoReadyHand->_kineticEnergy, (weaponInfoActionHand->getShootAttack() + _vm->_championMan->getSkillLevel(champIndex, kDMSkillShoot)) << 1, stepEnergy);
}
break;
@@ -1274,8 +1275,8 @@ bool MenuMan::isActionPerformed(uint16 champIndex, int16 actionIndex) {
int16 windowTicks = _vm->getRandomNumber(_vm->_championMan->getSkillLevel(champIndex, actionSkillIndex) + 8) + 5;
TimelineEvent newEvent;
newEvent._priority = 0;
- newEvent._type = k73_TMEventTypeThievesEye;
- _vm->setMapAndTime(newEvent._mapTime, _vm->_dungeonMan->_partyMapIndex, _vm->_gameTime + windowTicks);
+ newEvent._type = kDMEventTypeThievesEye;
+ newEvent._mapTime = _vm->setMapAndTime(_vm->_dungeonMan->_partyMapIndex, _vm->_gameTime + windowTicks);
_vm->_timeline->addEventGetEventIndex(&newEvent);
_vm->_championMan->_party._event73Count_ThievesEye++;
decrementCharges(curChampion);
@@ -1482,7 +1483,7 @@ bool MenuMan::isMeleeActionPerformed(int16 champIndex, Champion *champ, int16 ac
0 /* FUSE */
};
- _vm->_sound->requestPlay(k16_soundCOMBAT_ATTACK_SKELETON_ANIMATED_ARMOUR_DETH_KNIGHT, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, kDMSoundModePlayIfPrioritized);
+ _vm->_sound->requestPlay(kDMSoundIndexAttackSkelettonAnimatedArmorDethKnight, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, kDMSoundModePlayIfPrioritized);
if (_actionTargetGroupThing == Thing::_endOfList)
return false;
@@ -1491,24 +1492,24 @@ bool MenuMan::isMeleeActionPerformed(int16 champIndex, Champion *champ, int16 ac
if (targetCreatureOrdinal) {
uint16 viewCell = _vm->normalizeModulo4(championCell + 4 - champ->_dir);
switch (viewCell) {
- case k2_ViewCellBackRight: /* Champion is on the back right of the square and tries to attack a creature in the front right of its square */
- case k3_ViewCellBackLeft: /* Champion is on the back left of the square and tries to attack a creature in the front left of its square */
- uint16 cellDelta = (viewCell == k2_ViewCellBackRight) ? 3 : 1;
+ case kDMViewCellBackRight: /* Champion is on the back right of the square and tries to attack a creature in the front right of its square */
+ case kDMViewCellBackLeft: /* Champion is on the back left of the square and tries to attack a creature in the front left of its square */
+ uint16 cellDelta = (viewCell == kDMViewCellBackRight) ? 3 : 1;
/* Check if there is another champion in front */
if (_vm->_championMan->getIndexInCell(_vm->normalizeModulo4(championCell + cellDelta)) != kDMChampionNone) {
- _actionDamage = kM1_damageCantReach;
+ _actionDamage = kDMDamageCantReach;
return false;
}
break;
}
- if ((actionIndex == kDMActionDisrupt) && !getFlag(_vm->_dungeonMan->getCreatureAttributes(_actionTargetGroupThing), k0x0040_MaskCreatureInfo_nonMaterial))
+ if ((actionIndex == kDMActionDisrupt) && !getFlag(_vm->_dungeonMan->getCreatureAttributes(_actionTargetGroupThing), kDMCreatureMaskNonMaterial))
return false;
uint16 actionHitProbability = actionHitProbabilityArray[actionIndex];
uint16 actionDamageFactor = actionDamageFactorArray[actionIndex];
if ((_vm->_objectMan->getIconIndex(champ->_slots[kDMSlotActionHand]) == kDMIconIndiceWeaponVorpalBlade) || (actionIndex == kDMActionDisrupt)) {
- setFlag(actionHitProbability, k0x8000_hitNonMaterialCreatures);
+ setFlag(actionHitProbability, kDMActionMaskHitNonMaterialCreatures);
}
_actionDamage = _vm->_groupMan->getMeleeActionDamage(champ, champIndex, (Group *)_vm->_dungeonMan->getThingData(_actionTargetGroupThing), _vm->ordinalToIndex(targetCreatureOrdinal), targetMapX, targetMapY, actionHitProbability, actionDamageFactor, skillIndex);
return true;
@@ -1551,15 +1552,15 @@ bool MenuMan::isGroupFrightenedByAction(int16 champIndex, uint16 actionIndex, in
Group *targetGroup = (Group *)_vm->_dungeonMan->getThingData(_actionTargetGroupThing);
CreatureInfo *creatureInfo = &_vm->_dungeonMan->_creatureInfos[targetGroup->_type];
uint16 fearResistance = creatureInfo->getFearResistance();
- if ((fearResistance > _vm->getRandomNumber(frightAmount)) || (fearResistance == k15_immuneToFear)) {
+ if ((fearResistance > _vm->getRandomNumber(frightAmount)) || (fearResistance == kDMImmuneToFear)) {
experience >>= 1;
} else {
ActiveGroup *activeGroup = &_vm->_groupMan->_activeGroups[targetGroup->getActiveGroupIndex()];
- if (targetGroup->getBehaviour() == k6_behavior_ATTACK) {
+ if (targetGroup->getBehaviour() == kDMBehaviorAttack) {
_vm->_groupMan->stopAttacking(activeGroup, mapX, mapY);
_vm->_groupMan->startWandering(mapX, mapY);
}
- targetGroup->setBehaviour(k5_behavior_FLEE);
+ targetGroup->setBehaviour(kDMBehaviorFlee);
activeGroup->_delayFleeingFromTarget = ((16 - fearResistance) << 2) / creatureInfo->_movementTicks;
retVal = true;
}
@@ -1593,7 +1594,7 @@ void MenuMan::printMessageAfterReplacements(const char *str) {
*curCharacter = '\0';
if (outputString[1]) /* If the string is not empty (the first character is a new line \n) */
- _vm->_textMan->printMessage(k4_ColorCyan, outputString);
+ _vm->_textMan->printMessage(kDMColorCyan, outputString);
}
void MenuMan::processCommands116To119_setActingChampion(uint16 champIndex) {
@@ -1681,10 +1682,10 @@ void MenuMan::setActionList(ActionSet *actionSet) {
continue;
uint16 minimumSkillLevel = actionSet->_actionProperties[idx - 1];
- if (getFlag(minimumSkillLevel, k0x0080_actionRequiresCharge) && !getActionObjectChargeCount())
+ if (getFlag(minimumSkillLevel, kDMActionMaskRequiresCharge) && !getActionObjectChargeCount())
continue;
- clearFlag(minimumSkillLevel, k0x0080_actionRequiresCharge);
+ clearFlag(minimumSkillLevel, kDMActionMaskRequiresCharge);
if (_vm->_championMan->getSkillLevel(_vm->ordinalToIndex(_vm->_championMan->_actingChampionOrdinal), _actionSkillIndex[actionIndex]) >= minimumSkillLevel) {
_actionList._actionIndices[nextAvailableActionListIndex] = (ChampionAction)actionIndex;
_actionList._minimumSkillLevel[nextAvailableActionListIndex] = minimumSkillLevel;
@@ -1718,7 +1719,7 @@ void MenuMan::drawActionDamage(int16 damage) {
_vm->_eventMan->showMouse();
_vm->_displayMan->_useByteBoxCoordinates = false;
- _vm->_displayMan->fillScreenBox(_boxActionArea, k0_ColorBlack);
+ _vm->_displayMan->fillScreenBox(_boxActionArea, kDMColorBlack);
if (damage < 0) {
static const char *messagesEN[2] = {"CAN'T REACH", "NEED AMMO"};
static const char *messagesDE[2] = {"ZU WEIT WEG", "MEHR MUNITION"};
@@ -1745,14 +1746,14 @@ void MenuMan::drawActionDamage(int16 damage) {
const char *displayString;
int16 textPosX;
- if (damage == kM1_damageCantReach) {
+ if (damage == kDMDamageCantReach) {
textPosX = pos[0];
displayString = message[0];
} else {
textPosX = pos[1];
displayString = message[1];
}
- _vm->_textMan->printToLogicalScreen(textPosX, 100, k4_ColorCyan, k0_ColorBlack, displayString);
+ _vm->_textMan->printToLogicalScreen(textPosX, 100, kDMColorCyan, kDMColorBlack, displayString);
} else {
int16 byteWidth;
byte *blitBitmap;
@@ -1760,26 +1761,26 @@ void MenuMan::drawActionDamage(int16 damage) {
int16 displayHeight;
if (damage > 40) {
blitBox = &_boxActionArea3ActionMenu;
- blitBitmap = _vm->_displayMan->getNativeBitmapOrGraphic(k14_damageToCreatureIndice);
+ blitBitmap = _vm->_displayMan->getNativeBitmapOrGraphic(kDMGraphicIdxDamageToCreature);
byteWidth = k48_byteWidth;
displayHeight = 45;
} else {
uint16 derivedBitmapIndex;
int16 destPixelWidth;
if (damage > 15) {
- derivedBitmapIndex = k2_DerivedBitmapDamageToCreatureMedium;
+ derivedBitmapIndex = kDMDerivedBitmapDamageToCreatureMedium;
destPixelWidth = 64;
byteWidth = k32_byteWidth;
blitBox = &actionAreaMediumDamage;
} else {
- derivedBitmapIndex = k3_DerivedBitmapDamageToCreatureSmall;
+ derivedBitmapIndex = kDMDerivedBitmapDamageToCreatureSmall;
destPixelWidth = 42;
byteWidth = k24_byteWidth;
blitBox = &actionAreaSmallDamage;
}
displayHeight = 37;
if (!_vm->_displayMan->isDerivedBitmapInCache(derivedBitmapIndex)) {
- byte *nativeBitmap = _vm->_displayMan->getNativeBitmapOrGraphic(k14_damageToCreatureIndice);
+ byte *nativeBitmap = _vm->_displayMan->getNativeBitmapOrGraphic(kDMGraphicIdxDamageToCreature);
blitBitmap = _vm->_displayMan->getDerivedBitmap(derivedBitmapIndex);
_vm->_displayMan->blitToBitmapShrinkWithPalChange(nativeBitmap, blitBitmap, 96, 45, destPixelWidth, 37, _vm->_displayMan->_palChangesNoChanges);
_vm->_displayMan->addDerivedBitmap(derivedBitmapIndex);
@@ -1787,7 +1788,7 @@ void MenuMan::drawActionDamage(int16 damage) {
blitBitmap = _vm->_displayMan->getDerivedBitmap(derivedBitmapIndex);
}
}
- _vm->_displayMan->blitToScreen(blitBitmap, blitBox, byteWidth, kM1_ColorNoTransparency, displayHeight);
+ _vm->_displayMan->blitToScreen(blitBitmap, blitBox, byteWidth, kDMColorNoTransparency, displayHeight);
/* Convert damage value to string */
uint16 charIndex = 5;
int16 textPosX = 274;
@@ -1797,7 +1798,7 @@ void MenuMan::drawActionDamage(int16 damage) {
scoreString[--charIndex] = '0' + (damage % 10);
textPosX -= 3;
} while (damage /= 10);
- _vm->_textMan->printToLogicalScreen(textPosX, 100, k4_ColorCyan, k0_ColorBlack, &scoreString[charIndex]);
+ _vm->_textMan->printToLogicalScreen(textPosX, 100, kDMColorCyan, kDMColorBlack, &scoreString[charIndex]);
}
_vm->_eventMan->hideMouse();
}
diff --git a/engines/dm/menus.h b/engines/dm/menus.h
index 11232486d5..1964454717 100644
--- a/engines/dm/menus.h
+++ b/engines/dm/menus.h
@@ -34,13 +34,20 @@
namespace DM {
-#define kM1_damageCantReach -1 // @ CM1_DAMAGE_CANT_REACH
-#define kM2_damageNoAmmunition -2 // @ CM2_DAMAGE_NO_AMMUNITION
-#define k2_SpellAreaAvailableSymbols 2 // @ C2_SPELL_AREA_AVAILABLE_SYMBOLS
-#define k3_SpellAreaChampionSymbols 3 // @ C3_SPELL_AREA_CHAMPION_SYMBOLS
+enum Damage {
+ kDMDamageCantReach = -1, // @ CM1_DAMAGE_CANT_REACH
+ kDMDamageNoAmmunition = -2 // @ CM2_DAMAGE_NO_AMMUNITION
+};
-#define k0x0080_actionRequiresCharge 0x0080 // @ MASK0x0080_ACTION_REQUIRES_CHARGE
-#define k0x8000_hitNonMaterialCreatures 0x8000 // @ MASK0x8000_HIT_NON_MATERIAL_CREATURES
+enum SpellArea {
+ kDMSpellAreaAvailableSymbols = 2, // @ C2_SPELL_AREA_AVAILABLE_SYMBOLS
+ kDMSpellAreaChampionSymbols = 3 // @ C3_SPELL_AREA_CHAMPION_SYMBOLS
+};
+
+enum ActionMask {
+ kDMActionMaskRequiresCharge = 0x0080, // @ MASK0x0080_ACTION_REQUIRES_CHARGE
+ kDMActionMaskHitNonMaterialCreatures = 0x8000 // @ MASK0x8000_HIT_NON_MATERIAL_CREATURES
+};
class ActionList {
public:
@@ -122,14 +129,13 @@ public:
Box _boxActionArea3ActionMenu; // @ G0499_s_Graphic560_Box_ActionArea3ActionsMenu
Box _boxActionArea2ActionMenu; // @ G0500_s_Graphic560_Box_ActionArea2ActionsMenu
Box _boxActionArea1ActionMenu; // @ G0501_s_Graphic560_Box_ActionArea1ActionMenu
- Box _boxActionArea; // @ G0001_s_Graphic562_Box_ActionArea
+ Box _boxActionArea; // @ G0001_s_Graphic562_Box_ActionArea
Box _boxSpellArea;
unsigned char _actionSkillIndex[44]; // @ G0496_auc_Graphic560_ActionSkillIndex
unsigned char _actionDisabledTicks[44];
void initConstants();
};
-
}
#endif // DM_MENUS_H
diff --git a/engines/dm/movesens.cpp b/engines/dm/movesens.cpp
index 37ae1382aa..03ae63e34c 100644
--- a/engines/dm/movesens.cpp
+++ b/engines/dm/movesens.cpp
@@ -182,7 +182,7 @@ bool MovesensMan::sensorIsTriggeredByClickOnWall(int16 mapX, int16 mapY, uint16
if (!doNotTriggerSensor) {
atLeastOneSensorWasTriggered = true;
if (currentSensor->getAttrAudibleA())
- _vm->_sound->requestPlay(k01_soundSWITCH, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, kDMSoundModePlayIfPrioritized);
+ _vm->_sound->requestPlay(kDMSoundIndexSwitch, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, kDMSoundModePlayIfPrioritized);
if (!_vm->_championMan->_leaderEmptyHanded && ((processedSensorType == kDMSensorWallOrnClickWithSpecObjRemoved) || (processedSensorType == kDMSensorWallOrnClickWithSpecObjRemovedRotateSensors) || (processedSensorType == kDMSensorWallOrnClickWithSpecObjRemovedSensor))) {
Thing *leaderThing = (Thing *)_vm->_dungeonMan->getThingData(leaderHandObject);
@@ -279,7 +279,7 @@ bool MovesensMan::getMoveResult(Thing thing, int16 mapX, int16 mapY, int16 destM
_vm->_dungeonMan->_partyMapX = destMapX;
_vm->_dungeonMan->_partyMapY = destMapY;
if (teleporter->isAudible())
- _vm->_sound->requestPlay(k17_soundBUZZ, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, kDMSoundModePlayImmediately);
+ _vm->_sound->requestPlay(kDMSoundIndexBuzz, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, kDMSoundModePlayImmediately);
drawDungeonViewWhileFalling = true;
if (teleporter->getAbsoluteRotation())
@@ -289,7 +289,7 @@ bool MovesensMan::getMoveResult(Thing thing, int16 mapX, int16 mapY, int16 destM
} else {
if (thingType == kDMThingTypeGroup) {
if (teleporter->isAudible())
- _vm->_sound->requestPlay(k17_soundBUZZ, destMapX, destMapY, kDMSoundModePlayIfPrioritized);
+ _vm->_sound->requestPlay(kDMSoundIndexBuzz, destMapX, destMapY, kDMSoundModePlayIfPrioritized);
moveGroupResult = getTeleporterRotatedGroupResult(teleporter, thing, mapIndexSource);
} else {
@@ -327,18 +327,18 @@ bool MovesensMan::getMoveResult(Thing thing, int16 mapX, int16 mapY, int16 destM
_vm->_championMan->decrementStamina(championIdx, ((curChampion->_load * 25) / _vm->_championMan->getMaximumLoad(curChampion)) + 1);
}
} else if (_vm->_championMan->getDamagedChampionCount(20, kDMWoundLegs | kDMWoundFeet, kDMAttackTypeSelf))
- _vm->_sound->requestPlay(k06_soundSCREAM, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, kDMSoundModePlayImmediately);
+ _vm->_sound->requestPlay(kDMSoundIndexScream, _vm->_dungeonMan->_partyMapX, _vm->_dungeonMan->_partyMapY, kDMSoundModePlayImmediately);
}
_useRopeToClimbDownPit = false;
} else if (thingType == kDMThingTypeGroup) {
_vm->_dungeonMan->setCurrentMap(mapIndexSource);
uint16 outcome = _vm->_groupMan->getDamageAllCreaturesOutcome((Group *)_vm->_dungeonMan->getThingData(thing), mapX, mapY, 20, false);
_vm->_dungeonMan->setCurrentMap(mapIndexDestination);
- fallKilledGroup = (outcome == k2_outcomeKilledAllCreaturesInGroup);
+ fallKilledGroup = (outcome == kDMKillOutcomeAllCreaturesInGroup);
if (fallKilledGroup)
break;
- if (outcome == k1_outcomeKilledSomeCreaturesInGroup)
+ if (outcome == kDMKillOutcomeSomeCreaturesInGroup)
_vm->_groupMan->dropMovingCreatureFixedPossession(thing, destMapX, destMapY);
}
} else if ((destinationSquareType == (int)kDMElementTypeStairs) && (thing != Thing::_party) && (thingType != kDMThingTypeProjectile)) {
@@ -442,8 +442,9 @@ bool MovesensMan::getMoveResult(Thing thing, int16 mapX, int16 mapY, int16 destM
createEventMoveGroup(thing, destMapX, destMapY, mapIndexDestination, audibleTeleporter);
return true; /* The specified group thing cannot be moved because the party or another group is on the destination square */
}
- uint16 movementSoundIndex = getSound(((Group *)_vm->_dungeonMan->_thingData[kDMThingTypeGroup])[thing.getIndex()]._type);
- if (movementSoundIndex < k34_D13_soundCount)
+ Group *tmpGroup = (Group *)_vm->_dungeonMan->_thingData[kDMThingTypeGroup];
+ uint16 movementSoundIndex = getSound((CreatureType)tmpGroup[thing.getIndex()]._type);
+ if (movementSoundIndex < kDMSoundCount)
_vm->_sound->requestPlay(movementSoundIndex, destMapX, destMapY, kDMSoundModePlayIfPrioritized);
if (groupOnPartyMap && (mapIndexDestination != _vm->_dungeonMan->_partyMapIndex)) { /* If the group leaves the party map */
@@ -486,7 +487,7 @@ bool MovesensMan::isLevitating(Thing thing) {
ThingType thingType = thing.getType();
bool retVal = false;
if (thingType == kDMThingTypeGroup)
- retVal = getFlag(_vm->_dungeonMan->getCreatureAttributes(thing), k0x0020_MaskCreatureInfo_levitation);
+ retVal = getFlag(_vm->_dungeonMan->getCreatureAttributes(thing), kDMCreatureMaskLevitation);
else if ((thingType == kDMThingTypeProjectile) || (thingType == kDMThingTypeExplosion))
// Fix original bug involving explosions falling in pits
retVal = true;
@@ -559,11 +560,11 @@ T0266017_CheckProjectileImpacts:
Thing curThing = _vm->_dungeonMan->getSquareFirstThing(projectileMapX, projectileMapY);
while (curThing != Thing::_endOfList) {
if ((curThing.getType() == kDMThingTypeProjectile) &&
- (_vm->_timeline->_events[(((Projectile *)_vm->_dungeonMan->_thingData[kDMThingTypeProjectile])[curThing.getIndex()])._eventIndex]._type != k48_TMEventTypeMoveProjectileIgnoreImpacts)) {
+ (_vm->_timeline->_events[(((Projectile *)_vm->_dungeonMan->_thingData[kDMThingTypeProjectile])[curThing.getIndex()])._eventIndex]._type != kDMEventTypeMoveProjectileIgnoreImpacts)) {
int16 championOrCreatureOrdinal = championOrCreatureOrdinalInCell[curThing.getCell()];
if (championOrCreatureOrdinal && _vm->_projexpl->hasProjectileImpactOccurred(impactType, srcMapX, srcMapY, _vm->ordinalToIndex(championOrCreatureOrdinal), curThing)) {
_vm->_projexpl->projectileDeleteEvent(curThing);
- if (_vm->_projexpl->_creatureDamageOutcome == k2_outcomeKilledAllCreaturesInGroup)
+ if (_vm->_projexpl->_creatureDamageOutcome == kDMKillOutcomeAllCreaturesInGroup)
return true;
goto T0266017_CheckProjectileImpacts;
@@ -582,9 +583,9 @@ T0266017_CheckProjectileImpacts:
return false;
}
-void MovesensMan::addEvent(byte type, byte mapX, byte mapY, Cell cell, SensorEffect effect, int32 time) {
+void MovesensMan::addEvent(TimelineEventType type, byte mapX, byte mapY, Cell cell, SensorEffect effect, int32 time) {
TimelineEvent newEvent;
- _vm->setMapAndTime(newEvent._mapTime, _vm->_dungeonMan->_currMapIndex, time);
+ newEvent._mapTime = _vm->setMapAndTime(_vm->_dungeonMan->_currMapIndex, time);
newEvent._type = type;
newEvent._priority = 0;
newEvent._Bu._location._mapX = mapX;
@@ -594,46 +595,46 @@ void MovesensMan::addEvent(byte type, byte mapX, byte mapY, Cell cell, SensorEff
_vm->_timeline->addEventGetEventIndex(&newEvent);
}
-int16 MovesensMan::getSound(byte creatureType) {
+int16 MovesensMan::getSound(CreatureType creatureType) {
if (_vm->_championMan->_partyIsSleeping)
return 35;
switch (creatureType) {
- case k3_CreatureTypeWizardEyeFlyingEye:
- case k8_CreatureTypeGhostRive:
- case k11_CreatureTypeBlackFlame:
- case k19_CreatureTypeMaterializerZytaz:
- case k23_CreatureTypeLordChaos:
- case k25_CreatureTypeLordOrder:
- case k26_CreatureTypeGreyLord:
+ case kDMCreatureTypeWizardEye:
+ case kDMCreatureTypeGhostRive:
+ case kDMCreatureTypeBlackFlame:
+ case kDMCreatureTypeMaterializerZytaz:
+ case kDMCreatureTypeLordChaos:
+ case kDMCreatureTypeLordOrder:
+ case kDMCreatureTypeGreyLord:
return 35;
- case k2_CreatureTypeGiggler:
- case k9_CreatureTypeStoneGolem:
- case k10_CreatureTypeMummy:
- case k14_CreatureTypeVexirk:
- case k16_CreatureTypeTrolinAntman:
- case k22_CreatureTypeDemon:
- return k24_soundMOVE_MUMMY_TROLIN_ANTMAN_STONE_GOLEM_GIGGLER_VEXIRK_DEMON;
- case k0_CreatureTypeGiantScorpionScorpion:
- case k4_CreatureTypePainRatHellHound:
- case k5_CreatureTypeRuster:
- case k6_CreatureTypeScreamer:
- case k7_CreatureTypeRockpile:
- case k15_CreatureTypeMagnetaWormWorm:
- case k21_CreatureTypeOitu:
- return k26_soundMOVE_SCREAMER_ROCK_ROCKPILE_MAGENTA_WORM_WORM_PAIN_RAT_HELLHOUND_RUSTER_GIANT_SCORPION_SCORPION_OITU;
- case k24_CreatureTypeRedDragon:
- return k32_soundMOVE_RED_DRAGON;
- case k12_CreatureTypeSkeleton:
- return k33_soundMOVE_SKELETON;
- case k18_CreatureTypeAnimatedArmourDethKnight:
- return k22_soundMOVE_ANIMATED_ARMOUR_DETH_KNIGHT;
- case k1_CreatureTypeSwampSlimeSlime:
- case k20_CreatureTypeWaterElemental:
- return k27_soundMOVE_SWAMP_SLIME_SLIME_DEVIL_WATER_ELEMENTAL;
- case k13_CreatureTypeCouatl:
- case k17_CreatureTypeGiantWaspMuncher:
- return k23_soundMOVE_COUATL_GIANT_WASP_MUNCHER;
+ case kDMCreatureTypeGiggler:
+ case kDMCreatureTypeStoneGolem:
+ case kDMCreatureTypeMummy:
+ case kDMCreatureTypeVexirk:
+ case kDMCreatureTypeAntman:
+ case kDMCreatureTypeDemon:
+ return kDMSoundIndexMoveMummyTrolinAntmanStoneGolemGiggleVexirkDemon;
+ case kDMCreatureTypeGiantScorpion:
+ case kDMCreatureTypePainRat:
+ case kDMCreatureTypeRuster:
+ case kDMCreatureTypeScreamer:
+ case kDMCreatureTypeRockpile:
+ case kDMCreatureTypeMagentaWorm:
+ case kDMCreatureTypeOitu:
+ return kDMSoundIndexMoveScreamerRocksWormPainRatHellHoundRusterScorpionsOitu;
+ case kDMCreatureTypeRedDragon:
+ return kDMSoundIndexMoveRedDragon;
+ case kDMCreatureTypeSkeleton:
+ return kDMSoundIndexMoveSkeletton;
+ case kDMCreatureTypeAnimatedArmour:
+ return kDMSoundIndexMoveAnimatedArmorDethKnight;
+ case kDMCreatureTypeSwampSlime:
+ case kDMCreatureTypeWaterElemental:
+ return kDMSoundIndexMoveSlimesDevilWaterElemental;
+ case kDMCreatureTypeCouatl:
+ case kDMCreatureTypeGiantWasp:
+ return kDMSoundIndexMoveCouatlGiantWaspMuncher;
}
return 35;
@@ -652,13 +653,13 @@ int16 MovesensMan::getTeleporterRotatedGroupResult(Teleporter *teleporter, Thing
updatedGroupDirections = _vm->normalizeModulo4(groupDirections + rotation);
uint16 updatedGroupCells = _vm->_groupMan->getGroupCells(group, mapIndex);
- if (updatedGroupCells != k255_CreatureTypeSingleCenteredCreature) {
+ if (updatedGroupCells != kDMCreatureTypeSingleCenteredCreature) {
int16 groupCells = updatedGroupCells;
- int16 creatureSize = getFlag(_vm->_dungeonMan->_creatureInfos[group->_type]._attributes, k0x0003_MaskCreatureInfo_size);
+ int16 creatureSize = getFlag(_vm->_dungeonMan->_creatureInfos[group->_type]._attributes, kDMCreatureMaskSize);
int16 relativeRotation = _vm->normalizeModulo4(4 + updatedGroupDirections - groupDirections);
for (int16 creatureIdx = 0; creatureIdx <= group->getCount(); creatureIdx++) {
updatedGroupDirections = _vm->_groupMan->getGroupValueUpdatedWithCreatureValue(updatedGroupDirections, creatureIdx, absoluteRotation ? (uint16)rotation : _vm->normalizeModulo4(groupDirections + rotation));
- if (creatureSize == k0_MaskCreatureSizeQuarter) {
+ if (creatureSize == kDMCreatureSizeQuarter) {
relativeRotation = absoluteRotation ? 1 : 0;
if (relativeRotation)
relativeRotation = rotation;
@@ -672,7 +673,7 @@ int16 MovesensMan::getTeleporterRotatedGroupResult(Teleporter *teleporter, Thing
}
_vm->_dungeonMan->setGroupDirections(group, updatedGroupDirections, mapIndex);
_vm->_dungeonMan->setGroupCells(group, updatedGroupCells, mapIndex);
- if ((mapIndex == _vm->_dungeonMan->_partyMapIndex) && (group->setBehaviour(k6_behavior_ATTACK)))
+ if ((mapIndex == _vm->_dungeonMan->_partyMapIndex) && (group->setBehaviour(kDMBehaviorAttack)))
return group->getActiveGroupIndex() + 2;
return 1;
@@ -724,7 +725,7 @@ void MovesensMan::processThingAdditionOrRemoval(uint16 mapX, uint16 mapY, Thing
squareContainsGroup = true;
else if ((curThingType == kDMstringTypeText) && (thingType == kDMThingTypeParty) && addThing && !partySquare) {
_vm->_dungeonMan->decodeText(_vm->_stringBuildBuffer, curThing, kDMTextTypeMessage);
- _vm->_textMan->printMessage(k15_ColorWhite, _vm->_stringBuildBuffer);
+ _vm->_textMan->printMessage(kDMColorWhite, _vm->_stringBuildBuffer);
} else if ((curThingType > kDMThingTypeGroup) && (curThingType < kDMThingTypeProjectile)) {
squareContainsObject = true;
squareContainsThingOfSameType |= (_vm->_objectMan->getObjectType(curThing) == objectType);
@@ -839,7 +840,7 @@ void MovesensMan::processThingAdditionOrRemoval(uint16 mapX, uint16 mapY, Thing
continue;
if (curSensor->getAttrAudibleA())
- _vm->_sound->requestPlay(k01_soundSWITCH, mapX, mapY, kDMSoundModePlayIfPrioritized);
+ _vm->_sound->requestPlay(kDMSoundIndexSwitch, mapX, mapY, kDMSoundModePlayIfPrioritized);
triggerEffect(curSensor, curSensorEffect, mapX, mapY, (uint16)kDMCellAny); // this will wrap around
continue;
@@ -891,13 +892,13 @@ bool MovesensMan::isObjectInPartyPossession(int16 objectType) {
void MovesensMan::triggerEffect(Sensor *sensor, SensorEffect effect, int16 mapX, int16 mapY, uint16 cell) {
TimelineEventType squareTypeToEventTypeArray[7] = { // @ G0059_auc_Graphic562_SquareTypeToEventType
- k6_TMEventTypeWall,
- k5_TMEventTypeCorridor,
- k9_TMEventTypePit,
- k0_TMEventTypeNone,
- k10_TMEventTypeDoor,
- k8_TMEventTypeTeleporter,
- k7_TMEventTypeFakeWall
+ kDMEventTypeWall,
+ kDMEventTypeCorridor,
+ kDMEventTypePit,
+ kDMEventTypeNone,
+ kDMEventTypeDoor,
+ kDMEventTypeTeleporter,
+ kDMEventTypeFakeWall
};
if (sensor->getAttrOnlyOnce())
@@ -982,8 +983,8 @@ void MovesensMan::processRotationEffect() {
void MovesensMan::createEventMoveGroup(Thing groupThing, int16 mapX, int16 mapY, int16 mapIndex, bool audible) {
TimelineEvent newEvent;
- _vm->setMapAndTime(newEvent._mapTime, mapIndex, _vm->_gameTime + 5);
- newEvent._type = audible ? k61_TMEventTypeMoveGroupAudible : k60_TMEventTypeMoveGroupSilent;
+ newEvent._mapTime = _vm->setMapAndTime(mapIndex, _vm->_gameTime + 5);
+ newEvent._type = audible ? kDMEventTypeMoveGroupAudible : kDMEventTypeMoveGroupSilent;
newEvent._priority = 0;
newEvent._Bu._location._mapX = mapX;
newEvent._Bu._location._mapY = mapY;
diff --git a/engines/dm/movesens.h b/engines/dm/movesens.h
index f82ad186a3..c5a03d09c4 100644
--- a/engines/dm/movesens.h
+++ b/engines/dm/movesens.h
@@ -30,7 +30,7 @@
#define DM_MOVESENS_H
#include "dm/dm.h"
-
+#include "dm/group.h"
enum SensorEffect {
kDMSensorEffectNone = -1, // @ CM1_EFFECT_NONE
kDMSensorEffectSet = 0, // @ C00_EFFECT_SET
@@ -64,8 +64,8 @@ public:
bool getMoveResult(Thing thing, int16 mapX, int16 mapY, int16 destMapX, int16 destMapY); // @ F0267_MOVE_GetMoveResult_CPSCE
bool isLevitating(Thing thing); // @ F0264_MOVE_IsLevitating
bool moveIsKilledByProjectileImpact(int16 srcMapX, int16 srcMapY, int16 destMapX, int16 destMapY, Thing thing); // @ F0266_MOVE_IsKilledByProjectileImpact
- void addEvent(byte type, byte mapX, byte mapY, Cell cell, SensorEffect effect, int32 time); // @ F0268_SENSOR_AddEvent
- int16 getSound(byte creatureType); // @ F0514_MOVE_GetSound
+ void addEvent(TimelineEventType type, byte mapX, byte mapY, Cell cell, SensorEffect effect, int32 time); // @ F0268_SENSOR_AddEvent
+ int16 getSound(CreatureType creatureType); // @ F0514_MOVE_GetSound
int16 getTeleporterRotatedGroupResult(Teleporter *teleporter, Thing thing, uint16 mapIndex);// @ F0262_MOVE_GetTeleporterRotatedGroupResult
Thing getTeleporterRotatedProjectileThing(Teleporter *teleporter, Thing projectileThing); // @ F0263_MOVE_GetTeleporterRotatedProjectileThing
void processThingAdditionOrRemoval(uint16 mapX, uint16 mapY, Thing thing, bool partySquare, bool addThing);// @ F0276_SENSOR_ProcessThingAdditionOrRemoval
@@ -77,7 +77,6 @@ public:
void createEventMoveGroup(Thing groupThing, int16 mapX, int16 mapY, int16 mapIndex, bool audible); // @ F0265_MOVE_CreateEvent60To61_MoveGroup
Thing getObjectOfTypeInCell(int16 mapX, int16 mapY, int16 cell, int16 objectType); // @ F0273_SENSOR_GetObjectOfTypeInCell
};
-
}
#endif
diff --git a/engines/dm/objectman.cpp b/engines/dm/objectman.cpp
index ffab2392c3..3b191e877c 100644
--- a/engines/dm/objectman.cpp
+++ b/engines/dm/objectman.cpp
@@ -98,7 +98,7 @@ void ObjectMan::initConstants() {
}
ObjectMan::ObjectMan(DMEngine *vm) : _vm(vm) {
- for (uint16 i = 0; i < k199_ObjectNameCount; ++i)
+ for (uint16 i = 0; i < kDMObjectNameCount; ++i)
_objectNames[i] = nullptr;
_objectIconForMousePointer = nullptr;
@@ -116,10 +116,10 @@ void ObjectMan::loadObjectNames() {
_objectIconForMousePointer = new byte[16 * 16];
- char *objectNames = new char[dispMan.getCompressedDataSize(k556_ObjectNamesGraphicIndice) + k199_ObjectNameCount];
- Common::MemoryReadStream stream = dispMan.getCompressedData(k556_ObjectNamesGraphicIndice);
+ char *objectNames = new char[dispMan.getCompressedDataSize(kDMObjectNamesGraphicIndice) + kDMObjectNameCount];
+ Common::MemoryReadStream stream = dispMan.getCompressedData(kDMObjectNamesGraphicIndice);
- for (uint16 objNameIndex = 0; objNameIndex < k199_ObjectNameCount; ++objNameIndex) {
+ for (uint16 objNameIndex = 0; objNameIndex < kDMObjectNameCount; ++objNameIndex) {
_objectNames[objNameIndex] = objectNames;
byte tmpByte;
@@ -191,11 +191,11 @@ void ObjectMan::extractIconFromBitmap(uint16 iconIndex, byte *destBitmap) {
break;
}
--counter;
- byte *iconBitmap = _vm->_displayMan->getNativeBitmapOrGraphic(k42_ObjectIcons_000_TO_031 + counter);
+ byte *iconBitmap = _vm->_displayMan->getNativeBitmapOrGraphic(kDMGraphicIdxObjectIcons000To031 + counter);
iconIndex -= _iconGraphicFirstIndex[counter];
_vm->_displayMan->_useByteBoxCoordinates = true;
Box blitBox(0, 15, 0, 15);
- _vm->_displayMan->blitToBitmap(iconBitmap, destBitmap, blitBox, (iconIndex & 0x000F) << 4, iconIndex & 0x0FF0, 128, 8, kM1_ColorNoTransparency, _iconGraphicHeight[counter], 16);
+ _vm->_displayMan->blitToBitmap(iconBitmap, destBitmap, blitBox, (iconIndex & 0x000F) << 4, iconIndex & 0x0FF0, 128, 8, kDMColorNoTransparency, _iconGraphicHeight[counter], 16);
}
void ObjectMan::drawIconInSlotBox(uint16 slotBoxIndex, int16 iconIndex) {
@@ -205,10 +205,10 @@ void ObjectMan::drawIconInSlotBox(uint16 slotBoxIndex, int16 iconIndex) {
return;
Box blitBox;
- blitBox._x1 = slotBox->_x;
- blitBox._x2 = blitBox._x1 + 15;
- blitBox._y1 = slotBox->_y;
- blitBox._y2 = blitBox._y1 + 15;
+ blitBox._rect.left = slotBox->_x;
+ blitBox._rect.right = blitBox._rect.left + 15;
+ blitBox._rect.top = slotBox->_y;
+ blitBox._rect.bottom = blitBox._rect.top + 15;
uint16 iconGraphicIndex;
for (iconGraphicIndex = 0; iconGraphicIndex < 7; iconGraphicIndex++) {
@@ -216,12 +216,12 @@ void ObjectMan::drawIconInSlotBox(uint16 slotBoxIndex, int16 iconIndex) {
break;
}
iconGraphicIndex--;
- byte *iconBitmap = _vm->_displayMan->getNativeBitmapOrGraphic(iconGraphicIndex + k42_ObjectIcons_000_TO_031);
+ byte *iconBitmap = _vm->_displayMan->getNativeBitmapOrGraphic(iconGraphicIndex + kDMGraphicIdxObjectIcons000To031);
iconIndex -= _iconGraphicFirstIndex[iconGraphicIndex];
int16 byteWidth;
byte* blitDestination;
int16 destHeight;
- if (slotBoxIndex >= k8_SlotBoxInventoryFirstSlot) {
+ if (slotBoxIndex >= kDMSlotBoxInventoryFirstSlot) {
blitDestination = _vm->_displayMan->_bitmapViewport;
byteWidth = k112_byteWidthViewport;
destHeight = 136;
@@ -231,7 +231,7 @@ void ObjectMan::drawIconInSlotBox(uint16 slotBoxIndex, int16 iconIndex) {
destHeight = 200;
}
_vm->_displayMan->_useByteBoxCoordinates = false;
- _vm->_displayMan->blitToBitmap(iconBitmap, blitDestination, blitBox, (iconIndex & 0x000F) << 4, iconIndex & 0x0FF0, k128_byteWidth, byteWidth, kM1_ColorNoTransparency, _iconGraphicHeight[iconGraphicIndex], destHeight);
+ _vm->_displayMan->blitToBitmap(iconBitmap, blitDestination, blitBox, (iconIndex & 0x000F) << 4, iconIndex & 0x0FF0, k128_byteWidth, byteWidth, kDMColorNoTransparency, _iconGraphicHeight[iconGraphicIndex], destHeight);
}
void ObjectMan::drawLeaderObjectName(Thing thing) {
@@ -257,7 +257,7 @@ void ObjectMan::drawLeaderObjectName(Thing thing) {
} else
objectName = Common::String(_objectNames[iconIndex]);
- _vm->_textMan->printWithTrailingSpaces(_vm->_displayMan->_bitmapScreen, k160_byteWidthScreen, 233, 37, k4_ColorCyan, k0_ColorBlack, objectName.c_str(), k14_ObjectNameMaximumLength, k200_heightScreen);
+ _vm->_textMan->printWithTrailingSpaces(_vm->_displayMan->_bitmapScreen, k160_byteWidthScreen, 233, 37, kDMColorCyan, kDMColorBlack, objectName.c_str(), kDMObjectNameMaximumLength, k200_heightScreen);
}
IconIndice ObjectMan::getIconIndexInSlotBox(uint16 slotBoxIndex) {
@@ -265,14 +265,14 @@ IconIndice ObjectMan::getIconIndexInSlotBox(uint16 slotBoxIndex) {
}
void ObjectMan::clearLeaderObjectName() {
- static Box boxLeaderHandObjectName(233, 319, 33, 38); // @ G0028_s_Graphic562_Box_LeaderHandObjectName
- _vm->_displayMan->fillScreenBox(boxLeaderHandObjectName, k0_ColorBlack);
+ static Box boxLeaderHandObjectName(233, 319, 33, 38); // @ G0028_s_Graphic562_Box_LeaderHandObjectName
+ _vm->_displayMan->fillScreenBox(boxLeaderHandObjectName, kDMColorBlack);
}
void ObjectMan::drawIconToScreen(int16 iconIndex, int16 posX, int16 posY) {
static byte iconBitmap[16 * 16];
Box blitBox(posX, posX + 15, posY, posY + 15);
extractIconFromBitmap(iconIndex, iconBitmap);
- _vm->_displayMan->blitToScreen(iconBitmap, &blitBox, k8_byteWidth, kM1_ColorNoTransparency, 16);
+ _vm->_displayMan->blitToScreen(iconBitmap, &blitBox, k8_byteWidth, kDMColorNoTransparency, 16);
}
}
diff --git a/engines/dm/objectman.h b/engines/dm/objectman.h
index bb7d06c606..0457788e2d 100644
--- a/engines/dm/objectman.h
+++ b/engines/dm/objectman.h
@@ -33,13 +33,9 @@
namespace DM {
-#define k8_SlotBoxInventoryFirstSlot 8 // @ C08_SLOT_BOX_INVENTORY_FIRST_SLOT
-#define k9_SlotBoxInventoryActionHand 9 // @ C09_SLOT_BOX_INVENTORY_ACTION_HAND
-#define k38_SlotBoxChestFirstSlot 38 // @ C38_SLOT_BOX_CHEST_FIRST_SLOT
-
-#define k14_ObjectNameMaximumLength 14 // @ C014_OBJECT_NAME_MAXIMUM_LENGTH
-#define k199_ObjectNameCount 199 // @ C199_OBJECT_NAME_COUNT
-#define k556_ObjectNamesGraphicIndice 556 // @ C556_GRAPHIC_OBJECT_NAMES
+#define kDMObjectNameMaximumLength 14 // @ C014_OBJECT_NAME_MAXIMUM_LENGTH
+#define kDMObjectNameCount 199 // @ C199_OBJECT_NAME_COUNT
+#define kDMObjectNamesGraphicIndice 556 // @ C556_GRAPHIC_OBJECT_NAMES
class SlotBox {
public:
@@ -59,7 +55,7 @@ public:
void loadObjectNames(); // @ F0031_OBJECT_LoadNames
SlotBox _slotBoxes[46]; // @ G0030_as_Graphic562_SlotBoxes;
- char *_objectNames[k199_ObjectNameCount]; // @ G0352_apc_ObjectNames
+ char *_objectNames[kDMObjectNameCount]; // @ G0352_apc_ObjectNames
byte *_objectIconForMousePointer; // @ G0412_puc_Bitmap_ObjectIconForMousePointer
IconIndice getObjectType(Thing thing); // @ F0032_OBJECT_GetType
@@ -76,7 +72,6 @@ public:
void initConstants();
};
-
}
#endif
diff --git a/engines/dm/projexpl.cpp b/engines/dm/projexpl.cpp
index b30fb72dde..e4faa3f627 100644
--- a/engines/dm/projexpl.cpp
+++ b/engines/dm/projexpl.cpp
@@ -57,11 +57,11 @@ void ProjExpl::createProjectile(Thing thing, int16 mapX, int16 mapY, uint16 cell
projectilePtr->_attack = attack;
_vm->_dungeonMan->linkThingToList(projectileThing, Thing(0), mapX, mapY); /* Projectiles are added on the square and not 'moved' onto the square. In the case of a projectile launcher sensor, this means that the new projectile traverses the square in front of the launcher without any trouble: there is no impact if it is a wall, the projectile direction is not changed if it is a teleporter. Impacts with creatures and champions are still processed */
TimelineEvent newEvent;
- _vm->setMapAndTime(newEvent._mapTime, _vm->_dungeonMan->_currMapIndex, _vm->_gameTime + 1);
+ newEvent._mapTime = _vm->setMapAndTime(_vm->_dungeonMan->_currMapIndex, _vm->_gameTime + 1);
if (_createLauncherProjectile)
- newEvent._type = k49_TMEventTypeMoveProjectile; /* Launcher projectiles can impact immediately */
+ newEvent._type = kDMEventTypeMoveProjectile; /* Launcher projectiles can impact immediately */
else
- newEvent._type = k48_TMEventTypeMoveProjectileIgnoreImpacts; /* Projectiles created by champions or creatures ignore impacts on their first movement */
+ newEvent._type = kDMEventTypeMoveProjectileIgnoreImpacts; /* Projectiles created by champions or creatures ignore impacts on their first movement */
newEvent._priority = 0;
newEvent._Bu._slot = projectileThing.toUint16();
@@ -76,7 +76,7 @@ bool ProjExpl::hasProjectileImpactOccurred(int16 impactType, int16 mapXCombo, in
Projectile *projectileThingData = (Projectile *)_vm->_dungeonMan->getThingData(Thing(projectileThing));
bool removePotion = false;
int16 potionPower = 0;
- _creatureDamageOutcome = k0_outcomeKilledNoCreaturesInGroup;
+ _creatureDamageOutcome = kDMKillOutcomeNoCreaturesInGroup;
Thing projectileAssociatedThing = projectileThingData->_slot;
int16 projectileAssociatedThingType = projectileAssociatedThing.getType();
Potion *potion = nullptr;
@@ -118,7 +118,7 @@ bool ProjExpl::hasProjectileImpactOccurred(int16 impactType, int16 mapXCombo, in
Door *curDoor = (Door *)_vm->_dungeonMan->getSquareFirstThingData(projectileTargetMapX, projectileTargetMapY);
if ((curDoorState != kDMDoorStateDestroyed) && (projectileAssociatedThing == Thing::_explOpenDoor)) {
if (curDoor->hasButton())
- _vm->_moveSens->addEvent(k10_TMEventTypeDoor, projectileTargetMapX, projectileTargetMapY, kDMCellNorthWest, kDMSensorEffectToggle, _vm->_gameTime + 1);
+ _vm->_moveSens->addEvent(kDMEventTypeDoor, projectileTargetMapX, projectileTargetMapY, kDMCellNorthWest, kDMSensorEffectToggle, _vm->_gameTime + 1);
break;
}
@@ -163,26 +163,26 @@ bool ProjExpl::hasProjectileImpactOccurred(int16 impactType, int16 mapXCombo, in
return false;
curCreatureIndex--;
- uint16 curCreatureType = curGroup->_type;
+ CreatureType curCreatureType = curGroup->_type;
CreatureInfo *curCreatureInfo = &_vm->_dungeonMan->_creatureInfos[curCreatureType];
- if ((projectileAssociatedThing == Thing::_explFireBall) && (curCreatureType == k11_CreatureTypeBlackFlame)) {
+ if ((projectileAssociatedThing == Thing::_explFireBall) && (curCreatureType == kDMCreatureTypeBlackFlame)) {
uint16 *curCreatureHealth = &curGroup->_health[curCreatureIndex];
*curCreatureHealth = MIN(1000, *curCreatureHealth + getProjectileImpactAttack(projectileThingData, projectileAssociatedThing));
goto T0217044;
}
- if (getFlag(curCreatureInfo->_attributes, k0x0040_MaskCreatureInfo_nonMaterial) && (projectileAssociatedThing != Thing::_explHarmNonMaterial))
+ if (getFlag(curCreatureInfo->_attributes, kDMCreatureMaskNonMaterial) && (projectileAssociatedThing != Thing::_explHarmNonMaterial))
return false;
attack = (uint16)((unsigned long)getProjectileImpactAttack(projectileThingData, projectileAssociatedThing) << 6) / curCreatureInfo->_defense;
if (attack) {
int16 outcome = _vm->_groupMan->groupGetDamageCreatureOutcome(curGroup, curCreatureIndex, projectileTargetMapX, projectileTargetMapY, attack + _vm->_groupMan->groupGetResistanceAdjustedPoisonAttack(curCreatureType, _projectilePoisonAttack), true);
- if (outcome != k0_outcomeKilledNoCreaturesInGroup)
- _vm->_groupMan->processEvents29to41(projectileTargetMapX, projectileTargetMapY, kM2_TMEventTypeCreateReactionEvent30HitByProjectile, 0);
+ if (outcome != kDMKillOutcomeNoCreaturesInGroup)
+ _vm->_groupMan->processEvents29to41(projectileTargetMapX, projectileTargetMapY, kDMEventTypeCreateReactionHitByProjectile, 0);
_creatureDamageOutcome = outcome;
- if (!createExplosionOnImpact && (outcome == k0_outcomeKilledNoCreaturesInGroup)
+ if (!createExplosionOnImpact && (outcome == kDMKillOutcomeNoCreaturesInGroup)
&& (projectileAssociatedThingType == kDMThingTypeWeapon)
- && getFlag(curCreatureInfo->_attributes, k0x0400_MaskCreatureInfo_keepThrownSharpWeapon)) {
+ && getFlag(curCreatureInfo->_attributes, kDMCreatureMaskKeepThrownSharpWeapon)) {
Weapon *weapon = (Weapon *)_vm->_dungeonMan->getThingData(projectileAssociatedThing);
WeaponType weaponType = weapon->getType();
if ((weaponType == kDMWeaponDagger) || (weaponType == kDMWeaponArrow)
@@ -208,15 +208,15 @@ bool ProjExpl::hasProjectileImpactOccurred(int16 impactType, int16 mapXCombo, in
}
if ((projectileAssociatedThing == Thing::_explLightningBolt) && !(explosionAttack >>= 1))
goto T0217044;
- createExplosion(projectileAssociatedThing, explosionAttack, mapXCombo, mapYCombo, (projectileAssociatedThing == Thing::_explPoisonCloud) ? (uint16)k255_CreatureTypeSingleCenteredCreature : cell);
+ createExplosion(projectileAssociatedThing, explosionAttack, mapXCombo, mapYCombo, (projectileAssociatedThing == Thing::_explPoisonCloud) ? (uint16)kDMCreatureTypeSingleCenteredCreature : cell);
} else {
uint16 soundIndex;
if ((projectileAssociatedThing).getType() == kDMThingTypeWeapon)
- soundIndex = k00_soundMETALLIC_THUD;
+ soundIndex = kDMSoundIndexMetallicThud;
else if (projectileAssociatedThing == Thing::_explPoisonBolt)
- soundIndex = k13_soundSPELL;
+ soundIndex = kDMSoundIndexSpell;
else
- soundIndex = k04_soundWOODEN_THUD_ATTACK_TROLIN_ANTMAN_STONE_GOLEM;
+ soundIndex = kDMSoundIndexWoodenThudAttackTrolinAntmanStoneGolem;
_vm->_sound->requestPlay(soundIndex, projectileMapX, projectileMapY, kDMSoundModePlayIfPrioritized);
}
@@ -294,7 +294,7 @@ void ProjExpl::createExplosion(Thing explThing, uint16 attack, uint16 mapXCombo,
projectileMapY >>= 8;
}
- if (cell == k255_CreatureTypeSingleCenteredCreature)
+ if (cell == kDMCreatureTypeSingleCenteredCreature)
explosion->setCentered(true);
else {
explosion->setCentered(false);
@@ -304,15 +304,15 @@ void ProjExpl::createExplosion(Thing explThing, uint16 attack, uint16 mapXCombo,
explosion->setType(explThing.toUint16() - Thing::_firstExplosion.toUint16());
explosion->setAttack(attack);
if (explThing.toUint16() < Thing::_explHarmNonMaterial.toUint16()) {
- uint16 soundIndex = (attack > 80) ? k05_soundSTRONG_EXPLOSION : k20_soundWEAK_EXPLOSION;
+ uint16 soundIndex = (attack > 80) ? kDMSoundIndexStrongExplosion : kDMSoundIndexWeakExplosion;
_vm->_sound->requestPlay(soundIndex, projectileMapX, projectileMapY, kDMSoundModePlayIfPrioritized);
} else if (explThing != Thing::_explSmoke)
- _vm->_sound->requestPlay(k13_soundSPELL, projectileMapX, projectileMapY, kDMSoundModePlayIfPrioritized);
+ _vm->_sound->requestPlay(kDMSoundIndexSpell, projectileMapX, projectileMapY, kDMSoundModePlayIfPrioritized);
_vm->_dungeonMan->linkThingToList(unusedThing, Thing(0), projectileMapX, projectileMapY);
TimelineEvent newEvent;
- _vm->setMapAndTime(newEvent._mapTime, _vm->_dungeonMan->_currMapIndex, _vm->_gameTime + ((explThing == Thing::_explRebirthStep1) ? 5 : 1));
- newEvent._type = k25_TMEventTypeExplosion;
+ newEvent._mapTime = _vm->setMapAndTime(_vm->_dungeonMan->_currMapIndex, _vm->_gameTime + ((explThing == Thing::_explRebirthStep1) ? 5 : 1));
+ newEvent._type = kDMEventTypeExplosion;
newEvent._priority = 0;
newEvent._Cu._slot = unusedThing.toUint16();
newEvent._Bu._location._mapX = projectileMapX;
@@ -334,7 +334,7 @@ void ProjExpl::createExplosion(Thing explThing, uint16 attack, uint16 mapXCombo,
CreatureInfo *creatureInfo = &_vm->_dungeonMan->_creatureInfos[creatureGroup->_type];
int16 creatureFireResistance = creatureInfo->getFireResistance();
if (creatureFireResistance != kDMImmuneToFire) {
- if (getFlag(creatureInfo->_attributes, k0x0040_MaskCreatureInfo_nonMaterial))
+ if (getFlag(creatureInfo->_attributes, kDMCreatureMaskNonMaterial))
attack >>= 2;
if ((attack -= _vm->getRandomNumber((creatureFireResistance << 1) + 1)) > 0)
@@ -349,14 +349,14 @@ void ProjExpl::createExplosion(Thing explThing, uint16 attack, uint16 mapXCombo,
int16 ProjExpl::projectileGetImpactCount(int16 impactType, int16 mapX, int16 mapY, int16 cell) {
int16 impactCount = 0;
- _creatureDamageOutcome = k0_outcomeKilledNoCreaturesInGroup;
+ _creatureDamageOutcome = kDMKillOutcomeNoCreaturesInGroup;
for (Thing curThing = _vm->_dungeonMan->getSquareFirstThing(mapX, mapY); curThing != Thing::_endOfList; ) {
if (((curThing).getType() == kDMThingTypeProjectile) && ((curThing).getCell() == cell) &&
hasProjectileImpactOccurred(impactType, mapX, mapY, cell, curThing)) {
projectileDeleteEvent(curThing);
impactCount++;
- if ((impactType == kDMElementTypeCreature) && (_creatureDamageOutcome == k2_outcomeKilledAllCreaturesInGroup))
+ if ((impactType == kDMElementTypeCreature) && (_creatureDamageOutcome == kDMKillOutcomeAllCreaturesInGroup))
break;
curThing = _vm->_dungeonMan->getSquareFirstThing(mapX, mapY);
@@ -400,8 +400,8 @@ void ProjExpl::processEvents48To49(TimelineEvent *event) {
int16 destinationMapX = curEvent->_Cu._projectile.getMapX();
int16 destinationMapY = curEvent->_Cu._projectile.getMapY();
- if (curEvent->_type == k48_TMEventTypeMoveProjectileIgnoreImpacts)
- curEvent->_type = k49_TMEventTypeMoveProjectile;
+ if (curEvent->_type == kDMEventTypeMoveProjectileIgnoreImpacts)
+ curEvent->_type = kDMEventTypeMoveProjectile;
else {
uint16 projectileCurCell = projectileThingNewCell.getCell();
if ((_vm->_dungeonMan->_currMapIndex == _vm->_dungeonMan->_partyMapIndex) && (destinationMapX == _vm->_dungeonMan->_partyMapX) && (destinationMapY == _vm->_dungeonMan->_partyMapY) && hasProjectileImpactOccurred(kDMElementTypeChampion, destinationMapX, destinationMapY, projectileCurCell, projectileThingNewCell))
@@ -453,7 +453,7 @@ void ProjExpl::processEvents48To49(TimelineEvent *event) {
curEvent->_Cu._projectile.setMapY(_vm->_moveSens->_moveResultMapY);
curEvent->_Cu._projectile.setDir((Direction)_vm->_moveSens->_moveResultDir);
projectileThingNewCell = _vm->thingWithNewCell(projectileThingNewCell, _vm->_moveSens->_moveResultCell);
- M31_setMap(curEvent->_mapTime, _vm->_moveSens->_moveResultMapIndex);
+ _vm->setMap(curEvent->_mapTime, _vm->_moveSens->_moveResultMapIndex);
} else {
if ((Square(_vm->_dungeonMan->getSquare(destinationMapX, destinationMapY)).getType() == kDMElementTypeDoor) && hasProjectileImpactOccurred(kDMElementTypeDoor, destinationMapX, destinationMapY, projectileNewCell, projectileThing))
return;
@@ -480,7 +480,7 @@ void ProjExpl::processEvent25(TimelineEvent *event) {
Group *group = nullptr;
CreatureInfo *creatureInfo = nullptr;
- uint16 creatureType = 0;
+ CreatureType creatureType;
if (groupThing != Thing::_endOfList) {
group = (Group *)_vm->_dungeonMan->getThingData(groupThing);
creatureType = group->_type;
@@ -508,15 +508,15 @@ void ProjExpl::processEvent25(TimelineEvent *event) {
break;
case 0xFF83:
- if ((groupThing != Thing::_endOfList) && getFlag(creatureInfo->_attributes, k0x0040_MaskCreatureInfo_nonMaterial)) {
- if ((creatureType == k19_CreatureTypeMaterializerZytaz) && (_vm->_dungeonMan->_currMapIndex == _vm->_dungeonMan->_partyMapIndex)) {
+ if ((groupThing != Thing::_endOfList) && getFlag(creatureInfo->_attributes, kDMCreatureMaskNonMaterial)) {
+ if ((creatureType == kDMCreatureTypeMaterializerZytaz) && (_vm->_dungeonMan->_currMapIndex == _vm->_dungeonMan->_partyMapIndex)) {
int16 nonMaterialAdditionalAttack = attack >> 3;
attack -= nonMaterialAdditionalAttack;
nonMaterialAdditionalAttack <<= 1;
nonMaterialAdditionalAttack++;
int16 creatureCount = group->getCount();
do {
- if (getFlag(_vm->_groupMan->_activeGroups[group->getActiveGroupIndex()]._aspect[creatureCount], k0x0080_MaskActiveGroupIsAttacking)) /* Materializer / Zytaz can only be damaged while they are attacking */
+ if (getFlag(_vm->_groupMan->_activeGroups[group->getActiveGroupIndex()]._aspect[creatureCount], kDMAspectMaskActiveGroupIsAttacking)) /* Materializer / Zytaz can only be damaged while they are attacking */
_vm->_groupMan->groupGetDamageCreatureOutcome(group, creatureCount, mapX, mapY, attack + _vm->getRandomNumber(nonMaterialAdditionalAttack) + _vm->getRandomNumber(4), true);
} while (--creatureCount >= 0);
} else
@@ -525,7 +525,7 @@ void ProjExpl::processEvent25(TimelineEvent *event) {
break;
case 0xFFE4:
explosion->setType(explosion->getType() + 1);
- _vm->_sound->requestPlay(k05_soundSTRONG_EXPLOSION, mapX, mapY, kDMSoundModePlayIfPrioritized);
+ _vm->_sound->requestPlay(kDMSoundIndexStrongExplosion, mapX, mapY, kDMSoundModePlayIfPrioritized);
AddEventFl = true;
break;
case 0xFFA8:
@@ -539,9 +539,9 @@ void ProjExpl::processEvent25(TimelineEvent *event) {
_vm->_championMan->getDamagedChampionCount(attack, kDMWoundNone, kDMAttackTypeNormal);
else if ((groupThing != Thing::_endOfList)
&& (attack = _vm->_groupMan->groupGetResistanceAdjustedPoisonAttack(creatureType, attack))
- && (_vm->_groupMan->getDamageAllCreaturesOutcome(group, mapX, mapY, attack, true) != k2_outcomeKilledAllCreaturesInGroup)
+ && (_vm->_groupMan->getDamageAllCreaturesOutcome(group, mapX, mapY, attack, true) != kDMKillOutcomeAllCreaturesInGroup)
&& (attack > 2)) {
- _vm->_groupMan->processEvents29to41(mapX, mapY, kM3_TMEventTypeCreateReactionEvent29DangerOnSquare, 0);
+ _vm->_groupMan->processEvents29to41(mapX, mapY, kDMEventTypeCreateReactionDangerOnSquare, 0);
}
if (explosion->getAttack() >= 6) {
explosion->setAttack(explosion->getAttack() - 3);
diff --git a/engines/dm/projexpl.h b/engines/dm/projexpl.h
index 7559fef361..d7b598a934 100644
--- a/engines/dm/projexpl.h
+++ b/engines/dm/projexpl.h
@@ -31,46 +31,11 @@
namespace DM {
-#define k0_outcomeKilledNoCreaturesInGroup 0 // @ C0_OUTCOME_KILLED_NO_CREATURES_IN_GROUP
-#define k1_outcomeKilledSomeCreaturesInGroup 1 // @ C1_OUTCOME_KILLED_SOME_CREATURES_IN_GROUP
-#define k2_outcomeKilledAllCreaturesInGroup 2 // @ C2_OUTCOME_KILLED_ALL_CREATURES_IN_GROUP
-
-#define k00_soundMETALLIC_THUD 0 // @ C00_SOUND_METALLIC_THUD
-#define k01_soundSWITCH 1 // @ C01_SOUND_SWITCH
-#define k02_soundDOOR_RATTLE 2 // @ C02_SOUND_DOOR_RATTLE
-#define k03_soundATTACK_PAIN_RAT_HELLHOUND_RED_DRAGON 3 // @ C03_SOUND_ATTACK_PAIN_RAT_HELLHOUND_RED_DRAGON
-#define k04_soundWOODEN_THUD_ATTACK_TROLIN_ANTMAN_STONE_GOLEM 4 // @ C04_SOUND_WOODEN_THUD_ATTACK_TROLIN_ANTMAN_STONE_GOLEM
-#define k05_soundSTRONG_EXPLOSION 5 // @ C05_SOUND_STRONG_EXPLOSION
-#define k06_soundSCREAM 6 // @ C06_SOUND_SCREAM
-#define k07_soundATTACK_MUMMY_GHOST_RIVE 7 // @ C07_SOUND_ATTACK_MUMMY_GHOST_RIVE
-#define k08_soundSWALLOW 8 // @ C08_SOUND_SWALLOW
-#define k09_soundCHAMPION_0_DAMAGED 9 // @ C09_SOUND_CHAMPION_0_DAMAGED
-#define k10_soundCHAMPION_1_DAMAGED 10 // @ C10_SOUND_CHAMPION_1_DAMAGED
-#define k11_soundCHAMPION_2_DAMAGED 11 // @ C11_SOUND_CHAMPION_2_DAMAGED
-#define k12_soundCHAMPION_3_DAMAGED 12 // @ C12_SOUND_CHAMPION_3_DAMAGED
-#define k13_soundSPELL 13 // @ C13_SOUND_SPELL
-#define k14_soundATTACK_SCREAMER_OITU 14 // @ C14_SOUND_ATTACK_SCREAMER_OITU
-#define k15_soundATTACK_GIANT_SCORPION_SCORPION 15 // @ C15_SOUND_ATTACK_GIANT_SCORPION_SCORPION
-#define k16_soundCOMBAT_ATTACK_SKELETON_ANIMATED_ARMOUR_DETH_KNIGHT 16 // @ C16_SOUND_COMBAT_ATTACK_SKELETON_ANIMATED_ARMOUR_DETH_KNIGHT
-#define k17_soundBUZZ 17 // @ C17_SOUND_BUZZ
-#define k18_soundPARTY_DAMAGED 18 // @ C18_SOUND_PARTY_DAMAGED
-#define k19_soundATTACK_MAGENTA_WORM_WORM 19 // @ C19_SOUND_ATTACK_MAGENTA_WORM_WORM
-#define k20_soundWEAK_EXPLOSION 20 // @ C20_SOUND_WEAK_EXPLOSION
-#define k21_soundATTACK_GIGGLER 21 // @ C21_SOUND_ATTACK_GIGGLER
-#define k22_soundMOVE_ANIMATED_ARMOUR_DETH_KNIGHT 22 // @ C22_SOUND_MOVE_ANIMATED_ARMOUR_DETH_KNIGHT
-#define k23_soundMOVE_COUATL_GIANT_WASP_MUNCHER 23 // @ C23_SOUND_MOVE_COUATL_GIANT_WASP_MUNCHER
-#define k24_soundMOVE_MUMMY_TROLIN_ANTMAN_STONE_GOLEM_GIGGLER_VEXIRK_DEMON 24 // @ C24_SOUND_MOVE_MUMMY_TROLIN_ANTMAN_STONE_GOLEM_GIGGLER_VEXIRK_DEMON
-#define k25_soundBLOW_HORN 25 // @ C25_SOUND_BLOW_HORN
-#define k26_soundMOVE_SCREAMER_ROCK_ROCKPILE_MAGENTA_WORM_WORM_PAIN_RAT_HELLHOUND_RUSTER_GIANT_SCORPION_SCORPION_OITU 26 // @ C26_SOUND_MOVE_SCREAMER_ROCK_ROCKPILE_MAGENTA_WORM_WORM_PAIN_RAT_HELLHOUND_RUSTER_GIANT_SCORPION_SCORPION_OITU
-#define k27_soundMOVE_SWAMP_SLIME_SLIME_DEVIL_WATER_ELEMENTAL 27 // @ C27_SOUND_MOVE_SWAMP_SLIME_SLIME_DEVIL_WATER_ELEMENTAL
-#define k28_soundWAR_CRY 28 // @ C28_SOUND_WAR_CRY
-#define k29_soundATTACK_ROCK_ROCKPILE 29 // @ C29_SOUND_ATTACK_ROCK_ROCKPILE
-#define k30_soundATTACK_WATER_ELEMENTAL 30 // @ C30_SOUND_ATTACK_WATER_ELEMENTAL
-#define k31_soundATTACK_COUATL 31 // @ C31_SOUND_ATTACK_COUATL
-#define k32_soundMOVE_RED_DRAGON 32 // @ C32_SOUND_MOVE_RED_DRAGON
-#define k33_soundMOVE_SKELETON 33 // @ C33_SOUND_MOVE_SKELETON
-
-#define M31_setMap(map_time, map) ((map_time) = (((map_time) & 0x00FFFFFF) | (((int32)(map)) << 24)))
+enum KillOutcome {
+ kDMKillOutcomeNoCreaturesInGroup = 0, // @ C0_OUTCOME_KILLED_NO_CREATURES_IN_GROUP
+ kDMKillOutcomeSomeCreaturesInGroup = 1, // @ C1_OUTCOME_KILLED_SOME_CREATURES_IN_GROUP
+ kDMKillOutcomeAllCreaturesInGroup = 2 // @ C2_OUTCOME_KILLED_ALL_CREATURES_IN_GROUP
+};
class TimelineEvent;
class Projectile;
@@ -101,7 +66,6 @@ public:
void processEvents48To49(TimelineEvent *event); // @ F0219_PROJECTILE_ProcessEvents48To49_Projectile
void processEvent25(TimelineEvent *event); // @ F0220_EXPLOSION_ProcessEvent25_Explosion
};
-
}
#endif
diff --git a/engines/dm/sounds.cpp b/engines/dm/sounds.cpp
index 0c14cda19e..bd7d4042f8 100644
--- a/engines/dm/sounds.cpp
+++ b/engines/dm/sounds.cpp
@@ -52,7 +52,7 @@ SoundMan *SoundMan::getSoundMan(DMEngine *vm, const DMADGameDescription *gameVer
}
void SoundMan::initConstants() {
- Sound sounds[k34_D13_soundCount] = {
+ Sound sounds[kDMSoundCount] = {
Sound(533, 112, 11, 3, 6), /* k00_soundMETALLIC_THUD 0 */
Sound(534, 112, 15, 0, 3), /* k01_soundSWITCH 1 */
Sound(535, 112, 72, 3, 6), /* k02_soundDOOR_RATTLE 2 */
@@ -88,7 +88,7 @@ void SoundMan::initConstants() {
Sound(573, 138, 29, 0, 4), /* k32_soundMOVE_RED_DRAGON 32 Atari ST: not present */
Sound(574, 150, 22, 0, 4) /* k33_soundMOVE_SKELETON 33 Atari ST: not present */
};
- for (int i = 0; i < k34_D13_soundCount; i++)
+ for (int i = 0; i < kDMSoundCount; i++)
_sounds[i] = sounds[i];
}
@@ -97,12 +97,12 @@ SoundMan::SoundMan(DMEngine *vm) : _vm(vm) {
}
SoundMan::~SoundMan() {
- for (uint16 i = 0; i < k34_D13_soundCount; ++i)
+ for (uint16 i = 0; i < kDMSoundCount; ++i)
delete[] _soundData[i]._firstSample;
}
void SoundMan::loadSounds() {
- for (uint16 soundIndex = 0; soundIndex < k34_D13_soundCount; ++soundIndex) {
+ for (uint16 soundIndex = 0; soundIndex < kDMSoundCount; ++soundIndex) {
SoundData *soundData = _soundData + soundIndex;
uint16 graphicIndex = _sounds[soundIndex]._graphicIndex;
@@ -203,8 +203,8 @@ void SoundMan::requestPlay(uint16 soundIndex, int16 mapX, int16 mapY, SoundMode
Sound *sound = &_sounds[soundIndex];
if (soundMode == kDMSoundModePlayOneTickLater) { /* Add an event in the timeline to play the sound (mode - 1) ticks later */
TimelineEvent newEvent;
- _vm->setMapAndTime(newEvent._mapTime, _vm->_dungeonMan->_currMapIndex, _vm->_gameTime + soundMode - 1);
- newEvent._type = k20_TMEventTypePlaySound;
+ newEvent._mapTime = _vm->setMapAndTime(_vm->_dungeonMan->_currMapIndex, _vm->_gameTime + soundMode - 1);
+ newEvent._type = kDMEventTypePlaySound;
newEvent._priority = sound->_priority;
newEvent._Cu._soundIndex = soundIndex;
newEvent._Bu._location._mapX = mapX;
diff --git a/engines/dm/sounds.h b/engines/dm/sounds.h
index 92b9340dbd..04c51719d4 100644
--- a/engines/dm/sounds.h
+++ b/engines/dm/sounds.h
@@ -32,7 +32,51 @@
namespace DM {
-#define k34_D13_soundCount 34 // @ D13_SOUND_COUNT
+enum SoundMode {
+ kDMSoundModeDoNotPlaySound = -1, // @ CM1_MODE_DO_NOT_PLAY_SOUND
+ kDMSoundModePlayImmediately = 0, // @ C00_MODE_PLAY_IMMEDIATELY
+ kDMSoundModePlayIfPrioritized = 1, // @ C01_MODE_PLAY_IF_PRIORITIZED
+ kDMSoundModePlayOneTickLater = 2 // @ C02_MODE_PLAY_ONE_TICK_LATER
+};
+
+enum SoundIndex {
+ kDMSoundIndexMetallicThud = 0, // @ C00_SOUND_METALLIC_THUD
+ kDMSoundIndexSwitch = 1, // @ C01_SOUND_SWITCH
+ kDMSoundIndexDoorRattle = 2, // @ C02_SOUND_DOOR_RATTLE
+ kDMSoundIndexAttackPainRatHellHoundRedDragon = 3, // @ C03_SOUND_ATTACK_PAIN_RAT_HELLHOUND_RED_DRAGON
+ kDMSoundIndexWoodenThudAttackTrolinAntmanStoneGolem = 4, // @ C04_SOUND_WOODEN_THUD_ATTACK_TROLIN_ANTMAN_STONE_GOLEM
+ kDMSoundIndexStrongExplosion = 5, // @ C05_SOUND_STRONG_EXPLOSION
+ kDMSoundIndexScream = 6, // @ C06_SOUND_SCREAM
+ kDMSoundIndexAttackMummyGhostRive = 7, // @ C07_SOUND_ATTACK_MUMMY_GHOST_RIVE
+ kDMSoundIndexSwallow = 8, // @ C08_SOUND_SWALLOW
+ kDMSoundIndexChampion0Damaged = 9, // @ C09_SOUND_CHAMPION_0_DAMAGED
+ kDMSoundIndexChampion1Damaged = 10, // @ C10_SOUND_CHAMPION_1_DAMAGED
+ kDMSoundIndexChampion2Damaged = 11, // @ C11_SOUND_CHAMPION_2_DAMAGED
+ kDMSoundIndexChampion3Damaged = 12, // @ C12_SOUND_CHAMPION_3_DAMAGED
+ kDMSoundIndexSpell = 13, // @ C13_SOUND_SPELL
+ kDMSoundIndexAttackScreamerOitu = 14, // @ C14_SOUND_ATTACK_SCREAMER_OITU
+ kDMSoundIndexAttackGiantScorpion = 15, // @ C15_SOUND_ATTACK_GIANT_SCORPION_SCORPION
+ kDMSoundIndexAttackSkelettonAnimatedArmorDethKnight = 16, // @ C16_SOUND_COMBAT_ATTACK_SKELETON_ANIMATED_ARMOUR_DETH_KNIGHT
+ kDMSoundIndexBuzz = 17, // @ C17_SOUND_BUZZ
+ kDMSoundIndexPartyDamaged = 18, // @ C18_SOUND_PARTY_DAMAGED
+ kDMSoundIndexAttackMagentaWorm = 19, // @ C19_SOUND_ATTACK_MAGENTA_WORM_WORM
+ kDMSoundIndexWeakExplosion = 20, // @ C20_SOUND_WEAK_EXPLOSION
+ kDMSoundIndexAttackGiggler = 21, // @ C21_SOUND_ATTACK_GIGGLER
+ kDMSoundIndexMoveAnimatedArmorDethKnight = 22, // @ C22_SOUND_MOVE_ANIMATED_ARMOUR_DETH_KNIGHT
+ kDMSoundIndexMoveCouatlGiantWaspMuncher = 23, // @ C23_SOUND_MOVE_COUATL_GIANT_WASP_MUNCHER
+ kDMSoundIndexMoveMummyTrolinAntmanStoneGolemGiggleVexirkDemon = 24, // @ C24_SOUND_MOVE_MUMMY_TROLIN_ANTMAN_STONE_GOLEM_GIGGLER_VEXIRK_DEMON
+ kDMSoundIndexBlowHorn = 25, // @ C25_SOUND_BLOW_HORN
+ kDMSoundIndexMoveScreamerRocksWormPainRatHellHoundRusterScorpionsOitu = 26, // @ C26_SOUND_MOVE_SCREAMER_ROCK_ROCKPILE_MAGENTA_WORM_WORM_PAIN_RAT_HELLHOUND_RUSTER_GIANT_SCORPION_SCORPION_OITU
+ kDMSoundIndexMoveSlimesDevilWaterElemental = 27, // @ C27_SOUND_MOVE_SWAMP_SLIME_SLIME_DEVIL_WATER_ELEMENTAL
+ kDMSoundIndexWarCry = 28, // @ C28_SOUND_WAR_CRY
+ kDMSoundIndexAttackRocks = 29, // @ C29_SOUND_ATTACK_ROCK_ROCKPILE
+ kDMSoundIndexAttackWaterElemental = 30, // @ C30_SOUND_ATTACK_WATER_ELEMENTAL
+ kDMSoundIndexAttackCouatl = 31, // @ C31_SOUND_ATTACK_COUATL
+ kDMSoundIndexMoveRedDragon = 32, // @ C32_SOUND_MOVE_RED_DRAGON
+ kDMSoundIndexMoveSkeletton = 33 // @ C33_SOUND_MOVE_SKELETON
+};
+
+#define kDMSoundCount 34 // @ D13_SOUND_COUNT
class SoundData {
public:
@@ -73,7 +117,7 @@ public:
static SoundMan *getSoundMan(DMEngine *vm, const DMADGameDescription *gameVersion);
- SoundData _soundData[k34_D13_soundCount]; // @ K0024_as_SoundData
+ SoundData _soundData[kDMSoundCount]; // @ K0024_as_SoundData
Common::Queue<PendingSound> _pendingSounds;
virtual void loadSounds(); // @ F0503_SOUND_LoadAll
@@ -82,7 +126,7 @@ public:
void playPendingSound(); // @ F0065_SOUND_PlayPendingSound_CPSD
bool soundGetVolume(int16 mapX, int16 mapY, uint8 *leftVolume, uint8 *rightVolume); // @ F0505_SOUND_GetVolume
- Sound _sounds[k34_D13_soundCount];
+ Sound _sounds[kDMSoundCount];
void initConstants();
};
diff --git a/engines/dm/text.cpp b/engines/dm/text.cpp
index dcf7e27a8e..825c86a3b9 100644
--- a/engines/dm/text.cpp
+++ b/engines/dm/text.cpp
@@ -60,29 +60,29 @@ void TextMan::printTextToBitmap(byte *destBitmap, uint16 destByteWidth, int16 de
uint16 textLength = strlen(text);
uint16 nextX = destX;
uint16 nextY = destY;
- byte *srcBitmap = _vm->_displayMan->getNativeBitmapOrGraphic(k557_FontGraphicIndice);
+ byte *srcBitmap = _vm->_displayMan->getNativeBitmapOrGraphic(kDMGraphicIdxFont);
byte *tmp = _vm->_displayMan->_tmpBitmap;
- for (uint16 i = 0; i < (k5_LetterWidth + 1) * k6_LetterHeight * 128; ++i)
+ for (uint16 i = 0; i < (kDMFontLetterWidth + 1) * kDMFontLetterHeight * 128; ++i)
tmp[i] = srcBitmap[i] ? textColor : bgColor;
srcBitmap = tmp;
for (const char *begin = text, *end = text + textLength; begin != end; ++begin) {
- if (nextX + k5_LetterWidth + 1 >= destPixelWidth || (*begin == '\n')) {
+ if (nextX + kDMFontLetterWidth + 1 >= destPixelWidth || (*begin == '\n')) {
nextX = destX;
- nextY += k6_LetterHeight + 1;
+ nextY += kDMFontLetterHeight + 1;
}
- if (nextY + k6_LetterHeight >= destHeight)
+ if (nextY + kDMFontLetterHeight >= destHeight)
break;
uint16 srcX = (1 + 5) * *begin; // 1 + 5 is not the letter width, arbitrary choice of the unpacking code
- Box box((nextX == destX) ? (nextX + 1) : nextX, nextX + k5_LetterWidth + 1, nextY, nextY + k6_LetterHeight - 1);
- _vm->_displayMan->blitToBitmap(srcBitmap, destBitmap, box, (nextX == destX) ? (srcX + 1) : srcX, 0, 6 * 128 / 2, destByteWidth, kM1_ColorNoTransparency,
- k6_LetterHeight, destHeight);
+ Box box((nextX == destX) ? (nextX + 1) : nextX, nextX + kDMFontLetterWidth + 1, nextY, nextY + kDMFontLetterHeight - 1);
+ _vm->_displayMan->blitToBitmap(srcBitmap, destBitmap, box, (nextX == destX) ? (srcX + 1) : srcX, 0, 6 * 128 / 2, destByteWidth, kDMColorNoTransparency,
+ kDMFontLetterHeight, destHeight);
- nextX += k5_LetterWidth + 1;
+ nextX += kDMFontLetterWidth + 1;
}
}
@@ -103,7 +103,7 @@ void TextMan::printWithTrailingSpaces(byte *destBitmap, int16 destByteWidth, int
}
void TextMan::printLineFeed() {
- printMessage(k0_ColorBlack, "\n");
+ printMessage(kDMColorBlack, "\n");
}
void TextMan::printMessage(Color color, const char *string, bool printWithScroll) {
@@ -141,7 +141,7 @@ void TextMan::printMessage(Color color, const char *string, bool printWithScroll
void TextMan::createNewRow() {
if (_messageAreaCursorRow == 3) {
isTextScrolling(&_textScroller, true);
- memset(_bitmapMessageAreaNewRow, k0_ColorBlack, 320 * 7);
+ memset(_bitmapMessageAreaNewRow, kDMColorBlack, 320 * 7);
_isScrolling = true;
setScrollerCommand(&_textScroller, 1);
@@ -156,9 +156,9 @@ void TextMan::createNewRow() {
void TextMan::printString(Color color, const char* string) {
int16 stringLength = strlen(string);
if (isTextScrolling(&_textScroller, false))
- printToLogicalScreen(_messageAreaCursorColumn * 6, (_messageAreaCursorRow * 7 - 1) + 177, color, k0_ColorBlack, string);
+ printToLogicalScreen(_messageAreaCursorColumn * 6, (_messageAreaCursorRow * 7 - 1) + 177, color, kDMColorBlack, string);
else {
- printTextToBitmap(_bitmapMessageAreaNewRow, k160_byteWidthScreen, _messageAreaCursorColumn * 6, 0, color, k0_ColorBlack, string, 7);
+ printTextToBitmap(_bitmapMessageAreaNewRow, k160_byteWidthScreen, _messageAreaCursorColumn * 6, 0, color, kDMColorBlack, string, 7);
_isScrolling = true;
if (isTextScrolling(&_textScroller, false))
setScrollerCommand(&_textScroller, 1);
@@ -192,15 +192,16 @@ void TextMan::moveCursor(int16 column, int16 row) {
void TextMan::clearExpiredRows() {
_vm->_displayMan->_useByteBoxCoordinates = false;
Box displayBox;
- displayBox._x1 = 0;
- displayBox._x2 = 319;
+ displayBox._rect.left = 0;
+ displayBox._rect.right = 319;
for (uint16 rowIndex = 0; rowIndex < 4; rowIndex++) {
int32 expirationTime = _messageAreaRowExpirationTime[rowIndex];
if ((expirationTime == -1) || (expirationTime > _vm->_gameTime) || _isScrolling)
continue;
- displayBox._y2 = (displayBox._y1 = 172 + (rowIndex * 7)) + 6;
+ displayBox._rect.top = 172 + (rowIndex * 7);
+ displayBox._rect.bottom = displayBox._rect.top + 6;
isTextScrolling(&_textScroller, true);
- _vm->_displayMan->fillBoxBitmap(_vm->_displayMan->_bitmapScreen, displayBox, k0_ColorBlack, k160_byteWidthScreen, k200_heightScreen);
+ _vm->_displayMan->fillBoxBitmap(_vm->_displayMan->_bitmapScreen, displayBox, kDMColorBlack, k160_byteWidthScreen, k200_heightScreen);
_messageAreaRowExpirationTime[rowIndex] = -1;
}
}
@@ -217,14 +218,14 @@ void TextMan::printEndGameString(int16 x, int16 y, Color textColor, const char*
wrkStringPtr++;
*wrkStringPtr = *text++;
}
- printToLogicalScreen(x, y, textColor, k12_ColorDarkestGray, modifiedString);
+ printToLogicalScreen(x, y, textColor, kDMColorDarkestGray, modifiedString);
}
void TextMan::clearAllRows() {
isTextScrolling(&_textScroller, true);
Box tmpBox(0, 319, 169, 199);
- _vm->_displayMan->fillScreenBox(tmpBox, k0_ColorBlack);
+ _vm->_displayMan->fillScreenBox(tmpBox, kDMColorBlack);
_messageAreaCursorRow = 3;
_messageAreaCursorColumn = 0;
diff --git a/engines/dm/text.h b/engines/dm/text.h
index ab40925447..b90e09058e 100644
--- a/engines/dm/text.h
+++ b/engines/dm/text.h
@@ -37,8 +37,8 @@ struct TextScroller {
// Placeholder, empty for now
}; // @ Text_Scroller
-#define k5_LetterWidth 5
-#define k6_LetterHeight 6
+#define kDMFontLetterWidth 5
+#define kDMFontLetterHeight 6
class TextMan {
DMEngine *_vm;
@@ -60,7 +60,7 @@ public:
void printTextToBitmap(byte *destBitmap, uint16 destByteWidth, int16 destX, int16 destY,
Color textColor, Color bgColor, const char *text, uint16 destHeight); // @ F0040_TEXT_Print
void printToLogicalScreen(uint16 destX, uint16 destY, Color textColor, Color bgColor, const char *text); // @ F0053_TEXT_PrintToLogicalScreen
- void printToViewport(int16 posX, int16 posY, Color textColor, const char *text, Color bgColor = k12_ColorDarkestGray); // @ F0052_TEXT_PrintToViewport
+ void printToViewport(int16 posX, int16 posY, Color textColor, const char *text, Color bgColor = kDMColorDarkestGray); // @ F0052_TEXT_PrintToViewport
void printWithTrailingSpaces(byte *destBitmap, int16 destByteWidth, int16 destX, int16 destY, Color textColor, Color bgColor,
const char *text, int16 strLenght, int16 destHeight); // @ F0041_TEXT_PrintWithTrailingSpaces
void printLineFeed(); // @ F0051_TEXT_MESSAGEAREA_PrintLineFeed
diff --git a/engines/dm/timeline.cpp b/engines/dm/timeline.cpp
index e0b6484f27..97d590f4c3 100644
--- a/engines/dm/timeline.cpp
+++ b/engines/dm/timeline.cpp
@@ -110,16 +110,16 @@ Timeline::~Timeline() {
void Timeline::initTimeline() {
_events = new TimelineEvent[_eventMaxCount];
_timeline = new uint16[_eventMaxCount];
- if (_vm->_newGameFl) {
+ if (_vm->_gameMode != kDMModeLoadSavedGame) {
for (int16 i = 0; i < _eventMaxCount; ++i)
- _events[i]._type = k0_TMEventTypeNone;
+ _events[i]._type = kDMEventTypeNone;
_eventCount = 0;
_firstUnusedEventIndex = 0;
}
}
void Timeline::deleteEvent(uint16 eventIndex) {
- _events[eventIndex]._type = k0_TMEventTypeNone;
+ _events[eventIndex]._type = kDMEventTypeNone;
if (eventIndex < _firstUnusedEventIndex)
_firstUnusedEventIndex = eventIndex;
@@ -199,16 +199,16 @@ uint16 Timeline::addEventGetEventIndex(TimelineEvent *event) {
if (_eventCount == _eventMaxCount)
error("Too many events");
- if ((event->_type >= k5_TMEventTypeCorridor) && (event->_type <= k10_TMEventTypeDoor)) {
+ if ((event->_type >= kDMEventTypeCorridor) && (event->_type <= kDMEventTypeDoor)) {
TimelineEvent *curEvent = _events;
for (uint16 eventIndex = 0; eventIndex < _eventMaxCount; eventIndex++, curEvent++) {
- if ((curEvent->_type >= k5_TMEventTypeCorridor) && (curEvent->_type <= k10_TMEventTypeDoor)) {
- if ((event->_mapTime == curEvent->_mapTime) && (event->getMapXY() == curEvent->getMapXY()) && ((curEvent->_type != k6_TMEventTypeWall) || (curEvent->_Cu.A._cell == event->_Cu.A._cell))) {
+ if ((curEvent->_type >= kDMEventTypeCorridor) && (curEvent->_type <= kDMEventTypeDoor)) {
+ if ((event->_mapTime == curEvent->_mapTime) && (event->getMapXY() == curEvent->getMapXY()) && ((curEvent->_type != kDMEventTypeWall) || (curEvent->_Cu.A._cell == event->_Cu.A._cell))) {
curEvent->_Cu.A._effect = event->_Cu.A._effect;
return eventIndex;
}
continue;
- } else if ((curEvent->_type == k1_TMEventTypeDoorAnimation) && (event->_mapTime == curEvent->_mapTime) && (event->getMapXY() == curEvent->getMapXY())) {
+ } else if ((curEvent->_type == kDMEventTypeDoorAnimation) && (event->_mapTime == curEvent->_mapTime) && (event->getMapXY() == curEvent->getMapXY())) {
if (event->_Cu.A._effect == kDMSensorEffectToggle)
event->_Cu.A._effect = 1 - curEvent->_Cu.A._effect;
@@ -216,27 +216,27 @@ uint16 Timeline::addEventGetEventIndex(TimelineEvent *event) {
break;
}
}
- } else if (event->_type == k1_TMEventTypeDoorAnimation) {
+ } else if (event->_type == kDMEventTypeDoorAnimation) {
TimelineEvent *curEvent = _events;
for (uint16 eventIndex = 0; eventIndex < _eventMaxCount; eventIndex++, curEvent++) {
if ((event->_mapTime == curEvent->_mapTime) && (event->getMapXY() == curEvent->getMapXY())) {
- if (curEvent->_type == k10_TMEventTypeDoor) {
+ if (curEvent->_type == kDMEventTypeDoor) {
if (curEvent->_Cu.A._effect == kDMSensorEffectToggle)
curEvent->_Cu.A._effect = 1 - event->_Cu.A._effect;
return eventIndex;
}
- if (curEvent->_type == k1_TMEventTypeDoorAnimation) {
+ if (curEvent->_type == kDMEventTypeDoorAnimation) {
curEvent->_Cu.A._effect = event->_Cu.A._effect;
return eventIndex;
}
}
}
- } else if (event->_type == k2_TMEventTypeDoorDestruction) {
+ } else if (event->_type == kDMEventTypeDoorDestruction) {
TimelineEvent *curEvent = _events;
for (uint16 eventIndex = 0; eventIndex < _eventMaxCount; eventIndex++, curEvent++) {
if ((event->getMapXY() == curEvent->getMapXY()) && (_vm->getMap(event->_mapTime) == _vm->getMap(curEvent->_mapTime))) {
- if ((curEvent->_type == k1_TMEventTypeDoorAnimation) || (curEvent->_type == k10_TMEventTypeDoor))
+ if ((curEvent->_type == kDMEventTypeDoorAnimation) || (curEvent->_type == kDMEventTypeDoor))
deleteEvent(eventIndex);
}
}
@@ -248,7 +248,7 @@ uint16 Timeline::addEventGetEventIndex(TimelineEvent *event) {
if (_firstUnusedEventIndex == _eventMaxCount)
break;
_firstUnusedEventIndex++;
- } while ((_events[_firstUnusedEventIndex])._type != k0_TMEventTypeNone);
+ } while ((_events[_firstUnusedEventIndex])._type != kDMEventTypeNone);
_timeline[_eventCount] = newEventIndex;
fixChronology(_eventCount++);
return newEventIndex;
@@ -260,108 +260,111 @@ void Timeline::processTimeline() {
TimelineEvent *curEvent = &newEvent;
extractFirstEvent(curEvent);
_vm->_dungeonMan->setCurrentMap(_vm->getMap(newEvent._mapTime));
- uint16 curEventType = newEvent._type;
- if ((curEventType > (k29_TMEventTypeGroupReactionDangerOnSquare - 1)) && (curEventType < (k41_TMEventTypeUpdateBehaviour_3 + 1)))
+ TimelineEventType curEventType = newEvent._type;
+ if ((curEventType > (kDMEventTypeGroupReactionDangerOnSquare - 1)) && (curEventType < (kDMEventTypeUpdateBehavior3 + 1)))
_vm->_groupMan->processEvents29to41(newEvent._Bu._location._mapX, newEvent._Bu._location._mapY, curEventType, newEvent._Cu._ticks);
else {
switch (curEventType) {
- case k48_TMEventTypeMoveProjectileIgnoreImpacts:
- case k49_TMEventTypeMoveProjectile:
+ case kDMEventTypeMoveProjectileIgnoreImpacts:
+ case kDMEventTypeMoveProjectile:
_vm->_projexpl->processEvents48To49(curEvent);
break;
- case k1_TMEventTypeDoorAnimation:
+ case kDMEventTypeDoorAnimation:
processEventDoorAnimation(curEvent);
break;
- case k25_TMEventTypeExplosion:
+ case kDMEventTypeExplosion:
_vm->_projexpl->processEvent25(curEvent);
break;
- case k7_TMEventTypeFakeWall:
+ case kDMEventTypeFakeWall:
processEventSquareFakewall(curEvent);
break;
- case k2_TMEventTypeDoorDestruction:
+ case kDMEventTypeDoorDestruction:
processEventDoorDestruction(curEvent);
break;
- case k10_TMEventTypeDoor:
+ case kDMEventTypeDoor:
processEventSquareDoor(curEvent);
break;
- case k9_TMEventTypePit:
+ case kDMEventTypePit:
processEventSquarePit(curEvent);
break;
- case k8_TMEventTypeTeleporter:
+ case kDMEventTypeTeleporter:
processEventSquareTeleporter(curEvent);
break;
- case k6_TMEventTypeWall:
+ case kDMEventTypeWall:
processEventSquareWall(curEvent);
break;
- case k5_TMEventTypeCorridor:
+ case kDMEventTypeCorridor:
processEventSquareCorridor(curEvent);
break;
- case k60_TMEventTypeMoveGroupSilent:
- case k61_TMEventTypeMoveGroupAudible:
+ case kDMEventTypeMoveGroupSilent:
+ case kDMEventTypeMoveGroupAudible:
processEventsMoveGroup(curEvent);
break;
- case k65_TMEventTypeEnableGroupGenerator:
+ case kDMEventTypeEnableGroupGenerator:
procesEventEnableGroupGenerator(curEvent);
break;
- case k20_TMEventTypePlaySound:
+ case kDMEventTypePlaySound:
_vm->_sound->requestPlay(newEvent._Cu._soundIndex, newEvent._Bu._location._mapX, newEvent._Bu._location._mapY, kDMSoundModePlayIfPrioritized);
break;
- case k24_TMEventTypeRemoveFluxcage:
+ case kDMEventTypeRemoveFluxcage:
if (!_vm->_gameWon) {
_vm->_dungeonMan->unlinkThingFromList(Thing(newEvent._Cu._slot), Thing(0), newEvent._Bu._location._mapX, newEvent._Bu._location._mapY);
curEvent = (TimelineEvent *)_vm->_dungeonMan->getThingData(Thing(newEvent._Cu._slot));
((Explosion *)curEvent)->setNextThing(Thing::_none);
}
break;
- case k11_TMEventTypeEnableChampionAction:
+ case kDMEventTypeEnableChampionAction:
processEventEnableChampionAction(newEvent._priority);
if (newEvent._Bu._slotOrdinal)
processEventMoveWeaponFromQuiverToSlot(newEvent._priority, _vm->ordinalToIndex(newEvent._Bu._slotOrdinal));
_vm->_championMan->drawChampionState((ChampionIndex)newEvent._priority);
break;
- case k12_TMEventTypeHideDamageReceived:
+ case kDMEventTypeHideDamageReceived:
processEventHideDamageReceived(newEvent._priority);
break;
- case k70_TMEventTypeLight:
+ case kDMEventTypeLight:
_vm->_dungeonMan->setCurrentMap(_vm->_dungeonMan->_partyMapIndex);
processEventLight(curEvent);
_vm->_inventoryMan->setDungeonViewPalette();
break;
- case k71_TMEventTypeInvisibility:
+ case kDMEventTypeInvisibility:
_vm->_championMan->_party._event71Count_Invisibility--;
break;
- case k72_TMEventTypeChampionShield:
+ case kDMEventTypeChampionShield:
_vm->_championMan->_champions[newEvent._priority]._shieldDefense -= newEvent._Bu._defense;
setFlag(_vm->_championMan->_champions[newEvent._priority]._attributes, kDMAttributeStatusBox);
_vm->_championMan->drawChampionState((ChampionIndex)newEvent._priority);
break;
- case k73_TMEventTypeThievesEye:
+ case kDMEventTypeThievesEye:
_vm->_championMan->_party._event73Count_ThievesEye--;
break;
- case k74_TMEventTypePartyShield:
+ case kDMEventTypePartyShield:
_vm->_championMan->_party._shieldDefense -= newEvent._Bu._defense;
refreshAllChampionStatusBoxes();
break;
- case k77_TMEventTypeSpellShield:
+ case kDMEventTypeSpellShield:
_vm->_championMan->_party._spellShieldDefense -= newEvent._Bu._defense;
refreshAllChampionStatusBoxes();
break;
- case k78_TMEventTypeFireShield:
+ case kDMEventTypeFireShield:
_vm->_championMan->_party._fireShieldDefense -= newEvent._Bu._defense;
refreshAllChampionStatusBoxes();
break;
- case k75_TMEventTypePoisonChampion: {
+ case kDMEventTypePoisonChampion: {
uint16 championIndex = newEvent._priority;
_vm->_championMan->_champions[championIndex = newEvent._priority]._poisonEventCount--;
_vm->_championMan->championPoison(championIndex, newEvent._Bu._attack);
}
break;
- case k13_TMEventTypeViAltarRebirth:
+ case kDMEventTypeViAltarRebirth:
processEventViAltarRebirth(curEvent);
break;
- case k79_TMEventTypeFootprints:
+ case kDMEventTypeFootprints:
_vm->_championMan->_party._event79Count_Footprints--;
+ break;
+ default:
+ break;
}
}
_vm->_dungeonMan->setCurrentMap(_vm->_dungeonMan->_partyMapIndex);
@@ -402,7 +405,7 @@ void Timeline::processEventDoorAnimation(TimelineEvent *event) {
// See BUG0_78
int16 wounds = kDMWoundTorso | (verticalDoorFl ? kDMWoundHead : kDMWoundReadHand | kDMWoundActionHand);
if (_vm->_championMan->getDamagedChampionCount(5, wounds, kDMAttackTypeSelf))
- _vm->_sound->requestPlay(k18_soundPARTY_DAMAGED, mapX, mapY, kDMSoundModePlayIfPrioritized);
+ _vm->_sound->requestPlay(kDMSoundIndexPartyDamaged, mapX, mapY, kDMSoundModePlayIfPrioritized);
}
event->_mapTime++;
addEventGetEventIndex(event);
@@ -410,15 +413,15 @@ void Timeline::processEventDoorAnimation(TimelineEvent *event) {
}
Thing groupThing = _vm->_groupMan->groupGetThing(mapX, mapY);
uint16 creatureAttributes = _vm->_dungeonMan->getCreatureAttributes(groupThing);
- if ((groupThing != Thing::_endOfList) && !getFlag(creatureAttributes, k0x0040_MaskCreatureInfo_nonMaterial)) {
+ if ((groupThing != Thing::_endOfList) && !getFlag(creatureAttributes, kDMCreatureMaskNonMaterial)) {
if (doorState >= (verticalDoorFl ? CreatureInfo::getHeight(creatureAttributes) : 1)) { /* Creature height or 1 */
- if (_vm->_groupMan->getDamageAllCreaturesOutcome((Group *)_vm->_dungeonMan->getThingData(groupThing), mapX, mapY, 5, true) != k2_outcomeKilledAllCreaturesInGroup)
- _vm->_groupMan->processEvents29to41(mapX, mapY, kM3_TMEventTypeCreateReactionEvent29DangerOnSquare, 0);
+ if (_vm->_groupMan->getDamageAllCreaturesOutcome((Group *)_vm->_dungeonMan->getThingData(groupThing), mapX, mapY, 5, true) != kDMKillOutcomeAllCreaturesInGroup)
+ _vm->_groupMan->processEvents29to41(mapX, mapY, kDMEventTypeCreateReactionDangerOnSquare, 0);
int16 nextState = doorState - 1;
doorState = (doorState == kDMDoorStateOpen) ? kDMDoorStateOpen : (DoorState) nextState;
curSquare->setDoorState(doorState);
- _vm->_sound->requestPlay(k04_soundWOODEN_THUD_ATTACK_TROLIN_ANTMAN_STONE_GOLEM, mapX, mapY, kDMSoundModePlayIfPrioritized);
+ _vm->_sound->requestPlay(kDMSoundIndexWoodenThudAttackTrolinAntmanStoneGolem, mapX, mapY, kDMSoundModePlayIfPrioritized);
event->_mapTime++;
addEventGetEventIndex(event);
return;
@@ -435,7 +438,7 @@ void Timeline::processEventDoorAnimation(TimelineEvent *event) {
int16 prevDoorEffect = doorState - 1;
doorState = (DoorState) ((sensorEffect == kDMSensorEffectSet) ? prevDoorEffect : nextDoorEffect);
curSquare->setDoorState(doorState);
- _vm->_sound->requestPlay(k02_soundDOOR_RATTLE, mapX, mapY, kDMSoundModePlayIfPrioritized);
+ _vm->_sound->requestPlay(kDMSoundIndexDoorRattle, mapX, mapY, kDMSoundModePlayIfPrioritized);
if (sensorEffect == kDMSensorEffectSet) {
if (doorState == kDMDoorStateOpen)
@@ -460,7 +463,7 @@ void Timeline::processEventSquareFakewall(TimelineEvent *event) {
addEventGetEventIndex(event);
} else {
Thing groupThing = _vm->_groupMan->groupGetThing(mapX, mapY);
- if ((groupThing != Thing::_endOfList) && !getFlag(_vm->_dungeonMan->getCreatureAttributes(groupThing), k0x0040_MaskCreatureInfo_nonMaterial)) {
+ if ((groupThing != Thing::_endOfList) && !getFlag(_vm->_dungeonMan->getCreatureAttributes(groupThing), kDMCreatureMaskNonMaterial)) {
event->_mapTime++;
addEventGetEventIndex(event);
} else
@@ -486,7 +489,7 @@ void Timeline::processEventSquareDoor(TimelineEvent *event) {
if ((doorState == kDMDoorStateOpen) || (doorState == kDMDoorStateClosed))
return;
}
- event->_type = k1_TMEventTypeDoorAnimation;
+ event->_type = kDMEventTypeDoorAnimation;
addEventGetEventIndex(event);
}
@@ -541,15 +544,15 @@ void Timeline::moveTeleporterOrPitSquareThings(uint16 mapX, uint16 mapY) {
newEvent->_Cu._projectile.setMapY(_vm->_moveSens->_moveResultMapY);
newEvent->_Cu._projectile.setDir((Direction)_vm->_moveSens->_moveResultDir);
newEvent->_Bu._slot = _vm->thingWithNewCell(curThing, _vm->_moveSens->_moveResultCell).toUint16();
- M31_setMap(newEvent->_mapTime, _vm->_moveSens->_moveResultMapIndex);
+ _vm->setMap(newEvent->_mapTime, _vm->_moveSens->_moveResultMapIndex);
} else if (curThingType == kDMThingTypeExplosion) {
TimelineEvent *newEvent = _events;
for (uint16 i = 0; i < _eventMaxCount; newEvent++, i++) {
- if ((newEvent->_type == k25_TMEventTypeExplosion) && (newEvent->_Cu._slot == curThing.toUint16())) { /* BUG0_23 A Fluxcage explosion remains on a square forever. If you open a pit or teleporter on a square where there is a Fluxcage explosion, the Fluxcage explosion is moved but the associated event is not updated (because Fluxcage explosions do not use k25_TMEventTypeExplosion but rather k24_TMEventTypeRemoveFluxcage) causing the Fluxcage explosion to remain in the dungeon forever on its destination square. When the k24_TMEventTypeRemoveFluxcage expires the explosion thing is not removed, but it is marked as unused. Consequently, any objects placed on the Fluxcage square after it was moved but before it expires become orphans upon expiration. After expiration, any object placed on the fluxcage square is cloned when picked up */
+ if ((newEvent->_type == kDMEventTypeExplosion) && (newEvent->_Cu._slot == curThing.toUint16())) { /* BUG0_23 A Fluxcage explosion remains on a square forever. If you open a pit or teleporter on a square where there is a Fluxcage explosion, the Fluxcage explosion is moved but the associated event is not updated (because Fluxcage explosions do not use k25_TMEventTypeExplosion but rather k24_TMEventTypeRemoveFluxcage) causing the Fluxcage explosion to remain in the dungeon forever on its destination square. When the k24_TMEventTypeRemoveFluxcage expires the explosion thing is not removed, but it is marked as unused. Consequently, any objects placed on the Fluxcage square after it was moved but before it expires become orphans upon expiration. After expiration, any object placed on the fluxcage square is cloned when picked up */
newEvent->_Bu._location._mapX = _vm->_moveSens->_moveResultMapX;
newEvent->_Bu._location._mapY = _vm->_moveSens->_moveResultMapY;
newEvent->_Cu._slot = _vm->thingWithNewCell(curThing, _vm->_moveSens->_moveResultCell).toUint16();
- M31_setMap(newEvent->_mapTime, _vm->_moveSens->_moveResultMapIndex);
+ _vm->setMap(newEvent->_mapTime, _vm->_moveSens->_moveResultMapIndex);
}
}
}
@@ -719,14 +722,14 @@ void Timeline::processEventSquareCorridor(TimelineEvent *event) {
if (!textCurrentlyVisible && textString->isVisible() && (_vm->_dungeonMan->_currMapIndex == _vm->_dungeonMan->_partyMapIndex) && (mapX == _vm->_dungeonMan->_partyMapX) && (mapY == _vm->_dungeonMan->_partyMapY)) {
_vm->_dungeonMan->decodeText(_vm->_stringBuildBuffer, curThing, kDMTextTypeMessage);
- _vm->_textMan->printMessage(k15_ColorWhite, _vm->_stringBuildBuffer);
+ _vm->_textMan->printMessage(kDMColorWhite, _vm->_stringBuildBuffer);
}
} else if (curThingType == kDMThingTypeSensor) {
Sensor *curSensor = (Sensor *)_vm->_dungeonMan->getThingData(curThing);
if (curSensor->getType() == kDMSensorFloorGroupGenerator) {
int16 creatureCount = curSensor->getAttrValue();
- if (getFlag(creatureCount, k0x0008_randomizeGeneratedCreatureCount))
- creatureCount = _vm->getRandomNumber(getFlag(creatureCount, k0x0007_generatedCreatureCount));
+ if (getFlag(creatureCount, kDMMaskRandomizeGeneratedCreatureCount))
+ creatureCount = _vm->getRandomNumber(getFlag(creatureCount, kDMMaskGeneratedCreatureCount));
else
creatureCount--;
@@ -734,9 +737,9 @@ void Timeline::processEventSquareCorridor(TimelineEvent *event) {
if (healthMultiplier == 0)
healthMultiplier = _vm->_dungeonMan->_currMap->_difficulty;
- _vm->_groupMan->groupGetGenerated(curSensor->getData(), healthMultiplier, creatureCount, (Direction)_vm->getRandomNumber(4), mapX, mapY);
+ _vm->_groupMan->groupGetGenerated((CreatureType)curSensor->getData(), healthMultiplier, creatureCount, (Direction)_vm->getRandomNumber(4), mapX, mapY);
if (curSensor->getAttrAudibleA())
- _vm->_sound->requestPlay(k17_soundBUZZ, mapX, mapY, kDMSoundModePlayIfPrioritized);
+ _vm->_sound->requestPlay(kDMSoundIndexBuzz, mapX, mapY, kDMSoundModePlayIfPrioritized);
if (curSensor->getAttrOnlyOnce())
curSensor->setTypeDisabled();
@@ -748,8 +751,8 @@ void Timeline::processEventSquareCorridor(TimelineEvent *event) {
actionTicks = (actionTicks - 126) << 6;
TimelineEvent newEvent;
- newEvent._type = k65_TMEventTypeEnableGroupGenerator;
- _vm->setMapAndTime(newEvent._mapTime, _vm->_dungeonMan->_currMapIndex, _vm->_gameTime + actionTicks);
+ newEvent._type = kDMEventTypeEnableGroupGenerator;
+ newEvent._mapTime = _vm->setMapAndTime(_vm->_dungeonMan->_currMapIndex, _vm->_gameTime + actionTicks);
newEvent._priority = 0;
newEvent._Bu._location._mapX = mapX;
newEvent._Bu._location._mapY = mapY;
@@ -770,15 +773,15 @@ void Timeline::processEventsMoveGroup(TimelineEvent *event) {
T0252001:
if (((_vm->_dungeonMan->_currMapIndex != _vm->_dungeonMan->_partyMapIndex) || (mapX != _vm->_dungeonMan->_partyMapX) || (mapY != _vm->_dungeonMan->_partyMapY)) && (_vm->_groupMan->groupGetThing(mapX, mapY) == Thing::_endOfList)) { /* BUG0_24 Lord Chaos may teleport into one of the Black Flames and become invisible until the Black Flame is killed. In this case, _vm->_groupMan->f175_groupGetThing returns the Black Flame thing and the Lord Chaos thing is not moved into the dungeon until the Black Flame is killed */
- if (event->_type == k61_TMEventTypeMoveGroupAudible)
- _vm->_sound->requestPlay(k17_soundBUZZ, mapX, mapY, kDMSoundModePlayIfPrioritized);
+ if (event->_type == kDMEventTypeMoveGroupAudible)
+ _vm->_sound->requestPlay(kDMSoundIndexBuzz, mapX, mapY, kDMSoundModePlayIfPrioritized);
_vm->_moveSens->getMoveResult(Thing(event->_Cu._slot), kDMMapXNotOnASquare, 0, mapX, mapY);
} else {
if (!randomDirectionMoveRetried) {
randomDirectionMoveRetried = true;
Group *group = (Group *)_vm->_dungeonMan->getThingData(Thing(event->_Cu._slot));
- if ((group->_type == k23_CreatureTypeLordChaos) && !_vm->getRandomNumber(4)) {
+ if ((group->_type == kDMCreatureTypeLordChaos) && !_vm->getRandomNumber(4)) {
switch (_vm->getRandomNumber(4)) {
case 0:
mapX--;
@@ -898,9 +901,9 @@ void Timeline::processEventLight(TimelineEvent *event) {
_vm->_championMan->_party._magicalLightAmount += lightAmount;
if (weakerLightPower) {
TimelineEvent newEvent;
- newEvent._type = k70_TMEventTypeLight;
+ newEvent._type = kDMEventTypeLight;
newEvent._Bu._lightPower = weakerLightPower;
- _vm->setMapAndTime(newEvent._mapTime, _vm->_dungeonMan->_partyMapIndex, _vm->_gameTime + 4);
+ newEvent._mapTime = _vm->setMapAndTime(_vm->_dungeonMan->_partyMapIndex, _vm->_gameTime + 4);
newEvent._priority = 0;
addEventGetEventIndex(&newEvent);
}
@@ -974,7 +977,7 @@ void Timeline::loadEventsPart(Common::InSaveFile *file) {
for (uint16 i = 0; i < _eventMaxCount; ++i) {
TimelineEvent *event = &_events[i];
event->_mapTime = file->readSint32BE();
- event->_type = file->readByte();
+ event->_type = (TimelineEventType)file->readByte();
event->_priority = file->readByte();
event->_Bu._location._mapX = file->readByte();
event->_Bu._location._mapY = file->readByte();
diff --git a/engines/dm/timeline.h b/engines/dm/timeline.h
index 22e563d853..e7b4621af0 100644
--- a/engines/dm/timeline.h
+++ b/engines/dm/timeline.h
@@ -37,71 +37,71 @@ namespace DM {
/* Event types */
enum TimelineEventType {
/* Used when a creature in a group was damaged or killed by a Poison Cloud or by a closing door or if Lord Chaos is surrounded by = 3, Fluxcages */
-kM3_TMEventTypeCreateReactionEvent29DangerOnSquare = -3, // @ CM3_EVENT_CREATE_REACTION_EVENT_29_DANGER_ON_SQUARE
+ kDMEventTypeCreateReactionDangerOnSquare = -3, // @ CM3_EVENT_CREATE_REACTION_EVENT_29_DANGER_ON_SQUARE
/* Used when a projectile impacts with a creature in a group */
-kM2_TMEventTypeCreateReactionEvent30HitByProjectile = -2, // @ CM2_EVENT_CREATE_REACTION_EVENT_30_HIT_BY_PROJECTILE
+ kDMEventTypeCreateReactionHitByProjectile = -2, // @ CM2_EVENT_CREATE_REACTION_EVENT_30_HIT_BY_PROJECTILE
/* Used when the party bumps into a group or performs a melee attack */
-kM1_TMEventTypeCreateReactionEvent31ParyIsAdjacent = -1, // @ CM1_EVENT_CREATE_REACTION_EVENT_31_PARTY_IS_ADJACENT
-k0_TMEventTypeNone = 0, // @ C00_EVENT_NONE
-k1_TMEventTypeDoorAnimation = 1, // @ C01_EVENT_DOOR_ANIMATION
-k2_TMEventTypeDoorDestruction = 2, // @ C02_EVENT_DOOR_DESTRUCTION
-k5_TMEventTypeCorridor = 5, // @ C05_EVENT_CORRIDOR
-k6_TMEventTypeWall = 6, // @ C06_EVENT_WALL
-k7_TMEventTypeFakeWall = 7, // @ C07_EVENT_FAKEWALL
-k8_TMEventTypeTeleporter = 8, // @ C08_EVENT_TELEPORTER
-k9_TMEventTypePit = 9, // @ C09_EVENT_PIT
-k10_TMEventTypeDoor = 10, // @ C10_EVENT_DOOR
-k11_TMEventTypeEnableChampionAction = 11, // @ C11_EVENT_ENABLE_CHAMPION_ACTION
-k12_TMEventTypeHideDamageReceived = 12, // @ C12_EVENT_HIDE_DAMAGE_RECEIVED
-k13_TMEventTypeViAltarRebirth = 13, // @ C13_EVENT_VI_ALTAR_REBIRTH
-k20_TMEventTypePlaySound = 20, // @ C20_EVENT_PLAY_SOUND
-k22_TMEventTypeCPSE = 22, // @ C22_EVENT_CPSE
-k24_TMEventTypeRemoveFluxcage = 24, // @ C24_EVENT_REMOVE_FLUXCAGE
-k25_TMEventTypeExplosion = 25, // @ C25_EVENT_EXPLOSION
-k29_TMEventTypeGroupReactionDangerOnSquare = 29, // @ C29_EVENT_GROUP_REACTION_DANGER_ON_SQUARE
-k30_TMEventTypeGroupReacionHitByProjectile = 30, // @ C30_EVENT_GROUP_REACTION_HIT_BY_PROJECTILE
-k31_TMEventTypeGroupReactionPartyIsAdjecent = 31, // @ C31_EVENT_GROUP_REACTION_PARTY_IS_ADJACENT
-k32_TMEventTypeUpdateAspectGroup = 32, // @ C32_EVENT_UPDATE_ASPECT_GROUP
+ kDMEventTypeCreateReactionPartyIsAdjacent = -1, // @ CM1_EVENT_CREATE_REACTION_EVENT_31_PARTY_IS_ADJACENT
+ kDMEventTypeNone = 0, // @ C00_EVENT_NONE
+ kDMEventTypeDoorAnimation = 1, // @ C01_EVENT_DOOR_ANIMATION
+ kDMEventTypeDoorDestruction = 2, // @ C02_EVENT_DOOR_DESTRUCTION
+ kDMEventTypeCorridor = 5, // @ C05_EVENT_CORRIDOR
+ kDMEventTypeWall = 6, // @ C06_EVENT_WALL
+ kDMEventTypeFakeWall = 7, // @ C07_EVENT_FAKEWALL
+ kDMEventTypeTeleporter = 8, // @ C08_EVENT_TELEPORTER
+ kDMEventTypePit = 9, // @ C09_EVENT_PIT
+ kDMEventTypeDoor = 10, // @ C10_EVENT_DOOR
+ kDMEventTypeEnableChampionAction = 11, // @ C11_EVENT_ENABLE_CHAMPION_ACTION
+ kDMEventTypeHideDamageReceived = 12, // @ C12_EVENT_HIDE_DAMAGE_RECEIVED
+ kDMEventTypeViAltarRebirth = 13, // @ C13_EVENT_VI_ALTAR_REBIRTH
+ kDMEventTypePlaySound = 20, // @ C20_EVENT_PLAY_SOUND
+ kDMEventTypeCPSE = 22, // @ C22_EVENT_CPSE
+ kDMEventTypeRemoveFluxcage = 24, // @ C24_EVENT_REMOVE_FLUXCAGE
+ kDMEventTypeExplosion = 25, // @ C25_EVENT_EXPLOSION
+ kDMEventTypeGroupReactionDangerOnSquare = 29, // @ C29_EVENT_GROUP_REACTION_DANGER_ON_SQUARE
+ kDMEventTypeGroupReacionHitByProjectile = 30, // @ C30_EVENT_GROUP_REACTION_HIT_BY_PROJECTILE
+ kDMEventTypeGroupReactionPartyIsAdjecent = 31, // @ C31_EVENT_GROUP_REACTION_PARTY_IS_ADJACENT
+ kDMEventTypeUpdateAspectGroup = 32, // @ C32_EVENT_UPDATE_ASPECT_GROUP
/* Events = 33,-36 and = 38,-41 are used for individual creatures only while the group is attacking the party */
-k33_TMEventTypeUpdateAspectCreature_0 = 33, // @ C33_EVENT_UPDATE_ASPECT_CREATURE_0
-k34_TMEventTypeUpdateAspectCreature_1 = 34, // @ C34_EVENT_UPDATE_ASPECT_CREATURE_1
-k35_TMEventTypeUpdateAspectCreature_2 = 35, // @ C35_EVENT_UPDATE_ASPECT_CREATURE_2
-k36_TMEventTypeUpdateAspectCreature_3 = 36, // @ C36_EVENT_UPDATE_ASPECT_CREATURE_3
-k37_TMEventTypeUpdateBehaviourGroup = 37, // @ C37_EVENT_UPDATE_BEHAVIOR_GROUP
-k38_TMEventTypeUpdateBehaviour_0 = 38, // @ C38_EVENT_UPDATE_BEHAVIOR_CREATURE_0
-k39_TMEventTypeUpdateBehaviour_1 = 39, // @ C39_EVENT_UPDATE_BEHAVIOR_CREATURE_1
-k40_TMEventTypeUpdateBehaviour_2 = 40, // @ C40_EVENT_UPDATE_BEHAVIOR_CREATURE_2
-k41_TMEventTypeUpdateBehaviour_3 = 41, // @ C41_EVENT_UPDATE_BEHAVIOR_CREATURE_3
+ kDMEventTypeUpdateAspectCreature0 = 33, // @ C33_EVENT_UPDATE_ASPECT_CREATURE_0
+ kDMEventTypeUpdateAspectCreature1 = 34, // @ C34_EVENT_UPDATE_ASPECT_CREATURE_1
+ kDMEventTypeUpdateAspectCreature2 = 35, // @ C35_EVENT_UPDATE_ASPECT_CREATURE_2
+ kDMEventTypeUpdateAspectCreature3 = 36, // @ C36_EVENT_UPDATE_ASPECT_CREATURE_3
+ kDMEventTypeUpdateBehaviourGroup = 37, // @ C37_EVENT_UPDATE_BEHAVIOR_GROUP
+ kDMEventTypeUpdateBehavior0 = 38, // @ C38_EVENT_UPDATE_BEHAVIOR_CREATURE_0
+ kDMEventTypeUpdateBehavior1 = 39, // @ C39_EVENT_UPDATE_BEHAVIOR_CREATURE_1
+ kDMEventTypeUpdateBehavior2 = 40, // @ C40_EVENT_UPDATE_BEHAVIOR_CREATURE_2
+ kDMEventTypeUpdateBehavior3 = 41, // @ C41_EVENT_UPDATE_BEHAVIOR_CREATURE_3
/* Projectiles created by a champion (by casting a spell, shooting a weapon or throwing an object) or by a creature (by casting a spell) ignore impacts during their first movement otherwise an impact would always occur immediately as these projectiles are created on the champion or creature square */
-k48_TMEventTypeMoveProjectileIgnoreImpacts = 48, // @ C48_EVENT_MOVE_PROJECTILE_IGNORE_IMPACTS
+ kDMEventTypeMoveProjectileIgnoreImpacts = 48, // @ C48_EVENT_MOVE_PROJECTILE_IGNORE_IMPACTS
/* Projectiles created by projectile launcher sensors never ignore impacts as well as all other projectiles after their first movement */
-k49_TMEventTypeMoveProjectile = 49, // @ C49_EVENT_MOVE_PROJECTILE
-k53_TMEventTypeWatchdoge = 53, // @ C53_EVENT_WATCHDOG
-k60_TMEventTypeMoveGroupSilent = 60, // @ C60_EVENT_MOVE_GROUP_SILENT
-k61_TMEventTypeMoveGroupAudible = 61, // @ C61_EVENT_MOVE_GROUP_AUDIBLE
-k65_TMEventTypeEnableGroupGenerator = 65, // @ C65_EVENT_ENABLE_GROUP_GENERATOR
-k70_TMEventTypeLight = 70, // @ C70_EVENT_LIGHT
-k71_TMEventTypeInvisibility = 71, // @ C71_EVENT_INVISIBILITY
-k72_TMEventTypeChampionShield = 72, // @ C72_EVENT_CHAMPION_SHIELD
-k73_TMEventTypeThievesEye = 73, // @ C73_EVENT_THIEVES_EYE
-k74_TMEventTypePartyShield = 74, // @ C74_EVENT_PARTY_SHIELD
-k75_TMEventTypePoisonChampion = 75, // @ C75_EVENT_POISON_CHAMPION
-k77_TMEventTypeSpellShield = 77, // @ C77_EVENT_SPELLSHIELD
-k78_TMEventTypeFireShield = 78, // @ C78_EVENT_FIRESHIELD
-k79_TMEventTypeFootprints = 79, // @ C79_EVENT_FOOTPRINTS
-k80_TMEventTypeMagicMap_C80 = 80, // @ C80_EVENT_MAGIC_MAP
-k81_TMEventTypeMagicMap_C81 = 81, // @ C81_EVENT_MAGIC_MAP
-k82_TMEventTypeMagicMap_C82 = 82, // @ C82_EVENT_MAGIC_MAP
-k83_TMEventTypeMagicMap_C83 = 83 // @ C83_EVENT_MAGIC_MAP
+ kDMEventTypeMoveProjectile = 49, // @ C49_EVENT_MOVE_PROJECTILE
+ kDMEventTypeWatchdoge = 53, // @ C53_EVENT_WATCHDOG
+ kDMEventTypeMoveGroupSilent = 60, // @ C60_EVENT_MOVE_GROUP_SILENT
+ kDMEventTypeMoveGroupAudible = 61, // @ C61_EVENT_MOVE_GROUP_AUDIBLE
+ kDMEventTypeEnableGroupGenerator = 65, // @ C65_EVENT_ENABLE_GROUP_GENERATOR
+ kDMEventTypeLight = 70, // @ C70_EVENT_LIGHT
+ kDMEventTypeInvisibility = 71, // @ C71_EVENT_INVISIBILITY
+ kDMEventTypeChampionShield = 72, // @ C72_EVENT_CHAMPION_SHIELD
+ kDMEventTypeThievesEye = 73, // @ C73_EVENT_THIEVES_EYE
+ kDMEventTypePartyShield = 74, // @ C74_EVENT_PARTY_SHIELD
+ kDMEventTypePoisonChampion = 75, // @ C75_EVENT_POISON_CHAMPION
+ kDMEventTypeSpellShield = 77, // @ C77_EVENT_SPELLSHIELD
+ kDMEventTypeFireShield = 78, // @ C78_EVENT_FIRESHIELD
+ kDMEventTypeFootprints = 79, // @ C79_EVENT_FOOTPRINTS
+ kDMEventTypeMagicMap0 = 80, // @ C80_EVENT_MAGIC_MAP
+ kDMEventTypeMagicMap1 = 81, // @ C81_EVENT_MAGIC_MAP
+ kDMEventTypeMagicMap2 = 82, // @ C82_EVENT_MAGIC_MAP
+ kDMEventTypeMagicMap3 = 83 // @ C83_EVENT_MAGIC_MAP
};
-#define k0x0007_generatedCreatureCount 0x0007 // @ MASK0x0007_GENERATED_CREATURE_COUNT
-#define k0x0008_randomizeGeneratedCreatureCount 0x0008 // @ MASK0x0008_RANDOMIZE_GENERATED_CREATURE_COUNT
+#define kDMMaskGeneratedCreatureCount 0x0007 // @ MASK0x0007_GENERATED_CREATURE_COUNT
+#define kDMMaskRandomizeGeneratedCreatureCount 0x0008 // @ MASK0x0008_RANDOMIZE_GENERATED_CREATURE_COUNT
class TimelineEvent {
public:
int32 _mapTime;
- byte _type;
+ TimelineEventType _type;
byte _priority; // CHECKME: byte? or int16? Inconsistency in the code
uint16 getTypePriority() { return (_type << 8) + _priority; }
diff --git a/engines/drascula/saveload.cpp b/engines/drascula/saveload.cpp
index eb72a999d4..e99898da5a 100644
--- a/engines/drascula/saveload.cpp
+++ b/engines/drascula/saveload.cpp
@@ -45,7 +45,7 @@ void DrasculaEngine::checkForOldSaveGames() {
GUI::MessageDialog dialog0(
_("ScummVM found that you have old savefiles for Drascula that should be converted.\n"
- "The old save game format is no longer supported, so you will not be able to load your games if you don't convert them.\n\n"
+ "The old saved game format is no longer supported, so you will not be able to load your games if you don't convert them.\n\n"
"Press OK to convert them now, otherwise you will be asked again the next time you start the game.\n"), _("OK"), _("Cancel"));
int choice = dialog0.runModal();
diff --git a/engines/engine.cpp b/engines/engine.cpp
index 8fff99f3fc..68d9e8fde6 100644
--- a/engines/engine.cpp
+++ b/engines/engine.cpp
@@ -545,7 +545,7 @@ bool Engine::warnUserAboutUnsupportedGame() {
if (ConfMan.getBool("enable_unsupported_game_warning")) {
GUI::MessageDialog alert(_("WARNING: The game you are about to start is"
" not yet fully supported by ScummVM. As such, it is likely to be"
- " unstable, and any saves you make might not work in future"
+ " unstable, and any saved game you make might not work in future"
" versions of ScummVM."), _("Start anyway"), _("Cancel"));
return alert.runModal() == GUI::kMessageOK;
}
diff --git a/engines/fullpipe/fullpipe.cpp b/engines/fullpipe/fullpipe.cpp
index 6b8f92ccd2..c2d4106d3f 100644
--- a/engines/fullpipe/fullpipe.cpp
+++ b/engines/fullpipe/fullpipe.cpp
@@ -284,10 +284,18 @@ Common::Error FullpipeEngine::run() {
_gameContinue = true;
+ int time1 = g_fp->_system->getMillis();
+
while (_gameContinue) {
updateEvents();
- updateScreen();
+ int time2 = g_fp->_system->getMillis();
+
+ // 30fps
+ if (time2 - time1 >= 33 || !_normalSpeed) {
+ time1 = time2;
+ updateScreen();
+ }
if (_needRestart) {
if (_modalObject) {
@@ -303,8 +311,7 @@ Common::Error FullpipeEngine::run() {
_needRestart = false;
}
- if (_normalSpeed)
- _system->delayMillis(10);
+ _system->delayMillis(5);
_system->updateScreen();
}
diff --git a/engines/fullpipe/gameloader.cpp b/engines/fullpipe/gameloader.cpp
index e49e56d6f0..57bde97d9d 100644
--- a/engines/fullpipe/gameloader.cpp
+++ b/engines/fullpipe/gameloader.cpp
@@ -21,7 +21,6 @@
*/
#include "fullpipe/fullpipe.h"
-#include "graphics/thumbnail.h"
#include "fullpipe/gameloader.h"
#include "fullpipe/scene.h"
@@ -66,7 +65,7 @@ GameLoader::GameLoader() {
_field_F8 = 0;
_sceneSwitcher = 0;
_preloadCallback = 0;
- _readSavegameCallback = 0;
+ _savegameCallback = 0;
_gameVar = 0;
_preloadSceneId = 0;
_preloadEntranceId = 0;
@@ -598,14 +597,6 @@ void GameLoader::updateSystems(int counterdiff) {
}
}
-void GameLoader::readSavegame(const char *fname) {
- warning("STUB: readSavegame(%s)", fname);
-}
-
-void GameLoader::writeSavegame(Scene *sc, const char *fname) {
- warning("STUB: writeSavegame(sc, %s)", fname);
-}
-
Sc2::Sc2() {
_sceneId = 0;
_field_2 = 0;
@@ -704,32 +695,6 @@ const char *getSavegameFile(int saveGameIdx) {
return buffer;
}
-bool readSavegameHeader(Common::InSaveFile *in, FullpipeSavegameHeader &header) {
- char saveIdentBuffer[6];
- header.thumbnail = NULL;
-
- // Validate the header Id
- in->read(saveIdentBuffer, 6);
- if (strcmp(saveIdentBuffer, "SVMCR"))
- return false;
-
- header.version = in->readByte();
- if (header.version != FULLPIPE_SAVEGAME_VERSION)
- return false;
-
- // Read in the string
- header.saveName.clear();
- char ch;
- while ((ch = (char)in->readByte()) != '\0') header.saveName += ch;
-
- // Get the thumbnail
- header.thumbnail = Graphics::loadThumbnail(*in);
- if (!header.thumbnail)
- return false;
-
- return true;
-}
-
void GameLoader::restoreDefPicAniInfos() {
for (uint i = 0; i < _sc2array.size(); i++) {
if (_sc2array[i]._picAniInfos) {
diff --git a/engines/fullpipe/gameloader.h b/engines/fullpipe/gameloader.h
index bb9b934b59..9f99cb16f3 100644
--- a/engines/fullpipe/gameloader.h
+++ b/engines/fullpipe/gameloader.h
@@ -23,6 +23,8 @@
#ifndef FULLPIPE_GAMELOADER_H
#define FULLPIPE_GAMELOADER_H
+#include "engines/savestate.h"
+
#include "fullpipe/objects.h"
#include "fullpipe/inventory.h"
#include "fullpipe/messages.h"
@@ -75,11 +77,23 @@ class PreloadItems : public Common::Array<PreloadItem *>, public CObject {
};
struct FullpipeSavegameHeader {
+ char id[6];
uint8 version;
Common::String saveName;
+ uint32 date;
+ uint16 time;
+ uint32 playtime;
Graphics::Surface *thumbnail;
};
+struct SaveHeader {
+ int32 version;
+ char magic[32];
+ int32 updateCounter;
+ int32 unkField;
+ int32 encSize;
+};
+
class GameLoader : public CObject {
public:
GameLoader();
@@ -101,6 +115,8 @@ class GameLoader : public CObject {
void readSavegame(const char *fname);
void writeSavegame(Scene *sc, const char *fname);
+ void addVar(GameVar *var, GameVar *subvar);
+
void restoreDefPicAniInfos();
GameProject *_gameProject;
@@ -110,7 +126,7 @@ class GameLoader : public CObject {
Sc2Array _sc2array;
void *_sceneSwitcher;
bool (*_preloadCallback)(PreloadItem &pre, int flag);
- void *_readSavegameCallback;
+ void (*_savegameCallback)(MfcArchive *archive, bool mode);
int16 _field_F8;
int16 _field_FA;
PreloadItems _preloadItems;
@@ -124,6 +140,7 @@ class GameLoader : public CObject {
const char *getSavegameFile(int saveGameIdx);
bool readSavegameHeader(Common::InSaveFile *in, FullpipeSavegameHeader &header);
+void parseSavegameHeader(Fullpipe::FullpipeSavegameHeader &header, SaveStateDescriptor &desc);
Inventory2 *getGameLoaderInventory();
InteractionController *getGameLoaderInteractionController();
diff --git a/engines/fullpipe/gfx.cpp b/engines/fullpipe/gfx.cpp
index 5681e3c615..4dec4b640c 100644
--- a/engines/fullpipe/gfx.cpp
+++ b/engines/fullpipe/gfx.cpp
@@ -833,7 +833,7 @@ void Bitmap::decode(int32 *palette) {
putDibCB(palette);
}
-void Bitmap::putDib(int x, int y, int32 *palette, int alpha) {
+void Bitmap::putDib(int x, int y, int32 *palette, byte alpha) {
debugC(7, kDebugDrawing, "Bitmap::putDib(%d, %d)", x, y);
int x1 = x - g_fp->_sceneRect.left;
@@ -1180,15 +1180,7 @@ void BigPicture::draw(int x, int y, int style, int angle) {
if (y != -1)
ny = y;
- if (_alpha < 0xFF) {
- //vrtSetAlphaBlendMode(g_vrtDrawHandle, 1, v9);
- }
-
- _bitmap->putDib(nx, ny, 0, 0xff);
-
- if (_alpha < 0xFF) {
- //vrtSetAlphaBlendMode(g_vrtDrawHandle, 0, 255);
- }
+ _bitmap->putDib(nx, ny, 0, _alpha);
}
}
diff --git a/engines/fullpipe/gfx.h b/engines/fullpipe/gfx.h
index cbba550041..566586fb48 100644
--- a/engines/fullpipe/gfx.h
+++ b/engines/fullpipe/gfx.h
@@ -47,7 +47,7 @@ struct Bitmap {
void load(Common::ReadStream *s);
void decode(int32 *palette);
- void putDib(int x, int y, int32 *palette, int alpha);
+ void putDib(int x, int y, int32 *palette, byte alpha);
bool putDibRB(int32 *palette);
void putDibCB(int32 *palette);
diff --git a/engines/fullpipe/interaction.cpp b/engines/fullpipe/interaction.cpp
index 6bbf98e37b..accba788f9 100644
--- a/engines/fullpipe/interaction.cpp
+++ b/engines/fullpipe/interaction.cpp
@@ -290,8 +290,8 @@ LABEL_38:
return false;
}
- subj->_flags |= 1;
- obj->_flags |= 1;
+ subj->_flags |= 0x100;
+ obj->_flags |= 0x100;
} else {
bool someFlag = false;
PicAniInfo aniInfo;
@@ -389,7 +389,7 @@ LABEL_38:
ani->queueMessageQueue(mq);
}
} else {
- obj->_flags |= 1;
+ obj->_flags |= 0x100;
if (inter->_flags & 0x10000)
return true;
diff --git a/engines/fullpipe/inventory.cpp b/engines/fullpipe/inventory.cpp
index 13ac78a358..345a02c83e 100644
--- a/engines/fullpipe/inventory.cpp
+++ b/engines/fullpipe/inventory.cpp
@@ -94,6 +94,11 @@ Inventory2::~Inventory2() {
}
bool Inventory2::loadPartial(MfcArchive &file) { // Inventory2_SerializePartially
+ for (uint i = 0; i < _inventoryItems.size(); i++)
+ delete _inventoryItems[i];
+
+ _inventoryItems.clear();
+
int numInvs = file.readUint32LE();
for (int i = 0; i < numInvs; i++) {
@@ -106,6 +111,17 @@ bool Inventory2::loadPartial(MfcArchive &file) { // Inventory2_SerializePartiall
return true;
}
+bool Inventory2::savePartial(MfcArchive &file) {
+ file.writeUint32LE(_inventoryItems.size());
+
+ for (uint i = 0; i < _inventoryItems.size(); i++) {
+ file.writeUint16LE(_inventoryItems[i]->itemId);
+ file.writeUint16LE(_inventoryItems[i]->count);
+ }
+
+ return true;
+}
+
void Inventory2::addItem(int itemId, int count) {
if (getInventoryPoolItemIndexById(itemId) >= 0)
_inventoryItems.push_back(new InventoryItem(itemId, count));
diff --git a/engines/fullpipe/inventory.h b/engines/fullpipe/inventory.h
index 46b55c5669..9f9b9961c6 100644
--- a/engines/fullpipe/inventory.h
+++ b/engines/fullpipe/inventory.h
@@ -101,6 +101,7 @@ class Inventory2 : public Inventory {
virtual ~Inventory2();
bool loadPartial(MfcArchive &file);
+ bool savePartial(MfcArchive &file);
void addItem(int itemId, int count);
void addItem2(StaticANIObject *obj);
void removeItem(int itemId, int count);
diff --git a/engines/fullpipe/lift.cpp b/engines/fullpipe/lift.cpp
index 10b41546b5..113ddf719e 100644
--- a/engines/fullpipe/lift.cpp
+++ b/engines/fullpipe/lift.cpp
@@ -358,7 +358,7 @@ void FullpipeEngine::lift_walkAndGo() {
mq->chain(0);
- _aniMan->_flags |= 1;
+ _aniMan->_flags |= 0x100;
}
}
@@ -423,12 +423,12 @@ void FullpipeEngine::lift_goAnimation() {
mq->addExCommandToEnd(ex);
- _aniMan->_flags &= 0xFEFF;
+ _aniMan->_flags &= ~0x100;
if (!mq->chain(_aniMan))
delete mq;
- _aniMan->_flags |= 1;
+ _aniMan->_flags |= 0x100;
return;
}
diff --git a/engines/fullpipe/messages.cpp b/engines/fullpipe/messages.cpp
index 68ceae353b..a9fc5210a3 100644
--- a/engines/fullpipe/messages.cpp
+++ b/engines/fullpipe/messages.cpp
@@ -502,6 +502,9 @@ bool MessageQueue::checkGlobalExCommandList1() {
if (ex1->_messageKind != 1 && ex1->_messageKind != 20 && ex1->_messageKind != 5 && ex1->_messageKind != 27)
continue;
+ if (ex1->_parentId != ex->_parentId)
+ continue;
+
if (ex1->_param != ex->_param && ex1->_param != -1 && ex->_param != -1)
continue;
@@ -533,6 +536,11 @@ bool MessageQueue::checkGlobalExCommandList2() {
continue;
}
+ if (ex1->_parentId != ex->_parentId) {
+ it++;
+ continue;
+ }
+
if (ex1->_param != ex->_param && ex1->_param != -1 && ex->_param != -1) {
it++;
continue;
diff --git a/engines/fullpipe/modal.cpp b/engines/fullpipe/modal.cpp
index 1d1bbd077d..b73eaab5c7 100644
--- a/engines/fullpipe/modal.cpp
+++ b/engines/fullpipe/modal.cpp
@@ -233,8 +233,6 @@ void ModalIntro::finish() {
}
void ModalVideoPlayer::play(const char *filename) {
- // TODO: Videos are encoded using Intel Indeo 5 (IV50), which isn't supported yet
-
Video::AVIDecoder *aviDecoder = new Video::AVIDecoder();
if (!aviDecoder->loadFile(filename))
@@ -1199,7 +1197,7 @@ bool ModalMainMenu::isSaveAllowed() {
}
void ModalMainMenu::enableDebugMenu(char c) {
- const char deb[] = "DEBUGER";
+ const char deb[] = "debuger";
if (c == deb[_debugKeyCount]) {
_debugKeyCount++;
@@ -1603,7 +1601,7 @@ void ModalSaveGame::setup(Scene *sc, int mode) {
} else {
w = 0;
- for (int j = 0; j < 16; j++) {
+ for (uint j = 0; j < _arrayL.size(); j++) {
_arrayL[j]->getDimensions(&point);
w += point.x + 2;
}
@@ -1624,7 +1622,7 @@ char *ModalSaveGame::getSaveName() {
if (_queryRes < 0)
return 0;
- return _files[_queryRes]->filename;
+ return _files[_queryRes - 1]->filename;
}
bool ModalSaveGame::getFileInfo(int slot, FileInfo *fileinfo) {
@@ -1642,7 +1640,9 @@ bool ModalSaveGame::getFileInfo(int slot, FileInfo *fileinfo) {
SaveStateDescriptor desc(slot, header.saveName);
char res[17];
- snprintf(res, 17, "%s %s", desc.getSaveDate().c_str(), desc.getSaveTime().c_str());
+ Fullpipe::parseSavegameHeader(header, desc);
+
+ snprintf(res, 17, "%s %s", desc.getSaveDate().c_str(), desc.getSaveTime().c_str());
for (int i = 0; i < 16; i++) {
switch(res[i]) {
diff --git a/engines/fullpipe/module.mk b/engines/fullpipe/module.mk
index 01aba1bd82..62f9c5f77a 100644
--- a/engines/fullpipe/module.mk
+++ b/engines/fullpipe/module.mk
@@ -23,6 +23,7 @@ MODULE_OBJS = \
scenes.o \
sound.o \
stateloader.o \
+ statesaver.o \
statics.o \
utils.o \
scenes/sceneIntro.o \
diff --git a/engines/fullpipe/motion.cpp b/engines/fullpipe/motion.cpp
index b910c815a2..ba627a96a1 100644
--- a/engines/fullpipe/motion.cpp
+++ b/engines/fullpipe/motion.cpp
@@ -1675,8 +1675,9 @@ int MctlGraph::getDirByStatics(int idx, int staticsId) {
int MctlGraph::getDirByMovement(int idx, int movId) {
for (int i = 0; i < 4; i++)
- if (_items2[idx]->_subItems[i]._walk[0]._movementId == movId || _items2[idx]->_subItems[i]._turn[0]._movementId == movId ||
- _items2[idx]->_subItems[i]._turnS[0]._movementId == movId)
+ if (_items2[idx]->_subItems[i]._walk[0]._movementId == movId
+ || _items2[idx]->_subItems[i]._walk[1]._movementId == movId
+ || _items2[idx]->_subItems[i]._walk[2]._movementId == movId)
return i;
return -1;
diff --git a/engines/fullpipe/objects.h b/engines/fullpipe/objects.h
index c9da43986c..9f0ccf18de 100644
--- a/engines/fullpipe/objects.h
+++ b/engines/fullpipe/objects.h
@@ -61,6 +61,7 @@ struct PicAniInfo {
int32 someDynamicPhaseIndex;
bool load(MfcArchive &file);
+ void save(MfcArchive &file);
PicAniInfo() { memset(this, 0, sizeof(PicAniInfo)); }
};
@@ -87,6 +88,7 @@ class GameVar : public CObject {
virtual ~GameVar();
virtual bool load(MfcArchive &file);
+ virtual void save(MfcArchive &file);
GameVar *getSubVarByName(const char *name);
bool setSubVarAsInt(const char *name, int value);
int getSubVarAsInt(const char *name);
diff --git a/engines/fullpipe/scenes/scene04.cpp b/engines/fullpipe/scenes/scene04.cpp
index 6810744f8a..d25b0a08e7 100644
--- a/engines/fullpipe/scenes/scene04.cpp
+++ b/engines/fullpipe/scenes/scene04.cpp
@@ -413,7 +413,7 @@ void sceneHandler04_jumpOnLadder() {
g_fp->_aniMan->changeStatics2(ST_MAN_LADDERDOWN);
- g_fp->_aniMan->_flags |= 1;
+ g_fp->_aniMan->_flags |= 0x100;
AniHandler aniHandler;
MakeQueueStruct mkQueue;
@@ -527,7 +527,7 @@ void sceneHandler04_gotoLadder(ExCommand *ex) {
if (mq->chain(g_fp->_aniMan)) {
g_fp->_aniMan->_priority = 12;
- g_fp->_aniMan->_flags |= 1;
+ g_fp->_aniMan->_flags |= 0x100;
} else {
delete mq;
}
@@ -573,6 +573,8 @@ MessageQueue *sceneHandler04_kozFly3(StaticANIObject *ani, double phase) {
AniHandler aniHandler;
MakeQueueStruct mkQueue;
+ debugC(2, kDebugSceneLogic, "scene04: kozFly3 (OK)");
+
aniHandler.attachObject(ANI_KOZAWKA);
mkQueue.ani = ani;
@@ -622,6 +624,8 @@ MessageQueue *sceneHandler04_kozFly5(StaticANIObject *ani, double phase) {
AniHandler aniHandler;
MakeQueueStruct mkQueue;
+ debugC(2, kDebugSceneLogic, "scene04: kozFly5 (OK)");
+
aniHandler.attachObject(ANI_KOZAWKA);
mkQueue.ani = ani;
@@ -693,6 +697,8 @@ MessageQueue *sceneHandler04_kozFly6(StaticANIObject *ani) {
AniHandler aniHandler;
MakeQueueStruct mkQueue;
+ debugC(2, kDebugSceneLogic, "scene04: kozFly6 (OK)");
+
aniHandler.attachObject(ANI_KOZAWKA);
mkQueue.ani = ani;
@@ -751,6 +757,8 @@ MessageQueue *sceneHandler04_kozFly7(StaticANIObject *ani, double phase) {
AniHandler aniHandler;
MakeQueueStruct mkQueue;
+ debugC(2, kDebugSceneLogic, "scene04: kozFly7");
+
aniHandler.attachObject(ANI_KOZAWKA);
mkQueue.ani = ani;
@@ -870,7 +878,7 @@ void sceneHandler04_shootKozyawka() {
else
mq = sceneHandler04_kozFly7(g_vars->scene04_walkingKozyawka, (double)(phase - 6) * 0.3333333333333333);
} else {
- mq = sceneHandler04_kozFly5(g_vars->scene04_walkingKozyawka, (double)(phase - 2) * 0.3333333333333333);
+ mq = sceneHandler04_kozFly7(g_vars->scene04_walkingKozyawka, (double)(phase - 2) * 0.3333333333333333);
}
} else {
mq = sceneHandler04_kozFly3(g_vars->scene04_walkingKozyawka, (double)phase * 0.5);
@@ -943,9 +951,15 @@ void sceneHandler04_walkKozyawka() {
void sceneHandler04_bottleUpdateObjects(int off) {
for (Common::List<GameObject *>::iterator it = g_vars->scene04_bottleObjList.begin(); it != g_vars->scene04_bottleObjList.end(); ++it) {
- GameObject *obj = *it;
+ if ((*it)->_objtype == kObjTypeStaticANIObject) {
+ StaticANIObject *st = (StaticANIObject *)*it;
- obj->setOXY(obj->_ox, off + obj->_oy);
+ st->setOXY(st->_ox, off + st->_oy);
+ } else {
+ GameObject *obj = *it;
+
+ obj->setOXY(obj->_ox, off + obj->_oy);
+ }
}
}
@@ -1179,6 +1193,8 @@ void sceneHandler04_handTake() {
}
void sceneHandler04_putKozyawkaBack(StaticANIObject *ani) {
+ debugC(2, kDebugSceneLogic, "scene04: putKozyawkaBack");
+
g_vars->scene04_bottleObjList.push_back(ani);
g_vars->scene04_kozyawkiAni.push_back(ani);
diff --git a/engines/fullpipe/scenes/scene06.cpp b/engines/fullpipe/scenes/scene06.cpp
index 4d1b263fd4..cfdc23cb44 100644
--- a/engines/fullpipe/scenes/scene06.cpp
+++ b/engines/fullpipe/scenes/scene06.cpp
@@ -475,7 +475,7 @@ void sceneHandler06_catchBall() {
}
void sceneHandler06_checkBallTarget(int par) {
- int pixel;
+ uint32 pixel;
if (g_vars->scene06_ballY <= 475) {
if (g_vars->scene06_mumsy->getPixelAtPos(g_vars->scene06_ballX, g_vars->scene06_ballY, &pixel)) {
diff --git a/engines/fullpipe/scenes/scene09.cpp b/engines/fullpipe/scenes/scene09.cpp
index 209cf183b3..f556785421 100644
--- a/engines/fullpipe/scenes/scene09.cpp
+++ b/engines/fullpipe/scenes/scene09.cpp
@@ -106,9 +106,6 @@ void scene09_initScene(Scene *sc) {
g_vars->scene09_hangers.push_back(hng);
}
- for (uint i = 0; i < g_vars->scene09_sceneBalls.size(); i++)
- delete g_vars->scene09_sceneBalls[i];
-
g_vars->scene09_sceneBalls.clear();
StaticANIObject *newball = new StaticANIObject(sc->getStaticANIObject1ById(ANI_BALL9, -1));
@@ -376,7 +373,12 @@ void sceneHandler09_checkHangerCollide() {
for (int i = 0; i < g_vars->scene09_numMovingHangers; i++) {
for (int j = 0; j < 4; j++) {
- hit = g_vars->scene09_hangers[i]->ani->isPixelHitAtPos(newx + g_vars->scene09_hangerOffsets[j].x, ball->_oy + g_vars->scene09_hangerOffsets[j].y);
+ int x1 = newx + g_vars->scene09_hangerOffsets[j].x;
+ int y1 = ball->_oy + g_vars->scene09_hangerOffsets[j].y;
+
+ // Check 2 pixels to compensate cord width
+ hit = g_vars->scene09_hangers[i]->ani->isPixelHitAtPos(x1, y1)
+ && g_vars->scene09_hangers[i]->ani->isPixelHitAtPos(x1 + 10, y1);
if (hit) {
sceneHandler09_ballExplode(b);
diff --git a/engines/fullpipe/scenes/scene14.cpp b/engines/fullpipe/scenes/scene14.cpp
index 0e072094d7..f6841a8bbe 100644
--- a/engines/fullpipe/scenes/scene14.cpp
+++ b/engines/fullpipe/scenes/scene14.cpp
@@ -810,7 +810,7 @@ int sceneHandler14(ExCommand *cmd) {
case 29:
if (g_vars->scene14_arcadeIsOn) {
- int pixel;
+ uint32 pixel;
if (g_vars->scene14_dudeCanKick && g_fp->_aniMan->getPixelAtPos(cmd->_sceneClickX, cmd->_sceneClickY, &pixel) && !g_fp->_aniMan->_movement) {
sceneHandler14_dudeDecline();
diff --git a/engines/fullpipe/scenes/scene16.cpp b/engines/fullpipe/scenes/scene16.cpp
index 89b797757b..52daef3b8a 100644
--- a/engines/fullpipe/scenes/scene16.cpp
+++ b/engines/fullpipe/scenes/scene16.cpp
@@ -269,7 +269,7 @@ void sceneHandler16_drink() {
mq->setFlags(mq->getFlags() | 1);
mq->chain(0);
} else {
- g_fp->_aniMan->_flags |= 1;
+ g_fp->_aniMan->_flags |= 0x100;
mq = new MessageQueue(g_fp->_currentScene->getMessageQueueById(QU_SC16_MANDRINK), 0, 1);
diff --git a/engines/fullpipe/scenes/scene18and19.cpp b/engines/fullpipe/scenes/scene18and19.cpp
index e6754e4ba4..a6f77a33fd 100644
--- a/engines/fullpipe/scenes/scene18and19.cpp
+++ b/engines/fullpipe/scenes/scene18and19.cpp
@@ -538,7 +538,7 @@ void sceneHandler18and19_girlJumpTo() {
void sceneHandler18and19_manStandArmchair() {
g_fp->_aniMan->changeStatics2(ST_MAN_RIGHT);
- g_fp->_aniMan->_flags |= 1;
+ g_fp->_aniMan->_flags |= 0x100;
g_fp->_aniMan->_priority = 35;
g_fp->_aniMan->startAnim(MV_MAN18_STANDKRESLO, 0, -1);
}
diff --git a/engines/fullpipe/scenes/scene25.cpp b/engines/fullpipe/scenes/scene25.cpp
index dfb767ee91..9bc8f412f1 100644
--- a/engines/fullpipe/scenes/scene25.cpp
+++ b/engines/fullpipe/scenes/scene25.cpp
@@ -516,7 +516,7 @@ void sceneHandler25_walkOnLadder(StaticANIObject *ani, Common::Point *pnt, Messa
ani->restartMessageQueue(mq);
}
- ani->_flags |= 1;
+ ani->_flags |= 0x100;
}
bool sceneHandler25_isOnLadder(ExCommand *cmd) {
diff --git a/engines/fullpipe/scenes/scene28.cpp b/engines/fullpipe/scenes/scene28.cpp
index d7d2d213ee..b9cdf7ae1c 100644
--- a/engines/fullpipe/scenes/scene28.cpp
+++ b/engines/fullpipe/scenes/scene28.cpp
@@ -185,6 +185,8 @@ void sceneHandler28_turnOn2() {
}
void sceneHandler28_startWork1() {
+ debugC(2, kDebugSceneLogic, "scene28: startWork");
+
g_fp->_aniMan->hide();
StaticANIObject *man = g_fp->_currentScene->getStaticANIObject1ById(ANI_MAN_28, -1);
@@ -202,7 +204,7 @@ void sceneHandler28_lift0Start() {
}
void sceneHandler28_lift1Start() {
- g_fp->_aniMan->_flags |= 1;
+ g_fp->_aniMan->_flags |= 0x100;
g_fp->_behaviorManager->setFlagByStaticAniObject(g_fp->_aniMan, 0);
@@ -218,7 +220,7 @@ void sceneHandler28_lift3Start() {
}
void sceneHandler28_lift4Start() {
- g_fp->_aniMan->_flags |= 1;
+ g_fp->_aniMan->_flags |= 0x100;
g_fp->_behaviorManager->setFlagByStaticAniObject(g_fp->_aniMan, 0);
@@ -230,7 +232,7 @@ void sceneHandler28_lift5Start() {
}
void sceneHandler28_lift6Start() {
- g_fp->_aniMan->_flags |= 1;
+ g_fp->_aniMan->_flags |= 0x100;
g_fp->_behaviorManager->setFlagByStaticAniObject(g_fp->_aniMan, 0);
@@ -242,10 +244,12 @@ void sceneHandler28_lift6Start() {
chainQueue(QU_SC28_LIFT6_START, 1);
}
-void sceneHandler28_clickLift(int keycode) {
+void sceneHandler28_clickLift(int numLift) {
int x = 0;
- switch (keycode) {
+ debugC(2, kDebugSceneLogic, "scene28: clickLift(%d)", numLift);
+
+ switch (numLift) {
case 0: x = 600; break;
case 1: x = 824; break;
case 2: x = 1055; break;
@@ -258,17 +262,20 @@ void sceneHandler28_clickLift(int keycode) {
if (abs(x - g_fp->_aniMan->_ox) > 1 || abs(472 - g_fp->_aniMan->_oy) > 1
|| g_fp->_aniMan->_movement
|| g_fp->_aniMan->_statics->_staticsId != ST_MAN_UP) {
+ debugC(2, kDebugSceneLogic, "scene28: clickLift: overwrite");
+
MessageQueue *mq = getCurrSceneSc2MotionController()->startMove(g_fp->_aniMan, x, 472, 1, ST_MAN_UP);
if (mq) {
ExCommand *ex = new ExCommand(0, 17, MSG_SC28_CLICKLIFT, 0, 0, 0, 1, 0, 0, 0);
ex->_excFlags |= 3;
+ ex->_param = numLift;
mq->addExCommandToEnd(ex);
postExCommand(g_fp->_aniMan->_id, 2, x, 472, 0, -1);
}
} else {
- switch (keycode) {
+ switch (numLift) {
case 0:
sceneHandler28_lift0Start();
break;
diff --git a/engines/fullpipe/scenes/scene34.cpp b/engines/fullpipe/scenes/scene34.cpp
index 6b74551e49..bc4ff18bae 100644
--- a/engines/fullpipe/scenes/scene34.cpp
+++ b/engines/fullpipe/scenes/scene34.cpp
@@ -189,7 +189,7 @@ void sceneHandler34_fromCactus(ExCommand *cmd) {
mq->setFlags(mq->getFlags() | 1);
mq->chain(0);
- g_fp->_aniMan->_flags |= 1;
+ g_fp->_aniMan->_flags |= 0x100;
}
void sceneHandler34_animateLeaveBoard(ExCommand *cmd) {
diff --git a/engines/fullpipe/scenes/scene35.cpp b/engines/fullpipe/scenes/scene35.cpp
index 7a290ade3b..3cdbb42c1e 100644
--- a/engines/fullpipe/scenes/scene35.cpp
+++ b/engines/fullpipe/scenes/scene35.cpp
@@ -88,7 +88,7 @@ void sceneHandler35_startFlow() {
g_fp->_behaviorManager->setBehaviorEnabled(g_vars->scene35_bellyInflater, ST_PDV_SMALL, QU_PDV_SML_TRY, 0);
g_vars->scene35_bellyInflater->changeStatics2(ST_PDV_SMALL);
- g_vars->scene35_bellyInflater->_flags &= 0xFEFF;
+ g_vars->scene35_bellyInflater->_flags &= ~0x100;
MessageQueue *mq = new MessageQueue(g_fp->_currentScene->getMessageQueueById(QU_SC35_EATHOZE), 0, 0);
@@ -105,7 +105,7 @@ void sceneHandler35_startFlow() {
if (!mq->chain(g_vars->scene35_bellyInflater))
delete mq;
- g_vars->scene35_bellyInflater->_flags |= 1;
+ g_vars->scene35_bellyInflater->_flags |= 0x100;
getCurrSceneSc2MotionController()->enableLinks(sO_CloseThing, 1);
diff --git a/engines/fullpipe/scenes/sceneDbg.cpp b/engines/fullpipe/scenes/sceneDbg.cpp
index bd53f5749f..2ba59778ba 100644
--- a/engines/fullpipe/scenes/sceneDbg.cpp
+++ b/engines/fullpipe/scenes/sceneDbg.cpp
@@ -41,19 +41,21 @@ void sceneDbgMenu_initScene(Scene *sc) {
}
GameObject *sceneHandlerDbgMenu_getObjectAtXY(int x, int y) {
- if (g_fp->_currentScene)
- for (uint i = 0; i < g_fp->_currentScene->_picObjList.size(); i++) {
- PictureObject *pic = (PictureObject *)g_fp->_currentScene->_picObjList[i];
+ if (!g_fp->_currentScene)
+ return 0;
+
+ for (uint i = 1; i < g_fp->_currentScene->_picObjList.size(); i++) {
+ PictureObject *pic = (PictureObject *)g_fp->_currentScene->_picObjList[i];
- if (x >= pic->_ox && y >= pic->_oy) {
- Common::Point point;
+ if (x >= pic->_ox && y >= pic->_oy) {
+ Common::Point point;
- pic->getDimensions(&point);
+ pic->getDimensions(&point);
- if (x <= pic->_ox + point.x && y <= pic->_oy + point.y && pic != g_vars->selector)
- return pic;
- }
+ if (x <= pic->_ox + point.x && y <= pic->_oy + point.y && pic != g_vars->selector)
+ return pic;
}
+ }
return 0;
}
diff --git a/engines/fullpipe/stateloader.cpp b/engines/fullpipe/stateloader.cpp
index 02053aa94e..b61834db34 100644
--- a/engines/fullpipe/stateloader.cpp
+++ b/engines/fullpipe/stateloader.cpp
@@ -25,6 +25,9 @@
#include "common/file.h"
#include "common/array.h"
#include "common/list.h"
+#include "common/memstream.h"
+
+#include "graphics/thumbnail.h"
#include "fullpipe/objects.h"
#include "fullpipe/gameloader.h"
@@ -37,6 +40,232 @@
namespace Fullpipe {
+void GameLoader::readSavegame(const char *fname) {
+ SaveHeader header;
+ Common::InSaveFile *saveFile = g_system->getSavefileManager()->openForLoading(fname);
+
+ if (!saveFile) {
+ warning("Cannot open save %s for loading", fname);
+ return;
+ }
+
+ header.version = saveFile->readUint32LE();
+ saveFile->read(header.magic, 32);
+ header.updateCounter = saveFile->readUint32LE();
+ header.unkField = saveFile->readUint32LE();
+ header.encSize = saveFile->readUint32LE();
+
+ debugC(3, kDebugLoading, "version: %d magic: %s updateCounter: %d unkField: %d encSize: %d, pos: %d",
+ header.version, header.magic, header.updateCounter, header.unkField, header.encSize, saveFile->pos());
+
+ if (header.version != 48)
+ return;
+
+ _updateCounter = header.updateCounter;
+
+ byte *data = (byte *)malloc(header.encSize);
+ saveFile->read(data, header.encSize);
+
+ byte *map = (byte *)malloc(800);
+ saveFile->read(map, 800);
+
+ MfcArchive temp(new Common::MemoryReadStream(map, 800));
+
+ if (_savegameCallback)
+ _savegameCallback(&temp, false);
+
+ delete saveFile;
+
+ // Deobfuscate the data
+ for (uint i = 0; i < header.encSize; i++)
+ data[i] -= i & 0x7f;
+
+ MfcArchive *archive = new MfcArchive(new Common::MemoryReadStream(data, header.encSize));
+
+ GameVar *var = (GameVar *)archive->readClass();
+
+ GameVar *v = _gameVar->getSubVarByName("OBJSTATES");
+
+ if (!v) {
+ v = _gameVar->addSubVarAsInt("OBJSTATES", 0);
+
+ if (!v) {
+ warning("No state to save");
+ delete archive;
+ return;
+ }
+ }
+
+ addVar(var, v);
+
+ getGameLoaderInventory()->loadPartial(*archive);
+
+ int32 arrSize = archive->readUint32LE();
+
+ for (uint i = 0; i < arrSize; i++) {
+ _sc2array[i]._picAniInfosCount = archive->readUint32LE();
+
+ free(_sc2array[i]._picAniInfos);
+ _sc2array[i]._picAniInfos = (PicAniInfo **)malloc(sizeof(PicAniInfo *) * _sc2array[i]._picAniInfosCount);
+
+ for (uint j = 0; j < _sc2array[i]._picAniInfosCount; j++) {
+ _sc2array[i]._picAniInfos[j] = new PicAniInfo();
+ _sc2array[i]._picAniInfos[j]->load(*archive);
+ }
+ }
+
+ delete archive;
+
+ getGameLoaderInventory()->rebuildItemRects();
+
+ PreloadItem preloadItem;
+
+ v = _gameVar->getSubVarByName("OBJSTATES")->getSubVarByName("SAVEGAME");
+
+ if (v) {
+ if (g_fp->_currentScene)
+ preloadItem.preloadId1 = g_fp->_currentScene->_sceneId & 0xffff;
+ else
+ preloadItem.preloadId1 = 0;
+
+ preloadItem.param = v->getSubVarAsInt("Entrance");
+ preloadItem.preloadId2 = 0;
+ preloadItem.sceneId = v->getSubVarAsInt("Scene");
+
+ if (_preloadCallback) {
+ if (!_preloadCallback(preloadItem, 0))
+ return;
+ }
+
+ clearGlobalMessageQueueList1();
+
+ if (g_fp->_currentScene)
+ unloadScene(g_fp->_currentScene->_sceneId);
+
+ g_fp->_currentScene = 0;
+
+ if (_preloadCallback)
+ _preloadCallback(preloadItem, 50);
+
+ loadScene(preloadItem.sceneId);
+
+ ExCommand *ex = new ExCommand(preloadItem.sceneId, 17, 62, 0, 0, 0, 1, 0, 0, 0);
+ ex->_excFlags = 2;
+ ex->_param = preloadItem.param;
+
+ if (_preloadCallback)
+ _preloadCallback(preloadItem, 100);
+
+ ex->postMessage();
+ }
+}
+
+void parseSavegameHeader(Fullpipe::FullpipeSavegameHeader &header, SaveStateDescriptor &desc) {
+ int day = (header.date >> 24) & 0xFF;
+ int month = (header.date >> 16) & 0xFF;
+ int year = header.date & 0xFFFF;
+ desc.setSaveDate(year, month, day);
+ int hour = (header.time >> 8) & 0xFF;
+ int minutes = header.time & 0xFF;
+ desc.setSaveTime(hour, minutes);
+ desc.setPlayTime(header.playtime * 1000);
+
+ desc.setDescription(header.saveName);
+}
+
+void fillDummyHeader(Fullpipe::FullpipeSavegameHeader &header) {
+ // This is wrong header, perhaps it is original savegame. Thus fill out dummy values
+ header.date = (20 << 24) | (9 << 16) | 2016;
+ header.time = (9 << 8) | 56;
+ header.playtime = 1000;
+}
+
+bool readSavegameHeader(Common::InSaveFile *in, FullpipeSavegameHeader &header) {
+ header.thumbnail = NULL;
+
+ uint oldPos = in->pos();
+
+ in->seek(-4, SEEK_END);
+
+ uint headerOffset = in->readUint32LE();
+
+ // Sanity check
+ if (headerOffset >= in->pos() || headerOffset == 0) {
+ in->seek(oldPos, SEEK_SET); // Rewind the file
+ fillDummyHeader(header);
+ return false;
+ }
+
+ in->seek(headerOffset, SEEK_SET);
+
+ in->read(header.id, 6);
+
+ // Validate the header Id
+ if (strcmp(header.id, "SVMCR")) {
+ in->seek(oldPos, SEEK_SET); // Rewind the file
+ fillDummyHeader(header);
+ return false;
+ }
+
+ header.version = in->readByte();
+ if (header.version != FULLPIPE_SAVEGAME_VERSION) {
+ in->seek(oldPos, SEEK_SET); // Rewind the file
+ fillDummyHeader(header);
+ return false;
+ }
+
+ header.date = in->readUint32LE();
+ header.time = in->readUint16LE();
+ header.playtime = in->readUint32LE();
+
+ // Generate savename
+ SaveStateDescriptor desc;
+
+ parseSavegameHeader(header, desc);
+ header.saveName = Common::String::format("%s %s", desc.getSaveDate().c_str(), desc.getSaveTime().c_str());
+
+ // Get the thumbnail
+ header.thumbnail = Graphics::loadThumbnail(*in);
+
+ in->seek(oldPos, SEEK_SET); // Rewind the file
+
+ if (!header.thumbnail)
+ return false;
+
+ return true;
+}
+
+void GameLoader::addVar(GameVar *var, GameVar *subvar) {
+ if (var && subvar) {
+ int type = var->_varType;
+ if (type == subvar->_varType && (!type || type == 1))
+ subvar->_value.intValue = var->_value.intValue;
+
+ for (GameVar *v = var->_subVars; v; v = v->_nextVarObj) {
+ GameVar *nv = subvar->getSubVarByName(v->_varName);
+ if (!nv) {
+ nv = new GameVar;
+ nv->_varName = (char *)calloc(strlen(v->_varName) + 1, 1);
+ strcpy(nv->_varName, v->_varName);
+ nv->_varType = v->_varType;
+
+ subvar->addSubVar(nv);
+ }
+
+ addVar(v, nv);
+ }
+ }
+}
+
+void gameLoaderSavegameCallback(MfcArchive *archive, bool mode) {
+ if (mode)
+ for (int i = 0; i < 200; i++)
+ archive->writeUint32LE(g_fp->_mapTable[i]);
+ else
+ for (int i = 0; i < 200; i++)
+ g_fp->_mapTable[i] = archive->readUint32LE();
+}
+
bool FullpipeEngine::loadGam(const char *fname, int scene) {
_gameLoader = new GameLoader();
@@ -60,7 +289,7 @@ bool FullpipeEngine::loadGam(const char *fname, int scene) {
// _sceneSwitcher = sceneSwitcher; // substituted with direct call
_gameLoader->_preloadCallback = preloadCallback;
- // _readSavegameCallback = gameLoaderReadSavegameCallback; // TODO
+ _gameLoader->_savegameCallback = gameLoaderSavegameCallback;
_aniMan = accessScene(SC_COMMON)->getAniMan();
_scene2 = 0;
@@ -159,6 +388,8 @@ GameVar::GameVar() {
_varType = 0;
_value.floatValue = 0;
_varName = 0;
+
+ _objtype = kObjTypeGameVar;
}
GameVar::~GameVar() {
diff --git a/engines/fullpipe/statesaver.cpp b/engines/fullpipe/statesaver.cpp
new file mode 100644
index 0000000000..c6f4851a44
--- /dev/null
+++ b/engines/fullpipe/statesaver.cpp
@@ -0,0 +1,200 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "common/memstream.h"
+
+#include "graphics/thumbnail.h"
+
+#include "fullpipe/fullpipe.h"
+
+#include "fullpipe/gameloader.h"
+#include "fullpipe/objects.h"
+
+namespace Fullpipe {
+
+void GameLoader::writeSavegame(Scene *sc, const char *fname) {
+ GameVar *v = _gameVar->getSubVarByName("OBJSTATES")->getSubVarByName("SAVEGAME");
+
+ if (!v) {
+ v = _gameVar->getSubVarByName("OBJSTATES")->addSubVarAsInt("SAVEGAME", 0);
+
+ if (!v) {
+ warning("No state to save");
+ return;
+ }
+ }
+
+ SaveHeader header;
+
+ v->setSubVarAsInt("Scene", sc->_sceneId);
+
+ saveScenePicAniInfos(sc->_sceneId);
+ memset(&header, 0, sizeof(header));
+
+ header.version = 48; // '0'
+ strcpy(header.magic, "FullPipe Savegame");
+ header.updateCounter = _updateCounter;
+ header.unkField = 1;
+
+ Common::MemoryWriteStreamDynamic stream;
+
+ MfcArchive *archive = new MfcArchive(&stream);
+
+ v = _gameVar->getSubVarByName("OBJSTATES");
+
+ GameVar *nxt = 0;
+ GameVar *prv = 0;
+ GameVar *par;
+ if (v) {
+ nxt = v->_nextVarObj;
+ prv = v->_prevVarObj;
+ par = v->_parentVarObj;
+ v->_parentVarObj = 0;
+ v->_nextVarObj = 0;
+ v->_prevVarObj = 0;
+ }
+
+ archive->writeObject(v);
+
+ if (v) {
+ v->_parentVarObj = par;
+ v->_nextVarObj = nxt;
+ v->_prevVarObj = prv;
+ }
+
+ getGameLoaderInventory()->savePartial(*archive);
+
+ archive->writeUint32LE(_sc2array.size());
+
+ for (uint i = 0; i < _sc2array.size(); i++) {
+ archive->writeUint32LE(_sc2array[i]._picAniInfosCount);
+
+ for (uint j = 0; j < _sc2array[i]._picAniInfosCount; j++) {
+ _sc2array[i]._picAniInfos[j]->save(*archive);
+ }
+ }
+
+ header.encSize = stream.size();
+
+ // Now obfuscate the data
+ for (uint i = 0; i < header.encSize; i++)
+ stream.getData()[i] += i & 0x7f;
+
+ if (_savegameCallback)
+ _savegameCallback(archive, true);
+
+ // Now dump it into save file
+ Common::OutSaveFile *saveFile = g_system->getSavefileManager()->openForSaving(fname);
+
+ if (!saveFile) {
+ warning("Cannot open file for writing: %s", fname);
+ return;
+ }
+
+ saveFile->writeUint32LE(header.version);
+ saveFile->write(header.magic, 32);
+ saveFile->writeUint32LE(header.updateCounter);
+ saveFile->writeUint32LE(header.unkField);
+ saveFile->writeUint32LE(header.encSize);
+
+ debugC(3, kDebugLoading, "version: %d magic: %s updateCounter: %d unkField: %d encSize: %d, pos: %d",
+ header.version, header.magic, header.updateCounter, header.unkField, header.encSize, saveFile->pos());
+
+ saveFile->write(stream.getData(), stream.size());
+
+ uint headerPos = saveFile->pos();
+ FullpipeSavegameHeader header2;
+
+ strcpy(header2.id, "SVMCR");
+ header2.version = FULLPIPE_SAVEGAME_VERSION;
+
+ TimeDate curTime;
+ g_system->getTimeAndDate(curTime);
+
+ header2.date = ((curTime.tm_mday & 0xFF) << 24) | (((curTime.tm_mon + 1) & 0xFF) << 16) | ((curTime.tm_year + 1900) & 0xFFFF);
+ header2.time = ((curTime.tm_hour & 0xFF) << 8) | ((curTime.tm_min) & 0xFF);
+
+ header2.playtime = g_fp->getTotalPlayTime() / 1000;
+
+ saveFile->write(header2.id, 6);
+ saveFile->writeByte(header2.version);
+ saveFile->writeUint32LE(header2.date);
+ saveFile->writeUint16LE(header2.time);
+ saveFile->writeUint32LE(header2.playtime);
+
+ Graphics::saveThumbnail(*saveFile); // FIXME. Render proper screen
+
+ saveFile->writeUint32LE(headerPos); // Store where the header starts
+
+ saveFile->finalize();
+
+ delete saveFile;
+ delete archive;
+}
+
+
+void PicAniInfo::save(MfcArchive &file) {
+ debugC(5, kDebugLoading, "PicAniInfo::save()");
+
+ file.writeUint32LE(type);
+ file.writeUint16LE(objectId);
+ file.writeUint16LE(field_6);
+ file.writeUint32LE(field_8);
+ file.writeUint16LE(sceneId);
+ file.writeUint16LE(field_E);
+ file.writeSint32LE(ox);
+ file.writeSint32LE(oy);
+ file.writeUint32LE(priority);
+ file.writeUint16LE(staticsId);
+ file.writeUint16LE(movementId);
+ file.writeUint16LE(dynamicPhaseIndex);
+ file.writeUint16LE(flags);
+ file.writeUint32LE(field_24);
+ file.writeUint32LE(someDynamicPhaseIndex);
+}
+
+void GameVar::save(MfcArchive &file) {
+ file.writePascalString(_varName);
+ file.writeUint32LE(_varType);
+
+ switch (_varType) {
+ case 0:
+ file.writeUint32LE(_value.intValue);
+ break;
+ case 1:
+ file.writeUint32LE(_value.intValue); // FIXME
+ break;
+ case 2:
+ file.writePascalString(_value.stringValue);
+ break;
+ default:
+ error("Unknown var type: %d (0x%x)", _varType, _varType);
+ }
+
+ file.writeObject(_parentVarObj);
+ file.writeObject(_prevVarObj);
+ file.writeObject(_nextVarObj);
+ file.writeObject(_field_14);
+ file.writeObject(_subVars);
+}
+
+} // End of namespace Fullpipe
diff --git a/engines/fullpipe/statics.cpp b/engines/fullpipe/statics.cpp
index 0539edd047..79432d440a 100644
--- a/engines/fullpipe/statics.cpp
+++ b/engines/fullpipe/statics.cpp
@@ -191,9 +191,9 @@ StaticANIObject::StaticANIObject(StaticANIObject *src) : GameObject(src) {
Movement *newmov;
if (src->_movements[i]->_currMovement) {
- // WORKAROUND: Original uses weird construction here:
- // new Movement(getMovementById(src->getMovementIdById(mov->_id)), this);
- newmov = new Movement(src->getMovementById(src->getMovementIdById(src->_movements[i]->_id)), this);
+ // This is weird code. Logically it should be
+ // newmov = new Movement(src->getMovementById(src->getMovementIdById(src->_movements[i]->_id)), this);
+ newmov = new Movement(getMovementById(src->getMovementIdById(src->_movements[i]->_id)), this);
newmov->_id = src->_movements[i]->_id;
} else {
newmov = new Movement(src->_movements[i], 0, -1, this);
@@ -440,7 +440,7 @@ int StaticANIObject::getMovementIdById(int itemId) {
if (mov->_currMovement) {
if (mov->_id == itemId)
- return mov->_id;
+ return mov->_currMovement->_id;
if (mov->_currMovement->_id == itemId)
return mov->_id;
@@ -462,7 +462,7 @@ bool StaticANIObject::isPixelHitAtPos(int x, int y) {
return getPixelAtPos(x, y, 0, true);
}
-bool StaticANIObject::getPixelAtPos(int x, int y, int *pixel, bool hitOnly) {
+bool StaticANIObject::getPixelAtPos(int x, int y, uint32 *pixel, bool hitOnly) {
bool res = false;
Picture *pic;
@@ -538,11 +538,6 @@ void Movement::draw(bool flipFlag, int angle) {
if (_currDynamicPhase->getPaletteData())
g_fp->_globalPalette = _currDynamicPhase->getPaletteData();
- if (_currDynamicPhase->getAlpha() < 0xFF) {
- warning("Movement::draw: alpha < 0xff: %d", _currDynamicPhase->getAlpha());
- //vrtSetAlphaBlendMode(g_vrtDrawHandle, 1, _currDynamicPhase->getAlpha());
- }
-
Bitmap *bmp;
if (_currMovement) {
bmp = _currDynamicPhase->getPixelData()->reverseImage();
diff --git a/engines/fullpipe/statics.h b/engines/fullpipe/statics.h
index 6206fef4de..9c7cab5448 100644
--- a/engines/fullpipe/statics.h
+++ b/engines/fullpipe/statics.h
@@ -257,7 +257,7 @@ public:
MessageQueue *changeStatics1(int msgNum);
void changeStatics2(int objId);
- bool getPixelAtPos(int x, int y, int *pixel, bool hitOnly = false);
+ bool getPixelAtPos(int x, int y, uint32 *pixel, bool hitOnly = false);
bool isPixelHitAtPos(int x, int y);
};
diff --git a/engines/fullpipe/utils.cpp b/engines/fullpipe/utils.cpp
index de7cbbbaab..9dfebf2e83 100644
--- a/engines/fullpipe/utils.cpp
+++ b/engines/fullpipe/utils.cpp
@@ -109,6 +109,17 @@ char *MfcArchive::readPascalString(bool twoByte) {
return tmp;
}
+void MfcArchive::writePascalString(const char *str, bool twoByte) {
+ int len = strlen(str);
+
+ if (twoByte)
+ writeUint16LE(len);
+ else
+ writeByte(len);
+
+ write(str, len);
+}
+
MemoryObject::MemoryObject() {
_memfilename = 0;
_mfield_8 = 0;
@@ -347,6 +358,20 @@ static CObject *createObject(int objectId) {
}
MfcArchive::MfcArchive(Common::SeekableReadStream *stream) {
+ _stream = stream;
+ _wstream = 0;
+
+ init();
+}
+
+MfcArchive::MfcArchive(Common::WriteStream *stream) {
+ _wstream = stream;
+ _stream = 0;
+
+ init();
+}
+
+void MfcArchive::init() {
for (int i = 0; classMap[i].name; i++) {
_classMap[classMap[i].name] = classMap[i].id;
}
@@ -354,8 +379,6 @@ MfcArchive::MfcArchive(Common::SeekableReadStream *stream) {
_lastIndex = 1;
_level = 0;
- _stream = stream;
-
_objectMap.push_back(0);
_objectIdMap.push_back(kNullObject);
}
@@ -379,7 +402,9 @@ CObject *MfcArchive::parseClass(bool *isCopyReturned) {
debugC(7, kDebugLoading, "parseClass::obTag = %d (%04x) at 0x%08x", obTag, obTag, pos() - 2);
- if (obTag == 0xffff) {
+ if (obTag == 0x0000) {
+ return NULL;
+ } else if (obTag == 0xffff) {
int schema = readUint16LE();
debugC(7, kDebugLoading, "parseClass::schema = %d", schema);
@@ -434,6 +459,36 @@ CObject *MfcArchive::parseClass(bool *isCopyReturned) {
return res;
}
+void MfcArchive::writeObject(CObject *obj) {
+ if (obj == NULL) {
+ writeUint16LE(0);
+ } else if (_objectHash.contains(obj)) {
+ int32 idx = _objectHash[obj];
+
+ if (idx < 0x7fff) {
+ writeUint16LE(idx);
+ } else {
+ writeUint16LE(0x7fff);
+ writeUint32LE(idx);
+ }
+ } else {
+ writeUint16LE(0xffff); // New class
+ _objectHash[obj] = _lastIndex++;
+
+ writeUint16LE(1); // schema
+
+ switch (obj->_objtype) {
+ case kObjTypeGameVar:
+ writePascalString(lookupObjectId(kGameVar), true); // Two byte counter
+ break;
+ default:
+ error("Unhandled save for object type: %d", obj->_objtype);
+ }
+
+ obj->save(*this);
+ }
+}
+
char *genFileName(int superId, int sceneId, const char *ext) {
char *s = (char *)calloc(256, 1);
diff --git a/engines/fullpipe/utils.h b/engines/fullpipe/utils.h
index da3ab7ee4f..41a54f4ce7 100644
--- a/engines/fullpipe/utils.h
+++ b/engines/fullpipe/utils.h
@@ -32,36 +32,64 @@ namespace Fullpipe {
class CObject;
class NGIArchive;
+struct Pointer_EqualTo {
+ bool operator()(const void *x, const void *y) const { return x == y; }
+};
+
+struct Pointer_Hash {
+ uint operator()(const void *x) const {
+#ifdef SCUMM_64BITS
+ uint64 v = (uint64)x;
+ return (v >> 32) ^ (v & 0xffffffff);
+#else
+ return (uint)x;
+#endif
+ }
+};
+
+typedef Common::HashMap<void *, int, Pointer_Hash, Pointer_EqualTo> ObjHash;
+
typedef Common::HashMap<Common::String, int, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> ClassMap;
-class MfcArchive : public Common::SeekableReadStream {
+class MfcArchive : public Common::SeekableReadStream, public Common::WriteStream {
ClassMap _classMap;
Common::Array<CObject *> _objectMap;
Common::Array<int> _objectIdMap;
+ ObjHash _objectHash;
int _lastIndex;
int _level;
Common::SeekableReadStream *_stream;
+ Common::WriteStream *_wstream;
- public:
+public:
MfcArchive(Common::SeekableReadStream *file);
+ MfcArchive(Common::WriteStream *file);
char *readPascalString(bool twoByte = false);
+ void writePascalString(const char *str, bool twoByte = false);
int readCount();
double readDouble();
CObject *parseClass(bool *isCopyReturned);
CObject *readClass();
+ void writeObject(CObject *obj);
+
void incLevel() { _level++; }
void decLevel() { _level--; }
int getLevel() { return _level; }
virtual bool eos() const { return _stream->eos(); }
virtual uint32 read(void *dataPtr, uint32 dataSize) { return _stream->read(dataPtr, dataSize); }
- virtual int32 pos() const { return _stream->pos(); }
+ virtual int32 pos() const { return _stream ? _stream->pos() : _wstream->pos(); }
virtual int32 size() const { return _stream->size(); }
virtual bool seek(int32 offset, int whence = SEEK_SET) { return _stream->seek(offset, whence); }
+
+ virtual uint32 write(const void *dataPtr, uint32 dataSize) { return _wstream->write(dataPtr, dataSize); }
+
+private:
+ void init();
};
enum ObjType {
@@ -75,7 +103,8 @@ enum ObjType {
kObjTypeMctlCompound,
kObjTypeObjstateCommand,
kObjTypePictureObject,
- kObjTypeStaticANIObject
+ kObjTypeStaticANIObject,
+ kObjTypeGameVar
};
class CObject {
@@ -84,6 +113,7 @@ public:
CObject() : _objtype(kObjTypeDefault) {}
virtual bool load(MfcArchive &in) { return true; }
+ virtual void save(MfcArchive &out) { error("Not implemented for obj type: %d", _objtype); }
virtual ~CObject() {}
bool loadFile(const char *fname);
diff --git a/engines/kyra/saveload_eob.cpp b/engines/kyra/saveload_eob.cpp
index 9329d14255..7823064c3b 100644
--- a/engines/kyra/saveload_eob.cpp
+++ b/engines/kyra/saveload_eob.cpp
@@ -554,7 +554,7 @@ bool EoBCoreEngine::importOriginalSaveFile(int destSlot, const char *sourceFile)
}
delete fs;
- ::GUI::MessageDialog dialog(Common::String::format(_("The following original save game file has been found in your game path:\n\n%s %s\n\nDo you wish to use this save game file with ScummVM?\n\n"), temp.c_str(), dsc.c_str()), _("Yes"), _("No"));
+ ::GUI::MessageDialog dialog(Common::String::format(_("The following original saved game file has been found in your game path:\n\n%s %s\n\nDo you wish to use this saved game file with ScummVM?\n\n"), temp.c_str(), dsc.c_str()), _("Yes"), _("No"));
if (dialog.runModal())
origFiles.push_back(temp);
}
@@ -579,7 +579,7 @@ bool EoBCoreEngine::importOriginalSaveFile(int destSlot, const char *sourceFile)
// This will probably never happen, since we do have 990 save slots
if (assignedSlots != numFilesFound)
- warning("%d original save files could not be converted due to missing save game slots", numFilesFound - assignedSlots);
+ warning("%d original save files could not be converted due to missing saved game slots", numFilesFound - assignedSlots);
} else {
newSlots.push_back(destSlot);
@@ -587,7 +587,7 @@ bool EoBCoreEngine::importOriginalSaveFile(int destSlot, const char *sourceFile)
if (destSlot != -1) {
if (Common::find(_gui->_saveSlots.begin(), _gui->_saveSlots.end(), destSlot) != _gui->_saveSlots.end()) {
- ::GUI::MessageDialog dialog(Common::String::format(_("A save game file was found in the specified slot %d. Overwrite?\n\n"), destSlot), _("Yes"), _("No"));
+ ::GUI::MessageDialog dialog(Common::String::format(_("A saved game file was found in the specified slot %d. Overwrite?\n\n"), destSlot), _("Yes"), _("No"));
if (!dialog.runModal())
return false;
}
@@ -620,7 +620,7 @@ bool EoBCoreEngine::importOriginalSaveFile(int destSlot, const char *sourceFile)
_inf->reset();
if (destSlot == -1 && importedCount) {
- ::GUI::MessageDialog dialog(Common::String::format(_("%d original save game files have been successfully imported into\nScummVM. If you want to manually import original save game files later you will\nneed to open the ScummVM debug console and use the command 'import_savefile'.\n\n"), importedCount));
+ ::GUI::MessageDialog dialog(Common::String::format(_("%d original saved game files have been successfully imported into\nScummVM. If you want to manually import original saved game files later you will\nneed to open the ScummVM debug console and use the command 'import_savefile'.\n\n"), importedCount));
dialog.runModal();
}
diff --git a/engines/sci/detection_tables.h b/engines/sci/detection_tables.h
index eda6bfae64..fafbf60d5a 100644
--- a/engines/sci/detection_tables.h
+++ b/engines/sci/detection_tables.h
@@ -2197,6 +2197,20 @@ static const struct ADGameDescription SciGameDescriptions[] = {
AD_LISTEND},
Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+ // Larry 3 - English Amiga
+ // Executable scanning reports "1.002.006"
+ // Game version 1.027
+ {"lsl3", "", {
+ {"resource.map", 0, "4c39724c91f53afe08a1350172a2b67a", 5328},
+ {"resource.000", 0, "cdc2e21e297b10fe8fed6377af8c5698", 66472},
+ {"resource.001", 0, "6abbaf8c7e3b36dd868868ed187e8995", 71761},
+ {"resource.002", 0, "a883424fe6d594fec0cd5a79e7ad54c8", 477285},
+ {"resource.003", 0, "5c10e462c8cf589610773e4fe8bfd996", 526871},
+ {"resource.004", 0, "f408e59cbee1457f042e5773b8c53951", 651637},
+ {"resource.005", 0, "433911eb764089d493aed1f958a5615a", 523993},
+ AD_LISTEND},
+ Common::EN_ANY, Common::kPlatformAmiga, 0, GUIO4(GUIO_NOSPEECH, GAMEOPTION_PREFER_DIGITAL_SFX, GAMEOPTION_ORIGINAL_SAVELOAD, GAMEOPTION_FB01_MIDI) },
+
// Larry 3 - English Atari ST
// Game version 1.021, 1990-01-27
// Int#6.26.90
diff --git a/engines/sci/engine/kernel.cpp b/engines/sci/engine/kernel.cpp
index d764a88a0a..c03504d277 100644
--- a/engines/sci/engine/kernel.cpp
+++ b/engines/sci/engine/kernel.cpp
@@ -171,8 +171,11 @@ void Kernel::loadSelectorNames() {
// (io) -> optionally integer AND an object
// (i) -> optional integer
// . -> any type
-// i* -> optional multiple integers
-// .* -> any parameters afterwards (or none)
+// i* -> at least one integer, more integers may follow after that
+// (i*) -> optional multiple integers
+// .* -> at least one parameter of any type and more parameters of any type may follow
+// (.*) -> any parameters afterwards (or none)
+// * -> means "more of the last parameter may follow (or none at all)", must be at the end of a signature. Is not valid anywhere else.
static uint16 *parseKernelSignature(const char *kernelName, const char *writtenSig) {
const char *curPos;
char curChar;
diff --git a/engines/sci/engine/script_patches.cpp b/engines/sci/engine/script_patches.cpp
index c1a4b12292..664e7fa0c4 100644
--- a/engines/sci/engine/script_patches.cpp
+++ b/engines/sci/engine/script_patches.cpp
@@ -3181,10 +3181,41 @@ static const uint16 qfg1vgaPatchWhiteStagDagger[] = {
PATCH_END
};
+// The dagger range has a script bug that can freeze the game or cause Brutus to kill you even after you've killed him.
+// This is a bug in the original game.
+//
+// When Bruno leaves, a 300 tick countdown starts. If you kill Brutus or leave room 73 within those 300 ticks then
+// the game is left in a broken state. For the rest of the game, if you ever return to the dagger range from the
+// east or west during the first half of the day then the game will freeze or Brutus will come back to life
+// and kill you, even if you already killed him.
+//
+// Special thanks, credits and kudos to sluicebox, who did a ton of research on this and even found this game bug originally.
+//
+// Applies to at least: English floppy, Mac floppy
+// Responsible method: brutusWaits::changeState
+// Fixes bug #9558
+static const uint16 qfg1vgaSignatureBrutusScriptFreeze[] = {
+ 0x78, // push1
+ 0x38, SIG_UINT16(0x144), // pushi 144h (324d)
+ 0x45, 0x05, 0x02, // call export 5 of script 0
+ SIG_MAGICDWORD,
+ 0x34, SIG_UINT16(0x12c), // ldi 12Ch (300d)
+ 0x65, 0x20, // aTop ticks
+ SIG_END
+};
+
+static const uint16 qfg1vgaPatchBrutusScriptFreeze[] = {
+ 0x34, PATCH_UINT16(0), // ldi 0 (waste 7 bytes)
+ 0x35, 0x00, // ldi 0
+ 0x35, 0x00, // ldi 0
+ PATCH_END
+};
+
// script, description, signature patch
static const SciScriptPatcherEntry qfg1vgaSignatures[] = {
{ true, 41, "moving to castle gate", 1, qfg1vgaSignatureMoveToCastleGate, qfg1vgaPatchMoveToCastleGate },
{ true, 55, "healer's hut, no delay for buy/steal", 1, qfg1vgaSignatureHealerHutNoDelay, qfg1vgaPatchHealerHutNoDelay },
+ { true, 73, "brutus script freeze glitch", 1, qfg1vgaSignatureBrutusScriptFreeze, qfg1vgaPatchBrutusScriptFreeze },
{ true, 77, "white stag dagger throw animation glitch", 1, qfg1vgaSignatureWhiteStagDagger, qfg1vgaPatchWhiteStagDagger },
{ true, 96, "funny room script bug fixed", 1, qfg1vgaSignatureFunnyRoomFix, qfg1vgaPatchFunnyRoomFix },
{ true, 210, "cheetaur description fixed", 1, qfg1vgaSignatureCheetaurDescription, qfg1vgaPatchCheetaurDescription },
diff --git a/engines/sherlock/debugger.cpp b/engines/sherlock/debugger.cpp
index 55243c4bc7..39bc1b90ab 100644
--- a/engines/sherlock/debugger.cpp
+++ b/engines/sherlock/debugger.cpp
@@ -47,6 +47,7 @@ Debugger::Debugger(SherlockEngine *vm) : GUI::Debugger(), _vm(vm) {
registerCmd("listfiles", WRAP_METHOD(Debugger, cmdListFiles));
registerCmd("dumpfile", WRAP_METHOD(Debugger, cmdDumpFile));
registerCmd("locations", WRAP_METHOD(Debugger, cmdLocations));
+ registerCmd("flag", WRAP_METHOD(Debugger, cmdFlag));
}
void Debugger::postEnter() {
@@ -159,5 +160,27 @@ bool Debugger::cmdLocations(int argc, const char **argv) {
return false;
}
+bool Debugger::cmdFlag(int argc, const char **argv) {
+ if (argc < 2) {
+ debugPrintf("Format: flag <number> [set | clear | toggle]\n");
+ } else {
+ int flagNum = strToInt(argv[1]);
+
+ if (argc == 2) {
+ debugPrintf("Flag %d is %s\n", flagNum, _vm->_flags[flagNum] ? "Set" : "Clear");
+ } else {
+ if (!strcmp(argv[2], "set"))
+ _vm->_flags[flagNum] = true;
+ else if (!strcmp(argv[2], "clear"))
+ _vm->_flags[flagNum] = false;
+ else if (!strcmp(argv[2], "toggle"))
+ _vm->_flags[flagNum] = !_vm->_flags[flagNum];
+
+ debugPrintf("Flag %d is now %s\n", flagNum, _vm->_flags[flagNum] ? "Set" : "Clear");
+ }
+ }
+
+ return true;
+}
} // End of namespace Sherlock
diff --git a/engines/sherlock/debugger.h b/engines/sherlock/debugger.h
index bcc4448c32..ae74690bed 100644
--- a/engines/sherlock/debugger.h
+++ b/engines/sherlock/debugger.h
@@ -68,6 +68,11 @@ private:
* Show all locations on the map
*/
bool cmdLocations(int argc, const char **argv);
+
+ /**
+ * Get or set the value of a flag
+ */
+ bool cmdFlag(int argc, const char **argv);
protected:
SherlockEngine *_vm;
Common::String _3doPlayMovieFile;
diff --git a/engines/sword1/control.cpp b/engines/sword1/control.cpp
index 201c3aa9bd..be5f33600e 100644
--- a/engines/sword1/control.cpp
+++ b/engines/sword1/control.cpp
@@ -861,7 +861,7 @@ void Control::checkForOldSaveGames() {
GUI::MessageDialog dialog0(
_("ScummVM found that you have old savefiles for Broken Sword 1 that should be converted.\n"
- "The old save game format is no longer supported, so you will not be able to load your games if you don't convert them.\n\n"
+ "The old saved game format is no longer supported, so you will not be able to load your games if you don't convert them.\n\n"
"Press OK to convert them now, otherwise you will be asked again the next time you start the game.\n"), _("OK"), _("Cancel"));
int choice = dialog0.runModal();
@@ -1159,7 +1159,7 @@ bool Control::restoreGameFromFile(uint8 slot) {
uint saveHeader = inf->readUint32LE();
if (saveHeader != SAVEGAME_HEADER) {
// Display an error message, and do nothing
- displayMessage(0, "Save game '%s' is corrupt", fName);
+ displayMessage(0, "Saved game '%s' is corrupt", fName);
return false;
}
@@ -1167,7 +1167,7 @@ bool Control::restoreGameFromFile(uint8 slot) {
uint8 saveVersion = inf->readByte();
if (saveVersion > SAVEGAME_VERSION) {
- warning("Different save game version");
+ warning("Different saved game version");
return false;
}
@@ -1229,8 +1229,8 @@ bool Control::convertSaveGame(uint8 slot, char *desc) {
if (testSave) {
delete testSave;
- Common::String msg = Common::String::format(_("Target new save game already exists!\n"
- "Would you like to keep the old save game (%s) or the new one (%s)?\n"),
+ Common::String msg = Common::String::format(_("Target new saved game already exists!\n"
+ "Would you like to keep the old saved game (%s) or the new one (%s)?\n"),
oldFileName, newFileName);
GUI::MessageDialog dialog0(msg, _("Keep the old one"), _("Keep the new one"));
diff --git a/engines/titanic/core/dont_save_file_item.h b/engines/titanic/core/dont_save_file_item.h
index f5ec4f791d..38620474d9 100644
--- a/engines/titanic/core/dont_save_file_item.h
+++ b/engines/titanic/core/dont_save_file_item.h
@@ -41,6 +41,11 @@ public:
* Load the data for the class from file
*/
virtual void load(SimpleFile *file);
+
+ /**
+ * Returns true if the item is a file item
+ */
+ virtual bool isFileItem() const { return false; }
};
} // End of namespace Titanic
diff --git a/engines/titanic/star_control/fpoint.cpp b/engines/titanic/star_control/fpoint.cpp
index f3d7008324..a2829572f8 100644
--- a/engines/titanic/star_control/fpoint.cpp
+++ b/engines/titanic/star_control/fpoint.cpp
@@ -21,8 +21,17 @@
*/
#include "titanic/star_control/fpoint.h"
+#include "common/algorithm.h"
namespace Titanic {
+void FPoint::normalize() {
+ double hyp = sqrt(_x * _x + _y * _y);
+ assert(hyp != 0.0);
+
+ double fraction = 1.0 / hyp;
+ _x *= fraction;
+ _y *= fraction;
+}
} // End of namespace Titanic
diff --git a/engines/titanic/star_control/fpoint.h b/engines/titanic/star_control/fpoint.h
index f2cef18ea5..33181d937b 100644
--- a/engines/titanic/star_control/fpoint.h
+++ b/engines/titanic/star_control/fpoint.h
@@ -34,6 +34,25 @@ public:
public:
FPoint() : _x(0), _y(0) {}
FPoint(double x, double y) : _x(x), _y(y) {}
+
+ bool operator==(const FPoint &p) const { return _x == p._x && _y == p._y; }
+ bool operator!=(const FPoint &p) const { return _x != p._x || _y != p._y; }
+
+ void operator+=(const FPoint &delta) {
+ _x += delta._x;
+ _y += delta._y;
+ }
+
+ void operator-=(const FPoint &delta) {
+ _x -= delta._x;
+ _y -= delta._y;
+ }
+
+ /**
+ * Normalises the X and Y coordinates as fractions relative to the
+ * value of the hypotenuse formed by a triangle from the origin (0,0)
+ */
+ void normalize();
};
} // End of namespace Titanic
diff --git a/engines/xeen/character.cpp b/engines/xeen/character.cpp
index f47b6e28fb..4d791b9c7b 100644
--- a/engines/xeen/character.cpp
+++ b/engines/xeen/character.cpp
@@ -46,7 +46,7 @@ void XeenItem::synchronize(Common::Serializer &s) {
ElementalCategory XeenItem::getElementalCategory() const {
int idx;
- for (idx = 0; ELEMENTAL_CATEGORIES[idx] < _material; ++idx)
+ for (idx = 0; Res.ELEMENTAL_CATEGORIES[idx] < _material; ++idx)
;
return (ElementalCategory)idx;
@@ -55,7 +55,7 @@ ElementalCategory XeenItem::getElementalCategory() const {
AttributeCategory XeenItem::getAttributeCategory() const {
int m = _material - 59;
int idx;
- for (idx = 0; ATTRIBUTE_CATEGORIES[idx] < m; ++idx)
+ for (idx = 0; Res.ATTRIBUTE_CATEGORIES[idx] < m; ++idx)
;
return (AttributeCategory)idx;
@@ -67,10 +67,7 @@ InventoryItems::InventoryItems(Character *character, ItemCategory category):
_character(character), _category(category) {
resize(INV_ITEMS_TOTAL);
- static const char *const *NAMES[4] = {
- WEAPON_NAMES, ARMOR_NAMES, ACCESSORY_NAMES, MISC_NAMES
- };
- _names = NAMES[category];
+ _names = Res.ITEM_NAMES[category];
}
void InventoryItems::clear() {
@@ -94,7 +91,7 @@ bool InventoryItems::passRestrictions(int itemId, bool showError) const {
case CLASS_BARBARIAN:
case CLASS_DRUID:
case CLASS_RANGER: {
- if (!(ITEM_RESTRICTIONS[itemId + RESTRICTION_OFFSETS[_category]] &
+ if (!(Res.ITEM_RESTRICTIONS[itemId + Res.RESTRICTION_OFFSETS[_category]] &
(1 << (charClass - CLASS_ARCHER))))
return true;
break;
@@ -106,8 +103,8 @@ bool InventoryItems::passRestrictions(int itemId, bool showError) const {
Common::String name = _names[itemId];
if (showError) {
- Common::String msg = Common::String::format(NOT_PROFICIENT,
- CLASS_NAMES[charClass], name.c_str());
+ Common::String msg = Common::String::format(Res.NOT_PROFICIENT,
+ Res.CLASS_NAMES[charClass], name.c_str());
ErrorScroll::show(Party::_vm, msg, WT_FREEZE_WAIT);
}
@@ -125,14 +122,14 @@ Common::String InventoryItems::getIdentifiedDetails(int itemIndex) {
Common::String classes;
for (int charClass = CLASS_KNIGHT; charClass <= CLASS_RANGER; ++charClass) {
if (passRestrictions(charClass, true)) {
- const char *const name = CLASS_NAMES[charClass];
+ const char *const name = Res.CLASS_NAMES[charClass];
classes += name[0];
classes += name[1];
classes += " ";
}
}
if (classes.size() == 30)
- classes = ALL;
+ classes = Res.ALL;
return getAttributes(item, classes);
}
@@ -142,10 +139,10 @@ bool InventoryItems::discardItem(int itemIndex) {
XeenEngine *vm = Party::_vm;
if (item._bonusFlags & ITEMFLAG_CURSED) {
- ErrorScroll::show(vm, CANNOT_DISCARD_CURSED_ITEM);
+ ErrorScroll::show(vm, Res.CANNOT_DISCARD_CURSED_ITEM);
} else {
Common::String itemDesc = getFullDescription(itemIndex, 4);
- Common::String msg = Common::String::format(PERMANENTLY_DISCARD, itemDesc.c_str());
+ Common::String msg = Common::String::format(Res.PERMANENTLY_DISCARD, itemDesc.c_str());
if (Confirm::show(vm, msg)) {
operator[](itemIndex).clear();
@@ -182,7 +179,7 @@ void InventoryItems::removeItem(int itemIndex) {
XeenEngine *vm = Party::_vm;
if (item._bonusFlags & ITEMFLAG_CURSED)
- ErrorScroll::show(vm, CANNOT_REMOVE_CURSED_ITEM);
+ ErrorScroll::show(vm, Res.CANNOT_REMOVE_CURSED_ITEM);
else
item._frame = 0;
}
@@ -199,18 +196,18 @@ void InventoryItems::equipError(int itemIndex1, ItemCategory category1, int item
Common::String itemName1 = _character->_items[category1].getName(itemIndex1);
Common::String itemName2 = _character->_items[category2].getName(itemIndex2);
- ErrorDialog::show(vm, Common::String::format(REMOVE_X_TO_EQUIP_Y,
+ ErrorDialog::show(vm, Common::String::format(Res.REMOVE_X_TO_EQUIP_Y,
itemName1.c_str(), itemName2.c_str()));
} else {
- ErrorDialog::show(vm, Common::String::format(EQUIPPED_ALL_YOU_CAN,
- (itemIndex1 == -1) ? RING : MEDAL));
+ ErrorDialog::show(vm, Common::String::format(Res.EQUIPPED_ALL_YOU_CAN,
+ (itemIndex1 == -1) ? Res.RING : Res.MEDAL));
}
}
void InventoryItems::enchantItem(int itemIndex, int amount) {
XeenEngine *vm = Party::_vm;
vm->_sound->playFX(21);
- ErrorScroll::show(vm, Common::String::format(NOT_ENCHANTABLE, SPELL_FAILED));
+ ErrorScroll::show(vm, Common::String::format(Res.NOT_ENCHANTABLE, Res.SPELL_FAILED));
}
bool InventoryItems::isFull() const {
@@ -275,11 +272,11 @@ Common::String WeaponItems::getFullDescription(int itemIndex, int displayNum) {
return Common::String::format("\f%02u%s%s%s\f%02u%s%s%s", displayNum,
!i._bonusFlags ? res._maeNames[i._material].c_str() : "",
- (i._bonusFlags & ITEMFLAG_BROKEN) ? ITEM_BROKEN : "",
- (i._bonusFlags & ITEMFLAG_CURSED) ? ITEM_CURSED : "",
+ (i._bonusFlags & ITEMFLAG_BROKEN) ? Res.ITEM_BROKEN : "",
+ (i._bonusFlags & ITEMFLAG_CURSED) ? Res.ITEM_CURSED : "",
displayNum,
- WEAPON_NAMES[i._id],
- !i._bonusFlags ? "" : BONUS_NAMES[i._bonusFlags & ITEMFLAG_BONUS_MASK],
+ Res.WEAPON_NAMES[i._id],
+ !i._bonusFlags ? "" : Res.BONUS_NAMES[i._bonusFlags & ITEMFLAG_BONUS_MASK],
(i._bonusFlags & (ITEMFLAG_BROKEN | ITEMFLAG_CURSED)) ||
!i._bonusFlags ? "\b " : ""
);
@@ -307,45 +304,45 @@ void WeaponItems::enchantItem(int itemIndex, int amount) {
*/
Common::String WeaponItems::getAttributes(XeenItem &item, const Common::String &classes) {
Common::String attrBonus, elemDamage, physDamage, toHit, specialPower;
- attrBonus = elemDamage = physDamage = toHit = specialPower = FIELD_NONE;
+ attrBonus = elemDamage = physDamage = toHit = specialPower = Res.FIELD_NONE;
// First calculate physical damage
- int minVal = WEAPON_DAMAGE_BASE[item._id];
- int maxVal = minVal * WEAPON_DAMAGE_MULTIPLIER[item._id];
+ int minVal = Res.WEAPON_DAMAGE_BASE[item._id];
+ int maxVal = minVal * Res.WEAPON_DAMAGE_MULTIPLIER[item._id];
if (item._material >= 37 && item._material <= 58) {
- minVal += METAL_DAMAGE[item._material - 37];
- maxVal += METAL_DAMAGE[item._material - 37];
- toHit = Common::String::format("%+d", METAL_DAMAGE_PERCENT[item._material - 37]);
+ minVal += Res.METAL_DAMAGE[item._material - 37];
+ maxVal += Res.METAL_DAMAGE[item._material - 37];
+ toHit = Common::String::format("%+d", Res.METAL_DAMAGE_PERCENT[item._material - 37]);
}
- physDamage = Common::String::format(DAMAGE_X_TO_Y, minVal, maxVal);
+ physDamage = Common::String::format(Res.DAMAGE_X_TO_Y, minVal, maxVal);
// Next handle elemental/attribute damage
if (item._material < 37) {
- int damage = ELEMENTAL_DAMAGE[item._material];
+ int damage = Res.ELEMENTAL_DAMAGE[item._material];
if (damage > 0) {
ElementalCategory elemCategory = item.getElementalCategory();
- elemDamage = Common::String::format(ELEMENTAL_XY_DAMAGE,
- damage, ELEMENTAL_NAMES[elemCategory]);
+ elemDamage = Common::String::format(Res.ELEMENTAL_XY_DAMAGE,
+ damage, Res.ELEMENTAL_NAMES[elemCategory]);
}
} else if (item._material >= 59) {
- int bonus = ATTRIBUTE_BONUSES[item._material - 59];
+ int bonus = Res.ATTRIBUTE_BONUSES[item._material - 59];
AttributeCategory attrCategory = item.getAttributeCategory();
- attrBonus = Common::String::format(ATTR_XY_BONUS, bonus,
- ATTRIBUTE_NAMES[attrCategory]);
+ attrBonus = Common::String::format(Res.ATTR_XY_BONUS, bonus,
+ Res.ATTRIBUTE_NAMES[attrCategory]);
}
// Handle weapon effective against
int effective = item._bonusFlags & ITEMFLAG_BONUS_MASK;
if (effective) {
- specialPower = Common::String::format(EFFECTIVE_AGAINST,
- EFFECTIVENESS_NAMES[effective]);
+ specialPower = Common::String::format(Res.EFFECTIVE_AGAINST,
+ Res.EFFECTIVENESS_NAMES[effective]);
}
- return Common::String::format(ITEM_DETAILS, classes.c_str(),
+ return Common::String::format(Res.ITEM_DETAILS, classes.c_str(),
toHit.c_str(), physDamage.c_str(), elemDamage.c_str(),
- FIELD_NONE, FIELD_NONE, attrBonus.c_str(), specialPower.c_str()
+ Res.FIELD_NONE, Res.FIELD_NONE, attrBonus.c_str(), specialPower.c_str()
);
}
@@ -435,10 +432,10 @@ Common::String ArmorItems::getFullDescription(int itemIndex, int displayNum) {
return Common::String::format("\f%02u%s%s%s\f%02u%s%s", displayNum,
!i._bonusFlags ? "" : res._maeNames[i._material].c_str(),
- (i._bonusFlags & ITEMFLAG_BROKEN) ? ITEM_BROKEN : "",
- (i._bonusFlags & ITEMFLAG_CURSED) ? ITEM_CURSED : "",
+ (i._bonusFlags & ITEMFLAG_BROKEN) ? Res.ITEM_BROKEN : "",
+ (i._bonusFlags & ITEMFLAG_CURSED) ? Res.ITEM_CURSED : "",
displayNum,
- ARMOR_NAMES[i._id],
+ Res.ARMOR_NAMES[i._id],
(i._bonusFlags & (ITEMFLAG_BROKEN | ITEMFLAG_CURSED)) ||
!i._bonusFlags ? "\b " : ""
);
@@ -466,34 +463,34 @@ void ArmorItems::enchantItem(int itemIndex, int amount) {
*/
Common::String ArmorItems::getAttributes(XeenItem &item, const Common::String &classes) {
Common::String elemResist, attrBonus, acBonus;
- elemResist = attrBonus = acBonus = FIELD_NONE;
+ elemResist = attrBonus = acBonus = Res.FIELD_NONE;
if (item._material < 36) {
- int resistence = ELEMENTAL_RESISTENCES[item._material];
+ int resistence = Res.ELEMENTAL_RESISTENCES[item._material];
if (resistence > 0) {
int eCategory = ELEM_FIRE;
- while (eCategory < ELEM_MAGIC && ELEMENTAL_CATEGORIES[eCategory] < item._material)
+ while (eCategory < ELEM_MAGIC && Res.ELEMENTAL_CATEGORIES[eCategory] < item._material)
++eCategory;
- elemResist = Common::String::format(ATTR_XY_BONUS, resistence,
- ELEMENTAL_NAMES[eCategory]);
+ elemResist = Common::String::format(Res.ATTR_XY_BONUS, resistence,
+ Res.ELEMENTAL_NAMES[eCategory]);
}
} else if (item._material >= 59) {
- int bonus = ATTRIBUTE_BONUSES[item._material - 59];
+ int bonus = Res.ATTRIBUTE_BONUSES[item._material - 59];
AttributeCategory aCategory = item.getAttributeCategory();
- attrBonus = Common::String::format(ATTR_XY_BONUS, bonus,
- ATTRIBUTE_NAMES[aCategory]);
+ attrBonus = Common::String::format(Res.ATTR_XY_BONUS, bonus,
+ Res.ATTRIBUTE_NAMES[aCategory]);
}
- int strength = ARMOR_STRENGTHS[item._id];
+ int strength = Res.ARMOR_STRENGTHS[item._id];
if (item._material >= 37 && item._material <= 58) {
- strength += METAL_LAC[item._material - 37];
+ strength += Res.METAL_LAC[item._material - 37];
}
acBonus = Common::String::format("%+d", strength);
- return Common::String::format(ITEM_DETAILS, classes.c_str(),
- FIELD_NONE, FIELD_NONE, FIELD_NONE,
- elemResist.c_str(), acBonus.c_str(), attrBonus.c_str(), FIELD_NONE);
+ return Common::String::format(Res.ITEM_DETAILS, classes.c_str(),
+ Res.FIELD_NONE, Res.FIELD_NONE, Res.FIELD_NONE,
+ elemResist.c_str(), acBonus.c_str(), attrBonus.c_str(), Res.FIELD_NONE);
}
/*------------------------------------------------------------------------*/
@@ -552,10 +549,10 @@ Common::String AccessoryItems::getFullDescription(int itemIndex, int displayNum)
return Common::String::format("\f%02u%s%s%s\f%02u%s%s", displayNum,
!i._bonusFlags ? "" : res._maeNames[i._material].c_str(),
- (i._bonusFlags & ITEMFLAG_BROKEN) ? ITEM_BROKEN : "",
- (i._bonusFlags & ITEMFLAG_CURSED) ? ITEM_CURSED : "",
+ (i._bonusFlags & ITEMFLAG_BROKEN) ? Res.ITEM_BROKEN : "",
+ (i._bonusFlags & ITEMFLAG_CURSED) ? Res.ITEM_CURSED : "",
displayNum,
- ARMOR_NAMES[i._id],
+ Res.ARMOR_NAMES[i._id],
(i._bonusFlags & (ITEMFLAG_BROKEN | ITEMFLAG_CURSED)) ||
!i._bonusFlags ? "\b " : ""
);
@@ -566,28 +563,28 @@ Common::String AccessoryItems::getFullDescription(int itemIndex, int displayNum)
*/
Common::String AccessoryItems::getAttributes(XeenItem &item, const Common::String &classes) {
Common::String elemResist, attrBonus;
- elemResist = attrBonus = FIELD_NONE;
+ elemResist = attrBonus = Res.FIELD_NONE;
if (item._material < 36) {
- int resistence = ELEMENTAL_RESISTENCES[item._material];
+ int resistence = Res.ELEMENTAL_RESISTENCES[item._material];
if (resistence > 0) {
int eCategory = ELEM_FIRE;
- while (eCategory < ELEM_MAGIC && ELEMENTAL_CATEGORIES[eCategory] < item._material)
+ while (eCategory < ELEM_MAGIC && Res.ELEMENTAL_CATEGORIES[eCategory] < item._material)
++eCategory;
- elemResist = Common::String::format(ATTR_XY_BONUS, resistence,
- ELEMENTAL_NAMES[eCategory]);
+ elemResist = Common::String::format(Res.ATTR_XY_BONUS, resistence,
+ Res.ELEMENTAL_NAMES[eCategory]);
}
} else if (item._material >= 59) {
- int bonus = ATTRIBUTE_BONUSES[item._material - 59];
+ int bonus = Res.ATTRIBUTE_BONUSES[item._material - 59];
AttributeCategory aCategory = item.getAttributeCategory();
- attrBonus = Common::String::format(ATTR_XY_BONUS, bonus,
- ATTRIBUTE_NAMES[aCategory]);
+ attrBonus = Common::String::format(Res.ATTR_XY_BONUS, bonus,
+ Res.ATTRIBUTE_NAMES[aCategory]);
}
- return Common::String::format(ITEM_DETAILS, classes.c_str(),
- FIELD_NONE, FIELD_NONE, FIELD_NONE,
- elemResist.c_str(), FIELD_NONE, attrBonus.c_str(), FIELD_NONE);
+ return Common::String::format(Res.ITEM_DETAILS, classes.c_str(),
+ Res.FIELD_NONE, Res.FIELD_NONE, Res.FIELD_NONE,
+ elemResist.c_str(), Res.FIELD_NONE, attrBonus.c_str(), Res.FIELD_NONE);
}
/*------------------------------------------------------------------------*/
@@ -598,10 +595,10 @@ Common::String MiscItems::getFullDescription(int itemIndex, int displayNum) {
return Common::String::format("\f%02u%s%s%s\f%02u%s%s", displayNum,
!i._bonusFlags ? "" : res._maeNames[i._material].c_str(),
- (i._bonusFlags & ITEMFLAG_BROKEN) ? ITEM_BROKEN : "",
- (i._bonusFlags & ITEMFLAG_CURSED) ? ITEM_CURSED : "",
+ (i._bonusFlags & ITEMFLAG_BROKEN) ? Res.ITEM_BROKEN : "",
+ (i._bonusFlags & ITEMFLAG_CURSED) ? Res.ITEM_CURSED : "",
displayNum,
- ARMOR_NAMES[i._id],
+ Res.ARMOR_NAMES[i._id],
(i._bonusFlags & (ITEMFLAG_BROKEN | ITEMFLAG_CURSED)) ||
!i._id ? "\b " : ""
);
@@ -612,16 +609,16 @@ Common::String MiscItems::getFullDescription(int itemIndex, int displayNum) {
* Returns a text string listing all the stats/attributes of a given item
*/
Common::String MiscItems::getAttributes(XeenItem &item, const Common::String &classes) {
- Common::String specialPower = FIELD_NONE;
+ Common::String specialPower = Res.FIELD_NONE;
Spells &spells = *getVm()->_spells;
if (item._id) {
- specialPower = spells._spellNames[MISC_SPELL_INDEX[item._id]];
+ specialPower = spells._spellNames[Res.MISC_SPELL_INDEX[item._id]];
}
- return Common::String::format(ITEM_DETAILS, classes.c_str(),
- FIELD_NONE, FIELD_NONE, FIELD_NONE, FIELD_NONE, FIELD_NONE,
- FIELD_NONE, specialPower.c_str());
+ return Common::String::format(Res.ITEM_DETAILS, classes.c_str(),
+ Res.FIELD_NONE, Res.FIELD_NONE, Res.FIELD_NONE, Res.FIELD_NONE, Res.FIELD_NONE,
+ Res.FIELD_NONE, specialPower.c_str());
}
/*------------------------------------------------------------------------*/
@@ -836,9 +833,9 @@ int Character::getAge(bool ignoreTemp) const {
}
int Character::getMaxHP() const {
- int hp = BASE_HP_BY_CLASS[_class];
+ int hp = Res.BASE_HP_BY_CLASS[_class];
hp += statBonus(getStat(ENDURANCE));
- hp += RACE_HP_BONUSES[_race];
+ hp += Res.RACE_HP_BONUSES[_race];
if (_skills[BODYBUILDER])
++hp;
if (hp < 1)
@@ -873,7 +870,7 @@ int Character::getMaxSP() const {
for (;;) {
// Get the base number of spell points
result = statBonus(getStat(attrib)) + 3;
- result += RACE_SP_BONUSES[_race][attrib - 1];
+ result += Res.RACE_SP_BONUSES[_race][attrib - 1];
if (_skills[skill])
result += 2;
@@ -942,10 +939,10 @@ uint Character::getStat(Attribute attrib, bool baseOnly) const {
if (mode < 2) {
int age = getAge(false);
int ageIndex = 0;
- while (AGE_RANGES[ageIndex] <= age)
+ while (Res.AGE_RANGES[ageIndex] <= age)
++ageIndex;
- attr._permanent += AGE_RANGES_ADJUST[mode][ageIndex];
+ attr._permanent += Res.AGE_RANGES_ADJUST[mode][ageIndex];
}
@@ -974,10 +971,10 @@ int Character::statColor(int amount, int threshold) {
int Character::statBonus(uint statValue) const {
int idx;
- for (idx = 0; STAT_VALUES[idx] <= statValue; ++idx)
+ for (idx = 0; Res.STAT_VALUES[idx] <= statValue; ++idx)
;
- return STAT_BONUSES[idx];
+ return Res.STAT_BONUSES[idx];
}
bool Character::charSavingThrow(DamageType attackType) const {
@@ -1027,7 +1024,7 @@ bool Character::noActions() {
case INSANE:
case IN_LOVE:
case DRUNK: {
- Common::String msg = Common::String::format(IN_NO_CONDITION, _name.c_str());
+ Common::String msg = Common::String::format(Res.IN_NO_CONDITION, _name.c_str());
ErrorScroll::show(Party::_vm, msg,
Party::_vm->_mode == 17 ? WT_2 : WT_NONFREEZED_WAIT);
return true;
@@ -1119,7 +1116,7 @@ int Character::itemScan(int itemId) const {
++mIndex;
if (mIndex == itemId)
- result += ATTRIBUTE_BONUSES[item._material - 59];
+ result += Res.ATTRIBUTE_BONUSES[item._material - 59];
}
}
break;
@@ -1135,22 +1132,22 @@ int Character::itemScan(int itemId) const {
++mIndex;
if (mIndex == itemId)
- result += ATTRIBUTE_BONUSES[item._material - 59];
+ result += Res.ATTRIBUTE_BONUSES[item._material - 59];
}
if (itemId > 10 && item._material < 37) {
int mIndex = item.getElementalCategory() + 11;
if (mIndex == itemId) {
- result += ELEMENTAL_RESISTENCES[item._material];
+ result += Res.ELEMENTAL_RESISTENCES[item._material];
}
}
if (itemId == 9) {
- result += ARMOR_STRENGTHS[item._id];
+ result += Res.ARMOR_STRENGTHS[item._id];
if (item._material >= 37 && item._material <= 58)
- result += METAL_LAC[item._material - 37];
+ result += Res.METAL_LAC[item._material - 37];
}
}
}
@@ -1167,7 +1164,7 @@ int Character::itemScan(int itemId) const {
++mIndex;
if (mIndex == itemId) {
- result += ATTRIBUTE_BONUSES[item._material - 59];
+ result += Res.ATTRIBUTE_BONUSES[item._material - 59];
}
}
@@ -1175,7 +1172,7 @@ int Character::itemScan(int itemId) const {
int mIndex = item.getElementalCategory() + 11;
if (mIndex == itemId)
- result += ELEMENTAL_RESISTENCES[item._material];
+ result += Res.ELEMENTAL_RESISTENCES[item._material];
}
}
}
@@ -1469,7 +1466,7 @@ uint Character::nextExperienceLevel() const {
shift = _level._permanent - 1;
}
- return (base * 1024000) + (CLASS_EXP_LEVELS[_class] << shift);
+ return (base * 1024000) + (Res.CLASS_EXP_LEVELS[_class] << shift);
}
uint Character::getCurrentExperience() const {
@@ -1487,7 +1484,7 @@ uint Character::getCurrentExperience() const {
shift = lev - 1;
}
- return (base * 1024000) + (CLASS_EXP_LEVELS[_class] << shift) +
+ return (base * 1024000) + (Res.CLASS_EXP_LEVELS[_class] << shift) +
_experience;
}
@@ -1679,8 +1676,8 @@ int Character::makeItem(int p1, int itemIndex, int p3) {
mult = 5;
}
- v12 = MAKE_ITEM_ARR1[vm->getRandomNumber(MAKE_ITEM_ARR2[mult][p1][0],
- MAKE_ITEM_ARR2[mult][p1][1])];
+ v12 = Res.MAKE_ITEM_ARR1[vm->getRandomNumber(Res.MAKE_ITEM_ARR2[mult][p1][0],
+ Res.MAKE_ITEM_ARR2[mult][p1][1])];
break;
case 2:
@@ -1707,18 +1704,18 @@ int Character::makeItem(int p1, int itemIndex, int p3) {
mult = 9;
}
- v12 = MAKE_ITEM_ARR1[vm->getRandomNumber(MAKE_ITEM_ARR3[mult][p1][0],
- MAKE_ITEM_ARR3[mult][p1][1])];
+ v12 = Res.MAKE_ITEM_ARR1[vm->getRandomNumber(Res.MAKE_ITEM_ARR3[mult][p1][0],
+ Res.MAKE_ITEM_ARR3[mult][p1][1])];
break;
case 3:
mult = p1 == 7 || vm->getRandomNumber(1, 100) > 70 ? 1 : 0;
- v16 = vm->getRandomNumber(MAKE_ITEM_ARR4[mult][p1][0],
- MAKE_ITEM_ARR4[mult][p1][1]);
+ v16 = vm->getRandomNumber(Res.MAKE_ITEM_ARR4[mult][p1][0],
+ Res.MAKE_ITEM_ARR4[mult][p1][1]);
break;
case 4:
- miscBonus = vm->getRandomNumber(MAKE_ITEM_ARR5[p1][0], MAKE_ITEM_ARR5[p1][1]);
+ miscBonus = vm->getRandomNumber(Res.MAKE_ITEM_ARR5[p1][0], Res.MAKE_ITEM_ARR5[p1][1]);
break;
default:
diff --git a/engines/xeen/combat.cpp b/engines/xeen/combat.cpp
index be7ade8877..9282b4e75b 100644
--- a/engines/xeen/combat.cpp
+++ b/engines/xeen/combat.cpp
@@ -218,7 +218,7 @@ void Combat::giveCharDamage(int damage, DamageType attackType, int charIndex) {
// Draw the attack effect on the character sprite
sound.playFX(fx);
_powSprites.draw(screen, frame,
- Common::Point(CHAR_FACES_X[selectedIndex1], 150));
+ Common::Point(Res.CHAR_FACES_X[selectedIndex1], 150));
screen._windows[33].update();
// Reduce damage if power shield active, and set it zero
@@ -317,7 +317,7 @@ void Combat::doCharDamage(Character &c, int charNum, int monsterDataIndex) {
}
sound.playFX(fx);
- intf._charPowSprites.draw(screen, frame, Common::Point(CHAR_FACES_X[charNum], 150));
+ intf._charPowSprites.draw(screen, frame, Common::Point(Res.CHAR_FACES_X[charNum], 150));
screen._windows[33].update();
damage -= party._powerShield;
@@ -485,12 +485,12 @@ void Combat::moveMonsters() {
switch (party._mazeDirection) {
case DIR_NORTH:
case DIR_SOUTH:
- if (monsterCanMove(pt, MONSTER_GRID_BITMASK[MONSTER_GRID_BITINDEX1[arrIndex]],
+ if (monsterCanMove(pt, Res.MONSTER_GRID_BITMASK[MONSTER_GRID_BITINDEX1[arrIndex]],
MONSTER_GRID_X[arrIndex], MONSTER_GRID_Y[arrIndex], idx)) {
// Move the monster
moveMonster(idx, Common::Point(MONSTER_GRID_X[arrIndex], MONSTER_GRID_Y[arrIndex]));
} else {
- if (monsterCanMove(pt, MONSTER_GRID_BITMASK[MONSTER_GRID_BITINDEX2[arrIndex]],
+ if (monsterCanMove(pt, Res.MONSTER_GRID_BITMASK[MONSTER_GRID_BITINDEX2[arrIndex]],
arrIndex >= 21 && arrIndex <= 27 ? MONSTER_GRID3[arrIndex] : 0,
arrIndex >= 21 && arrIndex <= 27 ? 0 : MONSTER_GRID3[arrIndex],
idx)) {
@@ -505,7 +505,7 @@ void Combat::moveMonsters() {
case DIR_EAST:
case DIR_WEST:
- if (monsterCanMove(pt, MONSTER_GRID_BITMASK[MONSTER_GRID_BITINDEX2[arrIndex]],
+ if (monsterCanMove(pt, Res.MONSTER_GRID_BITMASK[MONSTER_GRID_BITINDEX2[arrIndex]],
arrIndex >= 21 && arrIndex <= 27 ? MONSTER_GRID3[arrIndex] : 0,
arrIndex >= 21 && arrIndex <= 27 ? 0 : MONSTER_GRID3[arrIndex],
idx)) {
@@ -514,7 +514,7 @@ void Combat::moveMonsters() {
} else {
moveMonster(idx, Common::Point(0, MONSTER_GRID3[arrIndex]));
}
- } else if (monsterCanMove(pt, MONSTER_GRID_BITMASK[MONSTER_GRID_BITINDEX1[arrIndex]],
+ } else if (monsterCanMove(pt, Res.MONSTER_GRID_BITMASK[MONSTER_GRID_BITINDEX1[arrIndex]],
MONSTER_GRID_X[arrIndex], MONSTER_GRID_Y[arrIndex], idx)) {
moveMonster(idx, Common::Point(MONSTER_GRID_X[arrIndex], MONSTER_GRID_Y[arrIndex]));
}
@@ -799,8 +799,7 @@ void Combat::doMonsterTurn(int monsterId) {
intf.draw3d(true);
intf.draw3d(true);
- File f(Common::String::format("%s.voc", monsterData._attackVoc.c_str()));
- sound.playSample(&f, 0);
+ sound.playSound(Common::String::format("%s.voc", monsterData._attackVoc.c_str()));
monsterId = monster._spriteId;
}
@@ -1163,7 +1162,7 @@ Common::String Combat::getMonsterDescriptions() {
_monsterIndex = 0;
}
- return Common::String::format(COMBAT_DETAILS, lines[0].c_str(),
+ return Common::String::format(Res.COMBAT_DETAILS, lines[0].c_str(),
lines[1].c_str(), lines[2].c_str());
}
@@ -1386,7 +1385,7 @@ void Combat::attack2(int damage, RangeType rangeType) {
damage = 0;
if (!damage) {
- sound.playSample(&_missVoc, 1);
+ sound.playSound(_missVoc, 1);
sound.playFX(6);
} else {
if (!isDarkCc && monster._spriteId == 89)
@@ -1449,17 +1448,17 @@ void Combat::attack2(int damage, RangeType rangeType) {
}
if (damage < 1) {
- sound.playSample(&_missVoc, 1);
+ sound.playSound(_missVoc, 1);
sound.playFX(6);
} else {
_monsterScale[_monsterIndex] = getDamageScale(damage);
intf.draw3d(true);
- sound.playSample(nullptr, 0);
+ sound.stopSound();
File powVoc(Common::String::format("pow%d.voc",
POW_WEAPON_VOCS[_attackWeaponId]));
sound.playFX(60 + POW_WEAPON_VOCS[_attackWeaponId]);
- sound.playSample(&powVoc, 1);
+ sound.playSound(powVoc, 1);
if (monster._hp > damage) {
monster._hp -= damage;
@@ -1576,7 +1575,7 @@ void Combat::quickFight() {
break;
case QUICK_SPELL:
if (c->_currentSpell != -1) {
- spells.castSpell(c, (MagicSpell)SPELLS_ALLOWED[c->getClassCategory()][c->_currentSpell]);
+ spells.castSpell(c, (MagicSpell)Res.SPELLS_ALLOWED[c->getClassCategory()][c->_currentSpell]);
}
break;
case QUICK_BLOCK:
@@ -1674,15 +1673,15 @@ void Combat::getWeaponDamage(Character &c, RangeType rangeType) {
_attackWeapon = &c._weapons[idx];
if (c._weapons[idx]._material >= 37 && c._weapons[idx]._material < 59) {
- _hitChanceBonus = METAL_DAMAGE_PERCENT[c._weapons[idx]._material - 37];
- _weaponDamage = METAL_DAMAGE[c._weapons[idx]._material - 37];
+ _hitChanceBonus = Res.METAL_DAMAGE_PERCENT[c._weapons[idx]._material - 37];
+ _weaponDamage = Res.METAL_DAMAGE[c._weapons[idx]._material - 37];
}
}
_hitChanceBonus += party._heroism;
_attackWeaponId = c._weapons[idx]._id;
- _weaponDice = WEAPON_DAMAGE_BASE[_attackWeaponId];
- _weaponDie = WEAPON_DAMAGE_MULTIPLIER[_attackWeaponId];
+ _weaponDice = Res.WEAPON_DAMAGE_BASE[_attackWeaponId];
+ _weaponDie = Res.WEAPON_DAMAGE_MULTIPLIER[_attackWeaponId];
for (int diceIdx = 0; diceIdx < _weaponDice; ++diceIdx)
_weaponDamage += _vm->getRandomNumber(1, _weaponDie);
@@ -1745,7 +1744,7 @@ int Combat::getMonsterResistence(RangeType rangeType) {
}
} else {
int material = !_attackWeapon ? 0 : _attackWeapon->_material;
- damage = ELEMENTAL_DAMAGE[material];
+ damage = Res.ELEMENTAL_DAMAGE[material];
if (material != 0) {
if (material < 9)
diff --git a/engines/xeen/cutscenes.cpp b/engines/xeen/cutscenes.cpp
new file mode 100644
index 0000000000..3c49d12816
--- /dev/null
+++ b/engines/xeen/cutscenes.cpp
@@ -0,0 +1,213 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "xeen/cutscenes.h"
+#include "xeen/xeen.h"
+
+namespace Xeen {
+
+static const char *SUBTITLE_LINE = "\xC" "35\x3" "c\xB" "190\x9" "000%s";
+
+void Cutscenes::resetSubtitles(uint lineNum, uint defaultSize) {
+ _subtitleLineNum = lineNum;
+ _subtitleSize = defaultSize;
+ recordTime();
+}
+
+void Cutscenes::showSubtitles(uint windowIndex) {
+ Screen &screen = *_vm->_screen;
+ Sound &sound = *_vm->_sound;
+
+ if (sound._soundOn || _vm->shouldQuit()) {
+ // Sound is on, so subtitles aren't needed
+ resetSubtitles(0, 0);
+ } else {
+ if (timeElapsed() > 1) {
+ ++_subtitleSize;
+ const Common::String &line = _subtitles[_subtitleLineNum];
+ Common::String lineStr(line.c_str(), line.c_str() + _subtitleSize);
+ _subtitleLine = Common::String::format(SUBTITLE_LINE, lineStr.c_str());
+
+ // If displayed a full line, then move to the next line
+ if (_subtitleSize == line.size()) {
+ _subtitleSize = 0;
+ if (++_subtitleLineNum == _subtitles.size())
+ _subtitleLineNum = 0;
+ }
+ }
+
+ // Draw the box sprite
+ if (!_boxSprites)
+ // Not already loaded, so load it
+ _boxSprites = new SpriteResource("box.vga");
+ _boxSprites->draw(screen, 0, Common::Point(36, 189));
+
+ // Write the subtitle line
+ screen._windows[windowIndex].writeString(_subtitleLine);
+ }
+
+ screen.update();
+}
+
+void Cutscenes::freeSubtitles() {
+ delete _boxSprites;
+ _boxSprites = nullptr;
+ _subtitles.clear();
+}
+
+bool Cutscenes::subtitlesWait(uint minTime) {
+ EventsManager &events = *_vm->_events;
+
+ events.updateGameCounter();
+ recordTime();
+ while (events.timeElapsed() < minTime || _subtitleSize != 0) {
+ events.pollEventsAndWait();
+ if (events.isKeyMousePressed())
+ return false;
+
+ showSubtitles();
+ }
+
+ return true;
+}
+
+bool Cutscenes::waitForLineOrSound() {
+ while (_vm->_sound->isPlaying() || _subtitleSize) {
+ showSubtitles();
+ _vm->_events->pollEventsAndWait();
+ if (_vm->_events->isKeyMousePressed())
+ return false;
+ }
+
+ return true;
+}
+
+void Cutscenes::recordTime() {
+ _vm->_events->timeMark1();
+}
+
+uint Cutscenes::timeElapsed() {
+ return _vm->_events->timeElapsed1();
+}
+
+uint Cutscenes::getSpeakingFrame(uint minFrame, uint maxFrame) {
+ uint interval = g_system->getMillis() / 100;
+ return minFrame + interval % (maxFrame + 1 - minFrame);
+}
+
+bool Cutscenes::doScroll(bool rollUp, bool fadeIn) {
+ Screen &screen = *_vm->_screen;
+ EventsManager &events = *_vm->_events;
+ const int SCROLL_L[8] = { 29, 23, 15, -5, -11, -23, -49, -71 };
+ const int SCROLL_R[8] = { 165, 171, 198, 218, 228, 245, 264, 281 };
+
+ if (_vm->_files->_isDarkCc) {
+ if (fadeIn)
+ screen.fadeIn(2);
+ return _vm->shouldQuit();
+ }
+
+ screen.saveBackground();
+
+ // Load hand sprites
+ SpriteResource *hand[16];
+ for (int i = 0; i < 16; ++i) {
+ Common::String name = Common::String::format("hand%02d.vga", i);
+ hand[i] = new SpriteResource(name);
+ }
+
+ // Load marb sprites
+ SpriteResource *marb[5];
+ for (int i = 0; i < 4; ++i) {
+ Common::String name = Common::String::format("marb%02d.vga", i + 1);
+ marb[i] = new SpriteResource(name);
+ }
+
+ if (rollUp) {
+ for (int i = 22, ctr = 7; i > 0 && !events.isKeyMousePressed()
+ && !_vm->shouldQuit(); --i) {
+ events.updateGameCounter();
+ screen.restoreBackground();
+
+ if (i > 14) {
+ hand[14]->draw(screen, 0, Common::Point(SCROLL_L[ctr], 0), SPRFLAG_800);
+ hand[15]->draw(screen, 0, Common::Point(SCROLL_R[ctr], 0), SPRFLAG_800);
+ --ctr;
+ } else if (i != 0) {
+ hand[i - 1]->draw(screen, 0);
+ }
+
+ if (i <= 20)
+ marb[(i - 1) / 5]->draw(screen, (i - 1) % 5);
+ screen.update();
+
+ while (!_vm->shouldQuit() && events.timeElapsed() == 0)
+ events.pollEventsAndWait();
+
+ if (i == 0 && fadeIn)
+ screen.fadeIn(2);
+ }
+ } else {
+ for (int i = 0, ctr = 0; i < 22 && !events.isKeyMousePressed()
+ && !_vm->shouldQuit(); ++i) {
+ events.updateGameCounter();
+ screen.restoreBackground();
+
+ if (i < 14) {
+ hand[i]->draw(screen, 0);
+ } else {
+ hand[14]->draw(screen, 0, Common::Point(SCROLL_L[ctr], 0), SPRFLAG_800);
+ hand[15]->draw(screen, 0, Common::Point(SCROLL_R[ctr], 0), SPRFLAG_800);
+ ++ctr;
+ }
+
+ if (i < 20) {
+ marb[i / 5]->draw(screen, i % 5);
+ }
+ screen.update();
+
+ while (!_vm->shouldQuit() && events.timeElapsed() == 0)
+ events.pollEventsAndWait();
+
+ if (i == 0 && fadeIn)
+ screen.fadeIn(2);
+ }
+ }
+
+ if (rollUp) {
+ hand[0]->draw(screen, 0);
+ marb[0]->draw(screen, 0);
+ } else {
+ screen.restoreBackground();
+ }
+ screen.update();
+
+ // Free resources
+ for (int i = 0; i < 4; ++i)
+ delete marb[i];
+ for (int i = 0; i < 16; ++i)
+ delete hand[i];
+
+ return _vm->shouldQuit() || events.isKeyMousePressed();
+}
+
+} // End of namespace Xeen
diff --git a/engines/xeen/cutscenes.h b/engines/xeen/cutscenes.h
new file mode 100644
index 0000000000..aa5501442d
--- /dev/null
+++ b/engines/xeen/cutscenes.h
@@ -0,0 +1,102 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef XEEN_CUTSCENES_H
+#define XEEN_CUTSCENES_H
+
+#include "xeen/files.h"
+#include "xeen/sprites.h"
+
+namespace Xeen {
+
+#define WAIT(time) events.updateGameCounter(); \
+ if (events.wait(time)) \
+ return false
+
+class XeenEngine;
+
+class Cutscenes {
+protected:
+ XeenEngine *_vm;
+ StringArray _subtitles;
+ SpriteResource *_boxSprites;
+ uint _timeElapsed;
+ Common::String _subtitleLine;
+ uint _subtitleLineNum, _subtitleSize;
+protected:
+ Cutscenes(XeenEngine *vm) : _vm(vm), _timeElapsed(0), _boxSprites(nullptr),
+ _subtitleLineNum(0), _subtitleSize(0) {}
+ virtual ~Cutscenes() {}
+
+ /**
+ * Resets the subtitles position
+ */
+ void resetSubtitles(uint lineNum, uint defaultSize = 1);
+
+ /**
+ * Free subtitles
+ */
+ void freeSubtitles();
+
+ /**
+ * Shows subtitles
+ */
+ void showSubtitles(uint windowIndex = 0);
+
+ /**
+ * Delays either the specified number of frames, or until
+ * an entire subtitle line is shown if subtitles are on
+ */
+ bool subtitlesWait(uint minTime = 0);
+
+ /**
+ * Wait for the end of currently playing sound or subtitles line
+ */
+ bool waitForLineOrSound();
+
+ /**
+ * Records the current execution time
+ */
+ void recordTime();
+
+ /**
+ * Returns the number of ticks since the last recordTime
+ */
+ uint timeElapsed();
+
+ /**
+ * Get a speaking frame from a range
+ */
+ uint getSpeakingFrame(uint minFrame, uint maxFrame);
+
+ /**
+ * Draws the scroll in the background
+ * @param rollUp If true, rolls up the scroll. If false, unrolls.
+ * @param fadeIn If true, does an initial fade in
+ * @returns True if key or mouse pressed
+ */
+ virtual bool doScroll(bool rollUp, bool fadeIn);
+};
+
+} // End of namespace Xeen
+
+#endif /* XEEN_CUTSCENES_H */
diff --git a/engines/xeen/debugger.cpp b/engines/xeen/debugger.cpp
index d9b4990e97..34bc0a3d49 100644
--- a/engines/xeen/debugger.cpp
+++ b/engines/xeen/debugger.cpp
@@ -47,6 +47,7 @@ static int strToInt(const char *s) {
Debugger::Debugger(XeenEngine *vm) : GUI::Debugger(), _vm(vm) {
registerCmd("continue", WRAP_METHOD(Debugger, cmdExit));
registerCmd("spell", WRAP_METHOD(Debugger, cmdSpell));
+ registerCmd("dump", WRAP_METHOD(Debugger, cmdDump));
_spellId = -1;
}
@@ -82,4 +83,34 @@ bool Debugger::cmdSpell(int argc, const char **argv) {
return true;
}
+bool Debugger::cmdDump(int argc, const char **argv) {
+ File f;
+
+ if (argc < 2) {
+ debugPrintf("Format: dump <resource name>\n");
+ } else {
+ if (argc == 2)
+ f.open(argv[1]);
+ else
+ f.open(argv[1], (ArchiveType)strToInt(argv[2]));
+
+ if (f.isOpen()) {
+ Common::DumpFile df;
+ df.open(argv[1]);
+ byte *data = new byte[f.size()];
+ f.read(data, f.size());
+ df.write(data, f.size());
+
+ f.close();
+ df.close();
+ delete[] data;
+ debugPrintf("Saved\n");
+ } else {
+ debugPrintf("Could not find resource with that name\n");
+ }
+ }
+
+ return true;
+}
+
} // End of namespace Xeen
diff --git a/engines/xeen/debugger.h b/engines/xeen/debugger.h
index e7f8ef6b7d..8599835866 100644
--- a/engines/xeen/debugger.h
+++ b/engines/xeen/debugger.h
@@ -36,6 +36,7 @@ private:
int _spellId;
bool cmdSpell(int argc, const char **argv);
+ bool cmdDump(int argc, const char **argv);
public:
Debugger(XeenEngine *vm);
diff --git a/engines/xeen/detection.cpp b/engines/xeen/detection.cpp
index e5b137c394..3c619e9877 100644
--- a/engines/xeen/detection.cpp
+++ b/engines/xeen/detection.cpp
@@ -116,7 +116,7 @@ bool XeenMetaEngine::createInstance(OSystem *syst, Engine **engine, const ADGame
case Xeen::GType_Clouds:
case Xeen::GType_DarkSide:
case Xeen::GType_WorldOfXeen:
- *engine = new Xeen::WorldOfXeenEngine(syst, gd);
+ *engine = new Xeen::WorldOfXeen::WorldOfXeenEngine(syst, gd);
break;
default:
break;
diff --git a/engines/xeen/dialogs.cpp b/engines/xeen/dialogs.cpp
index 4ecd1c775c..1924c69cf4 100644
--- a/engines/xeen/dialogs.cpp
+++ b/engines/xeen/dialogs.cpp
@@ -56,7 +56,7 @@ void ButtonContainer::addButton(const Common::Rect &bounds, int val) {
void ButtonContainer::addPartyButtons(XeenEngine *vm) {
for (uint idx = 0; idx < MAX_ACTIVE_PARTY; ++idx) {
- addButton(Common::Rect(CHAR_FACES_X[idx], 150, CHAR_FACES_X[idx] + 32, 182),
+ addButton(Common::Rect(Res.CHAR_FACES_X[idx], 150, Res.CHAR_FACES_X[idx] + 32, 182),
Common::KEYCODE_F1 + idx);
}
}
@@ -97,107 +97,6 @@ bool ButtonContainer::checkEvents(XeenEngine *vm) {
return false;
}
-void ButtonContainer::doScroll(XeenEngine *vm, bool drawFlag, bool doFade) {
- Screen &screen = *vm->_screen;
- EventsManager &events = *vm->_events;
-
- if (vm->getGameID() != GType_Clouds) {
- if (doFade) {
- screen.fadeIn(2);
- }
- return;
- }
-
- const int SCROLL_L[8] = { 29, 23, 15, 251, 245, 233, 207, 185 };
- const int SCROLL_R[8] = { 165, 171, 198, 218, 228, 245, 264, 281 };
-
- saveButtons();
- clearButtons();
- screen.saveBackground();
-
- // Load hand vga files
- SpriteResource *hand[16];
- for (int i = 0; i < 16; ++i) {
- Common::String name = Common::String::format("hand%02d.vga", i);
- hand[i] = new SpriteResource(name);
- }
-
- // Load marb vga files
- SpriteResource *marb[5];
- for (int i = 1; i < 5; ++i) {
- Common::String name = Common::String::format("marb%02d.vga", i);
- marb[i] = new SpriteResource(name);
- }
-
- if (drawFlag) {
- for (int i = 22; i > 0; --i) {
- events.updateGameCounter();
- screen.restoreBackground();
-
- if (i > 0 && i <= 14) {
- hand[i - 1]->draw(screen, 0);
- }
- else {
- // TODO: Check '800h'.. horizontal reverse maybe?
- hand[14]->draw(screen, 0, Common::Point(SCROLL_L[i - 14], 0));
- marb[15]->draw(screen, 0, Common::Point(SCROLL_R[i - 14], 0));
- }
-
- if (i <= 20) {
- marb[i / 5]->draw(screen, i % 5);
- }
-
- while (!vm->shouldQuit() && events.timeElapsed() == 0)
- events.pollEventsAndWait();
-
- screen._windows[0].update();
- if (i == 0 && doFade)
- screen.fadeIn(2);
- }
- } else {
- for (int i = 0; i < 22 && !events.isKeyMousePressed(); ++i) {
- events.updateGameCounter();
- screen.restoreBackground();
-
- if (i < 14) {
- hand[i]->draw(screen, 0);
- } else {
- // TODO: Check '800h'.. horizontal reverse maybe?
- hand[14]->draw(screen, 0, Common::Point(SCROLL_L[i - 7], 0));
- marb[15]->draw(screen, 0, Common::Point(SCROLL_R[i - 7], 0));
- }
-
- if (i < 20) {
- marb[i / 5]->draw(screen, i % 5);
- }
-
- while (!vm->shouldQuit() && events.timeElapsed() == 0)
- events.pollEventsAndWait();
-
- screen._windows[0].update();
- if (i == 0 && doFade)
- screen.fadeIn(2);
- }
- }
-
- if (drawFlag) {
- hand[0]->draw(screen, 0);
- marb[0]->draw(screen, 0);
- }
- else {
- screen.restoreBackground();
- }
-
- screen._windows[0].update();
- restoreButtons();
-
- // Free resources
- for (int i = 1; i < 5; ++i)
- delete marb[i];
- for (int i = 0; i < 16; ++i)
- delete hand[i];
-}
-
void ButtonContainer::drawButtons(XSurface *surface) {
for (uint btnIndex = 0; btnIndex < _buttons.size(); ++btnIndex) {
UIButton &btn = _buttons[btnIndex];
@@ -208,6 +107,18 @@ void ButtonContainer::drawButtons(XSurface *surface) {
}
}
+bool ButtonContainer::doScroll(bool rollUp, bool fadeIn) {
+ if (_vm->_files->_isDarkCc) {
+ return Cutscenes::doScroll(rollUp, fadeIn);
+ } else {
+ saveButtons();
+ clearButtons();
+ bool result = Cutscenes::doScroll(rollUp, fadeIn);
+ restoreButtons();
+ return result;
+ }
+}
+
/*------------------------------------------------------------------------*/
void SettingsBaseDialog::showContents(SpriteResource &title1, bool waitFlag) {
@@ -228,12 +139,12 @@ void CreditsScreen::execute() {
EventsManager &events = *_vm->_events;
// Handle drawing the credits screen
- doScroll(_vm, true, false);
+ doScroll(true, false);
screen._windows[GAME_WINDOW].close();
screen.loadBackground("marb.raw");
- screen._windows[0].writeString(CREDITS);
- doScroll(_vm, false, false);
+ screen._windows[0].writeString(Res.CREDITS);
+ doScroll(false, false);
events.setCursor(0);
screen._windows[0].update();
@@ -243,7 +154,7 @@ void CreditsScreen::execute() {
while (!events.isKeyMousePressed())
events.pollEventsAndWait();
- doScroll(_vm, true, false);
+ doScroll(true, false);
}
/*------------------------------------------------------------------------*/
@@ -252,7 +163,7 @@ void PleaseWait::show(XeenEngine *vm) {
if (vm->_mode != MODE_0) {
Window &w = vm->_screen->_windows[9];
w.open();
- w.writeString(PLEASE_WAIT);
+ w.writeString(Res.PLEASE_WAIT);
w.update();
}
}
diff --git a/engines/xeen/dialogs.h b/engines/xeen/dialogs.h
index 51eafa5f54..921c72a33f 100644
--- a/engines/xeen/dialogs.h
+++ b/engines/xeen/dialogs.h
@@ -26,6 +26,7 @@
#include "common/array.h"
#include "common/stack.h"
#include "common/rect.h"
+#include "xeen/cutscenes.h"
#include "xeen/sprites.h"
#include "xeen/xsurface.h"
@@ -46,21 +47,24 @@ public:
UIButton() : _value(0), _sprites(nullptr), _draw(false) {}
};
-class ButtonContainer {
+class ButtonContainer : public Cutscenes {
private:
Common::Stack< Common::Array<UIButton> > _savedButtons;
protected:
Common::Array<UIButton> _buttons;
int _buttonValue;
+ bool checkEvents(XeenEngine *vm);
+
/**
* Draws the scroll in the background
+ * @param rollUp If true, rolls up the scroll. If false, unrolls.
+ * @param fadeIn If true, does an initial fade in
+ * @returns True if key or mouse pressed
*/
- void doScroll(XeenEngine *vm, bool drawFlag, bool doFade);
-
- bool checkEvents(XeenEngine *vm);
+ virtual bool doScroll(bool rollUp, bool fadeIn);
public:
- ButtonContainer() : _buttonValue(0) {}
+ ButtonContainer(XeenEngine *vm) : Cutscenes(vm), _buttonValue(0) {}
/**
* Saves the current list of buttons
@@ -85,20 +89,16 @@ public:
class SettingsBaseDialog : public ButtonContainer {
protected:
- XeenEngine *_vm;
-
virtual void showContents(SpriteResource &title1, bool mode);
public:
- SettingsBaseDialog(XeenEngine *vm) : ButtonContainer(), _vm(vm) {}
+ SettingsBaseDialog(XeenEngine *vm) : ButtonContainer(vm) {}
virtual ~SettingsBaseDialog() {}
};
class CreditsScreen: public ButtonContainer {
private:
- XeenEngine *_vm;
-
- CreditsScreen(XeenEngine *vm) : ButtonContainer(), _vm(vm) {}
+ CreditsScreen(XeenEngine *vm) : ButtonContainer(vm) {}
void execute();
public:
diff --git a/engines/xeen/dialogs_automap.cpp b/engines/xeen/dialogs_automap.cpp
index d9b7e8d6c7..652494742a 100644
--- a/engines/xeen/dialogs_automap.cpp
+++ b/engines/xeen/dialogs_automap.cpp
@@ -411,9 +411,9 @@ void AutoMapDialog::execute() {
events.updateGameCounter();
}
- screen._windows[5].writeString(Common::String::format(MAP_TEXT,
+ screen._windows[5].writeString(Common::String::format(Res.MAP_TEXT,
map._mazeName.c_str(), party._mazePosition.x,
- party._mazePosition.y, DIRECTION_TEXT[party._mazeDirection]));
+ party._mazePosition.y, Res.DIRECTION_TEXT[party._mazeDirection]));
screen._windows[5].update();
screen._windows[3].update();
diff --git a/engines/xeen/dialogs_automap.h b/engines/xeen/dialogs_automap.h
index f20f9b0104..239a73a932 100644
--- a/engines/xeen/dialogs_automap.h
+++ b/engines/xeen/dialogs_automap.h
@@ -31,9 +31,7 @@ class XeenEngine;
class AutoMapDialog: public ButtonContainer {
private:
- XeenEngine *_vm;
-
- AutoMapDialog(XeenEngine *vm) : ButtonContainer(), _vm(vm) {}
+ AutoMapDialog(XeenEngine *vm) : ButtonContainer(vm) {}
void execute();
public:
diff --git a/engines/xeen/dialogs_char_info.cpp b/engines/xeen/dialogs_char_info.cpp
index 0494c22b9c..6dd79618ed 100644
--- a/engines/xeen/dialogs_char_info.cpp
+++ b/engines/xeen/dialogs_char_info.cpp
@@ -56,7 +56,7 @@ void CharacterInfo::execute(int charIndex) {
do {
if (redrawFlag) {
Common::String charDetails = loadCharacterDetails(*c);
- w.writeString(Common::String::format(CHARACTER_TEMPLATE, charDetails.c_str()));
+ w.writeString(Common::String::format(Res.CHARACTER_TEMPLATE, charDetails.c_str()));
w.drawList(_drawList, 24);
w.update();
redrawFlag = false;
@@ -175,7 +175,7 @@ void CharacterInfo::execute(int charIndex) {
case Common::KEYCODE_e:
if (oldMode == MODE_COMBAT) {
- ErrorScroll::show(_vm, EXCHANGING_IN_COMBAT, WT_FREEZE_WAIT);
+ ErrorScroll::show(_vm, Res.EXCHANGING_IN_COMBAT, WT_FREEZE_WAIT);
} else {
_vm->_mode = oldMode;
ExchangeDialog::show(_vm, c, charIndex);
@@ -285,9 +285,9 @@ Common::String CharacterInfo::loadCharacterDetails(const Character &c) {
c._energyResistence._permanent + c.itemScan(15) + c._energyResistence._temporary +
c._magicResistence._permanent + c.itemScan(16) + c._magicResistence._temporary;
- return Common::String::format(CHARACTER_DETAILS,
- PARTY_GOLD, c._name.c_str(), SEX_NAMES[c._sex],
- RACE_NAMES[c._race], CLASS_NAMES[c._class],
+ return Common::String::format(Res.CHARACTER_DETAILS,
+ Res.PARTY_GOLD, c._name.c_str(), Res.SEX_NAMES[c._sex],
+ Res.RACE_NAMES[c._race], Res.CLASS_NAMES[c._class],
c.statColor(c.getStat(MIGHT), c.getStat(MIGHT, true)), c.getStat(MIGHT),
c.statColor(c.getStat(ACCURACY), c.getStat(ACCURACY, true)), c.getStat(ACCURACY),
c.statColor(c._currentHp, c.getMaxHP()), c._currentHp,
@@ -307,11 +307,11 @@ Common::String CharacterInfo::loadCharacterDetails(const Character &c) {
c.statColor(c.getStat(SPEED), c.getStat(SPEED, true)), c.getStat(SPEED),
c.statColor(c.getArmorClass(), c.getArmorClass(true)), c.getArmorClass(),
c.getNumAwards(),
- CONDITION_COLORS[condition], CONDITION_NAMES[condition],
- condition == NO_CONDITION && party._blessed ? PLUS_14 : "",
- condition == NO_CONDITION && party._powerShield ? PLUS_14 : "",
- condition == NO_CONDITION && party._holyBonus ? PLUS_14 : "",
- condition == NO_CONDITION && party._heroism ? PLUS_14 : ""
+ Res.CONDITION_COLORS[condition], Res.CONDITION_NAMES[condition],
+ condition == NO_CONDITION && party._blessed ? Res.PLUS_14 : "",
+ condition == NO_CONDITION && party._powerShield ? Res.PLUS_14 : "",
+ condition == NO_CONDITION && party._holyBonus ? Res.PLUS_14 : "",
+ condition == NO_CONDITION && party._heroism ? Res.PLUS_14 : ""
);
}
@@ -356,18 +356,18 @@ bool CharacterInfo::expandStat(int attrib, const Character &c) {
stat1 = c.getStat((Attribute)attrib, false);
stat2 = c.getStat((Attribute)attrib, true);
idx = 0;
- while (STAT_VALUES[idx] <= stat1)
+ while (Res.STAT_VALUES[idx] <= stat1)
++idx;
- msg = Common::String::format(CURRENT_MAXIMUM_RATING_TEXT, STAT_NAMES[attrib],
- stat1, stat2, RATING_TEXT[idx]);
+ msg = Common::String::format(Res.CURRENT_MAXIMUM_RATING_TEXT, Res.STAT_NAMES[attrib],
+ stat1, stat2, Res.RATING_TEXT[idx]);
break;
case 7:
// Age
stat1 = c.getAge(false);
stat2 = c.getAge(true);
- msg = Common::String::format(AGE_TEXT, STAT_NAMES[attrib],
+ msg = Common::String::format(Res.AGE_TEXT, Res.STAT_NAMES[attrib],
stat1, stat2, c._birthDay, c._birthYear);
break;
@@ -376,7 +376,7 @@ bool CharacterInfo::expandStat(int attrib, const Character &c) {
const int CLASS_ATTACK_GAINS[10] = { 5, 6, 6, 7, 8, 6, 5, 4, 7, 6 };
idx = c.getCurrentLevel() / CLASS_ATTACK_GAINS[c._class] + 1;
- msg = Common::String::format(LEVEL_TEXT, STAT_NAMES[attrib],
+ msg = Common::String::format(Res.LEVEL_TEXT, Res.STAT_NAMES[attrib],
c.getCurrentLevel(), c._level._permanent,
idx, idx > 1 ? "s" : "",
c._level._permanent);
@@ -387,7 +387,7 @@ bool CharacterInfo::expandStat(int attrib, const Character &c) {
// Armor Class
stat1 = c.getArmorClass(false);
stat2 = c.getArmorClass(true);
- msg = Common::String::format(CURRENT_MAXIMUM_TEXT, STAT_NAMES[attrib],
+ msg = Common::String::format(Res.CURRENT_MAXIMUM_TEXT, Res.STAT_NAMES[attrib],
stat1, stat2);
bounds.setHeight(42);
break;
@@ -396,7 +396,7 @@ bool CharacterInfo::expandStat(int attrib, const Character &c) {
// Hit Points
stat1 = c._currentHp;
stat2 = c.getMaxHP();
- msg = Common::String::format(CURRENT_MAXIMUM_TEXT, STAT_NAMES[attrib],
+ msg = Common::String::format(Res.CURRENT_MAXIMUM_TEXT, Res.STAT_NAMES[attrib],
stat1, stat2);
bounds.setHeight(42);
break;
@@ -405,14 +405,14 @@ bool CharacterInfo::expandStat(int attrib, const Character &c) {
// Spell Points
stat1 = c._currentSp;
stat2 = c.getMaxSP();
- msg = Common::String::format(CURRENT_MAXIMUM_TEXT, STAT_NAMES[attrib],
+ msg = Common::String::format(Res.CURRENT_MAXIMUM_TEXT, Res.STAT_NAMES[attrib],
stat1, stat2);
bounds.setHeight(42);
break;
case 12:
// Resistences
- msg = Common::String::format(RESISTENCES_TEXT, STAT_NAMES[attrib],
+ msg = Common::String::format(Res.RESISTENCES_TEXT, Res.STAT_NAMES[attrib],
c._fireResistence._permanent + c.itemScan(11) + c._fireResistence._temporary,
c._coldResistence._permanent + c.itemScan(13) + c._coldResistence._temporary,
c._electricityResistence._permanent + c.itemScan(12) + c._electricityResistence._temporary,
@@ -431,19 +431,19 @@ bool CharacterInfo::expandStat(int attrib, const Character &c) {
if (c._skills[skill]) {
if (skill == THIEVERY) {
lines[0] = Common::String::format("\n\t020%s%u",
- SKILL_NAMES[THIEVERY], c.getThievery());
+ Res.SKILL_NAMES[THIEVERY], c.getThievery());
} else {
- lines[skill] = Common::String::format("\n\t020%s", SKILL_NAMES[skill]);
+ lines[skill] = Common::String::format("\n\t020%s", Res.SKILL_NAMES[skill]);
}
}
}
} else {
- lines[0] = NONE;
+ lines[0] = Res.NONE;
numLines = 1;
}
msg = Common::String::format("\x2\x3""c%s\x3l%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s",
- STAT_NAMES[attrib], lines[0].c_str(), lines[1].c_str(),
+ Res.STAT_NAMES[attrib], lines[0].c_str(), lines[1].c_str(),
lines[2].c_str(), lines[3].c_str(), lines[4].c_str(), lines[5].c_str(),
lines[17].c_str(), lines[6].c_str(), lines[7].c_str(), lines[8].c_str(),
lines[9].c_str(), lines[10].c_str(), lines[11].c_str(), lines[12].c_str(),
@@ -465,23 +465,23 @@ bool CharacterInfo::expandStat(int attrib, const Character &c) {
// Experience
stat1 = c.getCurrentExperience();
stat2 = c.experienceToNextLevel();
- msg = Common::String::format(EXPERIENCE_TEXT,
- STAT_NAMES[attrib], stat1,
- stat2 == 0 ? ELIGIBLE : Common::String::format("%d", stat2).c_str()
+ msg = Common::String::format(Res.EXPERIENCE_TEXT,
+ Res.STAT_NAMES[attrib], stat1,
+ stat2 == 0 ? Res.ELIGIBLE : Common::String::format("%d", stat2).c_str()
);
bounds.setHeight(43);
break;
case 16:
// Gold
- msg = Common::String::format(IN_PARTY_IN_BANK, STAT_NAMES[attrib],
+ msg = Common::String::format(Res.IN_PARTY_IN_BANK, Res.CONSUMABLE_NAMES[0],
party._gold, party._bankGold);
bounds.setHeight(43);
break;
case 17:
// Gems
- msg = Common::String::format(IN_PARTY_IN_BANK, STAT_NAMES[attrib],
+ msg = Common::String::format(Res.IN_PARTY_IN_BANK, Res.CONSUMABLE_NAMES[1],
party._gems, party._bankGems);
bounds.setHeight(43);
break;
@@ -489,7 +489,7 @@ bool CharacterInfo::expandStat(int attrib, const Character &c) {
case 18: {
// Food
int food = (party._food / party._activeParty.size()) / 3;
- msg = Common::String::format(FOOD_TEXT, STAT_NAMES[attrib],
+ msg = Common::String::format(Res.FOOD_TEXT, Res.CONSUMABLE_NAMES[2],
party._food, food, food != 1 ? "s" : "");
break;
}
@@ -502,10 +502,10 @@ bool CharacterInfo::expandStat(int attrib, const Character &c) {
if (c._conditions[condition]) {
if (condition >= UNCONSCIOUS) {
lines[condition] = Common::String::format("\n\t020%s",
- CONDITION_NAMES[condition]);
+ Res.CONDITION_NAMES[condition]);
} else {
lines[condition] = Common::String::format("\n\t020%s\t095-%d",
- CONDITION_NAMES[condition], c._conditions[condition]);
+ Res.CONDITION_NAMES[condition], c._conditions[condition]);
}
++total;
@@ -514,21 +514,21 @@ bool CharacterInfo::expandStat(int attrib, const Character &c) {
Condition condition = c.worstCondition();
if (condition == NO_CONDITION) {
- lines[0] = Common::String::format("\n\t020%s", GOOD);
+ lines[0] = Common::String::format("\n\t020%s", Res.GOOD);
++total;
}
if (party._blessed)
- lines[16] = Common::String::format(BLESSED, party._blessed);
+ lines[16] = Common::String::format(Res.BLESSED, party._blessed);
if (party._powerShield)
- lines[17] = Common::String::format(POWER_SHIELD, party._powerShield);
+ lines[17] = Common::String::format(Res.POWER_SHIELD, party._powerShield);
if (party._holyBonus)
- lines[18] = Common::String::format(HOLY_BONUS, party._holyBonus);
+ lines[18] = Common::String::format(Res.HOLY_BONUS, party._holyBonus);
if (party._heroism)
- lines[19] = Common::String::format(HEROISM, party._heroism);
+ lines[19] = Common::String::format(Res.HEROISM, party._heroism);
msg = Common::String::format("\x2\x3""c%s\x3l%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\x1",
- STAT_NAMES[attrib], lines[0].c_str(), lines[1].c_str(),
+ Res.CONSUMABLE_NAMES[3], lines[0].c_str(), lines[1].c_str(),
lines[2].c_str(), lines[3].c_str(), lines[4].c_str(),
lines[5].c_str(), lines[6].c_str(), lines[7].c_str(),
lines[8].c_str(), lines[9].c_str(), lines[10].c_str(),
diff --git a/engines/xeen/dialogs_char_info.h b/engines/xeen/dialogs_char_info.h
index 90b35a9f6b..cddd4ec89c 100644
--- a/engines/xeen/dialogs_char_info.h
+++ b/engines/xeen/dialogs_char_info.h
@@ -31,12 +31,11 @@ namespace Xeen {
class CharacterInfo : public ButtonContainer {
private:
- XeenEngine *_vm;
SpriteResource _iconSprites;
DrawStruct _drawList[24];
int _cursorCell;
- CharacterInfo(XeenEngine *vm) : ButtonContainer(), _vm(vm), _cursorCell(0) {}
+ CharacterInfo(XeenEngine *vm) : ButtonContainer(vm), _cursorCell(0) {}
void execute(int charIndex);
diff --git a/engines/xeen/dialogs_control_panel.h b/engines/xeen/dialogs_control_panel.h
index 16c3781789..ef86acf245 100644
--- a/engines/xeen/dialogs_control_panel.h
+++ b/engines/xeen/dialogs_control_panel.h
@@ -29,9 +29,7 @@ namespace Xeen {
class ControlPanel : public ButtonContainer {
private:
- XeenEngine *_vm;
-
- ControlPanel(XeenEngine *vm) : ButtonContainer(), _vm(vm) {}
+ ControlPanel(XeenEngine *vm) : ButtonContainer(vm) {}
int execute();
public:
diff --git a/engines/xeen/dialogs_dismiss.cpp b/engines/xeen/dialogs_dismiss.cpp
index 9323b46429..58936bdc39 100644
--- a/engines/xeen/dialogs_dismiss.cpp
+++ b/engines/xeen/dialogs_dismiss.cpp
@@ -68,7 +68,7 @@ void Dismiss::execute() {
if (_buttonValue < (int)party._activeParty.size()) {
if (party._activeParty.size() == 1) {
w.close();
- ErrorScroll::show(_vm, CANT_DISMISS_LAST_CHAR, WT_NONFREEZED_WAIT);
+ ErrorScroll::show(_vm, Res.CANT_DISMISS_LAST_CHAR, WT_NONFREEZED_WAIT);
w.open();
} else {
// Remove the character from the party
diff --git a/engines/xeen/dialogs_dismiss.h b/engines/xeen/dialogs_dismiss.h
index ec40e87f7c..7b73fc6f03 100644
--- a/engines/xeen/dialogs_dismiss.h
+++ b/engines/xeen/dialogs_dismiss.h
@@ -30,10 +30,9 @@ namespace Xeen {
class Dismiss : public ButtonContainer {
private:
- XeenEngine *_vm;
SpriteResource _iconSprites;
- Dismiss(XeenEngine *vm) : ButtonContainer(), _vm(vm) {}
+ Dismiss(XeenEngine *vm) : ButtonContainer(vm) {}
void execute();
diff --git a/engines/xeen/dialogs_error.cpp b/engines/xeen/dialogs_error.cpp
index 0a8f5923f2..f9269f59d4 100644
--- a/engines/xeen/dialogs_error.cpp
+++ b/engines/xeen/dialogs_error.cpp
@@ -60,7 +60,7 @@ void ErrorDialog::execute(const Common::String &msg, ErrorWaitType waitType) {
events.updateGameCounter();
_vm->_interface->draw3d(true);
- events.wait(1, true);
+ events.wait(1);
if (checkEvents(_vm))
break;
} while (!_vm->shouldQuit() && !_buttonValue);
@@ -100,8 +100,8 @@ void CantCast::execute(int spellId, int componentNum) {
sound.playFX(21);
w.open();
- w.writeString(Common::String::format(NOT_ENOUGH_TO_CAST,
- SPELL_CAST_COMPONENTS[componentNum - 1],
+ w.writeString(Common::String::format(Res.NOT_ENOUGH_TO_CAST,
+ Res.SPELL_CAST_COMPONENTS[componentNum - 1],
spells._spellNames[spellId].c_str()
));
w.update();
diff --git a/engines/xeen/dialogs_error.h b/engines/xeen/dialogs_error.h
index 46efdb1683..56e30bc9de 100644
--- a/engines/xeen/dialogs_error.h
+++ b/engines/xeen/dialogs_error.h
@@ -33,9 +33,7 @@ enum ErrorWaitType { WT_FREEZE_WAIT = 0, WT_NONFREEZED_WAIT = 1,
class ErrorDialog : public ButtonContainer {
private:
- XeenEngine *_vm;
-
- ErrorDialog(XeenEngine *vm) : ButtonContainer(), _vm(vm) {}
+ ErrorDialog(XeenEngine *vm) : ButtonContainer(vm) {}
void execute(const Common::String &msg, ErrorWaitType waitType);
public:
@@ -51,9 +49,7 @@ public:
class CantCast: public ButtonContainer {
private:
- XeenEngine *_vm;
-
- CantCast(XeenEngine *vm) : ButtonContainer(), _vm(vm) {}
+ CantCast(XeenEngine *vm) : ButtonContainer(vm) {}
void execute(int spellId, int componentNum);
public:
diff --git a/engines/xeen/dialogs_exchange.cpp b/engines/xeen/dialogs_exchange.cpp
index 37da4e0963..03195523e4 100644
--- a/engines/xeen/dialogs_exchange.cpp
+++ b/engines/xeen/dialogs_exchange.cpp
@@ -41,7 +41,7 @@ void ExchangeDialog::execute(Character *&c, int &charIndex) {
Window &w = screen._windows[31];
w.open();
- w.writeString(EXCHANGE_WITH_WHOM);
+ w.writeString(Res.EXCHANGE_WITH_WHOM);
_iconSprites.draw(w, 0, Common::Point(225, 120));
w.update();
diff --git a/engines/xeen/dialogs_exchange.h b/engines/xeen/dialogs_exchange.h
index e8c4a2dfb1..e67c315133 100644
--- a/engines/xeen/dialogs_exchange.h
+++ b/engines/xeen/dialogs_exchange.h
@@ -30,10 +30,9 @@ namespace Xeen {
class ExchangeDialog : public ButtonContainer {
private:
- XeenEngine *_vm;
SpriteResource _iconSprites;
- ExchangeDialog(XeenEngine *vm) : ButtonContainer(), _vm(vm) {}
+ ExchangeDialog(XeenEngine *vm) : ButtonContainer(vm) {}
void execute(Character *&c, int &charIndex);
diff --git a/engines/xeen/dialogs_fight_options.h b/engines/xeen/dialogs_fight_options.h
index 7b058bc6e9..823a716790 100644
--- a/engines/xeen/dialogs_fight_options.h
+++ b/engines/xeen/dialogs_fight_options.h
@@ -29,9 +29,7 @@ namespace Xeen {
class FightOptions : public ButtonContainer {
private:
- XeenEngine *_vm;
-
- FightOptions(XeenEngine *vm) : ButtonContainer(), _vm(vm) {}
+ FightOptions(XeenEngine *vm) : ButtonContainer(vm) {}
void execute();
public:
diff --git a/engines/xeen/dialogs_info.cpp b/engines/xeen/dialogs_info.cpp
index 56755630da..945567c9b2 100644
--- a/engines/xeen/dialogs_info.cpp
+++ b/engines/xeen/dialogs_info.cpp
@@ -45,18 +45,18 @@ void InfoDialog::execute() {
Common::String gameName;
if (_vm->getGameID() == GType_Swords)
- gameName = SWORDS_GAME_TEXT;
+ gameName = Res.SWORDS_GAME_TEXT;
else if (_vm->getGameID() == GType_Clouds)
- gameName = CLOUDS_GAME_TEXT;
+ gameName = Res.CLOUDS_GAME_TEXT;
else if (_vm->getGameID() == GType_DarkSide)
- gameName = DARKSIDE_GAME_TEXT;
+ gameName = Res.DARKSIDE_GAME_TEXT;
else
- gameName = WORLD_GAME_TEXT;
+ gameName = Res.WORLD_GAME_TEXT;
// Form the display message
int hour = party._minutes / 60;
- Common::String details = Common::String::format(GAME_INFORMATION,
- gameName.c_str(), WEEK_DAY_STRINGS[party._day % 10],
+ Common::String details = Common::String::format(Res.GAME_INFORMATION,
+ gameName.c_str(), Res.WEEK_DAY_STRINGS[party._day % 10],
(hour > 12) ? hour - 12 : (!hour ? 12 : hour),
party._minutes % 60, (hour > 11) ? 'p' : 'a',
party._day, party._year, statusText.c_str());
@@ -72,7 +72,7 @@ void InfoDialog::execute() {
w.writeString(details);
w.update();
- events.wait(1, true);
+ events.wait(1);
} while (!_vm->shouldQuit() && !events.isKeyMousePressed());
events.clearEvents();
@@ -86,41 +86,41 @@ void InfoDialog::protectionText() {
const char *const AA_R124 = "\x3r\x9""124";
if (party._lightCount) {
- _lines.push_back(Common::String::format(LIGHT_COUNT_TEXT, party._lightCount));
+ _lines.push_back(Common::String::format(Res.LIGHT_COUNT_TEXT, party._lightCount));
}
if (party._fireResistence) {
- _lines.push_back(Common::String::format(FIRE_RESISTENCE_TEXT,
+ _lines.push_back(Common::String::format(Res.FIRE_RESISTENCE_TEXT,
_lines.size() == 0 ? 10 : 1, AA_L024, AA_R124, party._fireResistence));
}
if (party._electricityResistence) {
- _lines.push_back(Common::String::format(ELECRICITY_RESISTENCE_TEXT,
+ _lines.push_back(Common::String::format(Res.ELECRICITY_RESISTENCE_TEXT,
_lines.size() == 0 ? 10 : 1, AA_L024, AA_R124, party._electricityResistence));
}
if (party._coldResistence) {
- _lines.push_back(Common::String::format(COLD_RESISTENCE_TEXT,
+ _lines.push_back(Common::String::format(Res.COLD_RESISTENCE_TEXT,
_lines.size() == 0 ? 10 : 1, AA_L024, AA_R124, party._coldResistence));
}
if (party._poisonResistence) {
- _lines.push_back(Common::String::format(POISON_RESISTENCE_TEXT,
+ _lines.push_back(Common::String::format(Res.POISON_RESISTENCE_TEXT,
_lines.size() == 0 ? 10 : 1, AA_L024, AA_R124, party._poisonResistence));
}
if (party._clairvoyanceActive) {
- _lines.push_back(Common::String::format(CLAIRVOYANCE_TEXT,
+ _lines.push_back(Common::String::format(Res.CLAIRVOYANCE_TEXT,
_lines.size() == 0 ? 10 : 1, AA_L024, AA_R124));
}
if (party._levitateActive) {
- _lines.push_back(Common::String::format(LEVITATE_TEXT,
+ _lines.push_back(Common::String::format(Res.LEVITATE_TEXT,
_lines.size() == 0 ? 10 : 1, AA_L024, AA_R124));
}
if (party._walkOnWaterActive) {
- _lines.push_back(Common::String::format(WALK_ON_WATER_TEXT,
+ _lines.push_back(Common::String::format(Res.WALK_ON_WATER_TEXT,
_lines.size() == 0 ? 10 : 1, AA_L024, AA_R124));
}
}
diff --git a/engines/xeen/dialogs_info.h b/engines/xeen/dialogs_info.h
index 66b915788b..68c8403545 100644
--- a/engines/xeen/dialogs_info.h
+++ b/engines/xeen/dialogs_info.h
@@ -30,10 +30,9 @@ namespace Xeen {
class InfoDialog : public ButtonContainer {
private:
- XeenEngine *_vm;
Common::StringArray _lines;
- InfoDialog(XeenEngine *vm) : ButtonContainer(), _vm(vm) {}
+ InfoDialog(XeenEngine *vm) : ButtonContainer(vm) {}
void execute();
diff --git a/engines/xeen/dialogs_input.cpp b/engines/xeen/dialogs_input.cpp
index 50d6ed2eca..943b038d09 100644
--- a/engines/xeen/dialogs_input.cpp
+++ b/engines/xeen/dialogs_input.cpp
@@ -97,7 +97,7 @@ Common::KeyCode Input::doCursor(const Common::String &msg) {
if (flag)
screen._windows[3].update();
- events.wait(1, true);
+ events.wait(1);
if (events.isKeyPending()) {
Common::KeyState keyState;
events.getKey(keyState);
@@ -233,7 +233,7 @@ int Choose123::execute(int numOptions) {
delay = 1;
}
- events.wait(delay, true);
+ events.wait(delay);
if (_vm->shouldQuit())
return 0;
} while (!_buttonValue);
diff --git a/engines/xeen/dialogs_input.h b/engines/xeen/dialogs_input.h
index e824d17f57..ce159c77a3 100644
--- a/engines/xeen/dialogs_input.h
+++ b/engines/xeen/dialogs_input.h
@@ -36,7 +36,6 @@ private:
*/
Common::KeyCode doCursor(const Common::String &msg);
protected:
- XeenEngine *_vm;
Window *_window;
/**
@@ -44,7 +43,7 @@ protected:
*/
int getString(Common::String &line, uint maxLen, int maxWidth, bool isNumeric);
- Input(XeenEngine *vm, Window *window) : _vm(vm), _window(window) {}
+ Input(XeenEngine *vm, Window *window) : ButtonContainer(vm), _window(window) {}
public:
static int show(XeenEngine *vm, Window *window, Common::String &line,
uint maxLen, int maxWidth, bool isNumeric = false);
@@ -72,10 +71,9 @@ public:
class Choose123 : public ButtonContainer {
private:
- XeenEngine *_vm;
SpriteResource _iconSprites;
- Choose123(XeenEngine *vm) : ButtonContainer(), _vm(vm) {}
+ Choose123(XeenEngine *vm) : ButtonContainer(vm) {}
int execute(int numOptions);
diff --git a/engines/xeen/dialogs_items.cpp b/engines/xeen/dialogs_items.cpp
index 59bf35dfb8..56de6a5b17 100644
--- a/engines/xeen/dialogs_items.cpp
+++ b/engines/xeen/dialogs_items.cpp
@@ -84,18 +84,18 @@ Character *ItemsDialog::execute(Character *c, ItemsMode mode) {
Common::String msg;
if (mode != ITEMMODE_CHAR_INFO && mode != ITEMMODE_8 && mode != ITEMMODE_ENCHANT
&& mode != ITEMMODE_RECHARGE && mode != ITEMMODE_TO_GOLD) {
- msg = Common::String::format(ITEMS_DIALOG_TEXT1,
- BTN_SELL, BTN_IDENTIFY, BTN_FIX);
+ msg = Common::String::format(Res.ITEMS_DIALOG_TEXT1,
+ Res.BTN_SELL, Res.BTN_IDENTIFY, Res.BTN_FIX);
} else if (mode != ITEMMODE_ENCHANT && mode != ITEMMODE_RECHARGE && mode != ITEMMODE_TO_GOLD) {
- msg = Common::String::format(ITEMS_DIALOG_TEXT1,
- category == 3 ? BTN_USE : BTN_EQUIP,
- BTN_REMOVE, BTN_DISCARD, BTN_QUEST);
+ msg = Common::String::format(Res.ITEMS_DIALOG_TEXT1,
+ category == 3 ? Res.BTN_USE : Res.BTN_EQUIP,
+ Res.BTN_REMOVE, Res.BTN_DISCARD, Res.BTN_QUEST);
} else if (mode == ITEMMODE_ENCHANT) {
- msg = Common::String::format(ITEMS_DIALOG_TEXT2, BTN_ENCHANT);
+ msg = Common::String::format(Res.ITEMS_DIALOG_TEXT2, Res.BTN_ENCHANT);
} else if (mode == ITEMMODE_RECHARGE) {
- msg = Common::String::format(ITEMS_DIALOG_TEXT2, BTN_RECHARGE);
+ msg = Common::String::format(Res.ITEMS_DIALOG_TEXT2, Res.BTN_RECHARGE);
} else {
- msg = Common::String::format(ITEMS_DIALOG_TEXT2, BTN_GOLD);
+ msg = Common::String::format(Res.ITEMS_DIALOG_TEXT2, Res.BTN_GOLD);
}
screen._windows[29].writeString(msg);
@@ -147,11 +147,11 @@ Character *ItemsDialog::execute(Character *c, ItemsMode mode) {
if (i._id) {
if (mode == ITEMMODE_CHAR_INFO || mode == ITEMMODE_8
|| mode == ITEMMODE_ENCHANT || mode == ITEMMODE_RECHARGE) {
- lines.push_back(Common::String::format(ITEMS_DIALOG_LINE1,
+ lines.push_back(Common::String::format(Res.ITEMS_DIALOG_LINE1,
arr[idx], idx + 1,
c->_items[category].getFullDescription(idx, arr[idx]).c_str()));
} else {
- lines.push_back(Common::String::format(ITEMS_DIALOG_LINE2,
+ lines.push_back(Common::String::format(Res.ITEMS_DIALOG_LINE2,
arr[idx], idx + 1,
c->_items[category].getFullDescription(idx, arr[idx]).c_str(),
calcItemCost(c, idx, mode,
@@ -167,7 +167,7 @@ Character *ItemsDialog::execute(Character *c, ItemsMode mode) {
else
ds._frame = 14;
} else if (_itemsDrawList[idx]._sprites == nullptr) {
- lines.push_back(NO_ITEMS_AVAILABLE);
+ lines.push_back(Res.NO_ITEMS_AVAILABLE);
}
break;
}
@@ -179,7 +179,7 @@ Character *ItemsDialog::execute(Character *c, ItemsMode mode) {
if (i._material == 0) {
// No item
if (idx == 0) {
- lines.push_back(NO_ITEMS_AVAILABLE);
+ lines.push_back(Res.NO_ITEMS_AVAILABLE);
}
} else {
ItemsMode tempMode = mode;
@@ -192,7 +192,7 @@ Character *ItemsDialog::execute(Character *c, ItemsMode mode) {
skill = 1;
}
- lines.push_back(Common::String::format(ITEMS_DIALOG_LINE2,
+ lines.push_back(Common::String::format(Res.ITEMS_DIALOG_LINE2,
arr[idx], idx + 1,
c->_items[category].getFullDescription(idx, arr[idx]).c_str(),
calcItemCost(c, idx, tempMode, skill, category)
@@ -212,10 +212,10 @@ Character *ItemsDialog::execute(Character *c, ItemsMode mode) {
switch (mode) {
case ITEMMODE_CHAR_INFO:
case ITEMMODE_8:
- screen._windows[30].writeString(Common::String::format(X_FOR_THE_Y,
+ screen._windows[30].writeString(Common::String::format(Res.X_FOR_THE_Y,
category == CATEGORY_MISC ? "\x3l" : "\x3c",
- CATEGORY_NAMES[category], c->_name.c_str(), CLASS_NAMES[c->_class],
- category == CATEGORY_MISC ? FMT_CHARGES : " ",
+ Res.CATEGORY_NAMES[category], c->_name.c_str(), Res.CLASS_NAMES[c->_class],
+ category == CATEGORY_MISC ? Res.FMT_CHARGES : " ",
lines[0].c_str(), lines[1].c_str(), lines[2].c_str(), lines[3].c_str(),
lines[4].c_str(), lines[5].c_str(), lines[6].c_str(), lines[7].c_str(),
lines[8].c_str()
@@ -224,8 +224,8 @@ Character *ItemsDialog::execute(Character *c, ItemsMode mode) {
case ITEMMODE_BLACKSMITH: {
// Original uses var in this block that's never set?!
const int v1 = 0;
- screen._windows[30].writeString(Common::String::format(AVAILABLE_GOLD_COST,
- CATEGORY_NAMES[category],
+ screen._windows[30].writeString(Common::String::format(Res.AVAILABLE_GOLD_COST,
+ Res.CATEGORY_NAMES[category],
v1 ? "" : "s", party._gold,
lines[0].c_str(), lines[1].c_str(), lines[2].c_str(), lines[3].c_str(),
lines[4].c_str(), lines[5].c_str(), lines[6].c_str(), lines[7].c_str(),
@@ -240,9 +240,9 @@ Character *ItemsDialog::execute(Character *c, ItemsMode mode) {
case ITEMMODE_REPAIR:
case ITEMMODE_IDENTIFY:
case ITEMMODE_TO_GOLD:
- screen._windows[30].writeString(Common::String::format(X_FOR_Y,
- CATEGORY_NAMES[category], startingChar->_name.c_str(),
- (mode == ITEMMODE_RECHARGE || mode == ITEMMODE_ENCHANT) ? CHARGES : COST,
+ screen._windows[30].writeString(Common::String::format(Res.X_FOR_Y,
+ Res.CATEGORY_NAMES[category], startingChar->_name.c_str(),
+ (mode == ITEMMODE_RECHARGE || mode == ITEMMODE_ENCHANT) ? Res.CHARGES : Res.COST,
lines[0].c_str(), lines[1].c_str(), lines[2].c_str(), lines[3].c_str(),
lines[4].c_str(), lines[5].c_str(), lines[6].c_str(), lines[7].c_str(),
lines[8].c_str()
@@ -251,8 +251,8 @@ Character *ItemsDialog::execute(Character *c, ItemsMode mode) {
case ITEMMODE_3:
case ITEMMODE_5:
- screen._windows[30].writeString(Common::String::format(X_FOR_Y_GOLD,
- CATEGORY_NAMES[category], c->_name.c_str(), party._gold, CHARGES,
+ screen._windows[30].writeString(Common::String::format(Res.X_FOR_Y_GOLD,
+ Res.CATEGORY_NAMES[category], c->_name.c_str(), party._gold, Res.CHARGES,
lines[0].c_str(), lines[1].c_str(), lines[2].c_str(), lines[3].c_str(),
lines[4].c_str(), lines[5].c_str(), lines[6].c_str(), lines[7].c_str(),
lines[8].c_str()
@@ -356,10 +356,10 @@ Character *ItemsDialog::execute(Character *c, ItemsMode mode) {
XeenItem &srcItem = srcItems[itemIndex];
if (srcItem._bonusFlags & ITEMFLAG_CURSED)
- ErrorScroll::show(_vm, CANNOT_REMOVE_CURSED_ITEM);
+ ErrorScroll::show(_vm, Res.CANNOT_REMOVE_CURSED_ITEM);
else if (destItems[INV_ITEMS_TOTAL - 1]._id)
ErrorScroll::show(_vm, Common::String::format(
- CATEGORY_BACKPACK_IS_FULL[category], c->_name.c_str()));
+ Res.CATEGORY_BACKPACK_IS_FULL[category], c->_name.c_str()));
else {
destItem = srcItem;
srcItem.clear();
@@ -581,7 +581,7 @@ void ItemsDialog::blackData2CharData() {
Party &party = *_vm->_party;
bool isDarkCc = _vm->_files->_isDarkCc;
int slotIndex = 0;
- while (party._mazeId != (int)BLACKSMITH_MAP_IDS[isDarkCc][slotIndex] && slotIndex < 4)
+ while (slotIndex < 4 && party._mazeId != (int)Res.BLACKSMITH_MAP_IDS[isDarkCc][slotIndex])
++slotIndex;
if (slotIndex == 4)
slotIndex = 0;
@@ -598,7 +598,7 @@ void ItemsDialog::charData2BlackData() {
Party &party = *_vm->_party;
bool isDarkCc = _vm->_files->_isDarkCc;
int slotIndex = 0;
- while (party._mazeId != (int)BLACKSMITH_MAP_IDS[isDarkCc][slotIndex] && slotIndex < 4)
+ while (slotIndex < 4 && party._mazeId != (int)Res.BLACKSMITH_MAP_IDS[isDarkCc][slotIndex])
++slotIndex;
if (slotIndex == 4)
slotIndex = 0;
@@ -692,8 +692,8 @@ int ItemsDialog::calcItemCost(Character *c, int itemIndex, ItemsMode mode,
// 0=Weapons, 1=Armor, 2=Accessories
XeenItem &i = (mode == 0) ? c->_weapons[itemIndex] :
(mode == 1 ? c->_armor[itemIndex] : c->_accessories[itemIndex]);
- amount1 = (mode == 0) ? WEAPON_BASE_COSTS[i._id] :
- (mode == 1 ? ARMOR_BASE_COSTS[i._id] : ACCESSORY_BASE_COSTS[i._id]);
+ amount1 = (mode == 0) ? Res.WEAPON_BASE_COSTS[i._id] :
+ (mode == 1 ? Res.ARMOR_BASE_COSTS[i._id] : Res.ACCESSORY_BASE_COSTS[i._id]);
if (i._material > 36 && i._material < 59) {
switch (i._material) {
@@ -710,15 +710,15 @@ int ItemsDialog::calcItemCost(Character *c, int itemIndex, ItemsMode mode,
amount1 /= 4;
break;
default:
- amount1 *= METAL_BASE_MULTIPLIERS[i._material - 37];
+ amount1 *= Res.METAL_BASE_MULTIPLIERS[i._material - 37];
break;
}
}
if (i._material < 37)
- amount2 = ELEMENTAL_DAMAGE[i._material] * 100;
+ amount2 = Res.ELEMENTAL_DAMAGE[i._material] * 100;
else if (i._material > 58)
- amount3 = METAL_BASE_MULTIPLIERS[i._material] * 100;
+ amount3 = Res.ELEMENTAL_DAMAGE[i._material - 59 + 7] * 100;
switch (mode) {
case ITEMMODE_BLACKSMITH:
@@ -726,7 +726,7 @@ int ItemsDialog::calcItemCost(Character *c, int itemIndex, ItemsMode mode,
case ITEMMODE_REPAIR:
case ITEMMODE_IDENTIFY:
case ITEMMODE_TO_GOLD:
- result = (amount1 + amount2 + amount3 + amount4) / ITEM_SKILL_DIVISORS[level];
+ result = (amount1 + amount2 + amount3 + amount4) / Res.ITEM_SKILL_DIVISORS[level];
if (!result)
result = 1;
break;
@@ -739,8 +739,8 @@ int ItemsDialog::calcItemCost(Character *c, int itemIndex, ItemsMode mode,
case 3: {
// Misc
XeenItem &i = c->_misc[itemIndex];
- amount1 = MISC_MATERIAL_COSTS[i._material];
- amount4 = MISC_BASE_COSTS[i._id];
+ amount1 = Res.MISC_MATERIAL_COSTS[i._material];
+ amount4 = Res.MISC_BASE_COSTS[i._id];
switch (mode) {
case ITEMMODE_BLACKSMITH:
@@ -748,7 +748,7 @@ int ItemsDialog::calcItemCost(Character *c, int itemIndex, ItemsMode mode,
case ITEMMODE_REPAIR:
case ITEMMODE_IDENTIFY:
case ITEMMODE_TO_GOLD:
- result = (amount1 + amount2 + amount3 + amount4) / ITEM_SKILL_DIVISORS[level];
+ result = (amount1 + amount2 + amount3 + amount4) / Res.ITEM_SKILL_DIVISORS[level];
if (!result)
result = 1;
break;
@@ -800,7 +800,7 @@ int ItemsDialog::doItemOptions(Character &c, int actionIndex, int itemIndex, Ite
addButton(Common::Rect(8, 92, 263, 100), Common::KEYCODE_9);
w.open();
- w.writeString(Common::String::format(WHICH_ITEM, ITEM_ACTIONS[actionIndex]));
+ w.writeString(Common::String::format(Res.WHICH_ITEM, Res.ITEM_ACTIONS[actionIndex]));
_iconSprites.draw(screen, 0, Common::Point(235, 111));
w.update();
@@ -845,7 +845,7 @@ int ItemsDialog::doItemOptions(Character &c, int actionIndex, int itemIndex, Ite
break;
case 2:
if (!party._mazeId) {
- ErrorScroll::show(_vm, WHATS_YOUR_HURRY);
+ ErrorScroll::show(_vm, Res.WHATS_YOUR_HURRY);
} else {
XeenItem &i = c._misc[itemIndex];
@@ -857,11 +857,11 @@ int ItemsDialog::doItemOptions(Character &c, int actionIndex, int itemIndex, Ite
case DEAD:
case STONED:
case ERADICATED:
- ErrorScroll::show(_vm, Common::String::format(IN_NO_CONDITION, c._name.c_str()));
+ ErrorScroll::show(_vm, Common::String::format(Res.IN_NO_CONDITION, c._name.c_str()));
break;
default:
if (combat._itemFlag) {
- ErrorScroll::show(_vm, USE_ITEM_IN_COMBAT);
+ ErrorScroll::show(_vm, Res.USE_ITEM_IN_COMBAT);
} else if (i._id && (i._bonusFlags & ITEMFLAG_BONUS_MASK)
&& !(i._bonusFlags & (ITEMFLAG_BROKEN | ITEMFLAG_CURSED))) {
int charges = (i._bonusFlags & ITEMFLAG_BONUS_MASK) - 1;
@@ -879,7 +879,7 @@ int ItemsDialog::doItemOptions(Character &c, int actionIndex, int itemIndex, Ite
c._items[category].sort();
}
} else {
- ErrorScroll::show(_vm, Common::String::format(NO_SPECIAL_ABILITIES,
+ ErrorScroll::show(_vm, Common::String::format(Res.NO_SPECIAL_ABILITIES,
c._items[category].getFullDescription(itemIndex).c_str()
));
}
@@ -898,18 +898,17 @@ int ItemsDialog::doItemOptions(Character &c, int actionIndex, int itemIndex, Ite
InventoryItems &invItems = _oldCharacter->_items[category];
if (invItems[INV_ITEMS_TOTAL - 1]._id) {
// If the last slot is in use, it means the list is full
- ErrorScroll::show(_vm, Common::String::format(BACKPACK_IS_FULL,
+ ErrorScroll::show(_vm, Common::String::format(Res.BACKPACK_IS_FULL,
_oldCharacter->_name.c_str()));
} else {
int cost = calcItemCost(_oldCharacter, itemIndex, mode, 0, category);
Common::String desc = c._items[category].getFullDescription(itemIndex);
- if (Confirm::show(_vm, Common::String::format(BUY_X_FOR_Y_GOLD,
+ if (Confirm::show(_vm, Common::String::format(Res.BUY_X_FOR_Y_GOLD,
desc.c_str(), cost))) {
if (party.subtract(0, cost, 0, WT_FREEZE_WAIT)) {
if (isDarkCc) {
- sound.playSample(0, 0);
- File f("choice2.voc");
- sound.playSample(&f, 0);
+ sound.stopSound();
+ sound.playSound("choice2.voc");
}
// Add entry to the end of the list
@@ -936,12 +935,12 @@ int ItemsDialog::doItemOptions(Character &c, int actionIndex, int itemIndex, Ite
}
if (noNeed) {
- ErrorScroll::show(_vm, Common::String::format(NO_NEED_OF_THIS,
+ ErrorScroll::show(_vm, Common::String::format(Res.NO_NEED_OF_THIS,
c._items[category].getFullDescription(itemIndex).c_str()));
} else {
int cost = calcItemCost(&c, itemIndex, mode, c._skills[MERCHANT], category);
Common::String desc = c._items[category].getFullDescription(itemIndex);
- Common::String msg = Common::String::format(SELL_X_FOR_Y_GOLD,
+ Common::String msg = Common::String::format(Res.SELL_X_FOR_Y_GOLD,
desc.c_str(), cost);
if (Confirm::show(_vm, msg)) {
@@ -959,7 +958,7 @@ int ItemsDialog::doItemOptions(Character &c, int actionIndex, int itemIndex, Ite
if (category != CATEGORY_MISC || c._misc[itemIndex]._material > 9
|| c._misc[itemIndex]._id == 53 || c._misc[itemIndex]._id == 0) {
sound.playFX(21);
- ErrorScroll::show(_vm, Common::String::format(NOT_RECHARGABLE, SPELL_FAILED));
+ ErrorScroll::show(_vm, Common::String::format(Res.NOT_RECHARGABLE, Res.SPELL_FAILED));
} else {
int charges = MIN(63, _vm->getRandomNumber(1, 6) +
(c._misc[itemIndex]._bonusFlags & ITEMFLAG_BONUS_MASK));
@@ -979,11 +978,11 @@ int ItemsDialog::doItemOptions(Character &c, int actionIndex, int itemIndex, Ite
case ITEMMODE_REPAIR:
if (!(item._bonusFlags & ITEMFLAG_BROKEN)) {
- ErrorScroll::show(_vm, ITEM_NOT_BROKEN);
+ ErrorScroll::show(_vm, Res.ITEM_NOT_BROKEN);
} else {
int cost = calcItemCost(&c, itemIndex, mode, actionIndex, category);
- Common::String msg = Common::String::format(FIX_IDENTIFY_GOLD,
- FIX_IDENTIFY[0],
+ Common::String msg = Common::String::format(Res.FIX_IDENTIFY_GOLD,
+ Res.FIX_IDENTIFY[0],
c._items[category].getFullDescription(itemIndex).c_str(),
cost);
@@ -995,15 +994,15 @@ int ItemsDialog::doItemOptions(Character &c, int actionIndex, int itemIndex, Ite
case ITEMMODE_IDENTIFY: {
int cost = calcItemCost(&c, itemIndex, mode, actionIndex, category);
- Common::String msg = Common::String::format(FIX_IDENTIFY_GOLD,
- FIX_IDENTIFY[1],
+ Common::String msg = Common::String::format(Res.FIX_IDENTIFY_GOLD,
+ Res.FIX_IDENTIFY[1],
c._items[category].getFullDescription(itemIndex).c_str(),
cost);
if (Confirm::show(_vm, msg) && party.subtract(0, cost, 0)) {
Common::String details = c._items[category].getIdentifiedDetails(itemIndex);
Common::String desc = c._items[category].getFullDescription(itemIndex);
- Common::String str = Common::String::format(IDENTIFY_ITEM_MSG,
+ Common::String str = Common::String::format(Res.IDENTIFY_ITEM_MSG,
desc.c_str(), details.c_str());
Window &win = screen._windows[14];
@@ -1049,7 +1048,7 @@ void ItemsDialog::itemToGold(Character &c, int itemIndex, ItemCategory category,
if (category == CATEGORY_WEAPON && item._id == 34) {
sound.playFX(21);
ErrorScroll::show(_vm, Common::String::format("\v012\t000\x03c%s",
- SPELL_FAILED));
+ Res.SPELL_FAILED));
} else if (item._id != 0) {
// There is a valid item present
// Calculate cost of item and add it to the party's total
diff --git a/engines/xeen/dialogs_items.h b/engines/xeen/dialogs_items.h
index 6069ca823b..c161b0721b 100644
--- a/engines/xeen/dialogs_items.h
+++ b/engines/xeen/dialogs_items.h
@@ -37,15 +37,13 @@ enum ItemsMode {
class ItemsDialog : public ButtonContainer {
private:
- XeenEngine *_vm;
SpriteResource _iconSprites;
SpriteResource _equipSprites;
Character _itemsCharacter;
Character *_oldCharacter;
DrawStruct _itemsDrawList[INV_ITEMS_TOTAL];
- ItemsDialog(XeenEngine *vm) : ButtonContainer(),
- _vm(vm), _oldCharacter(nullptr) {}
+ ItemsDialog(XeenEngine *vm) : ButtonContainer(vm), _oldCharacter(nullptr) {}
Character *execute(Character *c, ItemsMode mode);
diff --git a/engines/xeen/dialogs_options.cpp b/engines/xeen/dialogs_options.cpp
index 72445bf055..a49b6d60d5 100644
--- a/engines/xeen/dialogs_options.cpp
+++ b/engines/xeen/dialogs_options.cpp
@@ -114,7 +114,7 @@ void OptionsMenu::showTitles1(SpriteResource &sprites) {
screen.restoreBackground();
sprites.draw(screen, frameNum);
- events.wait(4, true);
+ events.wait(4);
}
}
@@ -123,7 +123,6 @@ void OptionsMenu::showTitles2() {
EventsManager &events = *_vm->_events;
Sound &sound = *_vm->_sound;
- File voc("elect.voc");
SpriteResource titleSprites("title2b.raw");
SpriteResource kludgeSprites("kludge.int");
SpriteResource title2Sprites[8] = {
@@ -135,7 +134,7 @@ void OptionsMenu::showTitles2() {
kludgeSprites.draw(screen, 0);
screen.saveBackground();
- sound.playSample(&voc, 0);
+ sound.playSound("elect.voc");
for (int i = 0; i < 30 && !_vm->shouldQuit(); ++i) {
events.updateGameCounter();
@@ -144,7 +143,7 @@ void OptionsMenu::showTitles2() {
screen._windows[0].update();
if (i == 19)
- sound.playSample(nullptr, 0);
+ sound.stopSound();
while (!_vm->shouldQuit() && events.timeElapsed() < 2)
events.pollEventsAndWait();
@@ -187,7 +186,7 @@ void WorldOptionsMenu::startup(Common::String &title1, Common::String &title2) {
title2 = "start.icn";
Screen &screen = *_vm->_screen;
- screen.fadeOut(4);
+ screen.fadeOut();
screen.loadPalette("dark.pal");
_vm->_events->clearEvents();
}
@@ -198,7 +197,7 @@ void WorldOptionsMenu::setBackground(bool doFade) {
screen.saveBackground();
if (doFade)
- screen.fadeIn(4);
+ screen.fadeIn();
}
void WorldOptionsMenu::openWindow() {
@@ -216,7 +215,7 @@ void WorldOptionsMenu::showContents(SpriteResource &title1, bool waitFlag) {
// Draw the basic frame for the optitons menu and title text
screen._windows[GAME_WINDOW].frame();
- screen._windows[GAME_WINDOW].writeString(OPTIONS_TITLE);
+ screen._windows[GAME_WINDOW].writeString(Res.OPTIONS_TITLE);
drawButtons(&screen._windows[0]);
diff --git a/engines/xeen/dialogs_party.cpp b/engines/xeen/dialogs_party.cpp
index ac5c749d03..9457173e0e 100644
--- a/engines/xeen/dialogs_party.cpp
+++ b/engines/xeen/dialogs_party.cpp
@@ -32,7 +32,7 @@
namespace Xeen {
-PartyDialog::PartyDialog(XeenEngine *vm) : ButtonContainer(),
+PartyDialog::PartyDialog(XeenEngine *vm) : ButtonContainer(vm),
PartyDrawer(vm), _vm(vm) {
initDrawStructs();
}
@@ -72,7 +72,7 @@ void PartyDialog::execute() {
Window &w = screen._windows[11];
w.open();
setupFaces(startingChar, false);
- w.writeString(Common::String::format(PARTY_DIALOG_TEXT, _partyDetails.c_str()));
+ w.writeString(Common::String::format(Res.PARTY_DIALOG_TEXT, _partyDetails.c_str()));
w.drawList(&_faceDrawStructs[0], 4);
_uiSprites.draw(w, 0, Common::Point(16, 100));
@@ -86,18 +86,18 @@ void PartyDialog::execute() {
if (modeFlag) {
screen._windows[0].update();
events.setCursor(0);
- screen.fadeIn(4);
+ screen.fadeIn();
} else {
if (_vm->getGameID() == GType_DarkSide) {
- screen.fadeOut(4);
+ screen.fadeOut();
screen._windows[0].update();
}
- doScroll(_vm, false, false);
+ doScroll(false, false);
events.setCursor(0);
if (_vm->getGameID() == GType_DarkSide) {
- screen.fadeIn(4);
+ screen.fadeIn();
}
}
@@ -114,7 +114,7 @@ void PartyDialog::execute() {
case Common::KEYCODE_e:
case Common::KEYCODE_x:
if (party._activeParty.size() == 0) {
- ErrorScroll::show(_vm, NO_ONE_TO_ADVENTURE_WITH);
+ ErrorScroll::show(_vm, Res.NO_ONE_TO_ADVENTURE_WITH);
} else {
if (_vm->_mode != MODE_0) {
for (int idx = 4; idx >= 0; --idx) {
@@ -166,7 +166,7 @@ void PartyDialog::execute() {
if (idx == party._activeParty.size()) {
if (party._activeParty.size() == MAX_ACTIVE_PARTY) {
sound.playFX(21);
- ErrorScroll::show(_vm, YOUR_PARTY_IS_FULL);
+ ErrorScroll::show(_vm, Res.YOUR_PARTY_IS_FULL);
} else {
// Add the character to the active party
party._activeParty.push_back(party._roster[
@@ -198,16 +198,16 @@ void PartyDialog::execute() {
case Common::KEYCODE_c:
// Create
if (_charList.size() == XEEN_TOTAL_CHARACTERS) {
- ErrorScroll::show(_vm, YOUR_ROSTER_IS_FULL);
+ ErrorScroll::show(_vm, Res.YOUR_ROSTER_IS_FULL);
} else {
- screen.fadeOut(4);
+ screen.fadeOut();
w.close();
createChar();
party.copyPartyToRoster();
_vm->_saves->writeCharFile();
- screen.fadeOut(4);
+ screen.fadeOut();
modeFlag = true;
breakFlag = true;
}
@@ -221,10 +221,10 @@ void PartyDialog::execute() {
int charIndex = charButtonValue - Common::KEYCODE_1 + startingChar;
Character &c = party._roster[_charList[charIndex]];
if (c.hasSpecialItem()) {
- ErrorScroll::show(_vm, HAS_SLAYER_SWORD);
+ ErrorScroll::show(_vm, Res.HAS_SLAYER_SWORD);
} else {
- Common::String msg = Common::String::format(SURE_TO_DELETE_CHAR,
- c._name.c_str(), CLASS_NAMES[c._class]);
+ Common::String msg = Common::String::format(Res.SURE_TO_DELETE_CHAR,
+ c._name.c_str(), Res.CLASS_NAMES[c._class]);
if (Confirm::show(_vm, msg)) {
// If the character is in the party, remove it
for (uint idx = 0; idx < party._activeParty.size(); ++idx) {
@@ -327,10 +327,10 @@ void PartyDialog::setupFaces(int firstDisplayChar, bool updateFlag) {
Common::Rect &b = _buttons[7 + posIndex]._bounds;
b.moveTo((posIndex & 1) ? 117 : 16, b.top);
Character &ps = party._roster[_charList[firstDisplayChar + posIndex]];
- charNames[posIndex] = isInParty ? IN_PARTY : ps._name;
- charRaces[posIndex] = RACE_NAMES[ps._race];
- charSex[posIndex] = SEX_NAMES[ps._sex];
- charClasses[posIndex] = CLASS_NAMES[ps._class];
+ charNames[posIndex] = isInParty ? Res.IN_PARTY : ps._name;
+ charRaces[posIndex] = Res.RACE_NAMES[ps._race];
+ charSex[posIndex] = Res.SEX_NAMES[ps._sex];
+ charClasses[posIndex] = Res.CLASS_NAMES[ps._class];
}
drawParty(updateFlag);
@@ -344,7 +344,7 @@ void PartyDialog::setupFaces(int firstDisplayChar, bool updateFlag) {
_charList[firstDisplayChar + posIndex]]._faceSprites;
}
- _partyDetails = Common::String::format(PARTY_DETAILS,
+ _partyDetails = Common::String::format(Res.PARTY_DETAILS,
charNames[0].c_str(), charRaces[0].c_str(), charSex[0].c_str(), charClasses[0].c_str(),
charNames[1].c_str(), charRaces[1].c_str(), charSex[1].c_str(), charClasses[1].c_str(),
charNames[2].c_str(), charRaces[2].c_str(), charSex[2].c_str(), charClasses[2].c_str(),
@@ -356,7 +356,7 @@ void PartyDialog::startingCharChanged(int firstDisplayChar) {
Window &w = _vm->_screen->_windows[11];
setupFaces(firstDisplayChar, true);
- w.writeString(Common::String::format(PARTY_DIALOG_TEXT, _partyDetails.c_str()));
+ w.writeString(Common::String::format(Res.PARTY_DIALOG_TEXT, _partyDetails.c_str()));
w.drawList(_faceDrawStructs, 4);
_uiSprites.draw(w, 0, Common::Point(16, 100));
@@ -382,10 +382,10 @@ void PartyDialog::createChar() {
bool restartFlag = true;
uint attribs[TOTAL_ATTRIBUTES];
bool allowedClasses[TOTAL_CLASSES];
- Race race;
- Sex sex;
+ Race race = HUMAN;
+ Sex sex = MALE;
Common::String msg;
- int charIndex;
+ int charIndex = 0;
Mode oldMode = _vm->_mode;
_vm->_mode = MODE_4;
@@ -498,7 +498,7 @@ void PartyDialog::createChar() {
// Draw the dice
drawDice(dice);
if (!hasFadedIn) {
- screen.fadeIn(4);
+ screen.fadeIn();
hasFadedIn = true;
}
@@ -701,8 +701,8 @@ int PartyDialog::selectCharacter(bool isDelete, int firstDisplayChar) {
w.setBounds(Common::Rect(50, isDelete ? 112 : 76, 266, isDelete ? 148 : 112));
w.open();
- w.writeString(Common::String::format(REMOVE_OR_DELETE_WHICH,
- REMOVE_DELETE[isDelete ? 1 : 0]));
+ w.writeString(Common::String::format(Res.REMOVE_OR_DELETE_WHICH,
+ Res.REMOVE_DELETE[isDelete ? 1 : 0]));
iconSprites.draw(w, 0, Common::Point(225, isDelete ? 120 : 84));
w.update();
@@ -808,19 +808,19 @@ int PartyDialog::newCharDetails(const uint attribs[TOTAL_ATTRIBUTES],
Common::String skillStr, classStr, raceSkillStr;
// If a selected class is provided, set the default skill for that class
- if (classId != -1 && NEW_CHAR_SKILLS[classId] != -1) {
- const char *skillP = SKILL_NAMES[NEW_CHAR_SKILLS[classId]];
- skillStr = Common::String(skillP, skillP + NEW_CHAR_SKILLS_LEN[classId]);
+ if (classId != -1 && Res.NEW_CHAR_SKILLS[classId] != -1) {
+ const char *skillP = Res.SKILL_NAMES[Res.NEW_CHAR_SKILLS[classId]];
+ skillStr = Common::String(skillP, skillP + Res.NEW_CHAR_SKILLS_LEN[classId]);
}
// If a class is provided, set the class name
if (classId != -1) {
- classStr = Common::String::format("\t062\v168%s", CLASS_NAMES[classId]);
+ classStr = Common::String::format("\t062\v168%s", Res.CLASS_NAMES[classId]);
}
// Set up default skill for the race, if any
- if (NEW_CHAR_RACE_SKILLS[race] != -1) {
- raceSkillStr = SKILL_NAMES[NEW_CHAR_RACE_SKILLS[race]];
+ if (Res.NEW_CHAR_RACE_SKILLS[race] != -1) {
+ raceSkillStr = Res.SKILL_NAMES[Res.NEW_CHAR_RACE_SKILLS[race]];
}
// Set up color to use for each skill string to be displayed, based
@@ -836,7 +836,7 @@ int PartyDialog::newCharDetails(const uint attribs[TOTAL_ATTRIBUTES],
}
// Return stats details and character class
- msg = Common::String::format(NEW_CHAR_STATS, RACE_NAMES[race], SEX_NAMES[sex],
+ msg = Common::String::format(Res.NEW_CHAR_STATS, Res.RACE_NAMES[race], Res.SEX_NAMES[sex],
attribs[MIGHT], attribs[INTELLECT], attribs[PERSONALITY],
attribs[ENDURANCE], attribs[SPEED], attribs[ACCURACY], attribs[LUCK],
classColors[CLASS_KNIGHT], classColors[CLASS_PALADIN],
@@ -887,7 +887,7 @@ void PartyDialog::drawDice(SpriteResource &dice) {
w.update();
// Wait for keypress
- events.wait(1, true);
+ events.wait(1);
checkEvents(_vm);
}
@@ -909,7 +909,7 @@ int PartyDialog::exchangeAttribute(int srcAttr) {
Window &w = screen._windows[26];
w.open();
- w.writeString(Common::String::format(EXCHANGE_ATTR_WITH, STAT_NAMES[srcAttr - 1]));
+ w.writeString(Common::String::format(Res.EXCHANGE_ATTR_WITH, Res.STAT_NAMES[srcAttr - 1]));
icons.draw(w, 0, Common::Point(118, 58));
w.update();
@@ -969,7 +969,7 @@ int PartyDialog::exchangeAttribute(int srcAttr) {
bool PartyDialog::saveCharacter(Character &c, int classId,
Race race, Sex sex, uint attribs[TOTAL_ATTRIBUTES]) {
if (classId == -1) {
- ErrorScroll::show(_vm, SELECT_CLASS_BEFORE_SAVING);
+ ErrorScroll::show(_vm, Res.SELECT_CLASS_BEFORE_SAVING);
return false;
}
@@ -982,7 +982,7 @@ bool PartyDialog::saveCharacter(Character &c, int classId,
bool isDarkCc = _vm->_files->_isDarkCc;
saveButtons();
- w.writeString(NAME_FOR_NEW_CHARACTER);
+ w.writeString(Res.NAME_FOR_NEW_CHARACTER);
result = Input::show(_vm, &w, name, 10, 200);
w.close();
@@ -1008,12 +1008,12 @@ bool PartyDialog::saveCharacter(Character &c, int classId,
c._accuracy._permanent = attribs[ACCURACY];
c._luck._permanent = attribs[LUCK];
- c._magicResistence._permanent = RACE_MAGIC_RESISTENCES[race];
- c._fireResistence._permanent = RACE_FIRE_RESISTENCES[race];
- c._electricityResistence._permanent = RACE_ELECTRIC_RESISTENCES[race];
- c._coldResistence._permanent = RACE_COLD_RESISTENCES[race];
- c._energyResistence._permanent = RACE_ENERGY_RESISTENCES[race];
- c._poisonResistence._permanent = RACE_POISON_RESISTENCES[race];
+ c._magicResistence._permanent = Res.RACE_MAGIC_RESISTENCES[race];
+ c._fireResistence._permanent = Res.RACE_FIRE_RESISTENCES[race];
+ c._electricityResistence._permanent = Res.RACE_ELECTRIC_RESISTENCES[race];
+ c._coldResistence._permanent = Res.RACE_COLD_RESISTENCES[race];
+ c._energyResistence._permanent = Res.RACE_ENERGY_RESISTENCES[race];
+ c._poisonResistence._permanent = Res.RACE_POISON_RESISTENCES[race];
c._birthYear = party._year - 18;
c._birthDay = party._day;
@@ -1022,18 +1022,18 @@ bool PartyDialog::saveCharacter(Character &c, int classId,
// Set up any default spells for the character's class
for (int idx = 0; idx < 4; ++idx) {
- if (NEW_CHARACTER_SPELLS[c._class][idx] != -1) {
+ if (Res.NEW_CHARACTER_SPELLS[c._class][idx] != -1) {
c._hasSpells = true;
- c._currentSpell = NEW_CHARACTER_SPELLS[c._class][idx];
+ c._currentSpell = Res.NEW_CHARACTER_SPELLS[c._class][idx];
c._spells[c._currentSpell] = 1;
}
}
- int classSkill = NEW_CHAR_SKILLS[c._class];
+ int classSkill = Res.NEW_CHAR_SKILLS[c._class];
if (classSkill != -1)
c._skills[classSkill] = 1;
- int raceSkill = NEW_CHAR_RACE_SKILLS[c._race];
+ int raceSkill = Res.NEW_CHAR_RACE_SKILLS[c._race];
if (raceSkill != -1)
c._skills[raceSkill] = 1;
diff --git a/engines/xeen/dialogs_query.cpp b/engines/xeen/dialogs_query.cpp
index abaddafe69..d8dfea116a 100644
--- a/engines/xeen/dialogs_query.cpp
+++ b/engines/xeen/dialogs_query.cpp
@@ -136,7 +136,7 @@ bool YesNo::execute(bool type, bool townFlag) {
//numFrames = 1;
}
- events.wait(3, true);
+ events.wait(3);
checkEvents(_vm);
if (!_buttonValue)
continue;
diff --git a/engines/xeen/dialogs_query.h b/engines/xeen/dialogs_query.h
index 96ae488b97..0b9b2687ac 100644
--- a/engines/xeen/dialogs_query.h
+++ b/engines/xeen/dialogs_query.h
@@ -29,9 +29,7 @@ namespace Xeen {
class Confirm : public ButtonContainer {
private:
- XeenEngine *_vm;
-
- Confirm(XeenEngine *vm) : ButtonContainer(), _vm(vm) {}
+ Confirm(XeenEngine *vm) : ButtonContainer(vm) {}
bool execute(const Common::String &msg, int mode);
public:
@@ -40,9 +38,7 @@ public:
class YesNo : public ButtonContainer {
private:
- XeenEngine *_vm;
-
- YesNo(XeenEngine *vm) : ButtonContainer(), _vm(vm) {}
+ YesNo(XeenEngine *vm) : ButtonContainer(vm) {}
bool execute(bool type, bool townFlag);
public:
diff --git a/engines/xeen/dialogs_quests.cpp b/engines/xeen/dialogs_quests.cpp
index 284e15781b..51a5d523d8 100644
--- a/engines/xeen/dialogs_quests.cpp
+++ b/engines/xeen/dialogs_quests.cpp
@@ -58,7 +58,7 @@ void Quests::execute() {
windowFlag = true;
}
- screen._windows[29].writeString(QUESTS_DIALOG_TEXT);
+ screen._windows[29].writeString(Res.QUESTS_DIALOG_TEXT);
drawButtons(&screen);
while (!_vm->shouldQuit()) {
@@ -74,10 +74,10 @@ void Quests::execute() {
for (int idx = 0; idx < TOTAL_QUEST_ITEMS; ++idx) {
if (party._questItems[idx]) {
if (!count && !headerShown && idx < 35) {
- lines[count++] = CLOUDS_OF_XEEN_LINE;
+ lines[count++] = Res.CLOUDS_OF_XEEN_LINE;
}
if (idx >= 35 && !headerShown) {
- lines[count++] = DARKSIDE_OF_XEEN_LINE;
+ lines[count++] = Res.DARKSIDE_OF_XEEN_LINE;
headerShown = true;
}
@@ -91,20 +91,20 @@ void Quests::execute() {
case 83:
case 84:
lines[count++] = Common::String::format("%d %s%c",
- party._questItems[idx], QUEST_ITEM_NAMES[idx],
+ party._questItems[idx], Res.QUEST_ITEM_NAMES[idx],
party._questItems[idx] == 1 ? ' ' : 's');
break;
default:
- lines[count++] = QUEST_ITEM_NAMES[idx];
+ lines[count++] = Res.QUEST_ITEM_NAMES[idx];
break;
}
}
}
if (count == 0) {
- screen._windows[30].writeString(NO_QUEST_ITEMS);
+ screen._windows[30].writeString(Res.NO_QUEST_ITEMS);
} else {
- screen._windows[30].writeString(Common::String::format(QUEST_ITEMS_DATA,
+ screen._windows[30].writeString(Common::String::format(Res.QUEST_ITEMS_DATA,
lines[topRow].c_str(), lines[topRow + 1].c_str(),
lines[topRow + 2].c_str(), lines[topRow + 3].c_str(),
lines[topRow + 4].c_str(), lines[topRow + 5].c_str(),
@@ -123,10 +123,10 @@ void Quests::execute() {
for (int idx = 0; idx < TOTAL_QUEST_FLAGS; ++idx) {
if (party._quests[idx]) {
if (!count && !headerShown && idx < 29) {
- lines[count++] = CLOUDS_OF_XEEN_LINE;
+ lines[count++] = Res.CLOUDS_OF_XEEN_LINE;
}
if (idx > 28 && !headerShown) {
- lines[count++] = DARKSIDE_OF_XEEN_LINE;
+ lines[count++] = Res.DARKSIDE_OF_XEEN_LINE;
headerShown = true;
}
@@ -135,9 +135,9 @@ void Quests::execute() {
}
if (count == 0)
- lines[1] = NO_CURRENT_QUESTS;
+ lines[1] = Res.NO_CURRENT_QUESTS;
- screen._windows[30].writeString(Common::String::format(CURRENT_QUESTS_DATA,
+ screen._windows[30].writeString(Common::String::format(Res.CURRENT_QUESTS_DATA,
lines[topRow].c_str(), lines[topRow + 1].c_str(), lines[topRow + 2].c_str()));
break;
@@ -150,10 +150,10 @@ void Quests::execute() {
for (int idx = 0; idx < MAX_DIALOG_LINES; ++idx) {
if (party._worldFlags[idx]) {
if (!count && !headerShown && idx < 72) {
- lines[count++] = CLOUDS_OF_XEEN_LINE;
+ lines[count++] = Res.CLOUDS_OF_XEEN_LINE;
}
if (idx >= 72 && !headerShown) {
- lines[count++] = DARKSIDE_OF_XEEN_LINE;
+ lines[count++] = Res.DARKSIDE_OF_XEEN_LINE;
headerShown = true;
}
@@ -162,9 +162,9 @@ void Quests::execute() {
}
if (count == 0)
- lines[1] = NO_AUTO_NOTES;
+ lines[1] = Res.NO_AUTO_NOTES;
- screen._windows[30].writeString(Common::String::format(AUTO_NOTES_DATA,
+ screen._windows[30].writeString(Common::String::format(Res.AUTO_NOTES_DATA,
lines[topRow].c_str(), lines[topRow + 1].c_str(),
lines[topRow + 2].c_str(), lines[topRow + 3].c_str(),
lines[topRow + 4].c_str(), lines[topRow + 5].c_str(),
@@ -245,7 +245,7 @@ void Quests::addButtons() {
}
void Quests::loadQuestNotes() {
- File f("qnotes.bin", *_vm->_files->_sideArchives[_vm->getGameID() == GType_Clouds ? 0 : 1]);
+ File f("qnotes.bin", _vm->getGameID() == GType_Clouds ? GAME_ARCHIVE : ALTSIDE_ARCHIVE);
while (f.pos() < f.size())
_questNotes.push_back(f.readString());
f.close();
diff --git a/engines/xeen/dialogs_quests.h b/engines/xeen/dialogs_quests.h
index 234accded6..dd1461f75b 100644
--- a/engines/xeen/dialogs_quests.h
+++ b/engines/xeen/dialogs_quests.h
@@ -30,11 +30,10 @@ namespace Xeen {
class Quests : public ButtonContainer {
private:
- XeenEngine *_vm;
SpriteResource _iconSprites;
Common::StringArray _questNotes;
- Quests(XeenEngine *vm) : ButtonContainer(), _vm(vm) {}
+ Quests(XeenEngine *vm) : ButtonContainer(vm) {}
void execute();
diff --git a/engines/xeen/dialogs_quick_ref.cpp b/engines/xeen/dialogs_quick_ref.cpp
index e9ffbd482c..eb516959d6 100644
--- a/engines/xeen/dialogs_quick_ref.cpp
+++ b/engines/xeen/dialogs_quick_ref.cpp
@@ -46,21 +46,21 @@ void QuickReferenceDialog::execute() {
Character &c = combat._globalCombat == 2 ? *combat._combatParty[idx] :
party._activeParty[idx];
Condition condition = c.worstCondition();
- lines[idx] = Common::String::format(QUICK_REF_LINE,
+ lines[idx] = Common::String::format(Res.QUICK_REF_LINE,
idx * 10 + 24, idx + 1, c._name.c_str(),
- CLASS_NAMES[c._class][0], CLASS_NAMES[c._class][1], CLASS_NAMES[c._class][2],
+ Res.CLASS_NAMES[c._class][0], Res.CLASS_NAMES[c._class][1], Res.CLASS_NAMES[c._class][2],
c.statColor(c.getCurrentLevel(), c._level._permanent), c._level._permanent,
c.statColor(c._currentHp, c.getMaxHP()), c._currentHp,
c.statColor(c._currentSp, c.getMaxSP()), c._currentSp,
c.statColor(c.getArmorClass(), c.getArmorClass(true)), c.getArmorClass(),
- CONDITION_COLORS[condition],
- CONDITION_NAMES[condition][0], CONDITION_NAMES[condition][1],
- CONDITION_NAMES[condition][2], CONDITION_NAMES[condition][3]
+ Res.CONDITION_COLORS[condition],
+ Res.CONDITION_NAMES[condition][0], Res.CONDITION_NAMES[condition][1],
+ Res.CONDITION_NAMES[condition][2], Res.CONDITION_NAMES[condition][3]
);
}
int food = (party._food / party._activeParty.size()) / 3;
- Common::String msg = Common::String::format(QUICK_REFERENCE,
+ Common::String msg = Common::String::format(Res.QUICK_REFERENCE,
lines[0].c_str(), lines[1].c_str(), lines[2].c_str(),
lines[3].c_str(), lines[4].c_str(), lines[5].c_str(),
lines[6].c_str(), lines[7].c_str(),
diff --git a/engines/xeen/dialogs_quick_ref.h b/engines/xeen/dialogs_quick_ref.h
index 0c1b8e3f91..eaafd99537 100644
--- a/engines/xeen/dialogs_quick_ref.h
+++ b/engines/xeen/dialogs_quick_ref.h
@@ -29,9 +29,7 @@ namespace Xeen {
class QuickReferenceDialog : public ButtonContainer {
private:
- XeenEngine *_vm;
-
- QuickReferenceDialog(XeenEngine *vm) : ButtonContainer(), _vm(vm) {}
+ QuickReferenceDialog(XeenEngine *vm) : ButtonContainer(vm) {}
void execute();
public:
diff --git a/engines/xeen/dialogs_spells.cpp b/engines/xeen/dialogs_spells.cpp
index 1e0600faf9..47125c4fa7 100644
--- a/engines/xeen/dialogs_spells.cpp
+++ b/engines/xeen/dialogs_spells.cpp
@@ -59,15 +59,14 @@ Character *SpellsDialog::execute(ButtonContainer *priorDialog, Character *c, int
do {
if (!isCasting) {
if (!c->guildMember()) {
- sound.playSample(nullptr, 0);
+ sound.stopSound();
intf._overallFrame = 5;
- File f(isDarkCc ? "skull1.voc" : "guild11.voc");
- sound.playSample(&f, 1);
+ sound.playSound(isDarkCc ? "skull1.voc" : "guild11.voc", 1);
break;
}
- Common::String title = Common::String::format(BUY_SPELLS, c->_name.c_str());
- Common::String msg = Common::String::format(GUILD_OPTIONS,
+ Common::String title = Common::String::format(Res.BUY_SPELLS, c->_name.c_str());
+ Common::String msg = Common::String::format(Res.GUILD_OPTIONS,
title.c_str(), XeenEngine::printMil(party._gold).c_str());
screen._windows[10].writeString(msg);
@@ -76,8 +75,8 @@ Character *SpellsDialog::execute(ButtonContainer *priorDialog, Character *c, int
_spells.clear();
const char *errorMsg = setSpellText(c, castingCopy);
- screen._windows[25].writeString(Common::String::format(SPELLS_FOR,
- errorMsg == nullptr ? SPELL_LINES_0_TO_9 : "",
+ screen._windows[25].writeString(Common::String::format(Res.SPELLS_FOR,
+ errorMsg == nullptr ? Res.SPELL_LINES_0_TO_9 : "",
c->_name.c_str()));
// Setup and write out spell list
@@ -99,12 +98,12 @@ Character *SpellsDialog::execute(ButtonContainer *priorDialog, Character *c, int
if (_spells.size() == 0)
names[0] = errorMsg;
- screen._windows[37].writeString(Common::String::format(SPELLS_DIALOG_SPELLS,
+ screen._windows[37].writeString(Common::String::format(Res.SPELLS_DIALOG_SPELLS,
colors[0], names[0], colors[1], names[1], colors[2], names[2],
colors[3], names[3], colors[4], names[4], colors[5], names[5],
colors[6], names[6], colors[7], names[7], colors[8], names[8],
colors[9], names[9],
- isCasting ? SPELL_PTS : GOLD,
+ isCasting ? Res.SPELL_PTS : Res.GOLD,
isCasting ? c->_currentSp : party._gold
));
@@ -136,8 +135,8 @@ Character *SpellsDialog::execute(ButtonContainer *priorDialog, Character *c, int
intf.highlightChar(_buttonValue);
if (_vm->_mode == MODE_17) {
- screen._windows[10].writeString(Common::String::format(GUILD_OPTIONS,
- XeenEngine::printMil(party._gold).c_str(), GUILD_TEXT, c->_name.c_str()));
+ screen._windows[10].writeString(Common::String::format(Res.GUILD_OPTIONS,
+ XeenEngine::printMil(party._gold).c_str(), Res.GUILD_TEXT, c->_name.c_str()));
} else {
int category;
switch (c->_class) {
@@ -155,11 +154,11 @@ Character *SpellsDialog::execute(ButtonContainer *priorDialog, Character *c, int
}
int spellIndex = (c->_currentSpell == -1) ? 39 : c->_currentSpell;
- int spellId = SPELLS_ALLOWED[category][spellIndex];
- screen._windows[10].writeString(Common::String::format(CAST_SPELL_DETAILS,
+ int spellId = Res.SPELLS_ALLOWED[category][spellIndex];
+ screen._windows[10].writeString(Common::String::format(Res.CAST_SPELL_DETAILS,
c->_name.c_str(), spells._spellNames[spellId].c_str(),
spells.calcSpellPoints(spellId, c->getCurrentLevel()),
- SPELL_GEM_COST[spellId], c->_currentSp));
+ Res.SPELL_GEM_COST[spellId], c->_currentSp));
}
if (priorDialog != nullptr)
@@ -225,7 +224,7 @@ Character *SpellsDialog::execute(ButtonContainer *priorDialog, Character *c, int
}
int spellIndex = _spells[newSelection]._spellIndex;
- int spellId = SPELLS_ALLOWED[category][spellIndex];
+ int spellId = Res.SPELLS_ALLOWED[category][spellIndex];
int spellCost = spells.calcSpellCost(spellId, expenseFactor);
if (isCasting) {
@@ -233,16 +232,15 @@ Character *SpellsDialog::execute(ButtonContainer *priorDialog, Character *c, int
} else {
Common::String spellName = _spells[newSelection]._name;
Common::String msg = (castingCopy & 0x80) ?
- Common::String::format(SPELLS_PRESS_A_KEY, spellName.c_str()) :
- Common::String::format(SPELLS_PURCHASE, spellName.c_str(), spellCost);
+ Common::String::format(Res.SPELLS_PRESS_A_KEY, spellName.c_str()) :
+ Common::String::format(Res.SPELLS_PURCHASE, spellName.c_str(), spellCost);
if (Confirm::show(_vm, msg, castingCopy + 1)) {
if (party.subtract(0, spellCost, 0, WT_FREEZE_WAIT)) {
++c->_spells[spellIndex];
- sound.playSample(nullptr, 0);
+ sound.stopSound();
intf._overallFrame = 0;
- File f(isDarkCc ? "guild12.voc" : "parrot2.voc");
- sound.playSample(&f, 1);
+ sound.playSound(isDarkCc ? "guild12.voc" : "parrot2.voc", 1);
} else {
sound.playFX(21);
}
@@ -347,32 +345,32 @@ const char *SpellsDialog::setSpellText(Character *c, int isCasting) {
if (party._mazeId == 49 || party._mazeId == 37) {
for (uint spellId = 0; spellId < 76; ++spellId) {
int idx = 0;
- while (idx < MAX_SPELLS_PER_CLASS && SPELLS_ALLOWED[category][idx] == spellId)
+ while (idx < MAX_SPELLS_PER_CLASS && Res.SPELLS_ALLOWED[category][idx] == spellId)
++idx;
// Handling if the spell is appropriate for the character's class
if (idx < MAX_SPELLS_PER_CLASS) {
if (!c->_spells[idx] || (isCasting & 0x80)) {
- int cost = spells.calcSpellCost(SPELLS_ALLOWED[category][idx], expenseFactor);
+ int cost = spells.calcSpellCost(Res.SPELLS_ALLOWED[category][idx], expenseFactor);
_spells.push_back(SpellEntry(Common::String::format("\x3l%s\x3r\x9""000%u",
- spells._spellNames[SPELLS_ALLOWED[category][idx]].c_str(), cost),
+ spells._spellNames[Res.SPELLS_ALLOWED[category][idx]].c_str(), cost),
idx, spellId));
}
}
}
} else if (isDarkCc) {
int groupIndex = (party._mazeId - 29) / 2;
- for (int spellId = DARK_SPELL_RANGES[groupIndex][0];
- spellId < DARK_SPELL_RANGES[groupIndex][1]; ++spellId) {
+ for (int spellId = Res.DARK_SPELL_RANGES[groupIndex][0];
+ spellId < Res.DARK_SPELL_RANGES[groupIndex][1]; ++spellId) {
int idx = 0;
- while (idx < 40 && SPELLS_ALLOWED[category][idx] ==
- DARK_SPELL_OFFSETS[category][spellId]);
+ while (idx < 40 && Res.SPELLS_ALLOWED[category][idx] ==
+ Res.DARK_SPELL_OFFSETS[category][spellId]);
if (idx < 40) {
if (!c->_spells[idx] || (isCasting & 0x80)) {
- int cost = spells.calcSpellCost(SPELLS_ALLOWED[category][idx], expenseFactor);
+ int cost = spells.calcSpellCost(Res.SPELLS_ALLOWED[category][idx], expenseFactor);
_spells.push_back(SpellEntry(Common::String::format("\x3l%s\x3r\x9""000%u",
- spells._spellNames[SPELLS_ALLOWED[category][idx]].c_str(), cost),
+ spells._spellNames[Res.SPELLS_ALLOWED[category][idx]].c_str(), cost),
idx, spellId));
}
}
@@ -380,14 +378,14 @@ const char *SpellsDialog::setSpellText(Character *c, int isCasting) {
} else {
for (int spellId = 0; spellId < 20; ++spellId) {
int idx = 0;
- while (CLOUDS_SPELL_OFFSETS[party._mazeId - 29][spellId] !=
- (int)SPELLS_ALLOWED[category][idx] && idx < 40) ;
+ while (Res.CLOUDS_SPELL_OFFSETS[party._mazeId - 29][spellId] !=
+ (int)Res.SPELLS_ALLOWED[category][idx] && idx < 40) ;
if (idx < 40) {
if (!c->_spells[idx] || (isCasting & 0x80)) {
- int cost = spells.calcSpellCost(SPELLS_ALLOWED[category][idx], expenseFactor);
+ int cost = spells.calcSpellCost(Res.SPELLS_ALLOWED[category][idx], expenseFactor);
_spells.push_back(SpellEntry(Common::String::format("\x3l%s\x3r\x9""000%u",
- spells._spellNames[SPELLS_ALLOWED[category][idx]].c_str(), cost),
+ spells._spellNames[Res.SPELLS_ALLOWED[category][idx]].c_str(), cost),
idx, spellId));
}
}
@@ -396,7 +394,7 @@ const char *SpellsDialog::setSpellText(Character *c, int isCasting) {
}
if (c->getMaxSP() == 0)
- return NOT_A_SPELL_CASTER;
+ return Res.NOT_A_SPELL_CASTER;
} else if ((isCasting & 0x7f) == 1) {
switch (c->_class) {
@@ -416,12 +414,12 @@ const char *SpellsDialog::setSpellText(Character *c, int isCasting) {
}
if (c->getMaxSP() == 0) {
- return NOT_A_SPELL_CASTER;
+ return Res.NOT_A_SPELL_CASTER;
} else {
for (int spellIndex = 0; spellIndex < (MAX_SPELLS_PER_CLASS - 1); ++spellIndex) {
if (c->_spells[spellIndex]) {
- int spellId = SPELLS_ALLOWED[category][spellIndex];
- int gemCost = SPELL_GEM_COST[spellId];
+ int spellId = Res.SPELLS_ALLOWED[category][spellIndex];
+ int gemCost = Res.SPELL_GEM_COST[spellId];
int spCost = spells.calcSpellPoints(spellId, currLevel);
Common::String msg = Common::String::format("\x3l%s\x3r\x9""000%u/%u",
@@ -496,11 +494,11 @@ int CastSpell::execute(Character *&c) {
if (redrawFlag) {
int category = c->getClassCategory();
int spellIndex = c->_currentSpell != -1 ? c->_currentSpell : 39;
- spellId = SPELLS_ALLOWED[category][spellIndex];
- int gemCost = SPELL_GEM_COST[spellId];
+ spellId = Res.SPELLS_ALLOWED[category][spellIndex];
+ int gemCost = Res.SPELL_GEM_COST[spellId];
int spCost = spells.calcSpellPoints(spellId, c->getCurrentLevel());
- w.writeString(Common::String::format(CAST_SPELL_DETAILS,
+ w.writeString(Common::String::format(Res.CAST_SPELL_DETAILS,
c->_name.c_str(), spells._spellNames[spellId].c_str(),
spCost, gemCost, c->_currentSp));
drawButtons(&screen);
@@ -608,7 +606,7 @@ int SpellOnWho::execute(int spellId) {
int result = 999;
w.open();
- w.writeString(ON_WHO);
+ w.writeString(Res.ON_WHO);
w.update();
addPartyButtons(_vm);
@@ -676,7 +674,7 @@ int SelectElement::execute(int spellId) {
loadButtons();
w.open();
- w.writeString(WHICH_ELEMENT1);
+ w.writeString(Res.WHICH_ELEMENT1);
drawButtons(&screen);
w.update();
@@ -685,7 +683,7 @@ int SelectElement::execute(int spellId) {
events.updateGameCounter();
intf.draw3d(true);
w.frame();
- w.writeString(WHICH_ELEMENT2);
+ w.writeString(Res.WHICH_ELEMENT2);
drawButtons(&screen);
w.update();
@@ -751,7 +749,7 @@ void NotWhileEngaged::execute(int spellId) {
_vm->_mode = MODE_3;
w.open();
- w.writeString(Common::String::format(CANT_CAST_WHILE_ENGAGED,
+ w.writeString(Common::String::format(Res.CANT_CAST_WHILE_ENGAGED,
spells._spellNames[spellId].c_str()));
w.update();
@@ -810,7 +808,7 @@ bool LloydsBeacon::execute() {
// Display the dialog
w.open();
- w.writeString(Common::String::format(LLOYDS_BEACON,
+ w.writeString(Common::String::format(Res.LLOYDS_BEACON,
mapName.c_str(), c._lloydPosition.x, c._lloydPosition.y));
drawButtons(&screen);
w.update();
@@ -888,8 +886,8 @@ int Teleport::execute() {
Common::String num;
w.open();
- w.writeString(Common::String::format(HOW_MANY_SQUARES,
- DIRECTION_TEXT[party._mazeDirection]));
+ w.writeString(Common::String::format(Res.HOW_MANY_SQUARES,
+ Res.DIRECTION_TEXT[party._mazeDirection]));
w.update();
int lineSize = Input::show(_vm, &w, num, 1, 200, true);
w.close();
@@ -950,13 +948,13 @@ int TownPortal::execute() {
for (int idx = 0; idx < 5; ++idx) {
File f(Common::String::format("%s%04d.txt",
map._sideTownPortal ? "dark" : "xeen",
- TOWN_MAP_NUMBERS[map._sideTownPortal][idx]));
+ Res.TOWN_MAP_NUMBERS[map._sideTownPortal][idx]));
townNames[idx] = f.readString();
f.close();
}
w.open();
- w.writeString(Common::String::format(TOWN_PORTAL,
+ w.writeString(Common::String::format(Res.TOWN_PORTAL,
townNames[0].c_str(), townNames[1].c_str(), townNames[2].c_str(),
townNames[3].c_str(), townNames[4].c_str()
));
@@ -1001,17 +999,17 @@ void IdentifyMonster::execute() {
MazeMonster &monster = map._mobData._monsters[combat._attackMonsters[monIndex]];
MonsterStruct &monsterData = *monster._monsterData;
- monsterDesc[monIndex] = Common::String::format(MONSTER_DETAILS,
+ monsterDesc[monIndex] = Common::String::format(Res.MONSTER_DETAILS,
monsterData._name.c_str(),
_vm->printK2(monster._hp).c_str(),
monsterData._accuracy, monsterData._numberOfAttacks,
- MONSTER_SPECIAL_ATTACKS[monsterData._specialAttack]
+ Res.MONSTER_SPECIAL_ATTACKS[monsterData._specialAttack]
);
}
sound.playFX(20);
w.open();
- w.writeString(Common::String::format(IDENTIFY_MONSTERS,
+ w.writeString(Common::String::format(Res.IDENTIFY_MONSTERS,
monsterDesc[0].c_str(), monsterDesc[1].c_str(), monsterDesc[2].c_str()));
w.update();
@@ -1021,7 +1019,7 @@ void IdentifyMonster::execute() {
w.frame();
screen._windows[3].update();
- events.wait(1);
+ events.wait(1, false);
} while (!events.isKeyMousePressed());
w.close();
diff --git a/engines/xeen/dialogs_spells.h b/engines/xeen/dialogs_spells.h
index 35b2708f7a..3ccdb836a3 100644
--- a/engines/xeen/dialogs_spells.h
+++ b/engines/xeen/dialogs_spells.h
@@ -41,12 +41,11 @@ struct SpellEntry {
class SpellsDialog : public ButtonContainer {
private:
- XeenEngine *_vm;
SpriteResource _iconSprites;
SpriteResource _scrollSprites;
Common::Array<SpellEntry> _spells;
- SpellsDialog(XeenEngine *vm) : ButtonContainer(), _vm(vm) {}
+ SpellsDialog(XeenEngine *vm) : ButtonContainer(vm) {}
Character *execute(ButtonContainer *priorDialog, Character *c, int isCasting);
@@ -60,10 +59,9 @@ public:
class CastSpell : public ButtonContainer {
private:
- XeenEngine *_vm;
SpriteResource _iconSprites;
- CastSpell(XeenEngine *vm) : ButtonContainer(), _vm(vm) {}
+ CastSpell(XeenEngine *vm) : ButtonContainer(vm) {}
int execute(Character *&c);
@@ -75,9 +73,7 @@ public:
class SpellOnWho : public ButtonContainer {
private:
- XeenEngine *_vm;
-
- SpellOnWho(XeenEngine *vm) : ButtonContainer(), _vm(vm) {}
+ SpellOnWho(XeenEngine *vm) : ButtonContainer(vm) {}
int execute(int spellId);
public:
@@ -86,10 +82,9 @@ public:
class SelectElement : public ButtonContainer {
private:
- XeenEngine *_vm;
SpriteResource _iconSprites;
- SelectElement(XeenEngine *vm) : ButtonContainer(), _vm(vm) {}
+ SelectElement(XeenEngine *vm) : ButtonContainer(vm) {}
int execute(int spellId);
@@ -100,9 +95,7 @@ public:
class NotWhileEngaged : public ButtonContainer {
private:
- XeenEngine *_vm;
-
- NotWhileEngaged(XeenEngine *vm) : ButtonContainer(), _vm(vm) {}
+ NotWhileEngaged(XeenEngine *vm) : ButtonContainer(vm) {}
void execute(int spellId);
public:
@@ -111,10 +104,9 @@ public:
class LloydsBeacon : public ButtonContainer {
private:
- XeenEngine *_vm;
SpriteResource _iconSprites;
- LloydsBeacon(XeenEngine *vm) : ButtonContainer(), _vm(vm) {}
+ LloydsBeacon(XeenEngine *vm) : ButtonContainer(vm) {}
bool execute();
@@ -125,10 +117,9 @@ public:
class Teleport : public ButtonContainer {
private:
- XeenEngine *_vm;
SpriteResource _iconSprites;
- Teleport(XeenEngine *vm) : ButtonContainer(), _vm(vm) {}
+ Teleport(XeenEngine *vm) : ButtonContainer(vm) {}
int execute();
public:
@@ -137,9 +128,7 @@ public:
class TownPortal : public ButtonContainer {
private:
- XeenEngine *_vm;
-
- TownPortal(XeenEngine *vm) : ButtonContainer(), _vm(vm) {}
+ TownPortal(XeenEngine *vm) : ButtonContainer(vm) {}
int execute();
public:
@@ -148,9 +137,7 @@ public:
class IdentifyMonster : public ButtonContainer {
private:
- XeenEngine *_vm;
-
- IdentifyMonster(XeenEngine *vm) : ButtonContainer(), _vm(vm) {}
+ IdentifyMonster(XeenEngine *vm) : ButtonContainer(vm) {}
void execute();
public:
diff --git a/engines/xeen/dialogs_whowill.cpp b/engines/xeen/dialogs_whowill.cpp
index fd72154cba..4192ea8a4a 100644
--- a/engines/xeen/dialogs_whowill.cpp
+++ b/engines/xeen/dialogs_whowill.cpp
@@ -51,9 +51,9 @@ int WhoWill::execute(int message, int action, bool type) {
screen._windows[38].close();
screen._windows[12].close();
- Common::String actionStr = type ? map._events._text[action] : WHO_WILL_ACTIONS[action];
- Common::String msg = Common::String::format(WHO_WILL, actionStr.c_str(),
- WHO_ACTIONS[message], party._activeParty.size());
+ Common::String actionStr = type ? map._events._text[action] : Res.WHO_WILL_ACTIONS[action];
+ Common::String msg = Common::String::format(Res.WHO_WILL, actionStr.c_str(),
+ Res.WHO_ACTIONS[message], party._activeParty.size());
screen._windows[36].open();
screen._windows[36].writeString(msg);
@@ -76,7 +76,7 @@ int WhoWill::execute(int message, int action, bool type) {
numFrames = 1;
}
- events.wait(numFrames, true);
+ events.wait(numFrames);
checkEvents(_vm);
if (!_buttonValue)
continue;
diff --git a/engines/xeen/dialogs_whowill.h b/engines/xeen/dialogs_whowill.h
index 8080c36ddb..8018cbb0ef 100644
--- a/engines/xeen/dialogs_whowill.h
+++ b/engines/xeen/dialogs_whowill.h
@@ -29,9 +29,7 @@ namespace Xeen {
class WhoWill : public ButtonContainer {
private:
- XeenEngine *_vm;
-
- WhoWill(XeenEngine *vm) : ButtonContainer(), _vm(vm) {}
+ WhoWill(XeenEngine *vm) : ButtonContainer(vm) {}
int execute(int message, int action, bool type);
public:
diff --git a/engines/xeen/events.cpp b/engines/xeen/events.cpp
index e50d689d9f..f89164903c 100644
--- a/engines/xeen/events.cpp
+++ b/engines/xeen/events.cpp
@@ -150,7 +150,7 @@ bool EventsManager::wait(uint numFrames, bool interruptable) {
return true;
}
- return false;
+ return _vm->shouldQuit();
}
void EventsManager::ipause(uint amount) {
diff --git a/engines/xeen/events.h b/engines/xeen/events.h
index 7847ecd81c..36ef939004 100644
--- a/engines/xeen/events.h
+++ b/engines/xeen/events.h
@@ -105,8 +105,9 @@ public:
uint32 timeElapsed3() const { return _frameCounter - _gameCounters[3]; }
uint32 timeElapsed4() const { return _frameCounter - _gameCounters[4]; }
uint32 timeElapsed5() const { return _frameCounter - _gameCounters[5]; }
+ uint32 getTicks() { return _frameCounter; }
- bool wait(uint numFrames, bool interruptable = false);
+ bool wait(uint numFrames, bool interruptable = true);
void ipause(uint amount);
};
diff --git a/engines/xeen/files.cpp b/engines/xeen/files.cpp
index bcee6bf9f6..ff4a56fcb0 100644
--- a/engines/xeen/files.cpp
+++ b/engines/xeen/files.cpp
@@ -183,37 +183,78 @@ Common::SeekableReadStream *CCArchive::createReadStreamForMember(const Common::S
/*------------------------------------------------------------------------*/
+CCArchive *FileManager::_archives[3];
+
FileManager::FileManager(XeenEngine *vm) {
Common::File f;
int sideNum = 0;
+ File::_currentArchive = ANY_ARCHIVE;
_isDarkCc = vm->getGameID() == GType_DarkSide;
- _sideArchives[0] = _sideArchives[1] = nullptr;
+ _archives[0] = _archives[1] = _archives[2] = nullptr;
if (vm->getGameID() != GType_DarkSide) {
- _sideArchives[0] = new CCArchive("xeen.cc", "xeen", true);
- SearchMan.add("xeen", _sideArchives[0]);
+ _archives[0] = new CCArchive("xeen.cc", "xeen", true);
+ SearchMan.add("xeen", _archives[0]);
sideNum = 1;
}
if (vm->getGameID() == GType_DarkSide || vm->getGameID() == GType_WorldOfXeen) {
- _sideArchives[sideNum] = new CCArchive("dark.cc", "dark", true);
- SearchMan.add("dark", _sideArchives[sideNum]);
+ _archives[sideNum] = new CCArchive("dark.cc", "dark", true);
+ SearchMan.add("dark", _archives[sideNum]);
+ }
+
+ if (f.exists("intro.cc")) {
+ _archives[2] = new CCArchive("intro.cc", "intro", true);
+ SearchMan.add("intro", _archives[2]);
}
+}
- SearchMan.add("intro", new CCArchive("intro.cc", "intro", true));
+void FileManager::setGameCc(bool isDarkCc) {
+ _isDarkCc = isDarkCc;
+ File::_currentArchive = isDarkCc ? ALTSIDE_ARCHIVE : GAME_ARCHIVE;
}
/*------------------------------------------------------------------------*/
-void File::openFile(const Common::String &filename) {
- if (!Common::File::open(filename))
+ArchiveType File::_currentArchive;
+
+File::File(const Common::String &filename) {
+ File::open(filename);
+}
+
+File::File(const Common::String &filename, ArchiveType archiveType) {
+ File::open(filename, archiveType);
+}
+
+File::File(const Common::String &filename, Common::Archive &archive) {
+ File::open(filename, archive);
+}
+
+bool File::open(const Common::String &filename) {
+ return File::open(filename, _currentArchive);
+}
+
+bool File::open(const Common::String &filename, ArchiveType archiveType) {
+ if (archiveType == ANY_ARCHIVE) {
+ Common::File::open(filename);
+ } else {
+ CCArchive &archive = *FileManager::_archives[archiveType];
+ if (!Common::File::open(filename, archive))
+ // If not in the designated archive, try opening from any archive,
+ // or as a standalone file in the filesystem
+ Common::File::open(filename);
+ }
+
+ if (!isOpen())
error("Could not open file - %s", filename.c_str());
+ return true;
}
-void File::openFile(const Common::String &filename, Common::Archive &archive) {
+bool File::open(const Common::String &filename, Common::Archive &archive) {
if (!Common::File::open(filename, archive))
error("Could not open file - %s", filename.c_str());
+ return true;
}
Common::String File::readString() {
@@ -226,5 +267,18 @@ Common::String File::readString() {
return result;
}
+/*------------------------------------------------------------------------*/
+
+void StringArray::load(const Common::String &name) {
+ load(name, ANY_ARCHIVE);
+}
+
+void StringArray::load(const Common::String &name, ArchiveType archiveType) {
+ File f(name, archiveType);
+ clear();
+ while (f.pos() < f.size())
+ push_back(f.readString());
+}
+
} // End of namespace Xeen
diff --git a/engines/xeen/files.h b/engines/xeen/files.h
index fc75031a72..d73eb281c6 100644
--- a/engines/xeen/files.h
+++ b/engines/xeen/files.h
@@ -27,13 +27,19 @@
#include "common/array.h"
#include "common/file.h"
#include "common/serializer.h"
+#include "common/str-array.h"
#include "graphics/surface.h"
-#include "xeen/xsurface.h"
namespace Xeen {
+enum ArchiveType {
+ ANY_ARCHIVE = -1, GAME_ARCHIVE = 0, ALTSIDE_ARCHIVE = 1,
+ INTRO_ARCHIVE = 2
+};
+
class XeenEngine;
class CCArchive;
+class File;
#define SYNC_AS(SUFFIX,STREAM,TYPE,SIZE) \
template<typename T> \
@@ -48,20 +54,26 @@ class CCArchive;
} \
_bytesSynced += SIZE; \
}
+
/*
* Main resource manager
*/
class FileManager {
+ friend class File;
+private:
+ static CCArchive *_archives[3];
public:
bool _isDarkCc;
- CCArchive *_sideArchives[2];
public:
/**
* Instantiates the resource manager
*/
FileManager(XeenEngine *vm);
- void setGameCc(bool isDarkCc) { _isDarkCc = isDarkCc; }
+ /**
+ * Set which game side files to use
+ */
+ void setGameCc(bool isDarkCc);
};
/**
@@ -69,26 +81,67 @@ public:
*/
class File : public Common::File {
public:
+ static ArchiveType _currentArchive;
+
+ /**
+ * Sets which archive is used by default
+ */
+ static void setCurrentArchive(ArchiveType arcType) { _currentArchive = arcType; }
+public:
File() : Common::File() {}
- File(const Common::String &filename) { openFile(filename); }
- File(const Common::String &filename, Common::Archive &archive) {
- openFile(filename, archive);
- }
+ File(const Common::String &filename);
+ File(const Common::String &filename, ArchiveType archiveType);
+ File(const Common::String &filename, Common::Archive &archive);
virtual ~File() {}
/**
* Opens the given file, throwing an error if it can't be opened
*/
- void openFile(const Common::String &filename);
+ virtual bool open(const Common::String &filename);
+
+ /**
+ * Opens the given file, throwing an error if it can't be opened
+ */
+ virtual bool open(const Common::String &filename, ArchiveType archiveType);
/**
* Opens the given file, throwing an error if it can't be opened
*/
- void openFile(const Common::String &filename, Common::Archive &archive);
+ virtual bool open(const Common::String &filename, Common::Archive &archive);
+
+ /**
+ * Opens the given file
+ */
+ virtual bool open(const Common::FSNode &node) {
+ return Common::File::open(node);
+ }
+
+ /**
+ * Opens the given file
+ */
+ virtual bool open(SeekableReadStream *stream, const Common::String &name) {
+ return Common::File::open(stream, name);
+ }
Common::String readString();
};
+class StringArray : public Common::StringArray {
+public:
+ StringArray() {}
+ StringArray(const Common::String &name) { load(name); }
+
+ /**
+ * Loads a string array from the specified file
+ */
+ void load(const Common::String &name);
+
+ /**
+ * Loads a string array from the specified file
+ */
+ void load(const Common::String &name, ArchiveType archiveType);
+};
+
class XeenSerializer : public Common::Serializer {
private:
Common::SeekableReadStream *_in;
diff --git a/engines/xeen/font.cpp b/engines/xeen/font.cpp
index 87e16b5bdd..459a334da0 100644
--- a/engines/xeen/font.cpp
+++ b/engines/xeen/font.cpp
@@ -38,7 +38,7 @@ FontSurface::FontSurface(int wv, int hv) : XSurface(wv, hv), _fontData(nullptr),
}
void FontSurface::writeSymbol(int symbolId) {
- const byte *srcP = &SYMBOLS[symbolId][0];
+ const byte *srcP = &Res.SYMBOLS[symbolId][0];
for (int yp = 0; yp < FONT_HEIGHT; ++yp) {
byte *destP = (byte *)getBasePtr(_writePos.x, _writePos.y + yp);
@@ -306,7 +306,7 @@ int FontSurface::fontAtoi(int len) {
}
void FontSurface::setTextColor(int idx) {
- const byte *colP = &TEXT_COLORS[idx][0];
+ const byte *colP = &Res.TEXT_COLORS[idx][0];
Common::copy(colP, colP + 4, &_textColors[0]);
}
diff --git a/engines/xeen/interface.cpp b/engines/xeen/interface.cpp
index 9aca904fb8..3c3b572518 100644
--- a/engines/xeen/interface.cpp
+++ b/engines/xeen/interface.cpp
@@ -59,13 +59,13 @@ void PartyDrawer::drawParty(bool updateFlag) {
for (uint idx = 0; idx < partyCount; ++idx) {
Character &ps = inCombat ? *combat._combatParty[idx] : party._activeParty[idx];
Condition charCondition = ps.worstCondition();
- int charFrame = FACE_CONDITION_FRAMES[charCondition];
+ int charFrame = Res.FACE_CONDITION_FRAMES[charCondition];
SpriteResource *sprites = (charFrame > 4) ? &_dseFace : ps._faceSprites;
if (charFrame > 4)
charFrame -= 5;
- sprites->draw(screen, charFrame, Common::Point(CHAR_FACES_X[idx], 150));
+ sprites->draw(screen, charFrame, Common::Point(Res.CHAR_FACES_X[idx], 150));
}
for (uint idx = 0; idx < partyCount; ++idx) {
@@ -85,11 +85,11 @@ void PartyDrawer::drawParty(bool updateFlag) {
else
frame = 1;
- _hpSprites.draw(screen, frame, Common::Point(HP_BARS_X[idx], 182));
+ _hpSprites.draw(screen, frame, Common::Point(Res.HP_BARS_X[idx], 182));
}
if (_hiliteChar != -1)
- res._globalSprites.draw(screen, 8, Common::Point(CHAR_FACES_X[_hiliteChar] - 1, 149));
+ res._globalSprites.draw(screen, 8, Common::Point(Res.CHAR_FACES_X[_hiliteChar] - 1, 149));
if (updateFlag)
screen._windows[33].update();
@@ -103,11 +103,11 @@ void PartyDrawer::highlightChar(int charId) {
// Handle deselecting any previusly selected char
if (_hiliteChar != -1) {
res._globalSprites.draw(screen, 9 + _hiliteChar,
- Common::Point(CHAR_FACES_X[_hiliteChar] - 1, 149));
+ Common::Point(Res.CHAR_FACES_X[_hiliteChar] - 1, 149));
}
// Highlight new character
- res._globalSprites.draw(screen, 8, Common::Point(CHAR_FACES_X[charId] - 1, 149));
+ res._globalSprites.draw(screen, 8, Common::Point(Res.CHAR_FACES_X[charId] - 1, 149));
_hiliteChar = charId;
screen._windows[33].update();
}
@@ -119,7 +119,7 @@ void PartyDrawer::unhighlightChar() {
if (_hiliteChar != -1) {
res._globalSprites.draw(screen, _hiliteChar + 9,
- Common::Point(CHAR_FACES_X[_hiliteChar] - 1, 149));
+ Common::Point(Res.CHAR_FACES_X[_hiliteChar] - 1, 149));
_hiliteChar = -1;
screen._windows[33].update();
}
@@ -130,7 +130,7 @@ void PartyDrawer::resetHighlight() {
}
/*------------------------------------------------------------------------*/
-Interface::Interface(XeenEngine *vm) : ButtonContainer(), InterfaceMap(vm),
+Interface::Interface(XeenEngine *vm) : ButtonContainer(vm), InterfaceMap(vm),
PartyDrawer(vm), _vm(vm) {
_buttonsLoaded = false;
_intrIndex1 = 0;
@@ -286,7 +286,7 @@ void Interface::perform() {
if (_buttonValue == Common::KEYCODE_SPACE) {
int lookupId = map.mazeLookup(party._mazePosition,
- WALL_SHIFTS[party._mazeDirection][2]);
+ Res.WALL_SHIFTS[party._mazeDirection][2]);
bool eventsFlag = true;
switch (lookupId) {
@@ -1033,7 +1033,7 @@ void Interface::rest() {
if ((map._currentCantRest || (map.mazeData()._mazeFlags & RESTRICTION_REST))
&& _vm->_mode != MODE_12) {
- ErrorScroll::show(_vm, TOO_DANGEROUS_TO_REST, WT_NONFREEZED_WAIT);
+ ErrorScroll::show(_vm, Res.TOO_DANGEROUS_TO_REST, WT_NONFREEZED_WAIT);
} else {
// Check whether any character is in danger of dying
bool dangerFlag = false;
@@ -1045,7 +1045,7 @@ void Interface::rest() {
}
if (dangerFlag) {
- if (!Confirm::show(_vm, SOME_CHARS_MAY_DIE))
+ if (!Confirm::show(_vm, Res.SOME_CHARS_MAY_DIE))
return;
}
@@ -1077,39 +1077,35 @@ void Interface::rest() {
if (_vm->getRandomNumber(1, 20) == 1) {
// Show dream
screen.saveBackground();
- screen.fadeOut(4);
+ screen.fadeOut();
events.hideCursor();
screen.loadBackground("scene1.raw");
screen._windows[0].update();
- screen.fadeIn(4);
+ screen.fadeIn();
events.updateGameCounter();
while (!_vm->shouldQuit() && events.timeElapsed() < 7)
events.pollEventsAndWait();
- File f("dreams2.voc");
- sound.playSample(&f, 1);
- while (!_vm->shouldQuit() && sound.playSample(1, 0))
+ sound.playSound("dreams2.voc", 1);
+ while (!_vm->shouldQuit() && sound.isPlaying())
events.pollEventsAndWait();
- f.close();
- f.openFile("laff1.voc");
- sound.playSample(&f, 1);
- while (!_vm->shouldQuit() && sound.playSample(1, 0))
+ sound.playSound("laff1.voc", 1);
+ while (!_vm->shouldQuit() && sound.isPlaying())
events.pollEventsAndWait();
- f.close();
events.updateGameCounter();
while (!_vm->shouldQuit() && events.timeElapsed() < 7)
events.pollEventsAndWait();
- screen.fadeOut(4);
+ screen.fadeOut();
events.setCursor(0);
screen.restoreBackground();
screen._windows[0].update();
- screen.fadeIn(4);
+ screen.fadeIn();
}
party.resetTemps();
@@ -1146,8 +1142,8 @@ void Interface::rest() {
doStepCode();
draw3d(true);
- ErrorScroll::show(_vm, Common::String::format(REST_COMPLETE,
- starving ? PARTY_IS_STARVING : HIT_SPELL_POINTS_RESTORED,
+ ErrorScroll::show(_vm, Common::String::format(Res.REST_COMPLETE,
+ starving ? Res.PARTY_IS_STARVING : Res.HIT_SPELL_POINTS_RESTORED,
foodConsumed));
party.checkPartyDead();
}
@@ -1183,18 +1179,18 @@ void Interface::bash(const Common::Point &pt, Direction direction) {
party._activeParty[charNum1 - 1].subtractHitPoints(2);
_charPowSprites.draw(screen._windows[0], 0,
- Common::Point(CHAR_FACES_X[charNum1 - 1], 150));
+ Common::Point(Res.CHAR_FACES_X[charNum1 - 1], 150));
screen._windows[0].update();
if (charNum2) {
party._activeParty[charNum2 - 1].subtractHitPoints(2);
_charPowSprites.draw(screen._windows[0], 0,
- Common::Point(CHAR_FACES_X[charNum2 - 1], 150));
+ Common::Point(Res.CHAR_FACES_X[charNum2 - 1], 150));
screen._windows[0].update();
}
- int cell = map.mazeLookup(Common::Point(pt.x + SCREEN_POSITIONING_X[direction][7],
- pt.y + SCREEN_POSITIONING_Y[direction][7]), 0, 0xffff);
+ int cell = map.mazeLookup(Common::Point(pt.x + Res.SCREEN_POSITIONING_X[direction][7],
+ pt.y + Res.SCREEN_POSITIONING_Y[direction][7]), 0, 0xffff);
if (cell != INVALID_CELL) {
int v = map.getCell(2);
@@ -1304,7 +1300,7 @@ void Interface::draw3d(bool updateFlag, bool skipDelay) {
}
if (!skipDelay)
- events.wait(2);
+ events.wait(2, false);
}
void Interface::handleFalling() {
@@ -1312,18 +1308,16 @@ void Interface::handleFalling() {
Screen &screen = *_vm->_screen;
Sound &sound = *_vm->_sound;
Window &w = screen._windows[3];
- File voc1("scream.voc");
- File voc2("unnh.voc");
saveFall();
for (uint idx = 0; idx < party._activeParty.size(); ++idx) {
party._activeParty[idx]._faceSprites->draw(screen._windows[0], 4,
- Common::Point(CHAR_FACES_X[idx], 150));
+ Common::Point(Res.CHAR_FACES_X[idx], 150));
}
screen._windows[33].update();
sound.playFX(11);
- sound.playSample(&voc1, 0);
+ sound.playSound("scream.voc");
for (int idx = 0, incr = 2; idx < 133; ++incr, idx += incr) {
fall(idx);
@@ -1335,8 +1329,8 @@ void Interface::handleFalling() {
assembleBorder();
w.update();
- sound.playSample(nullptr, 0);
- sound.playSample(&voc2, 0);
+ sound.stopSound();
+ sound.playSound("unnh.voc");
sound.playFX(31);
fall(127);
@@ -1435,8 +1429,7 @@ void Interface::drawMiniMap() {
// Draw the direction arrow
res._globalSprites.draw(window1, party._mazeDirection + 1,
Common::Point(267, 36));
- }
- else {
+ } else {
frame2 = (frame2 + 2) % 8;
// First draw the default surface bases for each cell to show
@@ -1847,7 +1840,7 @@ void Interface::assembleBorder() {
// Draw direction character if direction sense is active
if (_vm->_party->checkSkill(DIRECTION_SENSE) && !_vm->_noDirectionSense) {
- const char *dirText = DIRECTION_TEXT_UPPER[_vm->_party->_mazeDirection];
+ const char *dirText = Res.DIRECTION_TEXT_UPPER[_vm->_party->_mazeDirection];
Common::String msg = Common::String::format(
"\002""08\003""c\013""139\011""116%c\014""d\001", *dirText);
screen._windows[0].writeString(msg);
@@ -2274,13 +2267,13 @@ void Interface::spellFX(Character *c) {
for (int frameNum = 0; frameNum < 4; ++frameNum) {
events.updateGameCounter();
_spellFxSprites.draw(screen, frameNum, Common::Point(
- CHAR_FACES_X[charIndex], 150));
+ Res.CHAR_FACES_X[charIndex], 150));
if (!screen._windows[11]._enabled)
draw3d(false);
screen._windows[0].update();
- events.wait(screen._windows[11]._enabled ? 2 : 1);
+ events.wait(screen._windows[11]._enabled ? 2 : 1,false);
}
drawParty(true);
diff --git a/engines/xeen/interface_map.cpp b/engines/xeen/interface_map.cpp
index af39f38c28..0244e3e081 100644
--- a/engines/xeen/interface_map.cpp
+++ b/engines/xeen/interface_map.cpp
@@ -402,7 +402,7 @@ void InterfaceMap::drawMap() {
for (uint idx = 0; idx < map._mobData._objects.size(); ++idx) {
MazeObject &mazeObject = map._mobData._objects[idx];
AnimationEntry &animEntry = map._animationInfo[mazeObject._spriteId];
- int directionIndex = DIRECTION_ANIM_POSITIONS[mazeObject._direction][partyDirection];
+ int directionIndex = Res.DIRECTION_ANIM_POSITIONS[mazeObject._direction][partyDirection];
if (_isAnimReset) {
mazeObject._frame = animEntry._frame1._frames[directionIndex];
@@ -413,8 +413,7 @@ void InterfaceMap::drawMap() {
objObject._spriteId == 58 || objObject._spriteId == 73)) {
if (mazeObject._frame > 4 || mazeObject._spriteId == 58)
mazeObject._frame = 1;
- }
- else if (mazeObject._frame >= animEntry._frame2._frames[directionIndex]) {
+ } else if (mazeObject._frame >= animEntry._frame2._frames[directionIndex]) {
mazeObject._frame = animEntry._frame1._frames[directionIndex];
}
}
@@ -425,7 +424,7 @@ void InterfaceMap::drawMap() {
if (map._isOutdoors) {
// Outdoors drawing
for (int idx = 0; idx < 44; ++idx)
- _outdoorList[OUTDOOR_DRAWSTRCT_INDEXES[idx]]._frame = -1;
+ _outdoorList[Res.OUTDOOR_DRAWSTRCT_INDEXES[idx]]._frame = -1;
if (combat._monstersAttacking) {
for (int idx = 0; idx < 8; ++idx) {
@@ -2318,40 +2317,40 @@ void InterfaceMap::setIndoorsMonsters() {
}
// The following long sequence sets up monsters in the various positions
- if (monster._position.x == (mazePos.x + SCREEN_POSITIONING_X[dir][2]) &&
- monster._position.y == (mazePos.y + SCREEN_POSITIONING_Y[dir][2])) {
+ if (monster._position.x == (mazePos.x + Res.SCREEN_POSITIONING_X[dir][2]) &&
+ monster._position.y == (mazePos.y + Res.SCREEN_POSITIONING_Y[dir][2])) {
monster._isAttacking = true;
if (combat._attackMonsters[0] == -1) {
combat._attackMonsters[0] = monsterIdx;
- setMonsterSprite(_indoorList[156], monster, sprites, frame, INDOOR_MONSTERS_Y[0]);
+ setMonsterSprite(_indoorList[156], monster, sprites, frame, Res.INDOOR_MONSTERS_Y[0]);
} else if (combat._attackMonsters[1] == -1) {
combat._attackMonsters[1] = monsterIdx;
- setMonsterSprite(_indoorList[150], monster, sprites, frame, INDOOR_MONSTERS_Y[0]);
+ setMonsterSprite(_indoorList[150], monster, sprites, frame, Res.INDOOR_MONSTERS_Y[0]);
} else if (combat._attackMonsters[2] == -1) {
combat._attackMonsters[2] = monsterIdx;
- setMonsterSprite(_indoorList[153], monster, sprites, frame, INDOOR_MONSTERS_Y[0]);
+ setMonsterSprite(_indoorList[153], monster, sprites, frame, Res.INDOOR_MONSTERS_Y[0]);
}
}
- if (monster._position.x == (mazePos.x + SCREEN_POSITIONING_X[dir][7]) &&
- monster._position.y == (mazePos.y + SCREEN_POSITIONING_Y[dir][7])) {
+ if (monster._position.x == (mazePos.x + Res.SCREEN_POSITIONING_X[dir][7]) &&
+ monster._position.y == (mazePos.y + Res.SCREEN_POSITIONING_Y[dir][7])) {
monster._isAttacking = true;
if (!_wo[27]) {
if (combat._attackMonsters[3] == -1) {
combat._attackMonsters[3] = monsterIdx;
- setMonsterSprite(_indoorList[132], monster, sprites, frame, INDOOR_MONSTERS_Y[1]);
+ setMonsterSprite(_indoorList[132], monster, sprites, frame, Res.INDOOR_MONSTERS_Y[1]);
} else if (combat._attackMonsters[4] == -1) {
combat._attackMonsters[4] = monsterIdx;
- setMonsterSprite(_indoorList[130], monster, sprites, frame, INDOOR_MONSTERS_Y[1]);
+ setMonsterSprite(_indoorList[130], monster, sprites, frame, Res.INDOOR_MONSTERS_Y[1]);
} else if (combat._attackMonsters[2] == -1) {
combat._attackMonsters[5] = monsterIdx;
- setMonsterSprite(_indoorList[131], monster, sprites, frame, INDOOR_MONSTERS_Y[1]);
+ setMonsterSprite(_indoorList[131], monster, sprites, frame, Res.INDOOR_MONSTERS_Y[1]);
}
}
}
- if (monster._position.x == (mazePos.x + SCREEN_POSITIONING_X[dir][5]) &&
- monster._position.y == (mazePos.y + SCREEN_POSITIONING_Y[dir][5])) {
+ if (monster._position.x == (mazePos.x + Res.SCREEN_POSITIONING_X[dir][5]) &&
+ monster._position.y == (mazePos.y + Res.SCREEN_POSITIONING_Y[dir][5])) {
if (_wo[27] && _wo[25]) {
} else if (_wo[27] && _wo[28]) {
} else if (_wo[23] & _wo[25]) {
@@ -2361,13 +2360,13 @@ void InterfaceMap::setIndoorsMonsters() {
if (combat._attackMonsters[12] == -1) {
combat._attackMonsters[12] = monsterIdx;
- setMonsterSprite(_indoorList[128], monster, sprites, frame, INDOOR_MONSTERS_Y[1]);
+ setMonsterSprite(_indoorList[128], monster, sprites, frame, Res.INDOOR_MONSTERS_Y[1]);
}
}
}
- if (monster._position.x == (mazePos.x + SCREEN_POSITIONING_X[dir][9]) &&
- monster._position.y == (mazePos.y + SCREEN_POSITIONING_Y[dir][9])) {
+ if (monster._position.x == (mazePos.x + Res.SCREEN_POSITIONING_X[dir][9]) &&
+ monster._position.y == (mazePos.y + Res.SCREEN_POSITIONING_Y[dir][9])) {
if (_wo[27] && _wo[26]) {
} else if (_wo[27] && _wo[29]) {
} else if (_wo[24] & _wo[26]) {
@@ -2377,31 +2376,31 @@ void InterfaceMap::setIndoorsMonsters() {
if (combat._attackMonsters[13] == -1) {
combat._attackMonsters[13] = monsterIdx;
- setMonsterSprite(_indoorList[129], monster, sprites, frame, INDOOR_MONSTERS_Y[1]);
+ setMonsterSprite(_indoorList[129], monster, sprites, frame, Res.INDOOR_MONSTERS_Y[1]);
}
}
}
- if (monster._position.x == (mazePos.x + SCREEN_POSITIONING_X[dir][14]) &&
- monster._position.y == (mazePos.y + SCREEN_POSITIONING_Y[dir][14])) {
+ if (monster._position.x == (mazePos.x + Res.SCREEN_POSITIONING_X[dir][14]) &&
+ monster._position.y == (mazePos.y + Res.SCREEN_POSITIONING_Y[dir][14])) {
monster._isAttacking = true;
if (!_wo[22] && !_wo[27]) {
if (combat._attackMonsters[6] == -1) {
combat._attackMonsters[6] = monsterIdx;
- setMonsterSprite(_indoorList[106], monster, sprites, frame, INDOOR_MONSTERS_Y[2]);
+ setMonsterSprite(_indoorList[106], monster, sprites, frame, Res.INDOOR_MONSTERS_Y[2]);
} else if (combat._attackMonsters[7] == -1) {
combat._attackMonsters[7] = monsterIdx;
- setMonsterSprite(_indoorList[104], monster, sprites, frame, INDOOR_MONSTERS_Y[2]);
+ setMonsterSprite(_indoorList[104], monster, sprites, frame, Res.INDOOR_MONSTERS_Y[2]);
} else if (combat._attackMonsters[8] == -1) {
combat._attackMonsters[8] = monsterIdx;
- setMonsterSprite(_indoorList[105], monster, sprites, frame, INDOOR_MONSTERS_Y[2]);
+ setMonsterSprite(_indoorList[105], monster, sprites, frame, Res.INDOOR_MONSTERS_Y[2]);
}
}
}
- if (monster._position.x == (mazePos.x + SCREEN_POSITIONING_X[dir][12]) &&
- monster._position.y == (mazePos.y + SCREEN_POSITIONING_Y[dir][12])) {
+ if (monster._position.x == (mazePos.x + Res.SCREEN_POSITIONING_X[dir][12]) &&
+ monster._position.y == (mazePos.y + Res.SCREEN_POSITIONING_Y[dir][12])) {
if (_wo[27]) {
} else if (_wo[22] && _wo[23]) {
} else if (_wo[22] & _wo[20]) {
@@ -2411,16 +2410,16 @@ void InterfaceMap::setIndoorsMonsters() {
if (combat._attackMonsters[14] == -1) {
combat._attackMonsters[14] = monsterIdx;
- setMonsterSprite(_indoorList[100], monster, sprites, frame, INDOOR_MONSTERS_Y[2]);
+ setMonsterSprite(_indoorList[100], monster, sprites, frame, Res.INDOOR_MONSTERS_Y[2]);
} else if (combat._attackMonsters[20] == -1) {
combat._attackMonsters[20] = monsterIdx;
- setMonsterSprite(_indoorList[101], monster, sprites, frame, INDOOR_MONSTERS_Y[2]);
+ setMonsterSprite(_indoorList[101], monster, sprites, frame, Res.INDOOR_MONSTERS_Y[2]);
}
}
}
- if (monster._position.x == (mazePos.x + SCREEN_POSITIONING_X[dir][16]) &&
- monster._position.y == (mazePos.y + SCREEN_POSITIONING_Y[dir][16])) {
+ if (monster._position.x == (mazePos.x + Res.SCREEN_POSITIONING_X[dir][16]) &&
+ monster._position.y == (mazePos.y + Res.SCREEN_POSITIONING_Y[dir][16])) {
if (_wo[27]) {
} else if (_wo[22] && _wo[24]) {
} else if (_wo[22] & _wo[21]) {
@@ -2431,34 +2430,34 @@ void InterfaceMap::setIndoorsMonsters() {
if (combat._attackMonsters[15] == -1) {
combat._attackMonsters[15] = monsterIdx;
- setMonsterSprite(_indoorList[102], monster, sprites, frame, INDOOR_MONSTERS_Y[2]);
+ setMonsterSprite(_indoorList[102], monster, sprites, frame, Res.INDOOR_MONSTERS_Y[2]);
} else if (combat._attackMonsters[21] == -1) {
combat._attackMonsters[21] = monsterIdx;
- setMonsterSprite(_indoorList[103], monster, sprites, frame, INDOOR_MONSTERS_Y[2]);
+ setMonsterSprite(_indoorList[103], monster, sprites, frame, Res.INDOOR_MONSTERS_Y[2]);
}
}
}
- if (monster._position.x == (mazePos.x + SCREEN_POSITIONING_X[dir][27]) &&
- monster._position.y == (mazePos.y + SCREEN_POSITIONING_Y[dir][27])) {
+ if (monster._position.x == (mazePos.x + Res.SCREEN_POSITIONING_X[dir][27]) &&
+ monster._position.y == (mazePos.y + Res.SCREEN_POSITIONING_Y[dir][27])) {
if (!_wo[27] && !_wo[22] && !_wo[15]) {
monster._isAttacking = true;
if (combat._attackMonsters[9] == -1) {
combat._attackMonsters[9] = monsterIdx;
- setMonsterSprite(_indoorList[70], monster, sprites, frame, INDOOR_MONSTERS_Y[3]);
+ setMonsterSprite(_indoorList[70], monster, sprites, frame, Res.INDOOR_MONSTERS_Y[3]);
} else if (combat._attackMonsters[10] == -1) {
combat._attackMonsters[10] = monsterIdx;
- setMonsterSprite(_indoorList[68], monster, sprites, frame, INDOOR_MONSTERS_Y[3]);
+ setMonsterSprite(_indoorList[68], monster, sprites, frame, Res.INDOOR_MONSTERS_Y[3]);
} else if (combat._attackMonsters[11] == -1) {
combat._attackMonsters[11] = monsterIdx;
- setMonsterSprite(_indoorList[69], monster, sprites, frame, INDOOR_MONSTERS_Y[3]);
+ setMonsterSprite(_indoorList[69], monster, sprites, frame, Res.INDOOR_MONSTERS_Y[3]);
}
}
}
- if (monster._position.x == (mazePos.x + SCREEN_POSITIONING_X[dir][25]) &&
- monster._position.y == (mazePos.y + SCREEN_POSITIONING_Y[dir][25])) {
+ if (monster._position.x == (mazePos.x + Res.SCREEN_POSITIONING_X[dir][25]) &&
+ monster._position.y == (mazePos.y + Res.SCREEN_POSITIONING_Y[dir][25])) {
if (_wo[27] || _wo[22]) {
} else if (_wo[15] && _wo[17]) {
} else if (_wo[15] && _wo[12]) {
@@ -2469,19 +2468,19 @@ void InterfaceMap::setIndoorsMonsters() {
if (combat._attackMonsters[16] == -1) {
combat._attackMonsters[16] = monsterIdx;
- setMonsterSprite(_indoorList[62], monster, sprites, frame, INDOOR_MONSTERS_Y[3]);
+ setMonsterSprite(_indoorList[62], monster, sprites, frame, Res.INDOOR_MONSTERS_Y[3]);
} else if (combat._attackMonsters[22] == -1) {
combat._attackMonsters[22] = monsterIdx;
- setMonsterSprite(_indoorList[60], monster, sprites, frame, INDOOR_MONSTERS_Y[3]);
+ setMonsterSprite(_indoorList[60], monster, sprites, frame, Res.INDOOR_MONSTERS_Y[3]);
} else if (combat._attackMonsters[24] == -1) {
combat._attackMonsters[24] = monsterIdx;
- setMonsterSprite(_indoorList[61], monster, sprites, frame, INDOOR_MONSTERS_Y[3]);
+ setMonsterSprite(_indoorList[61], monster, sprites, frame, Res.INDOOR_MONSTERS_Y[3]);
}
}
}
- if (monster._position.x == (mazePos.x + SCREEN_POSITIONING_X[dir][23]) &&
- monster._position.y == (mazePos.y + SCREEN_POSITIONING_Y[dir][23])) {
+ if (monster._position.x == (mazePos.x + Res.SCREEN_POSITIONING_X[dir][23]) &&
+ monster._position.y == (mazePos.y + Res.SCREEN_POSITIONING_Y[dir][23])) {
if (_wo[27]) {
} else if (_wo[22] && _wo[20]) {
} else if (_wo[22] && _wo[23]) {
@@ -2493,13 +2492,13 @@ void InterfaceMap::setIndoorsMonsters() {
if (combat._attackMonsters[18] == -1) {
combat._attackMonsters[18] = monsterIdx;
- setMonsterSprite(_indoorList[66], monster, sprites, frame, INDOOR_MONSTERS_Y[3]);
+ setMonsterSprite(_indoorList[66], monster, sprites, frame, Res.INDOOR_MONSTERS_Y[3]);
}
}
}
- if (monster._position.x == (mazePos.x + SCREEN_POSITIONING_X[dir][29]) &&
- monster._position.y == (mazePos.y + SCREEN_POSITIONING_Y[dir][29])) {
+ if (monster._position.x == (mazePos.x + Res.SCREEN_POSITIONING_X[dir][29]) &&
+ monster._position.y == (mazePos.y + Res.SCREEN_POSITIONING_Y[dir][29])) {
if (_wo[27] || _wo[22]) {
} else if (_wo[15] && _wo[19]) {
} else if (_wo[15] && _wo[14]) {
@@ -2510,19 +2509,19 @@ void InterfaceMap::setIndoorsMonsters() {
if (combat._attackMonsters[17] == -1) {
combat._attackMonsters[17] = monsterIdx;
- setMonsterSprite(_indoorList[65], monster, sprites, frame, INDOOR_MONSTERS_Y[3]);
+ setMonsterSprite(_indoorList[65], monster, sprites, frame, Res.INDOOR_MONSTERS_Y[3]);
} else if (combat._attackMonsters[23] == -1) {
combat._attackMonsters[23] = monsterIdx;
- setMonsterSprite(_indoorList[63], monster, sprites, frame, INDOOR_MONSTERS_Y[3]);
+ setMonsterSprite(_indoorList[63], monster, sprites, frame, Res.INDOOR_MONSTERS_Y[3]);
} else if (combat._attackMonsters[25] == -1) {
combat._attackMonsters[25] = monsterIdx;
- setMonsterSprite(_indoorList[64], monster, sprites, frame, INDOOR_MONSTERS_Y[3]);
+ setMonsterSprite(_indoorList[64], monster, sprites, frame, Res.INDOOR_MONSTERS_Y[3]);
}
}
}
- if (monster._position.x == (mazePos.x + SCREEN_POSITIONING_X[dir][31]) &&
- monster._position.y == (mazePos.y + SCREEN_POSITIONING_Y[dir][31])) {
+ if (monster._position.x == (mazePos.x + Res.SCREEN_POSITIONING_X[dir][31]) &&
+ monster._position.y == (mazePos.y + Res.SCREEN_POSITIONING_Y[dir][31])) {
if (_wo[27]) {
} else if (_wo[22] && _wo[21]) {
} else if (_wo[22] && _wo[24]) {
@@ -2534,13 +2533,13 @@ void InterfaceMap::setIndoorsMonsters() {
if (combat._attackMonsters[19] == -1) {
combat._attackMonsters[19] = monsterIdx;
- setMonsterSprite(_indoorList[67], monster, sprites, frame, INDOOR_MONSTERS_Y[3]);
+ setMonsterSprite(_indoorList[67], monster, sprites, frame, Res.INDOOR_MONSTERS_Y[3]);
} else if (combat._attackMonsters[23] == -1) {
combat._attackMonsters[23] = monsterIdx;
- setMonsterSprite(_indoorList[63], monster, sprites, frame, INDOOR_MONSTERS_Y[3]);
+ setMonsterSprite(_indoorList[63], monster, sprites, frame, Res.INDOOR_MONSTERS_Y[3]);
} else if (combat._attackMonsters[25] == -1) {
combat._attackMonsters[25] = monsterIdx;
- setMonsterSprite(_indoorList[64], monster, sprites, frame, INDOOR_MONSTERS_Y[3]);
+ setMonsterSprite(_indoorList[64], monster, sprites, frame, Res.INDOOR_MONSTERS_Y[3]);
}
}
}
@@ -2619,15 +2618,15 @@ void InterfaceMap::setMonsterSprite(DrawStruct &drawStruct, MazeMonster &monster
drawStruct._y = defaultY;
if (flying) {
- drawStruct._x = COMBAT_FLOAT_X[_combatFloatCounter];
- drawStruct._y = COMBAT_FLOAT_Y[_combatFloatCounter];
+ drawStruct._x = Res.COMBAT_FLOAT_X[_combatFloatCounter];
+ drawStruct._y = Res.COMBAT_FLOAT_Y[_combatFloatCounter];
} else {
drawStruct._x = 0;
}
drawStruct._flags &= ~0xFFF;
if (monster._effect2)
- drawStruct._flags = MONSTER_EFFECT_FLAGS[monster._effect2][monster._effect3];
+ drawStruct._flags = Res.MONSTER_EFFECT_FLAGS[monster._effect2][monster._effect3];
}
void InterfaceMap::setIndoorsObjects() {
@@ -2649,11 +2648,11 @@ void InterfaceMap::setIndoorsObjects() {
}
// Position 1
- if ((mazePos.x + SCREEN_POSITIONING_X[dir][2]) == mazeObject._position.x
- && (mazePos.y + SCREEN_POSITIONING_Y[dir][2]) == mazeObject._position.y
+ if ((mazePos.x + Res.SCREEN_POSITIONING_X[dir][2]) == mazeObject._position.x
+ && (mazePos.y + Res.SCREEN_POSITIONING_Y[dir][2]) == mazeObject._position.y
&& _indoorList._objects0._frame == -1) {
- _indoorList._objects0._x = INDOOR_OBJECT_X[listOffset][0];
- _indoorList._objects0._y = MAP_OBJECT_Y[listOffset][0];
+ _indoorList._objects0._x = Res.INDOOR_OBJECT_X[listOffset][0];
+ _indoorList._objects0._y = Res.MAP_OBJECT_Y[listOffset][0];
_indoorList._objects0._frame = mazeObject._frame;
_indoorList._objects0._sprites = mazeObject._sprites;
_indoorList._objects0._flags &= ~SPRFLAG_HORIZ_FLIPPED;
@@ -2663,11 +2662,11 @@ void InterfaceMap::setIndoorsObjects() {
}
// Position 2
- if ((mazePos.x + SCREEN_POSITIONING_X[dir][7]) == mazeObject._position.x
- && (mazePos.y + SCREEN_POSITIONING_Y[dir][7]) == mazeObject._position.y
+ if ((mazePos.x + Res.SCREEN_POSITIONING_X[dir][7]) == mazeObject._position.x
+ && (mazePos.y + Res.SCREEN_POSITIONING_Y[dir][7]) == mazeObject._position.y
&& !_wo[27] && _indoorList._objects1._frame == -1) {
- _indoorList._objects1._x = INDOOR_OBJECT_X[listOffset][1];
- _indoorList._objects1._y = MAP_OBJECT_Y[listOffset][1];
+ _indoorList._objects1._x = Res.INDOOR_OBJECT_X[listOffset][1];
+ _indoorList._objects1._y = Res.MAP_OBJECT_Y[listOffset][1];
_indoorList._objects1._frame = mazeObject._frame;
_indoorList._objects1._sprites = mazeObject._sprites;
_indoorList._objects1._flags &= ~SPRFLAG_HORIZ_FLIPPED;
@@ -2676,15 +2675,15 @@ void InterfaceMap::setIndoorsObjects() {
}
// Position 3
- if ((mazePos.x + SCREEN_POSITIONING_X[dir][5]) == mazeObject._position.x
- && (mazePos.y + SCREEN_POSITIONING_Y[dir][5]) == mazeObject._position.y) {
+ if ((mazePos.x + Res.SCREEN_POSITIONING_X[dir][5]) == mazeObject._position.x
+ && (mazePos.y + Res.SCREEN_POSITIONING_Y[dir][5]) == mazeObject._position.y) {
if (_wo[27] && _wo[25]) {
} else if (_wo[27] && _wo[28]) {
} else if (_wo[23] && _wo[25]) {
} else if (_wo[23] && _wo[28]) {
} else if (_indoorList._objects2._frame == -1) {
- _indoorList._objects2._x = INDOOR_OBJECT_X[listOffset][2];
- _indoorList._objects2._y = MAP_OBJECT_Y[listOffset][2];
+ _indoorList._objects2._x = Res.INDOOR_OBJECT_X[listOffset][2];
+ _indoorList._objects2._y = Res.MAP_OBJECT_Y[listOffset][2];
_indoorList._objects2._frame = mazeObject._frame;
_indoorList._objects2._sprites = mazeObject._sprites;
_indoorList._objects2._flags &= ~SPRFLAG_HORIZ_FLIPPED;
@@ -2694,15 +2693,15 @@ void InterfaceMap::setIndoorsObjects() {
}
// Position 4
- if ((mazePos.x + SCREEN_POSITIONING_X[dir][9]) == mazeObject._position.x
- && (mazePos.y + SCREEN_POSITIONING_Y[dir][9]) == mazeObject._position.y) {
+ if ((mazePos.x + Res.SCREEN_POSITIONING_X[dir][9]) == mazeObject._position.x
+ && (mazePos.y + Res.SCREEN_POSITIONING_Y[dir][9]) == mazeObject._position.y) {
if (_wo[27] && _wo[26]) {
} else if (_wo[27] && _wo[29]) {
} else if (_wo[24] && _wo[26]) {
} else if (_wo[24] && _wo[29]) {
} else if (_indoorList._objects3._frame == -1) {
- _indoorList._objects3._x = INDOOR_OBJECT_X[listOffset][3];
- _indoorList._objects3._y = MAP_OBJECT_Y[listOffset][3];
+ _indoorList._objects3._x = Res.INDOOR_OBJECT_X[listOffset][3];
+ _indoorList._objects3._y = Res.MAP_OBJECT_Y[listOffset][3];
_indoorList._objects3._frame = mazeObject._frame;
_indoorList._objects3._sprites = mazeObject._sprites;
_indoorList._objects3._flags &= ~SPRFLAG_HORIZ_FLIPPED;
@@ -2712,11 +2711,11 @@ void InterfaceMap::setIndoorsObjects() {
}
// Position 5
- if ((mazePos.x + SCREEN_POSITIONING_X[dir][14]) == mazeObject._position.x
- && (mazePos.y + SCREEN_POSITIONING_Y[dir][14]) == mazeObject._position.y) {
+ if ((mazePos.x + Res.SCREEN_POSITIONING_X[dir][14]) == mazeObject._position.x
+ && (mazePos.y + Res.SCREEN_POSITIONING_Y[dir][14]) == mazeObject._position.y) {
if (!_wo[22] && !_wo[27] && _indoorList._objects4._frame == -1) {
- _indoorList._objects4._x = INDOOR_OBJECT_X[listOffset][4];
- _indoorList._objects4._y = MAP_OBJECT_Y[listOffset][4];
+ _indoorList._objects4._x = Res.INDOOR_OBJECT_X[listOffset][4];
+ _indoorList._objects4._y = Res.MAP_OBJECT_Y[listOffset][4];
_indoorList._objects4._frame = mazeObject._frame;
_indoorList._objects4._sprites = mazeObject._sprites;
_indoorList._objects4._flags &= ~SPRFLAG_HORIZ_FLIPPED;
@@ -2726,16 +2725,16 @@ void InterfaceMap::setIndoorsObjects() {
}
// Position 6
- if ((mazePos.x + SCREEN_POSITIONING_X[dir][12]) == mazeObject._position.x
- && (mazePos.y + SCREEN_POSITIONING_Y[dir][12]) == mazeObject._position.y) {
+ if ((mazePos.x + Res.SCREEN_POSITIONING_X[dir][12]) == mazeObject._position.x
+ && (mazePos.y + Res.SCREEN_POSITIONING_Y[dir][12]) == mazeObject._position.y) {
if (_wo[27]) {
} else if (_wo[22] && _wo[23]) {
} else if (_wo[22] && _wo[20]) {
} else if (_wo[23] && _wo[17]) {
} else if (_wo[20] && _wo[17]) {
} else if (_indoorList._objects5._frame == -1) {
- _indoorList._objects5._x = INDOOR_OBJECT_X[listOffset][5];
- _indoorList._objects5._y = MAP_OBJECT_Y[listOffset][5];
+ _indoorList._objects5._x = Res.INDOOR_OBJECT_X[listOffset][5];
+ _indoorList._objects5._y = Res.MAP_OBJECT_Y[listOffset][5];
_indoorList._objects5._frame = mazeObject._frame;
_indoorList._objects5._sprites = mazeObject._sprites;
_indoorList._objects5._flags &= ~SPRFLAG_HORIZ_FLIPPED;
@@ -2745,16 +2744,16 @@ void InterfaceMap::setIndoorsObjects() {
}
// Position 7
- if ((mazePos.x + SCREEN_POSITIONING_X[dir][16]) == mazeObject._position.x
- && (mazePos.y + SCREEN_POSITIONING_Y[dir][16]) == mazeObject._position.y) {
+ if ((mazePos.x + Res.SCREEN_POSITIONING_X[dir][16]) == mazeObject._position.x
+ && (mazePos.y + Res.SCREEN_POSITIONING_Y[dir][16]) == mazeObject._position.y) {
if (_wo[27]) {
} else if (_wo[22] && _wo[24]) {
} else if (_wo[22] && _wo[21]) {
} else if (_wo[24] && _wo[19]) {
} else if (_wo[21] && _wo[19]) {
} else if (_indoorList._objects6._frame == -1) {
- _indoorList._objects6._x = INDOOR_OBJECT_X[listOffset][6];
- _indoorList._objects6._y = MAP_OBJECT_Y[listOffset][6];
+ _indoorList._objects6._x = Res.INDOOR_OBJECT_X[listOffset][6];
+ _indoorList._objects6._y = Res.MAP_OBJECT_Y[listOffset][6];
_indoorList._objects6._frame = mazeObject._frame;
_indoorList._objects6._sprites = mazeObject._sprites;
_indoorList._objects6._flags &= ~SPRFLAG_HORIZ_FLIPPED;
@@ -2764,11 +2763,11 @@ void InterfaceMap::setIndoorsObjects() {
}
// Position 8
- if ((mazePos.x + SCREEN_POSITIONING_X[dir][27]) == mazeObject._position.x
- && (mazePos.y + SCREEN_POSITIONING_Y[dir][27]) == mazeObject._position.y) {
+ if ((mazePos.x + Res.SCREEN_POSITIONING_X[dir][27]) == mazeObject._position.x
+ && (mazePos.y + Res.SCREEN_POSITIONING_Y[dir][27]) == mazeObject._position.y) {
if (!_wo[27] && !_wo[22] && !_wo[15] && _indoorList._objects7._frame == -1) {
- _indoorList._objects7._x = INDOOR_OBJECT_X[listOffset][7];
- _indoorList._objects7._y = MAP_OBJECT_Y[listOffset][7];
+ _indoorList._objects7._x = Res.INDOOR_OBJECT_X[listOffset][7];
+ _indoorList._objects7._y = Res.MAP_OBJECT_Y[listOffset][7];
_indoorList._objects7._frame = mazeObject._frame;
_indoorList._objects7._sprites = mazeObject._sprites;
_indoorList._objects7._flags &= ~SPRFLAG_HORIZ_FLIPPED;
@@ -2778,16 +2777,16 @@ void InterfaceMap::setIndoorsObjects() {
}
// Position 9
- if ((mazePos.x + SCREEN_POSITIONING_X[dir][25]) == mazeObject._position.x
- && (mazePos.y + SCREEN_POSITIONING_Y[dir][25]) == mazeObject._position.y) {
+ if ((mazePos.x + Res.SCREEN_POSITIONING_X[dir][25]) == mazeObject._position.x
+ && (mazePos.y + Res.SCREEN_POSITIONING_Y[dir][25]) == mazeObject._position.y) {
if (_wo[27] || _wo[22]) {
} else if (_wo[15] && _wo[17]) {
} else if (_wo[15] && _wo[12]) {
} else if (_wo[12] && _wo[7]) {
} else if (_wo[17] && _wo[7]) {
} else if (_indoorList._objects8._frame == -1) {
- _indoorList._objects8._x = INDOOR_OBJECT_X[listOffset][8];
- _indoorList._objects8._y = MAP_OBJECT_Y[listOffset][8];
+ _indoorList._objects8._x = Res.INDOOR_OBJECT_X[listOffset][8];
+ _indoorList._objects8._y = Res.MAP_OBJECT_Y[listOffset][8];
_indoorList._objects8._frame = mazeObject._frame;
_indoorList._objects8._sprites = mazeObject._sprites;
_indoorList._objects8._flags &= ~SPRFLAG_HORIZ_FLIPPED;
@@ -2797,16 +2796,16 @@ void InterfaceMap::setIndoorsObjects() {
}
// Position 10
- if ((mazePos.x + SCREEN_POSITIONING_X[dir][23]) == mazeObject._position.x
- && (mazePos.y + SCREEN_POSITIONING_Y[dir][23]) == mazeObject._position.y) {
+ if ((mazePos.x + Res.SCREEN_POSITIONING_X[dir][23]) == mazeObject._position.x
+ && (mazePos.y + Res.SCREEN_POSITIONING_Y[dir][23]) == mazeObject._position.y) {
if (_wo[27]) {
} else if (_wo[22] && _wo[20]) {
} else if (_wo[22] && _wo[23]) {
} else if (_wo[20] && _wo[17]) {
} else if (_wo[23] && _wo[17]) {
} else if (!_wo[12] && !_wo[8] && _indoorList._objects9._frame == -1) {
- _indoorList._objects9._x = INDOOR_OBJECT_X[listOffset][10];
- _indoorList._objects9._y = MAP_OBJECT_Y[listOffset][10];
+ _indoorList._objects9._x = Res.INDOOR_OBJECT_X[listOffset][10];
+ _indoorList._objects9._y = Res.MAP_OBJECT_Y[listOffset][10];
_indoorList._objects9._frame = mazeObject._frame;
_indoorList._objects9._sprites = mazeObject._sprites;
_indoorList._objects9._flags &= ~SPRFLAG_HORIZ_FLIPPED;
@@ -2816,16 +2815,16 @@ void InterfaceMap::setIndoorsObjects() {
}
// Block 11
- if ((mazePos.x + SCREEN_POSITIONING_X[dir][29]) == mazeObject._position.x
- && (mazePos.y + SCREEN_POSITIONING_Y[dir][29]) == mazeObject._position.y) {
+ if ((mazePos.x + Res.SCREEN_POSITIONING_X[dir][29]) == mazeObject._position.x
+ && (mazePos.y + Res.SCREEN_POSITIONING_Y[dir][29]) == mazeObject._position.y) {
if (_wo[27]) {
} else if (_wo[15] && _wo[19]) {
} else if (_wo[15] && _wo[14]) {
} else if (_wo[14] && _wo[9]) {
} else if (_wo[19] && _wo[9]) {
} else if (_indoorList._objects10._frame == -1) {
- _indoorList._objects10._x = INDOOR_OBJECT_X[listOffset][9];
- _indoorList._objects10._y = MAP_OBJECT_Y[listOffset][9];
+ _indoorList._objects10._x = Res.INDOOR_OBJECT_X[listOffset][9];
+ _indoorList._objects10._y = Res.MAP_OBJECT_Y[listOffset][9];
_indoorList._objects10._frame = mazeObject._frame;
_indoorList._objects10._sprites = mazeObject._sprites;
_indoorList._objects10._flags &= ~SPRFLAG_HORIZ_FLIPPED;
@@ -2835,16 +2834,16 @@ void InterfaceMap::setIndoorsObjects() {
}
// Block 12
- if ((mazePos.x + SCREEN_POSITIONING_X[dir][31]) == mazeObject._position.x
- && (mazePos.y + SCREEN_POSITIONING_Y[dir][31]) == mazeObject._position.y) {
+ if ((mazePos.x + Res.SCREEN_POSITIONING_X[dir][31]) == mazeObject._position.x
+ && (mazePos.y + Res.SCREEN_POSITIONING_Y[dir][31]) == mazeObject._position.y) {
if (_wo[27]) {
} else if (_wo[22] && _wo[21]) {
} else if (_wo[22] && _wo[24]) {
} else if (_wo[21] && _wo[19]) {
} else if (_wo[24] && _wo[19]) {
} else if (!_wo[14] && !_wo[10] && _indoorList._objects11._frame == -1) {
- _indoorList._objects11._x = INDOOR_OBJECT_X[listOffset][11];
- _indoorList._objects11._y = MAP_OBJECT_Y[listOffset][11];
+ _indoorList._objects11._x = Res.INDOOR_OBJECT_X[listOffset][11];
+ _indoorList._objects11._y = Res.MAP_OBJECT_Y[listOffset][11];
_indoorList._objects11._frame = mazeObject._frame;
_indoorList._objects11._sprites = mazeObject._sprites;
_indoorList._objects11._flags &= ~SPRFLAG_HORIZ_FLIPPED;
@@ -2867,16 +2866,16 @@ void InterfaceMap::setIndoorsWallPics() {
if (wallItem._direction != dir)
continue;
- if (mazePos.x == (wallItem._position.x + SCREEN_POSITIONING_X[dir][2]) &&
- mazePos.y == (wallItem._position.y + SCREEN_POSITIONING_Y[dir][2])) {
+ if (mazePos.x == (wallItem._position.x + Res.SCREEN_POSITIONING_X[dir][2]) &&
+ mazePos.y == (wallItem._position.y + Res.SCREEN_POSITIONING_Y[dir][2])) {
if (_wp[1] == -1) {
_indoorList[148]._frame = wallItem._frame;
_indoorList[148]._sprites = wallItem._sprites;
}
}
- if (mazePos.x == (wallItem._position.x + SCREEN_POSITIONING_X[dir][7]) &&
- mazePos.y == (wallItem._position.y + SCREEN_POSITIONING_Y[dir][7])) {
+ if (mazePos.x == (wallItem._position.x + Res.SCREEN_POSITIONING_X[dir][7]) &&
+ mazePos.y == (wallItem._position.y + Res.SCREEN_POSITIONING_Y[dir][7])) {
if (!_wo[27] && _wp[1] == -1) {
_indoorList[123]._frame = wallItem._frame;
_indoorList[123]._sprites = wallItem._sprites;
@@ -2884,8 +2883,8 @@ void InterfaceMap::setIndoorsWallPics() {
}
}
- if (mazePos.x == (wallItem._position.x + SCREEN_POSITIONING_X[dir][5]) &&
- mazePos.y == (wallItem._position.y + SCREEN_POSITIONING_Y[dir][5])) {
+ if (mazePos.x == (wallItem._position.x + Res.SCREEN_POSITIONING_X[dir][5]) &&
+ mazePos.y == (wallItem._position.y + Res.SCREEN_POSITIONING_Y[dir][5])) {
if (_wo[27] && _wo[25]) {
} else if (_wo[27] && _wo[28]) {
} else if (_wo[23] && _wo[25]) {
@@ -2897,8 +2896,8 @@ void InterfaceMap::setIndoorsWallPics() {
}
}
- if (mazePos.x == (wallItem._position.x + SCREEN_POSITIONING_X[dir][9]) &&
- mazePos.y == (wallItem._position.y + SCREEN_POSITIONING_Y[dir][9])) {
+ if (mazePos.x == (wallItem._position.x + Res.SCREEN_POSITIONING_X[dir][9]) &&
+ mazePos.y == (wallItem._position.y + Res.SCREEN_POSITIONING_Y[dir][9])) {
if (_wo[27] && _wo[26]) {
} else if (_wo[27] && _wo[29]) {
} else if (_wo[24] && _wo[26]) {
@@ -2910,8 +2909,8 @@ void InterfaceMap::setIndoorsWallPics() {
}
}
- if (mazePos.x == (wallItem._position.x + SCREEN_POSITIONING_X[dir][14]) &&
- mazePos.y == (wallItem._position.y + SCREEN_POSITIONING_Y[dir][14])) {
+ if (mazePos.x == (wallItem._position.x + Res.SCREEN_POSITIONING_X[dir][14]) &&
+ mazePos.y == (wallItem._position.y + Res.SCREEN_POSITIONING_Y[dir][14])) {
if (!_wo[22] && !_wo[27] && !_wp[8]) {
_indoorList[94]._frame = wallItem._frame;
_indoorList[94]._sprites = wallItem._sprites;
@@ -2919,8 +2918,8 @@ void InterfaceMap::setIndoorsWallPics() {
}
}
- if (mazePos.x == (wallItem._position.x + SCREEN_POSITIONING_X[dir][12]) &&
- mazePos.y == (wallItem._position.y + SCREEN_POSITIONING_Y[dir][12])) {
+ if (mazePos.x == (wallItem._position.x + Res.SCREEN_POSITIONING_X[dir][12]) &&
+ mazePos.y == (wallItem._position.y + Res.SCREEN_POSITIONING_Y[dir][12])) {
if (_wo[27]) {
} else if (_wo[22] && _wo[23]) {
} else if (_wo[22] && _wo[20]) {
@@ -2933,8 +2932,8 @@ void InterfaceMap::setIndoorsWallPics() {
}
}
- if (mazePos.x == (wallItem._position.x + SCREEN_POSITIONING_X[dir][16]) &&
- mazePos.y == (wallItem._position.y + SCREEN_POSITIONING_Y[dir][16])) {
+ if (mazePos.x == (wallItem._position.x + Res.SCREEN_POSITIONING_X[dir][16]) &&
+ mazePos.y == (wallItem._position.y + Res.SCREEN_POSITIONING_Y[dir][16])) {
if (_wo[27]) {
} else if (_wo[22] && _wo[24]) {
} else if (_wo[22] && _wo[21]) {
@@ -2947,8 +2946,8 @@ void InterfaceMap::setIndoorsWallPics() {
}
}
- if (mazePos.x == (wallItem._position.x + SCREEN_POSITIONING_X[dir][12]) &&
- mazePos.y == (wallItem._position.y + SCREEN_POSITIONING_Y[dir][12])) {
+ if (mazePos.x == (wallItem._position.x + Res.SCREEN_POSITIONING_X[dir][12]) &&
+ mazePos.y == (wallItem._position.y + Res.SCREEN_POSITIONING_Y[dir][12])) {
if (_wo[27]) {
} else if (_wo[25] && _wo[28]) {
} else if (_wo[20] && _wo[16]) {
@@ -2959,8 +2958,8 @@ void InterfaceMap::setIndoorsWallPics() {
}
}
- if (mazePos.x == (wallItem._position.x + SCREEN_POSITIONING_X[dir][16]) &&
- mazePos.y == (wallItem._position.y + SCREEN_POSITIONING_Y[dir][16])) {
+ if (mazePos.x == (wallItem._position.x + Res.SCREEN_POSITIONING_X[dir][16]) &&
+ mazePos.y == (wallItem._position.y + Res.SCREEN_POSITIONING_Y[dir][16])) {
if (!_wo[26] && !_wo[29] && !_wo[21] && !_wo[18] && _wp[10] == -1) {
_indoorList[96]._frame = wallItem._frame;
_indoorList[96]._sprites = wallItem._sprites;
@@ -2968,8 +2967,8 @@ void InterfaceMap::setIndoorsWallPics() {
}
}
- if (mazePos.x == (wallItem._position.x + SCREEN_POSITIONING_X[dir][27]) &&
- mazePos.y == (wallItem._position.y + SCREEN_POSITIONING_Y[dir][27])) {
+ if (mazePos.x == (wallItem._position.x + Res.SCREEN_POSITIONING_X[dir][27]) &&
+ mazePos.y == (wallItem._position.y + Res.SCREEN_POSITIONING_Y[dir][27])) {
if (!_wo[27] && !_wo[22] && !_wo[15] && _wp[15] == -1) {
_indoorList[50]._frame = wallItem._frame;
_indoorList[50]._sprites = wallItem._sprites;
@@ -2977,8 +2976,8 @@ void InterfaceMap::setIndoorsWallPics() {
}
}
- if (mazePos.x == (wallItem._position.x + SCREEN_POSITIONING_X[dir][25]) &&
- mazePos.y == (wallItem._position.y + SCREEN_POSITIONING_Y[dir][25])) {
+ if (mazePos.x == (wallItem._position.x + Res.SCREEN_POSITIONING_X[dir][25]) &&
+ mazePos.y == (wallItem._position.y + Res.SCREEN_POSITIONING_Y[dir][25])) {
if (_wo[27]) {
} else if (_wo[27] && _wo[22]) {
} else if (_wo[15] && _wo[17]) {
@@ -2992,8 +2991,8 @@ void InterfaceMap::setIndoorsWallPics() {
}
}
- if (mazePos.x == (wallItem._position.x + SCREEN_POSITIONING_X[dir][23]) &&
- mazePos.y == (wallItem._position.y + SCREEN_POSITIONING_Y[dir][23])) {
+ if (mazePos.x == (wallItem._position.x + Res.SCREEN_POSITIONING_X[dir][23]) &&
+ mazePos.y == (wallItem._position.y + Res.SCREEN_POSITIONING_Y[dir][23])) {
if (_wo[27]) {
} else if (_wo[22] && _wo[20]) {
} else if (_wo[22] && _wo[23]) {
@@ -3007,8 +3006,8 @@ void InterfaceMap::setIndoorsWallPics() {
}
}
- if (mazePos.x == (wallItem._position.x + SCREEN_POSITIONING_X[dir][29]) &&
- mazePos.y == (wallItem._position.y + SCREEN_POSITIONING_Y[dir][29])) {
+ if (mazePos.x == (wallItem._position.x + Res.SCREEN_POSITIONING_X[dir][29]) &&
+ mazePos.y == (wallItem._position.y + Res.SCREEN_POSITIONING_Y[dir][29])) {
if (_wo[27] || _wo[22]) {
} else if (_wo[15] && _wo[19]) {
} else if (_wo[15] && _wo[14]) {
@@ -3021,8 +3020,8 @@ void InterfaceMap::setIndoorsWallPics() {
}
}
- if (mazePos.x == (wallItem._position.x + SCREEN_POSITIONING_X[dir][31]) &&
- mazePos.y == (wallItem._position.y + SCREEN_POSITIONING_Y[dir][31])) {
+ if (mazePos.x == (wallItem._position.x + Res.SCREEN_POSITIONING_X[dir][31]) &&
+ mazePos.y == (wallItem._position.y + Res.SCREEN_POSITIONING_Y[dir][31])) {
if (_wo[27]) {
} else if (_wo[22] && _wo[21]) {
} else if (_wo[22] && _wo[24]) {
@@ -3035,8 +3034,8 @@ void InterfaceMap::setIndoorsWallPics() {
}
}
- if (mazePos.x == (wallItem._position.x + SCREEN_POSITIONING_X[dir][23]) &&
- mazePos.y == (wallItem._position.y + SCREEN_POSITIONING_Y[dir][23])) {
+ if (mazePos.x == (wallItem._position.x + Res.SCREEN_POSITIONING_X[dir][23]) &&
+ mazePos.y == (wallItem._position.y + Res.SCREEN_POSITIONING_Y[dir][23])) {
if (!_wo[27] && !_wo[20] && !_wo[12] && !_wo[23] && !_wo[8] && !_wo[30]) {
if (_wp[12] == -1) {
_indoorList[47]._frame = wallItem._frame;
@@ -3046,8 +3045,8 @@ void InterfaceMap::setIndoorsWallPics() {
}
}
- if (mazePos.x == (wallItem._position.x + SCREEN_POSITIONING_X[dir][31]) &&
- mazePos.y == (wallItem._position.y + SCREEN_POSITIONING_Y[dir][31])) {
+ if (mazePos.x == (wallItem._position.x + Res.SCREEN_POSITIONING_X[dir][31]) &&
+ mazePos.y == (wallItem._position.y + Res.SCREEN_POSITIONING_Y[dir][31])) {
if (!_wo[27] && !_wo[21] && !_wo[14] && !_wo[24] && !_wo[10] && !_wo[31]) {
if (_wp[18] == -1) {
_indoorList[53]._frame = wallItem._frame;
@@ -3057,8 +3056,8 @@ void InterfaceMap::setIndoorsWallPics() {
}
}
- if (mazePos.x == (wallItem._position.x + SCREEN_POSITIONING_X[dir][23]) &&
- mazePos.y == (wallItem._position.y + SCREEN_POSITIONING_Y[dir][23])) {
+ if (mazePos.x == (wallItem._position.x + Res.SCREEN_POSITIONING_X[dir][23]) &&
+ mazePos.y == (wallItem._position.y + Res.SCREEN_POSITIONING_Y[dir][23])) {
if (!_wo[25] && !_wo[28] && !_wo[20] && !_wo[11] && !_wo[16] && !_wo[30] && !_wo[32]) {
if (_wp[11] == -1) {
_indoorList[46]._frame = wallItem._frame;
@@ -3068,8 +3067,8 @@ void InterfaceMap::setIndoorsWallPics() {
}
}
- if (mazePos.x == (wallItem._position.x + SCREEN_POSITIONING_X[dir][31]) &&
- mazePos.y == (wallItem._position.y + SCREEN_POSITIONING_Y[dir][31])) {
+ if (mazePos.x == (wallItem._position.x + Res.SCREEN_POSITIONING_X[dir][31]) &&
+ mazePos.y == (wallItem._position.y + Res.SCREEN_POSITIONING_Y[dir][31])) {
if (!_wo[26] && !_wo[20] && !_wo[21] && !_wo[13] && !_wo[18] && !_wo[31] && !_wo[33]) {
if (_wp[19] == -1) {
_indoorList[54]._frame = wallItem._frame;
@@ -3091,8 +3090,8 @@ void InterfaceMap::setOutdoorsMonsters() {
for (uint idx = 0; idx < map._mobData._monsters.size(); ++idx) {
MazeMonster &monster = map._mobData._monsters[idx];
- if (monster._position.x == (pt.x + SCREEN_POSITIONING_X[dir][2]) &&
- monster._position.y == (pt.y + SCREEN_POSITIONING_Y[dir][2])) {
+ if (monster._position.x == (pt.x + Res.SCREEN_POSITIONING_X[dir][2]) &&
+ monster._position.y == (pt.y + Res.SCREEN_POSITIONING_Y[dir][2])) {
monster._isAttacking = true;
if (combat._attackMonsters[0] == -1) {
_outdoorList[118]._frame = idx;
@@ -3106,8 +3105,8 @@ void InterfaceMap::setOutdoorsMonsters() {
}
}
- if (monster._position.x == (pt.x + SCREEN_POSITIONING_X[dir][7]) &&
- monster._position.y == (pt.y + SCREEN_POSITIONING_Y[dir][7])) {
+ if (monster._position.x == (pt.x + Res.SCREEN_POSITIONING_X[dir][7]) &&
+ monster._position.y == (pt.y + Res.SCREEN_POSITIONING_Y[dir][7])) {
monster._isAttacking = true;
if (combat._attackMonsters[3] == -1) {
_outdoorList[94]._frame = idx;
@@ -3121,8 +3120,8 @@ void InterfaceMap::setOutdoorsMonsters() {
}
}
- if (monster._position.x == (pt.x + SCREEN_POSITIONING_X[dir][5]) &&
- monster._position.y == (pt.y + SCREEN_POSITIONING_Y[dir][5])) {
+ if (monster._position.x == (pt.x + Res.SCREEN_POSITIONING_X[dir][5]) &&
+ monster._position.y == (pt.y + Res.SCREEN_POSITIONING_Y[dir][5])) {
monster._isAttacking = true;
if (combat._attackMonsters[12] == -1) {
_outdoorList[90]._frame = idx;
@@ -3130,8 +3129,8 @@ void InterfaceMap::setOutdoorsMonsters() {
}
}
- if (monster._position.x == (pt.x + SCREEN_POSITIONING_X[dir][9]) &&
- monster._position.y == (pt.y + SCREEN_POSITIONING_Y[dir][9])) {
+ if (monster._position.x == (pt.x + Res.SCREEN_POSITIONING_X[dir][9]) &&
+ monster._position.y == (pt.y + Res.SCREEN_POSITIONING_Y[dir][9])) {
monster._isAttacking = true;
if (combat._attackMonsters[13] == -1) {
_outdoorList[91]._frame = idx;
@@ -3139,8 +3138,8 @@ void InterfaceMap::setOutdoorsMonsters() {
}
}
- if (monster._position.x == (pt.x + SCREEN_POSITIONING_X[dir][14]) &&
- monster._position.y == (pt.y + SCREEN_POSITIONING_Y[dir][14])) {
+ if (monster._position.x == (pt.x + Res.SCREEN_POSITIONING_X[dir][14]) &&
+ monster._position.y == (pt.y + Res.SCREEN_POSITIONING_Y[dir][14])) {
monster._isAttacking = true;
if (combat._attackMonsters[6] == -1) {
_outdoorList[75]._frame = idx;
@@ -3154,8 +3153,8 @@ void InterfaceMap::setOutdoorsMonsters() {
}
}
- if (monster._position.x == (pt.x + SCREEN_POSITIONING_X[dir][12]) &&
- monster._position.y == (pt.y + SCREEN_POSITIONING_Y[dir][12])) {
+ if (monster._position.x == (pt.x + Res.SCREEN_POSITIONING_X[dir][12]) &&
+ monster._position.y == (pt.y + Res.SCREEN_POSITIONING_Y[dir][12])) {
monster._isAttacking = true;
if (combat._attackMonsters[14] == -1) {
_outdoorList[69]._frame = idx;
@@ -3166,8 +3165,8 @@ void InterfaceMap::setOutdoorsMonsters() {
}
}
- if (monster._position.x == (pt.x + SCREEN_POSITIONING_X[dir][16]) &&
- monster._position.y == (pt.y + SCREEN_POSITIONING_Y[dir][16])) {
+ if (monster._position.x == (pt.x + Res.SCREEN_POSITIONING_X[dir][16]) &&
+ monster._position.y == (pt.y + Res.SCREEN_POSITIONING_Y[dir][16])) {
monster._isAttacking = true;
if (combat._attackMonsters[15] == -1) {
_outdoorList[71]._frame = idx;
@@ -3178,8 +3177,8 @@ void InterfaceMap::setOutdoorsMonsters() {
}
}
- if (monster._position.x == (pt.x + SCREEN_POSITIONING_X[dir][27]) &&
- monster._position.y == (pt.y + SCREEN_POSITIONING_Y[dir][27])) {
+ if (monster._position.x == (pt.x + Res.SCREEN_POSITIONING_X[dir][27]) &&
+ monster._position.y == (pt.y + Res.SCREEN_POSITIONING_Y[dir][27])) {
monster._isAttacking = true;
if (combat._attackMonsters[9] == -1) {
_outdoorList[52]._frame = idx;
@@ -3193,8 +3192,8 @@ void InterfaceMap::setOutdoorsMonsters() {
}
}
- if (monster._position.x == (pt.x + SCREEN_POSITIONING_X[dir][25]) &&
- monster._position.y == (pt.y + SCREEN_POSITIONING_Y[dir][25])) {
+ if (monster._position.x == (pt.x + Res.SCREEN_POSITIONING_X[dir][25]) &&
+ monster._position.y == (pt.y + Res.SCREEN_POSITIONING_Y[dir][25])) {
monster._isAttacking = true;
if (combat._attackMonsters[16] == -1) {
_outdoorList[44]._frame = idx;
@@ -3208,8 +3207,8 @@ void InterfaceMap::setOutdoorsMonsters() {
}
}
- if (monster._position.x == (pt.x + SCREEN_POSITIONING_X[dir][23]) &&
- monster._position.y == (pt.y + SCREEN_POSITIONING_Y[dir][23])) {
+ if (monster._position.x == (pt.x + Res.SCREEN_POSITIONING_X[dir][23]) &&
+ monster._position.y == (pt.y + Res.SCREEN_POSITIONING_Y[dir][23])) {
monster._isAttacking = true;
if (combat._attackMonsters[18] == -1) {
_outdoorList[48]._frame = idx;
@@ -3217,8 +3216,8 @@ void InterfaceMap::setOutdoorsMonsters() {
}
}
- if (monster._position.x == (pt.x + SCREEN_POSITIONING_X[dir][29]) &&
- monster._position.y == (pt.y + SCREEN_POSITIONING_Y[dir][29])) {
+ if (monster._position.x == (pt.x + Res.SCREEN_POSITIONING_X[dir][29]) &&
+ monster._position.y == (pt.y + Res.SCREEN_POSITIONING_Y[dir][29])) {
monster._isAttacking = true;
if (combat._attackMonsters[17] == -1) {
_outdoorList[47]._frame = idx;
@@ -3232,8 +3231,8 @@ void InterfaceMap::setOutdoorsMonsters() {
}
}
- if (monster._position.x == (pt.x + SCREEN_POSITIONING_X[dir][31]) &&
- monster._position.y == (pt.y + SCREEN_POSITIONING_Y[dir][31])) {
+ if (monster._position.x == (pt.x + Res.SCREEN_POSITIONING_X[dir][31]) &&
+ monster._position.y == (pt.y + Res.SCREEN_POSITIONING_Y[dir][31])) {
monster._isAttacking = true;
if (combat._attackMonsters[19] == -1) {
_outdoorList[49]._frame = idx;
@@ -3301,7 +3300,7 @@ void InterfaceMap::setOutdoorsMonsters() {
}
for (int idx = 0; idx < 26; ++idx) {
- DrawStruct &ds = _outdoorList[OUTDOOR_MONSTER_INDEXES[idx]];
+ DrawStruct &ds = _outdoorList[Res.OUTDOOR_MONSTER_INDEXES[idx]];
if (ds._frame != -1) {
ds._flags &= ~0xfff;
@@ -3313,7 +3312,7 @@ void InterfaceMap::setOutdoorsMonsters() {
ds._frame = monster._frame;
if (monster._effect2) {
- ds._flags = MONSTER_EFFECT_FLAGS[monster._effect2 - 1][monster._effect3];
+ ds._flags = Res.MONSTER_EFFECT_FLAGS[monster._effect2 - 1][monster._effect3];
}
if (monster._frame > 7) {
@@ -3323,11 +3322,11 @@ void InterfaceMap::setOutdoorsMonsters() {
ds._sprites = monster._sprites;
}
- ds._y = OUTDOOR_MONSTERS_Y[idx];
+ ds._y = Res.OUTDOOR_MONSTERS_Y[idx];
if (monsterData._flying) {
- ds._x += COMBAT_FLOAT_X[_combatFloatCounter];
- ds._y += COMBAT_FLOAT_Y[_combatFloatCounter];
+ ds._x += Res.COMBAT_FLOAT_X[_combatFloatCounter];
+ ds._y += Res.COMBAT_FLOAT_Y[_combatFloatCounter];
}
}
}
@@ -3350,12 +3349,12 @@ void InterfaceMap::setOutdoorsObjects() {
posIndex = obj._spriteId == 113 ? 1 : 0;
}
- if (obj._position.x == (pt.x + SCREEN_POSITIONING_X[dir][2]) &&
- obj._position.y == (pt.y + SCREEN_POSITIONING_Y[dir][2]) &&
+ if (obj._position.x == (pt.x + Res.SCREEN_POSITIONING_X[dir][2]) &&
+ obj._position.y == (pt.y + Res.SCREEN_POSITIONING_Y[dir][2]) &&
_outdoorList[111]._frame == -1) {
DrawStruct &ds = _outdoorList[111];
- ds._x = OUTDOOR_OBJECT_X[posIndex][0];
- ds._y = MAP_OBJECT_Y[posIndex][0];
+ ds._x = Res.OUTDOOR_OBJECT_X[posIndex][0];
+ ds._y = Res.MAP_OBJECT_Y[posIndex][0];
ds._frame = obj._frame;
ds._sprites = obj._sprites;
@@ -3365,12 +3364,12 @@ void InterfaceMap::setOutdoorsObjects() {
_objNumber = idx;
}
- if (obj._position.x == (pt.x + SCREEN_POSITIONING_X[dir][7]) &&
- obj._position.y == (pt.y + SCREEN_POSITIONING_Y[dir][7]) &&
+ if (obj._position.x == (pt.x + Res.SCREEN_POSITIONING_X[dir][7]) &&
+ obj._position.y == (pt.y + Res.SCREEN_POSITIONING_Y[dir][7]) &&
_outdoorList[87]._frame == -1) {
DrawStruct &ds = _outdoorList[87];
- ds._x = OUTDOOR_OBJECT_X[posIndex][1];
- ds._y = MAP_OBJECT_Y[posIndex][1];
+ ds._x = Res.OUTDOOR_OBJECT_X[posIndex][1];
+ ds._y = Res.MAP_OBJECT_Y[posIndex][1];
ds._frame = obj._frame;
ds._sprites = obj._sprites;
@@ -3379,12 +3378,12 @@ void InterfaceMap::setOutdoorsObjects() {
ds._flags |= SPRFLAG_HORIZ_FLIPPED;
}
- if (obj._position.x == (pt.x + SCREEN_POSITIONING_X[dir][5]) &&
- obj._position.y == (pt.y + SCREEN_POSITIONING_Y[dir][5]) &&
+ if (obj._position.x == (pt.x + Res.SCREEN_POSITIONING_X[dir][5]) &&
+ obj._position.y == (pt.y + Res.SCREEN_POSITIONING_Y[dir][5]) &&
_outdoorList[88]._frame == -1) {
DrawStruct &ds = _outdoorList[88];
- ds._x = OUTDOOR_OBJECT_X[posIndex][2];
- ds._y = MAP_OBJECT_Y[posIndex][2];
+ ds._x = Res.OUTDOOR_OBJECT_X[posIndex][2];
+ ds._y = Res.MAP_OBJECT_Y[posIndex][2];
ds._frame = obj._frame;
ds._sprites = obj._sprites;
@@ -3393,12 +3392,12 @@ void InterfaceMap::setOutdoorsObjects() {
ds._flags |= SPRFLAG_HORIZ_FLIPPED;
}
- if (obj._position.x == (pt.x + SCREEN_POSITIONING_X[dir][9]) &&
- obj._position.y == (pt.y + SCREEN_POSITIONING_Y[dir][9]) &&
+ if (obj._position.x == (pt.x + Res.SCREEN_POSITIONING_X[dir][9]) &&
+ obj._position.y == (pt.y + Res.SCREEN_POSITIONING_Y[dir][9]) &&
_outdoorList[89]._frame == -1) {
DrawStruct &ds = _outdoorList[89];
- ds._x = OUTDOOR_OBJECT_X[posIndex][3];
- ds._y = MAP_OBJECT_Y[posIndex][3];
+ ds._x = Res.OUTDOOR_OBJECT_X[posIndex][3];
+ ds._y = Res.MAP_OBJECT_Y[posIndex][3];
ds._frame = obj._frame;
ds._sprites = obj._sprites;
@@ -3407,12 +3406,12 @@ void InterfaceMap::setOutdoorsObjects() {
ds._flags |= SPRFLAG_HORIZ_FLIPPED;
}
- if (obj._position.x == (pt.x + SCREEN_POSITIONING_X[dir][14]) &&
- obj._position.y == (pt.y + SCREEN_POSITIONING_Y[dir][14]) &&
+ if (obj._position.x == (pt.x + Res.SCREEN_POSITIONING_X[dir][14]) &&
+ obj._position.y == (pt.y + Res.SCREEN_POSITIONING_Y[dir][14]) &&
_outdoorList[66]._frame == -1) {
DrawStruct &ds = _outdoorList[66];
- ds._x = OUTDOOR_OBJECT_X[posIndex][4];
- ds._y = MAP_OBJECT_Y[posIndex][4];
+ ds._x = Res.OUTDOOR_OBJECT_X[posIndex][4];
+ ds._y = Res.MAP_OBJECT_Y[posIndex][4];
ds._frame = obj._frame;
ds._sprites = obj._sprites;
@@ -3421,12 +3420,12 @@ void InterfaceMap::setOutdoorsObjects() {
ds._flags |= SPRFLAG_HORIZ_FLIPPED;
}
- if (obj._position.x == (pt.x + SCREEN_POSITIONING_X[dir][12]) &&
- obj._position.y == (pt.y + SCREEN_POSITIONING_Y[dir][12]) &&
+ if (obj._position.x == (pt.x + Res.SCREEN_POSITIONING_X[dir][12]) &&
+ obj._position.y == (pt.y + Res.SCREEN_POSITIONING_Y[dir][12]) &&
_outdoorList[67]._frame == -1) {
DrawStruct &ds = _outdoorList[67];
- ds._x = OUTDOOR_OBJECT_X[posIndex][5];
- ds._y = MAP_OBJECT_Y[posIndex][5];
+ ds._x = Res.OUTDOOR_OBJECT_X[posIndex][5];
+ ds._y = Res.MAP_OBJECT_Y[posIndex][5];
ds._frame = obj._frame;
ds._sprites = obj._sprites;
@@ -3435,12 +3434,12 @@ void InterfaceMap::setOutdoorsObjects() {
ds._flags |= SPRFLAG_HORIZ_FLIPPED;
}
- if (obj._position.x == (pt.x + SCREEN_POSITIONING_X[dir][16]) &&
- obj._position.y == (pt.y + SCREEN_POSITIONING_Y[dir][16]) &&
+ if (obj._position.x == (pt.x + Res.SCREEN_POSITIONING_X[dir][16]) &&
+ obj._position.y == (pt.y + Res.SCREEN_POSITIONING_Y[dir][16]) &&
_outdoorList[68]._frame == -1) {
DrawStruct &ds = _outdoorList[68];
- ds._x = OUTDOOR_OBJECT_X[posIndex][6];
- ds._y = MAP_OBJECT_Y[posIndex][6];
+ ds._x = Res.OUTDOOR_OBJECT_X[posIndex][6];
+ ds._y = Res.MAP_OBJECT_Y[posIndex][6];
ds._frame = obj._frame;
ds._sprites = obj._sprites;
@@ -3449,12 +3448,12 @@ void InterfaceMap::setOutdoorsObjects() {
ds._flags |= SPRFLAG_HORIZ_FLIPPED;
}
- if (obj._position.x == (pt.x + SCREEN_POSITIONING_X[dir][27]) &&
- obj._position.y == (pt.y + SCREEN_POSITIONING_Y[dir][27]) &&
+ if (obj._position.x == (pt.x + Res.SCREEN_POSITIONING_X[dir][27]) &&
+ obj._position.y == (pt.y + Res.SCREEN_POSITIONING_Y[dir][27]) &&
_outdoorList[37]._frame == -1) {
DrawStruct &ds = _outdoorList[37];
- ds._x = OUTDOOR_OBJECT_X[posIndex][7];
- ds._y = MAP_OBJECT_Y[posIndex][7];
+ ds._x = Res.OUTDOOR_OBJECT_X[posIndex][7];
+ ds._y = Res.MAP_OBJECT_Y[posIndex][7];
ds._frame = obj._frame;
ds._sprites = obj._sprites;
@@ -3463,12 +3462,12 @@ void InterfaceMap::setOutdoorsObjects() {
ds._flags |= SPRFLAG_HORIZ_FLIPPED;
}
- if (obj._position.x == (pt.x + SCREEN_POSITIONING_X[dir][25]) &&
- obj._position.y == (pt.y + SCREEN_POSITIONING_Y[dir][25]) &&
+ if (obj._position.x == (pt.x + Res.SCREEN_POSITIONING_X[dir][25]) &&
+ obj._position.y == (pt.y + Res.SCREEN_POSITIONING_Y[dir][25]) &&
_outdoorList[38]._frame == -1) {
DrawStruct &ds = _outdoorList[38];
- ds._x = OUTDOOR_OBJECT_X[posIndex][8];
- ds._y = MAP_OBJECT_Y[posIndex][8];
+ ds._x = Res.OUTDOOR_OBJECT_X[posIndex][8];
+ ds._y = Res.MAP_OBJECT_Y[posIndex][8];
ds._frame = obj._frame;
ds._sprites = obj._sprites;
@@ -3477,12 +3476,12 @@ void InterfaceMap::setOutdoorsObjects() {
ds._flags |= SPRFLAG_HORIZ_FLIPPED;
}
- if (obj._position.x == (pt.x + SCREEN_POSITIONING_X[dir][23]) &&
- obj._position.y == (pt.y + SCREEN_POSITIONING_Y[dir][23]) &&
+ if (obj._position.x == (pt.x + Res.SCREEN_POSITIONING_X[dir][23]) &&
+ obj._position.y == (pt.y + Res.SCREEN_POSITIONING_Y[dir][23]) &&
_outdoorList[40]._frame == -1) {
DrawStruct &ds = _outdoorList[40];
- ds._x = OUTDOOR_OBJECT_X[posIndex][10];
- ds._y = MAP_OBJECT_Y[posIndex][10];
+ ds._x = Res.OUTDOOR_OBJECT_X[posIndex][10];
+ ds._y = Res.MAP_OBJECT_Y[posIndex][10];
ds._frame = obj._frame;
ds._sprites = obj._sprites;
@@ -3491,12 +3490,12 @@ void InterfaceMap::setOutdoorsObjects() {
ds._flags |= SPRFLAG_HORIZ_FLIPPED;
}
- if (obj._position.x == (pt.x + SCREEN_POSITIONING_X[dir][29]) &&
- obj._position.y == (pt.y + SCREEN_POSITIONING_Y[dir][29]) &&
+ if (obj._position.x == (pt.x + Res.SCREEN_POSITIONING_X[dir][29]) &&
+ obj._position.y == (pt.y + Res.SCREEN_POSITIONING_Y[dir][29]) &&
_outdoorList[39]._frame == -1) {
DrawStruct &ds = _outdoorList[39];
- ds._x = OUTDOOR_OBJECT_X[posIndex][9];
- ds._y = MAP_OBJECT_Y[posIndex][9];
+ ds._x = Res.OUTDOOR_OBJECT_X[posIndex][9];
+ ds._y = Res.MAP_OBJECT_Y[posIndex][9];
ds._frame = obj._frame;
ds._sprites = obj._sprites;
@@ -3505,12 +3504,12 @@ void InterfaceMap::setOutdoorsObjects() {
ds._flags |= SPRFLAG_HORIZ_FLIPPED;
}
- if (obj._position.x == (pt.x + SCREEN_POSITIONING_X[dir][31]) &&
- obj._position.y == (pt.y + SCREEN_POSITIONING_Y[dir][31]) &&
+ if (obj._position.x == (pt.x + Res.SCREEN_POSITIONING_X[dir][31]) &&
+ obj._position.y == (pt.y + Res.SCREEN_POSITIONING_Y[dir][31]) &&
_outdoorList[41]._frame == -1) {
DrawStruct &ds = _outdoorList[41];
- ds._x = OUTDOOR_OBJECT_X[posIndex][11];
- ds._y = MAP_OBJECT_Y[posIndex][11];
+ ds._x = Res.OUTDOOR_OBJECT_X[posIndex][11];
+ ds._y = Res.MAP_OBJECT_Y[posIndex][11];
ds._frame = obj._frame;
ds._sprites = obj._sprites;
@@ -3527,7 +3526,7 @@ void InterfaceMap::drawIndoors() {
// Draw any surface tiles on top of the default ground
for (int cellIndex = 0; cellIndex < 25; ++cellIndex) {
- map.getCell(DRAW_NUMBERS[cellIndex]);
+ map.getCell(Res.DRAW_NUMBERS[cellIndex]);
DrawStruct &drawStruct = _indoorList._groundTiles[cellIndex];
SpriteResource &sprites = map._surfaceSprites[map._currentSurfaceId];
@@ -3536,10 +3535,10 @@ void InterfaceMap::drawIndoors() {
surfaceId = map.mazeData()._surfaceTypes[map._currentSurfaceId];
if (surfaceId == SURFTYPE_WATER || surfaceId == SURFTYPE_LAVA ||
surfaceId == SURFTYPE_SEWER) {
- drawStruct._frame = DRAW_FRAMES[cellIndex][_flipWater ? 1 : 0];
+ drawStruct._frame = Res.DRAW_FRAMES[cellIndex][_flipWater ? 1 : 0];
drawStruct._flags = _flipWater ? SPRFLAG_HORIZ_FLIPPED : 0;
} else {
- drawStruct._frame = DRAW_FRAMES[cellIndex][_flipGround ? 1 : 0];
+ drawStruct._frame = Res.DRAW_FRAMES[cellIndex][_flipGround ? 1 : 0];
drawStruct._flags = _flipGround ? SPRFLAG_HORIZ_FLIPPED : 0;
}
}
@@ -4338,9 +4337,9 @@ void InterfaceMap::drawIndoors() {
if (_openDoor) {
Common::Point pt(
- _vm->_party->_mazePosition.x + SCREEN_POSITIONING_X[
+ _vm->_party->_mazePosition.x + Res.SCREEN_POSITIONING_X[
_vm->_party->_mazeDirection][_vm->_party->_mazePosition.x],
- _vm->_party->_mazePosition.y + SCREEN_POSITIONING_Y[
+ _vm->_party->_mazePosition.y + Res.SCREEN_POSITIONING_Y[
_vm->_party->_mazeDirection][_vm->_party->_mazePosition.y]
);
map.cellFlagLookup(pt);
@@ -4375,7 +4374,7 @@ void InterfaceMap::drawOutdoors() {
// Draw any surface tiles on top of the default ground
for (int cellIndex = 0; cellIndex < 25; ++cellIndex) {
- map.getCell(cellIndex == 24 ? 2 : DRAW_NUMBERS[cellIndex]);
+ map.getCell(cellIndex == 24 ? 2 : Res.DRAW_NUMBERS[cellIndex]);
DrawStruct &drawStruct = _outdoorList._groundTiles[cellIndex];
SpriteResource &sprites = map._surfaceSprites[map._currentSurfaceId];
@@ -4383,10 +4382,10 @@ void InterfaceMap::drawOutdoors() {
surfaceId = map.mazeData()._surfaceTypes[map._currentSurfaceId];
if (surfaceId == SURFTYPE_DWATER || surfaceId == SURFTYPE_LAVA) {
- drawStruct._frame = DRAW_FRAMES[cellIndex][_flipWater ? 1 : 0];
+ drawStruct._frame = Res.DRAW_FRAMES[cellIndex][_flipWater ? 1 : 0];
drawStruct._flags = _flipWater ? SPRFLAG_HORIZ_FLIPPED : 0;
} else {
- drawStruct._frame = DRAW_FRAMES[cellIndex][_flipGround ? 1 : 0];
+ drawStruct._frame = Res.DRAW_FRAMES[cellIndex][_flipGround ? 1 : 0];
drawStruct._flags = _flipGround ? SPRFLAG_HORIZ_FLIPPED : 0;
}
}
diff --git a/engines/xeen/map.cpp b/engines/xeen/map.cpp
index 6816423a19..a7be48af8f 100644
--- a/engines/xeen/map.cpp
+++ b/engines/xeen/map.cpp
@@ -892,7 +892,7 @@ void Map::load(int mapId) {
if (intf._falling) {
Window &w = screen._windows[9];
w.open();
- w.writeString(OOPS);
+ w.writeString(Res.OOPS);
} else {
PleaseWait::show(_vm);
}
@@ -1069,27 +1069,27 @@ void Map::load(int mapId) {
// Read in the object sprites
_mobData._objectSprites[i]._sprites.load(filename,
- *_vm->_files->_sideArchives[_sideObjects]);
+ _sideObjects ? ALTSIDE_ARCHIVE : GAME_ARCHIVE);
}
// Load sprites for the monsters
for (uint i = 0; i < _mobData._monsterSprites.size(); ++i) {
- CCArchive *archive = _vm->_files->_sideArchives[
+ ArchiveType archiveType =
_mobData._monsterSprites[i]._spriteId == 91 && _vm->getGameID() == GType_WorldOfXeen ?
- 0 : _sideMonsters];
+ ALTSIDE_ARCHIVE : GAME_ARCHIVE;
filename = Common::String::format("%03d.mon", _mobData._monsterSprites[i]._spriteId);
- _mobData._monsterSprites[i]._sprites.load(filename, *archive);
+ _mobData._monsterSprites[i]._sprites.load(filename, archiveType);
filename = Common::String::format("%03d.att", _mobData._monsterSprites[i]._spriteId);
- _mobData._monsterSprites[i]._attackSprites.load(filename, *archive);
+ _mobData._monsterSprites[i]._attackSprites.load(filename, archiveType);
}
// Load wall picture sprite resources
for (uint i = 0; i < _mobData._wallItemSprites.size(); ++i) {
filename = Common::String::format("%03d.pic", _mobData._wallItems[i]._spriteId);
_mobData._wallItemSprites[i]._sprites.load(filename,
- *_vm->_files->_sideArchives[_sidePictures]);
+ _sidePictures ? ALTSIDE_ARCHIVE : GAME_ARCHIVE);
}
// Handle loading miscellaneous sprites for the map
@@ -1107,43 +1107,43 @@ void Map::load(int mapId) {
if (_mazeData[0]._wallTypes[i] != 0) {
_wallSprites._surfaces[i].load(Common::String::format("%s.wal",
- SURFACE_TYPE_NAMES[_mazeData[0]._wallTypes[i]]));
+ Res.SURFACE_TYPE_NAMES[_mazeData[0]._wallTypes[i]]));
}
_surfaceSprites[i].clear();
if (i != 0 && _mazeData[0]._surfaceTypes[i] != 0)
- _surfaceSprites[i].load(SURFACE_NAMES[_mazeData[0]._surfaceTypes[i]]);
+ _surfaceSprites[i].load(Res.SURFACE_NAMES[_mazeData[0]._surfaceTypes[i]]);
}
} else {
warning("TODO"); // Sound loading
_skySprites[1].load(Common::String::format("%s.sky",
- TERRAIN_TYPES[_mazeData[0]._wallKind]));
+ Res.TERRAIN_TYPES[_mazeData[0]._wallKind]));
_groundSprites.load(Common::String::format("%s.gnd",
- TERRAIN_TYPES[_mazeData[0]._wallKind]));
+ Res.TERRAIN_TYPES[_mazeData[0]._wallKind]));
_tileSprites.load(Common::String::format("%s.til",
- TERRAIN_TYPES[_mazeData[0]._wallKind]));
+ Res.TERRAIN_TYPES[_mazeData[0]._wallKind]));
for (int i = 0; i < TOTAL_SURFACES; ++i) {
_surfaceSprites[i].clear();
if (_mazeData[0]._surfaceTypes[i] != 0 || i == 4)
- _surfaceSprites[i].load(SURFACE_NAMES[_mazeData[0]._surfaceTypes[i]]);
+ _surfaceSprites[i].load(Res.SURFACE_NAMES[_mazeData[0]._surfaceTypes[i]]);
}
for (int i = 0; i < TOTAL_SURFACES; ++i)
_wallSprites._surfaces[i].clear();
_wallSprites._fwl1.load(Common::String::format("f%s1.fwl",
- TERRAIN_TYPES[_mazeData[0]._wallKind]));
+ Res.TERRAIN_TYPES[_mazeData[0]._wallKind]));
_wallSprites._fwl2.load(Common::String::format("f%s2.fwl",
- TERRAIN_TYPES[_mazeData[0]._wallKind]));
+ Res.TERRAIN_TYPES[_mazeData[0]._wallKind]));
_wallSprites._fwl3.load(Common::String::format("f%s3.fwl",
- TERRAIN_TYPES[_mazeData[0]._wallKind]));
+ Res.TERRAIN_TYPES[_mazeData[0]._wallKind]));
_wallSprites._fwl4.load(Common::String::format("f%s4.fwl",
- TERRAIN_TYPES[_mazeData[0]._wallKind]));
+ Res.TERRAIN_TYPES[_mazeData[0]._wallKind]));
_wallSprites._swl.load(Common::String::format("s%s.swl",
- TERRAIN_TYPES[_mazeData[0]._wallKind]));
+ Res.TERRAIN_TYPES[_mazeData[0]._wallKind]));
// Set entries in the indoor draw list to the correct sprites
// for drawing various parts of the background
@@ -1388,15 +1388,15 @@ void Map::setWall(const Common::Point &pt, Direction dir, int v) {
Common::Point mapPos(pt.x & 15, pt.y & 15);
MazeWallLayers &wallLayer = _mazeData[_mazeDataIndex]._wallData[mapPos.y][mapPos.x];
wallLayer._data &= XOR_MASKS[dir];
- wallLayer._data |= v << WALL_SHIFTS[dir][2];
+ wallLayer._data |= v << Res.WALL_SHIFTS[dir][2];
}
int Map::getCell(int idx) {
int mapId = _vm->_party->_mazeId;
Direction dir = _vm->_party->_mazeDirection;
Common::Point pt(
- _vm->_party->_mazePosition.x + SCREEN_POSITIONING_X[_vm->_party->_mazeDirection][idx],
- _vm->_party->_mazePosition.y + SCREEN_POSITIONING_Y[_vm->_party->_mazeDirection][idx]
+ _vm->_party->_mazePosition.x + Res.SCREEN_POSITIONING_X[_vm->_party->_mazeDirection][idx],
+ _vm->_party->_mazePosition.y + Res.SCREEN_POSITIONING_Y[_vm->_party->_mazeDirection][idx]
);
if (pt.x > 31 || pt.y > 31) {
@@ -1512,7 +1512,7 @@ int Map::getCell(int idx) {
_currentSurfaceId = _mazeData[_mazeDataIndex]._cells[pt.y][pt.x]._surfaceId;
_currentWall = wallData;
- return (_currentWall >> WALL_SHIFTS[dir][idx]) & 0xF;
+ return (_currentWall >> Res.WALL_SHIFTS[dir][idx]) & 0xF;
}
return _currentWall;
diff --git a/engines/xeen/module.mk b/engines/xeen/module.mk
index 7435790335..400e273cb6 100644
--- a/engines/xeen/module.mk
+++ b/engines/xeen/module.mk
@@ -4,8 +4,10 @@ MODULE_OBJS := \
worldofxeen/clouds_cutscenes.o \
worldofxeen/darkside_cutscenes.o \
worldofxeen/worldofxeen.o \
+ worldofxeen/worldofxeen_resources.o \
character.o \
combat.o \
+ cutscenes.o \
debugger.o \
detection.o \
dialogs.o \
diff --git a/engines/xeen/music.cpp b/engines/xeen/music.cpp
index ae3d5aba83..1d00fdbd21 100644
--- a/engines/xeen/music.cpp
+++ b/engines/xeen/music.cpp
@@ -31,37 +31,52 @@ namespace Xeen {
/*------------------------------------------------------------------------*/
-MusicDriver::MusicDriver() : _fieldF(false), _field1E(false), _lowMusicIgnored(false),
+MusicDriver::MusicDriver() : _musicPlaying(false), _fxPlaying(false),
_musCountdownTimer(0), _fxCountdownTimer(0), _musDataPtr(nullptr),
- _fxDataPtr(nullptr), _fxStartPtr(nullptr), _musStartPtr(nullptr) {
+ _fxDataPtr(nullptr), _fxStartPtr(nullptr), _musStartPtr(nullptr),
+ _exclude7(false), _frameCtr(0) {
_channels.resize(CHANNEL_COUNT);
}
+MusicDriver::~MusicDriver() {
+ _musicPlaying = _fxPlaying = false;
+ _musCountdownTimer = _fxCountdownTimer = 0;
+}
+
void MusicDriver::execute() {
bool isFX = false;
- bool flag = !_field1E;
- const byte *srcP = _musDataPtr;
+ const byte *srcP = nullptr;
+ const byte *startP = nullptr;
+
+ // Single iteration loop to avoid use of GOTO
+ do {
+ if (_musicPlaying) {
+ startP = _musStartPtr;
+ srcP = _musDataPtr;
+ isFX = false;
+ if (_musCountdownTimer == 0 || --_musCountdownTimer == 0)
+ break;
+ }
- if (!flag) {
- if (_musCountdownTimer && --_musCountdownTimer == 0)
- flag = true;
- }
- if (flag && _lowMusicIgnored) {
- srcP = _fxDataPtr;
- isFX = true;
- if (!_fxCountdownTimer || --_fxCountdownTimer == 0)
- flag = false;
- }
+ if (_fxPlaying) {
+ startP = _fxStartPtr;
+ srcP = _fxDataPtr;
+ isFX = true;
+ if (_fxCountdownTimer == 0 || --_fxCountdownTimer == 0)
+ break;
+ }
- if (flag) {
- // Do paused handling and exit immediately
pausePostProcess();
return;
- }
+ } while (0);
+
+ ++_frameCtr;
+ debugC(3, kDebugSound, "\nMusicDriver frame - #%x", _frameCtr);
// Main loop
bool breakFlag = false;
while (!breakFlag) {
+ debugCN(3, kDebugSound, "MUSCODE %.4x - %.2x ", (uint)(srcP - startP), (uint)*srcP);
byte nextByte = *srcP++;
int cmd = (nextByte >> 4) & 15;
int param = (nextByte & 15);
@@ -73,6 +88,7 @@ void MusicDriver::execute() {
bool MusicDriver::musCallSubroutine(const byte *&srcP, byte param) {
+ debugC(3, kDebugSound, "musCallSubroutine");
if (_musSubroutines.size() < 16) {
const byte *returnP = srcP + 2;
srcP = _musStartPtr + READ_LE_UINT16(srcP);
@@ -86,9 +102,10 @@ bool MusicDriver::musCallSubroutine(const byte *&srcP, byte param) {
bool MusicDriver::musSetCountdown(const byte *&srcP, byte param) {
// Set the countdown timer
if (!param)
- param = *++srcP;
+ param = *srcP++;
_musCountdownTimer = param;
_musDataPtr = srcP;
+ debugC(3, kDebugSound, "musSetCountdown %d", param);
// Do paused handling and break out of processing loop
pausePostProcess();
@@ -96,22 +113,26 @@ bool MusicDriver::musSetCountdown(const byte *&srcP, byte param) {
}
bool MusicDriver::cmdNoOperation(const byte *&srcP, byte param) {
+ debugC(3, kDebugSound, "cmdNoOperation");
return false;
}
bool MusicDriver::musSkipWord(const byte *&srcP, byte param) {
+ debugC(3, kDebugSound, "musSkipWord");
srcP += 2;
return false;
}
-
bool MusicDriver::cmdFreezeFrequency(const byte *&srcP, byte param) {
+ debugC(3, kDebugSound, "cmdFreezeFrequency %d", param);
_channels[param]._changeFrequency = false;
return false;
}
bool MusicDriver::cmdChangeFrequency(const byte *&srcP, byte param) {
- if (param != 7 || !_fieldF) {
+ debugC(3, kDebugSound, "cmdChangeFrequency %d", param);
+
+ if (param != 7 || !_exclude7) {
_channels[param]._freqCtrChange = (int8)*srcP++;
_channels[param]._freqCtr = 0xFF;
_channels[param]._changeFrequency = true;
@@ -125,16 +146,22 @@ bool MusicDriver::cmdChangeFrequency(const byte *&srcP, byte param) {
}
bool MusicDriver::musEndSubroutine(const byte *&srcP, byte param) {
+ debugC(3, kDebugSound, "musEndSubroutine %d", param);
+
if (param != 15) {
- _field1E = 0;
+ // Music has ended, so flag it stopped
+ _musicPlaying = false;
return true;
}
+ // Returning from subroutine, or looping back to start of music
srcP = _musSubroutines.empty() ? _musStartPtr : _musSubroutines.pop()._returnP;
return false;
}
bool MusicDriver::fxCallSubroutine(const byte *&srcP, byte param) {
+ debugC(3, kDebugSound, "fxCallSubroutine");
+
if (_fxSubroutines.size() < 16) {
const byte *startP = srcP + 2;
srcP = _musStartPtr + READ_LE_UINT16(srcP);
@@ -148,9 +175,10 @@ bool MusicDriver::fxCallSubroutine(const byte *&srcP, byte param) {
bool MusicDriver::fxSetCountdown(const byte *&srcP, byte param) {
// Set the countdown timer
if (!param)
- param = *++srcP;
+ param = *srcP++;
_fxCountdownTimer = param;
- _musDataPtr = srcP;
+ _fxDataPtr = srcP;
+ debugC(3, kDebugSound, "fxSetCountdown %d", param);
// Do paused handling and break out of processing loop
pausePostProcess();
@@ -158,8 +186,11 @@ bool MusicDriver::fxSetCountdown(const byte *&srcP, byte param) {
}
bool MusicDriver::fxEndSubroutine(const byte *&srcP, byte param) {
+ debugC(3, kDebugSound, "fxEndSubroutine %d", param);
+
if (param != 15) {
- _lowMusicIgnored = false;
+ // FX has ended, so flag it stopped
+ _fxPlaying = false;
return true;
}
@@ -168,25 +199,37 @@ bool MusicDriver::fxEndSubroutine(const byte *&srcP, byte param) {
}
void MusicDriver::playFX(uint effectId, const byte *data) {
- if (!_lowMusicIgnored || effectId < 7 || effectId >= 11) {
+ if (!_fxPlaying || effectId < 7 || effectId >= 11) {
_musStartPtr = nullptr;
_fxDataPtr = _fxStartPtr = data;
_fxCountdownTimer = 0;
_channels[7]._changeFrequency = _channels[8]._changeFrequency = false;
resetFX();
- _lowMusicIgnored = true;
+ _fxPlaying = true;
}
+
+ debugC(1, kDebugSound, "Starting FX %d", effectId);
+}
+
+void MusicDriver::stopFX() {
+ resetFX();
+ _fxPlaying = false;
+ _fxStartPtr = _fxDataPtr = nullptr;
}
void MusicDriver::playSong(const byte *data) {
- _musDataPtr = data;
+ _musDataPtr = _musStartPtr = data;
_musSubroutines.clear();
_musCountdownTimer = 0;
- _field1E = true;
+ _musicPlaying = true;
+ debugC(1, kDebugSound, "Starting song");
}
int MusicDriver::songCommand(uint commandId, byte volume) {
- if (RESTART_MUSIC == 1) {
+ if (commandId == STOP_SONG) {
+ _musicPlaying = false;
+ } else if (commandId == RESTART_SONG) {
+ _musicPlaying = true;
_musDataPtr = nullptr;
_musSubroutines.clear();
}
@@ -195,25 +238,25 @@ int MusicDriver::songCommand(uint commandId, byte volume) {
}
const CommandFn MusicDriver::MUSIC_COMMANDS[16] = {
- &MusicDriver::musCallSubroutine, &MusicDriver::musSetCountdown,
- &MusicDriver::musSetInstrument, &MusicDriver::cmdNoOperation,
- &MusicDriver::musSetPitchWheel, &MusicDriver::musSkipWord,
- &MusicDriver::musSetPanning, &MusicDriver::cmdNoOperation,
- &MusicDriver::musFade, &MusicDriver::musStartNote,
- &MusicDriver::musSetVolume, &MusicDriver::musInjectMidi,
- &MusicDriver::musPlayInstrument, &MusicDriver::cmdFreezeFrequency,
- &MusicDriver::cmdChangeFrequency, &MusicDriver::musEndSubroutine
+ &MusicDriver::musCallSubroutine, &MusicDriver::musSetCountdown,
+ &MusicDriver::musSetInstrument, &MusicDriver::cmdNoOperation,
+ &MusicDriver::musSetPitchWheel, &MusicDriver::musSkipWord,
+ &MusicDriver::musSetPanning, &MusicDriver::cmdNoOperation,
+ &MusicDriver::musFade, &MusicDriver::musStartNote,
+ &MusicDriver::musSetVolume, &MusicDriver::musInjectMidi,
+ &MusicDriver::musPlayInstrument, &MusicDriver::cmdFreezeFrequency,
+ &MusicDriver::cmdChangeFrequency, &MusicDriver::musEndSubroutine
};
const CommandFn MusicDriver::FX_COMMANDS[16] = {
- &MusicDriver::fxCallSubroutine, &MusicDriver::fxSetCountdown,
- &MusicDriver::fxSetInstrument, &MusicDriver::fxSetVolume,
- &MusicDriver::fxMidiReset, &MusicDriver::fxMidiDword,
- &MusicDriver::fxSetPanning, &MusicDriver::fxChannelOff,
- &MusicDriver::fxFade, &MusicDriver::fxStartNote,
- &MusicDriver::cmdNoOperation, &MusicDriver::fxInjectMidi,
- &MusicDriver::fxPlayInstrument, &MusicDriver::cmdFreezeFrequency,
- &MusicDriver::cmdChangeFrequency, &MusicDriver::fxEndSubroutine
+ &MusicDriver::fxCallSubroutine, &MusicDriver::fxSetCountdown,
+ &MusicDriver::fxSetInstrument, &MusicDriver::fxSetVolume,
+ &MusicDriver::fxMidiReset, &MusicDriver::fxMidiDword,
+ &MusicDriver::fxSetPanning, &MusicDriver::fxChannelOff,
+ &MusicDriver::fxFade, &MusicDriver::fxStartNote,
+ &MusicDriver::cmdNoOperation, &MusicDriver::fxInjectMidi,
+ &MusicDriver::fxPlayInstrument, &MusicDriver::cmdFreezeFrequency,
+ &MusicDriver::cmdChangeFrequency, &MusicDriver::fxEndSubroutine
};
/*------------------------------------------------------------------------*/
@@ -258,20 +301,21 @@ void AdlibMusicDriver::playSong(const byte *data) {
Common::StackLock slock(_driverMutex);
MusicDriver::playSong(data);
_field180 = 0;
+ resetFrequencies();
}
int AdlibMusicDriver::songCommand(uint commandId, byte volume) {
Common::StackLock slock(_driverMutex);
+ MusicDriver::songCommand(commandId, volume);
- if (commandId == STOP_MUSIC) {
- _field1E = 0;
+ if (commandId == STOP_SONG) {
_field180 = 0;
resetFrequencies();
- } else if (commandId == RESTART_MUSIC) {
+ } else if (commandId == RESTART_SONG) {
_field180 = 0;
- _field1E = true;
+ _musicPlaying = true;
} else if (commandId < 0x100) {
- if (_field1E) {
+ if (_musicPlaying) {
_field180 = commandId;
_field182 = 63;
}
@@ -286,6 +330,7 @@ int AdlibMusicDriver::songCommand(uint commandId, byte volume) {
void AdlibMusicDriver::write(int reg, int val) {
_queue.push(RegisterValue(reg, val));
+ debugC(9, kDebugSound, "%.2x %.2x", reg, val);
}
void AdlibMusicDriver::flush() {
@@ -300,7 +345,7 @@ void AdlibMusicDriver::flush() {
void AdlibMusicDriver::pausePostProcess() {
if (_field180 && ((_field181 += _field180) < 0)) {
if (--_field182 < 0) {
- _field1E = false;
+ _musicPlaying = false;
_field180 = 0;
resetFrequencies();
} else {
@@ -311,7 +356,7 @@ void AdlibMusicDriver::pausePostProcess() {
}
}
- for (int channelNum = 8; channelNum != 6 || (channelNum == 7 && _fieldF); --channelNum) {
+ for (int channelNum = 8; channelNum != 6 || (channelNum == 7 && _exclude7); --channelNum) {
Channel &chan = _channels[channelNum];
if (!chan._changeFrequency || (chan._freqCtr += chan._freqCtrChange) >= 0)
continue;
@@ -349,7 +394,7 @@ void AdlibMusicDriver::pausePostProcess() {
}
void AdlibMusicDriver::resetFX() {
- if (!_fieldF) {
+ if (!_exclude7) {
_channels[7]._frequency = 0;
setFrequency(7, 0);
_channels[7]._volume = 63;
@@ -386,7 +431,7 @@ void AdlibMusicDriver::setOutputLevel(byte channelNum, uint level) {
void AdlibMusicDriver::playInstrument(byte channelNum, const byte *data) {
byte op1 = OPERATOR1_INDEXES[channelNum];
byte op2 = OPERATOR2_INDEXES[channelNum];
-
+ debugC(2, kDebugSound, "---START-playInstrument - %d", channelNum);
write(0x20 + op1, *data++);
write(0x40 + op1, *data++);
write(0x60 + op1, *data++);
@@ -408,10 +453,13 @@ void AdlibMusicDriver::playInstrument(byte channelNum, const byte *data) {
write(0x60 + op2, *data++);
write(0x80 + op2, *data++);
write(0xE0 + op2, *data++);
- write(0xC0 + op2, *data++);
+ write(0xC0 + channelNum, *data++);
+
+ debugC(2, kDebugSound, "---END-playInstrument");
}
bool AdlibMusicDriver::musSetInstrument(const byte *&srcP, byte param) {
+ debugC(3, kDebugSound, "musSetInstrument %d", param);
_musInstrumentPtrs[param] = srcP;
srcP += 26;
@@ -420,12 +468,14 @@ bool AdlibMusicDriver::musSetInstrument(const byte *&srcP, byte param) {
bool AdlibMusicDriver::musSetPitchWheel(const byte *&srcP, byte param) {
// Adlib does not support this
+ debugC(3, kDebugSound, "musSetPitchWheel");
srcP += 2;
return false;
}
bool AdlibMusicDriver::musSetPanning(const byte *&srcP, byte param) {
// Adlib does not support this
+ debugC(3, kDebugSound, "musSetPanning");
++srcP;
return false;
}
@@ -434,6 +484,7 @@ bool AdlibMusicDriver::musFade(const byte *&srcP, byte param) {
++srcP;
if (param < 7)
setFrequency(param, _channels[param]._frequency);
+ debugC(3, kDebugSound, "musFade");
return false;
}
@@ -443,18 +494,24 @@ bool AdlibMusicDriver::musStartNote(const byte *&srcP, byte param) {
byte note = *srcP++;
++srcP; // Second byte is fade, which is unused by Adlib
uint freq = calcFrequency(note);
+ debugC(3, kDebugSound, "musStartNote %x -> %x", note, freq);
+
setFrequency(param, freq);
- _channels[param]._frequency = freq | 0x2000;
+ freq |= 0x2000;
+ _channels[param]._frequency = freq;
setFrequency(param, freq);
} else {
srcP += 2;
+ debugC(3, kDebugSound, "musStartNote skipped");
}
return false;
}
bool AdlibMusicDriver::musSetVolume(const byte *&srcP, byte param) {
- if (*srcP++ == 2 && !_field180) {
+ debugC(3, kDebugSound, "musSetVolume %d", (int)*srcP);
+
+ if (*srcP++ == 5 && !_field180) {
_channels[param]._volume = *srcP;
setOutputLevel(param, *srcP);
}
@@ -466,6 +523,7 @@ bool AdlibMusicDriver::musSetVolume(const byte *&srcP, byte param) {
bool AdlibMusicDriver::musInjectMidi(const byte *&srcP, byte param) {
// Adlib does not support MIDI. So simply keep skipping over bytes
// until an 'F7' byte is found that flags the end of the MIDI data
+ debugC(3, kDebugSound, "musInjectMidi");
while (*srcP++ != 0xF7)
;
@@ -473,13 +531,17 @@ bool AdlibMusicDriver::musInjectMidi(const byte *&srcP, byte param) {
}
bool AdlibMusicDriver::musPlayInstrument(const byte *&srcP, byte param) {
+ byte instrument = *srcP++;
+ debugC(3, kDebugSound, "musPlayInstrument %d, %d", param, instrument);
+
if (param < 7)
- playInstrument(param, _musInstrumentPtrs[param]);
+ playInstrument(param, _musInstrumentPtrs[instrument]);
return false;
}
bool AdlibMusicDriver::fxSetInstrument(const byte *&srcP, byte param) {
+ debugC(3, kDebugSound, "fxSetInstrument %d", param);
_fxInstrumentPtrs[param] = srcP;
srcP += 11;
@@ -487,7 +549,9 @@ bool AdlibMusicDriver::fxSetInstrument(const byte *&srcP, byte param) {
}
bool AdlibMusicDriver::fxSetVolume(const byte *&srcP, byte param) {
- if (!_field180 && (!_fieldF || param != 7)) {
+ debugC(3, kDebugSound, "fxSetVolume %d", (int)*srcP);
+
+ if (!_field180 && (!_exclude7 || param != 7)) {
_channels[param]._volume = *srcP;
setOutputLevel(param, *srcP);
}
@@ -497,16 +561,20 @@ bool AdlibMusicDriver::fxSetVolume(const byte *&srcP, byte param) {
}
bool AdlibMusicDriver::fxMidiReset(const byte *&srcP, byte param) {
+ debugC(3, kDebugSound, "fxMidiReset");
return false;
}
bool AdlibMusicDriver::fxMidiDword(const byte *&srcP, byte param) {
+ debugC(3, kDebugSound, "fxMidiDword");
return false;
}
bool AdlibMusicDriver::fxSetPanning(const byte *&srcP, byte param) {
byte note = *srcP++;
- if (!_fieldF || param != 7) {
+ debugC(3, kDebugSound, "fxSetPanning - %x", note);
+
+ if (!_exclude7 || param != 7) {
uint freq = calcFrequency(note);
setFrequency(param, freq);
_channels[param]._frequency = freq;
@@ -516,6 +584,7 @@ bool AdlibMusicDriver::fxSetPanning(const byte *&srcP, byte param) {
}
bool AdlibMusicDriver::fxChannelOff(const byte *&srcP, byte param) {
+ debugC(3, kDebugSound, "fxChannelOff %d", param);
_channels[param]._frequency &= ~0x2000;
write(0xB0 + param, _channels[param]._frequency);
return false;
@@ -523,7 +592,9 @@ bool AdlibMusicDriver::fxChannelOff(const byte *&srcP, byte param) {
bool AdlibMusicDriver::fxFade(const byte *&srcP, byte param) {
uint freq = calcFrequency(*srcP++);
- if (!_fieldF || param != 7) {
+ debugC(3, kDebugSound, "fxFade %d %x", param, freq);
+
+ if (!_exclude7 || param != 7) {
_channels[param]._frequency = freq;
setFrequency(param, freq);
}
@@ -532,14 +603,18 @@ bool AdlibMusicDriver::fxFade(const byte *&srcP, byte param) {
}
bool AdlibMusicDriver::fxStartNote(const byte *&srcP, byte param) {
- if (!_fieldF || param != 7) {
+ if (!_exclude7 || param != 7) {
byte note = *srcP++;
uint freq = calcFrequency(note);
+ debugC(3, kDebugSound, "fxStartNote %x -> %x", note, freq);
+
setFrequency(param, freq);
- _channels[param]._frequency = freq | 0x2000;
+ freq |= 0x2000;
+ _channels[param]._frequency = freq;
setFrequency(param, freq);
} else {
++srcP;
+ debugC(3, kDebugSound, "fxStartNote skipped");
}
return false;
@@ -549,12 +624,16 @@ bool AdlibMusicDriver::fxInjectMidi(const byte *&srcP, byte param) {
// Surpringly, unlike the musInjectMidi, this version doesn't have
// any logic to skip over following MIDI data. Which must mean the opcode
// and/or it's data aren't present in the admus driver file
+ debugC(3, kDebugSound, "fxInjectMidi");
return false;
}
bool AdlibMusicDriver::fxPlayInstrument(const byte *&srcP, byte param) {
- if (!_fieldF || param != 7)
- playInstrument(param, _fxInstrumentPtrs[param]);
+ byte instrument = *srcP++;
+ debugC(3, kDebugSound, "fxPlayInstrument %d, %d", param, instrument);
+
+ if (!_exclude7 || param != 7)
+ playInstrument(param, _fxInstrumentPtrs[instrument]);
return false;
}
@@ -576,50 +655,68 @@ const uint AdlibMusicDriver::WAVEFORMS[24] = {
/*------------------------------------------------------------------------*/
-Music::Music(Audio::Mixer *mixer) : _mixer(mixer), _musicDriver(nullptr),
- _songData(nullptr) {
- _mixer = mixer;
+Music::Music() : _musicDriver(nullptr), _songData(nullptr),
+ _archiveType(ANY_ARCHIVE), _effectsData(nullptr), _musicOn(true) {
_musicDriver = new AdlibMusicDriver();
- loadEffectsData();
}
Music::~Music() {
+ stopSong();
delete _musicDriver;
delete[] _effectsData;
delete[] _songData;
}
void Music::loadEffectsData() {
- File file("admus");
- Common::String md5str = Common::computeStreamMD5AsString(file, 8192);
+ // Check whether it's the first load, or switching from intro to game data
+ if (_effectsData && !(_archiveType == INTRO_ARCHIVE && File::_currentArchive != INTRO_ARCHIVE))
+ return;
- if (md5str != "be8989a5e868913f0e53963046e3ea13")
- error("Unknown music driver encountered");
+ // Stop any prior FX
+ stopFX();
+ delete[] _effectsData;
+ _archiveType = File::_currentArchive;
- // Load in the driver data
+ // Load in an entire driver so we have quick access to the effects data
+ // that's hardcoded within it
+ File file("blastmus");
byte *effectsData = new byte[file.size()];
file.seek(0);
file.read(effectsData, file.size());
file.close();
_effectsData = effectsData;
+ // Locate the playFX routine
+ const byte *fx = effectsData + READ_LE_UINT16(effectsData + 10) + 12;
+ assert(READ_BE_UINT16(fx + 28) == 0x81FB);
+ uint numEffects = READ_LE_UINT16(fx + 30);
+
+ assert(READ_BE_UINT16(fx + 36) == 0x8B87);
+ const byte *table = effectsData + READ_LE_UINT16(fx + 38);
+
// Extract the effects offsets
- _effectsOffsets.resize(180);
- const int EFFECTS_OFFSET = 0x91D;
- for (int idx = 0; idx < 180; ++idx)
- _effectsOffsets[idx] = READ_LE_UINT16(&effectsData[EFFECTS_OFFSET + idx * 2]);
+ _effectsOffsets.resize(numEffects);
+ for (uint idx = 0; idx < numEffects; ++idx)
+ _effectsOffsets[idx] = READ_LE_UINT16(&table[idx * 2]);
}
void Music::playFX(uint effectId) {
+ stopFX();
+ loadEffectsData();
+
if (effectId < _effectsOffsets.size()) {
const byte *dataP = &_effectsData[_effectsOffsets[effectId]];
_musicDriver->playFX(effectId, dataP);
}
}
+void Music::stopFX() {
+ _musicDriver->stopFX();
+}
+
int Music::songCommand(uint commandId, byte volume) {
int result = _musicDriver->songCommand(commandId, volume);
- if (commandId == STOP_MUSIC) {
+ if (commandId == STOP_SONG) {
delete[] _songData;
_songData = nullptr;
}
@@ -628,8 +725,7 @@ int Music::songCommand(uint commandId, byte volume) {
}
void Music::playSong(Common::SeekableReadStream &stream) {
- if (_songData)
- stopMusic();
+ stopSong();
byte *songData = new byte[stream.size()];
stream.seek(0);
@@ -639,7 +735,7 @@ void Music::playSong(Common::SeekableReadStream &stream) {
_musicDriver->playSong(_songData);
}
-void Music::playSong(const Common::String &name) {
+void Music::playSong(const Common::String &name, int param) {
File f(name);
playSong(f);
}
diff --git a/engines/xeen/music.h b/engines/xeen/music.h
index a715471088..bf77398885 100644
--- a/engines/xeen/music.h
+++ b/engines/xeen/music.h
@@ -29,6 +29,7 @@
#include "common/mutex.h"
#include "common/queue.h"
#include "common/stack.h"
+#include "xeen/files.h"
#define CHANNEL_COUNT 9
@@ -39,7 +40,7 @@ namespace OPL {
namespace Xeen {
enum MusicCommand {
- STOP_MUSIC = 0, RESTART_MUSIC = 1, SET_VOLUME = 0x100,
+ STOP_SONG = 0, RESTART_SONG = 1, SET_VOLUME = 0x100,
GET_STATUS = 0xFFE0
};
@@ -77,10 +78,10 @@ private:
Common::Stack<Subroutine> _musSubroutines, _fxSubroutines;
int _musCountdownTimer;
int _fxCountdownTimer;
- bool _lowMusicIgnored;
const byte *_fxDataPtr, *_musDataPtr;
const byte *_fxStartPtr;
const byte *_musStartPtr;
+ uint _frameCtr;
private:
/**
* Executes the next command
@@ -90,8 +91,9 @@ private:
bool command(const byte *&srcP);
protected:
Common::Array<Channel> _channels;
- bool _fieldF;
- bool _field1E;
+ bool _exclude7;
+ bool _musicPlaying;
+ bool _fxPlaying;
protected:
/**
* Executes a series of commands until instructed to stop
@@ -148,7 +150,7 @@ public:
/**
* Destructor
*/
- virtual ~MusicDriver() {}
+ virtual ~MusicDriver();
/**
* Starts an special effect playing
@@ -156,6 +158,11 @@ public:
virtual void playFX(uint effectId, const byte *data);
/**
+ * Stop any playing FX
+ */
+ void stopFX();
+
+ /**
* Plays a song
*/
virtual void playSong(const byte *data);
@@ -298,6 +305,7 @@ private:
const byte *_effectsData;
Common::Array<uint16> _effectsOffsets;
const byte *_songData;
+ ArchiveType _archiveType;
private:
/**
* Loads effects data that was embedded in the music driver
@@ -308,11 +316,10 @@ private:
* Updates any playing music
*/
void update();
-
-protected:
- Audio::Mixer *_mixer;
public:
- Music(Audio::Mixer *mixer);
+ bool _musicOn;
+public:
+ Music();
~Music();
/**
@@ -321,6 +328,11 @@ public:
void playFX(uint effectId);
/**
+ * Stops any currently playing FX
+ */
+ void stopFX();
+
+ /**
* Executes special music command
*/
int songCommand(uint commandId, byte volume = 0);
@@ -328,12 +340,17 @@ public:
/**
* Stops any currently playing music
*/
- void stopMusic() { songCommand(STOP_MUSIC); }
+ void stopSong() { songCommand(STOP_SONG); }
+
+ /**
+ * Restart a previously playing song (which must still be loaded)
+ */
+ void restartSong() { songCommand(RESTART_SONG); }
/**
- * Restart the music
+ * Sets the music volume
*/
- void restartMusic() { songCommand(RESTART_MUSIC); }
+ void setMusicVolume(byte volume) { songCommand(SET_VOLUME, volume); }
/**
* Plays a song
@@ -343,7 +360,14 @@ public:
/**
* Plays a song
*/
- void playSong(const Common::String &name);
+ void playSong(const Common::String &name, int param = 0);
+
+ /**
+ * Plays a song
+ */
+ void playSong(const byte *data) {
+ _musicDriver->playSong(data);
+ }
};
} // End of namespace Xeen
diff --git a/engines/xeen/party.cpp b/engines/xeen/party.cpp
index 3315cb2816..292ac01d2c 100644
--- a/engines/xeen/party.cpp
+++ b/engines/xeen/party.cpp
@@ -405,7 +405,7 @@ void Party::addTime(int numMinutes) {
_activeParty[idx]._conditions[WEAK]++;
}
- ErrorScroll::show(_vm, THE_PARTY_NEEDS_REST, WT_NONFREEZED_WAIT);
+ ErrorScroll::show(_vm, Res.THE_PARTY_NEEDS_REST, WT_NONFREEZED_WAIT);
}
_vm->_interface->drawParty(true);
@@ -529,8 +529,8 @@ int Party::subtract(int mode, uint amount, int whereId, ErrorWaitType wait) {
void Party::notEnough(int consumableId, int whereId, bool mode, ErrorWaitType wait) {
Common::String msg = Common::String::format(
- mode ? NO_X_IN_THE_Y : NOT_ENOUGH_X_IN_THE_Y,
- CONSUMABLE_NAMES[consumableId], WHERE_NAMES[whereId]);
+ mode ? Res.NO_X_IN_THE_Y : Res.NOT_ENOUGH_X_IN_THE_Y,
+ Res.CONSUMABLE_NAMES[consumableId], Res.WHERE_NAMES[whereId]);
ErrorScroll::show(_vm, msg, wait);
}
@@ -583,14 +583,14 @@ void Party::giveTreasure() {
events.clearEvents();
w.close();
w.open();
- w.writeString(Common::String::format(PARTY_FOUND, _treasure._gold, _treasure._gems));
+ w.writeString(Common::String::format(Res.PARTY_FOUND, _treasure._gold, _treasure._gems));
w.update();
if (_vm->_mode != MODE_COMBAT)
_vm->_mode = MODE_7;
if (arePacksFull())
- ErrorScroll::show(_vm, BACKPACKS_FULL_PRESS_KEY, WT_NONFREEZED_WAIT);
+ ErrorScroll::show(_vm, Res.BACKPACKS_FULL_PRESS_KEY, WT_NONFREEZED_WAIT);
for (int categoryNum = 0; categoryNum < NUM_ITEM_CATEGORIES; ++categoryNum) {
for (int itemNum = 0; itemNum < MAX_TREASURE_ITEMS; ++itemNum) {
@@ -647,7 +647,7 @@ void Party::giveTreasure() {
}
}
- w.writeString(HIT_A_KEY);
+ w.writeString(Res.HIT_A_KEY);
w.update();
do {
@@ -705,12 +705,12 @@ void Party::giveTreasureToCharacter(Character &c, ItemCategory category, int ite
c._items[category].sort();
}
- w.writeString(GIVE_TREASURE_FORMATTING);
+ w.writeString(Res.GIVE_TREASURE_FORMATTING);
w.update();
events.ipause(5);
- w.writeString(Common::String::format(X_FOUND_Y, c._name.c_str(),
- ITEM_NAMES[category][treasureItem._id]));
+ w.writeString(Common::String::format(Res.X_FOUND_Y, c._name.c_str(),
+ Res.ITEM_NAMES[category][treasureItem._id]));
w.update();
events.ipause(5);
diff --git a/engines/xeen/resources.cpp b/engines/xeen/resources.cpp
index c171a1717b..b2d8c6d495 100644
--- a/engines/xeen/resources.cpp
+++ b/engines/xeen/resources.cpp
@@ -23,10 +23,25 @@
#include "common/scummsys.h"
#include "xeen/resources.h"
#include "xeen/files.h"
+#include "xeen/xeen.h"
+#include "xeen/worldofxeen/worldofxeen_resources.h"
namespace Xeen {
+Resources *g_resources;
+
+Resources *Resources::init(XeenEngine *vm) {
+ if (vm->getGameID() == GType_Clouds || vm->getGameID() == GType_DarkSide
+ || vm->getGameID() == GType_WorldOfXeen)
+ g_resources = new WorldOfXeen::WorldOfXeenResources();
+ else
+ g_resources = new Resources();
+
+ return g_resources;
+}
+
Resources::Resources() {
+ g_resources = this;
_globalSprites.load("global.icn");
File f("mae.xen");
@@ -37,7 +52,7 @@ Resources::Resources() {
/*------------------------------------------------------------------------*/
-const char *const CREDITS =
+const char *const Resources::CREDITS =
"\013""012\010""000\003""c\014""35Designed and Directed By:\n"
"\014""17Jon Van Caneghem\003""l\n"
"\n"
@@ -72,52 +87,52 @@ const char *const CREDITS =
"\t190Clayton Retzer\n"
"\t190David Vela\003""c";
-const char *const OPTIONS_TITLE =
+const char *const Resources::OPTIONS_TITLE =
"\x0D\x01\003""c\014""dMight and Magic Options\n"
"World of Xeen\x02\n"
"\v117Copyright (c) 1993 NWC, Inc.\n"
"All Rights Reserved\x01";
-const char *const THE_PARTY_NEEDS_REST = "\x0B""012The Party needs rest!";
+const char *const Resources::THE_PARTY_NEEDS_REST = "\x0B""012The Party needs rest!";
-const char *const WHO_WILL = "\x03""c\x0B""000\x09""000%s\x0A\x0A"
+const char *const Resources::WHO_WILL = "\x03""c\x0B""000\x09""000%s\x0A\x0A"
"Who will\x0A%s?\x0A\x0B""055F1 - F%d";
-const char *const WHATS_THE_PASSWORD = "What's the Password?";
+const char *const Resources::WHATS_THE_PASSWORD = "What's the Password?";
-const char *const IN_NO_CONDITION = "\x0B""007%s is not in any condition to perform actions!";
+const char *const Resources::IN_NO_CONDITION = "\x0B""007%s is not in any condition to perform actions!";
-const char *const NOTHING_HERE = "\x03""c\x0B""010Nothing here.";
+const char *const Resources::NOTHING_HERE = "\x03""c\x0B""010Nothing here.";
-const char *const TERRAIN_TYPES[6] = {
+const char *const Resources::TERRAIN_TYPES[6] = {
"town", "cave", "towr", "cstl", "dung", "scfi"
};
-const char *const SURFACE_TYPE_NAMES[15] = {
+const char *const Resources::SURFACE_TYPE_NAMES[15] = {
nullptr, "mount", "ltree", "dtree", "grass", "snotree", "snomnt",
"dedltree", "mount", "lavamnt", "palm", "dmount", "dedltree",
"dedltree", "dedltree"
};
-const char *const SURFACE_NAMES[16] = {
+const char *const Resources::SURFACE_NAMES[16] = {
"water.srf", "dirt.srf", "grass.srf", "snow.srf", "swamp.srf",
"lava.srf", "desert.srf", "road.srf", "dwater.srf", "tflr.srf",
"sky.srf", "croad.srf", "sewer.srf", "cloud.srf", "scortch.srf",
"space.srf"
};
-const char *const WHO_ACTIONS[32] = {
+const char *const Resources::WHO_ACTIONS[32] = {
"search", "open", "drink", "mine", "touch", "read", "learn", "take",
"bang", "steal", "bribe", "pay", "sit", "try", "turn", "bathe",
"destroy", "pull", "descend", "toss a coin", "pray", "join", "act",
"play", "push", "rub", "pick", "eat", "sign", "close", "look", "try"
};
-const char *const WHO_WILL_ACTIONS[4] = {
+const char *const Resources::WHO_WILL_ACTIONS[4] = {
"Open Grate", "Open Door", "Open Scroll", "Select Char"
};
-const byte SYMBOLS[20][64] = {
+const byte Resources::SYMBOLS[20][64] = {
{ // 0
0x00, 0x00, 0xA8, 0xA4, 0xA4, 0xA4, 0xA4, 0xA4, 0x00, 0xA8, 0x9E, 0x9C, 0x9C, 0x9E, 0x9E, 0x9E,
0xAC, 0x9C, 0xA4, 0xAC, 0xAC, 0x9A, 0x9A, 0x9A, 0xAC, 0x9E, 0xAC, 0xA8, 0xA8, 0xA6, 0x97, 0x98,
@@ -240,7 +255,7 @@ const byte SYMBOLS[20][64] = {
}
};
-const byte TEXT_COLORS[40][4] = {
+const byte Resources::TEXT_COLORS[40][4] = {
{ 0x00, 0x19, 0x19, 0x19 },
{ 0x00, 0x08, 0x08, 0x08 },
{ 0x00, 0x0F, 0x0F, 0x0F },
@@ -283,61 +298,61 @@ const byte TEXT_COLORS[40][4] = {
{ 0x00, 0xDB, 0xDB, 0xDB },
};
-const char *const DIRECTION_TEXT_UPPER[4] = { "NORTH", "EAST", "SOUTH", "WEST" };
+const char *const Resources::DIRECTION_TEXT_UPPER[4] = { "NORTH", "EAST", "SOUTH", "WEST" };
-const char *const DIRECTION_TEXT[4] = { "North", "East", "South", "West" };
+const char *const Resources::DIRECTION_TEXT[4] = { "North", "East", "South", "West" };
-const char *const RACE_NAMES[5] = { "Human", "Elf", "Dwarf", "Gnome", "H-Orc" };
+const char *const Resources::RACE_NAMES[5] = { "Human", "Elf", "Dwarf", "Gnome", "H-Orc" };
-const int RACE_HP_BONUSES[5] = { 0, -2, 1, -1, 2 };
+const int Resources::RACE_HP_BONUSES[5] = { 0, -2, 1, -1, 2 };
-const int RACE_SP_BONUSES[5][2] = {
+const int Resources::RACE_SP_BONUSES[5][2] = {
{ 0, 0 }, { 2, 0 }, { -1, -1 }, { 1, 1 }, { -2, -2 }
};
-const char *const ALIGNMENT_NAMES[3] = { "Good", "Neutral", "Evil" };
+const char *const Resources::ALIGNMENT_NAMES[3] = { "Good", "Neutral", "Evil" };
-const char *const SEX_NAMES[2] = { "Male", "Female" };
+const char *const Resources::SEX_NAMES[2] = { "Male", "Female" };
-const char *const SKILL_NAMES[18] = {
+const char *const Resources::SKILL_NAMES[18] = {
"Thievery", "Arms Master", "Astrologer", "Body Builder", "Cartographer",
"Crusader", "Direction Sense", "Linguist", "Merchant", "Mountaineer",
"Navigator", "Path Finder", "Prayer Master", "Prestidigitator",
"Swimmer", "Tracker", "Spot Secret Door", "Danger Sense"
};
-const char *const CLASS_NAMES[11] = {
+const char *const Resources::CLASS_NAMES[11] = {
"Knight", "Paladin", "Archer", "Cleric", "Sorcerer", "Robber",
"Ninja", "Barbarian", "Druid", "Ranger", nullptr
};
-const uint CLASS_EXP_LEVELS[10] = {
+const uint Resources::CLASS_EXP_LEVELS[10] = {
1500, 2000, 2000, 1500, 2000, 1000, 1500, 1500, 1500, 2000
};
-const char *const CONDITION_NAMES[17] = {
+const char *const Resources::CONDITION_NAMES[17] = {
"Cursed", "Heart Broken", "Weak", "Poisoned", "Diseased",
"Insane", "In Love", "Drunk", "Asleep", "Depressed", "Confused",
"Paralyzed", "Unconscious", "Dead", "Stone", "Eradicated", "Good"
};
-const int CONDITION_COLORS[17] = {
+const int Resources::CONDITION_COLORS[17] = {
9, 9, 9, 9, 9, 9, 9, 9, 32, 32, 32, 32, 6, 6, 6, 6, 15
};
-const char *const GOOD = "Good";
+const char *const Resources::GOOD = "Good";
-const char *const BLESSED = "\n\t020Blessed\t095%+d";
+const char *const Resources::BLESSED = "\n\t020Blessed\t095%+d";
-const char *const POWER_SHIELD = "\n\t020Power Shield\t095%+d";
+const char *const Resources::POWER_SHIELD = "\n\t020Power Shield\t095%+d";
-const char *const HOLY_BONUS = "\n\t020Holy Bonus\t095%+d";
+const char *const Resources::HOLY_BONUS = "\n\t020Holy Bonus\t095%+d";
-const char *const HEROISM = "\n\t020Heroism\t095%+d";
+const char *const Resources::HEROISM = "\n\t020Heroism\t095%+d";
-const char *const IN_PARTY = "\014""15In Party\014""d";
+const char *const Resources::IN_PARTY = "\014""15In Party\014""d";
-const char *const PARTY_DETAILS = "\015\003l\002\014""00"
+const char *const Resources::PARTY_DETAILS = "\015\003l\002\014""00"
"\013""001""\011""035%s"
"\013""009""\011""035%s"
"\013""017""\011""035%s"
@@ -354,23 +369,23 @@ const char *const PARTY_DETAILS = "\015\003l\002\014""00"
"\013""052""\011""136%s"
"\013""060""\011""136%s"
"\013""068""\011""136%s";
-const char *const PARTY_DIALOG_TEXT =
+const char *const Resources::PARTY_DIALOG_TEXT =
"%s\x2\x3""c\v106\t013Up\t048Down\t083\f37D\fdel\t118\f37R\fdem"
"\t153\f37C\fdreate\t188E\f37x\fdit\x1";
-const int FACE_CONDITION_FRAMES[17] = {
+const int Resources::FACE_CONDITION_FRAMES[17] = {
2, 2, 2, 1, 1, 4, 4, 4, 3, 2, 4, 3, 3, 5, 6, 7, 0
};
-const int CHAR_FACES_X[6] = { 10, 45, 81, 117, 153, 189 };
+const int Resources::CHAR_FACES_X[6] = { 10, 45, 81, 117, 153, 189 };
-const int HP_BARS_X[6] = { 13, 50, 86, 122, 158, 194 };
+const int Resources::HP_BARS_X[6] = { 13, 50, 86, 122, 158, 194 };
-const char *const NO_ONE_TO_ADVENTURE_WITH = "You have no one to adventure with";
+const char *const Resources::NO_ONE_TO_ADVENTURE_WITH = "You have no one to adventure with";
-const char *const YOUR_ROSTER_IS_FULL = "Your Roster is full!";
+const char *const Resources::YOUR_ROSTER_IS_FULL = "Your Roster is full!";
-const byte BACKGROUND_XLAT[] = {
+const byte Resources::BACKGROUND_XLAT[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0xF7, 0xFF, 0x09, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -385,12 +400,12 @@ const byte BACKGROUND_XLAT[] = {
0x00, 0x00
};
-const char *const PLEASE_WAIT = "\014""d\003""c\011""000"
+const char *const Resources::PLEASE_WAIT = "\014""d\003""c\011""000"
"\013""002Please Wait...";
-const char *const OOPS = "\003""c\011""000\013""002Oops...";
+const char *const Resources::OOPS = "\003""c\011""000\013""002Oops...";
-const int8 SCREEN_POSITIONING_X[4][48] = {
+const int8 Resources::SCREEN_POSITIONING_X[4][48] = {
{
-1, 0, 0, 0, 1, -1, 0, 0, 0, 1, -2, -1,
-1, 0, 0, 0, 1, 1, 2, -4, -3, -3, -2, -2,
@@ -414,7 +429,7 @@ const int8 SCREEN_POSITIONING_X[4][48] = {
}
};
-const int8 SCREEN_POSITIONING_Y[4][48] = {
+const int8 Resources::SCREEN_POSITIONING_Y[4][48] = {
{
0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2,
2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3,
@@ -438,42 +453,42 @@ const int8 SCREEN_POSITIONING_Y[4][48] = {
}
};
-const int MONSTER_GRID_BITMASK[12] = {
+const int Resources::MONSTER_GRID_BITMASK[12] = {
0xC, 8, 4, 0, 0xF, 0xF000, 0xF00, 0xF0, 0xF00, 0xF0, 0x0F, 0xF000
};
-const int INDOOR_OBJECT_X[2][12] = {
+const int Resources::INDOOR_OBJECT_X[2][12] = {
{ 5, -7, -112, 98, -8, -65, 49, -9, -34, 16, -58, 40 },
{ -35, -35, -142, 68, -35, -95, 19, -35, -62, -14, -98, 16 }
};
-const int MAP_OBJECT_Y[2][12] = {
+const int Resources::MAP_OBJECT_Y[2][12] = {
{ 2, 25, 25, 25, 50, 50, 50, 58, 58, 58, 58, 58 },
{ -65, -6, -6, -6, 36, 36, 36, 54, 54, 54, 54, 54 }
};
-const int INDOOR_MONSTERS_Y[4] = { 2, 34, 53, 59 };
+const int Resources::INDOOR_MONSTERS_Y[4] = { 2, 34, 53, 59 };
-const int OUTDOOR_OBJECT_X[2][12] = {
+const int Resources::OUTDOOR_OBJECT_X[2][12] = {
{ -5, -7, -112, 98, -8, -77, 61, -9, -43, 25, -74, 56 },
{ -35, -35, -142, 68, -35, -95, 19, -35, -62, -24, -98, 16 }
};
-const int OUTDOOR_MONSTER_INDEXES[26] = {
+const int Resources::OUTDOOR_MONSTER_INDEXES[26] = {
42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 69, 70,
71, 72, 73, 74, 75, 90, 91, 92, 93, 94, 112, 115, 118
};
-const int OUTDOOR_MONSTERS_Y[26] = {
+const int Resources::OUTDOOR_MONSTERS_Y[26] = {
59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 53, 53,
53, 53, 53, 53, 53, 34, 34, 34, 34, 34, 2, 2, 2
};
-const int DIRECTION_ANIM_POSITIONS[4][4] = {
+const int Resources::DIRECTION_ANIM_POSITIONS[4][4] = {
{ 0, 1, 2, 3 }, { 3, 0, 1, 2 }, { 2, 3, 0, 1 }, { 1, 2, 3, 0 }
};
-const byte WALL_SHIFTS[4][48] = {
+const byte Resources::WALL_SHIFTS[4][48] = {
{
12, 0, 12, 8, 12, 12, 0, 12, 8, 12, 12, 0,
12, 0, 12, 8, 12, 8, 12, 12, 0, 12, 0, 12,
@@ -497,14 +512,14 @@ const byte WALL_SHIFTS[4][48] = {
}
};
-const int DRAW_NUMBERS[25] = {
+const int Resources::DRAW_NUMBERS[25] = {
36, 37, 38, 43, 42, 41,
39, 20, 22, 24, 33, 31,
29, 26, 10, 11, 18, 16,
13, 5, 9, 6, 0, 4, 1
};
-const int DRAW_FRAMES[25][2] = {
+const int Resources::DRAW_FRAMES[25][2] = {
{ 18, 24 }, { 19, 23 }, { 20, 22 }, { 24, 18 }, { 23, 19 }, { 22, 20 },
{ 21, 21 }, { 11, 17 }, { 12, 16 }, { 13, 15 }, { 17, 11 }, { 16, 12 },
{ 15, 13 }, { 14, 14 }, { 6, 10 }, { 7, 9 }, { 10, 6 }, { 9, 7 },
@@ -512,11 +527,11 @@ const int DRAW_FRAMES[25][2] = {
{ 1, 1 }
};
-const int COMBAT_FLOAT_X[8] = { -2, -1, 0, 1, 2, 1, 0, -1 };
+const int Resources::COMBAT_FLOAT_X[8] = { -2, -1, 0, 1, 2, 1, 0, -1 };
-const int COMBAT_FLOAT_Y[8] = { -2, 0, 2, 0, -1, 0, 2, 0 };
+const int Resources::COMBAT_FLOAT_Y[8] = { -2, 0, 2, 0, -1, 0, 2, 0 };
-const int MONSTER_EFFECT_FLAGS[15][8] = {
+const int Resources::MONSTER_EFFECT_FLAGS[15][8] = {
{ 0x104, 0x105, 0x106, 0x107, 0x108, 0x109, 0x10A, 0x10B },
{ 0x10C, 0x10D, 0x10E, 0x10F, 0x0, 0x0, 0x0, 0x0 },
{ 0x110, 0x111, 0x112, 0x113, 0x0, 0x0, 0x0, 0x0 },
@@ -534,7 +549,7 @@ const int MONSTER_EFFECT_FLAGS[15][8] = {
{ 0x108, 0x108, 0x108, 0x108, 0x108, 0x108, 0x108, 0x108 }
};
-const uint SPELLS_ALLOWED[3][40] = {
+const uint Resources::SPELLS_ALLOWED[3][40] = {
{
0, 1, 2, 3, 5, 6, 7, 8, 9, 10,
12, 14, 16, 23, 26, 27, 28, 30, 31, 32,
@@ -553,31 +568,31 @@ const uint SPELLS_ALLOWED[3][40] = {
}
};
-const int BASE_HP_BY_CLASS[10] = { 10, 8, 7, 5, 4, 8, 7, 12, 6, 9 };
+const int Resources::BASE_HP_BY_CLASS[10] = { 10, 8, 7, 5, 4, 8, 7, 12, 6, 9 };
-const int AGE_RANGES[10] = { 1, 6, 11, 18, 36, 51, 76, 101, 201, 0xffff };
+const int Resources::AGE_RANGES[10] = { 1, 6, 11, 18, 36, 51, 76, 101, 201, 0xffff };
-const int AGE_RANGES_ADJUST[2][10] = {
+const int Resources::AGE_RANGES_ADJUST[2][10] = {
{ -250, -50, -20, -10, 0, -2, -5, -10, -20, -50 },
{ -250, -50, -20, -10, 0, 2, 5, 10, 20, 50 }
};
-const uint STAT_VALUES[24] = {
+const uint Resources::STAT_VALUES[24] = {
3, 5, 7, 9, 11, 13, 15, 17, 19, 21, 25, 30, 35, 40,
50, 75, 100, 125, 150, 175, 200, 225, 250,
};
-const int STAT_BONUSES[24] = {
+const int Resources::STAT_BONUSES[24] = {
-5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6,
7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 20
};
-const int ELEMENTAL_CATEGORIES[6] = { 8, 15, 20, 25, 33, 36 };
+const int Resources::ELEMENTAL_CATEGORIES[6] = { 8, 15, 20, 25, 33, 36 };
-const int ATTRIBUTE_CATEGORIES[10] = {
+const int Resources::ATTRIBUTE_CATEGORIES[10] = {
9, 17, 25, 33, 39, 45, 50, 56, 61, 72 };
-const int ATTRIBUTE_BONUSES[72] = {
+const int Resources::ATTRIBUTE_BONUSES[72] = {
2, 3, 5, 8, 12, 17, 23, 30, 38, 47, // Might bonus
2, 3, 5, 8, 12, 17, 23, 30, // INT bonus
2, 3, 5, 8, 12, 17, 23, 30, // PER bonus
@@ -590,46 +605,46 @@ const int ATTRIBUTE_BONUSES[72] = {
4, 6, 8, 10, 12, 14, 16, 18, 20, 25 // Thievery bonus
};
-const int ELEMENTAL_RESISTENCES[37] = {
+const int Resources::ELEMENTAL_RESISTENCES[37] = {
0, 5, 7, 9, 12, 15, 20, 25, 30, 5, 7, 9, 12, 15, 20, 25,
5, 10, 15, 20, 25, 10, 15, 20, 25, 40, 5, 7, 9, 11, 13, 15, 20, 25,
5, 10, 20
};
-const int ELEMENTAL_DAMAGE[37] = {
+const int Resources::ELEMENTAL_DAMAGE[37] = {
0, 2, 3, 4, 5, 10, 15, 20, 30, 2, 3, 4, 5, 10, 15, 20, 2, 4, 5, 10, 20,
2, 4, 8, 16, 32, 2, 3, 4, 5, 10, 15, 20, 30, 5, 10, 25
};
-const int WEAPON_DAMAGE_BASE[35] = {
+const int Resources::WEAPON_DAMAGE_BASE[35] = {
0, 3, 2, 3, 2, 2, 4, 1, 2, 4, 2, 3,
2, 2, 1, 1, 1, 1, 4, 4, 3, 2, 4, 2,
2, 2, 5, 3, 3, 3, 3, 5, 4, 2, 6
};
-const int WEAPON_DAMAGE_MULTIPLIER[35] = {
+const int Resources::WEAPON_DAMAGE_MULTIPLIER[35] = {
0, 3, 3, 4, 5, 4, 2, 3, 3, 3, 3, 3,
2, 4, 10, 6, 8, 9, 4, 3, 6, 8, 5, 6,
4, 5, 3, 5, 6, 7, 2, 2, 2, 2, 4
};
-const int METAL_DAMAGE[22] = {
+const int Resources::METAL_DAMAGE[22] = {
-3, -6, -4, -2, 2, 4, 6, 8, 10, 0, 1,
1, 2, 2, 3, 4, 5, 12, 15, 20, 30, 50
};
-const int METAL_DAMAGE_PERCENT[22] = {
+const int Resources::METAL_DAMAGE_PERCENT[22] = {
253, 252, 3, 2, 1, 2, 3, 4, 6, 0, 1,
1, 2, 2, 3, 4, 5, 6, 7, 8, 9, 10
};
-const int METAL_LAC[9] = { -3, 0, -2, -1, 1, 2, 4, 6, 8 };
+const int Resources::METAL_LAC[9] = { -3, 0, -2, -1, 1, 2, 4, 6, 8 };
-const int ARMOR_STRENGTHS[14] = { 0, 2, 4, 5, 6, 7, 8, 10, 4, 2, 1, 1, 1, 1 };
+const int Resources::ARMOR_STRENGTHS[14] = { 0, 2, 4, 5, 6, 7, 8, 10, 4, 2, 1, 1, 1, 1 };
-const int MAKE_ITEM_ARR1[6] = { 0, 8, 15, 20, 25, 33 };
+const int Resources::MAKE_ITEM_ARR1[6] = { 0, 8, 15, 20, 25, 33 };
-const int MAKE_ITEM_ARR2[6][7][2] = {
+const int Resources::MAKE_ITEM_ARR2[6][7][2] = {
{ { 0, 0 }, { 1, 3 }, { 2, 5 }, { 3, 6 }, { 4, 7 }, { 5, 8 }, { 8, 8 } },
{ { 0, 0 }, { 1, 3 }, { 2, 5 }, { 3, 6 }, { 4, 7 }, { 6, 7 }, { 7, 7 } },
{ { 0, 0 }, { 1, 2 }, { 1, 3 }, { 2, 4 }, { 3, 5 }, { 4, 5 }, { 5, 5 } },
@@ -638,7 +653,7 @@ const int MAKE_ITEM_ARR2[6][7][2] = {
{ { 0, 0 }, { 1, 1 }, { 1, 1 }, { 1, 2 }, { 2, 2 }, { 2, 3 }, { 3, 3 } }
};
-const int MAKE_ITEM_ARR3[10][7][2] = {
+const int Resources::MAKE_ITEM_ARR3[10][7][2] = {
{ { 0, 0 }, { 1, 4 }, { 2, 5 }, { 3, 6 }, { 4, 7 }, { 6, 10 }, { 10, 10 } },
{ { 0, 0 }, { 1, 3 }, { 2, 5 }, { 3, 6 }, { 4, 7 }, { 5, 8 }, { 8, 8 } },
{ { 0, 0 }, { 1, 3 }, { 2, 5 }, { 3, 6 }, { 4, 7 }, { 5, 8 }, { 8, 8 } },
@@ -651,44 +666,44 @@ const int MAKE_ITEM_ARR3[10][7][2] = {
{ { 0, 0 }, { 1, 2 }, { 1, 4 }, { 3, 6 }, { 5, 8 }, { 7, 10 }, { 10, 10 } }
};
-const int MAKE_ITEM_ARR4[2][7][2] = {
+const int Resources::MAKE_ITEM_ARR4[2][7][2] = {
{ { 0, 0 }, { 1, 4 }, { 3, 7 }, { 4, 8 }, { 5, 9 }, { 8, 9 }, { 9, 9 } },
{ { 0, 0 }, { 1, 4 }, { 2, 6 }, { 4, 7 }, { 6, 10 }, { 9, 13 }, { 13, 13 } }
};
-const int MAKE_ITEM_ARR5[8][2] = {
+const int Resources::MAKE_ITEM_ARR5[8][2] = {
{ 0, 0 }, { 1, 15 }, { 16, 30 }, { 31, 40 }, { 41, 50 },
{ 51, 60 }, { 61, 73 }, { 61, 73 }
};
-const int OUTDOOR_DRAWSTRCT_INDEXES[44] = {
+const int Resources::OUTDOOR_DRAWSTRCT_INDEXES[44] = {
37, 38, 39, 40, 41, 44, 42, 43, 47, 45, 46,
48, 49, 52, 50, 51, 66, 67, 68, 69, 70, 71,
72, 75, 73, 74, 87, 88, 89, 90, 91, 94, 92,
93, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120
};
-const int TOWN_MAXES[2][11] = {
+const int Resources::TOWN_MAXES[2][11] = {
{ 23, 13, 32, 16, 26, 16, 16, 16, 16, 16, 16 },
{ 26, 19, 48, 27, 26, 37, 16, 16, 16, 16, 16 }
};
-const char *const TOWN_ACTION_MUSIC[14] = {
+const char *const Resources::TOWN_ACTION_MUSIC[14] = {
"bank.m", "smith.m", "guild.m", "tavern.m", "temple.m",
"grounds.m", "endgame.m", "bank.m", "sf09.m", "guild.m",
"tavern.m", "temple.m", "smith.m", "endgame.m"
};
-const char *const TOWN_ACTION_SHAPES[4] = {
+const char *const Resources::TOWN_ACTION_SHAPES[4] = {
"bankr", "blck", "gild", "tvrn"
};
-const int TOWN_ACTION_FILES[2][7] = {
+const int Resources::TOWN_ACTION_FILES[2][7] = {
{ 3, 2, 4, 2, 4, 2, 1 }, { 5, 3, 7, 5, 4, 6, 1 }
};
-const char *const BANK_TEXT = "\x0D\x02\x03""c\x0B""122\x09""013"
+const char *const Resources::BANK_TEXT = "\x0D\x02\x03""c\x0B""122\x09""013"
"\x0C""37D\x0C""dep\x09""040\x0C""37W\x0C""dith\x09""067ESC"
"\x01\x09""000\x0B""000Bank of Xeen\x0B""015\n"
"Bank\x03l\n"
@@ -699,43 +714,43 @@ const char *const BANK_TEXT = "\x0D\x02\x03""c\x0B""122\x09""013"
"Gold\x03r\x09""000%s\x03l\n"
"Gems\x03r\x09""000%s";
-const char *const BLACKSMITH_TEXT = "\x01\x0D\x03""c\x0B""000\x09""000"
+const char *const Resources::BLACKSMITH_TEXT = "\x01\x0D\x03""c\x0B""000\x09""000"
"Store Options for\x09""039\x0B""027%s\x03""l\x0B""046\n"
"\x09""011\x0C""37B\x0C""drowse\n"
"\x09""000\x0B""090Gold\x03r\x09""000%s"
"\x02\x03""c\x0B""122\x09""040ESC\x01";
-const char *const GUILD_NOT_MEMBER_TEXT =
+const char *const Resources::GUILD_NOT_MEMBER_TEXT =
"\n\nYou have to be a member to shop here.";
-const char *const GUILD_TEXT = "\x03""c\x0B""027\x09""039%s"
+const char *const Resources::GUILD_TEXT = "\x03""c\x0B""027\x09""039%s"
"\x03l\x0B""046\n"
"\x09""012\x0C""37B\x0C""duy Spells\n"
"\x09""012\x0C""37S\x0C""dpell Info";
-const char *const TAVERN_TEXT =
+const char *const Resources::TAVERN_TEXT =
"\x0D\x03""c\x0B""000\x09""000Tavern Options for\x09""039"
"\x0B""027%s%s\x03l\x09""000"
"\x0B""090Gold\x03r\x09""000%s\x02\x03""c\x0B""122"
"\x09""021\x0C""37S\x0C""dign in\x09""060ESC\x01";
-const char *const FOOD_AND_DRINK =
+const char *const Resources::FOOD_AND_DRINK =
"\x03l\x09""017\x0B""046\x0C""37D\x0C""drink\n"
"\x09""017\x0C""37F\x0C""dood\n"
"\x09""017\x0C""37T\x0C""dip\n"
"\x09""017\x0C""37R\x0C""dumors";
-const char *const GOOD_STUFF = "\n"
+const char *const Resources::GOOD_STUFF = "\n"
"\n"
"Good Stuff\n"
"\n"
"Hit a key!";
-const char *const HAVE_A_DRINK = "\n\nHave a Drink\n\nHit a key!";
+const char *const Resources::HAVE_A_DRINK = "\n\nHave a Drink\n\nHit a key!";
-const char *const YOURE_DRUNK = "\n\nYou're Drunk\n\nHit a key!";
+const char *const Resources::YOURE_DRUNK = "\n\nYou're Drunk\n\nHit a key!";
-const int TAVERN_EXIT_LIST[2][6][5][2] = {
+const int Resources::TAVERN_EXIT_LIST[2][6][5][2] = {
{
{ { 21, 17 }, { 0, 0 }, { 20, 3 }, { 0, 0 }, { 0, 0 } },
{ { 13, 4 }, { 0, 0 }, { 19, 9 }, { 0, 0 }, { 0, 0 } },
@@ -753,7 +768,7 @@ const int TAVERN_EXIT_LIST[2][6][5][2] = {
}
};
-const char *const TEMPLE_TEXT =
+const char *const Resources::TEMPLE_TEXT =
"\x0D\x03""c\x0B""000\x09""000Temple Options for"
"\x09""039\x0B""027%s\x03l\x09""000\x0B""046"
"\x0C""37H\x0C""deal\x03r\x09""000%lu\x03l\n"
@@ -762,21 +777,21 @@ const char *const TEMPLE_TEXT =
"\x03l\x09""000\x0B""090Gold\x03r\x09""000%s"
"\x02\x03""c\x0B""122\x09""040ESC\x01";
-const char *const EXPERIENCE_FOR_LEVEL =
+const char *const Resources::EXPERIENCE_FOR_LEVEL =
"%s needs %lu experience for level %u.";
-const char *const LEARNED_ALL = "%s has learned all we can teach!";
+const char *const Resources::LEARNED_ALL = "%s has learned all we can teach!";
-const char *const ELIGIBLE_FOR_LEVEL = "%s is eligible for level %d.";
+const char *const Resources::ELIGIBLE_FOR_LEVEL = "%s is eligible for level %d.";
-const char *const TRAINING_TEXT =
+const char *const Resources::TRAINING_TEXT =
"\x0D\x03""cTraining Options\n"
"\n"
"%s\x03l\x0B""090\x09""000Gold\x03r\x09"
"000%s\x02\x03""c\x0B""122\x09""021"
"\x0C""37T\x0C""drain\x09""060ESC\x01";
-const char *const GOLD_GEMS =
+const char *const Resources::GOLD_GEMS =
"\x03""c\x0B""000\x09""000%s\x03l\n"
"\n"
"Gold\x03r\x09""000%s\x03l\n"
@@ -784,45 +799,45 @@ const char *const GOLD_GEMS =
"\x0C""37o\x0C""dld\x09""040G\x0C\x03""7e"
"\x0C""dms\x09""067ESC\x01";
-const char *const GOLD_GEMS_2 =
+const char *const Resources::GOLD_GEMS_2 =
"\x09""000\x0B""000\x03""c%s\x03l\n"
"\n"
"\x04""077Gold\x03r\x09""000%s\x03l\n"
"\x04""077Gems\x03r\x09""000%s\x03l\x09""000\x0B""051\x04""077\n"
"\x04""077";
-const char *const DEPOSIT_WITHDRAWL[2] = { "Deposit", "Withdrawl" };
+const char *const Resources::DEPOSIT_WITHDRAWL[2] = { "Deposit", "Withdrawl" };
-const char *const NOT_ENOUGH_X_IN_THE_Y =
+const char *const Resources::NOT_ENOUGH_X_IN_THE_Y =
"\x03""c\x0B""012Not enough %s in the %s!\x03l";
-const char *const NO_X_IN_THE_Y = "\x03""c\x0B""012No %s in the %s!\x03l";
+const char *const Resources::NO_X_IN_THE_Y = "\x03""c\x0B""012No %s in the %s!\x03l";
-const char *const STAT_NAMES[16] = {
+const char *const Resources::STAT_NAMES[16] = {
"Might", "Intellect", "Personality", "Endurance", "Speed",
"Accuracy", "Luck", "Age", "Level", "Armor Class", "Hit Points",
"Spell Points", "Resistances", "Skills", "Awards", "Experience"
};
-const char *const CONSUMABLE_NAMES[4] = { "Gold", "Gems", "Food", "Condition" };
+const char *const Resources::CONSUMABLE_NAMES[4] = { "Gold", "Gems", "Food", "Condition" };
-const char *const WHERE_NAMES[2] = { "Party", "Bank" };
+const char *const Resources::WHERE_NAMES[2] = { "Party", "Bank" };
-const char *const AMOUNT = "\x03""c\x09""000\x0B""051Amount\x03l\n";
+const char *const Resources::AMOUNT = "\x03""c\x09""000\x0B""051Amount\x03l\n";
-const char *const FOOD_PACKS_FULL = "\v007Your food packs are already full!";
+const char *const Resources::FOOD_PACKS_FULL = "\v007Your food packs are already full!";
-const char *const BUY_SPELLS =
+const char *const Resources::BUY_SPELLS =
"\x03""c\x0B""027\x09""039%s\x03l\x0B""046\n"
"\x09""012\x0C""37B\x0C""duy Spells\n"
"\x09""012\x0C""37S\x0C""dpell Info";
-const char *const GUILD_OPTIONS =
+const char *const Resources::GUILD_OPTIONS =
"\x0D\x0C""00\x03""c\x0B""000\x09""000Guild Options for%s"
"\x03l\x09""000\x0B""090Gold"
"\x03r\x09""000%s\x02\x03""c\x0B""122\x09""040ESC\x01";
-const int MISC_SPELL_INDEX[74] = {
+const int Resources::MISC_SPELL_INDEX[74] = {
NO_SPELL, MS_Light, MS_Awaken, MS_MagicArrow,
MS_FirstAid, MS_FlyingFist, MS_EnergyBlast, MS_Sleep,
MS_Revitalize, MS_CureWounds, MS_Sparks, MS_Shrapmetal,
@@ -844,7 +859,7 @@ const int MISC_SPELL_INDEX[74] = {
MS_StarBurst, MS_DivineIntervention
};
-const int SPELL_COSTS[77] = {
+const int Resources::SPELL_COSTS[77] = {
8, 1, 5, -2, 5, -2, 20, 10, 12, 8, 3,
- 3, 75, 40, 12, 6, 200, 10, 100, 30, -1, 30,
15, 25, 10, -2, 1, 2, 7, 20, -2, -2, 100,
@@ -854,13 +869,13 @@ const int SPELL_COSTS[77] = {
15, 5, 4, 10, 8, 30, 4, 5, 7, 5, 0
};
-const int DARK_SPELL_RANGES[12][2] = {
+const int Resources::DARK_SPELL_RANGES[12][2] = {
{ 0, 20 }, { 16, 35 }, { 27, 37 }, { 29, 39 },
{ 0, 17 }, { 14, 34 }, { 26, 37 }, { 29, 39 },
{ 0, 20 }, { 16, 35 }, { 27, 37 }, { 29, 39 }
};
-const int CLOUDS_SPELL_OFFSETS[5][20] = {
+const int Resources::CLOUDS_SPELL_OFFSETS[5][20] = {
{
1, 10, 20, 26, 27, 38, 40, 42, 45, 50,
55, 59, 60, 61, 62, 68, 72, 75, 77, 77
@@ -879,7 +894,7 @@ const int CLOUDS_SPELL_OFFSETS[5][20] = {
}
};
-const uint DARK_SPELL_OFFSETS[3][39] = {
+const uint Resources::DARK_SPELL_OFFSETS[3][39] = {
{
42, 1, 26, 59, 27, 10, 50, 68, 55, 62, 67, 73, 2,
5, 3, 31, 30, 52, 49, 28, 74, 0, 9, 7, 14, 8,
@@ -895,21 +910,21 @@ const uint DARK_SPELL_OFFSETS[3][39] = {
}
};
-const int SPELL_GEM_COST[77] = {
+const int Resources::SPELL_GEM_COST[77] = {
0, 0, 2, 1, 2, 4, 5, 0, 0, 0, 0, 10, 10, 10, 0, 0, 20, 4, 10, 20, 1, 10,
5, 5, 4, 2, 0, 0, 0, 10, 3, 1, 20, 4, 0, 20, 10, 10, 1, 10, 0, 0, 0, 2,
2, 0, 10, 10, 10, 0, 0, 10, 3, 2, 10, 1, 10, 10, 20, 0, 0, 1, 1, 20, 5, 20,
5, 0, 0, 0, 0, 5, 1, 2, 0, 2, 0
};
-const char *const NOT_A_SPELL_CASTER = "Not a spell caster...";
+const char *const Resources::NOT_A_SPELL_CASTER = "Not a spell caster...";
-const char *const SPELLS_FOR = "\xD\xC""d%s\x2\x3""c\x9""000\xB""002Spells for %s";
+const char *const Resources::SPELLS_FOR = "\xD\xC""d%s\x2\x3""c\x9""000\xB""002Spells for %s";
-const char *const SPELL_LINES_0_TO_9 =
+const char *const Resources::SPELL_LINES_0_TO_9 =
"\x2\x3l\xB""015\x9""0011\n2\n3\n4\n5\n6\n7\n8\n9\n0";
-const char *const SPELLS_DIALOG_SPELLS = "\x3l\xB""015"
+const char *const Resources::SPELLS_DIALOG_SPELLS = "\x3l\xB""015"
"\x9""010\xC""%2u%s\xC""d\x3l\n"
"\x9""010\xC""%2u%s\xC""d\x3l\n"
"\x9""010\xC""%2u%s\xC""d\x3l\n"
@@ -922,40 +937,40 @@ const char *const SPELLS_DIALOG_SPELLS = "\x3l\xB""015"
"\x9""010\xC""%2u%s\xC""d\x3l"
"\x9""004\xB""110%s - %lu\x1";
-const char *const SPELL_PTS = "Spell Pts";
+const char *const Resources::SPELL_PTS = "Spell Pts";
-const char *const GOLD = "Gold";
+const char *const Resources::GOLD = "Gold";
-const char *const SPELLS_PRESS_A_KEY =
+const char *const Resources::SPELLS_PRESS_A_KEY =
"\x3""c\xC""09%s\xC""d\x3l\n"
"\n"
"%s\x3""c\x9""000\xB""100Press a Key!";
-const char *const SPELLS_PURCHASE =
+const char *const Resources::SPELLS_PURCHASE =
"\x3l\xB""000\x9""000\xC""d%s Do you wish to purchase "
"\xC""09%s\xC""d for %u?";
-const char *const MAP_TEXT =
+const char *const Resources::MAP_TEXT =
"\x3""c\xB""000\x9""000%s\x3l\xB""139"
"\x9""000X = %d\x3r\x9""000Y = %d\x3""c\x9""000%s";
-const char *const LIGHT_COUNT_TEXT = "\x3l\n\n\t024Light\x3r\t124%d";
+const char *const Resources::LIGHT_COUNT_TEXT = "\x3l\n\n\t024Light\x3r\t124%d";
-const char *const FIRE_RESISTENCE_TEXT = "%c%sFire%s%u";
+const char *const Resources::FIRE_RESISTENCE_TEXT = "%c%sFire%s%u";
-const char *const ELECRICITY_RESISTENCE_TEXT = "%c%sElectricity%s%u";
+const char *const Resources::ELECRICITY_RESISTENCE_TEXT = "%c%sElectricity%s%u";
-const char *const COLD_RESISTENCE_TEXT = "c%sCold%s%u";
+const char *const Resources::COLD_RESISTENCE_TEXT = "c%sCold%s%u";
-const char *const POISON_RESISTENCE_TEXT = "%c%sPoison/Acid%s%u";
+const char *const Resources::POISON_RESISTENCE_TEXT = "%c%sPoison/Acid%s%u";
-const char *const CLAIRVOYANCE_TEXT = "%c%sClairvoyance%s";
+const char *const Resources::CLAIRVOYANCE_TEXT = "%c%sClairvoyance%s";
-const char *const LEVITATE_TEXT = "%c%sLevitate%s";
+const char *const Resources::LEVITATE_TEXT = "%c%sLevitate%s";
-const char *const WALK_ON_WATER_TEXT = "%c%sWalk on Water";
+const char *const Resources::WALK_ON_WATER_TEXT = "%c%sWalk on Water";
-const char *const GAME_INFORMATION =
+const char *const Resources::GAME_INFORMATION =
"\xD\x3""c\x9""000\xB""001\xC""37%s of Xeen\xC""d\n"
"Game Information\n"
"\n"
@@ -964,16 +979,16 @@ const char *const GAME_INFORMATION =
"\x9""032Time\x9""072Day\x9""112Year\n"
"\x9""032\xC""37%d:%02d%c\x9""072%u\x9""112%u\xC""d%s";
-const char *const WORLD_GAME_TEXT = "World";
-const char *const DARKSIDE_GAME_TEXT = "Darkside";
-const char *const CLOUDS_GAME_TEXT = "Clouds";
-const char *const SWORDS_GAME_TEXT = "Swords";
+const char *const Resources::WORLD_GAME_TEXT = "World";
+const char *const Resources::DARKSIDE_GAME_TEXT = "Darkside";
+const char *const Resources::CLOUDS_GAME_TEXT = "Clouds";
+const char *const Resources::SWORDS_GAME_TEXT = "Swords";
-const char *const WEEK_DAY_STRINGS[10] = {
+const char *const Resources::WEEK_DAY_STRINGS[10] = {
"Ten", "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine"
};
-const char *const CHARACTER_DETAILS =
+const char *const Resources::CHARACTER_DETAILS =
"\x3l\xB""041\x9""196%s\x9""000\xB""002%s : %s %s %s"
"\x3r\x9""053\xB""028\xC%02u%u\xC""d\x9""103\xC""%02u%u\xC""d"
"\x3l\x9""131\xC""%02u%d\xC""d\x9""196\xC""15%lu\xC""d\x3r"
@@ -987,11 +1002,11 @@ const char *const CHARACTER_DETAILS =
"\x3l\x9""131\xC""15%u\xC""d\x9""196\xC""%02u%s\xC""d"
"\x9""230%s%s%s%s\xC""d";
-const char *const PARTY_GOLD = "Party Gold";
+const char *const Resources::PARTY_GOLD = "Party Gold";
-const char *const PLUS_14 = "14+";
+const char *const Resources::PLUS_14 = "14+";
-const char *const CHARACTER_TEMPLATE =
+const char *const Resources::CHARACTER_TEMPLATE =
"\x1\xC""00\xD\x3l\x9""029\xB""018Mgt\x9""080Acy\x9""131H.P.\x9""196Experience"
"\x9""029\xB""041Int\x9""080Lck\x9""131S.P.\x9""029\xB""064Per\x9""080Age"
"\x9""131Resis\x9""196Party Gems\x9""029\xB""087End\x9""080Lvl\x9""131Skills"
@@ -999,36 +1014,36 @@ const char *const CHARACTER_TEMPLATE =
"\x9""290\xB""025\xC""37I\xC""dtem\x9""290\xB""057\xC""37Q"
"\xC""duick\x9""290\xB""089\xC""37E\xC""dxch\x9""290\xB""121Exit\x3l%s";
-const char *const EXCHANGING_IN_COMBAT = "\x3""c\xB""007\x9""000Exchanging in combat is not allowed!";
+const char *const Resources::EXCHANGING_IN_COMBAT = "\x3""c\xB""007\x9""000Exchanging in combat is not allowed!";
-const char *const CURRENT_MAXIMUM_RATING_TEXT = "\x2\x3""c%s\n"
+const char *const Resources::CURRENT_MAXIMUM_RATING_TEXT = "\x2\x3""c%s\n"
"Current / Maximum\n"
"\x3r\x9""054%lu\x3l\x9""058/ %lu\n"
"\x3""cRating: %s";
-const char *const CURRENT_MAXIMUM_TEXT = "\x2\x3""c%s\n"
+const char *const Resources::CURRENT_MAXIMUM_TEXT = "\x2\x3""c%s\n"
"Current / Maximum\n"
"\x3r\x9""054%u\x3l\x9""058/ %u";
-const char *const RATING_TEXT[24] = {
+const char *const Resources::RATING_TEXT[24] = {
"Nonexistant", "Very Poor", "Poor", "Very Low", "Low", "Averarage", "Good",
"Very Good", "High", "Very High", "Great", "Super", "Amazing", "Incredible",
"Gigantic", "Fantastic", "Astoundig", "Astonishing", "Monumental", "Tremendous",
"Collosal", "Awesome", "AweInspiring", "aUltimate"
};
-const char *const AGE_TEXT = "\x2\x3""c%s\n"
+const char *const Resources::AGE_TEXT = "\x2\x3""c%s\n"
"Current / Natural\n"
"\x3r\x9""057%u\x3l\x9""061/ %u\n"
"\x3""cBorn: %u / %u\x1";
-const char *const LEVEL_TEXT =
+const char *const Resources::LEVEL_TEXT =
"\x2\x3""c%s\n"
"Current / Maximum\n"
"\x3r\x9""054%u\x3l\x9""058/ %u\n"
"\x3""c%u Attack%s/Round\x1";
-const char *const RESISTENCES_TEXT =
+const char *const Resources::RESISTENCES_TEXT =
"\x2\x3""c%s\x3l\n"
"\x9""020Fire\x9""100%u\n"
"\x9""020Cold\x9""100%u\n"
@@ -1037,32 +1052,32 @@ const char *const RESISTENCES_TEXT =
"\x9""020Energy\x9""100%u\n"
"\x9""020Magic\x9""100%u";
-const char *const NONE = "\n\x9""020";
+const char *const Resources::NONE = "\n\x9""020";
-const char *const EXPERIENCE_TEXT = "\x2\x3""c%s\x3l\n"
+const char *const Resources::EXPERIENCE_TEXT = "\x2\x3""c%s\x3l\n"
"\x9""010Current:\x9""070%lu\n"
"\x9""010Next Level:\x9""070%s\x1";
-const char *const ELIGIBLE = "\xC""12Eligible\xC""d";
+const char *const Resources::ELIGIBLE = "\xC""12Eligible\xC""d";
-const char *const IN_PARTY_IN_BANK =
+const char *const Resources::IN_PARTY_IN_BANK =
"\x2\x3""cParty %s\n"
"%lu on hand\n"
"%lu in bank\x1\x3l";
-const char *const FOOD_TEXT =
+const char *const Resources::FOOD_TEXT =
"\x2\x3""cParty %s\n"
"%u on hand\n"
"Enough for %u day%s\x3l";
-const char *const EXCHANGE_WITH_WHOM = "\t010\v005Exchange with whom?";
+const char *const Resources::EXCHANGE_WITH_WHOM = "\t010\v005Exchange with whom?";
-const char *const QUICK_REF_LINE =
+const char *const Resources::QUICK_REF_LINE =
"\xB%3d\x9""007%u)\x9""027%s\x9""110%c%c%c\x3r\x9""160\xC%02u%u\xC""d"
"\x3l\x9""170\xC%02u%d\xC""d\x9""208\xC%02u%u\xC""d\x9""247\xC"
"%02u%u\xC""d\x9""270\xC%02u%c%c%c%c\xC""d";
-const char *const QUICK_REFERENCE =
+const char *const Resources::QUICK_REFERENCE =
"\xD\x3""cQuick Reference Chart\xB""012\x3l"
"\x9""007#\x9""027Name\x9""110Cls\x9""140Lvl\x9""176H.P."
"\x9""212S.P.\x9""241A.C.\x9""270Cond"
@@ -1070,39 +1085,39 @@ const char *const QUICK_REFERENCE =
"\xB""110\x9""064\x3""cGold\x9""144Gems\x9""224Food\xB""119"
"\x9""064\xC""15%lu\x9""144%lu\x9""224%u day%s\xC""d";
-const uint BLACKSMITH_MAP_IDS[2][4] = { { 28, 30, 73, 49 }, { 29, 31, 37, 43 } };
+const uint Resources::BLACKSMITH_MAP_IDS[2][4] = { { 28, 30, 73, 49 }, { 29, 31, 37, 43 } };
-const char *const ITEMS_DIALOG_TEXT1 =
+const char *const Resources::ITEMS_DIALOG_TEXT1 =
"\r\x2\x3""c\v021\t017\f37W\fdeap\t051\f37A\fdrmor\t085A"
"\f37c\fdces\t119\f37M\fdisc\t153%s\t187%s\t221%s"
"\t255%s\t289Exit";
-const char *const ITEMS_DIALOG_TEXT2 =
+const char *const Resources::ITEMS_DIALOG_TEXT2 =
"\r\x2\x3""c\v021\t017\f37W\fdeap\t051\f37A\fdrmor\t085A"
"\f37c\fdces\t119\f37M\fdisc\t153\f37%s\t289Exit";
-const char *const ITEMS_DIALOG_LINE1 = "\x3r\f%02u\f023%2d)\x3l\t028%s\n";
-const char *const ITEMS_DIALOG_LINE2 = "\x3r\f%02u\t023%2d)\x3l\t028%s\x3r\t000%lu\n";
-
-const char *const BTN_BUY = "\f37B\fduy";
-const char *const BTN_SELL = "\f37S\fdell";
-const char *const BTN_IDENTIFY = "\f37I\fddentify";
-const char *const BTN_FIX = "\f37F\fdix";
-const char *const BTN_USE = "\f37U\fdse";
-const char *const BTN_EQUIP = "\f37E\fdquip";
-const char *const BTN_REMOVE = "\f37R\fdem";
-const char *const BTN_DISCARD = "\f37D\fdisc";
-const char *const BTN_QUEST = "\f37Q\fduest";
-const char *const BTN_ENCHANT = "E\fdnchant";
-const char *const BTN_RECHARGE = "R\fdechrg";
-const char *const BTN_GOLD = "G\fdold";
-
-const char *const ITEM_BROKEN = "\f32broken ";
-const char *const ITEM_CURSED = "\f09cursed ";
-const char *const BONUS_NAMES[7] = {
+const char *const Resources::ITEMS_DIALOG_LINE1 = "\x3r\f%02u\f023%2d)\x3l\t028%s\n";
+const char *const Resources::ITEMS_DIALOG_LINE2 = "\x3r\f%02u\t023%2d)\x3l\t028%s\x3r\t000%lu\n";
+
+const char *const Resources::BTN_BUY = "\f37B\fduy";
+const char *const Resources::BTN_SELL = "\f37S\fdell";
+const char *const Resources::BTN_IDENTIFY = "\f37I\fddentify";
+const char *const Resources::BTN_FIX = "\f37F\fdix";
+const char *const Resources::BTN_USE = "\f37U\fdse";
+const char *const Resources::BTN_EQUIP = "\f37E\fdquip";
+const char *const Resources::BTN_REMOVE = "\f37R\fdem";
+const char *const Resources::BTN_DISCARD = "\f37D\fdisc";
+const char *const Resources::BTN_QUEST = "\f37Q\fduest";
+const char *const Resources::BTN_ENCHANT = "E\fdnchant";
+const char *const Resources::BTN_RECHARGE = "R\fdechrg";
+const char *const Resources::BTN_GOLD = "G\fdold";
+
+const char *const Resources::ITEM_BROKEN = "\f32broken ";
+const char *const Resources::ITEM_CURSED = "\f09cursed ";
+const char *const Resources::BONUS_NAMES[7] = {
"", "Dragon Slayer", "Undead Eater", "Golem Smasher",
"Bug Zapper", "Monster Masher", "Beast Bopper"
};
-const char *const WEAPON_NAMES[35] = {
+const char *const Resources::WEAPON_NAMES[35] = {
nullptr, "long sword ", "short sword ", "broad sword ", "scimitar ",
"cutlass ", "sabre ", "club ", "hand axe ", "katana ", "nunchakas ",
"wakazashi ", "dagger ", "mace ", "flail ", "cudgel ", "maul ", "spear ",
@@ -1111,42 +1126,43 @@ const char *const WEAPON_NAMES[35] = {
"short bow ", "long bow ", "crossbow ", "sling ", "Xeen Slayer Sword"
};
-const char *const ARMOR_NAMES[14] = {
+const char *const Resources::ARMOR_NAMES[14] = {
nullptr, "Robes ", "Scale rmor ", "ring mail ", "chain mail ",
"splint mail ", "plate mail ", "plate armor ", "shield ",
"helm ", "boots ", "cloak ", "cape ", "gauntlets "
};
-const char *const ACCESSORY_NAMES[11] = {
+const char *const Resources::ACCESSORY_NAMES[11] = {
nullptr, "ring ", "belt ", "broach ", "medal ", "charm ", "cameo ",
"scarab ", "pendant ", "necklace ", "amulet "
};
-const char *const MISC_NAMES[22] = {
+const char *const Resources::MISC_NAMES[22] = {
nullptr, "rod ", "jewel ", "gem ", "box ", "orb ", "horn ", "coin ",
"wand ", "whistle ", "potion ", "scroll ", "RogueVM",
"bogusg", "bogus", "bogus", "bogus", "bogus",
"bogus", "bogus", "bogus", "bogus"
};
-const char *const *ITEM_NAMES[4] = {
- &WEAPON_NAMES[0], &ARMOR_NAMES[0], &ACCESSORY_NAMES[0], &MISC_NAMES[0]
+const char *const *Resources::ITEM_NAMES[4] = {
+ &Resources::WEAPON_NAMES[0], &Resources::ARMOR_NAMES[0],
+ &Resources::ACCESSORY_NAMES[0], &Resources::MISC_NAMES[0]
};
-const char *const ELEMENTAL_NAMES[6] = {
+const char *const Resources::ELEMENTAL_NAMES[6] = {
"Fire", "Elec", "Cold", "Acid/Poison", "Energy", "Magic"
};
-const char *const ATTRIBUTE_NAMES[10] = {
+const char *const Resources::ATTRIBUTE_NAMES[10] = {
"might", "Intellect", "Personality", "Speed", "accuracy", "Luck",
"Hit Points", "Spell Points", "Armor Class", "Thievery"
};
-const char *const EFFECTIVENESS_NAMES[7] = {
+const char *const Resources::EFFECTIVENESS_NAMES[7] = {
nullptr, "Dragons", "Undead", "Golems", "Bugs", "Monsters", "Beasts"
};
-const char *const QUEST_ITEM_NAMES[85] = {
+const char *const Resources::QUEST_ITEM_NAMES[85] = {
"Deed to New Castle",
"Crystal Key to Witch Tower",
"Skeleton Key to Darzog's Tower",
@@ -1234,22 +1250,22 @@ const char *const QUEST_ITEM_NAMES[85] = {
"Energy Disk"
};
-const int WEAPON_BASE_COSTS[35] = {
+const int Resources::WEAPON_BASE_COSTS[35] = {
0, 50, 15, 100, 80, 40, 60, 1, 10, 150, 30, 60, 8, 50,
100, 15, 30, 15, 200, 80, 250, 150, 400, 100, 40, 120,
300, 100, 200, 300, 25, 100, 50, 15, 0
};
-const int ARMOR_BASE_COSTS[25] = {
+const int Resources::ARMOR_BASE_COSTS[25] = {
0, 20, 100, 200, 400, 600, 1000, 2000, 100, 60, 40, 250, 200, 100
};
-const int ACCESSORY_BASE_COSTS[11] = {
+const int Resources::ACCESSORY_BASE_COSTS[11] = {
0, 100, 100, 250, 100, 50, 300, 200, 500, 1000, 2000
};
-const int MISC_MATERIAL_COSTS[22] = {
+const int Resources::MISC_MATERIAL_COSTS[22] = {
0, 50, 1000, 500, 10, 100, 20, 10, 50, 10, 10, 100,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1
};
-const int MISC_BASE_COSTS[76] = {
+const int Resources::MISC_BASE_COSTS[76] = {
0, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,
100, 100, 100, 100, 200, 200, 200, 200, 200, 200, 200, 200,
200, 200, 200, 200, 200, 200, 200, 300, 300, 300, 300, 300,
@@ -1258,15 +1274,15 @@ const int MISC_BASE_COSTS[76] = {
500, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600,
600, 600, 600, 600
};
-const int METAL_BASE_MULTIPLIERS[22] = {
+const int Resources::METAL_BASE_MULTIPLIERS[22] = {
10, 25, 5, 75, 2, 5, 10, 20, 50, 2, 3, 5, 10, 20, 30, 40,
50, 60, 70, 80, 90, 100
};
-const int ITEM_SKILL_DIVISORS[4] = { 1, 2, 100, 10 };
+const int Resources::ITEM_SKILL_DIVISORS[4] = { 1, 2, 100, 10 };
-const int RESTRICTION_OFFSETS[4] = { 0, 35, 49, 60 };
+const int Resources::RESTRICTION_OFFSETS[4] = { 0, 35, 49, 60 };
-const int ITEM_RESTRICTIONS[86] = {
+const int Resources::ITEM_RESTRICTIONS[86] = {
0, 86, 86, 86, 86, 86, 86, 0, 6, 239, 239, 239, 2, 4, 4, 4, 4,
6, 70, 70, 70, 70, 94, 70, 0, 4, 239, 86, 86, 86, 70, 70, 70, 70,
0, 0, 0, 68, 100, 116, 125, 255, 255, 85, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -1274,94 +1290,94 @@ const int ITEM_RESTRICTIONS[86] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};
-const char *const NOT_PROFICIENT =
+const char *const Resources::NOT_PROFICIENT =
"\t000\v007\x3""c%ss are not proficient with a %s!";
-const char *const NO_ITEMS_AVAILABLE = "\x3""c\n"
+const char *const Resources::NO_ITEMS_AVAILABLE = "\x3""c\n"
"\t000No items available.";
-const char *const CATEGORY_NAMES[4] = { "Weapons", "Armor", "Accessories", "Miscellaneous" };
+const char *const Resources::CATEGORY_NAMES[4] = { "Weapons", "Armor", "Accessories", "Miscellaneous" };
-const char *const X_FOR_THE_Y =
+const char *const Resources::X_FOR_THE_Y =
"\x1\fd\r%s\v000\t000%s for %s the %s%s\v011\x2%s%s%s%s%s%s%s%s%s\x1\fd";
-const char *const X_FOR_Y =
+const char *const Resources::X_FOR_Y =
"\x1\xC""d\r\x3l\v000\t000%s for %s\x3r\t000%s\x3l\v011\x2%s%s%s%s%s%s%s%s%s\x1\xC""d";
-const char *const X_FOR_Y_GOLD =
+const char *const Resources::X_FOR_Y_GOLD =
"\x1\fd\r\x3l\v000\t000%s for %s\t150Gold - %lu%s\x3l\v011"
"\x2%s%s%s%s%s%s%s%s%s\x1\fd";
-const char *const FMT_CHARGES = "\x3rr\t000Charges\x3l";
+const char *const Resources::FMT_CHARGES = "\x3rr\t000Charges\x3l";
-const char *const AVAILABLE_GOLD_COST =
+const char *const Resources::AVAILABLE_GOLD_COST =
"\x1\fd\r\x3l\v000\t000Available %s%s\t150Gold - %lu\x3r\t000Cost"
"\x3l\v011\x2%s%s%s%s%s%s%s%s%s\x1\xC""d";
-const char *const CHARGES = "Charges";
+const char *const Resources::CHARGES = "Charges";
-const char *const COST = "Cost";
+const char *const Resources::COST = "Cost";
-const char *const ITEM_ACTIONS[7] = {
+const char *const Resources::ITEM_ACTIONS[7] = {
"Equip", "Remove", "Use", "Discard", "Enchant", "Recharge", "Gold"
};
-const char *const WHICH_ITEM = "\t010\v005%s which item?";
+const char *const Resources::WHICH_ITEM = "\t010\v005%s which item?";
-const char *const WHATS_YOUR_HURRY = "\v007What's your hurry?\n"
+const char *const Resources::WHATS_YOUR_HURRY = "\v007What's your hurry?\n"
"Wait till you get out of here!";
-const char *const USE_ITEM_IN_COMBAT =
+const char *const Resources::USE_ITEM_IN_COMBAT =
"\v007To use an item in Combat, invoke the Use command on your turn!";
-const char *const NO_SPECIAL_ABILITIES = "\v005\x3""c%s\fdhas no special abilities!";
+const char *const Resources::NO_SPECIAL_ABILITIES = "\v005\x3""c%s\fdhas no special abilities!";
-const char *const CANT_CAST_WHILE_ENGAGED = "\x3""c\v007Can't cast %s while engaged!";
+const char *const Resources::CANT_CAST_WHILE_ENGAGED = "\x3""c\v007Can't cast %s while engaged!";
-const char *const EQUIPPED_ALL_YOU_CAN = "\x3""c\v007You have equipped all the %ss you can!";
-const char *const REMOVE_X_TO_EQUIP_Y = "\x3""c\v007You must remove %sto equip %s\x8!";
-const char *const RING = "ring";
-const char *const MEDAL = "medal";
+const char *const Resources::EQUIPPED_ALL_YOU_CAN = "\x3""c\v007You have equipped all the %ss you can!";
+const char *const Resources::REMOVE_X_TO_EQUIP_Y = "\x3""c\v007You must remove %sto equip %s\x8!";
+const char *const Resources::RING = "ring";
+const char *const Resources::MEDAL = "medal";
-const char *const CANNOT_REMOVE_CURSED_ITEM = "\x3""You cannot remove a cursed item!";
+const char *const Resources::CANNOT_REMOVE_CURSED_ITEM = "\x3""You cannot remove a cursed item!";
-const char *const CANNOT_DISCARD_CURSED_ITEM = "\3x""cYou cannot discard a cursed item!";
+const char *const Resources::CANNOT_DISCARD_CURSED_ITEM = "\3x""cYou cannot discard a cursed item!";
-const char *const PERMANENTLY_DISCARD = "\v000\t000\x03lPermanently discard %s\fd?";
+const char *const Resources::PERMANENTLY_DISCARD = "\v000\t000\x03lPermanently discard %s\fd?";
-const char *const BACKPACK_IS_FULL = "\v005\x3""c\fd%s's backpack is full.";
+const char *const Resources::BACKPACK_IS_FULL = "\v005\x3""c\fd%s's backpack is full.";
-const char *const CATEGORY_BACKPACK_IS_FULL[4] = {
+const char *const Resources::CATEGORY_BACKPACK_IS_FULL[4] = {
"\v010\t000\x3""c%s's weapons backpack is full.",
"\v010\t000\x3""c%s's armor backpack is full.",
"\v010\t000\x3""c%s's accessories backpack is full.",
"\v010\t000\x3""c%s's miscellaneous backpack is full."
};
-const char *const BUY_X_FOR_Y_GOLD = "\x3l\v000\t000\fdBuy %s\fd for %lu gold?";
+const char *const Resources::BUY_X_FOR_Y_GOLD = "\x3l\v000\t000\fdBuy %s\fd for %lu gold?";
-const char *const SELL_X_FOR_Y_GOLD = "\x3l\v000\t000\fdSell %s\fd for %lu gold?";
+const char *const Resources::SELL_X_FOR_Y_GOLD = "\x3l\v000\t000\fdSell %s\fd for %lu gold?";
-const char *const NO_NEED_OF_THIS = "\v005\x3""c\fdWe have no need of this %s\f!";
+const char *const Resources::NO_NEED_OF_THIS = "\v005\x3""c\fdWe have no need of this %s\f!";
-const char *const NOT_RECHARGABLE = "\v012\x3""c\fdNot Rechargeable. %s";
+const char *const Resources::NOT_RECHARGABLE = "\v012\x3""c\fdNot Rechargeable. %s";
-const char *const NOT_ENCHANTABLE = "\v012\t000\x3""cNot Enchantable. %s";
+const char *const Resources::NOT_ENCHANTABLE = "\v012\t000\x3""cNot Enchantable. %s";
-const char *const SPELL_FAILED = "Spell Failed!";
+const char *const Resources::SPELL_FAILED = "Spell Failed!";
-const char *const ITEM_NOT_BROKEN = "\fdThat item is not broken!";
+const char *const Resources::ITEM_NOT_BROKEN = "\fdThat item is not broken!";
-const char *const FIX_IDENTIFY[2] = { "Fix", "Identify" };
+const char *const Resources::FIX_IDENTIFY[2] = { "Fix", "Identify" };
-const char *const FIX_IDENTIFY_GOLD = "\x3l\v000\t000%s %s\fd for %lu gold?";
+const char *const Resources::FIX_IDENTIFY_GOLD = "\x3l\v000\t000%s %s\fd for %lu gold?";
-const char *const IDENTIFY_ITEM_MSG = "\fd\v000\t000\x3""cIdentify Item\x3l\n"
+const char *const Resources::IDENTIFY_ITEM_MSG = "\fd\v000\t000\x3""cIdentify Item\x3l\n"
"\n"
"\v012%s\fd\n"
"\n"
"%s";
-const char *const ITEM_DETAILS =
+const char *const Resources::ITEM_DETAILS =
"Proficient Classes\t132:\t140%s\n"
"to Hit Modifier\t132:\t140%s\n"
"Physical Damage\t132:\t140%s\n"
@@ -1371,31 +1387,31 @@ const char *const ITEM_DETAILS =
"Attribute Bonus\t132:\t140%s\n"
"Special Power\t132:\t140%s";
-const char *const ALL = "All";
-const char *const FIELD_NONE = "None";
-const char *const DAMAGE_X_TO_Y = "%d to %d";
-const char *const ELEMENTAL_XY_DAMAGE = "%+d %s Damage";
-const char *const ATTR_XY_BONUS = "%+d %s";
-const char *const EFFECTIVE_AGAINST = "x3 vs %s";
+const char *const Resources::ALL = "All";
+const char *const Resources::FIELD_NONE = "None";
+const char *const Resources::DAMAGE_X_TO_Y = "%d to %d";
+const char *const Resources::ELEMENTAL_XY_DAMAGE = "%+d %s Damage";
+const char *const Resources::ATTR_XY_BONUS = "%+d %s";
+const char *const Resources::EFFECTIVE_AGAINST = "x3 vs %s";
-const char *const QUESTS_DIALOG_TEXT =
+const char *const Resources::QUESTS_DIALOG_TEXT =
"\r\x2\x3""c\v021\t017\f37I\fdtems\t085\f37Q\fduests\t153"
"\f37A\fduto Notes 221\f37U\fdp\t255\f37D\fdown"
"\t289Exit";
-const char *const CLOUDS_OF_XEEN_LINE = "\b \b*-- \f04Clouds of Xeen\fd --";
-const char *const DARKSIDE_OF_XEEN_LINE = "\b \b*-- \f04Darkside of Xeen\fd --";
+const char *const Resources::CLOUDS_OF_XEEN_LINE = "\b \b*-- \f04Clouds of Xeen\fd --";
+const char *const Resources::DARKSIDE_OF_XEEN_LINE = "\b \b*-- \f04Darkside of Xeen\fd --";
-const char *const NO_QUEST_ITEMS =
+const char *const Resources::NO_QUEST_ITEMS =
"\r\x3""c\v000 000Quest Items\x3l\x2\n"
"\n"
"\x3""cNo Quest Items";
-const char *const NO_CURRENT_QUESTS =
+const char *const Resources::NO_CURRENT_QUESTS =
"\x3""c\v000\t000\n"
"\n"
"No Current Quests";
-const char *const NO_AUTO_NOTES = "\x3""cNo Auto Notes";
+const char *const Resources::NO_AUTO_NOTES = "\x3""cNo Auto Notes";
-const char *const QUEST_ITEMS_DATA =
+const char *const Resources::QUEST_ITEMS_DATA =
"\r\x1\fd\x3""c\v000\t000Quest Items\x3l\x2\n"
"\f04 * \fd%s\n"
"\f04 * \fd%s\n"
@@ -1406,14 +1422,14 @@ const char *const QUEST_ITEMS_DATA =
"\f04 * \fd%s\n"
"\f04 * \fd%s\n"
"\f04 * \fd%s";
-const char *const CURRENT_QUESTS_DATA =
+const char *const Resources::CURRENT_QUESTS_DATA =
"\r\x1\fd\x3""c\t000\v000Current Quests\x3l\x2\n"
"%s\n"
"\n"
"%s\n"
"\n"
"%s";
-const char *const AUTO_NOTES_DATA =
+const char *const Resources::AUTO_NOTES_DATA =
"\r\x1\fd\x3""c\t000\v000Auto Notes\x3l\x2\n"
"%s\x3l\n"
"%s\x3l\n"
@@ -1425,35 +1441,35 @@ const char *const AUTO_NOTES_DATA =
"%s\x3l\n"
"%s\x3l";
-const char *const REST_COMPLETE =
+const char *const Resources::REST_COMPLETE =
"\v000\t0008 hours pass. Rest complete.\n"
"%s\n"
"%d food consumed.";
-const char *const PARTY_IS_STARVING = "\f07The Party is Starving!\fd";
-const char *const HIT_SPELL_POINTS_RESTORED = "Hit Pts and Spell Pts restored.";
-const char *const TOO_DANGEROUS_TO_REST = "Too dangerous to rest here!";
-const char *const SOME_CHARS_MAY_DIE = "Some Chars may die. Rest anyway?";
+const char *const Resources::PARTY_IS_STARVING = "\f07The Party is Starving!\fd";
+const char *const Resources::HIT_SPELL_POINTS_RESTORED = "Hit Pts and Spell Pts restored.";
+const char *const Resources::TOO_DANGEROUS_TO_REST = "Too dangerous to rest here!";
+const char *const Resources::SOME_CHARS_MAY_DIE = "Some Chars may die. Rest anyway?";
-const char *const CANT_DISMISS_LAST_CHAR = "You cannot dismiss your last character!";
+const char *const Resources::CANT_DISMISS_LAST_CHAR = "You cannot dismiss your last character!";
-const char *const REMOVE_DELETE[2] = { "Remove", "Delete" };
+const char *const Resources::REMOVE_DELETE[2] = { "Remove", "Delete" };
-const char *const REMOVE_OR_DELETE_WHICH = "\x3l\t010\v005%s which character?";
+const char *const Resources::REMOVE_OR_DELETE_WHICH = "\x3l\t010\v005%s which character?";
-const char *const YOUR_PARTY_IS_FULL = "\v007Your party is full!";
+const char *const Resources::YOUR_PARTY_IS_FULL = "\v007Your party is full!";
-const char *const HAS_SLAYER_SWORD =
+const char *const Resources::HAS_SLAYER_SWORD =
"\v000\t000This character has the Xeen Slayer Sword and cannot be deleted!";
-const char *const SURE_TO_DELETE_CHAR =
+const char *const Resources::SURE_TO_DELETE_CHAR =
"Are you sure you want to delete %s the %s?";
-const char *const CREATE_CHAR_DETAILS =
+const char *const Resources::CREATE_CHAR_DETAILS =
"\f04\x3""c\x2\t144\v119\f37R\f04oll\t144\v149\f37C\f04reate"
"\t144\v179\f37ESC\f04\x3l\x1\t195\v021\f37M\f04gt"
"\t195\v045\f37I\f04nt\t195\v069\f37P\f04er\t195\v093\f37E\f04nd"
"\t195\v116\f37S\f04pd\t195\v140\f37A\f04cy\t195\v164\f37L\f04ck%s";
-const char *const NEW_CHAR_STATS =
+const char *const Resources::NEW_CHAR_STATS =
"\f04\x3l\t022\v148Race\t055: %s\n"
"\t022Sex\t055: %s\n"
"\t022Class\t055:\n"
@@ -1464,23 +1480,23 @@ const char *const NEW_CHAR_STATS =
"Barbarian\t242\v108\f%2dDruid\t242\v119\f%2dRanger\f04\x3""c"
"\t265\v142Skills\x3l\t223\v155%s\t223\v170%s%s";
-const char *const NAME_FOR_NEW_CHARACTER =
+const char *const Resources::NAME_FOR_NEW_CHARACTER =
"\x3""cEnter a Name for this Character";
-const char *const SELECT_CLASS_BEFORE_SAVING =
+const char *const Resources::SELECT_CLASS_BEFORE_SAVING =
"\v006\x3""cSelect a Class before saving.\x3l";
-const char *const EXCHANGE_ATTR_WITH = "Exchange %s with...";
-
-const int NEW_CHAR_SKILLS[10] = { 1, 5, -1, -1, 4, 0, 0, -1, 6, 11 };
-const int NEW_CHAR_SKILLS_LEN[10] = { 11, 8, 0, 0, 12, 8, 8, 0, 9, 11 };
-const int NEW_CHAR_RACE_SKILLS[10] = { 14, -1, 17, 16, -1, 0, 0, 0, 0, 0 };
-
-const int RACE_MAGIC_RESISTENCES[5] = { 7, 5, 20, 0, 0 };
-const int RACE_FIRE_RESISTENCES[5] = { 7, 0, 2, 5, 10 };
-const int RACE_ELECTRIC_RESISTENCES[5] = { 7, 0, 2, 5, 10 };
-const int RACE_COLD_RESISTENCES[5] = { 7, 0, 2, 5, 10 };
-const int RACE_ENERGY_RESISTENCES[5] = { 7, 5, 2, 5, 0 };
-const int RACE_POISON_RESISTENCES[5] = { 7, 0, 2, 20, 0 };
-const int NEW_CHARACTER_SPELLS[10][4] = {
+const char *const Resources::EXCHANGE_ATTR_WITH = "Exchange %s with...";
+
+const int Resources::NEW_CHAR_SKILLS[10] = { 1, 5, -1, -1, 4, 0, 0, -1, 6, 11 };
+const int Resources::NEW_CHAR_SKILLS_LEN[10] = { 11, 8, 0, 0, 12, 8, 8, 0, 9, 11 };
+const int Resources::NEW_CHAR_RACE_SKILLS[10] = { 14, -1, 17, 16, -1, 0, 0, 0, 0, 0 };
+
+const int Resources::RACE_MAGIC_RESISTENCES[5] = { 7, 5, 20, 0, 0 };
+const int Resources::RACE_FIRE_RESISTENCES[5] = { 7, 0, 2, 5, 10 };
+const int Resources::RACE_ELECTRIC_RESISTENCES[5] = { 7, 0, 2, 5, 10 };
+const int Resources::RACE_COLD_RESISTENCES[5] = { 7, 0, 2, 5, 10 };
+const int Resources::RACE_ENERGY_RESISTENCES[5] = { 7, 5, 2, 5, 0 };
+const int Resources::RACE_POISON_RESISTENCES[5] = { 7, 0, 2, 20, 0 };
+const int Resources::NEW_CHARACTER_SPELLS[10][4] = {
{ -1, -1, -1, -1 },
{ 21, -1, -1, -1 },
{ 22, -1, -1, -1 },
@@ -1493,12 +1509,12 @@ const int NEW_CHARACTER_SPELLS[10][4] = {
{ 20, 1, -1, -1 }
};
-const char *const COMBAT_DETAILS = "\r\f00\x3""c\v000\t000\x2""Combat%s%s%s\x1";
+const char *const Resources::COMBAT_DETAILS = "\r\f00\x3""c\v000\t000\x2""Combat%s%s%s\x1";
-const char *NOT_ENOUGH_TO_CAST = "\x3""c\v010Not enough %s to Cast %s";
-const char *SPELL_CAST_COMPONENTS[2] = { "Spell Points", "Gems" };
+const char *Resources::NOT_ENOUGH_TO_CAST = "\x3""c\v010Not enough %s to Cast %s";
+const char *Resources::SPELL_CAST_COMPONENTS[2] = { "Spell Points", "Gems" };
-const char *const CAST_SPELL_DETAILS =
+const char *const Resources::CAST_SPELL_DETAILS =
"\r\x2\x3""c\v122\t013\f37C\fdast\t040\f37N\fdew"
"\t067ESC\x1\t000\v000\x3""cCast Spell\n"
"\n"
@@ -1510,19 +1526,19 @@ const char *const CAST_SPELL_DETAILS =
"\v082Cost\x3r\t000%u/%u\x3l\n"
"Cur SP\x3r\t000%u\x1";
-const char *const PARTY_FOUND =
+const char *const Resources::PARTY_FOUND =
"\x3""cThe Party Found:\n"
"\n"
"\x3r\t000%lu Gold\n"
"%lu Gems";
-const char *const BACKPACKS_FULL_PRESS_KEY =
+const char *const Resources::BACKPACKS_FULL_PRESS_KEY =
"\v007\f12Warning! BackPacks Full!\fd\n"
"Press a Key";
-const char *const HIT_A_KEY = "\x3l\v120\t000\x4""077\x3""c\f37Hit a key\f'd";
+const char *const Resources::HIT_A_KEY = "\x3l\v120\t000\x4""077\x3""c\f37Hit a key\f'd";
-const char *const GIVE_TREASURE_FORMATTING =
+const char *const Resources::GIVE_TREASURE_FORMATTING =
"\x3l\v060\t000\x4""077\n"
"\x4""077\n"
"\x4""077\n"
@@ -1530,21 +1546,21 @@ const char *const GIVE_TREASURE_FORMATTING =
"\x4""077\n"
"\x4""077";
-const char *const X_FOUND_Y = "\v060\t000\x3""c%s found: %s";
+const char *const Resources::X_FOUND_Y = "\v060\t000\x3""c%s found: %s";
-const char *const ON_WHO = "\x3""c\v009On Who?";
+const char *const Resources::ON_WHO = "\x3""c\v009On Who?";
-const char *const WHICH_ELEMENT1 =
+const char *const Resources::WHICH_ELEMENT1 =
"\r\x3""c\x1Which Element?\x2\v034\t014\f15F\fdire\t044"
"\f15E\fdlec\t074\f15C\fdold\t104\f15A\fdcid\x1";
-const char *const WHICH_ELEMENT2 =
+const char *const Resources::WHICH_ELEMENT2 =
"\r\x3""cWhich Element?', 2, 0Bh, '034\t014\f15F\fdire\t044"
"\f15E\fdlec\t074\f15C\fdold\t104\f15A\fdcid\x1";
-const char *const DETECT_MONSTERS = "\x3""cDetect Monsters";
+const char *const Resources::DETECT_MONSTERS = "\x3""cDetect Monsters";
-const char *const LLOYDS_BEACON =
+const char *const Resources::LLOYDS_BEACON =
"\r\x3""c\v000\t000\x1Lloyd's Beacon\n"
"\n"
"Last Location\n"
@@ -1552,9 +1568,9 @@ const char *const LLOYDS_BEACON =
"%s\x3l\n"
"x = %d\x3r\t000y = %d\x3""c\x2\v122\t021\f15S\fdet\t060\f15R\fdeturn\x1";
-const char *const HOW_MANY_SQUARES = "\x3""cTeleport\nHow many squares %s (1-9)";
+const char *const Resources::HOW_MANY_SQUARES = "\x3""cTeleport\nHow many squares %s (1-9)";
-const char *const TOWN_PORTAL =
+const char *const Resources::TOWN_PORTAL =
"\x3""cTown Portal\x3l\n"
"\n"
"\t0101. %s\n"
@@ -1566,24 +1582,24 @@ const char *const TOWN_PORTAL =
"To which Town (1-5)\n"
"\n";
-const int TOWN_MAP_NUMBERS[2][5] = {
+const int Resources::TOWN_MAP_NUMBERS[2][5] = {
{ 28, 29, 30, 31, 32 }, { 29, 31, 33, 35, 37 }
};
-const char *const MONSTER_DETAILS =
+const char *const Resources::MONSTER_DETAILS =
"\x3l\n"
"%s\x3""c\t100%s\t140%u\t180%u\x3r\t000%s";
-const char *const MONSTER_SPECIAL_ATTACKS[23] = {
+const char *const Resources::MONSTER_SPECIAL_ATTACKS[23] = {
"None", "Magic", "Fire", "Elec", "Cold", "Poison", "Energy", "Disease",
"Insane", "Asleep", "CurseItm", "InLove", "DrnSPts", "Curse", "Paralys",
"Uncons", "Confuse", "BrkWpn", "Weak", "Erad", "Age+5", "Dead", "Stone"
};
-const char *const IDENTIFY_MONSTERS =
+const char *const Resources::IDENTIFY_MONSTERS =
"Name\x3""c\t100HP\t140AC\t177#Atks\x3r\t000Special%s%s%s";
-const char *const EVENT_SAMPLES[6] = {
+const char *const Resources::EVENT_SAMPLES[6] = {
"ahh.voc", "whereto.voc", "gulp.voc", "null.voc", "scream.voc", "laff1.voc"
};
diff --git a/engines/xeen/resources.h b/engines/xeen/resources.h
index 6e9ce6ce39..1ca6c62453 100644
--- a/engines/xeen/resources.h
+++ b/engines/xeen/resources.h
@@ -31,538 +31,325 @@
namespace Xeen {
+#define Res (*g_resources)
+
+class XeenEngine;
+
class Resources {
+protected:
+ Resources();
public:
SpriteResource _globalSprites;
Common::StringArray _maeNames; // Magic and equipment names
+ static const char *const CREDITS;
+ static const char *const OPTIONS_TITLE;
+ static const char *const THE_PARTY_NEEDS_REST;
+ static const char *const WHO_WILL;
+ static const char *const WHATS_THE_PASSWORD;
+ static const char *const IN_NO_CONDITION;
+ static const char *const NOTHING_HERE;
+ static const char *const TERRAIN_TYPES[6];
+ static const char *const SURFACE_TYPE_NAMES[15];
+ static const char *const SURFACE_NAMES[16];
+ static const char *const WHO_ACTIONS[32];
+ static const char *const WHO_WILL_ACTIONS[4];
+ static const byte SYMBOLS[20][64];
+ static const byte TEXT_COLORS[40][4];
+ static const char *const DIRECTION_TEXT_UPPER[4];
+ static const char *const DIRECTION_TEXT[4];
+ static const char *const RACE_NAMES[5];
+ static const int RACE_HP_BONUSES[5];
+ static const int RACE_SP_BONUSES[5][2];
+ static const char *const CLASS_NAMES[11];
+ static const uint CLASS_EXP_LEVELS[10];
+ static const char *const ALIGNMENT_NAMES[3];
+ static const char *const SEX_NAMES[2];
+ static const char *const SKILL_NAMES[18];
+ static const char *const CONDITION_NAMES[17];
+ static const int CONDITION_COLORS[17];
+ static const char *const GOOD;
+ static const char *const BLESSED;
+ static const char *const POWER_SHIELD;
+ static const char *const HOLY_BONUS;
+ static const char *const HEROISM;
+ static const char *const IN_PARTY;
+ static const char *const PARTY_DETAILS;
+ static const char *const PARTY_DIALOG_TEXT;
+ static const int FACE_CONDITION_FRAMES[17];
+ static const int CHAR_FACES_X[6];
+ static const int HP_BARS_X[6];
+ static const char *const NO_ONE_TO_ADVENTURE_WITH;
+ static const byte BACKGROUND_XLAT[];
+ static const char *const YOUR_ROSTER_IS_FULL;
+ static const char *const PLEASE_WAIT;
+ static const char *const OOPS;
+ static const int8 SCREEN_POSITIONING_X[4][48];
+ static const int8 SCREEN_POSITIONING_Y[4][48];
+ static const int MONSTER_GRID_BITMASK[12];
+ static const int INDOOR_OBJECT_X[2][12];
+ static const int MAP_OBJECT_Y[2][12];
+ static const int INDOOR_MONSTERS_Y[4];
+ static const int OUTDOOR_OBJECT_X[2][12];
+ static const int OUTDOOR_MONSTER_INDEXES[26];
+ static const int OUTDOOR_MONSTERS_Y[26];
+ static const int DIRECTION_ANIM_POSITIONS[4][4];
+ static const byte WALL_SHIFTS[4][48];
+ static const int DRAW_NUMBERS[25];
+ static const int DRAW_FRAMES[25][2];
+ static const int COMBAT_FLOAT_X[8];
+ static const int COMBAT_FLOAT_Y[8];
+ static const int MONSTER_EFFECT_FLAGS[15][8];
+ static const uint SPELLS_ALLOWED[3][40];
+ static const int BASE_HP_BY_CLASS[10];
+ static const int AGE_RANGES[10];
+ static const int AGE_RANGES_ADJUST[2][10];
+ static const uint STAT_VALUES[24];
+ static const int STAT_BONUSES[24];
+ static const int ELEMENTAL_CATEGORIES[6];
+ static const int ATTRIBUTE_CATEGORIES[10];
+ static const int ATTRIBUTE_BONUSES[72];
+ static const int ELEMENTAL_RESISTENCES[37];
+ static const int ELEMENTAL_DAMAGE[37];
+ static const int WEAPON_DAMAGE_BASE[35];
+ static const int WEAPON_DAMAGE_MULTIPLIER[35];
+ static const int METAL_DAMAGE[22];
+ static const int METAL_DAMAGE_PERCENT[22];
+ static const int METAL_LAC[9];
+ static const int ARMOR_STRENGTHS[14];
+ static const int MAKE_ITEM_ARR1[6];
+ static const int MAKE_ITEM_ARR2[6][7][2];
+ static const int MAKE_ITEM_ARR3[10][7][2];
+ static const int MAKE_ITEM_ARR4[2][7][2];
+ static const int MAKE_ITEM_ARR5[8][2];
+ static const int OUTDOOR_DRAWSTRCT_INDEXES[44];
+ static const int TOWN_MAXES[2][11];
+ static const char *const TOWN_ACTION_MUSIC[14];
+ static const char *const TOWN_ACTION_SHAPES[4];
+ static const int TOWN_ACTION_FILES[2][7];
+ static const char *const BANK_TEXT;
+ static const char *const BLACKSMITH_TEXT;
+ static const char *const GUILD_NOT_MEMBER_TEXT;
+ static const char *const GUILD_TEXT;
+ static const char *const TAVERN_TEXT;
+ static const char *const GOOD_STUFF;
+ static const char *const HAVE_A_DRINK;
+ static const char *const YOURE_DRUNK;
+ static const int TAVERN_EXIT_LIST[2][6][5][2];
+ static const char *const FOOD_AND_DRINK;
+ static const char *const TEMPLE_TEXT;
+ static const char *const EXPERIENCE_FOR_LEVEL;
+ static const char *const LEARNED_ALL;
+ static const char *const ELIGIBLE_FOR_LEVEL;
+ static const char *const TRAINING_TEXT;
+ static const char *const GOLD_GEMS;
+ static const char *const GOLD_GEMS_2;
+ static const char *const DEPOSIT_WITHDRAWL[2];
+ static const char *const NOT_ENOUGH_X_IN_THE_Y;
+ static const char *const NO_X_IN_THE_Y;
+ static const char *const STAT_NAMES[16];
+ static const char *const CONSUMABLE_NAMES[4];
+ static const char *const WHERE_NAMES[2];
+ static const char *const AMOUNT;
+ static const char *const FOOD_PACKS_FULL;
+ static const char *const BUY_SPELLS;
+ static const char *const GUILD_OPTIONS;
+ static const int MISC_SPELL_INDEX[74];
+ static const int SPELL_COSTS[77];
+ static const int CLOUDS_SPELL_OFFSETS[5][20];
+ static const uint DARK_SPELL_OFFSETS[3][39];
+ static const int DARK_SPELL_RANGES[12][2];
+ static const int SPELL_LEVEL_OFFSETS[3][39];
+ static const int SPELL_GEM_COST[77];
+ static const char *const NOT_A_SPELL_CASTER;
+ static const char *const SPELLS_FOR;
+ static const char *const SPELL_LINES_0_TO_9;
+ static const char *const SPELLS_DIALOG_SPELLS;
+ static const char *const SPELL_PTS;
+ static const char *const GOLD;
+ static const char *const SPELLS_PRESS_A_KEY;
+ static const char *const SPELLS_PURCHASE;
+ static const char *const MAP_TEXT;
+ static const char *const LIGHT_COUNT_TEXT;
+ static const char *const FIRE_RESISTENCE_TEXT;
+ static const char *const ELECRICITY_RESISTENCE_TEXT;
+ static const char *const COLD_RESISTENCE_TEXT;
+ static const char *const POISON_RESISTENCE_TEXT;
+ static const char *const CLAIRVOYANCE_TEXT;
+ static const char *const LEVITATE_TEXT;
+ static const char *const WALK_ON_WATER_TEXT;
+ static const char *const GAME_INFORMATION;
+ static const char *const WORLD_GAME_TEXT;
+ static const char *const DARKSIDE_GAME_TEXT;
+ static const char *const CLOUDS_GAME_TEXT;
+ static const char *const SWORDS_GAME_TEXT;
+ static const char *const WEEK_DAY_STRINGS[10];
+ static const char *const CHARACTER_DETAILS;
+ static const char *const PARTY_GOLD;
+ static const char *const PLUS_14;
+ static const char *const CHARACTER_TEMPLATE;
+ static const char *const EXCHANGING_IN_COMBAT;
+ static const char *const CURRENT_MAXIMUM_RATING_TEXT;
+ static const char *const CURRENT_MAXIMUM_TEXT;
+ static const char *const RATING_TEXT[24];
+ static const char *const AGE_TEXT;
+ static const char *const LEVEL_TEXT;
+ static const char *const RESISTENCES_TEXT;
+ static const char *const NONE;
+ static const char *const EXPERIENCE_TEXT;
+ static const char *const ELIGIBLE;
+ static const char *const IN_PARTY_IN_BANK;
+ static const char *const FOOD_TEXT;
+ static const char *const EXCHANGE_WITH_WHOM;
+ static const char *const QUICK_REF_LINE;
+ static const char *const QUICK_REFERENCE;
+ static const uint BLACKSMITH_MAP_IDS[2][4];
+ static const char *const ITEMS_DIALOG_TEXT1;
+ static const char *const ITEMS_DIALOG_TEXT2;
+ static const char *const ITEMS_DIALOG_LINE1;
+ static const char *const ITEMS_DIALOG_LINE2;
+ static const char *const BTN_BUY;
+ static const char *const BTN_SELL;
+ static const char *const BTN_IDENTIFY;
+ static const char *const BTN_FIX;
+ static const char *const BTN_USE;
+ static const char *const BTN_EQUIP;
+ static const char *const BTN_REMOVE;
+ static const char *const BTN_DISCARD;
+ static const char *const BTN_QUEST;
+ static const char *const BTN_ENCHANT;
+ static const char *const BTN_RECHARGE;
+ static const char *const BTN_GOLD;
+ static const char *const ITEM_BROKEN;
+ static const char *const ITEM_CURSED;
+ static const char *const BONUS_NAMES[7];
+ static const char *const WEAPON_NAMES[35];
+ static const char *const ARMOR_NAMES[14];
+ static const char *const ACCESSORY_NAMES[11];
+ static const char *const MISC_NAMES[22];
+ static const char *const *ITEM_NAMES[4];
+ static const char *const ELEMENTAL_NAMES[6];
+ static const char *const ATTRIBUTE_NAMES[10];
+ static const char *const EFFECTIVENESS_NAMES[7];
+ static const char *const QUEST_ITEM_NAMES[85];
+ static const int WEAPON_BASE_COSTS[35];
+ static const int ARMOR_BASE_COSTS[25];
+ static const int ACCESSORY_BASE_COSTS[11];
+ static const int MISC_MATERIAL_COSTS[22];
+ static const int MISC_BASE_COSTS[76];
+ static const int METAL_BASE_MULTIPLIERS[22];
+ static const int ITEM_SKILL_DIVISORS[4];
+ static const int RESTRICTION_OFFSETS[4];
+ static const int ITEM_RESTRICTIONS[86];
+ static const char *const NOT_PROFICIENT;
+ static const char *const NO_ITEMS_AVAILABLE;
+ static const char *const CATEGORY_NAMES[4];
+ static const char *const X_FOR_THE_Y;
+ static const char *const X_FOR_Y;
+ static const char *const X_FOR_Y_GOLD;
+ static const char *const FMT_CHARGES;
+ static const char *const AVAILABLE_GOLD_COST;
+ static const char *const CHARGES;
+ static const char *const COST;
+ static const char *const ITEM_ACTIONS[7];
+ static const char *const WHICH_ITEM;
+ static const char *const WHATS_YOUR_HURRY;
+
+ static const char *const USE_ITEM_IN_COMBAT;
+
+ static const char *const NO_SPECIAL_ABILITIES;
+
+ static const char *const CANT_CAST_WHILE_ENGAGED;
+
+ static const char *const EQUIPPED_ALL_YOU_CAN;
+ static const char *const REMOVE_X_TO_EQUIP_Y;
+ static const char *const RING;
+ static const char *const MEDAL;
+ static const char *const CANNOT_REMOVE_CURSED_ITEM;
+ static const char *const CANNOT_DISCARD_CURSED_ITEM;
+ static const char *const PERMANENTLY_DISCARD;
+ static const char *const BACKPACK_IS_FULL;
+ static const char *const CATEGORY_BACKPACK_IS_FULL[4];
+ static const char *const BUY_X_FOR_Y_GOLD;
+ static const char *const SELL_X_FOR_Y_GOLD;
+ static const char *const NO_NEED_OF_THIS;
+ static const char *const NOT_RECHARGABLE;
+ static const char *const SPELL_FAILED;
+ static const char *const NOT_ENCHANTABLE;
+ static const char *const ITEM_NOT_BROKEN;
+ static const char *const FIX_IDENTIFY[2];
+ static const char *const FIX_IDENTIFY_GOLD;
+ static const char *const IDENTIFY_ITEM_MSG;
+ static const char *const ITEM_DETAILS;
+ static const char *const ALL;
+ static const char *const FIELD_NONE;
+ static const char *const DAMAGE_X_TO_Y;
+ static const char *const ELEMENTAL_XY_DAMAGE;
+ static const char *const ATTR_XY_BONUS;
+ static const char *const EFFECTIVE_AGAINST;
+ static const char *const QUESTS_DIALOG_TEXT;
+ static const char *const CLOUDS_OF_XEEN_LINE;
+ static const char *const DARKSIDE_OF_XEEN_LINE;
+ static const char *const NO_QUEST_ITEMS;
+ static const char *const NO_CURRENT_QUESTS;
+ static const char *const NO_AUTO_NOTES;
+ static const char *const QUEST_ITEMS_DATA;
+ static const char *const CURRENT_QUESTS_DATA;
+ static const char *const AUTO_NOTES_DATA;
+ static const char *const REST_COMPLETE;
+ static const char *const PARTY_IS_STARVING;
+ static const char *const HIT_SPELL_POINTS_RESTORED;
+ static const char *const TOO_DANGEROUS_TO_REST;
+ static const char *const SOME_CHARS_MAY_DIE;
+ static const char *const CANT_DISMISS_LAST_CHAR;
+ static const char *const REMOVE_DELETE[2];
+ static const char *const REMOVE_OR_DELETE_WHICH;
+ static const char *const YOUR_PARTY_IS_FULL;
+ static const char *const HAS_SLAYER_SWORD;
+ static const char *const SURE_TO_DELETE_CHAR;
+ static const char *const CREATE_CHAR_DETAILS;
+ static const char *const NEW_CHAR_STATS;
+ static const char *const NAME_FOR_NEW_CHARACTER;
+ static const char *const SELECT_CLASS_BEFORE_SAVING;
+ static const char *const EXCHANGE_ATTR_WITH;
+ static const int NEW_CHAR_SKILLS[10];
+ static const int NEW_CHAR_SKILLS_LEN[10];
+ static const int NEW_CHAR_RACE_SKILLS[10];
+ static const int RACE_MAGIC_RESISTENCES[5];
+ static const int RACE_FIRE_RESISTENCES[5];
+ static const int RACE_ELECTRIC_RESISTENCES[5];
+ static const int RACE_COLD_RESISTENCES[5];
+ static const int RACE_ENERGY_RESISTENCES[5];
+ static const int RACE_POISON_RESISTENCES[5];
+ static const int NEW_CHARACTER_SPELLS[10][4];
+ static const char *const COMBAT_DETAILS;
+ static const char *NOT_ENOUGH_TO_CAST;
+ static const char *SPELL_CAST_COMPONENTS[2];
+ static const char *const CAST_SPELL_DETAILS;
+ static const char *const PARTY_FOUND;
+ static const char *const BACKPACKS_FULL_PRESS_KEY;
+ static const char *const HIT_A_KEY;
+ static const char *const GIVE_TREASURE_FORMATTING;
+ static const char *const X_FOUND_Y;
+ static const char *const ON_WHO;
+ static const char *const WHICH_ELEMENT1;
+ static const char *const WHICH_ELEMENT2;
+ static const char *const DETECT_MONSTERS;
+ static const char *const LLOYDS_BEACON;
+ static const char *const HOW_MANY_SQUARES;
+ static const char *const TOWN_PORTAL;
+ static const int TOWN_MAP_NUMBERS[2][5];
+ static const char *const MONSTER_DETAILS;
+ static const char *const MONSTER_SPECIAL_ATTACKS[23];
+ static const char *const IDENTIFY_MONSTERS;
+ static const char *const EVENT_SAMPLES[6];
public:
- Resources();
+ /**
+ * Initializes an instnace of the resources
+ */
+ static Resources *init(XeenEngine *vm);
};
-#define Res (*_vm->_resources)
-
-extern const char *const CREDITS;
-
-extern const char *const OPTIONS_TITLE;
-
-extern const char *const THE_PARTY_NEEDS_REST;
-
-extern const char *const WHO_WILL;
-
-extern const char *const WHATS_THE_PASSWORD;
-
-extern const char *const IN_NO_CONDITION;
-
-extern const char *const NOTHING_HERE;
-
-extern const char *const TERRAIN_TYPES[6];
-
-extern const char *const SURFACE_TYPE_NAMES[15];
-
-extern const char *const SURFACE_NAMES[16];
-
-extern const char *const WHO_ACTIONS[32];
-
-extern const char *const WHO_WILL_ACTIONS[4];
-
-extern const byte SYMBOLS[20][64];
-
-extern const byte TEXT_COLORS[40][4];
-
-extern const char *const DIRECTION_TEXT_UPPER[4];
-
-extern const char *const DIRECTION_TEXT[4];
-
-extern const char *const RACE_NAMES[5];
-
-extern const int RACE_HP_BONUSES[5];
-
-extern const int RACE_SP_BONUSES[5][2];
-
-extern const char *const CLASS_NAMES[11];
-
-extern const uint CLASS_EXP_LEVELS[10];
-
-extern const char *const ALIGNMENT_NAMES[3];
-
-extern const char *const SEX_NAMES[2];
-
-extern const char *const SKILL_NAMES[18];
-
-extern const char *const CONDITION_NAMES[17];
-
-extern const int CONDITION_COLORS[17];
-
-extern const char *const GOOD;
-
-extern const char *const BLESSED;
-
-extern const char *const POWER_SHIELD;
-
-extern const char *const HOLY_BONUS;
-
-extern const char *const HEROISM;
-extern const char *const IN_PARTY;
-
-extern const char *const PARTY_DETAILS;
-extern const char *const PARTY_DIALOG_TEXT;
-
-extern const int FACE_CONDITION_FRAMES[17];
-
-extern const int CHAR_FACES_X[6];
-
-extern const int HP_BARS_X[6];
-
-extern const char *const NO_ONE_TO_ADVENTURE_WITH;
-
-extern const byte BACKGROUND_XLAT[];
-
-extern const char *const YOUR_ROSTER_IS_FULL;
-
-extern const char *const PLEASE_WAIT;
-
-extern const char *const OOPS;
-
-extern const int8 SCREEN_POSITIONING_X[4][48];
-
-extern const int8 SCREEN_POSITIONING_Y[4][48];
-
-extern const int MONSTER_GRID_BITMASK[12];
-
-extern const int INDOOR_OBJECT_X[2][12];
-
-extern const int MAP_OBJECT_Y[2][12];
-
-extern const int INDOOR_MONSTERS_Y[4];
-
-extern const int OUTDOOR_OBJECT_X[2][12];
-
-extern const int OUTDOOR_MONSTER_INDEXES[26];
-
-extern const int OUTDOOR_MONSTERS_Y[26];
-
-extern const int DIRECTION_ANIM_POSITIONS[4][4];
-
-extern const byte WALL_SHIFTS[4][48];
-
-extern const int DRAW_NUMBERS[25];
-
-extern const int DRAW_FRAMES[25][2];
-
-extern const int COMBAT_FLOAT_X[8];
-
-extern const int COMBAT_FLOAT_Y[8];
-
-extern const int MONSTER_EFFECT_FLAGS[15][8];
-
-extern const uint SPELLS_ALLOWED[3][40];
-
-extern const int BASE_HP_BY_CLASS[10];
-
-extern const int AGE_RANGES[10];
-
-extern const int AGE_RANGES_ADJUST[2][10];
-
-extern const uint STAT_VALUES[24];
-
-extern const int STAT_BONUSES[24];
-
-extern const int ELEMENTAL_CATEGORIES[6];
-
-extern const int ATTRIBUTE_CATEGORIES[10];
-
-extern const int ATTRIBUTE_BONUSES[72];
-
-extern const int ELEMENTAL_RESISTENCES[37];
-
-extern const int ELEMENTAL_DAMAGE[37];
-
-extern const int WEAPON_DAMAGE_BASE[35];
-extern const int WEAPON_DAMAGE_MULTIPLIER[35];
-extern const int METAL_DAMAGE[22];
-extern const int METAL_DAMAGE_PERCENT[22];
-
-extern const int METAL_LAC[9];
-
-extern const int ARMOR_STRENGTHS[14];
-
-extern const int MAKE_ITEM_ARR1[6];
-
-extern const int MAKE_ITEM_ARR2[6][7][2];
-
-extern const int MAKE_ITEM_ARR3[10][7][2];
-
-extern const int MAKE_ITEM_ARR4[2][7][2];
-
-extern const int MAKE_ITEM_ARR5[8][2];
-
-extern const int OUTDOOR_DRAWSTRCT_INDEXES[44];
-
-extern const int TOWN_MAXES[2][11];
-
-extern const char *const TOWN_ACTION_MUSIC[14];
-
-extern const char *const TOWN_ACTION_SHAPES[4];
-
-extern const int TOWN_ACTION_FILES[2][7];
-
-extern const char *const BANK_TEXT;
-
-extern const char *const BLACKSMITH_TEXT;
-
-extern const char *const GUILD_NOT_MEMBER_TEXT;
-
-extern const char *const GUILD_TEXT;
-
-extern const char *const TAVERN_TEXT;
-
-extern const char *const GOOD_STUFF;
-
-extern const char *const HAVE_A_DRINK;
-
-extern const char *const YOURE_DRUNK;
-
-extern const int TAVERN_EXIT_LIST[2][6][5][2];
-
-extern const char *const FOOD_AND_DRINK;
-
-extern const char *const TEMPLE_TEXT;
-
-extern const char *const EXPERIENCE_FOR_LEVEL;
-
-extern const char *const LEARNED_ALL;
-
-extern const char *const ELIGIBLE_FOR_LEVEL;
-
-extern const char *const TRAINING_TEXT;
-
-extern const char *const GOLD_GEMS;
-
-extern const char *const GOLD_GEMS_2;
-
-extern const char *const DEPOSIT_WITHDRAWL[2];
-
-extern const char *const NOT_ENOUGH_X_IN_THE_Y;
-
-extern const char *const NO_X_IN_THE_Y;
-
-extern const char *const STAT_NAMES[16];
-
-extern const char *const CONSUMABLE_NAMES[4];
-
-extern const char *const WHERE_NAMES[2];
-
-extern const char *const AMOUNT;
-
-extern const char *const FOOD_PACKS_FULL;
-
-extern const char *const BUY_SPELLS;
-
-extern const char *const GUILD_OPTIONS;
-
-extern const int MISC_SPELL_INDEX[74];
-
-extern const int SPELL_COSTS[77];
-
-extern const int CLOUDS_SPELL_OFFSETS[5][20];
-
-extern const uint DARK_SPELL_OFFSETS[3][39];
-
-extern const int DARK_SPELL_RANGES[12][2];
-
-extern const int SPELL_LEVEL_OFFSETS[3][39];
-
-extern const int SPELL_GEM_COST[77];
-
-extern const char *const NOT_A_SPELL_CASTER;
-
-extern const char *const SPELLS_FOR;
-
-extern const char *const SPELL_LINES_0_TO_9;
-
-extern const char *const SPELLS_DIALOG_SPELLS;
-
-extern const char *const SPELL_PTS;
-
-extern const char *const GOLD;
-
-extern const char *const SPELLS_PRESS_A_KEY;
-
-extern const char *const SPELLS_PURCHASE;
-
-extern const char *const MAP_TEXT;
-
-extern const char *const LIGHT_COUNT_TEXT;
-
-extern const char *const FIRE_RESISTENCE_TEXT;
-
-extern const char *const ELECRICITY_RESISTENCE_TEXT;
-
-extern const char *const COLD_RESISTENCE_TEXT;
-
-extern const char *const POISON_RESISTENCE_TEXT;
-
-extern const char *const CLAIRVOYANCE_TEXT;
-
-extern const char *const LEVITATE_TEXT;
-
-extern const char *const WALK_ON_WATER_TEXT;
-
-extern const char *const GAME_INFORMATION;
-
-extern const char *const WORLD_GAME_TEXT;
-
-extern const char *const DARKSIDE_GAME_TEXT;
-
-extern const char *const CLOUDS_GAME_TEXT;
-
-extern const char *const SWORDS_GAME_TEXT;
-
-extern const char *const WEEK_DAY_STRINGS[10];
-
-extern const char *const CHARACTER_DETAILS;
-
-extern const char *const PARTY_GOLD;
-
-extern const char *const PLUS_14;
-
-extern const char *const CHARACTER_TEMPLATE;
-
-extern const char *const EXCHANGING_IN_COMBAT;
-
-extern const char *const CURRENT_MAXIMUM_RATING_TEXT;
-
-extern const char *const CURRENT_MAXIMUM_TEXT;
-
-extern const char *const RATING_TEXT[24];
-
-extern const char *const AGE_TEXT;
-
-extern const char *const LEVEL_TEXT;
-
-extern const char *const RESISTENCES_TEXT;
-
-extern const char *const NONE;
-
-extern const char *const EXPERIENCE_TEXT;
-
-extern const char *const ELIGIBLE;
-
-extern const char *const IN_PARTY_IN_BANK;
-
-extern const char *const FOOD_TEXT;
-
-extern const char *const EXCHANGE_WITH_WHOM;
-
-extern const char *const QUICK_REF_LINE;
-
-extern const char *const QUICK_REFERENCE;
-
-extern const uint BLACKSMITH_MAP_IDS[2][4];
-
-extern const char *const ITEMS_DIALOG_TEXT1;
-extern const char *const ITEMS_DIALOG_TEXT2;
-extern const char *const ITEMS_DIALOG_LINE1;
-extern const char *const ITEMS_DIALOG_LINE2;
-
-extern const char *const BTN_BUY;
-extern const char *const BTN_SELL;
-extern const char *const BTN_IDENTIFY;
-extern const char *const BTN_FIX;
-extern const char *const BTN_USE;
-extern const char *const BTN_EQUIP;
-extern const char *const BTN_REMOVE;
-extern const char *const BTN_DISCARD;
-extern const char *const BTN_EQUIP;
-extern const char *const BTN_QUEST;
-extern const char *const BTN_ENCHANT;
-extern const char *const BTN_RECHARGE;
-extern const char *const BTN_GOLD;
-
-extern const char *const ITEM_BROKEN;
-extern const char *const ITEM_CURSED;
-extern const char *const BONUS_NAMES[7];
-extern const char *const WEAPON_NAMES[35];
-extern const char *const ARMOR_NAMES[14];
-extern const char *const ACCESSORY_NAMES[11];
-extern const char *const MISC_NAMES[22];
-extern const char *const *ITEM_NAMES[4];
-
-extern const char *const ELEMENTAL_NAMES[6];
-extern const char *const ATTRIBUTE_NAMES[10];
-extern const char *const EFFECTIVENESS_NAMES[7];
-extern const char *const QUEST_ITEM_NAMES[85];
-
-extern const int WEAPON_BASE_COSTS[35];
-extern const int ARMOR_BASE_COSTS[25];
-extern const int ACCESSORY_BASE_COSTS[11];
-extern const int MISC_MATERIAL_COSTS[22];
-extern const int MISC_BASE_COSTS[76];
-extern const int METAL_BASE_MULTIPLIERS[22];
-extern const int ITEM_SKILL_DIVISORS[4];
-
-extern const int RESTRICTION_OFFSETS[4];
-extern const int ITEM_RESTRICTIONS[86];
-
-extern const char *const NOT_PROFICIENT;
-
-extern const char *const NO_ITEMS_AVAILABLE;
-
-extern const char *const CATEGORY_NAMES[4];
-
-extern const char *const X_FOR_THE_Y;
-
-extern const char *const X_FOR_Y;
-
-extern const char *const X_FOR_Y_GOLD;
-
-extern const char *const FMT_CHARGES;
-
-extern const char *const AVAILABLE_GOLD_COST;
-
-extern const char *const CHARGES;
-
-extern const char *const COST;
-
-extern const char *const ITEM_ACTIONS[7];
-extern const char *const WHICH_ITEM;
-
-extern const char *const WHATS_YOUR_HURRY;
-
-extern const char *const USE_ITEM_IN_COMBAT;
-
-extern const char *const NO_SPECIAL_ABILITIES;
-
-extern const char *const CANT_CAST_WHILE_ENGAGED;
-
-extern const char *const EQUIPPED_ALL_YOU_CAN;
-extern const char *const REMOVE_X_TO_EQUIP_Y;
-extern const char *const RING;
-extern const char *const MEDAL;
-
-extern const char *const CANNOT_REMOVE_CURSED_ITEM;
-
-extern const char *const CANNOT_DISCARD_CURSED_ITEM;
-
-extern const char *const PERMANENTLY_DISCARD;
-
-extern const char *const BACKPACK_IS_FULL;
-
-extern const char *const CATEGORY_BACKPACK_IS_FULL[4];
-
-extern const char *const BUY_X_FOR_Y_GOLD;
-
-extern const char *const SELL_X_FOR_Y_GOLD;
-
-extern const char *const NO_NEED_OF_THIS;
-
-extern const char *const NOT_RECHARGABLE;
-
-extern const char *const SPELL_FAILED;
-
-extern const char *const NOT_ENCHANTABLE;
-
-extern const char *const ITEM_NOT_BROKEN;
-
-extern const char *const FIX_IDENTIFY[2];
-
-extern const char *const FIX_IDENTIFY_GOLD;
-
-extern const char *const IDENTIFY_ITEM_MSG;
-
-extern const char *const ITEM_DETAILS;
-
-extern const char *const ALL;
-extern const char *const FIELD_NONE;
-extern const char *const DAMAGE_X_TO_Y;
-extern const char *const ELEMENTAL_XY_DAMAGE;
-extern const char *const ATTR_XY_BONUS;
-extern const char *const EFFECTIVE_AGAINST;
-
-extern const char *const QUESTS_DIALOG_TEXT;
-extern const char *const CLOUDS_OF_XEEN_LINE;
-extern const char *const DARKSIDE_OF_XEEN_LINE;
-
-extern const char *const NO_QUEST_ITEMS;
-extern const char *const NO_CURRENT_QUESTS;
-extern const char *const NO_AUTO_NOTES;
-extern const char *const QUEST_ITEMS_DATA;
-extern const char *const CURRENT_QUESTS_DATA;
-extern const char *const AUTO_NOTES_DATA;
-
-extern const char *const REST_COMPLETE;
-extern const char *const PARTY_IS_STARVING;
-extern const char *const HIT_SPELL_POINTS_RESTORED;
-extern const char *const TOO_DANGEROUS_TO_REST;
-extern const char *const SOME_CHARS_MAY_DIE;
-
-extern const char *const CANT_DISMISS_LAST_CHAR;
-
-extern const char *const REMOVE_DELETE[2];
-extern const char *const REMOVE_OR_DELETE_WHICH;
-
-extern const char *const YOUR_PARTY_IS_FULL;
-
-extern const char *const HAS_SLAYER_SWORD;
-extern const char *const SURE_TO_DELETE_CHAR;
-
-extern const char *const CREATE_CHAR_DETAILS;
-
-extern const char *const NEW_CHAR_STATS;
-extern const char *const NAME_FOR_NEW_CHARACTER;
-extern const char *const SELECT_CLASS_BEFORE_SAVING;
-extern const char *const EXCHANGE_ATTR_WITH;
-extern const int NEW_CHAR_SKILLS[10];
-extern const int NEW_CHAR_SKILLS_LEN[10];
-extern const int NEW_CHAR_RACE_SKILLS[10];
-
-extern const int RACE_MAGIC_RESISTENCES[5];
-extern const int RACE_FIRE_RESISTENCES[5];
-extern const int RACE_ELECTRIC_RESISTENCES[5];
-extern const int RACE_COLD_RESISTENCES[5];
-extern const int RACE_ENERGY_RESISTENCES[5];
-extern const int RACE_POISON_RESISTENCES[5];
-extern const int NEW_CHARACTER_SPELLS[10][4];
-
-extern const char *const COMBAT_DETAILS;
-
-extern const char *NOT_ENOUGH_TO_CAST;
-extern const char *SPELL_CAST_COMPONENTS[2];
-
-extern const char *const CAST_SPELL_DETAILS;
-
-extern const char *const PARTY_FOUND;
-
-extern const char *const BACKPACKS_FULL_PRESS_KEY;
-
-extern const char *const HIT_A_KEY;
-
-extern const char *const GIVE_TREASURE_FORMATTING;
-
-extern const char *const X_FOUND_Y;
-
-extern const char *const ON_WHO;
-
-extern const char *const WHICH_ELEMENT1;
-extern const char *const WHICH_ELEMENT2;
-
-extern const char *const DETECT_MONSTERS;
-
-extern const char *const LLOYDS_BEACON;
-
-extern const char *const HOW_MANY_SQUARES;
-
-extern const char *const TOWN_PORTAL;
-
-extern const int TOWN_MAP_NUMBERS[2][5];
-
-extern const char *const MONSTER_DETAILS;
-
-extern const char *const MONSTER_SPECIAL_ATTACKS[23];
-
-extern const char *const IDENTIFY_MONSTERS;
-
-extern const char *const EVENT_SAMPLES[6];
+extern Resources *g_resources;
} // End of namespace Xeen
diff --git a/engines/xeen/screen.cpp b/engines/xeen/screen.cpp
index 03b751a6b9..32a08b24e5 100644
--- a/engines/xeen/screen.cpp
+++ b/engines/xeen/screen.cpp
@@ -29,22 +29,27 @@
namespace Xeen {
-Window::Window() : XSurface(), _vm(nullptr), _enabled(false),
+XeenEngine *Window::_vm;
+
+void Window::init(XeenEngine *vm) {
+ _vm = vm;
+}
+
+Window::Window() : XSurface(), _enabled(false),
_a(0), _border(0), _xLo(0), _xHi(0), _ycL(0), _ycH(0) {
}
-Window::Window(const Window &src) : XSurface(), _vm(src._vm), _enabled(src._enabled),
+Window::Window(const Window &src) : XSurface(), _enabled(src._enabled),
_a(src._a), _border(src._border), _xLo(src._xLo), _ycL(src._ycL),
_xHi(src._xHi), _ycH(src._ycH) {
- if (src._vm) {
- setBounds(src._bounds);
- create(*_vm->_screen, Common::Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT));
- }
+
+ setBounds(src._bounds);
+ create(*_vm->_screen, Common::Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT));
}
-Window::Window(XeenEngine *vm, const Common::Rect &bounds, int a, int border,
+Window::Window(const Common::Rect &bounds, int a, int border,
int xLo, int ycL, int xHi, int ycH): XSurface(),
- _vm(vm), _enabled(false), _a(a), _border(border),
+ _enabled(false), _a(a), _border(border),
_xLo(xLo), _ycL(ycL), _xHi(xHi), _ycH(ycH) {
setBounds(bounds);
create(*_vm->_screen, Common::Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT));
@@ -203,6 +208,7 @@ void Window::drawList(DrawStruct *items, int count) {
/*------------------------------------------------------------------------*/
Screen::Screen(XeenEngine *vm) : _vm(vm) {
+ Window::init(vm);
_fadeIn = false;
create(SCREEN_WIDTH, SCREEN_HEIGHT);
Common::fill(&_tempPalette[0], &_tempPalette[PALETTE_SIZE], 0);
@@ -221,45 +227,45 @@ Screen::~Screen() {
void Screen::setupWindows() {
Window windows[40] = {
- Window(_vm, Common::Rect(0, 0, 320, 200), 0, 0, 0, 0, 320, 200),
- Window(_vm, Common::Rect(237, 9, 317, 74), 0, 0, 237, 12, 307, 68),
- Window(_vm, Common::Rect(225, 1, 319, 73), 1, 8, 225, 1, 319, 73),
- Window(_vm, Common::Rect(0, 0, 230, 149), 0, 0, 9, 8, 216, 140),
- Window(_vm, Common::Rect(235, 148, 309, 189), 2, 8, 0, 0, 0, 0),
- Window(_vm, Common::Rect(70, 20, 250, 183), 3, 8, 80, 38, 240, 166),
- Window(_vm, Common::Rect(52, 149, 268, 197), 4, 8, 0, 0, 0, 0),
- Window(_vm, Common::Rect(108, 0, 200, 200), 5, 0, 0, 0, 0, 0),
- Window(_vm, Common::Rect(232, 9, 312, 74), 0, 0, 0, 0, 0, 0),
- Window(_vm, Common::Rect(103, 156, 217, 186), 6, 8, 0, 0, 0, 0),
- Window(_vm, Common::Rect(226, 0, 319, 146), 7, 8, 0, 0, 0, 0),
- Window(_vm, Common::Rect(8, 8, 224, 140), 8, 8, 8, 8, 224, 200),
- Window(_vm, Common::Rect(0, 143, 320, 199), 9, 8, 0, 0, 0, 0),
- Window(_vm, Common::Rect(50, 103, 266, 139), 10, 8, 0, 0, 0, 0),
- Window(_vm, Common::Rect(0, 7, 320, 138), 11, 8, 0, 0, 0, 0),
- Window(_vm, Common::Rect(50, 71, 182, 129), 12, 8, 0, 0, 0, 0),
- Window(_vm, Common::Rect(228, 106, 319, 146), 13, 8, 0, 0, 0, 0),
- Window(_vm, Common::Rect(20, 142, 290, 199), 14, 8, 0, 0, 0, 0),
- Window(_vm, Common::Rect(0, 20, 320, 180), 15, 8, 0, 0, 0, 0),
- Window(_vm, Common::Rect(231, 48, 317, 141), 16, 8, 0, 0, 0, 0),
- Window(_vm, Common::Rect(72, 37, 248, 163), 17, 8, 0, 0, 0, 0),
- Window(_vm, Common::Rect(99, 59, 237, 141), 18, 8, 99, 59, 237, 0),
- Window(_vm, Common::Rect(65, 23, 250, 163), 19, 8, 75, 36, 245, 141),
- Window(_vm, Common::Rect(80, 28, 256, 148), 20, 8, 80, 28, 256, 172),
- Window(_vm, Common::Rect(0, 0, 320, 146), 21, 8, 0, 0, 320, 148),
- Window(_vm, Common::Rect(27, 6, 207, 142), 22, 8, 0, 0, 0, 146),
- Window(_vm, Common::Rect(15, 15, 161, 91), 23, 8, 0, 0, 0, 0),
- Window(_vm, Common::Rect(90, 45, 220, 157), 24, 8, 0, 0, 0, 0),
- Window(_vm, Common::Rect(0, 0, 320, 200), 25, 8, 0, 0, 0, 0),
- Window(_vm, Common::Rect(0, 101, 320, 146), 26, 8, 0, 101, 320, 0),
- Window(_vm, Common::Rect(0, 0, 320, 108), 27, 8, 0, 0, 0, 45),
- Window(_vm, Common::Rect(50, 112, 266, 148), 28, 8, 0, 0, 0, 0),
- Window(_vm, Common::Rect(12, 11, 164, 94), 0, 0, 0, 0, 52, 0),
- Window(_vm, Common::Rect(8, 147, 224, 192), 0, 8, 0, 0, 0, 94),
- Window(_vm, Common::Rect(232, 74, 312, 138), 29, 8, 0, 0, 0, 0),
- Window(_vm, Common::Rect(226, 26, 319, 146), 30, 8, 0, 0, 0, 0),
- Window(_vm, Common::Rect(225, 74, 319, 154), 31, 8, 0, 0, 0, 0),
- Window(_vm, Common::Rect(27, 6, 195, 142), 0, 8, 0, 0, 0, 0),
- Window(_vm, Common::Rect(225, 140, 319, 199), 0, 8, 0, 0, 0, 0)
+ Window(Common::Rect(0, 0, 320, 200), 0, 0, 0, 0, 320, 200),
+ Window(Common::Rect(237, 9, 317, 74), 0, 0, 237, 12, 307, 68),
+ Window(Common::Rect(225, 1, 319, 73), 1, 8, 225, 1, 319, 73),
+ Window(Common::Rect(0, 0, 230, 149), 0, 0, 9, 8, 216, 140),
+ Window(Common::Rect(235, 148, 309, 189), 2, 8, 0, 0, 0, 0),
+ Window(Common::Rect(70, 20, 250, 183), 3, 8, 80, 38, 240, 166),
+ Window(Common::Rect(52, 149, 268, 197), 4, 8, 0, 0, 0, 0),
+ Window(Common::Rect(108, 0, 200, 200), 5, 0, 0, 0, 0, 0),
+ Window(Common::Rect(232, 9, 312, 74), 0, 0, 0, 0, 0, 0),
+ Window(Common::Rect(103, 156, 217, 186), 6, 8, 0, 0, 0, 0),
+ Window(Common::Rect(226, 0, 319, 146), 7, 8, 0, 0, 0, 0),
+ Window(Common::Rect(8, 8, 224, 140), 8, 8, 8, 8, 224, 200),
+ Window(Common::Rect(0, 143, 320, 199), 9, 8, 0, 0, 0, 0),
+ Window(Common::Rect(50, 103, 266, 139), 10, 8, 0, 0, 0, 0),
+ Window(Common::Rect(0, 7, 320, 138), 11, 8, 0, 0, 0, 0),
+ Window(Common::Rect(50, 71, 182, 129), 12, 8, 0, 0, 0, 0),
+ Window(Common::Rect(228, 106, 319, 146), 13, 8, 0, 0, 0, 0),
+ Window(Common::Rect(20, 142, 290, 199), 14, 8, 0, 0, 0, 0),
+ Window(Common::Rect(0, 20, 320, 180), 15, 8, 0, 0, 0, 0),
+ Window(Common::Rect(231, 48, 317, 141), 16, 8, 0, 0, 0, 0),
+ Window(Common::Rect(72, 37, 248, 163), 17, 8, 0, 0, 0, 0),
+ Window(Common::Rect(99, 59, 237, 141), 18, 8, 99, 59, 237, 0),
+ Window(Common::Rect(65, 23, 250, 163), 19, 8, 75, 36, 245, 141),
+ Window(Common::Rect(80, 28, 256, 148), 20, 8, 80, 28, 256, 172),
+ Window(Common::Rect(0, 0, 320, 146), 21, 8, 0, 0, 320, 148),
+ Window(Common::Rect(27, 6, 207, 142), 22, 8, 0, 0, 0, 146),
+ Window(Common::Rect(15, 15, 161, 91), 23, 8, 0, 0, 0, 0),
+ Window(Common::Rect(90, 45, 220, 157), 24, 8, 0, 0, 0, 0),
+ Window(Common::Rect(0, 0, 320, 200), 25, 8, 0, 0, 0, 0),
+ Window(Common::Rect(0, 101, 320, 146), 26, 8, 0, 101, 320, 0),
+ Window(Common::Rect(0, 0, 320, 108), 27, 8, 0, 0, 0, 45),
+ Window(Common::Rect(50, 112, 266, 148), 28, 8, 0, 0, 0, 0),
+ Window(Common::Rect(12, 11, 164, 94), 0, 0, 0, 0, 52, 0),
+ Window(Common::Rect(8, 147, 224, 192), 0, 8, 0, 0, 0, 94),
+ Window(Common::Rect(232, 74, 312, 138), 29, 8, 0, 0, 0, 0),
+ Window(Common::Rect(226, 26, 319, 146), 30, 8, 0, 0, 0, 0),
+ Window(Common::Rect(225, 74, 319, 154), 31, 8, 0, 0, 0, 0),
+ Window(Common::Rect(27, 6, 195, 142), 0, 8, 0, 0, 0, 0),
+ Window(Common::Rect(225, 140, 319, 199), 0, 8, 0, 0, 0, 0)
};
_windows = Common::Array<Window>(windows, 40);
@@ -369,14 +375,17 @@ void Screen::horizMerge(int xp) {
for (int y = 0; y < SCREEN_HEIGHT; ++y) {
byte *destP = (byte *)getBasePtr(0, y);
- const byte *srcP = (const byte *)_pages[0].getBasePtr(0, y);
+ const byte *srcP = (const byte *)_pages[0].getBasePtr(xp, y);
Common::copy(srcP, srcP + SCREEN_WIDTH - xp, destP);
if (xp != 0) {
+ destP = (byte *)getBasePtr(SCREEN_WIDTH - xp, y);
srcP = (const byte *)_pages[1].getBasePtr(0, y);
- Common::copy(srcP + SCREEN_WIDTH - xp, srcP + SCREEN_WIDTH, destP + SCREEN_WIDTH - xp);
+ Common::copy(srcP, srcP + xp, destP);
}
}
+
+ markAllDirty();
}
void Screen::vertMerge(int yp) {
@@ -384,16 +393,18 @@ void Screen::vertMerge(int yp) {
return;
for (int y = 0; y < SCREEN_HEIGHT - yp; ++y) {
- const byte *srcP = (const byte *)_pages[0].getBasePtr(0, y);
+ const byte *srcP = (const byte *)_pages[0].getBasePtr(0, yp + y);
byte *destP = (byte *)getBasePtr(0, y);
Common::copy(srcP, srcP + SCREEN_WIDTH, destP);
}
- for (int y = SCREEN_HEIGHT - yp; y < SCREEN_HEIGHT; ++y) {
+ for (int y = 0; y < yp; ++y) {
const byte *srcP = (const byte *)_pages[1].getBasePtr(0, y);
- byte *destP = (byte *)getBasePtr(0, y);
+ byte *destP = (byte *)getBasePtr(0, SCREEN_HEIGHT - yp + y);
Common::copy(srcP, srcP + SCREEN_WIDTH, destP);
}
+
+ markAllDirty();
}
void Screen::draw(void *data) {
@@ -438,6 +449,8 @@ void Screen::fadeInner(int step) {
_vm->_events->pollEventsAndWait();
}
+
+ update();
}
void Screen::updatePalette() {
@@ -467,7 +480,7 @@ void Screen::frameWindow(uint bgType) {
// Totally black background
_vm->_screen->fillRect(Common::Rect(8, 8, 224, 140), 0);
} else {
- const byte *lookup = BACKGROUND_XLAT + bgType;
+ const byte *lookup = Res.BACKGROUND_XLAT + bgType;
for (int yp = 8; yp < 140; ++yp) {
byte *destP = (byte *)_vm->_screen->getBasePtr(8, yp);
for (int xp = 8; xp < 224; ++xp, ++destP)
diff --git a/engines/xeen/screen.h b/engines/xeen/screen.h
index 854a05a7cf..8df15b22d6 100644
--- a/engines/xeen/screen.h
+++ b/engines/xeen/screen.h
@@ -58,7 +58,7 @@ struct DrawStruct {
class Window: public XSurface {
private:
- XeenEngine *_vm;
+ static XeenEngine *_vm;
Common::Rect _bounds;
Common::Rect _innerBounds;
XSurface _savedArea;
@@ -71,13 +71,15 @@ private:
public:
bool _enabled;
public:
- virtual void addDirtyRect(const Common::Rect &r);
+ static void init(XeenEngine *vm);
public:
Window();
Window(const Window &src);
- Window(XeenEngine *vm, const Common::Rect &bounds, int a, int border,
+ Window(const Common::Rect &bounds, int a, int border,
int xLo, int ycL, int xHi, int ycH);
+ virtual void addDirtyRect(const Common::Rect &r);
+
void setBounds(const Common::Rect &r);
const Common::Rect &getBounds() { return _bounds; }
@@ -169,7 +171,7 @@ public:
/**
* Merge the two pages along a horizontal split point
*/
- void horizMerge(int xp);
+ void horizMerge(int xp = 0);
/**
* Merge the two pages along a vertical split point
@@ -178,9 +180,9 @@ public:
void draw(void *data = nullptr);
- void fadeIn(int step);
+ void fadeIn(int step = 4);
- void fadeOut(int step);
+ void fadeOut(int step = 4);
void saveBackground(int slot = 1);
diff --git a/engines/xeen/scripts.cpp b/engines/xeen/scripts.cpp
index 0bf1792b26..1393c6eccf 100644
--- a/engines/xeen/scripts.cpp
+++ b/engines/xeen/scripts.cpp
@@ -224,13 +224,13 @@ int Scripts::checkEvents() {
} else {
Window &w = screen._windows[38];
w.open();
- w.writeString(NOTHING_HERE);
+ w.writeString(Res.NOTHING_HERE);
w.update();
do {
intf.draw3d(true);
events.updateGameCounter();
- events.wait(1, true);
+ events.wait(1);
} while (!events.isKeyMousePressed());
events.clearEvents();
@@ -874,7 +874,7 @@ void Scripts::cmdConfirmWord(Common::Array<byte> &params) {
} else if (params[3]) {
msg2 = "";
} else {
- msg2 = WHATS_THE_PASSWORD;
+ msg2 = Res.WHATS_THE_PASSWORD;
}
int result = StringInput::show(_vm, params[0], msg1, msg2,_event->_opcode);
@@ -1095,9 +1095,8 @@ void Scripts::cmdSeatTextSml(Common::Array<byte> &params) {
void Scripts::cmdPlayEventVoc(Common::Array<byte> &params) {
Sound &sound = *_vm->_sound;
- sound.playSample(nullptr, 0);
- File f(EVENT_SAMPLES[params[0]]);
- sound.playSample(&f, 1);
+ sound.stopSound();
+ sound.playSound(Res.EVENT_SAMPLES[params[0]], 1);
cmdNoAction(params);
}
@@ -1435,7 +1434,7 @@ bool Scripts::ifProc(int action, uint32 mask, int mode, int charIndex) {
// Check if the character class can cast the particular spell
for (int idx = 0; idx < 39; ++idx) {
- if (SPELLS_ALLOWED[category][idx] == mask) {
+ if (Res.SPELLS_ALLOWED[category][idx] == mask) {
// Can cast it. Check if the player has it in their spellbook
if (ps._spells[idx])
v = mask;
@@ -1760,7 +1759,7 @@ void Scripts::display(bool justifyFlag, int var46) {
events.updateGameCounter();
intf.draw3d(true);
- events.wait(1, true);
+ events.wait(1);
} while (!_vm->shouldQuit() && !events.isKeyMousePressed());
w.writeString(justifyFlag ? "\r" : "\r\x3""c");
diff --git a/engines/xeen/sound.cpp b/engines/xeen/sound.cpp
index 46532fa887..1da879842a 100644
--- a/engines/xeen/sound.cpp
+++ b/engines/xeen/sound.cpp
@@ -20,61 +20,53 @@
*
*/
+#include "audio/decoders/raw.h"
#include "audio/decoders/voc.h"
#include "xeen/sound.h"
#include "xeen/xeen.h"
namespace Xeen {
-Sound *Voc::_sound;
-
-Voc::Voc(const Common::String &name) {
- if (!open(name))
- error("Could not open - %s", name.c_str());
-}
-
-void Voc::init(XeenEngine *vm) {
- _sound = vm->_sound;
-}
+/*------------------------------------------------------------------------*/
-void Voc::play() {
- _sound->playSound(this, _soundHandle);
+Sound::Sound(XeenEngine *vm, Audio::Mixer *mixer): Music(),
+ _mixer(mixer), _soundOn(true) {
}
-void Voc::stop() {
- _sound->stopSound(_soundHandle);
+Sound::~Sound() {
+ stopSound();
}
-/*------------------------------------------------------------------------*/
-
-Sound::Sound(XeenEngine *vm, Audio::Mixer *mixer): Music(mixer) {
+void Sound::playSound(Common::SeekableReadStream &s, int unused) {
+ stopSound();
+ s.seek(0);
+ Common::SeekableReadStream *srcStream = s.readStream(s.size());
+ Audio::SeekableAudioStream *stream = Audio::makeVOCStream(srcStream,
+ Audio::FLAG_UNSIGNED, DisposeAfterUse::YES);
+ _mixer->playStream(Audio::Mixer::kSFXSoundType, &_soundHandle, stream);
}
-void Sound::proc2(Common::SeekableReadStream &f) {
- // TODO
-}
-
-void Sound::startMusic(int v1) {
- // TODO
-}
+void Sound::playSound(const Common::String &name, int unused) {
+ File f;
+ if (!f.open(name))
+ error("Could not open sound - %s", name.c_str());
-void Sound::stopMusic(int id) {
- // TODO
+ playSound(f);
}
-void Sound::playSound(Common::SeekableReadStream *s, Audio::SoundHandle &soundHandle,
- Audio::Mixer::SoundType soundType) {
- Audio::SeekableAudioStream *stream = Audio::makeVOCStream(s, 0);
- _mixer->playStream(soundType, &soundHandle, stream);
+void Sound::stopSound() {
+ _mixer->stopHandle(_soundHandle);
}
-void Sound::playMusic(Common::SeekableReadStream *s, Audio::SoundHandle &soundHandle) {
- // TODO
+bool Sound::isPlaying() const {
+ return _mixer->isSoundHandleActive(_soundHandle);
}
-void Sound::stopSound(Audio::SoundHandle &soundHandle) {
- _mixer->stopHandle(soundHandle);
+void Sound::stopAllAudio() {
+ stopSong();
+ stopFX();
+ stopSound();
}
} // End of namespace Xeen
diff --git a/engines/xeen/sound.h b/engines/xeen/sound.h
index 5dd80c0e55..41342dfab1 100644
--- a/engines/xeen/sound.h
+++ b/engines/xeen/sound.h
@@ -32,64 +32,42 @@
namespace Xeen {
-class Sound;
-
-class Voc: public Common::File {
+class Sound : public Music {
private:
- static Sound *_sound;
+ Audio::Mixer *_mixer;
Audio::SoundHandle _soundHandle;
public:
- Voc() {}
- Voc(const Common::String &name);
- virtual ~Voc() { stop(); }
- static void init(XeenEngine *vm);
-
- /**
- * Start playing the sound
- */
- void play();
-
- /**
- * Stop playing the sound
- */
- void stop();
-};
-
-class Sound : public Music {
+ bool _soundOn;
public:
Sound(XeenEngine *vm, Audio::Mixer *mixer);
-
- void proc2(Common::SeekableReadStream &f);
-
- void loadMusic(const Common::String &name, int v2) {}
-
- void startMusic(int v1);
-
- void stopMusic(int id);
-
- void playSong(Common::SeekableReadStream &f) {}
+ virtual ~Sound();
/**
* Play a given sound
*/
- void playSound(Common::SeekableReadStream *s, Audio::SoundHandle &soundHandle,
- Audio::Mixer::SoundType soundType = Audio::Mixer::kSFXSoundType);
+ void playSound(Common::SeekableReadStream &s, int unused = 0);
/**
- * Play a given music
+ * Play a given sound
*/
- void playMusic(Common::SeekableReadStream *s, Audio::SoundHandle &soundHandle);
+ void playSound(const Common::String &name, int unused = 0);
/**
* Stop playing a sound
+ * @remarks In the original, passing 1 to playSound stopped the sound
*/
- void stopSound(Audio::SoundHandle &soundHandle);
+ void stopSound();
- void playSample(const Common::SeekableReadStream *stream, int v2 = 1) {}
-
- bool playSample(int v1, int v2) { return false; }
+ /**
+ * Returns true if a sound is currently playing
+ * @remarks In the original, passing 0 to playSound returned play status
+ */
+ bool isPlaying() const;
- void playFX(int id) {}
+ /**
+ * Stops all playing music, FX, and sound samples
+ */
+ void stopAllAudio();
};
} // End of namespace Xeen
diff --git a/engines/xeen/spells.cpp b/engines/xeen/spells.cpp
index 1a0761ae40..681b7b65e6 100644
--- a/engines/xeen/spells.cpp
+++ b/engines/xeen/spells.cpp
@@ -43,13 +43,13 @@ void Spells::load() {
}
int Spells::calcSpellCost(int spellId, int expenseFactor) const {
- int amount = SPELL_COSTS[spellId];
+ int amount = Res.SPELL_COSTS[spellId];
return (amount >= 0) ? (amount * 100) << expenseFactor :
(amount * -500) << expenseFactor;
}
int Spells::calcSpellPoints(int spellId, int expenseFactor) const {
- int amount = SPELL_COSTS[spellId];
+ int amount = Res.SPELL_COSTS[spellId];
return (amount >= 0) ? amount : amount * -1 * expenseFactor;
}
@@ -89,7 +89,7 @@ void Spells::executeSpell(MagicSpell spellId) {
}
void Spells::spellFailed() {
- ErrorScroll::show(_vm, SPELL_FAILED, WT_NONFREEZED_WAIT);
+ ErrorScroll::show(_vm, Res.SPELL_FAILED, WT_NONFREEZED_WAIT);
}
void Spells::castItemSpell(int itemSpellId) {
@@ -210,8 +210,8 @@ int Spells::castSpell(Character *c, MagicSpell spellId) {
int Spells::subSpellCost(Character &c, int spellId) {
Party &party = *_vm->_party;
- int gemCost = SPELL_GEM_COST[spellId];
- int spCost = SPELL_COSTS[spellId];
+ int gemCost = Res.SPELL_GEM_COST[spellId];
+ int spCost = Res.SPELL_COSTS[spellId];
// Negative SP costs indicate it's dependent on the character's level
if (spCost <= 0) {
@@ -232,8 +232,8 @@ int Spells::subSpellCost(Character &c, int spellId) {
void Spells::addSpellCost(Character &c, int spellId) {
Party &party = *_vm->_party;
- int gemCost = SPELL_GEM_COST[spellId];
- int spCost = SPELL_COSTS[spellId];
+ int gemCost = Res.SPELL_GEM_COST[spellId];
+ int spCost = Res.SPELL_COSTS[spellId];
if (spCost < 1)
spCost *= -1 * c.getCurrentLevel();
@@ -440,7 +440,7 @@ void Spells::detectMonster() {
Common::fill(&grid[0][0], &grid[7][7], 0);
w.open();
- w.writeString(DETECT_MONSTERS);
+ w.writeString(Res.DETECT_MONSTERS);
sprites.draw(w, 0, Common::Point(243, 80));
for (int yDiff = 3; yDiff >= -3; --yDiff) {
@@ -467,7 +467,7 @@ void Spells::detectMonster() {
events.updateGameCounter();
intf.draw3d(true);
- events.wait(1);
+ events.wait(1, false);
} while (!events.isKeyMousePressed());
w.close();
@@ -549,8 +549,8 @@ void Spells::etherialize() {
Party &party = *_vm->_party;
Sound &sound = *_vm->_sound;
Common::Point pt = party._mazePosition + Common::Point(
- SCREEN_POSITIONING_X[party._mazeDirection][7],
- SCREEN_POSITIONING_Y[party._mazeDirection][7]
+ Res.SCREEN_POSITIONING_X[party._mazeDirection][7],
+ Res.SCREEN_POSITIONING_Y[party._mazeDirection][7]
);
if ((map.mazeData()._mazeFlags & RESTRICTION_ETHERIALIZE) ||
@@ -774,8 +774,8 @@ void Spells::jump() {
map.getCell(14);
if (map._currentSurfaceId != 0 && map._currentWall != 1) {
party._mazePosition += Common::Point(
- SCREEN_POSITIONING_X[party._mazeDirection][14],
- SCREEN_POSITIONING_Y[party._mazeDirection][14]
+ Res.SCREEN_POSITIONING_X[party._mazeDirection][14],
+ Res.SCREEN_POSITIONING_Y[party._mazeDirection][14]
);
sound.playFX(51);
party._stepped = true;
@@ -784,13 +784,13 @@ void Spells::jump() {
}
} else {
Common::Point pt = party._mazePosition + Common::Point(
- SCREEN_POSITIONING_X[party._mazeDirection][7],
- SCREEN_POSITIONING_Y[party._mazeDirection][7]);
- if (!map.mazeLookup(party._mazePosition, MONSTER_GRID_BITMASK[party._mazeDirection]) &&
- !map.mazeLookup(pt, MONSTER_GRID_BITMASK[party._mazeDirection])) {
+ Res.SCREEN_POSITIONING_X[party._mazeDirection][7],
+ Res.SCREEN_POSITIONING_Y[party._mazeDirection][7]);
+ if (!map.mazeLookup(party._mazePosition, Res.MONSTER_GRID_BITMASK[party._mazeDirection]) &&
+ !map.mazeLookup(pt, Res.MONSTER_GRID_BITMASK[party._mazeDirection])) {
party._mazePosition += Common::Point(
- SCREEN_POSITIONING_X[party._mazeDirection][14],
- SCREEN_POSITIONING_Y[party._mazeDirection][14]
+ Res.SCREEN_POSITIONING_X[party._mazeDirection][14],
+ Res.SCREEN_POSITIONING_Y[party._mazeDirection][14]
);
sound.playFX(51);
party._stepped = true;
@@ -1244,7 +1244,7 @@ void Spells::townPortal() {
sound.playFX(51);
map._loadDarkSide = map._sideTownPortal;
_vm->_files->_isDarkCc = map._sideTownPortal > 0;
- map.load(TOWN_MAP_NUMBERS[map._sideTownPortal][townNumber - 1]);
+ map.load(Res.TOWN_MAP_NUMBERS[map._sideTownPortal][townNumber - 1]);
if (!_vm->_files->_isDarkCc) {
party.moveToRunLocation();
diff --git a/engines/xeen/sprites.cpp b/engines/xeen/sprites.cpp
index 4804f0aa66..d0e9f07aee 100644
--- a/engines/xeen/sprites.cpp
+++ b/engines/xeen/sprites.cpp
@@ -71,8 +71,8 @@ void SpriteResource::load(const Common::String &filename) {
load(f);
}
-void SpriteResource::load(const Common::String &filename, Common::Archive &archive) {
- File f(filename, archive);
+void SpriteResource::load(const Common::String &filename, ArchiveType archiveType) {
+ File f(filename, archiveType);
load(f);
}
@@ -171,10 +171,11 @@ void SpriteResource::drawOffset(XSurface &dest, uint16 offset, const Common::Poi
// Initialize the array to hold the temporary data for the line. We do this to make it simpler
// to handle both deciding which pixels to draw in a scaled image, as well as when images
- // have been horizontally flipped
- int tempLine[SCREEN_WIDTH];
- Common::fill(&tempLine[0], &tempLine[SCREEN_WIDTH], -1);
- int *lineP = flipped ? &tempLine[width - 1 - xOffset] : &tempLine[xOffset];
+ // have been horizontally flipped. Note that we allocate an extra line for before and after our
+ // work line, just in case the sprite is screwed up and overruns the line
+ int tempLine[SCREEN_WIDTH * 3];
+ Common::fill(&tempLine[SCREEN_WIDTH], &tempLine[SCREEN_WIDTH * 3], -1);
+ int *lineP = flipped ? &tempLine[SCREEN_WIDTH + width - 1 - xOffset] : &tempLine[SCREEN_WIDTH + xOffset];
// Build up the line
int byteCount, opr1, opr2;
@@ -259,7 +260,7 @@ void SpriteResource::drawOffset(XSurface &dest, uint16 offset, const Common::Poi
// Handle drawing out the line
byte *destP = (byte *)dest.getBasePtr(destPos.x, destPos.y);
int16 xp = destPos.x;
- lineP = &tempLine[0];
+ lineP = &tempLine[SCREEN_WIDTH];
for (int xCtr = 0; xCtr < width; ++xCtr, ++lineP) {
bit = (scaleMaskX >> 15) & 1;
diff --git a/engines/xeen/sprites.h b/engines/xeen/sprites.h
index 9a241c2100..025c8db219 100644
--- a/engines/xeen/sprites.h
+++ b/engines/xeen/sprites.h
@@ -27,6 +27,7 @@
#include "common/array.h"
#include "common/file.h"
#include "graphics/surface.h"
+#include "xeen/files.h"
#include "xeen/xsurface.h"
namespace Xeen {
@@ -34,8 +35,11 @@ namespace Xeen {
class XeenEngine;
class Window;
-enum SpriteFlags { SPRFLAG_SCENE_CLIPPED = 0x2000, SPRFLAG_4000 = 0x4000,
- SPRFLAG_HORIZ_FLIPPED = 0x8000, SPRFLAG_RESIZE = 0x10000 };
+enum SpriteFlags {
+ SPRFLAG_800 = 0x800, SPRFLAG_SCENE_CLIPPED = 0x2000,
+ SPRFLAG_4000 = 0x4000, SPRFLAG_HORIZ_FLIPPED = 0x8000,
+ SPRFLAG_RESIZE = 0x10000
+};
class SpriteResource {
private:
@@ -88,7 +92,7 @@ public:
/**
* Load a sprite resource from a given file and archive
*/
- void load(const Common::String &filename, Common::Archive &archive);
+ void load(const Common::String &filename, ArchiveType archiveType);
/**
* Clears the sprite resource
diff --git a/engines/xeen/town.cpp b/engines/xeen/town.cpp
index 7cba3853f2..c0ecf5cf6f 100644
--- a/engines/xeen/town.cpp
+++ b/engines/xeen/town.cpp
@@ -30,7 +30,7 @@
namespace Xeen {
-Town::Town(XeenEngine *vm) : _vm(vm) {
+Town::Town(XeenEngine *vm) : ButtonContainer(vm) {
Common::fill(&_arr1[0], &_arr1[6], 0);
_townMaxId = 0;
_townActionId = 0;
@@ -77,7 +77,7 @@ int Town::townAction(int actionId) {
return 0;
}
- _townMaxId = TOWN_MAXES[_vm->_files->_isDarkCc][actionId];
+ _townMaxId = Res.TOWN_MAXES[_vm->_files->_isDarkCc][actionId];
_townActionId = actionId;
_drawFrameIndex = 0;
_v1 = 0;
@@ -101,7 +101,7 @@ int Town::townAction(int actionId) {
addButton(Common::Rect(288, 108, 312, 128), Common::KEYCODE_ESCAPE, &_icons1);
intf._overallFrame = 1;
- sound.playSample(nullptr, 0);
+ sound.stopSound();
vocName = isDarkCc ? "bank1.voc" : "banker.voc";
break;
@@ -114,7 +114,7 @@ int Town::townAction(int actionId) {
addButton(Common::Rect(234, 74, 308, 82), 0);
addButton(Common::Rect(234, 84, 308, 92), 0);
- sound.playSample(nullptr, 0);
+ sound.stopSound();
vocName = isDarkCc ? "see2.voc" : "whaddayo.voc";
break;
@@ -129,7 +129,7 @@ int Town::townAction(int actionId) {
addButton(Common::Rect(234, 84, 308, 92), 0);
_vm->_mode = MODE_17;
- sound.playSample(nullptr, 0);
+ sound.stopSound();
vocName = isDarkCc ? "parrot1.voc" : "guild10.voc";
break;
@@ -145,7 +145,7 @@ int Town::townAction(int actionId) {
addButton(Common::Rect(234, 84, 308, 92), Common::KEYCODE_r);
_vm->_mode = MODE_17;
- sound.playSample(nullptr, 0);
+ sound.stopSound();
vocName = isDarkCc ? "hello1.voc" : "hello.voc";
break;
@@ -158,7 +158,7 @@ int Town::townAction(int actionId) {
addButton(Common::Rect(234, 74, 308, 82), Common::KEYCODE_u);
addButton(Common::Rect(234, 84, 308, 92), 0);
- sound.playSample(nullptr, 0);
+ sound.stopSound();
vocName = isDarkCc ? "help2.voc" : "maywe2.voc";
break;
@@ -171,7 +171,7 @@ int Town::townAction(int actionId) {
addButton(Common::Rect(281, 108, 305, 128), Common::KEYCODE_ESCAPE, &_icons1);
addButton(Common::Rect(242, 108, 266, 128), Common::KEYCODE_t);
- sound.playSample(nullptr, 0);
+ sound.stopSound();
vocName = isDarkCc ? "training.voc" : "youtrn1.voc";
break;
@@ -203,12 +203,12 @@ int Town::townAction(int actionId) {
break;
}
- sound.loadMusic(TOWN_ACTION_MUSIC[actionId], 223);
+ sound.playSong(Res.TOWN_ACTION_MUSIC[actionId], 223);
- _townSprites.resize(TOWN_ACTION_FILES[isDarkCc][actionId]);
+ _townSprites.resize(Res.TOWN_ACTION_FILES[isDarkCc][actionId]);
for (uint idx = 0; idx < _townSprites.size(); ++idx) {
Common::String shapesName = Common::String::format("%s%d.twn",
- TOWN_ACTION_SHAPES[actionId], idx + 1);
+ Res.TOWN_ACTION_SHAPES[actionId], idx + 1);
_townSprites[idx].load(shapesName);
}
@@ -239,8 +239,7 @@ int Town::townAction(int actionId) {
if (actionId == 0)
intf._overallFrame = 2;
- File voc(vocName);
- sound.playSample(&voc, 1);
+ sound.playSound(vocName, 1);
do {
townWait();
@@ -253,17 +252,15 @@ int Town::townAction(int actionId) {
case 1:
// Leave blacksmith
if (isDarkCc) {
- sound.playSample(nullptr, 0);
- File f("come1.voc");
- sound.playSample(&f, 1);
+ sound.stopSound();
+ sound.playSound("come1.voc", 1);
}
break;
case 3: {
// Leave Tavern
- sound.playSample(nullptr, 0);
- File f(isDarkCc ? "gdluck1.voc" : "goodbye.voc");
- sound.playSample(&f, 1);
+ sound.stopSound();
+ sound.playSound(isDarkCc ? "gdluck1.voc" : "goodbye.voc", 1);
map.mazeData()._mazeNumber = party._mazeId;
break;
@@ -339,25 +336,25 @@ Common::String Town::createTownText(Character &ch) {
switch (_townActionId) {
case 0:
// Bank
- return Common::String::format(BANK_TEXT,
+ return Common::String::format(Res.BANK_TEXT,
XeenEngine::printMil(party._bankGold).c_str(),
XeenEngine::printMil(party._bankGems).c_str(),
XeenEngine::printMil(party._gold).c_str(),
XeenEngine::printMil(party._gems).c_str());
case 1:
// Blacksmith
- return Common::String::format(BLACKSMITH_TEXT,
+ return Common::String::format(Res.BLACKSMITH_TEXT,
XeenEngine::printMil(party._gold).c_str());
case 2:
// Guild
- return !ch.guildMember() ? GUILD_NOT_MEMBER_TEXT :
- Common::String::format(GUILD_TEXT, ch._name.c_str());
+ return !ch.guildMember() ? Res.GUILD_NOT_MEMBER_TEXT :
+ Common::String::format(Res.GUILD_TEXT, ch._name.c_str());
case 3:
// Tavern
- return Common::String::format(TAVERN_TEXT, ch._name.c_str(),
- FOOD_AND_DRINK, XeenEngine::printMil(party._gold).c_str());
+ return Common::String::format(Res.TAVERN_TEXT, ch._name.c_str(),
+ Res.FOOD_AND_DRINK, XeenEngine::printMil(party._gold).c_str());
case 4:
// Temple
@@ -424,7 +421,7 @@ Common::String Town::createTownText(Character &ch) {
_donation = _flag1 ? 0 : _v14;
_healCost += _v6 + _v5;
- return Common::String::format(TEMPLE_TEXT, ch._name.c_str(),
+ return Common::String::format(Res.TEMPLE_TEXT, ch._name.c_str(),
_healCost, _donation, XeenEngine::printK(_uncurseCost).c_str(),
XeenEngine::printMil(party._gold).c_str());
@@ -463,17 +460,17 @@ Common::String Town::createTownText(Character &ch) {
if (_experienceToNextLevel >= 0x10000 && ch._level._permanent < _v20) {
int nextLevel = ch._level._permanent + 1;
- return Common::String::format(EXPERIENCE_FOR_LEVEL,
+ return Common::String::format(Res.EXPERIENCE_FOR_LEVEL,
ch._name.c_str(), _experienceToNextLevel, nextLevel);
} else if (ch._level._permanent >= 20) {
_experienceToNextLevel = 1;
- msg = Common::String::format(LEARNED_ALL, ch._name.c_str());
+ msg = Common::String::format(Res.LEARNED_ALL, ch._name.c_str());
} else {
- msg = Common::String::format(ELIGIBLE_FOR_LEVEL,
+ msg = Common::String::format(Res.ELIGIBLE_FOR_LEVEL,
ch._name.c_str(), ch._level._permanent + 1);
}
- return Common::String::format(TRAINING_TEXT,
+ return Common::String::format(Res.TRAINING_TEXT,
XeenEngine::printMil(party._gold).c_str());
default:
@@ -559,10 +556,9 @@ Character *Town::doGuildOptions(Character *c) {
intf.highlightChar(_buttonValue);
if (!c->guildMember()) {
- sound.playSample(nullptr, 0);
+ sound.stopSound();
intf._overallFrame = 5;
- File f(isDarkCc ? "skull1.voc" : "guild11.voc");
- sound.playSample(&f, 1);
+ sound.playSound(isDarkCc ? "skull1.voc" : "guild11.voc", 1);
}
}
} else if (_buttonValue == Common::KEYCODE_s) {
@@ -608,13 +604,12 @@ Character *Town::doTavernOptions(Character *c) {
// Drink
if (!c->noActions()) {
if (party.subtract(0, 1, 0, WT_2)) {
- sound.playSample(nullptr, 0);
- File f("gulp.voc");
- sound.playSample(&f, 0);
+ sound.stopSound();
+ sound.playSound("gulp.voc");
_v21 = 1;
- screen._windows[10].writeString(Common::String::format(TAVERN_TEXT,
- c->_name.c_str(), GOOD_STUFF,
+ screen._windows[10].writeString(Common::String::format(Res.TAVERN_TEXT,
+ c->_name.c_str(), Res.GOOD_STUFF,
XeenEngine::printMil(party._gold).c_str()));
drawButtons(&screen._windows[0]);
screen._windows[10].update();
@@ -665,12 +660,11 @@ Character *Town::doTavernOptions(Character *c) {
if (YesNo::show(_vm, false, true)) {
if (party._food >= _v22) {
- ErrorScroll::show(_vm, FOOD_PACKS_FULL, WT_2);
+ ErrorScroll::show(_vm, Res.FOOD_PACKS_FULL, WT_2);
} else if (party.subtract(0, _v23, 0, WT_2)) {
party._food = _v22;
- sound.playSample(nullptr, 0);
- File f(isDarkCc ? "thanks2.voc" : "thankyou.voc");
- sound.playSample(&f, 1);
+ sound.stopSound();
+ sound.playSound(isDarkCc ? "thanks2.voc" : "thankyou.voc", 1);
}
}
@@ -706,8 +700,8 @@ Character *Town::doTavernOptions(Character *c) {
// Sign In
idx = isDarkCc ? (party._mazeId - 29) >> 1 : party._mazeId - 28;
assert(idx >= 0);
- party._mazePosition.x = TAVERN_EXIT_LIST[isDarkCc ? 1 : 0][_townActionId][idx][0];
- party._mazePosition.y = TAVERN_EXIT_LIST[isDarkCc ? 1 : 0][_townActionId][idx][1];
+ party._mazePosition.x = Res.TAVERN_EXIT_LIST[isDarkCc ? 1 : 0][_townActionId][idx][0];
+ party._mazePosition.y = Res.TAVERN_EXIT_LIST[isDarkCc ? 1 : 0][_townActionId][idx][1];
if (!isDarkCc || party._mazeId == 29)
party._mazeDirection = DIR_WEST;
@@ -731,8 +725,8 @@ Character *Town::doTavernOptions(Character *c) {
case Common::KEYCODE_t:
if (!c->noActions()) {
if (!_v21) {
- screen._windows[10].writeString(Common::String::format(TAVERN_TEXT,
- c->_name.c_str(), HAVE_A_DRINK,
+ screen._windows[10].writeString(Common::String::format(Res.TAVERN_TEXT,
+ c->_name.c_str(), Res.HAVE_A_DRINK,
XeenEngine::printMil(party._gold).c_str()));
drawButtons(&screen);
screen._windows[10].update();
@@ -740,16 +734,15 @@ Character *Town::doTavernOptions(Character *c) {
} else {
_v21 = 0;
if (c->_conditions[DRUNK]) {
- screen._windows[10].writeString(Common::String::format(TAVERN_TEXT,
- c->_name.c_str(), YOURE_DRUNK,
+ screen._windows[10].writeString(Common::String::format(Res.TAVERN_TEXT,
+ c->_name.c_str(), Res.YOURE_DRUNK,
XeenEngine::printMil(party._gold).c_str()));
drawButtons(&screen);
screen._windows[10].update();
townWait();
} else if (party.subtract(0, 1, 0, WT_2)) {
- sound.playSample(nullptr, 0);
- File f(isDarkCc ? "thanks2.voc" : "thankyou.voc");
- sound.playSample(&f, 1);
+ sound.stopSound();
+ sound.playSound(isDarkCc ? "thanks2.voc" : "thankyou.voc", 1);
if (party._mazeId == (isDarkCc ? 29 : 28)) {
_v24 = 30;
@@ -808,9 +801,8 @@ Character *Town::doTempleOptions(Character *c) {
case Common::KEYCODE_d:
if (_donation && party.subtract(0, _donation, 0, WT_2)) {
- sound.playSample(nullptr, 0);
- File f("coina.voc");
- sound.playSample(&f, 1);
+ sound.stopSound();
+ sound.playSound("coina.voc", 1);
_dayOfWeek = (_dayOfWeek + 1) / 10;
if (_dayOfWeek == (party._day / 10)) {
@@ -824,9 +816,8 @@ Character *Town::doTempleOptions(Character *c) {
party._blessed = amt;
intf.drawParty(true);
- sound.playSample(nullptr, 0);
- Voc voc("ahh.voc");
- voc.play();
+ sound.stopSound();
+ sound.playSound("ahh.voc");
_flag1 = true;
_donation = 0;
}
@@ -855,9 +846,8 @@ Character *Town::doTempleOptions(Character *c) {
_v1 = 1440;
intf.drawParty(true);
- sound.playSample(nullptr, 0);
- File f("ahh.voc");
- sound.playSample(&f, 1);
+ sound.stopSound();
+ sound.playSound("ahh.voc", 1);
}
break;
@@ -872,9 +862,8 @@ Character *Town::doTempleOptions(Character *c) {
_v1 = 1440;
intf.drawParty(true);
- sound.playSample(nullptr, 0);
- File f("ahh.voc");
- sound.playSample(&f, 1);
+ sound.stopSound();
+ sound.playSound("ahh.voc", 1);
}
break;
@@ -909,7 +898,7 @@ Character *Town::doTrainingOptions(Character *c) {
case Common::KEYCODE_t:
if (_experienceToNextLevel) {
- sound.playSample(nullptr, 0);
+ sound.stopSound();
_drawFrameIndex = 0;
Common::String name;
@@ -919,15 +908,13 @@ Character *Town::doTrainingOptions(Character *c) {
name = isDarkCc ? "gtlost.voc" : "trainin0.voc";
}
- File f(name);
- sound.playSample(&f);
+ sound.playSound(name);
} else if (!c->noActions()) {
if (party.subtract(0, (c->_level._permanent * c->_level._permanent) * 10, 0, WT_2)) {
_drawFrameIndex = 0;
- sound.playSample(nullptr, 0);
- File f(isDarkCc ? "prtygd.voc" : "trainin2.voc");
- sound.playSample(&f, 1);
+ sound.stopSound();
+ sound.playSound(isDarkCc ? "prtygd.voc" : "trainin2.voc", 1);
c->_experience -= c->nextExperienceLevel() -
(c->getCurrentExperience() - c->_experience);
@@ -973,8 +960,8 @@ void Town::depositWithdrawl(int choice) {
_buttons[1]._value = Common::KEYCODE_e;
_buttons[2]._value = Common::KEYCODE_ESCAPE;
- Common::String msg = Common::String::format(GOLD_GEMS,
- DEPOSIT_WITHDRAWL[choice],
+ Common::String msg = Common::String::format(Res.GOLD_GEMS,
+ Res.DEPOSIT_WITHDRAWL[choice],
XeenEngine::printMil(gold).c_str(),
XeenEngine::printMil(gems).c_str());
@@ -983,7 +970,7 @@ void Town::depositWithdrawl(int choice) {
drawButtons(&screen._windows[35]);
screen._windows[35].update();
- sound.playSample(nullptr, 0);
+ sound.stopSound();
File voc("coina.voc");
bool flag = false;
@@ -1007,7 +994,7 @@ void Town::depositWithdrawl(int choice) {
(!choice && !party._gold && !flag)) {
party.notEnough(flag, choice, 1, WT_2);
} else {
- screen._windows[35].writeString(AMOUNT);
+ screen._windows[35].writeString(Res.AMOUNT);
int amount = NumericInput::show(_vm, 35, 10, 77);
if (amount) {
@@ -1038,8 +1025,8 @@ void Town::depositWithdrawl(int choice) {
gems = party._gems;
}
- sound.playSample(&voc, 0);
- msg = Common::String::format(GOLD_GEMS_2, DEPOSIT_WITHDRAWL[choice],
+ sound.playSound(voc);
+ msg = Common::String::format(Res.GOLD_GEMS_2, Res.DEPOSIT_WITHDRAWL[choice],
XeenEngine::printMil(gold).c_str(), XeenEngine::printMil(gems).c_str());
screen._windows[35].writeString(msg);
screen._windows[35].update();
@@ -1061,7 +1048,7 @@ void Town::drawTownAnim(bool flag) {
bool isDarkCc = _vm->_files->_isDarkCc;
if (_townActionId == 1) {
- if (sound.playSample(1, 0)) {
+ if (sound.isPlaying()) {
if (isDarkCc) {
_townSprites[_drawFrameIndex / 8].draw(screen, _drawFrameIndex % 8, _townPos);
_townSprites[2].draw(screen, _vm->getRandomNumber(11) == 1 ? 9 : 10,
@@ -1085,9 +1072,9 @@ void Town::drawTownAnim(bool flag) {
switch (_townActionId) {
case 0:
- if (sound.playSample(1, 0) || (isDarkCc && intf._overallFrame)) {
+ if (sound.isPlaying() || (isDarkCc && intf._overallFrame)) {
if (isDarkCc) {
- if (sound.playSample(1, 0) || intf._overallFrame == 1) {
+ if (sound.isPlaying() || intf._overallFrame == 1) {
_townSprites[4].draw(screen, _vm->getRandomNumber(13, 18),
Common::Point(8, 30));
} else if (intf._overallFrame > 1) {
@@ -1103,7 +1090,7 @@ void Town::drawTownAnim(bool flag) {
break;
case 2:
- if (sound.playSample(1, 0)) {
+ if (sound.isPlaying()) {
if (isDarkCc) {
if (intf._overallFrame) {
intf._overallFrame ^= 1;
@@ -1116,19 +1103,19 @@ void Town::drawTownAnim(bool flag) {
break;
case 3:
- if (sound.playSample(1, 0) && isDarkCc) {
+ if (sound.isPlaying() && isDarkCc) {
_townSprites[4].draw(screen, _vm->getRandomNumber(7), Common::Point(153, 49));
}
break;
case 4:
- if (sound.playSample(1, 0)) {
+ if (sound.isPlaying()) {
_townSprites[3].draw(screen, _vm->getRandomNumber(2, 4), Common::Point(8, 8));
}
break;
case 5:
- if (sound.playSample(1, 0)) {
+ if (sound.isPlaying()) {
if (isDarkCc) {
_townSprites[_drawFrameIndex / 8].draw(screen, _drawFrameIndex % 8, _townPos);
}
@@ -1169,8 +1156,7 @@ void Town::drawTownAnim(bool flag) {
sound.playFX(45);
if (_townActionId == 5 && _drawFrameIndex == 23) {
- File f("spit1.voc");
- sound.playSample(&f, 0);
+ sound.playSound("spit1.voc");
}
} else {
if (_townMaxId == 32 && _drawFrameIndex == 0)
@@ -1262,7 +1248,7 @@ bool TownMessage::execute(int portrait, const Common::String &name, const Common
clearButtons();
do {
- events.wait(3, true);
+ events.wait(3);
checkEvents(_vm);
if (_vm->shouldQuit())
return false;
diff --git a/engines/xeen/town.h b/engines/xeen/town.h
index f56f24ca73..0767638f8a 100644
--- a/engines/xeen/town.h
+++ b/engines/xeen/town.h
@@ -37,7 +37,6 @@ class TownMessage;
class Town: public ButtonContainer {
friend class TownMessage;
private:
- XeenEngine *_vm;
SpriteResource _icons1, _icons2;
Common::StringArray _textStrings;
Common::Array<SpriteResource> _townSprites;
@@ -114,10 +113,9 @@ public:
class TownMessage : public ButtonContainer {
private:
- XeenEngine *_vm;
SpriteResource _iconSprites;
- TownMessage(XeenEngine *vm) : ButtonContainer(), _vm(vm) {}
+ TownMessage(XeenEngine *vm) : ButtonContainer(vm) {}
bool execute(int portrait, const Common::String &name,
const Common::String &text, int confirm);
diff --git a/engines/xeen/worldofxeen/clouds_cutscenes.cpp b/engines/xeen/worldofxeen/clouds_cutscenes.cpp
index 1d578bdbea..e257215b74 100644
--- a/engines/xeen/worldofxeen/clouds_cutscenes.cpp
+++ b/engines/xeen/worldofxeen/clouds_cutscenes.cpp
@@ -21,23 +21,455 @@
*/
#include "xeen/worldofxeen/clouds_cutscenes.h"
+#include "xeen/worldofxeen/worldofxeen_resources.h"
#include "xeen/sound.h"
namespace Xeen {
+namespace WorldOfXeen {
bool CloudsCutscenes::showCloudsTitle() {
- // TODO
+ EventsManager &events = *_vm->_events;
+ Screen &screen = *_vm->_screen;
+ Sound &sound = *_vm->_sound;
+
+ // Initial logo display
+ screen.loadPalette("intro1.pal");
+ screen.loadBackground("logobak.raw");
+ screen.saveBackground();
+ screen.update();
+ screen.fadeIn(128);
+
+ SpriteResource logo[2] = {
+ SpriteResource("logo.vga"), SpriteResource("logo1.vga")
+ };
+ sound.playFX(1);
+
+ for (int idx = 0; idx < 80; ++idx) {
+ screen.restoreBackground();
+ logo[idx / 65].draw(screen, idx % 65);
+ screen.update();
+
+ switch (idx) {
+ case 37:
+ sound.playFX(0);
+ sound.playFX(53);
+ sound.playSound("fire.voc");
+ break;
+ case 52:
+ case 60:
+ sound.playFX(3);
+ break;
+ case 64:
+ sound.playFX(2);
+ break;
+ case 66:
+ sound.playFX(52);
+ sound.playSound("meangro&.voc");
+ break;
+ default:
+ break;
+ }
+
+ WAIT(2);
+ }
+
+ screen.restoreBackground();
+ screen.update();
+ WAIT(30);
+
+ screen.fadeOut(8);
+ logo[0].clear();
+ logo[1].clear();
+
return true;
}
bool CloudsCutscenes::showCloudsIntro() {
- // TODO
+ EventsManager &events = *_vm->_events;
+ Screen &screen = *_vm->_screen;
+ Sound &sound = *_vm->_sound;
+ SpriteResource stars("stars.vga"), intro1("intro1.vga"),
+ lake("lake.vga"), xeen("xeen.vga"), wizTower("wiztower.vga"),
+ wizTower2("wiztwer2.vga"), lake2("lake2.vga"), lake3("lake3.vga"),
+ xeen1("xeen1.vga");
+ _subtitles.load("special.bin", GAME_ARCHIVE);
+ _vm->_files->_isDarkCc = false;
+
+ // Show the production splash screen
+ sound.playSong("mm4theme.m");
+ screen.loadBackground("jvc.raw");
+ screen.loadPalette("mm4.pal");
+ screen.update();
+ screen.fadeIn();
+ WAIT(30);
+ screen.fadeOut(8);
+
+ // Clouds of Xeen title with vertically scrolling background
+ screen.loadPalette("intro.pal");
+ screen.loadBackground("blank.raw");
+ screen.saveBackground();
+ stars.draw(screen, 0);
+ stars.draw(screen, 1, Common::Point(160, 0));
+ screen.loadPage(0);
+ intro1.draw(screen, 0);
+ screen.loadPage(1);
+
+ bool fadeFlag = true;
+ for (int yCtr = SCREEN_HEIGHT, yScroll = 0, xeenCtr = -1; yCtr > 0; --yCtr, ++yScroll) {
+ screen.vertMerge(yScroll);
+ if (yCtr < 160) {
+ xeen.draw(screen, 0);
+ }
+ else if (yCtr < 100) {
+ xeen.draw(screen, 0);
+ if (++xeenCtr < 14)
+ xeen1.draw(screen, xeenCtr);
+ }
+ screen.update();
+
+ if (fadeFlag) {
+ screen.fadeIn();
+ fadeFlag = false;
+ }
+
+ WAIT(1);
+ }
+
+ // Remainder of vertical scrolling of background
+ screen.restoreBackground();
+ intro1.draw(screen, 0);
+ screen.loadPage(0);
+ lake.draw(screen, 0);
+ screen.loadPage(1);
+
+ bool drawFlag = false;
+ for (int yCtr = SCREEN_HEIGHT - 1, yScroll = 1, lakeCtr = 0; yCtr > 0; --yCtr, ++yScroll) {
+ screen.vertMerge(yScroll);
+
+ if (yCtr < 95) {
+ if (++lakeCtr >= 44 || drawFlag) {
+ lakeCtr = 0;
+ drawFlag = true;
+ } else {
+ lake3.draw(screen, lakeCtr, Common::Point(0, yCtr));
+ }
+ }
+
+ xeen.draw(screen, 0);
+ screen.update();
+ WAIT(1);
+ }
+
+ screen.freePages();
+
+ // Flying creatures moving horizontally
+ lake.draw(screen, 0);
+ screen.saveBackground();
+
+ int frameNum = 0;
+ events.updateGameCounter();
+ for (int idx = 0; idx < 100; ++idx) {
+ frameNum = (frameNum + 1) % 43;
+ screen.restoreBackground();
+ lake2.draw(screen, frameNum, Common::Point(0, 0), SPRFLAG_800);
+ WAIT(1);
+ }
+
+ // Zoom in on a closeup of the wizardry tower
+ const int XLIST1[16] = { 0, 5, 10, 15, 20, 25, 30, 35, 40, 44, 48, 52, 56, 60, 64, 68 };
+ const int XLIST2[16] = { 160, 155, 150, 145, 140, 135, 130, 125, 120, 114, 108, 102, 96, 90, 84, 78 };
+ const int YLIST[23] = { 0, 6, 12, 17, 20, 23, 26, 29, 32, 35, 38, 41, 44, 47, 50, 51 };
+
+ for (int idx = 15; idx >= 0; --idx) {
+ events.updateGameCounter();
+
+ screen.restoreBackground();
+ lake2.draw(screen, frameNum, Common::Point(0, 0), SPRFLAG_800);
+ frameNum = (frameNum + 1) % 43;
+ wizTower.draw(screen, 0, Common::Point(XLIST1[idx], YLIST[idx]), 0, idx);
+ wizTower.draw(screen, 1, Common::Point(XLIST2[idx], YLIST[idx]), 0, idx);
+ screen.update();
+ WAIT(1);
+ }
+
+ // Cloaked figure walks horizontally
+ wizTower.draw(screen, 0);
+ wizTower.draw(screen, 1, Common::Point(160, 0));
+ screen.saveBackground();
+
+ for (int idx = 0; idx < 39; ++idx) {
+ screen.restoreBackground();
+ wizTower2.draw(screen, idx);
+ screen.update();
+
+ WAIT(2);
+ }
+
+ screen.fadeOut();
+ lake2.clear();
+ lake3.clear();
+ xeen1.clear();
+
+ // All the lines whilst the scroll is open
+ SpriteResource groupo("groupo.vga"), group("group.vga"),
+ crodo("crodo.vga"), box("box.vga");
+
+ groupo.draw(screen, 0);
+ groupo.draw(screen, 1, Common::Point(160, 0));
+ crodo.draw(screen, 0, Common::Point(0, -5));
+ screen._windows[0].writeString(Res.CLOUDS_INTRO1);
+
+ // Unroll a scroll
+ if (doScroll(false, true))
+ return false;
+
+ sound.setMusicVolume(75);
+ screen.restoreBackground();
+ screen.update();
+ resetSubtitles(0, 1);
+
+ // Loop through each spoken line
+ int ctr1 = 0, ctr2 = 0, ctr3 = 0, ctr4 = 0, ctr5 = 0, totalCtr = 0;
+ for (int lineCtr = 0; lineCtr < 14; ++lineCtr) {
+ if (lineCtr != 6 && lineCtr != 7) {
+ sound.playSound(_INTRO_VOCS[lineCtr]);
+ }
+
+ for (int frameCtr = 0, lookup = 0; sound.isPlaying() || _subtitleSize; ) {
+ groupo.draw(screen, 0);
+ groupo.draw(screen, 1, Common::Point(160, 0));
+
+ switch (lineCtr) {
+ case 2:
+ ctr1 = (ctr1 + 1) % 5;
+ group.draw(screen, ctr1);
+ ctr4 = (ctr4 + 1) % 9;
+ break;
+
+ case 4:
+ ctr4 = (ctr4 + 1) % 9 + 9;
+ break;
+
+ case 8:
+ case 12:
+ ctr2 = (ctr2 + 1) % 3;
+ ctr4 = (ctr4 + 1) % 9;
+ ctr3 = (ctr3 + 1) % 6 + 3;
+ break;
+
+ case 9:
+ case 13:
+ ctr3 = (ctr3 + 1) % 3;
+ group.draw(screen, ctr3 + 43, Common::Point(178, 134));
+ ctr4 = (ctr4 + 1) % 9;
+ ctr2 = (ctr2 % 15) + 3;
+ break;
+
+ default:
+ ctr4 = (ctr4 + 1) % 9;
+ ctr2 = (ctr2 + 1) % 15 + 3;
+ ctr3 = (ctr3 + 1) % 6 + 3;
+ break;
+ }
+
+ group.draw(screen, ctr4 + 5, Common::Point(0, 99));
+ group.draw(screen, ctr2 + 24, Common::Point(202, 12));
+ if ((++totalCtr % 30) == 0)
+ group.draw(screen, 43, Common::Point(178, 134));
+
+ switch (lineCtr) {
+ case 2:
+ case 4:
+ case 8:
+ case 9:
+ case 12:
+ case 13: {
+ crodo.draw(screen, 0, Common::Point(0, -5));
+ screen._windows[0].writeString(Res.CLOUDS_INTRO1);
+
+ ctr5 = (ctr5 + 1) % 19;
+ WAIT(1);
+ showSubtitles();
+ continue;
+ }
+
+ default:
+ crodo.draw(screen, frameCtr, Common::Point(0, -5));
+ if (lookup > 30)
+ lookup = 30;
+ frameCtr = _INTRO_FRAMES_VALS[_INTRO_FRAMES_LOOKUP[lineCtr]][lookup];
+ screen._windows[0].writeString(Res.CLOUDS_INTRO1);
+
+ ctr5 = (ctr5 + 1) % 19;
+ WAIT(1);
+ showSubtitles();
+ break;
+ }
+
+ events.updateGameCounter();
+ while (events.timeElapsed() < _INTRO_FRAMES_WAIT[_INTRO_FRAMES_LOOKUP[lineCtr]][lookup]
+ && sound.isPlaying()) {
+ events.pollEventsAndWait();
+ if (events.isKeyMousePressed())
+ return false;
+ }
+
+ ++lookup;
+ if (!sound._soundOn && lookup > 30)
+ lookup = 0;
+ }
+
+ if (!sound._soundOn)
+ lineCtr = 20;
+
+ if (lineCtr == 5)
+ sound.playSound(_INTRO_VOCS[6]);
+ else if (lineCtr == 6)
+ sound.playSound(_INTRO_VOCS[7]);
+ }
+
+ // Roll up the scroll again
+ sound.songCommand(50);
+ doScroll(true, false);
+
return true;
}
bool CloudsCutscenes::showCloudsEnding() {
+ EventsManager &events = *_vm->_events;
+ FileManager &files = *_vm->_files;
+ Screen &screen = *_vm->_screen;
+ Sound &sound = *_vm->_sound;
+
+ files._isDarkCc = false;
+ File::setCurrentArchive(GAME_ARCHIVE);
+
+ // Show the castle with swirling clouds and lightning
+ SpriteResource prec[42];
+ prec[0].load("prec.end");
+ for (int idx = 1; idx < 42; ++idx)
+ prec[idx].load(Common::String::format("prec00%02u.frm", idx));
+
+ screen.loadBackground("blank.raw");
+ screen.loadPalette("mm4e.pal");
+ prec[0].draw(screen, 0);
+ prec[0].draw(screen, 1, Common::Point(160, 0));
+ screen.update();
+ screen.fadeIn();
+ WAIT(15);
+
+ sound.playFX(1);
+ sound.playFX(34);
+
+ for (int idx = 1; idx < 42; ++idx) {
+ prec[idx].draw(screen, 0);
+ prec[idx].draw(screen, 1, Common::Point(160, 0));
+ screen.update();
+
+ switch (idx) {
+ case 8:
+ case 18:
+ case 21:
+ sound.playFX(33);
+ break;
+
+ case 19:
+ case 25:
+ sound.playFX(34);
+ break;
+
+ default:
+ break;
+ }
+
+ WAIT(3);
+ }
+
+ for (int idx = 0; idx < 42; ++idx)
+ prec[idx].clear();
+
+ // Closeup of castle
+ SpriteResource vort[21], cast[6], darkLord[4];
+ for (int idx = 1; idx < 21; ++idx)
+ vort[idx].load(Common::String::format("vort%02u.frm", idx));
+ for (int idx = 1; idx < 7; ++idx)
+ cast[idx - 1].load(Common::String::format("cast%02u.end", idx));
+ for (int idx = 1; idx < 4; ++idx)
+ darkLord[idx].load(Common::String::format("darklrd%d.end", idx));
+
+
+
// TODO
+ WAIT(5000);
return true;
}
+const char *const CloudsCutscenes::_INTRO_VOCS[14] = {
+ "crodo1.voc", "crodo2.voc", "iamking.voc", "crodo3.voc",
+ "ya1.voc", "crodo4a.voc", "crodo4b.voc", "crodo4c.voc",
+ "xeenlaff.voc", "tiger2&.voc", "crodo5.voc", "crodo6.voc",
+ "xeenlaff.voc", "tiger2&.voc"
+};
+
+const int CloudsCutscenes::_INTRO_FRAMES_LOOKUP[14] = {
+ 0, 1, 0, 2, 0, 3, 4, 5, 0, 0, 6, 7, 0, 0
+};
+
+const int CloudsCutscenes::_INTRO_FRAMES_VALS[8][32] = {
+ {
+ 4, 2, 3, 0, 2, 3, 2, 0, 1, 1, 3, 4, 3, 2, 4, 2,
+ 3, 4, 3, 4, 3, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+ }, {
+ 3, 2, 3, 2, 4, 3, 0, 3, 2, 2, 3, 1, 2, 3, 3, 3,
+ 2, 3, 2, 3, 2, 0, 3, 2, 0, 0, 0, 0, 0, 0, 2, 4
+ }, {
+ 3, 1, 2, 3, 0, 3, 4, 3, 2, 3, 0, 3, 2, 3, 2, 1,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 3
+ }, {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 1, 2, 3
+ }, {
+ 4, 2, 2, 3, 2, 3, 3, 4, 2, 4, 2, 0, 3, 2, 3, 2,
+ 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 0, 2, 3
+ }, {
+ 2, 0, 2, 3, 2, 4, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 3, 2, 3, 1
+ }, {
+ 3, 2, 0, 2, 4, 2, 3, 2, 3, 2, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 4, 3, 4, 0, 2
+ }, {
+ 3, 2, 4, 1, 2, 4, 3, 2, 3, 0, 2, 2, 0, 3, 2, 3,
+ 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+ }
+};
+
+const uint CloudsCutscenes::_INTRO_FRAMES_WAIT[8][32] = {
+ {
+ 2, 5, 6, 9, 10, 11, 12, 13, 14, 23, 25, 29, 31, 35, 38, 41,
+ 42, 45, 50, 52, 55, 56, 57, 0, 0, 0, 0, 0, 0, 0, 0, 0
+ }, {
+ 1, 4, 6, 8, 9, 11, 13, 15, 17, 18, 19, 22, 28, 29, 30, 31,
+ 0, 39, 0, 44, 0, 50, 51, 0, 54, 0, 0, 0, 0, 0, 0, 4
+ }, {
+ 6, 9, 11, 13, 15, 19, 21, 23, 25, 27, 28, 31, 35, 39, 40, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 5, 7
+ }, {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 3, 4
+ }, {
+ 5, 9, 10, 11, 13, 15, 18, 23, 26, 31, 33, 36, 37, 41, 43, 45,
+ 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 12
+ }, {
+ 14, 17, 20, 23, 27, 29, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 8, 11, 13
+ }, {
+ 15, 16, 17, 19, 21, 24, 24, 27, 34, 35, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 7, 10, 11, 13
+ }, {
+ 17, 19, 22, 23, 26, 30, 32, 34, 40, 43, 47, 52, 53, 55, 57, 60,
+ 62, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+ }
+};
+
+} // End of namespace WorldOfXeen
} // End of namespace Xeen
diff --git a/engines/xeen/worldofxeen/clouds_cutscenes.h b/engines/xeen/worldofxeen/clouds_cutscenes.h
index 2c2ed602ea..0f413b7666 100644
--- a/engines/xeen/worldofxeen/clouds_cutscenes.h
+++ b/engines/xeen/worldofxeen/clouds_cutscenes.h
@@ -23,17 +23,20 @@
#ifndef XEEN_WORLDOFXEEN_CLOUDS_CUTSCENES_H
#define XEEN_WORLDOFXEEN_CLOUDS_CUTSCENES_H
+#include "xeen/cutscenes.h"
#include "xeen/xeen.h"
namespace Xeen {
+namespace WorldOfXeen {
-class XeenEngine;
-
-class CloudsCutscenes {
+class CloudsCutscenes : public Cutscenes {
private:
- XeenEngine *_vm;
+ static const char *const _INTRO_VOCS[14];
+ static const int _INTRO_FRAMES_LOOKUP[14];
+ static const int _INTRO_FRAMES_VALS[8][32];
+ static const uint _INTRO_FRAMES_WAIT[8][32];
public:
- CloudsCutscenes(XeenEngine *vm) : _vm(vm) {}
+ CloudsCutscenes(XeenEngine *vm) : Cutscenes(vm) {}
/**
* Shows the Clouds of Xeen title screen
@@ -50,6 +53,8 @@ public:
*/
bool showCloudsEnding();
};
+
+} // End of namespace WorldOfXeen
} // End of namespace Xeen
#endif /* XEEN_WORLDOFXEEN_CLOUDS_CUTSCENES_H */
diff --git a/engines/xeen/worldofxeen/darkside_cutscenes.cpp b/engines/xeen/worldofxeen/darkside_cutscenes.cpp
index 514bcac901..e40fee680f 100644
--- a/engines/xeen/worldofxeen/darkside_cutscenes.cpp
+++ b/engines/xeen/worldofxeen/darkside_cutscenes.cpp
@@ -20,26 +20,36 @@
*
*/
-#include "xeen/worldofxeen/darkside_cutscenes.h"
-#include "xeen/worldofxeen/worldofxeen.h"
#include "xeen/sound.h"
#include "xeen/xeen.h"
+#include "xeen/worldofxeen/darkside_cutscenes.h"
+#include "xeen/worldofxeen/worldofxeen.h"
+#include "xeen/worldofxeen/worldofxeen_resources.h"
namespace Xeen {
+namespace WorldOfXeen {
+
+static const int CUTSCENES_XLIST[32] = {
+ 146, 145, 143, 141, 141, 141, 141, 141, 141, 141, 141, 142, 143, 144, 145, 146,
+ 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146
+};
+static const int CUTSCENES_YLIST[32] = {
+ 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143, 143,
+ 143, 143, 144, 145, 145, 145, 145, 145, 145, 145, 145, 144, 143, 143, 143, 143
+};
bool DarkSideCutscenes::showDarkSideTitle() {
EventsManager &events = *_vm->_events;
Screen &screen = *_vm->_screen;
Sound &sound = *_vm->_sound;
+ _vm->_files->_isDarkCc = true;
- // TODO: Starting method, and sound
- //sub_28F40
screen.loadPalette("dark.pal");
SpriteResource nwc[4] = {
SpriteResource("nwc1.int"), SpriteResource("nwc2.int"),
SpriteResource("nwc3.int"), SpriteResource("nwc4.int")
};
- Voc voc[3];
+ File voc[3];
voc[0].open("dragon1.voc");
voc[1].open("dragon2.voc");
voc[2].open("dragon3.voc");
@@ -53,20 +63,22 @@ bool DarkSideCutscenes::showDarkSideTitle() {
// Draw the screen and fade it in
screen.horizMerge(0);
screen.draw();
- screen.fadeIn(4);
+ screen.fadeIn();
+
+ sound.setMusicVolume(0x5f);
+ sound.playFX(1);
// Initial loop for dragon roaring
int nwcIndex = 0, nwcFrame = 0;
for (int idx = 0; idx < 55 && !_vm->shouldQuit(); ++idx) {
// Render the next frame
- events.updateGameCounter();
screen.vertMerge(0);
nwc[nwcIndex].draw(screen, nwcFrame);
screen.draw();
switch (idx) {
case 17:
- voc[0].play();
+ sound.playSound(voc[0]);
break;
case 34:
case 44:
@@ -74,63 +86,57 @@ bool DarkSideCutscenes::showDarkSideTitle() {
nwcFrame = 0;
break;
case 35:
- voc[1].play();
+ sound.playSound(voc[1]);
break;
default:
++nwcFrame;
}
- if (events.wait(2, true))
- return false;
+ WAIT(2);
}
// Loop for dragon using flyspray
for (int idx = 0; idx < 42 && !_vm->shouldQuit(); ++idx) {
- events.updateGameCounter();
screen.vertMerge(SCREEN_HEIGHT);
nwc[3].draw(screen, idx);
screen.draw();
switch (idx) {
case 3:
- sound.startMusic(40);
+ sound.playFX(40);
break;
case 11:
- sound.startMusic(0);
+ sound.playFX(0);
case 27:
case 30:
- sound.startMusic(3);
+ sound.playFX(3);
break;
case 31:
- sound.proc2(voc[2]);
+ sound.playSound(voc[2]);
break;
case 33:
- sound.startMusic(2);
+ sound.playFX(2);
break;
default:
break;
}
- if (events.wait(2, true))
- return false;
+ WAIT(2);
}
+ if (_vm->shouldQuit())
+ return false;
// Pause for a bit
- if (events.wait(10, true))
- return false;
+ WAIT(10);
- voc[0].stop();
- voc[1].stop();
- voc[2].stop();
- sound.stopMusic(95);
+ sound.setMusicVolume(95);
- screen.loadBackground("jvc.raw");
screen.fadeOut(8);
+ screen.loadBackground("jvc.raw");
screen.draw();
- screen.fadeIn(4);
-
- events.updateGameCounter();
- events.wait(60, true);
+ screen.fadeIn();
+
+ WAIT(60);
return true;
}
@@ -148,40 +154,42 @@ bool DarkSideCutscenes::showDarkSideIntro() {
160, 155, 150, 145, 140, 135, 130, 125, 120, 115, 110, 105, 98, 90, 82
};
+ _vm->_files->_isDarkCc = true;
+ _subtitles.load("special.bin");
screen.fadeOut(8);
+ screen.loadPalette("dark.pal");
screen.loadBackground("pyramid2.raw");
screen.loadPage(0);
screen.loadPage(1);
screen.loadBackground("pyramid3.raw");
screen.saveBackground(1);
- SpriteResource sprites[3] = {
- SpriteResource("title.int"), SpriteResource("pyratop.int"), SpriteResource("pyramid.int")
- };
- Voc voc[2];
- voc[0].open("pharoh1a.voc");
- voc[1].open("pharoh1b.voc");
+ SpriteResource title("title.int");
+ SpriteResource pyraTop("pyratop.int");
+ SpriteResource pyramid("pyramid.int");
screen.vertMerge(SCREEN_HEIGHT);
screen.loadPage(0);
+ screen.restoreBackground();
screen.loadPage(1);
+ // Play the intro music
+ sound.playSong("bigtheme.m");
+
// Show Might and Magic Darkside of Xeen title, and gradualy scroll
// the background vertically down to show the Pharoah's base
int yp = 0;
- int frameNum = 0;
int idx1 = 0;
bool skipElapsed = false;
uint32 timeExpired = 0;
bool fadeFlag = true;
- for (int yCtr = SCREEN_HEIGHT; yCtr > 0; ) {
- events.updateGameCounter();
+ for (int yCtr = SCREEN_HEIGHT, frameNum = 0; yCtr > 0; ) {
screen.vertMerge(yp);
- sprites[0].draw(screen, 0);
+ title.draw(screen, 0);
if (frameNum)
- sprites[0].draw(screen, frameNum);
+ title.draw(screen, frameNum);
idx1 = (idx1 + 1) % 4;
if (!idx1)
@@ -196,11 +204,10 @@ bool DarkSideCutscenes::showDarkSideIntro() {
yCtr -= timeExpired;
yp = MIN((uint)(yp + timeExpired), (uint)200);
- if (events.wait(1, true))
- return false;
+ WAIT(1);
if (fadeFlag) {
- screen.fadeIn(4);
+ screen.fadeIn();
fadeFlag = false;
}
}
@@ -210,25 +217,111 @@ bool DarkSideCutscenes::showDarkSideIntro() {
screen.draw();
screen.freePages();
- events.updateGameCounter();
- events.wait(30, true);
+ WAIT(30);
// Zoom into the Pharoah's base closeup view
for (int idx = 14; idx >= 0; --idx) {
- events.updateGameCounter();
- sprites[1].draw(screen, 0, Common::Point(XLIST1[idx], YLIST1[idx]));
- sprites[1].draw(screen, 1, Common::Point(XLIST2[idx], YLIST1[idx]));
+ pyraTop.draw(screen, 0, Common::Point(XLIST1[idx], YLIST1[idx]));
+ pyraTop.draw(screen, 1, Common::Point(XLIST2[idx], YLIST1[idx]));
screen.draw();
if (idx == 2)
- sound.stopMusic(48);
- if (events.wait(2, true))
- return false;
+ sound.setMusicVolume(48);
+ WAIT(2);
+ }
+
+ // Inconceivable, the royal pyramid besieged
+ screen.saveBackground();
+ sound.playSound("pharoh1a.voc");
+
+ recordTime();
+ resetSubtitles(0);
+ _subtitleLineNum = 0;
+
+ bool phar2 = false;
+ for (int idx = 0; idx < 19; ++idx) {
+ screen.restoreBackground();
+ pyramid.draw(screen, idx, Common::Point(132, 62));
+ showSubtitles();
+
+ if (!sound.isPlaying() && !phar2)
+ sound.playSound("pharoh1b.voc");
+
+ events.updateGameCounter();
+ while (timeElapsed() < 4) {
+ showSubtitles();
+ events.pollEventsAndWait();
+ if (events.isKeyMousePressed())
+ return false;
+ }
}
- // TODO: More
- sound.playSong(voc[0]);
- sound.playSong(voc[1]);
+ waitForLineOrSound();
+ screen.fadeOut();
+ screen.freePages();
+ title.clear();
+ pyraTop.clear();
+ pyramid.clear();
+
+ //
+ SpriteResource dragon("dragon.int");
+ const int XLIST3[10] = { 102, 103, 104, 104, 104, 103, 102, 101, 101, 101 };
+ const int YLIST3[10] = { 30, 29, 28, 27, 26, 25, 24, 25, 26, 28 };
+ const int FRAMES3[70] = {
+ 9, 9, 9, 9, 9, 8, 8, 8, 8, 9, 9, 9, 9, 9, 0,
+ 1, 2, 3, 4, 5, 6, 7, 8, 9, 9, 9, 9, 9, 8, 8,
+ 8, 8, 9, 9, 9, 9, 165, 149, 126, 106, 92, 80, 66, 55, 42,
+ 29, 10, -6, -26, -40, -56, -72, -83, 154, 141, 125, 105, 94, 83, 74,
+ 69, 68, 70, 73, 77, 83, 89, 94, 99, 109
+ };
+ const char *const PHAR2_VOC[5] = {
+ "pharoh2a.voc", "pharoh2b.voc", "pharoh2c.voc", "pharoh2d.voc", "pharoh2e.voc"
+ };
+ recordTime();
+ resetSubtitles(0);
+ _subtitleLineNum = 0;
+ _subtitleSize = 25;
+
+ screen.loadBackground("2room.raw");
+ screen.loadPage(1);
+ screen.loadBackground("3room.raw");
+ screen.loadPage(0);
+ screen.loadBackground("1room.raw");
+ screen.horizMerge(SCREEN_WIDTH);
+ dragon.draw(screen, 0, Common::Point(XLIST3[0], YLIST3[0]), SPRFLAG_800);
+
+ int posNum = 0, phar2Index = 0, ctr = 0;
+ for (int idx = SCREEN_WIDTH, frameNum = 0; idx >= 0; --idx) {
+ events.updateGameCounter();
+ screen.horizMerge(idx);
+ dragon.draw(screen, FRAMES3[frameNum], Common::Point(XLIST3[posNum], YLIST3[posNum]), SPRFLAG_800);
+ showSubtitles();
+ events.pollEventsAndWait();
+ if (events.isKeyMousePressed())
+ return false;
+
+ if (idx == SCREEN_WIDTH)
+ sound.playSound(PHAR2_VOC[0]);
+ if (!sound.isPlaying() && phar2Index < 4)
+ sound.playSound(PHAR2_VOC[1 + phar2Index++]);
+
+ if (phar2Index == 4) {
+ if (!sound.isPlaying() && !_subtitleSize)
+ break;
+ }
+
+ if (++ctr > 2) {
+ if (posNum == 5)
+ sound.playFX(7);
+ else if (posNum == 0)
+ sound.playFX(8);
+
+ posNum = (posNum + 1) % 10;
+ frameNum = (frameNum + 1) % 36;
+ }
+
+ WAIT(1);
+ }
return true;
}
@@ -237,22 +330,903 @@ bool DarkSideCutscenes::showDarkSideEnding() {
EventsManager &events = *_vm->_events;
Screen &screen = *_vm->_screen;
Sound &sound = *_vm->_sound;
+ _vm->_files->_isDarkCc = true;
- Voc voc("ido2.voc");
-// Music newBright("newbrigh.m");
- SpriteResource box("box.vga");
-
-// newBright.play();
+ sound.playSong("dngon3.m");
screen.loadBackground("scene1.raw");
screen.loadPalette("endgame.pal");
screen.update();
- screen.fadeIn(4);
+ screen.fadeIn();
+ WAIT(30);
+
+ screen.fadeOut();
+ screen.loadBackground("scene2-b.raw");
+ screen.update();
+ screen.saveBackground();
+
+ SpriteResource faceEnd("face.end");
+ screen.restoreBackground();
+ faceEnd.draw(screen, 0, Common::Point(29, 76), SPRFLAG_4000);
+ screen.update();
+
+ screen.fadeIn();
+ WAIT(1);
+
+ _subtitles.load("special.bin");
+ resetSubtitles(21, 0);
+
+ // Alamar stands up
+ for (int idx = 74; idx > 20; idx -= 2) {
+ if (idx == 60)
+ sound.songCommand(207);
+ else if (idx == 22)
+ sound.stopSong();
+
+ screen.restoreBackground();
+ faceEnd.draw(screen, 0, Common::Point(29, idx), SPRFLAG_4000);
+ screen.update();
+
+ WAIT(2);
+ }
+ faceEnd.clear();
+
+ // Alamar says "Come to me"
+ sound.playSound("come2.voc");
+ WAIT(27);
+
+ // Show the entire throne room
+ screen.loadBackground("mainback.raw");
+ SpriteResource sc03a("sc03a.end"), sc03b("sc03b.end"), sc03c("sc03c.end");
+ sc03a.draw(screen, 0, Common::Point(250, 0));
+
+ screen.saveBackground();
+ screen.update();
+ WAIT(30);
+
+ // Silhouette of door opening
+ sound.playSound("door.voc");
+ for (int idx = 0; idx < 6; ++idx) {
+ screen.restoreBackground();
+ sc03b.draw(screen, idx, Common::Point(72, 125));
+ screen.update();
+
+ WAIT(4);
+ }
+
+ // Silhouette of playing entering
+ for (int idx = 0; idx < 19; ++idx) {
+ screen.restoreBackground();
+ sc03c.draw(screen, idx, Common::Point(72, 125));
+ screen.update();
+
+ if (idx == 3 || idx == 11)
+ sound.playFX(7);
+ if (idx == 7 || idx == 16)
+ sound.playFX(8);
+
+ WAIT(4);
+ }
+
+ sc03a.clear();
+ sc03b.clear();
+ sc03c.clear();
+
+ // Box throwing
+ screen.loadBackground("scene4.raw");
+ screen.loadPage(0);
+ screen.loadBackground("scene4-1.raw");
+ screen.loadPage(1);
+ SpriteResource disk("disk.end");
+ File whoosh("whoosh.voc");
+
+ screen.horizMerge();
+ int yp = 101, tCtr = 0, frameNum = 0;
+ for (int xp = 0; xp < 320; xp += 2) {
+ screen.horizMerge(xp);
+
+ disk.draw(screen, frameNum, Common::Point(xp / 2, yp));
+ if (xp < 44)
+ disk.draw(screen, 11, Common::Point(-xp, 22), SPRFLAG_800);
+ disk.draw(screen, 10, Common::Point(0, 134));
+
+ if (!(xp % 22))
+ sound.playSound(whoosh);
+ WAIT(1);
+
+ if (++tCtr % 2)
+ frameNum = (frameNum + 1) % 10;
+
+ if (xp < 100)
+ --yp;
+ else if (xp > 150)
+ ++yp;
+ }
+
+ whoosh.close();
+ WAIT(10);
+
+ // Play landing thud
+ sound.playSound("thud.voc");
+ while (!_vm->shouldQuit() && !events.isKeyMousePressed()
+ && sound.isPlaying()) {
+ events.pollEventsAndWait();
+ }
+
+ // Fade over to box opening background
+ events.updateGameCounter();
+ screen.freePages();
+ screen.fadeOut();
+ screen.loadBackground("sc050001.raw");
+ screen.update();
+ screen.saveBackground();
+ screen.fadeIn();
events.updateGameCounter();
- // TODO
- events.wait(5000);
+ // Box opening
+ SpriteResource diskOpen[5] = {
+ SpriteResource("diska.end"), SpriteResource("diskb.end"),
+ SpriteResource("diskc.end"), SpriteResource("diskd.end"),
+ SpriteResource("diske.end")
+ };
+ File click("click.voc");
+
+ for (int idx = 0; idx < 34; ++idx) {
+ screen.restoreBackground();
+ diskOpen[idx / 8].draw(screen, idx % 8, Common::Point(28, 11));
+
+ WAIT(3);
+ if (idx == 0 || idx == 2 || idx == 4 || idx == 6)
+ sound.playSound(click);
+ else if (idx == 18)
+ sound.playSound("explosio.voc");
+ else if (idx == 9 || idx == 10 || idx == 11 || idx == 12)
+ sound.playFX(30);
+ else if (idx == 13)
+ sound.playFX(14);
+ }
+ click.close();
+ for (int idx = 0; idx < 5; ++idx)
+ diskOpen[idx].clear();
+
+ SpriteResource sc06[2] = {
+ SpriteResource("sc06a.end"), SpriteResource("sc06b.end")
+ };
+ screen.loadBackground("mainback.raw");
+ screen.saveBackground();
+ sc06[0].draw(screen, 0);
+ screen.update();
+ sound.playSound("alien2.voc");
+
+ // Zoomed out throneroom view of beam coming out of box
+ for (int idx = 0; idx < 20; ++idx) {
+ if (idx == 6 || idx == 8 || idx == 9 || idx == 10
+ || idx == 13 || idx == 15 || idx == 16)
+ sound.playFX(3);
+
+ screen.restoreBackground();
+ sc06[idx / 10].draw(screen, idx % 10);
+ screen.update();
+
+ WAIT(3);
+ }
+
+ screen.fadeOut();
+ sc06[0].clear();
+ sc06[1].clear();
+
+ // Corak appearing
+ SpriteResource sc07[8] = {
+ SpriteResource("sc07a.end"), SpriteResource("sc07b.end"),
+ SpriteResource("sc07c.end"), SpriteResource("sc07d.end"),
+ SpriteResource("sc07e.end"), SpriteResource("sc07f.end"),
+ SpriteResource("sc07g.end"), SpriteResource("sc07h.end")
+ };
+
+ screen.loadBackground("sc070001.raw");
+ screen.saveBackground();
+ screen.update();
+ screen.fadeIn();
+ WAIT(2);
+
+ resetSubtitles(22, 0);
+
+ for (int idx = 0; idx < 45; ++idx) {
+ screen.restoreBackground();
+ sc07[idx / 6].draw(screen, idx % 6, Common::Point(61, 12));
+
+ if (_subtitleSize == 0)
+ screen.update();
+ else
+ showSubtitles();
+
+ WAIT(2);
+ if (idx == 40)
+ _subtitleSize = 1;
+ else if (idx == 1 || idx == 19)
+ // Wind storm
+ sound.playSound("windstor.voc");
+ }
+
+ for (int idx = 0; idx < 8; ++idx)
+ sc07[idx].clear();
+
+ // Corak?!
+ sound.playSound("corak2.voc");
+ subtitlesWait(30);
+
+ // Yep, that's my name, don't wear it out
+ SpriteResource sc08("sc08.end");
+ resetSubtitles(23);
+ sound.playFX(0);
+
+ for (int idx = 0; idx < 15; ++idx) {
+ if (idx == 2)
+ sound.playSound("yes1.voc");
+
+ // Animate Corak speaking
+ sc08.draw(screen, sound.isPlaying() ? getSpeakingFrame(0, 2) : 0);
+ showSubtitles();
+ WAIT(3);
+ }
+
+ do {
+ sc08.draw(screen, 0);
+ showSubtitles();
+ } while (_subtitleSize);
+
+ sc08.clear();
+
+ // Nowhere to run to
+ SpriteResource sc09("sc09.end");
+
+ screen.loadBackground("sc090001.raw");
+ screen.saveBackground();
+ screen.update();
+
+ resetSubtitles(24);
+
+ for (int idx = 0; idx < 15; ++idx) {
+ if (idx == 2)
+ sound.playSound("nowre1.voc");
+
+ screen.restoreBackground();
+ sc09.draw(screen, getSpeakingFrame(0, 8));
+ showSubtitles();
+ WAIT(3);
+ }
+
+ do {
+ screen.restoreBackground();
+ showSubtitles();
+ } while (_subtitleSize);
+
+ sc09.clear();
+
+ // Nor do you!
+ SpriteResource sc10("sc10.end");
+ resetSubtitles(25);
+
+ for (int idx = 0; idx < 15; ++idx) {
+ if (idx == 3)
+ sound.playSound("nordo2.voc");
+
+ screen.restoreBackground();
+ sc10.draw(screen, getSpeakingFrame(0, 1));
+ showSubtitles();
+ WAIT(3);
+ }
+
+ do {
+ screen.restoreBackground();
+ showSubtitles();
+ } while (_subtitleSize);
+
+ sc10.clear();
+
+ // Closeup of side of Alamar's helmet
+ SpriteResource sc11("sc11.end");
+ sound.setMusicVolume(95);
+ sound.playSong("dngon2.m");
+ screen.fadeOut();
+ screen.loadBackground("blank.raw");
+ screen.saveBackground();
+
+ for (int idx = 0; idx < 15; ++idx) {
+ screen.restoreBackground();
+ sc11.draw(screen, idx, Common::Point(100, 44));
+
+ if (idx == 0)
+ screen.fadeIn();
+ WAIT(3);
+
+ if (idx == 3)
+ sound.playSound("click.voc");
+ else if (idx == 5)
+ sound.playSound("airmon.voc");
+ }
+
+ screen.fadeOut();
+
+ // Helmet raises, we see the face appear
+ for (int idx = 80; idx > 20; idx -= 2) {
+ screen.restoreBackground();
+ sc11.draw(screen, 15, Common::Point(60, 80));
+ sc11.draw(screen, 16, Common::Point(61, idx));
+ sc11.draw(screen, 17);
+ screen.update();
+
+ if (idx == 80)
+ screen.fadeIn();
+
+ WAIT(3);
+ }
+
+ // Sheltem is revealed
+ sc11.clear();
+ screen.fadeOut();
+ screen.loadBackground("scene12.raw");
+ screen.update();
+ screen.fadeIn();
+ WAIT(30);
+ screen.fadeOut();
+
+ // I'm ready for you this time
+ SpriteResource sc13("sc13.end");
+ resetSubtitles(26);
+ sound.setMusicVolume(48);
+
+ for (int idx = 0; idx < 16; ++idx) {
+ if (idx == 1)
+ sound.playSound("ready2.voc");
+
+ sc13.draw(screen, getSpeakingFrame(0, 3));
+ showSubtitles();
+
+ if (idx == 0)
+ screen.fadeIn();
+ WAIT(3);
+ }
+
+ do {
+ sc13.draw(screen, 0);
+ showSubtitles();
+ events.pollEventsAndWait();
+ } while (_subtitleSize);
+
+ sc13.clear();
+
+ // This fight will be your last
+ SpriteResource sc14("sc14.end");
+ resetSubtitles(27);
+
+ screen.fadeOut();
+ screen.loadBackground("blank.raw");
+ screen.saveBackground();
+
+ sc14.draw(screen, 0, Common::Point(37, 37));
+ screen.update();
+ screen.fadeIn();
+
+ for (int waveNum = 0; waveNum < 2; ++waveNum) {
+ for (int idx = 0; idx < 10; ++idx) {
+ if (waveNum == 0 && idx == 3)
+ sound.playSound("fight2.voc");
+
+ screen.restoreBackground();
+ sc14.draw(screen, idx, Common::Point(37, 37));
+ showSubtitles();
+ WAIT(3);
+ }
+ }
+
+ while (_subtitleSize) {
+ showSubtitles();
+ events.pollEventsAndWait();
+ showSubtitles();
+ }
+ sc14.clear();
+
+ // Fighting start
+ SpriteResource sc15("sc15.end");
+ screen.loadBackground("mainback.raw");
+ screen.saveBackground();
+ sc15.draw(screen, 0, Common::Point(52, 84));
+ screen.update();
+
+ for (int idx = 0; idx < 21; ++idx) {
+ screen.restoreBackground();
+ sc15.draw(screen, idx, Common::Point(52, 84));
+ screen.update();
+ WAIT(3);
+
+ if (idx == 4)
+ sound.playSound("disint.voc");
+ else if (idx == 12)
+ sound.playSound("explosio.voc");
+ }
+
+ sc15.clear();
+ sound.stopSound();
+
+ // I can not fail
+ SpriteResource sc16("sc16.end");
+ resetSubtitles(28);
+
+ screen.loadBackground("scene4.raw");
+ screen.loadPage(0);
+ screen.loadBackground("scene4-1.raw");
+ screen.loadPage(1);
+ screen.loadBackground("sc170001.raw");
+ screen.saveBackground();
+ screen.horizMerge(0);
+ sc16.draw(screen, 0, Common::Point(7, 29));
+ showSubtitles();
+ sound.playSound("fail1.voc");
+
+ for (int idx = 0; idx < 5; ++idx) {
+ screen.horizMerge(0);
+ sc16.draw(screen, idx, Common::Point(7, 29));
+ showSubtitles();
+ WAIT(4);
+ }
+
+ // Force sphere goes horizontally
+ int val = 5;
+ for (int idx = 0; idx < 320; idx += 16) {
+ screen.horizMerge(idx);
+ sc16.draw(screen, (val >= 12) ? 11 : val++,
+ Common::Point(idx * -1 + 7, 29));
+
+ if (val > 10)
+ sc16.draw(screen, 12, Common::Point(273, 70));
+
+ showSubtitles();
+ WAIT(2);
+
+ if (idx == 48)
+ sound.playSound("alien2.voc");
+ }
+
+ screen.freePages();
+ sc16.clear();
+
+ // Sheltem protects himself with cloak
+ SpriteResource sc17[2] = {
+ SpriteResource("sc17xa.end"), SpriteResource("sc17xb.end")
+ };
+ screen.restoreBackground();
+ screen.update();
+
+ for (int idx = 0; idx < 16; ++idx) {
+ screen.restoreBackground();
+ sc17[idx / 8].draw(screen, idx % 8, Common::Point(44, 19));
+ screen.update();
+ WAIT(3);
+
+ if (idx == 9)
+ sound.playSound("thud1.voc");
+ }
+
+ screen.fadeOut();
+ sc17[0].clear();
+ sc17[1].clear();
+
+ // Sheltem fires on Corak
+ SpriteResource sc18[4] = {
+ SpriteResource("sc18a.end"), SpriteResource("sc18b.end"),
+ SpriteResource("sc18c.end"), SpriteResource("sc18d.end")
+ };
+ screen.loadBackground("sc180001.raw");
+ screen.saveBackground();
+ screen.update();
+ screen.fadeIn();
+
+ for (int idx = 0; idx < 31; ++idx) {
+ screen.restoreBackground();
+ sc18[idx / 8].draw(screen, idx % 8, Common::Point(29, 12));
+ screen.update();
+ WAIT(3);
+
+ if (idx == 2)
+ sound.playSound("gascompr.voc");
+ }
+
+ for (int idx = 0; idx < 4; ++idx)
+ sc18[idx].clear();
+
+ // Closeup of Corak bleeding
+ SpriteResource sc19("sc19.end");
+ screen.loadBackground("sc190001.raw");
+ screen.saveBackground();
+ screen.update();
+
+ for (int idx = 0; idx < 28; ++idx) {
+ if (idx == 20)
+ sound.songCommand(207);
+
+ screen.restoreBackground();
+ sc19.draw(screen, idx, Common::Point(33, 10));
+ WAIT(3);
+ }
+
+ sc19.clear();
+ sound.stopSong();
+ screen.fadeOut();
+
+ // Corak waving his hands
+ SpriteResource sc20("sc20.end");
+ sound.setMusicVolume(95);
+ sound.playSong("sf17.m");
+ screen.loadBackground("blank.raw");
+ screen.saveBackground();
+ screen.update();
+ screen.fadeIn();
+
+ for (int waveNum = 0; waveNum < 2; ++waveNum) {
+ sound.playSound("cast.voc");
+
+ for (int idx = 0; idx < 9; ++idx) {
+ screen.restoreBackground();
+ sc20.draw(screen, idx, Common::Point(80, 18));
+ screen.update();
+ WAIT(3);
+ }
+ }
+
+ sc20.clear();
+
+ // Sheltem bounces back bolts that Corak fires
+ SpriteResource sc21("sc21.end");
+ File alien2("alien2.voc");
+ screen.loadBackground("mainback.raw");
+ screen.saveBackground();
+ sc21.draw(screen, 0, Common::Point(133, 81));
+ screen.update();
+
+ for (int boltNum = 0; boltNum < 4; ++boltNum) {
+ sound.playSound(alien2);
+
+ for (int idx = (boltNum == 0) ? 0 : 3; idx < 13; ++idx) {
+ screen.restoreBackground();
+ sc21.draw(screen, idx, Common::Point(133, 81));
+ WAIT(2);
+ }
+ }
+
+ screen.restoreBackground();
+ sc21.draw(screen, 0, Common::Point(133, 81));
+ screen.update();
+
+ sc21.clear();
+ alien2.close();
+
+ // Sheltem fires force sphere at Corak
+ SpriteResource sc22("sc22.end");
+ screen.loadBackground("scene4.raw");
+ screen.loadPage(0);
+ screen.loadBackground("scene4-1.raw");
+ screen.loadPage(1);
+ screen.loadBackground("sc230001.raw");
+ screen.saveBackground();
+ screen.horizMerge(SCREEN_WIDTH);
+
+ while (sound.isPlaying()) {
+ WAIT(1);
+ }
+
+ sc22.draw(screen, 0, Common::Point(156, 28));
+ screen.update();
+ sound.playSound("cast.voc");
+
+ for (int idx = 0; idx < 5; ++idx) {
+ screen.horizMerge(SCREEN_WIDTH);
+ sc22.draw(screen, idx, Common::Point(156, 28));
+ screen.update();
+ WAIT(3);
+ }
+
+ // The sphere travels horizontally
+ sound.playSound("gascompr.voc");
+
+ int ctr = 5;
+ for (int idx = SCREEN_WIDTH, xOffset = 0; idx >= 0; idx -= 16, xOffset += 16) {
+ screen.horizMerge(idx);
+ sc22.draw(screen, (ctr >= 8) ? 7 : ctr++,
+ Common::Point(xOffset + 156, 28), SPRFLAG_800);
+ if (ctr > 7)
+ sc22.draw(screen, 8, Common::Point(136, 64));
+ screen.update();
+
+ WAIT(2);
+ }
+
+ screen.freePages();
+ sc22.clear();
+
+ // Corak raises shield and blocks sphere
+ SpriteResource sc23[2] = {
+ SpriteResource("sc23a.end"), SpriteResource("sc23b.end")
+ };
+
+ screen.restoreBackground();
+ screen.update();
+ sound.playSound("cast.voc");
+
+ for (int idx = 0; idx < 19; ++idx) {
+ screen.restoreBackground();
+ sc23[idx / 12].draw(screen, idx % 12, Common::Point(72, 4));
+ screen.update();
+ WAIT(3);
+
+ if (idx == 5)
+ sound.playSound("padspell.voc");
+ else if (idx == 11)
+ sound.playFX(9);
+ }
+
+ screen.restoreBackground();
+ sc23[0].draw(screen, 0, Common::Point(72, 4));
+ screen.update();
+ screen.fadeOut();
+
+ sc23[0].clear();
+ sc23[1].clear();
+
+ // Corak does a ricochet shot on Sheltem
+ SpriteResource sc24[2] = {
+ SpriteResource("sc24a.end"), SpriteResource("sc24b.end")
+ };
+
+ screen.loadBackground("mainback.raw");
+ screen.saveBackground();
+ sc24[0].draw(screen, 0, Common::Point(148, 0));
+ screen.update();
+ screen.fadeIn(4);
+ sound.playSound("cast.voc");
+
+ for (int idx = 0; idx < 30; ++idx) {
+ screen.restoreBackground();
+ sc24[idx / 15].draw(screen, idx % 15, Common::Point(148, 0));
+ screen.update();
+ WAIT(3);
+
+ if (idx == 6)
+ sound.playSound("padspell.voc");
+ else if (idx == 11 || idx == 14)
+ sound.playSound("click.voc");
+ else if (idx == 17)
+ sound.playSound("thud1.voc");
+ }
+
+ sc24[0].clear();
+ sc24[1].clear();
+
+ // Admit your defeat Corak
+ // Interestingly, the original also has a sc25b.end here, which was of
+ // Corak speaking here. It seems this was ditched in favor of the
+ // following closeup of him speaking "I do"
+ SpriteResource sc25("sc25a.end");
+ resetSubtitles(29);
+
+ screen.loadBackground("sc250001.raw");
+ screen.saveBackground();
+ sc25.draw(screen, 0, Common::Point(27, 30));
+ screen.update();
+
+ for (int struggleNum = 0; struggleNum < 2; ++struggleNum) {
+ for (int idx = 0; idx < 9; ++idx) {
+ if (struggleNum == 0 && idx == 2)
+ sound.playSound("admit2.voc");
+
+ sc25.draw(screen, idx, Common::Point(27, 30));
+ showSubtitles();
+ WAIT(3);
+ }
+ }
+ subtitlesWait();
+ sc25.clear();
+
+ // I do. Kamakazi time
+ SpriteResource sc26[4] = {
+ SpriteResource("sc26a.end"), SpriteResource("sc26b.end"),
+ SpriteResource("sc26c.end"), SpriteResource("sc26d.end")
+ };
+ resetSubtitles(30);
+
+ screen.loadBackground("sc260001.raw");
+ screen.saveBackground();
+ showSubtitles();
+ sound.playSound("ido2.voc");
+
+ for (int idx = 0; sound.isPlaying() || _subtitleSize; ) {
+ screen.restoreBackground();
+ sc26[idx / 8].draw(screen, idx % 8, Common::Point(58, 25));
+ WAIT(2);
+
+ idx = (idx == 31) ? 22 : idx + 1;
+ }
+
+ screen.loadBackground("sc270001.raw");
+ screen.saveBackground();
+
+ while (sound.isPlaying() && !_vm->shouldQuit()) {
+ events.pollEventsAndWait();
+ if (events.isKeyMousePressed())
+ return false;
+ }
+
+ for (int idx = 0; idx < 4; ++idx)
+ sc26[idx].clear();
+
+ // What? No!
+ SpriteResource sc27("sc27.end");
+ resetSubtitles(31);
+ showSubtitles();
+
+ for (int idx = 0; idx < 12; ++idx) {
+ if (idx == 1)
+ sound.playSound("what3.voc");
+
+ screen.restoreBackground();
+ sc27.draw(screen, idx, Common::Point(65, 22));
+ showSubtitles();
+ WAIT(3);
+ }
+
+ subtitlesWait();
+ sc27.clear();
+
+ // Vortex is opened and the two are sucked in, obliterating them
+ SpriteResource sc28[11] = {
+ SpriteResource("sca28.end"), SpriteResource("scb28.end"),
+ SpriteResource("scc28.end"), SpriteResource("scd28.end"),
+ SpriteResource("sce28.end"), SpriteResource("scf28.end"),
+ SpriteResource("scg28.end"), SpriteResource("sch28.end"),
+ SpriteResource("sci28.end"), SpriteResource("sck28.end"),
+ SpriteResource("sck28.end")
+ };
+
+ sound.playSong("dungeon2.m");
+ screen.fadeOut();
+ screen.loadBackground("mainback.raw");
+ screen.saveBackground();
+
+ sc28[0].draw(screen, 0, Common::Point(74, 0));
+ screen.update();
+ screen.fadeIn();
+
+ for (int idx = 0; idx < 44; ++idx) {
+ screen.restoreBackground();
+ sc28[idx / 4].draw(screen, idx % 4, Common::Point(74, 0));
+ screen.update();
+ WAIT(3);
+
+ if (idx == 0 || idx == 10 || idx == 18)
+ sound.playSound("rumble.voc");
+ else if (idx == 27)
+ sound.playSound("airmon.voc");
+ else if (idx == 38)
+ sound.playSound("explosio.voc");
+ }
+
+ screen.fadeOut();
+ for (int idx = 0; idx < 11; ++idx)
+ sc28[idx].clear();
+
+ // Longshot of castle blowing up
+ SpriteResource sc29[6] = {
+ SpriteResource("sc29a.end"), SpriteResource("sc29b.end"),
+ SpriteResource("sc29c.end"), SpriteResource("sc29d.end"),
+ SpriteResource("sc29e.end"), SpriteResource("sc29f.end")
+ };
+
+ screen.loadBackground("sc290001.raw");
+ screen.saveBackground();
+ screen.fadeIn();
+
+ for (int idx = 0; idx < 54; ++idx) {
+ screen.restoreBackground();
+ if (idx == 40)
+ sound.songCommand(207);
+
+ sc29[idx / 10].draw(screen, idx % 10, Common::Point(92, 10));
+ screen.update();
+ WAIT(3);
+
+ if (idx == 1 || idx == 5 || idx == 11 || idx == 19 || idx == 34 || idx == 35)
+ sound.playSound("explosio.voc");
+ }
+
+ // Final bit of smoke from destroyed castle
+ for (int loopNum = 0; loopNum < 4; ++loopNum) {
+ for (int idx = 49; idx < 54; ++idx) {
+ screen.restoreBackground();
+ sc29[idx / 10].draw(screen, idx % 10, Common::Point(92, 10));
+ screen.update();
+ WAIT(3);
+ }
+ }
+
+ screen.fadeOut();
+ sound.stopSong();
+ for (int idx = 0; idx < 6; ++idx)
+ sc29[idx].clear();
+
+ freeSubtitles();
return true;
}
+void DarkSideCutscenes::showDarkSideScore() {
+ Common::String str = Common::String::format(Res.DARKSIDE_ENDING1, _vm->_endingScore);
+ showPharaohEndText(str.c_str(), Res.DARKSIDE_ENDING2);
+}
+
+void DarkSideCutscenes::showPharaohEndText(const char *msg1, const char *msg2, const char *msg3) {
+ const int YLIST[32] = {
+ -3, -3, -3, -3, -3, -3, -3, -3, -1, 0, 0, 0, 0, 0, 0, 0,
+ -1, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3
+ };
+ const int FRAMES[32] = {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 3, 3, 2, 1,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+ };
+ const int XLIST2[32] = {
+ 223, 222, 220, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219,
+ 219, 219, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 220, 221
+ };
+ const int YLIST2[32] = {
+ 116, 116, 116, 117, 117, 117, 117, 117, 118, 118, 118, 118, 118, 118, 118, 118,
+ 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118, 118
+ };
+ Screen &screen = *_vm->_screen;
+ EventsManager &events = *_vm->_events;
+ SpriteResource claw("claw.int");
+ SpriteResource dragon1("dragon1.int");
+ int numPages = 0 + (msg1 ? 1 : 0) + (msg2 ? 1 : 0) + (msg3 ? 1 : 0);
+ const char *const text[3] = { msg1, msg2, msg3 };
+
+ screen.loadBackground("3room.raw");
+ screen.saveBackground();
+ screen.loadPalette("dark.pal");
+ claw.draw(screen, 5, Common::Point(CUTSCENES_XLIST[0], CUTSCENES_YLIST[0]), SPRFLAG_800);
+ claw.draw(screen, 6, Common::Point(149, 184));
+ dragon1.draw(screen, FRAMES[0], Common::Point(139, YLIST[0]), SPRFLAG_800);
+ claw.draw(screen, 0, Common::Point(XLIST2[0], YLIST2[0]), SPRFLAG_800);
+ screen.update();
+ screen.fadeIn();
+ events.clearEvents();
+
+ // Iterate through showing the pages
+ int idx = 1;
+ for (int pageNum = 0; !_vm->shouldQuit() && pageNum < numPages; ++pageNum) {
+ // Show each page until a key is pressed
+ do {
+ // Draw the dragon pharoah
+ screen.restoreBackground();
+ claw.draw(screen, 5, Common::Point(CUTSCENES_XLIST[idx], CUTSCENES_YLIST[idx]), SPRFLAG_800);
+ claw.draw(screen, 6, Common::Point(145, 185));
+ dragon1.draw(screen, FRAMES[idx], Common::Point(139, YLIST[idx]), SPRFLAG_800);
+ claw.draw(screen, idx % 5, Common::Point(XLIST2[idx], YLIST2[idx]), SPRFLAG_800);
+
+ // Form the text string to display the text
+ Common::String str1 = Common::String::format(Res.PHAROAH_ENDING_TEXT1,
+ text[pageNum]);
+ screen._windows[39].writeString(str1);
+
+ Common::String str2 = Common::String::format(Res.PHAROAH_ENDING_TEXT2,
+ text[pageNum]);
+ screen._windows[39].writeString(str2);
+
+ idx = (idx + 1) % 32;
+ screen.update();
+
+ events.pollEventsAndWait();
+ } while (!_vm->shouldQuit() && !events.isKeyMousePressed());
+
+ events.clearEvents();
+ }
+}
+
+} // End of namespace WorldOfXeen
} // End of namespace Xeen
diff --git a/engines/xeen/worldofxeen/darkside_cutscenes.h b/engines/xeen/worldofxeen/darkside_cutscenes.h
index 1b78e3ea2d..30e3e8d3c9 100644
--- a/engines/xeen/worldofxeen/darkside_cutscenes.h
+++ b/engines/xeen/worldofxeen/darkside_cutscenes.h
@@ -23,15 +23,22 @@
#ifndef XEEN_WORLDOFXEEN_DARKSIDE_CUTSCENES_H
#define XEEN_WORLDOFXEEN_DARKSIDE_CUTSCENES_H
+#include "xeen/cutscenes.h"
+
namespace Xeen {
class XeenEngine;
-class DarkSideCutscenes {
-private:
- XeenEngine *_vm;
+namespace WorldOfXeen {
+
+class DarkSideCutscenes : public Cutscenes {
+protected:
+ /**
+ * Shows the Pharaoh ending screen where score text is shown
+ */
+ void showPharaohEndText(const char *msg1, const char *msg2 = nullptr, const char *msg3 = nullptr);
public:
- DarkSideCutscenes(XeenEngine *vm) : _vm(vm) {}
+ DarkSideCutscenes(XeenEngine *vm) : Cutscenes(vm) {}
/**
* Shows the Dark Side of Xeen title screen
@@ -47,8 +54,14 @@ public:
* Shows the Dark Side of Xeen ending sequence
*/
bool showDarkSideEnding();
+
+ /**
+ * Show the ending score
+ */
+ void showDarkSideScore();
};
+} // End of namespace WorldOfXeen
} // End of namespace Xeen
#endif /* XEEN_WORLDOFXEEN_DARKSIDE_CUTSCENES_H */
diff --git a/engines/xeen/worldofxeen/worldofxeen.cpp b/engines/xeen/worldofxeen/worldofxeen.cpp
index 86a6ee3da7..0ad76ce09b 100644
--- a/engines/xeen/worldofxeen/worldofxeen.cpp
+++ b/engines/xeen/worldofxeen/worldofxeen.cpp
@@ -26,6 +26,7 @@
#include "xeen/sound.h"
namespace Xeen {
+namespace WorldOfXeen {
WorldOfXeenEngine::WorldOfXeenEngine(OSystem *syst, const XeenGameDescription *gameDesc)
: XeenEngine(syst, gameDesc), CloudsCutscenes(this),
@@ -34,13 +35,19 @@ WorldOfXeenEngine::WorldOfXeenEngine(OSystem *syst, const XeenGameDescription *g
}
void WorldOfXeenEngine::showIntro() {
+ File::setCurrentArchive(INTRO_ARCHIVE);
+
// **DEBUG**
if (gDebugLevel == 0)
return;
+ showCloudsEnding();
+ /*
bool completed = showDarkSideTitle();
if (!_seenDarkSideIntro && completed)
showDarkSideIntro();
+ */
}
+} // End of namespace WorldOfXeen
} // End of namespace Xeen
diff --git a/engines/xeen/worldofxeen/worldofxeen.h b/engines/xeen/worldofxeen/worldofxeen.h
index 68a83bb89d..3dceb891ee 100644
--- a/engines/xeen/worldofxeen/worldofxeen.h
+++ b/engines/xeen/worldofxeen/worldofxeen.h
@@ -28,6 +28,7 @@
#include "xeen/worldofxeen/darkside_cutscenes.h"
namespace Xeen {
+namespace WorldOfXeen {
/**
* Implements a descendant of the base Xeen engine to handle
@@ -45,6 +46,7 @@ public:
virtual ~WorldOfXeenEngine() {}
};
+} // End of namespace WorldOfXeen
} // End of namespace Xeen
#endif /* XEEN_WORLDOFXEEN_WORLDOFXEEN_H */
diff --git a/engines/xeen/worldofxeen/worldofxeen_resources.cpp b/engines/xeen/worldofxeen/worldofxeen_resources.cpp
new file mode 100644
index 0000000000..fec30158e9
--- /dev/null
+++ b/engines/xeen/worldofxeen/worldofxeen_resources.cpp
@@ -0,0 +1,62 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "xeen/worldofxeen/worldofxeen_resources.h"
+
+namespace Xeen {
+namespace WorldOfXeen {
+
+const char *const WorldOfXeenResources::CLOUDS_INTRO1 = "\xC" "00\xB" "082\x9" "040\x3"
+ "cKing Burlock\xB" "190\x9" "040Peasants\xB" "082\x9" "247"
+ "Lord Xeen\xB" "190\x9" "258Xeen's Pet\xB" "179\x9" "150Crodo";
+
+const char *const WorldOfXeenResources::DARKSIDE_ENDING1 = "\n\x3" "cCongratulations\n"
+ "\n"
+ "Your Final Score is:\n"
+ "\n"
+ "%010lu\n"
+ "\x3" "l\n"
+ "Please send this score to the Ancient's Headquarters "
+ "where you'll be added to the Hall of Legends!\n"
+ "\n"
+ "Ancient's Headquarters\n"
+ "New World Computing, Inc.\n"
+ "P.O. Box 4302\n"
+ "Hollywood, CA 90078";
+
+const char *const WorldOfXeenResources::DARKSIDE_ENDING2 = "\n"
+ "Adventurers,\n"
+ "\n"
+ "I have saved your game in Castleview.\n"
+ "\n"
+ "The World of Xeen still needs you!\n"
+ "\n"
+ "Load your game and come visit me in the Great Pyramid "
+ "for further instructions";
+
+const char *const WorldOfXeenResources::PHAROAH_ENDING_TEXT1 = "\xC" "d\xB"
+ "001\x9" "001%s\x3" "c\x9" "000\xB" "180Press a Key!\x3" "l";
+const char *const WorldOfXeenResources::PHAROAH_ENDING_TEXT2 = "\xC" "04\xB"
+ "000\x9" "000%s\x3" "c\x9" "000\xB" "180Press a Key!\x3" "l\xC" "d";
+
+} // End of namespace WorldOfXeen
+} // End of namespace Xeen
diff --git a/engines/xeen/worldofxeen/worldofxeen_resources.h b/engines/xeen/worldofxeen/worldofxeen_resources.h
new file mode 100644
index 0000000000..18a8df6f7f
--- /dev/null
+++ b/engines/xeen/worldofxeen/worldofxeen_resources.h
@@ -0,0 +1,50 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef XEEN_WORLDOFXEEN_RESOURCES_H
+#define XEEN_WORLDOFXEEN_RESOURCES_H
+
+#include "xeen/resources.h"
+
+namespace Xeen {
+namespace WorldOfXeen {
+
+#ifdef Res
+#undef Res
+#endif
+#define Res (*(WorldOfXeenResources *)g_resources)
+
+class WorldOfXeenResources : public Resources {
+public:
+ static const char *const CLOUDS_INTRO1;
+ static const char *const DARKSIDE_ENDING1;
+ static const char *const DARKSIDE_ENDING2;
+ static const char *const PHAROAH_ENDING_TEXT1;
+ static const char *const PHAROAH_ENDING_TEXT2;
+};
+
+extern Resources *g_resources;
+
+} // End of namespace WorldOfXeen
+} // End of namespace Xeen
+
+#endif /* XEEN_RESOURCES_H */
diff --git a/engines/xeen/xeen.cpp b/engines/xeen/xeen.cpp
index c67ee07b69..493ffbf129 100644
--- a/engines/xeen/xeen.cpp
+++ b/engines/xeen/xeen.cpp
@@ -34,8 +34,16 @@
namespace Xeen {
+XeenEngine *g_vm = nullptr;
+
XeenEngine::XeenEngine(OSystem *syst, const XeenGameDescription *gameDesc)
: Engine(syst), _gameDescription(gameDesc), _randomSource("Xeen") {
+ // Set up debug channels
+ DebugMan.addDebugChannel(kDebugPath, "Path", "Pathfinding debug level");
+ DebugMan.addDebugChannel(kDebugScripts, "scripts", "Game scripts");
+ DebugMan.addDebugChannel(kDebugGraphics, "graphics", "Graphics handling");
+ DebugMan.addDebugChannel(kDebugSound, "sound", "Sound processing");
+
_combat = nullptr;
_debugger = nullptr;
_events = nullptr;
@@ -54,7 +62,9 @@ XeenEngine::XeenEngine(OSystem *syst, const XeenGameDescription *gameDesc)
_quitMode = 0;
_noDirectionSense = false;
_mode = MODE_0;
+ _endingScore = 0;
_startupWindowActive = false;
+ g_vm = this;
}
XeenEngine::~XeenEngine() {
@@ -73,18 +83,13 @@ XeenEngine::~XeenEngine() {
delete _eventData;
delete _resources;
delete _files;
+ g_vm = nullptr;
}
void XeenEngine::initialize() {
- // Set up debug channels
- DebugMan.addDebugChannel(kDebugPath, "Path", "Pathfinding debug level");
- DebugMan.addDebugChannel(kDebugScripts, "scripts", "Game scripts");
- DebugMan.addDebugChannel(kDebugGraphics, "graphics", "Graphics handling");
- DebugMan.addDebugChannel(kDebugSound, "sound", "Sound and Music handling");
-
// Create sub-objects of the engine
_files = new FileManager(this);
- _resources = new Resources();
+ _resources = Resources::init(this);
_combat = new Combat(this);
_debugger = new Debugger(this);
_events = new EventsManager(this);
@@ -98,7 +103,6 @@ void XeenEngine::initialize() {
_sound = new Sound(this, _mixer);
_spells = new Spells(this);
_town = new Town(this);
- Voc::init(this);
File f("029.obj");
_eventData = f.readStream(f.size());
@@ -120,6 +124,8 @@ Common::Error XeenEngine::run() {
showIntro();
if (shouldQuit())
return Common::kNoError;
+ File::setCurrentArchive(GAME_ARCHIVE);
+ _sound->stopAllAudio();
showMainMenu();
if (shouldQuit())
@@ -299,7 +305,7 @@ void XeenEngine::play() {
_interface->startup();
if (_mode == MODE_0) {
-// _screen->fadeOut(4);
+// _screen->fadeOut();
}
_screen->_windows[0].update();
@@ -310,7 +316,7 @@ void XeenEngine::play() {
_combat->_moveMonsters = true;
if (_mode == MODE_0) {
_mode = MODE_1;
- _screen->fadeIn(4);
+ _screen->fadeIn();
}
_combat->_moveMonsters = true;
diff --git a/engines/xeen/xeen.h b/engines/xeen/xeen.h
index d0a69394e1..3c8084b2bd 100644
--- a/engines/xeen/xeen.h
+++ b/engines/xeen/xeen.h
@@ -156,6 +156,7 @@ public:
int _quitMode;
bool _noDirectionSense;
bool _startupWindowActive;
+ uint _endingScore;
public:
XeenEngine(OSystem *syst, const XeenGameDescription *gameDesc);
virtual ~XeenEngine();
@@ -208,6 +209,8 @@ public:
static Common::String printK2(uint value);
};
+extern XeenEngine *g_vm;
+
} // End of namespace Xeen
#endif /* XEEN_XEEN_H */
diff --git a/gui/editgamedialog.cpp b/gui/editgamedialog.cpp
index fbe76d228a..a4731c1595 100644
--- a/gui/editgamedialog.cpp
+++ b/gui/editgamedialog.cpp
@@ -507,7 +507,7 @@ void EditGameDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 dat
Common::FSNode dir(browser.getResult());
_savePathWidget->setLabel(dir.getPath());
#ifdef USE_LIBCURL
- MessageDialog warningMessage(_("Saves sync feature doesn't work with non-default directories. If you want your saves to sync, use default directory."));
+ MessageDialog warningMessage(_("Saved games sync feature doesn't work with non-default directories. If you want your saved games to sync, use default directory."));
warningMessage.runModal();
#endif
draw();
diff --git a/gui/options.cpp b/gui/options.cpp
index 68add45260..35c9864718 100644
--- a/gui/options.cpp
+++ b/gui/options.cpp
@@ -1308,10 +1308,10 @@ GlobalOptionsDialog::GlobalOptionsDialog(LauncherDialog *launcher)
_storageUsernameDesc = new StaticTextWidget(container, "GlobalOptions_Cloud_Container.StorageUsernameDesc", _("Username:"), _("Username used by this storage"));
_storageUsername = new StaticTextWidget(container, "GlobalOptions_Cloud_Container.StorageUsernameLabel", "<none>");
- _storageUsedSpaceDesc = new StaticTextWidget(container, "GlobalOptions_Cloud_Container.StorageUsedSpaceDesc", _("Used space:"), _("Space used by ScummVM's saves on this storage"));
+ _storageUsedSpaceDesc = new StaticTextWidget(container, "GlobalOptions_Cloud_Container.StorageUsedSpaceDesc", _("Used space:"), _("Space used by ScummVM's saved games on this storage"));
_storageUsedSpace = new StaticTextWidget(container, "GlobalOptions_Cloud_Container.StorageUsedSpaceLabel", "0 bytes");
- _storageLastSyncDesc = new StaticTextWidget(container, "GlobalOptions_Cloud_Container.StorageLastSyncDesc", _("Last sync time:"), _("When the last saves sync for this storage occured"));
+ _storageLastSyncDesc = new StaticTextWidget(container, "GlobalOptions_Cloud_Container.StorageLastSyncDesc", _("Last sync time:"), _("When the last saved games sync for this storage occured"));
_storageLastSync = new StaticTextWidget(container, "GlobalOptions_Cloud_Container.StorageLastSyncLabel", "<never>");
_storageConnectButton = new ButtonWidget(container, "GlobalOptions_Cloud_Container.ConnectButton", _("Connect"), _("Open wizard dialog to connect your cloud storage account"), kConfigureStorageCmd);
diff --git a/gui/saveload-dialog.cpp b/gui/saveload-dialog.cpp
index ae3612f778..4ae873229f 100644
--- a/gui/saveload-dialog.cpp
+++ b/gui/saveload-dialog.cpp
@@ -229,7 +229,7 @@ void SaveLoadChooserDialog::handleCommand(CommandSender *sender, uint32 cmd, uin
void SaveLoadChooserDialog::runSaveSync(bool hasSavepathOverride) {
if (!CloudMan.isSyncing()) {
if (hasSavepathOverride) {
- ConnMan.showCloudDisabledIcon();
+ CloudMan.showCloudDisabledIcon();
} else {
Cloud::SavesSyncRequest *request = CloudMan.syncSaves();
if (request)
@@ -921,7 +921,7 @@ void SaveLoadChooserGrid::reflowLayout() {
// In the save mode we will always create a new save button as the first button.
if (_saveMode && curLine == 0 && curColumn == 0) {
_newSaveContainer = new ContainerWidget(this, curX, y, containerWidth, containerHeight);
- ButtonWidget *newSave = new ButtonWidget(_newSaveContainer, dstX, dstY, buttonWidth, buttonHeight, _("New Save"), _("Create a new save game"), kNewSaveCmd);
+ ButtonWidget *newSave = new ButtonWidget(_newSaveContainer, dstX, dstY, buttonWidth, buttonHeight, _("New Save"), _("Create a new saved game"), kNewSaveCmd);
// In case no more slots are free, we will disable the new save button
if (_nextFreeSaveSlot == -1) {
newSave->setEnabled(false);
diff --git a/gui/themes/translations.dat b/gui/themes/translations.dat
index 49e03a05b9..d6f280c17f 100644
--- a/gui/themes/translations.dat
+++ b/gui/themes/translations.dat
Binary files differ
diff --git a/image/codecs/indeo/vlc.cpp b/image/codecs/indeo/vlc.cpp
index 1793952bcf..e4b1f6ddd9 100644
--- a/image/codecs/indeo/vlc.cpp
+++ b/image/codecs/indeo/vlc.cpp
@@ -203,7 +203,7 @@ void VLC::freeVlc() {
}
int VLC::compareVlcSpec(const void *a, const void *b) {
- const VLCcode *sa = (VLCcode *)a, *sb = (VLCcode *)b;
+ const VLCcode *sa = (const VLCcode *)a, *sb = (const VLCcode *)b;
return (sa->code >> 1) - (sb->code >> 1);
}
diff --git a/image/png.cpp b/image/png.cpp
index 158acfa8a5..dffd512b88 100644
--- a/image/png.cpp
+++ b/image/png.cpp
@@ -38,7 +38,7 @@
namespace Image {
-PNGDecoder::PNGDecoder() : _outputSurface(0), _palette(0), _paletteColorCount(0), _stream(0) {
+PNGDecoder::PNGDecoder() : _outputSurface(0), _palette(0), _paletteColorCount(0) {
}
PNGDecoder::~PNGDecoder() {
@@ -86,15 +86,11 @@ bool PNGDecoder::loadStream(Common::SeekableReadStream &stream) {
#ifdef USE_PNG
destroy();
- _stream = &stream;
-
// First, check the PNG signature
- if (_stream->readUint32BE() != MKTAG(0x89, 'P', 'N', 'G')) {
- delete _stream;
+ if (stream.readUint32BE() != MKTAG(0x89, 'P', 'N', 'G')) {
return false;
}
- if (_stream->readUint32BE() != MKTAG(0x0d, 0x0a, 0x1a, 0x0a)) {
- delete _stream;
+ if (stream.readUint32BE() != MKTAG(0x0d, 0x0a, 0x1a, 0x0a)) {
return false;
}
@@ -104,26 +100,23 @@ bool PNGDecoder::loadStream(Common::SeekableReadStream &stream) {
// along with the png-loading code used in the sword25-engine.
png_structp pngPtr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
if (!pngPtr) {
- delete _stream;
return false;
}
png_infop infoPtr = png_create_info_struct(pngPtr);
if (!infoPtr) {
png_destroy_read_struct(&pngPtr, NULL, NULL);
- delete _stream;
return false;
}
png_infop endInfo = png_create_info_struct(pngPtr);
if (!endInfo) {
png_destroy_read_struct(&pngPtr, &infoPtr, NULL);
- delete _stream;
return false;
}
png_set_error_fn(pngPtr, NULL, pngError, pngWarning);
// TODO: The manual says errors should be handled via setjmp
- png_set_read_fn(pngPtr, _stream, pngReadFromStream);
+ png_set_read_fn(pngPtr, &stream, pngReadFromStream);
png_set_crc_action(pngPtr, PNG_CRC_DEFAULT, PNG_CRC_WARN_USE);
// We already verified the PNG-header
png_set_sig_bytes(pngPtr, 8);
@@ -233,9 +226,6 @@ bool PNGDecoder::loadStream(Common::SeekableReadStream &stream) {
// Destroy libpng structures
png_destroy_read_struct(&pngPtr, &infoPtr, &endInfo);
- // We no longer need the file stream, thus close it here
- _stream = 0;
-
return true;
#else
return false;
diff --git a/image/png.h b/image/png.h
index c4532fd03b..b7ac91a3d2 100644
--- a/image/png.h
+++ b/image/png.h
@@ -56,7 +56,6 @@ public:
const byte *getPalette() const { return _palette; }
uint16 getPaletteColorCount() const { return _paletteColorCount; }
private:
- Common::SeekableReadStream *_stream;
byte *_palette;
uint16 _paletteColorCount;
diff --git a/po/be_BY.po b/po/be_BY.po
index a3651defb1..b1350a99be 100644
--- a/po/be_BY.po
+++ b/po/be_BY.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.8.0git\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n"
-"POT-Creation-Date: 2016-09-05 10:12+0200\n"
+"POT-Creation-Date: 2016-09-18 15:13+0100\n"
"PO-Revision-Date: 2016-05-22 17:05+0300\n"
"Last-Translator: Ivan Lukyanov <greencis@mail.ru>\n"
"Language-Team: Ivan Lukyanov <greencis@mail.ru>\n"
@@ -61,7 +61,7 @@ msgstr "Уверх"
#: gui/recorderdialog.cpp:155 gui/remotebrowser.cpp:59
#: gui/saveload-dialog.cpp:383 gui/saveload-dialog.cpp:443
#: gui/saveload-dialog.cpp:717 gui/saveload-dialog.cpp:1111
-#: gui/storagewizarddialog.cpp:69 gui/themebrowser.cpp:55
+#: gui/storagewizarddialog.cpp:68 gui/themebrowser.cpp:55
#: gui/updates-dialog.cpp:113 engines/engine.cpp:549
#: backends/events/default/default-events.cpp:196
#: backends/events/default/default-events.cpp:218
@@ -116,7 +116,7 @@ msgstr ""
#: gui/downloaddialog.cpp:118 gui/downloaddialog.cpp:152
#: gui/filebrowser-dialog.cpp:132 gui/fluidsynth-dialog.cpp:217
#: gui/launcher.cpp:286 gui/launcher.cpp:394 gui/launcher.cpp:453
-#: gui/storagewizarddialog.cpp:113
+#: gui/storagewizarddialog.cpp:112
#: backends/events/symbiansdl/symbiansdl-events.cpp:186
#: backends/platform/wince/CEActionsPocket.cpp:326
#: backends/platform/wince/CEActionsSmartphone.cpp:287
@@ -128,7 +128,7 @@ msgstr "Так"
#: gui/downloaddialog.cpp:118 gui/downloaddialog.cpp:153
#: gui/filebrowser-dialog.cpp:132 gui/fluidsynth-dialog.cpp:217
#: gui/launcher.cpp:286 gui/launcher.cpp:394 gui/launcher.cpp:453
-#: gui/storagewizarddialog.cpp:113
+#: gui/storagewizarddialog.cpp:112
#: backends/events/symbiansdl/symbiansdl-events.cpp:186
#: backends/platform/wince/CEActionsPocket.cpp:326
#: backends/platform/wince/CEActionsSmartphone.cpp:287
@@ -408,8 +408,8 @@ msgstr "Абярыце дырэкторыю для захаванняў"
#: gui/editgamedialog.cpp:510
msgid ""
-"Saves sync feature doesn't work with non-default directories. If you want "
-"your saves to sync, use default directory."
+"Saved games sync feature doesn't work with non-default directories. If you "
+"want your saved games to sync, use default directory."
msgstr ""
#: gui/editgamedialog.cpp:536
@@ -843,7 +843,7 @@ msgid "Special dithering modes supported by some games"
msgstr "Спецыяльныя рэжымы рэндэрынгу, падтрымоўваныя некаторымі гульнямі"
#: gui/options.cpp:789
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2458
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2388
msgid "Fullscreen mode"
msgstr "Поўнаэкранны рэжым"
@@ -1177,7 +1177,7 @@ msgid "Used space:"
msgstr ""
#: gui/options.cpp:1311
-msgid "Space used by ScummVM's saves on this storage"
+msgid "Space used by ScummVM's saved games on this storage"
msgstr ""
#: gui/options.cpp:1314
@@ -1185,10 +1185,10 @@ msgid "Last sync time:"
msgstr ""
#: gui/options.cpp:1314
-msgid "When the last saves sync for this storage occured"
+msgid "When the last saved games sync for this storage occured"
msgstr ""
-#: gui/options.cpp:1317 gui/storagewizarddialog.cpp:72
+#: gui/options.cpp:1317 gui/storagewizarddialog.cpp:71
msgid "Connect"
msgstr ""
@@ -1453,7 +1453,7 @@ msgid "New Save"
msgstr "Новае захаванне"
#: gui/saveload-dialog.cpp:924
-msgid "Create a new save game"
+msgid "Create a new saved game"
msgstr "Стварыць новы запіс гульні"
#: gui/saveload-dialog.cpp:1053
@@ -1465,72 +1465,72 @@ msgstr "Назва: "
msgid "Enter a description for slot %d:"
msgstr "Увядзіце апісанне слота %d:"
-#: gui/storagewizarddialog.cpp:56
+#: gui/storagewizarddialog.cpp:55
#, c-format
msgid "%s Storage Connection Wizard"
msgstr ""
-#: gui/storagewizarddialog.cpp:59
+#: gui/storagewizarddialog.cpp:58
msgid "Navigate to the following URL:"
msgstr ""
-#: gui/storagewizarddialog.cpp:62
+#: gui/storagewizarddialog.cpp:61
msgid "Obtain the code from the storage, enter it"
msgstr ""
-#: gui/storagewizarddialog.cpp:63
+#: gui/storagewizarddialog.cpp:62
msgid "in the following field and press 'Connect':"
msgstr ""
-#: gui/storagewizarddialog.cpp:70
+#: gui/storagewizarddialog.cpp:69
#, fuzzy
msgid "Open URL"
msgstr "OpenGL"
-#: gui/storagewizarddialog.cpp:71
+#: gui/storagewizarddialog.cpp:70
msgid "Paste"
msgstr ""
-#: gui/storagewizarddialog.cpp:71
+#: gui/storagewizarddialog.cpp:70
msgid "Pastes clipboard contents into fields"
msgstr ""
-#: gui/storagewizarddialog.cpp:79
+#: gui/storagewizarddialog.cpp:78
msgid "You will be directed to ScummVM's page where"
msgstr ""
-#: gui/storagewizarddialog.cpp:80
+#: gui/storagewizarddialog.cpp:79
msgid "you should allow it to access your storage."
msgstr ""
-#: gui/storagewizarddialog.cpp:113
+#: gui/storagewizarddialog.cpp:112
msgid "Another Storage is active. Do you want to interrupt it?"
msgstr ""
-#: gui/storagewizarddialog.cpp:122
+#: gui/storagewizarddialog.cpp:121
msgid "Wait until current Storage finishes up and try again."
msgstr ""
-#: gui/storagewizarddialog.cpp:183
+#: gui/storagewizarddialog.cpp:182
#, c-format
msgid "Field %s has a mistake in it."
msgstr ""
-#: gui/storagewizarddialog.cpp:185
+#: gui/storagewizarddialog.cpp:184
#, c-format
msgid "Fields %s have mistakes in them."
msgstr ""
-#: gui/storagewizarddialog.cpp:200
+#: gui/storagewizarddialog.cpp:199
msgid "All OK!"
msgstr ""
-#: gui/storagewizarddialog.cpp:202
+#: gui/storagewizarddialog.cpp:201
#, fuzzy
msgid "Invalid code"
msgstr "Неверный путь"
-#: gui/storagewizarddialog.cpp:210
+#: gui/storagewizarddialog.cpp:209
msgid ""
"Failed to open URL!\n"
"Please navigate to this page manually."
@@ -1901,8 +1901,8 @@ msgstr ""
#: engines/engine.cpp:546
msgid ""
"WARNING: The game you are about to start is not yet fully supported by "
-"ScummVM. As such, it is likely to be unstable, and any saves you make might "
-"not work in future versions of ScummVM."
+"ScummVM. As such, it is likely to be unstable, and any saved game you make "
+"might not work in future versions of ScummVM."
msgstr ""
"ПАПЯРЭДЖАННЕ: Гульня, якую вы збіраецеся запусціць, яшчэ не падтрымліваецца "
"ScummVM цалкам. Яна, хутчэй за ўсё, не будзе працаваць стабільна, і "
@@ -2015,16 +2015,16 @@ msgstr "Эмулятар гуку C64"
#: backends/cloud/storage.cpp:210
#, fuzzy
-msgid "Saves sync complete."
+msgid "Saved games sync complete."
msgstr "Пошук скончаны!"
#: backends/cloud/storage.cpp:221
-msgid "Saves sync was cancelled."
+msgid "Saved games sync was cancelled."
msgstr ""
#: backends/cloud/storage.cpp:223
msgid ""
-"Saves sync failed.\n"
+"Saved games sync failed.\n"
"Check your Internet connection."
msgstr ""
@@ -2146,11 +2146,11 @@ msgstr "Рэжым аўтадрэгу зараз"
msgid "Swipe three fingers to the right to toggle."
msgstr "Правядзіце трыма пальцамі направа для пераключэння."
-#: backends/graphics/opengl/opengl-graphics.cpp:126
+#: backends/graphics/opengl/opengl-graphics.cpp:129
msgid "OpenGL"
msgstr "OpenGL"
-#: backends/graphics/opengl/opengl-graphics.cpp:127
+#: backends/graphics/opengl/opengl-graphics.cpp:130
msgid "OpenGL (No filtering)"
msgstr "OpenGL (без фільтраў)"
@@ -2165,19 +2165,19 @@ msgctxt "lowres"
msgid "Normal (no scaling)"
msgstr "Без павелічэння"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2357
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2289
msgid "Enabled aspect ratio correction"
msgstr "Карэкцыя суадносін бакоў уключана"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2363
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2295
msgid "Disabled aspect ratio correction"
msgstr "Карэкцыя суадносін бакоў выключана"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2418
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2349
msgid "Active graphics filter:"
msgstr "Актыўны графічны фільтр:"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2460
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2390
msgid "Windowed mode"
msgstr "Аконны рэжым"
@@ -2851,7 +2851,7 @@ msgstr "Уключыць рэжым для людзей са слабым успрыманнем колеру"
msgid ""
"ScummVM found that you have old savefiles for Drascula that should be "
"converted.\n"
-"The old save game format is no longer supported, so you will not be able to "
+"The old saved game format is no longer supported, so you will not be able to "
"load your games if you don't convert them.\n"
"\n"
"Press OK to convert them now, otherwise you will be asked again the next "
@@ -3030,11 +3030,11 @@ msgstr ""
#: engines/kyra/saveload_eob.cpp:557
#, c-format
msgid ""
-"The following original save game file has been found in your game path:\n"
+"The following original saved game file has been found in your game path:\n"
"\n"
"%s %s\n"
"\n"
-"Do you wish to use this save game file with ScummVM?\n"
+"Do you wish to use this saved game file with ScummVM?\n"
"\n"
msgstr ""
"Ніжэйзгаданы файл захавання з арыгінальнай гульні быў знойдзены ў вашай "
@@ -3048,7 +3048,7 @@ msgstr ""
#: engines/kyra/saveload_eob.cpp:590
#, c-format
msgid ""
-"A save game file was found in the specified slot %d. Overwrite?\n"
+"A saved game file was found in the specified slot %d. Overwrite?\n"
"\n"
msgstr ""
"У азначаным слоце %d ужо ёсць захаванне гульні. Перазапісаць?\n"
@@ -3057,8 +3057,8 @@ msgstr ""
#: engines/kyra/saveload_eob.cpp:623
#, c-format
msgid ""
-"%d original save game files have been successfully imported into\n"
-"ScummVM. If you want to manually import original save game files later you "
+"%d original saved game files have been successfully imported into\n"
+"ScummVM. If you want to manually import original saved game files later you "
"will\n"
"need to open the ScummVM debug console and use the command "
"'import_savefile'.\n"
@@ -4114,7 +4114,7 @@ msgstr "Застаўка '%s' не знойдзена"
msgid ""
"ScummVM found that you have old savefiles for Broken Sword 1 that should be "
"converted.\n"
-"The old save game format is no longer supported, so you will not be able to "
+"The old saved game format is no longer supported, so you will not be able to "
"load your games if you don't convert them.\n"
"\n"
"Press OK to convert them now, otherwise you will be asked again the next "
@@ -4130,8 +4130,8 @@ msgstr ""
#: engines/sword1/control.cpp:1232
#, c-format
msgid ""
-"Target new save game already exists!\n"
-"Would you like to keep the old save game (%s) or the new one (%s)?\n"
+"Target new saved game already exists!\n"
+"Would you like to keep the old saved game (%s) or the new one (%s)?\n"
msgstr ""
"Захаванне гульні з такім імем ужо існуе!\n"
"Вы жадаеце пакінуць старую назву (%s) ці зрабіць новую (%s)?\n"
diff --git a/po/ca_ES.po b/po/ca_ES.po
index 4db21a1a9c..2b8308bd7c 100644
--- a/po/ca_ES.po
+++ b/po/ca_ES.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.6.0git\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n"
-"POT-Creation-Date: 2016-09-05 10:12+0200\n"
+"POT-Creation-Date: 2016-09-18 15:13+0100\n"
"PO-Revision-Date: 2013-05-05 14:16+0100\n"
"Last-Translator: Jordi Vilalta Prat <jvprat@jvprat.com>\n"
"Language-Team: Catalan <scummvm-devel@lists.sf.net>\n"
@@ -58,7 +58,7 @@ msgstr "Amunt"
#: gui/recorderdialog.cpp:155 gui/remotebrowser.cpp:59
#: gui/saveload-dialog.cpp:383 gui/saveload-dialog.cpp:443
#: gui/saveload-dialog.cpp:717 gui/saveload-dialog.cpp:1111
-#: gui/storagewizarddialog.cpp:69 gui/themebrowser.cpp:55
+#: gui/storagewizarddialog.cpp:68 gui/themebrowser.cpp:55
#: gui/updates-dialog.cpp:113 engines/engine.cpp:549
#: backends/events/default/default-events.cpp:196
#: backends/events/default/default-events.cpp:218
@@ -113,7 +113,7 @@ msgstr ""
#: gui/downloaddialog.cpp:118 gui/downloaddialog.cpp:152
#: gui/filebrowser-dialog.cpp:132 gui/fluidsynth-dialog.cpp:217
#: gui/launcher.cpp:286 gui/launcher.cpp:394 gui/launcher.cpp:453
-#: gui/storagewizarddialog.cpp:113
+#: gui/storagewizarddialog.cpp:112
#: backends/events/symbiansdl/symbiansdl-events.cpp:186
#: backends/platform/wince/CEActionsPocket.cpp:326
#: backends/platform/wince/CEActionsSmartphone.cpp:287
@@ -125,7 +125,7 @@ msgstr "Sэ"
#: gui/downloaddialog.cpp:118 gui/downloaddialog.cpp:153
#: gui/filebrowser-dialog.cpp:132 gui/fluidsynth-dialog.cpp:217
#: gui/launcher.cpp:286 gui/launcher.cpp:394 gui/launcher.cpp:453
-#: gui/storagewizarddialog.cpp:113
+#: gui/storagewizarddialog.cpp:112
#: backends/events/symbiansdl/symbiansdl-events.cpp:186
#: backends/platform/wince/CEActionsPocket.cpp:326
#: backends/platform/wince/CEActionsSmartphone.cpp:287
@@ -405,8 +405,8 @@ msgstr "Seleccioneu el directori de les partides desades"
#: gui/editgamedialog.cpp:510
msgid ""
-"Saves sync feature doesn't work with non-default directories. If you want "
-"your saves to sync, use default directory."
+"Saved games sync feature doesn't work with non-default directories. If you "
+"want your saved games to sync, use default directory."
msgstr ""
#: gui/editgamedialog.cpp:536
@@ -851,7 +851,7 @@ msgid "Special dithering modes supported by some games"
msgstr "Modes de tramat especials suportats per alguns jocs"
#: gui/options.cpp:789
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2458
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2388
msgid "Fullscreen mode"
msgstr "Mode pantalla completa"
@@ -1183,7 +1183,7 @@ msgid "Used space:"
msgstr ""
#: gui/options.cpp:1311
-msgid "Space used by ScummVM's saves on this storage"
+msgid "Space used by ScummVM's saved games on this storage"
msgstr ""
#: gui/options.cpp:1314
@@ -1191,10 +1191,10 @@ msgid "Last sync time:"
msgstr ""
#: gui/options.cpp:1314
-msgid "When the last saves sync for this storage occured"
+msgid "When the last saved games sync for this storage occured"
msgstr ""
-#: gui/options.cpp:1317 gui/storagewizarddialog.cpp:72
+#: gui/options.cpp:1317 gui/storagewizarddialog.cpp:71
msgid "Connect"
msgstr ""
@@ -1465,7 +1465,7 @@ msgid "New Save"
msgstr "Nova partida desada"
#: gui/saveload-dialog.cpp:924
-msgid "Create a new save game"
+msgid "Create a new saved game"
msgstr "Crea una nova partida desada"
#: gui/saveload-dialog.cpp:1053
@@ -1477,71 +1477,71 @@ msgstr "Nom: "
msgid "Enter a description for slot %d:"
msgstr "Entreu la descripciѓ per l'espai %d:"
-#: gui/storagewizarddialog.cpp:56
+#: gui/storagewizarddialog.cpp:55
#, c-format
msgid "%s Storage Connection Wizard"
msgstr ""
-#: gui/storagewizarddialog.cpp:59
+#: gui/storagewizarddialog.cpp:58
msgid "Navigate to the following URL:"
msgstr ""
-#: gui/storagewizarddialog.cpp:62
+#: gui/storagewizarddialog.cpp:61
msgid "Obtain the code from the storage, enter it"
msgstr ""
-#: gui/storagewizarddialog.cpp:63
+#: gui/storagewizarddialog.cpp:62
msgid "in the following field and press 'Connect':"
msgstr ""
-#: gui/storagewizarddialog.cpp:70
+#: gui/storagewizarddialog.cpp:69
#, fuzzy
msgid "Open URL"
msgstr "Obre"
-#: gui/storagewizarddialog.cpp:71
+#: gui/storagewizarddialog.cpp:70
msgid "Paste"
msgstr ""
-#: gui/storagewizarddialog.cpp:71
+#: gui/storagewizarddialog.cpp:70
msgid "Pastes clipboard contents into fields"
msgstr ""
-#: gui/storagewizarddialog.cpp:79
+#: gui/storagewizarddialog.cpp:78
msgid "You will be directed to ScummVM's page where"
msgstr ""
-#: gui/storagewizarddialog.cpp:80
+#: gui/storagewizarddialog.cpp:79
msgid "you should allow it to access your storage."
msgstr ""
-#: gui/storagewizarddialog.cpp:113
+#: gui/storagewizarddialog.cpp:112
msgid "Another Storage is active. Do you want to interrupt it?"
msgstr ""
-#: gui/storagewizarddialog.cpp:122
+#: gui/storagewizarddialog.cpp:121
msgid "Wait until current Storage finishes up and try again."
msgstr ""
-#: gui/storagewizarddialog.cpp:183
+#: gui/storagewizarddialog.cpp:182
#, c-format
msgid "Field %s has a mistake in it."
msgstr ""
-#: gui/storagewizarddialog.cpp:185
+#: gui/storagewizarddialog.cpp:184
#, c-format
msgid "Fields %s have mistakes in them."
msgstr ""
-#: gui/storagewizarddialog.cpp:200
+#: gui/storagewizarddialog.cpp:199
msgid "All OK!"
msgstr ""
-#: gui/storagewizarddialog.cpp:202
+#: gui/storagewizarddialog.cpp:201
msgid "Invalid code"
msgstr ""
-#: gui/storagewizarddialog.cpp:210
+#: gui/storagewizarddialog.cpp:209
msgid ""
"Failed to open URL!\n"
"Please navigate to this page manually."
@@ -1909,8 +1909,8 @@ msgstr ""
#: engines/engine.cpp:546
msgid ""
"WARNING: The game you are about to start is not yet fully supported by "
-"ScummVM. As such, it is likely to be unstable, and any saves you make might "
-"not work in future versions of ScummVM."
+"ScummVM. As such, it is likely to be unstable, and any saved game you make "
+"might not work in future versions of ScummVM."
msgstr ""
"AVЭS: El joc que esteu a punt d'iniciar encara no estр completament suportat "
"pel ScummVM. Com a tal, probablement serр inestable, i pot ser que les "
@@ -2024,16 +2024,16 @@ msgstr "Emulador d'рudio C64"
#: backends/cloud/storage.cpp:210
#, fuzzy
-msgid "Saves sync complete."
+msgid "Saved games sync complete."
msgstr "S'ha acabat la cerca!"
#: backends/cloud/storage.cpp:221
-msgid "Saves sync was cancelled."
+msgid "Saved games sync was cancelled."
msgstr ""
#: backends/cloud/storage.cpp:223
msgid ""
-"Saves sync failed.\n"
+"Saved games sync failed.\n"
"Check your Internet connection."
msgstr ""
@@ -2156,12 +2156,12 @@ msgstr ""
msgid "Swipe three fingers to the right to toggle."
msgstr ""
-#: backends/graphics/opengl/opengl-graphics.cpp:126
+#: backends/graphics/opengl/opengl-graphics.cpp:129
#, fuzzy
msgid "OpenGL"
msgstr "Obre"
-#: backends/graphics/opengl/opengl-graphics.cpp:127
+#: backends/graphics/opengl/opengl-graphics.cpp:130
msgid "OpenGL (No filtering)"
msgstr ""
@@ -2176,19 +2176,19 @@ msgctxt "lowres"
msgid "Normal (no scaling)"
msgstr "Normal (no escalat)"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2357
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2289
msgid "Enabled aspect ratio correction"
msgstr "S'ha activat la correcciѓ de la relaciѓ d'aspecte"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2363
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2295
msgid "Disabled aspect ratio correction"
msgstr "S'ha desactivat la correcciѓ de la relaciѓ d'aspecte"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2418
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2349
msgid "Active graphics filter:"
msgstr "Filtre de grрfics actiu:"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2460
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2390
msgid "Windowed mode"
msgstr "Mode de finestra"
@@ -2857,7 +2857,7 @@ msgstr ""
msgid ""
"ScummVM found that you have old savefiles for Drascula that should be "
"converted.\n"
-"The old save game format is no longer supported, so you will not be able to "
+"The old saved game format is no longer supported, so you will not be able to "
"load your games if you don't convert them.\n"
"\n"
"Press OK to convert them now, otherwise you will be asked again the next "
@@ -3036,26 +3036,26 @@ msgstr ""
#: engines/kyra/saveload_eob.cpp:557
#, c-format
msgid ""
-"The following original save game file has been found in your game path:\n"
+"The following original saved game file has been found in your game path:\n"
"\n"
"%s %s\n"
"\n"
-"Do you wish to use this save game file with ScummVM?\n"
+"Do you wish to use this saved game file with ScummVM?\n"
"\n"
msgstr ""
#: engines/kyra/saveload_eob.cpp:590
#, c-format
msgid ""
-"A save game file was found in the specified slot %d. Overwrite?\n"
+"A saved game file was found in the specified slot %d. Overwrite?\n"
"\n"
msgstr ""
#: engines/kyra/saveload_eob.cpp:623
#, c-format
msgid ""
-"%d original save game files have been successfully imported into\n"
-"ScummVM. If you want to manually import original save game files later you "
+"%d original saved game files have been successfully imported into\n"
+"ScummVM. If you want to manually import original saved game files later you "
"will\n"
"need to open the ScummVM debug console and use the command "
"'import_savefile'.\n"
@@ -4115,7 +4115,7 @@ msgstr "No s'ha trobat l'escena '%s'"
msgid ""
"ScummVM found that you have old savefiles for Broken Sword 1 that should be "
"converted.\n"
-"The old save game format is no longer supported, so you will not be able to "
+"The old saved game format is no longer supported, so you will not be able to "
"load your games if you don't convert them.\n"
"\n"
"Press OK to convert them now, otherwise you will be asked again the next "
@@ -4132,8 +4132,8 @@ msgstr ""
#: engines/sword1/control.cpp:1232
#, c-format
msgid ""
-"Target new save game already exists!\n"
-"Would you like to keep the old save game (%s) or the new one (%s)?\n"
+"Target new saved game already exists!\n"
+"Would you like to keep the old saved game (%s) or the new one (%s)?\n"
msgstr ""
"La nova partida guardada d'aquest joc ja existeix!\n"
"Voleu conservar la partida guardada antiga (%s) o la nova (%s)?\n"
diff --git a/po/cs_CZ.po b/po/cs_CZ.po
index 891e35f598..403b7fe7a5 100644
--- a/po/cs_CZ.po
+++ b/po/cs_CZ.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.7.0git\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n"
-"POT-Creation-Date: 2016-09-05 10:12+0200\n"
+"POT-Creation-Date: 2016-09-18 15:13+0100\n"
"PO-Revision-Date: 2016-02-03 22:59+0100\n"
"Last-Translator: Zbynьk Schwarz <zbynek.schwarz@gmail.com>\n"
"Language-Team: \n"
@@ -62,7 +62,7 @@ msgstr "Jэt nahoru"
#: gui/recorderdialog.cpp:155 gui/remotebrowser.cpp:59
#: gui/saveload-dialog.cpp:383 gui/saveload-dialog.cpp:443
#: gui/saveload-dialog.cpp:717 gui/saveload-dialog.cpp:1111
-#: gui/storagewizarddialog.cpp:69 gui/themebrowser.cpp:55
+#: gui/storagewizarddialog.cpp:68 gui/themebrowser.cpp:55
#: gui/updates-dialog.cpp:113 engines/engine.cpp:549
#: backends/events/default/default-events.cpp:196
#: backends/events/default/default-events.cpp:218
@@ -117,7 +117,7 @@ msgstr ""
#: gui/downloaddialog.cpp:118 gui/downloaddialog.cpp:152
#: gui/filebrowser-dialog.cpp:132 gui/fluidsynth-dialog.cpp:217
#: gui/launcher.cpp:286 gui/launcher.cpp:394 gui/launcher.cpp:453
-#: gui/storagewizarddialog.cpp:113
+#: gui/storagewizarddialog.cpp:112
#: backends/events/symbiansdl/symbiansdl-events.cpp:186
#: backends/platform/wince/CEActionsPocket.cpp:326
#: backends/platform/wince/CEActionsSmartphone.cpp:287
@@ -129,7 +129,7 @@ msgstr "Ano"
#: gui/downloaddialog.cpp:118 gui/downloaddialog.cpp:153
#: gui/filebrowser-dialog.cpp:132 gui/fluidsynth-dialog.cpp:217
#: gui/launcher.cpp:286 gui/launcher.cpp:394 gui/launcher.cpp:453
-#: gui/storagewizarddialog.cpp:113
+#: gui/storagewizarddialog.cpp:112
#: backends/events/symbiansdl/symbiansdl-events.cpp:186
#: backends/platform/wince/CEActionsPocket.cpp:326
#: backends/platform/wince/CEActionsSmartphone.cpp:287
@@ -407,8 +407,8 @@ msgstr "Vyberte adresсј pro uloОenщ hry"
#: gui/editgamedialog.cpp:510
msgid ""
-"Saves sync feature doesn't work with non-default directories. If you want "
-"your saves to sync, use default directory."
+"Saved games sync feature doesn't work with non-default directories. If you "
+"want your saved games to sync, use default directory."
msgstr ""
#: gui/editgamedialog.cpp:536
@@ -844,7 +844,7 @@ msgid "Special dithering modes supported by some games"
msgstr "Speciсlnэ reОimy chvьnэ podporovanщ nьkter§mi hrami"
#: gui/options.cpp:789
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2458
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2388
msgid "Fullscreen mode"
msgstr "ReОim celщ obrazovky"
@@ -1174,7 +1174,7 @@ msgid "Used space:"
msgstr ""
#: gui/options.cpp:1311
-msgid "Space used by ScummVM's saves on this storage"
+msgid "Space used by ScummVM's saved games on this storage"
msgstr ""
#: gui/options.cpp:1314
@@ -1182,10 +1182,10 @@ msgid "Last sync time:"
msgstr ""
#: gui/options.cpp:1314
-msgid "When the last saves sync for this storage occured"
+msgid "When the last saved games sync for this storage occured"
msgstr ""
-#: gui/options.cpp:1317 gui/storagewizarddialog.cpp:72
+#: gui/options.cpp:1317 gui/storagewizarddialog.cpp:71
msgid "Connect"
msgstr ""
@@ -1450,7 +1450,7 @@ msgid "New Save"
msgstr "Novс uloОenс pozice"
#: gui/saveload-dialog.cpp:924
-msgid "Create a new save game"
+msgid "Create a new saved game"
msgstr "Vytvoјit novou uloОenou hru."
#: gui/saveload-dialog.cpp:1053
@@ -1462,72 +1462,72 @@ msgstr "Nсzev:"
msgid "Enter a description for slot %d:"
msgstr "Zadejte popis pro pozici %d:"
-#: gui/storagewizarddialog.cpp:56
+#: gui/storagewizarddialog.cpp:55
#, c-format
msgid "%s Storage Connection Wizard"
msgstr ""
-#: gui/storagewizarddialog.cpp:59
+#: gui/storagewizarddialog.cpp:58
msgid "Navigate to the following URL:"
msgstr ""
-#: gui/storagewizarddialog.cpp:62
+#: gui/storagewizarddialog.cpp:61
msgid "Obtain the code from the storage, enter it"
msgstr ""
-#: gui/storagewizarddialog.cpp:63
+#: gui/storagewizarddialog.cpp:62
msgid "in the following field and press 'Connect':"
msgstr ""
-#: gui/storagewizarddialog.cpp:70
+#: gui/storagewizarddialog.cpp:69
#, fuzzy
msgid "Open URL"
msgstr "OpenGL"
-#: gui/storagewizarddialog.cpp:71
+#: gui/storagewizarddialog.cpp:70
msgid "Paste"
msgstr ""
-#: gui/storagewizarddialog.cpp:71
+#: gui/storagewizarddialog.cpp:70
msgid "Pastes clipboard contents into fields"
msgstr ""
-#: gui/storagewizarddialog.cpp:79
+#: gui/storagewizarddialog.cpp:78
msgid "You will be directed to ScummVM's page where"
msgstr ""
-#: gui/storagewizarddialog.cpp:80
+#: gui/storagewizarddialog.cpp:79
msgid "you should allow it to access your storage."
msgstr ""
-#: gui/storagewizarddialog.cpp:113
+#: gui/storagewizarddialog.cpp:112
msgid "Another Storage is active. Do you want to interrupt it?"
msgstr ""
-#: gui/storagewizarddialog.cpp:122
+#: gui/storagewizarddialog.cpp:121
msgid "Wait until current Storage finishes up and try again."
msgstr ""
-#: gui/storagewizarddialog.cpp:183
+#: gui/storagewizarddialog.cpp:182
#, c-format
msgid "Field %s has a mistake in it."
msgstr ""
-#: gui/storagewizarddialog.cpp:185
+#: gui/storagewizarddialog.cpp:184
#, c-format
msgid "Fields %s have mistakes in them."
msgstr ""
-#: gui/storagewizarddialog.cpp:200
+#: gui/storagewizarddialog.cpp:199
msgid "All OK!"
msgstr ""
-#: gui/storagewizarddialog.cpp:202
+#: gui/storagewizarddialog.cpp:201
#, fuzzy
msgid "Invalid code"
msgstr "Neplatnс Cesta"
-#: gui/storagewizarddialog.cpp:210
+#: gui/storagewizarddialog.cpp:209
msgid ""
"Failed to open URL!\n"
"Please navigate to this page manually."
@@ -1892,8 +1892,8 @@ msgstr ""
#: engines/engine.cpp:546
msgid ""
"WARNING: The game you are about to start is not yet fully supported by "
-"ScummVM. As such, it is likely to be unstable, and any saves you make might "
-"not work in future versions of ScummVM."
+"ScummVM. As such, it is likely to be unstable, and any saved game you make "
+"might not work in future versions of ScummVM."
msgstr ""
"VAROVСNЭ: Hra, kterou se chystсte spustit, nenэ jeЙtь plnь podporovсna "
"ScummVM. Proto je moОnщ, Оe bude nestabilnэ a jakщkoli uloОenщ hry nemusэ "
@@ -2006,16 +2006,16 @@ msgstr "Emulсtor zvuku C64"
#: backends/cloud/storage.cpp:210
#, fuzzy
-msgid "Saves sync complete."
+msgid "Saved games sync complete."
msgstr "Hledсnэ dokonшeno!"
#: backends/cloud/storage.cpp:221
-msgid "Saves sync was cancelled."
+msgid "Saved games sync was cancelled."
msgstr ""
#: backends/cloud/storage.cpp:223
msgid ""
-"Saves sync failed.\n"
+"Saved games sync failed.\n"
"Check your Internet connection."
msgstr ""
@@ -2137,11 +2137,11 @@ msgstr "ReОim automatickщho taОenэ je nynэ"
msgid "Swipe three fingers to the right to toggle."
msgstr "Pro zapnutэ pјejeяte tјemi prsty doprava."
-#: backends/graphics/opengl/opengl-graphics.cpp:126
+#: backends/graphics/opengl/opengl-graphics.cpp:129
msgid "OpenGL"
msgstr "OpenGL"
-#: backends/graphics/opengl/opengl-graphics.cpp:127
+#: backends/graphics/opengl/opengl-graphics.cpp:130
msgid "OpenGL (No filtering)"
msgstr "OpenGL (bez filtrovсnэ)"
@@ -2156,19 +2156,19 @@ msgctxt "lowres"
msgid "Normal (no scaling)"
msgstr "Normсlnэ (bez zmьny velikosti)"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2357
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2289
msgid "Enabled aspect ratio correction"
msgstr "Povolena korekce pomьru stran"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2363
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2295
msgid "Disabled aspect ratio correction"
msgstr "Zakсzсna korekce pomьru stran"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2418
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2349
msgid "Active graphics filter:"
msgstr "Aktivnэ grafick§ filtr:"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2460
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2390
msgid "Windowed mode"
msgstr "ReОim do okna"
@@ -2839,7 +2839,7 @@ msgstr "Standardnь zapэnat reОim pro barvoslepщ"
msgid ""
"ScummVM found that you have old savefiles for Drascula that should be "
"converted.\n"
-"The old save game format is no longer supported, so you will not be able to "
+"The old saved game format is no longer supported, so you will not be able to "
"load your games if you don't convert them.\n"
"\n"
"Press OK to convert them now, otherwise you will be asked again the next "
@@ -3018,11 +3018,11 @@ msgstr ""
#: engines/kyra/saveload_eob.cpp:557
#, c-format
msgid ""
-"The following original save game file has been found in your game path:\n"
+"The following original saved game file has been found in your game path:\n"
"\n"
"%s %s\n"
"\n"
-"Do you wish to use this save game file with ScummVM?\n"
+"Do you wish to use this saved game file with ScummVM?\n"
"\n"
msgstr ""
"V cestь vaЙэ hry byl nalezen nсsledujэcэ soubor s uloОenou hrou:\n"
@@ -3035,7 +3035,7 @@ msgstr ""
#: engines/kyra/saveload_eob.cpp:590
#, c-format
msgid ""
-"A save game file was found in the specified slot %d. Overwrite?\n"
+"A saved game file was found in the specified slot %d. Overwrite?\n"
"\n"
msgstr ""
"V urшenщ pozici %d byl nalezen soubor s uloОenou hrou. Pјepsat?\n"
@@ -3044,8 +3044,8 @@ msgstr ""
#: engines/kyra/saveload_eob.cpp:623
#, c-format
msgid ""
-"%d original save game files have been successfully imported into\n"
-"ScummVM. If you want to manually import original save game files later you "
+"%d original saved game files have been successfully imported into\n"
+"ScummVM. If you want to manually import original saved game files later you "
"will\n"
"need to open the ScummVM debug console and use the command "
"'import_savefile'.\n"
@@ -4093,7 +4093,7 @@ msgstr "Video '%s' nenalezeno"
msgid ""
"ScummVM found that you have old savefiles for Broken Sword 1 that should be "
"converted.\n"
-"The old save game format is no longer supported, so you will not be able to "
+"The old saved game format is no longer supported, so you will not be able to "
"load your games if you don't convert them.\n"
"\n"
"Press OK to convert them now, otherwise you will be asked again the next "
@@ -4110,8 +4110,8 @@ msgstr ""
#: engines/sword1/control.cpp:1232
#, c-format
msgid ""
-"Target new save game already exists!\n"
-"Would you like to keep the old save game (%s) or the new one (%s)?\n"
+"Target new saved game already exists!\n"
+"Would you like to keep the old saved game (%s) or the new one (%s)?\n"
msgstr ""
"Novс cэlovс uloОenс hra jiО existuje!\n"
"Chtьli byste ponechat starou uloОenou hru (%s), nebo novou (%s)?\n"
diff --git a/po/da_DK.po b/po/da_DK.po
index 18489c8d71..fd5b15e9c0 100644
--- a/po/da_DK.po
+++ b/po/da_DK.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.3.0svn\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n"
-"POT-Creation-Date: 2016-09-05 10:12+0200\n"
+"POT-Creation-Date: 2016-09-18 15:13+0100\n"
"PO-Revision-Date: 2016-02-25 21:08+0100\n"
"Last-Translator: Steffen Nyeland <steffen@nyeland.dk>\n"
"Language-Team: Steffen Nyeland <steffen@nyeland.dk>\n"
@@ -60,7 +60,7 @@ msgstr "Gх op"
#: gui/recorderdialog.cpp:155 gui/remotebrowser.cpp:59
#: gui/saveload-dialog.cpp:383 gui/saveload-dialog.cpp:443
#: gui/saveload-dialog.cpp:717 gui/saveload-dialog.cpp:1111
-#: gui/storagewizarddialog.cpp:69 gui/themebrowser.cpp:55
+#: gui/storagewizarddialog.cpp:68 gui/themebrowser.cpp:55
#: gui/updates-dialog.cpp:113 engines/engine.cpp:549
#: backends/events/default/default-events.cpp:196
#: backends/events/default/default-events.cpp:218
@@ -115,7 +115,7 @@ msgstr ""
#: gui/downloaddialog.cpp:118 gui/downloaddialog.cpp:152
#: gui/filebrowser-dialog.cpp:132 gui/fluidsynth-dialog.cpp:217
#: gui/launcher.cpp:286 gui/launcher.cpp:394 gui/launcher.cpp:453
-#: gui/storagewizarddialog.cpp:113
+#: gui/storagewizarddialog.cpp:112
#: backends/events/symbiansdl/symbiansdl-events.cpp:186
#: backends/platform/wince/CEActionsPocket.cpp:326
#: backends/platform/wince/CEActionsSmartphone.cpp:287
@@ -127,7 +127,7 @@ msgstr "Ja"
#: gui/downloaddialog.cpp:118 gui/downloaddialog.cpp:153
#: gui/filebrowser-dialog.cpp:132 gui/fluidsynth-dialog.cpp:217
#: gui/launcher.cpp:286 gui/launcher.cpp:394 gui/launcher.cpp:453
-#: gui/storagewizarddialog.cpp:113
+#: gui/storagewizarddialog.cpp:112
#: backends/events/symbiansdl/symbiansdl-events.cpp:186
#: backends/platform/wince/CEActionsPocket.cpp:326
#: backends/platform/wince/CEActionsSmartphone.cpp:287
@@ -407,8 +407,8 @@ msgstr "Vцlg bibliotek til spil gemmer"
#: gui/editgamedialog.cpp:510
msgid ""
-"Saves sync feature doesn't work with non-default directories. If you want "
-"your saves to sync, use default directory."
+"Saved games sync feature doesn't work with non-default directories. If you "
+"want your saved games to sync, use default directory."
msgstr ""
#: gui/editgamedialog.cpp:536
@@ -845,7 +845,7 @@ msgid "Special dithering modes supported by some games"
msgstr "Speciel farvereduceringstilstand understјttet a nogle spil"
#: gui/options.cpp:789
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2458
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2388
msgid "Fullscreen mode"
msgstr "Fuldskцrms tilstand"
@@ -1173,7 +1173,7 @@ msgid "Used space:"
msgstr ""
#: gui/options.cpp:1311
-msgid "Space used by ScummVM's saves on this storage"
+msgid "Space used by ScummVM's saved games on this storage"
msgstr ""
#: gui/options.cpp:1314
@@ -1181,10 +1181,10 @@ msgid "Last sync time:"
msgstr ""
#: gui/options.cpp:1314
-msgid "When the last saves sync for this storage occured"
+msgid "When the last saved games sync for this storage occured"
msgstr ""
-#: gui/options.cpp:1317 gui/storagewizarddialog.cpp:72
+#: gui/options.cpp:1317 gui/storagewizarddialog.cpp:71
msgid "Connect"
msgstr ""
@@ -1449,7 +1449,7 @@ msgid "New Save"
msgstr "Ny Gemmer"
#: gui/saveload-dialog.cpp:924
-msgid "Create a new save game"
+msgid "Create a new saved game"
msgstr "Opret en ny gemmer"
#: gui/saveload-dialog.cpp:1053
@@ -1461,72 +1461,72 @@ msgstr "Navn:"
msgid "Enter a description for slot %d:"
msgstr "Indtast en beskrivelse af plads %d:"
-#: gui/storagewizarddialog.cpp:56
+#: gui/storagewizarddialog.cpp:55
#, c-format
msgid "%s Storage Connection Wizard"
msgstr ""
-#: gui/storagewizarddialog.cpp:59
+#: gui/storagewizarddialog.cpp:58
msgid "Navigate to the following URL:"
msgstr ""
-#: gui/storagewizarddialog.cpp:62
+#: gui/storagewizarddialog.cpp:61
msgid "Obtain the code from the storage, enter it"
msgstr ""
-#: gui/storagewizarddialog.cpp:63
+#: gui/storagewizarddialog.cpp:62
msgid "in the following field and press 'Connect':"
msgstr ""
-#: gui/storagewizarddialog.cpp:70
+#: gui/storagewizarddialog.cpp:69
#, fuzzy
msgid "Open URL"
msgstr "OpenGL"
-#: gui/storagewizarddialog.cpp:71
+#: gui/storagewizarddialog.cpp:70
msgid "Paste"
msgstr ""
-#: gui/storagewizarddialog.cpp:71
+#: gui/storagewizarddialog.cpp:70
msgid "Pastes clipboard contents into fields"
msgstr ""
-#: gui/storagewizarddialog.cpp:79
+#: gui/storagewizarddialog.cpp:78
msgid "You will be directed to ScummVM's page where"
msgstr ""
-#: gui/storagewizarddialog.cpp:80
+#: gui/storagewizarddialog.cpp:79
msgid "you should allow it to access your storage."
msgstr ""
-#: gui/storagewizarddialog.cpp:113
+#: gui/storagewizarddialog.cpp:112
msgid "Another Storage is active. Do you want to interrupt it?"
msgstr ""
-#: gui/storagewizarddialog.cpp:122
+#: gui/storagewizarddialog.cpp:121
msgid "Wait until current Storage finishes up and try again."
msgstr ""
-#: gui/storagewizarddialog.cpp:183
+#: gui/storagewizarddialog.cpp:182
#, c-format
msgid "Field %s has a mistake in it."
msgstr ""
-#: gui/storagewizarddialog.cpp:185
+#: gui/storagewizarddialog.cpp:184
#, c-format
msgid "Fields %s have mistakes in them."
msgstr ""
-#: gui/storagewizarddialog.cpp:200
+#: gui/storagewizarddialog.cpp:199
msgid "All OK!"
msgstr ""
-#: gui/storagewizarddialog.cpp:202
+#: gui/storagewizarddialog.cpp:201
#, fuzzy
msgid "Invalid code"
msgstr "Ugyldig sti"
-#: gui/storagewizarddialog.cpp:210
+#: gui/storagewizarddialog.cpp:209
msgid ""
"Failed to open URL!\n"
"Please navigate to this page manually."
@@ -1893,8 +1893,8 @@ msgstr ""
#: engines/engine.cpp:546
msgid ""
"WARNING: The game you are about to start is not yet fully supported by "
-"ScummVM. As such, it is likely to be unstable, and any saves you make might "
-"not work in future versions of ScummVM."
+"ScummVM. As such, it is likely to be unstable, and any saved game you make "
+"might not work in future versions of ScummVM."
msgstr ""
"ADVARSEL: Spillet du er ved at starte endnu ikke er fuldt understјttet af "
"ScummVM. Sхledes, er det sandsynligt, at det er ustabilt, og alle gemmer du "
@@ -2006,16 +2006,16 @@ msgstr "C64 lyd emulator"
#: backends/cloud/storage.cpp:210
#, fuzzy
-msgid "Saves sync complete."
+msgid "Saved games sync complete."
msgstr "Skan gennemfјrt!"
#: backends/cloud/storage.cpp:221
-msgid "Saves sync was cancelled."
+msgid "Saved games sync was cancelled."
msgstr ""
#: backends/cloud/storage.cpp:223
msgid ""
-"Saves sync failed.\n"
+"Saved games sync failed.\n"
"Check your Internet connection."
msgstr ""
@@ -2137,11 +2137,11 @@ msgstr "Auto-trцk tilstand er nu"
msgid "Swipe three fingers to the right to toggle."
msgstr "Fјr tre fingre til hјjre for at skifte."
-#: backends/graphics/opengl/opengl-graphics.cpp:126
+#: backends/graphics/opengl/opengl-graphics.cpp:129
msgid "OpenGL"
msgstr "OpenGL"
-#: backends/graphics/opengl/opengl-graphics.cpp:127
+#: backends/graphics/opengl/opengl-graphics.cpp:130
msgid "OpenGL (No filtering)"
msgstr "OpenGL (Ingen filtrering)"
@@ -2156,19 +2156,19 @@ msgctxt "lowres"
msgid "Normal (no scaling)"
msgstr "Normal (ingen skalering)"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2357
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2289
msgid "Enabled aspect ratio correction"
msgstr "Aktivщr billedformat korrektion"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2363
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2295
msgid "Disabled aspect ratio correction"
msgstr "Deaktivщr billedformat korrektion"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2418
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2349
msgid "Active graphics filter:"
msgstr "Aktive grafik filtre:"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2460
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2390
msgid "Windowed mode"
msgstr "Vindue tilstand"
@@ -2838,7 +2838,7 @@ msgstr "Aktivщr Farveblind tilstand som standard"
msgid ""
"ScummVM found that you have old savefiles for Drascula that should be "
"converted.\n"
-"The old save game format is no longer supported, so you will not be able to "
+"The old saved game format is no longer supported, so you will not be able to "
"load your games if you don't convert them.\n"
"\n"
"Press OK to convert them now, otherwise you will be asked again the next "
@@ -3017,11 +3017,11 @@ msgstr ""
#: engines/kyra/saveload_eob.cpp:557
#, c-format
msgid ""
-"The following original save game file has been found in your game path:\n"
+"The following original saved game file has been found in your game path:\n"
"\n"
"%s %s\n"
"\n"
-"Do you wish to use this save game file with ScummVM?\n"
+"Do you wish to use this saved game file with ScummVM?\n"
"\n"
msgstr ""
"Fјlgende originale savegame fil er blevet fundet i din spil sti:\n"
@@ -3034,7 +3034,7 @@ msgstr ""
#: engines/kyra/saveload_eob.cpp:590
#, c-format
msgid ""
-"A save game file was found in the specified slot %d. Overwrite?\n"
+"A saved game file was found in the specified slot %d. Overwrite?\n"
"\n"
msgstr ""
"En savegame fil blev fundet pх den angivne plads %d. Overskriv?\n"
@@ -3043,8 +3043,8 @@ msgstr ""
#: engines/kyra/saveload_eob.cpp:623
#, c-format
msgid ""
-"%d original save game files have been successfully imported into\n"
-"ScummVM. If you want to manually import original save game files later you "
+"%d original saved game files have been successfully imported into\n"
+"ScummVM. If you want to manually import original saved game files later you "
"will\n"
"need to open the ScummVM debug console and use the command "
"'import_savefile'.\n"
@@ -4100,7 +4100,7 @@ msgstr "Filmsekvens '%s' ikke fundet"
msgid ""
"ScummVM found that you have old savefiles for Broken Sword 1 that should be "
"converted.\n"
-"The old save game format is no longer supported, so you will not be able to "
+"The old saved game format is no longer supported, so you will not be able to "
"load your games if you don't convert them.\n"
"\n"
"Press OK to convert them now, otherwise you will be asked again the next "
@@ -4117,8 +4117,8 @@ msgstr ""
#: engines/sword1/control.cpp:1232
#, c-format
msgid ""
-"Target new save game already exists!\n"
-"Would you like to keep the old save game (%s) or the new one (%s)?\n"
+"Target new saved game already exists!\n"
+"Would you like to keep the old saved game (%s) or the new one (%s)?\n"
msgstr ""
"Nyt gemt spil findes allerede!\n"
"Vil du gerne beholde det gamle gemte spil (%s) eller det nye (%s)?\n"
diff --git a/po/de_DE.po b/po/de_DE.po
index 21839fa7af..6933c74d07 100644
--- a/po/de_DE.po
+++ b/po/de_DE.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.9.0git\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n"
-"POT-Creation-Date: 2016-09-05 10:12+0200\n"
+"POT-Creation-Date: 2016-09-18 15:13+0100\n"
"PO-Revision-Date: 2016-07-19 9:40:00+0200\n"
"Last-Translator: Lothar Serra Mari <rootfather@scummvm.org>\n"
"Language-Team: Simon Sawatzki <SimSaw@gmx.de>, Lothar Serra Mari "
@@ -61,7 +61,7 @@ msgstr "Pfad hoch"
#: gui/recorderdialog.cpp:155 gui/remotebrowser.cpp:59
#: gui/saveload-dialog.cpp:383 gui/saveload-dialog.cpp:443
#: gui/saveload-dialog.cpp:717 gui/saveload-dialog.cpp:1111
-#: gui/storagewizarddialog.cpp:69 gui/themebrowser.cpp:55
+#: gui/storagewizarddialog.cpp:68 gui/themebrowser.cpp:55
#: gui/updates-dialog.cpp:113 engines/engine.cpp:549
#: backends/events/default/default-events.cpp:196
#: backends/events/default/default-events.cpp:218
@@ -119,7 +119,7 @@ msgstr ""
#: gui/downloaddialog.cpp:118 gui/downloaddialog.cpp:152
#: gui/filebrowser-dialog.cpp:132 gui/fluidsynth-dialog.cpp:217
#: gui/launcher.cpp:286 gui/launcher.cpp:394 gui/launcher.cpp:453
-#: gui/storagewizarddialog.cpp:113
+#: gui/storagewizarddialog.cpp:112
#: backends/events/symbiansdl/symbiansdl-events.cpp:186
#: backends/platform/wince/CEActionsPocket.cpp:326
#: backends/platform/wince/CEActionsSmartphone.cpp:287
@@ -131,7 +131,7 @@ msgstr "Ja"
#: gui/downloaddialog.cpp:118 gui/downloaddialog.cpp:153
#: gui/filebrowser-dialog.cpp:132 gui/fluidsynth-dialog.cpp:217
#: gui/launcher.cpp:286 gui/launcher.cpp:394 gui/launcher.cpp:453
-#: gui/storagewizarddialog.cpp:113
+#: gui/storagewizarddialog.cpp:112
#: backends/events/symbiansdl/symbiansdl-events.cpp:186
#: backends/platform/wince/CEActionsPocket.cpp:326
#: backends/platform/wince/CEActionsSmartphone.cpp:287
@@ -415,8 +415,8 @@ msgstr "Verzeichnis fќr Spielstфnde auswфhlen"
#: gui/editgamedialog.cpp:510
msgid ""
-"Saves sync feature doesn't work with non-default directories. If you want "
-"your saves to sync, use default directory."
+"Saved games sync feature doesn't work with non-default directories. If you "
+"want your saved games to sync, use default directory."
msgstr ""
"Spielstand-Synchronisierung funktioniert nicht mit anderen Verzeichnissen. "
"Wenn SieIhre Spielstфnde synchronisieren mіchten, verwenden Sie das Standard-"
@@ -862,7 +862,7 @@ msgstr ""
"Spezielle Farbmischungsmethoden werden von manchen Spielen unterstќtzt."
#: gui/options.cpp:789
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2458
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2388
msgid "Fullscreen mode"
msgstr "Vollbildmodus"
@@ -1197,7 +1197,7 @@ msgid "Used space:"
msgstr "Belegter Speicher:"
#: gui/options.cpp:1311
-msgid "Space used by ScummVM's saves on this storage"
+msgid "Space used by ScummVM's saved games on this storage"
msgstr ""
"Von ScummVM-Spielstфnden beleger Speicherplatz auf diesem Cloud-Speicher"
@@ -1206,10 +1206,10 @@ msgid "Last sync time:"
msgstr "Letzte Sync.:"
#: gui/options.cpp:1314
-msgid "When the last saves sync for this storage occured"
+msgid "When the last saved games sync for this storage occured"
msgstr "Zeitpunkt der letzten Spielstand-Synchronisierung"
-#: gui/options.cpp:1317 gui/storagewizarddialog.cpp:72
+#: gui/options.cpp:1317 gui/storagewizarddialog.cpp:71
msgid "Connect"
msgstr "Verbinden"
@@ -1477,7 +1477,7 @@ msgid "New Save"
msgstr "Neuer Spielstand"
#: gui/saveload-dialog.cpp:924
-msgid "Create a new save game"
+msgid "Create a new saved game"
msgstr "Erstellt einen neuen Spielstand."
#: gui/saveload-dialog.cpp:1053
@@ -1489,73 +1489,73 @@ msgstr "Name: "
msgid "Enter a description for slot %d:"
msgstr "Geben Sie eine Beschreibung fќr Speicherplatz %d ein:"
-#: gui/storagewizarddialog.cpp:56
+#: gui/storagewizarddialog.cpp:55
#, c-format
msgid "%s Storage Connection Wizard"
msgstr "Verbindungs-Assistent fќr %s"
-#: gui/storagewizarddialog.cpp:59
+#: gui/storagewizarddialog.cpp:58
msgid "Navigate to the following URL:"
msgstr "Rufen Sie folgende URL auf:"
-#: gui/storagewizarddialog.cpp:62
+#: gui/storagewizarddialog.cpp:61
msgid "Obtain the code from the storage, enter it"
msgstr "Geben Sie den Code, den Sie von Ihrem Cloud-Speicher bekommen haben,"
-#: gui/storagewizarddialog.cpp:63
+#: gui/storagewizarddialog.cpp:62
msgid "in the following field and press 'Connect':"
msgstr ""
"geben Sie Ihn in das folgende Feld ein und klicken Sie auf 'Verbinden':"
-#: gui/storagewizarddialog.cpp:70
+#: gui/storagewizarddialog.cpp:69
msgid "Open URL"
msgstr "URL іffnen"
-#: gui/storagewizarddialog.cpp:71
+#: gui/storagewizarddialog.cpp:70
msgid "Paste"
msgstr "Einfќgen"
-#: gui/storagewizarddialog.cpp:71
+#: gui/storagewizarddialog.cpp:70
msgid "Pastes clipboard contents into fields"
msgstr "Fќgt den Inhalt der Zwischenablage in die Felder ein"
-#: gui/storagewizarddialog.cpp:79
+#: gui/storagewizarddialog.cpp:78
msgid "You will be directed to ScummVM's page where"
msgstr "Sie werden zur Webseite von ScummVM weitergeleitet,"
-#: gui/storagewizarddialog.cpp:80
+#: gui/storagewizarddialog.cpp:79
msgid "you should allow it to access your storage."
msgstr "wo Sie den Zugriff auf die Cloud erlauben sollten."
-#: gui/storagewizarddialog.cpp:113
+#: gui/storagewizarddialog.cpp:112
msgid "Another Storage is active. Do you want to interrupt it?"
msgstr ""
"Ein anderer Cloud-Speicher arbeitet gerade. Mіchten Sie ihn unterbrechen?"
-#: gui/storagewizarddialog.cpp:122
+#: gui/storagewizarddialog.cpp:121
msgid "Wait until current Storage finishes up and try again."
msgstr ""
"Warten Sie, bis der Cloud-Speicher fertig ist und versuchen Sie es erneut."
-#: gui/storagewizarddialog.cpp:183
+#: gui/storagewizarddialog.cpp:182
#, c-format
msgid "Field %s has a mistake in it."
msgstr "Fehler in Feld %s."
-#: gui/storagewizarddialog.cpp:185
+#: gui/storagewizarddialog.cpp:184
#, c-format
msgid "Fields %s have mistakes in them."
msgstr "Fehler in den Feldern %s"
-#: gui/storagewizarddialog.cpp:200
+#: gui/storagewizarddialog.cpp:199
msgid "All OK!"
msgstr "Alles OK!"
-#: gui/storagewizarddialog.cpp:202
+#: gui/storagewizarddialog.cpp:201
msgid "Invalid code"
msgstr "Code ungќltig"
-#: gui/storagewizarddialog.cpp:210
+#: gui/storagewizarddialog.cpp:209
msgid ""
"Failed to open URL!\n"
"Please navigate to this page manually."
@@ -1932,8 +1932,8 @@ msgstr ""
#: engines/engine.cpp:546
msgid ""
"WARNING: The game you are about to start is not yet fully supported by "
-"ScummVM. As such, it is likely to be unstable, and any saves you make might "
-"not work in future versions of ScummVM."
+"ScummVM. As such, it is likely to be unstable, and any saved game you make "
+"might not work in future versions of ScummVM."
msgstr ""
"WARNUNG: Das Spiel, welches Sie starten wollen, wird noch nicht vollstфndig "
"von ScummVM unterstќtzt. Somit ist es wahrscheinlich, dass es instabil ist "
@@ -2046,16 +2046,16 @@ msgid "C64 Audio Emulator"
msgstr "C64-Audio-Emulator"
#: backends/cloud/storage.cpp:210
-msgid "Saves sync complete."
+msgid "Saved games sync complete."
msgstr "Spielstфnde synchronisiert."
#: backends/cloud/storage.cpp:221
-msgid "Saves sync was cancelled."
+msgid "Saved games sync was cancelled."
msgstr "Spielstand-Synchronisierung abgebrochen"
#: backends/cloud/storage.cpp:223
msgid ""
-"Saves sync failed.\n"
+"Saved games sync failed.\n"
"Check your Internet connection."
msgstr ""
"Spielstand-Synchronisierung fehlgeschlagen.\n"
@@ -2179,11 +2179,11 @@ msgstr "Automatisches Ziehen ist jetzt "
msgid "Swipe three fingers to the right to toggle."
msgstr "Zum Umschalten mit drei Fingern nach rechts wischen."
-#: backends/graphics/opengl/opengl-graphics.cpp:126
+#: backends/graphics/opengl/opengl-graphics.cpp:129
msgid "OpenGL"
msgstr "OpenGL"
-#: backends/graphics/opengl/opengl-graphics.cpp:127
+#: backends/graphics/opengl/opengl-graphics.cpp:130
msgid "OpenGL (No filtering)"
msgstr "OpenGL (ohne Filter)"
@@ -2198,19 +2198,19 @@ msgctxt "lowres"
msgid "Normal (no scaling)"
msgstr "Normal ohn.Skalieren"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2357
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2289
msgid "Enabled aspect ratio correction"
msgstr "Seitenverhфltniskorrektur an"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2363
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2295
msgid "Disabled aspect ratio correction"
msgstr "Seitenverhфltniskorrektur aus"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2418
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2349
msgid "Active graphics filter:"
msgstr "Aktiver Grafikfilter:"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2460
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2390
msgid "Windowed mode"
msgstr "Fenstermodus"
@@ -2883,7 +2883,7 @@ msgstr "Modus fќr Farbenblinde standardmфпig einschalten"
msgid ""
"ScummVM found that you have old savefiles for Drascula that should be "
"converted.\n"
-"The old save game format is no longer supported, so you will not be able to "
+"The old saved game format is no longer supported, so you will not be able to "
"load your games if you don't convert them.\n"
"\n"
"Press OK to convert them now, otherwise you will be asked again the next "
@@ -3064,11 +3064,11 @@ msgstr ""
#: engines/kyra/saveload_eob.cpp:557
#, c-format
msgid ""
-"The following original save game file has been found in your game path:\n"
+"The following original saved game file has been found in your game path:\n"
"\n"
"%s %s\n"
"\n"
-"Do you wish to use this save game file with ScummVM?\n"
+"Do you wish to use this saved game file with ScummVM?\n"
"\n"
msgstr ""
"Die folgende originale Spielstand-Datei wurde in Ihrem Spieleverzeichnis "
@@ -3082,7 +3082,7 @@ msgstr ""
#: engines/kyra/saveload_eob.cpp:590
#, c-format
msgid ""
-"A save game file was found in the specified slot %d. Overwrite?\n"
+"A saved game file was found in the specified slot %d. Overwrite?\n"
"\n"
msgstr ""
"Eine Spielstand-Datei wurde im gewфhlten Speicherplatz %d gefunden. "
@@ -3092,8 +3092,8 @@ msgstr ""
#: engines/kyra/saveload_eob.cpp:623
#, c-format
msgid ""
-"%d original save game files have been successfully imported into\n"
-"ScummVM. If you want to manually import original save game files later you "
+"%d original saved game files have been successfully imported into\n"
+"ScummVM. If you want to manually import original saved game files later you "
"will\n"
"need to open the ScummVM debug console and use the command "
"'import_savefile'.\n"
@@ -4161,7 +4161,7 @@ msgstr "Zwischensequenz \"%s\" nicht gefunden"
msgid ""
"ScummVM found that you have old savefiles for Broken Sword 1 that should be "
"converted.\n"
-"The old save game format is no longer supported, so you will not be able to "
+"The old saved game format is no longer supported, so you will not be able to "
"load your games if you don't convert them.\n"
"\n"
"Press OK to convert them now, otherwise you will be asked again the next "
@@ -4178,8 +4178,8 @@ msgstr ""
#: engines/sword1/control.cpp:1232
#, c-format
msgid ""
-"Target new save game already exists!\n"
-"Would you like to keep the old save game (%s) or the new one (%s)?\n"
+"Target new saved game already exists!\n"
+"Would you like to keep the old saved game (%s) or the new one (%s)?\n"
msgstr ""
"Die fќr den neuen Spielstand vorgesehene Datei existiert bereits!\n"
"Mіchten Sie den alten Speicherstand (%s) oder den neuen (%s) behalten?\n"
diff --git a/po/es_ES.po b/po/es_ES.po
index a78f401bde..3959e0acff 100644
--- a/po/es_ES.po
+++ b/po/es_ES.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.4.0svn\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n"
-"POT-Creation-Date: 2016-09-05 10:12+0200\n"
+"POT-Creation-Date: 2016-09-18 15:13+0100\n"
"PO-Revision-Date: 2016-02-24 18:01+0100\n"
"Last-Translator: \n"
"Language-Team: \n"
@@ -59,7 +59,7 @@ msgstr "Arriba"
#: gui/recorderdialog.cpp:155 gui/remotebrowser.cpp:59
#: gui/saveload-dialog.cpp:383 gui/saveload-dialog.cpp:443
#: gui/saveload-dialog.cpp:717 gui/saveload-dialog.cpp:1111
-#: gui/storagewizarddialog.cpp:69 gui/themebrowser.cpp:55
+#: gui/storagewizarddialog.cpp:68 gui/themebrowser.cpp:55
#: gui/updates-dialog.cpp:113 engines/engine.cpp:549
#: backends/events/default/default-events.cpp:196
#: backends/events/default/default-events.cpp:218
@@ -114,7 +114,7 @@ msgstr ""
#: gui/downloaddialog.cpp:118 gui/downloaddialog.cpp:152
#: gui/filebrowser-dialog.cpp:132 gui/fluidsynth-dialog.cpp:217
#: gui/launcher.cpp:286 gui/launcher.cpp:394 gui/launcher.cpp:453
-#: gui/storagewizarddialog.cpp:113
+#: gui/storagewizarddialog.cpp:112
#: backends/events/symbiansdl/symbiansdl-events.cpp:186
#: backends/platform/wince/CEActionsPocket.cpp:326
#: backends/platform/wince/CEActionsSmartphone.cpp:287
@@ -126,7 +126,7 @@ msgstr "Sэ"
#: gui/downloaddialog.cpp:118 gui/downloaddialog.cpp:153
#: gui/filebrowser-dialog.cpp:132 gui/fluidsynth-dialog.cpp:217
#: gui/launcher.cpp:286 gui/launcher.cpp:394 gui/launcher.cpp:453
-#: gui/storagewizarddialog.cpp:113
+#: gui/storagewizarddialog.cpp:112
#: backends/events/symbiansdl/symbiansdl-events.cpp:186
#: backends/platform/wince/CEActionsPocket.cpp:326
#: backends/platform/wince/CEActionsSmartphone.cpp:287
@@ -406,8 +406,8 @@ msgstr "Selecciona el directorio para partidas guardadas"
#: gui/editgamedialog.cpp:510
msgid ""
-"Saves sync feature doesn't work with non-default directories. If you want "
-"your saves to sync, use default directory."
+"Saved games sync feature doesn't work with non-default directories. If you "
+"want your saved games to sync, use default directory."
msgstr ""
#: gui/editgamedialog.cpp:536
@@ -844,7 +844,7 @@ msgid "Special dithering modes supported by some games"
msgstr "Modos especiales de difuminado compatibles con algunos juegos"
#: gui/options.cpp:789
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2458
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2388
msgid "Fullscreen mode"
msgstr "Pantalla completa"
@@ -1179,7 +1179,7 @@ msgid "Used space:"
msgstr ""
#: gui/options.cpp:1311
-msgid "Space used by ScummVM's saves on this storage"
+msgid "Space used by ScummVM's saved games on this storage"
msgstr ""
#: gui/options.cpp:1314
@@ -1187,10 +1187,10 @@ msgid "Last sync time:"
msgstr ""
#: gui/options.cpp:1314
-msgid "When the last saves sync for this storage occured"
+msgid "When the last saved games sync for this storage occured"
msgstr ""
-#: gui/options.cpp:1317 gui/storagewizarddialog.cpp:72
+#: gui/options.cpp:1317 gui/storagewizarddialog.cpp:71
msgid "Connect"
msgstr ""
@@ -1456,7 +1456,7 @@ msgid "New Save"
msgstr "Guardar"
#: gui/saveload-dialog.cpp:924
-msgid "Create a new save game"
+msgid "Create a new saved game"
msgstr "Guarda una nueva partida"
#: gui/saveload-dialog.cpp:1053
@@ -1468,71 +1468,71 @@ msgstr "Nombre:"
msgid "Enter a description for slot %d:"
msgstr "Introduce una descripciѓn para la ranura %d:"
-#: gui/storagewizarddialog.cpp:56
+#: gui/storagewizarddialog.cpp:55
#, c-format
msgid "%s Storage Connection Wizard"
msgstr ""
-#: gui/storagewizarddialog.cpp:59
+#: gui/storagewizarddialog.cpp:58
msgid "Navigate to the following URL:"
msgstr ""
-#: gui/storagewizarddialog.cpp:62
+#: gui/storagewizarddialog.cpp:61
msgid "Obtain the code from the storage, enter it"
msgstr ""
-#: gui/storagewizarddialog.cpp:63
+#: gui/storagewizarddialog.cpp:62
msgid "in the following field and press 'Connect':"
msgstr ""
-#: gui/storagewizarddialog.cpp:70
+#: gui/storagewizarddialog.cpp:69
#, fuzzy
msgid "Open URL"
msgstr "OpenGL"
-#: gui/storagewizarddialog.cpp:71
+#: gui/storagewizarddialog.cpp:70
msgid "Paste"
msgstr ""
-#: gui/storagewizarddialog.cpp:71
+#: gui/storagewizarddialog.cpp:70
msgid "Pastes clipboard contents into fields"
msgstr ""
-#: gui/storagewizarddialog.cpp:79
+#: gui/storagewizarddialog.cpp:78
msgid "You will be directed to ScummVM's page where"
msgstr ""
-#: gui/storagewizarddialog.cpp:80
+#: gui/storagewizarddialog.cpp:79
msgid "you should allow it to access your storage."
msgstr ""
-#: gui/storagewizarddialog.cpp:113
+#: gui/storagewizarddialog.cpp:112
msgid "Another Storage is active. Do you want to interrupt it?"
msgstr ""
-#: gui/storagewizarddialog.cpp:122
+#: gui/storagewizarddialog.cpp:121
msgid "Wait until current Storage finishes up and try again."
msgstr ""
-#: gui/storagewizarddialog.cpp:183
+#: gui/storagewizarddialog.cpp:182
#, c-format
msgid "Field %s has a mistake in it."
msgstr ""
-#: gui/storagewizarddialog.cpp:185
+#: gui/storagewizarddialog.cpp:184
#, c-format
msgid "Fields %s have mistakes in them."
msgstr ""
-#: gui/storagewizarddialog.cpp:200
+#: gui/storagewizarddialog.cpp:199
msgid "All OK!"
msgstr ""
-#: gui/storagewizarddialog.cpp:202
+#: gui/storagewizarddialog.cpp:201
msgid "Invalid code"
msgstr ""
-#: gui/storagewizarddialog.cpp:210
+#: gui/storagewizarddialog.cpp:209
msgid ""
"Failed to open URL!\n"
"Please navigate to this page manually."
@@ -1899,8 +1899,8 @@ msgstr ""
#: engines/engine.cpp:546
msgid ""
"WARNING: The game you are about to start is not yet fully supported by "
-"ScummVM. As such, it is likely to be unstable, and any saves you make might "
-"not work in future versions of ScummVM."
+"ScummVM. As such, it is likely to be unstable, and any saved game you make "
+"might not work in future versions of ScummVM."
msgstr ""
"AVISO: El juego que vas a ejecutar aњn no es totalmente compatible con "
"ScummVM. Por lo tanto, puede que sea inestable, y que las partidas que "
@@ -2013,16 +2013,16 @@ msgstr "Emulador de C64 Audio"
#: backends/cloud/storage.cpp:210
#, fuzzy
-msgid "Saves sync complete."
+msgid "Saved games sync complete."
msgstr "ЁBњsqueda completada!"
#: backends/cloud/storage.cpp:221
-msgid "Saves sync was cancelled."
+msgid "Saved games sync was cancelled."
msgstr ""
#: backends/cloud/storage.cpp:223
msgid ""
-"Saves sync failed.\n"
+"Saved games sync failed.\n"
"Check your Internet connection."
msgstr ""
@@ -2144,11 +2144,11 @@ msgstr "El modo de arrastre automсtico estс"
msgid "Swipe three fingers to the right to toggle."
msgstr "Desliza tres dedos hacia la derecha para cambiar de modo."
-#: backends/graphics/opengl/opengl-graphics.cpp:126
+#: backends/graphics/opengl/opengl-graphics.cpp:129
msgid "OpenGL"
msgstr "OpenGL"
-#: backends/graphics/opengl/opengl-graphics.cpp:127
+#: backends/graphics/opengl/opengl-graphics.cpp:130
msgid "OpenGL (No filtering)"
msgstr "OpenGL (sin filtros)"
@@ -2163,19 +2163,19 @@ msgctxt "lowres"
msgid "Normal (no scaling)"
msgstr "Normal"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2357
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2289
msgid "Enabled aspect ratio correction"
msgstr "Activar la correcciѓn de aspecto"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2363
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2295
msgid "Disabled aspect ratio correction"
msgstr "Desactivar la correcciѓn de aspecto"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2418
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2349
msgid "Active graphics filter:"
msgstr "Filtro de grсficos activo:"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2460
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2390
msgid "Windowed mode"
msgstr "Modo ventana"
@@ -2846,7 +2846,7 @@ msgstr "Activar por defecto el modo para daltѓnicos"
msgid ""
"ScummVM found that you have old savefiles for Drascula that should be "
"converted.\n"
-"The old save game format is no longer supported, so you will not be able to "
+"The old saved game format is no longer supported, so you will not be able to "
"load your games if you don't convert them.\n"
"\n"
"Press OK to convert them now, otherwise you will be asked again the next "
@@ -3025,11 +3025,11 @@ msgstr ""
#: engines/kyra/saveload_eob.cpp:557
#, c-format
msgid ""
-"The following original save game file has been found in your game path:\n"
+"The following original saved game file has been found in your game path:\n"
"\n"
"%s %s\n"
"\n"
-"Do you wish to use this save game file with ScummVM?\n"
+"Do you wish to use this saved game file with ScummVM?\n"
"\n"
msgstr ""
"Se ha encontrado esta partida guardada en el directorio del juego:\n"
@@ -3042,7 +3042,7 @@ msgstr ""
#: engines/kyra/saveload_eob.cpp:590
#, c-format
msgid ""
-"A save game file was found in the specified slot %d. Overwrite?\n"
+"A saved game file was found in the specified slot %d. Overwrite?\n"
"\n"
msgstr ""
"Ya hay una partida guardada en la ranura %d. ПQuieres sobrescribirla?\n"
@@ -3051,8 +3051,8 @@ msgstr ""
#: engines/kyra/saveload_eob.cpp:623
#, c-format
msgid ""
-"%d original save game files have been successfully imported into\n"
-"ScummVM. If you want to manually import original save game files later you "
+"%d original saved game files have been successfully imported into\n"
+"ScummVM. If you want to manually import original saved game files later you "
"will\n"
"need to open the ScummVM debug console and use the command "
"'import_savefile'.\n"
@@ -4114,7 +4114,7 @@ msgstr "No se ha encontrado el vэdeo '%s'"
msgid ""
"ScummVM found that you have old savefiles for Broken Sword 1 that should be "
"converted.\n"
-"The old save game format is no longer supported, so you will not be able to "
+"The old saved game format is no longer supported, so you will not be able to "
"load your games if you don't convert them.\n"
"\n"
"Press OK to convert them now, otherwise you will be asked again the next "
@@ -4131,8 +4131,8 @@ msgstr ""
#: engines/sword1/control.cpp:1232
#, c-format
msgid ""
-"Target new save game already exists!\n"
-"Would you like to keep the old save game (%s) or the new one (%s)?\n"
+"Target new saved game already exists!\n"
+"Would you like to keep the old saved game (%s) or the new one (%s)?\n"
msgstr ""
"ЁLa partida guardada ya existe!\n"
"ПQuieres conservar la partida guardada antigua (%s) o la nueva (%s)?\n"
diff --git a/po/eu.po b/po/eu.po
index c4c8f0b6f1..a3052a87be 100644
--- a/po/eu.po
+++ b/po/eu.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.5.0git\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n"
-"POT-Creation-Date: 2016-09-05 10:12+0200\n"
+"POT-Creation-Date: 2016-09-18 15:13+0100\n"
"PO-Revision-Date: 2011-12-15 14:53+0100\n"
"Last-Translator: Mikel Iturbe Urretxa <mikel@hamahiru.org>\n"
"Language-Team: Librezale <librezale@librezale.org>\n"
@@ -58,7 +58,7 @@ msgstr "Joan gora"
#: gui/recorderdialog.cpp:155 gui/remotebrowser.cpp:59
#: gui/saveload-dialog.cpp:383 gui/saveload-dialog.cpp:443
#: gui/saveload-dialog.cpp:717 gui/saveload-dialog.cpp:1111
-#: gui/storagewizarddialog.cpp:69 gui/themebrowser.cpp:55
+#: gui/storagewizarddialog.cpp:68 gui/themebrowser.cpp:55
#: gui/updates-dialog.cpp:113 engines/engine.cpp:549
#: backends/events/default/default-events.cpp:196
#: backends/events/default/default-events.cpp:218
@@ -113,7 +113,7 @@ msgstr ""
#: gui/downloaddialog.cpp:118 gui/downloaddialog.cpp:152
#: gui/filebrowser-dialog.cpp:132 gui/fluidsynth-dialog.cpp:217
#: gui/launcher.cpp:286 gui/launcher.cpp:394 gui/launcher.cpp:453
-#: gui/storagewizarddialog.cpp:113
+#: gui/storagewizarddialog.cpp:112
#: backends/events/symbiansdl/symbiansdl-events.cpp:186
#: backends/platform/wince/CEActionsPocket.cpp:326
#: backends/platform/wince/CEActionsSmartphone.cpp:287
@@ -125,7 +125,7 @@ msgstr "Bai"
#: gui/downloaddialog.cpp:118 gui/downloaddialog.cpp:153
#: gui/filebrowser-dialog.cpp:132 gui/fluidsynth-dialog.cpp:217
#: gui/launcher.cpp:286 gui/launcher.cpp:394 gui/launcher.cpp:453
-#: gui/storagewizarddialog.cpp:113
+#: gui/storagewizarddialog.cpp:112
#: backends/events/symbiansdl/symbiansdl-events.cpp:186
#: backends/platform/wince/CEActionsPocket.cpp:326
#: backends/platform/wince/CEActionsSmartphone.cpp:287
@@ -404,8 +404,8 @@ msgstr "Partida gordeen direktorioa aukeratu"
#: gui/editgamedialog.cpp:510
msgid ""
-"Saves sync feature doesn't work with non-default directories. If you want "
-"your saves to sync, use default directory."
+"Saved games sync feature doesn't work with non-default directories. If you "
+"want your saved games to sync, use default directory."
msgstr ""
#: gui/editgamedialog.cpp:536
@@ -843,7 +843,7 @@ msgid "Special dithering modes supported by some games"
msgstr "Joko batzuk onarturiko lausotze-modu bereziak"
#: gui/options.cpp:789
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2458
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2388
msgid "Fullscreen mode"
msgstr "Pantaila osoa"
@@ -1176,7 +1176,7 @@ msgid "Used space:"
msgstr ""
#: gui/options.cpp:1311
-msgid "Space used by ScummVM's saves on this storage"
+msgid "Space used by ScummVM's saved games on this storage"
msgstr ""
#: gui/options.cpp:1314
@@ -1184,10 +1184,10 @@ msgid "Last sync time:"
msgstr ""
#: gui/options.cpp:1314
-msgid "When the last saves sync for this storage occured"
+msgid "When the last saved games sync for this storage occured"
msgstr ""
-#: gui/options.cpp:1317 gui/storagewizarddialog.cpp:72
+#: gui/options.cpp:1317 gui/storagewizarddialog.cpp:71
msgid "Connect"
msgstr ""
@@ -1452,7 +1452,7 @@ msgid "New Save"
msgstr "Gorde"
#: gui/saveload-dialog.cpp:924
-msgid "Create a new save game"
+msgid "Create a new saved game"
msgstr "Sortu joko gorde berria"
#: gui/saveload-dialog.cpp:1053
@@ -1464,71 +1464,71 @@ msgstr "Izena: "
msgid "Enter a description for slot %d:"
msgstr "Sartu deskribapena %d zirrikiturako: "
-#: gui/storagewizarddialog.cpp:56
+#: gui/storagewizarddialog.cpp:55
#, c-format
msgid "%s Storage Connection Wizard"
msgstr ""
-#: gui/storagewizarddialog.cpp:59
+#: gui/storagewizarddialog.cpp:58
msgid "Navigate to the following URL:"
msgstr ""
-#: gui/storagewizarddialog.cpp:62
+#: gui/storagewizarddialog.cpp:61
msgid "Obtain the code from the storage, enter it"
msgstr ""
-#: gui/storagewizarddialog.cpp:63
+#: gui/storagewizarddialog.cpp:62
msgid "in the following field and press 'Connect':"
msgstr ""
-#: gui/storagewizarddialog.cpp:70
+#: gui/storagewizarddialog.cpp:69
#, fuzzy
msgid "Open URL"
msgstr "OpenGL"
-#: gui/storagewizarddialog.cpp:71
+#: gui/storagewizarddialog.cpp:70
msgid "Paste"
msgstr ""
-#: gui/storagewizarddialog.cpp:71
+#: gui/storagewizarddialog.cpp:70
msgid "Pastes clipboard contents into fields"
msgstr ""
-#: gui/storagewizarddialog.cpp:79
+#: gui/storagewizarddialog.cpp:78
msgid "You will be directed to ScummVM's page where"
msgstr ""
-#: gui/storagewizarddialog.cpp:80
+#: gui/storagewizarddialog.cpp:79
msgid "you should allow it to access your storage."
msgstr ""
-#: gui/storagewizarddialog.cpp:113
+#: gui/storagewizarddialog.cpp:112
msgid "Another Storage is active. Do you want to interrupt it?"
msgstr ""
-#: gui/storagewizarddialog.cpp:122
+#: gui/storagewizarddialog.cpp:121
msgid "Wait until current Storage finishes up and try again."
msgstr ""
-#: gui/storagewizarddialog.cpp:183
+#: gui/storagewizarddialog.cpp:182
#, c-format
msgid "Field %s has a mistake in it."
msgstr ""
-#: gui/storagewizarddialog.cpp:185
+#: gui/storagewizarddialog.cpp:184
#, c-format
msgid "Fields %s have mistakes in them."
msgstr ""
-#: gui/storagewizarddialog.cpp:200
+#: gui/storagewizarddialog.cpp:199
msgid "All OK!"
msgstr ""
-#: gui/storagewizarddialog.cpp:202
+#: gui/storagewizarddialog.cpp:201
msgid "Invalid code"
msgstr ""
-#: gui/storagewizarddialog.cpp:210
+#: gui/storagewizarddialog.cpp:209
msgid ""
"Failed to open URL!\n"
"Please navigate to this page manually."
@@ -1892,8 +1892,8 @@ msgstr ""
#: engines/engine.cpp:546
msgid ""
"WARNING: The game you are about to start is not yet fully supported by "
-"ScummVM. As such, it is likely to be unstable, and any saves you make might "
-"not work in future versions of ScummVM."
+"ScummVM. As such, it is likely to be unstable, and any saved game you make "
+"might not work in future versions of ScummVM."
msgstr ""
"ABISUA: ScummVM-k ez du guztiz onartzen exekutatuko duzun jokoa oraindik. "
"Hori dela eta, ezegonkorra izan daiteke eta gerta daiteke gordeta izan "
@@ -2006,16 +2006,16 @@ msgstr "C64 Audio emuladorea"
#: backends/cloud/storage.cpp:210
#, fuzzy
-msgid "Saves sync complete."
+msgid "Saved games sync complete."
msgstr "Bilaketa amaitua!"
#: backends/cloud/storage.cpp:221
-msgid "Saves sync was cancelled."
+msgid "Saved games sync was cancelled."
msgstr ""
#: backends/cloud/storage.cpp:223
msgid ""
-"Saves sync failed.\n"
+"Saved games sync failed.\n"
"Check your Internet connection."
msgstr ""
@@ -2137,11 +2137,11 @@ msgstr "Auto-arrastatzea orain:"
msgid "Swipe three fingers to the right to toggle."
msgstr "Pasatu hiru atzamar eskuinean gaitu/desgaitzeko."
-#: backends/graphics/opengl/opengl-graphics.cpp:126
+#: backends/graphics/opengl/opengl-graphics.cpp:129
msgid "OpenGL"
msgstr "OpenGL"
-#: backends/graphics/opengl/opengl-graphics.cpp:127
+#: backends/graphics/opengl/opengl-graphics.cpp:130
msgid "OpenGL (No filtering)"
msgstr "OpenGL (Iragazi gabe)"
@@ -2156,19 +2156,19 @@ msgctxt "lowres"
msgid "Normal (no scaling)"
msgstr "Normala"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2357
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2289
msgid "Enabled aspect ratio correction"
msgstr "Formatu-ratio zuzenketa gaituta"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2363
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2295
msgid "Disabled aspect ratio correction"
msgstr "Formatu-ratio zuzenketa desgaituta"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2418
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2349
msgid "Active graphics filter:"
msgstr "Filtro grafiko aktiboa:"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2460
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2390
msgid "Windowed mode"
msgstr "Leiho modua"
@@ -2839,7 +2839,7 @@ msgstr "Gaitu daltonikoentzako modua lehenetsi modura"
msgid ""
"ScummVM found that you have old savefiles for Drascula that should be "
"converted.\n"
-"The old save game format is no longer supported, so you will not be able to "
+"The old saved game format is no longer supported, so you will not be able to "
"load your games if you don't convert them.\n"
"\n"
"Press OK to convert them now, otherwise you will be asked again the next "
@@ -3018,11 +3018,11 @@ msgstr ""
#: engines/kyra/saveload_eob.cpp:557
#, c-format
msgid ""
-"The following original save game file has been found in your game path:\n"
+"The following original saved game file has been found in your game path:\n"
"\n"
"%s %s\n"
"\n"
-"Do you wish to use this save game file with ScummVM?\n"
+"Do you wish to use this saved game file with ScummVM?\n"
"\n"
msgstr ""
"Hurrengo jatorrizko gordetako fitxategia aurkitu da bidean:\n"
@@ -3035,7 +3035,7 @@ msgstr ""
#: engines/kyra/saveload_eob.cpp:590
#, c-format
msgid ""
-"A save game file was found in the specified slot %d. Overwrite?\n"
+"A saved game file was found in the specified slot %d. Overwrite?\n"
"\n"
msgstr ""
"Joko gorde baten fitxategia aurkitu da zehaztutako %d zirrikituan."
@@ -3045,8 +3045,8 @@ msgstr ""
#: engines/kyra/saveload_eob.cpp:623
#, c-format
msgid ""
-"%d original save game files have been successfully imported into\n"
-"ScummVM. If you want to manually import original save game files later you "
+"%d original saved game files have been successfully imported into\n"
+"ScummVM. If you want to manually import original saved game files later you "
"will\n"
"need to open the ScummVM debug console and use the command "
"'import_savefile'.\n"
@@ -4103,7 +4103,7 @@ msgstr "Ez da '%s' bideoa aurkitu"
msgid ""
"ScummVM found that you have old savefiles for Broken Sword 1 that should be "
"converted.\n"
-"The old save game format is no longer supported, so you will not be able to "
+"The old saved game format is no longer supported, so you will not be able to "
"load your games if you don't convert them.\n"
"\n"
"Press OK to convert them now, otherwise you will be asked again the next "
@@ -4120,8 +4120,8 @@ msgstr ""
#: engines/sword1/control.cpp:1232
#, c-format
msgid ""
-"Target new save game already exists!\n"
-"Would you like to keep the old save game (%s) or the new one (%s)?\n"
+"Target new saved game already exists!\n"
+"Would you like to keep the old saved game (%s) or the new one (%s)?\n"
msgstr ""
"Gordetako partida jadanik existitzen da!\n"
"Gordetako partida zaharra (%s) ala berria (%s) mantendu nahi zenuke?\n"
diff --git a/po/fi_FI.po b/po/fi_FI.po
index b880e0dbec..67e18e7758 100644
--- a/po/fi_FI.po
+++ b/po/fi_FI.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.6.0git\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n"
-"POT-Creation-Date: 2016-09-05 10:12+0200\n"
+"POT-Creation-Date: 2016-09-18 15:13+0100\n"
"PO-Revision-Date: 2012-12-01 19:37+0200\n"
"Last-Translator: Toni Saarela <saarela@gmail.com>\n"
"Language-Team: Finnish\n"
@@ -60,7 +60,7 @@ msgstr "Siirry ylіs"
#: gui/recorderdialog.cpp:155 gui/remotebrowser.cpp:59
#: gui/saveload-dialog.cpp:383 gui/saveload-dialog.cpp:443
#: gui/saveload-dialog.cpp:717 gui/saveload-dialog.cpp:1111
-#: gui/storagewizarddialog.cpp:69 gui/themebrowser.cpp:55
+#: gui/storagewizarddialog.cpp:68 gui/themebrowser.cpp:55
#: gui/updates-dialog.cpp:113 engines/engine.cpp:549
#: backends/events/default/default-events.cpp:196
#: backends/events/default/default-events.cpp:218
@@ -115,7 +115,7 @@ msgstr ""
#: gui/downloaddialog.cpp:118 gui/downloaddialog.cpp:152
#: gui/filebrowser-dialog.cpp:132 gui/fluidsynth-dialog.cpp:217
#: gui/launcher.cpp:286 gui/launcher.cpp:394 gui/launcher.cpp:453
-#: gui/storagewizarddialog.cpp:113
+#: gui/storagewizarddialog.cpp:112
#: backends/events/symbiansdl/symbiansdl-events.cpp:186
#: backends/platform/wince/CEActionsPocket.cpp:326
#: backends/platform/wince/CEActionsSmartphone.cpp:287
@@ -127,7 +127,7 @@ msgstr "Kyllф"
#: gui/downloaddialog.cpp:118 gui/downloaddialog.cpp:153
#: gui/filebrowser-dialog.cpp:132 gui/fluidsynth-dialog.cpp:217
#: gui/launcher.cpp:286 gui/launcher.cpp:394 gui/launcher.cpp:453
-#: gui/storagewizarddialog.cpp:113
+#: gui/storagewizarddialog.cpp:112
#: backends/events/symbiansdl/symbiansdl-events.cpp:186
#: backends/platform/wince/CEActionsPocket.cpp:326
#: backends/platform/wince/CEActionsSmartphone.cpp:287
@@ -407,8 +407,8 @@ msgstr "Valitse kansio pelitallennuksille"
#: gui/editgamedialog.cpp:510
msgid ""
-"Saves sync feature doesn't work with non-default directories. If you want "
-"your saves to sync, use default directory."
+"Saved games sync feature doesn't work with non-default directories. If you "
+"want your saved games to sync, use default directory."
msgstr ""
#: gui/editgamedialog.cpp:536
@@ -854,7 +854,7 @@ msgid "Special dithering modes supported by some games"
msgstr "Erityiset dithering asetukset joita jotkut pelit tukevat"
#: gui/options.cpp:789
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2458
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2388
msgid "Fullscreen mode"
msgstr "Kokoruututila"
@@ -1186,7 +1186,7 @@ msgid "Used space:"
msgstr ""
#: gui/options.cpp:1311
-msgid "Space used by ScummVM's saves on this storage"
+msgid "Space used by ScummVM's saved games on this storage"
msgstr ""
#: gui/options.cpp:1314
@@ -1194,10 +1194,10 @@ msgid "Last sync time:"
msgstr ""
#: gui/options.cpp:1314
-msgid "When the last saves sync for this storage occured"
+msgid "When the last saved games sync for this storage occured"
msgstr ""
-#: gui/options.cpp:1317 gui/storagewizarddialog.cpp:72
+#: gui/options.cpp:1317 gui/storagewizarddialog.cpp:71
msgid "Connect"
msgstr ""
@@ -1466,7 +1466,7 @@ msgid "New Save"
msgstr "Uusi pelitallennus"
#: gui/saveload-dialog.cpp:924
-msgid "Create a new save game"
+msgid "Create a new saved game"
msgstr "Luo uusi pelitallennus"
#: gui/saveload-dialog.cpp:1053
@@ -1478,71 +1478,71 @@ msgstr "Nimi: "
msgid "Enter a description for slot %d:"
msgstr "Anna kuvaus tallennukselle numero %d:"
-#: gui/storagewizarddialog.cpp:56
+#: gui/storagewizarddialog.cpp:55
#, c-format
msgid "%s Storage Connection Wizard"
msgstr ""
-#: gui/storagewizarddialog.cpp:59
+#: gui/storagewizarddialog.cpp:58
msgid "Navigate to the following URL:"
msgstr ""
-#: gui/storagewizarddialog.cpp:62
+#: gui/storagewizarddialog.cpp:61
msgid "Obtain the code from the storage, enter it"
msgstr ""
-#: gui/storagewizarddialog.cpp:63
+#: gui/storagewizarddialog.cpp:62
msgid "in the following field and press 'Connect':"
msgstr ""
-#: gui/storagewizarddialog.cpp:70
+#: gui/storagewizarddialog.cpp:69
#, fuzzy
msgid "Open URL"
msgstr "Avaa"
-#: gui/storagewizarddialog.cpp:71
+#: gui/storagewizarddialog.cpp:70
msgid "Paste"
msgstr ""
-#: gui/storagewizarddialog.cpp:71
+#: gui/storagewizarddialog.cpp:70
msgid "Pastes clipboard contents into fields"
msgstr ""
-#: gui/storagewizarddialog.cpp:79
+#: gui/storagewizarddialog.cpp:78
msgid "You will be directed to ScummVM's page where"
msgstr ""
-#: gui/storagewizarddialog.cpp:80
+#: gui/storagewizarddialog.cpp:79
msgid "you should allow it to access your storage."
msgstr ""
-#: gui/storagewizarddialog.cpp:113
+#: gui/storagewizarddialog.cpp:112
msgid "Another Storage is active. Do you want to interrupt it?"
msgstr ""
-#: gui/storagewizarddialog.cpp:122
+#: gui/storagewizarddialog.cpp:121
msgid "Wait until current Storage finishes up and try again."
msgstr ""
-#: gui/storagewizarddialog.cpp:183
+#: gui/storagewizarddialog.cpp:182
#, c-format
msgid "Field %s has a mistake in it."
msgstr ""
-#: gui/storagewizarddialog.cpp:185
+#: gui/storagewizarddialog.cpp:184
#, c-format
msgid "Fields %s have mistakes in them."
msgstr ""
-#: gui/storagewizarddialog.cpp:200
+#: gui/storagewizarddialog.cpp:199
msgid "All OK!"
msgstr ""
-#: gui/storagewizarddialog.cpp:202
+#: gui/storagewizarddialog.cpp:201
msgid "Invalid code"
msgstr ""
-#: gui/storagewizarddialog.cpp:210
+#: gui/storagewizarddialog.cpp:209
msgid ""
"Failed to open URL!\n"
"Please navigate to this page manually."
@@ -1909,8 +1909,8 @@ msgstr ""
#: engines/engine.cpp:546
msgid ""
"WARNING: The game you are about to start is not yet fully supported by "
-"ScummVM. As such, it is likely to be unstable, and any saves you make might "
-"not work in future versions of ScummVM."
+"ScummVM. As such, it is likely to be unstable, and any saved game you make "
+"might not work in future versions of ScummVM."
msgstr ""
"VAROITUS: ScummVM ei vielф tue tфysin valitsemaasi peliф. Peli saattaa olla "
"epфvakaa, eivфtkф pelitallennukset vфlttфmфttф toimi tulevissa ScummVM:n "
@@ -2024,16 +2024,16 @@ msgstr "C64 Audio emulaattori"
#: backends/cloud/storage.cpp:210
#, fuzzy
-msgid "Saves sync complete."
+msgid "Saved games sync complete."
msgstr "Skannaus on valmis!"
#: backends/cloud/storage.cpp:221
-msgid "Saves sync was cancelled."
+msgid "Saved games sync was cancelled."
msgstr ""
#: backends/cloud/storage.cpp:223
msgid ""
-"Saves sync failed.\n"
+"Saved games sync failed.\n"
"Check your Internet connection."
msgstr ""
@@ -2157,12 +2157,12 @@ msgstr ""
msgid "Swipe three fingers to the right to toggle."
msgstr ""
-#: backends/graphics/opengl/opengl-graphics.cpp:126
+#: backends/graphics/opengl/opengl-graphics.cpp:129
#, fuzzy
msgid "OpenGL"
msgstr "Avaa"
-#: backends/graphics/opengl/opengl-graphics.cpp:127
+#: backends/graphics/opengl/opengl-graphics.cpp:130
msgid "OpenGL (No filtering)"
msgstr ""
@@ -2177,19 +2177,19 @@ msgctxt "lowres"
msgid "Normal (no scaling)"
msgstr "Normaali (ei skaalausta)"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2357
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2289
msgid "Enabled aspect ratio correction"
msgstr "Kuvasuhteen korjaus pффllф"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2363
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2295
msgid "Disabled aspect ratio correction"
msgstr "Kuvasuhteen korjaus pois pффltф"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2418
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2349
msgid "Active graphics filter:"
msgstr "Valittu grafiikkafiltteri:"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2460
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2390
msgid "Windowed mode"
msgstr "Ikkunoitu tila"
@@ -2862,7 +2862,7 @@ msgstr ""
msgid ""
"ScummVM found that you have old savefiles for Drascula that should be "
"converted.\n"
-"The old save game format is no longer supported, so you will not be able to "
+"The old saved game format is no longer supported, so you will not be able to "
"load your games if you don't convert them.\n"
"\n"
"Press OK to convert them now, otherwise you will be asked again the next "
@@ -3038,26 +3038,26 @@ msgstr ""
#: engines/kyra/saveload_eob.cpp:557
#, c-format
msgid ""
-"The following original save game file has been found in your game path:\n"
+"The following original saved game file has been found in your game path:\n"
"\n"
"%s %s\n"
"\n"
-"Do you wish to use this save game file with ScummVM?\n"
+"Do you wish to use this saved game file with ScummVM?\n"
"\n"
msgstr ""
#: engines/kyra/saveload_eob.cpp:590
#, c-format
msgid ""
-"A save game file was found in the specified slot %d. Overwrite?\n"
+"A saved game file was found in the specified slot %d. Overwrite?\n"
"\n"
msgstr ""
#: engines/kyra/saveload_eob.cpp:623
#, c-format
msgid ""
-"%d original save game files have been successfully imported into\n"
-"ScummVM. If you want to manually import original save game files later you "
+"%d original saved game files have been successfully imported into\n"
+"ScummVM. If you want to manually import original saved game files later you "
"will\n"
"need to open the ScummVM debug console and use the command "
"'import_savefile'.\n"
@@ -4108,7 +4108,7 @@ msgstr "Videotiedosto '%s' ei lіytynyt"
msgid ""
"ScummVM found that you have old savefiles for Broken Sword 1 that should be "
"converted.\n"
-"The old save game format is no longer supported, so you will not be able to "
+"The old saved game format is no longer supported, so you will not be able to "
"load your games if you don't convert them.\n"
"\n"
"Press OK to convert them now, otherwise you will be asked again the next "
@@ -4123,8 +4123,8 @@ msgstr ""
#: engines/sword1/control.cpp:1232
#, c-format
msgid ""
-"Target new save game already exists!\n"
-"Would you like to keep the old save game (%s) or the new one (%s)?\n"
+"Target new saved game already exists!\n"
+"Would you like to keep the old saved game (%s) or the new one (%s)?\n"
msgstr ""
"Kohdetiedosto on jo olemassa!\n"
"Sфilytetффnkі vanha pelitallennus (%s), vai uusi pelitallennus (%s)?\n"
diff --git a/po/fr_FR.po b/po/fr_FR.po
index e0ce85cb5d..281c19c8ef 100644
--- a/po/fr_FR.po
+++ b/po/fr_FR.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.8.0git\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n"
-"POT-Creation-Date: 2016-09-05 10:12+0200\n"
+"POT-Creation-Date: 2016-09-18 15:13+0100\n"
"PO-Revision-Date: 2016-09-05 21:34+0100\n"
"Last-Translator: Thierry Crozat <criezy@scummvm.org>\n"
"Language-Team: French <scummvm-devel@lists.sf.net>\n"
@@ -60,7 +60,7 @@ msgstr "Remonter"
#: gui/recorderdialog.cpp:155 gui/remotebrowser.cpp:59
#: gui/saveload-dialog.cpp:383 gui/saveload-dialog.cpp:443
#: gui/saveload-dialog.cpp:717 gui/saveload-dialog.cpp:1111
-#: gui/storagewizarddialog.cpp:69 gui/themebrowser.cpp:55
+#: gui/storagewizarddialog.cpp:68 gui/themebrowser.cpp:55
#: gui/updates-dialog.cpp:113 engines/engine.cpp:549
#: backends/events/default/default-events.cpp:196
#: backends/events/default/default-events.cpp:218
@@ -116,7 +116,7 @@ msgstr ""
#: gui/downloaddialog.cpp:118 gui/downloaddialog.cpp:152
#: gui/filebrowser-dialog.cpp:132 gui/fluidsynth-dialog.cpp:217
#: gui/launcher.cpp:286 gui/launcher.cpp:394 gui/launcher.cpp:453
-#: gui/storagewizarddialog.cpp:113
+#: gui/storagewizarddialog.cpp:112
#: backends/events/symbiansdl/symbiansdl-events.cpp:186
#: backends/platform/wince/CEActionsPocket.cpp:326
#: backends/platform/wince/CEActionsSmartphone.cpp:287
@@ -128,7 +128,7 @@ msgstr "Oui"
#: gui/downloaddialog.cpp:118 gui/downloaddialog.cpp:153
#: gui/filebrowser-dialog.cpp:132 gui/fluidsynth-dialog.cpp:217
#: gui/launcher.cpp:286 gui/launcher.cpp:394 gui/launcher.cpp:453
-#: gui/storagewizarddialog.cpp:113
+#: gui/storagewizarddialog.cpp:112
#: backends/events/symbiansdl/symbiansdl-events.cpp:186
#: backends/platform/wince/CEActionsPocket.cpp:326
#: backends/platform/wince/CEActionsSmartphone.cpp:287
@@ -412,8 +412,8 @@ msgstr "Sщlectionner le rщpertoire pour les sauvegardes"
#: gui/editgamedialog.cpp:510
msgid ""
-"Saves sync feature doesn't work with non-default directories. If you want "
-"your saves to sync, use default directory."
+"Saved games sync feature doesn't work with non-default directories. If you "
+"want your saved games to sync, use default directory."
msgstr ""
"La fonctionnalitщ de synchronisation des sauvegardes ne fonctionne qu'avec "
"les rщpertoires par dщfaut. Si vous souhaitez synchroniser vos sauvegardes, "
@@ -856,7 +856,7 @@ msgid "Special dithering modes supported by some games"
msgstr "Mode spщcial de tramage supportщ par certains jeux"
#: gui/options.cpp:789
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2458
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2388
msgid "Fullscreen mode"
msgstr "Plein щcran"
@@ -1192,7 +1192,7 @@ msgid "Used space:"
msgstr "Espace utilisщ"
#: gui/options.cpp:1311
-msgid "Space used by ScummVM's saves on this storage"
+msgid "Space used by ScummVM's saved games on this storage"
msgstr "Espace utilisщ par les sauvegardes de ScummVM sur ce stockage."
#: gui/options.cpp:1314
@@ -1200,10 +1200,10 @@ msgid "Last sync time:"
msgstr "Synchronisщ :"
#: gui/options.cpp:1314
-msgid "When the last saves sync for this storage occured"
+msgid "When the last saved games sync for this storage occured"
msgstr "Quand la derniшre synchronisation des sauvegardes р eu lieu"
-#: gui/options.cpp:1317 gui/storagewizarddialog.cpp:72
+#: gui/options.cpp:1317 gui/storagewizarddialog.cpp:71
msgid "Connect"
msgstr "Se connecter"
@@ -1466,7 +1466,7 @@ msgid "New Save"
msgstr "Nouvelle Sauvegarde"
#: gui/saveload-dialog.cpp:924
-msgid "Create a new save game"
+msgid "Create a new saved game"
msgstr "Crщe une nouvelle sauvegarde."
#: gui/saveload-dialog.cpp:1053
@@ -1478,71 +1478,71 @@ msgstr "Nom: "
msgid "Enter a description for slot %d:"
msgstr "Entrez une description pour l'emplacement %d:"
-#: gui/storagewizarddialog.cpp:56
+#: gui/storagewizarddialog.cpp:55
#, c-format
msgid "%s Storage Connection Wizard"
msgstr "Assistant de Connexion pour %s"
-#: gui/storagewizarddialog.cpp:59
+#: gui/storagewizarddialog.cpp:58
msgid "Navigate to the following URL:"
msgstr "Accщdez р l'URL ci-dessous :"
-#: gui/storagewizarddialog.cpp:62
+#: gui/storagewizarddialog.cpp:61
msgid "Obtain the code from the storage, enter it"
msgstr "Obtenez le code du service de stockage, entrez le"
-#: gui/storagewizarddialog.cpp:63
+#: gui/storagewizarddialog.cpp:62
msgid "in the following field and press 'Connect':"
msgstr "ci-dessous et cliquez sur 'Se connecter' :"
-#: gui/storagewizarddialog.cpp:70
+#: gui/storagewizarddialog.cpp:69
msgid "Open URL"
msgstr "Ouvrir l'URL"
-#: gui/storagewizarddialog.cpp:71
+#: gui/storagewizarddialog.cpp:70
msgid "Paste"
msgstr "Coller"
-#: gui/storagewizarddialog.cpp:71
+#: gui/storagewizarddialog.cpp:70
msgid "Pastes clipboard contents into fields"
msgstr "Colle le contenu du presse-papier dans les champs de texte"
-#: gui/storagewizarddialog.cpp:79
+#: gui/storagewizarddialog.cpp:78
msgid "You will be directed to ScummVM's page where"
msgstr "Vous serez redirigщ vers la page de ScummVM oљ"
-#: gui/storagewizarddialog.cpp:80
+#: gui/storagewizarddialog.cpp:79
msgid "you should allow it to access your storage."
msgstr "vous devrez l'autoriser р accщder р votre stockage."
-#: gui/storagewizarddialog.cpp:113
+#: gui/storagewizarddialog.cpp:112
msgid "Another Storage is active. Do you want to interrupt it?"
msgstr "Un autre service de stockage est actif. Voulez-vous l'interrompre ?"
-#: gui/storagewizarddialog.cpp:122
+#: gui/storagewizarddialog.cpp:121
msgid "Wait until current Storage finishes up and try again."
msgstr ""
"Patientez jusqu'р ce que le Stockage actuel soit fermщ et essayez de nouveau."
-#: gui/storagewizarddialog.cpp:183
+#: gui/storagewizarddialog.cpp:182
#, c-format
msgid "Field %s has a mistake in it."
msgstr "Il y a une erreur dans le champ %s."
-#: gui/storagewizarddialog.cpp:185
+#: gui/storagewizarddialog.cpp:184
#, c-format
msgid "Fields %s have mistakes in them."
msgstr "Il y a des erreurs dans les champs %s."
-#: gui/storagewizarddialog.cpp:200
+#: gui/storagewizarddialog.cpp:199
msgid "All OK!"
msgstr "Tous OK !"
-#: gui/storagewizarddialog.cpp:202
+#: gui/storagewizarddialog.cpp:201
msgid "Invalid code"
msgstr "Code invalide"
-#: gui/storagewizarddialog.cpp:210
+#: gui/storagewizarddialog.cpp:209
msgid ""
"Failed to open URL!\n"
"Please navigate to this page manually."
@@ -1915,8 +1915,8 @@ msgstr ""
#: engines/engine.cpp:546
msgid ""
"WARNING: The game you are about to start is not yet fully supported by "
-"ScummVM. As such, it is likely to be unstable, and any saves you make might "
-"not work in future versions of ScummVM."
+"ScummVM. As such, it is likely to be unstable, and any saved game you make "
+"might not work in future versions of ScummVM."
msgstr ""
"Attention : le jeu que vous vous apprъtez р jouer n'est pas encore "
"complшtement supportщ par ScummVM. Il est donc instable et les sauvegardes "
@@ -2028,16 +2028,16 @@ msgid "C64 Audio Emulator"
msgstr "Щmulateur C64 Audio"
#: backends/cloud/storage.cpp:210
-msgid "Saves sync complete."
+msgid "Saved games sync complete."
msgstr "Synchronisation des sauvegardes terminщ."
#: backends/cloud/storage.cpp:221
-msgid "Saves sync was cancelled."
+msgid "Saved games sync was cancelled."
msgstr "Synchronisation des sauvegardes annulщe."
#: backends/cloud/storage.cpp:223
msgid ""
-"Saves sync failed.\n"
+"Saved games sync failed.\n"
"Check your Internet connection."
msgstr ""
"Erreur lors de la synchronisation des sauvegardes.\n"
@@ -2161,11 +2161,11 @@ msgstr "Le mode glisser-auto est maintenant"
msgid "Swipe three fingers to the right to toggle."
msgstr "Glissez trois doigts vers la droite pour changer de mode."
-#: backends/graphics/opengl/opengl-graphics.cpp:126
+#: backends/graphics/opengl/opengl-graphics.cpp:129
msgid "OpenGL"
msgstr "OpenGL"
-#: backends/graphics/opengl/opengl-graphics.cpp:127
+#: backends/graphics/opengl/opengl-graphics.cpp:130
msgid "OpenGL (No filtering)"
msgstr "OpenGL (sans filtre)"
@@ -2180,19 +2180,19 @@ msgctxt "lowres"
msgid "Normal (no scaling)"
msgstr "Normal"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2357
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2289
msgid "Enabled aspect ratio correction"
msgstr "Activer la correction du rapport d'aspect"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2363
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2295
msgid "Disabled aspect ratio correction"
msgstr "Dщsactiver la correction du rapport d'aspect"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2418
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2349
msgid "Active graphics filter:"
msgstr "Mode graphique actif:"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2460
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2390
msgid "Windowed mode"
msgstr "Mode Fenъtre"
@@ -2865,7 +2865,7 @@ msgstr "Activer le mode Daltonien par dщfaut"
msgid ""
"ScummVM found that you have old savefiles for Drascula that should be "
"converted.\n"
-"The old save game format is no longer supported, so you will not be able to "
+"The old saved game format is no longer supported, so you will not be able to "
"load your games if you don't convert them.\n"
"\n"
"Press OK to convert them now, otherwise you will be asked again the next "
@@ -3044,11 +3044,11 @@ msgstr ""
#: engines/kyra/saveload_eob.cpp:557
#, c-format
msgid ""
-"The following original save game file has been found in your game path:\n"
+"The following original saved game file has been found in your game path:\n"
"\n"
"%s %s\n"
"\n"
-"Do you wish to use this save game file with ScummVM?\n"
+"Do you wish to use this saved game file with ScummVM?\n"
"\n"
msgstr ""
"Le fichier de sauvegarde original suivant a щtщ trouvщ dans le rщpertoire du "
@@ -3062,7 +3062,7 @@ msgstr ""
#: engines/kyra/saveload_eob.cpp:590
#, c-format
msgid ""
-"A save game file was found in the specified slot %d. Overwrite?\n"
+"A saved game file was found in the specified slot %d. Overwrite?\n"
"\n"
msgstr ""
"Une sauvegarde existe dщjр dans l'emplacement %d. Щcraser ?\n"
@@ -3071,8 +3071,8 @@ msgstr ""
#: engines/kyra/saveload_eob.cpp:623
#, c-format
msgid ""
-"%d original save game files have been successfully imported into\n"
-"ScummVM. If you want to manually import original save game files later you "
+"%d original saved game files have been successfully imported into\n"
+"ScummVM. If you want to manually import original saved game files later you "
"will\n"
"need to open the ScummVM debug console and use the command "
"'import_savefile'.\n"
@@ -4134,7 +4134,7 @@ msgstr "Sщquence '%s' non trouvщ"
msgid ""
"ScummVM found that you have old savefiles for Broken Sword 1 that should be "
"converted.\n"
-"The old save game format is no longer supported, so you will not be able to "
+"The old saved game format is no longer supported, so you will not be able to "
"load your games if you don't convert them.\n"
"\n"
"Press OK to convert them now, otherwise you will be asked again the next "
@@ -4151,8 +4151,8 @@ msgstr ""
#: engines/sword1/control.cpp:1232
#, c-format
msgid ""
-"Target new save game already exists!\n"
-"Would you like to keep the old save game (%s) or the new one (%s)?\n"
+"Target new saved game already exists!\n"
+"Would you like to keep the old saved game (%s) or the new one (%s)?\n"
msgstr ""
"La sauvegarde cible existe dщjр!\n"
"Voulez-vous conserver l'ancienne sauvegarde (%s) ou la nouvelle (%s) ?\n"
diff --git a/po/gl_ES.po b/po/gl_ES.po
index fc432a0b98..803a45d0e3 100644
--- a/po/gl_ES.po
+++ b/po/gl_ES.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.8.0git\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n"
-"POT-Creation-Date: 2016-09-05 10:12+0200\n"
+"POT-Creation-Date: 2016-09-18 15:13+0100\n"
"PO-Revision-Date: 2016-02-21 00:43+0100\n"
"Last-Translator: Santiago G. Sanz <s.sanz@uvigo.es>\n"
"Language-Team: Santiago G. Sanz <s.sanz@uvigo.es>\n"
@@ -59,7 +59,7 @@ msgstr "Arriba"
#: gui/recorderdialog.cpp:155 gui/remotebrowser.cpp:59
#: gui/saveload-dialog.cpp:383 gui/saveload-dialog.cpp:443
#: gui/saveload-dialog.cpp:717 gui/saveload-dialog.cpp:1111
-#: gui/storagewizarddialog.cpp:69 gui/themebrowser.cpp:55
+#: gui/storagewizarddialog.cpp:68 gui/themebrowser.cpp:55
#: gui/updates-dialog.cpp:113 engines/engine.cpp:549
#: backends/events/default/default-events.cpp:196
#: backends/events/default/default-events.cpp:218
@@ -114,7 +114,7 @@ msgstr ""
#: gui/downloaddialog.cpp:118 gui/downloaddialog.cpp:152
#: gui/filebrowser-dialog.cpp:132 gui/fluidsynth-dialog.cpp:217
#: gui/launcher.cpp:286 gui/launcher.cpp:394 gui/launcher.cpp:453
-#: gui/storagewizarddialog.cpp:113
+#: gui/storagewizarddialog.cpp:112
#: backends/events/symbiansdl/symbiansdl-events.cpp:186
#: backends/platform/wince/CEActionsPocket.cpp:326
#: backends/platform/wince/CEActionsSmartphone.cpp:287
@@ -126,7 +126,7 @@ msgstr "Si"
#: gui/downloaddialog.cpp:118 gui/downloaddialog.cpp:153
#: gui/filebrowser-dialog.cpp:132 gui/fluidsynth-dialog.cpp:217
#: gui/launcher.cpp:286 gui/launcher.cpp:394 gui/launcher.cpp:453
-#: gui/storagewizarddialog.cpp:113
+#: gui/storagewizarddialog.cpp:112
#: backends/events/symbiansdl/symbiansdl-events.cpp:186
#: backends/platform/wince/CEActionsPocket.cpp:326
#: backends/platform/wince/CEActionsSmartphone.cpp:287
@@ -404,8 +404,8 @@ msgstr "Selecciona un directorio para ficheiros de gardado"
#: gui/editgamedialog.cpp:510
msgid ""
-"Saves sync feature doesn't work with non-default directories. If you want "
-"your saves to sync, use default directory."
+"Saved games sync feature doesn't work with non-default directories. If you "
+"want your saved games to sync, use default directory."
msgstr ""
#: gui/editgamedialog.cpp:536
@@ -842,7 +842,7 @@ msgid "Special dithering modes supported by some games"
msgstr "Modos de interpolaciѓn de cores compatibles con algњns xogos"
#: gui/options.cpp:789
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2458
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2388
msgid "Fullscreen mode"
msgstr "Pantalla completa"
@@ -1174,7 +1174,7 @@ msgid "Used space:"
msgstr ""
#: gui/options.cpp:1311
-msgid "Space used by ScummVM's saves on this storage"
+msgid "Space used by ScummVM's saved games on this storage"
msgstr ""
#: gui/options.cpp:1314
@@ -1182,10 +1182,10 @@ msgid "Last sync time:"
msgstr ""
#: gui/options.cpp:1314
-msgid "When the last saves sync for this storage occured"
+msgid "When the last saved games sync for this storage occured"
msgstr ""
-#: gui/options.cpp:1317 gui/storagewizarddialog.cpp:72
+#: gui/options.cpp:1317 gui/storagewizarddialog.cpp:71
msgid "Connect"
msgstr ""
@@ -1450,7 +1450,7 @@ msgid "New Save"
msgstr "Novo ficheiro"
#: gui/saveload-dialog.cpp:924
-msgid "Create a new save game"
+msgid "Create a new saved game"
msgstr "Crea un novo ficheiro de gardado"
#: gui/saveload-dialog.cpp:1053
@@ -1462,71 +1462,71 @@ msgstr "Nome:"
msgid "Enter a description for slot %d:"
msgstr "Introduce unha descriciѓn para o espazo %d:"
-#: gui/storagewizarddialog.cpp:56
+#: gui/storagewizarddialog.cpp:55
#, c-format
msgid "%s Storage Connection Wizard"
msgstr ""
-#: gui/storagewizarddialog.cpp:59
+#: gui/storagewizarddialog.cpp:58
msgid "Navigate to the following URL:"
msgstr ""
-#: gui/storagewizarddialog.cpp:62
+#: gui/storagewizarddialog.cpp:61
msgid "Obtain the code from the storage, enter it"
msgstr ""
-#: gui/storagewizarddialog.cpp:63
+#: gui/storagewizarddialog.cpp:62
msgid "in the following field and press 'Connect':"
msgstr ""
-#: gui/storagewizarddialog.cpp:70
+#: gui/storagewizarddialog.cpp:69
#, fuzzy
msgid "Open URL"
msgstr "OpenGL"
-#: gui/storagewizarddialog.cpp:71
+#: gui/storagewizarddialog.cpp:70
msgid "Paste"
msgstr ""
-#: gui/storagewizarddialog.cpp:71
+#: gui/storagewizarddialog.cpp:70
msgid "Pastes clipboard contents into fields"
msgstr ""
-#: gui/storagewizarddialog.cpp:79
+#: gui/storagewizarddialog.cpp:78
msgid "You will be directed to ScummVM's page where"
msgstr ""
-#: gui/storagewizarddialog.cpp:80
+#: gui/storagewizarddialog.cpp:79
msgid "you should allow it to access your storage."
msgstr ""
-#: gui/storagewizarddialog.cpp:113
+#: gui/storagewizarddialog.cpp:112
msgid "Another Storage is active. Do you want to interrupt it?"
msgstr ""
-#: gui/storagewizarddialog.cpp:122
+#: gui/storagewizarddialog.cpp:121
msgid "Wait until current Storage finishes up and try again."
msgstr ""
-#: gui/storagewizarddialog.cpp:183
+#: gui/storagewizarddialog.cpp:182
#, c-format
msgid "Field %s has a mistake in it."
msgstr ""
-#: gui/storagewizarddialog.cpp:185
+#: gui/storagewizarddialog.cpp:184
#, c-format
msgid "Fields %s have mistakes in them."
msgstr ""
-#: gui/storagewizarddialog.cpp:200
+#: gui/storagewizarddialog.cpp:199
msgid "All OK!"
msgstr ""
-#: gui/storagewizarddialog.cpp:202
+#: gui/storagewizarddialog.cpp:201
msgid "Invalid code"
msgstr ""
-#: gui/storagewizarddialog.cpp:210
+#: gui/storagewizarddialog.cpp:209
msgid ""
"Failed to open URL!\n"
"Please navigate to this page manually."
@@ -1891,8 +1891,8 @@ msgstr ""
#: engines/engine.cpp:546
msgid ""
"WARNING: The game you are about to start is not yet fully supported by "
-"ScummVM. As such, it is likely to be unstable, and any saves you make might "
-"not work in future versions of ScummVM."
+"ScummVM. As such, it is likely to be unstable, and any saved game you make "
+"might not work in future versions of ScummVM."
msgstr ""
"Ollo: o xogo que vas iniciar non щ aэnda totalmente compatible con ScummVM. "
"Por iso, talvez sexa inestable e os ficheiros de gardado talvez non "
@@ -2005,16 +2005,16 @@ msgstr "Emulador de C64 Audio"
#: backends/cloud/storage.cpp:210
#, fuzzy
-msgid "Saves sync complete."
+msgid "Saved games sync complete."
msgstr "Anсlise finalizada!"
#: backends/cloud/storage.cpp:221
-msgid "Saves sync was cancelled."
+msgid "Saved games sync was cancelled."
msgstr ""
#: backends/cloud/storage.cpp:223
msgid ""
-"Saves sync failed.\n"
+"Saved games sync failed.\n"
"Check your Internet connection."
msgstr ""
@@ -2136,11 +2136,11 @@ msgstr "O modo Autoarrastrar estс"
msgid "Swipe three fingers to the right to toggle."
msgstr "Arrastra tres dedos с dereita para cambiar o estado."
-#: backends/graphics/opengl/opengl-graphics.cpp:126
+#: backends/graphics/opengl/opengl-graphics.cpp:129
msgid "OpenGL"
msgstr "OpenGL"
-#: backends/graphics/opengl/opengl-graphics.cpp:127
+#: backends/graphics/opengl/opengl-graphics.cpp:130
msgid "OpenGL (No filtering)"
msgstr "OpenGL (Sen filtraxe)"
@@ -2155,19 +2155,19 @@ msgctxt "lowres"
msgid "Normal (no scaling)"
msgstr "Normal (sen escala)"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2357
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2289
msgid "Enabled aspect ratio correction"
msgstr "Correcciѓn de proporciѓn activada"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2363
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2295
msgid "Disabled aspect ratio correction"
msgstr "Correcciѓn de proporciѓn desactivada"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2418
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2349
msgid "Active graphics filter:"
msgstr "Filtro de grсficos activo:"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2460
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2390
msgid "Windowed mode"
msgstr "Modo en ventс"
@@ -2837,7 +2837,7 @@ msgstr "Activa o modo accesible para daltonismo de xeito predeterminado."
msgid ""
"ScummVM found that you have old savefiles for Drascula that should be "
"converted.\n"
-"The old save game format is no longer supported, so you will not be able to "
+"The old saved game format is no longer supported, so you will not be able to "
"load your games if you don't convert them.\n"
"\n"
"Press OK to convert them now, otherwise you will be asked again the next "
@@ -3016,11 +3016,11 @@ msgstr ""
#: engines/kyra/saveload_eob.cpp:557
#, c-format
msgid ""
-"The following original save game file has been found in your game path:\n"
+"The following original saved game file has been found in your game path:\n"
"\n"
"%s %s\n"
"\n"
-"Do you wish to use this save game file with ScummVM?\n"
+"Do you wish to use this saved game file with ScummVM?\n"
"\n"
msgstr ""
"Atopouse o seguinte ficheiro de gardado orixinal:\n"
@@ -3033,7 +3033,7 @@ msgstr ""
#: engines/kyra/saveload_eob.cpp:590
#, c-format
msgid ""
-"A save game file was found in the specified slot %d. Overwrite?\n"
+"A saved game file was found in the specified slot %d. Overwrite?\n"
"\n"
msgstr ""
"Atopouse un ficheiro de gardado no espazo %d. Sobreescribir?\n"
@@ -3042,8 +3042,8 @@ msgstr ""
#: engines/kyra/saveload_eob.cpp:623
#, c-format
msgid ""
-"%d original save game files have been successfully imported into\n"
-"ScummVM. If you want to manually import original save game files later you "
+"%d original saved game files have been successfully imported into\n"
+"ScummVM. If you want to manually import original saved game files later you "
"will\n"
"need to open the ScummVM debug console and use the command "
"'import_savefile'.\n"
@@ -4103,7 +4103,7 @@ msgstr "Non se atopou a secuencia %s"
msgid ""
"ScummVM found that you have old savefiles for Broken Sword 1 that should be "
"converted.\n"
-"The old save game format is no longer supported, so you will not be able to "
+"The old saved game format is no longer supported, so you will not be able to "
"load your games if you don't convert them.\n"
"\n"
"Press OK to convert them now, otherwise you will be asked again the next "
@@ -4120,8 +4120,8 @@ msgstr ""
#: engines/sword1/control.cpp:1232
#, c-format
msgid ""
-"Target new save game already exists!\n"
-"Would you like to keep the old save game (%s) or the new one (%s)?\n"
+"Target new saved game already exists!\n"
+"Would you like to keep the old saved game (%s) or the new one (%s)?\n"
msgstr ""
"Xa existe unha partida con ese nome!\n"
"Queres conservar a vella (%s) ou a nova (%s)?\n"
diff --git a/po/hu_HU.po b/po/hu_HU.po
index bfc4e3405d..ecbd835087 100644
--- a/po/hu_HU.po
+++ b/po/hu_HU.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.3.0svn\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n"
-"POT-Creation-Date: 2016-09-05 10:12+0200\n"
+"POT-Creation-Date: 2016-09-18 15:13+0100\n"
"PO-Revision-Date: 2016-09-06 06:22+0200\n"
"Last-Translator: George Kormendi <grubycza@hotmail.com>\n"
"Language-Team: Hungarian\n"
@@ -60,7 +60,7 @@ msgstr "Feljebb"
#: gui/recorderdialog.cpp:155 gui/remotebrowser.cpp:59
#: gui/saveload-dialog.cpp:383 gui/saveload-dialog.cpp:443
#: gui/saveload-dialog.cpp:717 gui/saveload-dialog.cpp:1111
-#: gui/storagewizarddialog.cpp:69 gui/themebrowser.cpp:55
+#: gui/storagewizarddialog.cpp:68 gui/themebrowser.cpp:55
#: gui/updates-dialog.cpp:113 engines/engine.cpp:549
#: backends/events/default/default-events.cpp:196
#: backends/events/default/default-events.cpp:218
@@ -116,7 +116,7 @@ msgstr ""
#: gui/downloaddialog.cpp:118 gui/downloaddialog.cpp:152
#: gui/filebrowser-dialog.cpp:132 gui/fluidsynth-dialog.cpp:217
#: gui/launcher.cpp:286 gui/launcher.cpp:394 gui/launcher.cpp:453
-#: gui/storagewizarddialog.cpp:113
+#: gui/storagewizarddialog.cpp:112
#: backends/events/symbiansdl/symbiansdl-events.cpp:186
#: backends/platform/wince/CEActionsPocket.cpp:326
#: backends/platform/wince/CEActionsSmartphone.cpp:287
@@ -128,7 +128,7 @@ msgstr "Igen"
#: gui/downloaddialog.cpp:118 gui/downloaddialog.cpp:153
#: gui/filebrowser-dialog.cpp:132 gui/fluidsynth-dialog.cpp:217
#: gui/launcher.cpp:286 gui/launcher.cpp:394 gui/launcher.cpp:453
-#: gui/storagewizarddialog.cpp:113
+#: gui/storagewizarddialog.cpp:112
#: backends/events/symbiansdl/symbiansdl-events.cpp:186
#: backends/platform/wince/CEActionsPocket.cpp:326
#: backends/platform/wince/CEActionsSmartphone.cpp:287
@@ -410,8 +410,8 @@ msgstr "Vсlaszz jсtщkmentщseknek mappсt"
#: gui/editgamedialog.cpp:510
msgid ""
-"Saves sync feature doesn't work with non-default directories. If you want "
-"your saves to sync, use default directory."
+"Saved games sync feature doesn't work with non-default directories. If you "
+"want your saved games to sync, use default directory."
msgstr ""
"Mentщs szinkronizсlсs nem mћkіdik nem alapщrtelmezett mappсkkal. Ha "
"szinkronizсlni akarod a mentщseid, hasznсld az alapщrtelmezett mappсt."
@@ -849,7 +849,7 @@ msgid "Special dithering modes supported by some games"
msgstr "Nщhсny jсtщk tсmogatja a speciсlis сrnyalсsi mѓdokat"
#: gui/options.cpp:789
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2458
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2388
msgid "Fullscreen mode"
msgstr "Teljeskщpernyѕs mѓd:"
@@ -1177,18 +1177,18 @@ msgid "Used space:"
msgstr "Hasznсlt hely:"
#: gui/options.cpp:1311
-msgid "Space used by ScummVM's saves on this storage"
+msgid "Space used by ScummVM's saved games on this storage"
msgstr "ScummVM mentщsekhez hasznсlt hely ezen a tсrolѓn"
#: gui/options.cpp:1314
msgid "Last sync time:"
-msgstr "Utolsѓ szinkronizсlсs ideje:"
+msgstr "Utolsѓ szinkron:"
#: gui/options.cpp:1314
-msgid "When the last saves sync for this storage occured"
+msgid "When the last saved games sync for this storage occured"
msgstr "Amikor az utolsѓ mentщs szinkronizсlсs tіrtщnt ezen a tсrolѓn"
-#: gui/options.cpp:1317 gui/storagewizarddialog.cpp:72
+#: gui/options.cpp:1317 gui/storagewizarddialog.cpp:71
msgid "Connect"
msgstr "Csatlakozсs"
@@ -1447,7 +1447,7 @@ msgid "New Save"
msgstr "кj Mentщs"
#: gui/saveload-dialog.cpp:924
-msgid "Create a new save game"
+msgid "Create a new saved game"
msgstr "кj jсtщkmentщs kщszэtщse"
#: gui/saveload-dialog.cpp:1053
@@ -1459,70 +1459,70 @@ msgstr "Nщv:"
msgid "Enter a description for slot %d:"
msgstr "Adj meg egy leэrсst a %d slothoz:"
-#: gui/storagewizarddialog.cpp:56
+#: gui/storagewizarddialog.cpp:55
#, c-format
msgid "%s Storage Connection Wizard"
msgstr "%s Tсrolѓ csatlakozсs varсzslѓ"
-#: gui/storagewizarddialog.cpp:59
+#: gui/storagewizarddialog.cpp:58
msgid "Navigate to the following URL:"
msgstr "Lщpjen a kіvetkezѕ URL-re:"
-#: gui/storagewizarddialog.cpp:62
+#: gui/storagewizarddialog.cpp:61
msgid "Obtain the code from the storage, enter it"
msgstr "Adja meg a hozzсfщrщsi kѓdot a tсrolѓhoz"
-#: gui/storagewizarddialog.cpp:63
+#: gui/storagewizarddialog.cpp:62
msgid "in the following field and press 'Connect':"
msgstr "a kіvetkezѕ mezѕbe щs nyomd meg 'Csatlakozсs':"
-#: gui/storagewizarddialog.cpp:70
+#: gui/storagewizarddialog.cpp:69
msgid "Open URL"
msgstr "URL megnyitсsa"
-#: gui/storagewizarddialog.cpp:71
+#: gui/storagewizarddialog.cpp:70
msgid "Paste"
msgstr "Beilleszt"
-#: gui/storagewizarddialog.cpp:71
+#: gui/storagewizarddialog.cpp:70
msgid "Pastes clipboard contents into fields"
msgstr "Beilleszti a vсgѓlap tartalmсt a mezѕbe"
-#: gui/storagewizarddialog.cpp:79
+#: gui/storagewizarddialog.cpp:78
msgid "You will be directed to ScummVM's page where"
msgstr "Сt kell irсnyэtanod a ScummVM oldalсra, ahol"
-#: gui/storagewizarddialog.cpp:80
+#: gui/storagewizarddialog.cpp:79
msgid "you should allow it to access your storage."
msgstr "lehetѕvщ teheted a hozzсfщrщst a tсrolѓdhoz."
-#: gui/storagewizarddialog.cpp:113
+#: gui/storagewizarddialog.cpp:112
msgid "Another Storage is active. Do you want to interrupt it?"
msgstr "Egy mсsik tсrolѓ aktэv. Meg akarod azt szakэtani?"
-#: gui/storagewizarddialog.cpp:122
+#: gui/storagewizarddialog.cpp:121
msgid "Wait until current Storage finishes up and try again."
msgstr "Vсrj amэg a jelenlegi tсrolѓ befejezi щs prѓbсld њjra."
-#: gui/storagewizarddialog.cpp:183
+#: gui/storagewizarddialog.cpp:182
#, c-format
msgid "Field %s has a mistake in it."
msgstr "%s mezѕben hiba van."
-#: gui/storagewizarddialog.cpp:185
+#: gui/storagewizarddialog.cpp:184
#, c-format
msgid "Fields %s have mistakes in them."
msgstr "%s mezѕben van egy hiba."
-#: gui/storagewizarddialog.cpp:200
+#: gui/storagewizarddialog.cpp:199
msgid "All OK!"
msgstr "Minden OK!"
-#: gui/storagewizarddialog.cpp:202
+#: gui/storagewizarddialog.cpp:201
msgid "Invalid code"
msgstr "Щrvщnytelen kѓd"
-#: gui/storagewizarddialog.cpp:210
+#: gui/storagewizarddialog.cpp:209
msgid ""
"Failed to open URL!\n"
"Please navigate to this page manually."
@@ -1890,8 +1890,8 @@ msgstr ""
#: engines/engine.cpp:546
msgid ""
"WARNING: The game you are about to start is not yet fully supported by "
-"ScummVM. As such, it is likely to be unstable, and any saves you make might "
-"not work in future versions of ScummVM."
+"ScummVM. As such, it is likely to be unstable, and any saved game you make "
+"might not work in future versions of ScummVM."
msgstr ""
"FIGYELEM: A jсtщkot amit indэtani akarsz mщg nem teljesen tсmogatotja a "
"ScummVM. Szсmэts rс hogy nem stabilan fut, щs a mentщsek nem mћkіdnek a "
@@ -2001,16 +2001,16 @@ msgid "C64 Audio Emulator"
msgstr "C64 Audio Emulсtor"
#: backends/cloud/storage.cpp:210
-msgid "Saves sync complete."
+msgid "Saved games sync complete."
msgstr "Mentщs szinkronizсlсs kщsz."
#: backends/cloud/storage.cpp:221
-msgid "Saves sync was cancelled."
+msgid "Saved games sync was cancelled."
msgstr "Mentщs szinkronizсlсs megszakэtva."
#: backends/cloud/storage.cpp:223
msgid ""
-"Saves sync failed.\n"
+"Saved games sync failed.\n"
"Check your Internet connection."
msgstr ""
"Mentщs szinkronizсlсs nem sikerќlt.\n"
@@ -2134,11 +2134,11 @@ msgstr "Auto-hњz mѓdban van"
msgid "Swipe three fingers to the right to toggle."
msgstr "мsd hсrom њjjal hogy biztosan vсltson."
-#: backends/graphics/opengl/opengl-graphics.cpp:126
+#: backends/graphics/opengl/opengl-graphics.cpp:129
msgid "OpenGL"
msgstr "OpenGL"
-#: backends/graphics/opengl/opengl-graphics.cpp:127
+#: backends/graphics/opengl/opengl-graphics.cpp:130
msgid "OpenGL (No filtering)"
msgstr "OpenGL (Nincs szћrщs)"
@@ -2153,19 +2153,19 @@ msgctxt "lowres"
msgid "Normal (no scaling)"
msgstr "Normсl (nincs сtmщretezщs)"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2357
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2289
msgid "Enabled aspect ratio correction"
msgstr "Mщretarсny korrekciѓ engedщlyezve"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2363
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2295
msgid "Disabled aspect ratio correction"
msgstr "Mщretarсny korrekciѓ letiltva"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2418
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2349
msgid "Active graphics filter:"
msgstr "Aktэv grafikus szћrѕk:"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2460
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2390
msgid "Windowed mode"
msgstr "Ablakos mѓd"
@@ -2831,7 +2831,7 @@ msgstr "Szinvak mѓd engedщlyezve alapщrtelmezett"
msgid ""
"ScummVM found that you have old savefiles for Drascula that should be "
"converted.\n"
-"The old save game format is no longer supported, so you will not be able to "
+"The old saved game format is no longer supported, so you will not be able to "
"load your games if you don't convert them.\n"
"\n"
"Press OK to convert them now, otherwise you will be asked again the next "
@@ -3009,11 +3009,11 @@ msgstr ""
#: engines/kyra/saveload_eob.cpp:557
#, c-format
msgid ""
-"The following original save game file has been found in your game path:\n"
+"The following original saved game file has been found in your game path:\n"
"\n"
"%s %s\n"
"\n"
-"Do you wish to use this save game file with ScummVM?\n"
+"Do you wish to use this saved game file with ScummVM?\n"
"\n"
msgstr ""
"A kіvetkezѕ eredeti jсtщkmentщs fсjlt talсltam a jсtщkkіnyvtсrban:\n"
@@ -3026,7 +3026,7 @@ msgstr ""
#: engines/kyra/saveload_eob.cpp:590
#, c-format
msgid ""
-"A save game file was found in the specified slot %d. Overwrite?\n"
+"A saved game file was found in the specified slot %d. Overwrite?\n"
"\n"
msgstr ""
"Jсtщkmentщs talсlhatѓ a vсlasztott %d slotban. Felќlэrjam?\n"
@@ -3035,8 +3035,8 @@ msgstr ""
#: engines/kyra/saveload_eob.cpp:623
#, c-format
msgid ""
-"%d original save game files have been successfully imported into\n"
-"ScummVM. If you want to manually import original save game files later you "
+"%d original saved game files have been successfully imported into\n"
+"ScummVM. If you want to manually import original saved game files later you "
"will\n"
"need to open the ScummVM debug console and use the command "
"'import_savefile'.\n"
@@ -4085,7 +4085,7 @@ msgstr "'%s' сtvezetѕ nem talсlhatѓ"
msgid ""
"ScummVM found that you have old savefiles for Broken Sword 1 that should be "
"converted.\n"
-"The old save game format is no longer supported, so you will not be able to "
+"The old saved game format is no longer supported, so you will not be able to "
"load your games if you don't convert them.\n"
"\n"
"Press OK to convert them now, otherwise you will be asked again the next "
@@ -4102,8 +4102,8 @@ msgstr ""
#: engines/sword1/control.cpp:1232
#, c-format
msgid ""
-"Target new save game already exists!\n"
-"Would you like to keep the old save game (%s) or the new one (%s)?\n"
+"Target new saved game already exists!\n"
+"Would you like to keep the old saved game (%s) or the new one (%s)?\n"
msgstr ""
"A vсlasztott jсtщkmentщs mсr lщtezik!\n"
"Megtartod a rщgi jсtщkmentщst (%s) vagy kicserщled az њjra (%s)?\n"
diff --git a/po/it_IT.po b/po/it_IT.po
index 611300142c..f26002ef70 100644
--- a/po/it_IT.po
+++ b/po/it_IT.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.3.0svn\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n"
-"POT-Creation-Date: 2016-09-05 10:12+0200\n"
+"POT-Creation-Date: 2016-09-18 15:13+0100\n"
"PO-Revision-Date: 2014-07-03 17:59-0600\n"
"Last-Translator: Matteo 'Maff' Angelino <matteo.maff at gmail dot com>\n"
"Language-Team: Italian\n"
@@ -58,7 +58,7 @@ msgstr "Su"
#: gui/recorderdialog.cpp:155 gui/remotebrowser.cpp:59
#: gui/saveload-dialog.cpp:383 gui/saveload-dialog.cpp:443
#: gui/saveload-dialog.cpp:717 gui/saveload-dialog.cpp:1111
-#: gui/storagewizarddialog.cpp:69 gui/themebrowser.cpp:55
+#: gui/storagewizarddialog.cpp:68 gui/themebrowser.cpp:55
#: gui/updates-dialog.cpp:113 engines/engine.cpp:549
#: backends/events/default/default-events.cpp:196
#: backends/events/default/default-events.cpp:218
@@ -113,7 +113,7 @@ msgstr ""
#: gui/downloaddialog.cpp:118 gui/downloaddialog.cpp:152
#: gui/filebrowser-dialog.cpp:132 gui/fluidsynth-dialog.cpp:217
#: gui/launcher.cpp:286 gui/launcher.cpp:394 gui/launcher.cpp:453
-#: gui/storagewizarddialog.cpp:113
+#: gui/storagewizarddialog.cpp:112
#: backends/events/symbiansdl/symbiansdl-events.cpp:186
#: backends/platform/wince/CEActionsPocket.cpp:326
#: backends/platform/wince/CEActionsSmartphone.cpp:287
@@ -125,7 +125,7 @@ msgstr "Sь"
#: gui/downloaddialog.cpp:118 gui/downloaddialog.cpp:153
#: gui/filebrowser-dialog.cpp:132 gui/fluidsynth-dialog.cpp:217
#: gui/launcher.cpp:286 gui/launcher.cpp:394 gui/launcher.cpp:453
-#: gui/storagewizarddialog.cpp:113
+#: gui/storagewizarddialog.cpp:112
#: backends/events/symbiansdl/symbiansdl-events.cpp:186
#: backends/platform/wince/CEActionsPocket.cpp:326
#: backends/platform/wince/CEActionsSmartphone.cpp:287
@@ -404,8 +404,8 @@ msgstr "Seleziona la cartella dei salvataggi"
#: gui/editgamedialog.cpp:510
msgid ""
-"Saves sync feature doesn't work with non-default directories. If you want "
-"your saves to sync, use default directory."
+"Saved games sync feature doesn't work with non-default directories. If you "
+"want your saved games to sync, use default directory."
msgstr ""
#: gui/editgamedialog.cpp:536
@@ -849,7 +849,7 @@ msgid "Special dithering modes supported by some games"
msgstr "Modalitр di resa grafica speciali supportate da alcuni giochi"
#: gui/options.cpp:789
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2458
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2388
msgid "Fullscreen mode"
msgstr "Modalitр a schermo intero"
@@ -1181,7 +1181,7 @@ msgid "Used space:"
msgstr ""
#: gui/options.cpp:1311
-msgid "Space used by ScummVM's saves on this storage"
+msgid "Space used by ScummVM's saved games on this storage"
msgstr ""
#: gui/options.cpp:1314
@@ -1189,10 +1189,10 @@ msgid "Last sync time:"
msgstr ""
#: gui/options.cpp:1314
-msgid "When the last saves sync for this storage occured"
+msgid "When the last saved games sync for this storage occured"
msgstr ""
-#: gui/options.cpp:1317 gui/storagewizarddialog.cpp:72
+#: gui/options.cpp:1317 gui/storagewizarddialog.cpp:71
msgid "Connect"
msgstr ""
@@ -1461,7 +1461,7 @@ msgid "New Save"
msgstr "Nuovo salvataggio"
#: gui/saveload-dialog.cpp:924
-msgid "Create a new save game"
+msgid "Create a new saved game"
msgstr "Crea un nuovo salvataggio"
#: gui/saveload-dialog.cpp:1053
@@ -1473,72 +1473,72 @@ msgstr "Nome: "
msgid "Enter a description for slot %d:"
msgstr "Inserisci una descrizione per la posizione %d:"
-#: gui/storagewizarddialog.cpp:56
+#: gui/storagewizarddialog.cpp:55
#, c-format
msgid "%s Storage Connection Wizard"
msgstr ""
-#: gui/storagewizarddialog.cpp:59
+#: gui/storagewizarddialog.cpp:58
msgid "Navigate to the following URL:"
msgstr ""
-#: gui/storagewizarddialog.cpp:62
+#: gui/storagewizarddialog.cpp:61
msgid "Obtain the code from the storage, enter it"
msgstr ""
-#: gui/storagewizarddialog.cpp:63
+#: gui/storagewizarddialog.cpp:62
msgid "in the following field and press 'Connect':"
msgstr ""
-#: gui/storagewizarddialog.cpp:70
+#: gui/storagewizarddialog.cpp:69
#, fuzzy
msgid "Open URL"
msgstr "OpenGL"
-#: gui/storagewizarddialog.cpp:71
+#: gui/storagewizarddialog.cpp:70
msgid "Paste"
msgstr ""
-#: gui/storagewizarddialog.cpp:71
+#: gui/storagewizarddialog.cpp:70
msgid "Pastes clipboard contents into fields"
msgstr ""
-#: gui/storagewizarddialog.cpp:79
+#: gui/storagewizarddialog.cpp:78
msgid "You will be directed to ScummVM's page where"
msgstr ""
-#: gui/storagewizarddialog.cpp:80
+#: gui/storagewizarddialog.cpp:79
msgid "you should allow it to access your storage."
msgstr ""
-#: gui/storagewizarddialog.cpp:113
+#: gui/storagewizarddialog.cpp:112
msgid "Another Storage is active. Do you want to interrupt it?"
msgstr ""
-#: gui/storagewizarddialog.cpp:122
+#: gui/storagewizarddialog.cpp:121
msgid "Wait until current Storage finishes up and try again."
msgstr ""
-#: gui/storagewizarddialog.cpp:183
+#: gui/storagewizarddialog.cpp:182
#, c-format
msgid "Field %s has a mistake in it."
msgstr ""
-#: gui/storagewizarddialog.cpp:185
+#: gui/storagewizarddialog.cpp:184
#, c-format
msgid "Fields %s have mistakes in them."
msgstr ""
-#: gui/storagewizarddialog.cpp:200
+#: gui/storagewizarddialog.cpp:199
msgid "All OK!"
msgstr ""
-#: gui/storagewizarddialog.cpp:202
+#: gui/storagewizarddialog.cpp:201
#, fuzzy
msgid "Invalid code"
msgstr "Percorso non valido"
-#: gui/storagewizarddialog.cpp:210
+#: gui/storagewizarddialog.cpp:209
msgid ""
"Failed to open URL!\n"
"Please navigate to this page manually."
@@ -1906,8 +1906,8 @@ msgstr ""
#: engines/engine.cpp:546
msgid ""
"WARNING: The game you are about to start is not yet fully supported by "
-"ScummVM. As such, it is likely to be unstable, and any saves you make might "
-"not work in future versions of ScummVM."
+"ScummVM. As such, it is likely to be unstable, and any saved game you make "
+"might not work in future versions of ScummVM."
msgstr ""
"ATTENZIONE: il gioco che stai avviando non ш completamente supportato da "
"ScummVM. Ш quindi possibile che sia instabile, e i salvataggi potrebbero non "
@@ -2022,16 +2022,16 @@ msgstr "Emulatore audio C64"
#: backends/cloud/storage.cpp:210
#, fuzzy
-msgid "Saves sync complete."
+msgid "Saved games sync complete."
msgstr "Scansione completa!"
#: backends/cloud/storage.cpp:221
-msgid "Saves sync was cancelled."
+msgid "Saved games sync was cancelled."
msgstr ""
#: backends/cloud/storage.cpp:223
msgid ""
-"Saves sync failed.\n"
+"Saved games sync failed.\n"
"Check your Internet connection."
msgstr ""
@@ -2154,11 +2154,11 @@ msgstr ""
msgid "Swipe three fingers to the right to toggle."
msgstr ""
-#: backends/graphics/opengl/opengl-graphics.cpp:126
+#: backends/graphics/opengl/opengl-graphics.cpp:129
msgid "OpenGL"
msgstr "OpenGL"
-#: backends/graphics/opengl/opengl-graphics.cpp:127
+#: backends/graphics/opengl/opengl-graphics.cpp:130
msgid "OpenGL (No filtering)"
msgstr "OpenGL (senza filtri)"
@@ -2173,19 +2173,19 @@ msgctxt "lowres"
msgid "Normal (no scaling)"
msgstr "Normale (no ridim.)"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2357
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2289
msgid "Enabled aspect ratio correction"
msgstr "Correzione proporzioni attivata"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2363
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2295
msgid "Disabled aspect ratio correction"
msgstr "Correzione proporzioni disattivata"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2418
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2349
msgid "Active graphics filter:"
msgstr "Filtro grafico attivo:"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2460
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2390
msgid "Windowed mode"
msgstr "Modalitр finestra"
@@ -2856,7 +2856,7 @@ msgstr ""
msgid ""
"ScummVM found that you have old savefiles for Drascula that should be "
"converted.\n"
-"The old save game format is no longer supported, so you will not be able to "
+"The old saved game format is no longer supported, so you will not be able to "
"load your games if you don't convert them.\n"
"\n"
"Press OK to convert them now, otherwise you will be asked again the next "
@@ -3035,26 +3035,26 @@ msgstr ""
#: engines/kyra/saveload_eob.cpp:557
#, c-format
msgid ""
-"The following original save game file has been found in your game path:\n"
+"The following original saved game file has been found in your game path:\n"
"\n"
"%s %s\n"
"\n"
-"Do you wish to use this save game file with ScummVM?\n"
+"Do you wish to use this saved game file with ScummVM?\n"
"\n"
msgstr ""
#: engines/kyra/saveload_eob.cpp:590
#, c-format
msgid ""
-"A save game file was found in the specified slot %d. Overwrite?\n"
+"A saved game file was found in the specified slot %d. Overwrite?\n"
"\n"
msgstr ""
#: engines/kyra/saveload_eob.cpp:623
#, c-format
msgid ""
-"%d original save game files have been successfully imported into\n"
-"ScummVM. If you want to manually import original save game files later you "
+"%d original saved game files have been successfully imported into\n"
+"ScummVM. If you want to manually import original saved game files later you "
"will\n"
"need to open the ScummVM debug console and use the command "
"'import_savefile'.\n"
@@ -4112,7 +4112,7 @@ msgstr "Scena di intermezzo '%s' non trovata"
msgid ""
"ScummVM found that you have old savefiles for Broken Sword 1 that should be "
"converted.\n"
-"The old save game format is no longer supported, so you will not be able to "
+"The old saved game format is no longer supported, so you will not be able to "
"load your games if you don't convert them.\n"
"\n"
"Press OK to convert them now, otherwise you will be asked again the next "
@@ -4129,8 +4129,8 @@ msgstr ""
#: engines/sword1/control.cpp:1232
#, c-format
msgid ""
-"Target new save game already exists!\n"
-"Would you like to keep the old save game (%s) or the new one (%s)?\n"
+"Target new saved game already exists!\n"
+"Would you like to keep the old saved game (%s) or the new one (%s)?\n"
msgstr ""
"La destinazione del nuovo salvataggio giр esiste!\n"
"Vuoi mantenere il vecchio salvataggio (%s) o quello nuovo (%s)?\n"
diff --git a/po/nb_NO.po b/po/nb_NO.po
index f77802a109..d01e3e8369 100644
--- a/po/nb_NO.po
+++ b/po/nb_NO.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.3.0svn\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n"
-"POT-Creation-Date: 2016-09-05 10:12+0200\n"
+"POT-Creation-Date: 2016-09-18 15:13+0100\n"
"PO-Revision-Date: 2016-02-25 23:42+0100\n"
"Last-Translator: Einar Johan Trјan Sјmхen <einarjohants@gmail.com>\n"
"Language-Team: somaen <einarjohants@gmail.com>\n"
@@ -61,7 +61,7 @@ msgstr "Oppover"
#: gui/recorderdialog.cpp:155 gui/remotebrowser.cpp:59
#: gui/saveload-dialog.cpp:383 gui/saveload-dialog.cpp:443
#: gui/saveload-dialog.cpp:717 gui/saveload-dialog.cpp:1111
-#: gui/storagewizarddialog.cpp:69 gui/themebrowser.cpp:55
+#: gui/storagewizarddialog.cpp:68 gui/themebrowser.cpp:55
#: gui/updates-dialog.cpp:113 engines/engine.cpp:549
#: backends/events/default/default-events.cpp:196
#: backends/events/default/default-events.cpp:218
@@ -116,7 +116,7 @@ msgstr ""
#: gui/downloaddialog.cpp:118 gui/downloaddialog.cpp:152
#: gui/filebrowser-dialog.cpp:132 gui/fluidsynth-dialog.cpp:217
#: gui/launcher.cpp:286 gui/launcher.cpp:394 gui/launcher.cpp:453
-#: gui/storagewizarddialog.cpp:113
+#: gui/storagewizarddialog.cpp:112
#: backends/events/symbiansdl/symbiansdl-events.cpp:186
#: backends/platform/wince/CEActionsPocket.cpp:326
#: backends/platform/wince/CEActionsSmartphone.cpp:287
@@ -128,7 +128,7 @@ msgstr "Ja"
#: gui/downloaddialog.cpp:118 gui/downloaddialog.cpp:153
#: gui/filebrowser-dialog.cpp:132 gui/fluidsynth-dialog.cpp:217
#: gui/launcher.cpp:286 gui/launcher.cpp:394 gui/launcher.cpp:453
-#: gui/storagewizarddialog.cpp:113
+#: gui/storagewizarddialog.cpp:112
#: backends/events/symbiansdl/symbiansdl-events.cpp:186
#: backends/platform/wince/CEActionsPocket.cpp:326
#: backends/platform/wince/CEActionsSmartphone.cpp:287
@@ -408,8 +408,8 @@ msgstr "Velg mappe for lagrede spill"
#: gui/editgamedialog.cpp:510
msgid ""
-"Saves sync feature doesn't work with non-default directories. If you want "
-"your saves to sync, use default directory."
+"Saved games sync feature doesn't work with non-default directories. If you "
+"want your saved games to sync, use default directory."
msgstr ""
#: gui/editgamedialog.cpp:536
@@ -847,7 +847,7 @@ msgid "Special dithering modes supported by some games"
msgstr "Spesiel dithering-modus stјttet av enkelte spill"
#: gui/options.cpp:789
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2458
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2388
msgid "Fullscreen mode"
msgstr "Fullskjermsmodus"
@@ -1175,7 +1175,7 @@ msgid "Used space:"
msgstr ""
#: gui/options.cpp:1311
-msgid "Space used by ScummVM's saves on this storage"
+msgid "Space used by ScummVM's saved games on this storage"
msgstr ""
#: gui/options.cpp:1314
@@ -1183,10 +1183,10 @@ msgid "Last sync time:"
msgstr ""
#: gui/options.cpp:1314
-msgid "When the last saves sync for this storage occured"
+msgid "When the last saved games sync for this storage occured"
msgstr ""
-#: gui/options.cpp:1317 gui/storagewizarddialog.cpp:72
+#: gui/options.cpp:1317 gui/storagewizarddialog.cpp:71
msgid "Connect"
msgstr ""
@@ -1451,7 +1451,7 @@ msgid "New Save"
msgstr "Nytt lagret spill"
#: gui/saveload-dialog.cpp:924
-msgid "Create a new save game"
+msgid "Create a new saved game"
msgstr "Opprett ett nytt lagret spill."
#: gui/saveload-dialog.cpp:1053
@@ -1463,72 +1463,72 @@ msgstr "Navn:"
msgid "Enter a description for slot %d:"
msgstr "Gi en beskrivelse for posisjon %d:"
-#: gui/storagewizarddialog.cpp:56
+#: gui/storagewizarddialog.cpp:55
#, c-format
msgid "%s Storage Connection Wizard"
msgstr ""
-#: gui/storagewizarddialog.cpp:59
+#: gui/storagewizarddialog.cpp:58
msgid "Navigate to the following URL:"
msgstr ""
-#: gui/storagewizarddialog.cpp:62
+#: gui/storagewizarddialog.cpp:61
msgid "Obtain the code from the storage, enter it"
msgstr ""
-#: gui/storagewizarddialog.cpp:63
+#: gui/storagewizarddialog.cpp:62
msgid "in the following field and press 'Connect':"
msgstr ""
-#: gui/storagewizarddialog.cpp:70
+#: gui/storagewizarddialog.cpp:69
#, fuzzy
msgid "Open URL"
msgstr "OpenGL"
-#: gui/storagewizarddialog.cpp:71
+#: gui/storagewizarddialog.cpp:70
msgid "Paste"
msgstr ""
-#: gui/storagewizarddialog.cpp:71
+#: gui/storagewizarddialog.cpp:70
msgid "Pastes clipboard contents into fields"
msgstr ""
-#: gui/storagewizarddialog.cpp:79
+#: gui/storagewizarddialog.cpp:78
msgid "You will be directed to ScummVM's page where"
msgstr ""
-#: gui/storagewizarddialog.cpp:80
+#: gui/storagewizarddialog.cpp:79
msgid "you should allow it to access your storage."
msgstr ""
-#: gui/storagewizarddialog.cpp:113
+#: gui/storagewizarddialog.cpp:112
msgid "Another Storage is active. Do you want to interrupt it?"
msgstr ""
-#: gui/storagewizarddialog.cpp:122
+#: gui/storagewizarddialog.cpp:121
msgid "Wait until current Storage finishes up and try again."
msgstr ""
-#: gui/storagewizarddialog.cpp:183
+#: gui/storagewizarddialog.cpp:182
#, c-format
msgid "Field %s has a mistake in it."
msgstr ""
-#: gui/storagewizarddialog.cpp:185
+#: gui/storagewizarddialog.cpp:184
#, c-format
msgid "Fields %s have mistakes in them."
msgstr ""
-#: gui/storagewizarddialog.cpp:200
+#: gui/storagewizarddialog.cpp:199
msgid "All OK!"
msgstr ""
-#: gui/storagewizarddialog.cpp:202
+#: gui/storagewizarddialog.cpp:201
#, fuzzy
msgid "Invalid code"
msgstr "Ugyldig sti"
-#: gui/storagewizarddialog.cpp:210
+#: gui/storagewizarddialog.cpp:209
msgid ""
"Failed to open URL!\n"
"Please navigate to this page manually."
@@ -1894,8 +1894,8 @@ msgstr ""
#: engines/engine.cpp:546
msgid ""
"WARNING: The game you are about to start is not yet fully supported by "
-"ScummVM. As such, it is likely to be unstable, and any saves you make might "
-"not work in future versions of ScummVM."
+"ScummVM. As such, it is likely to be unstable, and any saved game you make "
+"might not work in future versions of ScummVM."
msgstr ""
"ADVARSEL: Spillet du prјver х starte er ikke fullstendig stјttet av ScummVM. "
"Derfor er det sannsynlig at det vil vцre ustabilt, og det er ikke sikkert at "
@@ -2008,16 +2008,16 @@ msgstr "C64 Lydemulator"
#: backends/cloud/storage.cpp:210
#, fuzzy
-msgid "Saves sync complete."
+msgid "Saved games sync complete."
msgstr "Sјk fullfјrt!"
#: backends/cloud/storage.cpp:221
-msgid "Saves sync was cancelled."
+msgid "Saved games sync was cancelled."
msgstr ""
#: backends/cloud/storage.cpp:223
msgid ""
-"Saves sync failed.\n"
+"Saved games sync failed.\n"
"Check your Internet connection."
msgstr ""
@@ -2139,11 +2139,11 @@ msgstr "Auto-dramodus er nх"
msgid "Swipe three fingers to the right to toggle."
msgstr "Sveip tre fingre til hјyre for х veksle"
-#: backends/graphics/opengl/opengl-graphics.cpp:126
+#: backends/graphics/opengl/opengl-graphics.cpp:129
msgid "OpenGL"
msgstr "OpenGL"
-#: backends/graphics/opengl/opengl-graphics.cpp:127
+#: backends/graphics/opengl/opengl-graphics.cpp:130
msgid "OpenGL (No filtering)"
msgstr "OpenGL (Ingen filtrering)"
@@ -2158,19 +2158,19 @@ msgctxt "lowres"
msgid "Normal (no scaling)"
msgstr "Normal (ingen skalering)"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2357
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2289
msgid "Enabled aspect ratio correction"
msgstr "Aspekt-rate korrigering aktivert"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2363
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2295
msgid "Disabled aspect ratio correction"
msgstr "Aspekt-rate korrigering deaktivert"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2418
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2349
msgid "Active graphics filter:"
msgstr "Aktivt grafikkfilter:"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2460
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2390
msgid "Windowed mode"
msgstr "Vindusmodus"
@@ -2839,7 +2839,7 @@ msgstr "Aktiver fargeblindmodus som standard"
msgid ""
"ScummVM found that you have old savefiles for Drascula that should be "
"converted.\n"
-"The old save game format is no longer supported, so you will not be able to "
+"The old saved game format is no longer supported, so you will not be able to "
"load your games if you don't convert them.\n"
"\n"
"Press OK to convert them now, otherwise you will be asked again the next "
@@ -3018,11 +3018,11 @@ msgstr ""
#: engines/kyra/saveload_eob.cpp:557
#, c-format
msgid ""
-"The following original save game file has been found in your game path:\n"
+"The following original saved game file has been found in your game path:\n"
"\n"
"%s %s\n"
"\n"
-"Do you wish to use this save game file with ScummVM?\n"
+"Do you wish to use this saved game file with ScummVM?\n"
"\n"
msgstr ""
"Det fјlgende originale lagrede spillet ble funnet i spillstien din:\n"
@@ -3035,7 +3035,7 @@ msgstr ""
#: engines/kyra/saveload_eob.cpp:590
#, c-format
msgid ""
-"A save game file was found in the specified slot %d. Overwrite?\n"
+"A saved game file was found in the specified slot %d. Overwrite?\n"
"\n"
msgstr ""
"Et lagret spill ble funnet i den valgte posisjonen %d. Overskrive?\n"
@@ -3044,8 +3044,8 @@ msgstr ""
#: engines/kyra/saveload_eob.cpp:623
#, c-format
msgid ""
-"%d original save game files have been successfully imported into\n"
-"ScummVM. If you want to manually import original save game files later you "
+"%d original saved game files have been successfully imported into\n"
+"ScummVM. If you want to manually import original saved game files later you "
"will\n"
"need to open the ScummVM debug console and use the command "
"'import_savefile'.\n"
@@ -4094,7 +4094,7 @@ msgstr "Fant ikke cutscene '%s'"
msgid ""
"ScummVM found that you have old savefiles for Broken Sword 1 that should be "
"converted.\n"
-"The old save game format is no longer supported, so you will not be able to "
+"The old saved game format is no longer supported, so you will not be able to "
"load your games if you don't convert them.\n"
"\n"
"Press OK to convert them now, otherwise you will be asked again the next "
@@ -4111,8 +4111,8 @@ msgstr ""
#: engines/sword1/control.cpp:1232
#, c-format
msgid ""
-"Target new save game already exists!\n"
-"Would you like to keep the old save game (%s) or the new one (%s)?\n"
+"Target new saved game already exists!\n"
+"Would you like to keep the old saved game (%s) or the new one (%s)?\n"
msgstr ""
"Valgt plass for lagret spill eksisterer allerede!\n"
"Vil du ta vare pх den gamle lagringen (%s) eller den nye (%s)?\n"
diff --git a/po/nl_NL.po b/po/nl_NL.po
index bb6f59d77f..0568533c3a 100644
--- a/po/nl_NL.po
+++ b/po/nl_NL.po
@@ -7,15 +7,15 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.9.0git\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n"
-"POT-Creation-Date: 2016-09-05 10:12+0200\n"
-"PO-Revision-Date: 2016-07-05 10:07+0200\n"
+"POT-Creation-Date: 2016-09-18 15:13+0100\n"
+"PO-Revision-Date: 2016-09-15 10:55+0200\n"
"Last-Translator: Ben Castricum <scummvm@bencastricum.nl>\n"
"Language-Team: Ben Castricum <scummvm@bencastricum.nl>\n"
"Language: Nederlands\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=iso-8859-1\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Generator: Poedit 1.8.8\n"
+"X-Generator: Poedit 1.8.9\n"
"X-Poedit-SourceCharset: iso-8859-1\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
@@ -61,7 +61,7 @@ msgstr "Ga omhoog"
#: gui/recorderdialog.cpp:155 gui/remotebrowser.cpp:59
#: gui/saveload-dialog.cpp:383 gui/saveload-dialog.cpp:443
#: gui/saveload-dialog.cpp:717 gui/saveload-dialog.cpp:1111
-#: gui/storagewizarddialog.cpp:69 gui/themebrowser.cpp:55
+#: gui/storagewizarddialog.cpp:68 gui/themebrowser.cpp:55
#: gui/updates-dialog.cpp:113 engines/engine.cpp:549
#: backends/events/default/default-events.cpp:196
#: backends/events/default/default-events.cpp:218
@@ -78,9 +78,8 @@ msgid "Choose"
msgstr "Selecteer"
#: gui/downloaddialog.cpp:48
-#, fuzzy
msgid "Select directory where to download game data"
-msgstr "Selecteer map met speldata"
+msgstr "Selecteer map voor de te downloaden speldata"
#: gui/downloaddialog.cpp:49 gui/editgamedialog.cpp:472 gui/launcher.cpp:173
msgid "Select directory with game data"
@@ -88,35 +87,35 @@ msgstr "Selecteer map met speldata"
#: gui/downloaddialog.cpp:51 gui/downloaddialog.cpp:263
msgid "From: "
-msgstr ""
+msgstr "Van: "
#: gui/downloaddialog.cpp:52 gui/downloaddialog.cpp:264
msgid "To: "
-msgstr ""
+msgstr "Naar:"
#: gui/downloaddialog.cpp:63
msgid "Cancel download"
-msgstr ""
+msgstr "Download annuleren"
#: gui/downloaddialog.cpp:65
msgctxt "lowres"
msgid "Cancel download"
-msgstr ""
+msgstr "Download annuleren"
#: gui/downloaddialog.cpp:67
msgid "Hide"
-msgstr ""
+msgstr "Verberg"
#: gui/downloaddialog.cpp:117
msgid ""
"It looks like your connection is limited. Do you really want to download "
"files with it?"
-msgstr ""
+msgstr "Uw verbinding lijkt beperkt. Wilt u echt bestanden ermee downloaden?"
#: gui/downloaddialog.cpp:118 gui/downloaddialog.cpp:152
#: gui/filebrowser-dialog.cpp:132 gui/fluidsynth-dialog.cpp:217
#: gui/launcher.cpp:286 gui/launcher.cpp:394 gui/launcher.cpp:453
-#: gui/storagewizarddialog.cpp:113
+#: gui/storagewizarddialog.cpp:112
#: backends/events/symbiansdl/symbiansdl-events.cpp:186
#: backends/platform/wince/CEActionsPocket.cpp:326
#: backends/platform/wince/CEActionsSmartphone.cpp:287
@@ -128,7 +127,7 @@ msgstr "Ja"
#: gui/downloaddialog.cpp:118 gui/downloaddialog.cpp:153
#: gui/filebrowser-dialog.cpp:132 gui/fluidsynth-dialog.cpp:217
#: gui/launcher.cpp:286 gui/launcher.cpp:394 gui/launcher.cpp:453
-#: gui/storagewizarddialog.cpp:113
+#: gui/storagewizarddialog.cpp:112
#: backends/events/symbiansdl/symbiansdl-events.cpp:186
#: backends/platform/wince/CEActionsPocket.cpp:326
#: backends/platform/wince/CEActionsSmartphone.cpp:287
@@ -146,6 +145,8 @@ msgid ""
"Cannot create a directory to download - the specified directory has a file "
"with the same name."
msgstr ""
+"Kan geen download folder creыren - de gespecificeerde folder bevat een file "
+"met dezelfde naam."
#: gui/downloaddialog.cpp:146 gui/editgamedialog.cpp:293
#: gui/fluidsynth-dialog.cpp:153 gui/KeysDialog.cpp:42 gui/launcher.cpp:501
@@ -173,16 +174,18 @@ msgid ""
"The \"%s\" already exists in the specified directory.\n"
"Do you really want to download files into that directory?"
msgstr ""
+"De \"%s\" bestaat al in de gespecificeerde map.\n"
+"Wilt u echt bestanden in die map downloaden?"
#: gui/downloaddialog.cpp:251
#, c-format
msgid "Downloaded %s %s / %s %s"
-msgstr ""
+msgstr "%s %s / %s %s gedownload"
#: gui/downloaddialog.cpp:258
-#, fuzzy, c-format
+#, c-format
msgid "Download speed: %s %s"
-msgstr "Klaar met zoeken!"
+msgstr "Download snelheid: %s %s"
#: gui/editgamedialog.cpp:132
msgid "Game"
@@ -408,9 +411,12 @@ msgstr "Selecteer map voor opgeslagen spellen"
#: gui/editgamedialog.cpp:510
msgid ""
-"Saves sync feature doesn't work with non-default directories. If you want "
-"your saves to sync, use default directory."
+"Saved games sync feature doesn't work with non-default directories. If you "
+"want your saved games to sync, use default directory."
msgstr ""
+"Synchronisatie van opgeslagen spellen optie werkt niet met niet-standaard "
+"mappen. Als u de opgeslagen spellen wilt synchroniseren, gebruik dan de "
+"standaard map."
#: gui/editgamedialog.cpp:536
msgid "This game ID is already taken. Please choose another one."
@@ -699,7 +705,7 @@ msgstr ""
#: gui/launcher.cpp:344
msgid "This directory cannot be used yet, it is being downloaded into!"
-msgstr ""
+msgstr "Deze map kan nog niet gebruikt worden, er wordt al in gedownload!"
#: gui/launcher.cpp:394
msgid "Do you really want to remove this game configuration?"
@@ -853,7 +859,7 @@ msgid "Special dithering modes supported by some games"
msgstr "Speciale ditheringmodi die door sommige games ondersteund worden."
#: gui/options.cpp:789
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2458
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2388
msgid "Fullscreen mode"
msgstr "Volledig-scherm modus"
@@ -1153,24 +1159,24 @@ msgstr "Controleer nu"
#: gui/options.cpp:1284
msgid "Cloud"
-msgstr ""
+msgstr "Cloud"
#: gui/options.cpp:1286
msgctxt "lowres"
msgid "Cloud"
-msgstr ""
+msgstr "Cloud"
#: gui/options.cpp:1297
msgid "Storage:"
-msgstr ""
+msgstr "Opslag:"
#: gui/options.cpp:1297
msgid "Active cloud storage"
-msgstr ""
+msgstr "Actieve cloud opslag"
#: gui/options.cpp:1304 gui/options.cpp:1855
msgid "<none>"
-msgstr ""
+msgstr "<geen>"
#: gui/options.cpp:1308 backends/platform/wii/options.cpp:114
msgid "Username:"
@@ -1178,101 +1184,97 @@ msgstr "Gebruikersnaam:"
#: gui/options.cpp:1308
msgid "Username used by this storage"
-msgstr ""
+msgstr "Gebruikersnaam gebruikt voor deze opslag"
#: gui/options.cpp:1311
msgid "Used space:"
-msgstr ""
+msgstr "Gebruikte ruimte:"
#: gui/options.cpp:1311
-msgid "Space used by ScummVM's saves on this storage"
-msgstr ""
+msgid "Space used by ScummVM's saved games on this storage"
+msgstr "Ruimte in gebruikt door ScummVM's opgeslagen spellen op deze opslag"
#: gui/options.cpp:1314
msgid "Last sync time:"
-msgstr ""
+msgstr "Laatste synchronisatie:"
#: gui/options.cpp:1314
-msgid "When the last saves sync for this storage occured"
-msgstr ""
+msgid "When the last saved games sync for this storage occured"
+msgstr "Wanneer de laatste synchronisatie voor deze opslag is geweest."
-#: gui/options.cpp:1317 gui/storagewizarddialog.cpp:72
+#: gui/options.cpp:1317 gui/storagewizarddialog.cpp:71
msgid "Connect"
-msgstr ""
+msgstr "Verbinden"
#: gui/options.cpp:1317
msgid "Open wizard dialog to connect your cloud storage account"
msgstr ""
+"Open de Wizard dialoogvenster voor verbinden met uw cloud opslag account"
#: gui/options.cpp:1318
msgid "Refresh"
-msgstr ""
+msgstr "Ververs"
#: gui/options.cpp:1318
msgid "Refresh current cloud storage information (username and usage)"
-msgstr ""
+msgstr "Ververs de huidige opslag informatie (gebruikersnaam en gebruik)"
#: gui/options.cpp:1319
-#, fuzzy
msgid "Download"
-msgstr "Omlaag"
+msgstr "Download"
#: gui/options.cpp:1319
msgid "Open downloads manager dialog"
-msgstr ""
+msgstr "Open downloads manager dialoogvenster"
#: gui/options.cpp:1321
msgid "Run server"
-msgstr ""
+msgstr "Start server"
#: gui/options.cpp:1321
msgid "Run local webserver"
-msgstr ""
+msgstr "Draai lokale webserver"
#: gui/options.cpp:1322 gui/options.cpp:1965
-#, fuzzy
msgid "Not running"
-msgstr "Fout tijdens het starten van spel:"
+msgstr "Draait niet"
#: gui/options.cpp:1326
-#, fuzzy
msgid "/root/ Path:"
-msgstr "Extra Pad:"
+msgstr "/root/ Pad:"
#: gui/options.cpp:1326 gui/options.cpp:1328 gui/options.cpp:1329
-#, fuzzy
msgid "Specifies which directory the Files Manager can access"
-msgstr "Bepaalt waar opgeslagen spellen worden bewaard."
+msgstr "Bepaalt welke map de Bestanden Manager gebruiken mag"
#: gui/options.cpp:1328
-#, fuzzy
msgctxt "lowres"
msgid "/root/ Path:"
-msgstr "Extra Pad:"
+msgstr "/root/ Pad:"
#: gui/options.cpp:1338
-#, fuzzy
msgid "Server's port:"
-msgstr "Server:"
+msgstr "Serverport:"
#: gui/options.cpp:1338
msgid ""
"Which port is used by the server\n"
"Auth with server is not available with non-default port"
msgstr ""
+"Welke port is gebruikt voor de server\n"
+"Auth met server is niet beschikbaar met een niet standaard port"
#: gui/options.cpp:1498
msgid "You have to restart ScummVM before your changes will take effect."
msgstr "U dient ScummVM opnieuw op te starten om de wijzigingen te activeren."
#: gui/options.cpp:1521
-#, fuzzy
msgid "Failed to change cloud storage!"
-msgstr "Opslaan van spel mislukt."
+msgstr "Veranderen van cloud opslag mislukt!"
#: gui/options.cpp:1524
msgid "Another cloud storage is already active."
-msgstr ""
+msgstr "Er is al een andere cloud opslag actief."
#: gui/options.cpp:1562
msgid "The chosen directory cannot be written to. Please select another one."
@@ -1292,9 +1294,8 @@ msgid "Select directory for plugins"
msgstr "Selecteer map voor plugins"
#: gui/options.cpp:1604
-#, fuzzy
msgid "Select directory for Files Manager /root/"
-msgstr "Selecteer map voor extra bestanden"
+msgstr "Selecteer map voor Bestanden Manager /root/"
#: gui/options.cpp:1666
msgid ""
@@ -1307,31 +1308,29 @@ msgstr ""
#: gui/options.cpp:1862
#, c-format
msgid "%llu bytes"
-msgstr ""
+msgstr "%llu bytes"
#: gui/options.cpp:1870
msgid "<right now>"
-msgstr ""
+msgstr "<nu>"
#: gui/options.cpp:1872
-#, fuzzy
msgid "<never>"
-msgstr "Nooit"
+msgstr "<nooit>"
#: gui/options.cpp:1956
-#, fuzzy
msgid "Stop server"
-msgstr "Server:"
+msgstr "Stop server"
#: gui/options.cpp:1957
msgid "Stop local webserver"
-msgstr ""
+msgstr "Stop lokale webserver"
#: gui/options.cpp:2046
msgid ""
"Request failed.\n"
"Check your Internet connection."
-msgstr ""
+msgstr "Verzoek mislukt. Controleer uw Internet verbinding."
#. I18N: You must leave "#" as is, only word 'next' is translatable
#: gui/predictivedialog.cpp:86
@@ -1405,7 +1404,6 @@ msgid "Unknown Author"
msgstr "Onbekende Auteur"
#: gui/remotebrowser.cpp:128
-#, fuzzy
msgid "ScummVM could not access the directory!"
msgstr "ScummVM kon de opgegeven map niet openen!"
@@ -1462,7 +1460,7 @@ msgid "New Save"
msgstr "Nieuw spel opslaan"
#: gui/saveload-dialog.cpp:924
-msgid "Create a new save game"
+msgid "Create a new saved game"
msgstr "Nieuw spel opslaan"
#: gui/saveload-dialog.cpp:1053
@@ -1474,75 +1472,74 @@ msgstr "Naam: "
msgid "Enter a description for slot %d:"
msgstr "Geef een omschrijving voor slot %d:"
-#: gui/storagewizarddialog.cpp:56
+#: gui/storagewizarddialog.cpp:55
#, c-format
msgid "%s Storage Connection Wizard"
-msgstr ""
+msgstr "%s Opslag Verbindings Wizard"
-#: gui/storagewizarddialog.cpp:59
+#: gui/storagewizarddialog.cpp:58
msgid "Navigate to the following URL:"
-msgstr ""
+msgstr "Navigeer naar de volgende URL:"
-#: gui/storagewizarddialog.cpp:62
+#: gui/storagewizarddialog.cpp:61
msgid "Obtain the code from the storage, enter it"
-msgstr ""
+msgstr "Verkrijg de code van de opslag, voer het in"
-#: gui/storagewizarddialog.cpp:63
+#: gui/storagewizarddialog.cpp:62
msgid "in the following field and press 'Connect':"
-msgstr ""
+msgstr "in het volgende veld, en druk op 'Verbind';"
-#: gui/storagewizarddialog.cpp:70
-#, fuzzy
+#: gui/storagewizarddialog.cpp:69
msgid "Open URL"
-msgstr "OpenGL"
+msgstr "Open URL"
-#: gui/storagewizarddialog.cpp:71
+#: gui/storagewizarddialog.cpp:70
msgid "Paste"
-msgstr ""
+msgstr "Plakken"
-#: gui/storagewizarddialog.cpp:71
+#: gui/storagewizarddialog.cpp:70
msgid "Pastes clipboard contents into fields"
-msgstr ""
+msgstr "Pakt de inhoud van het clipboard in the velden"
-#: gui/storagewizarddialog.cpp:79
+#: gui/storagewizarddialog.cpp:78
msgid "You will be directed to ScummVM's page where"
-msgstr ""
+msgstr "U wordt doorgestuurd naar ScummVM's pagina waar"
-#: gui/storagewizarddialog.cpp:80
+#: gui/storagewizarddialog.cpp:79
msgid "you should allow it to access your storage."
-msgstr ""
+msgstr "u zou het toegang moeten geven tot uw opslag"
-#: gui/storagewizarddialog.cpp:113
+#: gui/storagewizarddialog.cpp:112
msgid "Another Storage is active. Do you want to interrupt it?"
-msgstr ""
+msgstr "Een andere opslag is actief. Wilt u die onderbreken?"
-#: gui/storagewizarddialog.cpp:122
+#: gui/storagewizarddialog.cpp:121
msgid "Wait until current Storage finishes up and try again."
-msgstr ""
+msgstr "Wacht totdat de huidige opslag klaar is en probeer het opnieuw."
-#: gui/storagewizarddialog.cpp:183
+#: gui/storagewizarddialog.cpp:182
#, c-format
msgid "Field %s has a mistake in it."
-msgstr ""
+msgstr "Er zit een fout in veld %s."
-#: gui/storagewizarddialog.cpp:185
+#: gui/storagewizarddialog.cpp:184
#, c-format
msgid "Fields %s have mistakes in them."
-msgstr ""
+msgstr "Er zitten fouten in de velden %s."
-#: gui/storagewizarddialog.cpp:200
+#: gui/storagewizarddialog.cpp:199
msgid "All OK!"
-msgstr ""
+msgstr "Alles OK!"
-#: gui/storagewizarddialog.cpp:202
+#: gui/storagewizarddialog.cpp:201
msgid "Invalid code"
-msgstr ""
+msgstr "Ongeldige code"
-#: gui/storagewizarddialog.cpp:210
+#: gui/storagewizarddialog.cpp:209
msgid ""
"Failed to open URL!\n"
"Please navigate to this page manually."
-msgstr ""
+msgstr "URL openen mislukt! Navigeer a.u.b. handmatig naar deze pagina."
#: gui/themebrowser.cpp:45
msgid "Select a Theme"
@@ -1909,8 +1906,8 @@ msgstr ""
#: engines/engine.cpp:546
msgid ""
"WARNING: The game you are about to start is not yet fully supported by "
-"ScummVM. As such, it is likely to be unstable, and any saves you make might "
-"not work in future versions of ScummVM."
+"ScummVM. As such, it is likely to be unstable, and any saved game you make "
+"might not work in future versions of ScummVM."
msgstr ""
"WAARSCHUWING: Het spel dat u wilt gaan spelen is nog niet volledig "
"ondersteund door ScummVM. Om die reden is het waarschijnlijk dat het spel "
@@ -2023,19 +2020,20 @@ msgid "C64 Audio Emulator"
msgstr "C64 Audio Emulator"
#: backends/cloud/storage.cpp:210
-#, fuzzy
-msgid "Saves sync complete."
-msgstr "Klaar met zoeken!"
+msgid "Saved games sync complete."
+msgstr "Klaar met synchronisatie van opgeslagen spellen."
#: backends/cloud/storage.cpp:221
-msgid "Saves sync was cancelled."
-msgstr ""
+msgid "Saved games sync was cancelled."
+msgstr "Synchronisatie van opgeslagen spellen was geannuleerd."
#: backends/cloud/storage.cpp:223
msgid ""
-"Saves sync failed.\n"
+"Saved games sync failed.\n"
"Check your Internet connection."
msgstr ""
+"Synchronisatie van opgeslagen spellen is mislukt.\n"
+"Controleer a.u.b. uw Internet verbinding."
#: backends/cloud/storage.cpp:327
#, c-format
@@ -2043,16 +2041,16 @@ msgid ""
"Download complete.\n"
"Failed to download %u files."
msgstr ""
+"Download klaar.\n"
+"%u bestanden konden niet gedownload worden."
#: backends/cloud/storage.cpp:329
-#, fuzzy
msgid "Download complete."
-msgstr "Klaar met zoeken!"
+msgstr "Download klaar."
#: backends/cloud/storage.cpp:339
-#, fuzzy
msgid "Download failed."
-msgstr "Laad bestand"
+msgstr "Download mislukt."
#: backends/events/default/default-events.cpp:196
msgid "Do you really want to return to the Launcher?"
@@ -2155,11 +2153,11 @@ msgstr "Auto-sleep modus is nu"
msgid "Swipe three fingers to the right to toggle."
msgstr "Swipe drie vingers naar rechts om te schakelen."
-#: backends/graphics/opengl/opengl-graphics.cpp:126
+#: backends/graphics/opengl/opengl-graphics.cpp:129
msgid "OpenGL"
msgstr "OpenGL"
-#: backends/graphics/opengl/opengl-graphics.cpp:127
+#: backends/graphics/opengl/opengl-graphics.cpp:130
msgid "OpenGL (No filtering)"
msgstr "OpenGL (geen filters)"
@@ -2174,19 +2172,19 @@ msgctxt "lowres"
msgid "Normal (no scaling)"
msgstr "Normaal (niet schalen)"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2357
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2289
msgid "Enabled aspect ratio correction"
msgstr "Pixelverhoudingcorrectie ingeschakeld"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2363
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2295
msgid "Disabled aspect ratio correction"
msgstr "Pixelverhoudingcorrectie uitgeschakeld"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2418
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2349
msgid "Active graphics filter:"
msgstr "Actieve grafische filter:"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2460
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2390
msgid "Windowed mode"
msgstr "Venstermodus"
@@ -2859,7 +2857,7 @@ msgstr "Schakel Kleurenblind modus standaard in"
msgid ""
"ScummVM found that you have old savefiles for Drascula that should be "
"converted.\n"
-"The old save game format is no longer supported, so you will not be able to "
+"The old saved game format is no longer supported, so you will not be able to "
"load your games if you don't convert them.\n"
"\n"
"Press OK to convert them now, otherwise you will be asked again the next "
@@ -3037,11 +3035,11 @@ msgstr ""
#: engines/kyra/saveload_eob.cpp:557
#, c-format
msgid ""
-"The following original save game file has been found in your game path:\n"
+"The following original saved game file has been found in your game path:\n"
"\n"
"%s %s\n"
"\n"
-"Do you wish to use this save game file with ScummVM?\n"
+"Do you wish to use this saved game file with ScummVM?\n"
"\n"
msgstr ""
"Het volgende originele opgeslagen spel was gevonden in uw spel pad:\n"
@@ -3054,7 +3052,7 @@ msgstr ""
#: engines/kyra/saveload_eob.cpp:590
#, c-format
msgid ""
-"A save game file was found in the specified slot %d. Overwrite?\n"
+"A saved game file was found in the specified slot %d. Overwrite?\n"
"\n"
msgstr ""
"Er is al een opgeslagen spel in slot %d. Deze overschrijven?\n"
@@ -3063,8 +3061,8 @@ msgstr ""
#: engines/kyra/saveload_eob.cpp:623
#, c-format
msgid ""
-"%d original save game files have been successfully imported into\n"
-"ScummVM. If you want to manually import original save game files later you "
+"%d original saved game files have been successfully imported into\n"
+"ScummVM. If you want to manually import original saved game files later you "
"will\n"
"need to open the ScummVM debug console and use the command "
"'import_savefile'.\n"
@@ -3252,11 +3250,12 @@ msgstr "Gebruik hoge resolutie beelden"
#: engines/sci/detection.cpp:410
msgid "Enable black-lined video"
-msgstr ""
+msgstr "Activeer black-lined video"
#: engines/sci/detection.cpp:411
msgid "Draw black lines over videos to increase their apparent sharpness"
msgstr ""
+"Teken zwarte lijntjes over videos om de scherpte ogenschijnlijk te verhogen"
#: engines/sci/detection.cpp:420
msgid "Prefer digital sound effects"
@@ -4121,7 +4120,7 @@ msgstr "Cutscene '%s' niet gevonden"
msgid ""
"ScummVM found that you have old savefiles for Broken Sword 1 that should be "
"converted.\n"
-"The old save game format is no longer supported, so you will not be able to "
+"The old saved game format is no longer supported, so you will not be able to "
"load your games if you don't convert them.\n"
"\n"
"Press OK to convert them now, otherwise you will be asked again the next "
@@ -4138,8 +4137,8 @@ msgstr ""
#: engines/sword1/control.cpp:1232
#, c-format
msgid ""
-"Target new save game already exists!\n"
-"Would you like to keep the old save game (%s) or the new one (%s)?\n"
+"Target new saved game already exists!\n"
+"Would you like to keep the old saved game (%s) or the new one (%s)?\n"
msgstr ""
"Bestand voor het nieuwe opgeslagen spel bestaat al!\n"
"Wilt u het oude opgeslagen spel (%s) of de nieuwe (%s) behouden?\n"
diff --git a/po/nn_NO.po b/po/nn_NO.po
index 7ca09897aa..188fd64fc6 100644
--- a/po/nn_NO.po
+++ b/po/nn_NO.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.3.0svn\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n"
-"POT-Creation-Date: 2016-09-05 10:12+0200\n"
+"POT-Creation-Date: 2016-09-18 15:13+0100\n"
"PO-Revision-Date: 2016-02-26 00:37+0100\n"
"Last-Translator: Einar Johan TrУИan SУИmУЅen <einarjohants@gmail.com>\n"
"Language-Team: somaen <einarjohants@gmail.com>\n"
@@ -61,7 +61,7 @@ msgstr "Oppover"
#: gui/recorderdialog.cpp:155 gui/remotebrowser.cpp:59
#: gui/saveload-dialog.cpp:383 gui/saveload-dialog.cpp:443
#: gui/saveload-dialog.cpp:717 gui/saveload-dialog.cpp:1111
-#: gui/storagewizarddialog.cpp:69 gui/themebrowser.cpp:55
+#: gui/storagewizarddialog.cpp:68 gui/themebrowser.cpp:55
#: gui/updates-dialog.cpp:113 engines/engine.cpp:549
#: backends/events/default/default-events.cpp:196
#: backends/events/default/default-events.cpp:218
@@ -116,7 +116,7 @@ msgstr ""
#: gui/downloaddialog.cpp:118 gui/downloaddialog.cpp:152
#: gui/filebrowser-dialog.cpp:132 gui/fluidsynth-dialog.cpp:217
#: gui/launcher.cpp:286 gui/launcher.cpp:394 gui/launcher.cpp:453
-#: gui/storagewizarddialog.cpp:113
+#: gui/storagewizarddialog.cpp:112
#: backends/events/symbiansdl/symbiansdl-events.cpp:186
#: backends/platform/wince/CEActionsPocket.cpp:326
#: backends/platform/wince/CEActionsSmartphone.cpp:287
@@ -128,7 +128,7 @@ msgstr "Ja"
#: gui/downloaddialog.cpp:118 gui/downloaddialog.cpp:153
#: gui/filebrowser-dialog.cpp:132 gui/fluidsynth-dialog.cpp:217
#: gui/launcher.cpp:286 gui/launcher.cpp:394 gui/launcher.cpp:453
-#: gui/storagewizarddialog.cpp:113
+#: gui/storagewizarddialog.cpp:112
#: backends/events/symbiansdl/symbiansdl-events.cpp:186
#: backends/platform/wince/CEActionsPocket.cpp:326
#: backends/platform/wince/CEActionsSmartphone.cpp:287
@@ -408,8 +408,8 @@ msgstr "Vel mappe for lagra spel"
#: gui/editgamedialog.cpp:510
msgid ""
-"Saves sync feature doesn't work with non-default directories. If you want "
-"your saves to sync, use default directory."
+"Saved games sync feature doesn't work with non-default directories. If you "
+"want your saved games to sync, use default directory."
msgstr ""
#: gui/editgamedialog.cpp:536
@@ -845,7 +845,7 @@ msgid "Special dithering modes supported by some games"
msgstr "Spesielle dithering-modus som stјttast av nokre spel"
#: gui/options.cpp:789
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2458
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2388
msgid "Fullscreen mode"
msgstr "Fullskjermsmodus"
@@ -1171,7 +1171,7 @@ msgid "Used space:"
msgstr ""
#: gui/options.cpp:1311
-msgid "Space used by ScummVM's saves on this storage"
+msgid "Space used by ScummVM's saved games on this storage"
msgstr ""
#: gui/options.cpp:1314
@@ -1179,10 +1179,10 @@ msgid "Last sync time:"
msgstr ""
#: gui/options.cpp:1314
-msgid "When the last saves sync for this storage occured"
+msgid "When the last saved games sync for this storage occured"
msgstr ""
-#: gui/options.cpp:1317 gui/storagewizarddialog.cpp:72
+#: gui/options.cpp:1317 gui/storagewizarddialog.cpp:71
msgid "Connect"
msgstr ""
@@ -1447,7 +1447,7 @@ msgid "New Save"
msgstr "Ny Lagring"
#: gui/saveload-dialog.cpp:924
-msgid "Create a new save game"
+msgid "Create a new saved game"
msgstr "Lag eit nytt lagra spel"
#: gui/saveload-dialog.cpp:1053
@@ -1459,72 +1459,72 @@ msgstr "Namn:"
msgid "Enter a description for slot %d:"
msgstr ""
-#: gui/storagewizarddialog.cpp:56
+#: gui/storagewizarddialog.cpp:55
#, c-format
msgid "%s Storage Connection Wizard"
msgstr ""
-#: gui/storagewizarddialog.cpp:59
+#: gui/storagewizarddialog.cpp:58
msgid "Navigate to the following URL:"
msgstr ""
-#: gui/storagewizarddialog.cpp:62
+#: gui/storagewizarddialog.cpp:61
msgid "Obtain the code from the storage, enter it"
msgstr ""
-#: gui/storagewizarddialog.cpp:63
+#: gui/storagewizarddialog.cpp:62
msgid "in the following field and press 'Connect':"
msgstr ""
-#: gui/storagewizarddialog.cpp:70
+#: gui/storagewizarddialog.cpp:69
#, fuzzy
msgid "Open URL"
msgstr "OpenGL"
-#: gui/storagewizarddialog.cpp:71
+#: gui/storagewizarddialog.cpp:70
msgid "Paste"
msgstr ""
-#: gui/storagewizarddialog.cpp:71
+#: gui/storagewizarddialog.cpp:70
msgid "Pastes clipboard contents into fields"
msgstr ""
-#: gui/storagewizarddialog.cpp:79
+#: gui/storagewizarddialog.cpp:78
msgid "You will be directed to ScummVM's page where"
msgstr ""
-#: gui/storagewizarddialog.cpp:80
+#: gui/storagewizarddialog.cpp:79
msgid "you should allow it to access your storage."
msgstr ""
-#: gui/storagewizarddialog.cpp:113
+#: gui/storagewizarddialog.cpp:112
msgid "Another Storage is active. Do you want to interrupt it?"
msgstr ""
-#: gui/storagewizarddialog.cpp:122
+#: gui/storagewizarddialog.cpp:121
msgid "Wait until current Storage finishes up and try again."
msgstr ""
-#: gui/storagewizarddialog.cpp:183
+#: gui/storagewizarddialog.cpp:182
#, c-format
msgid "Field %s has a mistake in it."
msgstr ""
-#: gui/storagewizarddialog.cpp:185
+#: gui/storagewizarddialog.cpp:184
#, c-format
msgid "Fields %s have mistakes in them."
msgstr ""
-#: gui/storagewizarddialog.cpp:200
+#: gui/storagewizarddialog.cpp:199
msgid "All OK!"
msgstr ""
-#: gui/storagewizarddialog.cpp:202
+#: gui/storagewizarddialog.cpp:201
#, fuzzy
msgid "Invalid code"
msgstr "Ugyldig sti"
-#: gui/storagewizarddialog.cpp:210
+#: gui/storagewizarddialog.cpp:209
msgid ""
"Failed to open URL!\n"
"Please navigate to this page manually."
@@ -1887,8 +1887,8 @@ msgstr ""
#: engines/engine.cpp:546
msgid ""
"WARNING: The game you are about to start is not yet fully supported by "
-"ScummVM. As such, it is likely to be unstable, and any saves you make might "
-"not work in future versions of ScummVM."
+"ScummVM. As such, it is likely to be unstable, and any saved game you make "
+"might not work in future versions of ScummVM."
msgstr ""
"ХTVARING: Spelet du forsјker х starte er ikkje fullt ut stјtta av ScummVM "
"ennх. Derfor er det sannsynleg at det er ustabilt, og det er mogleg at lagra "
@@ -2001,16 +2001,16 @@ msgstr "C64 Lydemulator"
#: backends/cloud/storage.cpp:210
#, fuzzy
-msgid "Saves sync complete."
+msgid "Saved games sync complete."
msgstr "Sјk fullfјrt!"
#: backends/cloud/storage.cpp:221
-msgid "Saves sync was cancelled."
+msgid "Saved games sync was cancelled."
msgstr ""
#: backends/cloud/storage.cpp:223
msgid ""
-"Saves sync failed.\n"
+"Saved games sync failed.\n"
"Check your Internet connection."
msgstr ""
@@ -2132,11 +2132,11 @@ msgstr ""
msgid "Swipe three fingers to the right to toggle."
msgstr "Sveip tre fingre til hјgre for х veksle"
-#: backends/graphics/opengl/opengl-graphics.cpp:126
+#: backends/graphics/opengl/opengl-graphics.cpp:129
msgid "OpenGL"
msgstr "OpenGL"
-#: backends/graphics/opengl/opengl-graphics.cpp:127
+#: backends/graphics/opengl/opengl-graphics.cpp:130
msgid "OpenGL (No filtering)"
msgstr "OpenGL (Ingen filtrering)"
@@ -2151,19 +2151,19 @@ msgctxt "lowres"
msgid "Normal (no scaling)"
msgstr "Normal (ikkje skaler)"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2357
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2289
msgid "Enabled aspect ratio correction"
msgstr "Aspekt-korrigering aktivert"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2363
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2295
msgid "Disabled aspect ratio correction"
msgstr "Aspekt-korrigering ikkje aktivert"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2418
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2349
msgid "Active graphics filter:"
msgstr "Aktivt grafikkfilter:"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2460
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2390
msgid "Windowed mode"
msgstr "Vindusmodus"
@@ -2818,7 +2818,7 @@ msgstr "Slх pх fargeblindmodus som standard"
msgid ""
"ScummVM found that you have old savefiles for Drascula that should be "
"converted.\n"
-"The old save game format is no longer supported, so you will not be able to "
+"The old saved game format is no longer supported, so you will not be able to "
"load your games if you don't convert them.\n"
"\n"
"Press OK to convert them now, otherwise you will be asked again the next "
@@ -2992,26 +2992,26 @@ msgstr ""
#: engines/kyra/saveload_eob.cpp:557
#, c-format
msgid ""
-"The following original save game file has been found in your game path:\n"
+"The following original saved game file has been found in your game path:\n"
"\n"
"%s %s\n"
"\n"
-"Do you wish to use this save game file with ScummVM?\n"
+"Do you wish to use this saved game file with ScummVM?\n"
"\n"
msgstr ""
#: engines/kyra/saveload_eob.cpp:590
#, c-format
msgid ""
-"A save game file was found in the specified slot %d. Overwrite?\n"
+"A saved game file was found in the specified slot %d. Overwrite?\n"
"\n"
msgstr ""
#: engines/kyra/saveload_eob.cpp:623
#, c-format
msgid ""
-"%d original save game files have been successfully imported into\n"
-"ScummVM. If you want to manually import original save game files later you "
+"%d original saved game files have been successfully imported into\n"
+"ScummVM. If you want to manually import original saved game files later you "
"will\n"
"need to open the ScummVM debug console and use the command "
"'import_savefile'.\n"
@@ -4036,7 +4036,7 @@ msgstr "Cutscene '%s' ikkje funne"
msgid ""
"ScummVM found that you have old savefiles for Broken Sword 1 that should be "
"converted.\n"
-"The old save game format is no longer supported, so you will not be able to "
+"The old saved game format is no longer supported, so you will not be able to "
"load your games if you don't convert them.\n"
"\n"
"Press OK to convert them now, otherwise you will be asked again the next "
@@ -4053,8 +4053,8 @@ msgstr ""
#: engines/sword1/control.cpp:1232
#, c-format
msgid ""
-"Target new save game already exists!\n"
-"Would you like to keep the old save game (%s) or the new one (%s)?\n"
+"Target new saved game already exists!\n"
+"Would you like to keep the old saved game (%s) or the new one (%s)?\n"
msgstr ""
"Mхlet for den lagrede speltilstanden finst!\n"
"Vil du ta vare pх den gamle tilstanden (%s) eller den nye (%s)?\n"
diff --git a/po/pl_PL.po b/po/pl_PL.po
index ce0b3bc91b..23f0b0fecb 100644
--- a/po/pl_PL.po
+++ b/po/pl_PL.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.3.0\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n"
-"POT-Creation-Date: 2016-09-05 10:12+0200\n"
+"POT-Creation-Date: 2016-09-18 15:13+0100\n"
"PO-Revision-Date: 2016-02-20 23:43+0100\n"
"Last-Translator: MichaГ ZiБbkowski <mziab@o2.pl>\n"
"Language-Team: Grajpopolsku.pl <grajpopolsku@gmail.com>\n"
@@ -64,7 +64,7 @@ msgstr "W gѓrъ"
#: gui/recorderdialog.cpp:155 gui/remotebrowser.cpp:59
#: gui/saveload-dialog.cpp:383 gui/saveload-dialog.cpp:443
#: gui/saveload-dialog.cpp:717 gui/saveload-dialog.cpp:1111
-#: gui/storagewizarddialog.cpp:69 gui/themebrowser.cpp:55
+#: gui/storagewizarddialog.cpp:68 gui/themebrowser.cpp:55
#: gui/updates-dialog.cpp:113 engines/engine.cpp:549
#: backends/events/default/default-events.cpp:196
#: backends/events/default/default-events.cpp:218
@@ -119,7 +119,7 @@ msgstr ""
#: gui/downloaddialog.cpp:118 gui/downloaddialog.cpp:152
#: gui/filebrowser-dialog.cpp:132 gui/fluidsynth-dialog.cpp:217
#: gui/launcher.cpp:286 gui/launcher.cpp:394 gui/launcher.cpp:453
-#: gui/storagewizarddialog.cpp:113
+#: gui/storagewizarddialog.cpp:112
#: backends/events/symbiansdl/symbiansdl-events.cpp:186
#: backends/platform/wince/CEActionsPocket.cpp:326
#: backends/platform/wince/CEActionsSmartphone.cpp:287
@@ -131,7 +131,7 @@ msgstr "Tak"
#: gui/downloaddialog.cpp:118 gui/downloaddialog.cpp:153
#: gui/filebrowser-dialog.cpp:132 gui/fluidsynth-dialog.cpp:217
#: gui/launcher.cpp:286 gui/launcher.cpp:394 gui/launcher.cpp:453
-#: gui/storagewizarddialog.cpp:113
+#: gui/storagewizarddialog.cpp:112
#: backends/events/symbiansdl/symbiansdl-events.cpp:186
#: backends/platform/wince/CEActionsPocket.cpp:326
#: backends/platform/wince/CEActionsSmartphone.cpp:287
@@ -409,8 +409,8 @@ msgstr "Wybierz katalog dla zapisѓw"
#: gui/editgamedialog.cpp:510
msgid ""
-"Saves sync feature doesn't work with non-default directories. If you want "
-"your saves to sync, use default directory."
+"Saved games sync feature doesn't work with non-default directories. If you "
+"want your saved games to sync, use default directory."
msgstr ""
#: gui/editgamedialog.cpp:536
@@ -844,7 +844,7 @@ msgid "Special dithering modes supported by some games"
msgstr "Specjalne tryby ditheringu wspierane przez niektѓre gry"
#: gui/options.cpp:789
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2458
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2388
msgid "Fullscreen mode"
msgstr "PeГny ekran"
@@ -1175,7 +1175,7 @@ msgid "Used space:"
msgstr ""
#: gui/options.cpp:1311
-msgid "Space used by ScummVM's saves on this storage"
+msgid "Space used by ScummVM's saved games on this storage"
msgstr ""
#: gui/options.cpp:1314
@@ -1183,10 +1183,10 @@ msgid "Last sync time:"
msgstr ""
#: gui/options.cpp:1314
-msgid "When the last saves sync for this storage occured"
+msgid "When the last saved games sync for this storage occured"
msgstr ""
-#: gui/options.cpp:1317 gui/storagewizarddialog.cpp:72
+#: gui/options.cpp:1317 gui/storagewizarddialog.cpp:71
msgid "Connect"
msgstr ""
@@ -1451,7 +1451,7 @@ msgid "New Save"
msgstr "Nowy zapis"
#: gui/saveload-dialog.cpp:924
-msgid "Create a new save game"
+msgid "Create a new saved game"
msgstr "Stwѓrz nowy zapis"
#: gui/saveload-dialog.cpp:1053
@@ -1463,72 +1463,72 @@ msgstr "Nazwa: "
msgid "Enter a description for slot %d:"
msgstr "Podaj opis dla slotu %d:"
-#: gui/storagewizarddialog.cpp:56
+#: gui/storagewizarddialog.cpp:55
#, c-format
msgid "%s Storage Connection Wizard"
msgstr ""
-#: gui/storagewizarddialog.cpp:59
+#: gui/storagewizarddialog.cpp:58
msgid "Navigate to the following URL:"
msgstr ""
-#: gui/storagewizarddialog.cpp:62
+#: gui/storagewizarddialog.cpp:61
msgid "Obtain the code from the storage, enter it"
msgstr ""
-#: gui/storagewizarddialog.cpp:63
+#: gui/storagewizarddialog.cpp:62
msgid "in the following field and press 'Connect':"
msgstr ""
-#: gui/storagewizarddialog.cpp:70
+#: gui/storagewizarddialog.cpp:69
#, fuzzy
msgid "Open URL"
msgstr "OpenGL"
-#: gui/storagewizarddialog.cpp:71
+#: gui/storagewizarddialog.cpp:70
msgid "Paste"
msgstr ""
-#: gui/storagewizarddialog.cpp:71
+#: gui/storagewizarddialog.cpp:70
msgid "Pastes clipboard contents into fields"
msgstr ""
-#: gui/storagewizarddialog.cpp:79
+#: gui/storagewizarddialog.cpp:78
msgid "You will be directed to ScummVM's page where"
msgstr ""
-#: gui/storagewizarddialog.cpp:80
+#: gui/storagewizarddialog.cpp:79
msgid "you should allow it to access your storage."
msgstr ""
-#: gui/storagewizarddialog.cpp:113
+#: gui/storagewizarddialog.cpp:112
msgid "Another Storage is active. Do you want to interrupt it?"
msgstr ""
-#: gui/storagewizarddialog.cpp:122
+#: gui/storagewizarddialog.cpp:121
msgid "Wait until current Storage finishes up and try again."
msgstr ""
-#: gui/storagewizarddialog.cpp:183
+#: gui/storagewizarddialog.cpp:182
#, c-format
msgid "Field %s has a mistake in it."
msgstr ""
-#: gui/storagewizarddialog.cpp:185
+#: gui/storagewizarddialog.cpp:184
#, c-format
msgid "Fields %s have mistakes in them."
msgstr ""
-#: gui/storagewizarddialog.cpp:200
+#: gui/storagewizarddialog.cpp:199
msgid "All OK!"
msgstr ""
-#: gui/storagewizarddialog.cpp:202
+#: gui/storagewizarddialog.cpp:201
#, fuzzy
msgid "Invalid code"
msgstr "NiewГaЖciwa ЖcieПka"
-#: gui/storagewizarddialog.cpp:210
+#: gui/storagewizarddialog.cpp:209
msgid ""
"Failed to open URL!\n"
"Please navigate to this page manually."
@@ -1889,8 +1889,8 @@ msgstr ""
#: engines/engine.cpp:546
msgid ""
"WARNING: The game you are about to start is not yet fully supported by "
-"ScummVM. As such, it is likely to be unstable, and any saves you make might "
-"not work in future versions of ScummVM."
+"ScummVM. As such, it is likely to be unstable, and any saved game you make "
+"might not work in future versions of ScummVM."
msgstr ""
"UWAGA: Gra, ktѓrБ chcesz wГБczyц, nie jest jeszcze w peГni obsГugiwana przez "
"ScummVM. W zwiБzku z tym moПe byц ona niestabilna, a wszelkie zapisy, "
@@ -2003,16 +2003,16 @@ msgstr "Emulator dМwiъku C64"
#: backends/cloud/storage.cpp:210
#, fuzzy
-msgid "Saves sync complete."
+msgid "Saved games sync complete."
msgstr "Skanowanie zakoёczone!"
#: backends/cloud/storage.cpp:221
-msgid "Saves sync was cancelled."
+msgid "Saved games sync was cancelled."
msgstr ""
#: backends/cloud/storage.cpp:223
msgid ""
-"Saves sync failed.\n"
+"Saved games sync failed.\n"
"Check your Internet connection."
msgstr ""
@@ -2134,11 +2134,11 @@ msgstr "Tryb automatycznego przeciБgania jest"
msgid "Swipe three fingers to the right to toggle."
msgstr "Przesuё trzema palcami, Пeby zmieniц."
-#: backends/graphics/opengl/opengl-graphics.cpp:126
+#: backends/graphics/opengl/opengl-graphics.cpp:129
msgid "OpenGL"
msgstr "OpenGL"
-#: backends/graphics/opengl/opengl-graphics.cpp:127
+#: backends/graphics/opengl/opengl-graphics.cpp:130
msgid "OpenGL (No filtering)"
msgstr "OpenGL (bez filtrowania)"
@@ -2153,19 +2153,19 @@ msgctxt "lowres"
msgid "Normal (no scaling)"
msgstr "ZwykГy (bez skalowania)"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2357
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2289
msgid "Enabled aspect ratio correction"
msgstr "WГБczono korekcjъ formatu obrazu"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2363
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2295
msgid "Disabled aspect ratio correction"
msgstr "WyГБczono korekcjъ formatu obrazu"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2418
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2349
msgid "Active graphics filter:"
msgstr "Aktywny filtr graficzny:"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2460
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2390
msgid "Windowed mode"
msgstr "Okno"
@@ -2832,7 +2832,7 @@ msgstr "DomyЖlnie wГБcz tryb dla daltonistѓw"
msgid ""
"ScummVM found that you have old savefiles for Drascula that should be "
"converted.\n"
-"The old save game format is no longer supported, so you will not be able to "
+"The old saved game format is no longer supported, so you will not be able to "
"load your games if you don't convert them.\n"
"\n"
"Press OK to convert them now, otherwise you will be asked again the next "
@@ -3009,11 +3009,11 @@ msgstr ""
#: engines/kyra/saveload_eob.cpp:557
#, c-format
msgid ""
-"The following original save game file has been found in your game path:\n"
+"The following original saved game file has been found in your game path:\n"
"\n"
"%s %s\n"
"\n"
-"Do you wish to use this save game file with ScummVM?\n"
+"Do you wish to use this saved game file with ScummVM?\n"
"\n"
msgstr ""
"W ЖcieПce gry znaleziono oryginalny zapis gry:\n"
@@ -3026,7 +3026,7 @@ msgstr ""
#: engines/kyra/saveload_eob.cpp:590
#, c-format
msgid ""
-"A save game file was found in the specified slot %d. Overwrite?\n"
+"A saved game file was found in the specified slot %d. Overwrite?\n"
"\n"
msgstr ""
"W wybranym slocie %d znaleziono zapis gry. Nadpisaц?\n"
@@ -3035,8 +3035,8 @@ msgstr ""
#: engines/kyra/saveload_eob.cpp:623
#, c-format
msgid ""
-"%d original save game files have been successfully imported into\n"
-"ScummVM. If you want to manually import original save game files later you "
+"%d original saved game files have been successfully imported into\n"
+"ScummVM. If you want to manually import original saved game files later you "
"will\n"
"need to open the ScummVM debug console and use the command "
"'import_savefile'.\n"
@@ -4092,7 +4092,7 @@ msgstr "Nie znaleziono przerywnika '%s'"
msgid ""
"ScummVM found that you have old savefiles for Broken Sword 1 that should be "
"converted.\n"
-"The old save game format is no longer supported, so you will not be able to "
+"The old saved game format is no longer supported, so you will not be able to "
"load your games if you don't convert them.\n"
"\n"
"Press OK to convert them now, otherwise you will be asked again the next "
@@ -4109,8 +4109,8 @@ msgstr ""
#: engines/sword1/control.cpp:1232
#, c-format
msgid ""
-"Target new save game already exists!\n"
-"Would you like to keep the old save game (%s) or the new one (%s)?\n"
+"Target new saved game already exists!\n"
+"Would you like to keep the old saved game (%s) or the new one (%s)?\n"
msgstr ""
"Docelowy plik nowego zapisu juП istnieje!\n"
"Chcesz zachowaц stary zapis (%s) czy nowy (%s)?\n"
diff --git a/po/pt_BR.po b/po/pt_BR.po
index 70cdb2718d..1d47c2e185 100644
--- a/po/pt_BR.po
+++ b/po/pt_BR.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.3.0svn\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n"
-"POT-Creation-Date: 2016-09-05 10:12+0200\n"
+"POT-Creation-Date: 2016-09-18 15:13+0100\n"
"PO-Revision-Date: 2011-10-21 21:30-0300\n"
"Last-Translator: Saulo Benigno <saulobenigno@gmail.com>\n"
"Language-Team: ScummBR (www.scummbr.com) <scummbr@yahoo.com.br>\n"
@@ -63,7 +63,7 @@ msgstr "Acima"
#: gui/recorderdialog.cpp:155 gui/remotebrowser.cpp:59
#: gui/saveload-dialog.cpp:383 gui/saveload-dialog.cpp:443
#: gui/saveload-dialog.cpp:717 gui/saveload-dialog.cpp:1111
-#: gui/storagewizarddialog.cpp:69 gui/themebrowser.cpp:55
+#: gui/storagewizarddialog.cpp:68 gui/themebrowser.cpp:55
#: gui/updates-dialog.cpp:113 engines/engine.cpp:549
#: backends/events/default/default-events.cpp:196
#: backends/events/default/default-events.cpp:218
@@ -118,7 +118,7 @@ msgstr ""
#: gui/downloaddialog.cpp:118 gui/downloaddialog.cpp:152
#: gui/filebrowser-dialog.cpp:132 gui/fluidsynth-dialog.cpp:217
#: gui/launcher.cpp:286 gui/launcher.cpp:394 gui/launcher.cpp:453
-#: gui/storagewizarddialog.cpp:113
+#: gui/storagewizarddialog.cpp:112
#: backends/events/symbiansdl/symbiansdl-events.cpp:186
#: backends/platform/wince/CEActionsPocket.cpp:326
#: backends/platform/wince/CEActionsSmartphone.cpp:287
@@ -130,7 +130,7 @@ msgstr "Sim"
#: gui/downloaddialog.cpp:118 gui/downloaddialog.cpp:153
#: gui/filebrowser-dialog.cpp:132 gui/fluidsynth-dialog.cpp:217
#: gui/launcher.cpp:286 gui/launcher.cpp:394 gui/launcher.cpp:453
-#: gui/storagewizarddialog.cpp:113
+#: gui/storagewizarddialog.cpp:112
#: backends/events/symbiansdl/symbiansdl-events.cpp:186
#: backends/platform/wince/CEActionsPocket.cpp:326
#: backends/platform/wince/CEActionsSmartphone.cpp:287
@@ -409,8 +409,8 @@ msgstr "Selecione a pasta para os jogos salvos"
#: gui/editgamedialog.cpp:510
msgid ""
-"Saves sync feature doesn't work with non-default directories. If you want "
-"your saves to sync, use default directory."
+"Saved games sync feature doesn't work with non-default directories. If you "
+"want your saved games to sync, use default directory."
msgstr ""
#: gui/editgamedialog.cpp:536
@@ -860,7 +860,7 @@ msgid "Special dithering modes supported by some games"
msgstr "Modos especiais de dithering suportados por alguns jogos"
#: gui/options.cpp:789
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2458
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2388
msgid "Fullscreen mode"
msgstr "Modo Tela Cheia"
@@ -1191,7 +1191,7 @@ msgid "Used space:"
msgstr ""
#: gui/options.cpp:1311
-msgid "Space used by ScummVM's saves on this storage"
+msgid "Space used by ScummVM's saved games on this storage"
msgstr ""
#: gui/options.cpp:1314
@@ -1199,10 +1199,10 @@ msgid "Last sync time:"
msgstr ""
#: gui/options.cpp:1314
-msgid "When the last saves sync for this storage occured"
+msgid "When the last saved games sync for this storage occured"
msgstr ""
-#: gui/options.cpp:1317 gui/storagewizarddialog.cpp:72
+#: gui/options.cpp:1317 gui/storagewizarddialog.cpp:71
msgid "Connect"
msgstr ""
@@ -1473,7 +1473,7 @@ msgstr "Salvar"
#: gui/saveload-dialog.cpp:924
#, fuzzy
-msgid "Create a new save game"
+msgid "Create a new saved game"
msgstr "Falha ao salvar o jogo"
#: gui/saveload-dialog.cpp:1053
@@ -1486,72 +1486,72 @@ msgstr "Nome:"
msgid "Enter a description for slot %d:"
msgstr ""
-#: gui/storagewizarddialog.cpp:56
+#: gui/storagewizarddialog.cpp:55
#, c-format
msgid "%s Storage Connection Wizard"
msgstr ""
-#: gui/storagewizarddialog.cpp:59
+#: gui/storagewizarddialog.cpp:58
msgid "Navigate to the following URL:"
msgstr ""
-#: gui/storagewizarddialog.cpp:62
+#: gui/storagewizarddialog.cpp:61
msgid "Obtain the code from the storage, enter it"
msgstr ""
-#: gui/storagewizarddialog.cpp:63
+#: gui/storagewizarddialog.cpp:62
msgid "in the following field and press 'Connect':"
msgstr ""
-#: gui/storagewizarddialog.cpp:70
+#: gui/storagewizarddialog.cpp:69
#, fuzzy
msgid "Open URL"
msgstr "Abrir"
-#: gui/storagewizarddialog.cpp:71
+#: gui/storagewizarddialog.cpp:70
msgid "Paste"
msgstr ""
-#: gui/storagewizarddialog.cpp:71
+#: gui/storagewizarddialog.cpp:70
msgid "Pastes clipboard contents into fields"
msgstr ""
-#: gui/storagewizarddialog.cpp:79
+#: gui/storagewizarddialog.cpp:78
msgid "You will be directed to ScummVM's page where"
msgstr ""
-#: gui/storagewizarddialog.cpp:80
+#: gui/storagewizarddialog.cpp:79
msgid "you should allow it to access your storage."
msgstr ""
-#: gui/storagewizarddialog.cpp:113
+#: gui/storagewizarddialog.cpp:112
msgid "Another Storage is active. Do you want to interrupt it?"
msgstr ""
-#: gui/storagewizarddialog.cpp:122
+#: gui/storagewizarddialog.cpp:121
msgid "Wait until current Storage finishes up and try again."
msgstr ""
-#: gui/storagewizarddialog.cpp:183
+#: gui/storagewizarddialog.cpp:182
#, c-format
msgid "Field %s has a mistake in it."
msgstr ""
-#: gui/storagewizarddialog.cpp:185
+#: gui/storagewizarddialog.cpp:184
#, c-format
msgid "Fields %s have mistakes in them."
msgstr ""
-#: gui/storagewizarddialog.cpp:200
+#: gui/storagewizarddialog.cpp:199
msgid "All OK!"
msgstr ""
-#: gui/storagewizarddialog.cpp:202
+#: gui/storagewizarddialog.cpp:201
#, fuzzy
msgid "Invalid code"
msgstr "Pasta invсlida"
-#: gui/storagewizarddialog.cpp:210
+#: gui/storagewizarddialog.cpp:209
msgid ""
"Failed to open URL!\n"
"Please navigate to this page manually."
@@ -1925,8 +1925,8 @@ msgstr ""
#: engines/engine.cpp:546
msgid ""
"WARNING: The game you are about to start is not yet fully supported by "
-"ScummVM. As such, it is likely to be unstable, and any saves you make might "
-"not work in future versions of ScummVM."
+"ScummVM. As such, it is likely to be unstable, and any saved game you make "
+"might not work in future versions of ScummVM."
msgstr ""
"AVISO: O jogo que vocъ estс prestes a comeчar ainda nуo щ totalmente "
"suportado pelo ScummVM. Como tal, щ provсvel que seja instсvel, e qualquer "
@@ -2041,16 +2041,16 @@ msgstr "Emulador Som C64"
#: backends/cloud/storage.cpp:210
#, fuzzy
-msgid "Saves sync complete."
+msgid "Saved games sync complete."
msgstr "Busca completa!"
#: backends/cloud/storage.cpp:221
-msgid "Saves sync was cancelled."
+msgid "Saved games sync was cancelled."
msgstr ""
#: backends/cloud/storage.cpp:223
msgid ""
-"Saves sync failed.\n"
+"Saved games sync failed.\n"
"Check your Internet connection."
msgstr ""
@@ -2174,12 +2174,12 @@ msgstr ""
msgid "Swipe three fingers to the right to toggle."
msgstr ""
-#: backends/graphics/opengl/opengl-graphics.cpp:126
+#: backends/graphics/opengl/opengl-graphics.cpp:129
#, fuzzy
msgid "OpenGL"
msgstr "Abrir"
-#: backends/graphics/opengl/opengl-graphics.cpp:127
+#: backends/graphics/opengl/opengl-graphics.cpp:130
msgid "OpenGL (No filtering)"
msgstr ""
@@ -2194,19 +2194,19 @@ msgctxt "lowres"
msgid "Normal (no scaling)"
msgstr "Normal (sem escala)"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2357
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2289
msgid "Enabled aspect ratio correction"
msgstr "Correчуo de proporчуo habilitada"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2363
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2295
msgid "Disabled aspect ratio correction"
msgstr "Correчуo de proporчуo desabilitada"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2418
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2349
msgid "Active graphics filter:"
msgstr "Ativa os filtros grсficos"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2460
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2390
msgid "Windowed mode"
msgstr "Modo janela"
@@ -2874,7 +2874,7 @@ msgstr ""
msgid ""
"ScummVM found that you have old savefiles for Drascula that should be "
"converted.\n"
-"The old save game format is no longer supported, so you will not be able to "
+"The old saved game format is no longer supported, so you will not be able to "
"load your games if you don't convert them.\n"
"\n"
"Press OK to convert them now, otherwise you will be asked again the next "
@@ -3070,26 +3070,26 @@ msgstr ""
#: engines/kyra/saveload_eob.cpp:557
#, c-format
msgid ""
-"The following original save game file has been found in your game path:\n"
+"The following original saved game file has been found in your game path:\n"
"\n"
"%s %s\n"
"\n"
-"Do you wish to use this save game file with ScummVM?\n"
+"Do you wish to use this saved game file with ScummVM?\n"
"\n"
msgstr ""
#: engines/kyra/saveload_eob.cpp:590
#, c-format
msgid ""
-"A save game file was found in the specified slot %d. Overwrite?\n"
+"A saved game file was found in the specified slot %d. Overwrite?\n"
"\n"
msgstr ""
#: engines/kyra/saveload_eob.cpp:623
#, c-format
msgid ""
-"%d original save game files have been successfully imported into\n"
-"ScummVM. If you want to manually import original save game files later you "
+"%d original saved game files have been successfully imported into\n"
+"ScummVM. If you want to manually import original saved game files later you "
"will\n"
"need to open the ScummVM debug console and use the command "
"'import_savefile'.\n"
@@ -4141,7 +4141,7 @@ msgstr "Vэdeo '%s' nуo encontrado"
msgid ""
"ScummVM found that you have old savefiles for Broken Sword 1 that should be "
"converted.\n"
-"The old save game format is no longer supported, so you will not be able to "
+"The old saved game format is no longer supported, so you will not be able to "
"load your games if you don't convert them.\n"
"\n"
"Press OK to convert them now, otherwise you will be asked again the next "
@@ -4158,8 +4158,8 @@ msgstr ""
#: engines/sword1/control.cpp:1232
#, c-format
msgid ""
-"Target new save game already exists!\n"
-"Would you like to keep the old save game (%s) or the new one (%s)?\n"
+"Target new saved game already exists!\n"
+"Would you like to keep the old saved game (%s) or the new one (%s)?\n"
msgstr ""
"Jс existe um jogo salvo no destino!\n"
"Vocъ gostaria de manter o jogo salvo (%s) ou o novo (%s)?\n"
diff --git a/po/ru_RU.po b/po/ru_RU.po
index 94a6ddc8aa..677421e3de 100644
--- a/po/ru_RU.po
+++ b/po/ru_RU.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.8.0svn\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n"
-"POT-Creation-Date: 2016-09-05 10:12+0200\n"
+"POT-Creation-Date: 2016-09-18 15:13+0100\n"
"PO-Revision-Date: 2016-05-22 17:04+0300\n"
"Last-Translator: Eugene Sandulenko <sev@scummvm.org>\n"
"Language-Team: Russian\n"
@@ -61,7 +61,7 @@ msgstr "Вверх"
#: gui/recorderdialog.cpp:155 gui/remotebrowser.cpp:59
#: gui/saveload-dialog.cpp:383 gui/saveload-dialog.cpp:443
#: gui/saveload-dialog.cpp:717 gui/saveload-dialog.cpp:1111
-#: gui/storagewizarddialog.cpp:69 gui/themebrowser.cpp:55
+#: gui/storagewizarddialog.cpp:68 gui/themebrowser.cpp:55
#: gui/updates-dialog.cpp:113 engines/engine.cpp:549
#: backends/events/default/default-events.cpp:196
#: backends/events/default/default-events.cpp:218
@@ -116,7 +116,7 @@ msgstr ""
#: gui/downloaddialog.cpp:118 gui/downloaddialog.cpp:152
#: gui/filebrowser-dialog.cpp:132 gui/fluidsynth-dialog.cpp:217
#: gui/launcher.cpp:286 gui/launcher.cpp:394 gui/launcher.cpp:453
-#: gui/storagewizarddialog.cpp:113
+#: gui/storagewizarddialog.cpp:112
#: backends/events/symbiansdl/symbiansdl-events.cpp:186
#: backends/platform/wince/CEActionsPocket.cpp:326
#: backends/platform/wince/CEActionsSmartphone.cpp:287
@@ -128,7 +128,7 @@ msgstr "Да"
#: gui/downloaddialog.cpp:118 gui/downloaddialog.cpp:153
#: gui/filebrowser-dialog.cpp:132 gui/fluidsynth-dialog.cpp:217
#: gui/launcher.cpp:286 gui/launcher.cpp:394 gui/launcher.cpp:453
-#: gui/storagewizarddialog.cpp:113
+#: gui/storagewizarddialog.cpp:112
#: backends/events/symbiansdl/symbiansdl-events.cpp:186
#: backends/platform/wince/CEActionsPocket.cpp:326
#: backends/platform/wince/CEActionsSmartphone.cpp:287
@@ -407,8 +407,8 @@ msgstr "Выберите директорию для сохранений"
#: gui/editgamedialog.cpp:510
msgid ""
-"Saves sync feature doesn't work with non-default directories. If you want "
-"your saves to sync, use default directory."
+"Saved games sync feature doesn't work with non-default directories. If you "
+"want your saved games to sync, use default directory."
msgstr ""
#: gui/editgamedialog.cpp:536
@@ -844,7 +844,7 @@ msgid "Special dithering modes supported by some games"
msgstr "Специальные режимы рендеринга, поддерживаемые некоторыми играми"
#: gui/options.cpp:789
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2458
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2388
msgid "Fullscreen mode"
msgstr "Полноэкранный режим"
@@ -1179,7 +1179,7 @@ msgid "Used space:"
msgstr ""
#: gui/options.cpp:1311
-msgid "Space used by ScummVM's saves on this storage"
+msgid "Space used by ScummVM's saved games on this storage"
msgstr ""
#: gui/options.cpp:1314
@@ -1187,10 +1187,10 @@ msgid "Last sync time:"
msgstr ""
#: gui/options.cpp:1314
-msgid "When the last saves sync for this storage occured"
+msgid "When the last saved games sync for this storage occured"
msgstr ""
-#: gui/options.cpp:1317 gui/storagewizarddialog.cpp:72
+#: gui/options.cpp:1317 gui/storagewizarddialog.cpp:71
msgid "Connect"
msgstr ""
@@ -1455,7 +1455,7 @@ msgid "New Save"
msgstr "Новое сохранение"
#: gui/saveload-dialog.cpp:924
-msgid "Create a new save game"
+msgid "Create a new saved game"
msgstr "Создать новую запись игры"
#: gui/saveload-dialog.cpp:1053
@@ -1467,71 +1467,71 @@ msgstr "Название: "
msgid "Enter a description for slot %d:"
msgstr "Введите описание слота %d:"
-#: gui/storagewizarddialog.cpp:56
+#: gui/storagewizarddialog.cpp:55
#, c-format
msgid "%s Storage Connection Wizard"
msgstr ""
-#: gui/storagewizarddialog.cpp:59
+#: gui/storagewizarddialog.cpp:58
msgid "Navigate to the following URL:"
msgstr ""
-#: gui/storagewizarddialog.cpp:62
+#: gui/storagewizarddialog.cpp:61
msgid "Obtain the code from the storage, enter it"
msgstr ""
-#: gui/storagewizarddialog.cpp:63
+#: gui/storagewizarddialog.cpp:62
msgid "in the following field and press 'Connect':"
msgstr ""
-#: gui/storagewizarddialog.cpp:70
+#: gui/storagewizarddialog.cpp:69
#, fuzzy
msgid "Open URL"
msgstr "OpenGL"
-#: gui/storagewizarddialog.cpp:71
+#: gui/storagewizarddialog.cpp:70
msgid "Paste"
msgstr ""
-#: gui/storagewizarddialog.cpp:71
+#: gui/storagewizarddialog.cpp:70
msgid "Pastes clipboard contents into fields"
msgstr ""
-#: gui/storagewizarddialog.cpp:79
+#: gui/storagewizarddialog.cpp:78
msgid "You will be directed to ScummVM's page where"
msgstr ""
-#: gui/storagewizarddialog.cpp:80
+#: gui/storagewizarddialog.cpp:79
msgid "you should allow it to access your storage."
msgstr ""
-#: gui/storagewizarddialog.cpp:113
+#: gui/storagewizarddialog.cpp:112
msgid "Another Storage is active. Do you want to interrupt it?"
msgstr ""
-#: gui/storagewizarddialog.cpp:122
+#: gui/storagewizarddialog.cpp:121
msgid "Wait until current Storage finishes up and try again."
msgstr ""
-#: gui/storagewizarddialog.cpp:183
+#: gui/storagewizarddialog.cpp:182
#, c-format
msgid "Field %s has a mistake in it."
msgstr ""
-#: gui/storagewizarddialog.cpp:185
+#: gui/storagewizarddialog.cpp:184
#, c-format
msgid "Fields %s have mistakes in them."
msgstr ""
-#: gui/storagewizarddialog.cpp:200
+#: gui/storagewizarddialog.cpp:199
msgid "All OK!"
msgstr ""
-#: gui/storagewizarddialog.cpp:202
+#: gui/storagewizarddialog.cpp:201
msgid "Invalid code"
msgstr ""
-#: gui/storagewizarddialog.cpp:210
+#: gui/storagewizarddialog.cpp:209
msgid ""
"Failed to open URL!\n"
"Please navigate to this page manually."
@@ -1902,8 +1902,8 @@ msgstr ""
#: engines/engine.cpp:546
msgid ""
"WARNING: The game you are about to start is not yet fully supported by "
-"ScummVM. As such, it is likely to be unstable, and any saves you make might "
-"not work in future versions of ScummVM."
+"ScummVM. As such, it is likely to be unstable, and any saved game you make "
+"might not work in future versions of ScummVM."
msgstr ""
"ПРЕДУПРЕЖДЕНИЕ: Игра, которую вы собираетесь запустить, ещё не "
"поддерживается ScummVM полностью. Она, скорее всего, не будет работать "
@@ -2016,16 +2016,16 @@ msgstr "Эмулятор звука C64"
#: backends/cloud/storage.cpp:210
#, fuzzy
-msgid "Saves sync complete."
+msgid "Saved games sync complete."
msgstr "Поиск закончен!"
#: backends/cloud/storage.cpp:221
-msgid "Saves sync was cancelled."
+msgid "Saved games sync was cancelled."
msgstr ""
#: backends/cloud/storage.cpp:223
msgid ""
-"Saves sync failed.\n"
+"Saved games sync failed.\n"
"Check your Internet connection."
msgstr ""
@@ -2147,11 +2147,11 @@ msgstr "Режим автодрэга сейчас"
msgid "Swipe three fingers to the right to toggle."
msgstr "Проведите тремя пальцами направо для переключения."
-#: backends/graphics/opengl/opengl-graphics.cpp:126
+#: backends/graphics/opengl/opengl-graphics.cpp:129
msgid "OpenGL"
msgstr "OpenGL"
-#: backends/graphics/opengl/opengl-graphics.cpp:127
+#: backends/graphics/opengl/opengl-graphics.cpp:130
msgid "OpenGL (No filtering)"
msgstr "OpenGL (без фильтров)"
@@ -2166,19 +2166,19 @@ msgctxt "lowres"
msgid "Normal (no scaling)"
msgstr "Без увеличения"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2357
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2289
msgid "Enabled aspect ratio correction"
msgstr "Коррекция соотношения сторон включена"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2363
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2295
msgid "Disabled aspect ratio correction"
msgstr "Коррекция соотношения сторон выключена"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2418
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2349
msgid "Active graphics filter:"
msgstr "Активный графический фильтр:"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2460
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2390
msgid "Windowed mode"
msgstr "Оконный режим"
@@ -2849,7 +2849,7 @@ msgstr "Включить режим для людей со слабым восприятием цвета"
msgid ""
"ScummVM found that you have old savefiles for Drascula that should be "
"converted.\n"
-"The old save game format is no longer supported, so you will not be able to "
+"The old saved game format is no longer supported, so you will not be able to "
"load your games if you don't convert them.\n"
"\n"
"Press OK to convert them now, otherwise you will be asked again the next "
@@ -3029,11 +3029,11 @@ msgstr ""
#: engines/kyra/saveload_eob.cpp:557
#, c-format
msgid ""
-"The following original save game file has been found in your game path:\n"
+"The following original saved game file has been found in your game path:\n"
"\n"
"%s %s\n"
"\n"
-"Do you wish to use this save game file with ScummVM?\n"
+"Do you wish to use this saved game file with ScummVM?\n"
"\n"
msgstr ""
"Нижеследующий файл сохранения из оригинальной игры был найден в вашей "
@@ -3047,7 +3047,7 @@ msgstr ""
#: engines/kyra/saveload_eob.cpp:590
#, c-format
msgid ""
-"A save game file was found in the specified slot %d. Overwrite?\n"
+"A saved game file was found in the specified slot %d. Overwrite?\n"
"\n"
msgstr ""
"В указанном слоте %d уже есть сохранение игры. Перезаписать?\n"
@@ -3056,8 +3056,8 @@ msgstr ""
#: engines/kyra/saveload_eob.cpp:623
#, c-format
msgid ""
-"%d original save game files have been successfully imported into\n"
-"ScummVM. If you want to manually import original save game files later you "
+"%d original saved game files have been successfully imported into\n"
+"ScummVM. If you want to manually import original saved game files later you "
"will\n"
"need to open the ScummVM debug console and use the command "
"'import_savefile'.\n"
@@ -4111,7 +4111,7 @@ msgstr "Заставка '%s' не найдена"
msgid ""
"ScummVM found that you have old savefiles for Broken Sword 1 that should be "
"converted.\n"
-"The old save game format is no longer supported, so you will not be able to "
+"The old saved game format is no longer supported, so you will not be able to "
"load your games if you don't convert them.\n"
"\n"
"Press OK to convert them now, otherwise you will be asked again the next "
@@ -4128,8 +4128,8 @@ msgstr ""
#: engines/sword1/control.cpp:1232
#, c-format
msgid ""
-"Target new save game already exists!\n"
-"Would you like to keep the old save game (%s) or the new one (%s)?\n"
+"Target new saved game already exists!\n"
+"Would you like to keep the old saved game (%s) or the new one (%s)?\n"
msgstr ""
"Сохранение игры с таким именем уже существует!\n"
"Вы хотите оставить старое название (%s) или сделать новое (%s)?\n"
diff --git a/po/scummvm.pot b/po/scummvm.pot
index 8f0724bed0..a13879d726 100644
--- a/po/scummvm.pot
+++ b/po/scummvm.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.9.0git\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n"
-"POT-Creation-Date: 2016-09-05 10:12+0200\n"
+"POT-Creation-Date: 2016-09-18 15:13+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -59,7 +59,7 @@ msgstr ""
#: gui/recorderdialog.cpp:155 gui/remotebrowser.cpp:59
#: gui/saveload-dialog.cpp:383 gui/saveload-dialog.cpp:443
#: gui/saveload-dialog.cpp:717 gui/saveload-dialog.cpp:1111
-#: gui/storagewizarddialog.cpp:69 gui/themebrowser.cpp:55
+#: gui/storagewizarddialog.cpp:68 gui/themebrowser.cpp:55
#: gui/updates-dialog.cpp:113 engines/engine.cpp:549
#: backends/events/default/default-events.cpp:196
#: backends/events/default/default-events.cpp:218
@@ -113,7 +113,7 @@ msgstr ""
#: gui/downloaddialog.cpp:118 gui/downloaddialog.cpp:152
#: gui/filebrowser-dialog.cpp:132 gui/fluidsynth-dialog.cpp:217
#: gui/launcher.cpp:286 gui/launcher.cpp:394 gui/launcher.cpp:453
-#: gui/storagewizarddialog.cpp:113
+#: gui/storagewizarddialog.cpp:112
#: backends/events/symbiansdl/symbiansdl-events.cpp:186
#: backends/platform/wince/CEActionsPocket.cpp:326
#: backends/platform/wince/CEActionsSmartphone.cpp:287
@@ -125,7 +125,7 @@ msgstr ""
#: gui/downloaddialog.cpp:118 gui/downloaddialog.cpp:153
#: gui/filebrowser-dialog.cpp:132 gui/fluidsynth-dialog.cpp:217
#: gui/launcher.cpp:286 gui/launcher.cpp:394 gui/launcher.cpp:453
-#: gui/storagewizarddialog.cpp:113
+#: gui/storagewizarddialog.cpp:112
#: backends/events/symbiansdl/symbiansdl-events.cpp:186
#: backends/platform/wince/CEActionsPocket.cpp:326
#: backends/platform/wince/CEActionsSmartphone.cpp:287
@@ -401,8 +401,8 @@ msgstr ""
#: gui/editgamedialog.cpp:510
msgid ""
-"Saves sync feature doesn't work with non-default directories. If you want "
-"your saves to sync, use default directory."
+"Saved games sync feature doesn't work with non-default directories. If you "
+"want your saved games to sync, use default directory."
msgstr ""
#: gui/editgamedialog.cpp:536
@@ -834,7 +834,7 @@ msgid "Special dithering modes supported by some games"
msgstr ""
#: gui/options.cpp:789
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2458
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2388
msgid "Fullscreen mode"
msgstr ""
@@ -1156,7 +1156,7 @@ msgid "Used space:"
msgstr ""
#: gui/options.cpp:1311
-msgid "Space used by ScummVM's saves on this storage"
+msgid "Space used by ScummVM's saved games on this storage"
msgstr ""
#: gui/options.cpp:1314
@@ -1164,10 +1164,10 @@ msgid "Last sync time:"
msgstr ""
#: gui/options.cpp:1314
-msgid "When the last saves sync for this storage occured"
+msgid "When the last saved games sync for this storage occured"
msgstr ""
-#: gui/options.cpp:1317 gui/storagewizarddialog.cpp:72
+#: gui/options.cpp:1317 gui/storagewizarddialog.cpp:71
msgid "Connect"
msgstr ""
@@ -1419,7 +1419,7 @@ msgid "New Save"
msgstr ""
#: gui/saveload-dialog.cpp:924
-msgid "Create a new save game"
+msgid "Create a new saved game"
msgstr ""
#: gui/saveload-dialog.cpp:1053
@@ -1431,70 +1431,70 @@ msgstr ""
msgid "Enter a description for slot %d:"
msgstr ""
-#: gui/storagewizarddialog.cpp:56
+#: gui/storagewizarddialog.cpp:55
#, c-format
msgid "%s Storage Connection Wizard"
msgstr ""
-#: gui/storagewizarddialog.cpp:59
+#: gui/storagewizarddialog.cpp:58
msgid "Navigate to the following URL:"
msgstr ""
-#: gui/storagewizarddialog.cpp:62
+#: gui/storagewizarddialog.cpp:61
msgid "Obtain the code from the storage, enter it"
msgstr ""
-#: gui/storagewizarddialog.cpp:63
+#: gui/storagewizarddialog.cpp:62
msgid "in the following field and press 'Connect':"
msgstr ""
-#: gui/storagewizarddialog.cpp:70
+#: gui/storagewizarddialog.cpp:69
msgid "Open URL"
msgstr ""
-#: gui/storagewizarddialog.cpp:71
+#: gui/storagewizarddialog.cpp:70
msgid "Paste"
msgstr ""
-#: gui/storagewizarddialog.cpp:71
+#: gui/storagewizarddialog.cpp:70
msgid "Pastes clipboard contents into fields"
msgstr ""
-#: gui/storagewizarddialog.cpp:79
+#: gui/storagewizarddialog.cpp:78
msgid "You will be directed to ScummVM's page where"
msgstr ""
-#: gui/storagewizarddialog.cpp:80
+#: gui/storagewizarddialog.cpp:79
msgid "you should allow it to access your storage."
msgstr ""
-#: gui/storagewizarddialog.cpp:113
+#: gui/storagewizarddialog.cpp:112
msgid "Another Storage is active. Do you want to interrupt it?"
msgstr ""
-#: gui/storagewizarddialog.cpp:122
+#: gui/storagewizarddialog.cpp:121
msgid "Wait until current Storage finishes up and try again."
msgstr ""
-#: gui/storagewizarddialog.cpp:183
+#: gui/storagewizarddialog.cpp:182
#, c-format
msgid "Field %s has a mistake in it."
msgstr ""
-#: gui/storagewizarddialog.cpp:185
+#: gui/storagewizarddialog.cpp:184
#, c-format
msgid "Fields %s have mistakes in them."
msgstr ""
-#: gui/storagewizarddialog.cpp:200
+#: gui/storagewizarddialog.cpp:199
msgid "All OK!"
msgstr ""
-#: gui/storagewizarddialog.cpp:202
+#: gui/storagewizarddialog.cpp:201
msgid "Invalid code"
msgstr ""
-#: gui/storagewizarddialog.cpp:210
+#: gui/storagewizarddialog.cpp:209
msgid ""
"Failed to open URL!\n"
"Please navigate to this page manually."
@@ -1840,8 +1840,8 @@ msgstr ""
#: engines/engine.cpp:546
msgid ""
"WARNING: The game you are about to start is not yet fully supported by "
-"ScummVM. As such, it is likely to be unstable, and any saves you make might "
-"not work in future versions of ScummVM."
+"ScummVM. As such, it is likely to be unstable, and any saved game you make "
+"might not work in future versions of ScummVM."
msgstr ""
#: engines/engine.cpp:549
@@ -1942,16 +1942,16 @@ msgid "C64 Audio Emulator"
msgstr ""
#: backends/cloud/storage.cpp:210
-msgid "Saves sync complete."
+msgid "Saved games sync complete."
msgstr ""
#: backends/cloud/storage.cpp:221
-msgid "Saves sync was cancelled."
+msgid "Saved games sync was cancelled."
msgstr ""
#: backends/cloud/storage.cpp:223
msgid ""
-"Saves sync failed.\n"
+"Saved games sync failed.\n"
"Check your Internet connection."
msgstr ""
@@ -2071,11 +2071,11 @@ msgstr ""
msgid "Swipe three fingers to the right to toggle."
msgstr ""
-#: backends/graphics/opengl/opengl-graphics.cpp:126
+#: backends/graphics/opengl/opengl-graphics.cpp:129
msgid "OpenGL"
msgstr ""
-#: backends/graphics/opengl/opengl-graphics.cpp:127
+#: backends/graphics/opengl/opengl-graphics.cpp:130
msgid "OpenGL (No filtering)"
msgstr ""
@@ -2090,19 +2090,19 @@ msgctxt "lowres"
msgid "Normal (no scaling)"
msgstr ""
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2357
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2289
msgid "Enabled aspect ratio correction"
msgstr ""
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2363
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2295
msgid "Disabled aspect ratio correction"
msgstr ""
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2418
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2349
msgid "Active graphics filter:"
msgstr ""
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2460
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2390
msgid "Windowed mode"
msgstr ""
@@ -2751,7 +2751,7 @@ msgstr ""
msgid ""
"ScummVM found that you have old savefiles for Drascula that should be "
"converted.\n"
-"The old save game format is no longer supported, so you will not be able to "
+"The old saved game format is no longer supported, so you will not be able to "
"load your games if you don't convert them.\n"
"\n"
"Press OK to convert them now, otherwise you will be asked again the next "
@@ -2918,26 +2918,26 @@ msgstr ""
#: engines/kyra/saveload_eob.cpp:557
#, c-format
msgid ""
-"The following original save game file has been found in your game path:\n"
+"The following original saved game file has been found in your game path:\n"
"\n"
"%s %s\n"
"\n"
-"Do you wish to use this save game file with ScummVM?\n"
+"Do you wish to use this saved game file with ScummVM?\n"
"\n"
msgstr ""
#: engines/kyra/saveload_eob.cpp:590
#, c-format
msgid ""
-"A save game file was found in the specified slot %d. Overwrite?\n"
+"A saved game file was found in the specified slot %d. Overwrite?\n"
"\n"
msgstr ""
#: engines/kyra/saveload_eob.cpp:623
#, c-format
msgid ""
-"%d original save game files have been successfully imported into\n"
-"ScummVM. If you want to manually import original save game files later you "
+"%d original saved game files have been successfully imported into\n"
+"ScummVM. If you want to manually import original saved game files later you "
"will\n"
"need to open the ScummVM debug console and use the command "
"'import_savefile'.\n"
@@ -3945,7 +3945,7 @@ msgstr ""
msgid ""
"ScummVM found that you have old savefiles for Broken Sword 1 that should be "
"converted.\n"
-"The old save game format is no longer supported, so you will not be able to "
+"The old saved game format is no longer supported, so you will not be able to "
"load your games if you don't convert them.\n"
"\n"
"Press OK to convert them now, otherwise you will be asked again the next "
@@ -3955,8 +3955,8 @@ msgstr ""
#: engines/sword1/control.cpp:1232
#, c-format
msgid ""
-"Target new save game already exists!\n"
-"Would you like to keep the old save game (%s) or the new one (%s)?\n"
+"Target new saved game already exists!\n"
+"Would you like to keep the old saved game (%s) or the new one (%s)?\n"
msgstr ""
#: engines/sword1/control.cpp:1235
diff --git a/po/sv_SE.po b/po/sv_SE.po
index 742a9d99bd..d2be275a62 100644
--- a/po/sv_SE.po
+++ b/po/sv_SE.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.5.0svn\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n"
-"POT-Creation-Date: 2016-09-05 10:12+0200\n"
+"POT-Creation-Date: 2016-09-18 15:13+0100\n"
"PO-Revision-Date: 2016-02-25 23:06+0100\n"
"Last-Translator: Hampus Flink <hampus.flink@gmail.com>\n"
"Language-Team: \n"
@@ -61,7 +61,7 @@ msgstr "Uppхt"
#: gui/recorderdialog.cpp:155 gui/remotebrowser.cpp:59
#: gui/saveload-dialog.cpp:383 gui/saveload-dialog.cpp:443
#: gui/saveload-dialog.cpp:717 gui/saveload-dialog.cpp:1111
-#: gui/storagewizarddialog.cpp:69 gui/themebrowser.cpp:55
+#: gui/storagewizarddialog.cpp:68 gui/themebrowser.cpp:55
#: gui/updates-dialog.cpp:113 engines/engine.cpp:549
#: backends/events/default/default-events.cpp:196
#: backends/events/default/default-events.cpp:218
@@ -116,7 +116,7 @@ msgstr ""
#: gui/downloaddialog.cpp:118 gui/downloaddialog.cpp:152
#: gui/filebrowser-dialog.cpp:132 gui/fluidsynth-dialog.cpp:217
#: gui/launcher.cpp:286 gui/launcher.cpp:394 gui/launcher.cpp:453
-#: gui/storagewizarddialog.cpp:113
+#: gui/storagewizarddialog.cpp:112
#: backends/events/symbiansdl/symbiansdl-events.cpp:186
#: backends/platform/wince/CEActionsPocket.cpp:326
#: backends/platform/wince/CEActionsSmartphone.cpp:287
@@ -128,7 +128,7 @@ msgstr "Ja"
#: gui/downloaddialog.cpp:118 gui/downloaddialog.cpp:153
#: gui/filebrowser-dialog.cpp:132 gui/fluidsynth-dialog.cpp:217
#: gui/launcher.cpp:286 gui/launcher.cpp:394 gui/launcher.cpp:453
-#: gui/storagewizarddialog.cpp:113
+#: gui/storagewizarddialog.cpp:112
#: backends/events/symbiansdl/symbiansdl-events.cpp:186
#: backends/platform/wince/CEActionsPocket.cpp:326
#: backends/platform/wince/CEActionsSmartphone.cpp:287
@@ -408,8 +408,8 @@ msgstr "Vфlj katalog fіr spardata"
#: gui/editgamedialog.cpp:510
msgid ""
-"Saves sync feature doesn't work with non-default directories. If you want "
-"your saves to sync, use default directory."
+"Saved games sync feature doesn't work with non-default directories. If you "
+"want your saved games to sync, use default directory."
msgstr ""
#: gui/editgamedialog.cpp:536
@@ -847,7 +847,7 @@ msgid "Special dithering modes supported by some games"
msgstr "Speciella gitterlфgen stіdda av vissa spel"
#: gui/options.cpp:789
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2458
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2388
msgid "Fullscreen mode"
msgstr "Fullskфrmslфge"
@@ -1177,7 +1177,7 @@ msgid "Used space:"
msgstr ""
#: gui/options.cpp:1311
-msgid "Space used by ScummVM's saves on this storage"
+msgid "Space used by ScummVM's saved games on this storage"
msgstr ""
#: gui/options.cpp:1314
@@ -1185,10 +1185,10 @@ msgid "Last sync time:"
msgstr ""
#: gui/options.cpp:1314
-msgid "When the last saves sync for this storage occured"
+msgid "When the last saved games sync for this storage occured"
msgstr ""
-#: gui/options.cpp:1317 gui/storagewizarddialog.cpp:72
+#: gui/options.cpp:1317 gui/storagewizarddialog.cpp:71
msgid "Connect"
msgstr ""
@@ -1454,7 +1454,7 @@ msgid "New Save"
msgstr "Ny sparning"
#: gui/saveload-dialog.cpp:924
-msgid "Create a new save game"
+msgid "Create a new saved game"
msgstr "Skapa ett nytt sparat spel"
#: gui/saveload-dialog.cpp:1053
@@ -1466,72 +1466,72 @@ msgstr "Namn:"
msgid "Enter a description for slot %d:"
msgstr "Ange en beskrivning fіr position %d:"
-#: gui/storagewizarddialog.cpp:56
+#: gui/storagewizarddialog.cpp:55
#, c-format
msgid "%s Storage Connection Wizard"
msgstr ""
-#: gui/storagewizarddialog.cpp:59
+#: gui/storagewizarddialog.cpp:58
msgid "Navigate to the following URL:"
msgstr ""
-#: gui/storagewizarddialog.cpp:62
+#: gui/storagewizarddialog.cpp:61
msgid "Obtain the code from the storage, enter it"
msgstr ""
-#: gui/storagewizarddialog.cpp:63
+#: gui/storagewizarddialog.cpp:62
msgid "in the following field and press 'Connect':"
msgstr ""
-#: gui/storagewizarddialog.cpp:70
+#: gui/storagewizarddialog.cpp:69
#, fuzzy
msgid "Open URL"
msgstr "OpenGL"
-#: gui/storagewizarddialog.cpp:71
+#: gui/storagewizarddialog.cpp:70
msgid "Paste"
msgstr ""
-#: gui/storagewizarddialog.cpp:71
+#: gui/storagewizarddialog.cpp:70
msgid "Pastes clipboard contents into fields"
msgstr ""
-#: gui/storagewizarddialog.cpp:79
+#: gui/storagewizarddialog.cpp:78
msgid "You will be directed to ScummVM's page where"
msgstr ""
-#: gui/storagewizarddialog.cpp:80
+#: gui/storagewizarddialog.cpp:79
msgid "you should allow it to access your storage."
msgstr ""
-#: gui/storagewizarddialog.cpp:113
+#: gui/storagewizarddialog.cpp:112
msgid "Another Storage is active. Do you want to interrupt it?"
msgstr ""
-#: gui/storagewizarddialog.cpp:122
+#: gui/storagewizarddialog.cpp:121
msgid "Wait until current Storage finishes up and try again."
msgstr ""
-#: gui/storagewizarddialog.cpp:183
+#: gui/storagewizarddialog.cpp:182
#, c-format
msgid "Field %s has a mistake in it."
msgstr ""
-#: gui/storagewizarddialog.cpp:185
+#: gui/storagewizarddialog.cpp:184
#, c-format
msgid "Fields %s have mistakes in them."
msgstr ""
-#: gui/storagewizarddialog.cpp:200
+#: gui/storagewizarddialog.cpp:199
msgid "All OK!"
msgstr ""
-#: gui/storagewizarddialog.cpp:202
+#: gui/storagewizarddialog.cpp:201
#, fuzzy
msgid "Invalid code"
msgstr "Ogiltig sіkvфg"
-#: gui/storagewizarddialog.cpp:210
+#: gui/storagewizarddialog.cpp:209
msgid ""
"Failed to open URL!\n"
"Please navigate to this page manually."
@@ -1897,8 +1897,8 @@ msgstr ""
#: engines/engine.cpp:546
msgid ""
"WARNING: The game you are about to start is not yet fully supported by "
-"ScummVM. As such, it is likely to be unstable, and any saves you make might "
-"not work in future versions of ScummVM."
+"ScummVM. As such, it is likely to be unstable, and any saved game you make "
+"might not work in future versions of ScummVM."
msgstr ""
"VARNING: Spelet du фr pх vфg att starta stіds inte фnnu till fullo av "
"ScummVM. Dфrfіr фr det troligtvis instabilt och om du skapar spardata kan de "
@@ -2011,16 +2011,16 @@ msgstr "C64 ljudemulator"
#: backends/cloud/storage.cpp:210
#, fuzzy
-msgid "Saves sync complete."
+msgid "Saved games sync complete."
msgstr "Scanning fфrdig!"
#: backends/cloud/storage.cpp:221
-msgid "Saves sync was cancelled."
+msgid "Saved games sync was cancelled."
msgstr ""
#: backends/cloud/storage.cpp:223
msgid ""
-"Saves sync failed.\n"
+"Saved games sync failed.\n"
"Check your Internet connection."
msgstr ""
@@ -2142,11 +2142,11 @@ msgstr "Automatiskt draglфge "
msgid "Swipe three fingers to the right to toggle."
msgstr "Svep хt hіger med tre fingrar fіr att byta lфge."
-#: backends/graphics/opengl/opengl-graphics.cpp:126
+#: backends/graphics/opengl/opengl-graphics.cpp:129
msgid "OpenGL"
msgstr "OpenGL"
-#: backends/graphics/opengl/opengl-graphics.cpp:127
+#: backends/graphics/opengl/opengl-graphics.cpp:130
msgid "OpenGL (No filtering)"
msgstr "OpenGL (ingen filtrering)"
@@ -2161,19 +2161,19 @@ msgctxt "lowres"
msgid "Normal (no scaling)"
msgstr "Normalt (ingen skalning)"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2357
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2289
msgid "Enabled aspect ratio correction"
msgstr "Korrektion av bildfіrhхllande pх"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2363
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2295
msgid "Disabled aspect ratio correction"
msgstr "Korrektion av bildfіrhхllande av"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2418
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2349
msgid "Active graphics filter:"
msgstr "Aktivt grafikfilter:"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2460
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2390
msgid "Windowed mode"
msgstr "Fіnsterlфge"
@@ -2843,7 +2843,7 @@ msgstr "Aktivera fфrgblint lфge som standard"
msgid ""
"ScummVM found that you have old savefiles for Drascula that should be "
"converted.\n"
-"The old save game format is no longer supported, so you will not be able to "
+"The old saved game format is no longer supported, so you will not be able to "
"load your games if you don't convert them.\n"
"\n"
"Press OK to convert them now, otherwise you will be asked again the next "
@@ -3022,11 +3022,11 @@ msgstr ""
#: engines/kyra/saveload_eob.cpp:557
#, c-format
msgid ""
-"The following original save game file has been found in your game path:\n"
+"The following original saved game file has been found in your game path:\n"
"\n"
"%s %s\n"
"\n"
-"Do you wish to use this save game file with ScummVM?\n"
+"Do you wish to use this saved game file with ScummVM?\n"
"\n"
msgstr ""
"Fіljande originalspardata hittades i sіkvфgen fіr ditt spel:\n"
@@ -3040,7 +3040,7 @@ msgstr ""
#: engines/kyra/saveload_eob.cpp:590
#, c-format
msgid ""
-"A save game file was found in the specified slot %d. Overwrite?\n"
+"A saved game file was found in the specified slot %d. Overwrite?\n"
"\n"
msgstr ""
"En sparfil hittades pх den angivna platsen %d. Vill du skriva іver den?\n"
@@ -3049,8 +3049,8 @@ msgstr ""
#: engines/kyra/saveload_eob.cpp:623
#, c-format
msgid ""
-"%d original save game files have been successfully imported into\n"
-"ScummVM. If you want to manually import original save game files later you "
+"%d original saved game files have been successfully imported into\n"
+"ScummVM. If you want to manually import original saved game files later you "
"will\n"
"need to open the ScummVM debug console and use the command "
"'import_savefile'.\n"
@@ -4105,7 +4105,7 @@ msgstr "Filmscenen '%s' hittades ej"
msgid ""
"ScummVM found that you have old savefiles for Broken Sword 1 that should be "
"converted.\n"
-"The old save game format is no longer supported, so you will not be able to "
+"The old saved game format is no longer supported, so you will not be able to "
"load your games if you don't convert them.\n"
"\n"
"Press OK to convert them now, otherwise you will be asked again the next "
@@ -4122,8 +4122,8 @@ msgstr ""
#: engines/sword1/control.cpp:1232
#, c-format
msgid ""
-"Target new save game already exists!\n"
-"Would you like to keep the old save game (%s) or the new one (%s)?\n"
+"Target new saved game already exists!\n"
+"Would you like to keep the old saved game (%s) or the new one (%s)?\n"
msgstr ""
"Den valda spardatan existerar redan!\n"
"Vill du behхlla den gamla spardatan (%s) eller den nya (%s)?\n"
diff --git a/po/uk_UA.po b/po/uk_UA.po
index e69c92aaae..f437aa53b2 100644
--- a/po/uk_UA.po
+++ b/po/uk_UA.po
@@ -6,10 +6,10 @@
#
msgid ""
msgstr ""
-"Project-Id-Version: ScummVM 1.3.0svn\n"
+"Project-Id-Version: ScummVM 1.9.0git\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n"
-"POT-Creation-Date: 2016-09-05 10:12+0200\n"
-"PO-Revision-Date: 2015-11-06 10:07+0300\n"
+"POT-Creation-Date: 2016-09-18 15:13+0100\n"
+"PO-Revision-Date: 2016-09-17 22:36+0200\n"
"Last-Translator: Eugene Sandulenko <sev@scummvm.org>\n"
"Language-Team: Ukrainian\n"
"Language: Ukrainian\n"
@@ -61,7 +61,7 @@ msgstr "Вгору"
#: gui/recorderdialog.cpp:155 gui/remotebrowser.cpp:59
#: gui/saveload-dialog.cpp:383 gui/saveload-dialog.cpp:443
#: gui/saveload-dialog.cpp:717 gui/saveload-dialog.cpp:1111
-#: gui/storagewizarddialog.cpp:69 gui/themebrowser.cpp:55
+#: gui/storagewizarddialog.cpp:68 gui/themebrowser.cpp:55
#: gui/updates-dialog.cpp:113 engines/engine.cpp:549
#: backends/events/default/default-events.cpp:196
#: backends/events/default/default-events.cpp:218
@@ -78,9 +78,8 @@ msgid "Choose"
msgstr "Вибрати"
#: gui/downloaddialog.cpp:48
-#, fuzzy
msgid "Select directory where to download game data"
-msgstr "Виберіть папку з файлами гри"
+msgstr "Виберіть папку куди завантажувати файли гри"
#: gui/downloaddialog.cpp:49 gui/editgamedialog.cpp:472 gui/launcher.cpp:173
msgid "Select directory with game data"
@@ -88,35 +87,37 @@ msgstr "Виберіть папку з файлами гри"
#: gui/downloaddialog.cpp:51 gui/downloaddialog.cpp:263
msgid "From: "
-msgstr ""
+msgstr "Від: "
#: gui/downloaddialog.cpp:52 gui/downloaddialog.cpp:264
msgid "To: "
-msgstr ""
+msgstr "До: "
#: gui/downloaddialog.cpp:63
msgid "Cancel download"
-msgstr ""
+msgstr "Припинити завантаження"
#: gui/downloaddialog.cpp:65
msgctxt "lowres"
msgid "Cancel download"
-msgstr ""
+msgstr "Припинити"
#: gui/downloaddialog.cpp:67
msgid "Hide"
-msgstr ""
+msgstr "Сховати"
#: gui/downloaddialog.cpp:117
msgid ""
"It looks like your connection is limited. Do you really want to download "
"files with it?"
msgstr ""
+"Виглядає, що ваше поточне з'єднання лімітовано. Ви насправді хочете зараз "
+"завантажувати файи на цьому з'єднанні?"
#: gui/downloaddialog.cpp:118 gui/downloaddialog.cpp:152
#: gui/filebrowser-dialog.cpp:132 gui/fluidsynth-dialog.cpp:217
#: gui/launcher.cpp:286 gui/launcher.cpp:394 gui/launcher.cpp:453
-#: gui/storagewizarddialog.cpp:113
+#: gui/storagewizarddialog.cpp:112
#: backends/events/symbiansdl/symbiansdl-events.cpp:186
#: backends/platform/wince/CEActionsPocket.cpp:326
#: backends/platform/wince/CEActionsSmartphone.cpp:287
@@ -128,7 +129,7 @@ msgstr "Так"
#: gui/downloaddialog.cpp:118 gui/downloaddialog.cpp:153
#: gui/filebrowser-dialog.cpp:132 gui/fluidsynth-dialog.cpp:217
#: gui/launcher.cpp:286 gui/launcher.cpp:394 gui/launcher.cpp:453
-#: gui/storagewizarddialog.cpp:113
+#: gui/storagewizarddialog.cpp:112
#: backends/events/symbiansdl/symbiansdl-events.cpp:186
#: backends/platform/wince/CEActionsPocket.cpp:326
#: backends/platform/wince/CEActionsSmartphone.cpp:287
@@ -146,6 +147,8 @@ msgid ""
"Cannot create a directory to download - the specified directory has a file "
"with the same name."
msgstr ""
+"Неможливо створити папку для скачування: вказана папка має файл з такою ж "
+"назвою."
#: gui/downloaddialog.cpp:146 gui/editgamedialog.cpp:293
#: gui/fluidsynth-dialog.cpp:153 gui/KeysDialog.cpp:42 gui/launcher.cpp:501
@@ -173,16 +176,18 @@ msgid ""
"The \"%s\" already exists in the specified directory.\n"
"Do you really want to download files into that directory?"
msgstr ""
+"\"%s\" вже існує у вказаній папці.\n"
+"Чи ви дійсно хочете завантажити файли в цю папку?"
#: gui/downloaddialog.cpp:251
#, c-format
msgid "Downloaded %s %s / %s %s"
-msgstr ""
+msgstr "Завантажено %s %s з %s %s"
#: gui/downloaddialog.cpp:258
-#, fuzzy, c-format
+#, c-format
msgid "Download speed: %s %s"
-msgstr "Пошук закінчено!"
+msgstr "Швидкість завантаження: %s %s"
#: gui/editgamedialog.cpp:132
msgid "Game"
@@ -198,7 +203,7 @@ msgid ""
"Short game identifier used for referring to saved games and running the game "
"from the command line"
msgstr ""
-"Короткий ідентифікатор, який використовується для назв збережених ігор і для "
+"Короткий ідентифікатор, який використовується для назв збережений станів ігор і для "
"запуску з командної стрічки"
#: gui/editgamedialog.cpp:138
@@ -266,12 +271,12 @@ msgstr "Грф"
#: gui/editgamedialog.cpp:187
msgid "Override global graphic settings"
-msgstr "Перекрити глобальні установки графіки"
+msgstr "Перекрити глобальні налаштування графіки"
#: gui/editgamedialog.cpp:189
msgctxt "lowres"
msgid "Override global graphic settings"
-msgstr "Перекрити глобальні установки графіки"
+msgstr "Перекрити глобальні налаштування графіки"
#: gui/editgamedialog.cpp:196 gui/options.cpp:1121
msgid "Audio"
@@ -279,12 +284,12 @@ msgstr "Аудіо"
#: gui/editgamedialog.cpp:199
msgid "Override global audio settings"
-msgstr "Перекрити глобальні установки аудіо"
+msgstr "Перекрити глобальні налаштування аудіо"
#: gui/editgamedialog.cpp:201
msgctxt "lowres"
msgid "Override global audio settings"
-msgstr "Перекрити глобальні установки аудіо"
+msgstr "Перекрити глобальні налаштування аудіо"
#: gui/editgamedialog.cpp:210 gui/options.cpp:1126
msgid "Volume"
@@ -297,12 +302,12 @@ msgstr "Гучн."
#: gui/editgamedialog.cpp:215
msgid "Override global volume settings"
-msgstr "Перекрити глобальні установки гучності"
+msgstr "Перекрити глобальні налаштування гучності"
#: gui/editgamedialog.cpp:217
msgctxt "lowres"
msgid "Override global volume settings"
-msgstr "Перекрити глобальні установки гучності"
+msgstr "Перекрити глобальні налаштування гучності"
#: gui/editgamedialog.cpp:226 gui/options.cpp:1136
msgid "MIDI"
@@ -310,12 +315,12 @@ msgstr "MIDI"
#: gui/editgamedialog.cpp:229
msgid "Override global MIDI settings"
-msgstr "Перекрити глобальні установки MIDI"
+msgstr "Перекрити глобальні налаштування MIDI"
#: gui/editgamedialog.cpp:231
msgctxt "lowres"
msgid "Override global MIDI settings"
-msgstr "Перекрити глобальні установки MIDI"
+msgstr "Перекрити глобальні нааштування MIDI"
#: gui/editgamedialog.cpp:241 gui/options.cpp:1146
msgid "MT-32"
@@ -323,12 +328,12 @@ msgstr "MT-32"
#: gui/editgamedialog.cpp:244
msgid "Override global MT-32 settings"
-msgstr "Перекрити глобальні установки MT-32"
+msgstr "Перекрити глобальні налаштування MT-32"
#: gui/editgamedialog.cpp:246
msgctxt "lowres"
msgid "Override global MT-32 settings"
-msgstr "Перекрити глобальні установки MT-32"
+msgstr "Перекрити глобальні налаштування MT-32"
#: gui/editgamedialog.cpp:255 gui/options.cpp:1153
msgid "Paths"
@@ -370,7 +375,7 @@ msgstr "Шлях збер.:"
#: gui/editgamedialog.cpp:283 gui/options.cpp:1163 gui/options.cpp:1165
#: gui/options.cpp:1166
msgid "Specifies where your saved games are put"
-msgstr "Вказує шлях до збережень гри"
+msgstr "Вказує шлях до збережених станів ігор"
#: gui/editgamedialog.cpp:282 gui/options.cpp:1165
msgctxt "lowres"
@@ -404,12 +409,12 @@ msgstr "Виберіть додаткову папку гри"
#: gui/editgamedialog.cpp:504 gui/options.cpp:1555
msgid "Select directory for saved games"
-msgstr "Виберіть папку для збережень"
+msgstr "Виберіть папку для збережених станів ігор"
#: gui/editgamedialog.cpp:510
msgid ""
-"Saves sync feature doesn't work with non-default directories. If you want "
-"your saves to sync, use default directory."
+"Saved games sync feature doesn't work with non-default directories. If you "
+"want your saved games to sync, use default directory."
msgstr ""
#: gui/editgamedialog.cpp:536
@@ -622,7 +627,7 @@ msgstr "~З~авантажити..."
#: gui/launcher.cpp:124
msgid "Load saved game for selected game"
-msgstr "Завантажити збереження для вибраної гри"
+msgstr "Завантажити збережений стан для вибраної гри"
#: gui/launcher.cpp:129
msgid "~A~dd Game..."
@@ -701,15 +706,15 @@ msgstr ""
#: gui/launcher.cpp:394
msgid "Do you really want to remove this game configuration?"
-msgstr "Ви дійсно хочете видалити установки для цієї гри?"
+msgstr "Ви дійсно хочете видалити налаштування для цієї гри?"
#: gui/launcher.cpp:452
msgid "Do you want to load saved game?"
-msgstr "Ви хочете завантажити збережену гру?"
+msgstr "Ви хочете завантажити збережений стан гри?"
#: gui/launcher.cpp:501
msgid "This game does not support loading games from the launcher."
-msgstr "Ця гра не підтримує завантаження збережень через головне меню."
+msgstr "Ця гра не підтримує завантаження збережених станів ігор через головне меню."
#: gui/launcher.cpp:505
msgid "ScummVM could not find any engine capable of running the selected game!"
@@ -845,7 +850,7 @@ msgid "Special dithering modes supported by some games"
msgstr "Спеціальні режими растрування, які підтримують деякі ігри"
#: gui/options.cpp:789
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2458
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2388
msgid "Fullscreen mode"
msgstr "Повноекранний режим"
@@ -1146,24 +1151,24 @@ msgstr "Перевірити зараз"
#: gui/options.cpp:1284
msgid "Cloud"
-msgstr ""
+msgstr "Хмара"
#: gui/options.cpp:1286
msgctxt "lowres"
msgid "Cloud"
-msgstr ""
+msgstr "Хмара"
#: gui/options.cpp:1297
msgid "Storage:"
-msgstr ""
+msgstr "Середовище:"
#: gui/options.cpp:1297
msgid "Active cloud storage"
-msgstr ""
+msgstr "Активне хмарне середовище"
#: gui/options.cpp:1304 gui/options.cpp:1855
msgid "<none>"
-msgstr ""
+msgstr "<немає>"
#: gui/options.cpp:1308 backends/platform/wii/options.cpp:114
msgid "Username:"
@@ -1171,71 +1176,67 @@ msgstr "Користувач:"
#: gui/options.cpp:1308
msgid "Username used by this storage"
-msgstr ""
+msgstr "Користувач для цього сердовища"
#: gui/options.cpp:1311
msgid "Used space:"
-msgstr ""
+msgstr "Використаний об'єм"
#: gui/options.cpp:1311
-msgid "Space used by ScummVM's saves on this storage"
-msgstr ""
+msgid "Space used by ScummVM's saved games on this storage"
+msgstr "Об'єм, використаний для збережених станів ігор ScummVM на цьому середовищі"
#: gui/options.cpp:1314
msgid "Last sync time:"
-msgstr ""
+msgstr "Остання синхронизація:"
#: gui/options.cpp:1314
-msgid "When the last saves sync for this storage occured"
-msgstr ""
+msgid "When the last saved games sync for this storage occured"
+msgstr "Час, коли було зроблено останню синхронизацію з цим середовищем"
-#: gui/options.cpp:1317 gui/storagewizarddialog.cpp:72
+#: gui/options.cpp:1317 gui/storagewizarddialog.cpp:71
msgid "Connect"
-msgstr ""
+msgstr "Залучитись"
#: gui/options.cpp:1317
msgid "Open wizard dialog to connect your cloud storage account"
-msgstr ""
+msgstr "Розпочати кроки для залучення до вашого облікового засобу на хмарному середовищі"
#: gui/options.cpp:1318
msgid "Refresh"
-msgstr ""
+msgstr "Поновити"
#: gui/options.cpp:1318
msgid "Refresh current cloud storage information (username and usage)"
-msgstr ""
+msgstr "Поновити поточні дані хмарного середовища (ім'я користувача та об'єм)"
#: gui/options.cpp:1319
-#, fuzzy
msgid "Download"
-msgstr "Донизу"
+msgstr "Завантажити"
#: gui/options.cpp:1319
msgid "Open downloads manager dialog"
-msgstr ""
+msgstr "Відкрити керування завантаженнями"
#: gui/options.cpp:1321
msgid "Run server"
-msgstr ""
+msgstr "Запустити сервер"
#: gui/options.cpp:1321
msgid "Run local webserver"
-msgstr ""
+msgstr "Запускає локвальний веб-сервер"
#: gui/options.cpp:1322 gui/options.cpp:1965
-#, fuzzy
msgid "Not running"
-msgstr "Помилка запуску гри:"
+msgstr "Вимкнено"
#: gui/options.cpp:1326
-#, fuzzy
msgid "/root/ Path:"
-msgstr "Додатк. шлях:"
+msgstr "Шлях /root/:"
#: gui/options.cpp:1326 gui/options.cpp:1328 gui/options.cpp:1329
-#, fuzzy
msgid "Specifies which directory the Files Manager can access"
-msgstr "Вказує шлях до збережень гри"
+msgstr "Вказує шлях до якого можна мати доступ через Керування файлами"
#: gui/options.cpp:1328
#, fuzzy
@@ -1259,9 +1260,8 @@ msgid "You have to restart ScummVM before your changes will take effect."
msgstr "Ви повинні перезапустити ScummVM щоб застосувати зміни."
#: gui/options.cpp:1521
-#, fuzzy
msgid "Failed to change cloud storage!"
-msgstr "Не вдалося записати гру"
+msgstr "Не вдалося змінити змарне середовище!"
#: gui/options.cpp:1524
msgid "Another cloud storage is already active."
@@ -1284,9 +1284,8 @@ msgid "Select directory for plugins"
msgstr "Виберіть папку зі втулками"
#: gui/options.cpp:1604
-#, fuzzy
msgid "Select directory for Files Manager /root/"
-msgstr "Виберіть папку з додатковими файлами"
+msgstr "Виберіть папку /root/ для Керування файлами"
#: gui/options.cpp:1666
msgid ""
@@ -1299,31 +1298,31 @@ msgstr ""
#: gui/options.cpp:1862
#, c-format
msgid "%llu bytes"
-msgstr ""
+msgstr "%llu байт"
#: gui/options.cpp:1870
msgid "<right now>"
-msgstr ""
+msgstr "<зараз>"
#: gui/options.cpp:1872
-#, fuzzy
msgid "<never>"
-msgstr "Ніколи"
+msgstr "<ніколи>"
#: gui/options.cpp:1956
-#, fuzzy
msgid "Stop server"
-msgstr "Сервер:"
+msgstr "Вимкнути сервер"
#: gui/options.cpp:1957
msgid "Stop local webserver"
-msgstr ""
+msgstr "Вимкнути локальний веб-сервер"
#: gui/options.cpp:2046
msgid ""
"Request failed.\n"
"Check your Internet connection."
msgstr ""
+"Помилка запиту.\n"
+"Перевірте ваше інтернет-з'єднання."
#. I18N: You must leave "#" as is, only word 'next' is translatable
#: gui/predictivedialog.cpp:86
@@ -1397,9 +1396,8 @@ msgid "Unknown Author"
msgstr "Невідомий автор"
#: gui/remotebrowser.cpp:128
-#, fuzzy
msgid "ScummVM could not access the directory!"
-msgstr "ScummVM не може відкрити вказану папку!"
+msgstr "ScummVM не має доступу до вказаної папки!"
#: gui/saveload-dialog.cpp:334
msgid "List view"
@@ -1423,7 +1421,7 @@ msgstr "Час гри не записано"
#: gui/saveload-dialog.cpp:442
msgid "Do you really want to delete this saved game?"
-msgstr "Ви дійсно хочете видалити це збереження?"
+msgstr "Ви дійсно хочете видалити цей збережений стан гри?"
#: gui/saveload-dialog.cpp:554 gui/saveload-dialog.cpp:1060
msgid "Date: "
@@ -1451,10 +1449,10 @@ msgstr "Попередній"
#: gui/saveload-dialog.cpp:924
msgid "New Save"
-msgstr "Нове збереження"
+msgstr "Новий стан"
#: gui/saveload-dialog.cpp:924
-msgid "Create a new save game"
+msgid "Create a new saved game"
msgstr "Створити новий запис гри"
#: gui/saveload-dialog.cpp:1053
@@ -1466,71 +1464,70 @@ msgstr "Назва: "
msgid "Enter a description for slot %d:"
msgstr "Введіть опис для слоту %d:"
-#: gui/storagewizarddialog.cpp:56
+#: gui/storagewizarddialog.cpp:55
#, c-format
msgid "%s Storage Connection Wizard"
msgstr ""
-#: gui/storagewizarddialog.cpp:59
+#: gui/storagewizarddialog.cpp:58
msgid "Navigate to the following URL:"
msgstr ""
-#: gui/storagewizarddialog.cpp:62
+#: gui/storagewizarddialog.cpp:61
msgid "Obtain the code from the storage, enter it"
msgstr ""
-#: gui/storagewizarddialog.cpp:63
+#: gui/storagewizarddialog.cpp:62
msgid "in the following field and press 'Connect':"
msgstr ""
-#: gui/storagewizarddialog.cpp:70
-#, fuzzy
+#: gui/storagewizarddialog.cpp:69
msgid "Open URL"
-msgstr "OpenGL"
+msgstr "Відкрити URL"
-#: gui/storagewizarddialog.cpp:71
+#: gui/storagewizarddialog.cpp:70
msgid "Paste"
-msgstr ""
+msgstr "Вставити"
-#: gui/storagewizarddialog.cpp:71
+#: gui/storagewizarddialog.cpp:70
msgid "Pastes clipboard contents into fields"
msgstr ""
-#: gui/storagewizarddialog.cpp:79
+#: gui/storagewizarddialog.cpp:78
msgid "You will be directed to ScummVM's page where"
msgstr ""
-#: gui/storagewizarddialog.cpp:80
+#: gui/storagewizarddialog.cpp:79
msgid "you should allow it to access your storage."
msgstr ""
-#: gui/storagewizarddialog.cpp:113
+#: gui/storagewizarddialog.cpp:112
msgid "Another Storage is active. Do you want to interrupt it?"
msgstr ""
-#: gui/storagewizarddialog.cpp:122
+#: gui/storagewizarddialog.cpp:121
msgid "Wait until current Storage finishes up and try again."
msgstr ""
-#: gui/storagewizarddialog.cpp:183
+#: gui/storagewizarddialog.cpp:182
#, c-format
msgid "Field %s has a mistake in it."
msgstr ""
-#: gui/storagewizarddialog.cpp:185
+#: gui/storagewizarddialog.cpp:184
#, c-format
msgid "Fields %s have mistakes in them."
msgstr ""
-#: gui/storagewizarddialog.cpp:200
+#: gui/storagewizarddialog.cpp:199
msgid "All OK!"
msgstr ""
-#: gui/storagewizarddialog.cpp:202
+#: gui/storagewizarddialog.cpp:201
msgid "Invalid code"
msgstr ""
-#: gui/storagewizarddialog.cpp:210
+#: gui/storagewizarddialog.cpp:209
msgid ""
"Failed to open URL!\n"
"Please navigate to this page manually."
@@ -1679,7 +1676,7 @@ msgstr "Не можу знайти необхідного втулка для движка"
#: common/error.cpp:68
msgid "Engine plugin does not support save states"
-msgstr "Втулок движка не підтримує збереження ігор"
+msgstr "Втулок движка не підтримує збережені стани ігор"
#: common/error.cpp:71
msgid "User canceled"
@@ -1897,11 +1894,11 @@ msgstr ""
#: engines/engine.cpp:546
msgid ""
"WARNING: The game you are about to start is not yet fully supported by "
-"ScummVM. As such, it is likely to be unstable, and any saves you make might "
-"not work in future versions of ScummVM."
+"ScummVM. As such, it is likely to be unstable, and any saved game you make "
+"might not work in future versions of ScummVM."
msgstr ""
"ПОПЕРЕДЖЕННЯ: Гра, яку ви хочете запустити, ще не підтримується повністю "
-"ScummVM. Скорше за все вона не буде працювати стабільно, і збереження ігор, "
+"ScummVM. Скорше за все вона не буде працювати стабільно, і збережені стани ігор, "
"які ви зробите, можуть не працювати у подальших версіях ScummVM."
#: engines/engine.cpp:549
@@ -1945,7 +1942,7 @@ msgid ""
"information."
msgstr ""
"Вибраний звуковий пристрій '%s' не може бути використаний. Дивіться файл "
-"логу для додаткової інформації."
+"протоколу для додаткової інформації."
#: audio/mididrv.cpp:257
#, c-format
@@ -1963,7 +1960,7 @@ msgid ""
"information."
msgstr ""
"Уподобаний звуковий пристрій '%s' не може бути використаний. Дивіться файл "
-"логу для додаткової інформації."
+"протоколу для додаткової інформації."
#: audio/mods/paula.cpp:196
msgid "Amiga Audio Emulator"
@@ -2010,19 +2007,20 @@ msgid "C64 Audio Emulator"
msgstr "C64 Аудіо Емулятор"
#: backends/cloud/storage.cpp:210
-#, fuzzy
-msgid "Saves sync complete."
-msgstr "Пошук закінчено!"
+msgid "Saved games sync complete."
+msgstr "Синхронизацію збережених станів закінчено!"
#: backends/cloud/storage.cpp:221
-msgid "Saves sync was cancelled."
-msgstr ""
+msgid "Saved games sync was cancelled."
+msgstr "Синхронизацію збережених станів припинено."
#: backends/cloud/storage.cpp:223
msgid ""
-"Saves sync failed.\n"
+"Saved games sync failed.\n"
"Check your Internet connection."
msgstr ""
+"Помилка синхронизації збережених станів.\n"
+"Перевірте ваше з'єднання з інтернет."
#: backends/cloud/storage.cpp:327
#, c-format
@@ -2030,16 +2028,16 @@ msgid ""
"Download complete.\n"
"Failed to download %u files."
msgstr ""
+"Завантаження закінчено.\n"
+"Не вдалося завантажити %u файлів."
#: backends/cloud/storage.cpp:329
-#, fuzzy
msgid "Download complete."
-msgstr "Пошук закінчено!"
+msgstr "Завантаження закінчено."
#: backends/cloud/storage.cpp:339
-#, fuzzy
msgid "Download failed."
-msgstr "Завантажити файл"
+msgstr "Помилка завантаження."
#: backends/events/default/default-events.cpp:196
msgid "Do you really want to return to the Launcher?"
@@ -2142,11 +2140,11 @@ msgstr "Режим самотягнення включено"
msgid "Swipe three fingers to the right to toggle."
msgstr "Проведіть трьома пальцямі направо для переключення."
-#: backends/graphics/opengl/opengl-graphics.cpp:126
+#: backends/graphics/opengl/opengl-graphics.cpp:129
msgid "OpenGL"
msgstr "OpenGL"
-#: backends/graphics/opengl/opengl-graphics.cpp:127
+#: backends/graphics/opengl/opengl-graphics.cpp:130
msgid "OpenGL (No filtering)"
msgstr "OpenGL (без фільтрів)"
@@ -2161,19 +2159,19 @@ msgctxt "lowres"
msgid "Normal (no scaling)"
msgstr "Без збільшення"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2357
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2289
msgid "Enabled aspect ratio correction"
msgstr "Корекцію співвідношення сторін увімкнено"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2363
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2295
msgid "Disabled aspect ratio correction"
msgstr "Корекцію співвідношення сторін вимкнено"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2418
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2349
msgid "Active graphics filter:"
msgstr "Поточний графічний фільтр:"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2460
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2390
msgid "Windowed mode"
msgstr "Віконний режим"
@@ -2699,22 +2697,20 @@ msgid "Check for Updates..."
msgstr "Перевірити оновлення..."
#: engines/adl/detection.cpp:45 engines/adl/detection.cpp:55
-#, fuzzy
msgid "Color mode"
-msgstr "Режим без кольору"
+msgstr "Кольоровий режим"
#: engines/adl/detection.cpp:46 engines/adl/detection.cpp:56
msgid "Use color graphics"
-msgstr ""
+msgstr "Використовувати кольорову графіку"
#: engines/adl/detection.cpp:65
msgid "Scanlines"
-msgstr ""
+msgstr "Скан-лінії"
#: engines/adl/detection.cpp:66
-#, fuzzy
msgid "Show scanlines"
-msgstr "Показувати лінії об'єктів"
+msgstr "Показувати скан-лінії"
#: engines/agi/detection.cpp:147 engines/cine/detection.cpp:70
#: engines/drascula/detection.cpp:302 engines/dreamweb/detection.cpp:48
@@ -2729,7 +2725,7 @@ msgstr "Використовувати ориг. збереження/завантаження екрани"
#: engines/toltecs/detection.cpp:201
msgid "Use the original save/load screens, instead of the ScummVM ones"
msgstr ""
-"Використовувати оригінальні збереження/завантаження екрани, замість ScummVM"
+"Використовувати оригінальні екрани збереження/завантаження замість ScummVM"
#: engines/agi/detection.cpp:157
msgid "Use an alternative palette"
@@ -2803,7 +2799,7 @@ msgid ""
"\n"
"%s"
msgstr ""
-"Не вдалося завантажити стан гри з файлу:\n"
+"Не вдалося завантажити збережений стан гри з файлу:\n"
"\n"
"%s"
@@ -2846,13 +2842,13 @@ msgstr "Включає режим для людей з погіршенним сприяттям кольору"
msgid ""
"ScummVM found that you have old savefiles for Drascula that should be "
"converted.\n"
-"The old save game format is no longer supported, so you will not be able to "
+"The old saved game format is no longer supported, so you will not be able to "
"load your games if you don't convert them.\n"
"\n"
"Press OK to convert them now, otherwise you will be asked again the next "
"time you start the game.\n"
msgstr ""
-"ScummVM знайшов, що Ви маєте старі збереження ігор для Drascula.\n"
+"ScummVM знайшов, що Ви маєте старі збережені стани ігор для Drascula.\n"
"Збереження у старому форматі не підтримуються, і Ви не зможете їх "
"завантажити, якщо не переведете у новий формат.\n"
"\n"
@@ -2870,7 +2866,7 @@ msgstr "Відображення графіки з використанням яскравої палітри ігр"
#: engines/gob/inter_playtoons.cpp:255 engines/gob/inter_v2.cpp:1467
#: engines/gob/inter_geisha.cpp:232 engines/tinsel/saveload.cpp:532
msgid "Failed to load game state from file."
-msgstr "Не вдалося завантажити стан гри з файлу."
+msgstr "Не вдалося завантажити зюережений стан гри з файлу."
#: engines/gob/inter_v2.cpp:1537 engines/gob/inter_geisha.cpp:263
#: engines/tinsel/saveload.cpp:545
@@ -3024,40 +3020,40 @@ msgstr ""
#: engines/kyra/saveload_eob.cpp:557
#, c-format
msgid ""
-"The following original save game file has been found in your game path:\n"
+"The following original saved game file has been found in your game path:\n"
"\n"
"%s %s\n"
"\n"
-"Do you wish to use this save game file with ScummVM?\n"
+"Do you wish to use this saved game file with ScummVM?\n"
"\n"
msgstr ""
-"Наступний оригінальний файл стану гри було знайдено у вашій папці з грою:\n"
+"Наступний оригінальний файл збереженого стану гри було знайдено у вашій папці з грою:\n"
"\n"
"%s %s\n"
"\n"
-"Чи ви бажаєте використовувати цей стан гри зі ScummVM?\n"
+"Чи ви бажаєте використовувати цей збережений стан гри зі ScummVM?\n"
"\n"
#: engines/kyra/saveload_eob.cpp:590
#, c-format
msgid ""
-"A save game file was found in the specified slot %d. Overwrite?\n"
+"A saved game file was found in the specified slot %d. Overwrite?\n"
"\n"
msgstr ""
-"Файл стану гри було знайдено у вказаній позиції %d. Перетерти?\n"
+"Файл збереженого стану гри було знайдено у вказаній позиції %d. Перетерти?\n"
"\n"
#: engines/kyra/saveload_eob.cpp:623
#, c-format
msgid ""
-"%d original save game files have been successfully imported into\n"
-"ScummVM. If you want to manually import original save game files later you "
+"%d original saved game files have been successfully imported into\n"
+"ScummVM. If you want to manually import original saved game files later you "
"will\n"
"need to open the ScummVM debug console and use the command "
"'import_savefile'.\n"
"\n"
msgstr ""
-"%d оригінальних файлів зі станом гри було успішно імпортовано у\n"
+"%d оригінальних файлів зі збереженеми станами гри було успішно імпортовано у\n"
"ScummVM. Якщо ви захочете пізніше імпортувати оригінальні файли зі станом "
"гри, вам потрібно\n"
"відкрити консоль відладчика і ввести команду 'import_savefile'.\n"
@@ -3119,7 +3115,7 @@ msgid ""
"Can't save game in slot %i\n"
"\n"
msgstr ""
-"Не можу зберегти гру у слот %i\n"
+"Не можу зберегти стан гри у слот %i\n"
"\n"
#: engines/parallaction/saveload.cpp:194
@@ -3147,7 +3143,7 @@ msgid ""
"\n"
"Press OK to convert them now, otherwise you will be asked next time.\n"
msgstr ""
-"ScummVM знайшов, що Ви маєте старі збереження ігор для Nippon Safes.\n"
+"ScummVM знайшов, що Ви маєте старі збережені стани ігор для Nippon Safes.\n"
"Збереження у старому форматі не підтримуються, і Ви не зможете їх "
"завантажити, якщо не переведете у новий формат.\n"
"\n"
@@ -3156,7 +3152,7 @@ msgstr ""
#: engines/parallaction/saveload.cpp:316
msgid "ScummVM successfully converted all your savefiles."
-msgstr "ScummVM успішно перевів усі Ваші збереження."
+msgstr "ScummVM успішно перевів усі Ваші збережені стани."
#: engines/parallaction/saveload.cpp:318
msgid ""
@@ -3172,7 +3168,7 @@ msgstr ""
#: engines/pegasus/pegasus.cpp:714
msgid "Invalid save file name"
-msgstr "Неправильна назва файлу збереження"
+msgstr "Неправильна назва файлу збереження стану"
#: engines/pegasus/pegasus.cpp:2507
msgid "Up/Zoom In/Move Forward/Open Doors"
@@ -3234,11 +3230,11 @@ msgstr "Увімкнути графіку та контент у високому розгалуженні"
#: engines/sci/detection.cpp:410
msgid "Enable black-lined video"
-msgstr ""
+msgstr "Увімкнути відео з чорними лініями"
#: engines/sci/detection.cpp:411
msgid "Draw black lines over videos to increase their apparent sharpness"
-msgstr ""
+msgstr "Малювати чорні лінії поверху відео щоб посилити їхню чіткість"
#: engines/sci/detection.cpp:420
msgid "Prefer digital sound effects"
@@ -3333,7 +3329,7 @@ msgstr "Грати"
#: engines/scumm/dialogs.cpp:190
msgid "Insert save/load game disk"
-msgstr "Вставте диск зі збереженням ігор"
+msgstr "Вставте диск зі збереженими станами ігор"
#: engines/scumm/dialogs.cpp:191
msgid "You must enter a name"
@@ -3359,7 +3355,7 @@ msgstr "Завантажую '%s'"
#: engines/scumm/dialogs.cpp:196
msgid "Name your SAVE game"
-msgstr "Назовіть своє збереження ігри"
+msgstr "Назовіть свій збережений стан ігри"
#: engines/scumm/dialogs.cpp:197
msgid "Select a game to LOAD"
@@ -4100,13 +4096,13 @@ msgstr "Ролик '%s' не знайдено"
msgid ""
"ScummVM found that you have old savefiles for Broken Sword 1 that should be "
"converted.\n"
-"The old save game format is no longer supported, so you will not be able to "
+"The old saved game format is no longer supported, so you will not be able to "
"load your games if you don't convert them.\n"
"\n"
"Press OK to convert them now, otherwise you will be asked again the next "
"time you start the game.\n"
msgstr ""
-"ScummVM знайшов, що Ви маєте старі збереження ігор для Broken Sword 1.\n"
+"ScummVM знайшов, що Ви маєте старі збережені стани ігор для Broken Sword 1.\n"
"Збереження у старому форматі не підтримуються, і Ви не зможете їх "
"завантажити, якщо не переведете у новий формат.\n"
"\n"
@@ -4116,11 +4112,11 @@ msgstr ""
#: engines/sword1/control.cpp:1232
#, c-format
msgid ""
-"Target new save game already exists!\n"
-"Would you like to keep the old save game (%s) or the new one (%s)?\n"
+"Target new saved game already exists!\n"
+"Would you like to keep the old saved game (%s) or the new one (%s)?\n"
msgstr ""
"Збереження гри з такою назвою вже існує!\n"
-"Чи ви хочете лишити старе збереження (%s) або нове (%s)?\n"
+"Чи ви хочете лишити старий збережений стан (%s) або нове (%s)?\n"
#: engines/sword1/control.cpp:1235
msgid "Keep the old one"
@@ -4219,7 +4215,3 @@ msgid "Use MPEG video from the DVD version, instead of lower resolution AVI"
msgstr ""
"Використовувати відео MPEG з DVD-версії, замість файлів AVI з ніжчою "
"роздільною здатністю"
-
-#, fuzzy
-#~ msgid "Specifies where Files Manager can access to"
-#~ msgstr "Вказує шлях до збережень гри"
diff --git a/po/zh-Latn_CN.po b/po/zh-Latn_CN.po
index ebaac184ac..6edb532dc3 100644
--- a/po/zh-Latn_CN.po
+++ b/po/zh-Latn_CN.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: ScummVM 1.9.0git\n"
"Report-Msgid-Bugs-To: scummvm-devel@lists.sf.net\n"
-"POT-Creation-Date: 2016-09-05 10:12+0200\n"
+"POT-Creation-Date: 2016-09-18 15:13+0100\n"
"PO-Revision-Date: 2016-03-15 04:09-0700\n"
"Last-Translator: Chenbo Li <lichenbo1949@gmail.com>\n"
"Language-Team: Chenbo Li <lichenbo1949@gmail.com>\n"
@@ -59,7 +59,7 @@ msgstr "ShangYiJi"
#: gui/recorderdialog.cpp:155 gui/remotebrowser.cpp:59
#: gui/saveload-dialog.cpp:383 gui/saveload-dialog.cpp:443
#: gui/saveload-dialog.cpp:717 gui/saveload-dialog.cpp:1111
-#: gui/storagewizarddialog.cpp:69 gui/themebrowser.cpp:55
+#: gui/storagewizarddialog.cpp:68 gui/themebrowser.cpp:55
#: gui/updates-dialog.cpp:113 engines/engine.cpp:549
#: backends/events/default/default-events.cpp:196
#: backends/events/default/default-events.cpp:218
@@ -114,7 +114,7 @@ msgstr ""
#: gui/downloaddialog.cpp:118 gui/downloaddialog.cpp:152
#: gui/filebrowser-dialog.cpp:132 gui/fluidsynth-dialog.cpp:217
#: gui/launcher.cpp:286 gui/launcher.cpp:394 gui/launcher.cpp:453
-#: gui/storagewizarddialog.cpp:113
+#: gui/storagewizarddialog.cpp:112
#: backends/events/symbiansdl/symbiansdl-events.cpp:186
#: backends/platform/wince/CEActionsPocket.cpp:326
#: backends/platform/wince/CEActionsSmartphone.cpp:287
@@ -126,7 +126,7 @@ msgstr "Shi"
#: gui/downloaddialog.cpp:118 gui/downloaddialog.cpp:153
#: gui/filebrowser-dialog.cpp:132 gui/fluidsynth-dialog.cpp:217
#: gui/launcher.cpp:286 gui/launcher.cpp:394 gui/launcher.cpp:453
-#: gui/storagewizarddialog.cpp:113
+#: gui/storagewizarddialog.cpp:112
#: backends/events/symbiansdl/symbiansdl-events.cpp:186
#: backends/platform/wince/CEActionsPocket.cpp:326
#: backends/platform/wince/CEActionsSmartphone.cpp:287
@@ -405,8 +405,8 @@ msgstr "Xuanze Youxi Baocun Mulu"
#: gui/editgamedialog.cpp:510
msgid ""
-"Saves sync feature doesn't work with non-default directories. If you want "
-"your saves to sync, use default directory."
+"Saved games sync feature doesn't work with non-default directories. If you "
+"want your saved games to sync, use default directory."
msgstr ""
#: gui/editgamedialog.cpp:536
@@ -840,7 +840,7 @@ msgid "Special dithering modes supported by some games"
msgstr "Youxi Zhichi Teshu de Doudong Moshi"
#: gui/options.cpp:789
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2458
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2388
msgid "Fullscreen mode"
msgstr "Quanping Moshi"
@@ -1170,7 +1170,7 @@ msgid "Used space:"
msgstr ""
#: gui/options.cpp:1311
-msgid "Space used by ScummVM's saves on this storage"
+msgid "Space used by ScummVM's saved games on this storage"
msgstr ""
#: gui/options.cpp:1314
@@ -1178,10 +1178,10 @@ msgid "Last sync time:"
msgstr ""
#: gui/options.cpp:1314
-msgid "When the last saves sync for this storage occured"
+msgid "When the last saved games sync for this storage occured"
msgstr ""
-#: gui/options.cpp:1317 gui/storagewizarddialog.cpp:72
+#: gui/options.cpp:1317 gui/storagewizarddialog.cpp:71
msgid "Connect"
msgstr ""
@@ -1446,7 +1446,7 @@ msgid "New Save"
msgstr "Xinjian Cundang"
#: gui/saveload-dialog.cpp:924
-msgid "Create a new save game"
+msgid "Create a new saved game"
msgstr "Chuangjian Yige Xin Cundang"
#: gui/saveload-dialog.cpp:1053
@@ -1458,71 +1458,71 @@ msgstr "Mingcheng:"
msgid "Enter a description for slot %d:"
msgstr "Shuru dui %d Dangwei de Miaoshu"
-#: gui/storagewizarddialog.cpp:56
+#: gui/storagewizarddialog.cpp:55
#, c-format
msgid "%s Storage Connection Wizard"
msgstr ""
-#: gui/storagewizarddialog.cpp:59
+#: gui/storagewizarddialog.cpp:58
msgid "Navigate to the following URL:"
msgstr ""
-#: gui/storagewizarddialog.cpp:62
+#: gui/storagewizarddialog.cpp:61
msgid "Obtain the code from the storage, enter it"
msgstr ""
-#: gui/storagewizarddialog.cpp:63
+#: gui/storagewizarddialog.cpp:62
msgid "in the following field and press 'Connect':"
msgstr ""
-#: gui/storagewizarddialog.cpp:70
+#: gui/storagewizarddialog.cpp:69
#, fuzzy
msgid "Open URL"
msgstr "OpenGL"
-#: gui/storagewizarddialog.cpp:71
+#: gui/storagewizarddialog.cpp:70
msgid "Paste"
msgstr ""
-#: gui/storagewizarddialog.cpp:71
+#: gui/storagewizarddialog.cpp:70
msgid "Pastes clipboard contents into fields"
msgstr ""
-#: gui/storagewizarddialog.cpp:79
+#: gui/storagewizarddialog.cpp:78
msgid "You will be directed to ScummVM's page where"
msgstr ""
-#: gui/storagewizarddialog.cpp:80
+#: gui/storagewizarddialog.cpp:79
msgid "you should allow it to access your storage."
msgstr ""
-#: gui/storagewizarddialog.cpp:113
+#: gui/storagewizarddialog.cpp:112
msgid "Another Storage is active. Do you want to interrupt it?"
msgstr ""
-#: gui/storagewizarddialog.cpp:122
+#: gui/storagewizarddialog.cpp:121
msgid "Wait until current Storage finishes up and try again."
msgstr ""
-#: gui/storagewizarddialog.cpp:183
+#: gui/storagewizarddialog.cpp:182
#, c-format
msgid "Field %s has a mistake in it."
msgstr ""
-#: gui/storagewizarddialog.cpp:185
+#: gui/storagewizarddialog.cpp:184
#, c-format
msgid "Fields %s have mistakes in them."
msgstr ""
-#: gui/storagewizarddialog.cpp:200
+#: gui/storagewizarddialog.cpp:199
msgid "All OK!"
msgstr ""
-#: gui/storagewizarddialog.cpp:202
+#: gui/storagewizarddialog.cpp:201
msgid "Invalid code"
msgstr ""
-#: gui/storagewizarddialog.cpp:210
+#: gui/storagewizarddialog.cpp:209
msgid ""
"Failed to open URL!\n"
"Please navigate to this page manually."
@@ -1886,8 +1886,8 @@ msgstr ""
#: engines/engine.cpp:546
msgid ""
"WARNING: The game you are about to start is not yet fully supported by "
-"ScummVM. As such, it is likely to be unstable, and any saves you make might "
-"not work in future versions of ScummVM."
+"ScummVM. As such, it is likely to be unstable, and any saved game you make "
+"might not work in future versions of ScummVM."
msgstr ""
"Jinggao: Nin Yao Yunxing de Youxi Bingwei Wanquan Bei ScummVM Zhichi. Youxi "
"Yunxing Youkeneng Buwending, Renhe Cundang Youkeneng zai Yihou de ScummVM "
@@ -2000,16 +2000,16 @@ msgstr "C64 Yinpin Moniqi"
#: backends/cloud/storage.cpp:210
#, fuzzy
-msgid "Saves sync complete."
+msgid "Saved games sync complete."
msgstr "Saomiao Wancheng!"
#: backends/cloud/storage.cpp:221
-msgid "Saves sync was cancelled."
+msgid "Saved games sync was cancelled."
msgstr ""
#: backends/cloud/storage.cpp:223
msgid ""
-"Saves sync failed.\n"
+"Saved games sync failed.\n"
"Check your Internet connection."
msgstr ""
@@ -2131,11 +2131,11 @@ msgstr "Muqian Wei Zidong Tuozhuai Moshi"
msgid "Swipe three fingers to the right to toggle."
msgstr "Xiangyou Huadong San Gen Shouzhi Qiehuan"
-#: backends/graphics/opengl/opengl-graphics.cpp:126
+#: backends/graphics/opengl/opengl-graphics.cpp:129
msgid "OpenGL"
msgstr "OpenGL"
-#: backends/graphics/opengl/opengl-graphics.cpp:127
+#: backends/graphics/opengl/opengl-graphics.cpp:130
msgid "OpenGL (No filtering)"
msgstr "OpenGL"
@@ -2150,19 +2150,19 @@ msgctxt "lowres"
msgid "Normal (no scaling)"
msgstr "Putong"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2357
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2289
msgid "Enabled aspect ratio correction"
msgstr "Qiyong Bili Jiaozheng"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2363
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2295
msgid "Disabled aspect ratio correction"
msgstr "Jinyong Bili Jiaozheng"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2418
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2349
msgid "Active graphics filter:"
msgstr "Huodong de Tuxing Guolvqi:"
-#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2460
+#: backends/graphics/surfacesdl/surfacesdl-graphics.cpp:2390
msgid "Windowed mode"
msgstr "Chuangkou Moshi"
@@ -2827,7 +2827,7 @@ msgstr "Moren Qiyong Semang Moshi"
msgid ""
"ScummVM found that you have old savefiles for Drascula that should be "
"converted.\n"
-"The old save game format is no longer supported, so you will not be able to "
+"The old saved game format is no longer supported, so you will not be able to "
"load your games if you don't convert them.\n"
"\n"
"Press OK to convert them now, otherwise you will be asked again the next "
@@ -3006,11 +3006,11 @@ msgstr ""
#: engines/kyra/saveload_eob.cpp:557
#, c-format
msgid ""
-"The following original save game file has been found in your game path:\n"
+"The following original saved game file has been found in your game path:\n"
"\n"
"%s %s\n"
"\n"
-"Do you wish to use this save game file with ScummVM?\n"
+"Do you wish to use this saved game file with ScummVM?\n"
"\n"
msgstr ""
"Xialie Yuanshi Cundang Wenjian Zai Nin de Youxi Lujing Zhong:\n"
@@ -3023,7 +3023,7 @@ msgstr ""
#: engines/kyra/saveload_eob.cpp:590
#, c-format
msgid ""
-"A save game file was found in the specified slot %d. Overwrite?\n"
+"A saved game file was found in the specified slot %d. Overwrite?\n"
"\n"
msgstr ""
"Zai Cundang %d Zhong Yifaxian Baocun de Youxi WEnjian. Fugai Ma?\n"
@@ -3032,8 +3032,8 @@ msgstr ""
#: engines/kyra/saveload_eob.cpp:623
#, c-format
msgid ""
-"%d original save game files have been successfully imported into\n"
-"ScummVM. If you want to manually import original save game files later you "
+"%d original saved game files have been successfully imported into\n"
+"ScummVM. If you want to manually import original saved game files later you "
"will\n"
"need to open the ScummVM debug console and use the command "
"'import_savefile'.\n"
@@ -4076,7 +4076,7 @@ msgstr "Guochang '%s' Weizhaodao"
msgid ""
"ScummVM found that you have old savefiles for Broken Sword 1 that should be "
"converted.\n"
-"The old save game format is no longer supported, so you will not be able to "
+"The old saved game format is no longer supported, so you will not be able to "
"load your games if you don't convert them.\n"
"\n"
"Press OK to convert them now, otherwise you will be asked again the next "
@@ -4092,8 +4092,8 @@ msgstr ""
#: engines/sword1/control.cpp:1232
#, c-format
msgid ""
-"Target new save game already exists!\n"
-"Would you like to keep the old save game (%s) or the new one (%s)?\n"
+"Target new saved game already exists!\n"
+"Would you like to keep the old saved game (%s) or the new one (%s)?\n"
msgstr ""
"Mubiao Xin Cundang Yijing Cunzai!\n"
"Niyao Baocun jiude Cundang (%s) Haishi Xinde(%s)?\n"