This commit is contained in:
Ian Brown 2021-03-19 17:33:28 +00:00
parent bf096d140a
commit 1516e0201c
4 changed files with 40 additions and 5 deletions

View file

@ -59,22 +59,45 @@ endif()
set(SNOWLIB_SRC_FILES set(SNOWLIB_SRC_FILES
snowlib/AnimationProcessor.cpp snowlib/AnimationProcessor.cpp
snowlib/AnimationProcessor.h
snowlib/AnimData.cpp snowlib/AnimData.cpp
snowlib/AnimData.h
snowlib/AnimDecoder.cpp snowlib/AnimDecoder.cpp
snowlib/AnimDecoder.h
snowlib/DataAccess.h
snowlib/DataUtil.h
snowlib/FntDecoder.cpp snowlib/FntDecoder.cpp
snowlib/FntDecoder.h
snowlib/GameRegion.h snowlib/GameRegion.h
snowlib/GameType.h snowlib/GameType.h
snowlib/GIFTag.cpp snowlib/GIFTag.cpp
snowlib/GIFTag.h
snowlib/GobFile.cpp snowlib/GobFile.cpp
snowlib/GobFile.h
snowlib/Helpers.cpp snowlib/Helpers.cpp
snowlib/Helpers.h
snowlib/LmpFile.cpp snowlib/LmpFile.cpp
snowlib/LmpFile.h
snowlib/LmpRepository.cpp snowlib/LmpRepository.cpp
snowlib/LmpRepository.h
snowlib/Logger.cpp snowlib/Logger.cpp
snowlib/Logger.h
snowlib/Mesh.cpp snowlib/Mesh.cpp
snowlib/Mesh.h
snowlib/Model.h
snowlib/Palette.h
snowlib/Scene.h
snowlib/TexDecoder.cpp snowlib/TexDecoder.cpp
snowlib/TexDecoder.h
snowlib/Texture.h
snowlib/VertexDefs.h
snowlib/VertexWeight.h
snowlib/VifDecoder.cpp snowlib/VifDecoder.cpp
snowlib/VifDecoder.h
snowlib/World.cpp snowlib/World.cpp
snowlib/WorldReader.cpp snowlib/World.h
snowlib/WorldReader.cpp
snowlib/WorldReader.h
) )
include_directories("${FROSTBITE_SOURCE_DIR}/snowlib") include_directories("${FROSTBITE_SOURCE_DIR}/snowlib")

View file

@ -41,8 +41,8 @@ void GameData::read(QString rootDir, QString worldName)
if (gameType != GameType::UNKNOWN) { if (gameType != GameType::UNKNOWN) {
QString lmpDir = rootDir + "/" + dataRelPath; QString lmpDir = rootDir + "/" + dataRelPath;
//LmpRepository* lmpRepository = new LmpRepositoryImpl(lmpDir.toStdString(), gameType); //LmpRepository* lmpRepository = new LmpRepositoryImpl(lmpDir.toStdString(), gameType);
gobName = worldName.toUpper() + ".GOB";
QString gobFile = lmpDir + "/" + worldName.toUpper() + ".GOB"; QString gobFile = lmpDir + "/" + gobName;
worldGob = new GobFile(gobFile.toStdString(), gameType); worldGob = new GobFile(gobFile.toStdString(), gameType);
world = WorldReader().readWorld(worldGob, worldName.toLower().toStdString().c_str()); world = WorldReader().readWorld(worldGob, worldName.toLower().toStdString().c_str());
} }

View file

@ -16,6 +16,11 @@ public:
void read(QString rootDir, QString worldName); void read(QString rootDir, QString worldName);
QString getGobName() { return gobName; }
QString getRootDir() { return rootDir; }
World* getWorld() { return world; }
private: private:
GameRegion gameRegion; GameRegion gameRegion;
GameType gameType; GameType gameType;
@ -26,6 +31,7 @@ private:
/* Relative path from the root where the data files live. */ /* Relative path from the root where the data files live. */
QString dataRelPath; QString dataRelPath;
QString gobName;
GobFile* worldGob; GobFile* worldGob;
World* world; World* world;

View file

@ -1,4 +1,5 @@
#include "InfoPanel.h" #include "InfoPanel.h"
#include "gameData.h"
#include <QtWidgets> #include <QtWidgets>
@ -6,6 +7,9 @@ InfoPanel::InfoPanel(QWidget* parent, GameData& gameData) : gameData(gameData)
{ {
widget = new QTableWidget(1, 2, parent); widget = new QTableWidget(1, 2, parent);
widget->setHorizontalHeaderLabels(QStringList() << "Property" << "Value"); widget->setHorizontalHeaderLabels(QStringList() << "Property" << "Value");
widget->setCornerButtonEnabled(false);
widget->verticalHeader()->hide();
widget->setAlternatingRowColors(true);
populateGamedata(); populateGamedata();
} }
@ -14,10 +18,12 @@ void InfoPanel::populateGamedata()
widget->clearContents(); widget->clearContents();
widget->setRowCount(0); widget->setRowCount(0);
widget->setSortingEnabled(false); widget->setSortingEnabled(false);
addRow("Name", QString("xxx")); addRow("Root Dir", gameData.getRootDir());
addRow("Name2", QString("xxx2")); addRow("GOB Name", gameData.getGobName());
widget->setEditTriggers(QAbstractItemView::NoEditTriggers); widget->setEditTriggers(QAbstractItemView::NoEditTriggers);
widget->resizeColumnsToContents();
widget->resizeRowsToContents();
} }
void InfoPanel::addRow(const char* name, QString val) void InfoPanel::addRow(const char* name, QString val)