diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/tile_editor/tile_editor_main_window.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/tile_editor/tile_editor_main_window.cpp
index c367addbe..930ae9d8b 100644
--- a/code/nel/tools/3d/object_viewer_qt/src/plugins/tile_editor/tile_editor_main_window.cpp
+++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/tile_editor/tile_editor_main_window.cpp
@@ -139,7 +139,7 @@ TileEditorMainWindow::TileEditorMainWindow(QWidget *parent)
m_zoomSignalMapper->setMapping(m_ui->actionZoom100, 1);
connect(m_ui->actionZoom200, SIGNAL(triggered()), m_zoomSignalMapper, SLOT(map()));
m_zoomSignalMapper->setMapping(m_ui->actionZoom200, 2);
- connect(m_zoomSignalMapper, SIGNAL(mapped(int)), m_model, SLOT(onZoomFactor(int)));
+ connect(m_zoomSignalMapper, SIGNAL(mapped(int)), this, SLOT(onZoomFactor(int)));
}
TileEditorMainWindow::~TileEditorMainWindow()
@@ -158,6 +158,53 @@ TileEditorMainWindow::~TileEditorMainWindow()
delete m_zoomSignalMapper;
}
+void TileEditorMainWindow::onZoomFactor(int level)
+{
+ int tile128Scaled=TileModel::TILE_128_BASE_SIZE;
+ int tile256Scaled=TileModel::TILE_256_BASE_SIZE;
+ int tileTransScaled=TileModel::TILE_TRANSITION_BASE_SIZE;
+ int tileDispScaled=TileModel::TILE_DISPLACE_BASE_SIZE;
+ switch(level)
+ {
+ // Zoom Level 50%
+ case 0:
+ nlinfo("zooming to 50%");
+ TileModel::CurrentZoomFactor = TileModel::TileZoom50;
+ tile128Scaled /= 2;
+ tile256Scaled /= 2;
+ tileTransScaled /= 2;
+ tileDispScaled /= 2;
+ break;
+ case 1:
+ nlinfo("zooming to 100%");
+ TileModel::CurrentZoomFactor = TileModel::TileZoom100;
+ break;
+ case 2:
+ nlinfo("zooming to 200%");
+ TileModel::CurrentZoomFactor = TileModel::TileZoom200;
+ tile128Scaled *= 2;
+ tile256Scaled *= 2;
+ tileTransScaled *= 2;
+ tileDispScaled *= 2;
+ break;
+ default:
+ nlwarning("Invalid Time Zoom Factor passed.");
+ break;
+ };
+
+ nlinfo("resizing transition view. base size: %d factor %d to: %d", TileModel::TILE_TRANSITION_BASE_SIZE, level, tileTransScaled);
+
+ m_ui->listView128->setIconSize(QSize(tile128Scaled, tile128Scaled));
+ m_ui->listView128->setCurrentIndex(m_ui->listView128->model()->index(0, 0, m_ui->listView128->rootIndex()));
+ m_ui->listView256->setIconSize(QSize(tile256Scaled, tile256Scaled));
+ m_ui->listView256->setCurrentIndex(m_ui->listView256->model()->index(0, 0, m_ui->listView256->rootIndex()));
+ m_ui->listViewTransition->setIconSize(QSize(tileTransScaled, tileTransScaled));
+ m_ui->listViewTransition->setCurrentIndex(m_ui->listViewTransition->model()->index(0, 0, m_ui->listViewTransition->rootIndex()));
+ m_ui->listViewDisplacement->setIconSize(QSize(tileDispScaled, tileDispScaled));
+ m_ui->listViewDisplacement->setCurrentIndex(m_ui->listViewDisplacement->model()->index(0, 0, m_ui->listViewDisplacement->rootIndex()));
+ m_ui->listViewTransition->repaint();
+}
+
void TileEditorMainWindow::onActionAddTile(bool triggered)
{
onActionAddTile(m_ui->tileViewTabWidget->currentIndex());
diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/tile_editor/tile_editor_main_window.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/tile_editor/tile_editor_main_window.h
index 8233d16d3..ae3520465 100644
--- a/code/nel/tools/3d/object_viewer_qt/src/plugins/tile_editor/tile_editor_main_window.h
+++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/tile_editor/tile_editor_main_window.h
@@ -40,7 +40,7 @@ public:
explicit TileEditorMainWindow(QWidget *parent = 0);
~TileEditorMainWindow();
- QUndoStack *getUndoStack() { return m_undoStack; }
+ QUndoStack *getUndoStack() { return m_undoStack; }
public Q_SLOTS:
void onActionAddTile(bool triggered);
@@ -48,7 +48,8 @@ public Q_SLOTS:
void onActionReplaceImage(bool triggered);
void onActionDeleteImage(bool triggered);
void onTileSetAdd();
- void changeActiveTileSet(const QModelIndex &newIndex, const QModelIndex &oldIndex);
+ void changeActiveTileSet(const QModelIndex &newIndex, const QModelIndex &oldIndex);
+ void onZoomFactor(int level);
private:
void onActionAddTile(int tabId);
diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/tile_editor/tile_editor_main_window.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/tile_editor/tile_editor_main_window.ui
index 7bf82ca05..66a086179 100644
--- a/code/nel/tools/3d/object_viewer_qt/src/plugins/tile_editor/tile_editor_main_window.ui
+++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/tile_editor/tile_editor_main_window.ui
@@ -155,6 +155,9 @@
64
+
+ QListView::Static
+
QListView::LeftToRight
@@ -226,6 +229,9 @@
32
+
+ QListView::Static
+
QListView::LeftToRight
diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/tile_editor/tile_item.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/tile_editor/tile_item.cpp
index adf381dc0..fcd14a61b 100644
--- a/code/nel/tools/3d/object_viewer_qt/src/plugins/tile_editor/tile_item.cpp
+++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/tile_editor/tile_item.cpp
@@ -223,7 +223,7 @@ TileItemNode::TileItemNode(int tileId, TileModel::TTileChannel channel, QString
{
m_tileFilename[channel] = filename;
m_parentItem = parent;
- nlinfo("dispalying tile %d - %s", m_tileId, m_tileFilename[TileModel::TileDiffuse].toStdString().c_str());
+ //nlinfo("dispalying tile %d - %s", m_tileId, m_tileFilename[TileModel::TileDiffuse].toStdString().c_str());
}
TileItemNode::~TileItemNode()
@@ -257,7 +257,12 @@ QVariant TileItemNode::data(int column, int role) const
if(!pixmap.load(tileFilename))
nlinfo("failed to load %s", tileFilename.toStdString().c_str());
- //pixmap.scaled(tileSize*100, tileSize*100);
+ if(TileModel::CurrentZoomFactor == TileModel::TileZoom200)
+ tileSize *= 2;
+ else if(TileModel::CurrentZoomFactor == TileModel::TileZoom50)
+ tileSize /= 2;
+
+ pixmap.scaled(tileSize, tileSize);
return pixmap;
}
diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/tile_editor/tile_model.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/tile_editor/tile_model.cpp
index cd5c1c4ce..c167dbd44 100644
--- a/code/nel/tools/3d/object_viewer_qt/src/plugins/tile_editor/tile_model.cpp
+++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/tile_editor/tile_model.cpp
@@ -21,6 +21,9 @@
#include
+// Initialize the static members
+TileModel::TTileZoomFactor TileModel::CurrentZoomFactor;
+
TileModel::TileModel(const QStringList &headers, QObject *parent) : QAbstractItemModel(parent)
{
QVector rootData;
@@ -29,7 +32,7 @@ TileModel::TileModel(const QStringList &headers, QObject *parent) : QAbstractIte
rootItem = new Node(rootData);
- m_tileZoomFactor = TileZoom100;
+ TileModel::CurrentZoomFactor = TileModel::TileZoom100;
m_indexDisplay = true;
m_fileDisplay = true;
}
@@ -224,27 +227,4 @@ void TileModel::selectFilenameDisplay(bool selected)
void TileModel::selectIndexDisplay(bool selected)
{
m_indexDisplay = selected;
-}
-
-void TileModel::onZoomFactor(int level)
-{
- switch(level)
- {
- // Zoom Level 50%
- case 0:
- nlinfo("zooming to 50%");
- m_tileZoomFactor = TileZoom50;
- break;
- case 1:
- nlinfo("zooming to 100%");
- m_tileZoomFactor = TileZoom100;
- break;
- case 2:
- nlinfo("zooming to 200%");
- m_tileZoomFactor = TileZoom200;
- break;
- default:
- nlwarning("Invalid Time Zoom Factor passed.");
- break;
- };
}
\ No newline at end of file
diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/tile_editor/tile_model.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/tile_editor/tile_model.h
index e9884cd61..bd7d808fb 100644
--- a/code/nel/tools/3d/object_viewer_qt/src/plugins/tile_editor/tile_model.h
+++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/tile_editor/tile_model.h
@@ -59,6 +59,11 @@ public:
TileZoom200 = 2
};
+ static const int TILE_DISPLACE_BASE_SIZE = 32;
+ static const int TILE_TRANSITION_BASE_SIZE = 64;
+ static const int TILE_128_BASE_SIZE = 128;
+ static const int TILE_256_BASE_SIZE = 256;
+
TileModel(const QStringList &headers, QObject *parent);
~TileModel();
@@ -80,17 +85,18 @@ public:
static const char *getTileTypeName(TNodeTileType type);
static uint32 getTileTypeSize(TileModel::TNodeTileType type);
+ static TTileZoomFactor CurrentZoomFactor;
+
public Q_SLOTS:
void selectFilenameDisplay(bool selected);
- void selectIndexDisplay(bool selected);
- void onZoomFactor(int level);
+ void selectIndexDisplay(bool selected);
private:
Node *getItem(const QModelIndex &index) const;
bool m_fileDisplay;
bool m_indexDisplay;
- TTileZoomFactor m_tileZoomFactor;
+ //TTileZoomFactor m_tileZoomFactor;
//QList m_tiles;
//int m_activeEditChannel;