2016-05-16 01:06:51 +02:00
|
|
|
#ifndef _RWVIEWER_VIEWERINTERFACE_HPP_
|
|
|
|
#define _RWVIEWER_VIEWERINTERFACE_HPP_
|
|
|
|
#include <engine/GameWorld.hpp>
|
|
|
|
|
|
|
|
#include <ViewerWidget.hpp>
|
|
|
|
|
|
|
|
#include <QWidget>
|
|
|
|
|
2016-09-09 22:13:21 +02:00
|
|
|
class ViewerInterface : public QWidget {
|
|
|
|
Q_OBJECT
|
2016-05-16 01:06:51 +02:00
|
|
|
public:
|
2016-09-09 22:13:21 +02:00
|
|
|
ViewerInterface(QWidget* parent = 0, Qt::WindowFlags f = 0)
|
|
|
|
: QWidget(parent, f), m_world(nullptr) {
|
|
|
|
}
|
2016-05-16 01:06:51 +02:00
|
|
|
|
2016-09-09 22:13:21 +02:00
|
|
|
GameWorld* world() {
|
|
|
|
return m_world;
|
|
|
|
}
|
2016-05-16 01:06:51 +02:00
|
|
|
|
|
|
|
protected:
|
2018-01-16 02:05:23 +01:00
|
|
|
virtual void worldChanged() {}
|
|
|
|
|
|
|
|
ViewerWidget* createViewer();
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void gameLoaded(GameWorld*, GameRenderer*);
|
2016-05-16 01:06:51 +02:00
|
|
|
|
|
|
|
public slots:
|
2018-01-16 02:05:23 +01:00
|
|
|
void showData(GameWorld* world, GameRenderer* renderer) {
|
2016-09-09 22:13:21 +02:00
|
|
|
m_world = world;
|
2018-01-16 02:05:23 +01:00
|
|
|
gameLoaded(world, renderer);
|
2016-09-09 22:13:21 +02:00
|
|
|
worldChanged();
|
|
|
|
}
|
2016-05-16 01:06:51 +02:00
|
|
|
|
|
|
|
private:
|
2016-09-09 22:13:21 +02:00
|
|
|
GameWorld* m_world;
|
2016-05-16 01:06:51 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|