1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-07 11:22:45 +01:00

Merge pull request #187 from JayFoxRox/fix-rwviewer

Fix RWViewer
This commit is contained in:
Daniel Evans 2016-08-09 21:06:17 +01:00 committed by GitHub
commit 612a314126
3 changed files with 10 additions and 6 deletions

View File

@ -15,8 +15,8 @@
#include <objects/VehicleObject.hpp>
ViewerWidget::ViewerWidget(QWidget* parent, const QGLWidget* shareWidget, Qt::WindowFlags f)
: QGLWidget(parent, shareWidget, f)
ViewerWidget::ViewerWidget(QGLFormat g, QWidget* parent, const QGLWidget* shareWidget, Qt::WindowFlags f)
: QGLWidget(g, parent, shareWidget, f)
, gworld(nullptr)
, activeModel(nullptr)
, selectedFrame(nullptr)
@ -54,7 +54,7 @@ std::vector<WidgetVertex> widgetVerts = {
void ViewerWidget::initializeGL()
{
QGLWidget::initializeGL();
timer.setInterval(16);
timer.setInterval(25);
connect(&timer, SIGNAL(timeout()), SLOT(updateGL()));
timer.start();

View File

@ -52,7 +52,7 @@ class ViewerWidget : public QGLWidget
void drawFrameWidget(ModelFrame* f, const glm::mat4& = glm::mat4(1.f));
public:
ViewerWidget(QWidget* parent = 0, const QGLWidget* shareWidget = 0, Qt::WindowFlags f = 0);
ViewerWidget(QGLFormat g, QWidget* parent = 0, const QGLWidget* shareWidget = 0, Qt::WindowFlags f = 0);
virtual void initializeGL();

View File

@ -46,7 +46,12 @@ ViewerWindow::ViewerWindow(QWidget* parent, Qt::WindowFlags flags)
connect(ex, SIGNAL(triggered()), QApplication::instance(), SLOT(closeAllWindows()));
//----------------------- View Mode setup
viewerWidget = new ViewerWidget;
QGLFormat glFormat;
glFormat.setVersion( 3, 3 );
glFormat.setProfile( QGLFormat::CoreProfile );
viewerWidget = new ViewerWidget(glFormat);
viewerWidget->context()->makeCurrent();
connect(this, SIGNAL(loadedData(GameWorld*)), viewerWidget, SLOT(dataLoaded(GameWorld*)));
@ -164,7 +169,6 @@ void ViewerWindow::loadGame(const QString &path)
// Initalize all the archives.
gameWorld->data->loadIMG("/models/gta3");
gameWorld->data->loadIMG("/models/txd");
gameWorld->data->loadIMG("/anim/cuts");
loadedData(gameWorld);