[Scummvm-cvs-logs] CVS: scummvm/backends/wince/CEgui Panel.cpp,1.2,1.3 Toolbar.cpp,1.2,1.3 ToolbarHandler.cpp,1.2,1.3 ToolbarHandler.h,1.2,1.3

Nicolas Bacca arisme at users.sourceforge.net
Tue Jan 27 17:17:07 CET 2004


Update of /cvsroot/scummvm/scummvm/backends/wince/CEgui
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25375

Modified Files:
	Panel.cpp Toolbar.cpp ToolbarHandler.cpp ToolbarHandler.h 
Log Message:
640x480 toolbar fixes, don't draw an invisible toolbar

Index: Panel.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/wince/CEgui/Panel.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- Panel.cpp	26 Jan 2004 08:13:10 -0000	1.2
+++ Panel.cpp	28 Jan 2004 01:09:08 -0000	1.3
@@ -43,7 +43,7 @@
 
 	bool Panel::draw(SDL_Surface *surface) {
 		ItemMap::ConstIterator iterator;
-		if (!_drawn) {
+		if (!_drawn && _visible) {
 			GUIElement::draw(surface);
 			for (iterator = _itemsMap.begin(); iterator != _itemsMap.end(); ++iterator) {
 				((GUIElement*)(iterator->_value))->draw(surface);

Index: Toolbar.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/wince/CEgui/Toolbar.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- Toolbar.cpp	26 Jan 2004 08:13:10 -0000	1.2
+++ Toolbar.cpp	28 Jan 2004 01:09:08 -0000	1.3
@@ -24,12 +24,12 @@
 
 namespace CEGUI {
 
-	// FIXME (could be game dependant)
-	Toolbar::Toolbar() : GUIElement(0, 200, 320, 40)
+	// Not to be drawn on game screen ! 
+	Toolbar::Toolbar() : GUIElement(0, 0, 320, 40)
 	{
 	}
 
 	
 	Toolbar::~Toolbar() {
 	}
-}
\ No newline at end of file
+}

Index: ToolbarHandler.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/wince/CEgui/ToolbarHandler.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- ToolbarHandler.cpp	26 Jan 2004 08:13:10 -0000	1.2
+++ ToolbarHandler.cpp	28 Jan 2004 01:09:08 -0000	1.3
@@ -58,8 +58,13 @@
 	}
 
 	bool ToolbarHandler::action(int x, int y, bool pushed) {
-		if (_active)
-			return _active->action(x, y, pushed);
+		if (_active) {
+			// FIXME !
+			if (_offset > 240)
+				return _active->action(x / 2, (y - _offset) / 2, pushed);
+			else
+				return _active->action(x, y - _offset, pushed);			
+		}
 		else
 			return false;
 	}
@@ -103,6 +108,14 @@
 			return false;
 	}
 
+	void ToolbarHandler::setOffset(int offset) {
+		_offset = offset;
+	}
+
+	int ToolbarHandler::getOffset() {
+		return _offset;
+	}
+
 	Toolbar* ToolbarHandler::active() {
 		return _active;
 	}

Index: ToolbarHandler.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/backends/wince/CEgui/ToolbarHandler.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- ToolbarHandler.h	26 Jan 2004 08:13:10 -0000	1.2
+++ ToolbarHandler.h	28 Jan 2004 01:09:08 -0000	1.3
@@ -45,6 +45,8 @@
 		bool visible();
 		String activeName();
 		void forceRedraw();
+		void setOffset(int offset);
+		int getOffset();
 		bool draw(SDL_Surface *surface, SDL_Rect *rect);
 		bool drawn();
 		Toolbar *active();
@@ -59,6 +61,7 @@
 		Map<String, Toolbar*, IgnoreCaseComparator> _toolbarMap;
 		String _current;
 		Toolbar *_active;
+		int _offset;
 	};
 }
 





More information about the Scummvm-git-logs mailing list