/* _______ __ __ __ ______ __ __ _______ __ __ * / _____/\ / /\ / /\ / /\ / ____/\ / /\ / /\ / ___ /\ / |\/ /\ * / /\____\// / // / // / // /\___\// /_// / // /\_/ / // , |/ / / * / / /__ / / // / // / // / / / ___ / // ___ / // /| ' / / * / /_// /\ / /_// / // / // /_/_ / / // / // /\_/ / // / | / / * /______/ //______/ //_/ //_____/\ /_/ //_/ //_/ //_/ //_/ /|_/ / * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/ * * Copyright (c) 2004, 2005, 2006, 2007 Olof Naessén and Per Larsson * * Js_./ * Per Larsson a.k.a finalman _RqZ{a<^_aa * Olof Naessén a.k.a jansem/yakslem _asww7!uY`> )\a// * _Qhm`] _f "'c 1!5m * Visit: http://guichan.darkbits.org )Qk

ws?a-?' ._/L #' * binary forms, with or without )4d[#7r, . ' )d`)[ * modification, are permitted provided _Q-5'5W..j/?' -?!\)cam' * that the following conditions are met: j<. a J@\ * this list of conditions and the j(]1ux = x; this->y = y; this->width = width; this->height = height; } void Rectangle::setAll(int x, int y, int width, int height) { this->x = x; this->y = y; this->width = width; this->height = height; } bool Rectangle::intersect(const Rectangle& rectangle) { x -= rectangle.x; y -= rectangle.y; if (x < 0) { width += x; x = 0; } if (y < 0) { height += y; y = 0; } if (x + width > rectangle.width) { width = rectangle.width - x; } if (y + height > rectangle.height) { height = rectangle.height - y; } if (width <= 0 || height <= 0) { height = 0; width = 0; x += rectangle.x; y += rectangle.y; return false; } x += rectangle.x; y += rectangle.y; return true; } bool Rectangle::isPointInRect(int x, int y) const { return ((x >= this->x) && (y >= this->y) && x < (this->x + this->width) && y < (this->y + this->height)); } }