[Scummvm-git-logs] scummvm master -> a1c58483904595a93b4e556dd07ac06f1905dbc9
dreammaster
paulfgilbert at gmail.com
Sat Apr 25 16:10:34 UTC 2020
This automated email contains information about 8 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
4103fe0df7 ULTIMA4: Change intro global to g_intro
60f451e7a4 ULTIMA4: Move settingsChanged to IntroController
5c0ace61a8 ULTIMA4: Fixes for switching video mode in Config menu
dd050238e8 ULTIMA4: Fix entering uppercase keys
06ca44d53d ULTIMA4: Fixes for quitting ScummVM during Initiate
d08468e311 ULTIMA4: Rename all IOS defines to IOS_ULTIMA4
a0b0074659 ULTIMA4: Fixes to word capitalizations in field names
a1c5848390 ULTIMA8: Fix uninitialized variable warning
Commit: 4103fe0df79cf42532111ff619ff8cdb5fcc4313
https://github.com/scummvm/scummvm/commit/4103fe0df79cf42532111ff619ff8cdb5fcc4313
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2020-04-25T09:06:39-07:00
Commit Message:
ULTIMA4: Change intro global to g_intro
Changed paths:
engines/ultima/ultima4/controllers/intro_controller.cpp
engines/ultima/ultima4/controllers/intro_controller.h
engines/ultima/ultima4/gfx/imagemgr.cpp
engines/ultima/ultima4/gfx/screen.cpp
engines/ultima/ultima4/ultima4.cpp
diff --git a/engines/ultima/ultima4/controllers/intro_controller.cpp b/engines/ultima/ultima4/controllers/intro_controller.cpp
index 5c8df629d7..7fb639d1c1 100644
--- a/engines/ultima/ultima4/controllers/intro_controller.cpp
+++ b/engines/ultima/ultima4/controllers/intro_controller.cpp
@@ -51,7 +51,7 @@ using namespace std;
Common::String profileName;
bool useProfile;
-IntroController *intro = nullptr;
+IntroController *g_intro;
#define INTRO_MAP_HEIGHT 5
#define INTRO_MAP_WIDTH 19
@@ -1503,7 +1503,7 @@ void IntroController::getTitleSourceData() {
switch (_titles[i]._method) {
case SIGNATURE: {
// PLOT: "Lord British"
- srcData = intro->getSigData();
+ srcData = g_intro->getSigData();
RGBA color = info->_image->setColor(0, 255, 255); // cyan for EGA
int x = 0, y = 0;
@@ -1836,7 +1836,7 @@ bool IntroController::updateTitle() {
Image *screen = imageMgr->get("screen")->_image;
// draw the updated map display
- intro->drawMapStatic();
+ g_intro->drawMapStatic();
screen->drawSubRectOn(
_title->_srcImage,
diff --git a/engines/ultima/ultima4/controllers/intro_controller.h b/engines/ultima/ultima4/controllers/intro_controller.h
index bc914bc2d8..7c3eb6e8da 100644
--- a/engines/ultima/ultima4/controllers/intro_controller.h
+++ b/engines/ultima/ultima4/controllers/intro_controller.h
@@ -431,7 +431,7 @@ private:
bool _bSkipTitles;
};
-extern IntroController *intro;
+extern IntroController *g_intro;
} // End of namespace Ultima4
} // End of namespace Ultima
diff --git a/engines/ultima/ultima4/gfx/imagemgr.cpp b/engines/ultima/ultima4/gfx/imagemgr.cpp
index 26b6acbdf9..e64aa6d745 100644
--- a/engines/ultima/ultima4/gfx/imagemgr.cpp
+++ b/engines/ultima/ultima4/gfx/imagemgr.cpp
@@ -214,7 +214,7 @@ void ImageMgr::fixupIntro(Image *im, int prescale) {
bool alpha = im->isAlphaOn();
RGBA color;
- sigData = intro->getSigData();
+ sigData = g_intro->getSigData();
im->alphaOff();
if (settings._videoType != "VGA-ALLPNG" && settings._videoType != "new") {
/* ----------------------------
diff --git a/engines/ultima/ultima4/gfx/screen.cpp b/engines/ultima/ultima4/gfx/screen.cpp
index c7b5bf6fb0..65a4d4a46d 100644
--- a/engines/ultima/ultima4/gfx/screen.cpp
+++ b/engines/ultima/ultima4/gfx/screen.cpp
@@ -214,13 +214,13 @@ MouseCursorSurface *Screen::loadMouseCursor(Shared::File &src) {
}
void Screen::screenReInit() {
- intro->deleteIntro(); /* delete intro stuff */
- Tileset::unloadAllImages(); /* unload tilesets, which will be reloaded lazily as needed */
+ g_intro->deleteIntro(); // delete intro stuff
+ Tileset::unloadAllImages(); // unload tilesets, which will be reloaded lazily as needed
ImageMgr::destroy();
_tileAnims = nullptr;
clear();
- init(); // re-init screen stuff (loading new backgrounds, etc.)
- intro->init(); /* re-fix the backgrounds loaded and scale images, etc. */
+ init(); // Re-init screen stuff (loading new backgrounds, etc.)
+ g_intro->init(); // Re-fix the backgrounds loaded and scale images, etc.
}
void Screen::screenTextAt(int x, int y, const char *fmt, ...) {
diff --git a/engines/ultima/ultima4/ultima4.cpp b/engines/ultima/ultima4/ultima4.cpp
index 0fa7dcb02b..8a8349ed99 100644
--- a/engines/ultima/ultima4/ultima4.cpp
+++ b/engines/ultima/ultima4/ultima4.cpp
@@ -108,14 +108,14 @@ void Ultima4Engine::startup() {
if (!skipInfo) {
// do the intro
- intro = new IntroController();
- intro->init();
- intro->preloadMap();
+ g_intro = new IntroController();
+ g_intro->init();
+ g_intro->preloadMap();
- eventHandler->pushController(intro);
+ eventHandler->pushController(g_intro);
eventHandler->run();
eventHandler->popController();
- intro->deleteIntro();
+ g_intro->deleteIntro();
}
}
Commit: 60f451e7a41754293129a9797239dc4c5a702693
https://github.com/scummvm/scummvm/commit/60f451e7a41754293129a9797239dc4c5a702693
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2020-04-25T09:06:39-07:00
Commit Message:
ULTIMA4: Move settingsChanged to IntroController
Changed paths:
engines/ultima/ultima4/controllers/intro_controller.cpp
engines/ultima/ultima4/controllers/intro_controller.h
diff --git a/engines/ultima/ultima4/controllers/intro_controller.cpp b/engines/ultima/ultima4/controllers/intro_controller.cpp
index 7fb639d1c1..a2cb564459 100644
--- a/engines/ultima/ultima4/controllers/intro_controller.cpp
+++ b/engines/ultima/ultima4/controllers/intro_controller.cpp
@@ -74,9 +74,6 @@ public:
MapTile tile; /* base tile + tile frame */
};
-/* temporary place-holder for settings changes */
-SettingsData settingsChanged;
-
const int IntroBinData::INTRO_TEXT_OFFSET = 17445 - 1; // (start at zero)
const int IntroBinData::INTRO_MAP_OFFSET = 30339;
const int IntroBinData::INTRO_FIXUPDATA_OFFSET = 29806;
@@ -209,7 +206,7 @@ IntroController::IntroController() : Controller(1),
_confMenu.add(MI_CONF_SOUND, "\010 Sound Options", 2, 3,/*'s'*/ 2);
_confMenu.add(MI_CONF_INPUT, "\010 Input Options", 2, 4,/*'i'*/ 2);
_confMenu.add(MI_CONF_SPEED, "\010 Speed Options", 2, 5,/*'p'*/ 3);
- _confMenu.add(MI_CONF_01, new BoolMenuItem("Game Enhancements %s", 2, 7,/*'e'*/ 5, &settingsChanged._enhancements));
+ _confMenu.add(MI_CONF_01, new BoolMenuItem("Game Enhancements %s", 2, 7,/*'e'*/ 5, &_settingsChanged._enhancements));
_confMenu.add(MI_CONF_GAMEPLAY, "\010 Enhanced Gameplay Options", 2, 9,/*'g'*/ 11);
_confMenu.add(MI_CONF_INTERFACE, "\010 Enhanced Interface Options", 2, 10,/*'n'*/ 12);
_confMenu.add(CANCEL, "\017 Main Menu", 2, 12,/*'m'*/ 2);
@@ -222,7 +219,7 @@ IntroController::IntroController() : Controller(1),
_videoMenu.setTitle("Video Options:", 0, 0);
_videoMenu.add(MI_VIDEO_CONF_GFX, "\010 Game Graphics Options", 2, 2,/*'g'*/ 2);
- _videoMenu.add(MI_VIDEO_08, new IntMenuItem("Gamma %s", 2, 4,/*'a'*/ 1, &settingsChanged._gamma, 50, 150, 10, MENU_OUTPUT_GAMMA));
+ _videoMenu.add(MI_VIDEO_08, new IntMenuItem("Gamma %s", 2, 4,/*'a'*/ 1, &_settingsChanged._gamma, 50, 150, 10, MENU_OUTPUT_GAMMA));
_videoMenu.add(USE_SETTINGS, "\010 Use These Settings", 2, 11,/*'u'*/ 2);
_videoMenu.add(CANCEL, "\010 Cancel", 2, 12,/*'c'*/ 2);
_videoMenu.addShortcutKey(CANCEL, ' ');
@@ -230,21 +227,21 @@ IntroController::IntroController() : Controller(1),
_videoMenu.setClosesMenu(CANCEL);
_gfxMenu.setTitle("Game Graphics Options", 0, 0);
- _gfxMenu.add(MI_GFX_SCHEME, new StringMenuItem("Graphics Scheme %s", 2, 2, /*'G'*/ 0, &settingsChanged._videoType, imageMgr->getSetNames()));
- _gfxMenu.add(MI_GFX_TILE_TRANSPARENCY, new BoolMenuItem("Transparency Hack %s", 2, 4, /*'t'*/ 0, &settingsChanged._enhancementsOptions._u4TileTransparencyHack));
- _gfxMenu.add(MI_GFX_TILE_TRANSPARENCY_SHADOW_SIZE, new IntMenuItem(" Shadow Size: %d", 2, 5, /*'s'*/ 9, &settingsChanged._enhancementsOptions._u4TrileTransparencyHackShadowBreadth, 0, 16, 1));
- _gfxMenu.add(MI_GFX_TILE_TRANSPARENCY_SHADOW_OPACITY, new IntMenuItem(" Shadow Opacity: %d", 2, 6, /*'o'*/ 9, &settingsChanged._enhancementsOptions._u4TileTransparencyHackPixelShadowOpacity, 8, 256, 8));
- _gfxMenu.add(MI_VIDEO_02, new StringMenuItem("Gem Layout %s", 2, 8,/*'e'*/ 1, &settingsChanged._gemLayout, screenGetGemLayoutNames()));
- _gfxMenu.add(MI_VIDEO_03, new StringMenuItem("Line Of Sight %s", 2, 9,/*'l'*/ 0, &settingsChanged._lineOfSight, screenGetLineOfSightStyles()));
- _gfxMenu.add(MI_VIDEO_07, new BoolMenuItem("Screen Shaking %s", 2, 10,/*'k'*/ 8, &settingsChanged._screenShakes));
+ _gfxMenu.add(MI_GFX_SCHEME, new StringMenuItem("Graphics Scheme %s", 2, 2, /*'G'*/ 0, &_settingsChanged._videoType, imageMgr->getSetNames()));
+ _gfxMenu.add(MI_GFX_TILE_TRANSPARENCY, new BoolMenuItem("Transparency Hack %s", 2, 4, /*'t'*/ 0, &_settingsChanged._enhancementsOptions._u4TileTransparencyHack));
+ _gfxMenu.add(MI_GFX_TILE_TRANSPARENCY_SHADOW_SIZE, new IntMenuItem(" Shadow Size: %d", 2, 5, /*'s'*/ 9, &_settingsChanged._enhancementsOptions._u4TrileTransparencyHackShadowBreadth, 0, 16, 1));
+ _gfxMenu.add(MI_GFX_TILE_TRANSPARENCY_SHADOW_OPACITY, new IntMenuItem(" Shadow Opacity: %d", 2, 6, /*'o'*/ 9, &_settingsChanged._enhancementsOptions._u4TileTransparencyHackPixelShadowOpacity, 8, 256, 8));
+ _gfxMenu.add(MI_VIDEO_02, new StringMenuItem("Gem Layout %s", 2, 8,/*'e'*/ 1, &_settingsChanged._gemLayout, screenGetGemLayoutNames()));
+ _gfxMenu.add(MI_VIDEO_03, new StringMenuItem("Line Of Sight %s", 2, 9,/*'l'*/ 0, &_settingsChanged._lineOfSight, screenGetLineOfSightStyles()));
+ _gfxMenu.add(MI_VIDEO_07, new BoolMenuItem("Screen Shaking %s", 2, 10,/*'k'*/ 8, &_settingsChanged._screenShakes));
_gfxMenu.add(MI_GFX_RETURN, "\010 Return to Video Options", 2, 12,/*'r'*/ 2);
_gfxMenu.setClosesMenu(MI_GFX_RETURN);
_soundMenu.setTitle("Sound Options:", 0, 0);
- _soundMenu.add(MI_SOUND_01, new IntMenuItem("Music Volume %s", 2, 2,/*'m'*/ 0, &settingsChanged._musicVol, 0, MAX_VOLUME, 1, MENU_OUTPUT_VOLUME));
- _soundMenu.add(MI_SOUND_02, new IntMenuItem("Sound Effect Volume %s", 2, 3,/*'s'*/ 0, &settingsChanged._soundVol, 0, MAX_VOLUME, 1, MENU_OUTPUT_VOLUME));
- _soundMenu.add(MI_SOUND_03, new BoolMenuItem("Fading %s", 2, 4,/*'f'*/ 0, &settingsChanged._volumeFades));
+ _soundMenu.add(MI_SOUND_01, new IntMenuItem("Music Volume %s", 2, 2,/*'m'*/ 0, &_settingsChanged._musicVol, 0, MAX_VOLUME, 1, MENU_OUTPUT_VOLUME));
+ _soundMenu.add(MI_SOUND_02, new IntMenuItem("Sound Effect Volume %s", 2, 3,/*'s'*/ 0, &_settingsChanged._soundVol, 0, MAX_VOLUME, 1, MENU_OUTPUT_VOLUME));
+ _soundMenu.add(MI_SOUND_03, new BoolMenuItem("Fading %s", 2, 4,/*'f'*/ 0, &_settingsChanged._volumeFades));
_soundMenu.add(USE_SETTINGS, "\010 Use These Settings", 2, 11,/*'u'*/ 2);
_soundMenu.add(CANCEL, "\010 Cancel", 2, 12,/*'c'*/ 2);
_soundMenu.addShortcutKey(CANCEL, ' ');
@@ -252,10 +249,10 @@ IntroController::IntroController() : Controller(1),
_soundMenu.setClosesMenu(CANCEL);
_inputMenu.setTitle("Keyboard Options:", 0, 0);
- _inputMenu.add(MI_INPUT_01, new IntMenuItem("Repeat Delay %4d msec", 2, 2,/*'d'*/ 7, &settingsChanged._keydelay, 100, MAX_KEY_DELAY, 100));
- _inputMenu.add(MI_INPUT_02, new IntMenuItem("Repeat Interval %4d msec", 2, 3,/*'i'*/ 7, &settingsChanged._keyinterval, 10, MAX_KEY_INTERVAL, 10));
+ _inputMenu.add(MI_INPUT_01, new IntMenuItem("Repeat Delay %4d msec", 2, 2,/*'d'*/ 7, &_settingsChanged._keydelay, 100, MAX_KEY_DELAY, 100));
+ _inputMenu.add(MI_INPUT_02, new IntMenuItem("Repeat Interval %4d msec", 2, 3,/*'i'*/ 7, &_settingsChanged._keyinterval, 10, MAX_KEY_INTERVAL, 10));
/* "Mouse Options:" is drawn in the updateInputMenu() function */
- _inputMenu.add(MI_INPUT_03, new BoolMenuItem("Mouse %s", 2, 7,/*'m'*/ 0, &settingsChanged._mouseOptions._enabled));
+ _inputMenu.add(MI_INPUT_03, new BoolMenuItem("Mouse %s", 2, 7,/*'m'*/ 0, &_settingsChanged._mouseOptions._enabled));
_inputMenu.add(USE_SETTINGS, "\010 Use These Settings", 2, 11,/*'u'*/ 2);
_inputMenu.add(CANCEL, "\010 Cancel", 2, 12,/*'c'*/ 2);
_inputMenu.addShortcutKey(CANCEL, ' ');
@@ -263,13 +260,13 @@ IntroController::IntroController() : Controller(1),
_inputMenu.setClosesMenu(CANCEL);
_speedMenu.setTitle("Speed Options:", 0, 0);
- _speedMenu.add(MI_SPEED_01, new IntMenuItem("Game Cycles per Second %3d", 2, 2,/*'g'*/ 0, &settingsChanged._gameCyclesPerSecond, 1, MAX_CYCLES_PER_SECOND, 1));
- _speedMenu.add(MI_SPEED_02, new IntMenuItem("Battle Speed %3d", 2, 3,/*'b'*/ 0, &settingsChanged._battleSpeed, 1, MAX_BATTLE_SPEED, 1));
- _speedMenu.add(MI_SPEED_03, new IntMenuItem("Spell Effect Length %s", 2, 4,/*'p'*/ 1, &settingsChanged._spellEffectSpeed, 1, MAX_SPELL_EFFECT_SPEED, 1, MENU_OUTPUT_SPELL));
- _speedMenu.add(MI_SPEED_04, new IntMenuItem("Camping Length %3d sec", 2, 5,/*'m'*/ 2, &settingsChanged._campTime, 1, MAX_CAMP_TIME, 1));
- _speedMenu.add(MI_SPEED_05, new IntMenuItem("Inn Rest Length %3d sec", 2, 6,/*'i'*/ 0, &settingsChanged._innTime, 1, MAX_INN_TIME, 1));
- _speedMenu.add(MI_SPEED_06, new IntMenuItem("Shrine Meditation Length %3d sec", 2, 7,/*'s'*/ 0, &settingsChanged._shrineTime, 1, MAX_SHRINE_TIME, 1));
- _speedMenu.add(MI_SPEED_07, new IntMenuItem("Screen Shake Interval %3d msec", 2, 8,/*'r'*/ 2, &settingsChanged._shakeInterval, MIN_SHAKE_INTERVAL, MAX_SHAKE_INTERVAL, 10));
+ _speedMenu.add(MI_SPEED_01, new IntMenuItem("Game Cycles per Second %3d", 2, 2,/*'g'*/ 0, &_settingsChanged._gameCyclesPerSecond, 1, MAX_CYCLES_PER_SECOND, 1));
+ _speedMenu.add(MI_SPEED_02, new IntMenuItem("Battle Speed %3d", 2, 3,/*'b'*/ 0, &_settingsChanged._battleSpeed, 1, MAX_BATTLE_SPEED, 1));
+ _speedMenu.add(MI_SPEED_03, new IntMenuItem("Spell Effect Length %s", 2, 4,/*'p'*/ 1, &_settingsChanged._spellEffectSpeed, 1, MAX_SPELL_EFFECT_SPEED, 1, MENU_OUTPUT_SPELL));
+ _speedMenu.add(MI_SPEED_04, new IntMenuItem("Camping Length %3d sec", 2, 5,/*'m'*/ 2, &_settingsChanged._campTime, 1, MAX_CAMP_TIME, 1));
+ _speedMenu.add(MI_SPEED_05, new IntMenuItem("Inn Rest Length %3d sec", 2, 6,/*'i'*/ 0, &_settingsChanged._innTime, 1, MAX_INN_TIME, 1));
+ _speedMenu.add(MI_SPEED_06, new IntMenuItem("Shrine Meditation Length %3d sec", 2, 7,/*'s'*/ 0, &_settingsChanged._shrineTime, 1, MAX_SHRINE_TIME, 1));
+ _speedMenu.add(MI_SPEED_07, new IntMenuItem("Screen Shake Interval %3d msec", 2, 8,/*'r'*/ 2, &_settingsChanged._shakeInterval, MIN_SHAKE_INTERVAL, MAX_SHAKE_INTERVAL, 10));
_speedMenu.add(USE_SETTINGS, "\010 Use These Settings", 2, 11,/*'u'*/ 2);
_speedMenu.add(CANCEL, "\010 Cancel", 2, 12,/*'c'*/ 2);
_speedMenu.addShortcutKey(CANCEL, ' ');
@@ -278,12 +275,12 @@ IntroController::IntroController() : Controller(1),
/* move the BATTLE DIFFICULTY, DEBUG, and AUTOMATIC ACTIONS settings to "enhancementsOptions" */
_gameplayMenu.setTitle("Enhanced Gameplay Options:", 0, 0);
- _gameplayMenu.add(MI_GAMEPLAY_01, new StringMenuItem("Battle Difficulty %s", 2, 2,/*'b'*/ 0, &settingsChanged._battleDiff, settings.getBattleDiffs()));
- _gameplayMenu.add(MI_GAMEPLAY_02, new BoolMenuItem("Fixed Chest Traps %s", 2, 3,/*'t'*/ 12, &settingsChanged._enhancementsOptions._c64chestTraps));
- _gameplayMenu.add(MI_GAMEPLAY_03, new BoolMenuItem("Gazer Spawns Insects %s", 2, 4,/*'g'*/ 0, &settingsChanged._enhancementsOptions._gazerSpawnsInsects));
- _gameplayMenu.add(MI_GAMEPLAY_04, new BoolMenuItem("Gem View Shows Objects %s", 2, 5,/*'e'*/ 1, &settingsChanged._enhancementsOptions._peerShowsObjects));
- _gameplayMenu.add(MI_GAMEPLAY_05, new BoolMenuItem("Slime Divides %s", 2, 6,/*'s'*/ 0, &settingsChanged._enhancementsOptions._slimeDivides));
- _gameplayMenu.add(MI_GAMEPLAY_06, new BoolMenuItem("Debug Mode (Cheats) %s", 2, 8,/*'d'*/ 0, &settingsChanged._debug));
+ _gameplayMenu.add(MI_GAMEPLAY_01, new StringMenuItem("Battle Difficulty %s", 2, 2,/*'b'*/ 0, &_settingsChanged._battleDiff, settings.getBattleDiffs()));
+ _gameplayMenu.add(MI_GAMEPLAY_02, new BoolMenuItem("Fixed Chest Traps %s", 2, 3,/*'t'*/ 12, &_settingsChanged._enhancementsOptions._c64chestTraps));
+ _gameplayMenu.add(MI_GAMEPLAY_03, new BoolMenuItem("Gazer Spawns Insects %s", 2, 4,/*'g'*/ 0, &_settingsChanged._enhancementsOptions._gazerSpawnsInsects));
+ _gameplayMenu.add(MI_GAMEPLAY_04, new BoolMenuItem("Gem View Shows Objects %s", 2, 5,/*'e'*/ 1, &_settingsChanged._enhancementsOptions._peerShowsObjects));
+ _gameplayMenu.add(MI_GAMEPLAY_05, new BoolMenuItem("Slime Divides %s", 2, 6,/*'s'*/ 0, &_settingsChanged._enhancementsOptions._slimeDivides));
+ _gameplayMenu.add(MI_GAMEPLAY_06, new BoolMenuItem("Debug Mode (Cheats) %s", 2, 8,/*'d'*/ 0, &_settingsChanged._debug));
_gameplayMenu.add(USE_SETTINGS, "\010 Use These Settings", 2, 11,/*'u'*/ 2);
_gameplayMenu.add(CANCEL, "\010 Cancel", 2, 12,/*'c'*/ 2);
_gameplayMenu.addShortcutKey(CANCEL, ' ');
@@ -291,13 +288,13 @@ IntroController::IntroController() : Controller(1),
_gameplayMenu.setClosesMenu(CANCEL);
_interfaceMenu.setTitle("Enhanced Interface Options:", 0, 0);
- _interfaceMenu.add(MI_INTERFACE_01, new BoolMenuItem("Automatic Actions %s", 2, 2,/*'a'*/ 0, &settingsChanged._shortcutCommands));
+ _interfaceMenu.add(MI_INTERFACE_01, new BoolMenuItem("Automatic Actions %s", 2, 2,/*'a'*/ 0, &_settingsChanged._shortcutCommands));
/* "(Open, Jimmy, etc.)" */
- _interfaceMenu.add(MI_INTERFACE_02, new BoolMenuItem("Set Active Player %s", 2, 4,/*'p'*/ 11, &settingsChanged._enhancementsOptions._activePlayer));
- _interfaceMenu.add(MI_INTERFACE_03, new BoolMenuItem("Smart 'Enter' Key %s", 2, 5,/*'e'*/ 7, &settingsChanged._enhancementsOptions._smartEnterKey));
- _interfaceMenu.add(MI_INTERFACE_04, new BoolMenuItem("Text Colorization %s", 2, 6,/*'t'*/ 0, &settingsChanged._enhancementsOptions._textColorization));
- _interfaceMenu.add(MI_INTERFACE_05, new BoolMenuItem("Ultima V Shrines %s", 2, 7,/*'s'*/ 9, &settingsChanged._enhancementsOptions._u5shrines));
- _interfaceMenu.add(MI_INTERFACE_06, new BoolMenuItem("Ultima V Spell Mixing %s", 2, 8,/*'m'*/ 15, &settingsChanged._enhancementsOptions._u5spellMixing));
+ _interfaceMenu.add(MI_INTERFACE_02, new BoolMenuItem("Set Active Player %s", 2, 4,/*'p'*/ 11, &_settingsChanged._enhancementsOptions._activePlayer));
+ _interfaceMenu.add(MI_INTERFACE_03, new BoolMenuItem("Smart 'Enter' Key %s", 2, 5,/*'e'*/ 7, &_settingsChanged._enhancementsOptions._smartEnterKey));
+ _interfaceMenu.add(MI_INTERFACE_04, new BoolMenuItem("Text Colorization %s", 2, 6,/*'t'*/ 0, &_settingsChanged._enhancementsOptions._textColorization));
+ _interfaceMenu.add(MI_INTERFACE_05, new BoolMenuItem("Ultima V Shrines %s", 2, 7,/*'s'*/ 9, &_settingsChanged._enhancementsOptions._u5shrines));
+ _interfaceMenu.add(MI_INTERFACE_06, new BoolMenuItem("Ultima V Spell Mixing %s", 2, 8,/*'m'*/ 15, &_settingsChanged._enhancementsOptions._u5spellMixing));
_interfaceMenu.add(USE_SETTINGS, "\010 Use These Settings", 2, 11,/*'u'*/ 2);
_interfaceMenu.add(CANCEL, "\010 Cancel", 2, 12,/*'c'*/ 2);
_interfaceMenu.addShortcutKey(CANCEL, ' ');
@@ -403,7 +400,7 @@ bool IntroController::keyPressed(int key) {
case 'c': {
_errorMessage.clear();
// Make a copy of our settings so we can change them
- settingsChanged = settings;
+ _settingsChanged = settings;
g_screen->screenDisableCursor();
runMenu(&_confMenu, &_extendedMenuArea, true);
g_screen->screenEnableCursor();
@@ -985,11 +982,11 @@ void IntroController::updateConfMenu(MenuEvent &event) {
event.getType() == MenuEvent::DECREMENT) {
// show or hide game enhancement options if enhancements are enabled/disabled
- _confMenu.getItemById(MI_CONF_GAMEPLAY)->setVisible(settingsChanged._enhancements);
- _confMenu.getItemById(MI_CONF_INTERFACE)->setVisible(settingsChanged._enhancements);
+ _confMenu.getItemById(MI_CONF_GAMEPLAY)->setVisible(_settingsChanged._enhancements);
+ _confMenu.getItemById(MI_CONF_INTERFACE)->setVisible(_settingsChanged._enhancements);
// save settings
- settings.setData(settingsChanged);
+ settings.setData(_settingsChanged);
settings.write();
switch (event.getMenuItem()->getId()) {
@@ -1016,7 +1013,7 @@ void IntroController::updateConfMenu(MenuEvent &event) {
break;
case CANCEL:
// discard settings
- settingsChanged = settings;
+ _settingsChanged = settings;
break;
default:
break;
@@ -1036,8 +1033,8 @@ void IntroController::updateVideoMenu(MenuEvent &event) {
switch (event.getMenuItem()->getId()) {
case USE_SETTINGS:
/* save settings (if necessary) */
- if (settings != settingsChanged) {
- settings.setData(settingsChanged);
+ if (settings != _settingsChanged) {
+ settings.setData(_settingsChanged);
settings.write();
/* FIXME: resize images, etc. */
@@ -1052,7 +1049,7 @@ void IntroController::updateVideoMenu(MenuEvent &event) {
break;
case CANCEL:
// discard settings
- settingsChanged = settings;
+ _settingsChanged = settings;
break;
default:
break;
@@ -1091,15 +1088,15 @@ void IntroController::updateSoundMenu(MenuEvent &event) {
switch (event.getMenuItem()->getId()) {
case MI_SOUND_01:
- g_music->setMusicVolume(settingsChanged._musicVol);
+ g_music->setMusicVolume(_settingsChanged._musicVol);
break;
case MI_SOUND_02:
- g_music->setSoundVolume(settingsChanged._soundVol);
+ g_music->setSoundVolume(_settingsChanged._soundVol);
soundPlay(SOUND_FLEE);
break;
case USE_SETTINGS:
// save settings
- settings.setData(settingsChanged);
+ settings.setData(_settingsChanged);
settings.write();
g_music->intro();
break;
@@ -1107,7 +1104,7 @@ void IntroController::updateSoundMenu(MenuEvent &event) {
g_music->setMusicVolume(settings._musicVol);
g_music->setSoundVolume(settings._soundVol);
// discard settings
- settingsChanged = settings;
+ _settingsChanged = settings;
break;
default:
break;
@@ -1127,11 +1124,11 @@ void IntroController::updateInputMenu(MenuEvent &event) {
switch (event.getMenuItem()->getId()) {
case USE_SETTINGS:
// save settings
- settings.setData(settingsChanged);
+ settings.setData(_settingsChanged);
settings.write();
// re-initialize keyboard
- KeyHandler::setKeyRepeat(settingsChanged._keydelay, settingsChanged._keyinterval);
+ KeyHandler::setKeyRepeat(_settingsChanged._keydelay, _settingsChanged._keyinterval);
#ifdef SLACK_ON_SDL_AGNOSTICISM
if (settings.mouseOptions.enabled) {
@@ -1144,7 +1141,7 @@ void IntroController::updateInputMenu(MenuEvent &event) {
break;
case CANCEL:
// discard settings
- settingsChanged = settings;
+ _settingsChanged = settings;
break;
default:
break;
@@ -1167,7 +1164,7 @@ void IntroController::updateSpeedMenu(MenuEvent &event) {
switch (event.getMenuItem()->getId()) {
case USE_SETTINGS:
// save settings
- settings.setData(settingsChanged);
+ settings.setData(_settingsChanged);
settings.write();
// re-initialize events
@@ -1177,7 +1174,7 @@ void IntroController::updateSpeedMenu(MenuEvent &event) {
break;
case CANCEL:
// discard settings
- settingsChanged = settings;
+ _settingsChanged = settings;
break;
default:
break;
@@ -1197,12 +1194,12 @@ void IntroController::updateGameplayMenu(MenuEvent &event) {
switch (event.getMenuItem()->getId()) {
case USE_SETTINGS:
// save settings
- settings.setData(settingsChanged);
+ settings.setData(_settingsChanged);
settings.write();
break;
case CANCEL:
// discard settings
- settingsChanged = settings;
+ _settingsChanged = settings;
break;
default:
break;
@@ -1222,12 +1219,12 @@ void IntroController::updateInterfaceMenu(MenuEvent &event) {
switch (event.getMenuItem()->getId()) {
case USE_SETTINGS:
// save settings
- settings.setData(settingsChanged);
+ settings.setData(_settingsChanged);
settings.write();
break;
case CANCEL:
// discard settings
- settingsChanged = settings;
+ _settingsChanged = settings;
break;
default:
break;
diff --git a/engines/ultima/ultima4/controllers/intro_controller.h b/engines/ultima/ultima4/controllers/intro_controller.h
index 7c3eb6e8da..0a1a9d9356 100644
--- a/engines/ultima/ultima4/controllers/intro_controller.h
+++ b/engines/ultima/ultima4/controllers/intro_controller.h
@@ -429,6 +429,9 @@ private:
RGBA _transparentColor; // palette color for transparency
bool _bSkipTitles;
+
+ // Temporary place-holder for settings changes
+ SettingsData _settingsChanged;
};
extern IntroController *g_intro;
Commit: 5c0ace61a8d077750bad9f5f1c1296e04460bf87
https://github.com/scummvm/scummvm/commit/5c0ace61a8d077750bad9f5f1c1296e04460bf87
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2020-04-25T09:06:39-07:00
Commit Message:
ULTIMA4: Fixes for switching video mode in Config menu
Changed paths:
engines/ultima/ultima4/controllers/intro_controller.cpp
engines/ultima/ultima4/core/settings.cpp
engines/ultima/ultima4/gfx/screen.cpp
engines/ultima/ultima4/ultima4.cpp
diff --git a/engines/ultima/ultima4/controllers/intro_controller.cpp b/engines/ultima/ultima4/controllers/intro_controller.cpp
index a2cb564459..abbaf2812b 100644
--- a/engines/ultima/ultima4/controllers/intro_controller.cpp
+++ b/engines/ultima/ultima4/controllers/intro_controller.cpp
@@ -1032,15 +1032,15 @@ void IntroController::updateVideoMenu(MenuEvent &event) {
switch (event.getMenuItem()->getId()) {
case USE_SETTINGS:
- /* save settings (if necessary) */
+ // Save settings (if necessary)
if (settings != _settingsChanged) {
settings.setData(_settingsChanged);
settings.write();
- /* FIXME: resize images, etc. */
+ // FIXME: resize images, etc.
g_screen->screenReInit();
- // go back to menu mode
+ // Go back to menu mode
_mode = INTRO_MENU;
}
break;
diff --git a/engines/ultima/ultima4/core/settings.cpp b/engines/ultima/ultima4/core/settings.cpp
index 4ebf9a5324..041a184c73 100644
--- a/engines/ultima/ultima4/core/settings.cpp
+++ b/engines/ultima/ultima4/core/settings.cpp
@@ -53,7 +53,8 @@ bool SettingsEnhancementOptions::operator==(const SettingsEnhancementOptions &s)
/*-------------------------------------------------------------------*/
bool SettingsData::operator==(const SettingsData &s) const {
- return _battleSpeed == s._battleSpeed
+ return _videoType == s._videoType
+ && _battleSpeed == s._battleSpeed
&& _campingAlwaysCombat == s._campingAlwaysCombat
&& _campTime == s._campTime
&& _debug == s._debug
@@ -118,6 +119,10 @@ Settings &Settings::getInstance() {
void Settings::setData(const SettingsData &data) {
// bitwise copy is safe
*(SettingsData *)this = data;
+
+ bool isEnhanced = _videoType != "EGA";
+ _scale = isEnhanced ? 2 : 1;
+ _filter = isEnhanced ? "Scale2x" : "point";
}
bool Settings::write() {
diff --git a/engines/ultima/ultima4/gfx/screen.cpp b/engines/ultima/ultima4/gfx/screen.cpp
index 65a4d4a46d..0b0fffee95 100644
--- a/engines/ultima/ultima4/gfx/screen.cpp
+++ b/engines/ultima/ultima4/gfx/screen.cpp
@@ -62,34 +62,30 @@ Screen::Screen() : _filterScaler(nullptr), _currentMouseCursor(-1),
Common::fill(&_mouseCursors[0], &_mouseCursors[5], (MouseCursorSurface *)nullptr);
Common::fill(&_los[0][0], &_los[0][0] + (VIEWPORT_W * VIEWPORT_H), 0);
- Graphics::PixelFormat SCREEN_FORMAT(2, 5, 6, 5, 0, 11, 5, 0, 0);
- Common::Point size(SCREEN_WIDTH * settings._scale, SCREEN_HEIGHT * settings._scale);
- initGraphics(size.x, size.y, &SCREEN_FORMAT);
+ _filterNames.clear();
+ _filterNames.push_back("point");
+ _filterNames.push_back("2xBi");
+ _filterNames.push_back("2xSaI");
+ _filterNames.push_back("Scale2x");
- create(size.x, size.y, SCREEN_FORMAT);
- loadMouseCursors();
+ _lineOfSightStyles.clear();
+ _lineOfSightStyles.push_back("DOS");
+ _lineOfSightStyles.push_back("Enhanced");
}
Screen::~Screen() {
clear();
g_screen = nullptr;
-
- // Delete cursors
- for (int idx = 0; idx < 5; ++idx)
- delete _mouseCursors[idx];
}
void Screen::init() {
- _filterNames.clear();
- _filterNames.push_back("point");
- _filterNames.push_back("2xBi");
- _filterNames.push_back("2xSaI");
- _filterNames.push_back("Scale2x");
+ Graphics::PixelFormat SCREEN_FORMAT(2, 5, 6, 5, 0, 11, 5, 0, 0);
+ Common::Point size(SCREEN_WIDTH * settings._scale, SCREEN_HEIGHT * settings._scale);
- _lineOfSightStyles.clear();
- _lineOfSightStyles.push_back("DOS");
- _lineOfSightStyles.push_back("Enhanced");
+ initGraphics(size.x, size.y, &SCREEN_FORMAT);
+ create(size.x, size.y, SCREEN_FORMAT);
+ loadMouseCursors();
screenLoadGraphicsFromConf();
debug(1, "using %s scaler\n", settings._filter.c_str());
@@ -131,12 +127,22 @@ void Screen::init() {
}
void Screen::clear() {
+ // Clear any pending updates for the current screen
+ update();
+
Std::vector<Layout *>::const_iterator i;
for (i = _layouts.begin(); i != _layouts.end(); ++i)
delete(*i);
_layouts.clear();
ImageMgr::destroy();
+ _charSetInfo = nullptr;
+
+ // Delete cursors
+ for (int idx = 0; idx < 5; ++idx) {
+ delete _mouseCursors[idx];
+ _mouseCursors[idx] = nullptr;
+ }
}
void Screen::loadMouseCursors() {
diff --git a/engines/ultima/ultima4/ultima4.cpp b/engines/ultima/ultima4/ultima4.cpp
index 8a8349ed99..e2241e9335 100644
--- a/engines/ultima/ultima4/ultima4.cpp
+++ b/engines/ultima/ultima4/ultima4.cpp
@@ -82,12 +82,12 @@ bool Ultima4Engine::initialize() {
_context = new Context();
_dialogueLoaders = new DialogueLoaders();
_screen = new Screen();
+ _screen->init();
_game = new GameController();
_imageLoaders = new ImageLoaders();
_music = new Music();
_saveGame = new SaveGame();
- _screen->init();
setDebugger(new Debugger());
soundInit();
Tileset::loadAll();
Commit: dd050238e80ffc6b50af0b4f7236249fa883f9f8
https://github.com/scummvm/scummvm/commit/dd050238e80ffc6b50af0b4f7236249fa883f9f8
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2020-04-25T09:06:39-07:00
Commit Message:
ULTIMA4: Fix entering uppercase keys
Changed paths:
engines/ultima/ultima4/events/event_handler.cpp
diff --git a/engines/ultima/ultima4/events/event_handler.cpp b/engines/ultima/ultima4/events/event_handler.cpp
index 68381794ce..c191c2ecee 100644
--- a/engines/ultima/ultima4/events/event_handler.cpp
+++ b/engines/ultima/ultima4/events/event_handler.cpp
@@ -302,7 +302,8 @@ void EventHandler::handleKeyDownEvent(const Common::Event &event, Controller *co
key = event.kbd.ascii;
if (!key)
return;
- key += event.kbd.flags << 16;
+ key += (event.kbd.flags & (Common::KBD_CTRL |
+ Common::KBD_ALT | Common::KBD_META)) << 16;
debug(1, "key event: sym = %d, mod = %d; translated = %d",
event.kbd.keycode, event.kbd.flags, key);
Commit: 06ca44d53dda274a4271db6e35e6c5b0d7fdc1fc
https://github.com/scummvm/scummvm/commit/06ca44d53dda274a4271db6e35e6c5b0d7fdc1fc
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2020-04-25T09:06:39-07:00
Commit Message:
ULTIMA4: Fixes for quitting ScummVM during Initiate
Changed paths:
engines/ultima/ultima4/controllers/intro_controller.cpp
diff --git a/engines/ultima/ultima4/controllers/intro_controller.cpp b/engines/ultima/ultima4/controllers/intro_controller.cpp
index abbaf2812b..6161841854 100644
--- a/engines/ultima/ultima4/controllers/intro_controller.cpp
+++ b/engines/ultima/ultima4/controllers/intro_controller.cpp
@@ -665,7 +665,7 @@ void IntroController::initiateNewGame() {
g_screen->update();
Common::String nameBuffer = ReadStringController::get(12, &_menuArea);
- if (nameBuffer.empty()) {
+ if (nameBuffer.empty() || shouldQuit()) {
// the user didn't enter a name
_menuArea.disableCursor();
g_screen->screenEnableCursor();
@@ -687,12 +687,15 @@ void IntroController::initiateNewGame() {
SexType sex;
int sexChoice = ReadChoiceController::get("mf");
- if (sexChoice == 'm')
- sex = SEX_MALE;
- else
- sex = SEX_FEMALE;
- finishInitiateGame(nameBuffer, sex);
+ if (!shouldQuit()) {
+ if (sexChoice == 'm')
+ sex = SEX_MALE;
+ else
+ sex = SEX_FEMALE;
+
+ finishInitiateGame(nameBuffer, sex);
+ }
}
void IntroController::finishInitiateGame(const Common::String &nameBuffer, SexType sex) {
Commit: d08468e3116d488f36f2caa65893dcaafa9ecd3e
https://github.com/scummvm/scummvm/commit/d08468e3116d488f36f2caa65893dcaafa9ecd3e
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2020-04-25T09:06:39-07:00
Commit Message:
ULTIMA4: Rename all IOS defines to IOS_ULTIMA4
This should prevent the relevant codes being linked in on IOS
until I've had the chance to review them all
Changed paths:
engines/ultima/ultima4/controllers/combat_controller.cpp
engines/ultima/ultima4/controllers/game_controller.cpp
engines/ultima/ultima4/controllers/intro_controller.cpp
engines/ultima/ultima4/controllers/intro_controller.h
engines/ultima/ultima4/controllers/read_player_controller.cpp
engines/ultima/ultima4/controllers/read_string_controller.h
engines/ultima/ultima4/conversation/conversation.cpp
engines/ultima/ultima4/core/debugger.cpp
engines/ultima/ultima4/core/debugger_actions.cpp
engines/ultima/ultima4/events/event_handler.cpp
engines/ultima/ultima4/events/event_handler.h
engines/ultima/ultima4/events/timed_event_mgr.h
engines/ultima/ultima4/game/codex.cpp
engines/ultima/ultima4/game/game.cpp
engines/ultima/ultima4/game/item.cpp
engines/ultima/ultima4/game/person.cpp
engines/ultima/ultima4/game/player.h
engines/ultima/ultima4/game/portal.cpp
engines/ultima/ultima4/game/stats.cpp
engines/ultima/ultima4/game/view.cpp
engines/ultima/ultima4/game/view.h
engines/ultima/ultima4/gfx/screen.cpp
engines/ultima/ultima4/map/shrine.cpp
engines/ultima/ultima4/map/tileview.cpp
engines/ultima/ultima4/sound/music.h
diff --git a/engines/ultima/ultima4/controllers/combat_controller.cpp b/engines/ultima/ultima4/controllers/combat_controller.cpp
index c0408d57da..b15e6c3898 100644
--- a/engines/ultima/ultima4/controllers/combat_controller.cpp
+++ b/engines/ultima/ultima4/controllers/combat_controller.cpp
@@ -922,7 +922,7 @@ bool CombatController::keyPressed(int key) {
g_debugger->castSpell(_focus);
break;
-#ifdef IOS
+#ifdef IOS_ULTIMA4
case Common::KEYCODE_RETURN: // Fall through and get the chest.
#endif
case 'g':
@@ -970,7 +970,7 @@ bool CombatController::keyPressed(int key) {
case 'u':
g_screen->screenMessage("Use which item:\n");
g_context->_stats->setView(STATS_ITEMS);
-#ifdef IOS
+#ifdef IOS_ULTIMA4
U4IOS::IOSConversationHelper::setIntroString("Use which item?");
#endif
itemUse(gameGetInput().c_str());
@@ -1052,7 +1052,7 @@ void CombatController::attack() {
g_screen->screenMessage("Dir: ");
ReadDirController dirController;
-#ifdef IOS
+#ifdef IOS_ULTIMA4
U4IOS::IOSDirectionHelper directionPopup;
#endif
eventHandler->pushController(&dirController);
diff --git a/engines/ultima/ultima4/controllers/game_controller.cpp b/engines/ultima/ultima4/controllers/game_controller.cpp
index 7e70cf7690..dc386bf5b9 100644
--- a/engines/ultima/ultima4/controllers/game_controller.cpp
+++ b/engines/ultima/ultima4/controllers/game_controller.cpp
@@ -147,7 +147,7 @@ void GameController::setMap(Map *map, bool saveLocation, const Portal *portal, T
g_context->_location = new Location(coords, map, viewMode, context, turnCompleter, g_context->_location);
g_context->_location->addObserver(this);
g_context->_party->setActivePlayer(activePlayer);
-#ifdef IOS
+#ifdef IOS_ULTIMA4
U4IOS::updateGameControllerContext(c->location->context);
#endif
@@ -182,7 +182,7 @@ int GameController::exitToParentMap() {
// restore the tileset to the one the current map uses
_mapArea.setTileset(g_context->_location->_map->_tileset);
-#ifdef IOS
+#ifdef IOS_ULTIMA4
U4IOS::updateGameControllerContext(c->location->context);
#endif
@@ -718,7 +718,7 @@ void GameController::creatureCleanup() {
void GameController::checkRandomCreatures() {
int canSpawnHere = g_context->_location->_map->isWorldMap() || g_context->_location->_context & CTX_DUNGEON;
-#ifdef IOS
+#ifdef IOS_ULTIMA4
int spawnDivisor = c->location->context & CTX_DUNGEON ? (53 - (c->location->coords.z << 2)) : 53;
#else
int spawnDivisor = g_context->_location->_context & CTX_DUNGEON ? (32 - (g_context->_location->_coords.z << 2)) : 32;
diff --git a/engines/ultima/ultima4/controllers/intro_controller.cpp b/engines/ultima/ultima4/controllers/intro_controller.cpp
index 6161841854..78df2c9b76 100644
--- a/engines/ultima/ultima4/controllers/intro_controller.cpp
+++ b/engines/ultima/ultima4/controllers/intro_controller.cpp
@@ -313,7 +313,7 @@ bool IntroController::init() {
// the init() method is called again from within the
// game via ALT-Q, so return to the menu
//
-#ifndef IOS
+#ifndef IOS_ULTIMA4
_mode = INTRO_MENU;
#else
mode = INTRO_MAP;
@@ -699,7 +699,7 @@ void IntroController::initiateNewGame() {
}
void IntroController::finishInitiateGame(const Common::String &nameBuffer, SexType sex) {
-#ifdef IOS
+#ifdef IOS_ULTIMA4
mode = INTRO_MENU; // ensure we are now in the menu mode, (i.e., stop drawing the map).
#endif
// no more text entry, so disable the text cursor
@@ -733,7 +733,7 @@ void IntroController::finishInitiateGame(const Common::String &nameBuffer, SexTy
// show the text thats segues into the main game
showText(_binData->_introGypsy[GYP_SEGUE1]);
-#ifdef IOS
+#ifdef IOS_ULTIMA4
U4IOS::switchU4IntroControllerToContinueButton();
#endif
ReadChoiceController pauseController("");
@@ -814,7 +814,7 @@ void IntroController::startQuestions() {
_binData->_introGypsy[_questionTree[_questionRound * 2 + 1] + 4].c_str());
_questionArea.textAt(0, 3, "\"Consider this:\"");
-#ifdef IOS
+#ifdef IOS_ULTIMA4
U4IOS::switchU4IntroControllerToContinueButton();
#endif
// wait for a key
@@ -825,7 +825,7 @@ void IntroController::startQuestions() {
// show the question to choose between virtues
showText(getQuestion(_questionTree[_questionRound * 2], _questionTree[_questionRound * 2 + 1]));
-#ifdef IOS
+#ifdef IOS_ULTIMA4
U4IOS::switchU4IntroControllerToABButtons();
#endif
// wait for an answer
@@ -1611,7 +1611,7 @@ void IntroController::getTitleSourceData() {
int getTicks() {
return SDL_GetTicks();
}
-#elif !defined(IOS)
+#elif !defined(IOS_ULTIMA4)
static int ticks = 0;
int getTicks() {
ticks += 1000;
@@ -1620,7 +1620,7 @@ int getTicks() {
#endif
bool IntroController::updateTitle() {
-#ifdef IOS
+#ifdef IOS_ULTIMA4
static bool firstTime = true;
if (firstTime) {
firstTime = false;
@@ -1934,7 +1934,7 @@ void IntroController::skipTitles() {
soundStop();
}
-#ifdef IOS
+#ifdef IOS_ULTIMA4
void IntroController::tryTriggerIntroMusic() {
if (mode == INTRO_MAP)
g_music->intro();
diff --git a/engines/ultima/ultima4/controllers/intro_controller.h b/engines/ultima/ultima4/controllers/intro_controller.h
index 0a1a9d9356..c58b275cf0 100644
--- a/engines/ultima/ultima4/controllers/intro_controller.h
+++ b/engines/ultima/ultima4/controllers/intro_controller.h
@@ -223,7 +223,7 @@ private:
* virtue v2 (zero based virtue index, starting at honesty).
*/
Common::String getQuestion(int v1, int v2);
-#ifdef IOS
+#ifdef IOS_ULTIMA4
public:
/**
* Try to put the intro music back at just the correct moment on iOS;
@@ -255,7 +255,7 @@ public:
* Shows an about box.
*/
void about();
-#ifdef IOS
+#ifdef IOS_ULTIMA4
private:
#endif
/**
diff --git a/engines/ultima/ultima4/controllers/read_player_controller.cpp b/engines/ultima/ultima4/controllers/read_player_controller.cpp
index f64530ab61..0e481083ee 100644
--- a/engines/ultima/ultima4/controllers/read_player_controller.cpp
+++ b/engines/ultima/ultima4/controllers/read_player_controller.cpp
@@ -28,13 +28,13 @@ namespace Ultima {
namespace Ultima4 {
ReadPlayerController::ReadPlayerController() : ReadChoiceController("12345678 \033\n") {
-#ifdef IOS
+#ifdef IOS_ULTIMA4
U4IOS::beginCharacterChoiceDialog();
#endif
}
ReadPlayerController::~ReadPlayerController() {
-#ifdef IOS
+#ifdef IOS_ULTIMA4
U4IOS::endCharacterChoiceDialog();
#endif
}
diff --git a/engines/ultima/ultima4/controllers/read_string_controller.h b/engines/ultima/ultima4/controllers/read_string_controller.h
index 2e59493aef..8e4c3c1dc0 100644
--- a/engines/ultima/ultima4/controllers/read_string_controller.h
+++ b/engines/ultima/ultima4/controllers/read_string_controller.h
@@ -47,7 +47,7 @@ public:
static Common::String get(int maxlen, int screenX, int screenY, EventHandler *eh = nullptr);
static Common::String get(int maxlen, TextView *view, EventHandler *eh = nullptr);
-#ifdef IOS
+#ifdef IOS_ULTIMA4
void setValue(const Common::String &utf8StringValue) {
value = utf8StringValue;
}
diff --git a/engines/ultima/ultima4/conversation/conversation.cpp b/engines/ultima/ultima4/conversation/conversation.cpp
index 4854fe6c6e..4c1aea5689 100644
--- a/engines/ultima/ultima4/conversation/conversation.cpp
+++ b/engines/ultima/ultima4/conversation/conversation.cpp
@@ -231,14 +231,14 @@ Common::String Dialogue::dump(const Common::String &arg) {
*/
Conversation::Conversation() : _state(INTRO), _script(new Script()) {
-#ifdef IOS
+#ifdef IOS_ULTIMA4
U4IOS::incrementConversationCount();
#endif
}
Conversation::~Conversation() {
-#ifdef IOS
+#ifdef IOS_ULTIMA4
U4IOS::decrementConversationCount();
#endif
delete _script;
diff --git a/engines/ultima/ultima4/core/debugger.cpp b/engines/ultima/ultima4/core/debugger.cpp
index 6e456e9a51..749eb167d6 100644
--- a/engines/ultima/ultima4/core/debugger.cpp
+++ b/engines/ultima/ultima4/core/debugger.cpp
@@ -317,7 +317,7 @@ bool Debugger::cmdCastSpell(int argc, const char **argv) {
g_context->_stats->setView(STATS_MIXTURES);
printN("Spell: ");
// ### Put the iPad thing too.
-#ifdef IOS
+#ifdef IOS_ULTIMA4
U4IOS::IOSCastSpellHelper castSpellController;
#endif
int spell = AlphaActionController::get('z', "Spell: ");
@@ -342,7 +342,7 @@ bool Debugger::cmdCastSpell(int argc, const char **argv) {
case Spell::PARAM_PHASE: {
printN("To Phase: ");
-#ifdef IOS
+#ifdef IOS_ULTIMA4
U4IOS::IOSConversationChoiceHelper choiceController;
choiceController.fullSizeChoicePanel();
choiceController.updateGateSpellChoices();
@@ -378,7 +378,7 @@ bool Debugger::cmdCastSpell(int argc, const char **argv) {
case Spell::PARAM_TYPEDIR: {
printN("Energy type? ");
-#ifdef IOS
+#ifdef IOS_ULTIMA4
U4IOS::IOSConversationChoiceHelper choiceController;
choiceController.fullSizeChoicePanel();
choiceController.updateEnergyFieldSpellChoices();
@@ -656,7 +656,7 @@ bool Debugger::cmdInteract(int argc, const char **argv) {
if (g_context->_party->isFlying()) {
return cmdDescend(argc, argv);
} else {
-#ifdef IOS
+#ifdef IOS_ULTIMA4
U4IOS::IOSSuperButtonHelper superHelper;
key = ReadChoiceController::get("xk \033\n");
#else
@@ -680,7 +680,7 @@ bool Debugger::cmdInteract(int argc, const char **argv) {
bool up = dungeon->ladderUpAt(g_context->_location->_coords);
bool down = dungeon->ladderDownAt(g_context->_location->_coords);
if (up && down) {
-#ifdef IOS
+#ifdef IOS_ULTIMA4
U4IOS::IOSClimbHelper climbHelper;
key = ReadChoiceController::get("kd \033\n");
#else
@@ -750,7 +750,7 @@ bool Debugger::cmdMixReagents(int argc, const char **argv) {
while (!done) {
print("Mix reagents");
-#ifdef IOS
+#ifdef IOS_ULTIMA4
U4IOS::beginMixSpellController();
return isDebuggerActive(); // Just return, the dialog takes control from here.
#endif
@@ -1052,7 +1052,7 @@ bool Debugger::cmdStats(int argc, const char **argv) {
g_context->_stats->resetReagentsMenu();
g_context->_stats->setView(StatsView(STATS_CHAR1 + player));
-#ifdef IOS
+#ifdef IOS_ULTIMA4
U4IOS::IOSHideActionKeysHelper hideExtraControls;
#endif
ZtatsController ctrl;
@@ -1093,7 +1093,7 @@ bool Debugger::cmdUse(int argc, const char **argv) {
// a little xu4 enhancement: show items in inventory when prompted for an item to use
g_context->_stats->setView(STATS_ITEMS);
}
-#ifdef IOS
+#ifdef IOS_ULTIMA4
U4IOS::IOSConversationHelper::setIntroString("Use which item?");
#endif
itemUse(gameGetInput().c_str());
diff --git a/engines/ultima/ultima4/core/debugger_actions.cpp b/engines/ultima/ultima4/core/debugger_actions.cpp
index b59d892b65..be68d1de18 100644
--- a/engines/ultima/ultima4/core/debugger_actions.cpp
+++ b/engines/ultima/ultima4/core/debugger_actions.cpp
@@ -403,7 +403,7 @@ void DebuggerActions::talkRunConversation(Conversation &conv, Person *talker, bo
/* if all chunks haven't been shown, wait for a key and process next chunk*/
int size = conv._reply.size();
if (size > 0) {
-#ifdef IOS
+#ifdef IOS_ULTIMA4
U4IOS::IOSConversationChoiceHelper continueDialog;
continueDialog.updateChoices(" ");
#endif
@@ -445,7 +445,7 @@ void DebuggerActions::talkRunConversation(Conversation &conv, Person *talker, bo
Common::String prompt = talker->getPrompt(&conv);
if (!prompt.empty()) {
if (linesused + linecount(prompt, TEXT_AREA_W) > TEXT_AREA_H) {
-#ifdef IOS
+#ifdef IOS_ULTIMA4
U4IOS::IOSConversationChoiceHelper continueDialog;
continueDialog.updateChoices(" ");
#endif
@@ -461,7 +461,7 @@ void DebuggerActions::talkRunConversation(Conversation &conv, Person *talker, bo
case Conversation::INPUT_STRING:
{
conv._playerInput = gameGetInput(maxlen);
-#ifdef IOS
+#ifdef IOS_ULTIMA4
g_screen->screenMessage("%s", conv.playerInput.c_str()); // Since we put this in a different window, we need to show it again.
#endif
conv._reply = talker->getConversationText(&conv, conv._playerInput.c_str());
@@ -472,7 +472,7 @@ void DebuggerActions::talkRunConversation(Conversation &conv, Person *talker, bo
case Conversation::INPUT_CHARACTER:
{
char message[2];
-#ifdef IOS
+#ifdef IOS_ULTIMA4
U4IOS::IOSConversationChoiceHelper yesNoHelper;
yesNoHelper.updateChoices("yn ");
#endif
diff --git a/engines/ultima/ultima4/events/event_handler.cpp b/engines/ultima/ultima4/events/event_handler.cpp
index c191c2ecee..b9997946f7 100644
--- a/engines/ultima/ultima4/events/event_handler.cpp
+++ b/engines/ultima/ultima4/events/event_handler.cpp
@@ -77,7 +77,7 @@ void EventHandler::wait_cycles(uint cycles) {
void EventHandler::setControllerDone(bool done) {
_controllerDone = done;
-#if defined(IOS)
+#if defined(IOS_ULTIMA4)
if (done)
controllerStopped_helper();
#endif
diff --git a/engines/ultima/ultima4/events/event_handler.h b/engines/ultima/ultima4/events/event_handler.h
index e9ddd80318..37458b0a92 100644
--- a/engines/ultima/ultima4/events/event_handler.h
+++ b/engines/ultima/ultima4/events/event_handler.h
@@ -38,7 +38,7 @@ namespace Ultima4 {
#define eventHandler (EventHandler::getInstance())
-#if defined(IOS)
+#if defined(IOS_ULTIMA4)
#ifndef __OBJC__
typedef void *TimedManagerHelper;
typedef void *UIEvent;
@@ -143,7 +143,7 @@ public:
/* Event functions */
void run();
void setScreenUpdate(void (*updateScreen)(void));
-#if defined(IOS)
+#if defined(IOS_ULTIMA4)
void handleEvent(UIEvent *);
static void controllerStopped_helper();
updateScreenCallback screenCallback() {
diff --git a/engines/ultima/ultima4/events/timed_event_mgr.h b/engines/ultima/ultima4/events/timed_event_mgr.h
index f442fdd7dc..6d72cb45fa 100644
--- a/engines/ultima/ultima4/events/timed_event_mgr.h
+++ b/engines/ultima/ultima4/events/timed_event_mgr.h
@@ -117,7 +117,7 @@ public:
* Re-initializes the timer manager to a new timer granularity
*/
void reset(uint interval); /**< Re-initializes the event manager to a new base interval */
-#if defined(IOS)
+#if defined(IOS_ULTIMA4)
bool hasActiveTimer() const;
#endif
@@ -132,7 +132,7 @@ protected:
bool _locked;
List _events;
List _deferredRemovals;
-#if defined(IOS)
+#if defined(IOS_ULTIMA4)
TimedManagerHelper *m_helper;
#endif
};
diff --git a/engines/ultima/ultima4/game/codex.cpp b/engines/ultima/ultima4/game/codex.cpp
index f0315da282..0285ca2eb7 100644
--- a/engines/ultima/ultima4/game/codex.cpp
+++ b/engines/ultima/ultima4/game/codex.cpp
@@ -91,7 +91,7 @@ void codexStart() {
/**
* disable the whirlpool cursor and black out the screen
*/
-#ifdef IOS
+#ifdef IOS_ULTIMA4
U4IOS::IOSHideGameControllerHelper hideControllsHelper;
#endif
g_screen->screenDisableCursor();
@@ -131,7 +131,7 @@ void codexStart() {
/**
* Get the Word of Passage
*/
-#ifdef IOS
+#ifdef IOS_ULTIMA4
U4IOS::IOSConversationHelper::setIntroString("What is the Word of Passage?");
#endif
codexHandleWOP(gameGetInput());
@@ -275,7 +275,7 @@ void codexHandleWOP(const Common::String &word) {
else if (tries++ < 3) {
codexImpureThoughts();
g_screen->screenMessage("\"What is the Word of Passage?\"\n\n");
-#ifdef IOS
+#ifdef IOS_ULTIMA4
U4IOS::IOSConversationHelper::setIntroString("Which virtue?");
#endif
codexHandleWOP(gameGetInput());
@@ -328,7 +328,7 @@ void codexHandleVirtues(const Common::String &virtue) {
g_screen->screenMessage("\n\nThe voice asks:\n");
EventHandler::sleep(2000);
g_screen->screenMessage("\n%s\n\n", codexVirtueQuestions[current].c_str());
-#ifdef IOS
+#ifdef IOS_ULTIMA4
U4IOS::IOSConversationHelper::setIntroString((current != VIRT_MAX) ? "Which virtue?" : "Which principle?");
#endif
codexHandleVirtues(gameGetInput());
@@ -348,7 +348,7 @@ void codexHandleVirtues(const Common::String &virtue) {
g_screen->screenMessage("\n\nThe voice asks:\n");
EventHandler::sleep(2000);
g_screen->screenMessage("\n%s\n\n", codexVirtueQuestions[current].c_str());
-#ifdef IOS
+#ifdef IOS_ULTIMA4
U4IOS::IOSConversationHelper::setIntroString("Which principle?");
#endif
codexHandleVirtues(gameGetInput());
@@ -360,7 +360,7 @@ void codexHandleVirtues(const Common::String &virtue) {
EventHandler::sleep(3000);
g_screen->screenEnableCursor();
g_screen->screenMessage("\nAbove the din, the voice asks:\n\nIf all eight virtues of the Avatar combine into and are derived from the Three Principles of Truth, Love and Courage...");
-#ifdef IOS
+#ifdef IOS_ULTIMA4
// Ugh, we now enter happy callback land, so I know how to do these things manually. Good thing I kept these separate functions.
U4IOS::beginChoiceConversation();
U4IOS::updateChoicesInDialog(" ", "", -1);
@@ -373,7 +373,7 @@ void codexHandleVirtues(const Common::String &virtue) {
else if (tries++ < 3) {
codexImpureThoughts();
g_screen->screenMessage("%s\n\n", codexVirtueQuestions[current].c_str());
-#ifdef IOS
+#ifdef IOS_ULTIMA4
U4IOS::IOSConversationHelper::setIntroString("Which virtue?");
#endif
codexHandleVirtues(gameGetInput());
@@ -392,7 +392,7 @@ bool codexHandleInfinityAnyKey(int key, void *data) {
eventHandler->popKeyHandler();
g_screen->screenMessage("\n\nThen what is the one thing which encompasses and is the whole of all undeniable Truth, unending Love, and unyielding Courage?\n\n");
-#ifdef IOS
+#ifdef IOS_ULTIMA4
U4IOS::endChoiceConversation();
U4IOS::IOSConversationHelper::setIntroString("What is the whole of all undeniable Truth, unending Love, and unyielding Courage?");
#endif
@@ -404,7 +404,7 @@ void codexHandleInfinity(const Common::String &answer) {
static int tries = 1;
eventHandler->popKeyHandler();
-#ifdef IOS
+#ifdef IOS_ULTIMA4
U4IOS::IOSHideGameControllerHelper hideControllsHelper;
#endif
/* slight pause before continuing */
@@ -418,7 +418,7 @@ void codexHandleInfinity(const Common::String &answer) {
g_screen->screenEnableCursor();
g_screen->screenMessage("\n%s", codexEndgameText1[0].c_str());
-#ifdef IOS
+#ifdef IOS_ULTIMA4
// Ugh, we now enter happy callback land, so I know how to do these things manually. Good thing I kept these separate functions.
U4IOS::hideGameButtons();
U4IOS::beginChoiceConversation();
@@ -459,7 +459,7 @@ bool codexHandleEndgameAnyKey(int key, void *data) {
/* CONGRATULATIONS!... you have completed the game in x turns */
g_screen->screenDisableCursor();
g_screen->screenMessage("%s%d%s", codexEndgameText2[index - 7].c_str(), g_ultima->_saveGame->_moves, codexEndgameText2[index - 6].c_str());
-#ifdef IOS
+#ifdef IOS_ULTIMA4
U4IOS::endChoiceConversation();
#endif
eventHandler->pushKeyHandler(&KeyHandler::ignoreKeys);
diff --git a/engines/ultima/ultima4/game/game.cpp b/engines/ultima/ultima4/game/game.cpp
index 06676078ee..d15388e38f 100644
--- a/engines/ultima/ultima4/game/game.cpp
+++ b/engines/ultima/ultima4/game/game.cpp
@@ -175,7 +175,7 @@ void gameSpellEffect(int spell, int player, Sound sound) {
Common::String gameGetInput(int maxlen) {
g_screen->screenEnableCursor();
g_screen->screenShowCursor();
-#ifdef IOS
+#ifdef IOS_ULTIMA4
U4IOS::IOSConversationHelper helper;
helper.beginConversation(U4IOS::UIKeyboardTypeDefault);
#endif
@@ -220,7 +220,7 @@ Direction gameGetDirection() {
ReadDirController dirController;
g_screen->screenMessage("Dir?");
-#ifdef IOS
+#ifdef IOS_ULTIMA4
U4IOS::IOSDirectionHelper directionPopup;
#endif
@@ -311,7 +311,7 @@ bool gamePeerCity(int city, void *data) {
g_game->_pausedTimer = 0;
g_screen->screenDisableCursor();
-#ifdef IOS
+#ifdef IOS_ULTIMA4
U4IOS::IOSConversationChoiceHelper continueHelper;
continueHelper.updateChoices(" ");
continueHelper.fullSizeChoicePanel();
@@ -347,7 +347,7 @@ void peer(bool useGem) {
g_screen->screenDisableCursor();
g_context->_location->_viewMode = VIEW_GEM;
-#ifdef IOS
+#ifdef IOS_ULTIMA4
U4IOS::IOSConversationChoiceHelper continueHelper;
continueHelper.updateChoices(" ");
continueHelper.fullSizeChoicePanel();
diff --git a/engines/ultima/ultima4/game/item.cpp b/engines/ultima/ultima4/game/item.cpp
index 3522969bd5..f1f46cdabe 100644
--- a/engines/ultima/ultima4/game/item.cpp
+++ b/engines/ultima/ultima4/game/item.cpp
@@ -218,7 +218,7 @@ void putRuneInInventory(int virt) {
g_context->_party->member(0)->awardXp(100);
g_context->_party->adjustKarma(KA_FOUND_ITEM);
g_ultima->_saveGame->_runes |= virt;
-#ifdef IOS
+#ifdef IOS_ULTIMA4
Common::String virtueName;
switch (virt) {
default:
@@ -264,7 +264,7 @@ void putStoneInInventory(int virt) {
g_context->_party->member(0)->awardXp(200);
g_context->_party->adjustKarma(KA_FOUND_ITEM);
g_ultima->_saveGame->_stones |= virt;
-#ifdef IOS
+#ifdef IOS_ULTIMA4
Common::String stoneName;
switch (virt) {
default:
@@ -310,7 +310,7 @@ void putItemInInventory(int item) {
g_context->_party->member(0)->awardXp(400);
g_context->_party->adjustKarma(KA_FOUND_ITEM);
g_ultima->_saveGame->_items |= item;
-#ifdef IOS
+#ifdef IOS_ULTIMA4
Common::String itemName;
switch (item) {
default:
@@ -357,7 +357,7 @@ void useBBC(int item) {
if (g_context->_location->_coords == abyssEntrance) {
/* must use bell first */
if (item == ITEM_BELL) {
-#ifdef IOS
+#ifdef IOS_ULTIMA4
U4IOS::testFlightPassCheckPoint("The Bell rings on and on!");
#endif
g_screen->screenMessage("\nThe Bell rings on and on!\n");
@@ -365,7 +365,7 @@ void useBBC(int item) {
}
/* then the book */
else if ((item == ITEM_BOOK) && (g_ultima->_saveGame->_items & ITEM_BELL_USED)) {
-#ifdef IOS
+#ifdef IOS_ULTIMA4
U4IOS::testFlightPassCheckPoint("The words resonate with the ringing!");
#endif
g_screen->screenMessage("\nThe words resonate with the ringing!\n");
@@ -374,7 +374,7 @@ void useBBC(int item) {
/* then the candle */
else if ((item == ITEM_CANDLE) && (g_ultima->_saveGame->_items & ITEM_BOOK_USED)) {
g_screen->screenMessage("\nAs you light the Candle the Earth Trembles!\n");
-#ifdef IOS
+#ifdef IOS_ULTIMA4
U4IOS::testFlightPassCheckPoint("As you light the Candle the Earth Trembles!");
#endif
g_ultima->_saveGame->_items |= ITEM_CANDLE_USED;
@@ -419,7 +419,7 @@ void useSkull(int item) {
/* destroy the skull! pat yourself on the back */
if (g_context->_location->_coords.x == 0xe9 && g_context->_location->_coords.y == 0xe9) {
g_screen->screenMessage("\n\nYou cast the Skull of Mondain into the Abyss!\n");
-#ifdef IOS
+#ifdef IOS_ULTIMA4
U4IOS::testFlightPassCheckPoint("You cast the Skull of Mondain into the Abyss!");
#endif
@@ -430,7 +430,7 @@ void useSkull(int item) {
/* use the skull... bad, very bad */
else {
g_screen->screenMessage("\n\nYou hold the evil Skull of Mondain the Wizard aloft...\n");
-#ifdef IOS
+#ifdef IOS_ULTIMA4
U4IOS::testFlightPassCheckPoint("You hold the evil Skull of Mondain the Wizard aloft...");
#endif
@@ -499,7 +499,7 @@ void useStone(int item) {
/* see if we have all the stones, if not, get more names! */
if (attr && needStoneNames) {
g_screen->screenMessage("\n%c:", 'E' - needStoneNames);
-#ifdef IOS
+#ifdef IOS_ULTIMA4
U4IOS::IOSConversationHelper::setIntroString("Which Color?");
#endif
itemHandleStones(gameGetInput());
@@ -523,7 +523,7 @@ void useStone(int item) {
/* in an altar room, named all of the stones, and don't have the key yet... */
if (attr && (stoneMask == *attr) && !(g_ultima->_saveGame->_items & key)) {
-#ifdef IOS
+#ifdef IOS_ULTIMA4
Common::String keyName;
switch (key) {
case ITEM_KEY_C:
@@ -580,7 +580,7 @@ void useStone(int item) {
if (virtueMask > 0)
g_screen->screenMessage("\n\nAs thou doth approach, a voice rings out: What virtue dost stem from %s?\n\n", getBaseVirtueName(virtueMask));
else g_screen->screenMessage("\n\nA voice rings out: What virtue exists independently of Truth, Love, and Courage?\n\n");
-#ifdef IOS
+#ifdef IOS_ULTIMA4
U4IOS::IOSConversationHelper::setIntroString("Which virtue?");
#endif
Common::String virtue = gameGetInput();
@@ -589,7 +589,7 @@ void useStone(int item) {
/* now ask for stone */
g_screen->screenMessage("\n\nThe Voice says: Use thy Stone.\n\nColor:\n");
needStoneNames = 1;
-#ifdef IOS
+#ifdef IOS_ULTIMA4
U4IOS::IOSConversationHelper::setIntroString("Which color?");
#endif
itemHandleStones(gameGetInput());
@@ -605,7 +605,7 @@ void useStone(int item) {
coords.x == 5 && coords.y == 5) {
needStoneNames = 4;
g_screen->screenMessage("\n\nThere are holes for 4 stones.\nWhat colors:\nA:");
-#ifdef IOS
+#ifdef IOS_ULTIMA4
U4IOS::IOSConversationHelper::setIntroString("Which color?");
#endif
itemHandleStones(gameGetInput());
@@ -668,7 +668,7 @@ void putWeaponInInventory(int weapon) {
void useTelescope(int notused) {
g_screen->screenMessage("You see a knob\non the telescope\nmarked A-P\nYou Select:");
-#ifdef IOS
+#ifdef IOS_ULTIMA4
U4IOS::IOSConversationChoiceHelper telescopeHelper;
telescopeHelper.updateChoices("abcdefghijklmnop ");
#endif
diff --git a/engines/ultima/ultima4/game/person.cpp b/engines/ultima/ultima4/game/person.cpp
index 1b25244598..77427dd901 100644
--- a/engines/ultima/ultima4/game/person.cpp
+++ b/engines/ultima/ultima4/game/person.cpp
@@ -175,7 +175,7 @@ Common::List<Common::String> Person::getConversationText(Conversation *cnv, cons
script->unload();
script->load("vendorScript.xml", ids[_npcType - NPC_VENDOR_WEAPONS], "vendor", g_context->_location->_map->getName());
script->run("intro");
-#ifdef IOS
+#ifdef IOS_ULTIMA4
U4IOS::IOSConversationChoiceHelper choiceDialog;
#endif
while (script->getState() != Script::STATE_DONE) {
@@ -185,7 +185,7 @@ Common::List<Common::String> Person::getConversationText(Conversation *cnv, cons
case Script::INPUT_CHOICE: {
const Common::String &choices = script->getChoices();
// Get choice
-#ifdef IOS
+#ifdef IOS_ULTIMA4
choiceDialog.updateChoices(choices, script->getTarget(), npcType);
#endif
char val = ReadChoiceController::get(choices);
@@ -204,7 +204,7 @@ Common::List<Common::String> Person::getConversationText(Conversation *cnv, cons
break;
case Script::INPUT_NUMBER: {
-#ifdef IOS
+#ifdef IOS_ULTIMA4
U4IOS::IOSConversationHelper ipadNumberInput;
ipadNumberInput.beginConversation(U4IOS::UIKeyboardTypeNumberPad, "Amount?");
#endif
@@ -214,7 +214,7 @@ Common::List<Common::String> Person::getConversationText(Conversation *cnv, cons
break;
case Script::INPUT_STRING: {
-#ifdef IOS
+#ifdef IOS_ULTIMA4
U4IOS::IOSConversationHelper ipadNumberInput;
ipadNumberInput.beginConversation(U4IOS::UIKeyboardTypeDefault);
#endif
diff --git a/engines/ultima/ultima4/game/player.h b/engines/ultima/ultima4/game/player.h
index afc89f2ae1..578a470f80 100644
--- a/engines/ultima/ultima4/game/player.h
+++ b/engines/ultima/ultima4/game/player.h
@@ -439,7 +439,7 @@ private:
MapTile _transport;
int _torchDuration;
int _activePlayer;
-#ifdef IOS
+#ifdef IOS_ULTIMA4
friend void U4IOS::syncPartyMembersWithSaveGame();
#endif
};
diff --git a/engines/ultima/ultima4/game/portal.cpp b/engines/ultima/ultima4/game/portal.cpp
index 2e3dd98f2a..72dcd82280 100644
--- a/engines/ultima/ultima4/game/portal.cpp
+++ b/engines/ultima/ultima4/game/portal.cpp
@@ -109,7 +109,7 @@ int usePortalAt(Location *location, MapCoords coords, PortalTriggerAction action
g_screen->screenMessage("Enter the %s!\n\n", destination->getName().c_str());
break;
case Map::DUNGEON:
-#ifdef IOS
+#ifdef IOS_ULTIMA4
U4IOS::testFlightPassCheckPoint("Enter " + destination->getName());
#endif
g_screen->screenMessage("Enter dungeon!\n\n%s\n\n", destination->getName().c_str());
diff --git a/engines/ultima/ultima4/game/stats.cpp b/engines/ultima/ultima4/game/stats.cpp
index ec11b74715..8402e99271 100644
--- a/engines/ultima/ultima4/game/stats.cpp
+++ b/engines/ultima/ultima4/game/stats.cpp
@@ -182,7 +182,7 @@ void StatsArea::update(Menu *menu, MenuEvent &event) {
void StatsArea::highlightPlayer(int player) {
ASSERT(player < g_context->_party->size(), "player number out of range: %d", player);
_mainArea.highlight(0, player * CHAR_HEIGHT, STATS_AREA_WIDTH * CHAR_WIDTH, CHAR_HEIGHT);
-#ifdef IOS
+#ifdef IOS_ULTIMA4
U4IOS::updateActivePartyMember(player);
#endif
}
diff --git a/engines/ultima/ultima4/game/view.cpp b/engines/ultima/ultima4/game/view.cpp
index e798ed68b4..f798569a12 100644
--- a/engines/ultima/ultima4/game/view.cpp
+++ b/engines/ultima/ultima4/game/view.cpp
@@ -48,7 +48,7 @@ void View::clear() {
void View::update() {
if (_highlighted)
drawHighlighted();
-#ifdef IOS
+#ifdef IOS_ULTIMA4
U4IOS::updateView();
#endif
}
@@ -56,7 +56,7 @@ void View::update() {
void View::update(int x, int y, int width, int height) {
if (_highlighted)
drawHighlighted();
-#ifdef IOS
+#ifdef IOS_ULTIMA4
U4IOS::updateRectInView(x, y, width, height);
#endif
}
diff --git a/engines/ultima/ultima4/game/view.h b/engines/ultima/ultima4/game/view.h
index 18947699b7..5898588ab2 100644
--- a/engines/ultima/ultima4/game/view.h
+++ b/engines/ultima/ultima4/game/view.h
@@ -70,7 +70,7 @@ protected:
bool _highlighted;
int _highlightX, _highlightY, _highlightW, _highlightH;
void drawHighlighted();
-#ifdef IOS
+#ifdef IOS_ULTIMA4
friend void U4IOS::updateScreenView();
#endif
static Image *_screen;
diff --git a/engines/ultima/ultima4/gfx/screen.cpp b/engines/ultima/ultima4/gfx/screen.cpp
index 0b0fffee95..3f983a8fdc 100644
--- a/engines/ultima/ultima4/gfx/screen.cpp
+++ b/engines/ultima/ultima4/gfx/screen.cpp
@@ -250,7 +250,7 @@ void Screen::screenPrompt() {
}
void Screen::screenMessage(const char *fmt, ...) {
-#ifdef IOS
+#ifdef IOS_ULTIMA4
static bool recursed = false;
#endif
@@ -264,7 +264,7 @@ void Screen::screenMessage(const char *fmt, ...) {
va_start(args, fmt);
vsnprintf(buffer, BUFFER_SIZE, fmt, args);
va_end(args);
-#ifdef IOS
+#ifdef IOS_ULTIMA4
if (recursed)
recursed = false;
else
@@ -312,7 +312,7 @@ void Screen::screenMessage(const char *fmt, ...) {
i++;
g_context->_line++;
g_context->col = 0;
-#ifdef IOS
+#ifdef IOS_ULTIMA4
recursed = true;
#endif
screenMessage("%s", buffer + i);
@@ -1407,7 +1407,7 @@ Image *Screen::screenScaleDown(Image *src, int scale) {
return dest;
}
-#ifdef IOS
+#ifdef IOS_ULTIMA4
//Unsure if implementation required in iOS.
void inline screenLock() {};
void inline screenUnlock() {};
diff --git a/engines/ultima/ultima4/map/shrine.cpp b/engines/ultima/ultima4/map/shrine.cpp
index f10b57f648..b436d6e43f 100644
--- a/engines/ultima/ultima4/map/shrine.cpp
+++ b/engines/ultima/ultima4/map/shrine.cpp
@@ -104,7 +104,7 @@ void Shrine::enter() {
shrineAdvice = u4read_stringtable(avatar, 93682, 24);
u4fclose(avatar);
}
-#ifdef IOS
+#ifdef IOS_ULTIMA4
U4IOS::IOSHideGameControllerHelper hideControllsHelper;
#endif
if (settings._enhancements && settings._enhancementsOptions._u5shrines)
@@ -114,25 +114,25 @@ void Shrine::enter() {
g_screen->screenMessage("\nUpon which virtue dost thou meditate?\n");
Common::String virtue;
-#ifdef IOS
+#ifdef IOS_ULTIMA4
{
U4IOS::IOSConversationHelper inputVirture;
inputVirture.beginConversation(U4IOS::UIKeyboardTypeDefault, "Upon which virtue dost thou meditate?");
#endif
virtue = ReadStringController::get(32, TEXT_AREA_X + g_context->col, TEXT_AREA_Y + g_context->_line);
-#ifdef IOS
+#ifdef IOS_ULTIMA4
}
#endif
int choice;
g_screen->screenMessage("\n\nFor how many Cycles (0-3)? ");
-#ifdef IOS
+#ifdef IOS_ULTIMA4
{
U4IOS::IOSConversationChoiceHelper cyclesChoice;
cyclesChoice.updateChoices("0123 \015\033");
#endif
choice = ReadChoiceController::get("0123\015\033");
-#ifdef IOS
+#ifdef IOS_ULTIMA4
}
#endif
if (choice == '\033' || choice == '\015')
@@ -220,14 +220,14 @@ void Shrine::askMantra() {
g_screen->screenMessage("\nMantra: ");
g_screen->update(); // FIXME: needed?
Common::String mantra;
-#ifdef IOS
+#ifdef IOS_ULTIMA4
{
U4IOS::IOSConversationHelper mantraHelper;
mantraHelper.beginConversation(U4IOS::UIKeyboardTypeASCIICapable, "Mantra?");
#endif
mantra = ReadStringController::get(4, TEXT_AREA_X + g_context->col, TEXT_AREA_Y + g_context->_line);
g_screen->screenMessage("\n");
-#ifdef IOS
+#ifdef IOS_ULTIMA4
}
#endif
@@ -251,7 +251,7 @@ void Shrine::askMantra() {
g_screen->screenMessage("\nThy thoughts are pure. "
"Thou art granted a vision!\n");
-#ifdef IOS
+#ifdef IOS_ULTIMA4
U4IOS::IOSConversationChoiceHelper choiceDialog;
choiceDialog.updateChoices(" ");
U4IOS::testFlightPassCheckPoint(Common::String("Gained avatarhood in: ")
diff --git a/engines/ultima/ultima4/map/tileview.cpp b/engines/ultima/ultima4/map/tileview.cpp
index a04717bc89..9702a0c883 100644
--- a/engines/ultima/ultima4/map/tileview.cpp
+++ b/engines/ultima/ultima4/map/tileview.cpp
@@ -97,7 +97,7 @@ void TileView::drawTile(MapTile &mapTile, bool focus, int x, int y) {
// Draw the tile to the screen
if (tile->getAnim()) {
// First, create our animated version of the tile
-#ifdef IOS
+#ifdef IOS_ULTIMA4
animated->clearImageContents();
#endif
tile->getAnim()->draw(_animated, tile, mapTile, DIR_NONE);
diff --git a/engines/ultima/ultima4/sound/music.h b/engines/ultima/ultima4/sound/music.h
index b85f8d5cba..4225e62b89 100644
--- a/engines/ultima/ultima4/sound/music.h
+++ b/engines/ultima/ultima4/sound/music.h
@@ -138,7 +138,7 @@ public:
playMid(SHOPPING);
}
void intro() {
-#ifdef IOS
+#ifdef IOS_ULTIMA4
_on = true; // Force iOS to turn this back on from going in the background.
#endif
playMid(_introMid);
Commit: a0b0074659a5bcd9b6bf4a3d834ca7c744373011
https://github.com/scummvm/scummvm/commit/a0b0074659a5bcd9b6bf4a3d834ca7c744373011
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2020-04-25T09:06:40-07:00
Commit Message:
ULTIMA4: Fixes to word capitalizations in field names
Changed paths:
engines/ultima/ultima4/controllers/combat_controller.cpp
engines/ultima/ultima4/controllers/game_controller.cpp
engines/ultima/ultima4/controllers/inn_controller.cpp
engines/ultima/ultima4/controllers/intro_controller.cpp
engines/ultima/ultima4/core/debugger.cpp
engines/ultima/ultima4/core/debugger_actions.cpp
engines/ultima/ultima4/core/settings.cpp
engines/ultima/ultima4/core/settings.h
engines/ultima/ultima4/game/game.cpp
engines/ultima/ultima4/game/item.cpp
engines/ultima/ultima4/game/spell.cpp
engines/ultima/ultima4/gfx/screen.cpp
engines/ultima/ultima4/map/dungeon.cpp
engines/ultima/ultima4/map/dungeonview.cpp
engines/ultima/ultima4/map/location.cpp
engines/ultima/ultima4/map/map.cpp
engines/ultima/ultima4/map/map.h
engines/ultima/ultima4/map/maploader.cpp
engines/ultima/ultima4/map/mapmgr.cpp
engines/ultima/ultima4/map/shrine.cpp
engines/ultima/ultima4/map/tile.cpp
engines/ultima/ultima4/map/tile.h
engines/ultima/ultima4/map/tileview.cpp
engines/ultima/ultima4/map/tileview.h
diff --git a/engines/ultima/ultima4/controllers/combat_controller.cpp b/engines/ultima/ultima4/controllers/combat_controller.cpp
index b15e6c3898..e6767af11d 100644
--- a/engines/ultima/ultima4/controllers/combat_controller.cpp
+++ b/engines/ultima/ultima4/controllers/combat_controller.cpp
@@ -528,12 +528,12 @@ void CombatController::awardLoot() {
if (_creature->leavesChest() &&
ground->isCreatureWalkable() &&
(!(g_context->_location->_context & CTX_DUNGEON) || ground->isDungeonFloor())) {
- MapTile chest = g_context->_location->_map->_tileset->getByName("chest")->getId();
+ MapTile chest = g_context->_location->_map->_tileSet->getByName("chest")->getId();
g_context->_location->_map->addObject(chest, chest, coords);
}
/* add a ship if you just defeated a pirate ship */
else if (_creature->getTile().getTileType()->isPirateShip()) {
- MapTile ship = g_context->_location->_map->_tileset->getByName("ship")->getId();
+ MapTile ship = g_context->_location->_map->_tileSet->getByName("ship")->getId();
ship.setDirection(_creature->getTile().getDirection());
g_context->_location->_map->addObject(ship, ship, coords);
}
@@ -553,8 +553,8 @@ bool CombatController::attackAt(const Coords &coords, PartyMember *attacker, int
const Weapon *weapon = attacker->getWeapon();
bool wrongRange = weapon->rangeAbsolute() && (distance != range);
- MapTile hittile = _map->_tileset->getByName(weapon->getHitTile())->getId();
- MapTile misstile = _map->_tileset->getByName(weapon->getMissTile())->getId();
+ MapTile hittile = _map->_tileSet->getByName(weapon->getHitTile())->getId();
+ MapTile misstile = _map->_tileSet->getByName(weapon->getMissTile())->getId();
// Check to see if something hit
Creature *creature = _map->creatureAt(coords);
@@ -597,8 +597,8 @@ bool CombatController::attackAt(const Coords &coords, PartyMember *attacker, int
}
bool CombatController::rangedAttack(const Coords &coords, Creature *attacker) {
- MapTile hittile = _map->_tileset->getByName(attacker->getHitTile())->getId();
- MapTile misstile = _map->_tileset->getByName(attacker->getMissTile())->getId();
+ MapTile hittile = _map->_tileSet->getByName(attacker->getHitTile())->getId();
+ MapTile misstile = _map->_tileSet->getByName(attacker->getMissTile())->getId();
Creature *target = isCreature(attacker) ? _map->partyMemberAt(coords) : _map->creatureAt(coords);
@@ -676,13 +676,13 @@ void CombatController::rangedMiss(const Coords &coords, Creature *attacker) {
/* If the creature leaves a tile behind, do it here! (lava lizard, etc) */
const Tile *ground = _map->tileTypeAt(coords, WITH_GROUND_OBJECTS);
if (attacker->leavesTile() && ground->isWalkable())
- _map->_annotations->add(coords, _map->_tileset->getByName(attacker->getHitTile())->getId());
+ _map->_annotations->add(coords, _map->_tileSet->getByName(attacker->getHitTile())->getId());
}
bool CombatController::returnWeaponToOwner(const Coords &coords, int distance, int dir, const Weapon *weapon) {
MapCoords new_coords = coords;
- MapTile misstile = _map->_tileset->getByName(weapon->getMissTile())->getId();
+ MapTile misstile = _map->_tileSet->getByName(weapon->getMissTile())->getId();
/* reverse the direction of the weapon */
Direction returnDir = dirReverse(dirFromMask(dir));
@@ -1113,7 +1113,7 @@ void CombatController::attack() {
// does weapon leave a tile behind? (e.g. flaming oil)
const Tile *ground = _map->tileTypeAt(targetCoords, WITHOUT_OBJECTS);
if (!weapon->leavesTile().empty() && ground->isWalkable())
- _map->_annotations->add(targetCoords, _map->_tileset->getByName(weapon->leavesTile())->getId());
+ _map->_annotations->add(targetCoords, _map->_tileSet->getByName(weapon->leavesTile())->getId());
/* show the 'miss' tile */
if (!foundTarget) {
diff --git a/engines/ultima/ultima4/controllers/game_controller.cpp b/engines/ultima/ultima4/controllers/game_controller.cpp
index dc386bf5b9..8fa6632bf2 100644
--- a/engines/ultima/ultima4/controllers/game_controller.cpp
+++ b/engines/ultima/ultima4/controllers/game_controller.cpp
@@ -152,7 +152,7 @@ void GameController::setMap(Map *map, bool saveLocation, const Portal *portal, T
#endif
/* now, actually set our new tileset */
- _mapArea.setTileset(map->_tileset);
+ _mapArea.setTileset(map->_tileSet);
if (isCity(map)) {
City *city = dynamic_cast<City *>(map);
@@ -181,7 +181,7 @@ int GameController::exitToParentMap() {
locationFree(&g_context->_location);
// restore the tileset to the one the current map uses
- _mapArea.setTileset(g_context->_location->_map->_tileset);
+ _mapArea.setTileset(g_context->_location->_map->_tileSet);
#ifdef IOS_ULTIMA4
U4IOS::updateGameControllerContext(c->location->context);
#endif
@@ -285,7 +285,7 @@ void GameController::flashTile(const Coords &coords, MapTile tile, int frames) {
}
void GameController::flashTile(const Coords &coords, const Common::String &tilename, int timeFactor) {
- Tile *tile = g_context->_location->_map->_tileset->getByName(tilename);
+ Tile *tile = g_context->_location->_map->_tileSet->getByName(tilename);
ASSERT(tile, "no tile named '%s' found in tileset", tilename.c_str());
flashTile(coords, tile->getId(), timeFactor);
}
@@ -735,7 +735,7 @@ void GameController::checkRandomCreatures() {
}
void GameController::checkBridgeTrolls() {
- const Tile *bridge = g_context->_location->_map->_tileset->getByName("bridge");
+ const Tile *bridge = g_context->_location->_map->_tileSet->getByName("bridge");
if (!bridge)
return;
@@ -763,7 +763,7 @@ bool GameController::createBalloon(Map *map) {
return false;
}
- const Tile *balloon = map->_tileset->getByName("balloon");
+ const Tile *balloon = map->_tileSet->getByName("balloon");
ASSERT(balloon, "no balloon tile found in tileset");
map->addObject(balloon->getId(), balloon->getId(), map->getLabel("balloon"));
return true;
diff --git a/engines/ultima/ultima4/controllers/inn_controller.cpp b/engines/ultima/ultima4/controllers/inn_controller.cpp
index b47cdbd8fc..79e0798cbc 100644
--- a/engines/ultima/ultima4/controllers/inn_controller.cpp
+++ b/engines/ultima/ultima4/controllers/inn_controller.cpp
@@ -51,7 +51,7 @@ void InnController::begin() {
EventHandler::wait_msecs(INN_FADE_OUT_TIME);
/* show the sleeping avatar */
- g_context->_party->setTransport(g_context->_location->_map->_tileset->getByName("corpse")->getId());
+ g_context->_party->setTransport(g_context->_location->_map->_tileSet->getByName("corpse")->getId());
gameUpdateScreen();
g_screen->screenDisableCursor();
@@ -61,7 +61,7 @@ void InnController::begin() {
g_screen->screenEnableCursor();
/* restore the avatar to normal */
- g_context->_party->setTransport(g_context->_location->_map->_tileset->getByName("avatar")->getId());
+ g_context->_party->setTransport(g_context->_location->_map->_tileSet->getByName("avatar")->getId());
gameUpdateScreen();
/* the party is always healed */
diff --git a/engines/ultima/ultima4/controllers/intro_controller.cpp b/engines/ultima/ultima4/controllers/intro_controller.cpp
index 78df2c9b76..70aa2458d8 100644
--- a/engines/ultima/ultima4/controllers/intro_controller.cpp
+++ b/engines/ultima/ultima4/controllers/intro_controller.cpp
@@ -249,8 +249,8 @@ IntroController::IntroController() : Controller(1),
_soundMenu.setClosesMenu(CANCEL);
_inputMenu.setTitle("Keyboard Options:", 0, 0);
- _inputMenu.add(MI_INPUT_01, new IntMenuItem("Repeat Delay %4d msec", 2, 2,/*'d'*/ 7, &_settingsChanged._keydelay, 100, MAX_KEY_DELAY, 100));
- _inputMenu.add(MI_INPUT_02, new IntMenuItem("Repeat Interval %4d msec", 2, 3,/*'i'*/ 7, &_settingsChanged._keyinterval, 10, MAX_KEY_INTERVAL, 10));
+ _inputMenu.add(MI_INPUT_01, new IntMenuItem("Repeat Delay %4d msec", 2, 2,/*'d'*/ 7, &_settingsChanged._keyDelay, 100, MAX_KEY_DELAY, 100));
+ _inputMenu.add(MI_INPUT_02, new IntMenuItem("Repeat Interval %4d msec", 2, 3,/*'i'*/ 7, &_settingsChanged._keyInterval, 10, MAX_KEY_INTERVAL, 10));
/* "Mouse Options:" is drawn in the updateInputMenu() function */
_inputMenu.add(MI_INPUT_03, new BoolMenuItem("Mouse %s", 2, 7,/*'m'*/ 0, &_settingsChanged._mouseOptions._enabled));
_inputMenu.add(USE_SETTINGS, "\010 Use These Settings", 2, 11,/*'u'*/ 2);
@@ -276,7 +276,7 @@ IntroController::IntroController() : Controller(1),
/* move the BATTLE DIFFICULTY, DEBUG, and AUTOMATIC ACTIONS settings to "enhancementsOptions" */
_gameplayMenu.setTitle("Enhanced Gameplay Options:", 0, 0);
_gameplayMenu.add(MI_GAMEPLAY_01, new StringMenuItem("Battle Difficulty %s", 2, 2,/*'b'*/ 0, &_settingsChanged._battleDiff, settings.getBattleDiffs()));
- _gameplayMenu.add(MI_GAMEPLAY_02, new BoolMenuItem("Fixed Chest Traps %s", 2, 3,/*'t'*/ 12, &_settingsChanged._enhancementsOptions._c64chestTraps));
+ _gameplayMenu.add(MI_GAMEPLAY_02, new BoolMenuItem("Fixed Chest Traps %s", 2, 3,/*'t'*/ 12, &_settingsChanged._enhancementsOptions._c64ChestTraps));
_gameplayMenu.add(MI_GAMEPLAY_03, new BoolMenuItem("Gazer Spawns Insects %s", 2, 4,/*'g'*/ 0, &_settingsChanged._enhancementsOptions._gazerSpawnsInsects));
_gameplayMenu.add(MI_GAMEPLAY_04, new BoolMenuItem("Gem View Shows Objects %s", 2, 5,/*'e'*/ 1, &_settingsChanged._enhancementsOptions._peerShowsObjects));
_gameplayMenu.add(MI_GAMEPLAY_05, new BoolMenuItem("Slime Divides %s", 2, 6,/*'s'*/ 0, &_settingsChanged._enhancementsOptions._slimeDivides));
@@ -293,8 +293,8 @@ IntroController::IntroController() : Controller(1),
_interfaceMenu.add(MI_INTERFACE_02, new BoolMenuItem("Set Active Player %s", 2, 4,/*'p'*/ 11, &_settingsChanged._enhancementsOptions._activePlayer));
_interfaceMenu.add(MI_INTERFACE_03, new BoolMenuItem("Smart 'Enter' Key %s", 2, 5,/*'e'*/ 7, &_settingsChanged._enhancementsOptions._smartEnterKey));
_interfaceMenu.add(MI_INTERFACE_04, new BoolMenuItem("Text Colorization %s", 2, 6,/*'t'*/ 0, &_settingsChanged._enhancementsOptions._textColorization));
- _interfaceMenu.add(MI_INTERFACE_05, new BoolMenuItem("Ultima V Shrines %s", 2, 7,/*'s'*/ 9, &_settingsChanged._enhancementsOptions._u5shrines));
- _interfaceMenu.add(MI_INTERFACE_06, new BoolMenuItem("Ultima V Spell Mixing %s", 2, 8,/*'m'*/ 15, &_settingsChanged._enhancementsOptions._u5spellMixing));
+ _interfaceMenu.add(MI_INTERFACE_05, new BoolMenuItem("Ultima V Shrines %s", 2, 7,/*'s'*/ 9, &_settingsChanged._enhancementsOptions._u5Shrines));
+ _interfaceMenu.add(MI_INTERFACE_06, new BoolMenuItem("Ultima V Spell Mixing %s", 2, 8,/*'m'*/ 15, &_settingsChanged._enhancementsOptions._u5SpellMixing));
_interfaceMenu.add(USE_SETTINGS, "\010 Use These Settings", 2, 11,/*'u'*/ 2);
_interfaceMenu.add(CANCEL, "\010 Cancel", 2, 12,/*'c'*/ 2);
_interfaceMenu.addShortcutKey(CANCEL, ' ');
@@ -1131,7 +1131,7 @@ void IntroController::updateInputMenu(MenuEvent &event) {
settings.write();
// re-initialize keyboard
- KeyHandler::setKeyRepeat(_settingsChanged._keydelay, _settingsChanged._keyinterval);
+ KeyHandler::setKeyRepeat(_settingsChanged._keyDelay, _settingsChanged._keyInterval);
#ifdef SLACK_ON_SDL_AGNOSTICISM
if (settings.mouseOptions.enabled) {
diff --git a/engines/ultima/ultima4/core/debugger.cpp b/engines/ultima/ultima4/core/debugger.cpp
index 749eb167d6..c80eb9f42e 100644
--- a/engines/ultima/ultima4/core/debugger.cpp
+++ b/engines/ultima/ultima4/core/debugger.cpp
@@ -505,7 +505,7 @@ bool Debugger::cmdExit(int argc, const char **argv) {
if (g_context->_transportContext == TRANSPORT_SHIP)
g_context->_lastShip = obj;
- Tile *avatar = g_context->_location->_map->_tileset->getByName("avatar");
+ Tile *avatar = g_context->_location->_map->_tileSet->getByName("avatar");
ASSERT(avatar, "no avatar tile found in tileset");
g_context->_party->setTransport(avatar->getId());
@@ -789,7 +789,7 @@ bool Debugger::cmdMixReagents(int argc, const char **argv) {
g_context->_stats->resetReagentsMenu();
g_context->_stats->setView(MIX_REAGENTS);
- if (settings._enhancements && settings._enhancementsOptions._u5spellMixing)
+ if (settings._enhancements && settings._enhancementsOptions._u5SpellMixing)
done = mixReagentsForSpellU5(spell);
else
done = mixReagentsForSpellU4(spell);
@@ -1538,9 +1538,9 @@ bool Debugger::cmdTransport(int argc, const char **argv) {
return isDebuggerActive();
}
- _horse = g_context->_location->_map->_tileset->getByName("horse")->getId();
- _ship = g_context->_location->_map->_tileset->getByName("ship")->getId();
- _balloon = g_context->_location->_map->_tileset->getByName("balloon")->getId();
+ _horse = g_context->_location->_map->_tileSet->getByName("horse")->getId();
+ _ship = g_context->_location->_map->_tileSet->getByName("ship")->getId();
+ _balloon = g_context->_location->_map->_tileSet->getByName("balloon")->getId();
MapCoords coords = g_context->_location->_coords;
MapTile *choice;
@@ -1572,7 +1572,7 @@ bool Debugger::cmdTransport(int argc, const char **argv) {
return isDebuggerActive();
}
- tile = g_context->_location->_map->_tileset->get(choice->getId());
+ tile = g_context->_location->_map->_tileSet->get(choice->getId());
Direction dir;
if (argc == 3) {
diff --git a/engines/ultima/ultima4/core/debugger_actions.cpp b/engines/ultima/ultima4/core/debugger_actions.cpp
index be68d1de18..f7be84e88b 100644
--- a/engines/ultima/ultima4/core/debugger_actions.cpp
+++ b/engines/ultima/ultima4/core/debugger_actions.cpp
@@ -93,7 +93,7 @@ bool DebuggerActions::destroyAt(const Coords &coords) {
Creature *c = dynamic_cast<Creature *>(obj);
g_screen->screenMessage("%s Destroyed!\n", c->getName().c_str());
} else {
- Tile *t = g_context->_location->_map->_tileset->get(obj->getTile()._id);
+ Tile *t = g_context->_location->_map->_tileSet->get(obj->getTile()._id);
g_screen->screenMessage("%s Destroyed!\n", t->getName().c_str());
}
@@ -148,7 +148,7 @@ bool DebuggerActions::getChestTrapHandler(int player) {
int randNum = xu4_random(4);
/* Do we use u4dos's way of trap-determination, or the original intended way? */
- int passTest = (settings._enhancements && settings._enhancementsOptions._c64chestTraps) ?
+ int passTest = (settings._enhancements && settings._enhancementsOptions._c64ChestTraps) ?
(xu4_random(2) == 0) : /* xu4-enhanced */
((randNum & 1) == 0); /* u4dos original way (only allows even numbers through, so only acid and poison show) */
@@ -208,7 +208,7 @@ bool DebuggerActions::jimmyAt(const Coords &coords) {
return false;
if (g_ultima->_saveGame->_keys) {
- Tile *door = g_context->_location->_map->_tileset->getByName("door");
+ Tile *door = g_context->_location->_map->_tileSet->getByName("door");
ASSERT(door, "no door tile found in tileset");
g_ultima->_saveGame->_keys--;
g_context->_location->_map->_annotations->add(coords, door->getId());
@@ -327,7 +327,7 @@ bool DebuggerActions::openAt(const Coords &coords) {
return true;
}
- Tile *floor = g_context->_location->_map->_tileset->getByName("brick_floor");
+ Tile *floor = g_context->_location->_map->_tileSet->getByName("brick_floor");
ASSERT(floor, "no floor tile found in tileset");
g_context->_location->_map->_annotations->add(coords, floor->getId(), false, true)->setTTL(4);
diff --git a/engines/ultima/ultima4/core/settings.cpp b/engines/ultima/ultima4/core/settings.cpp
index 041a184c73..3912c1a8ee 100644
--- a/engines/ultima/ultima4/core/settings.cpp
+++ b/engines/ultima/ultima4/core/settings.cpp
@@ -36,13 +36,13 @@ Settings *Settings::_instance = nullptr;
bool SettingsEnhancementOptions::operator==(const SettingsEnhancementOptions &s) const {
return _activePlayer == s._activePlayer
- && _u5spellMixing == s._u5spellMixing
- && _u5shrines == s._u5shrines
- && _u5combat == s._u5combat
+ && _u5SpellMixing == s._u5SpellMixing
+ && _u5Shrines == s._u5Shrines
+ && _u5Combat == s._u5Combat
&& _slimeDivides == s._slimeDivides
&& _gazerSpawnsInsects == s._gazerSpawnsInsects
&& _textColorization == s._textColorization
- && _c64chestTraps == s._c64chestTraps
+ && _c64ChestTraps == s._c64ChestTraps
&& _smartEnterKey == s._smartEnterKey
&& _peerShowsObjects == s._peerShowsObjects
&& _u4TileTransparencyHack == s._u4TileTransparencyHack
@@ -65,8 +65,8 @@ bool SettingsData::operator==(const SettingsData &s) const {
&& _screenAnimationFramesPerSecond == s._screenAnimationFramesPerSecond
&& _innAlwaysCombat == s._innAlwaysCombat
&& _innTime == s._innTime
- && _keydelay == s._keydelay
- && _keyinterval == s._keyinterval
+ && _keyDelay == s._keyDelay
+ && _keyInterval == s._keyInterval
&& _mouseOptions == s._mouseOptions
&& _screenShakes == s._screenShakes
&& _gamma == s._gamma
@@ -149,8 +149,8 @@ void Settings::synchronize(Shared::ConfSerializer &s) {
s.syncAsInt("gamma", _gamma, DEFAULT_GAMMA);
s.syncAsBool("volumeFades", _volumeFades, DEFAULT_VOLUME_FADES);
s.syncAsBool("shortcutCommands", _shortcutCommands, DEFAULT_SHORTCUT_COMMANDS);
- s.syncAsInt("keydelay", _keydelay, DEFAULT_KEY_DELAY);
- s.syncAsInt("keyinterval", _keyinterval, DEFAULT_KEY_INTERVAL);
+ s.syncAsInt("keydelay", _keyDelay, DEFAULT_KEY_DELAY);
+ s.syncAsInt("keyinterval", _keyInterval, DEFAULT_KEY_INTERVAL);
s.syncAsBool("filterMoveMessages", _filterMoveMessages, DEFAULT_FILTER_MOVE_MESSAGES);
s.syncAsInt("battlespeed", _battleSpeed, DEFAULT_BATTLE_SPEED);
s.syncAsBool("enhancements", _enhancements, DEFAULT_ENHANCEMENTS);
@@ -170,17 +170,17 @@ void Settings::synchronize(Shared::ConfSerializer &s) {
// all specific minor enhancements default to "on", any major enhancements default to "off"
// minor enhancement options
s.syncAsBool("activePlayer", _enhancementsOptions._activePlayer, true);
- s.syncAsBool("u5spellMixing", _enhancementsOptions._u5spellMixing, true);
- s.syncAsBool("u5shrines", _enhancementsOptions._u5shrines, true);
+ s.syncAsBool("u5spellMixing", _enhancementsOptions._u5SpellMixing, true);
+ s.syncAsBool("u5shrines", _enhancementsOptions._u5Shrines, true);
s.syncAsBool("slimeDivides", _enhancementsOptions._slimeDivides, true);
s.syncAsBool("gazerSpawnsInsects", _enhancementsOptions._gazerSpawnsInsects, true);
s.syncAsBool("textColorization", _enhancementsOptions._textColorization, false);
- s.syncAsBool("c64chestTraps", _enhancementsOptions._c64chestTraps, true);
+ s.syncAsBool("c64chestTraps", _enhancementsOptions._c64ChestTraps, true);
s.syncAsBool("smartEnterKey", _enhancementsOptions._smartEnterKey, true);
// major enhancement options
s.syncAsBool("peerShowsObjects", _enhancementsOptions._peerShowsObjects, false);
- s.syncAsBool("u5combat", _enhancementsOptions._u5combat, false);
+ s.syncAsBool("u5combat", _enhancementsOptions._u5Combat, false);
// graphics enhancements options
s.syncAsBool("renderTileTransparency", _enhancementsOptions._u4TileTransparencyHack, true);
diff --git a/engines/ultima/ultima4/core/settings.h b/engines/ultima/ultima4/core/settings.h
index 5e68dced89..9b986d2478 100644
--- a/engines/ultima/ultima4/core/settings.h
+++ b/engines/ultima/ultima4/core/settings.h
@@ -77,13 +77,13 @@ namespace Ultima4 {
struct SettingsEnhancementOptions {
bool _activePlayer;
- bool _u5spellMixing;
- bool _u5shrines;
- bool _u5combat;
+ bool _u5SpellMixing;
+ bool _u5Shrines;
+ bool _u5Combat;
bool _slimeDivides;
bool _gazerSpawnsInsects;
bool _textColorization;
- bool _c64chestTraps;
+ bool _c64ChestTraps;
bool _smartEnterKey;
bool _peerShowsObjects;
bool _u4TileTransparencyHack;
@@ -120,8 +120,8 @@ public:
int _screenAnimationFramesPerSecond;
bool _innAlwaysCombat;
int _innTime;
- int _keydelay;
- int _keyinterval;
+ int _keyDelay;
+ int _keyInterval;
MouseOptions _mouseOptions;
int _musicVol;
uint _scale;
diff --git a/engines/ultima/ultima4/game/game.cpp b/engines/ultima/ultima4/game/game.cpp
index d15388e38f..f850dc12ee 100644
--- a/engines/ultima/ultima4/game/game.cpp
+++ b/engines/ultima/ultima4/game/game.cpp
@@ -246,7 +246,7 @@ bool fireAt(const Coords &coords, bool originAvatar) {
Object *obj = nullptr;
- MapTile tile(g_context->_location->_map->_tileset->getByName("miss_flash")->getId());
+ MapTile tile(g_context->_location->_map->_tileSet->getByName("miss_flash")->getId());
GameController::flashTile(coords, tile, 1);
obj = g_context->_location->_map->objectAt(coords);
@@ -465,7 +465,7 @@ bool creatureRangeAttack(const Coords &coords, Creature *m) {
// int attackdelay = MAX_BATTLE_SPEED - settings.battleSpeed;
// Figure out what the ranged attack should look like
- MapTile tile(g_context->_location->_map->_tileset->getByName((m && !m->getWorldrangedtile().empty()) ?
+ MapTile tile(g_context->_location->_map->_tileSet->getByName((m && !m->getWorldrangedtile().empty()) ?
m->getWorldrangedtile() :
"hit_flash")->getId());
diff --git a/engines/ultima/ultima4/game/item.cpp b/engines/ultima/ultima4/game/item.cpp
index f1f46cdabe..6b75294f2a 100644
--- a/engines/ultima/ultima4/game/item.cpp
+++ b/engines/ultima/ultima4/game/item.cpp
@@ -555,7 +555,7 @@ void useStone(int item) {
MapCoords pos;
g_screen->screenMessage("\n\nThe altar changes before thyne eyes!\n");
g_context->_location->getCurrentPosition(&pos);
- g_context->_location->_map->_annotations->add(pos, g_context->_location->_map->_tileset->getByName("down_ladder")->getId());
+ g_context->_location->_map->_annotations->add(pos, g_context->_location->_map->_tileSet->getByName("down_ladder")->getId());
}
/* start chamber of the codex sequence... */
else {
diff --git a/engines/ultima/ultima4/game/spell.cpp b/engines/ultima/ultima4/game/spell.cpp
index d81875112d..1ac96c08a9 100644
--- a/engines/ultima/ultima4/game/spell.cpp
+++ b/engines/ultima/ultima4/game/spell.cpp
@@ -375,7 +375,7 @@ void spellMagicAttack(const Common::String &tilename, Direction dir, int minDama
CombatController *controller = spellCombatController();
PartyMemberVector *party = controller->getParty();
- MapTile tile = g_context->_location->_map->_tileset->getByName(tilename)->getId();
+ MapTile tile = g_context->_location->_map->_tileSet->getByName(tilename)->getId();
int attackDamage = ((minDamage >= 0) && (minDamage < maxDamage)) ?
xu4_random((maxDamage + 1) - minDamage) + minDamage :
@@ -554,16 +554,16 @@ static int spellEField(int param) {
/* Make sure params valid */
switch (fieldType) {
case ENERGYFIELD_FIRE:
- fieldTile = g_context->_location->_map->_tileset->getByName("fire_field")->getId();
+ fieldTile = g_context->_location->_map->_tileSet->getByName("fire_field")->getId();
break;
case ENERGYFIELD_LIGHTNING:
- fieldTile = g_context->_location->_map->_tileset->getByName("energy_field")->getId();
+ fieldTile = g_context->_location->_map->_tileSet->getByName("energy_field")->getId();
break;
case ENERGYFIELD_POISON:
- fieldTile = g_context->_location->_map->_tileset->getByName("poison_field")->getId();
+ fieldTile = g_context->_location->_map->_tileSet->getByName("poison_field")->getId();
break;
case ENERGYFIELD_SLEEP:
- fieldTile = g_context->_location->_map->_tileset->getByName("sleep_field")->getId();
+ fieldTile = g_context->_location->_map->_tileSet->getByName("sleep_field")->getId();
break;
default:
return 0;
diff --git a/engines/ultima/ultima4/gfx/screen.cpp b/engines/ultima/ultima4/gfx/screen.cpp
index 3f983a8fdc..b80d6dfa29 100644
--- a/engines/ultima/ultima4/gfx/screen.cpp
+++ b/engines/ultima/ultima4/gfx/screen.cpp
@@ -90,7 +90,7 @@ void Screen::init() {
debug(1, "using %s scaler\n", settings._filter.c_str());
- KeyHandler::setKeyRepeat(settings._keydelay, settings._keyinterval);
+ KeyHandler::setKeyRepeat(settings._keyDelay, settings._keyInterval);
/* find the tile animations for our tileset */
_tileAnims = nullptr;
@@ -400,7 +400,7 @@ Layout *Screen::screenLoadLayoutFromConf(const ConfigElement &conf) {
Std::vector<MapTile> Screen::screenViewportTile(uint width, uint height, int x, int y, bool &focus) {
MapCoords center = g_context->_location->_coords;
- static MapTile grass = g_context->_location->_map->_tileset->getByName("grass")->getId();
+ static MapTile grass = g_context->_location->_map->_tileSet->getByName("grass")->getId();
if (g_context->_location->_map->_width <= width &&
g_context->_location->_map->_height <= height) {
@@ -468,7 +468,7 @@ void Screen::screenUpdate(TileView *view, bool showmap, bool blackout) {
DungeonViewer.display(g_context, view);
screenRedrawMapArea();
} else if (showmap) {
- static MapTile black = g_context->_location->_map->_tileset->getByName("black")->getId();
+ static MapTile black = g_context->_location->_map->_tileSet->getByName("black")->getId();
//static MapTile avatar = g_context->_location->_map->_tileset->getByName("avatar")->getId();
int x, y;
@@ -1162,7 +1162,7 @@ void Screen::screenShowGemTile(Layout *layout, Map *map, MapTile &t, bool focus,
// Make sure we account for tiles that look like other tiles (dungeon tiles, mainly)
Common::String looks_like = t.getTileType()->getLooksLike();
if (!looks_like.empty())
- t = map->_tileset->getByName(looks_like)->getId();
+ t = map->_tileSet->getByName(looks_like)->getId();
uint tile = map->translateToRawTileIndex(t);
@@ -1271,7 +1271,7 @@ void Screen::screenGemUpdate() {
layout->_viewport.height(), x - center_x + avt_x, y - center_y + avt_y, focus);
tile = tiles.front();
- TileId avatarTileId = g_context->_location->_map->_tileset->getByName("avatar")->getId();
+ TileId avatarTileId = g_context->_location->_map->_tileSet->getByName("avatar")->getId();
if (!weAreDrawingTheAvatarTile) {
diff --git a/engines/ultima/ultima4/map/dungeon.cpp b/engines/ultima/ultima4/map/dungeon.cpp
index c2b5130d7a..4d1fbdd5b7 100644
--- a/engines/ultima/ultima4/map/dungeon.cpp
+++ b/engines/ultima/ultima4/map/dungeon.cpp
@@ -60,7 +60,7 @@ DungeonToken Dungeon::tokenForTile(MapTile tile) {
const static Common::String fieldNames[] = { "poison_field", "energy_field", "fire_field", "sleep_field", "" };
int i;
- Tile *t = _tileset->get(tile.getId());
+ Tile *t = _tileSet->get(tile.getId());
for (i = 0; !tileNames[i].empty(); i++) {
if (t->getName() == tileNames[i])
@@ -191,7 +191,7 @@ void dungeonTouchOrb() {
int damage = 0;
/* Get current position and find a replacement tile for it */
- Tile *orb_tile = g_context->_location->_map->_tileset->getByName("magic_orb");
+ Tile *orb_tile = g_context->_location->_map->_tileSet->getByName("magic_orb");
MapTile replacementTile(g_context->_location->getReplacementTile(g_context->_location->_coords, orb_tile));
switch (g_context->_location->_map->_id) {
@@ -277,7 +277,7 @@ bool Dungeon::ladderUpAt(MapCoords coords) {
if (a.size() > 0) {
Annotation::List::iterator i;
for (i = a.begin(); i != a.end(); i++) {
- if (i->getTile() == _tileset->getByName("up_ladder")->getId())
+ if (i->getTile() == _tileSet->getByName("up_ladder")->getId())
return true;
}
}
@@ -294,7 +294,7 @@ bool Dungeon::ladderDownAt(MapCoords coords) {
if (a.size() > 0) {
Annotation::List::iterator i;
for (i = a.begin(); i != a.end(); i++) {
- if (i->getTile() == _tileset->getByName("down_ladder")->getId())
+ if (i->getTile() == _tileSet->getByName("down_ladder")->getId())
return true;
}
}
diff --git a/engines/ultima/ultima4/map/dungeonview.cpp b/engines/ultima/ultima4/map/dungeonview.cpp
index 6bda03cb18..f5976cc1ca 100644
--- a/engines/ultima/ultima4/map/dungeonview.cpp
+++ b/engines/ultima/ultima4/map/dungeonview.cpp
@@ -82,11 +82,11 @@ void DungeonView::display(Context *c, TileView *view) {
DungeonGraphicType distant_type = tilesToGraphic(distant_tiles);
if ((distant_type == DNGGRAPHIC_DNGTILE) || (distant_type == DNGGRAPHIC_BASETILE))
- drawTile(c->_location->_map->_tileset->get(distant_tiles.front().getId()), 0, y_obj, Direction(g_ultima->_saveGame->_orientation));
+ drawTile(c->_location->_map->_tileSet->get(distant_tiles.front().getId()), 0, y_obj, Direction(g_ultima->_saveGame->_orientation));
}
}
if ((type == DNGGRAPHIC_DNGTILE) || (type == DNGGRAPHIC_BASETILE))
- drawTile(c->_location->_map->_tileset->get(tiles.front().getId()), 0, y, Direction(g_ultima->_saveGame->_orientation));
+ drawTile(c->_location->_map->_tileSet->get(tiles.front().getId()), 0, y, Direction(g_ultima->_saveGame->_orientation));
}
}
}
@@ -95,8 +95,8 @@ void DungeonView::display(Context *c, TileView *view) {
else {
Std::vector<MapTile> tiles;
- static MapTile black = c->_location->_map->_tileset->getByName("black")->getId();
- static MapTile avatar = c->_location->_map->_tileset->getByName("avatar")->getId();
+ static MapTile black = c->_location->_map->_tileSet->getByName("black")->getId();
+ static MapTile avatar = c->_location->_map->_tileSet->getByName("avatar")->getId();
for (y = 0; y < VIEWPORT_H; y++) {
for (x = 0; x < VIEWPORT_W; x++) {
@@ -270,10 +270,10 @@ Std::vector<MapTile> DungeonView::getTiles(int fwd, int side) {
DungeonGraphicType DungeonView::tilesToGraphic(const Std::vector<MapTile> &tiles) {
MapTile tile = tiles.front();
- static const MapTile corridor = g_context->_location->_map->_tileset->getByName("brick_floor")->getId();
- static const MapTile up_ladder = g_context->_location->_map->_tileset->getByName("up_ladder")->getId();
- static const MapTile down_ladder = g_context->_location->_map->_tileset->getByName("down_ladder")->getId();
- static const MapTile updown_ladder = g_context->_location->_map->_tileset->getByName("up_down_ladder")->getId();
+ static const MapTile corridor = g_context->_location->_map->_tileSet->getByName("brick_floor")->getId();
+ static const MapTile up_ladder = g_context->_location->_map->_tileSet->getByName("up_ladder")->getId();
+ static const MapTile down_ladder = g_context->_location->_map->_tileSet->getByName("down_ladder")->getId();
+ static const MapTile updown_ladder = g_context->_location->_map->_tileSet->getByName("up_down_ladder")->getId();
/*
* check if the dungeon tile has an annotation or object on top
diff --git a/engines/ultima/ultima4/map/location.cpp b/engines/ultima/ultima4/map/location.cpp
index 426c33e7d4..3e6425568b 100644
--- a/engines/ultima/ultima4/map/location.cpp
+++ b/engines/ultima/ultima4/map/location.cpp
@@ -116,7 +116,7 @@ Std::vector<MapTile> Location::tilesAt(MapCoords coords, bool &focus) {
// then camouflaged creatures that have a disguise
if (obj && (obj->getType() == Object::CREATURE) && !obj->isVisible() && (!m->getCamouflageTile().empty())) {
focus = focus || obj->hasFocus();
- tiles.push_back(_map->_tileset->getByName(m->getCamouflageTile())->getId());
+ tiles.push_back(_map->_tileSet->getByName(m->getCamouflageTile())->getId());
}
// then visible creatures and objects
else if (obj && obj->isVisible()) {
@@ -227,7 +227,7 @@ TileId Location::getReplacementTile(MapCoords atCoords, const Tile *forTile) {
} while (++loop_count < 128 && searchQueue.size() > 0 && searchQueue.size() < 64);
// couldn't find a tile, give it the classic default
- return _map->_tileset->getByName("brick_floor")->getId();
+ return _map->_tileSet->getByName("brick_floor")->getId();
}
int Location::getCurrentPosition(MapCoords *coords) {
diff --git a/engines/ultima/ultima4/map/map.cpp b/engines/ultima/ultima4/map/map.cpp
index 06e07d49f7..ee14d1a461 100644
--- a/engines/ultima/ultima4/map/map.cpp
+++ b/engines/ultima/ultima4/map/map.cpp
@@ -243,8 +243,8 @@ Map::Map() {
_chunkHeight = 0;
_offset = 0;
_id = 0;
- _tileset = nullptr;
- _tilemap = nullptr;
+ _tileSet = nullptr;
+ _tileMap = nullptr;
}
Map::~Map() {
@@ -606,7 +606,7 @@ int Map::getValidMoves(MapCoords from, MapTile transport) {
else if (transport.getTileType()->isBalloon() && tile.getTileType()->isFlyable())
retval = DIR_ADD_TO_MASK(d, retval);
// avatar or horseback: check walkable
- else if (transport == _tileset->getByName("avatar")->getId() || transport.getTileType()->isHorse()) {
+ else if (transport == _tileSet->getByName("avatar")->getId() || transport.getTileType()->isHorse()) {
if (tile.getTileType()->canWalkOn(d) &&
(!transport.getTileType()->isHorse() || tile.getTileType()->isCreatureWalkable()) &&
prev_tile.getTileType()->canWalkOff(d))
@@ -772,13 +772,13 @@ bool Map::fillMonsterTable() {
}
MapTile Map::translateFromRawTileIndex(int raw) const {
- ASSERT(_tilemap != nullptr, "tilemap hasn't been set");
+ ASSERT(_tileMap != nullptr, "tilemap hasn't been set");
- return _tilemap->translate(raw);
+ return _tileMap->translate(raw);
}
uint Map::translateToRawTileIndex(MapTile &tile) const {
- return _tilemap->untranslate(tile);
+ return _tileMap->untranslate(tile);
}
} // End of namespace Ultima4
diff --git a/engines/ultima/ultima4/map/map.h b/engines/ultima/ultima4/map/map.h
index 6b36d24d44..f005fdac3d 100644
--- a/engines/ultima/ultima4/map/map.h
+++ b/engines/ultima/ultima4/map/map.h
@@ -283,8 +283,8 @@ public:
MapData _data;
ObjectDeque _objects;
Std::map<Common::String, MapCoords> _labels;
- Tileset *_tileset;
- TileMap *_tilemap;
+ Tileset *_tileSet;
+ TileMap *_tileMap;
// u4dos compatibility
SaveGameMonsterRecord _monsterTable[MONSTERTABLE_SIZE];
diff --git a/engines/ultima/ultima4/map/maploader.cpp b/engines/ultima/ultima4/map/maploader.cpp
index 86b5b9a807..a4fe545d28 100644
--- a/engines/ultima/ultima4/map/maploader.cpp
+++ b/engines/ultima/ultima4/map/maploader.cpp
@@ -89,7 +89,7 @@ bool MapLoader::loadData(Map *map, Common::File *f) {
for (ych = 0; ych < (map->_height / map->_chunkHeight); ++ych) {
for (xch = 0; xch < (map->_width / map->_chunkWidth); ++xch) {
if (isChunkCompressed(map, ych * map->_chunkWidth + xch)) {
- MapTile water = map->_tileset->getByName("sea")->getId();
+ MapTile water = map->_tileSet->getByName("sea")->getId();
for (y = 0; y < map->_chunkHeight; ++y) {
for (x = 0; x < map->_chunkWidth; ++x) {
map->_data[x + (y * map->_width) + (xch * map->_chunkWidth) + (ych * map->_chunkHeight * map->_width)] = water;
@@ -432,7 +432,7 @@ void DngMapLoader::initDungeonRoom(Dungeon *dng, int room) {
dng->_roomMaps[room]->_music = Music::COMBAT;
dng->_roomMaps[room]->_type = Map::COMBAT;
dng->_roomMaps[room]->_flags |= NO_LINE_OF_SIGHT;
- dng->_roomMaps[room]->_tileset = Tileset::get("base");
+ dng->_roomMaps[room]->_tileSet = Tileset::get("base");
}
bool WorldMapLoader::load(Map *map) {
diff --git a/engines/ultima/ultima4/map/mapmgr.cpp b/engines/ultima/ultima4/map/mapmgr.cpp
index 48f6ba3df7..573689c364 100644
--- a/engines/ultima/ultima4/map/mapmgr.cpp
+++ b/engines/ultima/ultima4/map/mapmgr.cpp
@@ -184,8 +184,8 @@ Map *MapMgr::initMapFromConf(const ConfigElement &mapConf) {
map->_flags |= FIRST_PERSON;
map->_music = static_cast<Music::Type>(mapConf.getInt("music"));
- map->_tileset = Tileset::get(mapConf.getString("tileset"));
- map->_tilemap = TileMap::get(mapConf.getString("tilemap"));
+ map->_tileSet = Tileset::get(mapConf.getString("tileset"));
+ map->_tileMap = TileMap::get(mapConf.getString("tilemap"));
vector<ConfigElement> children = mapConf.getChildren();
for (Std::vector<ConfigElement>::iterator i = children.begin(); i != children.end(); i++) {
diff --git a/engines/ultima/ultima4/map/shrine.cpp b/engines/ultima/ultima4/map/shrine.cpp
index b436d6e43f..f685a51975 100644
--- a/engines/ultima/ultima4/map/shrine.cpp
+++ b/engines/ultima/ultima4/map/shrine.cpp
@@ -107,7 +107,7 @@ void Shrine::enter() {
#ifdef IOS_ULTIMA4
U4IOS::IOSHideGameControllerHelper hideControllsHelper;
#endif
- if (settings._enhancements && settings._enhancementsOptions._u5shrines)
+ if (settings._enhancements && settings._enhancementsOptions._u5Shrines)
enhancedSequence();
else
g_screen->screenMessage("You enter the ancient shrine and sit before the altar...");
@@ -162,7 +162,7 @@ void Shrine::enter() {
void Shrine::enhancedSequence() {
// Replace the 'static' avatar tile with grass
- _annotations->add(Coords(5, 6, g_context->_location->_coords.z), _tileset->getByName("grass")->getId(), false, true);
+ _annotations->add(Coords(5, 6, g_context->_location->_coords.z), _tileSet->getByName("grass")->getId(), false, true);
g_screen->screenDisableCursor();
g_screen->screenMessage("You approach\nthe ancient\nshrine...\n");
@@ -170,7 +170,7 @@ void Shrine::enhancedSequence() {
EventHandler::wait_cycles(settings._gameCyclesPerSecond);
Object *obj = addCreature(creatureMgr->getById(BEGGAR_ID), Coords(5, 10, g_context->_location->_coords.z));
- obj->setTile(_tileset->getByName("avatar")->getId());
+ obj->setTile(_tileSet->getByName("avatar")->getId());
gameUpdateScreen();
EventHandler::wait_msecs(400);
diff --git a/engines/ultima/ultima4/map/tile.cpp b/engines/ultima/ultima4/map/tile.cpp
index ad9f645e8a..e54b64cde8 100644
--- a/engines/ultima/ultima4/map/tile.cpp
+++ b/engines/ultima/ultima4/map/tile.cpp
@@ -42,7 +42,7 @@ TileId Tile::_nextId = 0;
Tile::Tile(Tileset *tileset)
: _id(_nextId++)
, _name()
- , _tileset(tileset)
+ , _tileSet(tileset)
, _w(0)
, _h(0)
, _frames(0)
@@ -192,7 +192,7 @@ void Tile::deleteImage() {
}
bool Tile::isDungeonFloor() const {
- Tile *floor = _tileset->getByName("brick_floor");
+ Tile *floor = _tileSet->getByName("brick_floor");
if (_id == floor->_id)
return true;
return false;
diff --git a/engines/ultima/ultima4/map/tile.h b/engines/ultima/ultima4/map/tile.h
index b0da014d82..8f30e97a67 100644
--- a/engines/ultima/ultima4/map/tile.h
+++ b/engines/ultima/ultima4/map/tile.h
@@ -219,7 +219,7 @@ private:
private:
TileId _id; /**< an id that is unique across all tilesets */
Common::String _name; /**< The name of this tile */
- Tileset *_tileset; /**< The tileset this tile belongs to */
+ Tileset *_tileSet; /**< The tileset this tile belongs to */
int _w, _h; /**< width and height of the tile */
int _frames; /**< The number of frames this tile has */
int _scale; /**< The scale of the tile */
diff --git a/engines/ultima/ultima4/map/tileview.cpp b/engines/ultima/ultima4/map/tileview.cpp
index 9702a0c883..39ccd63df4 100644
--- a/engines/ultima/ultima4/map/tileview.cpp
+++ b/engines/ultima/ultima4/map/tileview.cpp
@@ -40,7 +40,7 @@ TileView::TileView(int x, int y, int columns, int rows) : View(x, y, columns * T
_rows = rows;
_tileWidth = TILE_WIDTH;
_tileHeight = TILE_HEIGHT;
- _tileset = Tileset::get("base");
+ _tileSet = Tileset::get("base");
_animated = Image::create(SCALED(_tileWidth), SCALED(_tileHeight), false, Image::HARDWARE);
}
@@ -50,7 +50,7 @@ TileView::TileView(int x, int y, int columns, int rows, const Common::String &ti
_rows = rows;
_tileWidth = TILE_WIDTH;
_tileHeight = TILE_HEIGHT;
- _tileset = Tileset::get(tileset);
+ _tileSet = Tileset::get(tileset);
_animated = Image::create(SCALED(_tileWidth), SCALED(_tileHeight), false, Image::HARDWARE);
}
@@ -60,7 +60,7 @@ TileView::~TileView() {
void TileView::reinit() {
View::reinit();
- _tileset = Tileset::get("base");
+ _tileSet = Tileset::get("base");
// Scratchpad needs to be re-inited if we rescale...
if (_animated) {
@@ -72,7 +72,7 @@ void TileView::reinit() {
void TileView::loadTile(MapTile &mapTile) {
// This attempts to preload tiles in advance
- Tile *tile = _tileset->get(mapTile._id);
+ Tile *tile = _tileSet->get(mapTile._id);
if (tile) {
tile->getImage();
}
@@ -80,7 +80,7 @@ void TileView::loadTile(MapTile &mapTile) {
}
void TileView::drawTile(MapTile &mapTile, bool focus, int x, int y) {
- Tile *tile = _tileset->get(mapTile._id);
+ Tile *tile = _tileSet->get(mapTile._id);
Image *image = tile->getImage();
ASSERT(x < _columns, "x value of %d out of range", x);
@@ -133,7 +133,7 @@ void TileView::drawTile(Std::vector<MapTile> &tiles, bool focus, int x, int y) {
// Iterate through rendering each of the needed tiles
for (Std::vector<MapTile>::reverse_iterator t = tiles.rbegin(); t != tiles.rend(); ++t) {
MapTile &frontTile = *t;
- Tile *frontTileType = _tileset->get(frontTile._id);
+ Tile *frontTileType = _tileSet->get(frontTile._id);
if (!frontTileType) {
// TODO: This leads to an error. It happens after graphics mode changes.
@@ -201,7 +201,7 @@ void TileView::drawFocus(int x, int y) {
}
void TileView::setTileset(Tileset *tileset) {
- this->_tileset = tileset;
+ this->_tileSet = tileset;
}
} // End of namespace Ultima4
diff --git a/engines/ultima/ultima4/map/tileview.h b/engines/ultima/ultima4/map/tileview.h
index 81a874abd3..bd10943277 100644
--- a/engines/ultima/ultima4/map/tileview.h
+++ b/engines/ultima/ultima4/map/tileview.h
@@ -60,7 +60,7 @@ public:
protected:
int _columns, _rows;
int _tileWidth, _tileHeight;
- Tileset *_tileset;
+ Tileset *_tileSet;
Image *_animated; /**< a scratchpad image for drawing animations */
};
Commit: a1c58483904595a93b4e556dd07ac06f1905dbc9
https://github.com/scummvm/scummvm/commit/a1c58483904595a93b4e556dd07ac06f1905dbc9
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2020-04-25T09:09:52-07:00
Commit Message:
ULTIMA8: Fix uninitialized variable warning
Changed paths:
engines/ultima/ultima8/gumps/item_relative_gump.cpp
diff --git a/engines/ultima/ultima8/gumps/item_relative_gump.cpp b/engines/ultima/ultima8/gumps/item_relative_gump.cpp
index 56a28bf784..7612ef5426 100644
--- a/engines/ultima/ultima8/gumps/item_relative_gump.cpp
+++ b/engines/ultima/ultima8/gumps/item_relative_gump.cpp
@@ -121,7 +121,7 @@ void ItemRelativeGump::GetItemLocation(int32 lerp_factor) {
}
Item *next;
- Item *prev;
+ Item *prev = nullptr;
while ((next = it->getParentAsContainer()) != nullptr) {
prev = it;
it = next;
@@ -142,6 +142,7 @@ void ItemRelativeGump::GetItemLocation(int32 lerp_factor) {
gump->GetLocationOfItem(_owner, gx, gy, lerp_factor);
} else {
+ assert(prev);
gump->GetLocationOfItem(prev->getObjId(), gx, gy, lerp_factor);
}
More information about the Scummvm-git-logs
mailing list