mirror of
https://github.com/rwengine/openrw.git
synced 2024-11-07 11:22:45 +01:00
commit
612a314126
@ -15,8 +15,8 @@
|
|||||||
#include <objects/VehicleObject.hpp>
|
#include <objects/VehicleObject.hpp>
|
||||||
|
|
||||||
|
|
||||||
ViewerWidget::ViewerWidget(QWidget* parent, const QGLWidget* shareWidget, Qt::WindowFlags f)
|
ViewerWidget::ViewerWidget(QGLFormat g, QWidget* parent, const QGLWidget* shareWidget, Qt::WindowFlags f)
|
||||||
: QGLWidget(parent, shareWidget, f)
|
: QGLWidget(g, parent, shareWidget, f)
|
||||||
, gworld(nullptr)
|
, gworld(nullptr)
|
||||||
, activeModel(nullptr)
|
, activeModel(nullptr)
|
||||||
, selectedFrame(nullptr)
|
, selectedFrame(nullptr)
|
||||||
@ -54,7 +54,7 @@ std::vector<WidgetVertex> widgetVerts = {
|
|||||||
void ViewerWidget::initializeGL()
|
void ViewerWidget::initializeGL()
|
||||||
{
|
{
|
||||||
QGLWidget::initializeGL();
|
QGLWidget::initializeGL();
|
||||||
timer.setInterval(16);
|
timer.setInterval(25);
|
||||||
connect(&timer, SIGNAL(timeout()), SLOT(updateGL()));
|
connect(&timer, SIGNAL(timeout()), SLOT(updateGL()));
|
||||||
timer.start();
|
timer.start();
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ class ViewerWidget : public QGLWidget
|
|||||||
void drawFrameWidget(ModelFrame* f, const glm::mat4& = glm::mat4(1.f));
|
void drawFrameWidget(ModelFrame* f, const glm::mat4& = glm::mat4(1.f));
|
||||||
public:
|
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();
|
virtual void initializeGL();
|
||||||
|
|
||||||
|
@ -46,7 +46,12 @@ ViewerWindow::ViewerWindow(QWidget* parent, Qt::WindowFlags flags)
|
|||||||
connect(ex, SIGNAL(triggered()), QApplication::instance(), SLOT(closeAllWindows()));
|
connect(ex, SIGNAL(triggered()), QApplication::instance(), SLOT(closeAllWindows()));
|
||||||
|
|
||||||
//----------------------- View Mode setup
|
//----------------------- View Mode setup
|
||||||
viewerWidget = new ViewerWidget;
|
|
||||||
|
QGLFormat glFormat;
|
||||||
|
glFormat.setVersion( 3, 3 );
|
||||||
|
glFormat.setProfile( QGLFormat::CoreProfile );
|
||||||
|
|
||||||
|
viewerWidget = new ViewerWidget(glFormat);
|
||||||
viewerWidget->context()->makeCurrent();
|
viewerWidget->context()->makeCurrent();
|
||||||
connect(this, SIGNAL(loadedData(GameWorld*)), viewerWidget, SLOT(dataLoaded(GameWorld*)));
|
connect(this, SIGNAL(loadedData(GameWorld*)), viewerWidget, SLOT(dataLoaded(GameWorld*)));
|
||||||
|
|
||||||
@ -164,7 +169,6 @@ void ViewerWindow::loadGame(const QString &path)
|
|||||||
|
|
||||||
// Initalize all the archives.
|
// Initalize all the archives.
|
||||||
gameWorld->data->loadIMG("/models/gta3");
|
gameWorld->data->loadIMG("/models/gta3");
|
||||||
gameWorld->data->loadIMG("/models/txd");
|
|
||||||
gameWorld->data->loadIMG("/anim/cuts");
|
gameWorld->data->loadIMG("/anim/cuts");
|
||||||
|
|
||||||
loadedData(gameWorld);
|
loadedData(gameWorld);
|
||||||
|
Loading…
Reference in New Issue
Block a user