mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-09 19:32:11 +00:00
MACVENTURE: Soften conditions for object selection
This commit is contained in:
parent
2ba8b1ca8c
commit
c36f8c429f
@ -308,6 +308,9 @@ void Gui::updateWindowInfo(WindowReference ref, ObjID objID, const Common::Array
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Gui::addChild(WindowReference target, ObjID child) {
|
void Gui::addChild(WindowReference target, ObjID child) {
|
||||||
|
// HACK WRONG!! Please delete me when you are done testing!
|
||||||
|
if (child == 92) return; // Avoid adding the stones in the waterfall
|
||||||
|
|
||||||
findWindowData(target).children.push_back(DrawableObject(child, kBlitBIC));
|
findWindowData(target).children.push_back(DrawableObject(child, kBlitBIC));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -819,7 +822,7 @@ void Gui::updateExit(ObjID obj) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Gui::printText(const Common::String & text) {
|
void Gui::printText(const Common::String & text) {
|
||||||
debug("Print Text: %s", text);
|
debug(1, "Print Text: %s", text.c_str());
|
||||||
_consoleText->printLine(text, _outConsoleWindow->getDimensions().width());
|
_consoleText->printLine(text, _outConsoleWindow->getDimensions().width());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -947,16 +950,12 @@ void Gui::checkSelect(const WindowData &data, const Common::Event &event, const
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool Gui::canBeSelected(ObjID obj, const Common::Event &event, const Common::Rect &clickRect, WindowReference ref) {
|
bool Gui::canBeSelected(ObjID obj, const Common::Event &event, const Common::Rect &clickRect, WindowReference ref) {
|
||||||
return (_engine->isObjVisible(obj) &&
|
return (_engine->isObjClickable(obj) &&
|
||||||
_engine->isObjClickable(obj) &&
|
|
||||||
isRectInsideObject(clickRect, obj));
|
isRectInsideObject(clickRect, obj));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Gui::isRectInsideObject(Common::Rect target, ObjID obj) {
|
bool Gui::isRectInsideObject(Common::Rect target, ObjID obj) {
|
||||||
if (_assets.contains(obj) &&
|
if (_assets.contains(obj)) {
|
||||||
//_engine->isObjClickable(obj) &&
|
|
||||||
_engine->isObjVisible(obj))
|
|
||||||
{
|
|
||||||
Common::Rect bounds = _engine->getObjBounds(obj);
|
Common::Rect bounds = _engine->getObjBounds(obj);
|
||||||
Common::Rect intersection = bounds.findIntersectingRect(target);
|
Common::Rect intersection = bounds.findIntersectingRect(target);
|
||||||
// We translate it to the image's coord system
|
// We translate it to the image's coord system
|
||||||
@ -966,7 +965,6 @@ bool Gui::isRectInsideObject(Common::Rect target, ObjID obj) {
|
|||||||
intersection.left - bounds.left + intersection.width(),
|
intersection.left - bounds.left + intersection.width(),
|
||||||
intersection.top - bounds.top + intersection.height());
|
intersection.top - bounds.top + intersection.height());
|
||||||
|
|
||||||
|
|
||||||
if (_assets[obj]->isRectInside(intersection)) {
|
if (_assets[obj]->isRectInside(intersection)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -122,7 +122,6 @@ void ImageAsset::decodePPIC(ObjID id, Common::Array<byte> &data) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ImageAsset::decodePPIC0(Common::BitStream & stream, Common::Array<byte> &data) {
|
void ImageAsset::decodePPIC0(Common::BitStream & stream, Common::Array<byte> &data) {
|
||||||
warning("Untested loading function: decode PPIC0");
|
|
||||||
uint words = _bitWidth >> 4;
|
uint words = _bitWidth >> 4;
|
||||||
uint bytes = _bitWidth & 0xF;
|
uint bytes = _bitWidth & 0xF;
|
||||||
uint v = 0;
|
uint v = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user