From 1516e0201c58d3f8eb5ad2bd6c2a7571b7c625af Mon Sep 17 00:00:00 2001 From: Ian Brown Date: Fri, 19 Mar 2021 17:33:28 +0000 Subject: [PATCH] update --- CMakeLists.txt | 25 ++++++++++++++++++++++++- CuttownTest/gameData.cpp | 4 ++-- CuttownTest/gameData.h | 6 ++++++ CuttownTest/infoPanel.cpp | 10 ++++++++-- 4 files changed, 40 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6d3c9aa..73da61c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -59,22 +59,45 @@ endif() set(SNOWLIB_SRC_FILES snowlib/AnimationProcessor.cpp + snowlib/AnimationProcessor.h snowlib/AnimData.cpp + snowlib/AnimData.h snowlib/AnimDecoder.cpp + snowlib/AnimDecoder.h + snowlib/DataAccess.h + snowlib/DataUtil.h snowlib/FntDecoder.cpp + snowlib/FntDecoder.h snowlib/GameRegion.h snowlib/GameType.h snowlib/GIFTag.cpp + snowlib/GIFTag.h snowlib/GobFile.cpp + snowlib/GobFile.h snowlib/Helpers.cpp + snowlib/Helpers.h snowlib/LmpFile.cpp + snowlib/LmpFile.h snowlib/LmpRepository.cpp + snowlib/LmpRepository.h snowlib/Logger.cpp + snowlib/Logger.h snowlib/Mesh.cpp + snowlib/Mesh.h + snowlib/Model.h + snowlib/Palette.h + snowlib/Scene.h snowlib/TexDecoder.cpp + snowlib/TexDecoder.h + snowlib/Texture.h + snowlib/VertexDefs.h + snowlib/VertexWeight.h snowlib/VifDecoder.cpp + snowlib/VifDecoder.h snowlib/World.cpp - snowlib/WorldReader.cpp + snowlib/World.h + snowlib/WorldReader.cpp + snowlib/WorldReader.h ) include_directories("${FROSTBITE_SOURCE_DIR}/snowlib") diff --git a/CuttownTest/gameData.cpp b/CuttownTest/gameData.cpp index 3765757..1b0a15a 100644 --- a/CuttownTest/gameData.cpp +++ b/CuttownTest/gameData.cpp @@ -41,8 +41,8 @@ void GameData::read(QString rootDir, QString worldName) if (gameType != GameType::UNKNOWN) { QString lmpDir = rootDir + "/" + dataRelPath; //LmpRepository* lmpRepository = new LmpRepositoryImpl(lmpDir.toStdString(), gameType); - - QString gobFile = lmpDir + "/" + worldName.toUpper() + ".GOB"; + gobName = worldName.toUpper() + ".GOB"; + QString gobFile = lmpDir + "/" + gobName; worldGob = new GobFile(gobFile.toStdString(), gameType); world = WorldReader().readWorld(worldGob, worldName.toLower().toStdString().c_str()); } diff --git a/CuttownTest/gameData.h b/CuttownTest/gameData.h index cfdb413..e51feac 100644 --- a/CuttownTest/gameData.h +++ b/CuttownTest/gameData.h @@ -16,6 +16,11 @@ public: void read(QString rootDir, QString worldName); + QString getGobName() { return gobName; } + QString getRootDir() { return rootDir; } + + World* getWorld() { return world; } + private: GameRegion gameRegion; GameType gameType; @@ -26,6 +31,7 @@ private: /* Relative path from the root where the data files live. */ QString dataRelPath; + QString gobName; GobFile* worldGob; World* world; diff --git a/CuttownTest/infoPanel.cpp b/CuttownTest/infoPanel.cpp index e8d3b04..c9a0cff 100644 --- a/CuttownTest/infoPanel.cpp +++ b/CuttownTest/infoPanel.cpp @@ -1,4 +1,5 @@ #include "InfoPanel.h" +#include "gameData.h" #include @@ -6,6 +7,9 @@ InfoPanel::InfoPanel(QWidget* parent, GameData& gameData) : gameData(gameData) { widget = new QTableWidget(1, 2, parent); widget->setHorizontalHeaderLabels(QStringList() << "Property" << "Value"); + widget->setCornerButtonEnabled(false); + widget->verticalHeader()->hide(); + widget->setAlternatingRowColors(true); populateGamedata(); } @@ -14,10 +18,12 @@ void InfoPanel::populateGamedata() widget->clearContents(); widget->setRowCount(0); widget->setSortingEnabled(false); - addRow("Name", QString("xxx")); - addRow("Name2", QString("xxx2")); + addRow("Root Dir", gameData.getRootDir()); + addRow("GOB Name", gameData.getGobName()); widget->setEditTriggers(QAbstractItemView::NoEditTriggers); + widget->resizeColumnsToContents(); + widget->resizeRowsToContents(); } void InfoPanel::addRow(const char* name, QString val)