summaryrefslogtreecommitdiff
path: root/src/gui/gui.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2005-10-07 00:12:32 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2005-10-07 00:12:32 +0000
commita246c08cef5e4d598fc07a681eb971bfbcf01519 (patch)
treeff1813b11379ddef2c5be627aafcf3329170a293 /src/gui/gui.cpp
parent09db562f2fca5c49fa1a92ba0b6dc60db479ae08 (diff)
downloadmana-a246c08cef5e4d598fc07a681eb971bfbcf01519.tar.gz
mana-a246c08cef5e4d598fc07a681eb971bfbcf01519.tar.bz2
mana-a246c08cef5e4d598fc07a681eb971bfbcf01519.tar.xz
mana-a246c08cef5e4d598fc07a681eb971bfbcf01519.zip
Modified finding NPC as by timonator's suggestion in order to allow NPCs to be
clicked on their heads too. Also made start to tile engine improvement by adding the Sprite class that is now used by the floor items for being displayed on the map. Finally added documentation to Item class and splitted out Properties class from Map.
Diffstat (limited to 'src/gui/gui.cpp')
-rw-r--r--src/gui/gui.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp
index 48cbd522..365d8eba 100644
--- a/src/gui/gui.cpp
+++ b/src/gui/gui.cpp
@@ -192,7 +192,8 @@ Gui::~Gui()
delete guiInput;
}
-void Gui::logic()
+void
+Gui::logic()
{
gcn::Gui::logic();
@@ -201,7 +202,8 @@ void Gui::logic()
mFocusHandler->applyChanges();
}
-void Gui::draw()
+void
+Gui::draw()
{
mGraphics->pushClipArea(mTop->getDimension());
mTop->draw(mGraphics);
@@ -212,19 +214,24 @@ void Gui::draw()
if ((SDL_GetAppState() & SDL_APPMOUSEFOCUS || button & SDL_BUTTON(1))
&& mCustomCursor)
{
- dynamic_cast<Graphics*>(mGraphics)->drawImage(mMouseCursor, mouseX - 5, mouseY - 2);
+ dynamic_cast<Graphics*>(mGraphics)->drawImage(mMouseCursor,
+ mouseX - 5,
+ mouseY - 2);
}
mGraphics->popClipArea();
}
-void Gui::mousePress(int mx, int my, int button)
+void
+Gui::mousePress(int mx, int my, int button)
{
// Mouse pressed on window container (basically, the map)
// When conditions for walking are met, set new player destination
- if (player_node && player_node->action != Being::DEAD && current_npc == 0 &&
- button == gcn::MouseInput::LEFT)
+ if (player_node &&
+ player_node->action != Being::DEAD &&
+ current_npc == 0 &&
+ button == gcn::MouseInput::LEFT)
{
Map *tiledMap = engine->getCurrentMap();
int tilex = mx / 32 + camera_x;