mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 23:23:52 +00:00
Fix simulation time reset in OpenCS when opening a new view
This commit is contained in:
parent
b90fc8ad92
commit
412e001edb
2 changed files with 8 additions and 1 deletions
|
@ -95,6 +95,7 @@ void RenderWidget::setVisibilityMask(int mask)
|
||||||
// --------------------------------------------------
|
// --------------------------------------------------
|
||||||
|
|
||||||
CompositeViewer::CompositeViewer()
|
CompositeViewer::CompositeViewer()
|
||||||
|
: mSimulationTime(0.0)
|
||||||
{
|
{
|
||||||
#if QT_VERSION >= 0x050000
|
#if QT_VERSION >= 0x050000
|
||||||
// Qt5 is currently crashing and reporting "Cannot make QOpenGLContext current in a different thread" when the viewer is run multi-threaded, this is regression from Qt4
|
// Qt5 is currently crashing and reporting "Cannot make QOpenGLContext current in a different thread" when the viewer is run multi-threaded, this is regression from Qt4
|
||||||
|
@ -124,7 +125,9 @@ CompositeViewer &CompositeViewer::get()
|
||||||
|
|
||||||
void CompositeViewer::update()
|
void CompositeViewer::update()
|
||||||
{
|
{
|
||||||
frame();
|
mSimulationTime += mFrameTimer.time_s();
|
||||||
|
mFrameTimer.setStartTick();
|
||||||
|
frame(mSimulationTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------
|
// ---------------------------------------------------
|
||||||
|
|
|
@ -100,6 +100,10 @@ namespace CSVRender
|
||||||
|
|
||||||
QTimer mTimer;
|
QTimer mTimer;
|
||||||
|
|
||||||
|
private:
|
||||||
|
osg::Timer mFrameTimer;
|
||||||
|
double mSimulationTime;
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void update();
|
void update();
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue