[Scummvm-cvs-logs] SF.net SVN: scummvm:[33680] scummvm/branches/gsoc2008-vkeybd

kenny-d at users.sourceforge.net kenny-d at users.sourceforge.net
Thu Aug 7 17:44:50 CEST 2008


Revision: 33680
          http://scummvm.svn.sourceforge.net/scummvm/?rev=33680&view=rev
Author:   kenny-d
Date:     2008-08-07 15:44:48 +0000 (Thu, 07 Aug 2008)

Log Message:
-----------
* Removed Shape base class
* Reverted Rect to not derive from Shape
* ImageMap now just uses Polygon's

Modified Paths:
--------------
    scummvm/branches/gsoc2008-vkeybd/backends/common/keymap-manager.cpp
    scummvm/branches/gsoc2008-vkeybd/backends/common/keymap-manager.h
    scummvm/branches/gsoc2008-vkeybd/backends/common/keymap.h
    scummvm/branches/gsoc2008-vkeybd/backends/common/virtual-keyboard-parser.cpp
    scummvm/branches/gsoc2008-vkeybd/backends/common/virtual-keyboard-parser.h
    scummvm/branches/gsoc2008-vkeybd/common/image-map.cpp
    scummvm/branches/gsoc2008-vkeybd/common/image-map.h
    scummvm/branches/gsoc2008-vkeybd/common/polygon.h
    scummvm/branches/gsoc2008-vkeybd/common/rect.h
    scummvm/branches/gsoc2008-vkeybd/dists/msvc8/scummvm.vcproj

Removed Paths:
-------------
    scummvm/branches/gsoc2008-vkeybd/common/shape.h

Modified: scummvm/branches/gsoc2008-vkeybd/backends/common/keymap-manager.cpp
===================================================================
--- scummvm/branches/gsoc2008-vkeybd/backends/common/keymap-manager.cpp	2008-08-07 14:16:48 UTC (rev 33679)
+++ scummvm/branches/gsoc2008-vkeybd/backends/common/keymap-manager.cpp	2008-08-07 15:44:48 UTC (rev 33680)
@@ -43,12 +43,12 @@
 void KeymapManager::Domain::deleteAllKeyMaps() {
 	KeymapMap::iterator it;
 	for (it = _keymaps.begin(); it != _keymaps.end(); it++) {
-		it->_value->saveMappings(_configDomain, it->_key);
+		//it->_value->saveMappings(_configDomain, it->_key);
 		delete it->_value;
 	}
 	_keymaps.clear();
 	if (_defaultKeymap) {
-		_defaultKeymap->saveMappings(_configDomain, "default");
+		//_defaultKeymap->saveMappings(_configDomain, "default");
 		delete _defaultKeymap;
 	}
 }

Modified: scummvm/branches/gsoc2008-vkeybd/backends/common/keymap-manager.h
===================================================================
--- scummvm/branches/gsoc2008-vkeybd/backends/common/keymap-manager.h	2008-08-07 14:16:48 UTC (rev 33679)
+++ scummvm/branches/gsoc2008-vkeybd/backends/common/keymap-manager.h	2008-08-07 15:44:48 UTC (rev 33680)
@@ -39,7 +39,9 @@
 	class Domain {
 	public:
 		Domain() : _defaultKeymap(0), _configDomain(0) {}
-		~Domain() { deleteAllKeyMaps(); }
+		~Domain() { 
+			deleteAllKeyMaps();
+		}
 
 		void setConfigDomain(ConfigManager::Domain *confDom) { 
 			_configDomain = confDom;

Modified: scummvm/branches/gsoc2008-vkeybd/backends/common/keymap.h
===================================================================
--- scummvm/branches/gsoc2008-vkeybd/backends/common/keymap.h	2008-08-07 14:16:48 UTC (rev 33679)
+++ scummvm/branches/gsoc2008-vkeybd/backends/common/keymap.h	2008-08-07 15:44:48 UTC (rev 33680)
@@ -98,7 +98,7 @@
 
 	/**
 	 * Returns true if all UserAction's in Keymap are mapped, or,
-	 * all HardwareKey'ss from the given set have been used up.
+	 * all HardwareKey's from the given set have been used up.
 	 */
 	bool isComplete(const HardwareKeySet *hwKeys);
 

Modified: scummvm/branches/gsoc2008-vkeybd/backends/common/virtual-keyboard-parser.cpp
===================================================================
--- scummvm/branches/gsoc2008-vkeybd/backends/common/virtual-keyboard-parser.cpp	2008-08-07 14:16:48 UTC (rev 33679)
+++ scummvm/branches/gsoc2008-vkeybd/backends/common/virtual-keyboard-parser.cpp	2008-08-07 15:44:48 UTC (rev 33680)
@@ -55,14 +55,14 @@
 	}
 }
 
-bool VirtualKeyboardParser::keyCallback(Common::String keyName) {
+bool VirtualKeyboardParser::keyCallback(String keyName) {
 	if (!_callbacks.contains(_activeKey.top()->name))
 		return parserError("%s is not a valid key name.", keyName.c_str());
 
 	return (this->*(_callbacks[_activeKey.top()->name]))();
 }
 
-bool VirtualKeyboardParser::closedKeyCallback(Common::String keyName) {
+bool VirtualKeyboardParser::closedKeyCallback(String keyName) {
 	if (!_closedCallbacks.contains(_activeKey.top()->name))
 		return true;
 	
@@ -90,7 +90,7 @@
 	_initialModeName = kbdNode->values["initial_mode"];
 
 	if (kbdNode->values.contains("h_align")) {
-		Common::String h = kbdNode->values["h_align"];
+		String h = kbdNode->values["h_align"];
 		if (h == "left")
 			_keyboard->_hAlignment = VirtualKeyboard::kAlignLeft;
 		else if (h == "centre" || h == "center")
@@ -100,7 +100,7 @@
 	}
 
 	if (kbdNode->values.contains("v_align")) {
-		Common::String v = kbdNode->values["h_align"];
+		String v = kbdNode->values["h_align"];
 		if (v == "top")
 			_keyboard->_vAlignment = VirtualKeyboard::kAlignTop;
 		else if (v == "middle" || v == "center")
@@ -130,7 +130,7 @@
 	if (!modeNode->values.contains("name") || !modeNode->values.contains("resolutions"))
 		return parserError("Mode element must contain name and resolutions attributes");
 
-	Common::String name = modeNode->values["name"];
+	String name = modeNode->values["name"];
 
 	if (_parseMode == kParseFull) {
 		// if full parse then add new mode to keyboard
@@ -148,8 +148,8 @@
 	} else
 		_mode = &(_keyboard->_modes[name]);
 
-	Common::String resolutions = modeNode->values["resolutions"];
-	Common::StringTokenizer tok (resolutions, " ,");
+	String resolutions = modeNode->values["resolutions"];
+	StringTokenizer tok (resolutions, " ,");
 
 	// select best resolution simply by minimising the difference between the 
 	// overlay size and the resolution dimensions.
@@ -157,8 +157,8 @@
 	// than the overlay res (so the keyboard can't be too big for the screen)
 	uint16 scrW = g_system->getOverlayWidth(), scrH = g_system->getOverlayHeight();
 	uint32 diff = 0xFFFFFFFF;
-	Common::String newResolution;
-	for (Common::String res = tok.nextToken(); res.size() > 0; res = tok.nextToken()) {
+	String newResolution;
+	for (String res = tok.nextToken(); res.size() > 0; res = tok.nextToken()) {
 		int resW, resH;
 		if (sscanf(res.c_str(), "%dx%d", &resW, &resH) != 2) {
 			return parserError("Invalid resolution specification");
@@ -222,14 +222,14 @@
 	if (_parseMode == kParseCheckResolutions)
 		return true;
 
-	Common::String name = evtNode->values["name"];
+	String name = evtNode->values["name"];
 	if (_mode->events.contains(name))
 		return parserError("Event '%s' has already been defined", name.c_str());
 
 	VirtualKeyboard::Event *evt = new VirtualKeyboard::Event();
 	evt->name = name;
 
-	Common::String type = evtNode->values["type"];
+	String type = evtNode->values["type"];
 	if (type == "key") {
 		if (!evtNode->values.contains("code") || !evtNode->values.contains("ascii")) {
 			delete evt;
@@ -238,14 +238,14 @@
 
 		evt->type = VirtualKeyboard::kEventKey;
 
-		Common::KeyCode code = (Common::KeyCode)atoi(evtNode->values["code"].c_str());
+		KeyCode code = (KeyCode)atoi(evtNode->values["code"].c_str());
 		uint16 ascii = atoi(evtNode->values["ascii"].c_str());
 
 		byte flags = 0;
 		if (evtNode->values.contains("modifiers"))
 			flags = parseFlags(evtNode->values["modifiers"]);
 
-		evt->data = new Common::KeyState(code, ascii, flags);
+		evt->data = new KeyState(code, ascii, flags);
 
 	} else if (type == "modifier") {
 		if (!evtNode->values.contains("modifiers")) {
@@ -265,7 +265,7 @@
 		}
 
 		evt->type = VirtualKeyboard::kEventSwitchMode;
-		evt->data = new Common::String(evtNode->values["mode"]);
+		evt->data = new String(evtNode->values["mode"]);
 	} else if (type == "close") {
 		evt->type = VirtualKeyboard::kEventClose;
 		evt->data = 0;
@@ -292,7 +292,7 @@
 
 	assert(!_mode->resolution.empty());
 
-	Common::String res = layoutNode->values["resolution"];
+	String res = layoutNode->values["resolution"];
 
 	if (res != _mode->resolution) {
 		layoutNode->ignore = true;
@@ -353,20 +353,20 @@
 	if (!areaNode->values.contains("shape") || !areaNode->values.contains("coords") || !areaNode->values.contains("target"))
 		return parserError("Area element must contain shape, coords and target attributes");
 
-	Common::String& shape = areaNode->values["shape"];
-	Common::String& target = areaNode->values["target"];
-	Common::String& coords = areaNode->values["coords"];
+	String& shape = areaNode->values["shape"];
+	String& target = areaNode->values["target"];
+	String& coords = areaNode->values["coords"];
 
 	if (target == "display_area") {
 		if (shape != "rect")
 			return parserError("display_area must be a rect area");
-		_mode->displayArea = new Common::Rect();
+		_mode->displayArea = new Rect();
 		return parseRect(_mode->displayArea, coords);
 	} else if (shape == "rect") {
-		Common::Rect *rect = _mode->imageMap.createRectArea(target);
-		return parseRect(rect, coords);
+		Polygon *poly = _mode->imageMap.createArea(target);
+		return parseRectAsPolygon(poly, coords);
 	} else if (shape == "poly") {
-		Common::Polygon *poly = _mode->imageMap.createPolygonArea(target);
+		Polygon *poly = _mode->imageMap.createArea(target);
 		return parsePolygon(poly, coords);
 	}
 	return parserError("Area shape '%s' not known", shape.c_str());
@@ -376,20 +376,20 @@
 	if (flags.empty())
 		return 0;
 
-	Common::StringTokenizer tok(flags, ", ");
+	StringTokenizer tok(flags, ", ");
 	byte val = 0;
-	for (Common::String fl = tok.nextToken(); !fl.empty(); fl = tok.nextToken()) {
+	for (String fl = tok.nextToken(); !fl.empty(); fl = tok.nextToken()) {
 		if (fl == "ctrl" || fl == "control")
-			val |= Common::KBD_CTRL;
+			val |= KBD_CTRL;
 		else if (fl == "alt")
-			val |= Common::KBD_ALT;
+			val |= KBD_ALT;
 		else if (fl == "shift")
-			val |= Common::KBD_SHIFT;
+			val |= KBD_SHIFT;
 	}
 	return val;
 }
 
-bool VirtualKeyboardParser::parseRect(Common::Rect *rect, const String& coords) {
+bool VirtualKeyboardParser::parseRect(Rect *rect, const String& coords) {
 	int x1, y1, x2, y2;
 	if (!parseIntegerKey(coords.c_str(), 4, &x1, &y1, &x2, &y2))
 		return parserError("Invalid coords for rect area");
@@ -399,9 +399,9 @@
 	return true;
 }
 
-bool VirtualKeyboardParser::parsePolygon(Common::Polygon *poly, const String& coords) {
-	Common::StringTokenizer tok (coords, ", ");
-	for (Common::String st = tok.nextToken(); !st.empty(); st = tok.nextToken()) {
+bool VirtualKeyboardParser::parsePolygon(Polygon *poly, const String& coords) {
+	StringTokenizer tok (coords, ", ");
+	for (String st = tok.nextToken(); !st.empty(); st = tok.nextToken()) {
 		int x, y;
 		if (sscanf(st.c_str(), "%d", &x) != 1)
 			return parserError("Invalid coords for polygon area");
@@ -416,4 +416,15 @@
 	return true;
 }
 
+bool VirtualKeyboardParser::parseRectAsPolygon(Polygon *poly, const String& coords) {
+	Rect rect;
+	if (!parseRect(&rect, coords))
+		return false;
+	poly->addPoint(rect.left, rect.top);
+	poly->addPoint(rect.right, rect.top);
+	poly->addPoint(rect.right, rect.bottom);
+	poly->addPoint(rect.left, rect.bottom);
+	return true;
+}
+
 } // end of namespace GUI

Modified: scummvm/branches/gsoc2008-vkeybd/backends/common/virtual-keyboard-parser.h
===================================================================
--- scummvm/branches/gsoc2008-vkeybd/backends/common/virtual-keyboard-parser.h	2008-08-07 14:16:48 UTC (rev 33679)
+++ scummvm/branches/gsoc2008-vkeybd/backends/common/virtual-keyboard-parser.h	2008-08-07 15:44:48 UTC (rev 33680)
@@ -185,12 +185,12 @@
 	/** internal state variables of parser */
 	ParseMode _parseMode;
 	VirtualKeyboard::Mode *_mode; // pointer to mode currently being parsed
-	Common::String _initialModeName;
+	String _initialModeName;
 	bool _kbdParsed;
 	bool _layoutParsed;
 
-	bool keyCallback(Common::String keyName);
-	bool closedKeyCallback(Common::String keyName);
+	bool keyCallback(String keyName);
+	bool closedKeyCallback(String keyName);
 	void cleanup();
 
 	bool parserCallback_Keyboard();
@@ -204,11 +204,12 @@
 	bool parserCallback_ModeClosed();
 
 	byte parseFlags(const String& flags);
-	bool parseRect(Common::Rect *rect, const String& coords);
-	bool parsePolygon(Common::Polygon *poly, const String& coords);
+	bool parseRect(Rect *rect, const String& coords);
+	bool parsePolygon(Polygon *poly, const String& coords);
+	bool parseRectAsPolygon(Polygon *poly, const String& coords);
 
-	Common::HashMap<Common::String, ParserCallback, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> _callbacks;
-	Common::HashMap<Common::String, ParserCallback, Common::IgnoreCase_Hash, Common::IgnoreCase_EqualTo> _closedCallbacks;
+	HashMap<String, ParserCallback, IgnoreCase_Hash, IgnoreCase_EqualTo> _callbacks;
+	HashMap<String, ParserCallback, IgnoreCase_Hash, IgnoreCase_EqualTo> _closedCallbacks;
 };
 
 } // end of namespace GUI

Modified: scummvm/branches/gsoc2008-vkeybd/common/image-map.cpp
===================================================================
--- scummvm/branches/gsoc2008-vkeybd/common/image-map.cpp	2008-08-07 14:16:48 UTC (rev 33679)
+++ scummvm/branches/gsoc2008-vkeybd/common/image-map.cpp	2008-08-07 15:44:48 UTC (rev 33680)
@@ -31,21 +31,11 @@
 	removeAllAreas();
 }
 
-Rect *ImageMap::createRectArea(const String& id) {
+Polygon *ImageMap::createArea(const String& id) {
 	if (_areas.contains(id)) {
 		warning("Image map already contains an area with target of '%s'", id.c_str());
 		return 0;
 	}
-	Rect *r = new Rect();
-	_areas[id] = r;
-	return r;
-}
-
-Polygon *ImageMap::createPolygonArea(const String& id) {
-	if (_areas.contains(id)) {
-		warning("Image map already contains an area with target of '%s'", id.c_str());
-		return 0;
-	}
 	Polygon *p = new Polygon();
 	_areas[id] = p;
 	return p;
@@ -59,7 +49,7 @@
 }
 
 void ImageMap::removeAllAreas() {
-	HashMap<String, Shape*>::iterator it;
+	HashMap<String, Polygon*>::iterator it;
 	for (it = _areas.begin(); it != _areas.end(); it++) {
 		delete it->_value;
 	}
@@ -67,7 +57,7 @@
 }
 
 String ImageMap::findMapArea(int16 x, int16 y) {
-	HashMap<String, Shape*>::iterator it;
+	HashMap<String, Polygon*>::iterator it;
 	for (it = _areas.begin(); it != _areas.end(); it++) {
 		if (it->_value->contains(x, y))
 			return it->_key;

Modified: scummvm/branches/gsoc2008-vkeybd/common/image-map.h
===================================================================
--- scummvm/branches/gsoc2008-vkeybd/common/image-map.h	2008-08-07 14:16:48 UTC (rev 33679)
+++ scummvm/branches/gsoc2008-vkeybd/common/image-map.h	2008-08-07 15:44:48 UTC (rev 33680)
@@ -28,7 +28,6 @@
 
 #include "common/hashmap.h"
 #include "common/hash-str.h"
-#include "common/rect.h"
 #include "common/polygon.h"
 
 namespace Common {
@@ -39,14 +38,13 @@
 
 	~ImageMap();
 	
-	Rect *createRectArea(const String& id);
-	Polygon *createPolygonArea(const String& id);
+	Polygon *createArea(const String& id);
 	void removeArea(const String& id);
 	void removeAllAreas();
 	String findMapArea(int16 x, int16 y);
 
 protected:
-	HashMap<String, Shape*> _areas;
+	HashMap<String, Polygon*> _areas;
 };
 
 

Modified: scummvm/branches/gsoc2008-vkeybd/common/polygon.h
===================================================================
--- scummvm/branches/gsoc2008-vkeybd/common/polygon.h	2008-08-07 14:16:48 UTC (rev 33679)
+++ scummvm/branches/gsoc2008-vkeybd/common/polygon.h	2008-08-07 15:44:48 UTC (rev 33680)
@@ -28,15 +28,14 @@
 
 #include "common/array.h"
 #include "common/rect.h"
-#include "common/shape.h"
 
 namespace Common {
 
-struct Polygon : public Shape {
+struct Polygon {
 
 
 	Polygon() {}
-	Polygon(const Polygon& p) : Shape(), _points(p._points), _bound(p._bound) {}
+	Polygon(const Polygon& p) : _points(p._points), _bound(p._bound) {}
 	Polygon(Array<Point> p) : _points(p) {
 		if (p.empty()) return;
 		_bound = Rect(p[0].x, p[0].y, p[0].x, p[0].y);

Modified: scummvm/branches/gsoc2008-vkeybd/common/rect.h
===================================================================
--- scummvm/branches/gsoc2008-vkeybd/common/rect.h	2008-08-07 14:16:48 UTC (rev 33679)
+++ scummvm/branches/gsoc2008-vkeybd/common/rect.h	2008-08-07 15:44:48 UTC (rev 33680)
@@ -26,10 +26,45 @@
 #ifndef COMMON_RECT_H
 #define COMMON_RECT_H
 
-#include "common/shape.h"
+#include "common/scummsys.h"
+#include "common/util.h"
 
 namespace Common {
 
+/*!		@brief simple class for handling both 2D position and size
+
+	This small class is an helper for position and size values.
+*/
+struct Point {
+	int16 x;	//!< The horizontal part of the point
+	int16 y;	//!< The vertical part of the point
+
+	Point() : x(0), y(0) {}
+	Point(const Point &p) : x(p.x), y(p.y) {}
+	explicit Point(int16 x1, int16 y1) : x(x1), y(y1) {}
+	Point & operator=(const Point & p) { x = p.x; y = p.y; return *this; };
+	bool operator==(const Point & p) const { return x == p.x && y == p.y; };
+	bool operator!=(const Point & p) const { return x != p.x || y != p.y; };
+
+	/**
+	 * Return the square of the distance between this point and the point p.
+	 *
+	 * @param p		the other point
+	 * @return the distance between this and p
+	 */
+	uint sqrDist(const Point & p) const {
+		int diffx = ABS(p.x - x);
+		if (diffx >= 0x1000)
+			return 0xFFFFFF;
+
+		int diffy = ABS(p.y - y);
+		if (diffy >= 0x1000)
+			return 0xFFFFFF;
+
+		return uint(diffx*diffx + diffy*diffy);
+	}
+};
+
 /*!		@brief simple class for handling a rectangular zone.
 
 	This small class is an helper for rectangles.
@@ -40,7 +75,7 @@
 	Another very wide spread approach to rectangle classes treats (bottom,right)
 	also as a part of the rectangle.
 
-	Conceptually, both are sound, but the approach we use saves many intermediate
+	Coneptually, both are sound, but the approach we use saves many intermediate
 	computations (like computing the height in our case is done by doing this:
 	  height = bottom - top;
 	while in the alternate system, it would be
@@ -48,7 +83,7 @@
 
 	When writing code using our Rect class, always keep this principle in mind!
 */
-struct Rect : public Shape {
+struct Rect {
 	int16 top, left;		//!< The point at the top left of the rectangle (part of the rect).
 	int16 bottom, right;	//!< The point at the bottom right of the rectangle (not part of the rect).
 
@@ -57,8 +92,6 @@
 	Rect(int16 x1, int16 y1, int16 x2, int16 y2) : top(y1), left(x1), bottom(y2), right(x2) {
 		assert(isValidRect());
 	}
-	virtual ~Rect() {}
-
 	int16 width() const { return right - left; }
 	int16 height() const { return bottom - top; }
 
@@ -77,7 +110,7 @@
 
 		@return true if the given position is inside this rectangle, false otherwise
 	*/
-	virtual bool contains(int16 x, int16 y) const {
+	bool contains(int16 x, int16 y) const {
 		return (left <= x) && (x < right) && (top <= y) && (y < bottom);
 	}
 
@@ -87,7 +120,7 @@
 
 		@return true if the given point is inside this rectangle, false otherwise
 	*/
-	virtual bool contains(const Point &p) const {
+	bool contains(const Point &p) const {
 		return contains(p.x, p.y);
 	}
 
@@ -152,19 +185,19 @@
 		return (left <= right && top <= bottom);
 	}
 
-	virtual void moveTo(int16 x, int16 y) {
+	void moveTo(int16 x, int16 y) {
 		bottom += y - top;
 		right += x - left;
 		top = y;
 		left = x;
 	}
 
-	virtual void translate(int16 dx, int16 dy) {
+	void translate(int16 dx, int16 dy) {
 		left += dx; right += dx;
 		top += dy; bottom += dy;
 	}
 
-	virtual void moveTo(const Point &p) {
+	void moveTo(const Point &p) {
 		moveTo(p.x, p.y);
 	}
 
@@ -178,10 +211,6 @@
 		h /= 2;
 		return Rect(cx - w, cy - h, cx + w, cy + h);
 	}
-
-	virtual Rect getBoundingRect() const {
-		return *this;
-	}
 };
 
 }	// End of namespace Common

Deleted: scummvm/branches/gsoc2008-vkeybd/common/shape.h
===================================================================
--- scummvm/branches/gsoc2008-vkeybd/common/shape.h	2008-08-07 14:16:48 UTC (rev 33679)
+++ scummvm/branches/gsoc2008-vkeybd/common/shape.h	2008-08-07 15:44:48 UTC (rev 33680)
@@ -1,105 +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.
- *
- * $URL$
- * $Id$
- *
- */
-
-#ifndef COMMON_SHAPE_H
-#define COMMON_SHAPE_H
-
-#include "common/scummsys.h"
-#include "common/util.h"
-
-namespace Common {
-
-struct Rect;
-
-/*!		@brief simple class for handling both 2D position and size
-
-	This small class is an helper for position and size values.
-*/
-struct Point {
-	int16 x;	//!< The horizontal part of the point
-	int16 y;	//!< The vertical part of the point
-
-	Point() : x(0), y(0) {}
-	Point(const Point &p) : x(p.x), y(p.y) {}
-	explicit Point(int16 x1, int16 y1) : x(x1), y(y1) {}
-	Point & operator=(const Point & p) { x = p.x; y = p.y; return *this; };
-	bool operator==(const Point & p) const { return x == p.x && y == p.y; };
-	bool operator!=(const Point & p) const { return x != p.x || y != p.y; };
-
-	/**
-	 * Return the square of the distance between this point and the point p.
-	 *
-	 * @param p		the other point
-	 * @return the distance between this and p
-	 */
-	uint sqrDist(const Point & p) const {
-		int diffx = ABS(p.x - x);
-		if (diffx >= 0x1000)
-			return 0xFFFFFF;
-
-		int diffy = ABS(p.y - y);
-		if (diffy >= 0x1000)
-			return 0xFFFFFF;
-
-		return uint(diffx*diffx + diffy*diffy);
-	}
-};
-
-/*!		@brief simple interface that provides common methods for 2D shapes
-
-*/
-struct Shape {
-
-	virtual ~Shape() {}
-	/*!	@brief check if given position is inside this shape
-
-		@param x the horizontal position to check
-		@param y the vertical position to check
-
-		@return true if the given position is inside this shape, false otherwise
-	*/
-	virtual bool contains(int16 x, int16 y) const = 0;
-
-	/*!	@brief check if given point is inside this shape
-
-		@param p the point to check
-
-		@return true if the given point is inside this shape, false otherwise
-	*/
-	virtual bool contains(const Point &p) const = 0;
-
-	virtual void moveTo(int16 x, int16 y) = 0;
-
-	virtual void moveTo(const Point &p) = 0;
-
-	virtual void translate(int16 dx, int16 dy) = 0;
-
-	virtual Rect getBoundingRect() const = 0;
-
-};
-
-} // end of namespace Common
-
-#endif

Modified: scummvm/branches/gsoc2008-vkeybd/dists/msvc8/scummvm.vcproj
===================================================================
--- scummvm/branches/gsoc2008-vkeybd/dists/msvc8/scummvm.vcproj	2008-08-07 14:16:48 UTC (rev 33679)
+++ scummvm/branches/gsoc2008-vkeybd/dists/msvc8/scummvm.vcproj	2008-08-07 15:44:48 UTC (rev 33680)
@@ -415,10 +415,6 @@
 				>
 			</File>
 			<File
-				RelativePath="..\..\common\shape.h"
-				>
-			</File>
-			<File
 				RelativePath="..\..\common\singleton.h"
 				>
 			</File>


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list