aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2010-03-11 23:41:28 +0000
committerMax Horn2010-03-11 23:41:28 +0000
commit4fc8ebab017a18b83ca82e930f02ceeac6313de7 (patch)
tree6163fdafc910ab046072f3393edbca2ab0341d7d
parent6e78fdc161501ed6d2be0e4004915b3660623647 (diff)
downloadscummvm-rg350-4fc8ebab017a18b83ca82e930f02ceeac6313de7.tar.gz
scummvm-rg350-4fc8ebab017a18b83ca82e930f02ceeac6313de7.tar.bz2
scummvm-rg350-4fc8ebab017a18b83ca82e930f02ceeac6313de7.zip
GUI: Remove GuiObject::getMillis()
svn-id: r48241
-rw-r--r--engines/scumm/dialogs.cpp10
-rw-r--r--gui/ListWidget.cpp2
-rw-r--r--gui/PopUpWidget.cpp4
-rw-r--r--gui/about.cpp4
-rw-r--r--gui/editable.cpp4
-rw-r--r--gui/message.cpp4
-rw-r--r--gui/object.cpp4
-rw-r--r--gui/object.h4
8 files changed, 14 insertions, 22 deletions
diff --git a/engines/scumm/dialogs.cpp b/engines/scumm/dialogs.cpp
index f3bc6f3216..906d8754b3 100644
--- a/engines/scumm/dialogs.cpp
+++ b/engines/scumm/dialogs.cpp
@@ -674,7 +674,7 @@ void ValueDisplayDialog::drawDialog() {
}
void ValueDisplayDialog::handleTickle() {
- if (getMillis() > _timer) {
+ if (g_system->getMillis() > _timer) {
close();
}
}
@@ -702,7 +702,7 @@ void ValueDisplayDialog::handleKeyDown(Common::KeyState state) {
_value--;
setResult(_value);
- _timer = getMillis() + kDisplayDelay;
+ _timer = g_system->getMillis() + kDisplayDelay;
draw();
} else {
close();
@@ -712,7 +712,7 @@ void ValueDisplayDialog::handleKeyDown(Common::KeyState state) {
void ValueDisplayDialog::open() {
GUI_Dialog::open();
setResult(_value);
- _timer = getMillis() + kDisplayDelay;
+ _timer = g_system->getMillis() + kDisplayDelay;
}
SubtitleSettingsDialog::SubtitleSettingsDialog(ScummEngine *scumm, int value)
@@ -722,7 +722,7 @@ SubtitleSettingsDialog::SubtitleSettingsDialog(ScummEngine *scumm, int value)
void SubtitleSettingsDialog::handleTickle() {
InfoDialog::handleTickle();
- if (getMillis() > _timer)
+ if (g_system->getMillis() > _timer)
close();
}
@@ -759,7 +759,7 @@ void SubtitleSettingsDialog::cycleValue() {
else
setInfoText(subtitleDesc[_value]);
- _timer = getMillis() + 1500;
+ _timer = g_system->getMillis() + 1500;
}
Indy3IQPointsDialog::Indy3IQPointsDialog(ScummEngine *scumm, char* text)
diff --git a/gui/ListWidget.cpp b/gui/ListWidget.cpp
index baaa29aecb..f138fe7cc1 100644
--- a/gui/ListWidget.cpp
+++ b/gui/ListWidget.cpp
@@ -290,7 +290,7 @@ bool ListWidget::handleKeyDown(Common::KeyState state) {
// Quick selection mode: Go to first list item starting with this key
// (or a substring accumulated from the last couple key presses).
// Only works in a useful fashion if the list entries are sorted.
- uint32 time = getMillis();
+ uint32 time = g_system->getMillis();
if (_quickSelectTime < time) {
_quickSelectStr = (char)state.ascii;
} else {
diff --git a/gui/PopUpWidget.cpp b/gui/PopUpWidget.cpp
index d0828a69f6..7463399e0b 100644
--- a/gui/PopUpWidget.cpp
+++ b/gui/PopUpWidget.cpp
@@ -170,7 +170,7 @@ void PopUpDialog::drawDialog() {
if (_openTime == 0) {
// Time the popup was opened
- _openTime = getMillis();
+ _openTime = g_system->getMillis();
}
}
@@ -178,7 +178,7 @@ void PopUpDialog::handleMouseUp(int x, int y, int button, int clickCount) {
// Mouse was released. If it wasn't moved much since the original mouse down,
// let the popup stay open. If it did move, assume the user made his selection.
int dist = (_clickX - x) * (_clickX - x) + (_clickY - y) * (_clickY - y);
- if (dist > 3 * 3 || getMillis() - _openTime > 300) {
+ if (dist > 3 * 3 || g_system->getMillis() - _openTime > 300) {
setResult(_selection);
close();
}
diff --git a/gui/about.cpp b/gui/about.cpp
index e2b651ee05..650c42d97c 100644
--- a/gui/about.cpp
+++ b/gui/about.cpp
@@ -175,7 +175,7 @@ void AboutDialog::addLine(const char *str) {
void AboutDialog::open() {
- _scrollTime = getMillis() + kScrollStartDelay;
+ _scrollTime = g_system->getMillis() + kScrollStartDelay;
_scrollPos = 0;
_willClose = false;
@@ -253,7 +253,7 @@ void AboutDialog::drawDialog() {
}
void AboutDialog::handleTickle() {
- const uint32 t = getMillis();
+ const uint32 t = g_system->getMillis();
int scrollOffset = ((int)t - (int)_scrollTime) / kScrollMillisPerPixel;
if (scrollOffset > 0) {
int modifiers = g_system->getEventManager()->getModifierState();
diff --git a/gui/editable.cpp b/gui/editable.cpp
index aa95588da9..2b08b91fd2 100644
--- a/gui/editable.cpp
+++ b/gui/editable.cpp
@@ -77,7 +77,7 @@ bool EditableWidget::tryInsertChar(byte c, int pos) {
}
void EditableWidget::handleTickle() {
- uint32 time = getMillis();
+ uint32 time = g_system->getMillis();
if (_caretTime < time) {
_caretTime = time + kCaretBlinkTime;
drawCaret(_caretVisible);
@@ -287,7 +287,7 @@ bool EditableWidget::adjustOffset() {
}
void EditableWidget::makeCaretVisible() {
- _caretTime = getMillis() + kCaretBlinkTime;
+ _caretTime = g_system->getMillis() + kCaretBlinkTime;
_caretVisible = true;
drawCaret(false);
}
diff --git a/gui/message.cpp b/gui/message.cpp
index 7dc850482b..e4f0bb12da 100644
--- a/gui/message.cpp
+++ b/gui/message.cpp
@@ -110,12 +110,12 @@ void MessageDialog::handleCommand(CommandSender *sender, uint32 cmd, uint32 data
TimedMessageDialog::TimedMessageDialog(const Common::String &message, uint32 duration)
: MessageDialog(message, 0, 0) {
- _timer = getMillis() + duration;
+ _timer = g_system->getMillis() + duration;
}
void TimedMessageDialog::handleTickle() {
MessageDialog::handleTickle();
- if (getMillis() > _timer)
+ if (g_system->getMillis() > _timer)
close();
}
diff --git a/gui/object.cpp b/gui/object.cpp
index 2267eb83b5..f24ce0997e 100644
--- a/gui/object.cpp
+++ b/gui/object.cpp
@@ -40,10 +40,6 @@ GuiObject::~GuiObject() {
_firstWidget = 0;
}
-uint32 GuiObject::getMillis() {
- return g_system->getMillis();
-}
-
void GuiObject::reflowLayout() {
if (!_name.empty()) {
if (!g_gui.xmlEval()->getWidgetData(_name, _x, _y, _w, _h)) {
diff --git a/gui/object.h b/gui/object.h
index d188807a16..1c8bcdfdcc 100644
--- a/gui/object.h
+++ b/gui/object.h
@@ -86,10 +86,6 @@ public:
protected:
virtual void releaseFocus() = 0;
-
- // Convenience alias for OSystem::getMillis().
- // This is a bit hackish, of course :-).
- uint32 getMillis();
};
} // End of namespace GUI