[Scummvm-git-logs] scummvm master -> 4dbfeb6ea4b38ca74d70fe2a6830d65b3ff517fa

a-yyg 76591232+a-yyg at users.noreply.github.com
Sat Jul 3 01:57:26 UTC 2021


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
e1a430c801 SAGA2: Remove DList from imagcach.h
4dbfeb6ea4 SAGA2: Kill DList


Commit: e1a430c80173c0434b1544d601da9650510bcd7f
    https://github.com/scummvm/scummvm/commit/e1a430c80173c0434b1544d601da9650510bcd7f
Author: a/ (yuri.kgpps at gmail.com)
Date: 2021-07-03T08:13:09+09:00

Commit Message:
SAGA2: Remove DList from imagcach.h

Changed paths:
    engines/saga2/imagcach.cpp
    engines/saga2/imagcach.h


diff --git a/engines/saga2/imagcach.cpp b/engines/saga2/imagcach.cpp
index d428b8cca5..a50707b4f3 100644
--- a/engines/saga2/imagcach.cpp
+++ b/engines/saga2/imagcach.cpp
@@ -26,7 +26,6 @@
 
 #include "saga2/saga2.h"
 #include "saga2/fta.h"
-#include "saga2/dlist.h"
 #include "saga2/imagcach.h"
 #include "saga2/hresmgr.h"
 
