aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2016-03-21 20:53:49 -0400
committerPaul Gilbert2016-03-21 20:53:49 -0400
commit217360d0c5a0b8289c16b22fc46782c475fcc9f5 (patch)
tree5fef119ff142d15d2bd91e99dfc9700f86ac38ed /engines
parent9a66bc2e9e3638af940053ac58df36b489b3e345 (diff)
downloadscummvm-rg350-217360d0c5a0b8289c16b22fc46782c475fcc9f5.tar.gz
scummvm-rg350-217360d0c5a0b8289c16b22fc46782c475fcc9f5.tar.bz2
scummvm-rg350-217360d0c5a0b8289c16b22fc46782c475fcc9f5.zip
TITANIC: Add new derived Rect and Point classes
Diffstat (limited to 'engines')
-rw-r--r--engines/titanic/carry/brain.h2
-rw-r--r--engines/titanic/carry/bridge_piece.h2
-rw-r--r--engines/titanic/carry/carry.h4
-rw-r--r--engines/titanic/core/drop_target.h2
-rw-r--r--engines/titanic/core/game_object.cpp4
-rw-r--r--engines/titanic/core/game_object.h6
-rw-r--r--engines/titanic/core/link_item.h2
-rw-r--r--engines/titanic/core/room_item.h4
-rw-r--r--engines/titanic/core/tree_item.h2
-rw-r--r--engines/titanic/direct_draw_surface.cpp14
-rw-r--r--engines/titanic/direct_draw_surface.h9
-rw-r--r--engines/titanic/events.cpp2
-rw-r--r--engines/titanic/game/cdrom.h2
-rw-r--r--engines/titanic/game/end_game_credits.h2
-rw-r--r--engines/titanic/game/placeholder/lemon_on_bar.h2
-rw-r--r--engines/titanic/game/placeholder/tv_on_bar.h2
-rw-r--r--engines/titanic/game/sauce_dispensor.h4
-rw-r--r--engines/titanic/game/ship_setting.h2
-rw-r--r--engines/titanic/game/transport/lift_indicator.h2
-rw-r--r--engines/titanic/game_manager.cpp6
-rw-r--r--engines/titanic/game_manager.h2
-rw-r--r--engines/titanic/game_state.cpp8
-rw-r--r--engines/titanic/game_state.h6
-rw-r--r--engines/titanic/game_view.cpp8
-rw-r--r--engines/titanic/game_view.h9
-rw-r--r--engines/titanic/gfx/move_object_button.h2
-rw-r--r--engines/titanic/gfx/slider_button.h2
-rw-r--r--engines/titanic/gfx/toggle_switch.h2
-rw-r--r--engines/titanic/input_handler.cpp4
-rw-r--r--engines/titanic/input_handler.h8
-rw-r--r--engines/titanic/input_translator.cpp20
-rw-r--r--engines/titanic/input_translator.h20
-rw-r--r--engines/titanic/main_game_window.cpp12
-rw-r--r--engines/titanic/main_game_window.h10
-rw-r--r--engines/titanic/messages/mouse_messages.h24
-rw-r--r--engines/titanic/module.mk2
-rw-r--r--engines/titanic/movie.cpp28
-rw-r--r--engines/titanic/movie.h36
-rw-r--r--engines/titanic/npcs/mobile.h2
-rw-r--r--engines/titanic/pet_control/pet_val.cpp2
-rw-r--r--engines/titanic/pet_control/pet_val.h2
-rw-r--r--engines/titanic/pet_control/pet_val_base.cpp4
-rw-r--r--engines/titanic/pet_control/pet_val_base.h2
-rw-r--r--engines/titanic/rect.cpp27
-rw-r--r--engines/titanic/rect.h43
-rw-r--r--engines/titanic/screen_manager.cpp4
-rw-r--r--engines/titanic/screen_manager.h8
-rw-r--r--engines/titanic/simple_file.cpp16
-rw-r--r--engines/titanic/simple_file.h10
-rw-r--r--engines/titanic/text_cursor.cpp5
-rw-r--r--engines/titanic/text_cursor.h3
-rw-r--r--engines/titanic/video_surface.cpp8
-rw-r--r--engines/titanic/video_surface.h7
53 files changed, 284 insertions, 137 deletions
diff --git a/engines/titanic/carry/brain.h b/engines/titanic/carry/brain.h
index 8cfd491cea..14f9b632a0 100644
--- a/engines/titanic/carry/brain.h
+++ b/engines/titanic/carry/brain.h
@@ -29,7 +29,7 @@ namespace Titanic {
class CBrain : public CCarry {
private:
- Common::Point _pos1;
+ Point _pos1;
int _field134;
int _field138;
public:
diff --git a/engines/titanic/carry/bridge_piece.h b/engines/titanic/carry/bridge_piece.h
index b96015a2a9..a641eb4574 100644
--- a/engines/titanic/carry/bridge_piece.h
+++ b/engines/titanic/carry/bridge_piece.h
@@ -30,7 +30,7 @@ namespace Titanic {
class CBridgePiece : public CCarry {
private:
CString _string6;
- Common::Point _pos3;
+ Point _pos3;
int _field140;
public:
CLASSDEF
diff --git a/engines/titanic/carry/carry.h b/engines/titanic/carry/carry.h
index 6b3ae2323e..309b8a8eb8 100644
--- a/engines/titanic/carry/carry.h
+++ b/engines/titanic/carry/carry.h
@@ -30,13 +30,13 @@ namespace Titanic {
class CCarry : public CGameObject {
private:
CString _string1;
- Common::Point _pos1;
+ Point _pos1;
CString _string2;
int _fieldDC;
int _fieldE0;
CString _string3;
CString _string4;
- Common::Point _pos2;
+ Point _pos2;
int _field100;
int _field104;
int _field108;
diff --git a/engines/titanic/core/drop_target.h b/engines/titanic/core/drop_target.h
index 22cb057bb7..6c1cdcfe38 100644
--- a/engines/titanic/core/drop_target.h
+++ b/engines/titanic/core/drop_target.h
@@ -29,7 +29,7 @@ namespace Titanic {
class CDropTarget : public CGameObject {
private:
- Common::Point _pos1;
+ Point _pos1;
int _fieldC4;
CString _string1;
int _fieldD4;
diff --git a/engines/titanic/core/game_object.cpp b/engines/titanic/core/game_object.cpp
index 884873ec0e..06f2ce78af 100644
--- a/engines/titanic/core/game_object.cpp
+++ b/engines/titanic/core/game_object.cpp
@@ -26,7 +26,7 @@
namespace Titanic {
CGameObject::CGameObject(): CNamedItem() {
- _bounds = Common::Rect(0, 0, 15, 15);
+ _bounds = Rect(0, 0, 15, 15);
_field34 = 0;
_field38 = 0;
_field3C = 0;
@@ -122,7 +122,7 @@ void CGameObject::fn2() {
error("TODO");
}
-bool CGameObject::checkPoint(const Common::Point &pt, int v0, int v1) {
+bool CGameObject::checkPoint(const Point &pt, int v0, int v1) {
warning("TODO: CGameObject::checkPoint");
return false;
}
diff --git a/engines/titanic/core/game_object.h b/engines/titanic/core/game_object.h
index 693f334608..809f7b8d20 100644
--- a/engines/titanic/core/game_object.h
+++ b/engines/titanic/core/game_object.h
@@ -23,7 +23,7 @@
#ifndef TITANIC_GAME_OBJECT_H
#define TITANIC_GAME_OBJECT_H
-#include "common/rect.h"
+#include "titanic/rect.h"
#include "titanic/core/movie_clip.h"
#include "titanic/core/named_item.h"
@@ -31,7 +31,7 @@ namespace Titanic {
class CGameObject : public CNamedItem {
protected:
- Common::Rect _bounds;
+ Rect _bounds;
double _field34;
double _field38;
double _field3C;
@@ -75,7 +75,7 @@ public:
void fn2();
- bool checkPoint(const Common::Point &pt, int v0, int v1);
+ bool checkPoint(const Point &pt, int v0, int v1);
};
} // End of namespace Titanic
diff --git a/engines/titanic/core/link_item.h b/engines/titanic/core/link_item.h
index 733a4c9bdd..bbeef2c11c 100644
--- a/engines/titanic/core/link_item.h
+++ b/engines/titanic/core/link_item.h
@@ -46,7 +46,7 @@ protected:
int _field30;
int _field34;
public:
- Common::Rect _bounds;
+ Rect _bounds;
public:
CLASSDEF
CLinkItem();
diff --git a/engines/titanic/core/room_item.h b/engines/titanic/core/room_item.h
index a42ffab32e..7248b4aac3 100644
--- a/engines/titanic/core/room_item.h
+++ b/engines/titanic/core/room_item.h
@@ -23,7 +23,7 @@
#ifndef TITANIC_ROOM_ITEM_H
#define TITANIC_ROOM_ITEM_H
-#include "common/rect.h"
+#include "titanic/rect.h"
#include "titanic/core/list.h"
#include "titanic/core/movie_clip.h"
#include "titanic/core/named_item.h"
@@ -33,7 +33,7 @@ namespace Titanic {
class CRoomItem : public CNamedItem {
public:
- Common::Rect _roomRect;
+ Rect _roomRect;
CMovieClipList _clipList;
int _roomNumber;
CResourceKey _transitionMovieKey;
diff --git a/engines/titanic/core/tree_item.h b/engines/titanic/core/tree_item.h
index a4156d6ad1..5669784cd7 100644
--- a/engines/titanic/core/tree_item.h
+++ b/engines/titanic/core/tree_item.h
@@ -122,7 +122,7 @@ public:
/**
* Gets the bounds occupied by the item
*/
- virtual Common::Rect getBounds() { return Common::Rect(); }
+ virtual Rect getBounds() { return Rect(); }
/**
* Called when the view changes
diff --git a/engines/titanic/direct_draw_surface.cpp b/engines/titanic/direct_draw_surface.cpp
index cf7639cf1b..4e7311a6a7 100644
--- a/engines/titanic/direct_draw_surface.cpp
+++ b/engines/titanic/direct_draw_surface.cpp
@@ -52,7 +52,7 @@ void DirectDrawSurface::free() {
_disposeAfterUse = DisposeAfterUse::NO;
}
-Graphics::ManagedSurface *DirectDrawSurface::lock(const Common::Rect *bounds, int flags) {
+Graphics::ManagedSurface *DirectDrawSurface::lock(const Rect *bounds, int flags) {
assert(!_surface->empty());
return _surface;
}
@@ -61,29 +61,29 @@ void DirectDrawSurface::unlock() {
assert(_surface->w != 0 && _surface->h != 0);
}
-void DirectDrawSurface::fill(const Common::Rect *bounds, uint32 color) {
- Common::Rect tempBounds;
+void DirectDrawSurface::fill(const Rect *bounds, uint32 color) {
+ Rect tempBounds;
if (bounds) {
// Bounds are provided, clip them to the bounds of this surface
tempBounds = *bounds;
- tempBounds.clip(Common::Rect(0, 0, _surface->w, _surface->h));
+ tempBounds.clip(Rect(0, 0, _surface->w, _surface->h));
} else {
// No bounds provided, so use the entire surface
- tempBounds = Common::Rect(0, 0, _surface->w, _surface->h);
+ tempBounds = Rect(0, 0, _surface->w, _surface->h);
}
// Fill the area
_surface->fillRect(tempBounds, color);
}
-void DirectDrawSurface::blit(const Common::Rect &destRect, DirectDrawSurface *srcSurface, Common::Rect &srcRect) {
+void DirectDrawSurface::blit(const Rect &destRect, DirectDrawSurface *srcSurface, Rect &srcRect) {
assert(srcSurface);
if (!destRect.isEmpty())
_surface->transBlitFrom(*srcSurface->_surface, srcRect, destRect, (uint)-1);
}
-void DirectDrawSurface::blit(const Common::Point &destPos, DirectDrawSurface *srcSurface, Common::Rect *bounds) {
+void DirectDrawSurface::blit(const Point &destPos, DirectDrawSurface *srcSurface, Rect *bounds) {
if (bounds)
_surface->blitFrom(*srcSurface->_surface, *bounds, destPos);
else
diff --git a/engines/titanic/direct_draw_surface.h b/engines/titanic/direct_draw_surface.h
index 9a93316f7d..dfcdccb48c 100644
--- a/engines/titanic/direct_draw_surface.h
+++ b/engines/titanic/direct_draw_surface.h
@@ -26,6 +26,7 @@
#include "common/scummsys.h"
#include "common/array.h"
#include "graphics/managed_surface.h"
+#include "titanic/rect.h"
namespace Titanic {
@@ -86,7 +87,7 @@ public:
/**
* Lock the surface for access
*/
- Graphics::ManagedSurface *lock(const Common::Rect *bounds, int flags);
+ Graphics::ManagedSurface *lock(const Rect *bounds, int flags);
/**
* Unlocks the surface at the end of direct accesses
@@ -97,17 +98,17 @@ public:
* Fills an area of the surfae with the specified color. If no bounds are passed,
* then the entire surface is filled
*/
- void fill(const Common::Rect *bounds, uint32 color);
+ void fill(const Rect *bounds, uint32 color);
/**
* Copy data from a source surfcae into this one
*/
- void blit(const Common::Rect &destRect, DirectDrawSurface *srcSurface, Common::Rect &srcRect);
+ void blit(const Rect &destRect, DirectDrawSurface *srcSurface, Rect &srcRect);
/**
* Copy data from a source surfcae into this one
*/
- void blit(const Common::Point &destPos, DirectDrawSurface *srcSurface, Common::Rect *bounds);
+ void blit(const Point &destPos, DirectDrawSurface *srcSurface, Rect *bounds);
};
} // End of namespace Titanic
diff --git a/engines/titanic/events.cpp b/engines/titanic/events.cpp
index 346b43c02b..6fae102ccc 100644
--- a/engines/titanic/events.cpp
+++ b/engines/titanic/events.cpp
@@ -103,7 +103,7 @@ uint32 Events::getTicksCount() const {
}
#define HANDLE_MESSAGE(method) if (_vm->_window->_inputAllowed) { \
- _vm->_window->_gameManager->_inputTranslator.leftButtonDown(_specialButtons, _mousePos); \
+ _vm->_window->_gameManager->_inputTranslator.leftButtonDown(_specialButtons, Point(_mousePos.x, _mousePos.y)); \
_vm->_window->mouseChanged(); \
}
diff --git a/engines/titanic/game/cdrom.h b/engines/titanic/game/cdrom.h
index f810056e4f..c1280f6712 100644
--- a/engines/titanic/game/cdrom.h
+++ b/engines/titanic/game/cdrom.h
@@ -29,7 +29,7 @@ namespace Titanic {
class CCDROM : public CGameObject {
private:
- Common::Point _pos1;
+ Point _pos1;
public:
CLASSDEF
CCDROM();
diff --git a/engines/titanic/game/end_game_credits.h b/engines/titanic/game/end_game_credits.h
index 68e86c6220..ab14f2680b 100644
--- a/engines/titanic/game/end_game_credits.h
+++ b/engines/titanic/game/end_game_credits.h
@@ -30,7 +30,7 @@ namespace Titanic {
class CEndGameCredits : public CGameObject {
private:
int _fieldBC;
- Common::Point _pos1;
+ Point _pos1;
public:
CLASSDEF
CEndGameCredits();
diff --git a/engines/titanic/game/placeholder/lemon_on_bar.h b/engines/titanic/game/placeholder/lemon_on_bar.h
index c88698fcab..18559b0350 100644
--- a/engines/titanic/game/placeholder/lemon_on_bar.h
+++ b/engines/titanic/game/placeholder/lemon_on_bar.h
@@ -29,7 +29,7 @@ namespace Titanic {
class CLemonOnBar : public CPlaceHolder {
private:
- Common::Point _pos1;
+ Point _pos1;
public:
CLASSDEF
diff --git a/engines/titanic/game/placeholder/tv_on_bar.h b/engines/titanic/game/placeholder/tv_on_bar.h
index 3358cd6fec..3af59deb5b 100644
--- a/engines/titanic/game/placeholder/tv_on_bar.h
+++ b/engines/titanic/game/placeholder/tv_on_bar.h
@@ -29,7 +29,7 @@ namespace Titanic {
class CTVOnBar : public CPlaceHolder {
private:
- Common::Point _pos1;
+ Point _pos1;
public:
CLASSDEF
diff --git a/engines/titanic/game/sauce_dispensor.h b/engines/titanic/game/sauce_dispensor.h
index 6969adb326..8a5cc96eca 100644
--- a/engines/titanic/game/sauce_dispensor.h
+++ b/engines/titanic/game/sauce_dispensor.h
@@ -32,8 +32,8 @@ public:
CString _string3;
int _fieldEC;
int _fieldF0;
- Common::Point _pos1;
- Common::Point _pos2;
+ Point _pos1;
+ Point _pos2;
int _field104;
int _field108;
public:
diff --git a/engines/titanic/game/ship_setting.h b/engines/titanic/game/ship_setting.h
index cbf4e9f61a..2525224a28 100644
--- a/engines/titanic/game/ship_setting.h
+++ b/engines/titanic/game/ship_setting.h
@@ -31,7 +31,7 @@ namespace Titanic {
class CShipSetting : public CBackground, CEnterRoomMsgTarget {
private:
CString _string3;
- Common::Point _pos1;
+ Point _pos1;
CString _string4;
CString _string5;
protected:
diff --git a/engines/titanic/game/transport/lift_indicator.h b/engines/titanic/game/transport/lift_indicator.h
index 161f032480..80f8b0d05b 100644
--- a/engines/titanic/game/transport/lift_indicator.h
+++ b/engines/titanic/game/transport/lift_indicator.h
@@ -31,7 +31,7 @@ namespace Titanic {
class CLiftindicator : public CLift {
private:
int _fieldFC;
- Common::Point _pos2;
+ Point _pos2;
int _field108;
int _field10C;
protected:
diff --git a/engines/titanic/game_manager.cpp b/engines/titanic/game_manager.cpp
index 49a881d8e2..a80e871e49 100644
--- a/engines/titanic/game_manager.cpp
+++ b/engines/titanic/game_manager.cpp
@@ -137,7 +137,7 @@ void CGameManager::postSave() {
}
void CGameManager::initBounds() {
- _bounds = Common::Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
+ _bounds = Rect(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT);
}
void CGameManager::fn2() {
@@ -160,7 +160,7 @@ void CGameManager::update() {
if (view) {
// Expand the game manager's bounds to encompass all the view's items
for (CTreeItem *item = view; item; item = item->scan(view)) {
- Common::Rect r = item->getBounds();
+ Rect r = item->getBounds();
if (!r.isEmpty())
_bounds.extend(r);
}
@@ -184,7 +184,7 @@ void CGameManager::update() {
// Handle redrawing the view
if (!_bounds.isEmpty()) {
_gameView->draw(_bounds);
- _bounds = Common::Rect();
+ _bounds = Rect();
}
_gameState.checkForViewChange();
diff --git a/engines/titanic/game_manager.h b/engines/titanic/game_manager.h
index f18696bf5c..51e1c3dd8f 100644
--- a/engines/titanic/game_manager.h
+++ b/engines/titanic/game_manager.h
@@ -113,7 +113,7 @@ public:
CProjectItem *_project;
CGameView *_gameView;
CGameState _gameState;
- Common::Rect _bounds;
+ Rect _bounds;
CInputHandler _inputHandler;
CInputTranslator _inputTranslator;
CTreeItem *_dragItem;
diff --git a/engines/titanic/game_state.cpp b/engines/titanic/game_state.cpp
index f906ff66d3..2885b3ad0c 100644
--- a/engines/titanic/game_state.cpp
+++ b/engines/titanic/game_state.cpp
@@ -36,13 +36,13 @@ bool CGameStateList::isViewChanging() const {
CGameState::CGameState(CGameManager *gameManager) :
_gameManager(gameManager), _gameLocation(this),
- _field8(0), _fieldC(0), _mode(GSMODE_0), _field14(0), _field18(0),
+ _field8(0), _fieldC(0), _mode(GSMODE_0), _field14(0), _petActive(false),
_field1C(0), _field20(0), _field24(0), _nodeChangeCtr(0),
_nodeEnterTicks(0), _field38(0) {
}
void CGameState::save(SimpleFile *file) const {
- file->writeNumber(_field18);
+ file->writeNumber(_petActive);
file->writeNumber(_field8);
file->writeNumber(_fieldC);
file->writeNumber(_field14);
@@ -53,7 +53,7 @@ void CGameState::save(SimpleFile *file) const {
}
void CGameState::load(SimpleFile *file) {
- _field18 = file->readNumber();
+ _petActive = file->readNumber() != 0;
_field8 = file->readNumber();
_fieldC = file->readNumber();
_field14 = file->readNumber();
@@ -87,7 +87,7 @@ void CGameState::setMode(GameStateMode newMode) {
_mode = newMode;
}
-void CGameState::setMousePos(const Common::Point &pt) {
+void CGameState::setMousePos(const Point &pt) {
_mousePos = pt;
}
diff --git a/engines/titanic/game_state.h b/engines/titanic/game_state.h
index 37bb603317..49bcbcdd97 100644
--- a/engines/titanic/game_state.h
+++ b/engines/titanic/game_state.h
@@ -53,13 +53,13 @@ public:
int _fieldC;
GameStateMode _mode;
int _field14;
- int _field18;
+ bool _petActive;
int _field1C;
int _field20;
int _field24;
uint _nodeChangeCtr;
uint32 _nodeEnterTicks;
- Common::Point _mousePos;
+ Point _mousePos;
int _field38;
public:
CGameState(CGameManager *gameManager);
@@ -82,7 +82,7 @@ public:
/**
* Sets the current mouse position
*/
- void setMousePos(const Common::Point &pt);
+ void setMousePos(const Point &pt);
/**
* Called by the PET when a new node is entered
diff --git a/engines/titanic/game_view.cpp b/engines/titanic/game_view.cpp
index ecdeb85f9a..505e489ee8 100644
--- a/engines/titanic/game_view.cpp
+++ b/engines/titanic/game_view.cpp
@@ -57,10 +57,10 @@ void CGameView::createSurface(const CResourceKey &key) {
_surface->_blitFlag = true;
}
-void CGameView::draw1() {
+void CGameView::drawView() {
CScreenManager::setCurrent();
- Common::Rect rect1 = _gameManager->_bounds;
- Common::Rect rect2(0, 0, 600, 340);
+ Rect rect1 = _gameManager->_bounds;
+ Rect rect2(0, 0, 600, 340);
rect2.translate(20, 10);
@@ -78,7 +78,7 @@ void CSTGameView::setView(CViewItem *view) {
_gameWindow->setActiveView(view);
}
-void CSTGameView::draw(const Common::Rect &bounds) {
+void CSTGameView::draw(const Rect &bounds) {
_gameWindow->draw();
}
diff --git a/engines/titanic/game_view.h b/engines/titanic/game_view.h
index 14412032dc..c1d1a001d3 100644
--- a/engines/titanic/game_view.h
+++ b/engines/titanic/game_view.h
@@ -57,14 +57,17 @@ public:
*/
virtual void setView(CViewItem *item) = 0;
- virtual void draw(const Common::Rect &bounds) = 0;
+ virtual void draw(const Rect &bounds) = 0;
/**
* Creates a surface from a specified resource
*/
void createSurface(const CResourceKey &key);
- void draw1();
+ /**
+ * Draws the background of a view
+ */
+ void drawView();
};
class CSTGameView: public CGameView {
@@ -81,7 +84,7 @@ public:
/**
* Handles drawing the view
*/
- virtual void draw(const Common::Rect &bounds);
+ virtual void draw(const Rect &bounds);
};
} // End of namespace Titanic
diff --git a/engines/titanic/gfx/move_object_button.h b/engines/titanic/gfx/move_object_button.h
index 70df8f6a7f..3873db6f4e 100644
--- a/engines/titanic/gfx/move_object_button.h
+++ b/engines/titanic/gfx/move_object_button.h
@@ -29,7 +29,7 @@ namespace Titanic {
class CMoveObjectButton : public CSTButton {
private:
- Common::Point _pos1;
+ Point _pos1;
int _field11C;
public:
CLASSDEF
diff --git a/engines/titanic/gfx/slider_button.h b/engines/titanic/gfx/slider_button.h
index afb96dbd70..2fdf448d09 100644
--- a/engines/titanic/gfx/slider_button.h
+++ b/engines/titanic/gfx/slider_button.h
@@ -32,7 +32,7 @@ private:
int _field114;
int _field118;
int _field11C;
- Common::Point _pos1;
+ Point _pos1;
public:
CLASSDEF
CSliderButton();
diff --git a/engines/titanic/gfx/toggle_switch.h b/engines/titanic/gfx/toggle_switch.h
index 9b4fc4219b..cc369f6281 100644
--- a/engines/titanic/gfx/toggle_switch.h
+++ b/engines/titanic/gfx/toggle_switch.h
@@ -30,7 +30,7 @@ namespace Titanic {
class CToggleSwitch : public CGameObject {
private:
int _fieldBC;
- Common::Point _pos1;
+ Point _pos1;
public:
CLASSDEF
CToggleSwitch();
diff --git a/engines/titanic/input_handler.cpp b/engines/titanic/input_handler.cpp
index c710374d05..110bddfd90 100644
--- a/engines/titanic/input_handler.cpp
+++ b/engines/titanic/input_handler.cpp
@@ -101,7 +101,7 @@ void CInputHandler::processMessage(const CMessage *msg) {
// Save where the drag movement started from
_dragStartPos = _mousePos;
} else {
- Common::Point delta = mouseMsg->_mousePos - _dragStartPos;
+ Point delta = mouseMsg->_mousePos - _dragStartPos;
int distance = (int)sqrt(double(delta.x * delta.x + delta.y * delta.y));
if (distance > 4) {
@@ -134,7 +134,7 @@ void CInputHandler::dispatchMessage(const CMessage *msg) {
}
}
-void CInputHandler::dragEnd(const Common::Point &mousePos, CTreeItem *dragItem) {
+void CInputHandler::dragEnd(const Point &mousePos, CTreeItem *dragItem) {
warning("TODO CInputHandler::dragEnd");
}
diff --git a/engines/titanic/input_handler.h b/engines/titanic/input_handler.h
index ad1ba86215..a81874f0c5 100644
--- a/engines/titanic/input_handler.h
+++ b/engines/titanic/input_handler.h
@@ -23,7 +23,7 @@
#ifndef TITANIC_INPUT_HANDLER_H
#define TITANIC_INPUT_HANDLER_H
-#include "common/rect.h"
+#include "titanic/rect.h"
#include "titanic/input_translator.h"
#include "titanic/core/tree_item.h"
@@ -46,15 +46,15 @@ private:
/**
* Called when a drag operation has ended
*/
- void dragEnd(const Common::Point &mousePos, CTreeItem *dragItem);
+ void dragEnd(const Point &mousePos, CTreeItem *dragItem);
public:
CGameManager *_gameManager;
CInputTranslator *_inputTranslator;
bool _dragging;
bool _buttonDown;
CTreeItem *_dragItem;
- Common::Point _dragStartPos;
- Common::Point _mousePos;
+ Point _dragStartPos;
+ Point _mousePos;
int _lockCount;
int _field24;
public:
diff --git a/engines/titanic/input_translator.cpp b/engines/titanic/input_translator.cpp
index bd33f20a70..ceb2be87f6 100644
--- a/engines/titanic/input_translator.cpp
+++ b/engines/titanic/input_translator.cpp
@@ -44,52 +44,52 @@ int CInputTranslator::getButtons(int special) const {
return buttons;
}
-void CInputTranslator::mouseMove(int special, const Common::Point &pt) {
+void CInputTranslator::mouseMove(int special, const Point &pt) {
CMouseMoveMsg msg(pt, getButtons(special));
_inputHandler->handleMessage(msg);
}
-void CInputTranslator::leftButtonDown(int special, const Common::Point &pt) {
+void CInputTranslator::leftButtonDown(int special, const Point &pt) {
CMouseButtonDownMsg msg(pt, getButtons(special));
_inputHandler->handleMessage(msg);
}
-void CInputTranslator::leftButtonUp(int special, const Common::Point &pt) {
+void CInputTranslator::leftButtonUp(int special, const Point &pt) {
CMouseButtonUpMsg msg(pt, getButtons(special));
_inputHandler->handleMessage(msg);
}
-void CInputTranslator::leftButtonDoubleClick(int special, const Common::Point &pt) {
+void CInputTranslator::leftButtonDoubleClick(int special, const Point &pt) {
CMouseButtonDoubleClickMsg msg(pt, getButtons(special));
_inputHandler->handleMessage(msg);
}
-void CInputTranslator::middleButtonDown(int special, const Common::Point &pt) {
+void CInputTranslator::middleButtonDown(int special, const Point &pt) {
CMouseButtonDownMsg msg(pt, getButtons(special));
_inputHandler->handleMessage(msg);
}
-void CInputTranslator::middleButtonUp(int special, const Common::Point &pt) {
+void CInputTranslator::middleButtonUp(int special, const Point &pt) {
CMouseButtonUpMsg msg(pt, getButtons(special));
_inputHandler->handleMessage(msg);
}
-void CInputTranslator::middleButtonDoubleClick(int special, const Common::Point &pt) {
+void CInputTranslator::middleButtonDoubleClick(int special, const Point &pt) {
CMouseButtonDoubleClickMsg msg(pt, getButtons(special));
_inputHandler->handleMessage(msg);
}
-void CInputTranslator::rightButtonDown(int special, const Common::Point &pt) {
+void CInputTranslator::rightButtonDown(int special, const Point &pt) {
CMouseButtonDownMsg msg(pt, getButtons(special));
_inputHandler->handleMessage(msg);
}
-void CInputTranslator::rightButtonUp(int special, const Common::Point &pt) {
+void CInputTranslator::rightButtonUp(int special, const Point &pt) {
CMouseButtonUpMsg msg(pt, getButtons(special));
_inputHandler->handleMessage(msg);
}
-void CInputTranslator::rightButtonDoubleClick(int special, const Common::Point &pt) {
+void CInputTranslator::rightButtonDoubleClick(int special, const Point &pt) {
CMouseButtonDoubleClickMsg msg(pt, getButtons(special));
_inputHandler->handleMessage(msg);
}
diff --git a/engines/titanic/input_translator.h b/engines/titanic/input_translator.h
index 2748ca4951..ad4f2d9d0a 100644
--- a/engines/titanic/input_translator.h
+++ b/engines/titanic/input_translator.h
@@ -40,16 +40,16 @@ public:
public:
CInputTranslator(CInputHandler *inputHandler);
- void mouseMove(int special, const Common::Point &pt);
- void leftButtonDown(int special, const Common::Point &pt);
- void leftButtonUp(int special, const Common::Point &pt);
- void leftButtonDoubleClick(int special, const Common::Point &pt);
- void middleButtonDown(int special, const Common::Point &pt);
- void middleButtonUp(int special, const Common::Point &pt);
- void middleButtonDoubleClick(int special, const Common::Point &pt);
- void rightButtonDown(int special, const Common::Point &pt);
- void rightButtonUp(int special, const Common::Point &pt);
- void rightButtonDoubleClick(int special, const Common::Point &pt);
+ void mouseMove(int special, const Point &pt);
+ void leftButtonDown(int special, const Point &pt);
+ void leftButtonUp(int special, const Point &pt);
+ void leftButtonDoubleClick(int special, const Point &pt);
+ void middleButtonDown(int special, const Point &pt);
+ void middleButtonUp(int special, const Point &pt);
+ void middleButtonDoubleClick(int special, const Point &pt);
+ void rightButtonDown(int special, const Point &pt);
+ void rightButtonUp(int special, const Point &pt);
+ void rightButtonDoubleClick(int special, const Point &pt);
};
} // End of namespace Titanic
diff --git a/engines/titanic/main_game_window.cpp b/engines/titanic/main_game_window.cpp
index c282787ade..839c2fc684 100644
--- a/engines/titanic/main_game_window.cpp
+++ b/engines/titanic/main_game_window.cpp
@@ -125,11 +125,11 @@ void CMainGameWindow::draw() {
switch (_gameManager->_gameState._mode) {
case GSMODE_1:
case GSMODE_2:
- if (_gameManager->_gameState._field18)
+ if (_gameManager->_gameState._petActive)
drawPet(scrManager);
- draw1();
- draw2(scrManager);
+ drawView();
+ drawViewContents(scrManager);
scrManager->drawCursors();
break;
@@ -151,12 +151,12 @@ void CMainGameWindow::drawPet(CScreenManager *screenManager) {
}
}
-void CMainGameWindow::draw1() {
+void CMainGameWindow::drawView() {
if (_gameView->_surface)
- _gameView->draw1();
+ _gameView->drawView();
}
-void CMainGameWindow::draw2(CScreenManager *screenManager) {
+void CMainGameWindow::drawViewContents(CScreenManager *screenManager) {
}
diff --git a/engines/titanic/main_game_window.h b/engines/titanic/main_game_window.h
index 549637b5dd..42517f5a08 100644
--- a/engines/titanic/main_game_window.h
+++ b/engines/titanic/main_game_window.h
@@ -55,9 +55,15 @@ private:
*/
void drawPet(CScreenManager *screenManager);
- void draw1();
+ /**
+ * Draws the background for the view
+ */
+ void drawView();
- void draw2(CScreenManager *screenManager);
+ /**
+ * Draws all the items within the view
+ */
+ void drawViewContents(CScreenManager *screenManager);
public:
CGameView *_gameView;
CGameManager *_gameManager;
diff --git a/engines/titanic/messages/mouse_messages.h b/engines/titanic/messages/mouse_messages.h
index 84d7b8f61c..77343fa6cd 100644
--- a/engines/titanic/messages/mouse_messages.h
+++ b/engines/titanic/messages/mouse_messages.h
@@ -23,7 +23,7 @@
#ifndef TITANIC_MOUSE_MESSAGES_H
#define TITANIC_MOUSE_MESSAGES_H
-#include "common/rect.h"
+#include "titanic/rect.h"
#include "titanic/messages/messages.h"
namespace Titanic {
@@ -33,14 +33,14 @@ enum MouseButton { MB_LEFT = 1, MB_MIDDLE = 2, MB_RIGHT = 4 };
class CMouseMsg : public CMessage {
public:
int _buttons;
- Common::Point _mousePos;
+ Point _mousePos;
public:
CLASSDEF
static bool isSupportedBy(const CTreeItem *item) {
return dynamic_cast<const CMouseMsg *>(item) != nullptr;
}
CMouseMsg() : _buttons(0) {}
- CMouseMsg(const Common::Point &pt, int buttons) :
+ CMouseMsg(const Point &pt, int buttons) :
_mousePos(pt), _buttons(buttons) {}
};
@@ -49,7 +49,7 @@ class CMouseMoveMsg : public CMouseMsg {
public:
CLASSDEF
CMouseMoveMsg() : CMouseMsg() {}
- CMouseMoveMsg(const Common::Point &pt, int buttons) : CMouseMsg(pt, buttons) {}
+ CMouseMoveMsg(const Point &pt, int buttons) : CMouseMsg(pt, buttons) {}
static bool isSupportedBy(const CTreeItem *item) {
return dynamic_cast<const CMouseMoveMsg *>(item) != nullptr;
@@ -67,7 +67,7 @@ public:
public:
CLASSDEF
CMouseButtonMsg() : CMouseMsg(), _field10(0) {}
- CMouseButtonMsg(const Common::Point &pt, int buttons) : CMouseMsg(pt, buttons) {}
+ CMouseButtonMsg(const Point &pt, int buttons) : CMouseMsg(pt, buttons) {}
static bool isSupportedBy(const CTreeItem *item) {
return dynamic_cast<const CMouseButtonMsg *>(item) != nullptr;
@@ -79,7 +79,7 @@ class CMouseButtonDownMsg : public CMouseButtonMsg {
public:
CLASSDEF
CMouseButtonDownMsg() : CMouseButtonMsg() {}
- CMouseButtonDownMsg(const Common::Point &pt, int buttons) : CMouseButtonMsg(pt, buttons) {}
+ CMouseButtonDownMsg(const Point &pt, int buttons) : CMouseButtonMsg(pt, buttons) {}
static bool isSupportedBy(const CTreeItem *item) {
return dynamic_cast<const CMouseButtonDownMsg *>(item) != nullptr;
@@ -96,7 +96,7 @@ class CMouseButtonUpMsg : public CMouseButtonMsg {
public:
CLASSDEF
CMouseButtonUpMsg() : CMouseButtonMsg() {}
- CMouseButtonUpMsg(const Common::Point &pt, int buttons) : CMouseButtonMsg(pt, buttons) {}
+ CMouseButtonUpMsg(const Point &pt, int buttons) : CMouseButtonMsg(pt, buttons) {}
static bool isSupportedBy(const CTreeItem *item) {
return dynamic_cast<const CMouseButtonUpMsg *>(item) != nullptr;
@@ -113,7 +113,7 @@ class CMouseButtonDoubleClickMsg : public CMouseButtonMsg {
public:
CLASSDEF
CMouseButtonDoubleClickMsg() : CMouseButtonMsg() {}
- CMouseButtonDoubleClickMsg(const Common::Point &pt, int buttons) : CMouseButtonMsg(pt, buttons) {}
+ CMouseButtonDoubleClickMsg(const Point &pt, int buttons) : CMouseButtonMsg(pt, buttons) {}
static bool isSupportedBy(const CTreeItem *item) {
return dynamic_cast<const CMouseButtonDoubleClickMsg *>(item) != nullptr;
@@ -129,7 +129,7 @@ class CMouseDragMsg : public CMouseMsg {
public:
CLASSDEF
CMouseDragMsg() : CMouseMsg() {}
- CMouseDragMsg(const Common::Point &pt) : CMouseMsg(pt, 0) {}
+ CMouseDragMsg(const Point &pt) : CMouseMsg(pt, 0) {}
static bool isSupportedBy(const CTreeItem *item) {
return dynamic_cast<const CMouseDragMsg *>(item) != nullptr;
@@ -140,7 +140,7 @@ class CMouseDragMoveMsg : public CMouseDragMsg {
public:
CLASSDEF
CMouseDragMoveMsg() : CMouseDragMsg() {}
- CMouseDragMoveMsg(const Common::Point &pt) : CMouseDragMsg(pt) {}
+ CMouseDragMoveMsg(const Point &pt) : CMouseDragMsg(pt) {}
static bool isSupportedBy(const CTreeItem *item) {
return dynamic_cast<const CMouseDragMoveMsg *>(item) != nullptr;
@@ -160,7 +160,7 @@ public:
public:
CLASSDEF
CMouseDragStartMsg() : CMouseDragMsg(), _dragItem(nullptr), _field14(0) {}
- CMouseDragStartMsg(const Common::Point &pt) : CMouseDragMsg(pt),
+ CMouseDragStartMsg(const Point &pt) : CMouseDragMsg(pt),
_dragItem(nullptr), _field14(0) {}
static bool isSupportedBy(const CTreeItem *item) {
@@ -180,7 +180,7 @@ public:
public:
CLASSDEF
CMouseDragEndMsg() : CMouseDragMsg(), _dragItem(nullptr) {}
- CMouseDragEndMsg(const Common::Point &pt, CTreeItem *dragItem = nullptr) :
+ CMouseDragEndMsg(const Point &pt, CTreeItem *dragItem = nullptr) :
CMouseDragMsg(pt), _dragItem(dragItem) {}
static bool isSupportedBy(const CTreeItem *item) {
diff --git a/engines/titanic/module.mk b/engines/titanic/module.mk
index 285a1c8157..afd8453d88 100644
--- a/engines/titanic/module.mk
+++ b/engines/titanic/module.mk
@@ -18,6 +18,8 @@ MODULE_OBJS := \
input_translator.o \
main_game_window.o \
mouse_cursor.o \
+ movie.o \
+ rect.o \
screen_manager.o \
simple_file.o \
string.o \
diff --git a/engines/titanic/movie.cpp b/engines/titanic/movie.cpp
new file mode 100644
index 0000000000..1eaeac638d
--- /dev/null
+++ b/engines/titanic/movie.cpp
@@ -0,0 +1,28 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/movie.h"
+
+namespace Titanic {
+
+
+} // End of namespace Titanic
diff --git a/engines/titanic/movie.h b/engines/titanic/movie.h
new file mode 100644
index 0000000000..a213b7b891
--- /dev/null
+++ b/engines/titanic/movie.h
@@ -0,0 +1,36 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_MOVIE_H
+#define TITANIC_MOVIE_H
+
+#include "titanic/core/list.h"
+
+namespace Titanic {
+
+class CMovie : public ListItem {
+public:
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_MOVIE_H */
diff --git a/engines/titanic/npcs/mobile.h b/engines/titanic/npcs/mobile.h
index 512bb9fe9f..4979d54fc3 100644
--- a/engines/titanic/npcs/mobile.h
+++ b/engines/titanic/npcs/mobile.h
@@ -29,7 +29,7 @@ namespace Titanic {
class CMobile : public CCharacter {
private:
- Common::Point _pos1;
+ Point _pos1;
int _fieldDC;
public:
CLASSDEF
diff --git a/engines/titanic/pet_control/pet_val.cpp b/engines/titanic/pet_control/pet_val.cpp
index 96b82f1632..5bc237572e 100644
--- a/engines/titanic/pet_control/pet_val.cpp
+++ b/engines/titanic/pet_control/pet_val.cpp
@@ -41,7 +41,7 @@ void CPetVal::proc4() {
error("TODO");
}
-void CPetVal::proc5(Common::Rect *rect) {
+void CPetVal::proc5(Rect *rect) {
error("TODO");
}
diff --git a/engines/titanic/pet_control/pet_val.h b/engines/titanic/pet_control/pet_val.h
index bd1fb9e55c..0e909d485b 100644
--- a/engines/titanic/pet_control/pet_val.h
+++ b/engines/titanic/pet_control/pet_val.h
@@ -40,7 +40,7 @@ public:
virtual void proc3();
virtual void proc4();
- virtual void proc5(Common::Rect *linkItem);
+ virtual void proc5(Rect *linkItem);
virtual int proc16();
};
diff --git a/engines/titanic/pet_control/pet_val_base.cpp b/engines/titanic/pet_control/pet_val_base.cpp
index c798c37971..9a23854450 100644
--- a/engines/titanic/pet_control/pet_val_base.cpp
+++ b/engines/titanic/pet_control/pet_val_base.cpp
@@ -28,9 +28,9 @@ namespace Titanic {
CPetValBase::CPetValBase() : _field4(0), _field8(0), _fieldC(0),
_field10(0), _field14(0) {}
-void CPetValBase::proc5(Common::Rect *rect) {
+void CPetValBase::proc5(Rect *rect) {
if (rect)
- *rect = Common::Rect();
+ *rect = Rect();
}
int CPetValBase::proc6() {
diff --git a/engines/titanic/pet_control/pet_val_base.h b/engines/titanic/pet_control/pet_val_base.h
index c4ff66568d..637e95f22d 100644
--- a/engines/titanic/pet_control/pet_val_base.h
+++ b/engines/titanic/pet_control/pet_val_base.h
@@ -44,7 +44,7 @@ public:
virtual void proc3() {}
virtual void proc4() {}
- virtual void proc5(Common::Rect *rect);
+ virtual void proc5(Rect *rect);
virtual int proc6();
virtual int proc7();
diff --git a/engines/titanic/rect.cpp b/engines/titanic/rect.cpp
new file mode 100644
index 0000000000..deb896fb47
--- /dev/null
+++ b/engines/titanic/rect.cpp
@@ -0,0 +1,27 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#include "titanic/rect.h"
+
+namespace Titanic {
+
+} // End of namespace Titanic
diff --git a/engines/titanic/rect.h b/engines/titanic/rect.h
new file mode 100644
index 0000000000..ffd251b4bb
--- /dev/null
+++ b/engines/titanic/rect.h
@@ -0,0 +1,43 @@
+/* ScummVM - Graphic Adventure Engine
+ *
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef TITANIC_RECT_H
+#define TITANIC_RECT_H
+
+#include "common/rect.h"
+
+namespace Titanic {
+
+typedef Common::Point Point;
+
+class Rect : public Common::Rect {
+public:
+ Rect() : Common::Rect() {}
+ Rect(int16 w, int16 h) : Common::Rect(w, h) {}
+ Rect(int16 x1, int16 y1, int16 x2, int16 y2) : Common::Rect(x1, y1, x2, y2) {}
+
+ operator const Point() { return Point(left, top); }
+};
+
+} // End of namespace Titanic
+
+#endif /* TITANIC_RECT_H */
diff --git a/engines/titanic/screen_manager.cpp b/engines/titanic/screen_manager.cpp
index f87ad66b9a..942bb4179f 100644
--- a/engines/titanic/screen_manager.cpp
+++ b/engines/titanic/screen_manager.cpp
@@ -62,7 +62,7 @@ CScreenManager *CScreenManager::setCurrent() {
return _currentScreenManagerPtr;
}
-void CScreenManager::setSurfaceBounds(int surfaceNum, const Common::Rect &r) {
+void CScreenManager::setSurfaceBounds(int surfaceNum, const Rect &r) {
if (surfaceNum >= 0 && surfaceNum < (int)_backSurfaces.size())
_backSurfaces[surfaceNum]._bounds = r;
}
@@ -133,7 +133,7 @@ void OSScreenManager::getFont() {}
void OSScreenManager::proc18() {}
void OSScreenManager::proc19() {}
-void OSScreenManager::clearSurface(int surfaceNum, Common::Rect *bounds) {
+void OSScreenManager::clearSurface(int surfaceNum, Rect *bounds) {
if (surfaceNum == -1)
_directDrawManager._mainSurface->fill(bounds, 0);
else if (surfaceNum >= 0 && surfaceNum < (int)_backSurfaces.size())
diff --git a/engines/titanic/screen_manager.h b/engines/titanic/screen_manager.h
index ae3424d9fa..023aa8ea55 100644
--- a/engines/titanic/screen_manager.h
+++ b/engines/titanic/screen_manager.h
@@ -40,7 +40,7 @@ class TitanicEngine;
class CScreenManager {
struct VideoSurfaceEntry {
CVideoSurface *_surface;
- Common::Rect _bounds;
+ Rect _bounds;
};
protected:
TitanicEngine *_vm;
@@ -97,7 +97,7 @@ public:
/**
* Clear a portion of a specified surface
*/
- virtual void clearSurface(int surfaceNum, Common::Rect *_bounds) = 0;
+ virtual void clearSurface(int surfaceNum, Rect *_bounds) = 0;
/**
* Resize the passed surface
@@ -119,7 +119,7 @@ public:
virtual void showCursor() = 0;
virtual void hideCursor() = 0;
- void setSurfaceBounds(int surfaceNum, const Common::Rect &r);
+ void setSurfaceBounds(int surfaceNum, const Rect &r);
};
class OSScreenManager: CScreenManager {
@@ -173,7 +173,7 @@ public:
/**
* Clear a portion of the screen surface
*/
- virtual void clearSurface(int surfaceNum, Common::Rect *bounds);
+ virtual void clearSurface(int surfaceNum, Rect *bounds);
/**
* Resize the passed surface
diff --git a/engines/titanic/simple_file.cpp b/engines/titanic/simple_file.cpp
index c975a27b28..3cd0ef7ecc 100644
--- a/engines/titanic/simple_file.cpp
+++ b/engines/titanic/simple_file.cpp
@@ -194,16 +194,16 @@ double SimpleFile::readFloat() {
return floatValue;
}
-Common::Point SimpleFile::readPoint() {
- Common::Point pt;
+Point SimpleFile::readPoint() {
+ Point pt;
pt.x = readNumber();
pt.y = readNumber();
return pt;
}
-Common::Rect SimpleFile::readRect() {
- Common::Rect r;
+Rect SimpleFile::readRect() {
+ Rect r;
r.left = readNumber();
r.top = readNumber();
r.right = readNumber();
@@ -296,16 +296,16 @@ void SimpleFile::writeFloatLine(double val, int indent) {
write("\n", 1);
}
-void SimpleFile::writePoint(const Common::Point &pt, int indent) {
+void SimpleFile::writePoint(const Point &pt, int indent) {
writeIndent(indent);
writeNumber(pt.x);
writeNumber(pt.y);
write("\n", 1);
}
-void SimpleFile::writeRect(const Common::Rect &r, int indent) {
- writePoint(Common::Point(r.left, r.top), indent);
- writePoint(Common::Point(r.right, r.bottom), indent);
+void SimpleFile::writeRect(const Rect &r, int indent) {
+ writePoint(Point(r.left, r.top), indent);
+ writePoint(Point(r.right, r.bottom), indent);
}
void SimpleFile::writeIndent(uint indent) {
diff --git a/engines/titanic/simple_file.h b/engines/titanic/simple_file.h
index 815896fc7e..0568092b4e 100644
--- a/engines/titanic/simple_file.h
+++ b/engines/titanic/simple_file.h
@@ -24,7 +24,7 @@
#define TITANIC_SIMPLE_FILE_H
#include "common/file.h"
-#include "common/rect.h"
+#include "titanic/rect.h"
#include "common/savefile.h"
#include "common/stream.h"
#include "common/zlib.h"
@@ -104,12 +104,12 @@ public:
/**
* Read in a point
*/
- Common::Point readPoint();
+ Point readPoint();
/**
* Read in a rect
*/
- Common::Rect readRect();
+ Rect readRect();
/**
* Read a string and copy it into an optionally passed buffer
@@ -159,12 +159,12 @@ public:
/**
* Write out a point line
*/
- void writePoint(const Common::Point &pt, int indent);
+ void writePoint(const Point &pt, int indent);
/**
* Write out a rect line
*/
- void writeRect(const Common::Rect &r, int indent);
+ void writeRect(const Rect &r, int indent);
/**
* Write out a number of tabs to form an indent in the output
diff --git a/engines/titanic/text_cursor.cpp b/engines/titanic/text_cursor.cpp
index e591dc38ed..ae1f842adb 100644
--- a/engines/titanic/text_cursor.cpp
+++ b/engines/titanic/text_cursor.cpp
@@ -20,7 +20,6 @@
*
*/
-#include "common/rect.h"
#include "common/textconsole.h"
#include "titanic/text_cursor.h"
@@ -29,9 +28,9 @@ namespace Titanic {
CTextCursor::CTextCursor() : _active(false) {
}
-Common::Rect CTextCursor::getBounds() {
+Rect CTextCursor::getBounds() {
warning("CTextCursor::getBounds");
- return Common::Rect();
+ return Rect();
}
} // End of namespace Titanic
diff --git a/engines/titanic/text_cursor.h b/engines/titanic/text_cursor.h
index 1b03abdd6a..4b6be8f1c4 100644
--- a/engines/titanic/text_cursor.h
+++ b/engines/titanic/text_cursor.h
@@ -24,6 +24,7 @@
#define TITANIC_TEXT_CURSOR_H
#include "common/scummsys.h"
+#include "titanic/rect.h"
namespace Titanic {
@@ -33,7 +34,7 @@ public:
public:
CTextCursor();
- Common::Rect getBounds();
+ Rect getBounds();
};
} // End of namespace Titanic
diff --git a/engines/titanic/video_surface.cpp b/engines/titanic/video_surface.cpp
index b38a8624ea..17e8f0ab46 100644
--- a/engines/titanic/video_surface.cpp
+++ b/engines/titanic/video_surface.cpp
@@ -46,14 +46,14 @@ void CVideoSurface::setSurface(CScreenManager *screenManager, DirectDrawSurface
_ddSurface = surface;
}
-void CVideoSurface::blitFrom(const Common::Rect &srcRect, const Common::Rect &destRect, CVideoSurface *srcSurface) {
+void CVideoSurface::blitFrom(const Rect &srcRect, const Rect &destRect, CVideoSurface *srcSurface) {
// TODO: Cases when _blitFlag is false
assert(_blitFlag);
error("TODO");
}
-void CVideoSurface::clipBounds(Common::Rect &srcRect, Common::Rect &destRect,
- CVideoSurface *srcSurface, Common::Rect *subRect, Common::Point *pt) {
+void CVideoSurface::clipBounds(Rect &srcRect, Rect &destRect,
+ CVideoSurface *srcSurface, Rect *subRect, Point *pt) {
if (pt) {
srcRect.left = pt->x;
srcRect.top = pt->y;
@@ -68,7 +68,7 @@ void CVideoSurface::clipBounds(Common::Rect &srcRect, Common::Rect &destRect,
} else {
srcRect.right = srcRect.left + srcSurface->getWidth();
srcRect.bottom = srcRect.top + srcSurface->getHeight();
- srcRect = Common::Rect(0, 0, srcSurface->getWidth(), srcSurface->getHeight());
+ srcRect = Rect(0, 0, srcSurface->getWidth(), srcSurface->getHeight());
}
// Clip destination rect to be on-screen
diff --git a/engines/titanic/video_surface.h b/engines/titanic/video_surface.h
index 88ab2e4d45..3538b1dd89 100644
--- a/engines/titanic/video_surface.h
+++ b/engines/titanic/video_surface.h
@@ -27,6 +27,7 @@
#include "common/array.h"
#include "titanic/font.h"
#include "titanic/direct_draw.h"
+#include "titanic/rect.h"
#include "titanic/core/list.h"
#include "titanic/core/resource_key.h"
@@ -43,8 +44,8 @@ private:
/**
* Calculates blitting bounds
*/
- void clipBounds(Common::Rect &destRect, Common::Rect &srcRect,
- CVideoSurface *srcSurface, Common::Rect *bounds2, Common::Point *pt);
+ void clipBounds(Rect &destRect, Rect &srcRect,
+ CVideoSurface *srcSurface, Rect *bounds2, Point *pt);
protected:
static int _videoSurfaceCounter;
protected:
@@ -151,7 +152,7 @@ public:
/**
* Blit from another surface
*/
- void blitFrom(const Common::Rect &srcRect, const Common::Rect &destRect, CVideoSurface *srcSurface);
+ void blitFrom(const Rect &srcRect, const Rect &destRect, CVideoSurface *srcSurface);
};
class OSVideoSurface : public CVideoSurface {