Strip trailing whitespaces in the whole code base.

svn-id: r40867
This commit is contained in:
Johannes Schickel 2009-05-24 15:17:42 +00:00
parent 7c1eb05714
commit b3c6751b9b
163 changed files with 734 additions and 734 deletions

View file

@ -469,7 +469,7 @@ bool DefaultEventManager::pollEvent(Common::Event &event) {
event.type = Common::EVENT_RTL; event.type = Common::EVENT_RTL;
} }
} }
#ifdef ENABLE_VKEYBD #ifdef ENABLE_VKEYBD
else if (event.kbd.keycode == Common::KEYCODE_F7 && event.kbd.flags == 0) { else if (event.kbd.keycode == Common::KEYCODE_F7 && event.kbd.flags == 0) {
if (_vk->isDisplaying()) { if (_vk->isDisplaying()) {
_vk->close(true); _vk->close(true);
@ -483,7 +483,7 @@ bool DefaultEventManager::pollEvent(Common::Event &event) {
} }
} }
#endif #endif
#ifdef ENABLE_KEYMAPPER #ifdef ENABLE_KEYMAPPER
else if (event.kbd.keycode == Common::KEYCODE_F8 && event.kbd.flags == 0) { else if (event.kbd.keycode == Common::KEYCODE_F8 && event.kbd.flags == 0) {
if (!_remap) { if (!_remap) {
_remap = true; _remap = true;

View file

@ -143,7 +143,7 @@ public:
virtual int shouldQuit() const { return _shouldQuit; } virtual int shouldQuit() const { return _shouldQuit; }
virtual int shouldRTL() const { return _shouldRTL; } virtual int shouldRTL() const { return _shouldRTL; }
virtual void resetRTL() { _shouldRTL = false; } virtual void resetRTL() { _shouldRTL = false; }
#ifdef ENABLE_KEYMAPPER #ifdef ENABLE_KEYMAPPER
virtual Common::Keymapper *getKeymapper() { return _keymapper; } virtual Common::Keymapper *getKeymapper() { return _keymapper; }
#endif #endif

View file

@ -224,7 +224,7 @@ GBAMPFileSystemNode::GBAMPFileSystemNode(const Common::String& path) {
lastSlash = r; lastSlash = r;
} }
} }
if (path == "mp:/") { if (path == "mp:/") {
// This is the root directory // This is the root directory
_isDirectory = true; _isDirectory = true;

View file

@ -264,7 +264,7 @@ void Ps2FilesystemNode::doverify(void) {
_isHere = false; _isHere = false;
_isDirectory = false; _isDirectory = false;
return; return;
} }
switch (medium) { switch (medium) {
#if 0 #if 0
@ -361,7 +361,7 @@ AbstractFSNode *Ps2FilesystemNode::getChild(const Common::String &n) const {
/* /*
int fd; int fd;
if (_path == "pfs0:") if (_path == "pfs0:")
fd = fio.dopen("pfs0:/"); fd = fio.dopen("pfs0:/");
else else
@ -442,7 +442,7 @@ bool Ps2FilesystemNode::getChildren(AbstractFSList &list, ListMode mode, bool hi
if ( (mode == Common::FSNode::kListAll) || if ( (mode == Common::FSNode::kListAll) ||
((mode == Common::FSNode::kListDirectoriesOnly) && ((mode == Common::FSNode::kListDirectoriesOnly) &&
(dirent.stat.mode & FIO_S_IFDIR)) || (dirent.stat.mode & FIO_S_IFDIR)) ||
((mode == Common::FSNode::kListFilesOnly) && ((mode == Common::FSNode::kListFilesOnly) &&
@ -499,7 +499,7 @@ char *Ps2FilesystemNode::getDeviceDescription() const {
return "Host"; return "Host";
else if (strncmp(_path.c_str(), "mc0", 3) == 0) else if (strncmp(_path.c_str(), "mc0", 3) == 0)
return "Memory Card"; return "Memory Card";
else else
return "WTF ???"; return "WTF ???";
} }

View file

@ -136,10 +136,10 @@ SymbianFilesystemNode::SymbianFilesystemNode(const Common::String &path) {
} else { } else {
_isValid = ETrue; _isValid = ETrue;
_isDirectory = EFalse; _isDirectory = EFalse;
TParsePtrC parser(fname); TParsePtrC parser(fname);
if(parser.PathPresent() && parser.Path().Compare(_L("\\")) == KErrNone && !parser.NameOrExtPresent()) { if(parser.PathPresent() && parser.Path().Compare(_L("\\")) == KErrNone && !parser.NameOrExtPresent()) {
_isDirectory = ETrue; _isDirectory = ETrue;
} }
} }
} }

View file

@ -31,7 +31,7 @@
namespace Common { namespace Common {
Action::Action(Keymap *boss, const char *i, String des, ActionType typ, Action::Action(Keymap *boss, const char *i, String des, ActionType typ,
KeyType prefKey, int pri, int flg) KeyType prefKey, int pri, int flg)
: _boss(boss), description(des), type(typ), preferredKey(prefKey), : _boss(boss), description(des), type(typ), preferredKey(prefKey),
priority(pri), flags(flg), _hwKey(0) { priority(pri), flags(flg), _hwKey(0) {

View file

@ -63,12 +63,12 @@ private:
Keymap *_boss; Keymap *_boss;
public: public:
Action(Keymap *boss, const char *id, String des = "", Action(Keymap *boss, const char *id, String des = "",
ActionType typ = kGenericActionType, ActionType typ = kGenericActionType,
KeyType prefKey = kGenericKeyType, KeyType prefKey = kGenericKeyType,
int pri = 0, int flg = 0 ); int pri = 0, int flg = 0 );
void addEvent(const Event &evt) { void addEvent(const Event &evt) {
events.push_back(evt); events.push_back(evt);
} }
@ -101,7 +101,7 @@ public:
addEvent(evt); addEvent(evt);
} }
Keymap *getParent() { Keymap *getParent() {
return _boss; return _boss;
} }
@ -111,10 +111,10 @@ public:
}; };
struct ActionPriorityComp : public BinaryFunction<Action, Action, bool> { struct ActionPriorityComp : public BinaryFunction<Action, Action, bool> {
bool operator()(const Action *x, const Action *y) const { bool operator()(const Action *x, const Action *y) const {
return x->priority > y->priority; return x->priority > y->priority;
} }
bool operator()(const Action &x, const Action &y) const { bool operator()(const Action &x, const Action &y) const {
return x.priority > y.priority; return x.priority > y.priority;
} }
}; };

View file

@ -38,17 +38,17 @@ namespace Common {
#define HWKEY_ID_SIZE (30) #define HWKEY_ID_SIZE (30)
/** /**
* Describes an available hardware key * Describes an available hardware key
*/ */
struct HardwareKey { struct HardwareKey {
/** unique id used for saving/loading to config */ /** unique id used for saving/loading to config */
char hwKeyId[HWKEY_ID_SIZE]; char hwKeyId[HWKEY_ID_SIZE];
/** Human readable description */ /** Human readable description */
String description; String description;
/** /**
* The KeyState that is generated by the back-end * The KeyState that is generated by the back-end
* when this hardware key is pressed. * when this hardware key is pressed.
*/ */
KeyState key; KeyState key;
@ -69,7 +69,7 @@ struct HardwareKey {
* Simple class to encapsulate a device's set of HardwareKeys. * Simple class to encapsulate a device's set of HardwareKeys.
* Each device should instantiate this and call addHardwareKey a number of times * Each device should instantiate this and call addHardwareKey a number of times
* in its constructor to define the device's available keys. * in its constructor to define the device's available keys.
*/ */
class HardwareKeySet { class HardwareKeySet {
public: public:

View file

@ -124,7 +124,7 @@ void Keymap::loadMappings(const HardwareKeySet *hwKeys) {
if (!_configDomain) if (!_configDomain)
return; return;
ConfigManager::Domain::iterator it; ConfigManager::Domain::iterator it;
String prefix = KEYMAP_KEY_PREFIX + _name + "_"; String prefix = KEYMAP_KEY_PREFIX + _name + "_";
for (it = _configDomain->begin(); it != _configDomain->end(); it++) { for (it = _configDomain->begin(); it != _configDomain->end(); it++) {
@ -138,7 +138,7 @@ void Keymap::loadMappings(const HardwareKeySet *hwKeys) {
Action *ua = getAction(actionId); Action *ua = getAction(actionId);
if (!ua) { if (!ua) {
warning("'%s' keymap does not contain Action with ID %s", warning("'%s' keymap does not contain Action with ID %s",
_name.c_str(), actionId); _name.c_str(), actionId);
_configDomain->erase(key); _configDomain->erase(key);
@ -199,7 +199,7 @@ bool Keymap::isComplete(const HardwareKeySet *hwKeys) {
// TODO: // TODO:
// - current weakness: // - current weakness:
// - if an action finds a key with required type but a parent action with // - if an action finds a key with required type but a parent action with
// higher priority is using it, that key is never used // higher priority is using it, that key is never used
void Keymap::automaticMapping(HardwareKeySet *hwKeys) { void Keymap::automaticMapping(HardwareKeySet *hwKeys) {
// Create copies of action and key lists. // Create copies of action and key lists.
@ -208,7 +208,7 @@ void Keymap::automaticMapping(HardwareKeySet *hwKeys) {
List<Action*>::iterator actIt; List<Action*>::iterator actIt;
List<const HardwareKey*>::iterator keyIt, selectedKey; List<const HardwareKey*>::iterator keyIt, selectedKey;
// Remove actions and keys from local lists that have already been mapped. // Remove actions and keys from local lists that have already been mapped.
actIt = actions.begin(); actIt = actions.begin();
@ -227,16 +227,16 @@ void Keymap::automaticMapping(HardwareKeySet *hwKeys) {
// Sort remaining actions by priority. // Sort remaining actions by priority.
ActionPriorityComp priorityComp; ActionPriorityComp priorityComp;
sort(actions.begin(), actions.end(), priorityComp); sort(actions.begin(), actions.end(), priorityComp);
// First mapping pass: // First mapping pass:
// - Match if a key's preferred action type is the same as the action's // - 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: // - Priority is given to:
// - keys that match action types over key types. // - keys that match action types over key types.
// - keys that have not been used by parent maps. // - keys that have not been used by parent maps.
// - If a key has been used by a parent map the new action must have a // - If a key has been used by a parent map the new action must have a
// higher priority than the parent action. // higher priority than the parent action.
// - As soon as the number of skipped actions equals the number of keys // - As soon as the number of skipped actions equals the number of keys
// remaining we stop matching. This means that the second pass will assign keys // remaining we stop matching. This means that the second pass will assign keys
// to these higher priority skipped actions. // to these higher priority skipped actions.
uint skipped = 0; uint skipped = 0;
@ -317,7 +317,7 @@ void Keymap::automaticMapping(HardwareKeySet *hwKeys) {
if (selectedKey != keys.end()) { if (selectedKey != keys.end()) {
act->mapKey(*selectedKey); act->mapKey(*selectedKey);
keys.erase(selectedKey); keys.erase(selectedKey);
} else {// no match = no keys left } else {// no match = no keys left
break; break;
} }
} }

View file

@ -48,7 +48,7 @@ class HardwareKeySet;
template<> struct Hash<KeyState> template<> struct Hash<KeyState>
: public UnaryFunction<KeyState, uint> { : public UnaryFunction<KeyState, uint> {
uint operator()(const KeyState &val) const { uint operator()(const KeyState &val) const {
return (uint)val.keycode | ((uint)val.flags << 24); return (uint)val.keycode | ((uint)val.flags << 24);
} }
}; };
@ -78,7 +78,7 @@ public:
* @return a pointer to the Action or 0 if no * @return a pointer to the Action or 0 if no
*/ */
Action *getMappedAction(const KeyState& ks) const; Action *getMappedAction(const KeyState& ks) const;
void setConfigDomain(ConfigManager::Domain *dom); void setConfigDomain(ConfigManager::Domain *dom);
/** /**
@ -94,7 +94,7 @@ public:
*/ */
void saveMappings(); void saveMappings();
void automaticMapping(HardwareKeySet *hwKeys); void automaticMapping(HardwareKeySet *hwKeys);
/** /**
@ -110,7 +110,7 @@ private:
friend struct Action; friend struct Action;
/** /**
* Adds a new Action to this Map, * Adds a new Action to this Map,
* adding it at the back of the internal array * adding it at the back of the internal array
* @param action the Action to add * @param action the Action to add
*/ */
@ -141,7 +141,7 @@ private:
String _name; String _name;
Keymap *_parent; Keymap *_parent;
List<Action*> _actions; List<Action*> _actions;
HashMap<KeyState, Action*> _keymap; HashMap<KeyState, Action*> _keymap;
ConfigManager::Domain *_configDomain; ConfigManager::Domain *_configDomain;
}; };

View file

@ -86,7 +86,7 @@ void Keymapper::addGlobalKeymap(Keymap *keymap) {
void Keymapper::addGameKeymap(Keymap *keymap) { void Keymapper::addGameKeymap(Keymap *keymap) {
if (ConfMan.getActiveDomain() == 0) if (ConfMan.getActiveDomain() == 0)
error("Call to Keymapper::addGameKeymap when no game loaded"); error("Call to Keymapper::addGameKeymap when no game loaded");
// Detect whether the active game changed since last call. // Detect whether the active game changed since last call.
// If so, flush the game key configuration. // If so, flush the game key configuration.
if (_gameDomain.getConfigDomain() != ConfMan.getActiveDomain()) { if (_gameDomain.getConfigDomain() != ConfMan.getActiveDomain()) {
@ -118,7 +118,7 @@ void Keymapper::initKeymap(Domain &domain, Keymap *map) {
void Keymapper::cleanupGameKeymaps() { void Keymapper::cleanupGameKeymaps() {
// Flush all game specific keymaps // Flush all game specific keymaps
_gameDomain.deleteAllKeyMaps(); _gameDomain.deleteAllKeyMaps();
// Now restore the stack of active maps. Re-add all global keymaps, drop // Now restore the stack of active maps. Re-add all global keymaps, drop
// the game specific (=deleted) ones. // the game specific (=deleted) ones.
Stack<MapRecord> newStack; Stack<MapRecord> newStack;

View file

@ -41,7 +41,7 @@ namespace Common {
class Keymapper { class Keymapper {
public: public:
struct MapRecord { struct MapRecord {
Keymap* keymap; Keymap* keymap;
bool inherit; bool inherit;
@ -53,11 +53,11 @@ public:
IgnoreCase_Hash, IgnoreCase_EqualTo> { IgnoreCase_Hash, IgnoreCase_EqualTo> {
public: public:
Domain() : _configDomain(0) {} Domain() : _configDomain(0) {}
~Domain() { ~Domain() {
deleteAllKeyMaps(); deleteAllKeyMaps();
} }
void setConfigDomain(ConfigManager::Domain *confDom) { void setConfigDomain(ConfigManager::Domain *confDom) {
_configDomain = confDom; _configDomain = confDom;
} }
ConfigManager::Domain *getConfigDomain() { ConfigManager::Domain *getConfigDomain() {
@ -69,7 +69,7 @@ public:
void deleteAllKeyMaps(); void deleteAllKeyMaps();
Keymap *getKeymap(const String& name); Keymap *getKeymap(const String& name);
private: private:
ConfigManager::Domain *_configDomain; ConfigManager::Domain *_configDomain;
}; };
@ -120,10 +120,10 @@ public:
Keymap *getKeymap(const String& name, bool &global); Keymap *getKeymap(const String& name, bool &global);
/** /**
* Push a new keymap to the top of the active stack, activating * Push a new keymap to the top of the active stack, activating
* it for use. * it for use.
* @param name name of the keymap to push * @param name name of the keymap to push
* @param inherit if true keymapper will iterate down the * @param inherit if true keymapper will iterate down the
* stack if it cannot find a key in the new map * stack if it cannot find a key in the new map
* @return true if succesful * @return true if succesful
*/ */
@ -136,7 +136,7 @@ public:
/** /**
* @brief Map a key press event. * @brief Map a key press event.
* If the active keymap contains a Action mapped to the given key, then * If the active keymap contains a Action mapped to the given key, then
* the Action's events are pushed into the EventManager's event queue. * the Action's events are pushed into the EventManager's event queue.
* @param key key that was pressed * @param key key that was pressed
* @param keyDown true for key down, false for key up * @param keyDown true for key down, false for key up
@ -180,7 +180,7 @@ private:
HardwareKeySet *_hardwareKeys; HardwareKeySet *_hardwareKeys;
void pushKeymap(Keymap *newMap, bool inherit, bool global); void pushKeymap(Keymap *newMap, bool inherit, bool global);
Action *getAction(const KeyState& key); Action *getAction(const KeyState& key);
void executeAction(const Action *act, bool keyDown); void executeAction(const Action *act, bool keyDown);

View file

@ -146,7 +146,7 @@ void RemapDialog::reflowLayout() {
_colCount = (areaW - scrollbarWidth) / colWidth; _colCount = (areaW - scrollbarWidth) / colWidth;
_rowCount = (areaH + spacing) / (buttonHeight + spacing); _rowCount = (areaH + spacing) / (buttonHeight + spacing);
if (_colCount <= 0 || _rowCount <= 0) if (_colCount <= 0 || _rowCount <= 0)
error("Remap dialog too small to display any keymaps!"); error("Remap dialog too small to display any keymaps!");
_scrollBar->resize(areaX + areaW - scrollbarWidth, areaY, scrollbarWidth, areaH); _scrollBar->resize(areaX + areaW - scrollbarWidth, areaY, scrollbarWidth, areaH);
@ -164,9 +164,9 @@ void RemapDialog::reflowLayout() {
ActionWidgets widg; ActionWidgets widg;
if (i >= _keymapWidgets.size()) { if (i >= _keymapWidgets.size()) {
widg.actionText = widg.actionText =
new GUI::StaticTextWidget(this, 0, 0, 0, 0, "", Graphics::kTextAlignRight); new GUI::StaticTextWidget(this, 0, 0, 0, 0, "", Graphics::kTextAlignRight);
widg.keyButton = widg.keyButton =
new GUI::ButtonWidget(this, 0, 0, 0, 0, "", kRemapCmd + i); new GUI::ButtonWidget(this, 0, 0, 0, 0, "", kRemapCmd + i);
_keymapWidgets.push_back(widg); _keymapWidgets.push_back(widg);
} else { } else {
@ -208,7 +208,7 @@ void RemapDialog::handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 d
void RemapDialog::startRemapping(uint i) { void RemapDialog::startRemapping(uint i) {
if (_topAction + i >= _currentActions.size()) if (_topAction + i >= _currentActions.size())
return; return;
_remapTimeout = getMillis() + kRemapTimeoutDelay; _remapTimeout = getMillis() + kRemapTimeoutDelay;
_activeRemapAction = _currentActions[_topAction + i].action; _activeRemapAction = _currentActions[_topAction + i].action;
@ -287,7 +287,7 @@ void RemapDialog::loadKeymap() {
if (act->getMappedKey()) if (act->getMappedKey())
freeKeys.remove(act->getMappedKey()); freeKeys.remove(act->getMappedKey());
} }
// loop through remaining finding mappings for unmapped keys // loop through remaining finding mappings for unmapped keys
if (top.inherit) { if (top.inherit) {
for (int i = activeKeymaps.size() - 2; i >= 0; --i) { for (int i = activeKeymaps.size() - 2; i >= 0; --i) {
@ -365,7 +365,7 @@ void RemapDialog::refreshKeymap() {
widg.actionText->setVisible(true); widg.actionText->setVisible(true);
widg.keyButton->setVisible(true); widg.keyButton->setVisible(true);
actionI++; actionI++;
} else { } else {
widg.actionText->setVisible(false); widg.actionText->setVisible(false);
widg.keyButton->setVisible(false); widg.keyButton->setVisible(false);
@ -373,7 +373,7 @@ void RemapDialog::refreshKeymap() {
//widg.actionText->draw(); //widg.actionText->draw();
//widg.keyButton->draw(); //widg.keyButton->draw();
} }
// need to redraw entire Dialog so that invisible // need to redraw entire Dialog so that invisible
// widgets disappear // widgets disappear
draw(); draw();
} }

View file

@ -647,7 +647,7 @@ void displayMode8Bit() {
// ConsoleInit destroys the hardware palette :-( // ConsoleInit destroys the hardware palette :-(
OSystem_DS::instance()->restoreHardwarePalette(); OSystem_DS::instance()->restoreHardwarePalette();
// BG_PALETTE_SUB[255] = RGB15(31,31,31);//by default font will be rendered with color 255 // BG_PALETTE_SUB[255] = RGB15(31,31,31);//by default font will be rendered with color 255
// Do text stuff // Do text stuff
@ -893,7 +893,7 @@ void displayMode16Bit() {
BG3_XDX = isCpuScalerEnabled() ? 256 : (int) (1.25f * 256); BG3_XDX = isCpuScalerEnabled() ? 256 : (int) (1.25f * 256);
BG3_XDY = 0; BG3_XDY = 0;
BG3_YDX = 0; BG3_YDX = 0;
BG3_YDY = (int) ((200.0f / 192.0f) * 256); BG3_YDY = (int) ((200.0f / 192.0f) * 256);
#ifdef HEAVY_LOGGING #ifdef HEAVY_LOGGING
@ -1571,7 +1571,7 @@ void addEventsToQueue() {
} }
static int selectHoldCount = 0; static int selectHoldCount = 0;
static const int SELECT_HOLD_TIME = 60; static const int SELECT_HOLD_TIME = 60;
if ((getKeysHeld() & KEY_SELECT)) { if ((getKeysHeld() & KEY_SELECT)) {
@ -1585,8 +1585,8 @@ void addEventsToQueue() {
selectHoldCount = 0; selectHoldCount = 0;
} }
if (getKeysReleased() & KEY_SELECT) { if (getKeysReleased() & KEY_SELECT) {
if (selectHoldCount < SELECT_HOLD_TIME) { if (selectHoldCount < SELECT_HOLD_TIME) {
// Just pressed select - show DS options screen // Just pressed select - show DS options screen
@ -1838,7 +1838,7 @@ void soundBufferEmptyHandler() {
} }
currentTimeMillis++; currentTimeMillis++;
// TIMER0 end // TIMER0 end
soundHiPart = !soundHiPart; soundHiPart = !soundHiPart;
} }

View file

@ -335,7 +335,7 @@ void DSOptionsDialog::handleCommand(GUI::CommandSender *sender, uint32 cmd, uint
close(); close();
} }
if ((!guard) && (cmd == 0x40000000)) { if ((!guard) && (cmd == 0x40000000)) {
close(); close();
g_engine->openMainMenuDialog(); g_engine->openMainMenuDialog();

View file

@ -425,12 +425,12 @@ void OSystem_DS::grabOverlay(OverlayColor* buf, int pitch) {
for (int y = 0; y < 200; y++) { for (int y = 0; y < 200; y++) {
u16* src = start + (y * 320); u16* src = start + (y * 320);
u16* dest = ((u16 *) (buf)) + (y * pitch); u16* dest = ((u16 *) (buf)) + (y * pitch);
for (int x = 0; x < 320; x++) { for (int x = 0; x < 320; x++) {
*dest++ = *src++; *dest++ = *src++;
} }
} }
} }
void OSystem_DS::copyRectToOverlay(const OverlayColor *buf, int pitch, int x, int y, int w, int h) { void OSystem_DS::copyRectToOverlay(const OverlayColor *buf, int pitch, int x, int y, int w, int h) {

View file

@ -171,7 +171,7 @@ bool ZipFile::findFile(const char *search) {
char searchName[128]; char searchName[128];
strcpy(searchName, search); strcpy(searchName, search);
char *tmp = searchName; char *tmp = searchName;
// Change slashes to backslashes // Change slashes to backslashes
for (; *tmp; ++tmp) { for (; *tmp; ++tmp) {
if (*tmp == '/') if (*tmp == '/')

View file

@ -8,12 +8,12 @@
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2 * as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version. * of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful, * This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details. * GNU General Public License for more details.
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
@ -27,7 +27,7 @@
#include "blit_arm.h" #include "blit_arm.h"
void blitLandscapeScreenRect16bpp(uint16 *dst, uint16 *src, int width, int height, int screenWidth, int screenHeight) void blitLandscapeScreenRect16bpp(uint16 *dst, uint16 *src, int width, int height, int screenWidth, int screenHeight)
{ {
for (int x = width; x > 0; x--) { for (int x = width; x > 0; x--) {
for (int y = height; y > 0; y--) { for (int y = height; y > 0; y--) {
*(dst++) = *src; *(dst++) = *src;
@ -47,5 +47,5 @@ void blitLandscapeScreenRect8bpp(uint16 *dst, byte *src, int width, int height,
} }
dst -= screenHeight + height; dst -= screenHeight + height;
src += 1 - height * screenWidth; src += 1 - height * screenWidth;
} }
} }

View file

@ -66,7 +66,7 @@ void iPhone_updateScreenRect(unsigned short* screen, int x1, int y1, int x2, int
void iPhone_initSurface(int width, int height); void iPhone_initSurface(int width, int height);
bool iPhone_fetchEvent(int *outEvent, float *outX, float *outY); bool iPhone_fetchEvent(int *outEvent, float *outX, float *outY);
const char* iPhone_getDocumentsDir(); const char* iPhone_getDocumentsDir();
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View file

@ -47,7 +47,7 @@
int _fullHeight; int _fullHeight;
int _widthOffset; int _widthOffset;
int _heightOffset; int _heightOffset;
EAGLContext* _context; EAGLContext* _context;
GLuint _viewRenderbuffer; GLuint _viewRenderbuffer;
GLuint _viewFramebuffer; GLuint _viewFramebuffer;

View file

@ -88,7 +88,7 @@ int OSystem_IPHONE::timerHandler(int t) {
void OSystem_IPHONE::initBackend() { void OSystem_IPHONE::initBackend() {
#ifdef IPHONE_OFFICIAL #ifdef IPHONE_OFFICIAL
_savefile = new DefaultSaveFileManager(iPhone_getDocumentsDir()); _savefile = new DefaultSaveFileManager(iPhone_getDocumentsDir());
#else #else
_savefile = new DefaultSaveFileManager(SCUMMVM_SAVE_PATH); _savefile = new DefaultSaveFileManager(SCUMMVM_SAVE_PATH);
#endif #endif
@ -159,7 +159,7 @@ void OSystem_IPHONE::initSize(uint width, uint height) {
bzero(_fullscreen, fullSize); bzero(_fullscreen, fullSize);
iPhone_initSurface(width, height); iPhone_initSurface(width, height);
_fullScreenIsDirty = false; _fullScreenIsDirty = false;
dirtyFullScreen(); dirtyFullScreen();
_mouseVisible = false; _mouseVisible = false;
@ -300,9 +300,9 @@ void OSystem_IPHONE::internUpdateScreen() {
Common::Rect dirtyRect = _dirtyRects.remove_at(_dirtyRects.size() - 1); Common::Rect dirtyRect = _dirtyRects.remove_at(_dirtyRects.size() - 1);
//printf("Drawing: (%i, %i) -> (%i, %i)\n", dirtyRect.left, dirtyRect.top, dirtyRect.right, dirtyRect.bottom); //printf("Drawing: (%i, %i) -> (%i, %i)\n", dirtyRect.left, dirtyRect.top, dirtyRect.right, dirtyRect.bottom);
drawDirtyRect(dirtyRect); drawDirtyRect(dirtyRect);
if (_overlayVisible) if (_overlayVisible)
drawDirtyOverlayRect(dirtyRect); drawDirtyOverlayRect(dirtyRect);
@ -315,7 +315,7 @@ void OSystem_IPHONE::internUpdateScreen() {
Common::Rect dirtyRect = _dirtyOverlayRects.remove_at(_dirtyOverlayRects.size() - 1); Common::Rect dirtyRect = _dirtyOverlayRects.remove_at(_dirtyOverlayRects.size() - 1);
//printf("Drawing: (%i, %i) -> (%i, %i)\n", dirtyRect.left, dirtyRect.top, dirtyRect.right, dirtyRect.bottom); //printf("Drawing: (%i, %i) -> (%i, %i)\n", dirtyRect.left, dirtyRect.top, dirtyRect.right, dirtyRect.bottom);
drawDirtyOverlayRect(dirtyRect); drawDirtyOverlayRect(dirtyRect);
drawMouseCursorOnRectUpdate(dirtyRect, mouseRect); drawMouseCursorOnRectUpdate(dirtyRect, mouseRect);
updateHardwareSurfaceForRect(dirtyRect); updateHardwareSurfaceForRect(dirtyRect);
@ -332,7 +332,7 @@ void OSystem_IPHONE::drawDirtyRect(const Common::Rect& dirtyRect) {
for (int y = h; y > 0; y--) { for (int y = h; y > 0; y--) {
for (int x = w; x > 0; x--) for (int x = w; x > 0; x--)
*dst++ = _palette[*src++]; *dst++ = _palette[*src++];
dst += _screenWidth - w; dst += _screenWidth - w;
src += _screenWidth - w; src += _screenWidth - w;
} }
@ -392,7 +392,7 @@ void OSystem_IPHONE::drawMouseCursorOnRectUpdate(const Common::Rect& updatedRect
} }
void OSystem_IPHONE::updateHardwareSurfaceForRect(const Common::Rect& updatedRect) { void OSystem_IPHONE::updateHardwareSurfaceForRect(const Common::Rect& updatedRect) {
iPhone_updateScreenRect(_fullscreen, updatedRect.left, updatedRect.top, updatedRect.right, updatedRect.bottom ); iPhone_updateScreenRect(_fullscreen, updatedRect.left, updatedRect.top, updatedRect.right, updatedRect.bottom );
} }
Graphics::Surface *OSystem_IPHONE::lockScreen() { Graphics::Surface *OSystem_IPHONE::lockScreen() {
@ -610,7 +610,7 @@ bool OSystem_IPHONE::pollEvent(Common::Event &event) {
case kInputMouseDragged: case kInputMouseDragged:
if (!handleEvent_mouseDragged(event, x, y)) if (!handleEvent_mouseDragged(event, x, y))
return false; return false;
break; break;
case kInputMouseSecondDragged: case kInputMouseSecondDragged:
if (!handleEvent_mouseSecondDragged(event, x, y)) if (!handleEvent_mouseSecondDragged(event, x, y))
return false; return false;
@ -618,13 +618,13 @@ bool OSystem_IPHONE::pollEvent(Common::Event &event) {
case kInputMouseSecondDown: case kInputMouseSecondDown:
_secondaryTapped = true; _secondaryTapped = true;
if (!handleEvent_secondMouseDown(event, x, y)) if (!handleEvent_secondMouseDown(event, x, y))
return false; return false;
break; break;
case kInputMouseSecondUp: case kInputMouseSecondUp:
_secondaryTapped = false; _secondaryTapped = false;
if (!handleEvent_secondMouseUp(event, x, y)) if (!handleEvent_secondMouseUp(event, x, y))
return false; return false;
break; break;
case kInputOrientationChanged: case kInputOrientationChanged:
handleEvent_orientationChanged((int)xUnit); handleEvent_orientationChanged((int)xUnit);
return false; return false;
@ -781,30 +781,30 @@ bool OSystem_IPHONE::handleEvent_mouseDragged(Common::Event &event, int x, int y
int deltaY = _lastPadY - y; int deltaY = _lastPadY - y;
_lastPadX = x; _lastPadX = x;
_lastPadY = y; _lastPadY = y;
mouseNewPosX = (int)(_mouseX - deltaX / 0.5f); mouseNewPosX = (int)(_mouseX - deltaX / 0.5f);
mouseNewPosY = (int)(_mouseY - deltaY / 0.5f); mouseNewPosY = (int)(_mouseY - deltaY / 0.5f);
if (mouseNewPosX < 0) if (mouseNewPosX < 0)
mouseNewPosX = 0; mouseNewPosX = 0;
else if (mouseNewPosX > _screenWidth) else if (mouseNewPosX > _screenWidth)
mouseNewPosX = _screenWidth; mouseNewPosX = _screenWidth;
if (mouseNewPosY < 0) if (mouseNewPosY < 0)
mouseNewPosY = 0; mouseNewPosY = 0;
else if (mouseNewPosY > _screenHeight) else if (mouseNewPosY > _screenHeight)
mouseNewPosY = _screenHeight; mouseNewPosY = _screenHeight;
} else { } else {
mouseNewPosX = x; mouseNewPosX = x;
mouseNewPosY = y; mouseNewPosY = y;
} }
event.type = Common::EVENT_MOUSEMOVE; event.type = Common::EVENT_MOUSEMOVE;
event.mouse.x = mouseNewPosX; event.mouse.x = mouseNewPosX;
event.mouse.y = mouseNewPosY; event.mouse.y = mouseNewPosY;
warpMouse(mouseNewPosX, mouseNewPosY); warpMouse(mouseNewPosX, mouseNewPosY);
return true; return true;
} }
@ -812,27 +812,27 @@ bool OSystem_IPHONE::handleEvent_mouseSecondDragged(Common::Event &event, int x,
if (_gestureStartX == -1 || _gestureStartY == -1) { if (_gestureStartX == -1 || _gestureStartY == -1) {
return false; return false;
} }
int vecX = (x - _gestureStartX); int vecX = (x - _gestureStartX);
int vecY = (y - _gestureStartY); int vecY = (y - _gestureStartY);
int lengthSq = vecX * vecX + vecY * vecY; int lengthSq = vecX * vecX + vecY * vecY;
//printf("Lengthsq: %u\n", lengthSq); //printf("Lengthsq: %u\n", lengthSq);
if (lengthSq > 15000) { // Long enough gesture to react upon. if (lengthSq > 15000) { // Long enough gesture to react upon.
_gestureStartX = -1; _gestureStartX = -1;
_gestureStartY = -1; _gestureStartY = -1;
float vecLength = sqrt(lengthSq); float vecLength = sqrt(lengthSq);
float vecXNorm = vecX / vecLength; float vecXNorm = vecX / vecLength;
float vecYNorm = vecY / vecLength; float vecYNorm = vecY / vecLength;
//printf("Swipe vector: (%.2f, %.2f)\n", vecXNorm, vecYNorm); //printf("Swipe vector: (%.2f, %.2f)\n", vecXNorm, vecYNorm);
if (vecXNorm > -0.50 && vecXNorm < 0.50 && vecYNorm > 0.75) { if (vecXNorm > -0.50 && vecXNorm < 0.50 && vecYNorm > 0.75) {
// Swipe down // Swipe down
event.type = Common::EVENT_KEYDOWN; event.type = Common::EVENT_KEYDOWN;
_queuedInputEvent.type = Common::EVENT_KEYUP; _queuedInputEvent.type = Common::EVENT_KEYUP;
event.kbd.flags = _queuedInputEvent.kbd.flags = 0; event.kbd.flags = _queuedInputEvent.kbd.flags = 0;
event.kbd.keycode = _queuedInputEvent.kbd.keycode = Common::KEYCODE_F5; event.kbd.keycode = _queuedInputEvent.kbd.keycode = Common::KEYCODE_F5;
event.kbd.ascii = _queuedInputEvent.kbd.ascii = Common::ASCII_F5; event.kbd.ascii = _queuedInputEvent.kbd.ascii = Common::ASCII_F5;
@ -849,7 +849,7 @@ bool OSystem_IPHONE::handleEvent_mouseSecondDragged(Common::Event &event, int x,
GUI::TimedMessageDialog dialog(dialogMsg, 1500); GUI::TimedMessageDialog dialog(dialogMsg, 1500);
dialog.runModal(); dialog.runModal();
return false; return false;
} else if (vecXNorm > 0.75 && vecYNorm > -0.5 && vecYNorm < 0.5) { } else if (vecXNorm > 0.75 && vecYNorm > -0.5 && vecYNorm < 0.5) {
// Swipe right // Swipe right
_touchpadModeEnabled = !_touchpadModeEnabled; _touchpadModeEnabled = !_touchpadModeEnabled;
@ -861,12 +861,12 @@ bool OSystem_IPHONE::handleEvent_mouseSecondDragged(Common::Event &event, int x,
GUI::TimedMessageDialog dialog(dialogMsg, 1500); GUI::TimedMessageDialog dialog(dialogMsg, 1500);
dialog.runModal(); dialog.runModal();
return false; return false;
} else if (vecXNorm < -0.75 && vecYNorm > -0.5 && vecYNorm < 0.5) { } else if (vecXNorm < -0.75 && vecYNorm > -0.5 && vecYNorm < 0.5) {
// Swipe left // Swipe left
return false; return false;
} }
} }
return false; return false;
} }
@ -893,7 +893,7 @@ void OSystem_IPHONE::handleEvent_orientationChanged(int orientation) {
if (_screenOrientation != newOrientation) { if (_screenOrientation != newOrientation) {
_screenOrientation = newOrientation; _screenOrientation = newOrientation;
iPhone_initSurface(_screenWidth, _screenHeight); iPhone_initSurface(_screenWidth, _screenHeight);
dirtyFullScreen(); dirtyFullScreen();
if (_overlayVisible) if (_overlayVisible)
dirtyFullOverlayScreen(); dirtyFullOverlayScreen();
@ -1231,7 +1231,7 @@ Common::SeekableReadStream *OSystem_IPHONE::createConfigReadStream() {
strncat(buf, "/Preferences", 256 - strlen(buf) ); strncat(buf, "/Preferences", 256 - strlen(buf) );
Common::FSNode file(buf); Common::FSNode file(buf);
#else #else
Common::FSNode file(SCUMMVM_PREFS_PATH); Common::FSNode file(SCUMMVM_PREFS_PATH);
#endif #endif
return file.createReadStream(); return file.createReadStream();
} }
@ -1241,10 +1241,10 @@ Common::WriteStream *OSystem_IPHONE::createConfigWriteStream() {
char buf[256]; char buf[256];
strncpy(buf, iPhone_getDocumentsDir(), 256); strncpy(buf, iPhone_getDocumentsDir(), 256);
strncat(buf, "/Preferences", 256 - strlen(buf) ); strncat(buf, "/Preferences", 256 - strlen(buf) );
Common::FSNode file(buf); Common::FSNode file(buf);
#else #else
Common::FSNode file(SCUMMVM_PREFS_PATH); Common::FSNode file(SCUMMVM_PREFS_PATH);
#endif #endif
return file.createWriteStream(); return file.createWriteStream();
} }
@ -1288,7 +1288,7 @@ void iphone_main(int argc, char *argv[]) {
chdir("/var/mobile/"); chdir("/var/mobile/");
#endif #endif
g_system = OSystem_IPHONE_create(); g_system = OSystem_IPHONE_create();
assert(g_system); assert(g_system);

View file

@ -104,7 +104,7 @@ protected:
TimerProc _timerCallback; TimerProc _timerCallback;
Common::Array<Common::Rect> _dirtyRects; Common::Array<Common::Rect> _dirtyRects;
Common::Array<Common::Rect> _dirtyOverlayRects; Common::Array<Common::Rect> _dirtyOverlayRects;
ScreenOrientation _screenOrientation; ScreenOrientation _screenOrientation;
bool _fullScreenIsDirty; bool _fullScreenIsDirty;
bool _fullScreenOverlayIsDirty; bool _fullScreenOverlayIsDirty;
@ -168,7 +168,7 @@ public:
virtual void quit(); virtual void quit();
FilesystemFactory *getFilesystemFactory() { return _fsFactory; } FilesystemFactory *getFilesystemFactory() { return _fsFactory; }
virtual void addSysArchivesToSearchSet(Common::SearchSet &s, int priority = 0); virtual void addSysArchivesToSearchSet(Common::SearchSet &s, int priority = 0);
virtual void getTimeAndDate(struct tm &t) const; virtual void getTimeAndDate(struct tm &t) const;
virtual void setWindowCaption(const char *caption); virtual void setWindowCaption(const char *caption);
@ -186,13 +186,13 @@ public:
protected: protected:
void internUpdateScreen(); void internUpdateScreen();
void dirtyFullScreen(); void dirtyFullScreen();
void dirtyFullOverlayScreen(); void dirtyFullOverlayScreen();
void clipRectToScreen(int16 &x, int16 &y, int16 &w, int16 &h); void clipRectToScreen(int16 &x, int16 &y, int16 &w, int16 &h);
void suspendLoop(); void suspendLoop();
void drawDirtyRect(const Common::Rect& dirtyRect); void drawDirtyRect(const Common::Rect& dirtyRect);
void drawDirtyOverlayRect(const Common::Rect& dirtyRect); void drawDirtyOverlayRect(const Common::Rect& dirtyRect);
void drawMouseCursorOnRectUpdate(const Common::Rect& updatedRect, const Common::Rect& mouseRect); void drawMouseCursorOnRectUpdate(const Common::Rect& updatedRect, const Common::Rect& mouseRect);
void updateHardwareSurfaceForRect(const Common::Rect& updatedRect); void updateHardwareSurfaceForRect(const Common::Rect& updatedRect);
static void AQBufferCallback(void *in, AudioQueueRef inQ, AudioQueueBufferRef outQB); static void AQBufferCallback(void *in, AudioQueueRef inQ, AudioQueueBufferRef outQB);
static int timerHandler(int t); static int timerHandler(int t);
@ -207,5 +207,5 @@ protected:
bool handleEvent_secondMouseUp(Common::Event &event, int x, int y); bool handleEvent_secondMouseUp(Common::Event &event, int x, int y);
bool handleEvent_mouseDragged(Common::Event &event, int x, int y); bool handleEvent_mouseDragged(Common::Event &event, int x, int y);
bool handleEvent_mouseSecondDragged(Common::Event &event, int x, int y); bool handleEvent_mouseSecondDragged(Common::Event &event, int x, int y);
}; };

View file

@ -162,7 +162,7 @@ Gs2dScreen::Gs2dScreen(uint16 width, uint16 height, TVMode tvMode) {
// _tvMode = TV_NTSC; // _tvMode = TV_NTSC;
printf("Setting up %s mode\n", (_tvMode == TV_PAL) ? "PAL" : "NTSC"); printf("Setting up %s mode\n", (_tvMode == TV_PAL) ? "PAL" : "NTSC");
// set screen size, 640x512 for pal, 640x448 for ntsc // set screen size, 640x512 for pal, 640x448 for ntsc
_tvWidth = 640; _tvWidth = 640;
_tvHeight = ((_tvMode == TV_PAL) ? 512 /*544*/ : 448); _tvHeight = ((_tvMode == TV_PAL) ? 512 /*544*/ : 448);
@ -188,7 +188,7 @@ Gs2dScreen::Gs2dScreen(uint16 width, uint16 height, TVMode tvMode) {
_clutPtrs[TEXT] = _clutPtrs[SCREEN] + 0x2000; _clutPtrs[TEXT] = _clutPtrs[SCREEN] + 0x2000;
_texPtrs[SCREEN] = _clutPtrs[SCREEN] + 0x3000; _texPtrs[SCREEN] = _clutPtrs[SCREEN] + 0x3000;
_texPtrs[TEXT] = 0; // these buffers are stored in the alpha gaps of the frame buffers _texPtrs[TEXT] = 0; // these buffers are stored in the alpha gaps of the frame buffers
_texPtrs[MOUSE] = 128 * 256 * 4; _texPtrs[MOUSE] = 128 * 256 * 4;
_texPtrs[PRINTF] = _texPtrs[MOUSE] + M_SIZE * M_SIZE * 4; _texPtrs[PRINTF] = _texPtrs[MOUSE] + M_SIZE * M_SIZE * 4;
_showOverlay = false; _showOverlay = false;
@ -249,7 +249,7 @@ Gs2dScreen::Gs2dScreen(uint16 width, uint16 height, TVMode tvMode) {
updateScreen(); updateScreen();
createAnimTextures(); createAnimTextures();
// create anim thread // create anim thread
ee_thread_t animThread, thisThread; ee_thread_t animThread, thisThread;
ReferThreadStatus(GetThreadId(), &thisThread); ReferThreadStatus(GetThreadId(), &thisThread);
@ -683,7 +683,7 @@ void Gs2dScreen::animThread(void) {
do { do {
WaitSema(g_AnimSema); WaitSema(g_AnimSema);
} while ((!_systemQuit) && (!g_RunAnim)); } while ((!_systemQuit) && (!g_RunAnim));
if (_systemQuit) if (_systemQuit)
break; break;
@ -808,7 +808,7 @@ const uint32 Gs2dScreen::_binaryClut[16] __attribute__((aligned(64))) = {
GS_RGBA( 0, 0, 0, 0x20), // scrPrintf: semitransparent GS_RGBA( 0, 0, 0, 0x20), // scrPrintf: semitransparent
GS_RGBA(0xC0, 0xC0, 0xC0, 0), // scrPrintf: red GS_RGBA(0xC0, 0xC0, 0xC0, 0), // scrPrintf: red
GS_RGBA(0x16, 0x16, 0xF0, 0), // scrPrintf: blue GS_RGBA(0x16, 0x16, 0xF0, 0), // scrPrintf: blue
GS_RGBA(0xFF, 0xFF, 0xFF, 0x80), GS_RGBA(0xFF, 0xFF, 0xFF, 0x80), // unused GS_RGBA(0xFF, 0xFF, 0xFF, 0x80), GS_RGBA(0xFF, 0xFF, 0xFF, 0x80), // unused
GS_RGBA(0xFF, 0xFF, 0xFF, 0x80), GS_RGBA(0xFF, 0xFF, 0xFF, 0x80), GS_RGBA(0xFF, 0xFF, 0xFF, 0x80), GS_RGBA(0xFF, 0xFF, 0xFF, 0x80),
GS_RGBA(0xFF, 0xFF, 0xFF, 0x80), GS_RGBA(0xFF, 0xFF, 0xFF, 0x80), GS_RGBA(0xFF, 0xFF, 0xFF, 0x80), GS_RGBA(0xFF, 0xFF, 0xFF, 0x80),

View file

@ -77,7 +77,7 @@ public:
void showOverlay(void); void showOverlay(void);
void hideOverlay(void); void hideOverlay(void);
Graphics::PixelFormat getOverlayFormat(void); Graphics::PixelFormat getOverlayFormat(void);
int16 getOverlayWidth(void); int16 getOverlayWidth(void);
int16 getOverlayHeight(void); int16 getOverlayHeight(void);
//- mouse routines //- mouse routines

View file

@ -267,7 +267,7 @@ void Ps2File::cacheReadSync(void) {
} }
} }
uint32 Ps2File::read(void *dest, uint32 len) { uint32 Ps2File::read(void *dest, uint32 len) {
// uint32 r=0, d=0, ds=0, sz=0; // uint32 r=0, d=0, ds=0, sz=0;
#ifdef __PS2_FILE_SEMA__ #ifdef __PS2_FILE_SEMA__
WaitSema(_sema); WaitSema(_sema);

View file

@ -56,7 +56,7 @@ public:
virtual bool getErr(void); virtual bool getErr(void);
virtual void setErr(bool); virtual void setErr(bool);
private: private:
void cacheReadAhead(void); void cacheReadAhead(void);
void cacheReadSync(void); void cacheReadSync(void);

View file

@ -23,7 +23,7 @@
class PS2Icon { class PS2Icon {
public: public:
PS2Icon() {}; PS2Icon() {};
~PS2Icon() {}; ~PS2Icon() {};
uint16 decompressData(uint16 **data); uint16 decompressData(uint16 **data);

View file

@ -41,7 +41,7 @@ static const char netArg[] = "192.168.0.10" "\0" "255.255.255.0" "\0" "192.168.0
IrxFile irxFiles[] = { IrxFile irxFiles[] = {
{ "SIO2MAN", BIOS, NOTHING, NULL, 0 }, { "SIO2MAN", BIOS, NOTHING, NULL, 0 },
{ "MCMAN", BIOS, NOTHING, NULL, 0 }, { "MCMAN", BIOS, NOTHING, NULL, 0 },
{ "MCSERV", BIOS, NOTHING, NULL, 0 }, { "MCSERV", BIOS, NOTHING, NULL, 0 },
{ "PADMAN", BIOS, NOTHING, NULL, 0 }, { "PADMAN", BIOS, NOTHING, NULL, 0 },
{ "LIBSD", BIOS, NOTHING, NULL, 0 }, { "LIBSD", BIOS, NOTHING, NULL, 0 },
@ -73,7 +73,7 @@ PS2Device detectBootPath(const char *elfPath, char *bootPath) {
PS2Device device = _getDev(elfPath); PS2Device device = _getDev(elfPath);
printf("elf path: %s, device %d\n", elfPath, device); printf("elf path: %s, device %d\n", elfPath, device);
strcpy(bootPath, elfPath); strcpy(bootPath, elfPath);
char *pathPos = bootPath; char *pathPos = bootPath;
@ -115,7 +115,7 @@ PS2Device detectBootPath(const char *elfPath, char *bootPath) {
return device; return device;
} }
int loadIrxModules(int device, const char *irxPath, IrxReference **modules) { int loadIrxModules(int device, const char *irxPath, IrxReference **modules) {
IrxReference *resModules = (IrxReference *)malloc(numIrxFiles * sizeof(IrxReference)); IrxReference *resModules = (IrxReference *)malloc(numIrxFiles * sizeof(IrxReference));
IrxReference *curModule = resModules; IrxReference *curModule = resModules;

View file

@ -209,7 +209,7 @@ void OSystem_PS2::startIrxModules(int numModules, IrxReference *modules) {
} }
} else } else
sioprintf("Module \"%s\" wasn't found: %d\n", modules[i].path, modules[i].errorCode); sioprintf("Module \"%s\" wasn't found: %d\n", modules[i].path, modules[i].errorCode);
if ((modules[i].errorCode < 0) || (res < 0) || (rv < 0)) { if ((modules[i].errorCode < 0) || (res < 0) || (rv < 0)) {
if (!(modules[i].fileRef->flags & OPTIONAL)) { if (!(modules[i].fileRef->flags & OPTIONAL)) {
if (modules[i].errorCode < 0) if (modules[i].errorCode < 0)
@ -220,7 +220,7 @@ void OSystem_PS2::startIrxModules(int numModules, IrxReference *modules) {
quit(); quit();
} }
} }
if (modules[i].buffer) if (modules[i].buffer)
free(modules[i].buffer); free(modules[i].buffer);
} else { } else {
@ -723,7 +723,7 @@ void OSystem_PS2::msgPrintf(int millis, char *format, ...) {
while ((*lnEnd) && (*lnEnd != '\n')) while ((*lnEnd) && (*lnEnd != '\n'))
lnEnd++; lnEnd++;
*lnEnd = '\0'; *lnEnd = '\0';
Common::String str(lnSta); Common::String str(lnSta);
int width = Graphics::g_sysfont.getStringWidth(str); int width = Graphics::g_sysfont.getStringWidth(str);
if (width > maxWidth) if (width > maxWidth)
@ -821,17 +821,17 @@ void OSystem_PS2::quit(void) {
// ("", 0, NULL); // ("", 0, NULL);
/* back to PS2 Browser */ /* back to PS2 Browser */
/* /*
__asm__ __volatile__( __asm__ __volatile__(
" li $3, 0x04;" " li $3, 0x04;"
" syscall;" " syscall;"
" nop;" " nop;"
); );
*/ */
/* /*
SifIopReset("rom0:UNDL ", 0); SifIopReset("rom0:UNDL ", 0);
while (!SifIopSync()) ; while (!SifIopSync()) ;
// SifIopReboot(...); // SifIopReboot(...);
*/ */
#else #else
@ -959,7 +959,7 @@ void OSystem_PS2::makeConfigPath() {
sprintf(path, "mc0:ScummVM/ScummVM.ini"); sprintf(path, "mc0:ScummVM/ScummVM.ini");
else else
ps2_fclose(src); ps2_fclose(src);
_configFile = strdup(path); _configFile = strdup(path);
} }
@ -967,7 +967,7 @@ Common::SeekableReadStream *OSystem_PS2::createConfigReadStream() {
Common::FSNode file(_configFile); Common::FSNode file(_configFile);
return file.createReadStream(); return file.createReadStream();
} }
Common::WriteStream *OSystem_PS2::createConfigWriteStream() { Common::WriteStream *OSystem_PS2::createConfigWriteStream() {
Common::FSNode file(_configFile); Common::FSNode file(_configFile);
return file.createWriteStream(); return file.createWriteStream();

View file

@ -84,7 +84,7 @@ public:
virtual void copyRectToOverlay(const OverlayColor *buf, int pitch, int x, int y, int w, int h); virtual void copyRectToOverlay(const OverlayColor *buf, int pitch, int x, int y, int w, int h);
virtual int16 getOverlayWidth(void); virtual int16 getOverlayWidth(void);
virtual int16 getOverlayHeight(void); virtual int16 getOverlayHeight(void);
virtual bool showMouse(bool visible); virtual bool showMouse(bool visible);
virtual void warpMouse(int x, int y); virtual void warpMouse(int x, int y);

View file

@ -164,7 +164,7 @@ void SymbianActions::initInstanceGame() {
// Pause // Pause
if(is_cruise) { if(is_cruise) {
_key_action[ACTION_PAUSE].setKey('P'); _key_action[ACTION_PAUSE].setKey('P');
} }
else { else {
_key_action[ACTION_PAUSE].setKey(' '); _key_action[ACTION_PAUSE].setKey(' ');
} }

View file

@ -1737,8 +1737,8 @@ void OSystem_WINCE3::internUpdateScreen() {
toolbarScaler = Normal2x; toolbarScaler = Normal2x;
else if (_videoMode.scaleFactor == 3) else if (_videoMode.scaleFactor == 3)
toolbarScaler = Normal3x; toolbarScaler = Normal3x;
toolbarScaler((byte *)toolbarSurface->pixels, srcPitch, toolbarScaler((byte *)toolbarSurface->pixels, srcPitch,
(byte *)_hwscreen->pixels + (_toolbarHandler.getOffset() * _scaleFactorYm / _scaleFactorYd * dstPitch), (byte *)_hwscreen->pixels + (_toolbarHandler.getOffset() * _scaleFactorYm / _scaleFactorYd * dstPitch),
dstPitch, toolbar_rect[0].w, toolbar_rect[0].h); dstPitch, toolbar_rect[0].w, toolbar_rect[0].h);
SDL_UnlockSurface(toolbarSurface); SDL_UnlockSurface(toolbarSurface);
SDL_UnlockSurface(_hwscreen); SDL_UnlockSurface(_hwscreen);

View file

@ -41,7 +41,7 @@ class ImageMap {
public: public:
~ImageMap(); ~ImageMap();
Polygon *createArea(const String& id); Polygon *createArea(const String& id);
void removeArea(const String& id); void removeArea(const String& id);
void removeAllAreas(); void removeAllAreas();

View file

@ -62,31 +62,31 @@ static void blit(Graphics::Surface *surf_dst, Graphics::Surface *surf_src, int16
int dstAdd = surf_dst->w - blitW; int dstAdd = surf_dst->w - blitW;
int srcAdd = surf_src->w - blitW; int srcAdd = surf_src->w - blitW;
for (int i = 0; i < blitH; ++i) { for (int i = 0; i < blitH; ++i) {
for (int j = 0; j < blitW; ++j, ++dst, ++src) { for (int j = 0; j < blitW; ++j, ++dst, ++src) {
OverlayColor col = *src; OverlayColor col = *src;
if (col != transparent) if (col != transparent)
*dst = col; *dst = col;
} }
dst += dstAdd; dst += dstAdd;
src += srcAdd; src += srcAdd;
} }
} }
VirtualKeyboardGUI::VirtualKeyboardGUI(VirtualKeyboard *kbd) VirtualKeyboardGUI::VirtualKeyboardGUI(VirtualKeyboard *kbd)
: _kbd(kbd), _displaying(false), _drag(false), : _kbd(kbd), _displaying(false), _drag(false),
_drawCaret(false), _displayEnabled(false), _firstRun(true), _drawCaret(false), _displayEnabled(false), _firstRun(true),
_cursorAnimateTimer(0), _cursorAnimateCounter(0) { _cursorAnimateTimer(0), _cursorAnimateCounter(0) {
assert(_kbd); assert(_kbd);
assert(g_system); assert(g_system);
_system = g_system; _system = g_system;
_lastScreenChanged = _system->getScreenChangeID(); _lastScreenChanged = _system->getScreenChangeID();
_screenW = _system->getOverlayWidth(); _screenW = _system->getOverlayWidth();
_screenH = _system->getOverlayHeight(); _screenH = _system->getOverlayHeight();
memset(_cursor, 0xFF, sizeof(_cursor)); memset(_cursor, 0xFF, sizeof(_cursor));
} }
@ -138,7 +138,7 @@ bool VirtualKeyboardGUI::fontIsSuitable(const Graphics::Font *font, const Rect&
void VirtualKeyboardGUI::checkScreenChanged() { void VirtualKeyboardGUI::checkScreenChanged() {
if (_lastScreenChanged != _system->getScreenChangeID()) if (_lastScreenChanged != _system->getScreenChangeID())
screenChanged(); screenChanged();
} }
void VirtualKeyboardGUI::initSize(int16 w, int16 h) { void VirtualKeyboardGUI::initSize(int16 w, int16 h) {
@ -297,7 +297,7 @@ void VirtualKeyboardGUI::mainLoop() {
break; break;
case Common::EVENT_MOUSEMOVE: case Common::EVENT_MOUSEMOVE:
if (_drag) if (_drag)
move(event.mouse.x - _dragPoint.x, move(event.mouse.x - _dragPoint.x,
event.mouse.y - _dragPoint.y); event.mouse.y - _dragPoint.y);
break; break;
case Common::EVENT_SCREEN_CHANGED: case Common::EVENT_SCREEN_CHANGED:
@ -349,7 +349,7 @@ void VirtualKeyboardGUI::redraw() {
int16 w = _dirtyRect.width(); int16 w = _dirtyRect.width();
int16 h = _dirtyRect.height(); int16 h = _dirtyRect.height();
if (w <= 0 || h <= 0) return; if (w <= 0 || h <= 0) return;
Graphics::Surface surf; Graphics::Surface surf;
surf.create(w, h, sizeof(OverlayColor)); surf.create(w, h, sizeof(OverlayColor));
@ -362,17 +362,17 @@ void VirtualKeyboardGUI::redraw() {
src += _overlayBackup.w; src += _overlayBackup.w;
} }
blit(&surf, _kbdSurface, _kbdBound.left - _dirtyRect.left, blit(&surf, _kbdSurface, _kbdBound.left - _dirtyRect.left,
_kbdBound.top - _dirtyRect.top, _kbdTransparentColor); _kbdBound.top - _dirtyRect.top, _kbdTransparentColor);
if (_displayEnabled) { if (_displayEnabled) {
blit(&surf, &_dispSurface, _dispX - _dirtyRect.left, blit(&surf, &_dispSurface, _dispX - _dirtyRect.left,
_dispY - _dirtyRect.top, _dispBackColor); _dispY - _dirtyRect.top, _dispBackColor);
} }
_system->copyRectToOverlay((OverlayColor*)surf.pixels, surf.w, _system->copyRectToOverlay((OverlayColor*)surf.pixels, surf.w,
_dirtyRect.left, _dirtyRect.top, surf.w, surf.h); _dirtyRect.left, _dirtyRect.top, surf.w, surf.h);
surf.free(); surf.free();
resetDirtyRect(); resetDirtyRect();
} }
@ -390,7 +390,7 @@ void VirtualKeyboardGUI::animateCaret() {
if (_system->getMillis() % kCaretBlinkTime < kCaretBlinkTime / 2) { if (_system->getMillis() % kCaretBlinkTime < kCaretBlinkTime / 2) {
if (!_drawCaret) { if (!_drawCaret) {
_drawCaret = true; _drawCaret = true;
_dispSurface.drawLine(_caretX, 0, _caretX, _dispSurface.h, _dispForeColor); _dispSurface.drawLine(_caretX, 0, _caretX, _dispSurface.h, _dispForeColor);
extendDirtyRect(Rect(_dispX + _caretX, _dispY, _dispX + _caretX + 1, _dispY + _dispSurface.h)); extendDirtyRect(Rect(_dispX + _caretX, _dispY, _dispX + _caretX + 1, _dispY + _dispSurface.h));
} }
@ -412,17 +412,17 @@ void VirtualKeyboardGUI::updateDisplay() {
uint dispTextEnd; uint dispTextEnd;
if (_dispI > cursorPos) if (_dispI > cursorPos)
_dispI = cursorPos; _dispI = cursorPos;
dispTextEnd = calculateEndIndex(wholeText, _dispI); dispTextEnd = calculateEndIndex(wholeText, _dispI);
while (cursorPos > dispTextEnd) while (cursorPos > dispTextEnd)
dispTextEnd = calculateEndIndex(wholeText, ++_dispI); dispTextEnd = calculateEndIndex(wholeText, ++_dispI);
String dispText = String(wholeText.c_str() + _dispI, wholeText.c_str() + dispTextEnd); String dispText = String(wholeText.c_str() + _dispI, wholeText.c_str() + dispTextEnd);
// draw to display surface // draw to display surface
_dispSurface.fillRect(Rect(_dispSurface.w, _dispSurface.h), _dispBackColor); _dispSurface.fillRect(Rect(_dispSurface.w, _dispSurface.h), _dispBackColor);
_dispFont->drawString(&_dispSurface, dispText, 0, 0, _dispSurface.w, _dispForeColor); _dispFont->drawString(&_dispSurface, dispText, 0, 0, _dispSurface.w, _dispForeColor);
String beforeCaret(wholeText.c_str() + _dispI, wholeText.c_str() + cursorPos); String beforeCaret(wholeText.c_str() + _dispI, wholeText.c_str() + cursorPos);
_caretX = _dispFont->getStringWidth(beforeCaret); _caretX = _dispFont->getStringWidth(beforeCaret);
if (_drawCaret) _dispSurface.drawLine(_caretX, 0, _caretX, _dispSurface.h, _dispForeColor); if (_drawCaret) _dispSurface.drawLine(_caretX, 0, _caretX, _dispSurface.h, _dispForeColor);

View file

@ -62,9 +62,9 @@ public:
/** /**
* Interrupts the event loop and resets the overlay to its initial state. * Interrupts the event loop and resets the overlay to its initial state.
*/ */
void close(); void close();
bool isDisplaying() { return _displaying; } bool isDisplaying() { return _displaying; }
/** /**
@ -73,7 +73,7 @@ public:
void reset(); void reset();
/** /**
* Activates drag mode. Takes the keyboard-relative coordinates of the * Activates drag mode. Takes the keyboard-relative coordinates of the
* cursor as an argument. * cursor as an argument.
*/ */
void startDrag(int16 x, int16 y); void startDrag(int16 x, int16 y);
@ -82,16 +82,16 @@ public:
* Deactivates drag mode * Deactivates drag mode
* */ * */
void endDrag(); void endDrag();
/** /**
* Checks for a screen change in the backend and re-inits the virtual * Checks for a screen change in the backend and re-inits the virtual
* keyboard if it has. * keyboard if it has.
*/ */
void checkScreenChanged(); void checkScreenChanged();
/** /**
* Sets the GUI's internal screen size variables * Sets the GUI's internal screen size variables
*/ */
void initSize(int16 w, int16 h); void initSize(int16 w, int16 h);
private: private:

View file

@ -38,7 +38,7 @@
namespace Common { namespace Common {
VirtualKeyboardParser::VirtualKeyboardParser(VirtualKeyboard *kbd) VirtualKeyboardParser::VirtualKeyboardParser(VirtualKeyboard *kbd)
: XMLParser(), _keyboard(kbd) { : XMLParser(), _keyboard(kbd) {
} }
@ -59,7 +59,7 @@ bool VirtualKeyboardParser::closedKeyCallback(ParserNode *node) {
return parserError("Initial mode of keyboard pack not defined"); return parserError("Initial mode of keyboard pack not defined");
} else if (node->name.equalsIgnoreCase("mode")) { } else if (node->name.equalsIgnoreCase("mode")) {
if (!_layoutParsed) { if (!_layoutParsed) {
return parserError("'%s' layout missing from '%s' mode", return parserError("'%s' layout missing from '%s' mode",
_mode->resolution.c_str(), _mode->name.c_str()); _mode->resolution.c_str(), _mode->name.c_str());
} }
} }
@ -119,7 +119,7 @@ bool VirtualKeyboardParser::parserCallback_mode(ParserNode *node) {
String resolutions = node->values["resolutions"]; String resolutions = node->values["resolutions"];
StringTokenizer tok (resolutions, " ,"); StringTokenizer tok (resolutions, " ,");
// select best resolution simply by minimising the difference between the // select best resolution simply by minimising the difference between the
// overlay size and the resolution dimensions. // overlay size and the resolution dimensions.
// TODO: improve this by giving preference to a resolution that is smaller // TODO: improve this by giving preference to a resolution that is smaller
// than the overlay res (so the keyboard can't be too big for the screen) // than the overlay res (so the keyboard can't be too big for the screen)
@ -200,7 +200,7 @@ bool VirtualKeyboardParser::parserCallback_event(ParserNode *node) {
delete evt; delete evt;
return parserError("Key modifier element must contain modifier attributes"); return parserError("Key modifier element must contain modifier attributes");
} }
evt->type = VirtualKeyboard::kVKEventModifier; evt->type = VirtualKeyboard::kVKEventModifier;
byte *flags = (byte*) malloc(sizeof(byte)); byte *flags = (byte*) malloc(sizeof(byte));
*(flags) = parseFlags(node->values["modifiers"]); *(flags) = parseFlags(node->values["modifiers"]);

View file

@ -38,13 +38,13 @@
** Virtual Keyboard Pack File Format ** ** Virtual Keyboard Pack File Format **
*************************************** ***************************************
The new virtual keyboard for ScummVM is implemented in the same way as a HTML The new virtual keyboard for ScummVM is implemented in the same way as a HTML
ImageMap. It uses a single bitmap of the entire keyboard layout and then a ImageMap. It uses a single bitmap of the entire keyboard layout and then a
image map description allows certain areas of the bitmap to be given special image map description allows certain areas of the bitmap to be given special
actions. Most of these actions will be a virtual key press event, but there actions. Most of these actions will be a virtual key press event, but there
will also be special keys that will change the keyboard layout or close the will also be special keys that will change the keyboard layout or close the
keyboard. The HTML image map description is contained in a larger XML file that keyboard. The HTML image map description is contained in a larger XML file that
can describe all the different modes of the keyboard, and also different can describe all the different modes of the keyboard, and also different
keyboard layouts for different screen resolutions. keyboard layouts for different screen resolutions.
******************************************** ********************************************
@ -92,7 +92,7 @@ keyboard layouts for different screen resolutions.
<keyboard> <keyboard>
This is the required, root element of the file format. This is the required, root element of the file format.
required attributes: required attributes:
- initial_mode: name of the mode the keyboard will show initially - initial_mode: name of the mode the keyboard will show initially
@ -108,12 +108,12 @@ child tags:
<mode> <mode>
This tag encapsulates a single mode of the keyboard. Within are a number of This tag encapsulates a single mode of the keyboard. Within are a number of
layouts, which provide the specific implementation at different resolutions. layouts, which provide the specific implementation at different resolutions.
required attributes: required attributes:
- name: the name of the mode - name: the name of the mode
- resolutions: list of the different layout resolutions - resolutions: list of the different layout resolutions
child tags: child tags:
- layout - layout
@ -129,12 +129,12 @@ same as an event's name.
required attributes: required attributes:
- name: name of the event - name: name of the event
- type: key | modifier | switch_mode | submit | cancel | clear | delete | - type: key | modifier | switch_mode | submit | cancel | clear | delete |
move_left | move_right - see VirtualKeyboard::EventType for explanation move_left | move_right - see VirtualKeyboard::EventType for explanation
for key events for key events
- code / ascii: describe a key press in ScummVM KeyState format - code / ascii: describe a key press in ScummVM KeyState format
for key and modifier events for key and modifier events
- modifiers: modifier keystate as comma-separated list of shift, ctrl and/or - modifiers: modifier keystate as comma-separated list of shift, ctrl and/or
alt. alt.
for switch_mode events for switch_mode events
- mode: name of the mode that should be switched to - mode: name of the mode that should be switched to
@ -148,8 +148,8 @@ required attributes:
- resolution: the screen resolution that this layout is designed for - resolution: the screen resolution that this layout is designed for
- bitmap: filename of the 24-bit bitmap that will be used for this layout - bitmap: filename of the 24-bit bitmap that will be used for this layout
optional attributes: optional attributes:
- transparent_color: color in r,g,b format that will be used for keycolor - transparent_color: color in r,g,b format that will be used for keycolor
transparency (defaults to (255,0,255). transparency (defaults to (255,0,255).
- display_font_color: color in r,g,b format that will be used for the text of - display_font_color: color in r,g,b format that will be used for the text of
the keyboard display (defaults to (0,0,0). the keyboard display (defaults to (0,0,0).
@ -161,13 +161,13 @@ child nodes:
<map> <map>
These tags describe the image map for a particular layout. It uses the same These tags describe the image map for a particular layout. It uses the same
format as HTML image maps. The only area shapes that are supported are format as HTML image maps. The only area shapes that are supported are
rectangles and polygons. The target attribute of each area should be the name rectangles and polygons. The target attribute of each area should be the name
of an event for this mode (see <event> tag). They will usually be generated by of an event for this mode (see <event> tag). They will usually be generated by
an external tool such as GIMP's Image Map plugin, and so will not be written an external tool such as GIMP's Image Map plugin, and so will not be written
by hand, but for more information on HTML image map format see by hand, but for more information on HTML image map format see
- http://www.w3schools.com/TAGS/tag_map.asp - http://www.w3schools.com/TAGS/tag_map.asp
- http://www.w3schools.com/TAGS/tag_area.asp - http://www.w3schools.com/TAGS/tag_area.asp
*/ */
@ -177,21 +177,21 @@ namespace Common {
/** /**
* Subclass of Common::XMLParser that parses the virtual keyboard pack * Subclass of Common::XMLParser that parses the virtual keyboard pack
* description file * description file
*/ */
class VirtualKeyboardParser : public XMLParser { class VirtualKeyboardParser : public XMLParser {
public: public:
/** /**
* Enum dictating how extensive a parse will be * Enum dictating how extensive a parse will be
*/ */
enum ParseMode { enum ParseMode {
/** /**
* Full parse - when loading keyboard pack for first time * Full parse - when loading keyboard pack for first time
*/ */
kParseFull, kParseFull,
/** /**
* Just check resolutions and reload layouts if needed - following a * Just check resolutions and reload layouts if needed - following a
* change in screen size * change in screen size
*/ */
kParseCheckResolutions kParseCheckResolutions

View file

@ -97,7 +97,7 @@ bool VirtualKeyboard::loadKeyboardPack(String packName) {
// uncompressed keyboard pack // uncompressed keyboard pack
if (!_parser->loadFile(vkDir.getChild(packName + ".xml"))) if (!_parser->loadFile(vkDir.getChild(packName + ".xml")))
return false; return false;
} else if (vkDir.getChild(packName + ".zip").exists()) { } else if (vkDir.getChild(packName + ".zip").exists()) {
// compressed keyboard pack // compressed keyboard pack
#ifdef USE_ZLIB #ifdef USE_ZLIB
@ -239,7 +239,7 @@ void VirtualKeyboard::close(bool submit) {
_kbdGUI->close(); _kbdGUI->close();
} }
bool VirtualKeyboard::isDisplaying() { bool VirtualKeyboard::isDisplaying() {
return _kbdGUI->isDisplaying(); return _kbdGUI->isDisplaying();
} }
@ -359,7 +359,7 @@ void VirtualKeyboard::KeyPressQueue::clear() {
_strChanged = true; _strChanged = true;
} }
bool VirtualKeyboard::KeyPressQueue::empty() { bool VirtualKeyboard::KeyPressQueue::empty() {
return _keys.empty(); return _keys.empty();
} }

View file

@ -54,7 +54,7 @@ class VirtualKeyboardParser;
* This includes storage of the virtual key press events when the user clicks * This includes storage of the virtual key press events when the user clicks
* a key and delivery of them when the keyboard is closed, as well as managing * a key and delivery of them when the keyboard is closed, as well as managing
* the internal state of the keyboard, such as its active mode. * the internal state of the keyboard, such as its active mode.
*/ */
class VirtualKeyboard { class VirtualKeyboard {
protected: protected:
@ -73,7 +73,7 @@ protected:
kVKEventSubmit, kVKEventSubmit,
/** Close the keyboard, without submitting keypresses */ /** Close the keyboard, without submitting keypresses */
kVKEventCancel, kVKEventCancel,
/** Clear the virtual keypress queue */ /** Clear the virtual keypress queue */
kVKEventClear, kVKEventClear,
/** Move the keypress queue insert position backwards */ /** Move the keypress queue insert position backwards */
kVKEventMoveLeft, kVKEventMoveLeft,
@ -87,23 +87,23 @@ protected:
struct VKEvent { struct VKEvent {
String name; String name;
VKEventType type; VKEventType type;
/** /**
* Void pointer that will point to different types of data depending * Void pointer that will point to different types of data depending
* on the type of the event, these are: * on the type of the event, these are:
* - KeyState struct for kVKEventKey events * - KeyState struct for kVKEventKey events
* - a flags byte for kVKEventModifier events * - a flags byte for kVKEventModifier events
* - c-string stating the name of the new mode for kSwitchMode events * - c-string stating the name of the new mode for kSwitchMode events
*/ */
void *data; void *data;
VKEvent() : data(0) {} VKEvent() : data(0) {}
~VKEvent() { ~VKEvent() {
if (data) if (data)
free(data); free(data);
} }
}; };
typedef HashMap<String, VKEvent*> VKEventMap; typedef HashMap<String, VKEvent*> VKEventMap;
/** /**
* Mode struct encapsulates all the data for each mode of the keyboard * Mode struct encapsulates all the data for each mode of the keyboard
@ -122,7 +122,7 @@ protected:
Mode() : image(0) {} Mode() : image(0) {}
~Mode() { delete image; } ~Mode() { delete image; }
}; };
typedef HashMap<String, Mode, IgnoreCase_Hash, IgnoreCase_EqualTo> ModeMap; typedef HashMap<String, Mode, IgnoreCase_Hash, IgnoreCase_EqualTo> ModeMap;
enum HorizontalAlignment { enum HorizontalAlignment {
@ -143,7 +143,7 @@ protected:
uint strLen; uint strLen;
}; };
/** /**
* Class that stores the queue of virtual key presses, as well as * Class that stores the queue of virtual key presses, as well as
* maintaining a string that represents a preview of the queue * maintaining a string that represents a preview of the queue
*/ */
@ -182,11 +182,11 @@ public:
VirtualKeyboard(); VirtualKeyboard();
virtual ~VirtualKeyboard(); virtual ~VirtualKeyboard();
/** /**
* Loads the keyboard pack with the given name. * Loads the keyboard pack with the given name.
* The system first looks for an uncompressed keyboard pack by searching * The system first looks for an uncompressed keyboard pack by searching
* for packName.xml in the filesystem, if this does not exist then it * for packName.xml in the filesystem, if this does not exist then it
* searches for a compressed keyboard pack by looking for packName.zip. * searches for a compressed keyboard pack by looking for packName.zip.
* @param packName name of the keyboard pack * @param packName name of the keyboard pack
*/ */
@ -201,7 +201,7 @@ public:
/** /**
* Hides the keyboard, ending the event loop. * Hides the keyboard, ending the event loop.
* @param submit if true all accumulated key presses are submitted to * @param submit if true all accumulated key presses are submitted to
* the event manager * the event manager
*/ */
void close(bool submit); void close(bool submit);
@ -218,7 +218,7 @@ public:
return _loaded; return _loaded;
} }
protected: protected:
OSystem *_system; OSystem *_system;
Archive *_fileArchive; Archive *_fileArchive;
@ -227,7 +227,7 @@ protected:
VirtualKeyboardGUI *_kbdGUI; VirtualKeyboardGUI *_kbdGUI;
KeyPressQueue _keyQueue; KeyPressQueue _keyQueue;
friend class VirtualKeyboardParser; friend class VirtualKeyboardParser;
VirtualKeyboardParser *_parser; VirtualKeyboardParser *_parser;

View file

@ -221,7 +221,7 @@ static Common::Error runGame(const EnginePlugin *plugin, OSystem &system, const
} }
static void setupGraphics(OSystem &system) { static void setupGraphics(OSystem &system) {
system.beginGFXTransaction(); system.beginGFXTransaction();
// Set the user specified graphics mode (if any). // Set the user specified graphics mode (if any).
system.setGraphicsMode(ConfMan.get("gfx_mode").c_str()); system.setGraphicsMode(ConfMan.get("gfx_mode").c_str());
@ -265,13 +265,13 @@ static void setupKeymapper(OSystem &system) {
// Now create the global keymap // Now create the global keymap
act = new Action(globalMap, "MENU", "Menu", kGenericActionType, kSelectKeyType); act = new Action(globalMap, "MENU", "Menu", kGenericActionType, kSelectKeyType);
act->addKeyEvent(KeyState(KEYCODE_F5, ASCII_F5, 0)); act->addKeyEvent(KeyState(KEYCODE_F5, ASCII_F5, 0));
act = new Action(globalMap, "SKCT", "Skip", kGenericActionType, kActionKeyType); act = new Action(globalMap, "SKCT", "Skip", kGenericActionType, kActionKeyType);
act->addKeyEvent(KeyState(KEYCODE_ESCAPE, ASCII_ESCAPE, 0)); act->addKeyEvent(KeyState(KEYCODE_ESCAPE, ASCII_ESCAPE, 0));
act = new Action(globalMap, "PAUS", "Pause", kGenericActionType, kStartKeyType); act = new Action(globalMap, "PAUS", "Pause", kGenericActionType, kStartKeyType);
act->addKeyEvent(KeyState(KEYCODE_SPACE, ' ', 0)); act->addKeyEvent(KeyState(KEYCODE_SPACE, ' ', 0));
act = new Action(globalMap, "SKLI", "Skip line", kGenericActionType, kActionKeyType); act = new Action(globalMap, "SKLI", "Skip line", kGenericActionType, kActionKeyType);
act->addKeyEvent(KeyState(KEYCODE_PERIOD, '.', 0)); act->addKeyEvent(KeyState(KEYCODE_PERIOD, '.', 0));
@ -344,7 +344,7 @@ extern "C" int scummvm_main(int argc, const char * const argv[]) {
setupGraphics(system); setupGraphics(system);
// Init the event manager. As the virtual keyboard is loaded here, it must // Init the event manager. As the virtual keyboard is loaded here, it must
// take place after the backend is initiated and the screen has been setup // take place after the backend is initiated and the screen has been setup
system.getEventManager()->init(); system.getEventManager()->init();
@ -395,7 +395,7 @@ extern "C" int scummvm_main(int argc, const char * const argv[]) {
// screen to draw on yet. // screen to draw on yet.
warning("Could not find any engine capable of running the selected game"); warning("Could not find any engine capable of running the selected game");
} }
// reset the graphics to default // reset the graphics to default
setupGraphics(system); setupGraphics(system);
launcherDialog(); launcherDialog();

View file

@ -159,7 +159,7 @@ namespace ListInternal {
bool operator==(const Iterator<T>& a, const ConstIterator<T>& b) { bool operator==(const Iterator<T>& a, const ConstIterator<T>& b) {
return a._node == b._node; return a._node == b._node;
} }
template<typename T> template<typename T>
bool operator!=(const Iterator<T>& a, const ConstIterator<T>& b) { bool operator!=(const Iterator<T>& a, const ConstIterator<T>& b) {
return a._node != b._node; return a._node != b._node;

View file

@ -89,7 +89,7 @@ private:
public: public:
Stack<T>() {} Stack<T>() {}
Stack<T>(const Array<T> &stackContent) : _stack(stackContent) {} Stack<T>(const Array<T> &stackContent) : _stack(stackContent) {}
bool empty() const { bool empty() const {
return _stack.empty(); return _stack.empty();
} }

View file

@ -347,7 +347,7 @@ int AgiEngine::playGame() {
} }
interpretCycle(); interpretCycle();
// Check if the user has asked to load a game from the command line // Check if the user has asked to load a game from the command line
// or the launcher // or the launcher
if (firstLoop) { if (firstLoop) {

View file

@ -195,7 +195,7 @@ static const AGIGameDescription gameDescriptions[] = {
// Black Cauldron (PC 5.25") 2.10 11/10/88 [AGI 3.002.098] // Black Cauldron (PC 5.25") 2.10 11/10/88 [AGI 3.002.098]
GAME3("bc", "2.10 1988-11-10 5.25\"", "bcdir", "0c5a9acbcc7e51127c34818e75806df6", 0x3149, GID_BC), GAME3("bc", "2.10 1988-11-10 5.25\"", "bcdir", "0c5a9acbcc7e51127c34818e75806df6", 0x3149, GID_BC),
// Black Cauldron (PC) 2.10 [AGI 3.002.097] // Black Cauldron (PC) 2.10 [AGI 3.002.097]
GAME3("bc", "2.10", "bcdir", "0de3953c9225009dc91e5b0d1692967b", 0x3149, GID_BC), GAME3("bc", "2.10", "bcdir", "0de3953c9225009dc91e5b0d1692967b", 0x3149, GID_BC),
@ -524,7 +524,7 @@ static const AGIGameDescription gameDescriptions[] = {
// Troll's Tale // Troll's Tale
GAMEpre_PS("troll", "", "troll.img", "62903f264b3d849be4214b3a5c42a2fa", 184320, 0x0000, GID_TROLL, Common::kPlatformPC), GAMEpre_PS("troll", "", "troll.img", "62903f264b3d849be4214b3a5c42a2fa", 184320, 0x0000, GID_TROLL, Common::kPlatformPC),
// Winnie the Pooh in the Hundred Acre Wood // Winnie the Pooh in the Hundred Acre Wood
GAMEpre_P("winnie", "", "title.pic", "2e7900c1ccaa7671d65405f6d1efed30", 0x0000, GID_WINNIE, Common::kPlatformPC), GAMEpre_P("winnie", "", "title.pic", "2e7900c1ccaa7671d65405f6d1efed30", 0x0000, GID_WINNIE, Common::kPlatformPC),

View file

@ -115,7 +115,7 @@ bool Mickey::chooseY_N(int ofsPrompt, bool fErrorMsg) {
break; break;
} }
} }
return false; return false;
} }
@ -509,7 +509,7 @@ bool Mickey::getMenuSelRow(MSA_MENU menu, int *sel0, int *sel1, int iRow) {
animate(); animate();
drawMenu(menu, *sel0, *sel1); drawMenu(menu, *sel0, *sel1);
} }
return false; return false;
} }
@ -535,7 +535,7 @@ void Mickey::getMenuSel(char *buffer, int *sel0, int *sel1) {
} }
} }
} }
if (_clickToMove || getMenuSelRow(menu, sel0, sel1, 2)) { if (_clickToMove || getMenuSelRow(menu, sel0, sel1, 2)) {
break; break;
} }
@ -1358,11 +1358,11 @@ void Mickey::intro() {
// show copyright and play theme // show copyright and play theme
printExeMsg(IDO_MSA_COPYRIGHT); printExeMsg(IDO_MSA_COPYRIGHT);
// Quit if necessary // Quit if necessary
if (_vm->shouldQuit()) if (_vm->shouldQuit())
return; return;
playSound(IDI_MSA_SND_THEME); playSound(IDI_MSA_SND_THEME);
// load game // load game
@ -1375,7 +1375,7 @@ void Mickey::intro() {
return; return;
} }
} }
// Quit if necessary // Quit if necessary
if (_vm->shouldQuit()) if (_vm->shouldQuit())
return; return;
@ -1386,7 +1386,7 @@ void Mickey::intro() {
drawRoom(); drawRoom();
printRoomDesc(); printRoomDesc();
// Quit if necessary // Quit if necessary
if (_vm->shouldQuit()) if (_vm->shouldQuit())
return; return;
@ -2104,7 +2104,7 @@ void Mickey::waitAnyKey(bool anim) {
break; break;
} }
} }
if (anim) { if (anim) {
animate(); animate();
_vm->_gfx->doUpdate(); _vm->_gfx->doUpdate();

View file

@ -565,7 +565,7 @@ void Troll::gameLoop() {
memset(_roomStates, 0, sizeof(_roomStates)); memset(_roomStates, 0, sizeof(_roomStates));
memset(_inventory, 0, sizeof(_inventory)); memset(_inventory, 0, sizeof(_inventory));
while (!done && !_vm->shouldQuit()) { while (!done && !_vm->shouldQuit()) {
*menu = 0; *menu = 0;

View file

@ -446,7 +446,7 @@ int Winnie::parser(int pc, int index, uint8 *buffer) {
_vm->_gfx->doUpdate(); _vm->_gfx->doUpdate();
_vm->_system->updateScreen(); _vm->_system->updateScreen();
} }
return IDI_WTP_PAR_OK; return IDI_WTP_PAR_OK;
} }
@ -1016,7 +1016,7 @@ phase2:
if (parser(hdr.ofsDesc[iBlock] - _roomOffset, iBlock, roomdata) == IDI_WTP_PAR_BACK) if (parser(hdr.ofsDesc[iBlock] - _roomOffset, iBlock, roomdata) == IDI_WTP_PAR_BACK)
goto phase1; goto phase1;
} }
while (!_vm->shouldQuit()) { while (!_vm->shouldQuit()) {
for (iBlock = 0; iBlock < IDI_WTP_MAX_BLOCK; iBlock++) { for (iBlock = 0; iBlock < IDI_WTP_MAX_BLOCK; iBlock++) {
switch(parser(hdr.ofsBlock[iBlock] - _roomOffset, iBlock, roomdata)) { switch(parser(hdr.ofsBlock[iBlock] - _roomOffset, iBlock, roomdata)) {

View file

@ -46,11 +46,11 @@ AgiSound *AgiSound::createFromRawResource(uint8 *data, uint32 len, int resnum, S
uint16 type = READ_LE_UINT16(data); uint16 type = READ_LE_UINT16(data);
switch (type) { // Create a sound object based on the type switch (type) { // Create a sound object based on the type
case AGI_SOUND_SAMPLE: case AGI_SOUND_SAMPLE:
return new IIgsSample(data, len, resnum, manager); return new IIgsSample(data, len, resnum, manager);
case AGI_SOUND_MIDI: case AGI_SOUND_MIDI:
return new IIgsMidi (data, len, resnum, manager); return new IIgsMidi (data, len, resnum, manager);
case AGI_SOUND_4CHN: case AGI_SOUND_4CHN:
return new PCjrSound (data, len, resnum, manager); return new PCjrSound (data, len, resnum, manager);
} }

View file

@ -272,9 +272,9 @@ char *AgiEngine::wordWrapString(const char *s, int *len) {
if (wLen) { if (wLen) {
memcpy(outStr, pWord, wLen); memcpy(outStr, pWord, wLen);
outStr += wLen; outStr += wLen;
} }
lnLen += wLen+1; lnLen += wLen+1;
if (lnLen > msgWidth) { if (lnLen > msgWidth) {
msgWidth = lnLen; msgWidth = lnLen;

View file

@ -1770,104 +1770,104 @@ static const byte english_elvira1Font[] = {
}; };
static const byte english_pnFont[] = { static const byte english_pnFont[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x10, 0x10, 0x10, 0x10, 0x00, 0x10, 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0x00, 0x10, 0x00,
0x00, 0x24, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x24, 0x7E, 0x24, 0x24, 0x7E, 0x24, 0x00, 0x00, 0x24, 0x7E, 0x24, 0x24, 0x7E, 0x24, 0x00,
0x00, 0x08, 0x3E, 0x28, 0x3E, 0x0A, 0x3E, 0x08, 0x00, 0x08, 0x3E, 0x28, 0x3E, 0x0A, 0x3E, 0x08,
0x00, 0x62, 0x64, 0x08, 0x10, 0x26, 0x46, 0x00, 0x00, 0x62, 0x64, 0x08, 0x10, 0x26, 0x46, 0x00,
0x00, 0x10, 0x28, 0x10, 0x2A, 0x44, 0x3A, 0x00, 0x00, 0x10, 0x28, 0x10, 0x2A, 0x44, 0x3A, 0x00,
0x00, 0x08, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x04, 0x08, 0x08, 0x08, 0x08, 0x04, 0x00, 0x00, 0x04, 0x08, 0x08, 0x08, 0x08, 0x04, 0x00,
0x00, 0x20, 0x10, 0x10, 0x10, 0x10, 0x20, 0x00, 0x00, 0x20, 0x10, 0x10, 0x10, 0x10, 0x20, 0x00,
0x00, 0x00, 0x14, 0x08, 0x3E, 0x08, 0x14, 0x00, 0x00, 0x00, 0x14, 0x08, 0x3E, 0x08, 0x14, 0x00,
0x00, 0x00, 0x08, 0x08, 0x3E, 0x08, 0x08, 0x00, 0x00, 0x00, 0x08, 0x08, 0x3E, 0x08, 0x08, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x10,
0x00, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x18, 0x00,
0x00, 0x00, 0x02, 0x04, 0x08, 0x10, 0x20, 0x00, 0x00, 0x00, 0x02, 0x04, 0x08, 0x10, 0x20, 0x00,
0x00, 0x3C, 0x46, 0x4A, 0x52, 0x62, 0x3C, 0x00, 0x00, 0x3C, 0x46, 0x4A, 0x52, 0x62, 0x3C, 0x00,
0x00, 0x18, 0x28, 0x08, 0x08, 0x08, 0x3E, 0x00, 0x00, 0x18, 0x28, 0x08, 0x08, 0x08, 0x3E, 0x00,
0x00, 0x3C, 0x42, 0x02, 0x3C, 0x40, 0x7E, 0x00, 0x00, 0x3C, 0x42, 0x02, 0x3C, 0x40, 0x7E, 0x00,
0x00, 0x3C, 0x42, 0x0C, 0x02, 0x42, 0x3C, 0x00, 0x00, 0x3C, 0x42, 0x0C, 0x02, 0x42, 0x3C, 0x00,
0x00, 0x08, 0x18, 0x28, 0x48, 0x7E, 0x08, 0x00, 0x00, 0x08, 0x18, 0x28, 0x48, 0x7E, 0x08, 0x00,
0x00, 0x7E, 0x40, 0x7C, 0x02, 0x42, 0x3C, 0x00, 0x00, 0x7E, 0x40, 0x7C, 0x02, 0x42, 0x3C, 0x00,
0x00, 0x3C, 0x40, 0x7C, 0x42, 0x42, 0x3C, 0x00, 0x00, 0x3C, 0x40, 0x7C, 0x42, 0x42, 0x3C, 0x00,
0x00, 0x7E, 0x02, 0x04, 0x08, 0x10, 0x10, 0x00, 0x00, 0x7E, 0x02, 0x04, 0x08, 0x10, 0x10, 0x00,
0x00, 0x3C, 0x42, 0x3C, 0x42, 0x42, 0x3C, 0x00, 0x00, 0x3C, 0x42, 0x3C, 0x42, 0x42, 0x3C, 0x00,
0x00, 0x3C, 0x42, 0x42, 0x3E, 0x02, 0x3C, 0x00, 0x00, 0x3C, 0x42, 0x42, 0x3E, 0x02, 0x3C, 0x00,
0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x10, 0x00,
0x00, 0x00, 0x10, 0x00, 0x00, 0x10, 0x10, 0x20, 0x00, 0x00, 0x10, 0x00, 0x00, 0x10, 0x10, 0x20,
0x00, 0x00, 0x04, 0x08, 0x10, 0x08, 0x04, 0x00, 0x00, 0x00, 0x04, 0x08, 0x10, 0x08, 0x04, 0x00,
0x00, 0x00, 0x00, 0x3E, 0x00, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3E, 0x00, 0x3E, 0x00, 0x00,
0x00, 0x00, 0x10, 0x08, 0x04, 0x08, 0x10, 0x00, 0x00, 0x00, 0x10, 0x08, 0x04, 0x08, 0x10, 0x00,
0x00, 0x3C, 0x42, 0x04, 0x08, 0x00, 0x08, 0x00, 0x00, 0x3C, 0x42, 0x04, 0x08, 0x00, 0x08, 0x00,
0x00, 0x3C, 0x4A, 0x56, 0x5E, 0x40, 0x3C, 0x00, 0x00, 0x3C, 0x4A, 0x56, 0x5E, 0x40, 0x3C, 0x00,
0x00, 0x3C, 0x42, 0x42, 0x7E, 0x42, 0x42, 0x00, 0x00, 0x3C, 0x42, 0x42, 0x7E, 0x42, 0x42, 0x00,
0x00, 0x7C, 0x42, 0x7C, 0x42, 0x42, 0x7C, 0x00, 0x00, 0x7C, 0x42, 0x7C, 0x42, 0x42, 0x7C, 0x00,
0x00, 0x3C, 0x42, 0x40, 0x40, 0x42, 0x3C, 0x00, 0x00, 0x3C, 0x42, 0x40, 0x40, 0x42, 0x3C, 0x00,
0x00, 0x78, 0x44, 0x42, 0x42, 0x44, 0x78, 0x00, 0x00, 0x78, 0x44, 0x42, 0x42, 0x44, 0x78, 0x00,
0x00, 0x7E, 0x40, 0x7C, 0x40, 0x40, 0x7E, 0x00, 0x00, 0x7E, 0x40, 0x7C, 0x40, 0x40, 0x7E, 0x00,
0x00, 0x7E, 0x40, 0x7C, 0x40, 0x40, 0x40, 0x00, 0x00, 0x7E, 0x40, 0x7C, 0x40, 0x40, 0x40, 0x00,
0x00, 0x3C, 0x42, 0x40, 0x4E, 0x42, 0x3C, 0x00, 0x00, 0x3C, 0x42, 0x40, 0x4E, 0x42, 0x3C, 0x00,
0x00, 0x42, 0x42, 0x7E, 0x42, 0x42, 0x42, 0x00, 0x00, 0x42, 0x42, 0x7E, 0x42, 0x42, 0x42, 0x00,
0x00, 0x3E, 0x08, 0x08, 0x08, 0x08, 0x3E, 0x00, 0x00, 0x3E, 0x08, 0x08, 0x08, 0x08, 0x3E, 0x00,
0x00, 0x02, 0x02, 0x02, 0x42, 0x42, 0x3C, 0x00, 0x00, 0x02, 0x02, 0x02, 0x42, 0x42, 0x3C, 0x00,
0x00, 0x44, 0x48, 0x70, 0x48, 0x44, 0x42, 0x00, 0x00, 0x44, 0x48, 0x70, 0x48, 0x44, 0x42, 0x00,
0x00, 0x40, 0x40, 0x40, 0x40, 0x40, 0x7E, 0x00, 0x00, 0x40, 0x40, 0x40, 0x40, 0x40, 0x7E, 0x00,
0x00, 0x42, 0x66, 0x5A, 0x42, 0x42, 0x42, 0x00, 0x00, 0x42, 0x66, 0x5A, 0x42, 0x42, 0x42, 0x00,
0x00, 0x42, 0x62, 0x52, 0x4A, 0x46, 0x42, 0x00, 0x00, 0x42, 0x62, 0x52, 0x4A, 0x46, 0x42, 0x00,
0x00, 0x3C, 0x42, 0x42, 0x42, 0x42, 0x3C, 0x00, 0x00, 0x3C, 0x42, 0x42, 0x42, 0x42, 0x3C, 0x00,
0x00, 0x7C, 0x42, 0x42, 0x7C, 0x40, 0x40, 0x00, 0x00, 0x7C, 0x42, 0x42, 0x7C, 0x40, 0x40, 0x00,
0x00, 0x3C, 0x42, 0x42, 0x52, 0x4A, 0x3C, 0x00, 0x00, 0x3C, 0x42, 0x42, 0x52, 0x4A, 0x3C, 0x00,
0x00, 0x7C, 0x42, 0x42, 0x7C, 0x44, 0x42, 0x00, 0x00, 0x7C, 0x42, 0x42, 0x7C, 0x44, 0x42, 0x00,
0x00, 0x3C, 0x40, 0x3C, 0x02, 0x42, 0x3C, 0x00, 0x00, 0x3C, 0x40, 0x3C, 0x02, 0x42, 0x3C, 0x00,
0x00, 0xFE, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00, 0x00, 0xFE, 0x10, 0x10, 0x10, 0x10, 0x10, 0x00,
0x00, 0x42, 0x42, 0x42, 0x42, 0x42, 0x3C, 0x00, 0x00, 0x42, 0x42, 0x42, 0x42, 0x42, 0x3C, 0x00,
0x00, 0x42, 0x42, 0x42, 0x42, 0x24, 0x18, 0x00, 0x00, 0x42, 0x42, 0x42, 0x42, 0x24, 0x18, 0x00,
0x00, 0x42, 0x42, 0x42, 0x42, 0x5A, 0x24, 0x00, 0x00, 0x42, 0x42, 0x42, 0x42, 0x5A, 0x24, 0x00,
0x00, 0x42, 0x24, 0x18, 0x18, 0x24, 0x42, 0x00, 0x00, 0x42, 0x24, 0x18, 0x18, 0x24, 0x42, 0x00,
0x00, 0x82, 0x44, 0x28, 0x10, 0x10, 0x10, 0x00, 0x00, 0x82, 0x44, 0x28, 0x10, 0x10, 0x10, 0x00,
0x00, 0x7E, 0x04, 0x08, 0x10, 0x20, 0x7E, 0x00, 0x00, 0x7E, 0x04, 0x08, 0x10, 0x20, 0x7E, 0x00,
0x00, 0x0E, 0x08, 0x08, 0x08, 0x08, 0x0E, 0x00, 0x00, 0x0E, 0x08, 0x08, 0x08, 0x08, 0x0E, 0x00,
0x00, 0x00, 0x40, 0x20, 0x10, 0x08, 0x04, 0x00, 0x00, 0x00, 0x40, 0x20, 0x10, 0x08, 0x04, 0x00,
0x00, 0x70, 0x10, 0x10, 0x10, 0x10, 0x70, 0x00, 0x00, 0x70, 0x10, 0x10, 0x10, 0x10, 0x70, 0x00,
0x00, 0x10, 0x38, 0x54, 0x10, 0x10, 0x10, 0x00, 0x00, 0x10, 0x38, 0x54, 0x10, 0x10, 0x10, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF,
0x00, 0x1C, 0x22, 0x78, 0x20, 0x20, 0x7E, 0x00, 0x00, 0x1C, 0x22, 0x78, 0x20, 0x20, 0x7E, 0x00,
0x00, 0x00, 0x38, 0x04, 0x3C, 0x44, 0x3C, 0x00, 0x00, 0x00, 0x38, 0x04, 0x3C, 0x44, 0x3C, 0x00,
0x00, 0x20, 0x20, 0x3C, 0x22, 0x22, 0x3C, 0x00, 0x00, 0x20, 0x20, 0x3C, 0x22, 0x22, 0x3C, 0x00,
0x00, 0x00, 0x1C, 0x20, 0x20, 0x20, 0x1C, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x20, 0x20, 0x1C, 0x00,
0x00, 0x04, 0x04, 0x3C, 0x44, 0x44, 0x3C, 0x00, 0x00, 0x04, 0x04, 0x3C, 0x44, 0x44, 0x3C, 0x00,
0x00, 0x00, 0x38, 0x44, 0x78, 0x40, 0x3C, 0x00, 0x00, 0x00, 0x38, 0x44, 0x78, 0x40, 0x3C, 0x00,
0x00, 0x0C, 0x10, 0x18, 0x10, 0x10, 0x10, 0x00, 0x00, 0x0C, 0x10, 0x18, 0x10, 0x10, 0x10, 0x00,
0x00, 0x00, 0x3C, 0x44, 0x44, 0x3C, 0x04, 0x38, 0x00, 0x00, 0x3C, 0x44, 0x44, 0x3C, 0x04, 0x38,
0x00, 0x40, 0x40, 0x78, 0x44, 0x44, 0x44, 0x00, 0x00, 0x40, 0x40, 0x78, 0x44, 0x44, 0x44, 0x00,
0x00, 0x10, 0x00, 0x30, 0x10, 0x10, 0x38, 0x00, 0x00, 0x10, 0x00, 0x30, 0x10, 0x10, 0x38, 0x00,
0x00, 0x04, 0x00, 0x04, 0x04, 0x04, 0x24, 0x18, 0x00, 0x04, 0x00, 0x04, 0x04, 0x04, 0x24, 0x18,
0x00, 0x20, 0x28, 0x30, 0x30, 0x28, 0x24, 0x00, 0x00, 0x20, 0x28, 0x30, 0x30, 0x28, 0x24, 0x00,
0x00, 0x10, 0x10, 0x10, 0x10, 0x10, 0x0C, 0x00, 0x00, 0x10, 0x10, 0x10, 0x10, 0x10, 0x0C, 0x00,
0x00, 0x00, 0x68, 0x54, 0x54, 0x54, 0x54, 0x00, 0x00, 0x00, 0x68, 0x54, 0x54, 0x54, 0x54, 0x00,
0x00, 0x00, 0x78, 0x44, 0x44, 0x44, 0x44, 0x00, 0x00, 0x00, 0x78, 0x44, 0x44, 0x44, 0x44, 0x00,
0x00, 0x00, 0x38, 0x44, 0x44, 0x44, 0x38, 0x00, 0x00, 0x00, 0x38, 0x44, 0x44, 0x44, 0x38, 0x00,
0x00, 0x00, 0x78, 0x44, 0x44, 0x78, 0x40, 0x40, 0x00, 0x00, 0x78, 0x44, 0x44, 0x78, 0x40, 0x40,
0x00, 0x00, 0x3C, 0x44, 0x44, 0x3C, 0x04, 0x06, 0x00, 0x00, 0x3C, 0x44, 0x44, 0x3C, 0x04, 0x06,
0x00, 0x00, 0x1C, 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, 0x1C, 0x20, 0x20, 0x20, 0x20, 0x00,
0x00, 0x00, 0x38, 0x40, 0x38, 0x04, 0x78, 0x00, 0x00, 0x00, 0x38, 0x40, 0x38, 0x04, 0x78, 0x00,
0x00, 0x10, 0x38, 0x10, 0x10, 0x10, 0x0C, 0x00, 0x00, 0x10, 0x38, 0x10, 0x10, 0x10, 0x0C, 0x00,
0x00, 0x00, 0x44, 0x44, 0x44, 0x44, 0x38, 0x00, 0x00, 0x00, 0x44, 0x44, 0x44, 0x44, 0x38, 0x00,
0x00, 0x00, 0x44, 0x44, 0x28, 0x28, 0x10, 0x00, 0x00, 0x00, 0x44, 0x44, 0x28, 0x28, 0x10, 0x00,
0x00, 0x00, 0x44, 0x54, 0x54, 0x54, 0x28, 0x00, 0x00, 0x00, 0x44, 0x54, 0x54, 0x54, 0x28, 0x00,
0x00, 0x00, 0x44, 0x28, 0x10, 0x28, 0x44, 0x00, 0x00, 0x00, 0x44, 0x28, 0x10, 0x28, 0x44, 0x00,
0x00, 0x00, 0x44, 0x44, 0x44, 0x3C, 0x04, 0x38, 0x00, 0x00, 0x44, 0x44, 0x44, 0x3C, 0x04, 0x38,
0x00, 0x00, 0x7C, 0x08, 0x10, 0x20, 0x7C, 0x00, 0x00, 0x00, 0x7C, 0x08, 0x10, 0x20, 0x7C, 0x00,
0x00, 0x0E, 0x08, 0x30, 0x08, 0x08, 0x0E, 0x00, 0x00, 0x0E, 0x08, 0x30, 0x08, 0x08, 0x0E, 0x00,
0x00, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00,
0x00, 0x70, 0x10, 0x0C, 0x10, 0x10, 0x70, 0x00, 0x00, 0x70, 0x10, 0x0C, 0x10, 0x10, 0x70, 0x00,
0x00, 0x14, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x14, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00,
0x3C, 0x42, 0x99, 0xA1, 0xA1, 0x99, 0x42, 0x3C, 0x3C, 0x42, 0x99, 0xA1, 0xA1, 0x99, 0x42, 0x3C,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
}; };
void AGOSEngine::windowDrawChar(WindowBlock *window, uint x, uint y, byte chr) { void AGOSEngine::windowDrawChar(WindowBlock *window, uint x, uint y, byte chr) {

View file

@ -539,7 +539,7 @@ void AGOSEngine::dumpBitmap(const char *filename, const byte *offs, uint16 w, ui
src += 5; src += 5;
} while (--count); } while (--count);
dst += w; dst += w;
} }
} else if (flags & 0x80) { } else if (flags & 0x80) {
for (i = 0; i != w; i += 2) { for (i = 0; i != w; i += 2) {
byte *c = vc10_depackColumn(&state); byte *c = vc10_depackColumn(&state);
@ -580,7 +580,7 @@ void AGOSEngine::palLoad(byte *pal, const byte *vga1, int a, int b) {
const byte *src; const byte *src;
uint16 num, palSize; uint16 num, palSize;
byte *palptr = (byte *)&pal[0]; byte *palptr = (byte *)&pal[0];
if (getGameType() == GType_FF || getGameType() == GType_PP) { if (getGameType() == GType_FF || getGameType() == GType_PP) {
num = 256; num = 256;
palSize = 768; palSize = 768;

View file

@ -354,11 +354,11 @@ void AGOSEngine::drawIcon(WindowBlock *window, uint icon, uint x, uint y) {
dst += _dxSurfacePitch; dst += _dxSurfacePitch;
} }
} else { } else {
uint8 palette[4]; uint8 palette[4];
palette[0] = *src >> 4; palette[0] = *src >> 4;
palette[1] = *src++ & 0xf; palette[1] = *src++ & 0xf;
palette[2] = *src >> 4; palette[2] = *src >> 4;
palette[3] = *src++ & 0xf; palette[3] = *src++ & 0xf;
for (int yp = 0; yp < 24; ++yp, src += 6) { for (int yp = 0; yp < 24; ++yp, src += 6) {
// Get bit-set representing the 24 pixels for the line // Get bit-set representing the 24 pixels for the line
uint32 v1 = (READ_BE_UINT16(src) << 8) | *(src + 4); uint32 v1 = (READ_BE_UINT16(src) << 8) | *(src + 4);

View file

@ -463,9 +463,9 @@ bool AGOSEngine::processSpecialKeys() {
_lastMinute = t1; _lastMinute = t1;
} }
} }
if (shouldQuit()) if (shouldQuit())
_exitCutscene = true; _exitCutscene = true;
switch (_keyPressed.keycode) { switch (_keyPressed.keycode) {
case Common::KEYCODE_UP: case Common::KEYCODE_UP:
@ -694,7 +694,7 @@ void AGOSEngine_PN::interact(char *buffer, uint8 size) {
_inputting = true; _inputting = true;
_inputReady = true; _inputReady = true;
} }
while (!shouldQuit() && _inputReady) { while (!shouldQuit() && _inputReady) {
if (!_noScanFlag && _scanFlag) { if (!_noScanFlag && _scanFlag) {
buffer[0] = 1; buffer[0] = 1;
@ -744,7 +744,7 @@ void AGOSEngine_PN::clearCursor(WindowBlock *window) {
bool AGOSEngine_PN::processSpecialKeys() { bool AGOSEngine_PN::processSpecialKeys() {
if (shouldQuit()) if (shouldQuit())
_exitCutscene = true; _exitCutscene = true;
switch (_keyPressed.keycode) { switch (_keyPressed.keycode) {
case Common::KEYCODE_ESCAPE: case Common::KEYCODE_ESCAPE:

View file

@ -704,7 +704,7 @@ static bool getBit(Common::Stack<uint32> &dataList, uint32 &srcVal) {
static uint32 copyBits(Common::Stack<uint32> &dataList, uint32 &srcVal, int numBits) { static uint32 copyBits(Common::Stack<uint32> &dataList, uint32 &srcVal, int numBits) {
uint32 destVal = 0; uint32 destVal = 0;
for (int i = 0; i < numBits; ++i) { for (int i = 0; i < numBits; ++i) {
bool f = getBit(dataList, srcVal); bool f = getBit(dataList, srcVal);
destVal = (destVal << 1) | (f ? 1 : 0); destVal = (destVal << 1) | (f ? 1 : 0);

View file

@ -147,7 +147,7 @@ void AGOSEngine_PN::opn_opcode01() {
int32 sp = varval() + varval(); int32 sp = varval() + varval();
_variableArray[12] = sp % 65536; _variableArray[12] = sp % 65536;
_variableArray[13] = sp / 65536; _variableArray[13] = sp / 65536;
if (sp > 65535) if (sp > 65535)
sp=65535; sp=65535;
writeval(str, (int)sp); writeval(str, (int)sp);
setScriptReturn(true); setScriptReturn(true);
@ -329,7 +329,7 @@ void AGOSEngine_PN::opn_opcode25() {
void AGOSEngine_PN::opn_opcode26() { void AGOSEngine_PN::opn_opcode26() {
while ((_stackbase->classnum != -1) && (_stackbase != NULL)) while ((_stackbase->classnum != -1) && (_stackbase != NULL))
junkstack(); junkstack();
dumpstack(); dumpstack();
setScriptReturn(true); setScriptReturn(true);
} }
@ -371,10 +371,10 @@ void AGOSEngine_PN::opn_opcode31() {
slot = matchSaveGame(_saveFile, countSaveGames()); slot = matchSaveGame(_saveFile, countSaveGames());
strcpy(bf, genSaveName(slot)); strcpy(bf, genSaveName(slot));
break; break;
case 1: case 1:
strcpy(bf, "test.sav"); strcpy(bf, "test.sav");
break; break;
case 2: case 2:
// NOTE: Is this case ever used? // NOTE: Is this case ever used?
error("opn_opcode31: case 2"); error("opn_opcode31: case 2");
break; break;
@ -776,7 +776,7 @@ void AGOSEngine_PN::writeval(uint8 *ptr, int val) {
_workptr = ptr; _workptr = ptr;
_linct = 255; _linct = 255;
if ((a = readfromline()) < 247) if ((a = readfromline()) < 247)
error("writeval: Write to constant (%d)", a); error("writeval: Write to constant (%d)", a);
switch (a) { switch (a) {
@ -836,7 +836,7 @@ int AGOSEngine_PN::actCallD(int n) {
funcentry(pf, n); funcentry(pf, n);
addstack(-1); addstack(-1);
funccpy(pf); funccpy(pf);
setposition(n, 0); setposition(n, 0);
return(doline(1)); return(doline(1));
} }
@ -1065,7 +1065,7 @@ void AGOSEngine_PN::dumpstack() {
if (_stackbase == NULL) if (_stackbase == NULL)
error("dumpstack: Stack underflow or unknown longjmp"); error("dumpstack: Stack underflow or unknown longjmp");
a = _stackbase->nextframe; a = _stackbase->nextframe;
free((char *)_stackbase); free((char *)_stackbase);
_stackbase = a; _stackbase = a;
} }
@ -1076,7 +1076,7 @@ void AGOSEngine_PN::junkstack() {
if (_stackbase == NULL) if (_stackbase == NULL)
error("junkstack: Stack underflow or unknown longjmp"); error("junkstack: Stack underflow or unknown longjmp");
a = _stackbase->nextframe; a = _stackbase->nextframe;
if (_stackbase->classnum == -1) if (_stackbase->classnum == -1)
free((char *)_stackbase->savearea); free((char *)_stackbase->savearea);
free((char *)_stackbase); free((char *)_stackbase);
@ -1100,7 +1100,7 @@ void AGOSEngine_PN::popstack(int type) {
b = 0; b = 0;
while (a < 6) while (a < 6)
_variableArray[b++] = _stackbase->flag[a++]; _variableArray[b++] = _stackbase->flag[a++];
b = 24; b = 24;
a = 0; a = 0;
while (a < 8) while (a < 8)
_variableArray[b++] = _stackbase->param[a++]; _variableArray[b++] = _stackbase->param[a++];

View file

@ -56,7 +56,7 @@ byte *AGOSEngine::uncompressToken(byte a, byte *ptr) {
if (a == 0xFF || a == 0xFE || a == 0xFD) { if (a == 0xFF || a == 0xFE || a == 0xFD) {
if (a == 0xFF) if (a == 0xFF)
ptr2 = _twoByteTokenStrings; ptr2 = _twoByteTokenStrings;
if (a == 0xFE) if (a == 0xFE)
ptr2 = _secondTwoByteTokenStrings; ptr2 = _secondTwoByteTokenStrings;
if (a == 0xFD) if (a == 0xFD)
ptr2 = _thirdTwoByteTokenStrings; ptr2 = _thirdTwoByteTokenStrings;
@ -79,7 +79,7 @@ byte *AGOSEngine::uncompressToken(byte a, byte *ptr) {
count1++; count1++;
} }
ptr1 = _byteTokenStrings; /* Find it */ ptr1 = _byteTokenStrings; /* Find it */
while (count1--) { while (count1--) {
while (*ptr1++) while (*ptr1++)
; ;
} }
@ -224,7 +224,7 @@ l1: _stringTabPtr[i++] = mem;
; ;
mem++; mem++;
} }
_stringTabPos = i; _stringTabPos = i;
} }
} }
@ -936,7 +936,7 @@ char *AGOSEngine_PN::unctok(char *c, int n) {
*c = 0; *c = 0;
return c; return c;
} }
void AGOSEngine_PN::uncomstr(char *c, uint32 x) { void AGOSEngine_PN::uncomstr(char *c, uint32 x) {
if (x > _textBaseSize) if (x > _textBaseSize)
error("UNCOMSTR: TBASE over-run\n"); error("UNCOMSTR: TBASE over-run\n");
@ -1441,7 +1441,7 @@ void AGOSEngine_PN::getResponse(uint16 charNum, uint16 objNum, uint16 &msgNum1,
} }
ptr++; ptr++;
} }
while ((num = *ptr++) != 0) { while ((num = *ptr++) != 0) {
if (num == objNum) { if (num == objNum) {
msgNum2 = *ptr++; msgNum2 = *ptr++;
@ -1534,7 +1534,7 @@ char *AGOSEngine_PN::getMessage(char *msg, uint16 num) {
char *tmpPtr = strPtr1; char *tmpPtr = strPtr1;
char *strPtr2 = strPtr1; char *strPtr2 = strPtr1;
while (*strPtr2 != 0 && *strPtr2 != 32) while (*strPtr2 != 0 && *strPtr2 != 32)
strPtr2++; strPtr2++;
while (*strPtr2) { while (*strPtr2) {

View file

@ -540,7 +540,7 @@ int AGOSEngine::startSubroutine(Subroutine *sub) {
// WORKAROUND: If the game is saved, right after Simon is thrown in the dungeon of Sordid's Fortress of Doom, // WORKAROUND: If the game is saved, right after Simon is thrown in the dungeon of Sordid's Fortress of Doom,
// the saved game fails to load correctly. When loading the saved game, the sequence of Simon waking is started, // the saved game fails to load correctly. When loading the saved game, the sequence of Simon waking is started,
// before the scene is actually reloaded, due to a script bug. We manually add the extra script code from the // before the scene is actually reloaded, due to a script bug. We manually add the extra script code from the
// updated DOS CD release, which fixed this particular script bug. // updated DOS CD release, which fixed this particular script bug.
if (getGameType() == GType_SIMON2 && sub->id == 12101) { if (getGameType() == GType_SIMON2 && sub->id == 12101) {
const byte bit = 228; const byte bit = 228;
@ -577,7 +577,7 @@ restart:
} }
// WORKAROUND: Feeble walks in the incorrect direction, when looking at the Vent in the Research and Testing area of // WORKAROUND: Feeble walks in the incorrect direction, when looking at the Vent in the Research and Testing area of
// the Company Central Command Compound. We manually add the extra script code from the updated English 2CD release, // the Company Central Command Compound. We manually add the extra script code from the updated English 2CD release,
// which fixed this particular script bug. // which fixed this particular script bug.
if (getGameType() == GType_FF && _language == Common::EN_ANY) { if (getGameType() == GType_FF && _language == Common::EN_ANY) {
if (sub->id == 39125 && readVariable(84) == 2) { if (sub->id == 39125 && readVariable(84) == 2) {

View file

@ -754,7 +754,7 @@ void AGOSEngine::boxController(uint x, uint y, uint mode) {
if (_clickOnly) if (_clickOnly)
return; return;
if (best_ha->flags & kBFInvertTouch) { if (best_ha->flags & kBFInvertTouch) {
if (!(best_ha->flags & kBFBoxSelected)) { if (!(best_ha->flags & kBFBoxSelected)) {
hitarea_leave(best_ha, false); hitarea_leave(best_ha, false);
@ -763,7 +763,7 @@ void AGOSEngine::boxController(uint x, uint y, uint mode) {
} else { } else {
if (mode == 0) if (mode == 0)
return; return;
if (!(best_ha->flags & kBFInvertSelect)) if (!(best_ha->flags & kBFInvertSelect))
return; return;
@ -1145,7 +1145,7 @@ void AGOSEngine_PN::hitBox1(HitArea *ha) {
_mousePrintFG++; _mousePrintFG++;
_mouseString1 = _mouseString; _mouseString1 = _mouseString;
_mouseString = (const char*)"showname \0"; _mouseString = (const char*)"showname \0";
} }
} }

View file

@ -331,7 +331,7 @@ Palette &Palette::load(const byte *buf, const uint size, const Graphics::PixelFo
const int rBytePos = bytePos(format.rShift, format.bytesPerPixel, isBigEndian(endian)); const int rBytePos = bytePos(format.rShift, format.bytesPerPixel, isBigEndian(endian));
const int gBytePos = bytePos(format.gShift, format.bytesPerPixel, isBigEndian(endian)); const int gBytePos = bytePos(format.gShift, format.bytesPerPixel, isBigEndian(endian));
const int bBytePos = bytePos(format.bShift, format.bytesPerPixel, isBigEndian(endian)); const int bBytePos = bytePos(format.bShift, format.bytesPerPixel, isBigEndian(endian));
for (uint i = 0; i < numColors; i++) { for (uint i = 0; i < numColors; i++) {
// format.rMax(), format.gMax(), format.bMax() are also used as masks here // format.rMax(), format.gMax(), format.bMax() are also used as masks here
_colors[i].r = (buf[i * format.bytesPerPixel + rBytePos] >> (format.rShift % 8)) & format.rMax(); _colors[i].r = (buf[i * format.bytesPerPixel + rBytePos] >> (format.rShift % 8)) & format.rMax();

View file

@ -750,7 +750,7 @@ void processAnimation(void) {
currentActor->flag = 1; currentActor->flag = 1;
} }
currentActor->pathId = computePathfinding(moveInfo, params.X, params.Y, currentActor->pathId = computePathfinding(moveInfo, params.X, params.Y,
aniX, aniY, currentActor->stepX, currentActor->stepY, currentActor->pathId); aniX, aniY, currentActor->stepX, currentActor->stepY, currentActor->pathId);
if (currentActor->pathId == ANIM_WAIT) { if (currentActor->pathId == ANIM_WAIT) {
@ -804,7 +804,7 @@ void processAnimation(void) {
// , so 'break' statements should *not* be used at the end of case areas // , so 'break' statements should *not* be used at the end of case areas
switch (currentActor->phase) { switch (currentActor->phase) {
case ANIM_PHASE_STATIC_END: case ANIM_PHASE_STATIC_END:
case ANIM_PHASE_STATIC: case ANIM_PHASE_STATIC:
{ {
// In-place (on the spot) animationos // In-place (on the spot) animationos

View file

@ -81,7 +81,7 @@ void restoreBackground(backgroundIncrustStruct *pIncrust) {
int xp = j + X; int xp = j + X;
int yp = i + Y; int yp = i + Y;
if ((xp >= 0) && (yp >= 0) && (xp < 320) && (yp < 200)) if ((xp >= 0) && (yp >= 0) && (xp < 320) && (yp < 200))
pBackground[yp * 320 + xp] = pIncrust->ptr[i * width + j]; pBackground[yp * 320 + xp] = pIncrust->ptr[i * width + j];
} }
} }
@ -101,7 +101,7 @@ backgroundIncrustStruct *addBackgroundIncrust(int16 overlayIdx, int16 objectIdx,
// Don't process any further if not a sprite or polygon // Don't process any further if not a sprite or polygon
if (!ptr) return NULL; if (!ptr) return NULL;
if ((filesDatabase[params.fileIdx].subData.resourceType != OBJ_TYPE_SPRITE) && if ((filesDatabase[params.fileIdx].subData.resourceType != OBJ_TYPE_SPRITE) &&
(filesDatabase[params.fileIdx].subData.resourceType != OBJ_TYPE_POLY)) { (filesDatabase[params.fileIdx].subData.resourceType != OBJ_TYPE_POLY)) {
return NULL; return NULL;
} }

View file

@ -570,8 +570,8 @@ int findObject(int mouseX, int mouseY, int *outObjOvl, int *outObjIdx) {
cellStruct *currentObject = cellHead.prev; cellStruct *currentObject = cellHead.prev;
while (currentObject) { while (currentObject) {
if (currentObject->overlay > 0 && overlayTable[currentObject->overlay].alreadyLoaded && if (currentObject->overlay > 0 && overlayTable[currentObject->overlay].alreadyLoaded &&
(currentObject->type == OBJ_TYPE_SPRITE || currentObject->type == OBJ_TYPE_MASK || (currentObject->type == OBJ_TYPE_SPRITE || currentObject->type == OBJ_TYPE_MASK ||
currentObject->type == OBJ_TYPE_EXIT || currentObject->type == OBJ_TYPE_VIRTUAL)) { currentObject->type == OBJ_TYPE_EXIT || currentObject->type == OBJ_TYPE_VIRTUAL)) {
const char* pObjectName = getObjectName(currentObject->idx, overlayTable[currentObject->overlay].ovlData->arrayNameObj); const char* pObjectName = getObjectName(currentObject->idx, overlayTable[currentObject->overlay].ovlData->arrayNameObj);
@ -633,7 +633,7 @@ int findObject(int mouseX, int mouseY, int *outObjOvl, int *outObjIdx) {
offset += j; offset += j;
if (offset >= 0) { if (offset >= 0) {
if (filesDatabase[offset].resType == OBJ_TYPE_LINE && if (filesDatabase[offset].resType == OBJ_TYPE_LINE &&
filesDatabase[offset].subData.ptr) { filesDatabase[offset].subData.ptr) {
dataPtr = (int16 *)filesDatabase[offset].subData.ptr; dataPtr = (int16 *)filesDatabase[offset].subData.ptr;
} }

View file

@ -424,7 +424,7 @@ int loadSetEntry(const char *name, uint8 *ptr, int currentEntryIdx, int currentD
localBuffer.hotspotY = s4.readUint16BE(); localBuffer.hotspotY = s4.readUint16BE();
localBuffer.hotspotX = s4.readUint16BE(); localBuffer.hotspotX = s4.readUint16BE();
if (sec == 1) if (sec == 1)
// Type 1: Width - (1*2) , Type 5: Width - (5*2) // Type 1: Width - (1*2) , Type 5: Width - (5*2)
localBuffer.width -= localBuffer.type * 2; localBuffer.width -= localBuffer.type * 2;

View file

@ -47,8 +47,8 @@ bool Debugger::cmd_hotspots(int argc, const char **argv) {
cellStruct *currentObject = cellHead.prev; cellStruct *currentObject = cellHead.prev;
while (currentObject) { while (currentObject) {
if (currentObject->overlay > 0 && overlayTable[currentObject->overlay].alreadyLoaded && if (currentObject->overlay > 0 && overlayTable[currentObject->overlay].alreadyLoaded &&
(currentObject->type == OBJ_TYPE_SPRITE || currentObject->type == OBJ_TYPE_MASK || (currentObject->type == OBJ_TYPE_SPRITE || currentObject->type == OBJ_TYPE_MASK ||
currentObject->type == OBJ_TYPE_EXIT || currentObject->type == OBJ_TYPE_VIRTUAL)) { currentObject->type == OBJ_TYPE_EXIT || currentObject->type == OBJ_TYPE_VIRTUAL)) {
const char *pObjectName = getObjectName(currentObject->idx, overlayTable[currentObject->overlay].ovlData->arrayNameObj); const char *pObjectName = getObjectName(currentObject->idx, overlayTable[currentObject->overlay].ovlData->arrayNameObj);

View file

@ -1394,7 +1394,7 @@ int16 Op_SongSize(void) {
*pSize = size; *pSize = size;
} else } else
oldSize = 0; oldSize = 0;
return oldSize; return oldSize;
} }
@ -1412,7 +1412,7 @@ int16 Op_SetPattern(void) {
int16 Op_FadeSong(void) { int16 Op_FadeSong(void) {
_vm->music().fadeSong(); _vm->music().fadeSong();
return 0; return 0;
} }
@ -1646,7 +1646,7 @@ int16 Op_SetVolume(void) {
int volume = 63 - newVolume; int volume = 63 - newVolume;
_vm->music().setVolume(volume << 2); _vm->music().setVolume(volume << 2);
} }
return oldVolume >> 2; return oldVolume >> 2;
} }

View file

@ -180,7 +180,7 @@ static void syncFilesDatabase(Common::Serializer &s) {
s.syncAsUint16LE(fe.width); s.syncAsUint16LE(fe.width);
s.syncAsUint16LE(fe.resType); s.syncAsUint16LE(fe.resType);
s.syncAsUint16LE(fe.height); s.syncAsUint16LE(fe.height);
// TODO: Have a look at the saving/loading of this pointer // TODO: Have a look at the saving/loading of this pointer
tmp = (fe.subData.ptr) ? 1 : 0; tmp = (fe.subData.ptr) ? 1 : 0;
s.syncAsUint32LE(tmp); s.syncAsUint32LE(tmp);
@ -602,7 +602,7 @@ static void DoSync(Common::Serializer &s) {
syncBackgroundTable(s); syncBackgroundTable(s);
syncPalScreen(s); syncPalScreen(s);
syncSoundList(s); syncSoundList(s);
for (int i = 0; i < stateID; ++i) for (int i = 0; i < stateID; ++i)
s.syncAsSint16LE(globalVars[i]); s.syncAsSint16LE(globalVars[i]);

View file

@ -188,7 +188,7 @@ void MusicPlayer::removeSong() {
} }
_songPlayed = false; _songPlayed = false;
strcpy(_musicName, ""); strcpy(_musicName, "");
} }

View file

@ -45,7 +45,7 @@ private:
byte _masterVolume; byte _masterVolume;
byte *_songPointer; byte *_songPointer;
// TODO: lib_SongSize // TODO: lib_SongSize
int _songSize; int _songSize;
void patchMidi(uint32 adr, const byte *data, int size); void patchMidi(uint32 adr, const byte *data, int size);

View file

@ -135,8 +135,8 @@ int16 german_fontCharacterTable[256] = {
86, 87, 88, 89, 90, 91, 92, 86, 87, 88, 89, 90, 91, 92,
-1, -1, -1, -1, -1, -1,
0x72, 0x72,
-1, -1, -1, -1,
0x5e, 0x5e,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
0x6a, 0x6a,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,

View file

@ -371,7 +371,7 @@ void DataIO::openDataFile(const char *src, bool itk) {
ChunkDesc *dataDesc; ChunkDesc *dataDesc;
char path[128]; char path[128];
int16 file; int16 file;
char *fakeTotPtr; char *fakeTotPtr;
strncpy0(path, src, 127); strncpy0(path, src, 127);
if (!strchr(path, '.')) { if (!strchr(path, '.')) {

View file

@ -44,7 +44,7 @@ DemoPlayer::Script DemoPlayer::_scripts[] = {
{kScriptSourceFile, "e.scn"}, {kScriptSourceFile, "e.scn"},
{kScriptSourceFile, "i.scn"}, {kScriptSourceFile, "i.scn"},
{kScriptSourceFile, "s.scn"}, {kScriptSourceFile, "s.scn"},
{kScriptSourceDirect, {kScriptSourceDirect,
"slide machu.imd 20\nslide conseil.imd 20\nslide cons.imd 20\n" \ "slide machu.imd 20\nslide conseil.imd 20\nslide cons.imd 20\n" \
"slide tumia.imd 1\nslide tumib.imd 1\nslide tumic.imd 1\n" \ "slide tumia.imd 1\nslide tumib.imd 1\nslide tumic.imd 1\n" \
"slide tumid.imd 1\nslide post.imd 1\nslide posta.imd 1\n" \ "slide tumid.imd 1\nslide post.imd 1\nslide posta.imd 1\n" \

View file

@ -849,7 +849,7 @@ static const GOBGameDescription gameDescriptions[] = {
kFeaturesNone, kFeaturesNone,
0, 0, 0 0, 0, 0
}, },
{ // Supplied by goodoldgeorg in bug report #2563539 { // Supplied by goodoldgeorg in bug report #2563539
{ {
"ween", "ween",
"", "",
@ -1489,7 +1489,7 @@ static const GOBGameDescription gameDescriptions[] = {
kGameTypeFascination, kGameTypeFascination,
kFeaturesNone, kFeaturesNone,
"disk0.stk", 0, 0 "disk0.stk", 0, 0
}, },
{ {
{ {
"fascination", "fascination",
@ -1502,7 +1502,7 @@ static const GOBGameDescription gameDescriptions[] = {
kGameTypeFascination, kGameTypeFascination,
kFeaturesNone, kFeaturesNone,
"disk0.stk", 0, 0 "disk0.stk", 0, 0
}, },
{ {
{ {
"fascination", "fascination",
@ -1515,7 +1515,7 @@ static const GOBGameDescription gameDescriptions[] = {
kGameTypeFascination, kGameTypeFascination,
kFeaturesNone, kFeaturesNone,
"disk0.stk", 0, 0 "disk0.stk", 0, 0
}, },
{ {
{ {
"fascination", "fascination",
@ -1528,7 +1528,7 @@ static const GOBGameDescription gameDescriptions[] = {
kGameTypeFascination, kGameTypeFascination,
kFeaturesNone, kFeaturesNone,
"disk0.stk", 0, 0 "disk0.stk", 0, 0
}, },
{ {
{ {
"geisha", "geisha",

View file

@ -234,7 +234,7 @@ void Inter::funcBlock(int16 retFlag) {
// The EGA, Mac and Windows versions of gob1 doesn't add a delay after // The EGA, Mac and Windows versions of gob1 doesn't add a delay after
// showing images between levels. We manually add it here. // showing images between levels. We manually add it here.
if ((_vm->getGameType() == kGameTypeGob1) && if ((_vm->getGameType() == kGameTypeGob1) &&
( _vm->isEGA() || ( _vm->isEGA() ||
(_vm->getPlatform() == Common::kPlatformMacintosh) || (_vm->getPlatform() == Common::kPlatformMacintosh) ||
(_vm->getPlatform() == Common::kPlatformWindows))) { (_vm->getPlatform() == Common::kPlatformWindows))) {

View file

@ -55,8 +55,8 @@ const int Inter_Fascination::_goblinFuncLookUp[][2] = {
{10, 9}, {10, 9},
{11, 10}, {11, 10},
{12, 11}, {12, 11},
{1000, 12}, {1000, 12},
{1001, 13}, {1001, 13},
{1002, 14} {1002, 14}
}; };
@ -515,7 +515,7 @@ void Inter_Fascination::setupOpcodes() {
_opcodesDrawFascination = opcodesDraw; _opcodesDrawFascination = opcodesDraw;
_opcodesFuncFascination = opcodesFunc; _opcodesFuncFascination = opcodesFunc;
_opcodesGoblinFascination = opcodesGoblin; _opcodesGoblinFascination = opcodesGoblin;
} }
void Inter_Fascination::executeDrawOpcode(byte i) { void Inter_Fascination::executeDrawOpcode(byte i) {
@ -676,14 +676,14 @@ void Inter_Fascination::oFascin_cdUnknown6() {
void Inter_Fascination::oFascin_setRenderFlags() { void Inter_Fascination::oFascin_setRenderFlags() {
int16 expr; int16 expr;
// warning("Fascination oFascin_cdUnknown10 (set render flags)"); // warning("Fascination oFascin_cdUnknown10 (set render flags)");
evalExpr(&expr); evalExpr(&expr);
warning("_draw_renderFlags <- %d",expr); warning("_draw_renderFlags <- %d",expr);
_vm->_draw->_renderFlags = expr; _vm->_draw->_renderFlags = expr;
} }
void Inter_Fascination::oFascin_cdUnknown11() { void Inter_Fascination::oFascin_cdUnknown11() {
// warning("Fascination oFascin_cdUnknown11 (set variable)"); // warning("Fascination oFascin_cdUnknown11 (set variable)");
evalExpr(0); evalExpr(0);
} }
@ -744,7 +744,7 @@ const char *Inter_Fascination::getOpcodeGoblinDesc(int i) {
for (int j = 0; j < ARRAYSIZE(_goblinFuncLookUp); j++) for (int j = 0; j < ARRAYSIZE(_goblinFuncLookUp); j++)
if (_goblinFuncLookUp[j][0] == i) if (_goblinFuncLookUp[j][0] == i)
return _opcodesGoblinFascination[_goblinFuncLookUp[j][1]].desc; return _opcodesGoblinFascination[_goblinFuncLookUp[j][1]].desc;
warning("Error in getOpcodeGoblinDesc %d",i); warning("Error in getOpcodeGoblinDesc %d",i);
return ""; return "";
} }

View file

@ -1001,7 +1001,7 @@ void Inter_v5::o5_gob96(OpGobParams &params) {
warning("Dynasty Stub: GobFunc 96: %d, %d, %d, %d", warning("Dynasty Stub: GobFunc 96: %d, %d, %d, %d",
speedThrottle4, speedThrottle3, speedThrottle2, speedThrottle1); speedThrottle4, speedThrottle3, speedThrottle2, speedThrottle1);
// TODO // TODO
} }
void Inter_v5::o5_gob97(OpGobParams &params) { void Inter_v5::o5_gob97(OpGobParams &params) {

View file

@ -86,7 +86,7 @@ enum {
enum { enum {
// FIXME: The following two 'truth values' are stored inside the list // FIXME: The following two 'truth values' are stored inside the list
// of "operators". So they somehow coincide with OP_LOAD_VAR_UINT32 // of "operators". So they somehow coincide with OP_LOAD_VAR_UINT32
// and OP_LOAD_VAR_UINT32_AS_UINT16. I haven't yet quite understood // and OP_LOAD_VAR_UINT32_AS_UINT16. I haven't yet quite understood
// how, resp. what that means. You have been warned. // how, resp. what that means. You have been warned.
GOB_TRUE = 24, GOB_TRUE = 24,
GOB_FALSE = 23 GOB_FALSE = 23

View file

@ -60,7 +60,7 @@ void GraphicsMan::update() {
_fading = 0; _fading = 0;
// Clear the buffer when ending the fade out // Clear the buffer when ending the fade out
if (_fading == 2) if (_fading == 2)
_foreground.fillRect(Common::Rect(640, 320), 0); _foreground.fillRect(Common::Rect(640, 320), 0);
} }
} }

View file

@ -99,17 +99,17 @@ public:
virtual GUI::Debugger *getDebugger(); virtual GUI::Debugger *getDebugger();
bool isEGA() const { return (getFeatures() & GF_EGA) != 0; } bool isEGA() const { return (getFeatures() & GF_EGA) != 0; }
virtual Common::Error loadGameState(int slot) { virtual Common::Error loadGameState(int slot) {
return loadGame(slot) ? Common::kReadingFailed : Common::kNoError; return loadGame(slot) ? Common::kReadingFailed : Common::kNoError;
} }
virtual Common::Error saveGameState(int slot, const char *desc) { virtual Common::Error saveGameState(int slot, const char *desc) {
String s(desc); String s(desc);
return saveGame(slot, s) ? Common::kReadingFailed : Common::kNoError; return saveGame(slot, s) ? Common::kReadingFailed : Common::kNoError;
} }
virtual bool canLoadGameStateCurrently() { virtual bool canLoadGameStateCurrently() {
return _saveLoadAllowed && !Fights.isFighting(); return _saveLoadAllowed && !Fights.isFighting();
} }
virtual bool canSaveGameStateCurrently() { virtual bool canSaveGameStateCurrently() {
return _saveLoadAllowed && !Fights.isFighting(); return _saveLoadAllowed && !Fights.isFighting();
} }
}; };

View file

@ -431,7 +431,7 @@ void GameDatabaseV2::load(Common::SeekableReadStream &sourceS) {
// "Decrypt" the text data // "Decrypt" the text data
for (uint32 i = 0; i < textSize; i++) for (uint32 i = 0; i < textSize; i++)
_gameText[i] += 0x1E; _gameText[i] += 0x1E;
sourceS.seek(objectsOffs); sourceS.seek(objectsOffs);
if (version == 40) { if (version == 40) {

View file

@ -244,7 +244,7 @@ static const MadeGameDescription gameDescriptions[] = {
GF_CD_COMPRESSED, GF_CD_COMPRESSED,
3, 3,
}, },
{ {
// Return to Zork - French CD version 1.2 5/13/95 (installed) // Return to Zork - French CD version 1.2 5/13/95 (installed)
// Patch #2685032 submitted by goodoldgeorg // Patch #2685032 submitted by goodoldgeorg

View file

@ -77,7 +77,7 @@ void decompressImage(byte *source, Graphics::Surface &surface, uint16 cmdOffs, u
byte *cmdBuffer = source + cmdOffs; byte *cmdBuffer = source + cmdOffs;
ValueReader maskReader(source + maskOffs, (maskFlags & 2) != 0); ValueReader maskReader(source + maskOffs, (maskFlags & 2) != 0);
ValueReader pixelReader(source + pixelOffs, (pixelFlags & 2) != 0); ValueReader pixelReader(source + pixelOffs, (pixelFlags & 2) != 0);
if ((maskFlags != 0) && (maskFlags != 2) && (pixelFlags != 0) && (pixelFlags != 2) && (cmdFlags != 0)) if ((maskFlags != 0) && (maskFlags != 2) && (pixelFlags != 0) && (pixelFlags != 2) && (cmdFlags != 0))
error("decompressImage() Unsupported flags: cmdFlags = %02X; maskFlags = %02X, pixelFlags = %02X", cmdFlags, maskFlags, pixelFlags); error("decompressImage() Unsupported flags: cmdFlags = %02X; maskFlags = %02X, pixelFlags = %02X", cmdFlags, maskFlags, pixelFlags);

View file

@ -280,7 +280,7 @@ Common::Error MadeEngine::run() {
} else { } else {
error ("Unknown MADE game"); error ("Unknown MADE game");
} }
if ((getFeatures() & GF_CD) || (getFeatures() & GF_CD_COMPRESSED)) if ((getFeatures() & GF_CD) || (getFeatures() & GF_CD_COMPRESSED))
checkCD(); checkCD();

View file

@ -117,7 +117,7 @@ public:
bool _autoStopSound; bool _autoStopSound;
uint _soundEnergyIndex; uint _soundEnergyIndex;
SoundEnergyArray *_soundEnergyArray; SoundEnergyArray *_soundEnergyArray;
uint32 _musicBeatStart; uint32 _musicBeatStart;
uint32 _cdTimeStart; uint32 _cdTimeStart;

View file

@ -64,7 +64,7 @@ void PictureResource::load(byte *source, int size) {
void PictureResource::loadRaw(byte *source, int size) { void PictureResource::loadRaw(byte *source, int size) {
// Loads a "raw" picture as used in RtZ, LGoP2, Manhole:N&E and Rodney's Funscreen // Loads a "raw" picture as used in RtZ, LGoP2, Manhole:N&E and Rodney's Funscreen
Common::MemoryReadStream *sourceS = new Common::MemoryReadStream(source, size); Common::MemoryReadStream *sourceS = new Common::MemoryReadStream(source, size);
_hasPalette = (sourceS->readByte() != 0); _hasPalette = (sourceS->readByte() != 0);
@ -118,7 +118,7 @@ void PictureResource::loadChunked(byte *source, int size) {
uint32 chunkType = sourceS->readUint32BE(); uint32 chunkType = sourceS->readUint32BE();
uint32 chunkSize = sourceS->readUint32BE(); uint32 chunkSize = sourceS->readUint32BE();
if (sourceS->eos()) if (sourceS->eos())
break; break;

View file

@ -51,15 +51,15 @@ ScreenEffects::ScreenEffects(Screen *screen) : _screen(screen) {
vfxY1 = 0; vfxY1 = 0;
vfxWidth = 0; vfxWidth = 0;
vfxHeight = 0; vfxHeight = 0;
_fxPalette = new byte[768]; _fxPalette = new byte[768];
} }
ScreenEffects::~ScreenEffects() { ScreenEffects::~ScreenEffects() {
delete[] _fxPalette; delete[] _fxPalette;
} }
void ScreenEffects::run(int16 effectNum, Graphics::Surface *surface, byte *palette, byte *newPalette, int colorCount) { void ScreenEffects::run(int16 effectNum, Graphics::Surface *surface, byte *palette, byte *newPalette, int colorCount) {
// Workaround: we set up the final palette beforehand, to reduce CPU usage during the screen effect. // Workaround: we set up the final palette beforehand, to reduce CPU usage during the screen effect.
// The visual difference is not noticeable, but CPU load is much much less (as palette updates are very expensive). // The visual difference is not noticeable, but CPU load is much much less (as palette updates are very expensive).

View file

@ -53,7 +53,7 @@ private:
void setPalette(byte *palette); void setPalette(byte *palette);
void setBlendedPalette(byte *palette, byte *newPalette, int colorCount, int16 value, int16 maxValue); void setBlendedPalette(byte *palette, byte *newPalette, int colorCount, int16 value, int16 maxValue);
void copyFxRect(Graphics::Surface *surface, int16 x1, int16 y1, int16 x2, int16 y2); void copyFxRect(Graphics::Surface *surface, int16 x1, int16 y1, int16 x2, int16 y2);
void vfx00(Graphics::Surface *surface, byte *palette, byte *newPalette, int colorCount); void vfx00(Graphics::Surface *surface, byte *palette, byte *newPalette, int colorCount);
void vfx01(Graphics::Surface *surface, byte *palette, byte *newPalette, int colorCount); void vfx01(Graphics::Surface *surface, byte *palette, byte *newPalette, int colorCount);
void vfx02(Graphics::Surface *surface, byte *palette, byte *newPalette, int colorCount); void vfx02(Graphics::Surface *surface, byte *palette, byte *newPalette, int colorCount);

View file

@ -632,7 +632,7 @@ int16 ScriptFunctions::sfClearMono(int16 argc, int16 *argv) {
} }
int16 ScriptFunctions::sfGetSoundEnergy(int16 argc, int16 *argv) { int16 ScriptFunctions::sfGetSoundEnergy(int16 argc, int16 *argv) {
// This is called while in-game voices are played to animate // This is called while in-game voices are played to animate
// mouths when NPCs are talking // mouths when NPCs are talking
int result = 0; int result = 0;
if (_vm->_mixer->isSoundHandleActive(_audioStreamHandle) && _vm->_soundEnergyArray) { if (_vm->_mixer->isSoundHandleActive(_audioStreamHandle) && _vm->_soundEnergyArray) {

View file

@ -150,7 +150,7 @@ void decompressSound(byte *source, byte *dest, uint16 chunkSize, uint16 chunkCou
uint16 ofs = 0; uint16 ofs = 0;
uint16 i = 0, l = 0; uint16 i = 0, l = 0;
byte val; byte val;
SoundEnergyItem soundEnergyItem; SoundEnergyItem soundEnergyItem;
const int modeValues[3][4] = { const int modeValues[3][4] = {
@ -225,11 +225,11 @@ void decompressSound(byte *source, byte *dest, uint16 chunkSize, uint16 chunkCou
for (i = 0; i < workChunkSize; i++) for (i = 0; i < workChunkSize; i++)
soundBuffer[i] = *source++; soundBuffer[i] = *source++;
workSample = soundBuffer[workChunkSize - 1] - 128; workSample = soundBuffer[workChunkSize - 1] - 128;
soundEnergyItem.energy = 4; soundEnergyItem.energy = 4;
if (soundEnergyArray) if (soundEnergyArray)
soundEnergyArray->push_back(soundEnergyItem); soundEnergyArray->push_back(soundEnergyItem);
break; break;
default: default:

View file

@ -649,7 +649,7 @@ public:
struct DebugPoint { struct DebugPoint {
Point point; Point point;
byte color; byte color;
DebugPoint() : color(0) {} DebugPoint() : color(0) {}
DebugPoint(const Point &p, byte c): point(p), color(c) {} DebugPoint(const Point &p, byte c): point(p), color(c) {}

View file

@ -104,7 +104,7 @@ enum GameFileTypes {
GAME_SOUNDFILE = 1 << 2, // SFX (also contains voices and MIDI music in SAGA 2 games) GAME_SOUNDFILE = 1 << 2, // SFX (also contains voices and MIDI music in SAGA 2 games)
GAME_VOICEFILE = 1 << 3, // Voices (also contains SFX in the ITE floppy version) GAME_VOICEFILE = 1 << 3, // Voices (also contains SFX in the ITE floppy version)
// ITE specific // ITE specific
GAME_DIGITALMUSICFILE = 1 << 4, // ITE digital music, added by Wyrmkeep GAME_DIGITALMUSICFILE = 1 << 4, // ITE digital music, added by Wyrmkeep
GAME_MACBINARY = 1 << 5, // ITE Mac CD Guild GAME_MACBINARY = 1 << 5, // ITE Mac CD Guild
GAME_DEMOFILE = 1 << 6, // Early ITE demo GAME_DEMOFILE = 1 << 6, // Early ITE demo
GAME_SWAPENDIAN = 1 << 7, // Used to identify the BE voice file in the ITE combined version GAME_SWAPENDIAN = 1 << 7, // Used to identify the BE voice file in the ITE combined version

View file

@ -399,7 +399,7 @@ void Scene::skipScene() {
_sceneQueue.erase(_sceneQueue.begin(), queueIterator); _sceneQueue.erase(_sceneQueue.begin(), queueIterator);
endScene(); endScene();
loadScene(*_sceneQueue.begin()); loadScene(*_sceneQueue.begin());
break; break;
} }

View file

@ -316,7 +316,7 @@ void Script::setupScriptOpcodeList() {
// String manipulation // String manipulation
OPCODE(opDummy), // 71: opStrCat, string concatenation (unused) OPCODE(opDummy), // 71: opStrCat, string concatenation (unused)
OPCODE(opDummy), // 72: opStrFormat, string formatting (unused) OPCODE(opDummy), // 72: opStrFormat, string formatting (unused)
// Assignment // Assignment
OPCODE(opDummy), // 73: assign (unused) OPCODE(opDummy), // 73: assign (unused)
OPCODE(opDummy), // 74: += (unused) OPCODE(opDummy), // 74: += (unused)
OPCODE(opDummy), // 75: -= (unused) OPCODE(opDummy), // 75: -= (unused)
@ -434,7 +434,7 @@ void Script::setupScriptOpcodeList() {
// String manipulation // String manipulation
OPCODE(opDummy), // 80: opStrCat, string concatenation (unused) OPCODE(opDummy), // 80: opStrCat, string concatenation (unused)
OPCODE(opDummy), // 81: opStrFormat, string formatting (unused) OPCODE(opDummy), // 81: opStrFormat, string formatting (unused)
// Assignment // Assignment
OPCODE(opDummy), // 82: assign (unused) OPCODE(opDummy), // 82: assign (unused)
OPCODE(opDummy), // 83: += (unused) OPCODE(opDummy), // 83: += (unused)
OPCODE(opDummy), // 84: -= (unused) OPCODE(opDummy), // 84: -= (unused)
@ -660,7 +660,7 @@ void Script::opCcallV(SCRIPTOP_PARAMS) {
(this->*scriptFunction)(thread, argumentsCount, stopParsing); (this->*scriptFunction)(thread, argumentsCount, stopParsing);
if (stopParsing) if (stopParsing)
return; return;
if (scriptFunction == &Saga::Script::sfScriptGotoScene) { if (scriptFunction == &Saga::Script::sfScriptGotoScene) {
stopParsing = true; stopParsing = true;
breakOut = true; breakOut = true;

View file

@ -444,7 +444,7 @@ protected:
void setupScriptOpcodeList(); void setupScriptOpcodeList();
void opDummy(SCRIPTOP_PARAMS) { warning("Dummy opcode called"); } void opDummy(SCRIPTOP_PARAMS) { warning("Dummy opcode called"); }
void opNextBlock(SCRIPTOP_PARAMS) { void opNextBlock(SCRIPTOP_PARAMS) {
thread->_instructionOffset = (((thread->_instructionOffset) >> 10) + 1) << 10; thread->_instructionOffset = (((thread->_instructionOffset) >> 10) + 1) << 10;
} }
void opDup(SCRIPTOP_PARAMS); void opDup(SCRIPTOP_PARAMS);

View file

@ -219,7 +219,7 @@ bool SndRes::load(ResourceContext *context, uint32 resourceId, SoundBuffer &buff
file->open(soundFileName); file->open(soundFileName);
soundResourceLength = file->size(); soundResourceLength = file->size();
context->isBigEndian = true; context->isBigEndian = true;
} else } else
#endif #endif
{ {
ResourceData* resourceData = context->getResourceData(resourceId); ResourceData* resourceData = context->getResourceData(resourceId);

View file

@ -1042,7 +1042,7 @@ reg_t kDoAudio(EngineState *s, int funct_nr, int argc, reg_t *argv) {
if (audioRes) { if (audioRes) {
audioStream = Audio::makeLinearInputStream(audioRes->data, audioRes->size, _audioRate, Audio::Mixer::FLAG_UNSIGNED, 0, 0); audioStream = Audio::makeLinearInputStream(audioRes->data, audioRes->size, _audioRate, Audio::Mixer::FLAG_UNSIGNED, 0, 0);
sampleLen = audioRes->size * 60 / _audioRate; sampleLen = audioRes->size * 60 / _audioRate;
} else { } else {
// No patch file found, read it from the audio volume // No patch file found, read it from the audio volume
byte volume; byte volume;
@ -1057,8 +1057,8 @@ reg_t kDoAudio(EngineState *s, int funct_nr, int argc, reg_t *argv) {
sprintf(filename, "AUDIO%03d.%03d", _lang, volume); sprintf(filename, "AUDIO%03d.%03d", _lang, volume);
// Try to load compressed // Try to load compressed
audioStream = Audio::AudioStream::openStreamFile(filename, start, duration); audioStream = Audio::AudioStream::openStreamFile(filename, start, duration);
if (!audioStream) { if (!audioStream) {
// Compressed file load failed, try to load original raw data // Compressed file load failed, try to load original raw data
byte *soundbuff = (byte *)malloc(size); byte *soundbuff = (byte *)malloc(size);
Common::File* audioFile = new Common::File(); Common::File* audioFile = new Common::File();
@ -1094,7 +1094,7 @@ reg_t kDoAudio(EngineState *s, int funct_nr, int argc, reg_t *argv) {
case kSci1AudioPosition: case kSci1AudioPosition:
if (mixer->isSoundHandleActive(_audioHandle)) { if (mixer->isSoundHandleActive(_audioHandle)) {
return make_reg(0, mixer->getSoundElapsedTime(_audioHandle) * 6 / 100); // return elapsed time in ticks return make_reg(0, mixer->getSoundElapsedTime(_audioHandle) * 6 / 100); // return elapsed time in ticks
} else { } else {
return make_reg(0, -1); // Sound finished return make_reg(0, -1); // Sound finished
} }
case kSci1AudioRate: case kSci1AudioRate:

View file

@ -91,8 +91,8 @@ static void play_song(SongIterator *it) {
} }
static void player_tell_synth(int buf_nr, byte *buf) { static void player_tell_synth(int buf_nr, byte *buf) {
byte op1 = (buf_nr < 2 ? 0 : buf[1]); byte op1 = (buf_nr < 2 ? 0 : buf[1]);
byte op2 = (buf_nr < 3 ? 0 : buf[2]); byte op2 = (buf_nr < 3 ? 0 : buf[2]);
static_cast<MidiDriver *>(mididrv)->send(buf[0], op1, op2); static_cast<MidiDriver *>(mididrv)->send(buf[0], op1, op2);
} }

View file

@ -99,7 +99,7 @@ protected:
void PolledPlayerAudioStream::queryTimestamp() { void PolledPlayerAudioStream::queryTimestamp() {
Audio::Timestamp stamp; Audio::Timestamp stamp;
if (!new_song) { if (!new_song) {
_mode = FEED_MODE_IDLE; _mode = FEED_MODE_IDLE;
} else { } else {

View file

@ -522,7 +522,7 @@ bool ScummDebugger::Cmd_Debug(int argc, const char **argv) {
} else if (argv[1][0] == '-') { } else if (argv[1][0] == '-') {
result = Common::disableDebugChannel(argv[1] + 1); result = Common::disableDebugChannel(argv[1] + 1);
} }
if (result) { if (result) {
DebugPrintf("%s %s\n", (argv[1][0] == '+') ? "Enabled" : "Disabled", argv[1] + 1); DebugPrintf("%s %s\n", (argv[1][0] == '+') ? "Enabled" : "Disabled", argv[1] + 1);
} else { } else {

View file

@ -440,9 +440,9 @@ void ScummEngine_v3::processKeyboard(Common::KeyState lastKeyHit) {
// SCUMM var 244 is the episode score // SCUMM var 244 is the episode score
// and var 245 is the series score // and var 245 is the series score
char text[50]; char text[50];
updateIQPoints(); updateIQPoints();
sprintf(text, "IQ Points: Episode = %d, Series = %d", _scummVars[244], _scummVars[245]); sprintf(text, "IQ Points: Episode = %d, Series = %d", _scummVars[244], _scummVars[245]);
Indy3IQPointsDialog indy3IQPointsDialog(this, text); Indy3IQPointsDialog indy3IQPointsDialog(this, text);
runDialog(indy3IQPointsDialog); runDialog(indy3IQPointsDialog);

View file

@ -829,7 +829,7 @@ int ScummEngine::remapPaletteColor(int r, int g, int b, int threshold) {
uint sum, bestsum, bestitem = 0; uint sum, bestsum, bestitem = 0;
int startColor = (_game.version == 8) ? 24 : 1; int startColor = (_game.version == 8) ? 24 : 1;
if (_game.heversion >= 99) if (_game.heversion >= 99)
pal = _hePalettes + 1024 + startColor * 3; pal = _hePalettes + 1024 + startColor * 3;
else else

Some files were not shown because too many files have changed in this diff Show more