summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/engine.cpp9
-rw-r--r--src/game.cpp2
-rw-r--r--src/gui/stats.cpp7
-rw-r--r--src/gui/stats.h7
-rw-r--r--src/gui/status.cpp7
-rw-r--r--src/gui/status.h7
6 files changed, 26 insertions, 13 deletions
diff --git a/src/engine.cpp b/src/engine.cpp
index 50e271de..97ba1c2c 100644
--- a/src/engine.cpp
+++ b/src/engine.cpp
@@ -43,8 +43,6 @@
#include "gui/gui.h"
#include "gui/minimap.h"
-#include "gui/stats.h"
-#include "gui/status.h"
#include "gui/windowcontainer.h"
#include "resources/image.h"
@@ -467,13 +465,6 @@ void Engine::draw()
gcn::Graphics::CENTER);
}
- if (statsWindow->isVisible()) {
- statsWindow->update();
- }
- if (statusWindow->isVisible()) {
- statusWindow->update();
- }
-
std::stringstream debugStream;
debugStream << "[" << fps << " fps] " << mouseTileX << ", " << mouseTileY;
diff --git a/src/game.cpp b/src/game.cpp
index bbfbee9e..c40a052c 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -1460,7 +1460,6 @@ void do_parse()
player_node->aspd = RFIFOW(4);
break;
}
- statusWindow->update();
if (char_info->hp == 0 && deathNotice == NULL) {
deathNotice = new OkDialog("Message",
"You're now dead, press ok to restart",
@@ -1849,7 +1848,6 @@ void do_parse()
char_info->DEXUp = RFIFOB(13);
char_info->LUK = RFIFOB(14);
char_info->LUKUp = RFIFOB(15);
- statusWindow->update();
break;
// Updates status point
case 0x00be:
diff --git a/src/gui/stats.cpp b/src/gui/stats.cpp
index c5afe82d..f03d2bfc 100644
--- a/src/gui/stats.cpp
+++ b/src/gui/stats.cpp
@@ -142,6 +142,13 @@ StatsWindow::~StatsWindow() {
delete remainingStatsPointsLabel;
}
+void StatsWindow::draw(gcn::Graphics *graphics)
+{
+ update();
+
+ Window::draw(graphics);
+}
+
void StatsWindow::action(const std::string& eventId) {
WFIFOW(0) = net_w_value(0x00bb);
diff --git a/src/gui/stats.h b/src/gui/stats.h
index 54bd892b..3d7d0f52 100644
--- a/src/gui/stats.h
+++ b/src/gui/stats.h
@@ -53,11 +53,16 @@ class StatsWindow : public Window, public gcn::ActionListener {
void action(const std::string& eventId);
/**
+ * Draw this window
+ */
+ void draw(gcn::Graphics *graphics);
+
+ private:
+ /**
* Updates stats in window.
*/
void update();
- private:
int i;
/**
diff --git a/src/gui/status.cpp b/src/gui/status.cpp
index c903261c..7ba14fc7 100644
--- a/src/gui/status.cpp
+++ b/src/gui/status.cpp
@@ -206,6 +206,13 @@ void StatusWindow::update()
delete[] tempstr;
}
+void StatusWindow::draw(gcn::Graphics *graphics)
+{
+ update();
+
+ Window::draw(graphics);
+}
+
void StatusWindow::action(const std::string& eventId)
{
if (eventId == "Stats") {
diff --git a/src/gui/status.h b/src/gui/status.h
index 7ef57ed9..45ccb75d 100644
--- a/src/gui/status.h
+++ b/src/gui/status.h
@@ -56,11 +56,16 @@ class StatusWindow : public Window, public gcn::ActionListener {
void action(const std::string& eventId);
/**
+ * Draw this window
+ */
+ void draw(gcn::Graphics *graphics);
+
+ private:
+ /**
* Updates this dialog with values from PLAYER_INFO *char_info
*/
void update();
- private:
gcn::Label *hp, *sp;
gcn::Label *hpValue, *spValue;
gcn::Label *expLabel, *jobExpLabel;