@@ -148,19 +147,18 @@ void CImageCache::releaseImage(void *imagePtr) {
 	if (!imagePtr)  return;
 
 	CImageNode *imageNode;
-	CImageNode *prevImageNode;
+	Common::List<CImageNode *>::iterator nextIt;
 
+	for (Common::List<CImageNode *>::iterator it = _nodes.begin(); it != _nodes.end(); it = nextIt) {
+		nextIt = it;
+		nextIt++;
 
-	for (imageNode = (CImageNode *)nodes.last();
-	        imageNode != NULL;
-	        imageNode = prevImageNode) {
-		prevImageNode = (CImageNode *)imageNode->prev();
-
+		imageNode = *it;
 		if (imageNode->isSameImage(imagePtr)) {
 			// if that was the last request for the imageNode, delete it
 			if (imageNode->releaseRequest()) {
 				// remove and delete it
-				imageNode->remove();
+				_nodes.remove(imageNode);
 				delete imageNode;
 			}
 		}
@@ -171,9 +169,9 @@ void *CImageCache::requestImage(hResContext *con, uint32 resID) {
 	CImageNode *imageNode;
 
 	// look through all nodes to see if we have that image already
-	for (imageNode = (CImageNode *)nodes.last();
-	        imageNode;
-	        imageNode = (CImageNode *)imageNode->prev()) {
+	for (Common::List<CImageNode *>::iterator it = _nodes.begin(); it != _nodes.end(); it++) {
+		imageNode = *it;
+
 		if (imageNode->isSameImage(con, resID)) {
 			// return the image Ptr to the already allocated image resource
 			return imageNode->getImagePtr();
@@ -186,7 +184,7 @@ void *CImageCache::requestImage(hResContext *con, uint32 resID) {
 	imageNode = new CImageNode(con, resID);
 
 	// add this node to the list
-	nodes.addTail(*imageNode);
+	_nodes.push_back(imageNode);
 
 	// return the newly loaded image
 	return imageNode->getImagePtr();
diff --git a/engines/saga2/imagcach.h b/engines/saga2/imagcach.h
index 7aa00a670a..9c6e790430 100644
--- a/engines/saga2/imagcach.h
+++ b/engines/saga2/imagcach.h
@@ -36,7 +36,7 @@ void cleanupImageCache(void);
    ImageNode class which defines a re-entrant image resource
  * ===================================================================== */
 
-class CImageNode : public DNode {
+class CImageNode {
 private:
 	uint32      contextID;  // ID of context
 	uint32      resourceID;     // RES_ID of  image
@@ -64,11 +64,11 @@ public:
 
 class CImageCache {
 private:
-	DList nodes;    // list of ImageNode
+	Common::List<CImageNode *> _nodes;    // list of ImageNode
 
 public:
 	CImageCache(void) {
-		assert(nodes.empty());
+		assert(_nodes.empty());
 	}
 	~CImageCache(void);
 


Commit: 4dbfeb6ea4b38ca74d70fe2a6830d65b3ff517fa
    https://github.com/scummvm/scummvm/commit/4dbfeb6ea4b38ca74d70fe2a6830d65b3ff517fa
Author: a/ (yuri.kgpps at gmail.com)
Date: 2021-07-03T10:54:53+09:00

Commit Message:
SAGA2: Kill DList

Changed paths:
  R engines/saga2/dlist.cpp
  R engines/saga2/dlist.h
    engines/saga2/floating.cpp
    engines/saga2/module.mk
    engines/saga2/panel.cpp
    engines/saga2/panel.h
    engines/saga2/speech.h
    engines/saga2/timers.h


diff --git a/engines/saga2/dlist.cpp b/engines/saga2/dlist.cpp
deleted file mode 100644
index 5f739d23c3..0000000000
--- a/engines/saga2/dlist.cpp
+++ /dev/null
@@ -1,122 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * aint32 with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- *
- * Based on the original sources
- *   Faery Tale II -- The Halls of the Dead
- *   (c) 1993-1996 The Wyrmkeep Entertainment Co.
- */
-
-#include "saga2/saga2.h"
-#include "saga2/dlist.h"
-
-namespace Saga2 {
-
-DNode *DNode::remove(void) {
-	succ->pred = pred;
-	pred->succ = succ;
-	return this;
-}
-
-void DList::addHead(DNode &d) {
-	head->pred = &d;
-	d.succ = head;
-	head = &d;
-	d.pred = (DNode *)&head;
-}
-
-void DList::addTail(DNode &d) {
-	tail->succ = &d;
-	d.pred = tail;
-	tail = &d;
-	d.succ = (DNode *)&overlap;
-}
-
-DNode *DList::remHead(void) {
-	DNode       *n = head;
-	if (n == nullptr)
-		return nullptr;
-
-	if (n->succ) {
-		head = n->succ;
-		head->pred = (DNode *)&head;
-		return n;
-	}
-	return 0;
-}
-
-DNode *DList::remTail(void) {
-	DNode       *n = tail;
-
-	if (n->pred) {
-		tail = n->pred;
-		tail->succ = (DNode *)&overlap;
-		return n;
-	}
-	return 0;
-}
-
-
-//  Insert a node before another one
-void DList::insert(DNode &d, DNode &before) {
-	d.succ = &before;
-	d.pred = before.pred;
-	before.pred = &d;
-	d.pred->succ = &d;
-}
-
-void DList::insert(DNode &d, void *extra, int (*compare)(DNode &d1, DNode &d2, void *extra)) {
-	DNode           *search;
-
-	for (search = head;
-	        search->succ != NULL && (*compare)(*search, d, extra) < 0;
-	        search = search->succ)
-		;
-
-	insert(d, *search);
-}
-
-
-int DList::count(void) const {
-	int     ct;                                         // count
-	DNode   *d;
-
-	for (d = head, ct = -1;                          // scan list
-	        d;
-	        d = d->succ, ++ct) ;                          // bunp count
-
-	return ct;
-}
-
-DNode *DList::select(int number) const {
-	if (number < 0) {
-		for (DNode *d = tail; d->succ; d = d->succ, ++number) {
-			if (number >= -1) return d;
-		}
-		return 0;
-	}
-
-	for (DNode *d = head; d->succ; d = d->succ, --number) {
-		if (number <= 0) return d;
-	}
-	return 0;
-}
-
-} // end of namespace Saga2
diff --git a/engines/saga2/dlist.h b/engines/saga2/dlist.h
deleted file mode 100644
index f252447ad6..0000000000
--- a/engines/saga2/dlist.h
+++ /dev/null
@@ -1,130 +0,0 @@
-/* ScummVM - Graphic Adventure Engine
- *
- * ScummVM is the legal property of its developers, whose names
- * are too numerous to list here. Please refer to the COPYRIGHT
- * file distributed with this source distribution.
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
- *
- *
- * Based on the original sources
- *   Faery Tale II -- The Halls of the Dead
- *   (c) 1993-1996 The Wyrmkeep Entertainment Co.
- */
-
-
-#ifndef SAGA2_DLIST_H
-#define SAGA2_DLIST_H
-
-namespace Saga2 {
-
-//  A doubly-linked list node
-
-class DNode {
-	DNode               *succ,              // ptr to next in list
-	                    *pred;              // ptr to prev in list
-
-	friend class        DList;
-	friend class        DList_iter;
-
-public:
-	DNode *next(void) const {
-		return succ->succ ? succ : 0;    // Next in list
-	}
-	DNode *prev(void) const {
-		return pred->pred ? pred : 0;    // Previous in list
-	}
-	DNode *remove(void);
-};
-
-//  A doubly-linked list (with dummy pointer to resolve end cases)
-
-class DList {
-	DNode               *head,                  // ptr to next in list
-	                    *overlap,               // dummy pointer
-	                    *tail;                  // ptr to prev in list
-
-	friend class        DList_iter;
-public:
-
-	//  constructor
-	DList(void) {
-		head = (DNode *)&overlap;
-		tail = (DNode *)&head;
-		overlap = 0;
-	}
-
-	//  Return pointer to first/last node in list
-	DNode *first(void) const {
-		return head->succ ? head : NULL;
-	}
-	DNode *last(void) const {
-		return tail->pred ? tail : NULL;
-	}
-
-	//  Add node to head/tail of list
-	void addHead(DNode &d);
-	void addTail(DNode &d);
-
-	//  Remove head/tail
-	DNode *remHead(void);
-	DNode *remTail(void);
-
-	//  Test if list is empty
-	bool empty(void) {
-		return head == (DNode *)&overlap;
-	}
-
-	//  Insert a node before another one
-	void insert(DNode &d, DNode &before);
-
-	//  Insert a node in a specific order
-	void insert(DNode &d, void *extra, int (*compare)(DNode &d1, DNode &d2, void *extra));
-
-	//  Count number of nodes in the list
-	int count(void) const;
-
-	//  Select the Nth node in the list
-	DNode *select(int number) const;
-};
-
-class DList_iter {
-	DNode               *current;
-
-public:
-	//  Constructor, initializes the iterator to the head of the list
-	DList_iter(DList &dl) {
-		current = dl.head;
-	}
-
-	DNode *next(void) {
-		return current->succ ? (current = current->succ) : 0;
-	}
-	DNode *prev(void) {
-		return current->pred ? (current = current->pred) : 0;
-	}
-#if 0
-	DNode *remove(void) {
-		if (current->succ && current->pred) {
-			current.remove();
-			current = current->succ;
-		}
-	}
-#endif
-};
-
-} // end of namespace Saga2
-
-#endif
diff --git a/engines/saga2/floating.cpp b/engines/saga2/floating.cpp
index 53644dd5d5..70a31861ae 100644
--- a/engines/saga2/floating.cpp
+++ b/engines/saga2/floating.cpp
@@ -612,7 +612,6 @@ bool checkTileAreaPort(void);
 extern bool userControlsSetup;
 
 void updateWindowSection(const Rect16 &r) {
-	DecoratedWindow *dw;
 	gPixelMap       tempMap;
 	gPort           tempPort;
 	Point16         offset(r.x, r.y);
@@ -681,11 +680,8 @@ void updateWindowSection(const Rect16 &r) {
 	//  For each window, both background and float, that overlaps
 	//  the clip, draw the window's imagery
 	if (userControlsSetup) {
-		for (dw = (DecoratedWindow *)G_BASE.bottomWindow();
-		        dw;
-		        dw = (DecoratedWindow *)dw->prev()) {
-			dw->drawClipped(tempPort, offset, clip);
-		}
+		for (Common::List<gWindow *>::iterator it = G_BASE.bottomWindowIterator(); it != G_BASE.topWindowIterator(); --it)
+			(*it)->drawClipped(tempPort, offset, clip);
 	}
 	//  Now, blit the temporary bitmap to the main screen.
 
@@ -735,9 +731,8 @@ void drawFloatingWindows(gPort &port, const Point16 &offset, const Rect16 &clip)
 		}
 	}
 
-	for (dw = (DecoratedWindow *)G_BASE.bottomWindow();
-	        dw;
-	        dw = (DecoratedWindow *)dw->prev()) {
+	for (Common::List<gWindow *>::iterator it = G_BASE.bottomWindowIterator(); it != G_BASE.topWindowIterator(); --it) {
+		dw = (DecoratedWindow *)(*it);
 		if (!dw->isBackdrop())
 			dw->drawClipped(port, offset, clip);
 	}
diff --git a/engines/saga2/module.mk b/engines/saga2/module.mk
index 5d5eb4a1eb..9400b6806b 100644
--- a/engines/saga2/module.mk
+++ b/engines/saga2/module.mk
@@ -15,7 +15,6 @@ MODULE_OBJS := \
 	detection.o \
 	display.o \
 	dispnode.o \
-	dlist.o \
 	document.o \
 	effects.o \
 	enchant.o \
diff --git a/engines/saga2/panel.cpp b/engines/saga2/panel.cpp
index e3a183eeaf..27b4a4576c 100644
--- a/engines/saga2/panel.cpp
+++ b/engines/saga2/panel.cpp
@@ -266,20 +266,23 @@ gPanelList::gPanelList(gWindow &win, const Rect16 &box, char *newTitle,
 
 gPanelList::gPanelList(gPanelList &list)
 	: gPanel(list, list.window.getExtent(), NULL, 0, NULL) {
-	window.contents.addTail(*this);
+	window.contents.push_back(this);
 }
 
 gPanelList::~gPanelList() {
 	removeControls();
-	remove();
+	window.contents.remove(this);
 }
 
 void gPanelList::removeControls(void) {
-	gControl        *ctl;
+	gPanel *ctl;
 
 	//  Delete all sub-panels.
-	while ((ctl = (gControl *)contents.first()) != nullptr)
+	while (contents.size()) {
+		ctl = contents.front();
+		contents.remove(ctl);
 		delete ctl;
+	}
 }
 
 //  enable/disable gPanelList and all it's children
@@ -288,36 +291,33 @@ void gPanelList::enable(bool abled) {
 }
 
 void gPanelList::invalidate(Rect16 *) {
-	gControl        *ctl;
-	Rect16          invArea;
+	gPanel *ctl;
+	Rect16 invArea;
 
 	assert(displayEnabled());
 
 	if (displayEnabled())
-		if ((ctl = (gControl *)contents.last())) {
+		if (contents.size()) {
+			ctl = contents.back();
 			invArea = ctl->getExtent();
 
-			for (ctl = (gControl *)ctl->prev();
-			        ctl;
-			        ctl = (gControl *)ctl->prev()) {
+			for (Common::List<gPanel *>::iterator it = contents.reverse_begin(); it != contents.end(); --it) {
+				ctl = *it;
 				invArea = bound(invArea, ctl->getExtent());
 			}
-
 			window.update(invArea);
 		}
 }
 
 void gPanelList::draw(void) {
-	gControl        *ctl;
+	gPanel *ctl;
 
 	if (displayEnabled())
 		if (enabled) {
-			for (ctl = (gControl *)contents.last();
-			        ctl;
-			        ctl = (gControl *)ctl->prev()) {
-				if (ctl->getEnabled()) {
+			for (Common::List<gPanel *>::iterator it = contents.reverse_begin(); it != contents.end(); --it) {
+				ctl = *it;
+				if (ctl->getEnabled())
 					ctl->draw();
-				}
 			}
 		}
 }
@@ -326,47 +326,46 @@ void gPanelList::drawClipped(
     gPort           &port,
     const Point16   &offset,
     const Rect16    &r) {
-	gControl        *ctl;
+	gPanel          *ctl;
 	Point16         tmpOffset = offset - Point16(extent.x, extent.y);
 	Rect16          tmpR = r - Point16(extent.x, extent.y);
 
 	if (displayEnabled())
 		if (enabled) {
-			for (ctl = (gControl *)contents.last();
-			        ctl;
-			        ctl = (gControl *)ctl->prev()) {
-				if (ctl->getEnabled()) {
+			for (Common::List<gPanel *>::iterator it = contents.reverse_begin(); it != contents.end(); --it) {
+				ctl = *it;
+				if (ctl->getEnabled())
 					ctl->drawClipped(port, tmpOffset, tmpR);
-				}
 			}
 		}
 }
 
 gPanel *gPanelList::hitTest(const Point16 &p) {
-	gControl        *ctl;
-	gPanel          *result;
+	gPanel        *ctl;
+	gPanel        *result;
 
 	if (enabled && !ghosted) {
-		for (ctl = (gControl *)contents.first();
-		        ctl;
-		        ctl = (gControl *)ctl->next()) {
-			if ((result = ctl->hitTest(p)) != NULL) return result;
+		for (Common::List<gPanel *>::iterator it = contents.begin(); it != contents.end(); ++it) {
+			ctl = *it;
+			if ((result = ctl->hitTest(p)) != NULL)
+				return result;
 		}
 	}
 	return NULL;
 }
 
 gPanel *gPanelList::keyTest(int16 key) {
-	gControl        *ctl;
+	gPanel          *ctl;
 	gPanel          *result;
 
 	if (enabled && !ghosted) {
-		for (ctl = (gControl *)contents.last();
-		        ctl;
-		        ctl = (gControl *)ctl->prev()) {
-			if ((result = ctl->keyTest(key)) != NULL) return result;
+		for (Common::List<gPanel *>::iterator it = contents.reverse_begin(); it != contents.end(); --it) {
+			ctl = *it;
+			if ((result = ctl->keyTest(key)) != NULL)
+				return result;
 		}
 	}
+
 	return NULL;
 }
 
@@ -429,7 +428,7 @@ bool gWindow::open(void) {
 	//  Send a "pointer-leave" message to mouse panel.
 
 	G_BASE.leavePanel();
-	G_BASE.windowList.addHead(*this);
+	G_BASE.windowList.push_front(this);
 	G_BASE.activeWindow = this;
 	G_BASE.setActive(NULL);
 
@@ -461,9 +460,9 @@ void gWindow::close(void) {
 
 	//  remove this window from the window list.
 
-	remove();
+	G_BASE.windowList.remove(this);
 
-	G_BASE.mouseWindow = G_BASE.activeWindow = (gWindow *)G_BASE.windowList.first();
+	G_BASE.mouseWindow = G_BASE.activeWindow = G_BASE.windowList.front();
 	G_BASE.mousePanel = G_BASE.activePanel = NULL;
 }
 
@@ -472,8 +471,8 @@ void gWindow::close(void) {
 void gWindow::toFront(void) {            // re-order the windows
 	if (!isOpen()) return;
 
-	remove();
-	G_BASE.windowList.addHead(*this);
+	G_BASE.windowList.remove(this);
+	G_BASE.windowList.push_front(this);
 
 	G_BASE.activePanel = NULL;
 	G_BASE.activeWindow = this;
@@ -519,7 +518,7 @@ void gWindow::setExtent(const Rect16 &r) {
 
 //  insert window into window list
 void gWindow::insert(void) {
-	G_BASE.windowList.addHead(*this);
+	G_BASE.windowList.push_front(this);
 }
 
 
@@ -609,7 +608,7 @@ gControl::gControl(gPanelList &list, const Rect16 &box, const char *title_, uint
 
 	//  Add control to the window's control list.
 
-	list.contents.addTail(*this);
+	list.contents.push_back(this);
 }
 
 gControl::gControl(gPanelList &list, const Rect16 &box, gPixelMap &img, uint16 ident,
@@ -618,11 +617,11 @@ gControl::gControl(gPanelList &list, const Rect16 &box, gPixelMap &img, uint16 i
 
 	//  Add control to the window's control list.
 
-	list.contents.addTail(*this);
+	list.contents.push_back(this);
 }
 
 gControl::~gControl() {
-	remove();
+	window.contents.remove(this);
 }
 
 gControl::gControl(gPanelList &list, const StaticRect &box, const char *title_, uint16 ident,
@@ -631,7 +630,7 @@ gControl::gControl(gPanelList &list, const StaticRect &box, const char *title_,
 
 	//  Add control to the window's control list.
 
-	list.contents.addTail(*this);
+	list.contents.push_back(this);
 }
 
 void gControl::enable(bool abled) {
@@ -838,9 +837,8 @@ void gToolBase::handleMouse(Common::Event &event, uint32 time) {
 	if (!activePanel /* && !ms.right */) {
 		//  If the point is within the window
 
-		for (w = (gWindow *)windowList.first();
-		        w;
-		        w = (gWindow *)w->next()) {
+		for (Common::List<gWindow *>::iterator it = windowList.begin(); it != windowList.end(); ++it) {
+			w = *it;
 			if (w->extent.ptInside(_curMouseState.pos) || w->isModal()) {
 				//  Set up the pick position relative to the window
 
@@ -998,7 +996,7 @@ void gToolBase::leavePanel(void) {
 
 void gToolBase::handleKeyStroke(Common::Event &event) {
 	gWindow         *w = activeWindow;
-	gControl        *ctl;
+	gPanel          *ctl;
 
 	uint16 key = event.kbd.ascii; // FIXME
 	uint16 qualifier = 0;
@@ -1035,7 +1033,7 @@ void gToolBase::handleKeyStroke(Common::Event &event) {
 		if (k != 0) {
 			k = toupper(k);
 
-			if ((ctl = (gControl *)w->keyTest(k)) != NULL) {
+			if ((ctl = w->keyTest(k)) != NULL) {
 				if (activePanel == ctl) return;
 				if (activePanel) activePanel->deactivate();
 				if (ctl->activate(gEventKeyDown)) {
diff --git a/engines/saga2/panel.h b/engines/saga2/panel.h
index b08157e057..76576bee1d 100644
--- a/engines/saga2/panel.h
+++ b/engines/saga2/panel.h
@@ -27,7 +27,6 @@
 #ifndef SAGA2_PANEL_H
 #define SAGA2_PANEL_H
 
-#include "saga2/dlist.h"
 #include "saga2/input.h"
 #include "saga2/vdraw.h"
 
@@ -124,7 +123,7 @@ typedef void        AppFunc(gEvent &);
    gPanel class: The basic user interface element
  * ===================================================================== */
 
-class gPanel : public DNode {
+class gPanel {
 	friend class    gToolBase;
 	friend class    gWindow;
 
@@ -247,6 +246,8 @@ public:
    gPanelList class: A list of panels
  * ===================================================================== */
 
+class gControl;
+
 class gPanelList : public gPanel {
 
 	friend class    gControl;
@@ -257,7 +258,7 @@ class gPanelList : public gPanel {
 
 protected:
 
-	DList           contents;               // list of panels
+	Common::List<gPanel *> contents;               // list of panels
 
 	gPanelList(gWindow &, const Rect16 &, char *, uint16, AppFunc *cmd = NULL);
 
@@ -283,13 +284,13 @@ public:
 };
 
 inline void gPanel::moveToFront(gPanelList &l) {
-	remove();
-	l.contents.addHead(*this);
+	l.contents.remove(this);
+	l.contents.push_front(this);
 }
 
 inline void gPanel::moveToBack(gPanelList &l) {
-	remove();
-	l.contents.addTail(*this);
+	l.contents.remove(this);
+	l.contents.push_back(this);
 }
 
 /* ===================================================================== *
@@ -470,7 +471,7 @@ class gToolBase {
 
 	// windows
 
-	DList           windowList;             // list of windows
+	Common::List<gWindow *> windowList;     // list of windows
 	gWindow         *mouseWindow,           // window mouse is in
 	                *activeWindow;          // current active window
 	gPanel          *mousePanel,            // panel that mouse is in
@@ -514,11 +515,17 @@ public:
 	void handleMouse(Common::Event &event, uint32 time);
 	void handleKeyStroke(Common::Event &event);
 	void handleTimerTick(int32 tick);
+	Common::List<gWindow *>::iterator topWindowIterator(void) {
+		return windowList.end();
+	}
+	Common::List<gWindow *>::iterator bottomWindowIterator(void) {
+		return windowList.reverse_begin();
+	}
 	gWindow *topWindow(void) {
-		return (gWindow *)windowList.first();
+		return windowList.front();
 	}
 	gWindow *bottomWindow(void) {
-		return (gWindow *)windowList.last();
+		return windowList.back();
 	}
 	bool isMousePanel(gPanel *p) {
 		return (mousePanel != NULL) ? (p == mousePanel) : (p == topWindow());
diff --git a/engines/saga2/speech.h b/engines/saga2/speech.h
index c78c266a33..a285e09dd7 100644
--- a/engines/saga2/speech.h
+++ b/engines/saga2/speech.h
@@ -28,7 +28,6 @@
 #define SAGA2_SPEECH_H
 
 #include "saga2/objects.h"
-#include "saga2/dlist.h"
 
 namespace Saga2 {
 
diff --git a/engines/saga2/timers.h b/engines/saga2/timers.h
index 4bc8803199..9705f62217 100644
--- a/engines/saga2/timers.h
+++ b/engines/saga2/timers.h
@@ -28,7 +28,6 @@
 #define SAGA2_TIMERS_H
 
 #include "saga2/idtypes.h"
-#include "saga2/dlist.h"
 #include "saga2/calender.h"
 #include "saga2/objects.h"
 




More information about the Scummvm-git-logs mailing list