[Scummvm-git-logs] scummvm master -> e5f0d3599266deb62064bae6d26ff7dbc45b24a0
aquadran
noreply at scummvm.org
Sun Sep 14 07:12:34 UTC 2025
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
e5f0d35992 WINTERMUTE: Small sync with original code
Commit: e5f0d3599266deb62064bae6d26ff7dbc45b24a0
https://github.com/scummvm/scummvm/commit/e5f0d3599266deb62064bae6d26ff7dbc45b24a0
Author: PaweÅ KoÅodziejski (aquadran at gmail.com)
Date: 2025-09-14T09:12:27+02:00
Commit Message:
WINTERMUTE: Small sync with original code
Changed paths:
engines/wintermute/ad/ad_scene.cpp
engines/wintermute/base/base_engine.cpp
engines/wintermute/base/base_fader.cpp
engines/wintermute/base/base_game.cpp
engines/wintermute/base/base_game.h
engines/wintermute/base/base_persistence_manager.cpp
engines/wintermute/base/base_script_holder.cpp
engines/wintermute/base/base_transition_manager.cpp
engines/wintermute/base/font/base_font_truetype.cpp
engines/wintermute/base/gfx/base_renderer.h
engines/wintermute/base/scriptables/script.cpp
engines/wintermute/base/scriptables/script.h
engines/wintermute/base/scriptables/script_engine.cpp
engines/wintermute/base/scriptables/script_engine.h
engines/wintermute/platform_osystem.cpp
engines/wintermute/platform_osystem.h
engines/wintermute/ui/ui_button.cpp
engines/wintermute/ui/ui_edit.cpp
diff --git a/engines/wintermute/ad/ad_scene.cpp b/engines/wintermute/ad/ad_scene.cpp
index 66bb68f9439..a361cef6aa4 100644
--- a/engines/wintermute/ad/ad_scene.cpp
+++ b/engines/wintermute/ad/ad_scene.cpp
@@ -59,6 +59,7 @@
#include "engines/wintermute/ui/ui_window.h"
#include "engines/wintermute/utils/utils.h"
#include "engines/wintermute/wintermute.h"
+#include "engines/wintermute/platform_osystem.h"
#include "engines/wintermute/dcgf.h"
#ifdef ENABLE_WME3D
@@ -558,7 +559,7 @@ bool AdScene::initLoop() {
#ifdef _DEBUGxxxx
int numSteps = 0;
uint32 start = _game->_currentTime;
- while (!_pfReady && g_system->getMillis() - start <= _pfMaxTime) {
+ while (!_pfReady && BasePlatform::getTime() - start <= _pfMaxTime) {
pathFinderStep();
numSteps++;
}
@@ -567,7 +568,7 @@ bool AdScene::initLoop() {
}
#else
uint32 start = _game->_currentTime;
- while (!_pfReady && g_system->getMillis() - start <= _pfMaxTime) {
+ while (!_pfReady && BasePlatform::getTime() - start <= _pfMaxTime) {
pathFinderStep();
}
#endif
diff --git a/engines/wintermute/base/base_engine.cpp b/engines/wintermute/base/base_engine.cpp
index 6848f98eea8..d039509f814 100644
--- a/engines/wintermute/base/base_engine.cpp
+++ b/engines/wintermute/base/base_engine.cpp
@@ -30,7 +30,10 @@
#include "engines/wintermute/base/base_engine.h"
#include "engines/wintermute/wintermute.h"
#include "engines/wintermute/system/sys_class_registry.h"
+#include "engines/wintermute/platform_osystem.h"
+
#include "common/system.h"
+
namespace Common {
DECLARE_SINGLETON(Wintermute::BaseEngine);
}
@@ -72,7 +75,7 @@ void BaseEngine::createInstance(const Common::String &targetName, const Common::
}
void BaseEngine::LOG(bool res, const char *fmt, ...) {
- uint32 secs = g_system->getMillis() / 1000;
+ uint32 secs = BasePlatform::getTime() / 1000;
uint32 hours = secs / 3600;
secs = secs % 3600;
uint32 mins = secs / 60;
diff --git a/engines/wintermute/base/base_fader.cpp b/engines/wintermute/base/base_fader.cpp
index 604beae43e6..99d86966c30 100644
--- a/engines/wintermute/base/base_fader.cpp
+++ b/engines/wintermute/base/base_fader.cpp
@@ -29,6 +29,8 @@
#include "engines/wintermute/base/base_engine.h"
#include "engines/wintermute/base/base_game.h"
#include "engines/wintermute/base/gfx/base_renderer.h"
+#include "engines/wintermute/platform_osystem.h"
+
#include "common/util.h"
namespace Wintermute {
@@ -69,7 +71,7 @@ bool BaseFader::update() {
uint32 time;
if (_system) {
- time = g_system->getMillis() - _startTime;
+ time = BasePlatform::getTime() - _startTime;
} else {
time = _game->_timer - _startTime;
}
@@ -126,7 +128,7 @@ bool BaseFader::fadeIn(uint32 sourceColor, uint32 duration, bool system) {
_system = system;
if (_system) {
- _startTime = g_system->getMillis();
+ _startTime = BasePlatform::getTime();
} else {
_startTime = _game->_timer;
}
@@ -152,7 +154,7 @@ bool BaseFader::fadeOut(uint32 targetColor, uint32 duration, bool system) {
_system = system;
if (_system) {
- _startTime = g_system->getMillis();
+ _startTime = BasePlatform::getTime();
} else {
_startTime = _game->_timer;
}
diff --git a/engines/wintermute/base/base_game.cpp b/engines/wintermute/base/base_game.cpp
index 8a464f4269b..cd5f2ee33ce 100644
--- a/engines/wintermute/base/base_game.cpp
+++ b/engines/wintermute/base/base_game.cpp
@@ -662,7 +662,7 @@ bool BaseGame::initialize3() { // renderer is initialized
void BaseGame::debugEnable(const char *filename) {
_debugMode = true;
- int secs = g_system->getMillis() / 1000;
+ int secs = BasePlatform::getTime() / 1000;
int hours = secs / 3600;
secs = secs % 3600;
int mins = secs / 60;
@@ -693,7 +693,7 @@ void BaseGame::debugDisable() {
//////////////////////////////////////////////////////////////////////
void BaseGame::LOG(bool res, const char *fmt, ...) {
- uint32 secs = g_system->getMillis() / 1000;
+ uint32 secs = BasePlatform::getTime() / 1000;
uint32 hours = secs / 3600;
secs = secs % 3600;
uint32 mins = secs / 60;
@@ -729,7 +729,7 @@ void BaseGame::setEngineLogCallback(ENGINE_LOG_CALLBACK callback, void *data) {
bool BaseGame::initLoop() {
_viewportSP = -1;
- _currentTime = g_system->getMillis();
+ _currentTime = BasePlatform::getTime();
_renderer->initLoop();
updateMusicCrossfade();
@@ -2750,6 +2750,46 @@ bool BaseGame::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack
stack->correctParams(0);
stack->pushNULL();
+ return STATUS_OK;
+ }
+
+ //////////////////////////////////////////////////////////////////////////
+ // ShowURLInBrowser
+ //////////////////////////////////////////////////////////////////////////
+ else if (strcmp(name, "ShowURLInBrowser") == 0) {
+ stack->correctParams(1);
+
+ /*const char *URLToShow = */stack->pop()->getString();
+ stack->pushNULL();
+
+ return STATUS_OK;
+ }
+
+ //////////////////////////////////////////////////////////////////////////
+ // advertisementPrepare
+ //////////////////////////////////////////////////////////////////////////
+ else if (strcmp(name, "advertisementPrepare") == 0) {
+ stack->correctParams(2);
+
+ /*const char *key = */stack->pop()->getString();
+ /*int32 number = */stack->pop()->getInt();
+ int32 ret = 0;
+ stack->pushInt(ret);
+
+ return STATUS_OK;
+ }
+
+ //////////////////////////////////////////////////////////////////////////
+ // advertisementShow
+ //////////////////////////////////////////////////////////////////////////
+ else if (strcmp(name, "advertisementShow") == 0) {
+ stack->correctParams(2);
+
+ /*const char *key = */stack->pop()->getString();
+ /*int32 number = */stack->pop()->getInt();
+ int32 ret = 0;
+ stack->pushInt(ret);
+
return STATUS_OK;
} else {
return BaseObject::scCallMethod(script, stack, thisStack, name);
@@ -2795,7 +2835,7 @@ ScValue *BaseGame::scGetProperty(const char *name) {
// WindowsTime (RO)
//////////////////////////////////////////////////////////////////////////
else if (strcmp(name, "WindowsTime") == 0) {
- _scValue->setInt((int)g_system->getMillis());
+ _scValue->setInt((int)BasePlatform::getTime());
return _scValue;
}
@@ -4165,7 +4205,7 @@ bool BaseGame::saveGame(int32 slot, const char *desc, bool quickSave) {
Common::String filename;
getSaveSlotFilename(slot, filename);
- _game->LOG(0, "Saving game '%s'...", filename.c_str());
+ LOG(0, "Saving game '%s'...", filename.c_str());
pluginEvents().applyEvent(WME_EVENT_GAME_BEFORE_SAVE, nullptr);
applyEvent("BeforeSave", true);
@@ -4180,8 +4220,9 @@ bool BaseGame::saveGame(int32 slot, const char *desc, bool quickSave) {
if (DID_SUCCEED(ret = pm->initSave(desc))) {
if (!quickSave) {
SAFE_DELETE(_saveLoadImage);
- if (_saveImageName)
+ if (_saveImageName) {
_saveLoadImage = _game->_renderer->createSurface();
+ }
if (!_saveLoadImage || DID_FAIL(_saveLoadImage->create(_saveImageName, true, 0, 0, 0))) {
SAFE_DELETE(_saveLoadImage);
}
@@ -5683,8 +5724,8 @@ bool BaseGame::miniUpdate() {
return true;
}
- if (g_system->getMillis() - _lastMiniUpdate > 200) {
- _lastMiniUpdate = g_system->getMillis();
+ if (BasePlatform::getTime() - _lastMiniUpdate > 200) {
+ _lastMiniUpdate = BasePlatform::getTime();
}
return true;
}
@@ -5724,9 +5765,8 @@ bool BaseGame::isDoubleClick(int32 buttonIndex) {
int moveX = ABS(pos.x - _lastClick[buttonIndex].posX);
int moveY = ABS(pos.y - _lastClick[buttonIndex].posY);
-
- if (_lastClick[buttonIndex].time == 0 || g_system->getMillis() - _lastClick[buttonIndex].time > maxDoubleCLickTime || moveX > maxMoveX || moveY > maxMoveY) {
- _lastClick[buttonIndex].time = g_system->getMillis();
+ if (_lastClick[buttonIndex].time == 0 || BasePlatform::getTime() - _lastClick[buttonIndex].time > maxDoubleCLickTime || moveX > maxMoveX || moveY > maxMoveY) {
+ _lastClick[buttonIndex].time = BasePlatform::getTime();
_lastClick[buttonIndex].posX = pos.x;
_lastClick[buttonIndex].posY = pos.y;
return false;
diff --git a/engines/wintermute/base/base_game.h b/engines/wintermute/base/base_game.h
index 8f4a8ac6f62..99b8faa0db2 100644
--- a/engines/wintermute/base/base_game.h
+++ b/engines/wintermute/base/base_game.h
@@ -307,7 +307,6 @@ public:
bool _loadInProgress;
UIWindow *_focusedWindow;
bool _editorForceScripts;
- static void afterLoadScene(void *scene, void *data);
static void afterLoadRegion(void *region, void *data);
static void afterLoadSubFrame(void *subframe, void *data);
static void afterLoadSound(void *sound, void *data);
@@ -316,6 +315,7 @@ public:
static void afterLoadXModel(void *model, void *data);
#endif
static void afterLoadScript(void *script, void *data);
+ static void afterLoadScene(void *scene, void *data);
static void invalidateValues(void *value, void *data);
bool loadSettings(const char *filename);
bool resumeMusic(int channel);
diff --git a/engines/wintermute/base/base_persistence_manager.cpp b/engines/wintermute/base/base_persistence_manager.cpp
index bc48a3277ed..6e4f1b6dedb 100644
--- a/engines/wintermute/base/base_persistence_manager.cpp
+++ b/engines/wintermute/base/base_persistence_manager.cpp
@@ -304,7 +304,7 @@ bool BasePersistenceManager::initSave(const Common::String &desc) {
g_system->getTimeAndDate(_savedTimestamp);
putTimeDate(_savedTimestamp);
- _savedPlayTime = g_system->getMillis();
+ _savedPlayTime = BasePlatform::getTime();
_saveStream->writeUint32LE(_savedPlayTime);
}
return STATUS_OK;
diff --git a/engines/wintermute/base/base_script_holder.cpp b/engines/wintermute/base/base_script_holder.cpp
index 9acc792df14..61689226cc2 100644
--- a/engines/wintermute/base/base_script_holder.cpp
+++ b/engines/wintermute/base/base_script_holder.cpp
@@ -463,7 +463,7 @@ ScScript *BaseScriptHolder::invokeMethodThread(const char *methodName) {
assert(debuggableEngine);
ScScript *thread = new DebuggableScript(_game, debuggableEngine);
#else
- ScScript *thread = new ScScript(_game, _scripts[i]->_engine);
+ ScScript *thread = new ScScript(_game, _scripts[i]->_engine);
#endif
if (thread) {
bool ret = thread->createMethodThread(_scripts[i], methodName);
diff --git a/engines/wintermute/base/base_transition_manager.cpp b/engines/wintermute/base/base_transition_manager.cpp
index b86df66c481..733b35b5fac 100644
--- a/engines/wintermute/base/base_transition_manager.cpp
+++ b/engines/wintermute/base/base_transition_manager.cpp
@@ -29,6 +29,7 @@
#include "engines/wintermute/base/base_game.h"
#include "engines/wintermute/base/base_engine.h"
#include "engines/wintermute/base/gfx/base_renderer.h"
+#include "engines/wintermute/platform_osystem.h"
namespace Wintermute {
@@ -92,7 +93,7 @@ bool BaseTransitionMgr::update() {
if (!_started) {
_started = true;
- _lastTime = g_system->getMillis();
+ _lastTime = BasePlatform::getTime();
}
switch (_type) {
@@ -101,7 +102,7 @@ bool BaseTransitionMgr::update() {
break;
case TRANSITION_FADE_OUT: {
- uint32 time = g_system->getMillis() - _lastTime;
+ uint32 time = BasePlatform::getTime() - _lastTime;
int alpha = (int)(255 - (float)time / (float)FADE_DURATION * 255);
alpha = MIN(255, MAX(alpha, 0));
_game->_renderer->fade((uint16)alpha);
@@ -113,7 +114,7 @@ bool BaseTransitionMgr::update() {
break;
case TRANSITION_FADE_IN: {
- uint32 time = g_system->getMillis() - _lastTime;
+ uint32 time = BasePlatform::getTime() - _lastTime;
int alpha = (int)((float)time / (float)FADE_DURATION * 255);
alpha = MIN(255, MAX(alpha, 0));
_game->_renderer->fade((uint16)alpha);
diff --git a/engines/wintermute/base/font/base_font_truetype.cpp b/engines/wintermute/base/font/base_font_truetype.cpp
index 3e013d4875a..102d05b9231 100644
--- a/engines/wintermute/base/font/base_font_truetype.cpp
+++ b/engines/wintermute/base/font/base_font_truetype.cpp
@@ -175,7 +175,7 @@ void BaseFontTT::drawText(const byte *text, int x, int y, int width, TTextAlign
surface = _cachedTexts[i]->_surface;
textOffset = _cachedTexts[i]->_textOffset;
_cachedTexts[i]->_marked = true;
- _cachedTexts[i]->_lastUsed = g_system->getMillis();
+ _cachedTexts[i]->_lastUsed = BasePlatform::getTime();
break;
} else {
if (_cachedTexts[i]->_lastUsed < minUseTime) {
@@ -205,7 +205,7 @@ void BaseFontTT::drawText(const byte *text, int x, int y, int width, TTextAlign
_cachedTexts[minIndex]->_text = textStr;
_cachedTexts[minIndex]->_textOffset = textOffset;
_cachedTexts[minIndex]->_marked = true;
- _cachedTexts[minIndex]->_lastUsed = g_system->getMillis();
+ _cachedTexts[minIndex]->_lastUsed = BasePlatform::getTime();
}
}
diff --git a/engines/wintermute/base/gfx/base_renderer.h b/engines/wintermute/base/gfx/base_renderer.h
index 572cb99eded..e63ef8594f6 100644
--- a/engines/wintermute/base/gfx/base_renderer.h
+++ b/engines/wintermute/base/gfx/base_renderer.h
@@ -50,7 +50,7 @@ class Camera3D;
* this interface is mainly intended to wrap away any differencies between
* software-rendering/hardware-rendering.
*/
-class BaseRenderer: public BaseClass {
+class BaseRenderer : public BaseClass {
public:
int _realWidth;
int _realHeight;
diff --git a/engines/wintermute/base/scriptables/script.cpp b/engines/wintermute/base/scriptables/script.cpp
index ca258c8e09f..7e9f6b4c414 100644
--- a/engines/wintermute/base/scriptables/script.cpp
+++ b/engines/wintermute/base/scriptables/script.cpp
@@ -1245,7 +1245,7 @@ bool ScScript::sleep(uint32 duration) {
_state = SCRIPT_SLEEPING;
if (_game->_state == GAME_FROZEN) {
- _waitTime = g_system->getMillis() + duration;
+ _waitTime = BasePlatform::getTime() + duration;
_waitFrozen = true;
} else {
_waitTime = _game->_timer + duration;
diff --git a/engines/wintermute/base/scriptables/script.h b/engines/wintermute/base/scriptables/script.h
index e553addc23e..5bce2c3795c 100644
--- a/engines/wintermute/base/scriptables/script.h
+++ b/engines/wintermute/base/scriptables/script.h
@@ -51,6 +51,8 @@ public:
bool finishThreads();
bool copyParameters(ScStack *stack);
+ void afterLoad();
+
ScValue *_operand;
ScValue *_reg1;
bool _freezable;
@@ -63,7 +65,6 @@ public:
ScScript *invokeEventHandler(const char *eventName, bool unbreakable = false);
uint32 _timeSlice;
DECLARE_PERSISTENT(ScScript, BaseClass)
- void afterLoad();
void runtimeError(const char *fmt, ...);
bool run();
bool finish(bool includingThreads = false);
diff --git a/engines/wintermute/base/scriptables/script_engine.cpp b/engines/wintermute/base/scriptables/script_engine.cpp
index 7fecf8f4a97..43bed32bee7 100644
--- a/engines/wintermute/base/scriptables/script_engine.cpp
+++ b/engines/wintermute/base/scriptables/script_engine.cpp
@@ -33,6 +33,7 @@
#include "engines/wintermute/base/base_game.h"
#include "engines/wintermute/base/base_file_manager.h"
#include "engines/wintermute/utils/utils.h"
+#include "engines/wintermute/platform_osystem.h"
#include "engines/wintermute/dcgf.h"
namespace Wintermute {
@@ -200,7 +201,7 @@ byte *ScEngine::getCompiledScript(const char *filename, uint32 *outSize, bool ig
if (!ignoreCache) {
for (int i = 0; i < MAX_CACHED_SCRIPTS; i++) {
if (_cachedScripts[i] && scumm_stricmp(_cachedScripts[i]->_filename, filename) == 0) {
- _cachedScripts[i]->_timestamp = g_system->getMillis();
+ _cachedScripts[i]->_timestamp = BasePlatform::getTime();
*outSize = _cachedScripts[i]->_size;
return _cachedScripts[i]->_buffer;
}
@@ -240,7 +241,7 @@ byte *ScEngine::getCompiledScript(const char *filename, uint32 *outSize, bool ig
CScCachedScript *cachedScript = new CScCachedScript(filename, compBuffer, compSize);
if (cachedScript) {
int index = 0;
- uint32 minTime = g_system->getMillis();
+ uint32 minTime = BasePlatform::getTime();
for (int i = 0; i < MAX_CACHED_SCRIPTS; i++) {
if (_cachedScripts[i] == nullptr) {
index = i;
@@ -306,7 +307,7 @@ bool ScEngine::tick() {
case SCRIPT_SLEEPING: {
if (_scripts[i]->_waitFrozen) {
- if (_scripts[i]->_waitTime <= g_system->getMillis()) {
+ if (_scripts[i]->_waitTime <= BasePlatform::getTime()) {
_scripts[i]->run();
}
} else {
@@ -350,13 +351,13 @@ bool ScEngine::tick() {
// time sliced script
if (_scripts[i]->_timeSlice > 0) {
- uint32 startTime = g_system->getMillis();
- while (_scripts[i]->_state == SCRIPT_RUNNING && g_system->getMillis() - startTime < _scripts[i]->_timeSlice) {
+ uint32 startTime = BasePlatform::getTime();
+ while (_scripts[i]->_state == SCRIPT_RUNNING && BasePlatform::getTime() - startTime < _scripts[i]->_timeSlice) {
_currentScript = _scripts[i];
_scripts[i]->executeInstruction();
}
if (_isProfiling && _scripts[i]->_filename) {
- addScriptTime(_scripts[i]->_filename, g_system->getMillis() - startTime);
+ addScriptTime(_scripts[i]->_filename, BasePlatform::getTime() - startTime);
}
}
@@ -365,7 +366,7 @@ bool ScEngine::tick() {
uint32 startTime = 0;
bool isProfiling = _isProfiling;
if (isProfiling) {
- startTime = g_system->getMillis();
+ startTime = BasePlatform::getTime();
}
while (_scripts[i]->_state == SCRIPT_RUNNING) {
@@ -373,7 +374,7 @@ bool ScEngine::tick() {
_scripts[i]->executeInstruction();
}
if (isProfiling && _scripts[i]->_filename) {
- addScriptTime(_scripts[i]->_filename, g_system->getMillis() - startTime);
+ addScriptTime(_scripts[i]->_filename, BasePlatform::getTime() - startTime);
}
}
_currentScript = nullptr;
@@ -598,7 +599,7 @@ void ScEngine::enableProfiling() {
// destroy old data, if any
_scriptTimes.clear();
- _profilingStartTime = g_system->getMillis();
+ _profilingStartTime = BasePlatform::getTime();
_isProfiling = true;
}
@@ -617,7 +618,7 @@ void ScEngine::disableProfiling() {
//////////////////////////////////////////////////////////////////////////
void ScEngine::dumpStats() {
error("DumpStats not ported to ScummVM yet");
- /* uint32 totalTime = g_system->getMillis() - _profilingStartTime;
+ /* uint32 totalTime = BasePlatform::getTime() - _profilingStartTime;
typedef std::vector <std::pair<uint32, std::string> > TimeVector;
TimeVector times;
diff --git a/engines/wintermute/base/scriptables/script_engine.h b/engines/wintermute/base/scriptables/script_engine.h
index 9ef43b407ee..4104f1d2182 100644
--- a/engines/wintermute/base/scriptables/script_engine.h
+++ b/engines/wintermute/base/scriptables/script_engine.h
@@ -31,6 +31,7 @@
#include "engines/wintermute/persistent.h"
#include "engines/wintermute/coll_templ.h"
#include "engines/wintermute/base/base.h"
+#include "engines/wintermute/platform_osystem.h"
namespace Wintermute {
@@ -44,7 +45,7 @@ public:
class CScCachedScript {
public:
CScCachedScript(const char *filename, byte *buffer, uint32 size) {
- _timestamp = g_system->getMillis();
+ _timestamp = BasePlatform::getTime();
_buffer = new byte[size];
if (_buffer) {
memcpy(_buffer, buffer, size);
diff --git a/engines/wintermute/platform_osystem.cpp b/engines/wintermute/platform_osystem.cpp
index 3b8699d6147..f0d088f3d06 100644
--- a/engines/wintermute/platform_osystem.cpp
+++ b/engines/wintermute/platform_osystem.cpp
@@ -151,6 +151,11 @@ void BasePlatform::handleEvent(Common::Event *event) {
//////////////////////////////////////////////////////////////////////////
// Win32 API bindings
+//////////////////////////////////////////////////////////////////////////
+uint32 BasePlatform::getTime() {
+ return g_system->getMillis();
+}
+
//////////////////////////////////////////////////////////////////////////
bool BasePlatform::getCursorPos(Common::Point32 *lpPoint) {
Common::Point p = g_system->getEventManager()->getMousePos();
diff --git a/engines/wintermute/platform_osystem.h b/engines/wintermute/platform_osystem.h
index 7fe55d39ad2..d44091e18f5 100644
--- a/engines/wintermute/platform_osystem.h
+++ b/engines/wintermute/platform_osystem.h
@@ -44,6 +44,7 @@ public:
static AnsiString getPlatformName();
// Win32 API bindings
+ static uint32 getTime();
static bool getCursorPos(Common::Point32 *lpPoint);
static bool setCursorPos(int x, int y);
diff --git a/engines/wintermute/ui/ui_button.cpp b/engines/wintermute/ui/ui_button.cpp
index 67f3c2936d8..a0a63125c3a 100644
--- a/engines/wintermute/ui/ui_button.cpp
+++ b/engines/wintermute/ui/ui_button.cpp
@@ -40,6 +40,7 @@
#include "engines/wintermute/base/scriptables/script_value.h"
#include "engines/wintermute/base/scriptables/script.h"
#include "engines/wintermute/base/scriptables/script_stack.h"
+#include "engines/wintermute/platform_osystem.h"
#include "engines/wintermute/dcgf.h"
namespace Wintermute {
@@ -651,7 +652,7 @@ bool UIButton::display(int offsetX, int offsetY) {
_hover = (!_disable && _game->_activeObject == this && (_game->_interactive || _game->_state == GAME_SEMI_FROZEN));
if ((_press && _hover && !_game->_mouseLeftDown) ||
- (_oneTimePress && g_system->getMillis() - _oneTimePressTime >= 100)) {
+ (_oneTimePress && BasePlatform::getTime() - _oneTimePressTime >= 100)) {
press();
}
@@ -1078,7 +1079,7 @@ bool UIButton::scCallMethod(ScScript *script, ScStack *stack, ScStack *thisStack
if (_visible && !_disable) {
_oneTimePress = true;
- _oneTimePressTime = g_system->getMillis();
+ _oneTimePressTime = BasePlatform::getTime();
}
stack->pushNULL();
diff --git a/engines/wintermute/ui/ui_edit.cpp b/engines/wintermute/ui/ui_edit.cpp
index f2a383a6e68..a020d85f852 100644
--- a/engines/wintermute/ui/ui_edit.cpp
+++ b/engines/wintermute/ui/ui_edit.cpp
@@ -44,6 +44,7 @@
#include "engines/wintermute/base/scriptables/script_stack.h"
#include "engines/wintermute/base/scriptables/script.h"
#include "engines/wintermute/utils/utils.h"
+#include "engines/wintermute/platform_osystem.h"
#include "engines/wintermute/dcgf.h"
#include "common/util.h"
@@ -673,8 +674,8 @@ bool UIEdit::display(int offsetX, int offsetY) {
// cursor
if (focused && curFirst) {
if (count) {
- if (g_system->getMillis() - _lastBlinkTime >= _cursorBlinkRate) {
- _lastBlinkTime = g_system->getMillis();
+ if (BasePlatform::getTime() - _lastBlinkTime >= _cursorBlinkRate) {
+ _lastBlinkTime = BasePlatform::getTime();
_cursorVisible = !_cursorVisible;
}
if (_cursorVisible) {
@@ -699,8 +700,8 @@ bool UIEdit::display(int offsetX, int offsetY) {
// cursor
if (focused && !curFirst) {
if (count) {
- if (g_system->getMillis() - _lastBlinkTime >= _cursorBlinkRate) {
- _lastBlinkTime = g_system->getMillis();
+ if (BasePlatform::getTime() - _lastBlinkTime >= _cursorBlinkRate) {
+ _lastBlinkTime = BasePlatform::getTime();
_cursorVisible = !_cursorVisible;
}
if (_cursorVisible) {
More information about the Scummvm-git-logs
mailing list