diff options
author | Max Horn | 2003-10-02 17:43:02 +0000 |
---|---|---|
committer | Max Horn | 2003-10-02 17:43:02 +0000 |
commit | 0e645f88ae1586dbac2bf0855fd0fda1f8f11eeb (patch) | |
tree | cef3882f5cb527ab9ced0c208d6f9c045bf8f3c4 | |
parent | f26d3d1784756fccaaf306f6b13a28cb709ad5bc (diff) | |
download | scummvm-rg350-0e645f88ae1586dbac2bf0855fd0fda1f8f11eeb.tar.gz scummvm-rg350-0e645f88ae1586dbac2bf0855fd0fda1f8f11eeb.tar.bz2 scummvm-rg350-0e645f88ae1586dbac2bf0855fd0fda1f8f11eeb.zip |
renamed namespace ScummVM to Common
svn-id: r10544
58 files changed, 143 insertions, 142 deletions
diff --git a/backends/fs/fs.h b/backends/fs/fs.h index be543c67c4..6a5ab500d0 100644 --- a/backends/fs/fs.h +++ b/backends/fs/fs.h @@ -65,7 +65,7 @@ class FSList; */ class FilesystemNode { protected: - typedef ScummVM::String String; + typedef Common::String String; public: @@ -146,7 +146,7 @@ public: /* * A sorted list of multiple file system nodes. E.g. the contents of a given directory. */ -class FSList : ScummVM::List<FilesystemNode *> { +class FSList : Common::List<FilesystemNode *> { public: ~FSList() { for (int i = 0; i < _size; i++) diff --git a/backends/fs/palmos/palmos-fs.cpp b/backends/fs/palmos/palmos-fs.cpp index 5f634a8ca9..5972917784 100644 --- a/backends/fs/palmos/palmos-fs.cpp +++ b/backends/fs/palmos/palmos-fs.cpp @@ -124,7 +124,7 @@ FSList *PalmOSFilesystemNode::listDir(ListMode mode) const { return myList; } -const char *lastPathComponent(const ScummVM::String &str) { +const char *lastPathComponent(const Common::String &str) { const char *start = str.c_str(); const char *cur = start + str.size() - 2; diff --git a/backends/fs/posix/posix-fs.cpp b/backends/fs/posix/posix-fs.cpp index d560db51c5..26b3075436 100644 --- a/backends/fs/posix/posix-fs.cpp +++ b/backends/fs/posix/posix-fs.cpp @@ -64,7 +64,7 @@ public: }; -static const char *lastPathComponent(const ScummVM::String &str) { +static const char *lastPathComponent(const Common::String &str) { const char *start = str.c_str(); const char *cur = start + str.size() - 2; diff --git a/backends/fs/windows/windows-fs.cpp b/backends/fs/windows/windows-fs.cpp index a4479adac1..6e18e6cb4c 100644 --- a/backends/fs/windows/windows-fs.cpp +++ b/backends/fs/windows/windows-fs.cpp @@ -184,7 +184,7 @@ FSList *WindowsFilesystemNode::listDir(ListMode mode) const { return myList; } -const char *lastPathComponent(const ScummVM::String &str) { +const char *lastPathComponent(const Common::String &str) { const char *start = str.c_str(); const char *cur = start + str.size() - 2; diff --git a/backends/gp32/gp-fs.cpp b/backends/gp32/gp-fs.cpp index 79173f2e83..2cc552203f 100644 --- a/backends/gp32/gp-fs.cpp +++ b/backends/gp32/gp-fs.cpp @@ -119,7 +119,7 @@ FSList *GP32FilesystemNode::listDir(ListMode mode) const { return myList; } -const char *lastPathComponent(const ScummVM::String &str) { +const char *lastPathComponent(const Common::String &str) { const char *start = str.c_str(); const char *cur = start + str.size() - 2; diff --git a/base/gameDetector.cpp b/base/gameDetector.cpp index 728c1db9c5..4e44eb1a62 100644 --- a/base/gameDetector.cpp +++ b/base/gameDetector.cpp @@ -672,7 +672,7 @@ bool GameDetector::detectGame() { } } -const ScummVM::String& GameDetector::getGameName() { +const Common::String& GameDetector::getGameName() { if (_gameText.isEmpty()) { _gameText = "Unknown game: \""; _gameText += _gameFileName; diff --git a/base/gameDetector.h b/base/gameDetector.h index 2f88080060..798780adf9 100644 --- a/base/gameDetector.h +++ b/base/gameDetector.h @@ -103,7 +103,7 @@ struct Language { typedef Engine *(*EngineFactory)(GameDetector *detector, OSystem *syst); class GameDetector { - typedef ScummVM::String String; + typedef Common::String String; public: static const MusicDriver *getMusicDrivers(); diff --git a/base/plugins.cpp b/base/plugins.cpp index 096a1832b7..3ba63f3e0e 100644 --- a/base/plugins.cpp +++ b/base/plugins.cpp @@ -131,9 +131,9 @@ public: class DynamicPlugin : public Plugin { void *_dlHandle; - ScummVM::String _filename; + Common::String _filename; - ScummVM::String _name; + Common::String _name; const TargetSettings *_targets; int _targetCount; EngineFactory _ef; diff --git a/base/plugins.h b/base/plugins.h index d79ff0c5d9..a463861c7b 100644 --- a/base/plugins.h +++ b/base/plugins.h @@ -75,7 +75,7 @@ public: /** List of plugins. */ -typedef ScummVM::List<Plugin *> PluginList; +typedef Common::List<Plugin *> PluginList; /** diff --git a/common/config-file.cpp b/common/config-file.cpp index c24419258b..9a45b002b5 100644 --- a/common/config-file.cpp +++ b/common/config-file.cpp @@ -228,7 +228,7 @@ const int Config::count_domains() { return count; } -ScummVM::StringList Config::get_domains() { +Common::StringList Config::get_domains() { StringList domainNames; DomainMap::Iterator d, end(domains.end()); for (d = domains.begin(); d != end; ++d) { diff --git a/common/config-file.h b/common/config-file.h index 287d6d6812..bfec3e8465 100644 --- a/common/config-file.h +++ b/common/config-file.h @@ -30,10 +30,10 @@ class Config { public: - typedef ScummVM::String String; - typedef ScummVM::StringList StringList; - typedef ScummVM::StringMap StringMap; - typedef ScummVM::Map<String, StringMap> DomainMap; + typedef Common::String String; + typedef Common::StringList StringList; + typedef Common::StringMap StringMap; + typedef Common::Map<String, StringMap> DomainMap; Config (const String & = String("config.cfg"), const String & = String("default")); const char *get(const String &key, const String &dom = String()) const; diff --git a/common/list.h b/common/list.h index 4421981628..4b3f5a20c2 100644 --- a/common/list.h +++ b/common/list.h @@ -24,7 +24,7 @@ #include "common/scummsys.h" #include <assert.h> -namespace ScummVM { +namespace Common { template <class T> class List { @@ -126,6 +126,6 @@ protected: } }; -} // End of namespace ScummVM +} // End of namespace Common #endif diff --git a/common/map.h b/common/map.h index f970ec1209..bd3172f314 100644 --- a/common/map.h +++ b/common/map.h @@ -23,7 +23,7 @@ #include "common/scummsys.h" -namespace ScummVM { +namespace Common { template <class Key, class Value> class Map { @@ -247,6 +247,6 @@ class String; typedef Map<String, String> StringMap; -} // End of namespace ScummVM +} // End of namespace Common #endif diff --git a/common/rect.h b/common/rect.h index a4820a3722..c1f80ebf42 100644 --- a/common/rect.h +++ b/common/rect.h @@ -25,7 +25,7 @@ #include "common/scummsys.h" #include "common/util.h" -namespace ScummVM { +namespace Common { /*! @brief simple class for handling both 2D position and size @@ -108,6 +108,6 @@ struct Rect { } }; -} // End of namespace ScummVM +} // End of namespace Common #endif diff --git a/common/str.cpp b/common/str.cpp index 99b1766352..5d051de83f 100644 --- a/common/str.cpp +++ b/common/str.cpp @@ -23,7 +23,7 @@ #include <ctype.h> -namespace ScummVM { +namespace Common { String::String(const char *str, int len) { _refCount = new int(1); @@ -266,4 +266,4 @@ bool operator != (const char* y, const ConstString &x) { return x != y; } -} // End of namespace ScummVM +} // End of namespace Common diff --git a/common/str.h b/common/str.h index e134557dc7..9c3949d2e9 100644 --- a/common/str.h +++ b/common/str.h @@ -27,7 +27,7 @@ #include <assert.h> #include <string.h> -namespace ScummVM { +namespace Common { /* TODO @@ -141,6 +141,6 @@ public: } }; -} // End of namespace ScummVM +} // End of namespace Common #endif @@ -354,6 +354,7 @@ case $hosttype in Darwin) DEFINES="$DEFINES -DUNIX -DMACOSX" LIBS="$LIBS -framework QuickTime -framework AudioUnit" + #CXXFLAGS="$CXXFLAGS -faltivec" ;; esac diff --git a/gui/EditTextWidget.h b/gui/EditTextWidget.h index c81e50a29f..1b121c0a1f 100644 --- a/gui/EditTextWidget.h +++ b/gui/EditTextWidget.h @@ -27,8 +27,8 @@ /* EditTextWidget */ class EditTextWidget : public StaticTextWidget { - typedef ScummVM::StringList StringList; - typedef ScummVM::String String; + typedef Common::StringList StringList; + typedef Common::String String; protected: String _backupString; bool _caretVisible; diff --git a/gui/ListWidget.cpp b/gui/ListWidget.cpp index 50f3a724e2..2d3e9a7161 100644 --- a/gui/ListWidget.cpp +++ b/gui/ListWidget.cpp @@ -255,7 +255,7 @@ void ListWidget::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) { void ListWidget::drawWidget(bool hilite) { NewGui *gui = _boss->getGui(); int i, pos, len = _list.size(); - ScummVM::String buffer; + Common::String buffer; // Draw a thin frame around the list. gui->hLine(_x, _y, _x + _w - 1, gui->_color); @@ -296,7 +296,7 @@ void ListWidget::drawCaret(bool erase) { int16 color = erase ? gui->_textcolorhi : gui->_bgcolor; int x = _x + _boss->getX() + 3; int y = _y + _boss->getY() + 1; - ScummVM::String buffer; + Common::String buffer; y += (_selectedItem - _currentPos) * kLineHeight; diff --git a/gui/ListWidget.h b/gui/ListWidget.h index 1fc6d28807..f61ff55259 100644 --- a/gui/ListWidget.h +++ b/gui/ListWidget.h @@ -42,8 +42,8 @@ enum { /* ListWidget */ class ListWidget : public Widget, public CommandReceiver, public CommandSender { - typedef ScummVM::StringList StringList; - typedef ScummVM::String String; + typedef Common::StringList StringList; + typedef Common::String String; protected: StringList _list; bool _editable; diff --git a/gui/PopUpWidget.cpp b/gui/PopUpWidget.cpp index bdff005297..d6b5af978d 100644 --- a/gui/PopUpWidget.cpp +++ b/gui/PopUpWidget.cpp @@ -38,7 +38,7 @@ static uint32 up_down_arrows[8] = { 0x00001000, }; -const ScummVM::String PopUpWidget::emptyStr; +const Common::String PopUpWidget::emptyStr; // // PopUpDialog @@ -251,7 +251,7 @@ void PopUpDialog::drawMenuEntry(int entry, bool hilite) { int x = _x + 1; int y = _y + 1 + kLineHeight * entry; int w = _w - 2; - ScummVM::String &name = _popUpBoss->_entries[entry].name; + Common::String &name = _popUpBoss->_entries[entry].name; _gui->fillRect(x, y, w, kLineHeight, hilite ? _gui->_textcolorhi : _gui->_bgcolor); if (name.size() == 0) { diff --git a/gui/PopUpWidget.h b/gui/PopUpWidget.h index c27ce80f53..0027fe0ea6 100644 --- a/gui/PopUpWidget.h +++ b/gui/PopUpWidget.h @@ -38,13 +38,13 @@ enum { */ class PopUpWidget : public Widget, public CommandSender { friend class PopUpDialog; - typedef ScummVM::String String; + typedef Common::String String; struct Entry { String name; uint32 tag; }; - typedef ScummVM::List<Entry> EntryList; + typedef Common::List<Entry> EntryList; protected: static const String emptyStr; diff --git a/gui/about.cpp b/gui/about.cpp index 99f054b18e..e94a6b9598 100644 --- a/gui/about.cpp +++ b/gui/about.cpp @@ -28,11 +28,11 @@ AboutDialog::AboutDialog(NewGui *gui) : Dialog(gui, 10, 20, 300, 124) { addButton((_w - kButtonWidth)/2, 100, "OK", kCloseCmd, '\r'); // Close dialog - FIXME - ScummVM::String version("ScummVM "); + Common::String version("ScummVM "); version += gScummVMVersion; new StaticTextWidget(this, 10, 10, _w - 20, kLineHeight, version, kTextAlignCenter); - ScummVM::String date("(built on "); + Common::String date("(built on "); date += gScummVMBuildDate; date += ')'; new StaticTextWidget(this, 10, 20, _w - 20, kLineHeight, date, kTextAlignCenter); diff --git a/gui/browser.cpp b/gui/browser.cpp index 8eed83edf5..af935c3c0b 100644 --- a/gui/browser.cpp +++ b/gui/browser.cpp @@ -143,7 +143,7 @@ void BrowserDialog::updateListing() { assert(_nodeContent != NULL); // Populate the ListWidget - ScummVM::StringList list; + Common::StringList list; int size = _nodeContent->size(); for (int i = 0; i < size; i++) { list.push_back((*_nodeContent)[i].displayName()); diff --git a/gui/browser.h b/gui/browser.h index d7c41a9957..640570ad41 100644 --- a/gui/browser.h +++ b/gui/browser.h @@ -32,8 +32,8 @@ class FilesystemNode; class FSList; class BrowserDialog : public Dialog { - typedef ScummVM::String String; - typedef ScummVM::StringList StringList; + typedef Common::String String; + typedef Common::StringList StringList; public: BrowserDialog(NewGui *gui, const char *title); virtual ~BrowserDialog(); diff --git a/gui/chooser.h b/gui/chooser.h index e9d2df1716..81374bf3dc 100644 --- a/gui/chooser.h +++ b/gui/chooser.h @@ -33,8 +33,8 @@ class ListWidget; */ class ChooserDialog : public Dialog { - typedef ScummVM::String String; - typedef ScummVM::StringList StringList; + typedef Common::String String; + typedef Common::StringList StringList; public: ChooserDialog(NewGui *gui, const String title, const StringList &list); diff --git a/gui/dialog.cpp b/gui/dialog.cpp index 0a3c9ae0b8..0c0e4a73b7 100644 --- a/gui/dialog.cpp +++ b/gui/dialog.cpp @@ -279,11 +279,11 @@ Widget *Dialog::findWidget(int x, int y) { return w; } -ButtonWidget *Dialog::addButton(int x, int y, const ScummVM::String &label, uint32 cmd, char hotkey) { +ButtonWidget *Dialog::addButton(int x, int y, const Common::String &label, uint32 cmd, char hotkey) { return new ButtonWidget(this, x, y, kButtonWidth, 16, label, cmd, hotkey); } -PushButtonWidget *Dialog::addPushButton(int x, int y, const ScummVM::String &label, uint32 cmd, char hotkey) { +PushButtonWidget *Dialog::addPushButton(int x, int y, const Common::String &label, uint32 cmd, char hotkey) { return new PushButtonWidget(this, x, y, kButtonWidth, 16, label, cmd, hotkey); } diff --git a/gui/dialog.h b/gui/dialog.h index e3286fa475..02fd13324a 100644 --- a/gui/dialog.h +++ b/gui/dialog.h @@ -82,8 +82,8 @@ protected: Widget *findWidget(int x, int y); // Find the widget at pos x,y if any - ButtonWidget *addButton(int x, int y, const ScummVM::String &label, uint32 cmd, char hotkey); - PushButtonWidget *addPushButton(int x, int y, const ScummVM::String &label, uint32 cmd, char hotkey); + ButtonWidget *addButton(int x, int y, const Common::String &label, uint32 cmd, char hotkey); + PushButtonWidget *addPushButton(int x, int y, const Common::String &label, uint32 cmd, char hotkey); void setResult(int result) { _result = result; } }; diff --git a/gui/launcher.cpp b/gui/launcher.cpp index d231519f67..3f12bfd057 100644 --- a/gui/launcher.cpp +++ b/gui/launcher.cpp @@ -48,7 +48,7 @@ enum { kQuitCmd = 'QUIT' }; -typedef ScummVM::List<const TargetSettings *> GameList; +typedef Common::List<const TargetSettings *> GameList; /* * A dialog that allows the user to edit a config game entry. @@ -75,8 +75,8 @@ enum { }; class EditGameDialog : public Dialog { - typedef ScummVM::String String; - typedef ScummVM::StringList StringList; + typedef Common::String String; + typedef Common::StringList StringList; public: EditGameDialog(NewGui *gui, const String &domain, const TargetSettings *target); @@ -229,7 +229,7 @@ void LauncherDialog::close() { void LauncherDialog::updateListing() { int i; - ScummVM::StringList l; + Common::StringList l; // Retrieve a list of all games defined in the config file _domains.clear(); diff --git a/gui/launcher.h b/gui/launcher.h index 3c13ea442f..4aae8bd9e3 100644 --- a/gui/launcher.h +++ b/gui/launcher.h @@ -30,8 +30,8 @@ class GameDetector; class ListWidget; class LauncherDialog : public Dialog { - typedef ScummVM::String String; - typedef ScummVM::StringList StringList; + typedef Common::String String; + typedef Common::StringList StringList; public: LauncherDialog(NewGui *gui, GameDetector &detector); ~LauncherDialog(); diff --git a/gui/message.h b/gui/message.h index 63cca41c80..69f630a538 100644 --- a/gui/message.h +++ b/gui/message.h @@ -26,8 +26,8 @@ #include "common/list.h" class MessageDialog : public Dialog { - typedef ScummVM::String String; - typedef ScummVM::StringList StringList; + typedef Common::String String; + typedef Common::StringList StringList; public: MessageDialog(NewGui *gui, const String &message, uint32 timer = 0, bool showOKButton = true, bool showCancelButton = false); diff --git a/gui/newgui.h b/gui/newgui.h index 1f1012061f..b610825b3d 100644 --- a/gui/newgui.h +++ b/gui/newgui.h @@ -62,7 +62,7 @@ public: // This class hopefully will replace the old Gui class completly one day class NewGui { friend class Dialog; - typedef ScummVM::String String; + typedef Common::String String; public: // Main entry for the GUI: this will start an event loop that keeps running diff --git a/gui/options.h b/gui/options.h index 4ff51bb266..db25eee8a8 100644 --- a/gui/options.h +++ b/gui/options.h @@ -30,7 +30,7 @@ class GameDetector; class PopUpWidget; class GlobalOptionsDialog : public Dialog { - typedef ScummVM::String String; + typedef Common::String String; public: GlobalOptionsDialog(NewGui *gui, GameDetector &detector); ~GlobalOptionsDialog(); diff --git a/gui/widget.h b/gui/widget.h index e1c77b959f..f6954fe569 100644 --- a/gui/widget.h +++ b/gui/widget.h @@ -134,7 +134,7 @@ protected: /* StaticTextWidget */ class StaticTextWidget : public Widget { protected: - typedef ScummVM::String String; + typedef Common::String String; String _label; int _align; diff --git a/scumm/actor.cpp b/scumm/actor.cpp index 0c7b4e5d94..e8b82103de 100644 --- a/scumm/actor.cpp +++ b/scumm/actor.cpp @@ -158,8 +158,8 @@ int Scumm::getAngleFromPos(int x, int y) const { } } -int Actor::calcMovementFactor(ScummVM::Point next) { - ScummVM::Point actorPos(_pos); +int Actor::calcMovementFactor(Common::Point next) { + Common::Point actorPos(_pos); int diffX, diffY; int32 deltaXFactor, deltaYFactor; @@ -341,7 +341,7 @@ void Actor::setBox(int box) { int Actor::actorWalkStep() { int tmpX, tmpY; - ScummVM::Point actorPos; + Common::Point actorPos; int distX, distY; int nextFacing; @@ -1334,7 +1334,7 @@ void Actor::startWalkAnim(int cmd, int angle) { void Actor::walkActor() { int new_dir, next_box; - ScummVM::Point foundPath; + Common::Point foundPath; if (_vm->_version >= 7) { // FIXME - this is kind of a hack right now but it fixes the @@ -1414,7 +1414,7 @@ void Actor::walkActor() { /* void Actor::walkActorV12() { - ScummVM::Point foundPath, tmp; + Common::Point foundPath, tmp; int new_dir, next_box; if (moving & MF_TURN) { @@ -1465,7 +1465,7 @@ void Actor::walkActorV12() { */ void Actor::walkActorOld() { - ScummVM::Point p2, p3; // Gate locations + Common::Point p2, p3; // Gate locations int new_dir, next_box; if (!moving) diff --git a/scumm/actor.h b/scumm/actor.h index 83a2ec2b31..23e1cf862b 100644 --- a/scumm/actor.h +++ b/scumm/actor.h @@ -37,13 +37,13 @@ enum MoveFlags { }; struct ActorWalkData { - ScummVM::Point dest; // Final destination + Common::Point dest; // Final destination byte destbox; int16 destdir; - ScummVM::Point cur; // Current position + Common::Point cur; // Current position byte curbox; - ScummVM::Point next; // Next position on our way to the destination - ScummVM::Point point3; + Common::Point next; // Next position on our way to the destination + Common::Point point3; int32 deltaXFactor, deltaYFactor; uint16 xfrac, yfrac; }; @@ -82,7 +82,7 @@ public: static void initActorClass(Scumm *scumm); public: - ScummVM::Point _pos; + Common::Point _pos; int top, bottom; int elevation; uint width; @@ -133,7 +133,7 @@ public: void putActor(int x, int y, byte room); void setActorWalkSpeed(uint newSpeedX, uint newSpeedY); protected: - int calcMovementFactor(ScummVM::Point next); + int calcMovementFactor(Common::Point next); int actorWalkStep(); int remapDirection(int dir, bool is_walking); void setupActorScale(); @@ -204,8 +204,8 @@ protected: bool isPlayer(); - bool findPathTowards(byte box, byte box2, byte box3, ScummVM::Point &foundPath); - void findPathTowardsOld(byte box, byte box2, byte box3, ScummVM::Point &p2, ScummVM::Point &p3); + bool findPathTowards(byte box, byte box2, byte box3, Common::Point &foundPath); + void findPathTowardsOld(byte box, byte box2, byte box3, Common::Point &p2, Common::Point &p3); }; #endif diff --git a/scumm/boxes.cpp b/scumm/boxes.cpp index 6d0222ccf4..b4b50613d8 100644 --- a/scumm/boxes.cpp +++ b/scumm/boxes.cpp @@ -77,7 +77,7 @@ struct Box { /* Internal walkbox file format */ static bool compareSlope(int X1, int Y1, int X2, int Y2, int X3, int Y3); -static ScummVM::Point closestPtOnLine(int ulx, int uly, int llx, int lly, int x, int y); +static Common::Point closestPtOnLine(int ulx, int uly, int llx, int lly, int x, int y); byte Scumm::getMaskFromBox(int box) { @@ -434,7 +434,7 @@ bool Scumm::checkXYInBoxBounds(int b, int x, int y) { if (box.ul.x == box.ur.x && box.ul.y == box.ur.y && box.lr.x == box.ll.x && box.lr.y == box.ll.y || box.ul.x == box.ll.x && box.ul.y == box.ll.y && box.ur.x == box.lr.x && box.ur.y == box.lr.y) { - ScummVM::Point pt; + Common::Point pt; pt = closestPtOnLine(box.ul.x, box.ul.y, box.lr.x, box.lr.y, x, y); if (distanceFromPt(x, y, pt.x, pt.y) <= 4) return true; @@ -536,11 +536,11 @@ bool compareSlope(int X1, int Y1, int X2, int Y2, int X3, int Y3) { return (Y2 - Y1) * (X3 - X1) <= (Y3 - Y1) * (X2 - X1); } -ScummVM::Point closestPtOnLine(int ulx, int uly, int llx, int lly, int x, int y) { +Common::Point closestPtOnLine(int ulx, int uly, int llx, int lly, int x, int y) { int lydiff, lxdiff; int32 dist, a, b, c; int x2, y2; - ScummVM::Point pt; + Common::Point pt; if (llx == ulx) { // Vertical line? x2 = ulx; @@ -641,7 +641,7 @@ bool Scumm::inBoxQuickReject(int b, int x, int y, int threshold) { } int Scumm::getClosestPtOnBox(int b, int x, int y, int16& outX, int16& outY) { - ScummVM::Point pt; + Common::Point pt; uint dist; uint bestdist = 0xFFFFFF; BoxCoords box; @@ -769,10 +769,10 @@ int Scumm::getPathToDestBox(byte from, byte to) { * Computes the next point actor a has to walk towards in a straight * line in order to get from box1 to box3 via box2. */ -bool Actor::findPathTowards(byte box1nr, byte box2nr, byte box3nr, ScummVM::Point &foundPath) { +bool Actor::findPathTowards(byte box1nr, byte box2nr, byte box3nr, Common::Point &foundPath) { BoxCoords box1; BoxCoords box2; - ScummVM::Point tmp; + Common::Point tmp; int i, j; int flag; int q, pos; @@ -1142,10 +1142,10 @@ bool Scumm::areBoxesNeighbours(int box1nr, int box2nr) { return result; } -void Actor::findPathTowardsOld(byte trap1, byte trap2, byte final_trap, ScummVM::Point &p2, ScummVM::Point &p3) { - ScummVM::Point pt; - ScummVM::Point gateA[2]; - ScummVM::Point gateB[2]; +void Actor::findPathTowardsOld(byte trap1, byte trap2, byte final_trap, Common::Point &p2, Common::Point &p3) { + Common::Point pt; + Common::Point gateA[2]; + Common::Point gateB[2]; _vm->getGates(trap1, trap2, gateA, gateB); @@ -1183,15 +1183,15 @@ void Actor::findPathTowardsOld(byte trap1, byte trap2, byte final_trap, ScummVM: * This way the lines bound a 'corridor' between the two boxes, through which * the actor has to walk to get from trap1 to trap2. */ -void Scumm::getGates(int trap1, int trap2, ScummVM::Point gateA[2], ScummVM::Point gateB[2]) { +void Scumm::getGates(int trap1, int trap2, Common::Point gateA[2], Common::Point gateB[2]) { int i, j; int dist[8]; int minDist[3]; int closest[3]; int box[3]; BoxCoords coords; - ScummVM::Point closestPoint[8]; - ScummVM::Point boxCorner[8]; + Common::Point closestPoint[8]; + Common::Point boxCorner[8]; int line1, line2; // For all corner coordinates of the first box, compute the point closest diff --git a/scumm/boxes.h b/scumm/boxes.h index 583c3cc889..e0ab671d5c 100644 --- a/scumm/boxes.h +++ b/scumm/boxes.h @@ -39,10 +39,10 @@ typedef enum { } BoxFlags; struct BoxCoords { /* Box coordinates */ - ScummVM::Point ul; - ScummVM::Point ur; - ScummVM::Point ll; - ScummVM::Point lr; + Common::Point ul; + Common::Point ur; + Common::Point ll; + Common::Point lr; }; #endif diff --git a/scumm/camera.cpp b/scumm/camera.cpp index 46633343ba..ffa5a20389 100644 --- a/scumm/camera.cpp +++ b/scumm/camera.cpp @@ -60,7 +60,7 @@ void Scumm::setCameraAt(int pos_x, int pos_y) { } void Scumm_v7::setCameraAt(int pos_x, int pos_y) { - ScummVM::Point old; + Common::Point old; old = camera._cur; @@ -133,7 +133,7 @@ void Scumm_v7::setCameraFollows(Actor *a) { } -void Scumm::clampCameraPos(ScummVM::Point *pt) { +void Scumm::clampCameraPos(Common::Point *pt) { if (pt->x < VAR(VAR_CAMERA_MIN_X)) pt->x = (short) VAR(VAR_CAMERA_MIN_X); @@ -226,7 +226,7 @@ void Scumm::moveCamera() { } void Scumm_v7::moveCamera() { - ScummVM::Point old = camera._cur; + Common::Point old = camera._cur; Actor *a = NULL; if (camera._follows) { diff --git a/scumm/charset.h b/scumm/charset.h index e464ede692..dd0375c01c 100644 --- a/scumm/charset.h +++ b/scumm/charset.h @@ -30,7 +30,7 @@ struct VirtScreen; class CharsetRenderer { public: - ScummVM::Rect _str; + Common::Rect _str; int _nextLeft, _nextTop; int _top; diff --git a/scumm/dialogs.cpp b/scumm/dialogs.cpp index edfa8f5d41..63866b06df 100644 --- a/scumm/dialogs.cpp +++ b/scumm/dialogs.cpp @@ -170,7 +170,7 @@ void ScummDialog::addResText(int x, int y, int w, int h, int resID) { } -const ScummVM::String ScummDialog::queryResString(int stringno) { +const Common::String ScummDialog::queryResString(int stringno) { byte *result; if (stringno == 0) @@ -352,7 +352,7 @@ void SaveLoadDialog::close() { void SaveLoadDialog::fillList() { // Get savegame names - ScummVM::StringList l; + Common::StringList l; char name[32]; uint i = _saveMode ? 1 : 0; bool avail_saves[81]; @@ -715,7 +715,7 @@ KeysDialog::KeysDialog(NewGui *gui, Scumm *scumm) _keyMapping->setFlags(WIDGET_CLEARBG); // Get actions names - ScummVM::StringList l; + Common::StringList l; for (int i = 1; i < TOTAL_ACTIONS; i++) l.push_back(getActionName(i)); diff --git a/scumm/dialogs.h b/scumm/dialogs.h index d0abd0c404..eb0e2eb14a 100644 --- a/scumm/dialogs.h +++ b/scumm/dialogs.h @@ -38,7 +38,7 @@ public: : Dialog(gui, x, y, w, h), _scumm(scumm) {} protected: - typedef ScummVM::String String; + typedef Common::String String; Scumm *_scumm; @@ -88,7 +88,7 @@ public: virtual void handleCommand(CommandSender *sender, uint32 cmd, uint32 data); protected: - typedef ScummVM::String String; + typedef Common::String String; PushButtonWidget *_nextButton; PushButtonWidget *_prevButton; diff --git a/scumm/gfx.cpp b/scumm/gfx.cpp index 32259e37d3..c0f8452e49 100644 --- a/scumm/gfx.cpp +++ b/scumm/gfx.cpp @@ -802,7 +802,7 @@ void Scumm::restoreCharsetBg() { _charset->_nextTop = _string[0].ypos; } -void Scumm::restoreBG(ScummVM::Rect rect, byte backColor) { +void Scumm::restoreBG(Common::Rect rect, byte backColor) { VirtScreen *vs; int topline, height, width; byte *backbuff, *bgbak; @@ -873,7 +873,7 @@ void Scumm::restoreBG(ScummVM::Rect rect, byte backColor) { } bool Scumm::hasCharsetMask(int left, int top, int right, int bottom) { - ScummVM::Rect rect(left, top, right, bottom); + Common::Rect rect(left, top, right, bottom); return _charset->_hasMask && rect.intersects(gdi._mask); } diff --git a/scumm/gfx.h b/scumm/gfx.h index a5ae063acf..ebc40fde90 100644 --- a/scumm/gfx.h +++ b/scumm/gfx.h @@ -34,10 +34,10 @@ enum { /** Camera modes */ }; struct CameraData { /** Camera state data */ - ScummVM::Point _cur; - ScummVM::Point _dest; - ScummVM::Point _accel; - ScummVM::Point _last; + Common::Point _cur; + Common::Point _dest; + Common::Point _accel; + Common::Point _last; int _leftTrigger, _rightTrigger; byte _follows, _mode; bool _movingToActor; @@ -114,7 +114,7 @@ public: int _numZBuffer; int _imgBufOffs[8]; int32 _numStrips; - ScummVM::Rect _mask; + Common::Rect _mask; byte _C64Colors[4]; protected: diff --git a/scumm/help.h b/scumm/help.h index 37836580ca..72d658fc01 100644 --- a/scumm/help.h +++ b/scumm/help.h @@ -26,7 +26,7 @@ class ScummHelp { protected: - typedef ScummVM::String String; + typedef Common::String String; public: static int numPages(byte gameId); diff --git a/scumm/script_v2.cpp b/scumm/script_v2.cpp index 6b688bfdf9..34e08be9bc 100644 --- a/scumm/script_v2.cpp +++ b/scumm/script_v2.cpp @@ -971,7 +971,7 @@ void Scumm_v2::o2_doSentence() { } void Scumm_v2::o2_drawSentence() { - ScummVM::Rect sentenceline; + Common::Rect sentenceline; static char sentence[256]; const byte *temp; int slot = getVerbSlot(VAR(VAR_SENTENCE_VERB),0); @@ -1537,7 +1537,7 @@ void Scumm_v2::setUserState(byte state) { } // Hide all verbs and inventory - ScummVM::Rect rect; + Common::Rect rect; rect.top = virtscr[2].topline; rect.bottom = virtscr[2].topline + 8*88; rect.left = 0; diff --git a/scumm/script_v5.cpp b/scumm/script_v5.cpp index a9634a48a5..abe0111fd8 100644 --- a/scumm/script_v5.cpp +++ b/scumm/script_v5.cpp @@ -2861,7 +2861,7 @@ printf("o5_oldRoomEffect ODDBALL: _opcode = 0x%x, a = 0x%x\n", _opcode, a); // For now, we force a redraw of the screen background. This // Makes the Zak end credits work more or less correctly. VirtScreen *vs = &virtscr[0]; - restoreBG(ScummVM::Rect(0,vs->topline, vs->width, vs->topline + vs->height)); + restoreBG(Common::Rect(0,vs->topline, vs->width, vs->topline + vs->height)); virtscr[0].setDirtyRange(0, virtscr[0].height); updateDirtyScreen(0); diff --git a/scumm/scumm.h b/scumm/scumm.h index fbc2346c94..47d91fd9ed 100644 --- a/scumm/scumm.h +++ b/scumm/scumm.h @@ -54,7 +54,7 @@ struct Box; struct BoxCoords; struct FindObjectInRoom; -typedef ScummVM::Map<ScummVM::String, int> ObjectIDMap; +typedef Common::Map<Common::String, int> ObjectIDMap; // Use g_scumm from error() ONLY extern Scumm *g_scumm; @@ -115,7 +115,7 @@ struct ObjectData; struct BlastText { int16 xpos, ypos; - ScummVM::Rect rect; + Common::Rect rect; byte color; byte charset; bool center; @@ -123,7 +123,7 @@ struct BlastText { }; struct V2MouseoverBox { - ScummVM::Rect rect; + Common::Rect rect; byte color; byte hicolor; }; @@ -431,8 +431,8 @@ protected: int _keyPressed; uint16 _lastKeyHit; - ScummVM::Point _mouse; - ScummVM::Point _virtualMouse; + Common::Point _mouse; + Common::Point _virtualMouse; uint16 _mouseButStat; byte _leftBtnPressed, _rightBtnPressed; @@ -720,7 +720,7 @@ protected: int8 v2_mouseover_box; void initV2MouseOver(); - void checkV2MouseOver(ScummVM::Point pos); + void checkV2MouseOver(Common::Point pos); void checkV2Inventory(int x, int y); void redrawV2Inventory(); @@ -819,7 +819,7 @@ protected: void drawRoomObject(int i, int arg); void drawBox(int x, int y, int x2, int y2, int color); - void restoreBG(ScummVM::Rect rect, byte backColor = 0); + void restoreBG(Common::Rect rect, byte backColor = 0); void redrawBGStrip(int start, int num); void redrawBGAreas(); @@ -829,7 +829,7 @@ protected: virtual void setCameraFollows(Actor *a); virtual void moveCamera(); virtual void panCameraTo(int x, int y); - void clampCameraPos(ScummVM::Point *pt); + void clampCameraPos(Common::Point *pt); void actorFollowCamera(int act); const byte *getPalettePtr(); @@ -981,7 +981,7 @@ public: byte getNumBoxes(); byte *getBoxMatrixBaseAddr(); int getPathToDestBox(byte from, byte to); - void getGates(int trap1, int trap2, ScummVM::Point gateA[2], ScummVM::Point gateB[2]); + void getGates(int trap1, int trap2, Common::Point gateA[2], Common::Point gateB[2]); bool inBoxQuickReject(int box, int x, int y, int threshold); int getClosestPtOnBox(int box, int x, int y, int16& outX, int16& outY); int getSpecialBox(int param1, int param2); diff --git a/scumm/smush/chunk.cpp b/scumm/smush/chunk.cpp index d55629ef56..39cde19048 100644 --- a/scumm/smush/chunk.cpp +++ b/scumm/smush/chunk.cpp @@ -27,7 +27,7 @@ #include "common/util.h" class FilePtr : public File { - ScummVM::String _filename; + Common::String _filename; int32 _refcount; public: FilePtr(const char *fname, const char *directory) : diff --git a/scumm/verbs.cpp b/scumm/verbs.cpp index 13a4e1c014..992b3e5817 100644 --- a/scumm/verbs.cpp +++ b/scumm/verbs.cpp @@ -99,9 +99,9 @@ void Scumm::initV2MouseOver() { v2_mouseover_boxes[kSentenceLine].hicolor = hi_color; } -void Scumm::checkV2MouseOver(ScummVM::Point pos) { +void Scumm::checkV2MouseOver(Common::Point pos) { VirtScreen *vs = &virtscr[2]; - ScummVM::Rect rect; + Common::Rect rect; byte *ptr, *dst; int i, x, y, new_box = -1; @@ -197,7 +197,7 @@ void Scumm::checkV2Inventory(int x, int y) { void Scumm::redrawV2Inventory() { int i; int max_inv; - ScummVM::Rect inventoryBox; + Common::Rect inventoryBox; v2_mouseover_box = -1; diff --git a/scumm/verbs.h b/scumm/verbs.h index fd4decb82d..1cbaa2d459 100644 --- a/scumm/verbs.h +++ b/scumm/verbs.h @@ -32,7 +32,7 @@ enum { struct VerbSlot { int16 x, y; int16 right, bottom; - ScummVM::Rect old; + Common::Rect old; uint16 verbid; uint8 color, hicolor, dimcolor, bkcolor, type; uint8 charset_nr, curmode; diff --git a/sword2/controls.cpp b/sword2/controls.cpp index 5f704f7be0..f681f019b7 100644 --- a/sword2/controls.cpp +++ b/sword2/controls.cpp @@ -179,7 +179,7 @@ protected: int _numStates; int _state; - ScummVM::Rect _hitRect; + Common::Rect _hitRect; public: Sword2Widget(Sword2Dialog *parent, int states) : @@ -234,7 +234,7 @@ public: return _state; } - virtual void paint(ScummVM::Rect *clipRect = NULL) { + virtual void paint(Common::Rect *clipRect = NULL) { DrawSurface(&_sprites[_state], _surfaces[_state]._surface, clipRect); } @@ -574,7 +574,7 @@ public: createSurfaceImages(3406, x, y); } - virtual void paint(ScummVM::Rect *clipRect = NULL) { + virtual void paint(Common::Rect *clipRect = NULL) { // This will redraw a bit more than is strictly necessary, // but I doubt that will make any noticeable difference. @@ -948,7 +948,7 @@ public: return &_text[0]; } - virtual void paint(ScummVM::Rect *clipRect = NULL) { + virtual void paint(Common::Rect *clipRect = NULL) { Sword2Widget::paint(); // HACK: The main dialog is responsible for drawing the text diff --git a/sword2/driver/d_draw.cpp b/sword2/driver/d_draw.cpp index 6821df34bd..3fa0d9193c 100644 --- a/sword2/driver/d_draw.cpp +++ b/sword2/driver/d_draw.cpp @@ -305,7 +305,7 @@ int32 PlaySmacker(char *filename, _movieTextObject *text[], uint8 *musicOut) { SetNeedRedraw(); // HACK: Remove the instructions created above - ScummVM::Rect r; + Common::Rect r; memset(lpBackBuffer, 0, screenWide * MENUDEEP); r.left = r.top = 0; diff --git a/sword2/driver/driver96.h b/sword2/driver/driver96.h index e226291dcf..fd00dc267d 100644 --- a/sword2/driver/driver96.h +++ b/sword2/driver/driver96.h @@ -377,7 +377,7 @@ extern int32 ReadKey(_keyboardEvent *ke); //----------------------------------------------------------------------------- extern int32 DrawSprite(_spriteInfo *s); extern int32 CreateSurface(_spriteInfo *s, uint8 **surface); -extern void DrawSurface(_spriteInfo *s, uint8 *surface, ScummVM::Rect *clipRect = NULL); +extern void DrawSurface(_spriteInfo *s, uint8 *surface, Common::Rect *clipRect = NULL); extern void DeleteSurface(uint8 *surface); extern int32 OpenLightMask(_spriteInfo *s); extern int32 CloseLightMask(void); diff --git a/sword2/driver/menu.cpp b/sword2/driver/menu.cpp index f0783eac6a..8495e7cfb7 100644 --- a/sword2/driver/menu.cpp +++ b/sword2/driver/menu.cpp @@ -43,7 +43,7 @@ static uint8 pocketStatus[2][RDMENU_MAXPOCKETS] = { static uint8 iconCount = 0; -void ClearIconArea(int menu, int pocket, ScummVM::Rect *r) { +void ClearIconArea(int menu, int pocket, Common::Rect *r) { byte *dst; int i; @@ -74,7 +74,7 @@ int32 ProcessMenu(void) { uint8 frameCount; int32 curx, xoff; int32 cury, yoff; - ScummVM::Rect r1, r2; + Common::Rect r1, r2; int32 delta; static int32 lastTime = 0; @@ -254,7 +254,7 @@ int32 HideMenu(uint8 menu) { */ int32 CloseMenuImmediately(void) { - ScummVM::Rect r; + Common::Rect r; int i; menuStatus[0] = RDMENU_HIDDEN; @@ -284,7 +284,7 @@ int32 CloseMenuImmediately(void) { */ int32 SetMenuIcon(uint8 menu, uint8 pocket, uint8 *icon) { - ScummVM::Rect r; + Common::Rect r; debug(5, "stub SetMenuIcon( %d, %d )", menu, pocket); diff --git a/sword2/driver/render.cpp b/sword2/driver/render.cpp index 787dc2914a..17acf5735e 100644 --- a/sword2/driver/render.cpp +++ b/sword2/driver/render.cpp @@ -74,12 +74,12 @@ typedef struct { BlockSurface **blockSurfaces[MAXLAYERS] = { 0, 0, 0, 0, 0 }; -void UploadRect(ScummVM::Rect *r) { +void UploadRect(Common::Rect *r) { g_system->copy_rect(lpBackBuffer + r->top * screenWide + r->left, screenWide, r->left, r->top, r->right - r->left, r->bottom - r->top); } -void BlitBlockSurface(BlockSurface *s, ScummVM::Rect *r, ScummVM::Rect *clip_rect) { +void BlitBlockSurface(BlockSurface *s, Common::Rect *r, Common::Rect *clip_rect) { if (r->top > clip_rect->bottom || r->left > clip_rect->right || r->bottom <= clip_rect->top || r->right <= clip_rect->left) return; @@ -703,7 +703,7 @@ int32 SetLocationMetrics(uint16 w, uint16 h) { int32 RenderParallax(_parallax *p, int16 l) { int16 x, y; - ScummVM::Rect r; + Common::Rect r; if (locationWide == screenWide) x = 0; @@ -715,7 +715,7 @@ int32 RenderParallax(_parallax *p, int16 l) { else y = ((int32) ((p->h - (screenDeep - MENUDEEP * 2)) * scrolly) / (int32) (locationDeep - (screenDeep - MENUDEEP * 2))); - ScummVM::Rect clip_rect; + Common::Rect clip_rect; // Leave enough space for the top and bottom menues diff --git a/sword2/driver/render.h b/sword2/driver/render.h index 5a0112159d..34dc8eae58 100644 --- a/sword2/driver/render.h +++ b/sword2/driver/render.h @@ -56,6 +56,6 @@ extern int16 locationDeep; void SquashImage(byte *dst, uint16 dstPitch, uint16 dstWidth, uint16 dstHeight, byte *src, uint16 srcPitch, uint16 srcWidth, uint16 srcHeight, byte *backbuf); void StretchImage(byte *dst, uint16 dstPitch, uint16 dstWidth, uint16 dstHeight, byte *src, uint16 srcPitch, uint16 srcWidth, uint16 srcHeight, byte *backbuf); -void UploadRect(ScummVM::Rect *r); +void UploadRect(Common::Rect *r); #endif diff --git a/sword2/driver/sprite.cpp b/sword2/driver/sprite.cpp index 64189ca167..cb2a6a38b1 100644 --- a/sword2/driver/sprite.cpp +++ b/sword2/driver/sprite.cpp @@ -295,8 +295,8 @@ int32 CreateSurface(_spriteInfo *s, uint8 **sprite) { * @param clipRect the clipping rectangle */ -void DrawSurface(_spriteInfo *s, uint8 *surface, ScummVM::Rect *clipRect) { - ScummVM::Rect rd, rs; +void DrawSurface(_spriteInfo *s, uint8 *surface, Common::Rect *clipRect) { + Common::Rect rd, rs; uint16 x, y, srcPitch; uint8 *src, *dst; @@ -398,7 +398,7 @@ int32 DrawSprite(_spriteInfo *s) { uint16 srcPitch; bool freeSprite = false; bool clipped = false; - ScummVM::Rect rd, rs; + Common::Rect rd, rs; // ----------------------------------------------------------------- // Decompression and mirroring |