aboutsummaryrefslogtreecommitdiff
path: root/engines/m4/viewmgr.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2010-03-24 11:49:26 +0000
committerPaul Gilbert2010-03-24 11:49:26 +0000
commitcf5cd833fde2765668aea3b8f234388da3f9f94d (patch)
tree725cdaa1ff530f6f412b4c98cfba6dee5a9e8615 /engines/m4/viewmgr.cpp
parentd34fd9cdd667dea9ce11bf4aa9028b3e91caf19a (diff)
downloadscummvm-rg350-cf5cd833fde2765668aea3b8f234388da3f9f94d.tar.gz
scummvm-rg350-cf5cd833fde2765668aea3b8f234388da3f9f94d.tar.bz2
scummvm-rg350-cf5cd833fde2765668aea3b8f234388da3f9f94d.zip
Moved new MadsView related code into Mads_Views, where it's more appropriate. Added extra logic necessary for displaying text in the game dialogs
svn-id: r48378
Diffstat (limited to 'engines/m4/viewmgr.cpp')
-rw-r--r--engines/m4/viewmgr.cpp66
1 files changed, 0 insertions, 66 deletions
diff --git a/engines/m4/viewmgr.cpp b/engines/m4/viewmgr.cpp
index a1e9c3e584..46b4b5af9d 100644
--- a/engines/m4/viewmgr.cpp
+++ b/engines/m4/viewmgr.cpp
@@ -194,72 +194,6 @@ void View::onRefresh(RectList *rects, M4Surface *destSurface) {
//--------------------------------------------------------------------------
-MadsTextDisplay::MadsTextDisplay() {
- for (int i = 0; i < TEXT_DISPLAY_SIZE; ++i)
- _entries[i].active = false;
-}
-
-int MadsTextDisplay::add(int xp, int yp, uint fontColour, int charSpacing, const char *msg, Font *font) {
- int usedSlot = -1;
-
- for (int idx = 0; idx < TEXT_DISPLAY_SIZE; ++idx) {
- if (!_entries[idx].active) {
- usedSlot = idx;
-
- _entries[idx].bounds.left = xp;
- _entries[idx].bounds.top = yp;
- _entries[idx].font = font;
- _entries[idx].msg = msg;
- _entries[idx].bounds.setWidth(font->getWidth(msg, charSpacing));
- _entries[idx].bounds.setHeight(font->getHeight());
- _entries[idx].colour1 = fontColour & 0xff;
- _entries[idx].colour2 = fontColour >> 8;
- _entries[idx].spacing = charSpacing;
- _entries[idx].active2 = 1;
- _entries[idx].active = true;
- break;
- }
- }
-
- return usedSlot;
-}
-
-void MadsTextDisplay::draw(View *view) {
- for (int idx = 0; idx < OLD_TEXT_DISPLAY_SIZE; ++idx) {
- if (_entries[idx].active && (_entries[idx].active2 >= 0)) {
- _entries[idx].font->setColours(_entries[idx].colour1, 0xFF,
- (_entries[idx].colour2 == 0) ? _entries[idx].colour1 : _entries[idx].colour2);
- _entries[idx].font->writeString(view, _entries[idx].msg,
- _entries[idx].bounds.left, _entries[idx].bounds.top, _entries[idx].bounds.width(),
- _entries[idx].spacing);
- }
- }
-
- // Clear up any now inactive text display entries
- for (int idx = 0; idx < OLD_TEXT_DISPLAY_SIZE; ++idx) {
- if (_entries[idx].active2 < 0) {
- _entries[idx].active = false;
- _entries[idx].active2 = 0;
- }
- }
-}
-
-//--------------------------------------------------------------------------
-
-MadsView::MadsView(MadsM4Engine *vm, const Common::Rect &viewBounds, bool transparent): View(vm, viewBounds, transparent) {
- _spriteSlotsStart = 0;
-}
-
-MadsView::MadsView(MadsM4Engine *vm, int x, int y, bool transparent): View(vm, x, y, transparent) {
- _spriteSlotsStart = 0;
-}
-
-int MadsView::getSpriteSlotsIndex() {
- return _spriteSlotsStart++;
-}
-
-//--------------------------------------------------------------------------
-
ViewManager::ViewManager(MadsM4Engine *vm): _systemHotkeys(HotkeyList(NULL)), _vm(vm) {
_captureScreen = NULL;
_captureEvents = false;