2008-10-29 10:56:58 -07:00
|
|
|
/*
|
|
|
|
Copyright (C) 2008 by Warzone Resurrection Team
|
|
|
|
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU Lesser General Public License as
|
|
|
|
published by the Free Software Foundation, either version 3 of the
|
|
|
|
License, or (at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU Lesser General Public
|
|
|
|
License along with this program. If not, see
|
|
|
|
<http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
#ifndef QWZM_H
|
|
|
|
#define QWZM_H
|
|
|
|
|
|
|
|
#include <QApplication>
|
|
|
|
#include <QMainWindow>
|
|
|
|
#include <QtOpenGL>
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <ctype.h>
|
|
|
|
#include <errno.h>
|
|
|
|
#include <math.h>
|
|
|
|
|
|
|
|
extern "C" {
|
|
|
|
#include "wzmutils.h"
|
|
|
|
}
|
|
|
|
#include "ui_qwzm.h"
|
2008-12-09 12:59:57 -08:00
|
|
|
#include "ui_animationview.h"
|
2008-12-25 16:37:11 -08:00
|
|
|
#include "ui_connectorview.h"
|
2008-12-09 12:59:57 -08:00
|
|
|
|
|
|
|
/** Animation view */
|
|
|
|
class QAnimViewer : public QDialog, private Ui_AnimationView
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
QAnimViewer(QWidget *parent = 0);
|
|
|
|
~QAnimViewer();
|
|
|
|
void setModel(QStandardItemModel *model);
|
|
|
|
void updateModel();
|
2008-12-10 12:34:08 -08:00
|
|
|
QModelIndex selectedIndex();
|
2008-12-10 13:27:42 -08:00
|
|
|
void setSelectedIndex(int idx);
|
2008-12-09 12:59:57 -08:00
|
|
|
};
|
2008-10-29 10:56:58 -07:00
|
|
|
|
2008-12-25 16:37:11 -08:00
|
|
|
/** Connector view */
|
|
|
|
class QConnectorViewer : public QDialog, private Ui_ConnectorView
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
QConnectorViewer(QWidget *parent = 0);
|
|
|
|
~QConnectorViewer();
|
|
|
|
void setModel(QStandardItemModel *model);
|
|
|
|
void updateModel();
|
|
|
|
QModelIndex selectedIndex();
|
|
|
|
void setSelectedIndex(int idx);
|
|
|
|
};
|
|
|
|
|
2008-10-29 10:56:58 -07:00
|
|
|
/** WZM Viewer */
|
|
|
|
class QWzmViewer : public QMainWindow, private Ui::QWZM
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
QWzmViewer(QWidget *parent = 0);
|
|
|
|
~QWzmViewer();
|
|
|
|
|
|
|
|
protected slots:
|
|
|
|
void saveAs();
|
|
|
|
void save();
|
|
|
|
void open3DS();
|
|
|
|
void openWZM();
|
2008-11-02 12:52:00 -08:00
|
|
|
void openPIE();
|
2008-10-29 10:56:58 -07:00
|
|
|
void toggleWireframe();
|
|
|
|
void toggleCulling();
|
2008-12-09 12:59:57 -08:00
|
|
|
void setTeam(int index);
|
2008-10-29 10:56:58 -07:00
|
|
|
void tick();
|
|
|
|
void toggleAnimation();
|
2008-11-02 09:47:10 -08:00
|
|
|
void toggleScale();
|
2008-11-02 13:07:17 -08:00
|
|
|
void toggleSwapYZ();
|
|
|
|
void toggleReverseWinding();
|
|
|
|
void toggleFlipVerticalTexCoords();
|
2008-12-09 12:59:57 -08:00
|
|
|
void setMesh(int index);
|
|
|
|
void toggleEditAnimation();
|
2008-12-25 16:37:11 -08:00
|
|
|
void toggleEditConnectors();
|
2008-12-10 12:34:08 -08:00
|
|
|
void animLock();
|
|
|
|
void animUnlock();
|
2008-10-29 10:56:58 -07:00
|
|
|
|
2008-12-10 12:34:08 -08:00
|
|
|
void rowsChanged(const QModelIndex &parent, int start, int end);
|
|
|
|
void dataChanged(const QModelIndex &first, const QModelIndex &last);
|
|
|
|
void reloadFrames();
|
|
|
|
|
|
|
|
void prependFrame();
|
|
|
|
void appendFrame();
|
|
|
|
void removeFrame();
|
2008-12-09 13:27:19 -08:00
|
|
|
|
2008-10-29 10:56:58 -07:00
|
|
|
private:
|
|
|
|
QString filename;
|
2008-11-02 09:47:10 -08:00
|
|
|
MODEL *psModel;
|
2008-12-25 16:37:11 -08:00
|
|
|
QStandardItemModel anim, connectors;
|
2008-11-02 11:50:54 -08:00
|
|
|
void load3DS(QString input);
|
2008-11-02 12:52:00 -08:00
|
|
|
void loadPIE(QString input);
|
2008-11-02 13:31:51 -08:00
|
|
|
void setModel(QFileInfo &texPath);
|
2008-12-09 12:59:57 -08:00
|
|
|
QAnimViewer *animView;
|
2008-12-25 16:37:11 -08:00
|
|
|
QConnectorViewer *connectorView;
|
2008-10-29 10:56:58 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|