aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.common4
-rw-r--r--backends/keymapper/action.cpp21
-rw-r--r--backends/keymapper/action.h8
-rw-r--r--backends/keymapper/hardware-key.h108
-rw-r--r--backends/keymapper/keymap.cpp30
-rw-r--r--backends/keymapper/keymap.h19
-rw-r--r--backends/keymapper/keymapper.cpp9
-rw-r--r--backends/keymapper/keymapper.h9
-rw-r--r--backends/keymapper/remap-dialog.cpp22
-rw-r--r--backends/keymapper/types.h1
-rw-r--r--backends/platform/psp/Makefile2
-rw-r--r--backends/platform/psp/osys_psp.cpp2
-rw-r--r--backends/platform/psp/osys_psp.h1
-rw-r--r--backends/platform/psp/osys_psp_gu.cpp9
-rw-r--r--backends/platform/psp/psp.mk2
-rw-r--r--backends/platform/psp/psp_main.cpp9
-rw-r--r--backends/platform/sdl/hardwarekeys.cpp307
-rw-r--r--backends/platform/sdl/sdl.h2
-rw-r--r--common/EventRecorder.cpp1
-rwxr-xr-xconfigure14
-rw-r--r--dists/msvc8/ScummVM_Global.vsprops2
-rw-r--r--dists/msvc8/scummvm.vcproj1915
-rw-r--r--dists/msvc9/scummvm.vcproj24
-rw-r--r--dists/wii/meta.xml.in12
-rw-r--r--engines/gob/inter.h2
-rw-r--r--engines/gob/inter_playtoons.cpp118
-rw-r--r--engines/gob/save/saveload.h42
-rw-r--r--engines/gob/save/saveload_playtoons.cpp50
-rw-r--r--engines/gob/save/saveload_v2.cpp14
-rw-r--r--engines/gob/save/saveload_v3.cpp28
-rw-r--r--engines/gob/save/saveload_v4.cpp28
-rw-r--r--engines/gob/save/saveload_v6.cpp28
-rw-r--r--engines/gob/video_v6.cpp5
-rw-r--r--engines/groovie/graphics.cpp4
-rw-r--r--engines/groovie/groovie.cpp22
-rw-r--r--engines/groovie/groovie.h2
-rw-r--r--engines/groovie/roq.cpp162
-rw-r--r--engines/groovie/script.cpp91
-rw-r--r--engines/groovie/script.h7
-rw-r--r--engines/kyra/animator_lok.cpp7
-rw-r--r--engines/kyra/animator_lok.h1
-rw-r--r--engines/kyra/gui.cpp16
-rw-r--r--engines/kyra/gui_lok.cpp1
-rw-r--r--engines/kyra/kyra_v1.cpp5
-rw-r--r--engines/kyra/lol.cpp1
-rw-r--r--engines/kyra/lol.h4
-rw-r--r--engines/kyra/screen.cpp31
-rw-r--r--engines/kyra/screen.h2
-rw-r--r--engines/kyra/script_hof.cpp34
-rw-r--r--engines/kyra/script_lok.cpp104
-rw-r--r--engines/kyra/script_mr.cpp12
-rw-r--r--engines/kyra/sequences_lok.cpp1
-rw-r--r--engines/kyra/sequences_lol.cpp121
-rw-r--r--engines/kyra/staticres.cpp11
-rw-r--r--engines/kyra/text_lok.cpp1
-rw-r--r--engines/sci/detection.cpp9
-rw-r--r--engines/sci/engine/game.cpp2
-rw-r--r--engines/sci/engine/kernel.cpp6
-rw-r--r--engines/sci/engine/klists.cpp8
-rw-r--r--engines/sci/engine/kmisc.cpp25
-rw-r--r--engines/sci/engine/kpathing.cpp2
-rw-r--r--engines/sci/engine/kscripts.cpp2
-rw-r--r--engines/sci/engine/seg_manager.cpp4
-rw-r--r--engines/sci/engine/static_selectors.cpp101
-rw-r--r--engines/sci/engine/vm.cpp22
-rw-r--r--engines/sci/gfx/gfx_resmgr.cpp39
-rw-r--r--engines/sci/gfx/gfx_resource.h17
-rw-r--r--engines/sci/gfx/res_pic.cpp38
-rw-r--r--engines/sci/gfx/res_view.cpp45
-rw-r--r--engines/sci/resource.cpp66
-rw-r--r--engines/sci/resource.h11
-rw-r--r--engines/sci/sfx/core.cpp7
-rw-r--r--engines/scumm/dialogs.cpp237
-rw-r--r--engines/scumm/dialogs.h34
-rw-r--r--engines/scumm/scumm.h3
-rw-r--r--engines/tinsel/pcode.cpp6
-rw-r--r--engines/tinsel/polygons.cpp10
-rw-r--r--graphics/conversion.cpp152
-rw-r--r--graphics/conversion.h76
-rw-r--r--graphics/dither.cpp1
-rw-r--r--graphics/dither.h13
-rw-r--r--graphics/jpeg.cpp638
-rw-r--r--graphics/jpeg.h118
-rw-r--r--graphics/module.mk2
-rw-r--r--graphics/scaler/thumbnail_intern.cpp20
-rw-r--r--graphics/sjis.cpp5
-rw-r--r--graphics/video/coktelvideo/coktelvideo.cpp5
-rw-r--r--gui/GuiManager.cpp26
-rw-r--r--gui/ListWidget.cpp59
-rw-r--r--gui/ListWidget.h33
-rw-r--r--gui/ThemeEngine.h2
-rw-r--r--gui/saveload.cpp36
-rw-r--r--gui/themes/default.inc720
-rw-r--r--gui/themes/scummclassic.zipbin53568 -> 53594 bytes
-rw-r--r--gui/themes/scummclassic/THEMERC2
-rw-r--r--gui/themes/scummclassic/classic_gfx.stx8
-rw-r--r--gui/themes/scummclassic/classic_layout.stx4
-rw-r--r--gui/themes/scummclassic/classic_layout_lowres.stx4
-rw-r--r--gui/themes/scummmodern.zipbin158294 -> 158312 bytes
-rw-r--r--gui/themes/scummmodern/THEMERC2
-rw-r--r--gui/themes/scummmodern/checkbox_empty.bmpbin0 -> 774 bytes
-rw-r--r--gui/themes/scummmodern/scummmodern_gfx.stx6
-rw-r--r--gui/themes/scummmodern/scummmodern_layout.stx4
-rw-r--r--gui/themes/scummmodern/scummmodern_layout_lowres.stx4
-rw-r--r--gui/themes/scummmodern/search.bmpbin0 -> 872 bytes
105 files changed, 1911 insertions, 4211 deletions
diff --git a/Makefile.common b/Makefile.common
index 824139b0bd..caf5ba22fa 100644
--- a/Makefile.common
+++ b/Makefile.common
@@ -37,10 +37,6 @@ ifdef DISABLE_SCALERS
DEFINES += -DDISABLE_SCALERS
endif
-ifdef ENABLE_RGB_COLOR
-DEFINES += -DENABLE_RGB_COLOR
-endif
-
ifdef DISABLE_HQ_SCALERS
DEFINES += -DDISABLE_HQ_SCALERS
endif
diff --git a/backends/keymapper/action.cpp b/backends/keymapper/action.cpp
index 4633f20df3..3feb593f19 100644
--- a/backends/keymapper/action.cpp
+++ b/backends/keymapper/action.cpp
@@ -32,9 +32,9 @@
namespace Common {
Action::Action(Keymap *boss, const char *i, String des, ActionType typ,
- KeyType prefKey, int pri)
+ KeyType prefKey, int pri, int flg)
: _boss(boss), description(des), type(typ), preferredKey(prefKey),
- priority(pri), _hwKey(0) {
+ priority(pri), flags(flg), _hwKey(0) {
assert(i);
assert(_boss);
@@ -43,21 +43,14 @@ Action::Action(Keymap *boss, const char *i, String des, ActionType typ,
_boss->addAction(this);
}
-void Action::mapKey(const HardwareKey *key, byte flags) {
+void Action::mapKey(const HardwareKey *key) {
if (_hwKey)
- {
_boss->unregisterMapping(this);
- delete _hwKey;
- }
- if (key) {
- _hwKey = new HardwareKey(*key);
- if (flags)
- _hwKey->key.flags = flags & _hwKey->modMask;
- if (_hwKey)
- _boss->registerMapping(this, _hwKey);
- } else
- _hwKey = NULL;
+ _hwKey = key;
+
+ if (_hwKey)
+ _boss->registerMapping(this, _hwKey);
}
const HardwareKey *Action::getMappedKey() const {
diff --git a/backends/keymapper/action.h b/backends/keymapper/action.h
index c78a526414..31576e2960 100644
--- a/backends/keymapper/action.h
+++ b/backends/keymapper/action.h
@@ -54,17 +54,19 @@ struct Action {
ActionType type;
KeyType preferredKey;
int priority;
+ int group;
+ int flags;
private:
/** Hardware key that is mapped to this Action */
- HardwareKey *_hwKey;
+ const HardwareKey *_hwKey;
Keymap *_boss;
public:
Action(Keymap *boss, const char *id, String des = "",
ActionType typ = kGenericActionType,
KeyType prefKey = kGenericKeyType,
- int pri = 0);
+ int pri = 0, int flg = 0 );
void addEvent(const Event &evt) {
events.push_back(evt);
@@ -103,7 +105,7 @@ public:
return _boss;
}
- void mapKey(const HardwareKey *key, byte flags = 0);
+ void mapKey(const HardwareKey *key);
const HardwareKey *getMappedKey() const;
};
diff --git a/backends/keymapper/hardware-key.h b/backends/keymapper/hardware-key.h
index 70168def2d..8ddeada51e 100644
--- a/backends/keymapper/hardware-key.h
+++ b/backends/keymapper/hardware-key.h
@@ -31,47 +31,12 @@
#ifdef ENABLE_KEYMAPPER
#include "backends/keymapper/types.h"
-#include "common/str.h"
-#include "common/keyboard.h"
-#include "common/list.h"
-#include "common/util.h"
namespace Common {
#define HWKEY_ID_SIZE (30)
-
-// Structure for describing specific key+modifier combos mapped to actions,
-// to allow for modifiers to work properly without having to define the whole
-// hardware key set an additional time for each possible modifier combination
-struct ActionKey {
- KeyCode keycode;
- byte flags;
-
- ActionKey () {
- keycode = KEYCODE_INVALID;
- flags = 0;
- }
-
- ActionKey (const KeyState &key) {
- keycode = key.keycode;
- flags = key.flags;
- }
-
-
- ActionKey (KeyCode ky, byte f) {
- keycode = ky;
- flags = f;
- }
-
- bool operator ==(const ActionKey &x) const {
- return keycode == x.keycode && flags == x.flags;
- }
-
-};
-
-
/**
* Describes an available hardware key
*/
@@ -86,45 +51,19 @@ struct HardwareKey {
* The KeyState that is generated by the back-end
* when this hardware key is pressed.
*/
- ActionKey key;
+ KeyState key;
KeyType type;
ActionType preferredAction;
- // Mask of modifiers that can possibly apply to this key.
- byte modMask;
-
- HardwareKey(const char *i, ActionKey ky = ActionKey(), String desc = "", byte mods = ~0,
+ HardwareKey(const char *i, KeyState ky = KeyState(), String desc = "",
KeyType typ = kGenericKeyType, ActionType prefAct = kGenericActionType)
- : key(ky), description(desc), type(typ), preferredAction(prefAct), modMask(mods) {
+ : key(ky), description(desc), type(typ), preferredAction(prefAct) {
assert(i);
strncpy(hwKeyId, i, HWKEY_ID_SIZE);
}
};
-/**
-* Describes an available hardware modifier
-*/
-struct HardwareMod {
- /** unique id used for saving/loading to config */
- char hwModId[HWKEY_ID_SIZE];
-
- /** Human readable description */
- String description;
-
- /**
- * The modifier flags that are generated by the
- * back-end when this modifier key is pressed.
- */
- byte modFlags;
-
- HardwareMod(const char *i, byte mf, String desc = "")
- : modFlags(mf), description(desc) {
- assert(i);
- strncpy(hwModId, i, HWKEY_ID_SIZE);
- }
-};
-
/**
* Simple class to encapsulate a device's set of HardwareKeys.
@@ -141,11 +80,6 @@ public:
delete *it;
}
- void addHardwareMod(HardwareMod *mod) {
- checkForMod(mod);
- _mods.push_back(mod);
- }
-
void addHardwareKey(HardwareKey *key) {
checkForKey(key);
_keys.push_back(key);
@@ -161,31 +95,11 @@ public:
return 0;
}
- const HardwareKey *findHardwareKey(const ActionKey& keystate) const {
+ const HardwareKey *findHardwareKey(const KeyState& keystate) const {
List<const HardwareKey*>::const_iterator it;
for (it = _keys.begin(); it != _keys.end(); it++) {
- if ((*it)->key.keycode == keystate.keycode)
- return (*it);
- }
- return 0;
- }
-
- const HardwareMod *findHardwareMod(const char *id) const {
- List<const HardwareMod*>::const_iterator it;
-
- for (it = _mods.begin(); it != _mods.end(); it++) {
- if (strncmp((*it)->hwModId, id, HWKEY_ID_SIZE) == 0)
- return (*it);
- }
- return 0;
- }
-
- const HardwareMod *findHardwareMod(const ActionKey& keystate) const {
- List<const HardwareMod*>::const_iterator it;
-
- for (it = _mods.begin(); it != _mods.end(); it++) {
- if ((*it)->modFlags == keystate.flags)
+ if ((*it)->key == keystate)
return (*it);
}
return 0;
@@ -213,19 +127,7 @@ private:
}
}
- void checkForMod(HardwareMod *mod) {
- List<const HardwareMod*>::iterator it;
-
- for (it = _mods.begin(); it != _mods.end(); it++) {
- if (strncmp((*it)->hwModId, mod->hwModId, HWKEY_ID_SIZE) == 0)
- error("Error adding HardwareMod '%s' - id of %s already in use!", mod->description.c_str(), mod->hwModId);
- else if ((*it)->modFlags == mod->modFlags)
- error("Error adding HardwareMod '%s' - modFlags already in use!", mod->description.c_str());
- }
- }
-
List<const HardwareKey*> _keys;
- List<const HardwareMod*> _mods;
};
diff --git a/backends/keymapper/keymap.cpp b/backends/keymapper/keymap.cpp
index f082640f2c..95b64f88e7 100644
--- a/backends/keymapper/keymap.cpp
+++ b/backends/keymapper/keymap.cpp
@@ -60,7 +60,7 @@ void Keymap::addAction(Action *action) {
}
void Keymap::registerMapping(Action *action, const HardwareKey *hwKey) {
- HashMap<ActionKey, Action*>::iterator it;
+ HashMap<KeyState, Action*>::iterator it;
it = _keymap.find(hwKey->key);
@@ -105,8 +105,8 @@ const Action *Keymap::findAction(const char *id) const {
return 0;
}
-Action *Keymap::getMappedAction(const ActionKey& ks) const {
- HashMap<ActionKey, Action*>::iterator it;
+Action *Keymap::getMappedAction(const KeyState& ks) const {
+ HashMap<KeyState, Action*>::iterator it;
it = _keymap.find(ks);
@@ -127,10 +127,6 @@ void Keymap::loadMappings(const HardwareKeySet *hwKeys) {
ConfigManager::Domain::iterator it;
String prefix = KEYMAP_KEY_PREFIX + _name + "_";
- uint32 modId = 0;
- char hwId[HWKEY_ID_SIZE+1];
- memset(hwId,0,HWKEY_ID_SIZE+1);
-
for (it = _configDomain->begin(); it != _configDomain->end(); it++) {
const String& key = it->_key;
@@ -149,15 +145,15 @@ void Keymap::loadMappings(const HardwareKeySet *hwKeys) {
continue;
}
- sscanf(it->_value.c_str(),"%d,%s",&modId,hwId);
- const HardwareKey *hwKey = hwKeys->findHardwareKey(hwId);
+ const HardwareKey *hwKey = hwKeys->findHardwareKey(it->_value.c_str());
if (!hwKey) {
warning("HardwareKey with ID %s not known", it->_value.c_str());
_configDomain->erase(key);
continue;
}
- ua->mapKey(hwKey,modId);
+
+ ua->mapKey(hwKey);
}
}
@@ -175,19 +171,13 @@ void Keymap::saveMappings() {
String actId((*it)->id, (*it)->id + actIdLen);
char hwId[HWKEY_ID_SIZE+1];
- memset(hwId, 0, HWKEY_ID_SIZE+1);
- char modId[4];
- memset(modId, 0, 4);
+ memset(hwId, 0, HWKEY_ID_SIZE+1);
if ((*it)->getMappedKey()) {
memcpy(hwId, (*it)->getMappedKey()->hwKeyId, HWKEY_ID_SIZE);
- sprintf(modId,"%d",(*it)->getMappedKey()->key.flags);
}
- String val = modId;
- val += ',';
- val += hwId;
- _configDomain->setVal(prefix + actId, val);
+ _configDomain->setVal(prefix + actId, hwId);
}
}
@@ -240,7 +230,7 @@ void Keymap::automaticMapping(HardwareKeySet *hwKeys) {
// First mapping pass:
// - Match if a key's preferred action type is the same as the action's
- // type, or vice versa.
+ // type, or vice versa.
// - Priority is given to:
// - keys that match action types over key types.
// - keys that have not been used by parent maps.
@@ -333,7 +323,7 @@ void Keymap::automaticMapping(HardwareKeySet *hwKeys) {
}
}
-Action *Keymap::getParentMappedAction(const ActionKey &key) {
+Action *Keymap::getParentMappedAction(KeyState key) {
if (_parent) {
Action *act = _parent->getMappedAction(key);
diff --git a/backends/keymapper/keymap.h b/backends/keymapper/keymap.h
index f4ad8d110d..615fd9097d 100644
--- a/backends/keymapper/keymap.h
+++ b/backends/keymapper/keymap.h
@@ -36,7 +36,6 @@
#include "common/keyboard.h"
#include "common/list.h"
#include "backends/keymapper/action.h"
-#include "backends/keymapper/hardware-key.h"
namespace Common {
@@ -54,17 +53,6 @@ template<> struct Hash<KeyState>
}
};
-/**
- * Hash function for ActionKey
- */
-template<> struct Hash<ActionKey>
- : public UnaryFunction<ActionKey, uint> {
-
- uint operator()(const ActionKey &val) const {
- return (uint)val.keycode | ((uint)val.flags << 24);
- }
-};
-
class Keymap {
public:
Keymap(const String& name, Keymap *parent = 0) : _name(name), _parent(parent) {}
@@ -89,7 +77,7 @@ public:
* @param key the key that is mapped to the required Action
* @return a pointer to the Action or 0 if no
*/
- Action *getMappedAction(const ActionKey& ks) const;
+ Action *getMappedAction(const KeyState& ks) const;
void setConfigDomain(ConfigManager::Domain *dom);
@@ -102,6 +90,7 @@ public:
/**
* Save this keymap's mappings to the config manager
* @note Changes are *not* flushed to disk, to do so call ConfMan.flushToDisk()
+ * @note Changes are *not* flushed to disk, to do so call ConfMan.flushToDisk()
*/
void saveMappings();
@@ -147,12 +136,12 @@ private:
void internalMapKey(Action *action, HardwareKey *hwKey);
- Action *getParentMappedAction(const ActionKey &key);
+ Action *getParentMappedAction(KeyState key);
String _name;
Keymap *_parent;
List<Action*> _actions;
- HashMap<ActionKey, Action*> _keymap;
+ HashMap<KeyState, Action*> _keymap;
ConfigManager::Domain *_configDomain;
};
diff --git a/backends/keymapper/keymapper.cpp b/backends/keymapper/keymapper.cpp
index 704affb3fe..c0c454168c 100644
--- a/backends/keymapper/keymapper.cpp
+++ b/backends/keymapper/keymapper.cpp
@@ -190,6 +190,7 @@ bool Keymapper::mapKey(const KeyState& key, bool keyDown) {
return false;
Action *action = 0;
+
if (keyDown) {
// Search for key in active keymap stack
for (int i = _activeMaps.size() - 1; i >= 0; --i) {
@@ -204,7 +205,7 @@ bool Keymapper::mapKey(const KeyState& key, bool keyDown) {
if (action)
_keysDown[key] = action;
} else {
- HashMap<ActionKey, Action*>::iterator it = _keysDown.find(key);
+ HashMap<KeyState, Action*>::iterator it = _keysDown.find(key);
if (it != _keysDown.end()) {
action = it->_value;
@@ -267,14 +268,10 @@ void Keymapper::executeAction(const Action *action, bool keyDown) {
}
}
-const HardwareKey *Keymapper::findHardwareKey(const ActionKey& key) {
+const HardwareKey *Keymapper::findHardwareKey(const KeyState& key) {
return (_hardwareKeys) ? _hardwareKeys->findHardwareKey(key) : 0;
}
-const HardwareMod *Keymapper::findHardwareMod(const ActionKey& key) {
- return (_hardwareKeys) ? _hardwareKeys->findHardwareMod(key) : 0;
-}
-
} // end of namespace Common
#endif // #ifdef ENABLE_KEYMAPPER
diff --git a/backends/keymapper/keymapper.h b/backends/keymapper/keymapper.h
index 24c76fb09f..f492882ca2 100644
--- a/backends/keymapper/keymapper.h
+++ b/backends/keymapper/keymapper.h
@@ -168,12 +168,7 @@ public:
/**
* Return a HardwareKey pointer for the given key state
*/
- const HardwareKey *findHardwareKey(const ActionKey& key);
-
- /**
- * Return a HardwareMod pointer for the given key state
- */
- const HardwareMod *findHardwareMod(const ActionKey& key);
+ const HardwareKey *findHardwareKey(const KeyState& key);
Domain& getGlobalDomain() { return _globalDomain; }
Domain& getGameDomain() { return _gameDomain; }
@@ -198,7 +193,7 @@ private:
bool _enabled;
Stack<MapRecord> _activeMaps;
- HashMap<ActionKey, Action*> _keysDown;
+ HashMap<KeyState, Action*> _keysDown;
};
diff --git a/backends/keymapper/remap-dialog.cpp b/backends/keymapper/remap-dialog.cpp
index 0a93785c08..0440acdd0a 100644
--- a/backends/keymapper/remap-dialog.cpp
+++ b/backends/keymapper/remap-dialog.cpp
@@ -240,12 +240,11 @@ void RemapDialog::handleKeyUp(Common::KeyState state) {
if (_activeRemapAction) {
const HardwareKey *hwkey = _keymapper->findHardwareKey(state);
- debug( "Key: %d, %d (%c), %x", state.keycode, state.ascii, (state.ascii ? state.ascii : ' '), state.flags);
+ debug(0, "Key: %d, %d (%c), %x", state.keycode, state.ascii, (state.ascii ? state.ascii : ' '), state.flags);
if (hwkey) {
- _activeRemapAction->mapKey(hwkey,state.flags);
+ _activeRemapAction->mapKey(hwkey);
_activeRemapAction->getParent()->saveMappings();
-
_changes = true;
stopRemapping();
}
@@ -360,21 +359,8 @@ void RemapDialog::refreshKeymap() {
const HardwareKey *mappedKey = info.action->getMappedKey();
if (mappedKey)
- {
- Common::String description = "";
- if (mappedKey->key.flags)
- {
- byte flags = mappedKey->key.flags;
- if (flags & KBD_CTRL)
- description += "Ctrl+";
- if (flags & KBD_SHIFT)
- description += "Shift+";
- if (flags & KBD_ALT)
- description += "Alt+";
- }
- description += mappedKey->description;
- widg.keyButton->setLabel(description);
- } else
+ widg.keyButton->setLabel(mappedKey->description);
+ else
widg.keyButton->setLabel("-");
widg.actionText->setVisible(true);
diff --git a/backends/keymapper/types.h b/backends/keymapper/types.h
index 3cce79ee9a..7ad4c0e538 100644
--- a/backends/keymapper/types.h
+++ b/backends/keymapper/types.h
@@ -43,7 +43,6 @@ enum KeyType {
kTriggerRightKeyType,
kStartKeyType,
kSelectKeyType,
- kModiferKeyType,
/* ... */
kKeyTypeMax
diff --git a/backends/platform/psp/Makefile b/backends/platform/psp/Makefile
index d18e6ac82c..64ce8a0161 100644
--- a/backends/platform/psp/Makefile
+++ b/backends/platform/psp/Makefile
@@ -49,7 +49,7 @@ STRIP = psp-strip
MKDIR = mkdir -p
RM = rm -f
RM_REC = rm -rf
-MKSFO = mksfo
+MKSFO = mksfoex -d MEMSIZE=1
PACK_PBP = pack-pbp
FIXUP = psp-fixup-imports
diff --git a/backends/platform/psp/osys_psp.cpp b/backends/platform/psp/osys_psp.cpp
index 566db3014b..5e461f45e0 100644
--- a/backends/platform/psp/osys_psp.cpp
+++ b/backends/platform/psp/osys_psp.cpp
@@ -75,7 +75,7 @@ const OSystem::GraphicsMode OSystem_PSP::s_supportedGraphicsModes[] = {
};
-OSystem_PSP::OSystem_PSP() : _screenWidth(0), _screenHeight(0), _overlayWidth(0), _overlayHeight(0), _offscreen(0), _overlayBuffer(0), _overlayVisible(false), _shakePos(0), _mouseBuf(0), _prevButtons(0), _lastPadCheck(0), _padAccel(0), _mixer(0) {
+OSystem_PSP::OSystem_PSP() : _screenWidth(0), _screenHeight(0), _overlayWidth(0), _overlayHeight(0), _offscreen(0), _overlayBuffer(0), _overlayVisible(false), _shakePos(0), _lastScreenUpdate(0), _mouseBuf(0), _prevButtons(0), _lastPadCheck(0), _padAccel(0), _mixer(0) {
memset(_palette, 0, sizeof(_palette));
diff --git a/backends/platform/psp/osys_psp.h b/backends/platform/psp/osys_psp.h
index 310efdc7d4..94488a92ce 100644
--- a/backends/platform/psp/osys_psp.h
+++ b/backends/platform/psp/osys_psp.h
@@ -59,6 +59,7 @@ protected:
uint16 _palette[256];
bool _overlayVisible;
uint32 _shakePos;
+ uint32 _lastScreenUpdate;
Graphics::Surface _framebuffer;
diff --git a/backends/platform/psp/osys_psp_gu.cpp b/backends/platform/psp/osys_psp_gu.cpp
index 0fb1b4aded..1c83aa4abf 100644
--- a/backends/platform/psp/osys_psp_gu.cpp
+++ b/backends/platform/psp/osys_psp_gu.cpp
@@ -38,6 +38,8 @@
#define MOUSE_SIZE 128
#define KBD_DATA_SIZE 130560
+#define MAX_FPS 30
+
unsigned int __attribute__((aligned(16))) list[262144];
unsigned short __attribute__((aligned(16))) clut256[256];
unsigned short __attribute__((aligned(16))) mouseClut[256];
@@ -295,6 +297,13 @@ void OSystem_PSP_GU::copyRectToScreen(const byte *buf, int pitch, int x, int y,
}
void OSystem_PSP_GU::updateScreen() {
+ u32 now = getMillis();
+ if (now - _lastScreenUpdate < 1000 / MAX_FPS)
+ return;
+
+ _lastScreenUpdate = now;
+
+
sceGuStart(0,list);
sceGuClearColor(0xff000000);
diff --git a/backends/platform/psp/psp.mk b/backends/platform/psp/psp.mk
index 10e272a593..998a420ffc 100644
--- a/backends/platform/psp/psp.mk
+++ b/backends/platform/psp/psp.mk
@@ -9,7 +9,7 @@ PSP_EBOOT_SFO = param.sfo
PSP_EBOOT_TITLE = ScummVM-PSP
DATE = $(shell date +%Y%m%d)
-MKSFO = mksfo
+MKSFO = mksfoex -d MEMSIZE=1
PACK_PBP = pack-pbp
$(PSP_EXE_STRIPPED): $(PSP_EXE)
diff --git a/backends/platform/psp/psp_main.cpp b/backends/platform/psp/psp_main.cpp
index 3ea6c55368..357c502dbc 100644
--- a/backends/platform/psp/psp_main.cpp
+++ b/backends/platform/psp/psp_main.cpp
@@ -62,9 +62,8 @@ PSP_MODULE_INFO("SCUMMVM-PSP", 0, 1, 1);
* code (crt0.c) starts this program in to be in usermode
* even though the module was started in kernelmode
*/
-#ifndef USERSPACE_ONLY
PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER | THREAD_ATTR_VFPU);
-#endif
+PSP_HEAP_SIZE_KB(-128); //Leave 128kb for thread stacks, etc.
#ifndef USERSPACE_ONLY
@@ -142,13 +141,13 @@ int SetupCallbacks(void) {
#undef main
int main(void) {
+ //change clock rate to 333mhz
+ scePowerSetClockFrequency(333, 333, 166);
+
PowerManager::instance(); // Setup power manager
SetupCallbacks();
- //change clock rate to 333mhz
- scePowerSetClockFrequency(333, 333, 166);
-
static const char *argv[] = { "scummvm", NULL };
static int argc = sizeof(argv)/sizeof(char *)-1;
diff --git a/backends/platform/sdl/hardwarekeys.cpp b/backends/platform/sdl/hardwarekeys.cpp
index af9b0ba319..1a8124bbf3 100644
--- a/backends/platform/sdl/hardwarekeys.cpp
+++ b/backends/platform/sdl/hardwarekeys.cpp
@@ -37,178 +37,168 @@ struct Key {
uint16 ascii;
const char *desc;
KeyType preferredAction;
- int32 modableMask;
+ bool shiftable;
};
static const Key keys[] = {
- {"BACKSPACE", KEYCODE_BACKSPACE, ASCII_BACKSPACE, "Backspace", kActionKeyType, ~0},
- {"TAB", KEYCODE_TAB, ASCII_TAB, "Tab", kActionKeyType, ~0},
- {"CLEAR", KEYCODE_CLEAR, 0, "Clear", kActionKeyType, ~0},
- {"RETURN", KEYCODE_RETURN, ASCII_RETURN, "Return", kActionKeyType, ~0},
- {"PAUSE", KEYCODE_PAUSE, 0, "Pause", kActionKeyType, ~0},
- {"ESCAPE", KEYCODE_ESCAPE, ASCII_ESCAPE, "Esc", kStartKeyType, ~0},
- {"SPACE", KEYCODE_SPACE, ASCII_SPACE, "Space", kActionKeyType, ~0},
- {"EXCLAIM", KEYCODE_EXCLAIM, '!', "!", kActionKeyType, ~0},
- {"QUOTEDBL", KEYCODE_QUOTEDBL, '"', "\"", kActionKeyType, ~0},
- {"HASH", KEYCODE_HASH, '#', "#", kActionKeyType, ~0},
- {"DOLLAR", KEYCODE_DOLLAR, '$', "$", kActionKeyType, ~0},
- {"AMPERSAND", KEYCODE_AMPERSAND, '&', "&", kActionKeyType, ~0},
- {"QUOTE", KEYCODE_QUOTE, '\'', "'", kActionKeyType, ~0},
- {"LEFTPAREN", KEYCODE_LEFTPAREN, '(', "(", kActionKeyType, ~0},
- {"RIGHTPAREN", KEYCODE_RIGHTPAREN, ')', ")", kActionKeyType, ~0},
- {"ASTERISK", KEYCODE_ASTERISK, '*', "*", kActionKeyType, ~0},
- {"PLUS", KEYCODE_PLUS, '+', "+", kActionKeyType, ~0},
- {"COMMA", KEYCODE_COMMA, ',', ",", kActionKeyType, ~0},
- {"MINUS", KEYCODE_MINUS, '-', "-", kActionKeyType, ~0},
- {"PERIOD", KEYCODE_PERIOD, '.', ".", kActionKeyType, ~0},
- {"SLASH", KEYCODE_SLASH, '/', "/", kActionKeyType, ~0},
- {"0", KEYCODE_0, '0', "0", kActionKeyType, ~0},
- {"1", KEYCODE_1, '1', "1", kActionKeyType, ~0},
- {"2", KEYCODE_2, '2', "2", kActionKeyType, ~0},
- {"3", KEYCODE_3, '3', "3", kActionKeyType, ~0},
- {"4", KEYCODE_4, '4', "4", kActionKeyType, ~0},
- {"5", KEYCODE_5, '5', "5", kActionKeyType, ~0},
- {"6", KEYCODE_6, '6', "6", kActionKeyType, ~0},
- {"7", KEYCODE_7, '7', "7", kActionKeyType, ~0},
- {"8", KEYCODE_8, '8', "8", kActionKeyType, ~0},
- {"9", KEYCODE_9, '9', "9", kActionKeyType, ~0},
- {"COLON", KEYCODE_COLON, ':', ":", kActionKeyType, ~0},
- {"SEMICOLON", KEYCODE_SEMICOLON, ';', ";", kActionKeyType, ~0},
- {"LESS", KEYCODE_LESS, '<', "<", kActionKeyType, ~0},
- {"EQUALS", KEYCODE_EQUALS, '=', "=", kActionKeyType, ~0},
- {"GREATER", KEYCODE_GREATER, '>', ">", kActionKeyType, ~0},
- {"QUESTION", KEYCODE_QUESTION, '?', "?", kActionKeyType, ~0},
- {"AT", KEYCODE_AT, '@', "@", kActionKeyType, ~0},
-
- {"LEFTBRACKET", KEYCODE_LEFTBRACKET, '[', "[", kActionKeyType, ~0},
- {"BACKSLASH", KEYCODE_BACKSLASH, '\\', "\\", kActionKeyType, ~0},
- {"RIGHTBRACKET", KEYCODE_RIGHTBRACKET, ']', "]", kActionKeyType, ~0},
- {"CARET", KEYCODE_CARET, '^', "^", kActionKeyType, ~0},
- {"UNDERSCORE", KEYCODE_UNDERSCORE, '_', "_", kActionKeyType, ~0},
- {"BACKQUOTE", KEYCODE_BACKQUOTE, '`', "`", kActionKeyType, ~0},
- {"a", KEYCODE_a, 'a', "A", kActionKeyType, ~0},
- {"b", KEYCODE_b, 'b', "B", kActionKeyType, ~0},
- {"c", KEYCODE_c, 'c', "C", kActionKeyType, ~0},
- {"d", KEYCODE_d, 'd', "D", kActionKeyType, ~0},
- {"e", KEYCODE_e, 'e', "E", kActionKeyType, ~0},
- {"f", KEYCODE_f, 'f', "F", kActionKeyType, ~0},
- {"g", KEYCODE_g, 'g', "G", kActionKeyType, ~0},
- {"h", KEYCODE_h, 'h', "H", kActionKeyType, ~0},
- {"i", KEYCODE_i, 'i', "I", kActionKeyType, ~0},
- {"j", KEYCODE_j, 'j', "J", kActionKeyType, ~0},
- {"k", KEYCODE_k, 'k', "K", kActionKeyType, ~0},
- {"l", KEYCODE_l, 'l', "L", kActionKeyType, ~0},
- {"m", KEYCODE_m, 'm', "M", kActionKeyType, ~0},
- {"n", KEYCODE_n, 'n', "N", kActionKeyType, ~0},
- {"o", KEYCODE_o, 'o', "O", kActionKeyType, ~0},
- {"p", KEYCODE_p, 'p', "P", kActionKeyType, ~0},
- {"q", KEYCODE_q, 'q', "Q", kActionKeyType, ~0},
- {"r", KEYCODE_r, 'r', "R", kActionKeyType, ~0},
- {"s", KEYCODE_s, 's', "S", kActionKeyType, ~0},
- {"t", KEYCODE_t, 't', "T", kActionKeyType, ~0},
- {"u", KEYCODE_u, 'u', "U", kActionKeyType, ~0},
- {"v", KEYCODE_v, 'v', "V", kActionKeyType, ~0},
- {"w", KEYCODE_w, 'w', "W", kActionKeyType, ~0},
- {"x", KEYCODE_x, 'x', "X", kActionKeyType, ~0},
- {"y", KEYCODE_y, 'y', "Y", kActionKeyType, ~0},
- {"z", KEYCODE_z, 'z', "Z", kActionKeyType, ~0},
- {"DELETE", KEYCODE_DELETE, 0, "Del", kActionKeyType, ~0},
+ {"BACKSPACE", KEYCODE_BACKSPACE, ASCII_BACKSPACE, "Backspace", kActionKeyType, false},
+ {"TAB", KEYCODE_TAB, ASCII_TAB, "Tab", kActionKeyType, false},
+ {"CLEAR", KEYCODE_CLEAR, 0, "Clear", kActionKeyType, false},
+ {"RETURN", KEYCODE_RETURN, ASCII_RETURN, "Return", kActionKeyType, false},
+ {"PAUSE", KEYCODE_PAUSE, 0, "Pause", kActionKeyType, false},
+ {"ESCAPE", KEYCODE_ESCAPE, ASCII_ESCAPE, "Esc", kStartKeyType, false},
+ {"SPACE", KEYCODE_SPACE, ASCII_SPACE, "Space", kActionKeyType, false},
+ {"EXCLAIM", KEYCODE_EXCLAIM, '!', "!", kActionKeyType, false},
+ {"QUOTEDBL", KEYCODE_QUOTEDBL, '"', "\"", kActionKeyType, false},
+ {"HASH", KEYCODE_HASH, '#', "#", kActionKeyType, false},
+ {"DOLLAR", KEYCODE_DOLLAR, '$', "$", kActionKeyType, false},
+ {"AMPERSAND", KEYCODE_AMPERSAND, '&', "&", kActionKeyType, false},
+ {"QUOTE", KEYCODE_QUOTE, '\'', "'", kActionKeyType, false},
+ {"LEFTPAREN", KEYCODE_LEFTPAREN, '(', "(", kActionKeyType, false},
+ {"RIGHTPAREN", KEYCODE_RIGHTPAREN, ')', ")", kActionKeyType, false},
+ {"ASTERISK", KEYCODE_ASTERISK, '*', "*", kActionKeyType, false},
+ {"PLUS", KEYCODE_PLUS, '+', "+", kActionKeyType, false},
+ {"COMMA", KEYCODE_COMMA, ',', ",", kActionKeyType, false},
+ {"MINUS", KEYCODE_MINUS, '-', "-", kActionKeyType, false},
+ {"PERIOD", KEYCODE_PERIOD, '.', ".", kActionKeyType, false},
+ {"SLASH", KEYCODE_SLASH, '/', "/", kActionKeyType, false},
+ {"0", KEYCODE_0, '0', "0", kActionKeyType, false},
+ {"1", KEYCODE_1, '1', "1", kActionKeyType, false},
+ {"2", KEYCODE_2, '2', "2", kActionKeyType, false},
+ {"3", KEYCODE_3, '3', "3", kActionKeyType, false},
+ {"4", KEYCODE_4, '4', "4", kActionKeyType, false},
+ {"5", KEYCODE_5, '5', "5", kActionKeyType, false},
+ {"6", KEYCODE_6, '6', "6", kActionKeyType, false},
+ {"7", KEYCODE_7, '7', "7", kActionKeyType, false},
+ {"8", KEYCODE_8, '8', "8", kActionKeyType, false},
+ {"9", KEYCODE_9, '9', "9", kActionKeyType, false},
+ {"COLON", KEYCODE_COLON, ':', ":", kActionKeyType, false},
+ {"SEMICOLON", KEYCODE_SEMICOLON, ';', ";", kActionKeyType, false},
+ {"LESS", KEYCODE_LESS, '<', "<", kActionKeyType, false},
+ {"EQUALS", KEYCODE_EQUALS, '=', "=", kActionKeyType, false},
+ {"GREATER", KEYCODE_GREATER, '>', ">", kActionKeyType, false},
+ {"QUESTION", KEYCODE_QUESTION, '?', "?", kActionKeyType, false},
+ {"AT", KEYCODE_AT, '@', "@", kActionKeyType, false},
+
+ {"LEFTBRACKET", KEYCODE_LEFTBRACKET, '[', "[", kActionKeyType, false},
+ {"BACKSLASH", KEYCODE_BACKSLASH, '\\', "\\", kActionKeyType, false},
+ {"RIGHTBRACKET", KEYCODE_RIGHTBRACKET, ']', "]", kActionKeyType, false},
+ {"CARET", KEYCODE_CARET, '^', "^", kActionKeyType, false},
+ {"UNDERSCORE", KEYCODE_UNDERSCORE, '_', "_", kActionKeyType, false},
+ {"BACKQUOTE", KEYCODE_BACKQUOTE, '`', "`", kActionKeyType, false},
+ {"a", KEYCODE_a, 'a', "a", kActionKeyType, true},
+ {"b", KEYCODE_b, 'b', "b", kActionKeyType, true},
+ {"c", KEYCODE_c, 'c', "c", kActionKeyType, true},
+ {"d", KEYCODE_d, 'd', "d", kActionKeyType, true},
+ {"e", KEYCODE_e, 'e', "e", kActionKeyType, true},
+ {"f", KEYCODE_f, 'f', "f", kActionKeyType, true},
+ {"g", KEYCODE_g, 'g', "g", kActionKeyType, true},
+ {"h", KEYCODE_h, 'h', "h", kActionKeyType, true},
+ {"i", KEYCODE_i, 'i', "i", kActionKeyType, true},
+ {"j", KEYCODE_j, 'j', "j", kActionKeyType, true},
+ {"k", KEYCODE_k, 'k', "k", kActionKeyType, true},
+ {"l", KEYCODE_l, 'l', "l", kActionKeyType, true},
+ {"m", KEYCODE_m, 'm', "m", kActionKeyType, true},
+ {"n", KEYCODE_n, 'n', "n", kActionKeyType, true},
+ {"o", KEYCODE_o, 'o', "o", kActionKeyType, true},
+ {"p", KEYCODE_p, 'p', "p", kActionKeyType, true},
+ {"q", KEYCODE_q, 'q', "q", kActionKeyType, true},
+ {"r", KEYCODE_r, 'r', "r", kActionKeyType, true},
+ {"s", KEYCODE_s, 's', "s", kActionKeyType, true},
+ {"t", KEYCODE_t, 't', "t", kActionKeyType, true},
+ {"u", KEYCODE_u, 'u', "u", kActionKeyType, true},
+ {"v", KEYCODE_v, 'v', "v", kActionKeyType, true},
+ {"w", KEYCODE_w, 'w', "w", kActionKeyType, true},
+ {"x", KEYCODE_x, 'x', "x", kActionKeyType, true},
+ {"y", KEYCODE_y, 'y', "y", kActionKeyType, true},
+ {"z", KEYCODE_z, 'z', "z", kActionKeyType, true},
+ {"DELETE", KEYCODE_DELETE, 0, "Del", kActionKeyType, false},
// Numeric keypad
- {"KP0", KEYCODE_KP0, 0, "KP0", kActionKeyType, ~0},
- {"KP1", KEYCODE_KP1, 0, "KP1", kActionKeyType, ~0},
- {"KP2", KEYCODE_KP2, 0, "KP2", kActionKeyType, ~0},
- {"KP3", KEYCODE_KP3, 0, "KP3", kActionKeyType, ~0},
- {"KP4", KEYCODE_KP4, 0, "KP4", kActionKeyType, ~0},
- {"KP5", KEYCODE_KP5, 0, "KP5", kActionKeyType, ~0},
- {"KP6", KEYCODE_KP6, 0, "KP6", kActionKeyType, ~0},
- {"KP7", KEYCODE_KP7, 0, "KP7", kActionKeyType, ~0},
- {"KP8", KEYCODE_KP8, 0, "KP8", kActionKeyType, ~0},
- {"KP9", KEYCODE_KP9, 0, "KP9", kActionKeyType, ~0},
- {"KP_PERIOD", KEYCODE_KP_PERIOD, 0, "KP.", kActionKeyType, ~0},
- {"KP_DIVIDE", KEYCODE_KP_DIVIDE, 0, "KP/", kActionKeyType, ~0},
- {"KP_MULTIPLY", KEYCODE_KP_MULTIPLY, 0, "KP*", kActionKeyType, ~0},
- {"KP_MINUS", KEYCODE_KP_MINUS, 0, "KP-", kActionKeyType, ~0},
- {"KP_PLUS", KEYCODE_KP_PLUS, 0, "KP+", kActionKeyType, ~0},
- {"KP_ENTER", KEYCODE_KP_ENTER, 0, "KP Enter", kActionKeyType, ~0},
- {"KP_EQUALS", KEYCODE_KP_EQUALS, 0, "KP=", kActionKeyType, ~0},
+ {"KP0", KEYCODE_KP0, 0, "KP0", kActionKeyType, false},
+ {"KP1", KEYCODE_KP1, 0, "KP1", kActionKeyType, false},
+ {"KP2", KEYCODE_KP2, 0, "KP2", kActionKeyType, false},
+ {"KP3", KEYCODE_KP3, 0, "KP3", kActionKeyType, false},
+ {"KP4", KEYCODE_KP4, 0, "KP4", kActionKeyType, false},
+ {"KP5", KEYCODE_KP5, 0, "KP5", kActionKeyType, false},
+ {"KP6", KEYCODE_KP6, 0, "KP6", kActionKeyType, false},
+ {"KP7", KEYCODE_KP7, 0, "KP7", kActionKeyType, false},
+ {"KP8", KEYCODE_KP8, 0, "KP8", kActionKeyType, false},
+ {"KP9", KEYCODE_KP9, 0, "KP9", kActionKeyType, false},
+ {"KP_PERIOD", KEYCODE_KP_PERIOD, 0, "KP.", kActionKeyType, false},
+ {"KP_DIVIDE", KEYCODE_KP_DIVIDE, 0, "KP/", kActionKeyType, false},
+ {"KP_MULTIPLY", KEYCODE_KP_MULTIPLY, 0, "KP*", kActionKeyType, false},
+ {"KP_MINUS", KEYCODE_KP_MINUS, 0, "KP-", kActionKeyType, false},
+ {"KP_PLUS", KEYCODE_KP_PLUS, 0, "KP+", kActionKeyType, false},
+ {"KP_ENTER", KEYCODE_KP_ENTER, 0, "KP Enter", kActionKeyType, false},
+ {"KP_EQUALS", KEYCODE_KP_EQUALS, 0, "KP=", kActionKeyType, false},
// Arrows + Home/End pad
- {"UP", KEYCODE_UP, 0, "Up", kDirUpKeyType, ~0},
- {"DOWN", KEYCODE_DOWN, 0, "Down", kDirDownKeyType, ~0},
- {"RIGHT", KEYCODE_RIGHT, 0, "Right", kDirRightKeyType, ~0},
- {"LEFT", KEYCODE_LEFT, 0, "Left", kDirLeftKeyType, ~0},
- {"INSERT", KEYCODE_INSERT, 0, "Insert", kActionKeyType, ~0},
- {"HOME", KEYCODE_HOME, 0, "Home", kActionKeyType, ~0},
- {"END", KEYCODE_END, 0, "End", kActionKeyType, ~0},
- {"PAGEUP", KEYCODE_PAGEUP, 0, "PgUp", kActionKeyType, ~0},
- {"PAGEDOWN", KEYCODE_PAGEDOWN, 0, "PgDn", kActionKeyType, ~0},
+ {"UP", KEYCODE_UP, 0, "Up", kDirUpKeyType, false},
+ {"DOWN", KEYCODE_DOWN, 0, "Down", kDirDownKeyType, false},
+ {"RIGHT", KEYCODE_RIGHT, 0, "Right", kDirRightKeyType, false},
+ {"LEFT", KEYCODE_LEFT, 0, "Left", kDirLeftKeyType, false},
+ {"INSERT", KEYCODE_INSERT, 0, "Insert", kActionKeyType, false},
+ {"HOME", KEYCODE_HOME, 0, "Home", kActionKeyType, false},
+ {"END", KEYCODE_END, 0, "End", kActionKeyType, false},
+ {"PAGEUP", KEYCODE_PAGEUP, 0, "PgUp", kActionKeyType, false},
+ {"PAGEDOWN", KEYCODE_PAGEDOWN, 0, "PgDn", kActionKeyType, false},
// Function keys
- {"F1", KEYCODE_F1, ASCII_F1, "F1", kActionKeyType, ~0},
- {"F2", KEYCODE_F2, ASCII_F2, "F2", kActionKeyType, ~0},
- {"F3", KEYCODE_F3, ASCII_F3, "F3", kActionKeyType, ~0},
- {"F4", KEYCODE_F4, ASCII_F4, "F4", kActionKeyType, ~0},
- {"F5", KEYCODE_F5, ASCII_F5, "F5", kActionKeyType, ~0},
- {"F6", KEYCODE_F6, ASCII_F6, "F6", kActionKeyType, ~0},
- {"F7", KEYCODE_F7, ASCII_F7, "F7", kActionKeyType, ~0},
- {"F8", KEYCODE_F8, ASCII_F8, "F8", kActionKeyType, ~0},
- {"F9", KEYCODE_F9, ASCII_F9, "F9", kActionKeyType, ~0},
- {"F10", KEYCODE_F10, ASCII_F10, "F10", kActionKeyType, ~0},
- {"F11", KEYCODE_F11, ASCII_F11, "F11", kActionKeyType, ~0},
- {"F12", KEYCODE_F12, ASCII_F12, "F12", kActionKeyType, ~0},
- {"F13", KEYCODE_F13, 0, "F13", kActionKeyType, ~0},
- {"F14", KEYCODE_F14, 0, "F14", kActionKeyType, ~0},
- {"F15", KEYCODE_F15, 0, "F15", kActionKeyType, ~0},
-
-
- // Modifier keys pressed alone
- {"RSHIFT", KEYCODE_RSHIFT, 0, "Right Shift", kModiferKeyType, ~KBD_SHIFT},
- {"LSHIFT", KEYCODE_LSHIFT, 0, "Left Shift", kModiferKeyType, ~KBD_SHIFT},
- {"RCTRL", KEYCODE_RCTRL, 0, "Right Ctrl", kModiferKeyType, ~KBD_CTRL},
- {"LCTRL", KEYCODE_LCTRL, 0, "Left Ctrl", kModiferKeyType, ~KBD_CTRL},
- {"RALT", KEYCODE_RALT, 0, "Right Alt", kModiferKeyType, ~KBD_ALT},
- {"LALT", KEYCODE_LALT, 0, "Left Alt", kModiferKeyType, ~KBD_ALT},
-
+ {"F1", KEYCODE_F1, ASCII_F1, "F1", kActionKeyType, false},
+ {"F2", KEYCODE_F2, ASCII_F2, "F2", kActionKeyType, false},
+ {"F3", KEYCODE_F3, ASCII_F3, "F3", kActionKeyType, false},
+ {"F4", KEYCODE_F4, ASCII_F4, "F4", kActionKeyType, false},
+ {"F5", KEYCODE_F5, ASCII_F5, "F5", kActionKeyType, false},
+ {"F6", KEYCODE_F6, ASCII_F6, "F6", kActionKeyType, false},
+ {"F7", KEYCODE_F7, ASCII_F7, "F7", kActionKeyType, false},
+ {"F8", KEYCODE_F8, ASCII_F8, "F8", kActionKeyType, false},
+ {"F9", KEYCODE_F9, ASCII_F9, "F9", kActionKeyType, false},
+ {"F10", KEYCODE_F10, ASCII_F10, "F10", kActionKeyType, false},
+ {"F11", KEYCODE_F11, ASCII_F11, "F11", kActionKeyType, false},
+ {"F12", KEYCODE_F12, ASCII_F12, "F12", kActionKeyType, false},
+ {"F13", KEYCODE_F13, 0, "F13", kActionKeyType, false},
+ {"F14", KEYCODE_F14, 0, "F14", kActionKeyType, false},
+ {"F15", KEYCODE_F15, 0, "F15", kActionKeyType, false},
// Miscellaneous function keys
- {"HELP", KEYCODE_HELP, 0, "Help", kActionKeyType, ~0},
- {"PRINT", KEYCODE_PRINT, 0, "Print", kActionKeyType, ~0},
- {"SYSREQ", KEYCODE_SYSREQ, 0, "SysRq", kActionKeyType, ~0},
- {"BREAK", KEYCODE_BREAK, 0, "Break", kActionKeyType, ~0},
- {"MENU", KEYCODE_MENU, 0, "Menu", kActionKeyType, ~0},
+ {"HELP", KEYCODE_HELP, 0, "Help", kActionKeyType, false},
+ {"PRINT", KEYCODE_PRINT, 0, "Print", kActionKeyType, false},
+ {"SYSREQ", KEYCODE_SYSREQ, 0, "SysRq", kActionKeyType, false},
+ {"BREAK", KEYCODE_BREAK, 0, "Break", kActionKeyType, false},
+ {"MENU", KEYCODE_MENU, 0, "Menu", kActionKeyType, false},
// Power Macintosh power key
- {"POWER", KEYCODE_POWER, 0, "Power", kActionKeyType, ~0},
+ {"POWER", KEYCODE_POWER, 0, "Power", kActionKeyType, false},
// Some european keyboards
- {"EURO", KEYCODE_EURO, 0, "Euro", kActionKeyType, ~0},
+ {"EURO", KEYCODE_EURO, 0, "Euro", kActionKeyType, false},
// Atari keyboard has Undo
- {"UNDO", KEYCODE_UNDO, 0, "Undo", kActionKeyType, ~0},
- {0, KEYCODE_INVALID, 0, 0, kGenericKeyType, ~0}
+ {"UNDO", KEYCODE_UNDO, 0, "Undo", kActionKeyType, false},
+ {0, KEYCODE_INVALID, 0, 0, kGenericKeyType, false}
};
struct Mod {
byte flag;
const char *id;
const char *desc;
+ bool shiftable;
};
static const Mod modifiers[] = {
- { 0, "", "" },
- { KBD_CTRL, "C+", "Ctrl+" },
- { KBD_ALT, "A+", "Alt+" },
- { KBD_SHIFT, "S+", "Shift+" },
- { 0, 0, 0 }
+ { 0, "", "", false },
+ { KBD_CTRL, "C+", "Ctrl+", false },
+ { KBD_ALT, "A+", "Alt+", false },
+ { KBD_SHIFT, "", "", true },
+ { KBD_CTRL | KBD_ALT, "C+A+", "Ctrl+Alt+", false },
+ { KBD_SHIFT | KBD_CTRL, "S+C+", "Shift+Ctrl+", true },
+ { KBD_SHIFT | KBD_CTRL | KBD_ALT, "C+A+", "Ctrl+Alt+", true },
+ { 0, 0, 0, false }
};
#endif
Common::HardwareKeySet *OSystem_SDL::getHardwareKeySet() {
#ifdef ENABLE_KEYMAPPER
- static HardwareKeySet *keySet = new HardwareKeySet();
- static bool keySetInited = false;
- if (keySet && keySetInited)
- return keySet;
-
+ HardwareKeySet *keySet = new HardwareKeySet();
const Key *key;
const Mod *mod;
char fullKeyId[50];
@@ -216,21 +206,24 @@ Common::HardwareKeySet *OSystem_SDL::getHardwareKeySet() {
uint16 ascii;
for (mod = modifiers; mod->id; mod++) {
- snprintf(fullKeyId, 50, "S+%s", mod->id);
- snprintf(fullKeyDesc, 100, "Shift+%s", mod->desc);
-
- keySet->addHardwareMod(new HardwareMod(fullKeyId, mod->flag, fullKeyDesc));
+ for (key = keys; key->hwId; key++) {
+ ascii = key->ascii;
+
+ if (mod->shiftable && key->shiftable) {
+ snprintf(fullKeyId, 50, "%s%c", mod->id, toupper(key->hwId[0]));
+ snprintf(fullKeyDesc, 100, "%s%c", mod->desc, toupper(key->desc[0]));
+ ascii = toupper(key->ascii);
+ } else if (mod->shiftable) {
+ snprintf(fullKeyId, 50, "S+%s%s", mod->id, key->hwId);
+ snprintf(fullKeyDesc, 100, "Shift+%s%s", mod->desc, key->desc);
+ } else {
+ snprintf(fullKeyId, 50, "%s%s", mod->id, key->hwId);
+ snprintf(fullKeyDesc, 100, "%s%s", mod->desc, key->desc);
+ }
+
+ keySet->addHardwareKey(new HardwareKey(fullKeyId, KeyState(key->keycode, ascii, mod->flag), fullKeyDesc, key->preferredAction ));
+ }
}
- for (key = keys; key->hwId; key++) {
- ascii = key->ascii;
-
- snprintf(fullKeyId, 50, "%s", key->hwId);
- snprintf(fullKeyDesc, 100, "%s", key->desc);
-
- keySet->addHardwareKey(new HardwareKey(fullKeyId, ActionKey(key->keycode, 0), fullKeyDesc, key->modableMask, key->preferredAction));
- }
-
- keySetInited = true;
return keySet;
diff --git a/backends/platform/sdl/sdl.h b/backends/platform/sdl/sdl.h
index 6c8a721701..09213ad417 100644
--- a/backends/platform/sdl/sdl.h
+++ b/backends/platform/sdl/sdl.h
@@ -303,10 +303,10 @@ protected:
int screenWidth, screenHeight;
int overlayWidth, overlayHeight;
+ int hardwareWidth, hardwareHeight;
#ifdef ENABLE_RGB_COLOR
Graphics::PixelFormat format;
#endif
- int hardwareWidth, hardwareHeight;
};
VideoState _videoMode, _oldVideoMode;
diff --git a/common/EventRecorder.cpp b/common/EventRecorder.cpp
index 3d5eee3e52..57ab475f4a 100644
--- a/common/EventRecorder.cpp
+++ b/common/EventRecorder.cpp
@@ -100,6 +100,7 @@ EventRecorder::EventRecorder() {
_lastEventCount = 0;
_lastMillis = 0;
+ _recordMode = kPassthrough;
}
EventRecorder::~EventRecorder() {
diff --git a/configure b/configure
index 783c397402..9ef794eed2 100755
--- a/configure
+++ b/configure
@@ -110,8 +110,7 @@ _alsa=auto
_zlib=auto
_mpeg2=no
_fluidsynth=auto
-_16bit=yes
-_readline=auto
+_16bit=yes_readline=auto
# Default option behaviour yes/no
_text_console=no
_mt32emu=yes
@@ -638,8 +637,6 @@ DEBFLAGS="-g"
for ac_option in $@; do
case "$ac_option" in
- --enable-16bit) _16bit=yes ;;
- --disable-16bit) _16bit=no ;;
--disable-hq-scalers) _build_hq_scalers=no ;;
--disable-scalers) _build_scalers=no ;;
--enable-alsa) _alsa=yes ;;
@@ -1650,11 +1647,6 @@ fi
add_to_config_mk_if_yes "$_mt32emu" 'USE_MT32EMU = 1'
#
-# Check whether 16bit color support is requested
-#
-add_to_config_mk_if_yes "$_16bit" 'ENABLE_RGB_COLOR = 1'
-
-#
# Check whether to enable the (hq) scalers
#
add_to_config_mk_if_no $_build_hq_scalers 'DISABLE_HQ_SCALERS = 1'
@@ -2004,10 +1996,6 @@ if test "$_nasm" = yes ; then
echo_n ", assembly routines"
fi
-if test "$_16bit" = yes ; then
- echo_n ", 16bit color"
-fi
-
if test "$_build_hq_scalers" = yes ; then
echo_n ", HQ scalers"
fi
diff --git a/dists/msvc8/ScummVM_Global.vsprops b/dists/msvc8/ScummVM_Global.vsprops
index dc45440e62..4da6748645 100644
--- a/dists/msvc8/ScummVM_Global.vsprops
+++ b/dists/msvc8/ScummVM_Global.vsprops
@@ -10,7 +10,7 @@
Name="VCCLCompilerTool"
DisableSpecificWarnings="4068;4100;4103;4121;4127;4189;4201;4221;4244;4250;4310;4351;4355;4510;4511;4512;4610;4701;4702;4706;4800;4996"
AdditionalIncludeDirectories="../..;../../engines"
- PreprocessorDefinitions="USE_NASM;USE_ZLIB;USE_MAD;USE_VORBIS;USE_MPEG2;USE_MT32EMU;ENABLE_AGI;ENABLE_AGOS;ENABLE_AGOS2;ENABLE_CINE;ENABLE_CRUISE;ENABLE_DRASCULA;ENABLE_GOB;ENABLE_IGOR;ENABLE_KYRA;ENABLE_LOL;ENABLE_LURE;ENABLE_M4;ENABLE_MADE;ENABLE_PARALLACTION;ENABLE_QUEEN;ENABLE_SAGA;ENABLE_IHNM;ENABLE_SAGA2;ENABLE_SCI;ENABLE_SCUMM;ENABLE_SKY;ENABLE_SWORD1;ENABLE_SWORD2;ENABLE_TOUCHE;ENABLE_SCUMM_7_8;ENABLE_HE;ENABLE_TINSEL;ENABLE_TUCKER;ENABLE_GROOVIE;ENABLE_RGB_COLOR;ENABLE_KEYMAPPER"
+ PreprocessorDefinitions="USE_NASM;USE_ZLIB;USE_MAD;USE_VORBIS;USE_MPEG2;USE_MT32EMU;ENABLE_AGI;ENABLE_AGOS;ENABLE_AGOS2;ENABLE_CINE;ENABLE_CRUISE;ENABLE_DRASCULA;ENABLE_GOB;ENABLE_IGOR;ENABLE_KYRA;ENABLE_LOL;ENABLE_LURE;ENABLE_M4;ENABLE_MADE;ENABLE_PARALLACTION;ENABLE_QUEEN;ENABLE_SAGA;ENABLE_IHNM;ENABLE_SAGA2;ENABLE_SCI;ENABLE_SCUMM;ENABLE_SKY;ENABLE_SWORD1;ENABLE_SWORD2;ENABLE_TOUCHE;ENABLE_SCUMM_7_8;ENABLE_HE;ENABLE_TINSEL;ENABLE_TUCKER;ENABLE_GROOVIE;;ENABLE_RGB_COLOR"
ExceptionHandling="0"
RuntimeTypeInfo="false"
WarningLevel="4"
diff --git a/dists/msvc8/scummvm.vcproj b/dists/msvc8/scummvm.vcproj
index fbea20d7fc..fd02ba0023 100644
--- a/dists/msvc8/scummvm.vcproj
+++ b/dists/msvc8/scummvm.vcproj
@@ -8,867 +8,212 @@
Keyword="Win32Proj"
>
<Platforms>
- <Platform
- Name="Win32"
- />
+ <Platform Name="Win32" />
</Platforms>
- <ToolFiles>
- </ToolFiles>
<Configurations>
- <Configuration
- Name="Debug|Win32"
- ConfigurationType="1"
- InheritedPropertySheets=".\ScummVM_Debug.vsprops"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
+ <Configuration Name="Debug|Win32" ConfigurationType="1" InheritedPropertySheets=".\ScummVM_Debug.vsprops">
+ <Tool Name="VCLinkerTool" OutputFile="$(OutDir)/scummvm.exe"
AdditionalDependencies="winmm.lib sdl.lib zlib.lib libmad.lib vorbisfile_static.lib vorbis_static.lib ogg_static.lib libmpeg2.lib $(OutDir)/*.lib"
- OutputFile="$(OutDir)/scummvm.exe"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
/>
</Configuration>
- <Configuration
- Name="Release|Win32"
- ConfigurationType="1"
- InheritedPropertySheets=".\ScummVM_Release.vsprops"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
+ <Configuration Name="Release|Win32" ConfigurationType="1" InheritedPropertySheets=".\ScummVM_Release.vsprops">
+ <Tool Name="VCLinkerTool" OutputFile="$(OutDir)/scummvm.exe"
AdditionalDependencies="winmm.lib sdl.lib zlib.lib libmad.lib vorbisfile_static.lib vorbis_static.lib ogg_static.lib libmpeg2.lib $(OutDir)/*.lib"
- OutputFile="$(OutDir)/scummvm.exe"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
- <References>
- </References>
<Files>
- <Filter
- Name="base"
- >
- <File
- RelativePath="..\..\base\commandLine.cpp"
- >
- </File>
- <File
- RelativePath="..\..\base\commandLine.h"
- >
- </File>
- <File
- RelativePath="..\..\base\internal_version.h"
- >
- </File>
- <File
- RelativePath="..\..\base\main.cpp"
- >
- </File>
- <File
- RelativePath="..\..\base\main.h"
- >
- </File>
- <File
- RelativePath="..\..\base\plugins.cpp"
- >
- </File>
- <File
- RelativePath="..\..\base\plugins.h"
- >
- </File>
- <File
- RelativePath="..\..\base\version.cpp"
- >
- </File>
- <File
- RelativePath="..\..\base\version.h"
- >
- </File>
+ <Filter Name="base">
+ <File RelativePath="..\..\base\commandLine.cpp" />
+ <File RelativePath="..\..\base\commandLine.h" />
+ <File RelativePath="..\..\base\internal_version.h" />
+ <File RelativePath="..\..\base\main.cpp" />
+ <File RelativePath="..\..\base\main.h" />
+ <File RelativePath="..\..\base\plugins.cpp" />
+ <File RelativePath="..\..\base\plugins.h" />
+ <File RelativePath="..\..\base\version.cpp" />
+ <File RelativePath="..\..\base\version.h" />
</Filter>
- <Filter
- Name="common"
- >
- <File
- RelativePath="..\..\common\algorithm.h"
- >
- </File>
- <File
- RelativePath="..\..\common\archive.cpp"
- >
- </File>
- <File
- RelativePath="..\..\common\archive.h"
- >
- </File>
- <File
- RelativePath="..\..\common\array.h"
- >
- </File>
- <File
- RelativePath="..\..\common\config-file.cpp"
- >
- </File>
- <File
- RelativePath="..\..\common\config-file.h"
- >
- </File>
- <File
- RelativePath="..\..\common\config-manager.cpp"
- >
- </File>
- <File
- RelativePath="..\..\common\config-manager.h"
- >
- </File>
- <File
- RelativePath="..\..\common\debug.cpp"
- >
- </File>
- <File
- RelativePath="..\..\common\debug.h"
- >
- </File>
- <File
- RelativePath="..\..\common\endian.h"
- >
- </File>
- <File
- RelativePath="..\..\common\error.h"
- >
- </File>
- <File
- RelativePath="..\..\common\EventDispatcher.cpp"
- >
- </File>
- <File
- RelativePath="..\..\common\EventRecorder.cpp"
- >
- </File>
- <File
- RelativePath="..\..\common\EventRecorder.h"
- >
- </File>
- <File
- RelativePath="..\..\common\events.h"
- >
- </File>
- <File
- RelativePath="..\..\common\file.cpp"
- >
- </File>
- <File
- RelativePath="..\..\common\file.h"
- >
- </File>
- <File
- RelativePath="..\..\common\frac.h"
- >
- </File>
- <File
- RelativePath="..\..\common\fs.cpp"
- >
- </File>
- <File
- RelativePath="..\..\common\fs.h"
- >
- </File>
- <File
- RelativePath="..\..\common\func.h"
- >
- </File>
- <File
- RelativePath="..\..\common\hash-str.h"
- >
- </File>
- <File
- RelativePath="..\..\common\hashmap.cpp"
- >
- </File>
- <File
- RelativePath="..\..\common\hashmap.h"
- >
- </File>
- <File
- RelativePath="..\..\common\iff_container.h"
- >
- </File>
- <File
- RelativePath="..\..\common\keyboard.h"
- >
- </File>
- <File
- RelativePath="..\..\common\list.h"
- >
- </File>
- <File
- RelativePath="..\..\common\list_intern.h"
- >
- </File>
- <File
- RelativePath="..\..\common\md5.cpp"
- >
- </File>
- <File
- RelativePath="..\..\common\md5.h"
- >
- </File>
- <File
- RelativePath="..\..\common\memorypool.cpp"
- >
- </File>
- <File
- RelativePath="..\..\common\memorypool.h"
- >
- </File>
- <File
- RelativePath="..\..\common\mutex.cpp"
- >
- </File>
- <File
- RelativePath="..\..\common\mutex.h"
- >
- </File>
- <File
- RelativePath="..\..\common\noncopyable.h"
- >
- </File>
- <File
- RelativePath="..\..\common\pack-end.h"
- >
- </File>
- <File
- RelativePath="..\..\common\pack-start.h"
- >
- </File>
- <File
- RelativePath="..\..\common\ptr.h"
- >
- </File>
- <File
- RelativePath="..\..\common\queue.h"
- >
- </File>
- <File
- RelativePath="..\..\common\rect.h"
- >
- </File>
- <File
- RelativePath="..\..\common\savefile.h"
- >
- </File>
- <File
- RelativePath="..\..\common\scummsys.h"
- >
- </File>
- <File
- RelativePath="..\..\common\serializer.h"
- >
- </File>
- <File
- RelativePath="..\..\common\singleton.h"
- >
- </File>
- <File
- RelativePath="..\..\common\stack.h"
- >
- </File>
- <File
- RelativePath="..\..\common\str.cpp"
- >
- </File>
- <File
- RelativePath="..\..\common\str.h"
- >
- </File>
- <File
- RelativePath="..\..\common\stream.cpp"
- >
- </File>
- <File
- RelativePath="..\..\common\stream.h"
- >
- </File>
- <File
- RelativePath="..\..\common\system.cpp"
- >
- </File>
- <File
- RelativePath="..\..\common\system.h"
- >
- </File>
- <File
- RelativePath="..\..\common\timer.h"
- >
- </File>
- <File
- RelativePath="..\..\common\unarj.cpp"
- >
- </File>
- <File
- RelativePath="..\..\common\unarj.h"
- >
- </File>
- <File
- RelativePath="..\..\common\unzip.cpp"
- >
- </File>
- <File
- RelativePath="..\..\common\unzip.h"
- >
- </File>
- <File
- RelativePath="..\..\common\util.cpp"
- >
- </File>
- <File
- RelativePath="..\..\common\util.h"
- >
- </File>
- <File
- RelativePath="..\..\common\xmlparser.cpp"
- >
- </File>
- <File
- RelativePath="..\..\common\xmlparser.h"
- >
- </File>
- <File
- RelativePath="..\..\common\zlib.cpp"
- >
- </File>
- <File
- RelativePath="..\..\common\zlib.h"
- >
- </File>
+ <Filter Name="common">
+ <File RelativePath="..\..\common\algorithm.h" />
+ <File RelativePath="..\..\common\archive.cpp" />
+ <File RelativePath="..\..\common\archive.h" />
+ <File RelativePath="..\..\common\array.h" />
+ <File RelativePath="..\..\common\config-file.cpp" />
+ <File RelativePath="..\..\common\config-file.h" />
+ <File RelativePath="..\..\common\config-manager.cpp" />
+ <File RelativePath="..\..\common\config-manager.h" />
+ <File RelativePath="..\..\common\debug.cpp" />
+ <File RelativePath="..\..\common\debug.h" />
+ <File RelativePath="..\..\common\endian.h" />
+ <File RelativePath="..\..\common\error.h" />
+ <File RelativePath="..\..\common\EventDispatcher.cpp" />
+ <File RelativePath="..\..\common\EventRecorder.cpp" />
+ <File RelativePath="..\..\common\EventRecorder.h" />
+ <File RelativePath="..\..\common\events.h" />
+ <File RelativePath="..\..\common\file.cpp" />
+ <File RelativePath="..\..\common\file.h" />
+ <File RelativePath="..\..\common\frac.h" />
+ <File RelativePath="..\..\common\fs.cpp" />
+ <File RelativePath="..\..\common\fs.h" />
+ <File RelativePath="..\..\common\func.h" />
+ <File RelativePath="..\..\common\hash-str.h" />
+ <File RelativePath="..\..\common\hashmap.cpp" />
+ <File RelativePath="..\..\common\hashmap.h" />
+ <File RelativePath="..\..\common\iff_container.h" />
+ <File RelativePath="..\..\common\keyboard.h" />
+ <File RelativePath="..\..\common\list.h" />
+ <File RelativePath="..\..\common\list_intern.h" />
+ <File RelativePath="..\..\common\md5.cpp" />
+ <File RelativePath="..\..\common\md5.h" />
+ <File RelativePath="..\..\common\memorypool.cpp" />
+ <File RelativePath="..\..\common\memorypool.h" />
+ <File RelativePath="..\..\common\mutex.cpp" />
+ <File RelativePath="..\..\common\mutex.h" />
+ <File RelativePath="..\..\common\noncopyable.h" />
+ <File RelativePath="..\..\common\pack-end.h" />
+ <File RelativePath="..\..\common\pack-start.h" />
+ <File RelativePath="..\..\common\ptr.h" />
+ <File RelativePath="..\..\common\queue.h" />
+ <File RelativePath="..\..\common\rect.h" />
+ <File RelativePath="..\..\common\savefile.h" />
+ <File RelativePath="..\..\common\scummsys.h" />
+ <File RelativePath="..\..\common\serializer.h" />
+ <File RelativePath="..\..\common\singleton.h" />
+ <File RelativePath="..\..\common\stack.h" />
+ <File RelativePath="..\..\common\str.cpp" />
+ <File RelativePath="..\..\common\str.h" />
+ <File RelativePath="..\..\common\stream.cpp" />
+ <File RelativePath="..\..\common\stream.h" />
+ <File RelativePath="..\..\common\system.cpp" />
+ <File RelativePath="..\..\common\system.h" />
+ <File RelativePath="..\..\common\timer.h" />
+ <File RelativePath="..\..\common\unarj.cpp" />
+ <File RelativePath="..\..\common\unarj.h" />
+ <File RelativePath="..\..\common\unzip.cpp" />
+ <File RelativePath="..\..\common\unzip.h" />
+ <File RelativePath="..\..\common\util.cpp" />
+ <File RelativePath="..\..\common\util.h" />
+ <File RelativePath="..\..\common\xmlparser.cpp" />
+ <File RelativePath="..\..\common\xmlparser.h" />
+ <File RelativePath="..\..\common\zlib.cpp" />
+ <File RelativePath="..\..\common\zlib.h" />
</Filter>
- <Filter
- Name="sound"
- >
- <File
- RelativePath="..\..\sound\adpcm.cpp"
- >
- </File>
- <File
- RelativePath="..\..\sound\adpcm.h"
- >
- </File>
- <File
- RelativePath="..\..\sound\aiff.cpp"
- >
- </File>
- <File
- RelativePath="..\..\sound\aiff.h"
- >
- </File>
- <File
- RelativePath="..\..\sound\audiocd.cpp"
- >
- </File>
- <File
- RelativePath="..\..\sound\audiocd.h"
- >
- </File>
- <File
- RelativePath="..\..\sound\audiostream.cpp"
- >
- </File>
- <File
- RelativePath="..\..\sound\audiostream.h"
- >
- </File>
- <File
- RelativePath="..\..\sound\flac.cpp"
- >
- </File>
- <File
- RelativePath="..\..\sound\flac.h"
- >
- </File>
- <File
- RelativePath="..\..\sound\fmopl.cpp"
- >
- </File>
- <File
- RelativePath="..\..\sound\fmopl.h"
- >
- </File>
- <File
- RelativePath="..\..\sound\iff_sound.cpp"
- >
- </File>
- <File
- RelativePath="..\..\sound\iff_sound.h"
- >
- </File>
- <File
- RelativePath="..\..\sound\mididrv.cpp"
- >
- </File>
- <File
- RelativePath="..\..\sound\mididrv.h"
- >
- </File>
- <File
- RelativePath="..\..\sound\midiparser.cpp"
- >
- </File>
- <File
- RelativePath="..\..\sound\midiparser.h"
- >
- </File>
- <File
- RelativePath="..\..\sound\midiparser_smf.cpp"
- >
- </File>
- <File
- RelativePath="..\..\sound\midiparser_xmidi.cpp"
- >
- </File>
- <File
- RelativePath="..\..\sound\mixer.cpp"
- >
- </File>
- <File
- RelativePath="..\..\sound\mixer.h"
- >
- </File>
- <File
- RelativePath="..\..\sound\mixer_intern.h"
- >
- </File>
- <File
- RelativePath="..\..\sound\mp3.cpp"
- >
- </File>
- <File
- RelativePath="..\..\sound\mp3.h"
- >
- </File>
- <File
- RelativePath="..\..\sound\mpu401.cpp"
- >
- </File>
- <File
- RelativePath="..\..\sound\mpu401.h"
- >
- </File>
- <File
- RelativePath="..\..\sound\musicplugin.cpp"
- >
- </File>
- <File
- RelativePath="..\..\sound\musicplugin.h"
- >
- </File>
- <File
- RelativePath="..\..\sound\null.cpp"
- >
- </File>
- <File
- RelativePath="..\..\sound\rate.cpp"
- >
- </File>
- <File
- RelativePath="..\..\sound\rate.h"
- >
- </File>
- <File
- RelativePath="..\..\sound\shorten.cpp"
- >
- </File>
- <File
- RelativePath="..\..\sound\shorten.h"
- >
- </File>
- <File
- RelativePath="..\..\sound\timestamp.cpp"
- >
- </File>
- <File
- RelativePath="..\..\sound\timestamp.h"
- >
- </File>
- <File
- RelativePath="..\..\sound\vag.cpp"
- >
- </File>
- <File
- RelativePath="..\..\sound\vag.h"
- >
- </File>
- <File
- RelativePath="..\..\sound\voc.cpp"
- >
- </File>
- <File
- RelativePath="..\..\sound\voc.h"
- >
- </File>
- <File
- RelativePath="..\..\sound\vorbis.cpp"
- >
- </File>
- <File
- RelativePath="..\..\sound\vorbis.h"
- >
- </File>
- <File
- RelativePath="..\..\sound\wave.cpp"
- >
- </File>
- <File
- RelativePath="..\..\sound\wave.h"
- >
- </File>
- <Filter
- Name="softhsynth"
- >
- <File
- RelativePath="..\..\sound\softsynth\adlib.cpp"
- >
- </File>
- <File
- RelativePath="..\..\sound\softsynth\emumidi.h"
- >
- </File>
- <File
- RelativePath="..\..\sound\softsynth\fluidsynth.cpp"
- >
- </File>
- <File
- RelativePath="..\..\sound\softsynth\mt32.cpp"
- >
- </File>
- <File
- RelativePath="..\..\sound\softsynth\pcspk.cpp"
- >
- </File>
- <File
- RelativePath="..\..\sound\softsynth\pcspk.h"
- >
- </File>
- <File
- RelativePath="..\..\sound\softsynth\ym2612.cpp"
- >
- </File>
- <File
- RelativePath="..\..\sound\softsynth\ym2612.h"
- >
- </File>
- <Filter
- Name="mt32"
- >
- <File
- RelativePath="..\..\sound\softsynth\mt32\freeverb.cpp"
- >
- </File>
- <File
- RelativePath="..\..\sound\softsynth\mt32\freeverb.h"
- >
- </File>
- <File
- RelativePath="..\..\sound\softsynth\mt32\i386.cpp"
- >
- </File>
- <File
- RelativePath="..\..\sound\softsynth\mt32\i386.h"
- >
- </File>
- <File
- RelativePath="..\..\sound\softsynth\mt32\mt32_file.cpp"
- >
- </File>
- <File
- RelativePath="..\..\sound\softsynth\mt32\mt32_file.h"
- >
- </File>
- <File
- RelativePath="..\..\sound\softsynth\mt32\mt32emu.h"
- >
- </File>
- <File
- RelativePath="..\..\sound\softsynth\mt32\part.cpp"
- >
- </File>
- <File
- RelativePath="..\..\sound\softsynth\mt32\part.h"
- >
- </File>
- <File
- RelativePath="..\..\sound\softsynth\mt32\partial.cpp"
- >
- </File>
- <File
- RelativePath="..\..\sound\softsynth\mt32\partial.h"
- >
- </File>
- <File
- RelativePath="..\..\sound\softsynth\mt32\partialManager.cpp"
- >
- </File>
- <File
- RelativePath="..\..\sound\softsynth\mt32\partialManager.h"
- >
- </File>
- <File
- RelativePath="..\..\sound\softsynth\mt32\structures.h"
- >
- </File>
- <File
- RelativePath="..\..\sound\softsynth\mt32\synth.cpp"
- >
- </File>
- <File
- RelativePath="..\..\sound\softsynth\mt32\synth.h"
- >
- </File>
- <File
- RelativePath="..\..\sound\softsynth\mt32\tables.cpp"
- >
- </File>
- <File
- RelativePath="..\..\sound\softsynth\mt32\tables.h"
- >
- </File>
+ <Filter Name="sound">
+ <File RelativePath="..\..\sound\adpcm.cpp" />
+ <File RelativePath="..\..\sound\adpcm.h" />
+ <File RelativePath="..\..\sound\aiff.cpp" />
+ <File RelativePath="..\..\sound\aiff.h" />
+ <File RelativePath="..\..\sound\audiocd.cpp" />
+ <File RelativePath="..\..\sound\audiocd.h" />
+ <File RelativePath="..\..\sound\audiostream.cpp" />
+ <File RelativePath="..\..\sound\audiostream.h" />
+ <File RelativePath="..\..\sound\flac.cpp" />
+ <File RelativePath="..\..\sound\flac.h" />
+ <File RelativePath="..\..\sound\fmopl.cpp" />
+ <File RelativePath="..\..\sound\fmopl.h" />
+ <File RelativePath="..\..\sound\iff_sound.cpp" />
+ <File RelativePath="..\..\sound\iff_sound.h" />
+ <File RelativePath="..\..\sound\mididrv.cpp" />
+ <File RelativePath="..\..\sound\mididrv.h" />
+ <File RelativePath="..\..\sound\midiparser.cpp" />
+ <File RelativePath="..\..\sound\midiparser.h" />
+ <File RelativePath="..\..\sound\midiparser_smf.cpp" />
+ <File RelativePath="..\..\sound\midiparser_xmidi.cpp" />
+ <File RelativePath="..\..\sound\mixer.cpp" />
+ <File RelativePath="..\..\sound\mixer.h" />
+ <File RelativePath="..\..\sound\mixer_intern.h" />
+ <File RelativePath="..\..\sound\mp3.cpp" />
+ <File RelativePath="..\..\sound\mp3.h" />
+ <File RelativePath="..\..\sound\mpu401.cpp" />
+ <File RelativePath="..\..\sound\mpu401.h" />
+ <File RelativePath="..\..\sound\musicplugin.cpp" />
+ <File RelativePath="..\..\sound\musicplugin.h" />
+ <File RelativePath="..\..\sound\null.cpp" />
+ <File RelativePath="..\..\sound\rate.cpp" />
+ <File RelativePath="..\..\sound\rate.h" />
+ <File RelativePath="..\..\sound\shorten.cpp" />
+ <File RelativePath="..\..\sound\shorten.h" />
+ <File RelativePath="..\..\sound\timestamp.cpp" />
+ <File RelativePath="..\..\sound\timestamp.h" />
+ <File RelativePath="..\..\sound\vag.cpp" />
+ <File RelativePath="..\..\sound\vag.h" />
+ <File RelativePath="..\..\sound\voc.cpp" />
+ <File RelativePath="..\..\sound\voc.h" />
+ <File RelativePath="..\..\sound\vorbis.cpp" />
+ <File RelativePath="..\..\sound\vorbis.h" />
+ <File RelativePath="..\..\sound\wave.cpp" />
+ <File RelativePath="..\..\sound\wave.h" />
+ <Filter Name="softhsynth">
+ <File RelativePath="..\..\sound\softsynth\adlib.cpp" />
+ <File RelativePath="..\..\sound\softsynth\emumidi.h" />
+ <File RelativePath="..\..\sound\softsynth\fluidsynth.cpp" />
+ <File RelativePath="..\..\sound\softsynth\mt32.cpp" />
+ <File RelativePath="..\..\sound\softsynth\pcspk.cpp" />
+ <File RelativePath="..\..\sound\softsynth\pcspk.h" />
+ <File RelativePath="..\..\sound\softsynth\ym2612.cpp" />
+ <File RelativePath="..\..\sound\softsynth\ym2612.h" />
+ <Filter Name="mt32">
+ <File RelativePath="..\..\sound\softsynth\mt32\freeverb.cpp" />
+ <File RelativePath="..\..\sound\softsynth\mt32\freeverb.h" />
+ <File RelativePath="..\..\sound\softsynth\mt32\i386.cpp" />
+ <File RelativePath="..\..\sound\softsynth\mt32\i386.h" />
+ <File RelativePath="..\..\sound\softsynth\mt32\mt32_file.cpp" />
+ <File RelativePath="..\..\sound\softsynth\mt32\mt32_file.h" />
+ <File RelativePath="..\..\sound\softsynth\mt32\mt32emu.h" />
+ <File RelativePath="..\..\sound\softsynth\mt32\part.cpp" />
+ <File RelativePath="..\..\sound\softsynth\mt32\part.h" />
+ <File RelativePath="..\..\sound\softsynth\mt32\partial.cpp" />
+ <File RelativePath="..\..\sound\softsynth\mt32\partial.h" />
+ <File RelativePath="..\..\sound\softsynth\mt32\partialManager.cpp" />
+ <File RelativePath="..\..\sound\softsynth\mt32\partialManager.h" />
+ <File RelativePath="..\..\sound\softsynth\mt32\structures.h" />
+ <File RelativePath="..\..\sound\softsynth\mt32\synth.cpp" />
+ <File RelativePath="..\..\sound\softsynth\mt32\synth.h" />
+ <File RelativePath="..\..\sound\softsynth\mt32\tables.cpp" />
+ <File RelativePath="..\..\sound\softsynth\mt32\tables.h" />
</Filter>
- <Filter
- Name="opl"
- >
- <File
- RelativePath="..\..\sound\softsynth\opl\dosbox.cpp"
- >
- </File>
- <File
- RelativePath="..\..\sound\softsynth\opl\dosbox.h"
- >
- </File>
- <File
- RelativePath="..\..\sound\softsynth\opl\mame.cpp"
- >
- </File>
- <File
- RelativePath="..\..\sound\softsynth\opl\mame.h"
- >
- </File>
- <File
- RelativePath="..\..\sound\softsynth\opl\opl_impl.h"
- >
- </File>
- <File
- RelativePath="..\..\sound\softsynth\opl\opl_inc.h"
- >
- </File>
+ <Filter Name="opl">
+ <File RelativePath="..\..\sound\softsynth\opl\dosbox.cpp" />
+ <File RelativePath="..\..\sound\softsynth\opl\dosbox.h" />
+ <File RelativePath="..\..\sound\softsynth\opl\mame.cpp" />
+ <File RelativePath="..\..\sound\softsynth\opl\mame.h" />
+ <File RelativePath="..\..\sound\softsynth\opl\opl_impl.h" />
+ <File RelativePath="..\..\sound\softsynth\opl\opl_inc.h" />
</Filter>
</Filter>
- <Filter
- Name="mods"
- >
- <File
- RelativePath="..\..\sound\mods\infogrames.cpp"
- >
- </File>
- <File
- RelativePath="..\..\sound\mods\infogrames.h"
- >
- </File>
- <File
- RelativePath="..\..\sound\mods\module.cpp"
- >
- </File>
- <File
- RelativePath="..\..\sound\mods\module.h"
- >
- </File>
- <File
- RelativePath="..\..\sound\mods\paula.cpp"
- >
- </File>
- <File
- RelativePath="..\..\sound\mods\paula.h"
- >
- </File>
- <File
- RelativePath="..\..\sound\mods\protracker.cpp"
- >
- </File>
- <File
- RelativePath="..\..\sound\mods\protracker.h"
- >
- </File>
- <File
- RelativePath="..\..\sound\mods\rjp1.cpp"
- >
- </File>
- <File
- RelativePath="..\..\sound\mods\rjp1.h"
- >
- </File>
- <File
- RelativePath="..\..\sound\mods\soundfx.cpp"
- >
- </File>
- <File
- RelativePath="..\..\sound\mods\soundfx.h"
- >
- </File>
+ <Filter Name="mods">
+ <File RelativePath="..\..\sound\mods\infogrames.cpp" />
+ <File RelativePath="..\..\sound\mods\infogrames.h" />
+ <File RelativePath="..\..\sound\mods\module.cpp" />
+ <File RelativePath="..\..\sound\mods\module.h" />
+ <File RelativePath="..\..\sound\mods\paula.cpp" />
+ <File RelativePath="..\..\sound\mods\paula.h" />
+ <File RelativePath="..\..\sound\mods\protracker.cpp" />
+ <File RelativePath="..\..\sound\mods\protracker.h" />
+ <File RelativePath="..\..\sound\mods\rjp1.cpp" />
+ <File RelativePath="..\..\sound\mods\rjp1.h" />
+ <File RelativePath="..\..\sound\mods\soundfx.cpp" />
+ <File RelativePath="..\..\sound\mods\soundfx.h" />
</Filter>
</Filter>
- <Filter
- Name="txt"
- >
- <File
- RelativePath="..\..\COPYING"
- >
- </File>
- <File
- RelativePath="..\..\NEWS"
- >
- </File>
- <File
- RelativePath="..\..\README"
- >
- </File>
- <File
- RelativePath="..\..\TODO"
- >
- </File>
+ <Filter Name="txt">
+ <File RelativePath="..\..\COPYING" />
+ <File RelativePath="..\..\NEWS" />
+ <File RelativePath="..\..\README" />
+ <File RelativePath="..\..\TODO" />
</Filter>
- <Filter
- Name="rsc"
- >
- <File
- RelativePath="..\..\icons\scummvm.ico"
- >
- </File>
- <File
- RelativePath="..\..\dists\scummvm.rc"
- >
- </File>
+ <Filter Name="rsc">
+ <File RelativePath="..\..\icons\scummvm.ico" />
+ <File RelativePath="..\..\dists\scummvm.rc" />
</Filter>
- <Filter
- Name="backends"
- >
- <File
- RelativePath="..\..\backends\base-backend.cpp"
- >
- </File>
- <File
- RelativePath="..\..\backends\base-backend.h"
- >
- </File>
- <Filter
- Name="sdl"
- >
- <File
- RelativePath="..\..\backends\platform\sdl\events.cpp"
- >
- </File>
- <File
- RelativePath="..\..\backends\platform\sdl\graphics.cpp"
- >
- </File>
- <File
- RelativePath="..\..\backends\platform\sdl\hardwarekeys.cpp"
- >
- </File>
+ <Filter Name="backends">
+ <File RelativePath="..\..\backends\base-backend.cpp" />
+ <File RelativePath="..\..\backends\base-backend.h" />
+ <Filter Name="sdl">
+ <File RelativePath="..\..\backends\platform\sdl\events.cpp" />
+ <File RelativePath="..\..\backends\platform\sdl\graphics.cpp" />
+ <File RelativePath="..\..\backends\platform\sdl\hardwarekeys.cpp" />
<File
RelativePath="..\..\backends\platform\sdl\main.cpp"
>
@@ -891,558 +236,156 @@
/>
</FileConfiguration>
</File>
- <File
- RelativePath="..\..\backends\platform\sdl\sdl.cpp"
- >
- </File>
- <File
- RelativePath="..\..\backends\platform\sdl\sdl.h"
- >
- </File>
+ <File RelativePath="..\..\backends\platform\sdl\sdl.cpp" />
+ <File RelativePath="..\..\backends\platform\sdl\sdl.h" />
</Filter>
- <Filter
- Name="fs"
- >
- <File
- RelativePath="..\..\backends\fs\abstract-fs.cpp"
- >
- </File>
- <File
- RelativePath="..\..\backends\fs\abstract-fs.h"
- >
- </File>
- <File
- RelativePath="..\..\backends\fs\fs-factory.h"
- >
- </File>
- <File
- RelativePath="..\..\backends\fs\stdiostream.cpp"
- >
- </File>
- <File
- RelativePath="..\..\backends\fs\stdiostream.h"
- >
- </File>
- <Filter
- Name="windows"
- >
- <File
- RelativePath="..\..\backends\fs\windows\windows-fs-factory.cpp"
- >
- </File>
- <File
- RelativePath="..\..\backends\fs\windows\windows-fs-factory.h"
- >
- </File>
+ <Filter Name="fs">
+ <File RelativePath="..\..\backends\fs\abstract-fs.cpp" />
+ <File RelativePath="..\..\backends\fs\abstract-fs.h" />
+ <File RelativePath="..\..\backends\fs\fs-factory.h" />
+ <File RelativePath="..\..\backends\fs\stdiostream.cpp" />
+ <File RelativePath="..\..\backends\fs\stdiostream.h" />
+ <Filter Name="windows">
+ <File RelativePath="..\..\backends\fs\windows\windows-fs-factory.cpp" />
+ <File RelativePath="..\..\backends\fs\windows\windows-fs-factory.h" />
</Filter>
</Filter>
- <Filter
- Name="midi"
- >
- <File
- RelativePath="..\..\backends\midi\windows.cpp"
- >
- </File>
+ <Filter Name="midi">
+ <File RelativePath="..\..\backends\midi\windows.cpp" />
</Filter>
- <Filter
- Name="timer"
- >
- <File
- RelativePath="..\..\backends\timer\default\default-timer.cpp"
- >
- </File>
- <File
- RelativePath="..\..\backends\timer\default\default-timer.h"
- >
- </File>
+ <Filter Name="timer">
+ <File RelativePath="..\..\backends\timer\default\default-timer.cpp" />
+ <File RelativePath="..\..\backends\timer\default\default-timer.h" />
</Filter>
- <Filter
- Name="saves"
- >
- <File
- RelativePath="..\..\backends\saves\default\default-saves.cpp"
- >
- </File>
- <File
- RelativePath="..\..\backends\saves\default\default-saves.h"
- >
- </File>
- <File
- RelativePath="..\..\backends\saves\savefile.cpp"
- >
- </File>
+ <Filter Name="saves">
+ <File RelativePath="..\..\backends\saves\default\default-saves.cpp" />
+ <File RelativePath="..\..\backends\saves\default\default-saves.h" />
+ <File RelativePath="..\..\backends\saves\savefile.cpp" />
</Filter>
- <Filter
- Name="events"
- >
- <Filter
- Name="default"
- >
- <File
- RelativePath="..\..\backends\events\default\default-events.cpp"
- >
- </File>
- <File
- RelativePath="..\..\backends\events\default\default-events.h"
- >
- </File>
+ <Filter Name="events">
+ <Filter Name="default">
+ <File RelativePath="..\..\backends\events\default\default-events.cpp" />
+ <File RelativePath="..\..\backends\events\default\default-events.h" />
</Filter>
</Filter>
- <Filter
- Name="keymapper"
- >
- <File
- RelativePath="..\..\backends\keymapper\action.cpp"
- >
- </File>
- <File
- RelativePath="..\..\backends\keymapper\action.h"
- >
- </File>
- <File
- RelativePath="..\..\backends\keymapper\hardware-key.h"
- >
- </File>
- <File
- RelativePath="..\..\backends\keymapper\keymap.cpp"
- >
- </File>
- <File
- RelativePath="..\..\backends\keymapper\keymap.h"
- >
- </File>
- <File
- RelativePath="..\..\backends\keymapper\keymapper.cpp"
- >
- </File>
- <File
- RelativePath="..\..\backends\keymapper\keymapper.h"
- >
- </File>
- <File
- RelativePath="..\..\backends\keymapper\remap-dialog.cpp"
- >
- </File>
- <File
- RelativePath="..\..\backends\keymapper\remap-dialog.h"
- >
- </File>
- <File
- RelativePath="..\..\backends\keymapper\types.h"
- >
- </File>
+ <Filter Name="keymapper">
+ <File RelativePath="..\..\backends\keymapper\action.cpp" />
+ <File RelativePath="..\..\backends\keymapper\action.h" />
+ <File RelativePath="..\..\backends\keymapper\hardware-key.h" />
+ <File RelativePath="..\..\backends\keymapper\keymap.cpp" />
+ <File RelativePath="..\..\backends\keymapper\keymap.h" />
+ <File RelativePath="..\..\backends\keymapper\keymapper.cpp" />
+ <File RelativePath="..\..\backends\keymapper\keymapper.h" />
+ <File RelativePath="..\..\backends\keymapper\remap-dialog.cpp" />
+ <File RelativePath="..\..\backends\keymapper\remap-dialog.h" />
+ <File RelativePath="..\..\backends\keymapper\types.h" />
</Filter>
- <Filter
- Name="vkeybd"
- >
- <File
- RelativePath="..\..\backends\vkeybd\image-map.cpp"
- >
- </File>
- <File
- RelativePath="..\..\backends\vkeybd\image-map.h"
- >
- </File>
- <File
- RelativePath="..\..\backends\vkeybd\keycode-descriptions.h"
- >
- </File>
- <File
- RelativePath="..\..\backends\vkeybd\polygon.cpp"
- >
- </File>
- <File
- RelativePath="..\..\backends\vkeybd\polygon.h"
- >
- </File>
- <File
- RelativePath="..\..\backends\vkeybd\virtual-keyboard-gui.cpp"
- >
- </File>
- <File
- RelativePath="..\..\backends\vkeybd\virtual-keyboard-gui.h"
- >
- </File>
- <File
- RelativePath="..\..\backends\vkeybd\virtual-keyboard-parser.cpp"
- >
- </File>
- <File
- RelativePath="..\..\backends\vkeybd\virtual-keyboard-parser.h"
- >
- </File>
- <File
- RelativePath="..\..\backends\vkeybd\virtual-keyboard.cpp"
- >
- </File>
- <File
- RelativePath="..\..\backends\vkeybd\virtual-keyboard.h"
- >
- </File>
+ <Filter Name="vkeybd">
+ <File RelativePath="..\..\backends\vkeybd\image-map.cpp" />
+ <File RelativePath="..\..\backends\vkeybd\image-map.h" />
+ <File RelativePath="..\..\backends\vkeybd\keycode-descriptions.h" />
+ <File RelativePath="..\..\backends\vkeybd\polygon.cpp" />
+ <File RelativePath="..\..\backends\vkeybd\polygon.h" />
+ <File RelativePath="..\..\backends\vkeybd\virtual-keyboard-gui.cpp" />
+ <File RelativePath="..\..\backends\vkeybd\virtual-keyboard-gui.h" />
+ <File RelativePath="..\..\backends\vkeybd\virtual-keyboard-parser.cpp" />
+ <File RelativePath="..\..\backends\vkeybd\virtual-keyboard-parser.h" />
+ <File RelativePath="..\..\backends\vkeybd\virtual-keyboard.cpp" />
+ <File RelativePath="..\..\backends\vkeybd\virtual-keyboard.h" />
</Filter>
</Filter>
- <Filter
- Name="gui"
- >
- <File
- RelativePath="..\..\gui\about.cpp"
- >
- </File>
- <File
- RelativePath="..\..\gui\about.h"
- >
- </File>
- <File
- RelativePath="..\..\gui\browser.cpp"
- >
- </File>
- <File
- RelativePath="..\..\gui\browser.h"
- >
- </File>
- <File
- RelativePath="..\..\gui\chooser.cpp"
- >
- </File>
- <File
- RelativePath="..\..\gui\chooser.h"
- >
- </File>
- <File
- RelativePath="..\..\gui\console.cpp"
- >
- </File>
- <File
- RelativePath="..\..\gui\console.h"
- >
- </File>
- <File
- RelativePath="..\..\gui\credits.h"
- >
- </File>
- <File
- RelativePath="..\..\gui\debugger.cpp"
- >
- </File>
- <File
- RelativePath="..\..\gui\debugger.h"
- >
- </File>
- <File
- RelativePath="..\..\gui\dialog.cpp"
- >
- </File>
- <File
- RelativePath="..\..\gui\dialog.h"
- >
- </File>
- <File
- RelativePath="..\..\gui\editable.cpp"
- >
- </File>
- <File
- RelativePath="..\..\gui\editable.h"
- >
- </File>
- <File
- RelativePath="..\..\gui\EditTextWidget.cpp"
- >
- </File>
- <File
- RelativePath="..\..\gui\EditTextWidget.h"
- >
- </File>
- <File
- RelativePath="..\..\gui\GuiManager.cpp"
- >
- </File>
- <File
- RelativePath="..\..\gui\GuiManager.h"
- >
- </File>
- <File
- RelativePath="..\..\gui\Key.cpp"
- >
- </File>
- <File
- RelativePath="..\..\gui\Key.h"
- >
- </File>
- <File
- RelativePath="..\..\gui\launcher.cpp"
- >
- </File>
- <File
- RelativePath="..\..\gui\launcher.h"
- >
- </File>
- <File
- RelativePath="..\..\gui\ListWidget.cpp"
- >
- </File>
- <File
- RelativePath="..\..\gui\ListWidget.h"
- >
- </File>
- <File
- RelativePath="..\..\gui\massadd.cpp"
- >
- </File>
- <File
- RelativePath="..\..\gui\massadd.h"
- >
- </File>
- <File
- RelativePath="..\..\gui\message.cpp"
- >
- </File>
- <File
- RelativePath="..\..\gui\message.h"
- >
- </File>
- <File
- RelativePath="..\..\gui\object.cpp"
- >
- </File>
- <File
- RelativePath="..\..\gui\object.h"
- >
- </File>
- <File
- RelativePath="..\..\gui\options.cpp"
- >
- </File>
- <File
- RelativePath="..\..\gui\options.h"
- >
- </File>
- <File
- RelativePath="..\..\gui\PopUpWidget.cpp"
- >
- </File>
- <File
- RelativePath="..\..\gui\PopUpWidget.h"
- >
- </File>
- <File
- RelativePath="..\..\gui\saveload.cpp"
- >
- </File>
- <File
- RelativePath="..\..\gui\saveload.h"
- >
- </File>
- <File
- RelativePath="..\..\gui\ScrollBarWidget.cpp"
- >
- </File>
- <File
- RelativePath="..\..\gui\ScrollBarWidget.h"
- >
- </File>
- <File
- RelativePath="..\..\gui\TabWidget.cpp"
- >
- </File>
- <File
- RelativePath="..\..\gui\TabWidget.h"
- >
- </File>
- <File
- RelativePath="..\..\gui\themebrowser.cpp"
- >
- </File>
- <File
- RelativePath="..\..\gui\themebrowser.h"
- >
- </File>
- <File
- RelativePath="..\..\gui\ThemeEngine.cpp"
- >
- </File>
- <File
- RelativePath="..\..\gui\ThemeEngine.h"
- >
- </File>
- <File
- RelativePath="..\..\gui\ThemeEval.cpp"
- >
- </File>
- <File
- RelativePath="..\..\gui\ThemeLayout.cpp"
- >
- </File>
- <File
- RelativePath="..\..\gui\ThemeLayout.h"
- >
- </File>
- <File
- RelativePath="..\..\gui\ThemeParser.cpp"
- >
- </File>
- <File
- RelativePath="..\..\gui\ThemeParser.h"
- >
- </File>
- <File
- RelativePath="..\..\gui\widget.cpp"
- >
- </File>
- <File
- RelativePath="..\..\gui\widget.h"
- >
- </File>
+ <Filter Name="gui">
+ <File RelativePath="..\..\gui\about.cpp" />
+ <File RelativePath="..\..\gui\about.h" />
+ <File RelativePath="..\..\gui\browser.cpp" />
+ <File RelativePath="..\..\gui\browser.h" />
+ <File RelativePath="..\..\gui\chooser.cpp" />
+ <File RelativePath="..\..\gui\chooser.h" />
+ <File RelativePath="..\..\gui\console.cpp" />
+ <File RelativePath="..\..\gui\console.h" />
+ <File RelativePath="..\..\gui\credits.h" />
+ <File RelativePath="..\..\gui\debugger.cpp" />
+ <File RelativePath="..\..\gui\debugger.h" />
+ <File RelativePath="..\..\gui\dialog.cpp" />
+ <File RelativePath="..\..\gui\dialog.h" />
+ <File RelativePath="..\..\gui\editable.cpp" />
+ <File RelativePath="..\..\gui\editable.h" />
+ <File RelativePath="..\..\gui\EditTextWidget.cpp" />
+ <File RelativePath="..\..\gui\EditTextWidget.h" />
+ <File RelativePath="..\..\gui\GuiManager.cpp" />
+ <File RelativePath="..\..\gui\GuiManager.h" />
+ <File RelativePath="..\..\gui\Key.cpp" />
+ <File RelativePath="..\..\gui\Key.h" />
+ <File RelativePath="..\..\gui\launcher.cpp" />
+ <File RelativePath="..\..\gui\launcher.h" />
+ <File RelativePath="..\..\gui\ListWidget.cpp" />
+ <File RelativePath="..\..\gui\ListWidget.h" />
+ <File RelativePath="..\..\gui\massadd.cpp" />
+ <File RelativePath="..\..\gui\massadd.h" />
+ <File RelativePath="..\..\gui\message.cpp" />
+ <File RelativePath="..\..\gui\message.h" />
+ <File RelativePath="..\..\gui\object.cpp" />
+ <File RelativePath="..\..\gui\object.h" />
+ <File RelativePath="..\..\gui\options.cpp" />
+ <File RelativePath="..\..\gui\options.h" />
+ <File RelativePath="..\..\gui\PopUpWidget.cpp" />
+ <File RelativePath="..\..\gui\PopUpWidget.h" />
+ <File RelativePath="..\..\gui\saveload.cpp" />
+ <File RelativePath="..\..\gui\saveload.h" />
+ <File RelativePath="..\..\gui\ScrollBarWidget.cpp" />
+ <File RelativePath="..\..\gui\ScrollBarWidget.h" />
+ <File RelativePath="..\..\gui\TabWidget.cpp" />
+ <File RelativePath="..\..\gui\TabWidget.h" />
+ <File RelativePath="..\..\gui\themebrowser.cpp" />
+ <File RelativePath="..\..\gui\themebrowser.h" />
+ <File RelativePath="..\..\gui\ThemeEngine.cpp" />
+ <File RelativePath="..\..\gui\ThemeEngine.h" />
+ <File RelativePath="..\..\gui\ThemeEval.cpp" />
+ <File RelativePath="..\..\gui\ThemeLayout.cpp" />
+ <File RelativePath="..\..\gui\ThemeLayout.h" />
+ <File RelativePath="..\..\gui\ThemeParser.cpp" />
+ <File RelativePath="..\..\gui\ThemeParser.h" />
+ <File RelativePath="..\..\gui\widget.cpp" />
+ <File RelativePath="..\..\gui\widget.h" />
</Filter>
- <Filter
- Name="graphics"
- >
- <File
- RelativePath="..\..\graphics\colormasks.h"
- >
- </File>
- <File
- RelativePath="..\..\graphics\conversion.cpp"
- >
- </File>
- <File
- RelativePath="..\..\graphics\conversion.h"
- >
- </File>
- <File
- RelativePath="..\..\graphics\cursorman.cpp"
- >
- </File>
- <File
- RelativePath="..\..\graphics\cursorman.h"
- >
- </File>
- <File
- RelativePath="..\..\graphics\dither.cpp"
- >
- </File>
- <File
- RelativePath="..\..\graphics\dither.h"
- >
- </File>
- <File
- RelativePath="..\..\graphics\font.cpp"
- >
- </File>
- <File
- RelativePath="..\..\graphics\font.h"
- >
- </File>
- <File
- RelativePath="..\..\graphics\fontman.cpp"
- >
- </File>
- <File
- RelativePath="..\..\graphics\fontman.h"
- >
- </File>
- <File
- RelativePath="..\..\graphics\iff.cpp"
- >
- </File>
- <File
- RelativePath="..\..\graphics\iff.h"
- >
- </File>
- <File
- RelativePath="..\..\graphics\imagedec.cpp"
- >
- </File>
- <File
- RelativePath="..\..\graphics\imagedec.h"
- >
- </File>
- <File
- RelativePath="..\..\graphics\jpeg.cpp"
- >
- </File>
- <File
- RelativePath="..\..\graphics\jpeg.h"
- >
- </File>
- <File
- RelativePath="..\..\graphics\pixelformat.h"
- >
- </File>
- <File
- RelativePath="..\..\graphics\primitives.cpp"
- >
- </File>
- <File
- RelativePath="..\..\graphics\primitives.h"
- >
- </File>
- <File
- RelativePath="..\..\graphics\scaler.cpp"
- >
- </File>
- <File
- RelativePath="..\..\graphics\scaler.h"
- >
- </File>
- <File
- RelativePath="..\..\graphics\sjis.cpp"
- >
- </File>
- <File
- RelativePath="..\..\graphics\sjis.h"
- >
- </File>
- <File
- RelativePath="..\..\graphics\surface.cpp"
- >
- </File>
- <File
- RelativePath="..\..\graphics\surface.h"
- >
- </File>
- <File
- RelativePath="..\..\graphics\thumbnail.cpp"
- >
- </File>
- <File
- RelativePath="..\..\graphics\thumbnail.h"
- >
- </File>
- <File
- RelativePath="..\..\graphics\VectorRenderer.cpp"
- >
- </File>
- <File
- RelativePath="..\..\graphics\VectorRenderer.h"
- >
- </File>
- <File
- RelativePath="..\..\graphics\VectorRendererSpec.cpp"
- >
- </File>
- <File
- RelativePath="..\..\graphics\VectorRendererSpec.h"
- >
- </File>
- <Filter
- Name="scaler"
- >
- <File
- RelativePath="..\..\graphics\scaler\2xsai.cpp"
- >
- </File>
- <File
- RelativePath="..\..\graphics\scaler\aspect.cpp"
- >
- </File>
- <File
- RelativePath="..\..\graphics\scaler\hq2x.cpp"
- >
- </File>
- <File
- RelativePath="..\..\graphics\scaler\hq2x.h"
- >
- </File>
+ <Filter Name="graphics">
+ <File RelativePath="..\..\graphics\colormasks.h" />
+ <File RelativePath="..\..\graphics\conversion.cpp" />
+ <File RelativePath="..\..\graphics\conversion.h" />
+ <File RelativePath="..\..\graphics\cursorman.cpp" />
+ <File RelativePath="..\..\graphics\cursorman.h" />
+ <File RelativePath="..\..\graphics\dither.cpp" />
+ <File RelativePath="..\..\graphics\dither.h" />
+ <File RelativePath="..\..\graphics\font.cpp" />
+ <File RelativePath="..\..\graphics\font.h" />
+ <File RelativePath="..\..\graphics\fontman.cpp" />
+ <File RelativePath="..\..\graphics\fontman.h" />
+ <File RelativePath="..\..\graphics\iff.cpp" />
+ <File RelativePath="..\..\graphics\iff.h" />
+ <File RelativePath="..\..\graphics\jpeg.cpp" />
+ <File RelativePath="..\..\graphics\jpeg.h" />
+ <File RelativePath="..\..\graphics\imagedec.cpp" />
+ <File RelativePath="..\..\graphics\imagedec.h" />
+ <File RelativePath="..\..\graphics\pixelformat.h" />
+ <File RelativePath="..\..\graphics\primitives.cpp" />
+ <File RelativePath="..\..\graphics\primitives.h" />
+ <File RelativePath="..\..\graphics\scaler.cpp" />
+ <File RelativePath="..\..\graphics\scaler.h" />
+ <File RelativePath="..\..\graphics\sjis.cpp" />
+ <File RelativePath="..\..\graphics\sjis.h" />
+ <File RelativePath="..\..\graphics\surface.cpp" />
+ <File RelativePath="..\..\graphics\surface.h" />
+ <File RelativePath="..\..\graphics\thumbnail.cpp" />
+ <File RelativePath="..\..\graphics\thumbnail.h" />
+ <File RelativePath="..\..\graphics\VectorRenderer.cpp" />
+ <File RelativePath="..\..\graphics\VectorRenderer.h" />
+ <File RelativePath="..\..\graphics\VectorRendererSpec.cpp" />
+ <File RelativePath="..\..\graphics\VectorRendererSpec.h" />
+ <Filter Name="scaler">
+ <File RelativePath="..\..\graphics\scaler\2xsai.cpp" />
+ <File RelativePath="..\..\graphics\scaler\aspect.cpp" />
+ <File RelativePath="..\..\graphics\scaler\hq2x.cpp" />
+ <File RelativePath="..\..\graphics\scaler\hq2x.h" />
<File
RelativePath="..\..\graphics\scaler\hq2x_i386.asm"
>
@@ -1465,14 +408,8 @@
/>
</FileConfiguration>
</File>
- <File
- RelativePath="..\..\graphics\scaler\hq3x.cpp"
- >
- </File>
- <File
- RelativePath="..\..\graphics\scaler\hq3x.h"
- >
- </File>
+ <File RelativePath="..\..\graphics\scaler\hq3x.cpp" />
+ <File RelativePath="..\..\graphics\scaler\hq3x.h" />
<File
RelativePath="..\..\graphics\scaler\hq3x_i386.asm"
>
@@ -1495,169 +432,51 @@
/>
</FileConfiguration>
</File>
- <File
- RelativePath="..\..\graphics\scaler\intern.h"
- >
- </File>
- <File
- RelativePath="..\..\graphics\scaler\scale2x.cpp"
- >
- </File>
- <File
- RelativePath="..\..\graphics\scaler\scale2x.h"
- >
- </File>
- <File
- RelativePath="..\..\graphics\scaler\scale3x.cpp"
- >
- </File>
- <File
- RelativePath="..\..\graphics\scaler\scale3x.h"
- >
- </File>
- <File
- RelativePath="..\..\graphics\scaler\scalebit.cpp"
- >
- </File>
- <File
- RelativePath="..\..\graphics\scaler\scalebit.h"
- >
- </File>
- <File
- RelativePath="..\..\graphics\scaler\thumbnail_intern.cpp"
- >
- </File>
+ <File RelativePath="..\..\graphics\scaler\intern.h" />
+ <File RelativePath="..\..\graphics\scaler\scale2x.cpp" />
+ <File RelativePath="..\..\graphics\scaler\scale2x.h" />
+ <File RelativePath="..\..\graphics\scaler\scale3x.cpp" />
+ <File RelativePath="..\..\graphics\scaler\scale3x.h" />
+ <File RelativePath="..\..\graphics\scaler\scalebit.cpp" />
+ <File RelativePath="..\..\graphics\scaler\scalebit.h" />
+ <File RelativePath="..\..\graphics\scaler\thumbnail_intern.cpp" />
</Filter>
- <Filter
- Name="fonts"
- >
- <File
- RelativePath="..\..\graphics\fonts\consolefont.cpp"
- >
- </File>
- <File
- RelativePath="..\..\graphics\fonts\newfont.cpp"
- >
- </File>
- <File
- RelativePath="..\..\graphics\fonts\newfont_big.cpp"
- >
- </File>
- <File
- RelativePath="..\..\graphics\fonts\scummfont.cpp"
- >
- </File>
+ <Filter Name="fonts">
+ <File RelativePath="..\..\graphics\fonts\consolefont.cpp" />
+ <File RelativePath="..\..\graphics\fonts\newfont.cpp" />
+ <File RelativePath="..\..\graphics\fonts\newfont_big.cpp" />
+ <File RelativePath="..\..\graphics\fonts\scummfont.cpp" />
</Filter>
- <Filter
- Name="video"
- >
- <File
- RelativePath="..\..\graphics\video\dxa_decoder.cpp"
- >
- </File>
- <File
- RelativePath="..\..\graphics\video\dxa_decoder.h"
- >
- </File>
- <File
- RelativePath="..\..\graphics\video\flic_decoder.cpp"
- >
- </File>
- <File
- RelativePath="..\..\graphics\video\flic_decoder.h"
- >
- </File>
- <File
- RelativePath="..\..\graphics\video\mpeg_player.cpp"
- >
- </File>
- <File
- RelativePath="..\..\graphics\video\mpeg_player.h"
- >
- </File>
- <File
- RelativePath="..\..\graphics\video\smk_decoder.cpp"
- >
- </File>
- <File
- RelativePath="..\..\graphics\video\smk_decoder.h"
- >
- </File>
- <File
- RelativePath="..\..\graphics\video\video_player.cpp"
- >
- </File>
- <File
- RelativePath="..\..\graphics\video\video_player.h"
- >
- </File>
- <Filter
- Name="coktelvideo"
- >
- <File
- RelativePath="..\..\graphics\video\coktelvideo\coktelvideo.cpp"
- >
- </File>
- <File
- RelativePath="..\..\graphics\video\coktelvideo\coktelvideo.h"
- >
- </File>
- <File
- RelativePath="..\..\graphics\video\coktelvideo\indeo3.cpp"
- >
- </File>
- <File
- RelativePath="..\..\graphics\video\coktelvideo\indeo3.h"
- >
- </File>
- <File
- RelativePath="..\..\graphics\video\coktelvideo\indeo3data.h"
- >
- </File>
+ <Filter Name="video">
+ <File RelativePath="..\..\graphics\video\dxa_decoder.cpp" />
+ <File RelativePath="..\..\graphics\video\dxa_decoder.h" />
+ <File RelativePath="..\..\graphics\video\flic_decoder.cpp" />
+ <File RelativePath="..\..\graphics\video\flic_decoder.h" />
+ <File RelativePath="..\..\graphics\video\mpeg_player.cpp" />
+ <File RelativePath="..\..\graphics\video\mpeg_player.h" />
+ <File RelativePath="..\..\graphics\video\smk_decoder.cpp" />
+ <File RelativePath="..\..\graphics\video\smk_decoder.h" />
+ <File RelativePath="..\..\graphics\video\video_player.cpp" />
+ <File RelativePath="..\..\graphics\video\video_player.h" />
+ <Filter Name="coktelvideo">
+ <File RelativePath="..\..\graphics\video\coktelvideo\coktelvideo.cpp" />
+ <File RelativePath="..\..\graphics\video\coktelvideo\coktelvideo.h" />
+ <File RelativePath="..\..\graphics\video\coktelvideo\indeo3.cpp" />
+ <File RelativePath="..\..\graphics\video\coktelvideo\indeo3.h" />
+ <File RelativePath="..\..\graphics\video\coktelvideo\indeo3data.h" />
</Filter>
</Filter>
</Filter>
- <Filter
- Name="engines"
- >
- <File
- RelativePath="..\..\engines\advancedDetector.cpp"
- >
- </File>
- <File
- RelativePath="..\..\engines\advancedDetector.h"
- >
- </File>
- <File
- RelativePath="..\..\engines\dialogs.cpp"
- >
- </File>
- <File
- RelativePath="..\..\engines\dialogs.h"
- >
- </File>
- <File
- RelativePath="..\..\engines\engine.cpp"
- >
- </File>
- <File
- RelativePath="..\..\engines\engine.h"
- >
- </File>
- <File
- RelativePath="..\..\engines\game.cpp"
- >
- </File>
- <File
- RelativePath="..\..\engines\game.h"
- >
- </File>
- <File
- RelativePath="..\..\engines\metaengine.h"
- >
- </File>
+ <Filter Name="engines">
+ <File RelativePath="..\..\engines\advancedDetector.cpp" />
+ <File RelativePath="..\..\engines\advancedDetector.h" />
+ <File RelativePath="..\..\engines\dialogs.cpp" />
+ <File RelativePath="..\..\engines\dialogs.h" />
+ <File RelativePath="..\..\engines\engine.cpp" />
+ <File RelativePath="..\..\engines\engine.h" />
+ <File RelativePath="..\..\engines\game.cpp" />
+ <File RelativePath="..\..\engines\game.h" />
+ <File RelativePath="..\..\engines\metaengine.h" />
</Filter>
</Files>
- <Globals>
- </Globals>
</VisualStudioProject>
diff --git a/dists/msvc9/scummvm.vcproj b/dists/msvc9/scummvm.vcproj
index 9282f7a096..51c532a195 100644
--- a/dists/msvc9/scummvm.vcproj
+++ b/dists/msvc9/scummvm.vcproj
@@ -1296,14 +1296,6 @@
>
</File>
<File
- RelativePath="..\..\graphics\conversion.cpp"
- >
- </File>
- <File
- RelativePath="..\..\graphics\conversion.h"
- >
- </File>
- <File
RelativePath="..\..\graphics\cursorman.cpp"
>
</File>
@@ -1352,23 +1344,11 @@
>
</File>
<File
- RelativePath="..\..\graphics\font.cpp"
- >
- </File>
- <File
- RelativePath="..\..\graphics\font.h"
- >
- </File>
- <File
- RelativePath="..\..\graphics\jpeg.h"
- >
- </File>
- <File
- RelativePath="..\..\graphics\jpeg.cpp"
+ RelativePath="..\..\graphics\pixelformat.h"
>
</File>
<File
- RelativePath="..\..\graphics\pixelformat.h"
+ RelativePath="..\..\graphics\primitives.cpp"
>
</File>
<File
diff --git a/dists/wii/meta.xml.in b/dists/wii/meta.xml.in
new file mode 100644
index 0000000000..7df9f6d350
--- /dev/null
+++ b/dists/wii/meta.xml.in
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<app version="1">
+ <name>ScummVM</name>
+ <coder>The ScummVM Team</coder>
+ <version>@VERSION@@REVISION@</version>
+ <release_date>@TIMESTAMP@</release_date>
+ <short_description>Point &amp; Click Adventures</short_description>
+ <long_description>ScummVM is a program which allows you to run certain classic graphical point-and-click adventure games, provided you already have their data files. The clever part about this: ScummVM just replaces the executables shipped with the games, allowing you to play them on systems for which they were never designed!
+
+Some of the adventures ScummVM supports include Adventure Soft's Simon the Sorcerer 1 and 2; Revolution's Beneath A Steel Sky, Broken Sword 1 and Broken Sword 2; Flight of the Amazon Queen; Wyrmkeep's Inherit the Earth; Coktel Vision's Gobliiins; Westwood Studios' The Legend of Kyrandia and games based on LucasArts' SCUMM (Script Creation Utility for Maniac Mansion) system such as Monkey Island, Day of the Tentacle, Sam and Max and more.</long_description>
+</app>
+
diff --git a/engines/gob/inter.h b/engines/gob/inter.h
index 057f52b360..43a4941402 100644
--- a/engines/gob/inter.h
+++ b/engines/gob/inter.h
@@ -557,7 +557,9 @@ protected:
virtual void setupOpcodesFunc();
virtual void setupOpcodesGob();
+ bool oPlaytoons_F_1B(OpFuncParams &params);
bool oPlaytoons_checkData(OpFuncParams &params);
+ bool oPlaytoons_readData(OpFuncParams &params);
void oPlaytoons_CD_20_23();
void oPlaytoons_CD_25();
void oPlaytoons_openItk();
diff --git a/engines/gob/inter_playtoons.cpp b/engines/gob/inter_playtoons.cpp
index e224f29734..d7cb6b79c2 100644
--- a/engines/gob/inter_playtoons.cpp
+++ b/engines/gob/inter_playtoons.cpp
@@ -25,6 +25,8 @@
#include "common/endian.h"
+#include "gui/message.h"
+
#include "gob/gob.h"
#include "gob/inter.h"
#include "gob/helper.h"
@@ -77,12 +79,33 @@ void Inter_Playtoons::setupOpcodesDraw() {
void Inter_Playtoons::setupOpcodesFunc() {
Inter_v6::setupOpcodesFunc();
+ OPCODEFUNC(0x1B, oPlaytoons_F_1B);
OPCODEFUNC(0x3F, oPlaytoons_checkData);
+ OPCODEFUNC(0x4D, oPlaytoons_readData);
}
void Inter_Playtoons::setupOpcodesGob() {
}
+bool Inter_Playtoons::oPlaytoons_F_1B(OpFuncParams &params) {
+ int16 var1;
+ int16 var2;
+ int16 var3;
+ int16 var4;
+
+ var1 = _vm->_game->_script->readValExpr();
+ var2 = _vm->_game->_script->readValExpr();
+
+ _vm->_game->_script->evalExpr(0);
+
+ var3 = _vm->_game->_script->readValExpr();
+ var4 = _vm->_game->_script->readValExpr();
+
+ warning("oPlaytoons_F_1B not handled");
+
+ return false;
+}
+
bool Inter_Playtoons::oPlaytoons_checkData(OpFuncParams &params) {
int16 handle;
int16 varOff;
@@ -101,18 +124,16 @@ bool Inter_Playtoons::oPlaytoons_checkData(OpFuncParams &params) {
// In this case, "@:\" is replaced by the CD drive letter.
// As the files are copied on the HDD, those characters are skipped.
if (strncmp(file, "@:\\", 3) == 0) {
- debugC(2, kDebugFileIO, "File check: \"%s\" instead of \"%s\"", file + 3, file);
+ debugC(2, kDebugFileIO, "oPlaytoons_checkData: \"%s\" instead of \"%s\"", file + 3, file);
file += 3;
}
mode = _vm->_saveLoad->getSaveMode(file);
if (mode == SaveLoad::kSaveModeNone) {
-
if (_vm->_dataIO->existData(file))
size = _vm->_dataIO->getDataSize(file);
else
warning("File \"%s\" not found", file);
-
} else if (mode == SaveLoad::kSaveModeSave)
size = _vm->_saveLoad->getSize(file);
else if (mode == SaveLoad::kSaveModeExists)
@@ -130,6 +151,97 @@ bool Inter_Playtoons::oPlaytoons_checkData(OpFuncParams &params) {
return false;
}
+bool Inter_Playtoons::oPlaytoons_readData(OpFuncParams &params) {
+ int32 retSize;
+ int32 size;
+ int32 offset;
+ int16 dataVar;
+ int16 handle;
+ byte *buf;
+ SaveLoad::SaveMode mode;
+
+ _vm->_game->_script->evalExpr(0);
+ dataVar = _vm->_game->_script->readVarIndex();
+ size = _vm->_game->_script->readValExpr();
+ _vm->_game->_script->evalExpr(0);
+ offset = _vm->_game->_script->getResultInt();
+ retSize = 0;
+
+ char *file = _vm->_game->_script->getResultStr();
+
+ // WORKAROUND: In Playtoons games, some files are read on CD (and only on CD).
+ // In this case, "@:\" is replaced by the CD drive letter.
+ // As the files are copied on the HDD, those characters are skipped.
+ if (strncmp(file, "@:\\", 3) == 0) {
+ debugC(2, kDebugFileIO, "oPlaytoons_readData: \"%s\" instead of \"%s\"", file + 3, file);
+ file += 3;
+ }
+
+ debugC(2, kDebugFileIO, "Read from file \"%s\" (%d, %d bytes at %d)",
+ file, dataVar, size, offset);
+
+ mode = _vm->_saveLoad->getSaveMode(file);
+ if (mode == SaveLoad::kSaveModeSave) {
+
+ WRITE_VAR(1, 1);
+
+ if (!_vm->_saveLoad->load(file, dataVar, size, offset)) {
+ GUI::MessageDialog dialog("Failed to load game state from file.");
+ dialog.runModal();
+ } else
+ WRITE_VAR(1, 0);
+
+ return false;
+
+ } else if (mode == SaveLoad::kSaveModeIgnore)
+ return false;
+
+ if (size < 0) {
+ warning("Attempted to read a raw sprite from file \"%s\"",
+ file);
+ return false ;
+ } else if (size == 0) {
+ dataVar = 0;
+ size = _vm->_game->_script->getVariablesCount() * 4;
+ }
+
+ buf = _variables->getAddressOff8(dataVar);
+
+ if (file[0] == 0) {
+ WRITE_VAR(1, size);
+ return false;
+ }
+
+ WRITE_VAR(1, 1);
+ handle = _vm->_dataIO->openData(file);
+
+ if (handle < 0)
+ return false;
+
+ DataStream *stream = _vm->_dataIO->openAsStream(handle, true);
+
+ _vm->_draw->animateCursor(4);
+ if (offset < 0)
+ stream->seek(offset + 1, SEEK_END);
+ else
+ stream->seek(offset);
+
+ if (((dataVar >> 2) == 59) && (size == 4)) {
+ WRITE_VAR(59, stream->readUint32LE());
+ // The scripts in some versions divide through 256^3 then,
+ // effectively doing a LE->BE conversion
+ if ((_vm->getPlatform() != Common::kPlatformPC) && (VAR(59) < 256))
+ WRITE_VAR(59, SWAP_BYTES_32(VAR(59)));
+ } else
+ retSize = stream->read(buf, size);
+
+ if (retSize == size)
+ WRITE_VAR(1, 0);
+
+ delete stream;
+ return false;
+}
+
void Inter_Playtoons::oPlaytoons_CD_20_23() {
_vm->_game->_script->evalExpr(0);
}
diff --git a/engines/gob/save/saveload.h b/engines/gob/save/saveload.h
index 4779de703c..8a7d493aed 100644
--- a/engines/gob/save/saveload.h
+++ b/engines/gob/save/saveload.h
@@ -77,6 +77,9 @@ public:
static const uint32 kSlotCount = 15;
static const uint32 kSlotNameLength = 40;
+ /** The index. kSlotCount * kSlotNameLength bytes. */
+ static const uint32 kIndexSize = kSlotCount * kSlotNameLength;
+
SaveLoad_v2(GobEngine *vm, const char *targetName);
virtual ~SaveLoad_v2();
@@ -111,8 +114,7 @@ protected:
int getSlotRemainder(int32 offset) const;
};
- /** The index. kSlotCount * kSlotNameLength bytes. */
- byte _index[600];
+ byte _index[kIndexSize];
bool _hasIndex;
File *_slotFile;
@@ -139,6 +141,10 @@ public:
static const uint32 kSlotCount = 30;
static const uint32 kSlotNameLength = 40;
+ static const uint32 kPropsSize = 500;
+ /** Index. kSlotCount * kSlotNameLength bytes. */
+ static const uint32 kIndexSize = kSlotCount * kSlotNameLength;
+
enum ScreenshotType {
kScreenshotTypeGob3, //!< Goblins 3 type screenshot
kScreenshotTypeLost //!< Lost in Time type screenshot
@@ -193,9 +199,8 @@ protected:
bool _firstSize;
/** Global properties. */
- byte _props[500];
- /** Index. kSlotCount * kSlotNameLength bytes. */
- byte _index[1200];
+ byte _props[kPropsSize];
+ byte _index[kIndexSize];
bool _hasIndex;
SaveReader *_reader;
@@ -266,6 +271,10 @@ public:
static const uint32 kSlotCount = 10;
static const uint32 kSlotNameLength = 40;
+ static const uint32 kPropsSize = 500;
+ /** Index. kSlotCount * kSlotNameLength bytes + 800 bytes 0. */
+ static const uint32 kIndexSize = (kSlotCount * kSlotNameLength) + 800;
+
SaveLoad_v4(GobEngine *vm, const char *targetName);
virtual ~SaveLoad_v4();
@@ -311,9 +320,8 @@ protected:
private:
bool _firstSize;
- byte _props[500];
- /** The index. kSlotCount * kSlotNameLength bytes + 800 bytes 0. */
- byte _index[1200];
+ byte _props[kPropsSize];
+ byte _index[kIndexSize];
bool _hasIndex;
File *_slotFile;
@@ -392,6 +400,10 @@ public:
static const uint32 kSlotCount = 60;
static const uint32 kSlotNameLength = 40;
+ static const uint32 kPropsSize = 500;
+ /** Index. kSlotCount * kSlotNameLength bytes. */
+ static const uint32 kIndexSize = kSlotCount * kSlotNameLength;
+
SaveLoad_v6(GobEngine *vm, const char *targetName);
virtual ~SaveLoad_v6();
@@ -426,9 +438,8 @@ protected:
int getSlotRemainder(int32 offset) const;
};
- byte _props[500];
- /** The index. 500 bytes properties + kSlotCount * kSlotNameLength bytes. */
- byte _index[2400];
+ byte _props[kPropsSize];
+ byte _index[kIndexSize];
File *_slotFile;
@@ -454,6 +465,10 @@ public:
static const uint32 kSlotCount = 60;
static const uint32 kSlotNameLength = 40;
+ static const uint32 kPropsSize = 1642;
+ /** Index. kSlotCount * kSlotNameLength bytes. */
+ static const uint32 kIndexSize = kSlotCount * kSlotNameLength;
+
SaveLoad_Playtoons(GobEngine *vm, const char *targetName);
virtual ~SaveLoad_Playtoons();
@@ -488,9 +503,8 @@ protected:
int getSlotRemainder(int32 offset) const;
};
- byte _props[500];
- /** The index. 500 bytes properties + kSlotCount * kSlotNameLength bytes. */
- byte _index[2400];
+ byte _props[kPropsSize];
+ byte _index[kIndexSize];
File *_slotFile;
diff --git a/engines/gob/save/saveload_playtoons.cpp b/engines/gob/save/saveload_playtoons.cpp
index 392c9a94ac..a8fef3cb11 100644
--- a/engines/gob/save/saveload_playtoons.cpp
+++ b/engines/gob/save/saveload_playtoons.cpp
@@ -31,26 +31,8 @@ namespace Gob {
SaveLoad_Playtoons::SaveFile SaveLoad_Playtoons::_saveFiles[] = {
{ "did.inf", kSaveModeSave, 0, 0}, //
- { "dan.itk", kSaveModeNone, 0, 0}, // Playtoons CK initial detection file
- { "disk.001", kSaveModeExists, 0, 0}, // Playtoons 1 identification file
- { "disk.002", kSaveModeExists, 0, 0}, // Playtoons 2 identification file
- { "disk.003", kSaveModeExists, 0, 0}, // Playtoons 3 identification file
- { "disk.004", kSaveModeExists, 0, 0}, // Playtoons 4 identification file
- { "disk.005", kSaveModeExists, 0, 0}, // Playtoons 5 identification file
- { "disk.006", kSaveModeExists, 0, 0}, // Playtoons CK 1 identification file
- { "disk.007", kSaveModeExists, 0, 0}, // Playtoons CK 2 identification file
- { "disk.008", kSaveModeExists, 0, 0}, // Playtoons CK 3 identification file
-/*
- { "titre.001", kSaveModeExists, 0, 0}, // Playtoons 1 titles
- { "titre.002", kSaveModeExists, 0, 0}, // Playtoons 2 titles
- { "titre.003", kSaveModeExists, 0, 0}, // Playtoons 3 titles
- { "titre.004", kSaveModeExists, 0, 0}, // Playtoons 4 titles
- { "titre.005", kSaveModeExists, 0, 0}, // Playtoons 5 titles
- { "titre.006", kSaveModeExists, 0, 0}, // Playtoons CK 1 empty title (???)
- { "titre.007", kSaveModeExists, 0, 0}, // Playtoons CK 2 empty title (???)
- { "titre.008", kSaveModeExists, 0, 0}, // Playtoons CK 3 empty title (???)
- { "mdo.def", kSaveModeExists, 0, 0}, //
-*/
+ { "dan.itk", kSaveModeNone, 0, 0}, // Playtoons CK detection file
+
};
SaveLoad_Playtoons::GameHandler::File::File(GobEngine *vm, const char *base) :
@@ -66,7 +48,7 @@ int SaveLoad_Playtoons::GameHandler::File::getSlot(int32 offset) const {
if (varSize == 0)
return -1;
- return ((offset - 2900) / varSize);
+ return ((offset - (kPropsSize + kIndexSize)) / varSize);
}
int SaveLoad_Playtoons::GameHandler::File::getSlotRemainder(int32 offset) const {
@@ -75,13 +57,13 @@ int SaveLoad_Playtoons::GameHandler::File::getSlotRemainder(int32 offset) const
if (varSize == 0)
return -1;
- return ((offset - 2900) % varSize);
+ return ((offset - (kPropsSize + kIndexSize)) % varSize);
}
SaveLoad_Playtoons::GameHandler::GameHandler(GobEngine *vm, const char *target) : SaveHandler(vm) {
- memset(_props, 0, 500);
- memset(_index, 0, 2400);
+ memset(_props, 0, kPropsSize);
+ memset(_index, 0, kIndexSize);
_slotFile = new File(vm, target);
}
@@ -96,7 +78,7 @@ int32 SaveLoad_Playtoons::GameHandler::getSize() {
if (varSize == 0)
return -1;
- return _slotFile->tallyUpFiles(varSize, 2900);
+ return _slotFile->tallyUpFiles(varSize, kPropsSize + kIndexSize);
}
bool SaveLoad_Playtoons::GameHandler::load(int16 dataVar, int32 size, int32 offset) {
@@ -111,20 +93,20 @@ bool SaveLoad_Playtoons::GameHandler::load(int16 dataVar, int32 size, int32 offs
size = varSize;
}
- if (offset < 500) {
+ if (((uint32) offset) < kPropsSize) {
// Properties
- if ((offset + size) > 500) {
+ if (((uint32) (offset + size)) > kPropsSize) {
warning("Wrong index size (%d, %d)", size, offset);
return false;
}
_vm->_inter->_variables->copyFrom(dataVar, _props + offset, size);
- } else if (offset < 2900) {
+ } else if (((uint32) offset) < kPropsSize + kIndexSize) {
// Save index
- if (size != 2400) {
+ if (((uint32) size) != kIndexSize) {
warning("Wrong index size (%d, %d)", size, offset);
return false;
}
@@ -198,26 +180,26 @@ bool SaveLoad_Playtoons::GameHandler::save(int16 dataVar, int32 size, int32 offs
size = varSize;
}
- if (offset < 500) {
+ if (((uint32) offset) < kPropsSize) {
// Properties
- if ((offset + size) > 500) {
+ if (((uint32) (offset + size)) > kPropsSize) {
warning("Wrong index size (%d, %d)", size, offset);
return false;
}
_vm->_inter->_variables->copyTo(dataVar, _props + offset, size);
- } else if (offset < 2900) {
+ } else if (((uint32) offset) < kPropsSize + kIndexSize) {
// Save index
- if (size != 2400) {
+ if (((uint32) size) != kIndexSize) {
warning("Wrong index size (%d, %d)", size, offset);
return false;
}
// Just copy the index into our buffer
- _vm->_inter->_variables->copyTo(dataVar, _index, 2400);
+ _vm->_inter->_variables->copyTo(dataVar, _index, kIndexSize);
} else {
// Save slot, whole variable block
diff --git a/engines/gob/save/saveload_v2.cpp b/engines/gob/save/saveload_v2.cpp
index da1135df21..ea639b861a 100644
--- a/engines/gob/save/saveload_v2.cpp
+++ b/engines/gob/save/saveload_v2.cpp
@@ -51,7 +51,7 @@ int SaveLoad_v2::GameHandler::File::getSlot(int32 offset) const {
if (varSize == 0)
return -1;
- return ((offset - 600) / varSize);
+ return ((offset - kIndexSize) / varSize);
}
int SaveLoad_v2::GameHandler::File::getSlotRemainder(int32 offset) const {
@@ -60,12 +60,12 @@ int SaveLoad_v2::GameHandler::File::getSlotRemainder(int32 offset) const {
if (varSize == 0)
return -1;
- return ((offset - 600) % varSize);
+ return ((offset - kIndexSize) % varSize);
}
SaveLoad_v2::GameHandler::GameHandler(GobEngine *vm, const char *target) : SaveHandler(vm) {
- memset(_index, 0, 600);
+ memset(_index, 0, kIndexSize);
_hasIndex = false;
_slotFile = new File(vm, target);
@@ -81,7 +81,7 @@ int32 SaveLoad_v2::GameHandler::getSize() {
if (varSize == 0)
return -1;
- return _slotFile->tallyUpFiles(varSize, 600);
+ return _slotFile->tallyUpFiles(varSize, kIndexSize);
}
bool SaveLoad_v2::GameHandler::load(int16 dataVar, int32 size, int32 offset) {
@@ -99,7 +99,7 @@ bool SaveLoad_v2::GameHandler::load(int16 dataVar, int32 size, int32 offset) {
if (offset == 0) {
// Save index
- if (size != 600) {
+ if (((uint32) size) != kIndexSize) {
warning("Requested index has wrong size (%d)", size);
return false;
}
@@ -184,13 +184,13 @@ bool SaveLoad_v2::GameHandler::save(int16 dataVar, int32 size, int32 offset) {
if (offset == 0) {
// Save index
- if (size != 600) {
+ if (((uint32) size) != kIndexSize) {
warning("Requested index has wrong size (%d)", size);
return false;
}
// Just copy the index into our buffer
- _vm->_inter->_variables->copyTo(dataVar, _index, 600);
+ _vm->_inter->_variables->copyTo(dataVar, _index, kIndexSize);
_hasIndex = true;
} else {
diff --git a/engines/gob/save/saveload_v3.cpp b/engines/gob/save/saveload_v3.cpp
index c24b13d27b..064d472323 100644
--- a/engines/gob/save/saveload_v3.cpp
+++ b/engines/gob/save/saveload_v3.cpp
@@ -57,7 +57,7 @@ int SaveLoad_v3::GameHandler::File::getSlot(int32 offset) const {
if (varSize == 0)
return -1;
- return ((offset - 1700) / varSize);
+ return ((offset - (kPropsSize + kIndexSize)) / varSize);
}
int SaveLoad_v3::GameHandler::File::getSlotRemainder(int32 offset) const {
@@ -66,7 +66,7 @@ int SaveLoad_v3::GameHandler::File::getSlotRemainder(int32 offset) const {
if (varSize == 0)
return -1;
- return ((offset - 1700) % varSize);
+ return ((offset - (kPropsSize + kIndexSize)) % varSize);
}
@@ -78,8 +78,8 @@ SaveLoad_v3::GameHandler::GameHandler(GobEngine *vm, const char *target,
_usesScreenshots = usesScreenshots;
_firstSize = true;
- memset(_props, 0, 500);
- memset(_index, 0, 1200);
+ memset(_props, 0, kPropsSize);
+ memset(_index, 0, kIndexSize);
_hasIndex = false;
_writer = 0;
@@ -104,7 +104,7 @@ int32 SaveLoad_v3::GameHandler::getSize() {
if (varSize == 0)
return -1;
- return _slotFile->tallyUpFiles(varSize, 1700);
+ return _slotFile->tallyUpFiles(varSize, kPropsSize + kIndexSize);
}
bool SaveLoad_v3::GameHandler::load(int16 dataVar, int32 size, int32 offset) {
@@ -119,22 +119,22 @@ bool SaveLoad_v3::GameHandler::load(int16 dataVar, int32 size, int32 offset) {
size = varSize;
}
- if (offset < 500) {
+ if (((uint32) offset) < kPropsSize) {
// Global properties, like joker usage
debugC(3, kDebugSaveLoad, "Loading global properties");
- if ((size + offset) > 500) {
+ if (((uint32) (offset + size)) > kPropsSize) {
warning("Wrong global properties list size (%d, %d)", size, offset);
return false;
}
_vm->_inter->_variables->copyFrom(dataVar, _props + offset, size);
- } else if (offset == 500) {
+ } else if (((uint32) offset) == kPropsSize) {
// Save index
- if (size != 1200) {
+ if (((uint32) size) != kIndexSize) {
warning("Requested index has wrong size (%d)", size);
return false;
}
@@ -193,28 +193,28 @@ bool SaveLoad_v3::GameHandler::save(int16 dataVar, int32 size, int32 offset) {
size = varSize;
}
- if (offset < 500) {
+ if (((uint32) offset) < kPropsSize) {
// Global properties, like joker usage
debugC(3, kDebugSaveLoad, "Saving global properties");
- if ((size + offset) > 500) {
+ if (((uint32) (offset + size)) > kPropsSize) {
warning("Wrong global properties list size (%d, %d)", size, offset);
return false;
}
_vm->_inter->_variables->copyTo(dataVar, _props + offset, size);
- } else if (offset == 500) {
+ } else if (((uint32) offset) == kPropsSize) {
// Save index
- if (size != 1200) {
+ if (((uint32) size) != kIndexSize) {
warning("Requested index has wrong size (%d)", size);
return false;
}
// Just copy the index into our buffer
- _vm->_inter->_variables->copyTo(dataVar, _index, 1200);
+ _vm->_inter->_variables->copyTo(dataVar, _index, kIndexSize);
_hasIndex = true;
} else {
diff --git a/engines/gob/save/saveload_v4.cpp b/engines/gob/save/saveload_v4.cpp
index 16c87b9a64..e6973efd64 100644
--- a/engines/gob/save/saveload_v4.cpp
+++ b/engines/gob/save/saveload_v4.cpp
@@ -63,7 +63,7 @@ int SaveLoad_v4::GameHandler::File::getSlot(int32 offset) const {
if (varSize == 0)
return -1;
- return ((offset - 1700) / varSize);
+ return ((offset - (kPropsSize + kIndexSize)) / varSize);
}
int SaveLoad_v4::GameHandler::File::getSlotRemainder(int32 offset) const {
@@ -72,14 +72,14 @@ int SaveLoad_v4::GameHandler::File::getSlotRemainder(int32 offset) const {
if (varSize == 0)
return -1;
- return ((offset - 1700) % varSize);
+ return ((offset - (kPropsSize + kIndexSize)) % varSize);
}
SaveLoad_v4::GameHandler::GameHandler(GobEngine *vm, const char *target) : SaveHandler(vm) {
_firstSize = true;
- memset(_props, 0, 500);
- memset(_index, 0, 1200);
+ memset(_props, 0, kPropsSize);
+ memset(_index, 0, kIndexSize);
_hasIndex = false;
_slotFile = new File(vm, target);
@@ -112,7 +112,7 @@ int32 SaveLoad_v4::GameHandler::getSize() {
if (varSize == 0)
return -1;
- return _slotFile->tallyUpFiles(varSize, 1700);
+ return _slotFile->tallyUpFiles(varSize, kPropsSize + kIndexSize);
}
bool SaveLoad_v4::GameHandler::load(int16 dataVar, int32 size, int32 offset) {
@@ -127,22 +127,22 @@ bool SaveLoad_v4::GameHandler::load(int16 dataVar, int32 size, int32 offset) {
size = varSize;
}
- if (offset < 500) {
+ if (((uint32) offset) < kPropsSize) {
// Global properties
debugC(3, kDebugSaveLoad, "Loading global properties");
- if ((size + offset) > 500) {
+ if (((uint32) (offset + size)) > kPropsSize) {
warning("Wrong global properties list size (%d, %d)", size, offset);
return false;
}
_vm->_inter->_variables->copyFrom(dataVar, _props + offset, size);
- } else if (offset == 500) {
+ } else if (((uint32) offset) == kPropsSize) {
// Save index
- if (size != 1200) {
+ if (((uint32) size) != kIndexSize) {
warning("Requested index has wrong size (%d)", size);
return false;
}
@@ -202,28 +202,28 @@ bool SaveLoad_v4::GameHandler::save(int16 dataVar, int32 size, int32 offset) {
size = varSize;
}
- if (offset < 500) {
+ if (((uint32) offset) < kPropsSize) {
// Global properties
debugC(3, kDebugSaveLoad, "Saving global properties");
- if ((size + offset) > 500) {
+ if (((uint32) (offset + size)) > kPropsSize) {
warning("Wrong global properties list size (%d, %d)", size, offset);
return false;
}
_vm->_inter->_variables->copyTo(dataVar, _props + offset, size);
- } else if (offset == 500) {
+ } else if (((uint32) offset) == kPropsSize) {
// Save index
- if (size != 1200) {
+ if (((uint32) size) != kIndexSize) {
warning("Requested index has wrong size (%d)", size);
return false;
}
// Just copy the index into our buffer
- _vm->_inter->_variables->copyTo(dataVar, _index, 1200);
+ _vm->_inter->_variables->copyTo(dataVar, _index, kIndexSize);
_hasIndex = true;
} else {
diff --git a/engines/gob/save/saveload_v6.cpp b/engines/gob/save/saveload_v6.cpp
index 45622bee73..e31c8b4809 100644
--- a/engines/gob/save/saveload_v6.cpp
+++ b/engines/gob/save/saveload_v6.cpp
@@ -50,7 +50,7 @@ int SaveLoad_v6::GameHandler::File::getSlot(int32 offset) const {
if (varSize == 0)
return -1;
- return ((offset - 2900) / varSize);
+ return ((offset - (kPropsSize + kIndexSize)) / varSize);
}
int SaveLoad_v6::GameHandler::File::getSlotRemainder(int32 offset) const {
@@ -59,13 +59,13 @@ int SaveLoad_v6::GameHandler::File::getSlotRemainder(int32 offset) const {
if (varSize == 0)
return -1;
- return ((offset - 2900) % varSize);
+ return ((offset - (kPropsSize + kIndexSize)) % varSize);
}
SaveLoad_v6::GameHandler::GameHandler(GobEngine *vm, const char *target) : SaveHandler(vm) {
- memset(_props, 0, 500);
- memset(_index, 0, 2400);
+ memset(_props, 0, kPropsSize);
+ memset(_index, 0, kIndexSize);
_slotFile = new File(vm, target);
}
@@ -80,7 +80,7 @@ int32 SaveLoad_v6::GameHandler::getSize() {
if (varSize == 0)
return -1;
- return _slotFile->tallyUpFiles(varSize, 2900);
+ return _slotFile->tallyUpFiles(varSize, kPropsSize + kIndexSize);
}
bool SaveLoad_v6::GameHandler::load(int16 dataVar, int32 size, int32 offset) {
@@ -95,22 +95,22 @@ bool SaveLoad_v6::GameHandler::load(int16 dataVar, int32 size, int32 offset) {
size = varSize;
}
- if (offset < 500) {
+ if (((uint32) offset) < kPropsSize) {
// Properties
refreshProps();
- if ((offset + size) > 500) {
+ if (((uint32) (offset + size)) > kPropsSize) {
warning("Wrong index size (%d, %d)", size, offset);
return false;
}
_vm->_inter->_variables->copyFrom(dataVar, _props + offset, size);
- } else if (offset < 2900) {
+ } else if (((uint32) offset) < kPropsSize + kIndexSize) {
// Save index
- if (size != 2400) {
+ if (((uint32) size) != kIndexSize) {
warning("Wrong index size (%d, %d)", size, offset);
return false;
}
@@ -191,10 +191,10 @@ bool SaveLoad_v6::GameHandler::save(int16 dataVar, int32 size, int32 offset) {
size = varSize;
}
- if (offset < 500) {
+ if (((uint32) offset) < kPropsSize) {
// Properties
- if ((offset + size) > 500) {
+ if (((uint32) (offset + size)) > kPropsSize) {
warning("Wrong index size (%d, %d)", size, offset);
return false;
}
@@ -203,16 +203,16 @@ bool SaveLoad_v6::GameHandler::save(int16 dataVar, int32 size, int32 offset) {
refreshProps();
- } else if (offset < 2900) {
+ } else if (((uint32) offset) < kPropsSize + kIndexSize) {
// Save index
- if (size != 2400) {
+ if (((uint32) size) != kIndexSize) {
warning("Wrong index size (%d, %d)", size, offset);
return false;
}
// Just copy the index into our buffer
- _vm->_inter->_variables->copyTo(dataVar, _index, 2400);
+ _vm->_inter->_variables->copyTo(dataVar, _index, kIndexSize);
} else {
// Save slot, whole variable block
diff --git a/engines/gob/video_v6.cpp b/engines/gob/video_v6.cpp
index 5468f7c89d..c51b027bad 100644
--- a/engines/gob/video_v6.cpp
+++ b/engines/gob/video_v6.cpp
@@ -25,7 +25,6 @@
#include "common/endian.h"
#include "common/savefile.h"
-#include "graphics/conversion.h"
#include "graphics/dither.h"
#include "gob/gob.h"
@@ -46,8 +45,8 @@ void Video_v6::setPrePalette() {
for (int i = 0; i < 256; i++) {
byte r, g, b;
- Graphics::YUV2RGB(fpal[i * 3 + 0], fpal[i * 3 + 1], fpal[i * 3 + 2],
- r, g, b);
+ Graphics::PaletteLUT::YUV2RGB(fpal[i * 3 + 0], fpal[i * 3 + 1], fpal[i * 3 + 2],
+ r, g, b);
tpal[i * 3 + 0] = r >> 2;
tpal[i * 3 + 1] = g >> 2;
diff --git a/engines/groovie/graphics.cpp b/engines/groovie/graphics.cpp
index 1e54f0e79b..647eaa913b 100644
--- a/engines/groovie/graphics.cpp
+++ b/engines/groovie/graphics.cpp
@@ -31,8 +31,8 @@ namespace Groovie {
GraphicsMan::GraphicsMan(GroovieEngine *vm) :
_vm(vm), _changed(false), _fading(0) {
// Create the game surfaces
- _foreground.create(640, 320, _vm->_pixelFormat.bytesPerPixel);
- _background.create(640, 320, _vm->_pixelFormat.bytesPerPixel);
+ _foreground.create(640, 320, 1);
+ _background.create(640, 320, 1);
}
GraphicsMan::~GraphicsMan() {
diff --git a/engines/groovie/groovie.cpp b/engines/groovie/groovie.cpp
index bb4e142196..9381b5b47c 100644
--- a/engines/groovie/groovie.cpp
+++ b/engines/groovie/groovie.cpp
@@ -70,20 +70,7 @@ GroovieEngine::~GroovieEngine() {
Common::Error GroovieEngine::run() {
// Initialize the graphics
- switch (_gameDescription->version) {
- case kGroovieV2:
- // Request the mode with the highest precision available
- initGraphics(640, 480, true, NULL);
-
- // Save the enabled mode as it can be both an RGB mode or CLUT8
- _pixelFormat = _system->getScreenFormat();
- _mode8bit = (_pixelFormat == Graphics::PixelFormat::createFormatCLUT8());
- break;
- case kGroovieT7G:
- initGraphics(640, 480, true);
- _pixelFormat = Graphics::PixelFormat::createFormatCLUT8();
- break;
- }
+ initGraphics(640, 480, true);
// Create debugger. It requires GFX to be initialized
_debugger = new Debugger(this);
@@ -217,18 +204,13 @@ Common::Error GroovieEngine::run() {
case Common::EVENT_LBUTTONDOWN:
// Send the event to the scripts
- _script.setMouseClick(1);
+ _script.setMouseClick();
// Continue the script execution to handle
// the click
_waitingForInput = false;
break;
- case Common::EVENT_RBUTTONDOWN:
- // Send the event to the scripts (to skip the video)
- _script.setMouseClick(2);
- break;
-
case Common::EVENT_QUIT:
quitGame();
break;
diff --git a/engines/groovie/groovie.h b/engines/groovie/groovie.h
index bf57ae77de..a137193adf 100644
--- a/engines/groovie/groovie.h
+++ b/engines/groovie/groovie.h
@@ -85,8 +85,6 @@ protected:
public:
void waitForInput();
- Graphics::PixelFormat _pixelFormat;
- bool _mode8bit;
Script _script;
ResMan *_resMan;
GrvCursorMan *_grvCursorMan;
diff --git a/engines/groovie/roq.cpp b/engines/groovie/roq.cpp
index 538b1b7111..dcb8eafcb8 100644
--- a/engines/groovie/roq.cpp
+++ b/engines/groovie/roq.cpp
@@ -29,12 +29,6 @@
#include "groovie/groovie.h"
#include "groovie/roq.h"
-#include "graphics/jpeg.h"
-
-#ifdef ENABLE_RGB_COLOR
-// Required for the YUV to RGB conversion
-#include "graphics/conversion.h"
-#endif
#include "sound/mixer.h"
namespace Groovie {
@@ -49,52 +43,50 @@ ROQPlayer::ROQPlayer(GroovieEngine *vm) :
_currBuf = new Graphics::Surface();
_prevBuf = new Graphics::Surface();
- if (_vm->_mode8bit) {
- byte pal[256 * 4];
+ byte pal[256 * 4];
#ifdef DITHER
- byte pal3[256 * 3];
- // Initialize to a black palette
- for (int i = 0; i < 256 * 3; i++) {
- pal3[i] = 0;
- }
-
- // Build a basic color palette
- for (int r = 0; r < 4; r++) {
- for (int g = 0; g < 4; g++) {
- for (int b = 0; b < 4; b++) {
- byte col = (r << 4) | (g << 2) | (b << 0);
- pal3[3 * col + 0] = r << 6;
- pal3[3 * col + 1] = g << 6;
- pal3[3 * col + 2] = b << 6;
- }
+ byte pal3[256 * 3];
+ // Initialize to a black palette
+ for (int i = 0; i < 256 * 3; i++) {
+ pal3[i] = 0;
+ }
+
+ // Build a basic color palette
+ for (int r = 0; r < 4; r++) {
+ for (int g = 0; g < 4; g++) {
+ for (int b = 0; b < 4; b++) {
+ byte col = (r << 4) | (g << 2) | (b << 0);
+ pal3[3 * col + 0] = r << 6;
+ pal3[3 * col + 1] = g << 6;
+ pal3[3 * col + 2] = b << 6;
}
}
+ }
- // Initialize the dithering algorithm
- _paletteLookup = new Graphics::PaletteLUT(8, Graphics::PaletteLUT::kPaletteYUV);
- _paletteLookup->setPalette(pal3, Graphics::PaletteLUT::kPaletteRGB, 8);
- for (int i = 0; (i < 64) && !_vm->shouldQuit(); i++) {
- debug("Groovie::ROQ: Building palette table: %02d/63", i);
- _paletteLookup->buildNext();
- }
-
- // Prepare the palette to show
- for (int i = 0; i < 256; i++) {
- pal[(i * 4) + 0] = pal3[(i * 3) + 0];
- pal[(i * 4) + 1] = pal3[(i * 3) + 1];
- pal[(i * 4) + 2] = pal3[(i * 3) + 2];
- }
-#else // !DITHER
- // Set a grayscale palette
- for (int i = 0; i < 256; i++) {
- pal[(i * 4) + 0] = i;
- pal[(i * 4) + 1] = i;
- pal[(i * 4) + 2] = i;
- }
-#endif // DITHER
+ // Initialize the dithering algorithm
+ _paletteLookup = new Graphics::PaletteLUT(8, Graphics::PaletteLUT::kPaletteYUV);
+ _paletteLookup->setPalette(pal3, Graphics::PaletteLUT::kPaletteRGB, 8);
+ for (int i = 0; (i < 64) && !_vm->shouldQuit(); i++) {
+ debug("Groovie::ROQ: Building palette table: %02d/63", i);
+ _paletteLookup->buildNext();
+ }
- _syst->setPalette(pal, 0, 256);
+ // Prepare the palette to show
+ for (int i = 0; i < 256; i++) {
+ pal[(i * 4) + 0] = pal3[(i * 3) + 0];
+ pal[(i * 4) + 1] = pal3[(i * 3) + 1];
+ pal[(i * 4) + 2] = pal3[(i * 3) + 2];
}
+#else
+ // Set a grayscale palette
+ for (int i = 0; i < 256; i++) {
+ pal[(i * 4) + 0] = i;
+ pal[(i * 4) + 1] = i;
+ pal[(i * 4) + 2] = i;
+ }
+#endif
+
+ _syst->setPalette(pal, 0, 256);
}
ROQPlayer::~ROQPlayer() {
@@ -160,39 +152,22 @@ void ROQPlayer::buildShowBuf() {
for (int line = 0; line < _showBuf.h; line++) {
byte *out = (byte *)_showBuf.getBasePtr(0, line);
- byte *in = (byte *)_currBuf->getBasePtr(0, line / _scaleY);
+ byte *in = (byte *)_prevBuf->getBasePtr(0, line / _scaleY);
for (int x = 0; x < _showBuf.w; x++) {
- if (_vm->_mode8bit) {
#ifdef DITHER
- *out = _dither->dither(*in, *(in + 1), *(in + 2), x);
+ *out = _dither->dither(*in, *(in + 1), *(in + 2), x);
#else
- // Just use the luminancy component
- *out = *in;
-#endif // DITHER
-#ifdef ENABLE_RGB_COLOR
- } else {
- // Do the format conversion (YUV -> RGB -> Screen format)
- byte r, g, b;
- Graphics::YUV2RGB(*in, *(in + 1), *(in + 2), r, g, b);
- // FIXME: this is fixed to 16bit
- *(uint16 *)out = (uint16)_vm->_pixelFormat.RGBToColor(r, g, b);
-#endif // ENABLE_RGB_COLOR
- }
-
- // Skip to the next pixel
- out += _vm->_pixelFormat.bytesPerPixel;
+ // Just use the luminancy component
+ *out = *in;
+#endif
+ out++;
if (!(x % _scaleX))
- in += _currBuf->bytesPerPixel;
+ in += _prevBuf->bytesPerPixel;
}
#ifdef DITHER
_dither->nextLine();
#endif
}
-
- // Swap buffers
- Graphics::Surface *tmp = _prevBuf;
- _prevBuf = _currBuf;
- _currBuf = tmp;
}
bool ROQPlayer::playFrameInternal() {
@@ -205,7 +180,7 @@ bool ROQPlayer::playFrameInternal() {
}
if (_dirty) {
- // Build the show buffer from the current buffer
+ // Build the show buffer from the previous (back) buffer
buildShowBuf();
}
@@ -214,7 +189,7 @@ bool ROQPlayer::playFrameInternal() {
if (_dirty) {
// Update the screen
- _syst->copyRectToScreen((byte *)_showBuf.getBasePtr(0, 0), _showBuf.pitch, 0, (_syst->getHeight() - _showBuf.h) / 2, _showBuf.w, _showBuf.h);
+ _syst->copyRectToScreen((byte *)_showBuf.getBasePtr(0, 0), _showBuf.w, 0, (_syst->getHeight() - _showBuf.h) / 2, _showBuf.pitch, _showBuf.h);
_syst->updateScreen();
// Clear the dirty flag
@@ -265,15 +240,19 @@ bool ROQPlayer::processBlock() {
case 0x1002: // Quad codebook definition
ok = processBlockQuadCodebook(blockHeader);
break;
- case 0x1011: // Quad vector quantised video frame
+ case 0x1011: { // Quad vector quantised video frame
ok = processBlockQuadVector(blockHeader);
_dirty = true;
endframe = true;
+
+ // Swap buffers
+ Graphics::Surface *tmp = _prevBuf;
+ _prevBuf = _currBuf;
+ _currBuf = tmp;
break;
+ }
case 0x1012: // Still image (JPEG)
ok = processBlockStill(blockHeader);
- _dirty = true;
- endframe = true;
break;
case 0x1013: // Hang
assert(blockHeader.size == 0 && blockHeader.param == 0);
@@ -338,19 +317,7 @@ bool ROQPlayer::processBlockInfo(ROQBlockHeader &blockHeader) {
// Allocate new buffers
_currBuf->create(width, height, 3);
_prevBuf->create(width, height, 3);
- _showBuf.create(width * _scaleX, height * _scaleY, _vm->_pixelFormat.bytesPerPixel);
-
- // Clear the buffers with black YUV values
- byte *ptr1 = (byte *)_currBuf->getBasePtr(0, 0);
- byte *ptr2 = (byte *)_prevBuf->getBasePtr(0, 0);
- for (int i = 0; i < width * height; i++) {
- *ptr1++ = 0;
- *ptr1++ = 128;
- *ptr1++ = 128;
- *ptr2++ = 0;
- *ptr2++ = 128;
- *ptr2++ = 128;
- }
+ _showBuf.create(width * _scaleX, height * _scaleY, 1);
#ifdef DITHER
// Reset the dithering algorithm with the new width
@@ -489,23 +456,10 @@ void ROQPlayer::processBlockQuadVectorBlockSub(int baseX, int baseY, int8 Mx, in
bool ROQPlayer::processBlockStill(ROQBlockHeader &blockHeader) {
debugC(5, kGroovieDebugVideo | kGroovieDebugAll, "Groovie::ROQ: Processing still (JPEG) block");
- warning("Groovie::ROQ: JPEG frame (unfinshed)");
-
- Graphics::JPEG *jpg = new Graphics::JPEG();
- jpg->read(_file);
- byte *y = (byte *)jpg->getComponent(1)->getBasePtr(0, 0);
- byte *u = (byte *)jpg->getComponent(2)->getBasePtr(0, 0);
- byte *v = (byte *)jpg->getComponent(3)->getBasePtr(0, 0);
-
- byte *ptr = (byte *)_currBuf->getBasePtr(0, 0);
- for (int i = 0; i < _currBuf->w * _currBuf->h; i++) {
- *ptr++ = *y++;
- *ptr++ = *u++;
- *ptr++ = *v++;
- }
- memcpy(_prevBuf->getBasePtr(0, 0), _currBuf->getBasePtr(0, 0), _prevBuf->w * _prevBuf->h * 3);
+ warning("Groovie::ROQ: JPEG frame (unimplemented)");
+ memset(_prevBuf->getBasePtr(0, 0), 0, _prevBuf->w * _prevBuf->h * _prevBuf->bytesPerPixel);
- delete jpg;
+ _file->skip(blockHeader.size);
return true;
}
diff --git a/engines/groovie/script.cpp b/engines/groovie/script.cpp
index 97d8d24f77..5ee58184f2 100644
--- a/engines/groovie/script.cpp
+++ b/engines/groovie/script.cpp
@@ -102,7 +102,6 @@ Script::Script(GroovieEngine *vm, EngineVersion version) :
_hotspotSlot = (uint16)-1;
_oldInstruction = (uint16)-1;
- _videoSkipAddress = 0;
}
Script::~Script() {
@@ -236,8 +235,8 @@ void Script::step() {
(this->*op)();
}
-void Script::setMouseClick(uint8 button) {
- _eventMouseClicked = button;
+void Script::setMouseClick() {
+ _eventMouseClicked = true;
}
void Script::setKbdChar(uint8 c) {
@@ -360,7 +359,7 @@ bool Script::hotspot(Common::Rect rect, uint16 address, uint8 cursor) {
Common::isDebugChannelEnabled(kGroovieDebugAll)) {
rect.translate(0, -80);
_vm->_graphicsMan->_foreground.frameRect(rect, 250);
- _vm->_system->copyRectToScreen((byte*)_vm->_graphicsMan->_foreground.getBasePtr(0, 0), _vm->_graphicsMan->_foreground.pitch, 0, 80, 640, 320);
+ _vm->_system->copyRectToScreen((byte*)_vm->_graphicsMan->_foreground.getBasePtr(0, 0), 640, 0, 80, 640, 320);
_vm->_system->updateScreen();
}
@@ -531,6 +530,7 @@ void Script::o_videofromref() { // 0x09
bool Script::playvideofromref(uint32 fileref) {
// It isn't the current video, open it
if (fileref != _videoRef) {
+
// Debug bitflags
debugScript(1, false, "Play video 0x%04X (bitflags:", fileref);
for (int i = 15; i >= 0; i--) {
@@ -559,21 +559,6 @@ bool Script::playvideofromref(uint32 fileref) {
}
_bitflags = 0;
-
- // Reset the clicked mouse events
- _eventMouseClicked = 0;
- }
-
- // Check if the user wants to skip the video
- if ((_eventMouseClicked == 2) && (_videoSkipAddress != 0)) {
- // Jump to the given address
- _currentInstruction = _videoSkipAddress;
-
- // Reset the skip address
- _videoSkipAddress = 0;
-
- // End the playback
- return true;
}
// Video available, play one frame
@@ -588,7 +573,7 @@ bool Script::playvideofromref(uint32 fileref) {
_videoRef = 0;
// Clear the input events while playing the video
- _eventMouseClicked = 0;
+ _eventMouseClicked = false;
_eventKbdChar = 0;
// Newline
@@ -619,8 +604,8 @@ void Script::o_inputloopstart() { //0x0B
_inputLoopAddress = _currentInstruction - 1;
// Save the current mouse state for the whole loop
- _mouseClicked = (_eventMouseClicked == 1);
- _eventMouseClicked = 0;
+ _mouseClicked = _eventMouseClicked;
+ _eventMouseClicked = false;
// Save the current pressed character for the whole loop
_kbdChar = _eventKbdChar;
@@ -1550,19 +1535,20 @@ void Script::o_stub59() {
debugScript(1, true, "STUB59: 0x%04X 0x%02X", val1, val2);
}
-void Script::o2_playsong() {
+void Script::o2_playsong(){
uint32 fileref = readScript32bits();
debugScript(1, true, "PlaySong(0x%08X): Play xmidi file", fileref);
_vm->_musicPlayer->playSong(fileref);
+
}
-void Script::o2_setbackgroundsong() {
+void Script::o2_setbackgroundsong(){
uint32 fileref = readScript32bits();
debugScript(1, true, "SetBackgroundSong(0x%08X)", fileref);
_vm->_musicPlayer->setBackgroundSong(fileref);
}
-void Script::o2_videofromref() {
+void Script::o2_videofromref(){
uint32 fileref = readScript32bits();
// Show the debug information just when starting the playback
@@ -1570,7 +1556,6 @@ void Script::o2_videofromref() {
debugScript(1, true, "VIDEOFROMREF(0x%08X) (Not fully imp): Play video file from ref", fileref);
debugC(5, kGroovieDebugVideo | kGroovieDebugAll, "Playing video 0x%08X via 0x09", fileref);
}
-
// Play the video
if (!playvideofromref(fileref)) {
// Move _currentInstruction back
@@ -1578,7 +1563,7 @@ void Script::o2_videofromref() {
}
}
-void Script::o2_vdxtransition() {
+void Script::o2_vdxtransition(){
uint32 fileref = readScript32bits();
// Show the debug information just when starting the playback
@@ -1602,21 +1587,11 @@ void Script::o2_vdxtransition() {
}
}
-void Script::o2_setvideoskip() {
- _videoSkipAddress = readScript16bits();
- debugScript(1, true, "SetVideoSkip (0x%04X)", _videoSkipAddress);
-}
-
-void Script::o2_stub52() {
+void Script::o2_stub52(){
uint8 arg = readScript8bits();
debugScript(1, true, "STUB52 (0x%02X)", arg);
}
-void Script::o2_setscriptend() {
- uint16 arg = readScript16bits();
- debugScript(1, true, "SetScriptEnd (0x%04X)", arg);
-}
-
Script::OpcodeFunc Script::_opcodesT7G[NUM_OPCODES] = {
&Script::o_nop, // 0x00
&Script::o_nop,
@@ -1717,11 +1692,11 @@ Script::OpcodeFunc Script::_opcodesV2[NUM_OPCODES] = {
&Script::o_invalid, // 0x00
&Script::o_nop,
&Script::o2_playsong,
- &Script::o_nop,
- &Script::o_nop, // 0x04
- &Script::o_nop,
- &Script::o_nop,
- &Script::o_nop,
+ &Script::o_bf9on,
+ &Script::o_palfadeout, // 0x04
+ &Script::o_bf8on,
+ &Script::o_bf6on,
+ &Script::o_bf7on,
&Script::o2_setbackgroundsong, // 0x08
&Script::o2_videofromref,
&Script::o_bf5on,
@@ -1744,7 +1719,7 @@ Script::OpcodeFunc Script::_opcodesV2[NUM_OPCODES] = {
&Script::o_xor_obfuscate,
&Script::o2_vdxtransition, // 0x1C
&Script::o_swap,
- &Script::o_invalid,
+ &Script::o_nop8,
&Script::o_inc,
&Script::o_dec, // 0x20
&Script::o_strcmpnejmp_var,
@@ -1754,10 +1729,10 @@ Script::OpcodeFunc Script::_opcodesV2[NUM_OPCODES] = {
&Script::o_add,
&Script::o_videofromstring1,
&Script::o_videofromstring2,
- &Script::o_invalid, // 0x28
- &Script::o_nop,
+ &Script::o_nop16, // 0x28
+ &Script::o_stopmidi,
&Script::o_endscript,
- &Script::o_invalid,
+ &Script::o_nop,
&Script::o_sethotspottop, // 0x2C
&Script::o_sethotspotbottom,
&Script::o_loadgame,
@@ -1784,22 +1759,22 @@ Script::OpcodeFunc Script::_opcodesV2[NUM_OPCODES] = {
&Script::o_returnscript,
&Script::o_sethotspotright, // 0x44
&Script::o_sethotspotleft,
- &Script::o_invalid,
- &Script::o_invalid,
- &Script::o_invalid, // 0x48
- &Script::o_invalid,
+ &Script::o_nop,
+ &Script::o_nop,
+ &Script::o_nop8, // 0x48
+ &Script::o_nop,
+ &Script::o_nop16,
+ &Script::o_nop8,
+ &Script::o_getcd, // 0x4C
+ &Script::o_playcd,
&Script::o_nop16,
- &Script::o_invalid,
- &Script::o_invalid, // 0x4C
- &Script::o_invalid,
- &Script::o_invalid,
&Script::o_nop16,
&Script::o_nop16, // 0x50
- &Script::o2_setvideoskip,
+ &Script::o_nop16,
&Script::o2_stub52,
&Script::o_hotspot_outrect,
- &Script::o_invalid, // 0x54
- &Script::o2_setscriptend,
+ &Script::o_nop, // 0x54
+ &Script::o_nop16,
&Script::o_stub56,
&Script::o_invalid,
&Script::o_invalid, // 0x58
diff --git a/engines/groovie/script.h b/engines/groovie/script.h
index 9e35d6fcde..e9e0be69ec 100644
--- a/engines/groovie/script.h
+++ b/engines/groovie/script.h
@@ -58,7 +58,7 @@ public:
void directGameLoad(int slot);
void step();
- void setMouseClick(uint8 button);
+ void setMouseClick();
void setKbdChar(uint8 c);
Common::String &getContext();
@@ -96,7 +96,7 @@ private:
// Input
bool _mouseClicked;
- uint8 _eventMouseClicked;
+ bool _eventMouseClicked;
uint8 _kbdChar;
uint8 _eventKbdChar;
uint16 _inputLoopAddress;
@@ -115,7 +115,6 @@ private:
Common::SeekableReadStream *_videoFile;
uint32 _videoRef;
uint16 _bitflags;
- uint16 _videoSkipAddress;
// Debugging
Debugger *_debugger;
@@ -229,9 +228,7 @@ private:
void o2_setbackgroundsong();
void o2_videofromref();
void o2_vdxtransition();
- void o2_setvideoskip();
void o2_stub52();
- void o2_setscriptend();
};
} // End of Groovie namespace
diff --git a/engines/kyra/animator_lok.cpp b/engines/kyra/animator_lok.cpp
index a05eabe3e1..04c31a1422 100644
--- a/engines/kyra/animator_lok.cpp
+++ b/engines/kyra/animator_lok.cpp
@@ -37,7 +37,6 @@ Animator_LoK::Animator_LoK(KyraEngine_LoK *vm, OSystem *system) {
_vm = vm;
_screen = vm->screen();
_initOk = false;
- _updateScreen = false;
_system = system;
_screenObjects = _actors = _items = _sprites = _objectQueue = 0;
_noDrawShapesFlag = 0;
@@ -382,15 +381,11 @@ void Animator_LoK::copyChangedObjectsForward(int refreshFlag) {
_screen->copyRegion(xpos << 3, ypos, xpos << 3, ypos, width << 3, height, 2, 0);
curObject->refreshFlag = 0;
- _updateScreen = true;
}
}
}
- if (_updateScreen) {
- _screen->updateScreen();
- _updateScreen = false;
- }
+ _screen->updateScreen();
}
void Animator_LoK::updateAllObjectShapes() {
diff --git a/engines/kyra/animator_lok.h b/engines/kyra/animator_lok.h
index ba5882c710..618a210082 100644
--- a/engines/kyra/animator_lok.h
+++ b/engines/kyra/animator_lok.h
@@ -95,7 +95,6 @@ public:
int16 fetchAnimHeight(const uint8 *shape, int16 mult);
int _noDrawShapesFlag;
- bool _updateScreen;
uint16 _brandonDrawFrame;
int _brandonScaleX;
int _brandonScaleY;
diff --git a/engines/kyra/gui.cpp b/engines/kyra/gui.cpp
index cc1add9ce7..e49085103a 100644
--- a/engines/kyra/gui.cpp
+++ b/engines/kyra/gui.cpp
@@ -232,10 +232,11 @@ void GUI::processHighlights(Menu &menu) {
menu.highlightedItem = i;
redrawHighlight(menu);
- _screen->updateScreen();
}
}
}
+
+ _screen->updateScreen();
}
void GUI::redrawText(const Menu &menu) {
@@ -424,7 +425,8 @@ void GUI::checkTextfieldInput() {
Common::Point pos = _vm->getMousePos();
_vm->_mouseX = pos.x;
_vm->_mouseY = pos.y;
- _screen->updateScreen();
+
+ _vm->_system->updateScreen();
_lastScreenUpdate = now;
} break;
@@ -490,14 +492,24 @@ bool MainMenu::getInput() {
Common::Event event;
Common::EventManager *eventMan = _vm->getEventManager();
+ bool updateScreen = false;
+
while (eventMan->pollEvent(event)) {
switch (event.type) {
case Common::EVENT_LBUTTONUP:
return true;
+
+ case Common::EVENT_MOUSEMOVE:
+ updateScreen = true;
+ break;
+
default:
break;
}
}
+
+ if (updateScreen)
+ _system->updateScreen();
return false;
}
diff --git a/engines/kyra/gui_lok.cpp b/engines/kyra/gui_lok.cpp
index e9c71f511d..3c5fbe4f1c 100644
--- a/engines/kyra/gui_lok.cpp
+++ b/engines/kyra/gui_lok.cpp
@@ -522,7 +522,6 @@ int GUI_LoK::buttonMenuCallback(Button *caller) {
if (_menuRestoreScreen) {
restorePalette();
_screen->loadPageFromDisk("SEENPAGE.TMP", 0);
- _vm->_animator->_updateScreen = true;
} else {
_screen->deletePageFromDisk(0);
}
diff --git a/engines/kyra/kyra_v1.cpp b/engines/kyra/kyra_v1.cpp
index d79d9a8f32..d8e91b138d 100644
--- a/engines/kyra/kyra_v1.cpp
+++ b/engines/kyra/kyra_v1.cpp
@@ -434,11 +434,8 @@ void KyraEngine_v1::updateInput() {
}
}
- // TODO: Check whether we should really call Screen::updateScreen here.
- // We might simply want to call OSystem::updateScreen instead, since Screen::updateScreen
- // copies changed screen parts to the screen buffer, which might not be desired.
if (updateScreen)
- screen()->updateScreen();
+ _system->updateScreen();
}
void KyraEngine_v1::removeInputTop() {
diff --git a/engines/kyra/lol.cpp b/engines/kyra/lol.cpp
index 816e244531..eb313821af 100644
--- a/engines/kyra/lol.cpp
+++ b/engines/kyra/lol.cpp
@@ -65,6 +65,7 @@ LoLEngine::LoLEngine(OSystem *system, const GameFlags &flags) : KyraEngine_v1(sy
case Common::JA_JPN:
_lang = 0;
+ break;
default:
warning("unsupported language, switching back to English");
diff --git a/engines/kyra/lol.h b/engines/kyra/lol.h
index 1c89a7a1eb..7a112cfd8f 100644
--- a/engines/kyra/lol.h
+++ b/engines/kyra/lol.h
@@ -366,6 +366,10 @@ private:
static const CharacterPrev _charPreviews[];
+ // PC98 specific data
+ static const uint16 _charPosXPC98[];
+ static const uint8 _charNamesPC98[][11];
+
WSAMovie_v2 *_chargenWSA;
static const uint8 _chargenFrameTableTalkie[];
static const uint8 _chargenFrameTableFloppy[];
diff --git a/engines/kyra/screen.cpp b/engines/kyra/screen.cpp
index f5570acd72..6542b15183 100644
--- a/engines/kyra/screen.cpp
+++ b/engines/kyra/screen.cpp
@@ -51,6 +51,7 @@ Screen::Screen(KyraEngine_v1 *vm, OSystem *system)
memset(_fonts, 0, sizeof(_fonts));
_currentFont = FID_8_FNT;
+ _paletteChanged = true;
}
Screen::~Screen() {
@@ -206,6 +207,9 @@ void Screen::setResolution() {
}
void Screen::updateScreen() {
+ bool needRealUpdate = _forceFullUpdate || !_dirtyRects.empty() || _paletteChanged;
+ _paletteChanged = false;
+
if (_useOverlays)
updateDirtyRectsOvl();
else if (_isAmiga && _interfacePaletteEnabled)
@@ -214,13 +218,16 @@ void Screen::updateScreen() {
updateDirtyRects();
if (_debugEnabled) {
+ needRealUpdate = true;
+
if (!_useOverlays)
_system->copyRectToScreen(getPagePtr(2), SCREEN_W, 320, 0, SCREEN_W, SCREEN_H);
else
_system->copyRectToScreen(getPagePtr(2), SCREEN_W, 640, 0, SCREEN_W, SCREEN_H);
}
- _system->updateScreen();
+ if (needRealUpdate)
+ _system->updateScreen();
}
void Screen::updateDirtyRects() {
@@ -330,6 +337,7 @@ void Screen::updateDirtyRectsOvl() {
_system->copyRectToScreen(dst, 640, it->left<<1, it->top<<1, it->width()<<1, it->height()<<1);
}
}
+
_forceFullUpdate = false;
_dirtyRects.clear();
}
@@ -562,6 +570,12 @@ void Screen::setPagePixel(int pageNum, int x, int y, uint8 color) {
assert(x >= 0 && x < SCREEN_W && y >= 0 && y < SCREEN_H);
if (pageNum == 0 || pageNum == 1)
addDirtyRect(x, y, 1, 1);
+
+ if (_use16ColorMode) {
+ color &= 0x0F;
+ color |= (color << 4);
+ }
+
_pagePtrs[pageNum][y * SCREEN_W + x] = color;
}
@@ -703,6 +717,7 @@ void Screen::setScreenPalette(const Palette &pal) {
screenPal[4 * i + 3] = 0;
}
+ _paletteChanged = true;
_system->setPalette(screenPal, 0, pal.getNumColors());
}
@@ -738,6 +753,7 @@ void Screen::setInterfacePalette(const Palette &pal, uint8 r, uint8 g, uint8 b)
screenPal[4 * i + 3] = 0;
}
+ _paletteChanged = true;
_system->setPalette(screenPal, 32, pal.getNumColors());
}
@@ -954,6 +970,11 @@ void Screen::fillRect(int x1, int y1, int x2, int y2, uint8 color, int pageNum,
clearOverlayRect(pageNum, x1, y1, x2-x1+1, y2-y1+1);
+ if (_use16ColorMode) {
+ color &= 0x0F;
+ color |= (color << 4);
+ }
+
if (xored) {
for (; y1 <= y2; ++y1) {
for (int x = x1; x <= x2; ++x)
@@ -1035,6 +1056,11 @@ void Screen::drawClippedLine(int x1, int y1, int x2, int y2, int color) {
void Screen::drawLine(bool vertical, int x, int y, int length, int color) {
uint8 *ptr = getPagePtr(_curPage) + y * SCREEN_W + x;
+ if (_use16ColorMode) {
+ color &= 0x0F;
+ color |= (color << 4);
+ }
+
if (vertical) {
assert((y + length) <= SCREEN_H);
int currLine = 0;
@@ -2974,6 +3000,9 @@ byte *Screen::getOverlayPtr(int page) {
if (_vm->gameFlags().gameID == GI_KYRA2) {
if (page == 12 || page == 13)
return _sjisOverlayPtrs[3];
+ } else if (_vm->gameFlags().gameID == GI_LOL) {
+ if (page == 4 || page == 5)
+ return _sjisOverlayPtrs[3];
}
return 0;
diff --git a/engines/kyra/screen.h b/engines/kyra/screen.h
index 73a29ee2c7..7553a0132b 100644
--- a/engines/kyra/screen.h
+++ b/engines/kyra/screen.h
@@ -308,7 +308,6 @@ public:
virtual bool init();
virtual void setResolution();
-
void updateScreen();
// debug functions
@@ -508,6 +507,7 @@ protected:
};
bool _forceFullUpdate;
+ bool _paletteChanged;
Common::List<Common::Rect> _dirtyRects;
void addDirtyRect(int x, int y, int w, int h);
diff --git a/engines/kyra/script_hof.cpp b/engines/kyra/script_hof.cpp
index 1b8c1d32b3..a811952801 100644
--- a/engines/kyra/script_hof.cpp
+++ b/engines/kyra/script_hof.cpp
@@ -186,20 +186,14 @@ int KyraEngine_HoF::o2_displayWsaFrame(EMCState *script) {
int backUp = stackPos(8);
_screen->hideMouse();
- uint32 endTime = _system->getMillis() + waitTime * _tickLength;
+ const uint32 endTime = _system->getMillis() + waitTime * _tickLength;
_wsaSlots[slot]->displayFrame(frame, dstPage, x, y, copyParam | 0xC000, 0, 0);
_screen->updateScreen();
if (backUp)
memcpy(_gamePlayBuffer, _screen->getCPagePtr(3), 46080);
- while (_system->getMillis() < endTime) {
- if (doUpdate)
- update();
-
- if (endTime - _system->getMillis() >= 10)
- delay(10);
- }
+ delayUntil(endTime, false, doUpdate != 0);
_screen->showMouse();
return 0;
}
@@ -224,34 +218,22 @@ int KyraEngine_HoF::o2_displayWsaSequentialFramesLooping(EMCState *script) {
while (curTime < maxTimes) {
if (startFrame < endFrame) {
for (int i = startFrame; i <= endFrame; ++i) {
- uint32 endTime = _system->getMillis() + waitTime * _tickLength;
+ const uint32 endTime = _system->getMillis() + waitTime * _tickLength;
_wsaSlots[slot]->displayFrame(i, 0, x, y, 0xC000 | copyFlags, 0, 0);
if (!skipFlag()) {
_screen->updateScreen();
-
- do {
- update();
-
- if (endTime - _system->getMillis() >= 10)
- delay(10);
- } while (_system->getMillis() < endTime);
+ delayUntil(endTime, false, true);
}
}
} else {
for (int i = startFrame; i >= endFrame; --i) {
- uint32 endTime = _system->getMillis() + waitTime * _tickLength;
+ const uint32 endTime = _system->getMillis() + waitTime * _tickLength;
_wsaSlots[slot]->displayFrame(i, 0, x, y, 0xC000 | copyFlags, 0, 0);
if (!skipFlag()) {
_screen->updateScreen();
-
- do {
- update();
-
- if (endTime - _system->getMillis() >= 10 && !skipFlag())
- delay(10);
- } while (_system->getMillis() < endTime && !skipFlag());
+ delayUntil(endTime, false, true);
}
}
}
@@ -282,7 +264,7 @@ int KyraEngine_HoF::o2_displayWsaSequentialFrames(EMCState *script) {
_screen->hideMouse();
while (currentFrame <= lastFrame) {
- uint32 endTime = _system->getMillis() + frameDelay;
+ const uint32 endTime = _system->getMillis() + frameDelay;
_wsaSlots[index]->displayFrame(currentFrame++, 0, stackPos(0), stackPos(1), copyParam, 0, 0);
if (!skipFlag()) {
_screen->updateScreen();
@@ -310,7 +292,7 @@ int KyraEngine_HoF::o2_displayWsaSequence(EMCState *script) {
const int lastFrame = _wsaSlots[index]->frames();
while (currentFrame <= lastFrame) {
- uint32 endTime = _system->getMillis() + frameDelay;
+ const uint32 endTime = _system->getMillis() + frameDelay;
_wsaSlots[index]->displayFrame(currentFrame++, 0, stackPos(0), stackPos(1), copyParam, 0, 0);
if (!skipFlag()) {
if (doUpdate)
diff --git a/engines/kyra/script_lok.cpp b/engines/kyra/script_lok.cpp
index a778a2066b..0a96db8277 100644
--- a/engines/kyra/script_lok.cpp
+++ b/engines/kyra/script_lok.cpp
@@ -429,22 +429,13 @@ int KyraEngine_LoK::o1_runWSAFromBeginningToEnd(EMCState *script) {
int wsaFrame = 0;
while (running) {
+ const uint32 continueTime = waitTime * _tickLength + _system->getMillis();
+
_movieObjects[wsaIndex]->displayFrame(wsaFrame++, 0, xpos, ypos, 0, 0, 0);
- _animator->_updateScreen = true;
if (wsaFrame >= _movieObjects[wsaIndex]->frames())
running = false;
- uint32 continueTime = waitTime * _tickLength + _system->getMillis();
- while (_system->getMillis() < continueTime) {
- if (worldUpdate) {
- _sprites->updateSceneAnims();
- _animator->updateAllObjectShapes();
- } else {
- _screen->updateScreen();
- }
- if (continueTime - _system->getMillis() >= 10)
- delay(10);
- }
+ delayUntil(continueTime, false, worldUpdate != 0);
}
_screen->showMouse();
@@ -460,18 +451,9 @@ int KyraEngine_LoK::o1_displayWSAFrame(EMCState *script) {
int waitTime = stackPos(3);
int wsaIndex = stackPos(4);
_screen->hideMouse();
+ const uint32 continueTime = waitTime * _tickLength + _system->getMillis();
_movieObjects[wsaIndex]->displayFrame(frame, 0, xpos, ypos, 0, 0, 0);
- _animator->_updateScreen = true;
- uint32 continueTime = waitTime * _tickLength + _system->getMillis();
- while (_system->getMillis() < continueTime) {
- _sprites->updateSceneAnims();
- _animator->updateAllObjectShapes();
- if (skipFlag())
- break;
-
- if (continueTime - _system->getMillis() >= 10)
- delay(10);
- }
+ delayUntil(continueTime, false, true);
_screen->showMouse();
return 0;
}
@@ -501,15 +483,9 @@ int KyraEngine_LoK::o1_runWSAFrames(EMCState *script) {
int wsaIndex = stackPos(5);
_screen->hideMouse();
for (; startFrame <= endFrame; ++startFrame) {
- uint32 nextRun = _system->getMillis() + delayTime * _tickLength;
+ const uint32 nextRun = _system->getMillis() + delayTime * _tickLength;
_movieObjects[wsaIndex]->displayFrame(startFrame, 0, xpos, ypos, 0, 0, 0);
- _animator->_updateScreen = true;
- while (_system->getMillis() < nextRun) {
- _sprites->updateSceneAnims();
- _animator->updateAllObjectShapes();
- if (nextRun - _system->getMillis() >= 10)
- delay(10);
- }
+ delayUntil(nextRun, false, true);
}
_screen->showMouse();
return 0;
@@ -597,7 +573,6 @@ int KyraEngine_LoK::o1_setCustomPaletteRange(EMCState *script) {
int KyraEngine_LoK::o1_loadPageFromDisk(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_loadPageFromDisk(%p) ('%s', %d)", (const void *)script, stackPosString(0), stackPos(1));
_screen->loadPageFromDisk(stackPosString(0), stackPos(1));
- _animator->_updateScreen = true;
return 0;
}
@@ -665,7 +640,6 @@ int KyraEngine_LoK::o1_copyWSARegion(EMCState *script) {
int srcPage = stackPos(4);
int dstPage = stackPos(5);
_screen->copyRegion(xpos, ypos, xpos, ypos, width, height, srcPage, dstPage);
- _animator->_updateScreen = true;
return 0;
}
@@ -693,18 +667,9 @@ int KyraEngine_LoK::o1_displayWSAFrameOnHidPage(EMCState *script) {
int wsaIndex = stackPos(4);
_screen->hideMouse();
- uint32 continueTime = waitTime * _tickLength + _system->getMillis();
+ const uint32 continueTime = waitTime * _tickLength + _system->getMillis();
_movieObjects[wsaIndex]->displayFrame(frame, 2, xpos, ypos, 0, 0, 0);
- _animator->_updateScreen = true;
- while (_system->getMillis() < continueTime) {
- _sprites->updateSceneAnims();
- _animator->updateAllObjectShapes();
- if (skipFlag())
- break;
-
- if (continueTime - _system->getMillis() >= 10)
- delay(10);
- }
+ delayUntil(continueTime, false, true);
_screen->showMouse();
return 0;
@@ -776,37 +741,17 @@ int KyraEngine_LoK::o1_displayWSASequentialFrames(EMCState *script) {
if (endFrame >= startFrame) {
int frame = startFrame;
while (endFrame >= frame) {
- uint32 continueTime = waitTime * _tickLength + _system->getMillis();
+ const uint32 continueTime = waitTime * _tickLength + _system->getMillis();
_movieObjects[wsaIndex]->displayFrame(frame, 0, xpos, ypos, 0, 0, 0);
- if (waitTime)
- _animator->_updateScreen = true;
- while (_system->getMillis() < continueTime) {
- _sprites->updateSceneAnims();
- _animator->updateAllObjectShapes();
- if (skipFlag())
- break;
-
- if (continueTime - _system->getMillis() >= 10)
- delay(10);
- }
+ delayUntil(continueTime, false, true);
++frame;
}
} else {
int frame = startFrame;
while (endFrame <= frame) {
- uint32 continueTime = waitTime * _tickLength + _system->getMillis();
+ const uint32 continueTime = waitTime * _tickLength + _system->getMillis();
_movieObjects[wsaIndex]->displayFrame(frame, 0, xpos, ypos, 0, 0, 0);
- if (waitTime)
- _animator->_updateScreen = true;
- while (_system->getMillis() < continueTime) {
- _sprites->updateSceneAnims();
- _animator->updateAllObjectShapes();
- if (skipFlag())
- break;
-
- if (continueTime - _system->getMillis() >= 10)
- delay(10);
- }
+ delayUntil(continueTime, false, true);
--frame;
}
}
@@ -1060,16 +1005,7 @@ int KyraEngine_LoK::o1_walkCharacterToPoint(EMCState *script) {
setCharacterPosition(character, 0);
++curPos;
- nextFrame = _timer->getDelay(5 + character) * _tickLength + _system->getMillis();
- while (_system->getMillis() < nextFrame) {
- _sprites->updateSceneAnims();
- updateMousePointer();
- _timer->update();
- _animator->updateAllObjectShapes();
- updateTextFade();
- if ((nextFrame - _system->getMillis()) >= 10)
- delay(10);
- }
+ delayUntil(nextFrame = _timer->getDelay(5 + character) * _tickLength + _system->getMillis(), true, true);
}
return 0;
}
@@ -1318,9 +1254,8 @@ int KyraEngine_LoK::o1_makeAmuletAppear(EMCState *script) {
assert(_amuleteAnim);
_screen->hideMouse();
snd_playSoundEffect(0x70);
- uint32 nextTime = 0;
for (int i = 0; _amuleteAnim[i] != 0xFF; ++i) {
- nextTime = _system->getMillis() + 5 * _tickLength;
+ const uint32 nextTime = _system->getMillis() + 5 * _tickLength;
uint8 code = _amuleteAnim[i];
if (code == 3 || code == 7)
@@ -1333,14 +1268,7 @@ int KyraEngine_LoK::o1_makeAmuletAppear(EMCState *script) {
snd_playSoundEffect(0x73);
amulet->displayFrame(code, 0, 224, 152, 0, 0, 0);
- _animator->_updateScreen = true;
-
- while (_system->getMillis() < nextTime) {
- _sprites->updateSceneAnims();
- _animator->updateAllObjectShapes();
- if (nextTime - _system->getMillis() >= 10)
- delay(10);
- }
+ delayUntil(nextTime, false, true);
}
_screen->showMouse();
}
diff --git a/engines/kyra/script_mr.cpp b/engines/kyra/script_mr.cpp
index 819bf838ca..9943fe419d 100644
--- a/engines/kyra/script_mr.cpp
+++ b/engines/kyra/script_mr.cpp
@@ -266,7 +266,7 @@ int KyraEngine_MR::o3_wipeDownMouseItem(EMCState *script) {
for (int curY = y, height = 20; height > 0; height -= 2, curY += 2) {
restoreGfxRect32x32(x, y);
_screen->setNewShapeHeight(shape, height);
- uint32 waitTime = _system->getMillis() + _tickLength;
+ const uint32 waitTime = _system->getMillis() + _tickLength;
_screen->drawShape(0, shape, x, curY, 0, 0);
_screen->updateScreen();
delayUntil(waitTime);
@@ -1131,15 +1131,7 @@ int KyraEngine_MR::o3d_updateAnim(EMCState *script) {
int KyraEngine_MR::o3d_delay(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3d_delay(%p) (%d)", (const void *)script, stackPos(0));
- const uint32 endTime = _system->getMillis() + stackPos(0) * _tickLength;
- while (_system->getMillis() < endTime) {
- if (_chatText)
- updateWithText();
- else
- update();
-
- _system->delayMillis(10);
- }
+ delayUntil(_system->getMillis() + stackPos(0) * _tickLength, false, true);
return 0;
}
diff --git a/engines/kyra/sequences_lok.cpp b/engines/kyra/sequences_lok.cpp
index d2ef351767..d13dc2d291 100644
--- a/engines/kyra/sequences_lok.cpp
+++ b/engines/kyra/sequences_lok.cpp
@@ -1944,7 +1944,6 @@ void KyraEngine_LoK::updateKyragemFading() {
}
_screen->setScreenPalette(_screen->getPalette(0));
- _animator->_updateScreen = true;
switch (_kyragemFadingState.nextOperation) {
case 0:
diff --git a/engines/kyra/sequences_lol.cpp b/engines/kyra/sequences_lol.cpp
index c1ceba34e9..3b061e5062 100644
--- a/engines/kyra/sequences_lol.cpp
+++ b/engines/kyra/sequences_lol.cpp
@@ -289,18 +289,56 @@ int LoLEngine::chooseCharacter() {
_screen->setFont(Screen::FID_9_FNT);
_screen->_curPage = 2;
- for (int i = 0; i < 4; ++i)
- _screen->fprintStringIntro("%s", _charPreviews[i].x + 16, _charPreviews[i].y + 36, 0xC0, 0x00, 0x9C, 0x120, _charPreviews[i].name);
+ if (_flags.platform == Common::kPlatformPC98) {
+ _screen->fillRect(17, 29, 94, 97, 17);
+ _screen->fillRect(68, 167, 310, 199, 17);
+ _screen->drawClippedLine(68, 166, 311, 166, 238);
+ _screen->drawClippedLine(68, 166, 68, 199, 238);
+ _screen->drawClippedLine(311, 166, 311, 199, 238);
- for (int i = 0; i < 4; ++i) {
- _screen->fprintStringIntro("%d", _charPreviews[i].x + 21, _charPreviews[i].y + 48, 0x98, 0x00, 0x9C, 0x220, _charPreviews[i].attrib[0]);
- _screen->fprintStringIntro("%d", _charPreviews[i].x + 21, _charPreviews[i].y + 56, 0x98, 0x00, 0x9C, 0x220, _charPreviews[i].attrib[1]);
- _screen->fprintStringIntro("%d", _charPreviews[i].x + 21, _charPreviews[i].y + 64, 0x98, 0x00, 0x9C, 0x220, _charPreviews[i].attrib[2]);
- }
+ _screen->_curPage = 4;
+ _screen->fillRect(17, 29, 94, 97, 17);
+ _screen->_curPage = 2;
+
+ for (int i = 0; i < 4; ++i) {
+ _screen->printText((const char *)_charNamesPC98[i], _charPosXPC98[i], 168, 0xC1, 0x00);
+
+ // Since our SJIS font does not support ASCII digits currently, we have to use the
+ // digits from the SJIS range, which looks different to the original.
+ for (int j = 0; j < 3; ++j) {
+ uint8 buffer[5];
+ snprintf((char *)buffer, 5, "%2d", _charPreviews[i].attrib[j]);
+
+ buffer[3] = buffer[1] - '0' + 0x4F;
+ buffer[2] = 0x82;
+ if (buffer[0] != ' ') {
+ buffer[1] = buffer[0] - '0' + 0x4F;
+ buffer[0] = 0x82;
+ } else {
+ buffer[1] = 0x40;
+ buffer[0] = 0x81;
+ }
+ buffer[4] = 0x00;
+
+ _screen->printText((const char *)buffer, _charPosXPC98[i] + 16, 176 + j * 8, 0x81, 0x00);
+ }
+ }
- _screen->fprintStringIntro("%s", 36, 173, 0x98, 0x00, 0x9C, 0x20, _tim->getCTableEntry(51));
- _screen->fprintStringIntro("%s", 36, 181, 0x98, 0x00, 0x9C, 0x20, _tim->getCTableEntry(53));
- _screen->fprintStringIntro("%s", 36, 189, 0x98, 0x00, 0x9C, 0x20, _tim->getCTableEntry(55));
+ _screen->printText(_tim->getCTableEntry(51), 72, 176, 0x81, 0x00);
+ _screen->printText(_tim->getCTableEntry(53), 72, 184, 0x81, 0x00);
+ _screen->printText(_tim->getCTableEntry(55), 72, 192, 0x81, 0x00);
+ } else {
+ for (int i = 0; i < 4; ++i) {
+ _screen->fprintStringIntro("%s", _charPreviews[i].x + 16, _charPreviews[i].y + 36, 0xC0, 0x00, 0x9C, 0x120, _charPreviews[i].name);
+ _screen->fprintStringIntro("%d", _charPreviews[i].x + 21, _charPreviews[i].y + 48, 0x98, 0x00, 0x9C, 0x220, _charPreviews[i].attrib[0]);
+ _screen->fprintStringIntro("%d", _charPreviews[i].x + 21, _charPreviews[i].y + 56, 0x98, 0x00, 0x9C, 0x220, _charPreviews[i].attrib[1]);
+ _screen->fprintStringIntro("%d", _charPreviews[i].x + 21, _charPreviews[i].y + 64, 0x98, 0x00, 0x9C, 0x220, _charPreviews[i].attrib[2]);
+ }
+
+ _screen->fprintStringIntro("%s", 36, 173, 0x98, 0x00, 0x9C, 0x20, _tim->getCTableEntry(51));
+ _screen->fprintStringIntro("%s", 36, 181, 0x98, 0x00, 0x9C, 0x20, _tim->getCTableEntry(53));
+ _screen->fprintStringIntro("%s", 36, 189, 0x98, 0x00, 0x9C, 0x20, _tim->getCTableEntry(55));
+ }
_screen->copyRegion(0, 0, 0, 0, 320, 200, 2, 0, Screen::CR_NO_P_CHECK);
_screen->_curPage = 0;
@@ -337,6 +375,8 @@ int LoLEngine::chooseCharacter() {
} else {
break;
}
+
+ delay(10);
}
if (shouldQuit())
@@ -363,11 +403,13 @@ void LoLEngine::kingSelectionIntro() {
_screen->copyRegion(0, 0, 0, 0, 112, 120, 4, 0, Screen::CR_NO_P_CHECK);
int y = 38;
- _screen->fprintStringIntro("%s", 8, y, 0x32, 0x00, 0x9C, 0x20, _tim->getCTableEntry(57));
- _screen->fprintStringIntro("%s", 8, y + 10, 0x32, 0x00, 0x9C, 0x20, _tim->getCTableEntry(58));
- _screen->fprintStringIntro("%s", 8, y + 20, 0x32, 0x00, 0x9C, 0x20, _tim->getCTableEntry(59));
- _screen->fprintStringIntro("%s", 8, y + 30, 0x32, 0x00, 0x9C, 0x20, _tim->getCTableEntry(60));
- _screen->fprintStringIntro("%s", 8, y + 40, 0x32, 0x00, 0x9C, 0x20, _tim->getCTableEntry(61));
+ if (_flags.platform == Common::kPlatformPC98) {
+ for (int i = 0; i < 5; ++i)
+ _screen->printText(_tim->getCTableEntry(57 + i), 16, 32 + i * 8, 0xC1, 0x00);
+ } else {
+ for (int i = 0; i < 5; ++i)
+ _screen->fprintStringIntro("%s", 8, y + i * 10, 0x32, 0x00, 0x9C, 0x20, _tim->getCTableEntry(57 + i));
+ }
_sound->voicePlay("KING01", &_speechHandle);
@@ -405,8 +447,13 @@ void LoLEngine::kingSelectionReminder() {
_screen->copyRegion(0, 0, 0, 0, 112, 120, 4, 0, Screen::CR_NO_P_CHECK);
int y = 48;
- _screen->fprintStringIntro("%s", 8, y, 0x32, 0x00, 0x9C, 0x20, _tim->getCTableEntry(62));
- _screen->fprintStringIntro("%s", 8, y + 10, 0x32, 0x00, 0x9C, 0x20, _tim->getCTableEntry(63));
+ if (_flags.platform == Common::kPlatformPC98) {
+ _screen->printText(_tim->getCTableEntry(62), 16, 32, 0xC1, 0x00);
+ _screen->printText(_tim->getCTableEntry(63), 16, 40, 0xC1, 0x00);
+ } else {
+ _screen->fprintStringIntro("%s", 8, y, 0x32, 0x00, 0x9C, 0x20, _tim->getCTableEntry(62));
+ _screen->fprintStringIntro("%s", 8, y + 10, 0x32, 0x00, 0x9C, 0x20, _tim->getCTableEntry(63));
+ }
_sound->voicePlay("KING02", &_speechHandle);
@@ -540,13 +587,17 @@ int LoLEngine::selectionCharInfo(int character) {
static const uint8 charSelectInfoIdx[] = { 0x1D, 0x22, 0x27, 0x2C };
const int idx = charSelectInfoIdx[character];
- _screen->fprintStringIntro("%s", 50, 127, 0x53, 0x00, 0xCF, 0x20, _tim->getCTableEntry(idx+0));
- _screen->fprintStringIntro("%s", 50, 137, 0x53, 0x00, 0xCF, 0x20, _tim->getCTableEntry(idx+1));
- _screen->fprintStringIntro("%s", 50, 147, 0x53, 0x00, 0xCF, 0x20, _tim->getCTableEntry(idx+2));
- _screen->fprintStringIntro("%s", 50, 157, 0x53, 0x00, 0xCF, 0x20, _tim->getCTableEntry(idx+3));
- _screen->fprintStringIntro("%s", 50, 167, 0x53, 0x00, 0xCF, 0x20, _tim->getCTableEntry(idx+4));
+ if (_flags.platform == Common::kPlatformPC98) {
+ for (int i = 0; i < 5; ++i)
+ _screen->printText(_tim->getCTableEntry(idx+i), 60, 128 + i * 8, 0x41, 0x00);
+
+ _screen->printText(_tim->getCTableEntry(69), 112, 168, 0x01, 0x00);
+ } else {
+ for (int i = 0; i < 5; ++i)
+ _screen->fprintStringIntro("%s", 50, 127 + i * 10, 0x53, 0x00, 0xCF, 0x20, _tim->getCTableEntry(idx+i));
- _screen->fprintStringIntro("%s", 100, 168, 0x32, 0x00, 0xCF, 0x20, _tim->getCTableEntry(69));
+ _screen->fprintStringIntro("%s", 100, 168, 0x32, 0x00, 0xCF, 0x20, _tim->getCTableEntry(69));
+ }
selectionCharInfoIntro(vocFilename);
if (_charSelectionInfoResult == -1) {
@@ -568,11 +619,13 @@ int LoLEngine::selectionCharInfo(int character) {
_screen->copyRegion(48, 127, 48, 160, 272, 35, 4, 0, Screen::CR_NO_P_CHECK);
_screen->copyRegion(0, 0, 0, 0, 112, 120, 4, 0, Screen::CR_NO_P_CHECK);
- _screen->fprintStringIntro("%s", 3, 28, 0x32, 0x00, 0x9C, 0x20, _tim->getCTableEntry(64));
- _screen->fprintStringIntro("%s", 3, 38, 0x32, 0x00, 0x9C, 0x20, _tim->getCTableEntry(65));
- _screen->fprintStringIntro("%s", 3, 48, 0x32, 0x00, 0x9C, 0x20, _tim->getCTableEntry(66));
- _screen->fprintStringIntro("%s", 3, 58, 0x32, 0x00, 0x9C, 0x20, _tim->getCTableEntry(67));
- _screen->fprintStringIntro("%s", 3, 68, 0x32, 0x00, 0x9C, 0x20, _tim->getCTableEntry(68));
+ if (_flags.platform == Common::kPlatformPC98) {
+ for (int i = 0; i < 5; ++i)
+ _screen->printText(_tim->getCTableEntry(64+i), 16, 32 + i * 8, 0xC1, 0x00);
+ } else {
+ for (int i = 0; i < 5; ++i)
+ _screen->fprintStringIntro("%s", 3, 28 + i * 10, 0x32, 0x00, 0x9C, 0x20, _tim->getCTableEntry(64+i));
+ }
resetSkipFlag();
kingSelectionOutro();
@@ -875,20 +928,15 @@ void HistoryPlayer::play() {
while (sound->voiceIsPlaying() && !_vm->shouldQuit() && !_vm->skipFlag())
_vm->delay(10);
- if (_vm->skipFlag()) {
+ if (_vm->skipFlag())
sound->voiceStop();
- _vm->resetSkipFlag();
- }
++voiceFilename[4];
}
-
- if (_vm->skipFlag())
- _vm->resetSkipFlag();
}
if (_vm->skipFlag())
- _vm->resetSkipFlag();
+ _vm->_eventList.clear();
pal.fill(0, 256, 63);
if (_fireWsa->opened())
@@ -899,6 +947,9 @@ void HistoryPlayer::play() {
_screen->clearPage(0);
pal.fill(0, 256, 0);
_screen->fadePalette(pal, 0x3C);
+
+ if (_vm->skipFlag())
+ _vm->_eventList.clear();
}
void HistoryPlayer::loadWsa(const char *filename) {
diff --git a/engines/kyra/staticres.cpp b/engines/kyra/staticres.cpp
index 51288f31df..4f3824479d 100644
--- a/engines/kyra/staticres.cpp
+++ b/engines/kyra/staticres.cpp
@@ -3196,6 +3196,17 @@ const LoLEngine::CharacterPrev LoLEngine::_charPreviews[] = {
{ "Conrad", 0x10F, 0x7F, { 0x0A, 0x0C, 0x0A } }
};
+const uint16 LoLEngine::_charPosXPC98[] = {
+ 92, 152, 212, 268
+};
+
+const uint8 LoLEngine::_charNamesPC98[][11] = {
+ { 0x83, 0x41, 0x83, 0x4E, 0x83, 0x56, 0x83, 0x46, 0x83, 0x8B, 0x00 },
+ { 0x83, 0x7D, 0x83, 0x43, 0x83, 0x50, 0x83, 0x8B, 0x00, 0x00, 0x00 },
+ { 0x83, 0x4C, 0x81, 0x5B, 0x83, 0x89, 0x83, 0x93, 0x00, 0x00, 0x00 },
+ { 0x83, 0x52, 0x83, 0x93, 0x83, 0x89, 0x83, 0x62, 0x83, 0x68, 0x00 }
+};
+
const uint8 LoLEngine::_chargenFrameTableTalkie[] = {
0x00, 0x01, 0x02, 0x03, 0x04,
0x05, 0x04, 0x03, 0x02, 0x01,
diff --git a/engines/kyra/text_lok.cpp b/engines/kyra/text_lok.cpp
index d2128b7037..178966196c 100644
--- a/engines/kyra/text_lok.cpp
+++ b/engines/kyra/text_lok.cpp
@@ -97,7 +97,6 @@ void KyraEngine_LoK::waitForChatToFinish(int vocFile, int16 chatDuration, const
currPage = _screen->_curPage;
_screen->_curPage = 2;
_text->printCharacterText(chatStr, charNum, _characterList[charNum].x1);
- _animator->_updateScreen = true;
_screen->_curPage = currPage;
}
diff --git a/engines/sci/detection.cpp b/engines/sci/detection.cpp
index ee9fd5fb18..4b373a76f6 100644
--- a/engines/sci/detection.cpp
+++ b/engines/sci/detection.cpp
@@ -2308,6 +2308,15 @@ static const struct SciGameDescription SciGameDescriptions[] = {
0
},
+ // Quest for Glory 2 - English DOS Non-Interactive Demo
+ // Executable scanning reports "1.000.046"
+ {{"qfg2", "Demo", {
+ {"resource.map", 0, "e75eb86bdd517b3ef709058249986a87", 906},
+ {"resource.001", 0, "9b098f9e1008abe30e56c93b896494e6", 362123},
+ {NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, ADGF_DEMO, GUIO_NOSPEECH},
+ 0
+ },
+
// Quest for Glory 3 - English DOS Non-Interactive Demo (from FRG)
// Executable scanning reports "1.001.021", VERSION file reports "1.000, 0.001.059, 6.12.92"
{{"qfg3", "Demo", {
diff --git a/engines/sci/engine/game.cpp b/engines/sci/engine/game.cpp
index c34ac1cf00..f649d97412 100644
--- a/engines/sci/engine/game.cpp
+++ b/engines/sci/engine/game.cpp
@@ -43,7 +43,7 @@ int _reset_graphics_input(EngineState *s) {
gfx_color_t transparent = { PaletteEntry(), 0, -1, -1, 0 };
debug(2, "Initializing graphics");
- if (!s->resmgr->isVGA()) {
+ if (s->resmgr->getViewType() == kViewEga) {
for (int i = 0; i < 16; i++) {
if (gfxop_set_color(s->gfx_state, &(s->ega_colors[i]), gfx_sci0_image_colors[sci0_palette][i].r,
gfx_sci0_image_colors[sci0_palette][i].g, gfx_sci0_image_colors[sci0_palette][i].b, 0, -1, -1)) {
diff --git a/engines/sci/engine/kernel.cpp b/engines/sci/engine/kernel.cpp
index 223e7fc1e9..a871df936f 100644
--- a/engines/sci/engine/kernel.cpp
+++ b/engines/sci/engine/kernel.cpp
@@ -820,7 +820,7 @@ void Kernel::setDefaultKernelNames() {
}
#ifdef ENABLE_SCI32
-static void vocab_get_knames11(ResourceManager *resmgr, Common::StringList &names) {
+//static void vocab_get_knames11(ResourceManager *resmgr, Common::StringList &names) {
/*
999.voc format for SCI1.1 games:
[b] # of kernel functions
@@ -830,7 +830,7 @@ static void vocab_get_knames11(ResourceManager *resmgr, Common::StringList &name
{[w name-len][function name]}
...
*/
- //unsigned int size = 64, pos = 3;
+/* //unsigned int size = 64, pos = 3;
int len;
Resource *r = resmgr->findResource(ResourceId(kResourceTypeVocab, VOCAB_RESOURCE_KNAMES), 0);
if(r == NULL) // failed to open vocab.999 (happens with SCI1 demos)
@@ -843,7 +843,7 @@ static void vocab_get_knames11(ResourceManager *resmgr, Common::StringList &name
len = READ_LE_UINT16(r->data + off);
names[i] = Common::String((char *)r->data + off + 2, len);
}
-}
+}*/
#endif
bool Kernel::loadKernelNames() {
diff --git a/engines/sci/engine/klists.cpp b/engines/sci/engine/klists.cpp
index 43d1f25e01..a9ae77972f 100644
--- a/engines/sci/engine/klists.cpp
+++ b/engines/sci/engine/klists.cpp
@@ -36,7 +36,7 @@ Node *lookup_node(EngineState *s, reg_t addr) {
if (!mobj) {
// FIXME: This occurs right at the beginning of SQ4, when walking north from the first screen. It doesn't
// seem to have any apparent ill-effects, though, so it's been changed to non-fatal, for now
- //error("%s, L%d: Attempt to use non-node %04x:%04x as list node\n", __FILE__, __LINE__, PRINT_REG(addr));
+ //error("%s, L%d: Attempt to use non-node %04x:%04x as list node", __FILE__, __LINE__, PRINT_REG(addr));
warning("Attempt to use non-node %04x:%04x as list node", PRINT_REG(addr));
return NULL;
}
@@ -44,7 +44,7 @@ Node *lookup_node(EngineState *s, reg_t addr) {
NodeTable *nt = (NodeTable *)mobj;
if (!nt->isValidEntry(addr.offset)) {
- error("Attempt to use non-node %04x:%04x as list node\n", PRINT_REG(addr));
+ error("Attempt to use non-node %04x:%04x as list node", PRINT_REG(addr));
return NULL;
}
@@ -55,14 +55,14 @@ List *lookup_list(EngineState *s, reg_t addr) {
MemObject *mobj = GET_SEGMENT(*s->seg_manager, addr.segment, MEM_OBJ_LISTS);
if (!mobj) {
- error("Attempt to use non-list %04x:%04x as list\n", PRINT_REG(addr));
+ error("Attempt to use non-list %04x:%04x as list", PRINT_REG(addr));
return NULL;
}
ListTable *lt = (ListTable *)mobj;
if (!lt->isValidEntry(addr.offset)) {
- error("Attempt to use non-list %04x:%04x as list\n", PRINT_REG(addr));
+ error("Attempt to use non-list %04x:%04x as list", PRINT_REG(addr));
return NULL;
}
diff --git a/engines/sci/engine/kmisc.cpp b/engines/sci/engine/kmisc.cpp
index 2f0072ec67..90ae88b73f 100644
--- a/engines/sci/engine/kmisc.cpp
+++ b/engines/sci/engine/kmisc.cpp
@@ -63,14 +63,27 @@ reg_t kHaveMouse(EngineState *s, int funct_nr, int argc, reg_t *argv) {
return make_reg(0, -1);
}
+enum kMemoryInfoFunc {
+ K_MEMORYINFO_LARGEST_HEAP_BLOCK = 0, // Largest heap block available
+ K_MEMORYINFO_FREE_HEAP = 1, // Total free heap memory
+ K_MEMORYINFO_LARGEST_HUNK_BLOCK = 2, // Largest available hunk memory block
+ K_MEMORYINFO_FREE_HUNK = 3, // Amount of free DOS paragraphs
+ K_MEMORYINFO_TOTAL_HUNK = 4 // Total amount of hunk memory (SCI01)
+};
+
reg_t kMemoryInfo(EngineState *s, int funct_nr, int argc, reg_t *argv) {
+ uint16 size = 0x7fff; // Must not be 0xffff, or some memory calculations will overflow
+
switch (argv[0].offset) {
- case 0: // Total free heap memory
- case 1: // Largest heap block available
- case 2: // Largest available hunk memory block
- case 3: // Total amount of hunk memory
- case 4: // Amount of free DOS paragraphs- SCI01
- return make_reg(0, 0x7fff); // Must not be 0xffff, or some memory calculations will overflow
+ case K_MEMORYINFO_LARGEST_HEAP_BLOCK:
+ // In order to prevent "Memory fragmented" dialogs from
+ // popping up in some games, we must return FREE_HEAP - 2 here.
+ return make_reg(0, size - 2);
+ case K_MEMORYINFO_FREE_HEAP:
+ case K_MEMORYINFO_LARGEST_HUNK_BLOCK:
+ case K_MEMORYINFO_FREE_HUNK:
+ case K_MEMORYINFO_TOTAL_HUNK:
+ return make_reg(0, size);
default:
warning("Unknown MemoryInfo operation: %04x", argv[0].offset);
diff --git a/engines/sci/engine/kpathing.cpp b/engines/sci/engine/kpathing.cpp
index da24a388fa..ad14202257 100644
--- a/engines/sci/engine/kpathing.cpp
+++ b/engines/sci/engine/kpathing.cpp
@@ -1406,7 +1406,7 @@ static PathfindingState *convert_polygon_set(EngineState *s, reg_t poly_list, Co
err = nearest_intersection(pf_s, start, end, &intersection);
if (err == PF_FATAL) {
- warning("AvoidPath: fatal error finding nearest intersecton");
+ warning("AvoidPath: fatal error finding nearest intersection");
delete pf_s;
return NULL;
}
diff --git a/engines/sci/engine/kscripts.cpp b/engines/sci/engine/kscripts.cpp
index 4d90dd68ac..41eb9f624d 100644
--- a/engines/sci/engine/kscripts.cpp
+++ b/engines/sci/engine/kscripts.cpp
@@ -74,7 +74,7 @@ int invoke_selector(EngineState *s, reg_t object, int selector_id, SelectorInvoc
warning("Selector '%s' of object at %04x:%04x could not be invoked (%s L%d)",
((SciEngine*)g_engine)->getKernel()->getSelectorName(selector_id).c_str(), PRINT_REG(object), fname, line);
if (noinvalid == kStopOnInvalidSelector)
- error("[Kernel] Not recoverable: VM was halted\n");
+ error("[Kernel] Not recoverable: VM was halted");
return 1;
}
if (slc_type == kSelectorVariable) // Swallow silently
diff --git a/engines/sci/engine/seg_manager.cpp b/engines/sci/engine/seg_manager.cpp
index a6f54c5bf7..ddcd639f3c 100644
--- a/engines/sci/engine/seg_manager.cpp
+++ b/engines/sci/engine/seg_manager.cpp
@@ -166,7 +166,7 @@ void SegManager::setScriptSize(Script &scr, int script_nr) {
}
if (scr.buf_size > 65535) {
- error("Script and heap sizes combined exceed 64K.\n"
+ error("Script and heap sizes combined exceed 64K."
"This means a fundamental design bug was made in SCI\n"
"regarding SCI1.1 games.\nPlease report this so it can be"
"fixed in the next major version");
@@ -688,7 +688,7 @@ void SegManager::scriptInitialiseObjectsSci11(SegmentId seg) {
int species = READ_LE_UINT16(seeker + 10);
if (species < 0 || species >= (int)_classtable.size()) {
- error("Invalid species %d(0x%x) not in interval [0,%d) while instantiating script %d\n",
+ error("Invalid species %d(0x%x) not in interval [0,%d) while instantiating script %d",
species, species, _classtable.size(), scr->nr);
return;
}
diff --git a/engines/sci/engine/static_selectors.cpp b/engines/sci/engine/static_selectors.cpp
index c1d0ad9bac..9c2abbfbc9 100644
--- a/engines/sci/engine/static_selectors.cpp
+++ b/engines/sci/engine/static_selectors.cpp
@@ -26,9 +26,6 @@
// We place selector vocab name tables here for any game that doesn't have
// them. This includes the King's Quest IV Demo and LSL3 Demo.
-#ifndef SCI_STATIC_SELECTORS_H
-#define SCI_STATIC_SELECTORS_H
-
#include "sci/engine/kernel.h"
namespace Sci {
@@ -397,6 +394,100 @@ static const SelectorRemap iceman_demo_selectors[] = {
{ "setTarget", 171 }
};
+// Taken from Space Quest 1 VGA (Demo)
+static const SelectorRemap lsl5_demo_selectors[] = {
+ { "init", 103 },
+ { "play", 42 },
+ { "replay", 65 },
+ { "x", 4 },
+ { "y", 3 },
+ { "z", 85 },
+ { "priority", 63 },
+ { "view", 5 },
+ { "loop", 6 },
+ { "cel", 7 },
+ { "brLeft", 20 },
+ { "brRight", 22 },
+ { "brTop", 19 },
+ { "brBottom", 21 },
+ { "xStep", 54 },
+ { "yStep", 55 },
+ { "nsBottom", 11 },
+ { "nsTop", 9 },
+ { "nsLeft", 10 },
+ { "nsRight", 12 },
+ { "font", 33 },
+ { "text", 26 },
+ { "type", 34 },
+ { "state", 32 },
+ { "doit", 60 },
+ { "delete", 84 },
+ { "signal", 17 },
+ { "underBits", 8 },
+ { "canBeHere", 57 },
+ { "client", 45 },
+ { "dx", 46 },
+ { "dy", 47 },
+ { "xStep", 54 },
+ { "yStep", 55 },
+ { "b-moveCnt", 48 },
+ { "b-i1", 49 },
+ { "b-i2", 50 },
+ { "b-di", 51 },
+ { "b-xAxis", 52 },
+ { "b-incr", 53 },
+ { "completed", 207 },
+ { "illegalBits", 18 },
+ { "dispose", 104 },
+ { "prevSignal", 148 },
+ { "message", 40 },
+ { "modifiers", 64 },
+ { "cue", 135 },
+ { "owner", 149 },
+ { "handle", 93 },
+ { "number", 43 },
+ { "max", 37 },
+ { "cursor", 36 },
+ { "claimed", 76 },
+ { "edgeHit", 308 },
+ { "wordFail", 71 },
+ { "syntaxFail", 72 },
+ { "semanticFail", 73 },
+ { "cycler", 212 },
+ { "elements", 27 },
+ { "lsTop", 13 },
+ { "lsBottom", 15 },
+ { "lsLeft", 14 },
+ { "lsRight", 16 },
+ { "baseSetter", 277 },
+ { "who", 39 },
+ { "distance", 221 },
+ { "mover", 59 },
+ { "looper", 62 },
+ { "isBlocked", 61 },
+ { "heading", 58 },
+ { "mode", 30 },
+ { "caller", 133 },
+ { "moveDone", 100 },
+ { "vol", 97 },
+ { "pri", 98 },
+ { "min", 94 },
+ { "sec", 95 },
+ { "frame", 96 },
+ { "dataInc", 92 },
+ { "size", 89 },
+ { "palette", 91 },
+ { "moveSpeed", 56 },
+ { "nodePtr", 44 },
+ { "flags", 150 },
+ { "points", 90 },
+ { "printLang", 87 },
+ { "subtitleLang", 88 },
+ { "parseLang", 86 },
+ { "motionCue", 210 },
+ { "egoMoveSpeed", 357 }
+};
+
// A macro for loading one of the above tables in the function below
#define USE_SELECTOR_TABLE(x) \
do { \
@@ -420,10 +511,10 @@ Common::StringList Kernel::checkStaticSelectorNames() {
USE_SELECTOR_TABLE(christmas1992_selectors);
else if (gameID == "lsl1sci")
USE_SELECTOR_TABLE(lsl1_demo_selectors);
+ else if (gameID == "lsl5")
+ USE_SELECTOR_TABLE(lsl5_demo_selectors);
return names;
}
} // End of namespace Sci
-
-#endif // SCI_STATIC_SELECTORS_H
diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp
index 64ee7243fb..943a8e0354 100644
--- a/engines/sci/engine/vm.cpp
+++ b/engines/sci/engine/vm.cpp
@@ -79,7 +79,7 @@ static StackPtr validate_stack_addr(EngineState *s, StackPtr sp) {
if (sp >= s->stack_base && sp < s->stack_top)
return sp;
- error("[VM] Stack index %d out of valid range [%d..%d]\n",
+ error("[VM] Stack index %d out of valid range [%d..%d]",
(int)(sp - s->stack_base), 0, (int)(s->stack_top - s->stack_base - 1));
return 0;
}
@@ -87,9 +87,9 @@ static StackPtr validate_stack_addr(EngineState *s, StackPtr sp) {
static int validate_arithmetic(reg_t reg) {
if (reg.segment) {
if (g_debug_weak_validations)
- warning("[VM] Attempt to read arithmetic value from non-zero segment [%04x]\n", reg.segment);
+ warning("[VM] Attempt to read arithmetic value from non-zero segment [%04x]", reg.segment);
else
- error("[VM] Attempt to read arithmetic value from non-zero segment [%04x]\n", reg.segment);
+ error("[VM] Attempt to read arithmetic value from non-zero segment [%04x]", reg.segment);
return 0;
}
@@ -99,9 +99,9 @@ static int validate_arithmetic(reg_t reg) {
static int signed_validate_arithmetic(reg_t reg) {
if (reg.segment) {
if (g_debug_weak_validations)
- warning("[VM] Attempt to read arithmetic value from non-zero segment [%04x]\n", reg.segment);
+ warning("[VM] Attempt to read arithmetic value from non-zero segment [%04x]", reg.segment);
else
- error("[VM] Attempt to read arithmetic value from non-zero segment [%04x]\n", reg.segment);
+ error("[VM] Attempt to read arithmetic value from non-zero segment [%04x]", reg.segment);
return 0;
}
@@ -214,7 +214,7 @@ ExecStack *execute_method(EngineState *s, uint16 script, uint16 pubfunct, StackP
int temp = s->seg_manager->validateExportFunc(pubfunct, seg);
if (!temp) {
- error("Request for invalid exported function 0x%x of script 0x%x\n", pubfunct, script);
+ error("Request for invalid exported function 0x%x of script 0x%x", pubfunct, script);
return NULL;
}
@@ -319,7 +319,7 @@ ExecStack *send_selector(EngineState *s, reg_t send_obj, reg_t work_obj, StackPt
break;
}
- error("Send to invalid selector 0x%x of object at %04x:%04x\n", 0xffff & selector, PRINT_REG(send_obj));
+ error("Send to invalid selector 0x%x of object at %04x:%04x", 0xffff & selector, PRINT_REG(send_obj));
break;
@@ -930,7 +930,7 @@ void run_vm(EngineState *s, int restoring) {
}
if (opparams[0] >= (int)((SciEngine*)g_engine)->getKernel()->_kernelFuncs.size()) {
- error("Invalid kernel function 0x%x requested\n", opparams[0]);
+ error("Invalid kernel function 0x%x requested", opparams[0]);
} else {
int argc = ASSERT_ARITHMETIC(scriptState.xs->sp[0]);
@@ -941,7 +941,7 @@ void run_vm(EngineState *s, int restoring) {
&& !kernel_matches_signature(s,
((SciEngine*)g_engine)->getKernel()->_kernelFuncs[opparams[0]].signature, argc,
scriptState.xs->sp + 1)) {
- error("[VM] Invalid arguments to kernel call %x\n", opparams[0]);
+ error("[VM] Invalid arguments to kernel call %x", opparams[0]);
} else {
s->r_acc = ((SciEngine*)g_engine)->getKernel()->_kernelFuncs[opparams[0]].fun(s, opparams[0],
argc, scriptState.xs->sp + 1);
@@ -1195,7 +1195,7 @@ void run_vm(EngineState *s, int restoring) {
#ifndef DISABLE_VALIDATIONS
if (r_temp.offset >= code_buf_size) {
error("VM: lofss operation overflowed: %04x:%04x beyond end"
- " of script (at %04x)\n", PRINT_REG(r_temp), code_buf_size);
+ " of script (at %04x)", PRINT_REG(r_temp), code_buf_size);
}
#endif
PUSH32(r_temp);
@@ -1492,7 +1492,7 @@ SelectorType lookup_selector(EngineState *s, reg_t obj_location, Selector select
if (!obj) {
- error("lookup_selector(): Error while looking up Species class.\nOriginal address was %04x:%04x. Species address was %04x:%04x\n",
+ error("lookup_selector(): Error while looking up Species class.\nOriginal address was %04x:%04x. Species address was %04x:%04x",
PRINT_REG(obj_location), PRINT_REG(obj->_variables[SCRIPT_SPECIES_SELECTOR]));
return kSelectorNone;
}
diff --git a/engines/sci/gfx/gfx_resmgr.cpp b/engines/sci/gfx/gfx_resmgr.cpp
index a5596d1e4a..8ce7a50ed5 100644
--- a/engines/sci/gfx/gfx_resmgr.cpp
+++ b/engines/sci/gfx/gfx_resmgr.cpp
@@ -100,7 +100,7 @@ int GfxResManager::calculatePic(gfxr_pic_t *scaled_pic, gfxr_pic_t *unscaled_pic
if (_version == SCI_VERSION_1_1)
gfxr_draw_pic11(unscaled_pic, flags, default_palette, res->size, res->data, &basic_style, res->id.number, _staticPalette, _portBounds);
else
- gfxr_draw_pic01(unscaled_pic, flags, default_palette, res->size, res->data, &basic_style, res->id.number, _resManager->isVGA(), _staticPalette, _portBounds);
+ gfxr_draw_pic01(unscaled_pic, flags, default_palette, res->size, res->data, &basic_style, res->id.number, _resManager->getViewType(), _staticPalette, _portBounds);
}
if (scaled_pic && scaled_pic->undithered_buffer)
@@ -109,9 +109,9 @@ int GfxResManager::calculatePic(gfxr_pic_t *scaled_pic, gfxr_pic_t *unscaled_pic
if (_version == SCI_VERSION_1_1)
gfxr_draw_pic11(scaled_pic, flags, default_palette, res->size, res->data, &style, res->id.number, _staticPalette, _portBounds);
else
- gfxr_draw_pic01(scaled_pic, flags, default_palette, res->size, res->data, &style, res->id.number, _resManager->isVGA(), _staticPalette, _portBounds);
+ gfxr_draw_pic01(scaled_pic, flags, default_palette, res->size, res->data, &style, res->id.number, _resManager->getViewType(), _staticPalette, _portBounds);
- if (!_resManager->isVGA()) {
+ if (_version <= SCI_VERSION_1_EGA) {
if (need_unscaled)
gfxr_remove_artifacts_pic0(scaled_pic, unscaled_pic);
@@ -532,28 +532,25 @@ gfxr_view_t *GfxResManager::getView(int nr, int *loop, int *cel, int palette) {
return NULL;
int resid = GFXR_RES_ID(GFX_RESOURCE_TYPE_VIEW, nr);
-
- if (!_resManager->isVGA()) {
+ ViewType viewType = _resManager->getViewType();
+
+ if (viewType == kViewEga) {
int pal = (_version <= SCI_VERSION_01) ? -1 : palette;
view = getEGAView(resid, viewRes->data, viewRes->size, pal);
} else {
- if (_version < SCI_VERSION_1_1)
- view = getVGAView(resid, viewRes->data, viewRes->size, _staticPalette, false);
- else
- view = getVGAView(resid, viewRes->data, viewRes->size, 0, true);
-
- if (!view->palette) {
- view->palette = new Palette(_staticPalette->size());
- view->palette->name = "interpreter_get_view";
- }
-
- // Palettize view
- for (unsigned i = 0; i < MIN(view->palette->size(), _staticPalette->size()); i++) {
- const PaletteEntry& vc = view->palette->getColor(i);
- if (vc.r == 0 && vc.g == 0 && vc.b == 0) {
- const PaletteEntry& sc = _staticPalette->getColor(i);
- view->palette->setColor(i, sc.r, sc.g, sc.b);
+ view = getVGAView(resid, viewRes->data, viewRes->size, viewType);
+
+ if (view->palette) {
+ // Palettize view
+ for (unsigned i = 0; i < MIN(view->palette->size(), _staticPalette->size()); i++) {
+ const PaletteEntry& vc = view->palette->getColor(i);
+ if (vc.r == 0 && vc.g == 0 && vc.b == 0) {
+ const PaletteEntry& sc = _staticPalette->getColor(i);
+ view->palette->setColor(i, sc.r, sc.g, sc.b);
+ }
}
+ } else {
+ view->palette = _staticPalette->getref();
}
}
diff --git a/engines/sci/gfx/gfx_resource.h b/engines/sci/gfx/gfx_resource.h
index 9c83cf07cd..35d7ef58d6 100644
--- a/engines/sci/gfx/gfx_resource.h
+++ b/engines/sci/gfx/gfx_resource.h
@@ -77,6 +77,15 @@ extern gfx_pixmap_color_t gfx_sci0_image_colors[][16];
*/
extern Palette* gfx_sci0_pic_colors;
+
+enum ViewType {
+ kViewUnknown,
+ kViewEga,
+ kViewVga,
+ kViewVga11,
+ kViewAmiga
+};
+
struct gfxr_pic0_params_t {
gfx_line_mode_t line_mode; /* one of GFX_LINE_MODE_* */
gfx_brush_mode_t brush_mode;
@@ -190,13 +199,13 @@ void gfxr_clear_pic0(gfxr_pic_t *pic, int titlebar_size);
* @param[in] resource Pointer to the resource data
* @param[in] style The drawing style
* @param[in] resid The resource ID
- * @param[in] sci1 true if SCI1, false otherwise
+ * @param[in] viewType The view type for embedded views
* @param[in] static_pal The static palette
* @param[in] portBounds The bounds of the port being drawn to
*/
void gfxr_draw_pic01(gfxr_pic_t *pic, int fill_normally,
int default_palette, int size, byte *resource,
- gfxr_pic0_params_t *style, int resid, int sci1,
+ gfxr_pic0_params_t *style, int resid, ViewType viewType,
Palette *static_pal, Common::Rect portBounds);
/**
@@ -312,9 +321,9 @@ Palette *gfxr_read_pal11(int id, byte *resource, int size);
* @param[in] isSci11 true if SCI1.1, false otherwise
* @return The resulting view
*/
-gfxr_view_t *getVGAView(int id, byte *resource, int size, Palette *static_pal, bool isSci11);
+gfxr_view_t *getVGAView(int id, byte *resource, int size, ViewType viewType);
-gfx_pixmap_t *gfxr_draw_cel1(int id, int loop, int cel, int mirrored, byte *resource, byte *cel_base, int size, gfxr_view_t *view, bool isAmiga, bool isSci11);
+gfx_pixmap_t *gfxr_draw_cel1(int id, int loop, int cel, int mirrored, byte *resource, byte *cel_base, int size, gfxr_view_t *view, ViewType viewType);
/** @} */
} // End of namespace Sci
diff --git a/engines/sci/gfx/res_pic.cpp b/engines/sci/gfx/res_pic.cpp
index 6c35ad314e..09b98d12aa 100644
--- a/engines/sci/gfx/res_pic.cpp
+++ b/engines/sci/gfx/res_pic.cpp
@@ -1135,7 +1135,7 @@ extern gfx_pixmap_t *gfxr_draw_cel0(int id, int loop, int cel, byte *resource, i
extern void _gfx_crossblit_simple(byte *dest, byte *src, int dest_line_width, int src_line_width, int xl, int yl, int bpp);
void gfxr_draw_pic01(gfxr_pic_t *pic, int flags, int default_palette, int size, byte *resource,
- gfxr_pic0_params_t *style, int resid, int sci1, Palette *static_pal, Common::Rect portBounds) {
+ gfxr_pic0_params_t *style, int resid, ViewType viewType, Palette *static_pal, Common::Rect portBounds) {
const int default_palette_table[GFXR_PIC0_PALETTE_SIZE] = {
0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77,
0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0x88,
@@ -1189,7 +1189,7 @@ void gfxr_draw_pic01(gfxr_pic_t *pic, int flags, int default_palette, int size,
case PIC_OP_SET_COLOR:
p0printf("Set color @%d\n", pos);
- if (!sci1) {
+ if (viewType == kViewEga) {
pal = *(resource + pos++);
index = pal % GFXR_PIC0_PALETTE_SIZE;
pal /= GFXR_PIC0_PALETTE_SIZE;
@@ -1216,7 +1216,7 @@ void gfxr_draw_pic01(gfxr_pic_t *pic, int flags, int default_palette, int size,
case PIC_OP_SET_PRIORITY:
p0printf("Set priority @%d\n", pos);
- if (!sci1) {
+ if (viewType == kViewEga) {
pal = *(resource + pos++);
index = pal % GFXR_PIC0_PALETTE_SIZE;
pal /= GFXR_PIC0_PALETTE_SIZE; // Ignore pal
@@ -1425,7 +1425,7 @@ void gfxr_draw_pic01(gfxr_pic_t *pic, int flags, int default_palette, int size,
opx = *(resource + pos++);
p0printf("OPX: ");
- if (sci1)
+ if (viewType != kViewEga)
opx += SCI1_OP_OFFSET; // See comment at the definition of SCI1_OP_OFFSET.
switch (opx) {
@@ -1509,11 +1509,13 @@ void gfxr_draw_pic01(gfxr_pic_t *pic, int flags, int default_palette, int size,
bytesize = (*(resource + pos)) + (*(resource + pos + 1) << 8);
p0printf("(%d, %d)\n", posx, posy);
pos += 2;
- if (!sci1 && !nodraw)
- view = gfxr_draw_cel0(-1, -1, -1, resource + pos, bytesize, NULL, flags & DRAWPIC1_FLAG_MIRRORED);
- else
- view = gfxr_draw_cel1(-1, -1, -1, flags & DRAWPIC1_FLAG_MIRRORED, resource + pos, resource + pos,
- bytesize, NULL, (static_pal && static_pal->size() == GFX_SCI1_AMIGA_COLORS_NR), false);
+ if (!nodraw) {
+ if (viewType == kViewEga)
+ view = gfxr_draw_cel0(-1, -1, -1, resource + pos, bytesize, NULL, flags & DRAWPIC1_FLAG_MIRRORED);
+ else
+ view = gfxr_draw_cel1(-1, -1, -1, flags & DRAWPIC1_FLAG_MIRRORED, resource + pos, resource + pos,
+ bytesize, NULL, viewType);
+ }
pos += bytesize;
if (nodraw)
continue;
@@ -1526,20 +1528,22 @@ void gfxr_draw_pic01(gfxr_pic_t *pic, int flags, int default_palette, int size,
// we can only safely replace the palette if it's static
// *if it's not for some reason, we should die
- if (view->palette && view->palette->isShared() && !sci1) {
+ if (view->palette && view->palette->isShared() && (viewType == kViewEga)) {
warning("gfx_draw_pic0(): can't set a non-static palette for an embedded view");
}
// For SCI0, use special color mapping to copy the low
// nibble of the color index to the high nibble.
- if (sci1) {
- if (static_pal && static_pal->size() == GFX_SCI1_AMIGA_COLORS_NR) {
- // Assume Amiga game
+ if (viewType != kViewEga) {
+ if (view->palette)
+ view->palette->free();
+
+ if (viewType == kViewAmiga) {
pic->visual_map->palette = static_pal->getref();
+ } else {
+ view->palette = pic->visual_map->palette->copy();
}
- if (view->palette) view->palette->free();
- view->palette = pic->visual_map->palette->copy();
} else
view->palette = embedded_view_pal->getref();
@@ -1648,7 +1652,7 @@ void gfxr_draw_pic11(gfxr_pic_t *pic, int flags, int default_palette, int size,
pic->visual_map->palette = gfxr_read_pal11(-1, resource + palette_data_ptr, 1284);
if (has_bitmap)
- view = gfxr_draw_cel1(-1, 0, 0, flags & DRAWPIC1_FLAG_MIRRORED, resource, resource + bitmap_data_ptr, size - bitmap_data_ptr, NULL, 0, true);
+ view = gfxr_draw_cel1(-1, 0, 0, flags & DRAWPIC1_FLAG_MIRRORED, resource, resource + bitmap_data_ptr, size - bitmap_data_ptr, NULL, kViewVga11);
if (view) {
view->palette = pic->visual_map->palette->getref();
@@ -1677,7 +1681,7 @@ void gfxr_draw_pic11(gfxr_pic_t *pic, int flags, int default_palette, int size,
warning("[GFX] No view was contained in SCI1.1 pic resource");
}
- gfxr_draw_pic01(pic, flags, default_palette, size - vector_data_ptr, resource + vector_data_ptr, style, resid, 1, static_pal, portBounds);
+ gfxr_draw_pic01(pic, flags, default_palette, size - vector_data_ptr, resource + vector_data_ptr, style, resid, kViewVga11, static_pal, portBounds);
}
void gfxr_dither_pic0(gfxr_pic_t *pic, int dmode, int pattern) {
diff --git a/engines/sci/gfx/res_view.cpp b/engines/sci/gfx/res_view.cpp
index d484136f8e..95f6919b0c 100644
--- a/engines/sci/gfx/res_view.cpp
+++ b/engines/sci/gfx/res_view.cpp
@@ -326,19 +326,19 @@ static int decompress_sci_view_amiga(int id, int loop, int cel, byte *resource,
return 0;
}
-gfx_pixmap_t *gfxr_draw_cel1(int id, int loop, int cel, int mirrored, byte *resource, byte *cel_base, int size, gfxr_view_t *view, bool isAmiga, bool isSci11) {
+gfx_pixmap_t *gfxr_draw_cel1(int id, int loop, int cel, int mirrored, byte *resource, byte *cel_base, int size, gfxr_view_t *view, ViewType viewType) {
int xl = READ_LE_UINT16(cel_base);
int yl = READ_LE_UINT16(cel_base + 2);
int pixmap_size = xl * yl;
- int xdisplace = isSci11 ? READ_LE_UINT16(cel_base + 4) : (int8) cel_base[4];
- int ydisplace = isSci11 ? READ_LE_UINT16(cel_base + 6) : cel_base[5];
- int runlength_offset = isSci11 ? READ_LE_UINT16(cel_base + 24) : 8;
- int literal_offset = isSci11 ? READ_LE_UINT16(cel_base + 28) : 8;
+ int xdisplace = (viewType == kViewVga11) ? READ_LE_UINT16(cel_base + 4) : (int8) cel_base[4];
+ int ydisplace = (viewType == kViewVga11) ? READ_LE_UINT16(cel_base + 6) : cel_base[5];
+ int runlength_offset = (viewType == kViewVga11) ? READ_LE_UINT16(cel_base + 24) : 8;
+ int literal_offset = (viewType == kViewVga11) ? READ_LE_UINT16(cel_base + 28) : 8;
gfx_pixmap_t *retval = gfx_pixmap_alloc_index_data(gfx_new_pixmap(xl, yl, id, loop, cel));
byte *dest = retval->index_data;
int decompress_failed;
- retval->color_key = cel_base[isSci11 ? 8 : 6];
+ retval->color_key = cel_base[(viewType == kViewVga11) ? 8 : 6];
retval->xoffset = mirrored ? xdisplace : -xdisplace;
retval->yoffset = -ydisplace;
// FIXME: In LSL5, it seems that the inventory has views without palettes (or we don't load palettes properly)
@@ -350,12 +350,12 @@ gfx_pixmap_t *gfxr_draw_cel1(int id, int loop, int cel, int mirrored, byte *reso
return NULL;
}
- if (!isAmiga)
- decompress_failed = decompress_sci_view(id, loop, cel, resource, dest, mirrored, pixmap_size, size, runlength_offset,
- literal_offset, xl, yl, retval->color_key);
- else
+ if (viewType == kViewAmiga)
decompress_failed = decompress_sci_view_amiga(id, loop, cel, resource, dest, mirrored, pixmap_size, size, runlength_offset,
xl, yl, retval->color_key);
+ else
+ decompress_failed = decompress_sci_view(id, loop, cel, resource, dest, mirrored, pixmap_size, size, runlength_offset,
+ literal_offset, xl, yl, retval->color_key);
if (decompress_failed) {
gfx_free_pixmap(retval);
@@ -365,27 +365,22 @@ gfx_pixmap_t *gfxr_draw_cel1(int id, int loop, int cel, int mirrored, byte *reso
return retval;
}
-gfxr_view_t *getVGAView(int id, byte *resource, int size, Palette *static_pal, bool isSci11) {
- uint16 palOffset = READ_LE_UINT16(resource + V1_PALETTE_OFFSET + (isSci11 ? 2 : 0));
- uint16 headerSize = isSci11 ? READ_LE_UINT16(resource + V2_HEADER_SIZE) : 0;
+gfxr_view_t *getVGAView(int id, byte *resource, int size, ViewType viewType) {
+ uint16 palOffset = READ_LE_UINT16(resource + V1_PALETTE_OFFSET + ((viewType == kViewVga11) ? 2 : 0));
+ uint16 headerSize = (viewType == kViewVga11) ? READ_LE_UINT16(resource + V2_HEADER_SIZE) : 0;
byte* seeker = resource + headerSize;
uint16 loopOffset = 0;
- int amiga_game = 0;
gfxr_view_t *view = (gfxr_view_t *)malloc(sizeof(gfxr_view_t));
view->ID = id;
view->flags = 0;
- view->loops_nr = READ_LE_UINT16(resource + V1_LOOPS_NR_OFFSET + (isSci11 ? 2 : 0)) & 0xFF;
+ view->loops_nr = READ_LE_UINT16(resource + V1_LOOPS_NR_OFFSET + ((viewType == kViewVga11) ? 2 : 0)) & 0xFF;
if (palOffset > 0) {
- if (!isSci11)
- view->palette = gfxr_read_pal1(id, resource + palOffset, size - palOffset);
- else
+ if (viewType == kViewVga11)
view->palette = gfxr_read_pal11(id, resource + palOffset, size - palOffset);
- } else if (static_pal && static_pal->size() == GFX_SCI1_AMIGA_COLORS_NR) {
- // Assume we're running an amiga game.
- amiga_game = 1;
- view->palette = static_pal->getref();
+ else
+ view->palette = gfxr_read_pal1(id, resource + palOffset, size - palOffset);
} else {
view->palette = NULL;
}
@@ -393,7 +388,7 @@ gfxr_view_t *getVGAView(int id, byte *resource, int size, Palette *static_pal, b
view->loops = (gfxr_loop_t *)calloc(view->loops_nr, sizeof(gfxr_loop_t));
for (int i = 0; i < view->loops_nr; i++) {
- if (!isSci11) {
+ if (viewType != kViewVga11) {
bool mirrored = READ_LE_UINT16(resource + V1_MIRROR_MASK) & (1 << i);
loopOffset = READ_LE_UINT16(resource + V1_FIRST_LOOP_OFFSET + (i << 1));
view->loops[i].cels_nr = READ_LE_UINT16(resource + loopOffset);
@@ -405,7 +400,7 @@ gfxr_view_t *getVGAView(int id, byte *resource, int size, Palette *static_pal, b
resource + cel_offset,
resource + cel_offset,
size - cel_offset,
- view, amiga_game, false);
+ view, viewType);
}
} else {
byte copy_entry = seeker[V2_COPY_OF_LOOP];
@@ -417,7 +412,7 @@ gfxr_view_t *getVGAView(int id, byte *resource, int size, Palette *static_pal, b
byte* cellSeeker = resource + loopOffset;
for (int j = 0; j < view->loops[i].cels_nr; j++) {
- view->loops[i].cels[j] = gfxr_draw_cel1(id, i, j, mirrored, resource, cellSeeker, size, view, 0, true);
+ view->loops[i].cels[j] = gfxr_draw_cel1(id, i, j, mirrored, resource, cellSeeker, size, view, viewType);
cellSeeker += resource[V2_BYTES_PER_CEL];
}
diff --git a/engines/sci/resource.cpp b/engines/sci/resource.cpp
index 9b9c9ee26c..9e3bcb067e 100644
--- a/engines/sci/resource.cpp
+++ b/engines/sci/resource.cpp
@@ -510,7 +510,7 @@ void ResourceManager::init() {
if (_sciVersion != SCI_VERSION_AUTODETECT)
debug("Resmgr: Detected %s", versionNames[_sciVersion]);
else
- debug("Resmgr: Couldn't determine SCI version");
+ warning("Resmgr: Couldn't determine SCI version");
switch (_viewType) {
case kViewEga:
@@ -521,6 +521,12 @@ void ResourceManager::init() {
break;
case kViewVga11:
debug("Resmgr: Detected SCI1.1 VGA graphic resources");
+ break;
+ case kViewAmiga:
+ debug("Resmgr: Detected Amiga graphic resources");
+ break;
+ default:
+ warning("Resmgr: Couldn't determine view type");
}
}
@@ -904,7 +910,7 @@ void ResourceManager::processPatch(ResourceSource *source, ResourceType restype,
patch_data_offset = 2;
break;
default:
- warning("Resource patch unsupported special case %X\n", patch_data_offset);
+ warning("Resource patch unsupported special case %X", patch_data_offset);
}
}
@@ -1016,7 +1022,7 @@ int ResourceManager::readResourceMapSCI0(ResourceSource *map) {
res->id = resId;
res->source = getVolume(map, offset >> bShift);
if (!res->source) {
- warning("Could not get volume for resource %d, VolumeID %d\n", id, offset >> bShift);
+ warning("Could not get volume for resource %d, VolumeID %d", id, offset >> bShift);
}
_resMap.setVal(resId, res);
}
@@ -1500,22 +1506,64 @@ ResourceCompression ResourceManager::getViewCompression() {
return kCompNone;
}
-ResourceManager::ViewType ResourceManager::detectViewType() {
+ViewType ResourceManager::detectViewType() {
for (int i = 0; i < 1000; i++) {
Resource *res = findResource(ResourceId(kResourceTypeView, i), 0);
+
if (res) {
- //FIXME: Amiga
switch(res->data[1]) {
- case 0:
- return kViewEga;
- default:
+ case 128:
+ // If the 2nd byte is 128, it's a VGA game
return kViewVga;
+ case 0:
+ // EGA or Amiga, try to read as Amiga view
+
+ if (res->size < 10)
+ return kViewUnknown;
+
+ // Read offset of first loop
+ uint16 offset = READ_LE_UINT16(res->data + 8);
+
+ if (offset + 6U >= res->size)
+ return kViewUnknown;
+
+ // Read offset of first cel
+ offset = READ_LE_UINT16(res->data + offset + 4);
+
+ if (offset + 4U >= res->size)
+ return kViewUnknown;
+
+ // Check palette offset, amiga views have no palette
+ if (READ_LE_UINT16(res->data + 6) != 0)
+ return kViewEga;
+
+ uint16 width = READ_LE_UINT16(res->data + offset);
+ offset += 2;
+ uint16 height = READ_LE_UINT16(res->data + offset);
+ offset += 6;
+
+ // Check that the RLE data stays within bounds
+ int y;
+ for (y = 0; y < height; y++) {
+ int x = 0;
+
+ while ((x < width) && (offset < res->size)) {
+ byte op = res->data[offset++];
+ x += (op & 0x07) ? op & 0x07 : op >> 3;
+ }
+
+ // Make sure we got exactly the right number of pixels for this row
+ if (x != width)
+ return kViewEga;
+ }
+
+ return kViewAmiga;
}
}
}
warning("Resmgr: Couldn't find any views");
- return kViewVga;
+ return kViewUnknown;
}
SciVersion ResourceManager::detectSciVersion() {
diff --git a/engines/sci/resource.h b/engines/sci/resource.h
index 4250225ffe..5ba2d03beb 100644
--- a/engines/sci/resource.h
+++ b/engines/sci/resource.h
@@ -34,6 +34,8 @@
#include "sound/audiostream.h"
#include "sound/mixer.h" // for SoundHandle
+#include "gfx/gfx_resource.h" // for ViewType
+
#include "sci/decompressor.h"
namespace Common {
@@ -230,15 +232,10 @@ public:
kResVersionSci32
};
- // TODO: Amiga
- enum ViewType {
- kViewEga,
- kViewVga,
- kViewVga11
- };
-
bool isVGA() const { return (_viewType == kViewVga) || (_viewType == kViewVga11); }
+ ViewType getViewType() const { return _viewType; }
+
/**
* Returns the SCI version as detected by the resource manager
* @return SCI version
diff --git a/engines/sci/sfx/core.cpp b/engines/sci/sfx/core.cpp
index 95d79b3666..c8cf773eae 100644
--- a/engines/sci/sfx/core.cpp
+++ b/engines/sci/sfx/core.cpp
@@ -1060,7 +1060,7 @@ static void deDPCM16(byte *soundBuf, Common::SeekableReadStream &audioStream, ui
s += tableDPCM16[b];
s = CLIP<int32>(s, -32768, 32767);
- *out++ = TO_BE_16(s);
+ *out++ = s;
}
}
@@ -1070,7 +1070,7 @@ static void deDPCM8Nibble(byte *soundBuf, int32 &s, byte b) {
else
s += tableDPCM8[b & 7];
s = CLIP<int32>(s, 0, 255);
- *soundBuf = s;
+ *soundBuf = TO_LE_16(s);
}
static void deDPCM8(byte *soundBuf, Common::SeekableReadStream &audioStream, uint32 n) {
@@ -1106,7 +1106,8 @@ static byte* readSOLAudio(Common::SeekableReadStream *audioStream, uint32 &size,
// Convert the SOL stream flags to our own format
flags = 0;
if (audioFlags & kSolFlag16Bit)
- flags |= Audio::Mixer::FLAG_16BITS;
+ flags |= Audio::Mixer::FLAG_16BITS | Audio::Mixer::FLAG_LITTLE_ENDIAN;
+
if (!(audioFlags & kSolFlagIsSigned))
flags |= Audio::Mixer::FLAG_UNSIGNED;
diff --git a/engines/scumm/dialogs.cpp b/engines/scumm/dialogs.cpp
index 63ac952265..53097b6815 100644
--- a/engines/scumm/dialogs.cpp
+++ b/engines/scumm/dialogs.cpp
@@ -213,8 +213,6 @@ ScummDialog::ScummDialog(String name) : GUI::Dialog(name) {
#pragma mark -
-Common::StringList generateSavegameList(ScummEngine *scumm, bool saveMode);
-
enum {
kSaveCmd = 'SAVE',
kLoadCmd = 'LOAD',
@@ -226,213 +224,6 @@ enum {
kChooseCmd = 'CHOS'
};
-SaveLoadChooser::SaveLoadChooser(const String &title, const String &buttonLabel, bool saveMode, ScummEngine *engine)
- : Dialog("ScummSaveLoad"), _saveMode(saveMode), _list(0), _chooseButton(0), _gfxWidget(0), _vm(engine) {
-
- _backgroundType = GUI::ThemeEngine::kDialogBackgroundSpecial;
-
- new StaticTextWidget(this, "ScummSaveLoad.Title", title);
-
- // Add choice list
- _list = new GUI::ListWidget(this, "ScummSaveLoad.List");
- _list->setEditable(saveMode);
- _list->setNumberingMode(saveMode ? GUI::kListNumberingOne : GUI::kListNumberingZero);
-
-// Tanoku: SVNMerge removed this. Unconvinient. ///////////////
-// _container = new GUI::ContainerWidget(this, 0, 0, 10, 10);
-///////////////////////////////////////////////////////////////
-
- _gfxWidget = new GUI::GraphicsWidget(this, 0, 0, 10, 10);
-
- _date = new StaticTextWidget(this, 0, 0, 10, 10, "No date saved", kTextAlignCenter);
- _time = new StaticTextWidget(this, 0, 0, 10, 10, "No time saved", kTextAlignCenter);
- _playtime = new StaticTextWidget(this, 0, 0, 10, 10, "No playtime saved", kTextAlignCenter);
-
- // Buttons
- new GUI::ButtonWidget(this, "ScummSaveLoad.Cancel", "Cancel", kCloseCmd, 0);
- _chooseButton = new GUI::ButtonWidget(this, "ScummSaveLoad.Choose", buttonLabel, kChooseCmd, 0);
- _chooseButton->setEnabled(false);
-
- _container = new GUI::ContainerWidget(this, 0, 0, 10, 10);
-// _container->setHints(GUI::THEME_HINT_USE_SHADOW);
-}
-
-SaveLoadChooser::~SaveLoadChooser() {
-}
-
-const Common::String &SaveLoadChooser::getResultString() const {
- return _list->getSelectedString();
-}
-
-void SaveLoadChooser::setList(const StringList& list) {
- _list->setList(list);
-}
-
-int SaveLoadChooser::runModal() {
- if (_gfxWidget)
- _gfxWidget->setGfx(0);
- int ret = Dialog::runModal();
- return ret;
-}
-
-void SaveLoadChooser::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) {
- int selItem = _list->getSelected();
- switch (cmd) {
- case GUI::kListItemActivatedCmd:
- case GUI::kListItemDoubleClickedCmd:
- if (selItem >= 0) {
- if (_saveMode || !getResultString().empty()) {
- _list->endEditMode();
- setResult(selItem);
- close();
- }
- }
- break;
- case kChooseCmd:
- _list->endEditMode();
- setResult(selItem);
- close();
- break;
- case GUI::kListSelectionChangedCmd: {
- if (_gfxWidget) {
- updateInfos(true);
- }
-
- if (_saveMode) {
- _list->startEditMode();
- }
- // Disable button if nothing is selected, or (in load mode) if an empty
- // list item is selected. We allow choosing an empty item in save mode
- // because we then just assign a default name.
- _chooseButton->setEnabled(selItem >= 0 && (_saveMode || !getResultString().empty()));
- _chooseButton->draw();
- } break;
- case kCloseCmd:
- setResult(-1);
- default:
- Dialog::handleCommand(sender, cmd, data);
- }
-}
-
-void SaveLoadChooser::reflowLayout() {
- if (g_gui.xmlEval()->getVar("Globals.ScummSaveLoad.ExtInfo.Visible") == 1) {
- int16 x, y;
- uint16 w, h;
-
- if (!g_gui.xmlEval()->getWidgetData("ScummSaveLoad.Thumbnail", x, y, w, h))
- error("Error when loading position data for Save/Load Thumbnails.");
-
- int thumbW = kThumbnailWidth;
- int thumbH = ((g_system->getHeight() % 200 && g_system->getHeight() != 350) ? kThumbnailHeight2 : kThumbnailHeight1);
- int thumbX = x + (w >> 1) - (thumbW >> 1);
- int thumbY = y + kLineHeight;
-
- _container->resize(x, y, w, h);
- _gfxWidget->resize(thumbX, thumbY, thumbW, thumbH);
-
- int height = thumbY + thumbH + kLineHeight;
-
- _date->resize(thumbX, height, kThumbnailWidth, kLineHeight);
-
- height += kLineHeight;
-
- _time->resize(thumbX, height, kThumbnailWidth, kLineHeight);
-
- height += kLineHeight;
-
- _playtime->resize(thumbX, height, kThumbnailWidth, kLineHeight);
-
- _container->setVisible(true);
- _gfxWidget->setVisible(true);
- _date->setVisible(true);
- _time->setVisible(true);
- _playtime->setVisible(true);
-
- _fillR = 0; //g_gui.evaluator()->getVar("scummsaveload_thumbnail.fillR");
- _fillG = 0; //g_gui.evaluator()->getVar("scummsaveload_thumbnail.fillG");
- _fillB = 0; //g_gui.evaluator()->getVar("scummsaveload_thumbnail.fillB");
- } else {
- _container->setVisible(false);
- _gfxWidget->setVisible(false);
- _date->setVisible(false);
- _time->setVisible(false);
- _playtime->setVisible(false);
- }
-
- Dialog::reflowLayout();
-
- if (_container->isVisible())
- updateInfos(false);
-}
-
-void SaveLoadChooser::updateInfos(bool redraw) {
- int selItem = _list->getSelected();
- Graphics::Surface *thumb = 0;
- if (selItem >= 0 && !_list->getSelectedString().empty())
- thumb = _vm->loadThumbnailFromSlot(_saveMode ? selItem + 1 : selItem);
-
- if (thumb) {
- _gfxWidget->setGfx(thumb);
- _gfxWidget->useAlpha(256);
- thumb->free();
- delete thumb;
- } else {
- _gfxWidget->setGfx(-1, -1, _fillR, _fillG, _fillB);
- }
-
- InfoStuff infos;
- memset(&infos, 0, sizeof(InfoStuff));
- if (selItem >= 0 && !_list->getSelectedString().empty()
- && _vm->loadInfosFromSlot(_saveMode ? selItem + 1 : selItem, &infos)) {
- char buffer[32];
- snprintf(buffer, 32, "Date: %.2d.%.2d.%.4d",
- (infos.date >> 24) & 0xFF, (infos.date >> 16) & 0xFF,
- infos.date & 0xFFFF);
- _date->setLabel(buffer);
-
- snprintf(buffer, 32, "Time: %.2d:%.2d",
- (infos.time >> 8) & 0xFF, infos.time & 0xFF);
- _time->setLabel(buffer);
-
- int minutes = infos.playtime / 60;
- int hours = minutes / 60;
- minutes %= 60;
-
- snprintf(buffer, 32, "Playtime: %.2d:%.2d", hours, minutes);
- _playtime->setLabel(buffer);
- } else {
- _date->setLabel("No date saved");
- _time->setLabel("No time saved");
- _playtime->setLabel("No playtime saved");
- }
-
- if (redraw) {
- _gfxWidget->draw();
- _date->draw();
- _time->draw();
- _playtime->draw();
- }
-}
-
-#pragma mark -
-
-Common::StringList generateSavegameList(ScummEngine *scumm, bool saveMode) {
- // Get savegame descriptions
- Common::StringList descriptions;
- uint i = saveMode ? 1 : 0; //the autosave is on slot #0
- bool avail_saves[81];
-
- scumm->listSavegames(avail_saves, ARRAYSIZE(avail_saves));
- for (; i < ARRAYSIZE(avail_saves); i++) {
- Common::String name;
- if (avail_saves[i])
- scumm->getSavegameName(i, name);
- descriptions.push_back(name);
- }
-
- return descriptions;
-}
-
ScummMenuDialog::ScummMenuDialog(ScummEngine *scumm)
: ScummDialog("ScummMain"), _vm(scumm) {
@@ -457,8 +248,10 @@ ScummMenuDialog::ScummMenuDialog(ScummEngine *scumm)
#ifndef DISABLE_HELP
_helpDialog = new HelpDialog(scumm->_game);
#endif
- _saveDialog = new SaveLoadChooser("Save game:", "Save", true, scumm);
- _loadDialog = new SaveLoadChooser("Load game:", "Load", false, scumm);
+ _saveDialog = new GUI::SaveLoadChooser("Save game:", "Save");
+ _saveDialog->setSaveMode(true);
+ _loadDialog = new GUI::SaveLoadChooser("Load game:", "Load");
+ _loadDialog->setSaveMode(false);
}
ScummMenuDialog::~ScummMenuDialog() {
@@ -513,28 +306,34 @@ void ScummMenuDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 da
}
void ScummMenuDialog::save() {
- int idx;
- _saveDialog->setList(generateSavegameList(_vm, true));
- idx = _saveDialog->runModal();
+ Common::String gameId = ConfMan.get("gameid");
+
+ const EnginePlugin *plugin = 0;
+ EngineMan.findGame(gameId, &plugin);
+
+ int idx = _saveDialog->runModal(plugin, ConfMan.getActiveDomainName());
if (idx >= 0) {
String result(_saveDialog->getResultString());
char buffer[20];
const char *str;
if (result.empty()) {
// If the user was lazy and entered no save name, come up with a default name.
- sprintf(buffer, "Save %d", idx + 1);
+ sprintf(buffer, "Save %d", idx);
str = buffer;
} else
str = result.c_str();
- _vm->requestSave(idx + 1, str);
+ _vm->requestSave(idx, str);
close();
}
}
void ScummMenuDialog::load() {
- int idx;
- _loadDialog->setList(generateSavegameList(_vm, false));
- idx = _loadDialog->runModal();
+ Common::String gameId = ConfMan.get("gameid");
+
+ const EnginePlugin *plugin = 0;
+ EngineMan.findGame(gameId, &plugin);
+
+ int idx = _loadDialog->runModal(plugin, ConfMan.getActiveDomainName());
if (idx >= 0) {
_vm->requestLoad(idx);
close();
diff --git a/engines/scumm/dialogs.h b/engines/scumm/dialogs.h
index 85b562ed67..644c028c5e 100644
--- a/engines/scumm/dialogs.h
+++ b/engines/scumm/dialogs.h
@@ -29,6 +29,7 @@
#include "gui/dialog.h"
#include "gui/options.h"
#include "gui/widget.h"
+#include "gui/saveload.h"
#include "scumm/detection.h"
#ifndef DISABLE_HELP
@@ -53,35 +54,6 @@ protected:
typedef Common::String String;
};
-class SaveLoadChooser : public GUI::Dialog {
- typedef Common::String String;
- typedef Common::StringList StringList;
-protected:
- bool _saveMode;
- GUI::ListWidget *_list;
- GUI::ButtonWidget *_chooseButton;
- GUI::GraphicsWidget *_gfxWidget;
- GUI::StaticTextWidget *_date;
- GUI::StaticTextWidget *_time;
- GUI::StaticTextWidget *_playtime;
- GUI::ContainerWidget *_container;
- ScummEngine *_vm;
-
- uint8 _fillR, _fillG, _fillB;
-
- void updateInfos(bool redraw);
-public:
- SaveLoadChooser(const String &title, const String &buttonLabel, bool saveMode, ScummEngine *engine);
- ~SaveLoadChooser();
-
- virtual void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data);
- const String &getResultString() const;
- void setList(const StringList& list);
- int runModal();
-
- virtual void reflowLayout();
-};
-
class ScummMenuDialog : public ScummDialog {
public:
ScummMenuDialog(ScummEngine *scumm);
@@ -99,8 +71,8 @@ protected:
#ifndef DISABLE_HELP
GUI::Dialog *_helpDialog;
#endif
- SaveLoadChooser *_saveDialog;
- SaveLoadChooser *_loadDialog;
+ GUI::SaveLoadChooser *_saveDialog;
+ GUI::SaveLoadChooser *_loadDialog;
GUI::ButtonWidget *_saveButton;
diff --git a/engines/scumm/scumm.h b/engines/scumm/scumm.h
index 0e2031eea5..7d2bf3336a 100644
--- a/engines/scumm/scumm.h
+++ b/engines/scumm/scumm.h
@@ -667,9 +667,6 @@ public:
}
static Graphics::Surface *loadThumbnailFromSlot(const char *target, int slot);
- bool loadInfosFromSlot(int slot, InfoStuff *stuff) {
- return loadInfosFromSlot(_targetName.c_str(), slot, stuff);
- }
static bool loadInfosFromSlot(const char *target, int slot, InfoStuff *stuff);
protected:
diff --git a/engines/tinsel/pcode.cpp b/engines/tinsel/pcode.cpp
index 8646ad3267..a2661237b7 100644
--- a/engines/tinsel/pcode.cpp
+++ b/engines/tinsel/pcode.cpp
@@ -145,8 +145,8 @@ const WorkaroundEntry workaroundList[] = {
// Present Outside Inn
{TINSEL_V1, false, 352600876, 0, fragment2_size, fragment2},
- // DW1-GRA: Talking to palace guards in Act 2 gives !!!HIGH STRING||| - this happens if you initiate dialog
- // with one of the guards, but not the other. So this fix routes the talk parameters of the broken one
+ // DW1-GRA: Talking to palace guards in Act 2 gives !!!HIGH STRING||| - this happens if you initiate dialog with
+ // one of the guards, but not the other. So these fragments provide the correct talk parameters where needed
{TINSEL_V1, false, 310506872, 463, fragment4_size, fragment4},
{TINSEL_V1, false, 310506872, 485, fragment5_size, fragment5},
{TINSEL_V1, false, 310506872, 513, fragment6_size, fragment6},
@@ -164,7 +164,7 @@ const WorkaroundEntry workaroundList[] = {
{TINSEL_V0, false, 0, 0, 0, NULL}
};
-//310505453, x
+
//----------------- LOCAL GLOBAL DATA --------------------
/**
diff --git a/engines/tinsel/polygons.cpp b/engines/tinsel/polygons.cpp
index bb2daea206..825abc9a6b 100644
--- a/engines/tinsel/polygons.cpp
+++ b/engines/tinsel/polygons.cpp
@@ -1996,8 +1996,14 @@ void GetPolyNode(HPOLYGON hp, int *pNodeX, int *pNodeY) {
Poly pp(LockMem(pHandle), Polys[hp]->pIndex);
- *pNodeX = FROM_LE_32(pp.nodex);
- *pNodeY = FROM_LE_32(pp.nodey);
+ // WORKAROUND: Invalid node adjustment for DW2 Cartwheel scene refer polygon
+ if (TinselV2 && (pHandle == 0x74191900) && (hp == 8)) {
+ *pNodeX = 480;
+ *pNodeY = 408;
+ } else {
+ *pNodeX = FROM_LE_32(pp.nodex);
+ *pNodeY = FROM_LE_32(pp.nodey);
+ }
if (TinselV2) {
*pNodeX += volatileStuff[hp].xoff;
diff --git a/graphics/conversion.cpp b/graphics/conversion.cpp
deleted file mode 100644
index 1863814c1d..0000000000
--- a/graphics/conversion.cpp
+++ /dev/null
@@ -1,152 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * $URL$
- * $Id$
- */
-
-#include "graphics/conversion.h"
-
-namespace Graphics {
-
-// TODO: YUV to RGB conversion function
-
-// Function to blit a rect from one color format to another
-bool crossBlit(byte *dst, const byte *src, int dstpitch, int srcpitch,
- int w, int h, const Graphics::PixelFormat &dstFmt, const Graphics::PixelFormat &srcFmt) {
- // Error out if conversion is impossible
- if ((srcFmt.bytesPerPixel == 1) || (dstFmt.bytesPerPixel == 1)
- || (!srcFmt.bytesPerPixel) || (!dstFmt.bytesPerPixel)
- || (srcFmt.bytesPerPixel > dstFmt.bytesPerPixel))
- return false;
-
- // Don't perform unnecessary conversion
- if (srcFmt == dstFmt) {
- if (dst == src)
- return true;
- if (dstpitch == srcpitch && ((w * dstFmt.bytesPerPixel) == dstpitch)) {
- memcpy(dst,src,dstpitch * h);
- return true;
- } else {
- for (int i = 0; i < h; i++) {
- memcpy(dst,src,w * dstFmt.bytesPerPixel);
- dst += dstpitch;
- src += srcpitch;
- }
- return true;
- }
- }
-
- // Faster, but larger, to provide optimized handling for each case.
- int srcDelta, dstDelta;
- srcDelta = (srcpitch - w * srcFmt.bytesPerPixel);
- dstDelta = (dstpitch - w * dstFmt.bytesPerPixel);
-
- // TODO: optimized cases for dstDelta of 0
- uint8 r, g, b, a;
- if (dstFmt.bytesPerPixel == 2) {
- uint16 color;
- for (int y = 0; y < h; y++) {
- for (int x = 0; x < w; x++, src += 2, dst += 2) {
- color = *(uint16 *) src;
- srcFmt.colorToARGB(color, a, r, g, b);
- color = dstFmt.ARGBToColor(a, r, g, b);
- *(uint16 *) dst = color;
- }
- src += srcDelta;
- dst += dstDelta;
- }
- } else if (dstFmt.bytesPerPixel == 3) {
- uint32 color;
- uint8 *col = (uint8 *) &color;
-#ifdef SCUMM_BIG_ENDIAN
- col++;
-#endif
- if (srcFmt.bytesPerPixel == 2) {
- for (int y = 0; y < h; y++) {
- for (int x = 0; x < w; x++, src += 2, dst += 3) {
- color = *(uint16 *) src;
- srcFmt.colorToARGB(color, a, r, g, b);
- color = dstFmt.ARGBToColor(a, r, g, b);
- memcpy(dst, col, 3);
- }
- src += srcDelta;
- dst += dstDelta;
- }
- } else {
- for (int y = 0; y < h; y++) {
- for (int x = 0; x < w; x++, src += 3, dst += 3) {
- uint8 r, g, b, a;
- memcpy(col, src, 3);
- srcFmt.colorToARGB(color, a, r, g, b);
- color = dstFmt.ARGBToColor(a, r, g, b);
- memcpy(dst, col, 3);
- }
- src += srcDelta;
- dst += dstDelta;
- }
- }
- } else if (dstFmt.bytesPerPixel == 4) {
- uint32 color;
- if (srcFmt.bytesPerPixel == 2) {
- for (int y = 0; y < h; y++) {
- for (int x = 0; x < w; x++, src += 2, dst += 4) {
- color = *(uint16 *) src;
- srcFmt.colorToARGB(color, a, r, g, b);
- color = dstFmt.ARGBToColor(a, r, g, b);
- *(uint32 *) dst = color;
- }
- src += srcDelta;
- dst += dstDelta;
- }
- } else if (srcFmt.bytesPerPixel == 3) {
- uint8 *col = (uint8 *)&color;
-#ifdef SCUMM_BIG_ENDIAN
- col++;
-#endif
- for (int y = 0; y < h; y++) {
- for (int x = 0; x < w; x++, src += 2, dst += 4) {
- memcpy(col, src, 3);
- srcFmt.colorToARGB(color, a, r, g, b);
- color = dstFmt.ARGBToColor(a, r, g, b);
- *(uint32 *) dst = color;
- }
- src += srcDelta;
- dst += dstDelta;
- }
- } else {
- for (int y = 0; y < h; y++) {
- for (int x = 0; x < w; x++, src += 4, dst += 4) {
- color = *(uint32 *) src;
- srcFmt.colorToARGB(color, a, r, g, b);
- color = dstFmt.ARGBToColor(a, r, g, b);
- *(uint32 *) dst = color;
- }
- src += srcDelta;
- dst += dstDelta;
- }
- }
- } else {
- return false;
- }
- return true;
-}
-
-} // end of namespace Graphics
diff --git a/graphics/conversion.h b/graphics/conversion.h
deleted file mode 100644
index b0314046b9..0000000000
--- a/graphics/conversion.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
-
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
-
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * $URL$
- * $Id$
- *
- */
-
-#ifndef GRAPHICS_CONVERSION_H
-#define GRAPHICS_CONVERSION_H
-
-#include "common/util.h"
-#include "graphics/pixelformat.h"
-
-namespace Graphics {
-
-/** Converting a color from YUV to RGB colorspace. */
-inline static void YUV2RGB(byte y, byte u, byte v, byte &r, byte &g, byte &b) {
- r = CLIP<int>(y + ((1357 * (v - 128)) >> 10), 0, 255);
- g = CLIP<int>(y - (( 691 * (v - 128)) >> 10) - ((333 * (u - 128)) >> 10), 0, 255);
- b = CLIP<int>(y + ((1715 * (u - 128)) >> 10), 0, 255);
-}
-
-/** Converting a color from RGB to YUV colorspace. */
-inline static void RGB2YUV(byte r, byte g, byte b, byte &y, byte &u, byte &v) {
- y = CLIP<int>( ((r * 306) >> 10) + ((g * 601) >> 10) + ((b * 117) >> 10) , 0, 255);
- u = CLIP<int>(-((r * 172) >> 10) - ((g * 340) >> 10) + ((b * 512) >> 10) + 128, 0, 255);
- v = CLIP<int>( ((r * 512) >> 10) - ((g * 429) >> 10) - ((b * 83) >> 10) + 128, 0, 255);
-}
-
-// TODO: generic YUV to RGB blit
-
-/**
- * Blits a rectangle from one graphical format to another.
- *
- * @param dstbuf the buffer which will recieve the converted graphics data
- * @param srcbuf the buffer containing the original graphics data
- * @param dstpitch width in bytes of one full line of the dest buffer
- * @param srcpitch width in bytes of one full line of the source buffer
- * @param w the width of the graphics data
- * @param h the height of the graphics data
- * @param dstFmt the desired pixel format
- * @param srcFmt the original pixel format
- * @return true if conversion completes successfully,
- * false if there is an error.
- *
- * @note This implementation currently arbitrarily requires that the
- * destination's format have at least as high a bytedepth as
- * the source's.
- * @note This can convert a rectangle in place, if the source and
- * destination format have the same bytedepth.
- *
- */
-bool crossBlit(byte *dst, const byte *src, int dstpitch, int srcpitch,
- int w, int h, Graphics::PixelFormat dstFmt, Graphics::PixelFormat srcFmt);
-
-} // end of namespace Graphics
-
-#endif // GRAPHICS_CONVERSION_H
diff --git a/graphics/dither.cpp b/graphics/dither.cpp
index e671de265e..7a92441571 100644
--- a/graphics/dither.cpp
+++ b/graphics/dither.cpp
@@ -23,7 +23,6 @@
*/
#include "common/endian.h"
-#include "graphics/conversion.h"
#include "graphics/dither.h"
namespace Graphics {
diff --git a/graphics/dither.h b/graphics/dither.h
index 18f98ce4e0..e6d606cdd4 100644
--- a/graphics/dither.h
+++ b/graphics/dither.h
@@ -43,6 +43,19 @@ public:
kPaletteYUV //!< Palette in YUV colorspace
};
+ /** Converting a color from YUV to RGB colorspace. */
+ inline static void YUV2RGB(byte y, byte u, byte v, byte &r, byte &g, byte &b) {
+ r = CLIP<int>(y + ((1357 * (v - 128)) >> 10), 0, 255);
+ g = CLIP<int>(y - (( 691 * (v - 128)) >> 10) - ((333 * (u - 128)) >> 10), 0, 255);
+ b = CLIP<int>(y + ((1715 * (u - 128)) >> 10), 0, 255);
+ }
+ /** Converting a color from RGB to YUV colorspace. */
+ inline static void RGB2YUV(byte r, byte g, byte b, byte &y, byte &u, byte &v) {
+ y = CLIP<int>( ((r * 306) >> 10) + ((g * 601) >> 10) + ((b * 117) >> 10) , 0, 255);
+ u = CLIP<int>(-((r * 172) >> 10) - ((g * 340) >> 10) + ((b * 512) >> 10) + 128, 0, 255);
+ v = CLIP<int>( ((r * 512) >> 10) - ((g * 429) >> 10) - ((b * 83) >> 10) + 128, 0, 255);
+ }
+
/** Create a lookup table of a given depth and palette format.
*
* @param depth How many bits of each color component to consider.
diff --git a/graphics/jpeg.cpp b/graphics/jpeg.cpp
deleted file mode 100644
index 0ad2cf7699..0000000000
--- a/graphics/jpeg.cpp
+++ /dev/null
@@ -1,638 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
-
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
-
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * $URL$
- * $Id$
- *
- */
-
-#include "graphics/jpeg.h"
-
-#include "common/endian.h"
-#include "common/util.h"
-
-namespace Graphics {
-
-// Order used to traverse the quantization tables
-uint8 JPEG::_zigZagOrder[64] = {
- 0, 1, 8, 16, 9, 2, 3, 10,
- 17, 24, 32, 25, 18, 11, 4, 5,
- 12, 19, 26, 33, 40, 48, 41, 34,
- 27, 20, 13, 6, 7, 14, 21, 28,
- 35, 42, 49, 56, 57, 50, 43, 36,
- 29, 22, 15, 23, 30, 37, 44, 51,
- 58, 59, 52, 45, 38, 31, 39, 46,
- 53, 60, 61, 54, 47, 55, 62, 63
-};
-
-JPEG::JPEG() :
- _str(NULL), _w(0), _h(0), _numComp(0), _components(NULL), _numScanComp(0),
- _scanComp(NULL), _currentComp(NULL) {
-
- // Initialize the quantization tables
- for (int i = 0; i < JPEG_MAX_QUANT_TABLES; i++)
- _quant[i] = NULL;
-
- // Initialize the Huffman tables
- for (int i = 0; i < 2 * JPEG_MAX_HUFF_TABLES; i++) {
- _huff[i].count = 0;
- _huff[i].values = NULL;
- _huff[i].sizes = NULL;
- _huff[i].codes = NULL;
- }
-}
-
-JPEG::~JPEG() {
- reset();
-}
-
-void JPEG::reset() {
- // Reset member variables
- _str = NULL;
- _w = _h = 0;
-
- // Free the components
- for (int c = 0; c < _numComp; c++)
- _components[c].surface.free();
- delete[] _components; _components = NULL;
- _numComp = 0;
-
- // Free the scan components
- delete[] _scanComp; _scanComp = NULL;
- _numScanComp = 0;
- _currentComp = NULL;
-
- // Free the quantization tables
- for (int i = 0; i < JPEG_MAX_QUANT_TABLES; i++) {
- delete[] _quant[i];
- _quant[i] = NULL;
- }
-
- // Free the Huffman tables
- for (int i = 0; i < 2 * JPEG_MAX_HUFF_TABLES; i++) {
- _huff[i].count = 0;
- delete[] _huff[i].values; _huff[i].values = NULL;
- delete[] _huff[i].sizes; _huff[i].sizes = NULL;
- delete[] _huff[i].codes; _huff[i].codes = NULL;
- }
-}
-
-bool JPEG::read(Common::SeekableReadStream *str) {
- // Reset member variables and tables from previous reads
- reset();
-
- // Save the input stream
- _str = str;
-
- bool ok = true;
- bool done = false;
- while (!_str->eos() && ok && !done) {
- // Read the marker
- uint16 marker = _str->readByte();
- if (marker != 0xFF) {
- error("JPEG: Invalid marker[0]: 0x%02X", marker);
- ok = false;
- break;
- }
-
- while (marker == 0xFF)
- marker = _str->readByte();
-
- // Process the marker data
- switch (marker) {
- case 0xC0: // Start Of Frame
- ok = readSOF0();
- break;
- case 0xC4: // Define Huffman Tables
- ok = readDHT();
- break;
- case 0xD8: // Start Of Image
- break;
- case 0xD9: // End Of Image
- done = true;
- break;
- case 0xDA: // Start Of Scan
- ok = readSOS();
- break;
- case 0xDB: // Define Quantization Tables
- ok = readDQT();
- break;
- case 0xE0: // JFIF/JFXX segment
- ok = readJFIF();
- break;
- case 0xFE: // Comment
- _str->seek(_str->readUint16BE() - 2, SEEK_CUR);
- break;
- default: { // Unknown marker
- uint16 size = _str->readUint16BE();
- warning("JPEG: Unknown marker %02X, skipping %d bytes", marker, size - 2);
- _str->seek(size - 2, SEEK_CUR);
- }
- }
- }
- return ok;
-}
-
-bool JPEG::readJFIF() {
- /* uint16 length = */ _str->readUint16BE();
- uint32 tag = _str->readUint32BE();
- if (tag != MKID_BE('JFIF'))
- return false;
- _str->readByte(); // NULL
- /* byte majorVersion = */ _str->readByte();
- /* byte minorVersion = */ _str->readByte();
- /* byte densityUnits = */ _str->readByte();
- /* uint16 xDensity = */ _str->readUint16BE();
- /* uint16 yDensity = */ _str->readUint16BE();
- byte thumbW = _str->readByte();
- byte thumbH = _str->readByte();
- _str->seek(thumbW * thumbH * 3, SEEK_CUR); // Ignore thumbnail
- return true;
-}
-
-// Marker 0xC0 (Start Of Frame, Baseline DCT)
-bool JPEG::readSOF0() {
- debug(5, "JPEG: readSOF0");
- uint16 size = _str->readUint16BE();
-
- // Read the sample precision
- uint8 precision = _str->readByte();
- if (precision != 8) {
- warning("JPEG: Just 8 bit precision supported at the moment");
- return false;
- }
-
- // Image size
- _h = _str->readUint16BE();
- _w = _str->readUint16BE();
-
- // Number of components
- _numComp = _str->readByte();
- if (size != 8 + 3 * _numComp) {
- warning("JPEG: Invalid number of components");
- return false;
- }
-
- // Allocate the new components
- delete[] _components;
- _components = new Component[_numComp];
-
- // Read the components details
- for (int c = 0; c < _numComp; c++) {
- _components[c].id = _str->readByte();
- _components[c].factorH = _str->readByte();
- _components[c].factorV = _components[c].factorH & 0xF;
- _components[c].factorH >>= 4;
- _components[c].quantTableSelector = _str->readByte();
- }
-
- return true;
-}
-
-// Marker 0xC4 (Define Huffman Tables)
-bool JPEG::readDHT() {
- debug(5, "JPEG: readDHT");
- uint16 size = _str->readUint16BE() - 2;
- uint32 pos = _str->pos();
-
- while ((uint32)_str->pos() < (size + pos)) {
- // Read the table type and id
- uint8 tableId = _str->readByte();
- uint8 tableType = tableId >> 4; // type 0: DC, 1: AC
- tableId &= 0xF;
- uint8 tableNum = (tableId << 1) + tableType;
-
- // Free the Huffman table
- delete[] _huff[tableNum].values; _huff[tableNum].values = NULL;
- delete[] _huff[tableNum].sizes; _huff[tableNum].sizes = NULL;
- delete[] _huff[tableNum].codes; _huff[tableNum].codes = NULL;
-
- // Read the number of values for each length
- uint8 numValues[16];
- _huff[tableNum].count = 0;
- for (int len = 0; len < 16; len++) {
- numValues[len] = _str->readByte();
- _huff[tableNum].count += numValues[len];
- }
-
- // Allocate memory for the current table
- _huff[tableNum].values = new uint8[_huff[tableNum].count];
- _huff[tableNum].sizes = new uint8[_huff[tableNum].count];
- _huff[tableNum].codes = new uint16[_huff[tableNum].count];
-
- // Read the table contents
- int cur = 0;
- for (int len = 0; len < 16; len++) {
- for (int i = 0; i < numValues[len]; i++) {
- _huff[tableNum].values[cur] = _str->readByte();
- _huff[tableNum].sizes[cur] = len + 1;
- cur++;
- }
- }
-
- // Fill the table of Huffman codes
- cur = 0;
- uint16 curCode = 0;
- uint8 curCodeSize = _huff[tableNum].sizes[0];
- while (cur < _huff[tableNum].count) {
- // Increase the code size to fit the request
- while (_huff[tableNum].sizes[cur] != curCodeSize) {
- curCode <<= 1;
- curCodeSize++;
- }
-
- // Assign the current code
- _huff[tableNum].codes[cur] = curCode;
- curCode++;
- cur++;
- }
- }
-
- return true;
-}
-
-// Marker 0xDA (Start Of Scan)
-bool JPEG::readSOS() {
- debug(5, "JPEG: readSOS");
- uint16 size = _str->readUint16BE();
-
- // Number of scan components
- _numScanComp = _str->readByte();
- if (size != 6 + 2 * _numScanComp) {
- warning("JPEG: Invalid number of components");
- return false;
- }
-
- // Allocate the new scan components
- delete[] _scanComp;
- _scanComp = new Component *[_numScanComp];
-
- // Reset the maximum sampling factors
- _maxFactorV = 0;
- _maxFactorH = 0;
-
- // Component-specification parameters
- for (int c = 0; c < _numScanComp; c++) {
- // Read the desired component id
- uint8 id = _str->readByte();
-
- // Search the component with the specified id
- bool found = false;
- for (int i = 0; !found && i < _numComp; i++) {
- if (_components[i].id == id) {
- // We found the desired component
- found = true;
-
- // Assign the found component to the c'th scan component
- _scanComp[c] = &_components[i];
- }
- }
-
- if (!found) {
- warning("JPEG: Invalid component");
- return false;
- }
-
- // Read the entropy table selectors
- _scanComp[c]->DCentropyTableSelector = _str->readByte();
- _scanComp[c]->ACentropyTableSelector = _scanComp[c]->DCentropyTableSelector & 0xF;
- _scanComp[c]->DCentropyTableSelector >>= 4;
-
- // Calculate the maximum sampling factors
- if (_scanComp[c]->factorV > _maxFactorV)
- _maxFactorV = _scanComp[c]->factorV;
-
- if (_scanComp[c]->factorH > _maxFactorH)
- _maxFactorH = _scanComp[c]->factorH;
-
- // Initialize the DC predictor
- _scanComp[c]->DCpredictor = 0;
- }
-
- // Initialize the scan surfaces
- for (int c = 0; c < _numScanComp; c++)
- _scanComp[c]->surface.create(_w, _h, 1);
-
- // Start of spectral selection
- if (_str->readByte() != 0) {
- warning("JPEG: Progressive scanning not supported");
- return false;
- }
-
- // End of spectral selection
- if (_str->readByte() != 63) {
- warning("JPEG: Progressive scanning not supported");
- return false;
- }
-
- // Successive approximation parameters
- if (_str->readByte() != 0) {
- warning("JPEG: Progressive scanning not supported");
- return false;
- }
-
- // Entropy coded sequence starts, initialize Huffman decoder
- _bitsNumber = 0;
-
- // Read all the scan MCUs
- uint16 xMCU = _w / (_maxFactorH * 8);
- uint16 yMCU = _h / (_maxFactorV * 8);
-
- // Check for non- multiple-of-8 dimensions
- if (_w % 8 != 0)
- xMCU++;
- if (_h % 8 != 0)
- yMCU++;
-
- bool ok = true;
- for (int y = 0; ok && (y < yMCU); y++)
- for (int x = 0; ok && (x < xMCU); x++)
- ok = readMCU(x, y);
-
- return ok;
-}
-
-// Marker 0xDB (Define Quantization Tables)
-bool JPEG::readDQT() {
- debug(5, "JPEG: readDQT");
- uint16 size = _str->readUint16BE() - 2;
- uint32 pos = _str->pos();
-
- while ((uint32)_str->pos() < (pos + size)) {
- // Read the table precision and id
- uint8 tableId = _str->readByte();
- bool highPrecision = (tableId & 0xF0) != 0;
-
- // Validate the table id
- tableId &= 0xF;
- if (tableId > JPEG_MAX_QUANT_TABLES) {
- warning("JPEG: Invalid number of components");
- return false;
- }
-
- // Create the new table if necessary
- if (!_quant[tableId])
- _quant[tableId] = new uint16[64];
-
- // Read the table (stored in Zig-Zag order)
- for (int i = 0; i < 64; i++)
- _quant[tableId][i] = highPrecision ? _str->readUint16BE() : _str->readByte();
- }
-
- return true;
-}
-
-bool JPEG::readMCU(uint16 xMCU, uint16 yMCU) {
- bool ok = true;
- for (int c = 0; ok && (c < _numComp); c++) {
- // Set the current component
- _currentComp = _scanComp[c];
-
- // Read the data units of the current component
- for (int y = 0; ok && (y < _scanComp[c]->factorV); y++)
- for (int x = 0; ok && (x < _scanComp[c]->factorH); x++)
- ok = readDataUnit(xMCU * _scanComp[c]->factorH + x, yMCU * _scanComp[c]->factorV + y);
- }
-
- return ok;
-}
-
-float JPEG::idct(int x, int y, int weight, int fx, int fy) {
- float vx = cos((2 * x + 1) * fx * PI / 16);
- float vy = cos((2 * y + 1) * fy * PI / 16);
- float ret = (float)weight * vx * vy;
-
- if (fx == 0)
- ret /= sqrt(2.0f);
-
- if (fy == 0)
- ret /= sqrt(2.0f);
-
- return ret;
-}
-
-bool JPEG::readDataUnit(uint16 x, uint16 y) {
- // Prepare an empty data array
- int16 readData[64];
- for (int i = 1; i < 64; i++)
- readData[i] = 0;
-
- // Read the DC component
- readData[0] = _currentComp->DCpredictor + readDC();
- _currentComp->DCpredictor = readData[0];
-
- // Read the AC components (stored in Zig-Zag)
- readAC(readData);
-
- // Calculate the DCT coefficients from the input sequence
- int16 DCT[64];
- for (int i = 0; i < 64; i++) {
- // Dequantize
- int16 val = readData[i];
- int16 quant = _quant[_currentComp->quantTableSelector][i];
- val *= quant;
-
- // Store the normalized coefficients, undoing the Zig-Zag
- DCT[_zigZagOrder[i]] = val;
- }
-
- // Shortcut the IDCT for DC component
- float result[64];
- for (int i = 0; i < 64; i++)
- result[i] = DCT[0] / 2;
-
- // Apply the IDCT (PAG31)
- for (int i = 1; i < 64; i++) {
- if (DCT[i])
- for (int _y = 0; _y < 8; _y++)
- for (int _x = 0; _x < 8; _x++)
- result[_y * 8 + _x] += idct(_x, _y, DCT[i], i % 8, i / 8);
- }
-
- // Level shift to make the values unsigned
- // Divide by 4 is final part of IDCT
- for (int i = 0; i < 64; i++) {
- result[i] = result[i] / 4 + 128;
-
- if (result[i] < 0)
- result[i] = 0;
-
- if (result[i] > 255)
- result[i] = 255;
- }
-
- // Paint the component surface
- uint8 scalingV = _maxFactorV / _currentComp->factorV;
- uint8 scalingH = _maxFactorH / _currentComp->factorH;
-
- // Convert coordinates from MCU blocks to pixels
- x <<= 3;
- y <<= 3;
-
- // Handle non- multiple-of-8 dimensions
- byte xLim = 8;
- byte yLim = 8;
- if (x*scalingH + 8 > _w)
- xLim -= (x*scalingH + 8 - _w);
- if (y*scalingV + 8 > _h)
- yLim -= (y*scalingV + 8 - _h);
-
- for (int j = 0; j < yLim; j++) {
- for (int sV = 0; sV < scalingV; sV++) {
- // Get the beginning of the block line
- byte *ptr = (byte *)_currentComp->surface.getBasePtr(x * scalingH, (y + j) * scalingV + sV);
-
- for (int i = 0; i < xLim; i++) {
- for (uint8 sH = 0; sH < scalingH; sH++) {
- *ptr = (byte)(result[j * 8 + i]);
- ptr++;
- }
- }
- }
- }
-
- return true;
-}
-
-int16 JPEG::readDC() {
- // DC is type 0
- uint8 tableNum = _currentComp->DCentropyTableSelector << 1;
-
- // Get the number of bits to read
- uint8 numBits = readHuff(tableNum);
-
- // Read the requested bits
- return readSignedBits(numBits);
-}
-
-void JPEG::readAC(int16 *out) {
- // AC is type 1
- uint8 tableNum = (_currentComp->ACentropyTableSelector << 1) + 1;
-
- // Start reading AC element 1
- uint8 cur = 1;
- while (cur < 64) {
- uint8 s = readHuff(tableNum);
- uint8 r = s >> 4;
- s &= 0xF;
-
- if (s == 0) {
- if (r == 15) {
- // Skip 16 values
- cur += 16;
- } else {
- // EOB: end of block
- cur = 64;
- }
- } else {
- // Skip r values
- cur += r;
-
- // Read the next value
- out[cur] = readSignedBits(s);
- cur++;
- }
- }
-}
-
-int16 JPEG::readSignedBits(uint8 numBits) {
- uint16 ret = 0;
- if (numBits > 16) error("requested %d bits", numBits); //XXX
-
- // MSB=0 for negatives, 1 for positives
- for (int i = 0; i < numBits; i++)
- ret = (ret << 1) + readBit();
-
- // Extend sign bits (PAG109)
- if (!(ret >> (numBits - 1)))
- {
- uint16 tmp = ((uint16)-1 << numBits) + 1;
- ret = ret + tmp;
- }
- return ret;
-}
-
-// TODO: optimize?
-uint8 JPEG::readHuff(uint8 table) {
- bool foundCode = false;
- uint8 val = 0;
-
- uint8 cur = 0;
- uint8 codeSize = 1;
- uint16 code = readBit();
- while (!foundCode) {
- // Prepare a code of the current size
- while (codeSize < _huff[table].sizes[cur]) {
- code = (code << 1) + readBit();
- codeSize++;
- }
-
- // Compare the codes of the current size
- while (!foundCode && (codeSize == _huff[table].sizes[cur])) {
- if (code == _huff[table].codes[cur]) {
- // Found the code
- val = _huff[table].values[cur];
- foundCode = true;
- } else {
- // Continue reading
- cur++;
- }
- }
- }
-
- return val;
-}
-
-uint8 JPEG::readBit() {
- // Read a whole byte if necessary
- if (_bitsNumber == 0) {
- _bitsData = _str->readByte();
- _bitsNumber = 8;
-
- // Detect markers
- if (_bitsData == 0xFF) {
- uint8 byte2 = _str->readByte();
-
- // A stuffed 0 validates the previous byte
- if (byte2 != 0) {
- if (byte2 == 0xDC) {
- // DNL marker: Define Number of Lines
- // TODO: terminate scan
- printf("DNL marker detected: terminate scan\n");
- } else {
- printf("Error: marker 0x%02X read in entropy data\n", byte2);
- }
- }
- }
- }
- _bitsNumber--;
-
- return (_bitsData & (1 << _bitsNumber)) ? 1 : 0;
-}
-
-Surface *JPEG::getComponent(uint c) {
- for (int i = 0; i < _numComp; i++)
- if (_components[i].id == c) // We found the desired component
- return &_components[i].surface;
-
- return NULL;
-}
-
-} // End of Graphics namespace
diff --git a/graphics/jpeg.h b/graphics/jpeg.h
deleted file mode 100644
index f4743a5e83..0000000000
--- a/graphics/jpeg.h
+++ /dev/null
@@ -1,118 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
-
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
-
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- * $URL$
- * $Id$
- *
- */
-
-#ifndef GRAPHICS_JPEG_H
-#define GRAPHICS_JPEG_H
-
-#include "common/stream.h"
-#include "graphics/surface.h"
-
-namespace Graphics {
-
-#define JPEG_MAX_QUANT_TABLES 4
-#define JPEG_MAX_HUFF_TABLES 2
-
-class JPEG {
-public:
- JPEG();
- ~JPEG();
-
- bool read(Common::SeekableReadStream *str);
- Surface *getComponent(uint c);
-
-private:
- void reset();
-
- Common::SeekableReadStream *_str;
- uint16 _w, _h;
-
- // Image components
- uint8 _numComp;
- struct Component {
- // Global values
- uint8 id;
- uint8 factorH;
- uint8 factorV;
- uint8 quantTableSelector;
-
- // Scan specific values
- uint8 DCentropyTableSelector;
- uint8 ACentropyTableSelector;
- int16 DCpredictor;
-
- // Result image for this component
- Surface surface;
- } *_components;
-
- // Scan components
- uint8 _numScanComp;
- Component **_scanComp;
- Component *_currentComp;
-
- // Maximum sampling factors, used to calculate the interleaving of the MCU
- uint8 _maxFactorV;
- uint8 _maxFactorH;
-
- // Zig-Zag order
- static uint8 _zigZagOrder[64];
-
- // Quantization tables
- uint16 *_quant[JPEG_MAX_QUANT_TABLES];
-
- // Huffman tables
- struct HuffmanTable {
- uint8 count;
- uint8 *values;
- uint8 *sizes;
- uint16 *codes;
- } _huff[2 * JPEG_MAX_HUFF_TABLES];
-
- // Marker read functions
- bool readJFIF();
- bool readSOF0();
- bool readDHT();
- bool readSOS();
- bool readDQT();
-
- // Helper functions
- bool readMCU(uint16 xMCU, uint16 yMCU);
- bool readDataUnit(uint16 x, uint16 y);
- int16 readDC();
- void readAC(int16 *out);
- int16 readSignedBits(uint8 numBits);
-
- // Huffman decoding
- uint8 readHuff(uint8 table);
- uint8 readBit();
- uint8 _bitsData;
- uint8 _bitsNumber;
-
- // Discrete Cosine Transformation
- float idct(int x, int y, int weight, int fx, int fy);
-};
-
-} // End of Graphics namespace
-
-#endif // GRAPHICS_JPEG_H
diff --git a/graphics/module.mk b/graphics/module.mk
index ed14051243..46ed564e1e 100644
--- a/graphics/module.mk
+++ b/graphics/module.mk
@@ -1,7 +1,6 @@
MODULE := graphics
MODULE_OBJS := \
- conversion.o \
cursorman.o \
dither.o \
font.o \
@@ -12,7 +11,6 @@ MODULE_OBJS := \
fonts/scummfont.o \
iff.o \
imagedec.o \
- jpeg.o \
primitives.o \
scaler.o \
scaler/thumbnail_intern.o \
diff --git a/graphics/scaler/thumbnail_intern.cpp b/graphics/scaler/thumbnail_intern.cpp
index a542fe2268..fabe07b031 100644
--- a/graphics/scaler/thumbnail_intern.cpp
+++ b/graphics/scaler/thumbnail_intern.cpp
@@ -23,7 +23,6 @@
*
*/
-#include "common/endian.h"
#include "common/scummsys.h"
#include "common/system.h"
@@ -99,8 +98,7 @@ static bool grabScreen565(Graphics::Surface *surf) {
if (!screen)
return false;
- assert(screen->bytesPerPixel == 1 || screen->bytesPerPixel == 2);
- assert(screen->pixels != 0);
+ assert(screen->bytesPerPixel == 1 && screen->pixels != 0);
byte palette[256 * 4];
g_system->grabPalette(&palette[0], 0, 256);
@@ -109,17 +107,11 @@ static bool grabScreen565(Graphics::Surface *surf) {
for (uint y = 0; y < screen->h; ++y) {
for (uint x = 0; x < screen->w; ++x) {
- byte r, g, b;
- if (screen->bytesPerPixel == 2) {
- uint16 col = READ_UINT16(screen->getBasePtr(x, y));
- r = ((col >> 10) & 0x1F) << 3;
- g = ((col >> 5) & 0x1F) << 3;
- b = ((col >> 0) & 0x1F) << 3;
- } else {
- r = palette[((uint8*)screen->pixels)[y * screen->pitch + x] * 4];
- g = palette[((uint8*)screen->pixels)[y * screen->pitch + x] * 4 + 1];
- b = palette[((uint8*)screen->pixels)[y * screen->pitch + x] * 4 + 2];
- }
+ byte r, g, b;
+ r = palette[((uint8*)screen->pixels)[y * screen->pitch + x] * 4];
+ g = palette[((uint8*)screen->pixels)[y * screen->pitch + x] * 4 + 1];
+ b = palette[((uint8*)screen->pixels)[y * screen->pitch + x] * 4 + 2];
+
((uint16*)surf->pixels)[y * surf->w + x] = Graphics::RGBToColor<Graphics::ColorMasks<565> >(r, g, b);
}
}
diff --git a/graphics/sjis.cpp b/graphics/sjis.cpp
index 405d8622c2..9f5def8f10 100644
--- a/graphics/sjis.cpp
+++ b/graphics/sjis.cpp
@@ -280,6 +280,11 @@ const uint16 *FontSjisSVM::getCharData(uint16 c) const {
if (index >= 0x3F)
--index;
+ // Another check if the passed character was an
+ // correctly encoded SJIS character.
+ if (index < 0 || index >= 0xBC || base < 0)
+ return 0;
+
return _fontData + (base * 0xBC + index) * 16;
}
diff --git a/graphics/video/coktelvideo/coktelvideo.cpp b/graphics/video/coktelvideo/coktelvideo.cpp
index 063ad190e6..39aeca07bd 100644
--- a/graphics/video/coktelvideo/coktelvideo.cpp
+++ b/graphics/video/coktelvideo/coktelvideo.cpp
@@ -26,7 +26,6 @@
#include "common/endian.h"
#include "common/system.h"
-#include "graphics/conversion.h"
#include "graphics/dither.h"
#include "graphics/video/coktelvideo/coktelvideo.h"
#include "graphics/video/coktelvideo/indeo3.h"
@@ -1916,7 +1915,7 @@ void Vmd::blit16(byte *dest, byte *src, int16 srcPitch, int16 width, int16 heigh
byte b = ((data & 0x001F) >> 0);
byte dY, dU, dV;
- Graphics::RGB2YUV(r << 3, g << 3, b << 3, dY, dU, dV);
+ Graphics::PaletteLUT::RGB2YUV(r << 3, g << 3, b << 3, dY, dU, dV);
byte p = dither->dither(dY, dU, dV, j);
@@ -1950,7 +1949,7 @@ void Vmd::blit24(byte *dest, byte *src, int16 srcPitch, int16 width, int16 heigh
byte b = s[0];
byte dY, dU, dV;
- Graphics::RGB2YUV(r, g, b, dY, dU, dV);
+ Graphics::PaletteLUT::RGB2YUV(r, g, b, dY, dU, dV);
byte p = dither->dither(dY, dU, dV, j);
diff --git a/gui/GuiManager.cpp b/gui/GuiManager.cpp
index ca1fdef41c..b97a62109b 100644
--- a/gui/GuiManager.cpp
+++ b/gui/GuiManager.cpp
@@ -273,8 +273,8 @@ void GuiManager::runLoop() {
lastRedraw = _system->getMillis();
}
- Common::Event Event;
- while (eventMan->pollEvent(Event)) {
+ Common::Event event;
+ while (eventMan->pollEvent(event)) {
// The top dialog can change during the event loop. In that case, flush all the
// dialog-related events since they were probably generated while the old dialog
@@ -282,10 +282,10 @@ void GuiManager::runLoop() {
//
// This hopefully fixes strange behaviour/crashes with pop-up widgets. (Most easily
// triggered in 3x mode or when running ScummVM under Valgrind.)
- if (activeDialog != getTopDialog() && Event.type != Common::EVENT_SCREEN_CHANGED)
+ if (activeDialog != getTopDialog() && event.type != Common::EVENT_SCREEN_CHANGED)
continue;
- Common::Point mouse(Event.mouse.x - activeDialog->_x, Event.mouse.y - activeDialog->_y);
+ Common::Point mouse(event.mouse.x - activeDialog->_x, event.mouse.y - activeDialog->_y);
if (lastRedraw + waitTime < _system->getMillis()) {
_theme->updateScreen();
@@ -293,12 +293,12 @@ void GuiManager::runLoop() {
lastRedraw = _system->getMillis();
}
- switch (Event.type) {
+ switch (event.type) {
case Common::EVENT_KEYDOWN:
- activeDialog->handleKeyDown(Event.kbd);
+ activeDialog->handleKeyDown(event.kbd);
break;
case Common::EVENT_KEYUP:
- activeDialog->handleKeyUp(Event.kbd);
+ activeDialog->handleKeyUp(event.kbd);
break;
case Common::EVENT_MOUSEMOVE:
activeDialog->handleMouseMoved(mouse.x, mouse.y, 0);
@@ -306,15 +306,15 @@ void GuiManager::runLoop() {
// We don't distinguish between mousebuttons (for now at least)
case Common::EVENT_LBUTTONDOWN:
case Common::EVENT_RBUTTONDOWN:
- button = (Event.type == Common::EVENT_LBUTTONDOWN ? 1 : 2);
+ button = (event.type == Common::EVENT_LBUTTONDOWN ? 1 : 2);
time = _system->getMillis();
if (_lastClick.count && (time < _lastClick.time + kDoubleClickDelay)
- && ABS(_lastClick.x - Event.mouse.x) < 3
- && ABS(_lastClick.y - Event.mouse.y) < 3) {
+ && ABS(_lastClick.x - event.mouse.x) < 3
+ && ABS(_lastClick.y - event.mouse.y) < 3) {
_lastClick.count++;
} else {
- _lastClick.x = Event.mouse.x;
- _lastClick.y = Event.mouse.y;
+ _lastClick.x = event.mouse.x;
+ _lastClick.y = event.mouse.y;
_lastClick.count = 1;
}
_lastClick.time = time;
@@ -322,7 +322,7 @@ void GuiManager::runLoop() {
break;
case Common::EVENT_LBUTTONUP:
case Common::EVENT_RBUTTONUP:
- button = (Event.type == Common::EVENT_LBUTTONUP ? 1 : 2);
+ button = (event.type == Common::EVENT_LBUTTONUP ? 1 : 2);
activeDialog->handleMouseUp(mouse.x, mouse.y, button, _lastClick.count);
break;
case Common::EVENT_WHEELUP:
diff --git a/gui/ListWidget.cpp b/gui/ListWidget.cpp
index 7551acac48..195256b66f 100644
--- a/gui/ListWidget.cpp
+++ b/gui/ListWidget.cpp
@@ -64,6 +64,7 @@ ListWidget::ListWidget(GuiObject *boss, const String &name, uint32 cmd)
_editable = true;
_quickSelect = true;
+ _editColor = ThemeEngine::kFontColorNormal;
}
ListWidget::ListWidget(GuiObject *boss, int x, int y, int w, int h, uint32 cmd)
@@ -141,7 +142,17 @@ void ListWidget::setSelected(int item) {
}
}
-void ListWidget::setList(const StringList &list) {
+ThemeEngine::FontColor ListWidget::getSelectionColor() const {
+ if (_listColors.empty())
+ return ThemeEngine::kFontColorNormal;
+
+ if (_filter.empty())
+ return _listColors[_selectedItem];
+ else
+ return _listColors[_listIndex[_selectedItem]];
+}
+
+void ListWidget::setList(const StringList &list, const ColorList *colors) {
if (_editMode && _caretVisible)
drawCaret(true);
@@ -150,6 +161,12 @@ void ListWidget::setList(const StringList &list) {
_list = list;
_filter.clear();
_listIndex.clear();
+ _listColors.clear();
+
+ if (colors) {
+ _listColors = *colors;
+ assert(_listColors.size() == _dataList.size());
+ }
int size = list.size();
if (_currentPos >= size)
@@ -162,7 +179,19 @@ void ListWidget::setList(const StringList &list) {
scrollBarRecalc();
}
-void ListWidget::append(const String &s) {
+void ListWidget::append(const String &s, ThemeEngine::FontColor color) {
+ if (_dataList.size() == _listColors.size()) {
+ // If the color list has the size of the data list, we append the color.
+ _listColors.push_back(color);
+ } else if (!_listColors.size() && color != ThemeEngine::kFontColorNormal) {
+ // If it's the first entry to use a non default color, we will fill
+ // up all other entries of the color list with the default color and
+ // add the requested color for the new entry.
+ for (uint i = 0; i < _dataList.size(); ++i)
+ _listColors.push_back(ThemeEngine::kFontColorNormal);
+ _listColors.push_back(color);
+ }
+
_dataList.push_back(s);
_list.push_back(s);
@@ -431,17 +460,27 @@ void ListWidget::drawWidget() {
int width;
+ ThemeEngine::FontColor color = ThemeEngine::kFontColorNormal;
+
+ if (!_listColors.empty()) {
+ if (_filter.empty() || _selectedItem == -1)
+ color = _listColors[pos];
+ else
+ color = _listColors[_listIndex[pos]];
+ }
+
if (_selectedItem == pos && _editMode) {
buffer = _editString;
+ color = _editColor;
adjustOffset();
width = _w - r.left - _hlRightPadding - _leftPadding - scrollbarW;
- g_gui.theme()->drawText(Common::Rect(_x + r.left, y, _x + r.left + width, y + fontHeight - 2),
- buffer, _state, Graphics::kTextAlignLeft, inverted, pad, true);
+ g_gui.theme()->drawText(Common::Rect(_x + r.left, y, _x + r.left + width, y + fontHeight - 2), buffer, _state,
+ Graphics::kTextAlignLeft, inverted, pad, true, ThemeEngine::kFontStyleBold, color);
} else {
buffer = _list[pos];
width = _w - r.left - scrollbarW;
- g_gui.theme()->drawText(Common::Rect(_x + r.left, y, _x + r.left + width, y + fontHeight - 2),
- buffer, _state, Graphics::kTextAlignLeft, inverted, pad, true);
+ g_gui.theme()->drawText(Common::Rect(_x + r.left, y, _x + r.left + width, y + fontHeight - 2), buffer, _state,
+ Graphics::kTextAlignLeft, inverted, pad, true, ThemeEngine::kFontStyleBold, color);
}
_textWidth[i] = width;
@@ -499,6 +538,14 @@ void ListWidget::startEditMode() {
if (_editable && !_editMode && _selectedItem >= 0) {
_editMode = true;
setEditString(_list[_selectedItem]);
+ if (_listColors.empty()) {
+ _editColor = ThemeEngine::kFontColorNormal;
+ } else {
+ if (_filter.empty())
+ _editColor = _listColors[_selectedItem];
+ else
+ _editColor = _listColors[_listIndex[_selectedItem]];
+ }
draw();
g_system->setFeatureState(OSystem::kFeatureVirtualKeyboard, true);
}
diff --git a/gui/ListWidget.h b/gui/ListWidget.h
index 203cd88fb6..23c12a38fc 100644
--- a/gui/ListWidget.h
+++ b/gui/ListWidget.h
@@ -28,6 +28,8 @@
#include "gui/editable.h"
#include "common/str.h"
+#include "gui/ThemeEngine.h"
+
namespace GUI {
class ScrollBarWidget;
@@ -51,9 +53,11 @@ class ListWidget : public EditableWidget {
public:
typedef Common::String String;
typedef Common::StringList StringList;
+ typedef Common::Array<ThemeEngine::FontColor> ColorList;
protected:
StringList _list;
StringList _dataList;
+ ColorList _listColors;
Common::Array<int> _listIndex;
bool _editable;
bool _editMode;
@@ -80,6 +84,8 @@ protected:
uint32 _cmd;
+ ThemeEngine::FontColor _editColor;
+
public:
ListWidget(GuiObject *boss, const String &name, uint32 cmd = 0);
ListWidget(GuiObject *boss, int x, int y, int w, int h, uint32 cmd = 0);
@@ -87,20 +93,33 @@ public:
virtual Widget *findWidget(int x, int y);
- void setList(const StringList &list);
- void append(const String &s);
+ void setList(const StringList &list, const ColorList *colors = 0);
const StringList &getList() const { return _dataList; }
- int getSelected() const { return (_filter.empty() || _selectedItem == -1) ? _selectedItem : _listIndex[_selectedItem]; }
+
+ void append(const String &s, ThemeEngine::FontColor color = ThemeEngine::kFontColorNormal);
+
void setSelected(int item);
+ int getSelected() const { return (_filter.empty() || _selectedItem == -1) ? _selectedItem : _listIndex[_selectedItem]; }
+
const String &getSelectedString() const { return _list[_selectedItem]; }
+ ThemeEngine::FontColor getSelectionColor() const;
+
void setNumberingMode(NumberingMode numberingMode) { _numberingMode = numberingMode; }
- bool isEditable() const { return _editable; }
- void setEditable(bool editable) { _editable = editable; }
+
void scrollTo(int item);
void scrollToEnd();
+
void enableQuickSelect(bool enable) { _quickSelect = enable; }
String getQuickSelectString() const { return _quickSelectStr; }
+ bool isEditable() const { return _editable; }
+ void setEditable(bool editable) { _editable = editable; }
+ void setEditColor(ThemeEngine::FontColor color) { _editColor = color; }
+
+ // Made startEditMode/endEditMode for SaveLoadChooser
+ void startEditMode();
+ void endEditMode();
+
void setFilter(const String &filter, bool redraw = true);
virtual void handleTickle();
@@ -115,10 +134,6 @@ public:
virtual bool wantsFocus() { return true; }
- // Made startEditMode for SCUMM's SaveLoadChooser
- void startEditMode();
- void endEditMode();
-
protected:
void drawWidget();
diff --git a/gui/ThemeEngine.h b/gui/ThemeEngine.h
index 4cd5d827e3..43e227d5fb 100644
--- a/gui/ThemeEngine.h
+++ b/gui/ThemeEngine.h
@@ -32,7 +32,7 @@
#include "graphics/surface.h"
#include "graphics/fontman.h"
-#define SCUMMVM_THEME_VERSION_STR "SCUMMVM_STX0.7"
+#define SCUMMVM_THEME_VERSION_STR "SCUMMVM_STX0.8"
namespace Graphics {
struct DrawStep;
diff --git a/gui/saveload.cpp b/gui/saveload.cpp
index ce700c181e..058911d43f 100644
--- a/gui/saveload.cpp
+++ b/gui/saveload.cpp
@@ -42,15 +42,15 @@ enum {
};
SaveLoadChooser::SaveLoadChooser(const String &title, const String &buttonLabel)
- : Dialog("ScummSaveLoad"), _delSupport(0), _list(0), _chooseButton(0), _deleteButton(0), _gfxWidget(0) {
+ : Dialog("SaveLoadChooser"), _delSupport(0), _list(0), _chooseButton(0), _deleteButton(0), _gfxWidget(0) {
_delSupport = _metaInfoSupport = _thumbnailSupport = _saveDateSupport = _playTimeSupport = false;
_backgroundType = ThemeEngine::kDialogBackgroundSpecial;
- new StaticTextWidget(this, "ScummSaveLoad.Title", title);
+ new StaticTextWidget(this, "SaveLoadChooser.Title", title);
// Add choice list
- _list = new GUI::ListWidget(this, "ScummSaveLoad.List");
+ _list = new GUI::ListWidget(this, "SaveLoadChooser.List");
_list->setNumberingMode(GUI::kListNumberingZero);
setSaveMode(false);
@@ -61,11 +61,11 @@ SaveLoadChooser::SaveLoadChooser(const String &title, const String &buttonLabel)
_playtime = new StaticTextWidget(this, 0, 0, 10, 10, "No playtime saved", Graphics::kTextAlignCenter);
// Buttons
- new GUI::ButtonWidget(this, "ScummSaveLoad.Cancel", "Cancel", kCloseCmd, 0);
- _chooseButton = new GUI::ButtonWidget(this, "ScummSaveLoad.Choose", buttonLabel, kChooseCmd, 0);
+ new GUI::ButtonWidget(this, "SaveLoadChooser.Cancel", "Cancel", kCloseCmd, 0);
+ _chooseButton = new GUI::ButtonWidget(this, "SaveLoadChooser.Choose", buttonLabel, kChooseCmd, 0);
_chooseButton->setEnabled(false);
- _deleteButton = new GUI::ButtonWidget(this, "ScummSaveLoad.Delete", "Delete", kDelCmd, 0);
+ _deleteButton = new GUI::ButtonWidget(this, "SaveLoadChooser.Delete", "Delete", kDelCmd, 0);
_deleteButton->setEnabled(false);
_delSupport = _metaInfoSupport = _thumbnailSupport = false;
@@ -172,11 +172,11 @@ void SaveLoadChooser::handleCommand(CommandSender *sender, uint32 cmd, uint32 da
}
void SaveLoadChooser::reflowLayout() {
- if (g_gui.xmlEval()->getVar("Globals.ScummSaveLoad.ExtInfo.Visible") == 1 && _thumbnailSupport) {
+ if (g_gui.xmlEval()->getVar("Globals.SaveLoadChooser.ExtInfo.Visible") == 1 && _thumbnailSupport) {
int16 x, y;
uint16 w, h;
- if (!g_gui.xmlEval()->getWidgetData("ScummSaveLoad.Thumbnail", x, y, w, h))
+ if (!g_gui.xmlEval()->getWidgetData("SaveLoadChooser.Thumbnail", x, y, w, h))
error("Error when loading position data for Save/Load Thumbnails.");
int thumbW = kThumbnailWidth;
@@ -278,8 +278,15 @@ void SaveLoadChooser::updateSelection(bool redraw) {
// game is write protected
_chooseButton->setEnabled(selItem >= 0 && !isWriteProtected);
- if (startEditMode)
+ if (startEditMode) {
_list->startEditMode();
+
+ if (_chooseButton->isEnabled() && _list->getSelectedString() == "Untitled savestate" &&
+ _list->getSelectionColor() == ThemeEngine::kFontColorAlternate) {
+ _list->setEditString("");
+ _list->setEditColor(ThemeEngine::kFontColorNormal);
+ }
+ }
} else {
// Disable the load button if nothing is selected, or if an empty
// list item is selected.
@@ -316,6 +323,7 @@ void SaveLoadChooser::updateSaveList() {
int curSlot = 0;
int saveSlot = 0;
StringList saveNames;
+ ListWidget::ColorList colors;
for (SaveStateList::const_iterator x = _saveList.begin(); x != _saveList.end(); ++x) {
// Handle gaps in the list of save games
saveSlot = atoi(x->save_slot().c_str());
@@ -324,6 +332,7 @@ void SaveLoadChooser::updateSaveList() {
SaveStateDescriptor dummySave(curSlot, "");
_saveList.insert_at(curSlot, dummySave);
saveNames.push_back(dummySave.description());
+ colors.push_back(ThemeEngine::kFontColorNormal);
curSlot++;
}
@@ -338,8 +347,12 @@ void SaveLoadChooser::updateSaveList() {
Common::String description = x->description();
Common::String trimmedDescription = description;
trimmedDescription.trim();
- if (trimmedDescription.empty())
+ if (trimmedDescription.empty()) {
description = "Untitled savestate";
+ colors.push_back(ThemeEngine::kFontColorAlternate);
+ } else {
+ colors.push_back(ThemeEngine::kFontColorNormal);
+ }
saveNames.push_back(description);
curSlot++;
@@ -351,9 +364,10 @@ void SaveLoadChooser::updateSaveList() {
saveNames.push_back(emptyDesc);
SaveStateDescriptor dummySave(i, "");
_saveList.push_back(dummySave);
+ colors.push_back(ThemeEngine::kFontColorNormal);
}
- _list->setList(saveNames);
+ _list->setList(saveNames, &colors);
}
} // End of namespace GUI
diff --git a/gui/themes/default.inc b/gui/themes/default.inc
index 88ef801af5..d088f4181d 100644
--- a/gui/themes/default.inc
+++ b/gui/themes/default.inc
@@ -1,4 +1,360 @@
"<?xml version = '1.0'?>"
+"<render_info> "
+"<palette> "
+"<color name='black' "
+"rgb='0,0,0' "
+"/> "
+"<color name='lightgrey' "
+"rgb='104,104,104' "
+"/> "
+"<color name='darkgrey' "
+"rgb='64,64,64' "
+"/> "
+"<color name='green' "
+"rgb='32,160,32' "
+"/> "
+"<color name='green2' "
+"rgb='0,255,0' "
+"/> "
+"</palette> "
+"<fonts> "
+"<font id='text_default' "
+"file='default' "
+"/> "
+"<font id='text_button' "
+"file='default' "
+"/> "
+"<font id='text_normal' "
+"file='default' "
+"/> "
+"<text_color id='color_normal' "
+"color='green' "
+"/> "
+"<text_color id='color_normal_inverted' "
+"color='black' "
+"/> "
+"<text_color id='color_normal_hover' "
+"color='green2' "
+"/> "
+"<text_color id='color_normal_disabled' "
+"color='lightgrey' "
+"/> "
+"<text_color id='color_alternative' "
+"color='lightgrey' "
+"/> "
+"<text_color id='color_alternative_inverted' "
+"color='255,255,255' "
+"/> "
+"<text_color id='color_alternative_hover' "
+"color='176,176,176' "
+"/> "
+"<text_color id='color_alternative_disabled' "
+"color='darkgrey' "
+"/> "
+"<text_color id='color_button' "
+"color='green' "
+"/> "
+"<text_color id='color_button_hover' "
+"color='green2' "
+"/> "
+"<text_color id='color_button_disabled' "
+"color='lightgrey' "
+"/> "
+"</fonts> "
+"<defaults fill='foreground' fg_color='darkgrey' bg_color='black' shadow='0' bevel_color='lightgrey'/> "
+"<drawdata id='text_selection' cache='false'> "
+"<drawstep func='square' "
+"fill='foreground' "
+"fg_color='lightgrey' "
+"/> "
+"</drawdata> "
+"<drawdata id='text_selection_focus' cache='false'> "
+"<drawstep func='square' "
+"fill='foreground' "
+"fg_color='green' "
+"/> "
+"</drawdata> "
+"<drawdata id='mainmenu_bg' cache='false'> "
+"<drawstep func='fill' "
+"fill='foreground' "
+"fg_color='black' "
+"/> "
+"</drawdata> "
+"<drawdata id='special_bg' cache='false'> "
+"<drawstep func='bevelsq' "
+"bevel='2' "
+"/> "
+"</drawdata> "
+"<drawdata id='separator' cache='false'> "
+"<drawstep func='square' "
+"fill='foreground' "
+"height='2' "
+"ypos='center' "
+"fg_color='lightgrey' "
+"/> "
+"</drawdata> "
+"<drawdata id='scrollbar_base' cache='false'> "
+"<drawstep func='bevelsq' "
+"bevel='2' "
+"/> "
+"</drawdata> "
+"<drawdata id='scrollbar_handle_hover' cache='false'> "
+"<drawstep func='square' "
+"fill='foreground' "
+"fg_color='green2' "
+"/> "
+"</drawdata> "
+"<drawdata id='scrollbar_handle_idle' cache='false'> "
+"<drawstep func='square' "
+"fill='foreground' "
+"fg_color='green' "
+"/> "
+"</drawdata> "
+"<drawdata id='scrollbar_button_idle' cache='false'> "
+"<drawstep func='bevelsq' "
+"bevel='2' "
+"fill='none' "
+"/> "
+"<drawstep func='triangle' "
+"fg_color='green' "
+"fill='foreground' "
+"width='auto' "
+"height='auto' "
+"xpos='center' "
+"ypos='center' "
+"orientation='top' "
+"/> "
+"</drawdata> "
+"<drawdata id='scrollbar_button_hover' cache='false'> "
+"<drawstep func='bevelsq' "
+"bevel='2' "
+"fill='none' "
+"/> "
+"<drawstep func='triangle' "
+"fg_color='green2' "
+"fill='foreground' "
+"width='auto' "
+"height='auto' "
+"xpos='center' "
+"ypos='center' "
+"orientation='top' "
+"/> "
+"</drawdata> "
+"<drawdata id='tab_active' cache='false'> "
+"<text font='text_default' "
+"text_color='color_normal_hover' "
+"vertical_align='center' "
+"horizontal_align='center' "
+"/> "
+"<drawstep func='tab' "
+"bevel='2' "
+"radius='0' "
+"fill='none' "
+"/> "
+"</drawdata> "
+"<drawdata id='tab_inactive' cache='false'> "
+"<text font='text_default' "
+"text_color='color_normal' "
+"vertical_align='center' "
+"horizontal_align='center' "
+"/> "
+"<drawstep func='tab' "
+"bevel='2' "
+"radius='0' "
+"fill='none' "
+"/> "
+"</drawdata> "
+"<drawdata id='tab_background' cache='false'> "
+"</drawdata> "
+"<drawdata id='widget_slider' cache='false'> "
+"<drawstep func='bevelsq' "
+"bevel='2' "
+"fill='none' "
+"/> "
+"</drawdata> "
+"<drawdata id='slider_disabled' cache='false'> "
+"<drawstep func='square' "
+"fill='foreground' "
+"fg_color='lightgrey' "
+"/> "
+"</drawdata> "
+"<drawdata id='slider_full' cache='false'> "
+"<drawstep func='square' "
+"fill='foreground' "
+"fg_color='green' "
+"/> "
+"</drawdata> "
+"<drawdata id='slider_hover' cache='false'> "
+"<drawstep func='square' "
+"fill='foreground' "
+"fg_color='green2' "
+"/> "
+"</drawdata> "
+"<drawdata id='widget_small' cache='false'> "
+"<drawstep func='bevelsq' "
+"bevel='2' "
+"fill='none' "
+"/> "
+"</drawdata> "
+"<drawdata id='popup_idle' cache='false'> "
+"<drawstep func='bevelsq' "
+"bevel='2' "
+"fill='none' "
+"/> "
+"<drawstep func='triangle' "
+"fg_color='green' "
+"fill='foreground' "
+"width='height' "
+"height='auto' "
+"xpos='right' "
+"ypos='center' "
+"orientation='bottom' "
+"/> "
+"<text font='text_default' "
+"text_color='color_normal' "
+"vertical_align='center' "
+"horizontal_align='left' "
+"/> "
+"</drawdata> "
+"<drawdata id='popup_disabled' cache='false'> "
+"<drawstep func='bevelsq' "
+"bevel='2' "
+"fill='none' "
+"/> "
+"<drawstep func='triangle' "
+"fg_color='lightgrey' "
+"fill='foreground' "
+"width='height' "
+"height='auto' "
+"xpos='right' "
+"ypos='center' "
+"orientation='bottom' "
+"/> "
+"<text font='text_default' "
+"text_color='color_normal_disabled' "
+"vertical_align='center' "
+"horizontal_align='left' "
+"/> "
+"</drawdata> "
+"<drawdata id='popup_hover' cache='false'> "
+"<drawstep func='bevelsq' "
+"bevel='2' "
+"fill='none' "
+"/> "
+"<drawstep func='triangle' "
+"fg_color='green2' "
+"fill='foreground' "
+"width='height' "
+"height='auto' "
+"xpos='right' "
+"ypos='center' "
+"orientation='bottom' "
+"/> "
+"<text font='text_default' "
+"text_color='color_normal_hover' "
+"vertical_align='center' "
+"horizontal_align='left' "
+"/> "
+"</drawdata> "
+"<drawdata id='widget_textedit' cache='false'> "
+"<drawstep func='bevelsq' "
+"bevel='2' "
+"fill='none' "
+"/> "
+"</drawdata> "
+"<drawdata id='plain_bg' cache='false'> "
+"<drawstep func='bevelsq' "
+"bevel='2' "
+"/> "
+"</drawdata> "
+"<drawdata id='caret' cache='false'> "
+"<drawstep func='square' "
+"fill='foreground' "
+"fg_color='lightgrey' "
+"/> "
+"</drawdata> "
+"<drawdata id='default_bg' cache='false'> "
+"<drawstep func='bevelsq' "
+"bevel='2' "
+"/> "
+"</drawdata> "
+"<drawdata id='button_idle' cache='false'> "
+"<text font='text_button' "
+"text_color='color_button' "
+"vertical_align='center' "
+"horizontal_align='center' "
+"/> "
+"<drawstep func='bevelsq' "
+"bevel='2' "
+"fill='none' "
+"/> "
+"</drawdata> "
+"<drawdata id='button_hover' cache='false'> "
+"<text font='text_button' "
+"text_color='color_button_hover' "
+"vertical_align='center' "
+"horizontal_align='center' "
+"/> "
+"<drawstep func='bevelsq' "
+"bevel='2' "
+"fill='none' "
+"/> "
+"</drawdata> "
+"<drawdata id='button_disabled' cache='false'> "
+"<text font='text_button' "
+"text_color='color_button_disabled' "
+"vertical_align='center' "
+"horizontal_align='center' "
+"/> "
+"<drawstep func='bevelsq' "
+"bevel='2' "
+"fill='none' "
+"/> "
+"</drawdata> "
+"<drawdata id='checkbox_disabled' cache='false'> "
+"<text font='text_default' "
+"text_color='color_normal_disabled' "
+"vertical_align='top' "
+"horizontal_align='left' "
+"/> "
+"<drawstep func='bevelsq' "
+"bevel='2' "
+"fill='none' "
+"/> "
+"</drawdata> "
+"<drawdata id='checkbox_selected' cache='false'> "
+"<text font='text_default' "
+"text_color='color_normal' "
+"vertical_align='top' "
+"horizontal_align='left' "
+"/> "
+"<drawstep func='bevelsq' "
+"bevel='2' "
+"fill='none' "
+"/> "
+"<drawstep func='cross' "
+"fill='foreground' "
+"stroke='2' "
+"fg_color='green' "
+"/> "
+"</drawdata> "
+"<drawdata id='checkbox_default' cache='false'> "
+"<text font='text_default' "
+"text_color='color_normal' "
+"vertical_align='top' "
+"horizontal_align='left' "
+"/> "
+"<drawstep func='bevelsq' "
+"bevel='2' "
+"fill='none' "
+"/> "
+"</drawdata> "
+"<drawdata id='widget_default' cache='false'> "
+"<drawstep func='bevelsq' "
+"bevel='2' "
+"/> "
+"</drawdata> "
+"</render_info> "
"<layout_info resolution='320xY,256x240,Xx272'> "
"<globals> "
"<def var='Line.Height' value='12' /> "
@@ -8,7 +364,7 @@
"<def var='ShowLauncherLogo' value='0'/> "
"<def var='ShowGlobalMenuLogo' value='0'/> "
"<def var='ShowSearchPic' value='0'/> "
-"<def var='ScummSaveLoad.ExtInfo.Visible' value='0'/> "
+"<def var='SaveLoadChooser.ExtInfo.Visible' value='0'/> "
"<def var='KeyMapper.Spacing' value='5'/> "
"<def var='KeyMapper.LabelWidth' value='80'/> "
"<def var='KeyMapper.ButtonWidth' value='60'/> "
@@ -668,7 +1024,7 @@
"</layout> "
"</layout> "
"</dialog> "
-"<dialog name='ScummSaveLoad' overlays='screen' inset='8' shading='dim'> "
+"<dialog name='SaveLoadChooser' overlays='screen' inset='8' shading='dim'> "
"<layout type='vertical' padding='8,8,8,8' center='true'> "
"<widget name='Title' height='Globals.Line.Height'/> "
"<widget name='List' /> "
@@ -765,7 +1121,7 @@
"<def var='ShowLauncherLogo' value='0'/> "
"<def var='ShowGlobalMenuLogo' value='0'/> "
"<def var='ShowSearchPic' value='0'/> "
-"<def var='ScummSaveLoad.ExtInfo.Visible' value='1'/> "
+"<def var='SaveLoadChooser.ExtInfo.Visible' value='1'/> "
"<def var='KeyMapper.Spacing' value='10'/> "
"<def var='KeyMapper.LabelWidth' value='100'/> "
"<def var='KeyMapper.ButtonWidth' value='80'/> "
@@ -1413,7 +1769,7 @@
"</layout> "
"</layout> "
"</dialog> "
-"<dialog name='ScummSaveLoad' overlays='screen' inset='8' shading='dim'> "
+"<dialog name='SaveLoadChooser' overlays='screen' inset='8' shading='dim'> "
"<layout type='vertical' padding='8,8,8,32' center='true'> "
"<widget name='Title' "
"height='Globals.Line.Height' "
@@ -1509,359 +1865,3 @@
"</layout> "
"</dialog> "
"</layout_info> "
-"<render_info> "
-"<palette> "
-"<color name='black' "
-"rgb='0,0,0' "
-"/> "
-"<color name='lightgrey' "
-"rgb='104,104,104' "
-"/> "
-"<color name='darkgrey' "
-"rgb='64,64,64' "
-"/> "
-"<color name='green' "
-"rgb='32,160,32' "
-"/> "
-"<color name='green2' "
-"rgb='0,255,0' "
-"/> "
-"</palette> "
-"<fonts> "
-"<font id='text_default' "
-"file='default' "
-"/> "
-"<font id='text_button' "
-"file='default' "
-"/> "
-"<font id='text_normal' "
-"file='default' "
-"/> "
-"<text_color id='color_normal' "
-"color='green' "
-"/> "
-"<text_color id='color_normal_inverted' "
-"color='black' "
-"/> "
-"<text_color id='color_normal_hover' "
-"color='green2' "
-"/> "
-"<text_color id='color_normal_disabled' "
-"color='lightgrey' "
-"/> "
-"<text_color id='color_alternative' "
-"color='green' "
-"/> "
-"<text_color id='color_alternative_inverted' "
-"color='black' "
-"/> "
-"<text_color id='color_alternative_hover' "
-"color='green2' "
-"/> "
-"<text_color id='color_alternative_disabled' "
-"color='lightgrey' "
-"/> "
-"<text_color id='color_button' "
-"color='green' "
-"/> "
-"<text_color id='color_button_hover' "
-"color='green2' "
-"/> "
-"<text_color id='color_button_disabled' "
-"color='lightgrey' "
-"/> "
-"</fonts> "
-"<defaults fill='foreground' fg_color='darkgrey' bg_color='black' shadow='0' bevel_color='lightgrey'/> "
-"<drawdata id='text_selection' cache='false'> "
-"<drawstep func='square' "
-"fill='foreground' "
-"fg_color='lightgrey' "
-"/> "
-"</drawdata> "
-"<drawdata id='text_selection_focus' cache='false'> "
-"<drawstep func='square' "
-"fill='foreground' "
-"fg_color='green' "
-"/> "
-"</drawdata> "
-"<drawdata id='mainmenu_bg' cache='false'> "
-"<drawstep func='fill' "
-"fill='foreground' "
-"fg_color='black' "
-"/> "
-"</drawdata> "
-"<drawdata id='special_bg' cache='false'> "
-"<drawstep func='bevelsq' "
-"bevel='2' "
-"/> "
-"</drawdata> "
-"<drawdata id='separator' cache='false'> "
-"<drawstep func='square' "
-"fill='foreground' "
-"height='2' "
-"ypos='center' "
-"fg_color='lightgrey' "
-"/> "
-"</drawdata> "
-"<drawdata id='scrollbar_base' cache='false'> "
-"<drawstep func='bevelsq' "
-"bevel='2' "
-"/> "
-"</drawdata> "
-"<drawdata id='scrollbar_handle_hover' cache='false'> "
-"<drawstep func='square' "
-"fill='foreground' "
-"fg_color='green2' "
-"/> "
-"</drawdata> "
-"<drawdata id='scrollbar_handle_idle' cache='false'> "
-"<drawstep func='square' "
-"fill='foreground' "
-"fg_color='green' "
-"/> "
-"</drawdata> "
-"<drawdata id='scrollbar_button_idle' cache='false'> "
-"<drawstep func='bevelsq' "
-"bevel='2' "
-"fill='none' "
-"/> "
-"<drawstep func='triangle' "
-"fg_color='green' "
-"fill='foreground' "
-"width='auto' "
-"height='auto' "
-"xpos='center' "
-"ypos='center' "
-"orientation='top' "
-"/> "
-"</drawdata> "
-"<drawdata id='scrollbar_button_hover' cache='false'> "
-"<drawstep func='bevelsq' "
-"bevel='2' "
-"fill='none' "
-"/> "
-"<drawstep func='triangle' "
-"fg_color='green2' "
-"fill='foreground' "
-"width='auto' "
-"height='auto' "
-"xpos='center' "
-"ypos='center' "
-"orientation='top' "
-"/> "
-"</drawdata> "
-"<drawdata id='tab_active' cache='false'> "
-"<text font='text_default' "
-"text_color='color_normal_hover' "
-"vertical_align='center' "
-"horizontal_align='center' "
-"/> "
-"<drawstep func='tab' "
-"bevel='2' "
-"radius='0' "
-"fill='none' "
-"/> "
-"</drawdata> "
-"<drawdata id='tab_inactive' cache='false'> "
-"<text font='text_default' "
-"text_color='color_normal' "
-"vertical_align='center' "
-"horizontal_align='center' "
-"/> "
-"<drawstep func='tab' "
-"bevel='2' "
-"radius='0' "
-"fill='none' "
-"/> "
-"</drawdata> "
-"<drawdata id='tab_background' cache='false'> "
-"</drawdata> "
-"<drawdata id='widget_slider' cache='false'> "
-"<drawstep func='bevelsq' "
-"bevel='2' "
-"fill='none' "
-"/> "
-"</drawdata> "
-"<drawdata id='slider_disabled' cache='false'> "
-"<drawstep func='square' "
-"fill='foreground' "
-"fg_color='lightgrey' "
-"/> "
-"</drawdata> "
-"<drawdata id='slider_full' cache='false'> "
-"<drawstep func='square' "
-"fill='foreground' "
-"fg_color='green' "
-"/> "
-"</drawdata> "
-"<drawdata id='slider_hover' cache='false'> "
-"<drawstep func='square' "
-"fill='foreground' "
-"fg_color='green2' "
-"/> "
-"</drawdata> "
-"<drawdata id='widget_small' cache='false'> "
-"<drawstep func='bevelsq' "
-"bevel='2' "
-"fill='none' "
-"/> "
-"</drawdata> "
-"<drawdata id='popup_idle' cache='false'> "
-"<drawstep func='bevelsq' "
-"bevel='2' "
-"fill='none' "
-"/> "
-"<drawstep func='triangle' "
-"fg_color='green' "
-"fill='foreground' "
-"width='height' "
-"height='auto' "
-"xpos='right' "
-"ypos='center' "
-"orientation='bottom' "
-"/> "
-"<text font='text_default' "
-"text_color='color_normal' "
-"vertical_align='center' "
-"horizontal_align='left' "
-"/> "
-"</drawdata> "
-"<drawdata id='popup_disabled' cache='false'> "
-"<drawstep func='bevelsq' "
-"bevel='2' "
-"fill='none' "
-"/> "
-"<drawstep func='triangle' "
-"fg_color='lightgrey' "
-"fill='foreground' "
-"width='height' "
-"height='auto' "
-"xpos='right' "
-"ypos='center' "
-"orientation='bottom' "
-"/> "
-"<text font='text_default' "
-"text_color='color_normal_disabled' "
-"vertical_align='center' "
-"horizontal_align='left' "
-"/> "
-"</drawdata> "
-"<drawdata id='popup_hover' cache='false'> "
-"<drawstep func='bevelsq' "
-"bevel='2' "
-"fill='none' "
-"/> "
-"<drawstep func='triangle' "
-"fg_color='green2' "
-"fill='foreground' "
-"width='height' "
-"height='auto' "
-"xpos='right' "
-"ypos='center' "
-"orientation='bottom' "
-"/> "
-"<text font='text_default' "
-"text_color='color_normal_hover' "
-"vertical_align='center' "
-"horizontal_align='left' "
-"/> "
-"</drawdata> "
-"<drawdata id='widget_textedit' cache='false'> "
-"<drawstep func='bevelsq' "
-"bevel='2' "
-"fill='none' "
-"/> "
-"</drawdata> "
-"<drawdata id='plain_bg' cache='false'> "
-"<drawstep func='bevelsq' "
-"bevel='2' "
-"/> "
-"</drawdata> "
-"<drawdata id='caret' cache='false'> "
-"<drawstep func='square' "
-"fill='foreground' "
-"fg_color='lightgrey' "
-"/> "
-"</drawdata> "
-"<drawdata id='default_bg' cache='false'> "
-"<drawstep func='bevelsq' "
-"bevel='2' "
-"/> "
-"</drawdata> "
-"<drawdata id='button_idle' cache='false'> "
-"<text font='text_button' "
-"text_color='color_button' "
-"vertical_align='center' "
-"horizontal_align='center' "
-"/> "
-"<drawstep func='bevelsq' "
-"bevel='2' "
-"fill='none' "
-"/> "
-"</drawdata> "
-"<drawdata id='button_hover' cache='false'> "
-"<text font='text_button' "
-"text_color='color_button_hover' "
-"vertical_align='center' "
-"horizontal_align='center' "
-"/> "
-"<drawstep func='bevelsq' "
-"bevel='2' "
-"fill='none' "
-"/> "
-"</drawdata> "
-"<drawdata id='button_disabled' cache='false'> "
-"<text font='text_button' "
-"text_color='color_button_disabled' "
-"vertical_align='center' "
-"horizontal_align='center' "
-"/> "
-"<drawstep func='bevelsq' "
-"bevel='2' "
-"fill='none' "
-"/> "
-"</drawdata> "
-"<drawdata id='checkbox_disabled' cache='false'> "
-"<text font='text_default' "
-"text_color='color_normal_disabled' "
-"vertical_align='top' "
-"horizontal_align='left' "
-"/> "
-"<drawstep func='bevelsq' "
-"bevel='2' "
-"fill='none' "
-"/> "
-"</drawdata> "
-"<drawdata id='checkbox_selected' cache='false'> "
-"<text font='text_default' "
-"text_color='color_normal' "
-"vertical_align='top' "
-"horizontal_align='left' "
-"/> "
-"<drawstep func='bevelsq' "
-"bevel='2' "
-"fill='none' "
-"/> "
-"<drawstep func='cross' "
-"fill='foreground' "
-"stroke='2' "
-"fg_color='green' "
-"/> "
-"</drawdata> "
-"<drawdata id='checkbox_default' cache='false'> "
-"<text font='text_default' "
-"text_color='color_normal' "
-"vertical_align='top' "
-"horizontal_align='left' "
-"/> "
-"<drawstep func='bevelsq' "
-"bevel='2' "
-"fill='none' "
-"/> "
-"</drawdata> "
-"<drawdata id='widget_default' cache='false'> "
-"<drawstep func='bevelsq' "
-"bevel='2' "
-"/> "
-"</drawdata> "
-"</render_info> "
diff --git a/gui/themes/scummclassic.zip b/gui/themes/scummclassic.zip
index c295002f9d..7009b217af 100644
--- a/gui/themes/scummclassic.zip
+++ b/gui/themes/scummclassic.zip
Binary files differ
diff --git a/gui/themes/scummclassic/THEMERC b/gui/themes/scummclassic/THEMERC
index 524141faf2..c913ff6078 100644
--- a/gui/themes/scummclassic/THEMERC
+++ b/gui/themes/scummclassic/THEMERC
@@ -1 +1 @@
-[SCUMMVM_STX0.7:ScummVM Classic Theme:No Author]
+[SCUMMVM_STX0.8:ScummVM Classic Theme:No Author]
diff --git a/gui/themes/scummclassic/classic_gfx.stx b/gui/themes/scummclassic/classic_gfx.stx
index ff2fadc577..ceb8aa8bf2 100644
--- a/gui/themes/scummclassic/classic_gfx.stx
+++ b/gui/themes/scummclassic/classic_gfx.stx
@@ -70,19 +70,19 @@
/>
<text_color id = 'color_alternative'
- color = 'green'
+ color = 'lightgrey'
/>
<text_color id = 'color_alternative_inverted'
- color = 'black'
+ color = '255, 255, 255'
/>
<text_color id = 'color_alternative_hover'
- color = 'green2'
+ color = '176, 176, 176'
/>
<text_color id = 'color_alternative_disabled'
- color = 'lightgrey'
+ color = 'darkgrey'
/>
<text_color id = 'color_button'
diff --git a/gui/themes/scummclassic/classic_layout.stx b/gui/themes/scummclassic/classic_layout.stx
index 029c7479ac..40074640c8 100644
--- a/gui/themes/scummclassic/classic_layout.stx
+++ b/gui/themes/scummclassic/classic_layout.stx
@@ -35,7 +35,7 @@
<def var = 'ShowGlobalMenuLogo' value = '0'/>
<def var = 'ShowSearchPic' value = '0'/>
- <def var = 'ScummSaveLoad.ExtInfo.Visible' value = '1'/>
+ <def var = 'SaveLoadChooser.ExtInfo.Visible' value = '1'/>
<def var = 'KeyMapper.Spacing' value = '10'/>
<def var = 'KeyMapper.LabelWidth' value = '100'/>
@@ -710,7 +710,7 @@
</layout>
</dialog>
- <dialog name = 'ScummSaveLoad' overlays = 'screen' inset = '8' shading = 'dim'>
+ <dialog name = 'SaveLoadChooser' overlays = 'screen' inset = '8' shading = 'dim'>
<layout type = 'vertical' padding = '8, 8, 8, 32' center = 'true'>
<widget name = 'Title'
height = 'Globals.Line.Height'
diff --git a/gui/themes/scummclassic/classic_layout_lowres.stx b/gui/themes/scummclassic/classic_layout_lowres.stx
index da56f0178a..eb3a4ac326 100644
--- a/gui/themes/scummclassic/classic_layout_lowres.stx
+++ b/gui/themes/scummclassic/classic_layout_lowres.stx
@@ -36,7 +36,7 @@
<def var = 'ShowGlobalMenuLogo' value = '0'/>
<def var = 'ShowSearchPic' value = '0'/>
- <def var = 'ScummSaveLoad.ExtInfo.Visible' value = '0'/>
+ <def var = 'SaveLoadChooser.ExtInfo.Visible' value = '0'/>
<def var = 'KeyMapper.Spacing' value = '5'/>
<def var = 'KeyMapper.LabelWidth' value = '80'/>
@@ -723,7 +723,7 @@
</layout>
</dialog>
- <dialog name = 'ScummSaveLoad' overlays = 'screen' inset = '8' shading = 'dim'>
+ <dialog name = 'SaveLoadChooser' overlays = 'screen' inset = '8' shading = 'dim'>
<layout type = 'vertical' padding = '8, 8, 8, 8' center = 'true'>
<widget name = 'Title' height = 'Globals.Line.Height'/>
<widget name = 'List' />
diff --git a/gui/themes/scummmodern.zip b/gui/themes/scummmodern.zip
index 7e693c3247..b24e888316 100644
--- a/gui/themes/scummmodern.zip
+++ b/gui/themes/scummmodern.zip
Binary files differ
diff --git a/gui/themes/scummmodern/THEMERC b/gui/themes/scummmodern/THEMERC
index 784f4fae50..34495f71fa 100644
--- a/gui/themes/scummmodern/THEMERC
+++ b/gui/themes/scummmodern/THEMERC
@@ -1 +1 @@
-[SCUMMVM_STX0.7:ScummVM Modern Theme:No Author]
+[SCUMMVM_STX0.8:ScummVM Modern Theme:No Author]
diff --git a/gui/themes/scummmodern/checkbox_empty.bmp b/gui/themes/scummmodern/checkbox_empty.bmp
new file mode 100644
index 0000000000..89ebdcbf41
--- /dev/null
+++ b/gui/themes/scummmodern/checkbox_empty.bmp
Binary files differ
diff --git a/gui/themes/scummmodern/scummmodern_gfx.stx b/gui/themes/scummmodern/scummmodern_gfx.stx
index 6a3ab0c233..05316b516f 100644
--- a/gui/themes/scummmodern/scummmodern_gfx.stx
+++ b/gui/themes/scummmodern/scummmodern_gfx.stx
@@ -130,15 +130,15 @@
/>
<text_color id = 'color_alternative'
- color = 'black'
+ color = '128, 128, 128'
/>
<text_color id = 'color_alternative_inverted'
- color = 'black'
+ color = 'white'
/>
<text_color id = 'color_alternative_hover'
- color = 'bgreen'
+ color = 'darkgray'
/>
<text_color id = 'color_alternative_disabled'
diff --git a/gui/themes/scummmodern/scummmodern_layout.stx b/gui/themes/scummmodern/scummmodern_layout.stx
index 6582022fe1..33e0537a3c 100644
--- a/gui/themes/scummmodern/scummmodern_layout.stx
+++ b/gui/themes/scummmodern/scummmodern_layout.stx
@@ -42,7 +42,7 @@
<def var = 'ShowGlobalMenuLogo' value = '1'/>
<def var = 'ShowSearchPic' value = '1'/>
- <def var = 'ScummSaveLoad.ExtInfo.Visible' value = '1'/>
+ <def var = 'SaveLoadChooser.ExtInfo.Visible' value = '1'/>
<def var = 'KeyMapper.Spacing' value = '10'/>
<def var = 'KeyMapper.LabelWidth' value = '100'/>
@@ -723,7 +723,7 @@
</layout>
</dialog>
- <dialog name = 'ScummSaveLoad' overlays = 'screen' inset = '8' shading = 'dim'>
+ <dialog name = 'SaveLoadChooser' overlays = 'screen' inset = '8' shading = 'dim'>
<layout type = 'vertical' padding = '8, 8, 8, 32' center = 'true'>
<widget name = 'Title'
height = 'Globals.Line.Height'
diff --git a/gui/themes/scummmodern/scummmodern_layout_lowres.stx b/gui/themes/scummmodern/scummmodern_layout_lowres.stx
index c514ccc458..b756488279 100644
--- a/gui/themes/scummmodern/scummmodern_layout_lowres.stx
+++ b/gui/themes/scummmodern/scummmodern_layout_lowres.stx
@@ -34,7 +34,7 @@
<def var = 'ShowGlobalMenuLogo' value = '0'/>
<def var = 'ShowSearchPic' value = '0'/>
- <def var = 'ScummSaveLoad.ExtInfo.Visible' value = '0'/>
+ <def var = 'SaveLoadChooser.ExtInfo.Visible' value = '0'/>
<widget name = 'Button'
size = '72, 16'
@@ -712,7 +712,7 @@
</layout>
</dialog>
- <dialog name = 'ScummSaveLoad' overlays = 'screen' inset = '8' shading = 'dim'>
+ <dialog name = 'SaveLoadChooser' overlays = 'screen' inset = '8' shading = 'dim'>
<layout type = 'vertical' padding = '8, 8, 8, 8' center = 'true'>
<widget name = 'Title' height = 'Globals.Line.Height'/>
<widget name = 'List' />
diff --git a/gui/themes/scummmodern/search.bmp b/gui/themes/scummmodern/search.bmp
new file mode 100644
index 0000000000..fa963f8f16
--- /dev/null
+++ b/gui/themes/scummmodern/search.bmp
Binary files differ