mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 18:35:04 +02:00
rename function for better clarity
This commit is contained in:
parent
a12034cb45
commit
2d199fe3d0
3 changed files with 4 additions and 4 deletions
|
@ -4679,7 +4679,7 @@ void Application::packetSent(quint64 length) {
|
|||
|
||||
void Application::registerScriptEngineWithApplicationServices(ScriptEngine* scriptEngine) {
|
||||
|
||||
scriptEngine->setPhysicsEnabledFunction([this]() {
|
||||
scriptEngine->setEmitScriptUpdatesFunction([this]() {
|
||||
return isPhysicsEnabled();
|
||||
});
|
||||
|
||||
|
|
|
@ -894,7 +894,7 @@ void ScriptEngine::run() {
|
|||
qint64 now = usecTimestampNow();
|
||||
|
||||
// we check for 'now' in the past in case people set their clock back
|
||||
if (_isPhysicsEnabledFunc() && _lastUpdate < now) {
|
||||
if (_emitScriptUpdates() && _lastUpdate < now) {
|
||||
float deltaTime = (float) (now - _lastUpdate) / (float) USECS_PER_SECOND;
|
||||
if (!_isFinished) {
|
||||
auto preUpdate = clock::now();
|
||||
|
|
|
@ -168,7 +168,7 @@ public:
|
|||
// NOTE - this is used by the TypedArray implemetation. we need to review this for thread safety
|
||||
ArrayBufferClass* getArrayBufferClass() { return _arrayBufferClass; }
|
||||
|
||||
void setPhysicsEnabledFunction(std::function<bool()> func) { _isPhysicsEnabledFunc = func; }
|
||||
void setEmitScriptUpdatesFunction(std::function<bool()> func) { _emitScriptUpdates = func; }
|
||||
|
||||
public slots:
|
||||
void callAnimationStateHandler(QScriptValue callback, AnimVariantMap parameters, QStringList names, bool useNames, AnimVariantResultHandler resultHandler);
|
||||
|
@ -239,7 +239,7 @@ protected:
|
|||
void doWithEnvironment(const EntityItemID& entityID, const QUrl& sandboxURL, std::function<void()> operation);
|
||||
void callWithEnvironment(const EntityItemID& entityID, const QUrl& sandboxURL, QScriptValue function, QScriptValue thisObject, QScriptValueList args);
|
||||
|
||||
std::function<bool()> _isPhysicsEnabledFunc{ [](){ return true; } };
|
||||
std::function<bool()> _emitScriptUpdates{ [](){ return true; } };
|
||||
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue