From 176e885ef6c5ae34c8c31c693b65e5a246146f3a Mon Sep 17 00:00:00 2001 From: Ira Rice Date: Mon, 15 Sep 2008 17:24:24 +0000 Subject: Commented out getBeingByPixel because it really isn't used, nor is there much sense to. Shouldn't make any visible changes to performance yet, but I trimmed it out for now anyways. --- src/beingmanager.cpp | 4 ++-- src/beingmanager.h | 2 +- src/gui/viewport.cpp | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/beingmanager.cpp b/src/beingmanager.cpp index d1a333d0..47729a92 100644 --- a/src/beingmanager.cpp +++ b/src/beingmanager.cpp @@ -124,7 +124,7 @@ Being* BeingManager::findBeing(Uint16 x, Uint16 y, Being::Type type) return (i == mBeings.end()) ? NULL : *i; } -Being* BeingManager::findBeingByPixel(Uint16 x, Uint16 y) +/*Being* BeingManager::findBeingByPixel(Uint16 x, Uint16 y) { BeingIterator itr = mBeings.begin(); BeingIterator itr_end = mBeings.end(); @@ -144,7 +144,7 @@ Being* BeingManager::findBeingByPixel(Uint16 x, Uint16 y) } return NULL; -} +}*/ Being* BeingManager::findBeingByName(std::string name, Being::Type type) { diff --git a/src/beingmanager.h b/src/beingmanager.h index ff2d1980..f8391855 100644 --- a/src/beingmanager.h +++ b/src/beingmanager.h @@ -67,7 +67,7 @@ class BeingManager * Return a being at specific coordinates. */ Being* findBeing(Uint16 x, Uint16 y, Being::Type type = Being::UNKNOWN); - Being* findBeingByPixel(Uint16 x, Uint16 y); + //Being* findBeingByPixel(Uint16 x, Uint16 y); /** * Return a being nearest to specific coordinates. diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp index e7fdb522..568c1ea3 100644 --- a/src/gui/viewport.cpp +++ b/src/gui/viewport.cpp @@ -384,10 +384,10 @@ Viewport::mousePressed(gcn::MouseEvent &event) FloorItem *item; // Interact with some being -// if ((being = beingManager->findBeing(tilex, tiley)) - int x = (int)((float) event.getX() + mPixelViewX); - int y = (int)((float) event.getY() + mPixelViewY); - if ((being = beingManager->findBeingByPixel(x, y))) +// int x = (int)((float) event.getX() + mPixelViewX); +// int y = (int)((float) event.getY() + mPixelViewY); +// if ((being = beingManager->findBeingByPixel(x, y))) + if ((being = beingManager->findBeing(tilex, tiley))) { switch (being->getType()) { -- cgit v1.2.3-70-g09d2