Compare commits

..

No commits in common. "main" and "feature/rebrand" have entirely different histories.

1125 changed files with 3278 additions and 402550 deletions

23
.gitignore vendored
View File

@ -1,25 +1,4 @@
/build/
/data/dlls/
/data/fastfiles/
/releases/
.vscode/*
.qmake.stash
# Ignore Qt Creator user files
*.pro.user
*.pro.user.*
*.qbs.user
*.qbs.user.*
*.creator.user
*.creator.user.*
*.creator.*
*.ps1
version.txt
*.autosave
*.XMODEL_EXPORT
data/obj/*
libs/*/release/*
libs/*/debug/*
.git.stash
*Makefile*
.pro.user

24
Data.qrc Normal file
View File

@ -0,0 +1,24 @@
<RCC>
<qresource prefix="/obj">
<file>data/obj/defaultactor_LOD0.bin</file>
<file>data/obj/defaultactor_LOD0.cast</file>
<file>data/obj/defaultactor_LOD0.gltf</file>
<file>data/obj/defaultactor_LOD0.ma</file>
<file>data/obj/defaultactor_LOD0.mesh.ascii</file>
<file>data/obj/defaultactor_LOD0.obj</file>
<file>data/obj/defaultactor_LOD0.semodel</file>
<file>data/obj/defaultactor_LOD0.smd</file>
<file>data/obj/defaultactor_LOD0.XMODEL_BIN</file>
<file>data/obj/defaultactor_LOD0.XMODEL_EXPORT</file>
<file>data/obj/defaultactor_LOD0_BIND.mel</file>
<file>data/obj/defaultactor_LOD0_cosmetics.mel</file>
<file>data/obj/mtl_body_default_character.mtl</file>
<file>data/obj/mtl_body_default_character_images.txt</file>
<file>data/obj/diffusemap.png</file>
<file>data/obj/normalmap.png</file>
</qresource>
<qresource prefix="/d3dbsp">
<file>data/d3dbsp/asset_viewer.d3dbsp</file>
<file>data/d3dbsp/barebones.d3dbsp</file>
</qresource>
</RCC>

View File

@ -1,10 +1,34 @@
TEMPLATE = subdirs
QT += core gui 3dcore 3drender 3dinput 3dextras
SUBDIRS += libs \
app \
#tools \
#tests
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
#tests.depends = libs
app.depends = libs
#tools.depends = libs
CONFIG += c++17
# INCLUDEPATH += "C:/Program Files (x86)/Windows Kits/10/Include/10.0.26100.0/um"
# LIBS += -L"C:/Program Files (x86)/Windows Kits/10/Lib/10.0.26100.0/um/x64" \
# -ldxcompiler
# You can make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
SOURCES += \
main.cpp \
mainwindow.cpp
HEADERS += \
enums.h \
mainwindow.h \
structs.h \
utils.h
FORMS += \
mainwindow.ui
# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target
RESOURCES += \
Data.qrc

269
XPlor.pro.user Normal file
View File

@ -0,0 +1,269 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 15.0.0, 2025-01-11T10:27:40. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
<value type="QByteArray">{40d992cb-ac11-4385-a22b-016f1b4251a7}</value>
</data>
<data>
<variable>ProjectExplorer.Project.ActiveTarget</variable>
<value type="qlonglong">0</value>
</data>
<data>
<variable>ProjectExplorer.Project.EditorSettings</variable>
<valuemap type="QVariantMap">
<value type="bool" key="EditorConfiguration.AutoIndent">true</value>
<value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
<value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value>
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
<value type="QString" key="language">Cpp</value>
<valuemap type="QVariantMap" key="value">
<value type="QByteArray" key="CurrentPreferences">CppGlobal</value>
</valuemap>
</valuemap>
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
<value type="QString" key="language">QmlJS</value>
<valuemap type="QVariantMap" key="value">
<value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value>
</valuemap>
</valuemap>
<value type="qlonglong" key="EditorConfiguration.CodeStyle.Count">2</value>
<value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value>
<value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
<value type="int" key="EditorConfiguration.IndentSize">4</value>
<value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
<value type="int" key="EditorConfiguration.LineEndingBehavior">0</value>
<value type="int" key="EditorConfiguration.MarginColumn">80</value>
<value type="bool" key="EditorConfiguration.MouseHiding">true</value>
<value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
<value type="int" key="EditorConfiguration.PaddingMode">1</value>
<value type="int" key="EditorConfiguration.PreferAfterWhitespaceComments">0</value>
<value type="bool" key="EditorConfiguration.PreferSingleLineComments">false</value>
<value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
<value type="bool" key="EditorConfiguration.ShowMargin">false</value>
<value type="int" key="EditorConfiguration.SmartBackspaceBehavior">2</value>
<value type="bool" key="EditorConfiguration.SmartSelectionChanging">true</value>
<value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
<value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
<value type="int" key="EditorConfiguration.TabSize">8</value>
<value type="bool" key="EditorConfiguration.UseGlobal">true</value>
<value type="bool" key="EditorConfiguration.UseIndenter">false</value>
<value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
<value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
<value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
<value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
<value type="QString" key="EditorConfiguration.ignoreFileTypes">*.md, *.MD, Makefile</value>
<value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
<value type="bool" key="EditorConfiguration.skipTrailingWhitespace">true</value>
<value type="bool" key="EditorConfiguration.tintMarginArea">true</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.PluginSettings</variable>
<valuemap type="QVariantMap">
<valuemap type="QVariantMap" key="AutoTest.ActiveFrameworks">
<value type="bool" key="AutoTest.Framework.Boost">true</value>
<value type="bool" key="AutoTest.Framework.CTest">false</value>
<value type="bool" key="AutoTest.Framework.Catch">true</value>
<value type="bool" key="AutoTest.Framework.GTest">true</value>
<value type="bool" key="AutoTest.Framework.QtQuickTest">true</value>
<value type="bool" key="AutoTest.Framework.QtTest">true</value>
</valuemap>
<value type="bool" key="AutoTest.ApplyFilter">false</value>
<valuemap type="QVariantMap" key="AutoTest.CheckStates"/>
<valuelist type="QVariantList" key="AutoTest.PathFilters"/>
<value type="int" key="AutoTest.RunAfterBuild">0</value>
<value type="bool" key="AutoTest.UseGlobal">true</value>
<valuemap type="QVariantMap" key="ClangTools">
<value type="bool" key="ClangTools.AnalyzeOpenFiles">true</value>
<value type="bool" key="ClangTools.BuildBeforeAnalysis">true</value>
<value type="QString" key="ClangTools.DiagnosticConfig">Builtin.DefaultTidyAndClazy</value>
<value type="int" key="ClangTools.ParallelJobs">16</value>
<value type="bool" key="ClangTools.PreferConfigFile">true</value>
<valuelist type="QVariantList" key="ClangTools.SelectedDirs"/>
<valuelist type="QVariantList" key="ClangTools.SelectedFiles"/>
<valuelist type="QVariantList" key="ClangTools.SuppressedDiagnostics"/>
<value type="bool" key="ClangTools.UseGlobalSettings">true</value>
</valuemap>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.Target.0</variable>
<valuemap type="QVariantMap">
<value type="QString" key="DeviceType">Desktop</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 6.8.1 MSVC2022 64bit</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 6.8.1 MSVC2022 64bit</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.qt6.681.win64_msvc2022_64_kit</value>
<value type="qlonglong" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
<value type="qlonglong" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
<value type="qlonglong" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
<value type="int" key="EnableQmlDebugging">0</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">C:\Users\njohnson\Projects\XPlor\build\Desktop_Qt_6_8_1_MSVC2022_64bit-Debug</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">C:/Users/njohnson/Projects/XPlor/build/Desktop_Qt_6_8_1_MSVC2022_64bit-Debug</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
<valuelist type="QVariantList" key="QtProjectManager.QMakeBuildStep.SelectedAbis"/>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
</valuemap>
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
</valuemap>
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ParseStandardOutput">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">C:\Users\njohnson\Projects\XPlor\build\Desktop_Qt_6_8_1_MSVC2022_64bit-Release</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">C:/Users/njohnson/Projects/XPlor/build/Desktop_Qt_6_8_1_MSVC2022_64bit-Release</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
<valuelist type="QVariantList" key="QtProjectManager.QMakeBuildStep.SelectedAbis"/>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
</valuemap>
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
</valuemap>
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ParseStandardOutput">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Release</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
<value type="int" key="QtQuickCompiler">0</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2">
<value type="int" key="EnableQmlDebugging">0</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">C:\Users\njohnson\Projects\XPlor\build\Desktop_Qt_6_8_1_MSVC2022_64bit-Profile</value>
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir">C:/Users/njohnson/Projects/XPlor/build/Desktop_Qt_6_8_1_MSVC2022_64bit-Profile</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
<valuelist type="QVariantList" key="QtProjectManager.QMakeBuildStep.SelectedAbis"/>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
</valuemap>
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.MakeStep</value>
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeArguments">clean</value>
</valuemap>
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/>
<value type="bool" key="ProjectExplorer.BuildConfiguration.ParseStandardOutput">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Profile</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
<value type="int" key="QtQuickCompiler">0</value>
<value type="int" key="SeparateDebugInfo">0</value>
</valuemap>
<value type="qlonglong" key="ProjectExplorer.Target.BuildConfigurationCount">3</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Deploy</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
</valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
<valuemap type="QVariantMap" key="ProjectExplorer.DeployConfiguration.CustomData"/>
<value type="bool" key="ProjectExplorer.DeployConfiguration.CustomDataEnabled">false</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
</valuemap>
<value type="qlonglong" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
<value type="bool" key="Analyzer.Perf.Settings.UseGlobalSettings">true</value>
<value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value>
<value type="int" key="Analyzer.Valgrind.Callgrind.CostFormat">0</value>
<value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
<valuelist type="QVariantList" key="CustomOutputParsers"/>
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="bool" key="PE.EnvironmentAspect.PrintOnRun">false</value>
<value type="QString" key="PerfRecordArgsId">-e cpu-cycles --call-graph &quot;dwarf,4096&quot; -F 250</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value>
<value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey"></value>
<value type="bool" key="ProjectExplorer.RunConfiguration.Customized">false</value>
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
</valuemap>
<value type="qlonglong" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
</valuemap>
</data>
<data>
<variable>ProjectExplorer.Project.TargetCount</variable>
<value type="qlonglong">1</value>
</data>
<data>
<variable>ProjectExplorer.Project.Updater.FileVersion</variable>
<value type="int">22</value>
</data>
<data>
<variable>Version</variable>
<value type="int">22</value>
</data>
</qtcreator>

View File

@ -1,36 +0,0 @@
#!/bin/bash
set -e
# 1. Stage everything
git add -A
# 2. Get list of staged files
FILES=$(git diff --cached --name-only)
if [ -z "$FILES" ]; then
echo "No changes to commit."
exit 0
fi
# 3. Loop file by file
for FILE in $FILES; do
# Get diff for this file
DIFF=$(git diff --cached -- "$FILE")
if [ -z "$DIFF" ]; then
continue
fi
# Ask Ollama for a commit message describing this file change
MSG=$(echo "$DIFF" | ollama run gemma3 \
"You are a commit bot. Write a SHORT, clear, concise Git commit message for changes in file: $FILE.
Only output the commit message, nothing else.
Diff:
$DIFF")
# Commit just this file with its message
git commit -m "$MSG" -- "$FILE"
echo "✅ Committed $FILE with message:"
echo "$MSG"
done

View File

@ -1,14 +0,0 @@
#include "aboutdialog.h"
#include "ui_aboutdialog.h"
AboutDialog::AboutDialog(QWidget *parent)
: QDialog(parent)
, ui(new Ui::AboutDialog)
{
ui->setupUi(this);
}
AboutDialog::~AboutDialog()
{
delete ui;
}

View File

@ -1,22 +0,0 @@
#ifndef ABOUTDIALOG_H
#define ABOUTDIALOG_H
#include <QDialog>
namespace Ui {
class AboutDialog;
}
class AboutDialog : public QDialog
{
Q_OBJECT
public:
explicit AboutDialog(QWidget *parent = nullptr);
~AboutDialog();
private:
Ui::AboutDialog *ui;
};
#endif // ABOUTDIALOG_H

View File

@ -1,241 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>AboutDialog</class>
<widget class="QDialog" name="AboutDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>350</width>
<height>200</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>350</width>
<height>200</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>350</width>
<height>200</height>
</size>
</property>
<property name="windowTitle">
<string>About XPlor</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="label">
<property name="minimumSize">
<size>
<width>80</width>
<height>80</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>80</width>
<height>80</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="Data.qrc">:/images/data/images/XPlor.png</pixmap>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
<property name="alignment">
<set>Qt::AlignmentFlag::AlignCenter</set>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Orientation::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QLabel" name="label_2">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<family>Roboto</family>
<pointsize>16</pointsize>
<bold>false</bold>
</font>
</property>
<property name="text">
<string>XPlor v1.5</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_3">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<family>Roboto</family>
</font>
</property>
<property name="text">
<string>Copyright © 2024 RedLine Solutions LLC</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_4">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<family>Roboto</family>
</font>
</property>
<property name="text">
<string>For more, check out redline.llc</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Orientation::Vertical</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Policy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label_6">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<family>Roboto</family>
</font>
</property>
<property name="text">
<string>With Help From:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_9">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<family>Roboto</family>
</font>
</property>
<property name="text">
<string>- Paging Red</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_8">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<family>Roboto</family>
</font>
</property>
<property name="text">
<string>- ISOCheated</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_7">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<family>Roboto</family>
</font>
</property>
<property name="text">
<string>- SureShotIan</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Orientation::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
<resources>
<include location="Data.qrc"/>
</resources>
<connections/>
</ui>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -1,61 +0,0 @@
QT += core widgets gui multimedia
RC_ICONS = app.ico
SUBDIRS += app
CONFIG += c++17
SOURCES += $$files($$PWD/*.cpp)
HEADERS += $$files($$PWD/*.h)
FORMS += $$files($$PWD/*.ui)
RESOURCES += ../data/data.qrc
LIBS += \
-L$$PWD/../third_party/devil_sdk/lib/ -lDevIL -lILU -lILUT \
-L$$PWD/../third_party/zlib/lib/ -lzlib \
-L$$PWD/../third_party/xbox_sdk/lib -lxcompress64 \
-L$$OUT_PWD/../libs/ -lcore \
-L$$OUT_PWD/../libs/ -lxassets\
-L$$OUT_PWD/../libs/ -lcompression \
-L$$OUT_PWD/../libs/ -lencryption \
-L$$OUT_PWD/../libs/ -lfastfile \
-L$$OUT_PWD/../libs/ -lddsfile \
-L$$OUT_PWD/../libs/ -lipakfile \
-L$$OUT_PWD/../libs/ -liwifile \
-L$$OUT_PWD/../libs/ -lzonefile
INCLUDEPATH += \
$$PWD/../third_party/devil_sdk/include/ \
$$PWD/../third_party/zlib/include \
$$PWD/../third_party/xbox_sdk/include \
$$PWD/../libs/core \
$$PWD/../libs/compression \
$$PWD/../libs/encryption \
$$PWD/../libs/fastfile \
$$PWD/../libs/ddsfile \
$$PWD/../libs/ipakfile \
$$PWD/../libs/iwifile \
$$PWD/../libs/xassets \
$$PWD/../libs/zonefile
DEPENDPATH += \
$$PWD/../third_party/devil_sdk/include/ \
$$PWD/../third_party/zlib/include \
$$PWD/../third_party/xbox_sdk/include \
$$PWD/../libs/core \
$$PWD/../libs/compression \
$$PWD/../libs/encryption \
$$PWD/../libs/fastfile \
$$PWD/../libs/ddsfile \
$$PWD/../libs/ipakfile \
$$PWD/../libs/iwifile \
$$PWD/../libs/xassets \
$$PWD/../libs/zonefile
win32 {
QMAKE_POST_LINK =
QMAKE_POST_LINK += for /D %%G in (\"$$PWD/../third_party/*/lib\") do copy /Y \"%%~G\*.dll\" \"$$OUT_PWD/$$DESTDIR/\" >NUL $$escape_expand(\\n\\t)
}

View File

@ -1,41 +0,0 @@
#ifndef D3DBSP_STRUCTS_H
#define D3DBSP_STRUCTS_H
#include <QByteArray>
// Define Lump Structure
struct Lump {
QByteArray content;
quint32 size = 0;
bool isEmpty = true;
};
// Lump Index Entry Structure
struct LumpIndexEntry {
quint32 type;
quint32 length;
};
// Bink structure definitions
struct BINKRECT {
int Left;
int Top;
int Width;
int Height;
};
struct BINK {
int Width;
int Height;
uint32_t Frames;
uint32_t FrameNum;
uint32_t FrameRate;
uint32_t FrameRateDiv;
uint32_t ReadError;
uint32_t OpenFlags;
BINKRECT FrameRects;
uint32_t NumRects;
uint32_t FrameChangePercent;
};
#endif // D3DBSP_STRUCTS_H

View File

@ -1,182 +0,0 @@
#include "ddsviewer.h"
#include "enums.h"
#include "ui_ddsviewer.h"
DDSViewer::DDSViewer(QWidget *parent)
: QWidget(parent)
, ui(new Ui::DDSViewer)
{
ui->setupUi(this);
mDDSFile = nullptr;
}
DDSViewer::~DDSViewer() {
delete ui;
}
void DDSViewer::SetDDSFile(const DDSFile* aDDSFile) {
mDDSFile = aDDSFile;
ui->label_Title->setText(mDDSFile->fileStem + ".dds");
char magicData[5];
magicData[0] = static_cast<char>(mDDSFile->header.magic & 0xFF);
magicData[1] = static_cast<char>((mDDSFile->header.magic >> 8) & 0xFF);
magicData[2] = static_cast<char>((mDDSFile->header.magic >> 16) & 0xFF);
magicData[3] = static_cast<char>((mDDSFile->header.magic >> 24) & 0xFF);
magicData[4] = '\0';
// If youre using Qt and want a QString:
QString magicStr = QString::fromLatin1(magicData);
ui->lineEdit_Magic->setText(magicStr);
ui->spinBox_Size->setValue(mDDSFile->header.size);
ui->checkBox_CapsValid->setChecked((mDDSFile->header.flags & DDSD_CAPS) != 0);
ui->checkBox_HeightValid->setChecked((mDDSFile->header.flags & DDSD_HEIGHT) != 0);
ui->checkBox_WidthValid->setChecked((mDDSFile->header.flags & DDSD_WIDTH) != 0);
ui->checkBox_PitchValid->setChecked((mDDSFile->header.flags & DDSD_PITCH) != 0);
ui->checkBox_PFValid->setChecked((mDDSFile->header.flags & DDSD_PIXELFORMAT) != 0);
ui->checkBox_MipmapCountValid->setChecked((mDDSFile->header.flags & DDSD_MIPMAPCOUNT) != 0);
ui->checkBox_LinearSizeValid->setChecked((mDDSFile->header.flags & DDSD_LINEARSIZE) != 0);
ui->checkBox_DepthValid->setChecked((mDDSFile->header.flags & DDSD_DEPTH) != 0);
ui->spinBox_PLSize->setValue(mDDSFile->header.pitchOrLinearSize);
ui->spinBox_Depth->setValue(mDDSFile->header.depth);
ui->spinBox_Width->setValue(mDDSFile->header.width);
ui->spinBox_Height->setValue(mDDSFile->header.height);
ui->spinBox_MipmapCount->setValue(mDDSFile->header.mipMapCount);
ui->spinBox_Res1->setValue(mDDSFile->header.reserved1[0]);
ui->spinBox_Res2->setValue(mDDSFile->header.reserved1[1]);
ui->spinBox_Res3->setValue(mDDSFile->header.reserved1[2]);
ui->spinBox_Res4->setValue(mDDSFile->header.reserved1[3]);
ui->spinBox_Res5->setValue(mDDSFile->header.reserved1[4]);
ui->spinBox_Res6->setValue(mDDSFile->header.reserved1[5]);
ui->spinBox_Res7->setValue(mDDSFile->header.reserved1[6]);
ui->spinBox_Res8->setValue(mDDSFile->header.reserved1[7]);
ui->spinBox_Res9->setValue(mDDSFile->header.reserved1[8]);
ui->spinBox_Res10->setValue(mDDSFile->header.reserved1[9]);
ui->spinBox_Res11->setValue(mDDSFile->header.reserved1[10]);
ui->spinBox_Res12->setValue(mDDSFile->header.reserved2);
ui->spinBox_PF_Size->setValue(mDDSFile->header.pixelFormat.size);
ui->checkBox_PF_AlphaPxValid->setChecked((mDDSFile->header.pixelFormat.flags & DDPF_ALPHAPIXELS) != 0);
ui->checkBox_PF_AlphaOnlyValid->setChecked((mDDSFile->header.pixelFormat.flags & DDPF_ALPHA) != 0);
ui->checkBox_PF_FormatValid->setChecked((mDDSFile->header.pixelFormat.flags & DDPF_FOURCC) != 0);
ui->checkBox_PF_RGBValid->setChecked((mDDSFile->header.pixelFormat.flags & DDPF_RGB) != 0);
ui->checkBox_PF_YUVValid->setChecked((mDDSFile->header.pixelFormat.flags & DDPF_YUV) != 0);
ui->checkBox_PF_LuminanceValid->setChecked((mDDSFile->header.pixelFormat.flags & DDPF_LUMINANCE) != 0);
QString formatStr = QString::number(mDDSFile->header.pixelFormat.format);
switch (mDDSFile->header.pixelFormat.format) {
case IWI_FORMAT_ARGB32:
formatStr = "ARGB32";
break;
case IWI_FORMAT_RGB24:
formatStr = "RGB24";
break;
case IWI_FORMAT_GA16:
formatStr = "GA16";
break;
case IWI_FORMAT_A8:
formatStr = "A8";
break;
case IWI_FORMAT_DXT1:
formatStr = "DXT1";
break;
case IWI_FORMAT_DXT3:
formatStr = "DXT3";
break;
case IWI_FORMAT_DXT5:
formatStr = "DXT5";
break;
}
ui->lineEdit_PF_Format->setText(formatStr);
ui->spinBox_PF_RGBBitCount->setValue(mDDSFile->header.pixelFormat.rgbBitCount);
ui->spinBox_RedBitCount->setValue(mDDSFile->header.pixelFormat.rBitMask);
ui->spinBox_GreenBitCount->setValue(mDDSFile->header.pixelFormat.gBitMask);
ui->spinBox_BlueBitCount->setValue(mDDSFile->header.pixelFormat.bBitMask);
ui->spinBox_AlphaBitMask->setValue(mDDSFile->header.pixelFormat.aBitMask);
ui->checkBox_Caps1_TextureValid->setChecked((mDDSFile->header.caps.caps1 & DDSCAPS_TEXTURE) != 0);
ui->checkBox_Caps1_ComplexValid->setChecked((mDDSFile->header.caps.caps1 & DDSCAPS_COMPLEX) != 0);
ui->checkBox_Caps1_MipmapValid->setChecked((mDDSFile->header.caps.caps1 & DDSCAPS_MIPMAP) != 0);
ui->checkBox_Caps2_CubemapValid->setChecked((mDDSFile->header.caps.caps2 & DDSCAPS2_CUBEMAP) != 0);
ui->checkBox_Caps2_CMPXValid->setChecked((mDDSFile->header.caps.caps2 & DDSCAPS2_CUBEMAP_POSITIVEX) != 0);
ui->checkBox_Caps2_CMNXValid->setChecked((mDDSFile->header.caps.caps2 & DDSCAPS2_CUBEMAP_NEGATIVEX) != 0);
ui->checkBox_Caps2_CMPYValid->setChecked((mDDSFile->header.caps.caps2 & DDSCAPS2_CUBEMAP_POSITIVEY) != 0);
ui->checkBox_Caps2_CMNYValid->setChecked((mDDSFile->header.caps.caps2 & DDSCAPS2_CUBEMAP_NEGATIVEY) != 0);
ui->checkBox_Caps2_CMPZValid->setChecked((mDDSFile->header.caps.caps2 & DDSCAPS2_CUBEMAP_POSITIVEZ) != 0);
ui->checkBox_Caps2_CMNZValid->setChecked((mDDSFile->header.caps.caps2 & DDSCAPS2_CUBEMAP_NEGATIVEZ) != 0);
ui->checkBox_Caps2_VolumeValid->setChecked((mDDSFile->header.caps.caps2 & DDSCAPS2_VOLUME) != 0);
ui->spinBox_Caps_DDSX->setValue(mDDSFile->header.caps.dDSX);
ui->spinBox_Caps_Res->setValue(mDDSFile->header.caps.reserved);
ui->comboBox_Mipmap->clear();
for (auto mipmap : mDDSFile->mipmaps) {
ui->comboBox_Mipmap->addItem(QString("%1x%2").arg(mipmap.width).arg(mipmap.height));
}
connect(ui->comboBox_Mipmap, &QComboBox::currentIndexChanged, this, &DDSViewer::MipmapIndexChanged);
if (!mDDSFile->mipmaps.empty()) {
MipmapIndexChanged(0);
}
}
void DDSViewer::MipmapIndexChanged(int aMipmapIndex) {
if (aMipmapIndex == -1) { return; }
auto mipmaps = mDDSFile->mipmaps;
auto mipmap = mipmaps[aMipmapIndex];
ui->spinBox_MipmapSize->setValue(mipmap.size);
ui->spinBox_MipmapWidth->setValue(mipmap.width);
ui->spinBox_MipmapHeight->setValue(mipmap.height);
// Validate Data
if (mipmap.size <= 0) {
qDebug() << "Error: Mipmap data is empty!";
return;
}
if (mipmap.width <= 0 || mipmap.height <= 0) {
qDebug() << "Error: Invalid mipmap dimensions!";
return;
}
// Ensure data size matches expected size
int bytesPerPixel = 4; // RGBA8888
quint32 expectedSize = mipmap.width * mipmap.height * bytesPerPixel;
if (mipmap.size < expectedSize) {
qDebug() << "Error: Mipmap data size mismatch! Expected:" << expectedSize << ", Got:" << mipmap.size;
return;
}
// Create QImage
const unsigned char* imageData = reinterpret_cast<const unsigned char*>(mipmap.data.constData());
QImage image(reinterpret_cast<const uchar*>(imageData),
mipmap.width, mipmap.height,
mipmap.width * bytesPerPixel, // Stride
QImage::Format_RGBA8888);
if (image.isNull()) {
qDebug() << "Error: QImage creation failed!";
return;
}
// Convert to QPixmap
QPixmap pixmap = QPixmap::fromImage(image);
if (pixmap.isNull()) {
qDebug() << "Error: QPixmap conversion failed!";
return;
}
// Scale and display
pixmap = pixmap.scaled(ui->label_Image->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
ui->label_Image->setPixmap(pixmap);
}

View File

@ -1,29 +0,0 @@
#ifndef DDSVIEWER_H
#define DDSVIEWER_H
#include "ddsfile.h"
#include <QWidget>
namespace Ui {
class DDSViewer;
}
class DDSViewer : public QWidget
{
Q_OBJECT
public:
explicit DDSViewer(QWidget *parent = nullptr);
~DDSViewer();
void SetDDSFile(const DDSFile *aDDSFile);
private slots:
void MipmapIndexChanged(int aMipmapIndex);
private:
Ui::DDSViewer *ui;
const DDSFile* mDDSFile;
};
#endif // DDSVIEWER_H

File diff suppressed because it is too large Load Diff

View File

@ -1,26 +0,0 @@
#include "fastfileviewer.h"
#include "ui_fastfileviewer.h"
FastFileViewer::FastFileViewer(QWidget *parent)
: QWidget(parent)
, ui(new Ui::FFViewer)
, mFastFile(nullptr)
{
ui->setupUi(this);
}
FastFileViewer::~FastFileViewer()
{
delete ui;
}
void FastFileViewer::SetFastFile(const FastFile* aFastFile) {
mFastFile = aFastFile;
ui->label_Title->setText(mFastFile->GetStem());
ui->comboBox_Company->setCurrentIndex(mFastFile->GetCompany());
ui->comboBox_FileType->setCurrentIndex(mFastFile->GetType());
ui->checkBox_Signed->setChecked(mFastFile->GetSignage() == SIGNAGE_SIGNED);
ui->lineEdit_Magic->setText(mFastFile->GetMagic());
ui->spinBox_Version->setValue(mFastFile->GetVersion());
}

View File

@ -1,25 +0,0 @@
#ifndef FASTFILEVIEWER_H
#define FASTFILEVIEWER_H
#include "fastfile.h"
#include <QWidget>
namespace Ui {
class FFViewer;
}
class FastFileViewer : public QWidget
{
Q_OBJECT
public:
explicit FastFileViewer(QWidget *parent = nullptr);
~FastFileViewer();
void SetFastFile(const FastFile *aFastFile);
private:
Ui::FFViewer *ui;
const FastFile* mFastFile;
};
#endif // FASTFILEVIEWER_H

View File

@ -1,197 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>FFViewer</class>
<widget class="QWidget" name="FFViewer">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>428</width>
<height>459</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QLabel" name="label_Title">
<property name="font">
<font>
<family>Roboto</family>
<pointsize>16</pointsize>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>FastFile 0</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0" colspan="2">
<widget class="QGroupBox" name="groupBox">
<property name="minimumSize">
<size>
<width>400</width>
<height>400</height>
</size>
</property>
<property name="font">
<font>
<family>Roboto</family>
<pointsize>9</pointsize>
</font>
</property>
<property name="title">
<string>Header</string>
</property>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Company:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="comboBox_Company">
<property name="enabled">
<bool>false</bool>
</property>
<item>
<property name="text">
<string>None</string>
</property>
</item>
<item>
<property name="text">
<string>Infinity Ward</string>
</property>
</item>
<item>
<property name="text">
<string>Treyarch</string>
</property>
</item>
<item>
<property name="text">
<string>Sledgehammer</string>
</property>
</item>
<item>
<property name="text">
<string>Neversoft</string>
</property>
</item>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>File Type:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QComboBox" name="comboBox_FileType">
<property name="enabled">
<bool>false</bool>
</property>
<item>
<property name="text">
<string>None</string>
</property>
</item>
<item>
<property name="text">
<string>FastFile</string>
</property>
</item>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Signed:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QCheckBox" name="checkBox_Signed">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Is signed</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Magic:</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLineEdit" name="lineEdit_Magic"/>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Version:</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QSpinBox" name="spinBox_Version">
<property name="enabled">
<bool>false</bool>
</property>
<property name="maximum">
<number>10000</number>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer_5">
<property name="orientation">
<enum>Qt::Orientation::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>1</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -1,28 +0,0 @@
#include "imagewidget.h"
#include "ui_imagewidget.h"
ImageWidget::ImageWidget(QWidget *parent)
: QWidget(parent)
, ui(new Ui::ImageWidget)
{
ui->setupUi(this);
}
ImageWidget::~ImageWidget()
{
delete ui;
}
void ImageWidget::SetImage(std::shared_ptr<QImage> aImage)
{
mImage = aImage;
//ui->lineEdit_Name->setText(aImage->name);
//ui->lineEdit_Role->setText(aImage->materialName);
//ui->comboBox_Compression->setCurrentIndex(aImage->compression);
}
std::shared_ptr<QImage> ImageWidget::GetImage()
{
return mImage;
}

View File

@ -1,31 +0,0 @@
#ifndef IMAGEWIDGET_H
#define IMAGEWIDGET_H
#include "enums.h"
#include "dds_structs.h"
#include "d3dbsp_structs.h"
#include "ipak_structs.h"
#include <QWidget>
namespace Ui {
class ImageWidget;
}
class ImageWidget : public QWidget
{
Q_OBJECT
public:
explicit ImageWidget(QWidget *parent = nullptr);
~ImageWidget();
void SetImage(std::shared_ptr<QImage> aImage);
std::shared_ptr<QImage> GetImage();
private:
std::shared_ptr<QImage> mImage;
Ui::ImageWidget *ui;
};
#endif // IMAGEWIDGET_H

View File

@ -1,144 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>ImageWidget</class>
<widget class="QWidget" name="ImageWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>589</width>
<height>422</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Image Role:</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_Role"/>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>Name:</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_Name"/>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>Compression:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboBox_Compression">
<item>
<property name="text">
<string>None</string>
</property>
</item>
<item>
<property name="text">
<string>DXT1</string>
</property>
</item>
<item>
<property name="text">
<string>DXT3</string>
</property>
</item>
<item>
<property name="text">
<string>DXT5</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Orientation::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Orientation::Vertical</enum>
</property>
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QLabel" name="label_Preview">
<property name="minimumSize">
<size>
<width>250</width>
<height>250</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>250</width>
<height>250</height>
</size>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Orientation::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -1,98 +0,0 @@
#include "iwiviewer.h"
#include "enums.h"
#include "ui_iwiviewer.h"
IWIViewer::IWIViewer(QWidget *parent)
: QWidget(parent)
, ui(new Ui::IWIViewer)
{
ui->setupUi(this);
}
IWIViewer::~IWIViewer()
{
delete ui;
}
void IWIViewer::SetIWIFile(const IWIFile* aIWIFile) {
mIWIFile = aIWIFile;
ui->label_Title->setText(mIWIFile->fileStem + ".iwi");
// If youre using Qt and want a QString:
QString magicStr = QString::fromLatin1(mIWIFile->header.Magic, 3);
ui->lineEdit_Magic->setText(magicStr);
ui->spinBox_Version->setValue(mIWIFile->header.Version);
ui->spinBox_Depth->setValue(mIWIFile->info.Depth);
QString formatStr = "";
switch (mIWIFile->info.Format) {
case IWI_FORMAT_ARGB32:
formatStr = "ARGB32";
break;
case IWI_FORMAT_RGB24:
formatStr = "RGB24";
break;
case IWI_FORMAT_GA16:
formatStr = "GA16";
break;
case IWI_FORMAT_A8:
formatStr = "A8";
break;
case IWI_FORMAT_DXT1:
formatStr = "DXT1";
break;
case IWI_FORMAT_DXT3:
formatStr = "DXT3";
break;
case IWI_FORMAT_DXT5:
formatStr = "DXT5";
break;
}
ui->lineEdit_Format->setText(formatStr);
ui->spinBox_Height->setValue(mIWIFile->info.Height);
ui->spinBox_Width->setValue(mIWIFile->info.Width);
ui->spinBox_Usage->setValue(mIWIFile->info.Usage);
ui->comboBox_Mipmap->clear();
for (auto mipmap : mIWIFile->mipmaps) {
ui->comboBox_Mipmap->addItem(QString::number(mipmap.offset));
}
connect(ui->comboBox_Mipmap, &QComboBox::currentIndexChanged, this, &IWIViewer::MipmapIndexChanged);
if (!mIWIFile->mipmaps.empty()) {
MipmapIndexChanged(0);
}
}
void IWIViewer::MipmapIndexChanged(int aMipmapIndex) {
auto mipmaps = mIWIFile->mipmaps;
if (aMipmapIndex == -1) { return; }
auto mipmap = mipmaps[aMipmapIndex];
ui->spinBox_MipmapSize->setValue(mipmap.size);
ui->spinBox_MipmapOffset->setValue(mipmap.offset);
const unsigned char* imageData = reinterpret_cast<const unsigned char*>(mipmap.data.constData());
QImage image(reinterpret_cast<const uchar*>(imageData),
mIWIFile->info.Width, mIWIFile->info.Height,
QImage::Format_RGBA8888);
if (image.isNull()) {
qDebug() << "Error: QImage creation failed!";
return;
}
// Convert to QPixmap
QPixmap pixmap = QPixmap::fromImage(image);
if (pixmap.isNull()) {
qDebug() << "Error: QPixmap conversion failed!";
return;
}
// Scale and display
pixmap = pixmap.scaled(ui->label_Image->size(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
ui->label_Image->setPixmap(pixmap);
}

View File

@ -1,27 +0,0 @@
#ifndef IWIVIEWER_H
#define IWIVIEWER_H
#include "iwifile.h"
#include <QWidget>
namespace Ui {
class IWIViewer;
}
class IWIViewer : public QWidget
{
Q_OBJECT
public:
explicit IWIViewer(QWidget *parent = nullptr);
~IWIViewer();
void MipmapIndexChanged(int aMipmapIndex);
void SetIWIFile(const IWIFile *aIWIFile);
private:
Ui::IWIViewer *ui;
const IWIFile* mIWIFile;
};
#endif // IWIVIEWER_H

View File

@ -1,548 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>IWIViewer</class>
<widget class="QWidget" name="IWIViewer">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1246</width>
<height>909</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_9">
<item>
<widget class="QLabel" name="label_Title">
<property name="font">
<font>
<family>Roboto</family>
<pointsize>16</pointsize>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>IWI File 0</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QGroupBox" name="groupBox_17">
<property name="font">
<font>
<family>Roboto</family>
<pointsize>9</pointsize>
</font>
</property>
<property name="title">
<string>Header</string>
</property>
<layout class="QFormLayout" name="formLayout_4">
<item row="0" column="0">
<widget class="QLabel" name="label_3">
<property name="font">
<font>
<family>Roboto</family>
<pointsize>9</pointsize>
</font>
</property>
<property name="text">
<string>Magic:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="lineEdit_Magic">
<property name="enabled">
<bool>false</bool>
</property>
<property name="font">
<font>
<family>Roboto</family>
<pointsize>9</pointsize>
</font>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_26">
<property name="font">
<font>
<family>Roboto</family>
<pointsize>9</pointsize>
</font>
</property>
<property name="text">
<string>Version:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QSpinBox" name="spinBox_Version">
<property name="enabled">
<bool>false</bool>
</property>
<property name="font">
<font>
<family>Roboto</family>
<pointsize>9</pointsize>
</font>
</property>
<property name="suffix">
<string> B</string>
</property>
<property name="maximum">
<number>1000000000</number>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_14">
<property name="font">
<font>
<family>Roboto</family>
<pointsize>9</pointsize>
</font>
</property>
<property name="title">
<string>Info</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_8">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_40">
<item>
<widget class="QLabel" name="label_38">
<property name="font">
<font>
<family>Roboto</family>
<pointsize>9</pointsize>
</font>
</property>
<property name="text">
<string>Depth:</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="spinBox_Depth">
<property name="enabled">
<bool>false</bool>
</property>
<property name="font">
<font>
<family>Roboto</family>
<pointsize>9</pointsize>
</font>
</property>
<property name="maximum">
<number>1000000000</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_41">
<item>
<widget class="QLabel" name="label_35">
<property name="font">
<font>
<family>Roboto</family>
<pointsize>9</pointsize>
</font>
</property>
<property name="text">
<string>Format</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_Format">
<property name="enabled">
<bool>false</bool>
</property>
<property name="font">
<font>
<family>Roboto</family>
<pointsize>9</pointsize>
</font>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_43">
<item>
<widget class="QLabel" name="label_39">
<property name="font">
<font>
<family>Roboto</family>
<pointsize>9</pointsize>
</font>
</property>
<property name="text">
<string>Height:</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="spinBox_Height">
<property name="enabled">
<bool>false</bool>
</property>
<property name="font">
<font>
<family>Roboto</family>
<pointsize>9</pointsize>
</font>
</property>
<property name="maximum">
<number>1000000000</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_44">
<item>
<widget class="QLabel" name="label_40">
<property name="font">
<font>
<family>Roboto</family>
<pointsize>9</pointsize>
</font>
</property>
<property name="text">
<string>Width:</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="spinBox_Width">
<property name="enabled">
<bool>false</bool>
</property>
<property name="font">
<font>
<family>Roboto</family>
<pointsize>9</pointsize>
</font>
</property>
<property name="maximum">
<number>1000000000</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_45">
<item>
<widget class="QLabel" name="label_41">
<property name="font">
<font>
<family>Roboto</family>
<pointsize>9</pointsize>
</font>
</property>
<property name="text">
<string>Usage</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="spinBox_Usage">
<property name="enabled">
<bool>false</bool>
</property>
<property name="font">
<font>
<family>Roboto</family>
<pointsize>9</pointsize>
</font>
</property>
<property name="maximum">
<number>1000000000</number>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_21">
<property name="font">
<font>
<family>Roboto</family>
<pointsize>9</pointsize>
</font>
</property>
<property name="title">
<string>Mipmaps</string>
</property>
<layout class="QFormLayout" name="formLayout_5">
<item row="0" column="0" colspan="2">
<layout class="QHBoxLayout" name="horizontalLayout_25">
<item>
<spacer name="horizontalSpacer_4">
<property name="font">
<font>
<family>Roboto</family>
<pointsize>9</pointsize>
</font>
</property>
<property name="orientation">
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label_32">
<property name="font">
<font>
<family>Roboto</family>
<pointsize>9</pointsize>
</font>
</property>
<property name="text">
<string>Select Mipmap:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboBox_Mipmap">
<property name="minimumSize">
<size>
<width>60</width>
<height>0</height>
</size>
</property>
<property name="font">
<font>
<family>Roboto</family>
<pointsize>9</pointsize>
</font>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_5">
<property name="font">
<font>
<family>Roboto</family>
<pointsize>9</pointsize>
</font>
</property>
<property name="orientation">
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_55">
<property name="font">
<font>
<family>Roboto</family>
<pointsize>9</pointsize>
</font>
</property>
<property name="text">
<string>Size: </string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QSpinBox" name="spinBox_MipmapSize">
<property name="enabled">
<bool>false</bool>
</property>
<property name="font">
<font>
<family>Roboto</family>
<pointsize>9</pointsize>
</font>
</property>
<property name="maximum">
<number>1000000000</number>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_56">
<property name="font">
<font>
<family>Roboto</family>
<pointsize>9</pointsize>
</font>
</property>
<property name="text">
<string>Offset:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QSpinBox" name="spinBox_MipmapOffset">
<property name="enabled">
<bool>false</bool>
</property>
<property name="font">
<font>
<family>Roboto</family>
<pointsize>9</pointsize>
</font>
</property>
<property name="maximum">
<number>1000000000</number>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer_5">
<property name="orientation">
<enum>Qt::Orientation::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<spacer name="horizontalSpacer_6">
<property name="orientation">
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QGroupBox" name="groupBox_26">
<property name="font">
<font>
<family>Roboto</family>
<pointsize>9</pointsize>
</font>
</property>
<property name="title">
<string>Preview</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_22">
<item>
<spacer name="verticalSpacer_11">
<property name="orientation">
<enum>Qt::Orientation::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label_Image">
<property name="minimumSize">
<size>
<width>600</width>
<height>600</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>600</width>
<height>600</height>
</size>
</property>
<property name="font">
<font>
<family>Roboto</family>
<pointsize>9</pointsize>
</font>
</property>
<property name="styleSheet">
<string notr="true">border: 2px solid white;</string>
</property>
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignmentFlag::AlignCenter</set>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_12">
<property name="orientation">
<enum>Qt::Orientation::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer_13">
<property name="orientation">
<enum>Qt::Orientation::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>116</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -1,58 +0,0 @@
#include "localstringviewer.h"
#include "ui_localstringviewer.h"
LocalStringViewer::LocalStringViewer(QWidget *parent)
: QWidget(parent)
, ui(new Ui::LocalStringViewer),
mVersion(),
mConfigPath(),
mFileNotes() {
ui->setupUi(this);
ui->tableWidget_Strings->setColumnCount(2);
ui->tableWidget_Strings->setRowCount(0);
ui->tableWidget_Strings->setColumnWidth(0, 200);
ui->tableWidget_Strings->horizontalHeader()->setStretchLastSection(true);
}
LocalStringViewer::~LocalStringViewer() {
delete ui;
}
void LocalStringViewer::SetVersion(quint32 aVersion) {
mVersion = aVersion;
ui->spinBox_Version->setValue(mVersion);
}
void LocalStringViewer::SetConfigPath(const QString aConfigPath) {
mConfigPath = aConfigPath;
ui->lineEdit_Config->setText(mConfigPath);
}
void LocalStringViewer::SetFileNotes(const QString aFileNotes) {
mFileNotes = aFileNotes;
ui->plainTextEdit_FileNotes->setPlainText(mFileNotes);
}
void LocalStringViewer::AddLocalString(XLocalizeEntry aLocalString) {
mLocalStrings.append(aLocalString);
ui->tableWidget_Strings->setRowCount(mLocalStrings.size());
ui->groupBox_LocalStrViewer->setTitle(QString("Entries (%1)").arg(mLocalStrings.size()));
QTableWidgetItem *aliasItem = new QTableWidgetItem(aLocalString.GetValue()->GetString());
QTableWidgetItem *stringItem = new QTableWidgetItem(aLocalString.GetName()->GetString());
ui->tableWidget_Strings->setItem(mLocalStrings.size() - 1, 0, aliasItem);
ui->tableWidget_Strings->setItem(mLocalStrings.size() - 1, 1, stringItem);
}
void LocalStringViewer::SetZoneFile(const ZoneFile* aZoneFile) {
mLocalStrings.clear();
ui->tableWidget_Strings->clear();
ui->label_Title->setText(aZoneFile->GetStem().section('.', 0, 0) + ".str");
// for (const LocalString &localStr : aZoneFile->GetAssetMap().localStrings) {
// AddLocalString(localStr);
// }
}

View File

@ -1,34 +0,0 @@
#ifndef LOCALSTRINGVIEWER_H
#define LOCALSTRINGVIEWER_H
#include "xlocalizeentry.h"
#include "zonefile.h"
#include <QWidget>
namespace Ui {
class LocalStringViewer;
}
class LocalStringViewer : public QWidget
{
Q_OBJECT
public:
explicit LocalStringViewer(QWidget *parent = nullptr);
~LocalStringViewer();
void SetVersion(quint32 aVersion);
void SetConfigPath(const QString aConfigPath);
void SetFileNotes(const QString aFileNotes);
void AddLocalString(XLocalizeEntry aLocalString);
void SetZoneFile(const ZoneFile *aZoneFile);
private:
Ui::LocalStringViewer *ui;
quint32 mVersion;
QString mConfigPath;
QString mFileNotes;
QVector<XLocalizeEntry> mLocalStrings;
};
#endif // LOCALSTRINGVIEWER_H

View File

@ -1,194 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>LocalStringViewer</class>
<widget class="QWidget" name="LocalStringViewer">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>841</width>
<height>457</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>841</width>
<height>457</height>
</size>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="label_Title">
<property name="font">
<font>
<family>Roboto</family>
<pointsize>16</pointsize>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>LocalString File 0</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0" colspan="2">
<widget class="QGroupBox" name="groupBox">
<property name="minimumSize">
<size>
<width>325</width>
<height>398</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>325</width>
<height>16777215</height>
</size>
</property>
<property name="font">
<font>
<family>Roboto</family>
<pointsize>9</pointsize>
</font>
</property>
<property name="title">
<string>Header</string>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<item row="3" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>File Notes:</string>
</property>
<property name="alignment">
<set>Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignTop</set>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Version:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="lineEdit_Config">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>C:\cod5\cod\cod5\bin\StringEd.cfg</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Config:</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QToolButton" name="toolButton">
<property name="text">
<string>...</string>
</property>
</widget>
</item>
<item row="2" column="1" colspan="2">
<widget class="QSpinBox" name="spinBox_Version">
<property name="enabled">
<bool>false</bool>
</property>
<property name="maximum">
<number>10000</number>
</property>
<property name="value">
<number>1</number>
</property>
</widget>
</item>
<item row="3" column="1" colspan="2">
<widget class="QPlainTextEdit" name="plainTextEdit_FileNotes">
<property name="placeholderText">
<string>Files notes...</string>
</property>
</widget>
</item>
<item row="4" column="0" colspan="3">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Orientation::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QGroupBox" name="groupBox_LocalStrViewer">
<property name="minimumSize">
<size>
<width>400</width>
<height>400</height>
</size>
</property>
<property name="font">
<font>
<family>Roboto</family>
<pointsize>9</pointsize>
</font>
</property>
<property name="title">
<string>Entries</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QTableWidget" name="tableWidget_Strings">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer_5">
<property name="orientation">
<enum>Qt::Orientation::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -1,11 +0,0 @@
#include "mainwindow.h"
#include <QApplication>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
w.show();
return a.exec();
}

View File

@ -1,977 +0,0 @@
#include "mainwindow.h"
#include "qtimer.h"
#include "ui_mainwindow.h"
#include "aboutdialog.h"
#include "fastfile.h"
#include "highlighter_gsc.h"
#include "highlighter_cfg.h"
#include "highlighter_shock.h"
#include "highlighter_rumble.h"
#include "materialviewer.h"
#include "preferenceeditor.h"
#include "reportissuedialog.h"
#include "rumblegraphviewer.h"
#include "stringtableviewer.h"
#include "techsetviewer.h"
#include "fastfile_factory.h"
#include "iwifile.h"
#include "ddsfile.h"
#include "statusbarmanager.h"
#include "ddsviewer.h"
#include "fastfileviewer.h"
#include "ipak_structs.h"
#include "iwiviewer.h"
#include "localstringviewer.h"
#include "zonefileviewer.h"
#include "techsetviewer.h"
#include "logmanager.h"
#include <QtMath>
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent), ui(new Ui::MainWindow) {
ui->setupUi(this);
setAcceptDrops(true);
XAsset::SetDebug(true);
mTypeMap = QMap<QString, int>();
mTypeOrder = QStringList();
mRawFileMap = QMap<QString, QString>();
//mImageMap = QMap<QString, Image>();
mTreeMap = QMap<QString, QTreeWidgetItem *>();
mStrTableMap = QMap<QString, QVector<QPair<QString, QString>>>();
mBSPVersion = 0;
mDiskLumpCount = 0;
mDiskLumpOrder = QVector<quint32>();
mLumps = QMap<quint32, Lump>();
mTreeWidget = new XTreeWidget(this);
mLogWidget = new QPlainTextEdit(this);
mProgressBar = new QProgressBar(this);
mProgressBar->setMaximum(100); // Default max value
mProgressBar->setVisible(false); // Initially hidden
connect(ui->actionRun_Tests, &QAction::triggered, this, [](bool checked) {
Q_UNUSED(checked);
});
connect(ui->actionReport_Issue, &QAction::triggered, this, [this](bool checked) {
Q_UNUSED(checked);
ReportIssueDialog issueDialog("https://git.redline.llc", "njohnson", "XPlor", "4738c4d2efd123efac1506c68c59b285c646df9f", this);
if (issueDialog.exec() == QDialog::Accepted) {
}
});
connect(&StatusBarManager::instance(), &StatusBarManager::statusUpdated,
this, &MainWindow::HandleStatusUpdate);
connect(&StatusBarManager::instance(), &StatusBarManager::progressUpdated,
this, &MainWindow::HandleProgressUpdate);
connect(&LogManager::instance(), &LogManager::entryAdded,
this, &MainWindow::HandleLogEntry);
statusBar()->addPermanentWidget(mProgressBar);
connect(ui->actionPreferences, &QAction::triggered, this, [this](bool checked) {
Q_UNUSED(checked);
PreferenceEditor *prefEditor = new PreferenceEditor(this);
prefEditor->exec();
});
ui->tabWidget->setContextMenuPolicy(Qt::CustomContextMenu);
connect(ui->tabWidget, &QTabWidget::customContextMenuRequested, this, [this](const QPoint &pos) {
if (pos.isNull())
return;
int tabIndex = ui->tabWidget->tabBar()->tabAt(pos);
QMenu *contextMenu = new QMenu(this);
QAction *closeAction = new QAction("Close");
contextMenu->addAction(closeAction);
connect(closeAction, &QAction::triggered, this, [this, &tabIndex](bool checked) {
Q_UNUSED(checked);
ui->tabWidget->removeTab(tabIndex);
});
QMenu *closeMultipleAction = new QMenu("Close Multiple Tabs");
QAction *closeAllAction = new QAction("Close All");
closeMultipleAction->addAction(closeAllAction);
connect(closeAllAction, &QAction::triggered, this, [this](bool checked) {
Q_UNUSED(checked);
ui->tabWidget->clear();
});
QAction *closeAllButAction = new QAction("Close All BUT This");
closeMultipleAction->addAction(closeAllButAction);
connect(closeAllButAction, &QAction::triggered, this, [this, &tabIndex](bool checked) {
Q_UNUSED(checked);
for (int i = 0; i < ui->tabWidget->count(); i++) {
if (i != tabIndex) {
ui->tabWidget->removeTab(i);
}
}
});
QAction *closeLeftAction = new QAction("Close All to the Left");
closeMultipleAction->addAction(closeLeftAction);
connect(closeLeftAction, &QAction::triggered, this, [this, &tabIndex](bool checked) {
Q_UNUSED(checked);
for (int i = 0; i < tabIndex; i++) {
ui->tabWidget->removeTab(i);
}
});
QAction *closeRightAction = new QAction("Close All to the Right");
closeMultipleAction->addAction(closeRightAction);
connect(closeRightAction, &QAction::triggered, this, [this, &tabIndex](bool checked) {
Q_UNUSED(checked);
for (int i = tabIndex + 1; i < ui->tabWidget->count(); i++) {
ui->tabWidget->removeTab(i);
}
});
contextMenu->addMenu(closeMultipleAction);
QPoint pt(pos);
contextMenu->exec(ui->tabWidget->mapToGlobal(pt));
delete contextMenu;
});
connect(ui->tabWidget, &QTabWidget::tabCloseRequested, this, [this](int index) {
ui->tabWidget->removeTab(index);
});
connect(mTreeWidget, &XTreeWidget::Cleared, this, [this]() {
ui->tabWidget->clear();
});
connect(mTreeWidget, &XTreeWidget::RawFileSelected, this, [this](const XRawFile* rawFile, const QString aParentName) {
QTabWidget *rawTabWidget = new QTabWidget(this);
rawTabWidget->setProperty("PARENT_NAME", QVariant::fromValue(aParentName));
QPlainTextEdit *scriptEditor = new QPlainTextEdit(rawTabWidget);
scriptEditor->setAcceptDrops(false);
scriptEditor->setProperty("PARENT_NAME", QVariant::fromValue(aParentName));
scriptEditor->setFont(QFont("Consolas"));
// if (rawFile->contents.isEmpty()) {
// scriptEditor->setPlainText("EMPTY");
// } else {
// scriptEditor->setPlainText(rawFile->contents);
// }
QString fileStem;// = rawFile->path.split('/').last();
for (int i = 0; i < ui->tabWidget->count(); i++) {
if (ui->tabWidget->tabText(i) == fileStem) {
delete scriptEditor;
return;
}
}
const int tabStopSpaces = 4;
QFontMetrics metrics(scriptEditor->font());
scriptEditor->setTabStopDistance(tabStopSpaces * metrics.horizontalAdvance(' '));
QSyntaxHighlighter *highlighter = nullptr;
if (fileStem.contains(".gsc")) {
highlighter = new Highlighter_GSC(scriptEditor->document());
} else if (fileStem.contains(".cfg")) {
highlighter = new Highlighter_CFG(scriptEditor->document());
} else if (fileStem.contains(".rmb")) {
highlighter = new Highlighter_Rumble(scriptEditor->document());
RumbleGraphViewer *rmbGraphViewer = new RumbleGraphViewer(this);
rmbGraphViewer->setProperty("PARENT_NAME", QVariant::fromValue(aParentName));
rmbGraphViewer->SetRumbleGraphFile(rawFile);
rawTabWidget->addTab(rmbGraphViewer, "UI Editor");
rawTabWidget->addTab(scriptEditor, "Text Editor");
ui->tabWidget->addTab(rawTabWidget, fileStem);
ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, Utils::CreateAssetIcon(ASSET_TYPE_RUMBLE));
ui->tabWidget->setCurrentIndex(ui->tabWidget->count() - 1);
return;
} else if (fileStem.contains(".shock")) {
highlighter = new Highlighter_Shock(scriptEditor->document());
} /*else if (rawFile->contents.left(6) == "RUMBLE") {
RumbleFileViewer *rmbFileViewer = new RumbleFileViewer(this);
rmbFileViewer->setProperty("PARENT_NAME", QVariant::fromValue(aParentName));
rmbFileViewer->SetRumbleFile(rawFile);
rawTabWidget->addTab(rmbFileViewer, "UI Editor");
rawTabWidget->addTab(scriptEditor, "Text Editor");
ui->tabWidget->addTab(rawTabWidget, fileStem);
ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, Utils::CreateAssetIcon(ASSET_TYPE_RUMBLE));
ui->tabWidget->setCurrentIndex(ui->tabWidget->count() - 1);
return;
}*/ else {
delete highlighter;
}
ui->tabWidget->addTab(scriptEditor, fileStem);
ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, Utils::CreateAssetIcon(ASSET_TYPE_RAWFILE));
ui->tabWidget->setCurrentIndex(ui->tabWidget->count() - 1);
});
// connect(mTreeWidget, &XTreeWidget::ImageSelected, this, [this](std::shared_ptr<Image> image, const QString aParentName) {
// ImageWidget *mImageWidget = new ImageWidget(this);
// mImageWidget->setAcceptDrops(false);
// mImageWidget->SetImage(image);
// mImageWidget->setProperty("PARENT_NAME", QVariant::fromValue(aParentName));
// QString fileStem = image->materialName;
// for (int i = 0; i < ui->tabWidget->count(); i++) {
// if (ui->tabWidget->tabText(i) == fileStem) {
// delete mImageWidget;
// return;
// }
// }
// ui->tabWidget->addTab(mImageWidget, fileStem);
// ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, Utils::CreateAssetIcon(ASSET_TYPE_IMAGE));
// ui->tabWidget->setCurrentIndex(ui->tabWidget->count() - 1);
// });
// connect(mTreeWidget, &XTreeWidget::MenuSelected, this, [](std::shared_ptr<Menu> menu, const QString aParentName) {
// Q_UNUSED(menu);
// });
connect(mTreeWidget, &XTreeWidget::MaterialSelected, this, [this](const XMaterial* material, const QString aParentName) {
MaterialViewer *matViewer = new MaterialViewer(this);
matViewer->setAcceptDrops(false);
matViewer->SetMaterial(material);
matViewer->setProperty("PARENT_NAME", QVariant::fromValue(aParentName));
// QString fileStem = material->name;
// for (int i = 0; i < ui->tabWidget->count(); i++) {
// if (ui->tabWidget->tabText(i) == fileStem) {
// delete matViewer;
// return;
// }
// }
//ui->tabWidget->addTab(matViewer, fileStem);
ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, Utils::CreateAssetIcon(ASSET_TYPE_MATERIAL));
ui->tabWidget->setCurrentIndex(ui->tabWidget->count() - 1);
});
connect(mTreeWidget, &XTreeWidget::DDSFileSelected, this, [this](const DDSFile* ddsFile, const QString aParentName) {
DDSViewer *ddsViewer = new DDSViewer(this);
ddsViewer->setAcceptDrops(false);
ddsViewer->SetDDSFile(ddsFile);
ddsViewer->setProperty("PARENT_NAME", QVariant::fromValue(aParentName));
QString fileStem = ddsFile->fileStem + ".dds";
for (int i = 0; i < ui->tabWidget->count(); i++) {
if (ui->tabWidget->tabText(i) == fileStem) {
delete ddsViewer;
return;
}
}
ui->tabWidget->addTab(ddsViewer, fileStem);
ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, Utils::CreateAssetIcon(ASSET_TYPE_IMAGE));
ui->tabWidget->setCurrentIndex(ui->tabWidget->count() - 1);
});
connect(mTreeWidget, &XTreeWidget::IWIFileSelected, this, [this](const IWIFile* iwiFile, const QString aParentName) {
IWIViewer *iwiViewer = new IWIViewer(this);
iwiViewer->setAcceptDrops(false);
iwiViewer->SetIWIFile(iwiFile);
iwiViewer->setProperty("PARENT_NAME", QVariant::fromValue(aParentName));
QString fileStem = iwiFile->fileStem + ".iwi";
for (int i = 0; i < ui->tabWidget->count(); i++) {
if (ui->tabWidget->tabText(i) == fileStem) {
delete iwiViewer;
return;
}
}
ui->tabWidget->addTab(iwiViewer, fileStem);
ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, Utils::CreateAssetIcon(ASSET_TYPE_IMAGE));
ui->tabWidget->setCurrentIndex(ui->tabWidget->count() - 1);
});
connect(mTreeWidget, &XTreeWidget::FastFileSelected, this, [this](const FastFile* aFastFile, const QString aParentName) {
FastFileViewer *fastFileViewer = new FastFileViewer(this);
fastFileViewer->setAcceptDrops(false);
fastFileViewer->SetFastFile(aFastFile);
fastFileViewer->setProperty("PARENT_NAME", QVariant::fromValue(aParentName));
QString fileStem = aFastFile->GetStem();
for (int i = 0; i < ui->tabWidget->count(); i++) {
if (ui->tabWidget->tabText(i) == fileStem) {
delete fastFileViewer;
return;
}
}
ui->tabWidget->addTab(fastFileViewer, fileStem);
ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, Utils::CreateAssetIcon("FF"));
ui->tabWidget->setCurrentIndex(ui->tabWidget->count() - 1);
});
connect(mTreeWidget, &XTreeWidget::ZoneFileSelected, this, [this](const ZoneFile* aZoneFile, const QString aParentName) {
ZoneFileViewer *zoneFileViewer = new ZoneFileViewer(this);
zoneFileViewer->setAcceptDrops(false);
zoneFileViewer->SetZoneFile(aZoneFile);
zoneFileViewer->setProperty("PARENT_NAME", QVariant::fromValue(aParentName));
QString fileStem = aZoneFile->GetBaseStem() + ".zone";
for (int i = 0; i < ui->tabWidget->count(); i++) {
if (ui->tabWidget->tabText(i) == fileStem) {
delete zoneFileViewer;
return;
}
}
QWidget *containerWidget = new QWidget();
QVBoxLayout *layout = new QVBoxLayout(containerWidget);
layout->addWidget(zoneFileViewer);
containerWidget->setLayout(layout);
// Create a scroll area and set its properties
QScrollArea *scrollArea = new QScrollArea(ui->tabWidget);
scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
scrollArea->setWidgetResizable(true); // Important to allow resizing
scrollArea->setWidget(containerWidget);
ui->tabWidget->addTab(scrollArea, fileStem);
ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, Utils::CreateAssetIcon("ZF"));
ui->tabWidget->setCurrentIndex(ui->tabWidget->count() - 1);
});
connect(mTreeWidget, &XTreeWidget::LocalStringSelected, this, [this](const ZoneFile* aZoneFile, const QString aParentName) {
LocalStringViewer *localStrViewer = new LocalStringViewer(this);
localStrViewer->setAcceptDrops(false);
localStrViewer->SetZoneFile(aZoneFile);
localStrViewer->setProperty("PARENT_NAME", QVariant::fromValue(aParentName));
QString fileStem = aZoneFile->GetStem() + ".str";
for (int i = 0; i < ui->tabWidget->count(); i++) {
if (ui->tabWidget->tabText(i) == fileStem) {
delete localStrViewer;
return;
}
}
ui->tabWidget->addTab(localStrViewer, fileStem);
ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, Utils::CreateAssetIcon(ASSET_TYPE_LOCALIZE_ENTRY));
ui->tabWidget->setCurrentIndex(ui->tabWidget->count() - 1);
});
connect(mTreeWidget, &XTreeWidget::TechSetSelected, this, [this](const XMaterialTechniqueSet* aTechSet, const QString aParentName) {
TechSetViewer *techSetViewer = new TechSetViewer(this);
techSetViewer->setAcceptDrops(false);
techSetViewer->SetTechSet(aTechSet);
techSetViewer->setProperty("PARENT_NAME", QVariant::fromValue(aParentName));
QString fileStem = aTechSet->GetName();
for (int i = 0; i < ui->tabWidget->count(); i++) {
if (ui->tabWidget->tabText(i) == fileStem) {
delete techSetViewer;
return;
}
}
ui->tabWidget->addTab(techSetViewer, aTechSet->GetName());
ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, Utils::CreateAssetIcon(ASSET_TYPE_TECHNIQUE_SET));
ui->tabWidget->setCurrentIndex(ui->tabWidget->count() - 1);
});
connect(mTreeWidget, &XTreeWidget::StrTableSelected, this, [this](const XStringTable* aStrTable, const QString aParentName) {
StringTableViewer *strTableViewer = new StringTableViewer(this);
strTableViewer->setAcceptDrops(false);
strTableViewer->SetStringTable(aStrTable);
strTableViewer->setProperty("PARENT_NAME", QVariant::fromValue(aParentName));
QString fileStem = aStrTable->GetName()->GetString();
for (int i = 0; i < ui->tabWidget->count(); i++) {
if (ui->tabWidget->tabText(i) == fileStem) {
delete strTableViewer;
return;
}
}
ui->tabWidget->addTab(strTableViewer, fileStem);
ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, Utils::CreateAssetIcon(ASSET_TYPE_STRINGTABLE));
ui->tabWidget->setCurrentIndex(ui->tabWidget->count() - 1);
});
// connect(mTreeWidget, &XTreeWidget::SoundSelected, this, [this](std::shared_ptr<Sound> aSound, const QString aParentName) {
// SoundViewer *soundViewer = new SoundViewer(this);
// soundViewer->setAcceptDrops(false);
// soundViewer->SetSound(aSound);
// soundViewer->setProperty("PARENT_NAME", QVariant::fromValue(aParentName));
// QString fileStem = aSound->path.split('/').last();
// for (int i = 0; i < ui->tabWidget->count(); i++) {
// if (ui->tabWidget->tabText(i) == fileStem) {
// delete soundViewer;
// return;
// }
// }
// ui->tabWidget->addTab(soundViewer, fileStem);
// ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, Utils::CreateAssetIcon(ASSET_TYPE_SOUND));
// ui->tabWidget->setCurrentIndex(ui->tabWidget->count() - 1);
// });
connect(mTreeWidget, &XTreeWidget::ItemSelected, this, [this](const QString itemText) {
for (int i = 0; i < ui->tabWidget->count(); i++) {
if (ui->tabWidget->tabText(i) == itemText) {
ui->tabWidget->setCurrentIndex(i);
break;
}
}
});
connect(mTreeWidget, &XTreeWidget::ItemClosed, this, [this](const QString itemText) {
for (int i = 0; i < ui->tabWidget->count(); i++) {
const QString parentName = ui->tabWidget->widget(i)->property("PARENT_NAME").toString();
if (parentName == itemText) {
ui->tabWidget->removeTab(i);
break;
}
}
});
// Connect Help > About dialog
connect(ui->actionAbout, &QAction::triggered, this, [this](bool checked) {
Q_UNUSED(checked);
AboutDialog *aboutDialog = new AboutDialog(this);
aboutDialog->exec();
delete aboutDialog;
});
connect(ui->actionOpen_Fast_File, &QAction::triggered, this,
[this](bool checked) {
Q_UNUSED(checked);
OpenFastFile();
});
connect(ui->actionOpen_Zone_File, &QAction::triggered, this,
[this](bool checked) {
Q_UNUSED(checked);
OpenZoneFile();
});
QDockWidget *treeDockWidget = new QDockWidget(this);
treeDockWidget->setWidget(mTreeWidget);
treeDockWidget->setWindowTitle("Tree Browser");
addDockWidget(Qt::LeftDockWidgetArea, treeDockWidget);
QDockWidget *logDockWidget = new QDockWidget(this);
logDockWidget->setWidget(mLogWidget);
logDockWidget->setWindowTitle("Logs");
addDockWidget(Qt::RightDockWidgetArea, logDockWidget);
ui->toolBar->addAction(ui->actionNew_Fast_File);
ui->toolBar->addAction(ui->actionNew_Zone_File);
ui->toolBar->addAction(ui->actionOpen_Fast_File);
ui->toolBar->addAction(ui->actionOpen_Zone_File);
ui->toolBar->addAction(ui->actionOpen_Folder);
ui->toolBar->addAction(ui->actionSave);
ui->toolBar->addSeparator();
ui->toolBar->addAction(ui->actionCut);
ui->toolBar->addAction(ui->actionCopy);
ui->toolBar->addAction(ui->actionPaste);
ui->toolBar->addSeparator();
ui->toolBar->addSeparator();
ui->toolBar->addSeparator();
ui->toolBar->addAction(ui->actionFind_2);
Reset();
}
MainWindow::~MainWindow() { delete ui; }
void MainWindow::Reset() {
// Clear data tree
// mTreeWidget->clear();
// Reset class vars
mTypeMap.clear();
mTypeOrder.clear();
mTagCount = 0;
mRecordCount = 0;
mRawFileMap.clear();
mTreeMap.clear();
mStrTableMap.clear();
}
/*
OpenFastFile()
Opens a file dialog in the steam folder,
and opens the selected file.
*/
bool MainWindow::OpenFastFile(const QString aFastFilePath) {
const QString fastFileStem = aFastFilePath.section("/", -1, -1);
if (mTreeWidget->HasFastFile(fastFileStem)) {
LogManager::instance().addError("Can't add duplicate file!");
return false;
}
FastFile* fastFile = FastFile::Open(aFastFilePath);
fastFile->SetStem(fastFileStem);
mTreeWidget->AddFastFile(fastFile);
// Open zone file after decompressing ff and writing
return true;
}
bool MainWindow::OpenFastFile(const QByteArray& aFastFileData, const QString aFastFilePath) {
const QString fastFileStem = aFastFilePath.section("/", -1, -1);
if (mTreeWidget->HasFastFile(fastFileStem)) {
LogManager::instance().addError("Can't add duplicate file!");
return false;
}
FastFile* fastFile = FastFile::Open(aFastFileData);
fastFile->SetStem(fastFileStem);
mTreeWidget->AddFastFile(fastFile);
// Open zone file after decompressing ff and writing
return true;
}
/*
OpenFastFile()
Opens a file dialog in the steam folder,
and opens the selected file.
*/
bool MainWindow::OpenFastFile() {
// Open file dialog to steam apps
const QString steamPath = "C:/Program Files (x86)/Steam/steamapps/common/Call of Duty World at War/zone/english/";
QFileDialog::getOpenFileContent(tr("Fast File (*.ff);;All Files (*.*)"), [this](const QString &fileName, const QByteArray &data){
OpenFastFile(data, fileName);
});
return true;
}
/*
OpenZoneFile()
Opens a file dialog in the steam folder,
and opens the selected file.
*/
bool MainWindow::OpenZoneFile(const QString aZoneFilePath, bool fromFF) {
Q_UNUSED(aZoneFilePath);
Q_UNUSED(fromFF);
// ZoneFile* zoneFile = ZoneFile::Create();
// if (!zoneFile.Load(aZoneFilePath)) {
// qDebug() << "Error: Failed to load zone file!";
// return false;
// }
// mTreeWidget->AddZoneFile(std::make_shared<ZoneFile>(zoneFile));
return true;
}
bool MainWindow::OpenZoneFile() {
// Open file dialog to steam apps
const QString steamPath = "C:/Program Files (x86)/Steam/steamapps/common/Call of Duty World at War/zone/english/";
const QString zoneFilePath = QFileDialog::getOpenFileName(this, "Open Zone File", steamPath, "Zone File (*.zone);;All Files (*.*)");
if (zoneFilePath.isNull()) {
// User pressed cancel
return false;
} else if (!QFile::exists(zoneFilePath)) {
QMessageBox::warning(this, "Warning!", QString("%1 does not exist!.").arg(zoneFilePath));
qDebug() << "Failed to open Zone file!";
return false;
}
return true;
}
int MainWindow::LoadFile_D3DBSP(const QString aFilePath) {
QFile file(aFilePath);
if (!file.open(QIODevice::ReadOnly)) {
qDebug() << "Error: Unable to open file" << aFilePath;
return 1; // ERR_FILE_NOT_FOUND
}
QDataStream stream(&file);
stream.setByteOrder(QDataStream::LittleEndian);
// Read Magic Value
quint32 magicValue;
stream >> magicValue;
if (magicValue != 'PSBI') {
qDebug() << "Error: Not a valid D3DBSP file";
return 2; // ERR_NOT_A_D3DBSP_FILE
}
// Read BSP Version and Lump Count
stream >> mBSPVersion;
stream >> mDiskLumpCount;
// Assign diskLumpOrderSize
mDiskLumpOrder.resize(mDiskLumpCount);
// Read Lump Index Entries
quint32 lumpOffset =
sizeof(quint32) * 3 + sizeof(LumpIndexEntry) * mDiskLumpCount;
for (quint32 i = 0; i < mDiskLumpCount; i++) {
LumpIndexEntry indexEntry;
stream >> indexEntry.type >> indexEntry.length;
mDiskLumpOrder[i] = indexEntry.type;
Lump &lump = mLumps[indexEntry.type];
lump.size = indexEntry.length;
lump.content.resize(indexEntry.length);
lump.isEmpty = false;
qDebug() << "Lump Type:"
<< Utils::LumpTypeToString((LUMP_TYPE)indexEntry.type)
<< "Lump Size:" << indexEntry.length;
// Handle offsets and padding
qint64 currentPos = file.pos();
file.seek(lumpOffset);
file.read(lump.content.data(), lump.size);
file.seek(currentPos);
lumpOffset += Utils::PadInt4(indexEntry.length);
}
file.close();
return 0; // Success
}
struct Command {
quint32 size = 0;
bool compressed = false;
};
quint32 DXT1 = 0x31545844; // 'DXT1'
quint32 DXT3 = 0x33545844; // 'DXT3'
quint32 DXT5 = 0x35545844; // 'DXT5'
int MainWindow::LoadFile_IWI(const QString aFilePath) {
mTreeWidget->AddIWIFile(new IWIFile(aFilePath));
return 0;
}
int MainWindow::LoadFile_DDSFiles(const QStringList aFilePaths) {
for (const QString &filePath : aFilePaths) {
if (!filePath.endsWith(".dds", Qt::CaseInsensitive)) {
qDebug() << "Error: Invalid filename " << filePath;
return -1;
}
mTreeWidget->AddDDSFile(new DDSFile(filePath));
}
return 0;
}
void MainWindow::HandleLogEntry(const QString &entry) {
QString logContents = mLogWidget->toPlainText() + "\n" + entry;
if (mLogWidget->toPlainText().isEmpty()) {
logContents = entry;
}
mLogWidget->setPlainText(logContents);
}
void MainWindow::HandleStatusUpdate(const QString &message, int timeout) {
statusBar()->showMessage(message, timeout);
mProgressBar->setVisible(false); // Hide progress bar if just a message
}
void MainWindow::HandleProgressUpdate(const QString &message, int progress, int max) {
mProgressBar->setMaximum(max);
mProgressBar->setValue(progress);
mProgressBar->setVisible(true);
QString progressText = QString("%1 (%2/%3)").arg(message).arg(progress).arg(max);
statusBar()->showMessage(progressText);
}
int MainWindow::LoadFile_DDS(const QString aFilePath) {
if (!aFilePath.endsWith(".dds", Qt::CaseInsensitive)) {
qDebug() << "Error: Invalid filename " << aFilePath;
return -1;
}
mTreeWidget->AddDDSFile(new DDSFile(aFilePath));
return 0;
}
int MainWindow::LoadFile_XSUB(const QString aFilePath) {
QFile file(aFilePath);
if (!file.open(QIODevice::ReadOnly)) {
qDebug() << "Error: Unable to open file" << aFilePath;
return 1; // ERR_FILE_NOT_FOUND
}
QDataStream stream(&file);
stream.setByteOrder(QDataStream::LittleEndian);
QByteArray magic(4, Qt::Uninitialized);
stream.readRawData(magic.data(), 4);
if (magic != "KAPI") {
qDebug() << "Wrong magic, invalid XSUB file!";
return -1;
}
qDebug() << "Magic: " << magic;
stream.skipRawData(5 * 4);
quint32 fileSize;
stream >> fileSize;
qDebug() << "File Size: " << fileSize;
return 0; // Success
}
int MainWindow::LoadFile_IPAK(const QString aFilePath) {
QFile file(aFilePath);
if (!file.open(QIODevice::ReadOnly)) {
qDebug() << "Error: Unable to open file" << aFilePath;
return 1; // ERR_FILE_NOT_FOUND
}
QDataStream stream(&file);
stream.setByteOrder(QDataStream::BigEndian);
IPAKHeader header;
stream >> header;
if (header.version == "50000") {
if (header.magic == "KAPI") {
stream.setByteOrder(QDataStream::LittleEndian);
} else if (header.magic == "IPAK") {
stream.setByteOrder(QDataStream::BigEndian);
} else {
qDebug() << "Invalid IPAK file!";
return -1;
}
} else {
qDebug() << "Invalid IPAK file version!";
return -1;
}
qDebug() << "IPAK File " << "\n"
<< "- Platform: " << header.platform << "\n"
<< "- Magic: " << header.magic << "\n"
<< "- Size: " << header.size << "\n"
<< "- Version: " << header.version << "\n"
<< "- Sections: " << header.sectionCount;
QDir outputFolder = QDir(QDir::currentPath() + "/output");
outputFolder.remove(QDir::currentPath() + "/output");
outputFolder.mkdir(QDir::currentPath() + "/output");
QVector<IPAKDataChunkMetaData> metas = QVector<IPAKDataChunkMetaData>();
QVector<IPAKIndexEntry> entries = QVector<IPAKIndexEntry>();
QVector<IPAKSection> sections = QVector<IPAKSection>(header.sectionCount);
for (quint32 i = 0; i < header.sectionCount; i++) {
IPAKSection currentSection;
stream >> currentSection;
sections << currentSection;
qDebug() << " - IPAK Section " << i + 1 << "\n"
<< " - Type: " << currentSection.type << " -> " << currentSection.typeInt << "\n"
<< " - Offset: " << currentSection.offset << "\n"
<< " - Item (IWI) Count: " << currentSection.itemCount << "\n"
<< " - Size: " << currentSection.size;
qint64 sectionPos = stream.device()->pos();
stream.device()->seek(currentSection.offset);
QString sectionType = currentSection.type;
if (sectionType == "Data") {
IPAKDataChunkHeader chunkHeader;
stream >> chunkHeader;
qDebug() << " - Chunk Header\n"
<< " - Count: " << chunkHeader.count << "\n"
<< " - Offset: " << chunkHeader.offset;
for (quint32 j = 0; j < 31; j++) {
IPAKDataChunkCommand command;
stream >> command;
if (!command.size) { continue; }
chunkHeader.commands << command;
qDebug() << " - Command\n"
<< " - Size: " << command.size << "\n"
<< " - Compressed: " << command.compressed;
}
for (quint32 j = 0; j < chunkHeader.count; j++) {
auto command = chunkHeader.commands[j];
qDebug() << "Reading from " << stream.device()->pos();
QByteArray data = stream.device()->read(command.size);
qDebug() << " to " << stream.device()->pos();
QString outputFilePath = outputFolder.filePath(QString("%1.iwi").arg(j));
if (command.compressed) {
//data = Compression::DecompressLZO(data);
}
QFile outputFile(outputFilePath);
if (!outputFile.open(QIODevice::WriteOnly)) {
qDebug() << "Failed to extract IPAK file.";
}
qDebug() << " - File Name: " << outputFile.fileName();
outputFile.write(data);
outputFile.close();
}
qDebug() << stream.device()->pos();
stream.skipRawData(sizeof(quint32) * (31 - chunkHeader.count));
qDebug() << stream.device()->pos();
} else if (sectionType == "Index") {
for (quint32 j = 0; j < currentSection.itemCount; j++) {
IPAKIndexEntry entry;
stream >> entry;
if (entry.size == 0) { continue; }
entries << entry;
quint64 entryPos = stream.device()->pos();
qDebug() << " - Index Entry " << j + 1 << "\n"
<< " - Name Hash: " << entry.nameHash << "\n"
<< " - Data Hash: " << entry.dataHash << "\n"
<< " - Offset: " << entry.offset << "\n"
<< " - Size: " << entry.size;
stream.device()->seek(entry.offset);
QByteArray sectionData(entry.size, Qt::Uninitialized);
stream.readRawData(sectionData.data(), entry.size);
const QString entryKey = QString::number(entry.nameHash);
QFile outputFile(outputFolder.filePath(QString("%1.dds").arg(entryKey)));
if (!outputFile.open(QIODevice::WriteOnly)) {
qDebug() << "Failed to extract IPAK file.";
}
qDebug() << " - File Name: " << outputFile.fileName();
outputFile.write(sectionData);
outputFile.close();
stream.device()->seek(entryPos);
}
}
stream.device()->seek(sectionPos);
qDebug() << stream.device()->pos();
}
return 0; // Success
}
void MainWindow::dragEnterEvent(QDragEnterEvent *event) {
const QMimeData *mimeData = event->mimeData();
bool goodDrag = true;
if (mimeData->hasUrls()) {
foreach (const QUrl url, mimeData->urls()) {
if (!url.toString().contains(".ff") &&
!url.toString().contains(".zone") &&
!url.toString().contains(".ipak") &&
!url.toString().contains(".d3dbsp") &&
!url.toString().contains(".lzoin") &&
!url.toString().contains(".xsub") &&
!url.toString().contains(".iwi") &&
!url.toString().contains(".dds")) {
goodDrag = false;
}
}
} else {
goodDrag = false;
}
if (goodDrag) {
event->acceptProposedAction();
}
}
void MainWindow::dragMoveEvent(QDragMoveEvent *event) {
Q_UNUSED(event);
}
void MainWindow::dragLeaveEvent(QDragLeaveEvent *event) {
Q_UNUSED(event);
}
void MainWindow::dropEvent(QDropEvent *event) {
const QMimeData *mimeData = event->mimeData();
if (mimeData->hasUrls()) {
QStringList ddsPaths = QStringList();
foreach (const QUrl url, mimeData->urls()) {
const QString urlStr = url.toLocalFile();
if (urlStr.contains(".zone")) {
qDebug() << "OpenZoneFile Returned: " << OpenZoneFile(urlStr);
} else if (urlStr.contains(".ff")) {
qDebug() << "OpenFastFile Returned: " << OpenFastFile(urlStr);
} else if (urlStr.contains(".ipak")) {
qDebug() << "LoadFile_IPAK Returned: " << LoadFile_IPAK(urlStr);
} else if (urlStr.contains(".xsub")) {
qDebug() << "LoadFile_XSUB Returned: " << LoadFile_XSUB(urlStr);
} else if (urlStr.contains(".iwi")) {
qDebug() << "LoadFile_IWI Returned: " << LoadFile_IWI(urlStr);
} else if (urlStr.contains(".dds")) {
if (mimeData->urls().size() == 1) {
qDebug() << "LoadFile_DDS Returned: " << LoadFile_DDS(urlStr);
} else {
ddsPaths << urlStr;
}
} else if (urlStr.contains(".d3dbsp")) {
LoadFile_D3DBSP(urlStr);
} else if (urlStr.contains(".lzoin")) {
QFile lzoFile(urlStr);
if (!lzoFile.open(QIODevice::ReadOnly)) {
qDebug() << "LZO: Failed to read file!";
continue;
}
QByteArray data;// = Compression::DecompressLZO(lzoFile.readAll());
lzoFile.close();
if (data.isEmpty()) {
qDebug() << "LZO: Decompression gave empty result!";
continue;
}
QFile outputFile(url.toLocalFile().replace("lzoin", "lzoout"));
if (!outputFile.open(QIODevice::WriteOnly)) {
qDebug() << "LZO: Failed to write file!";
continue;
}
outputFile.write(data);
outputFile.close();
} else {
const QString ext = urlStr.split('.').last();
ui->statusBar->showMessage(
QString("Can't display dropped file! .%1").arg(ext));
}
}
if (ddsPaths.size() > 1) {
qDebug() << "LoadFile_DDSFiles Returned: " << LoadFile_DDSFiles(ddsPaths);
}
} else {
ui->statusBar->showMessage("Can't display dropped data!");
}
}

View File

@ -1,78 +0,0 @@
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include "d3dbsp_structs.h"
#include "xtreewidget.h"
#include <QMainWindow>
#include <QFileDialog>
#include <QStandardPaths>
#include <QMessageBox>
#include <QDebug>
#include <QTableWidgetItem>
#include <QTreeWidgetItem>
#include <QDockWidget>
#include <QPlainTextEdit>
#include <QMimeData>
#include <QProgressBar>
QT_BEGIN_NAMESPACE
namespace Ui {
class MainWindow;
}
QT_END_NAMESPACE
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow(QWidget *parent = nullptr);
~MainWindow();
void Reset();
private slots:
bool OpenFastFile(const QString aFastFilePath);
bool OpenFastFile(const QByteArray& aFastFileData, const QString aFastFilePath);
bool OpenFastFile();
bool OpenZoneFile(const QString aZoneFilePath, bool fromFF = false);
bool OpenZoneFile();
int LoadFile_D3DBSP(const QString aFilePath);
int LoadFile_IPAK(const QString aFilePath);
int LoadFile_XSUB(const QString aFilePath);
int LoadFile_IWI(const QString aFilePath);
int LoadFile_DDS(const QString aFilePath);
int LoadFile_DDSFiles(const QStringList aFilePaths);
void HandleLogEntry(const QString &entry);
void HandleStatusUpdate(const QString &message, int timeout);
void HandleProgressUpdate(const QString &message, int progress, int max);
protected:
void dragEnterEvent(QDragEnterEvent *event) override;
void dragMoveEvent(QDragMoveEvent *event) override;
void dragLeaveEvent(QDragLeaveEvent *event) override;
void dropEvent(QDropEvent *event) override;
private:
Ui::MainWindow *ui;
QMap<QString, int> mTypeMap;
QStringList mTypeOrder;
quint32 mTagCount;
quint32 mRecordCount;
QMap<QString, QString> mRawFileMap;
//QMap<QString, Image> mImageMap;
QMap<QString, QTreeWidgetItem*> mTreeMap;
QMap<QString, QVector<QPair<QString, QString>>> mStrTableMap;
XTreeWidget *mTreeWidget;
QPlainTextEdit *mLogWidget;
QProgressBar *mProgressBar;
quint32 mBSPVersion;
quint32 mDiskLumpCount;
QVector<quint32> mDiskLumpOrder;
QMap<quint32, Lump> mLumps;
};
#endif // MAINWINDOW_H

View File

@ -1,379 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1579</width>
<height>857</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>550</width>
<height>300</height>
</size>
</property>
<property name="windowTitle">
<string>XPlor</string>
</property>
<property name="styleSheet">
<string notr="true">QMainWindow {
}</string>
</property>
<widget class="QWidget" name="centralwidget">
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>-1</number>
</property>
<property name="tabsClosable">
<bool>true</bool>
</property>
<property name="movable">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QMenuBar" name="menuBar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1579</width>
<height>21</height>
</rect>
</property>
<widget class="QMenu" name="MenuDef">
<property name="title">
<string>File</string>
</property>
<widget class="QMenu" name="menuRecent">
<property name="title">
<string>Recent...</string>
</property>
</widget>
<widget class="QMenu" name="menuImport">
<property name="title">
<string>Import...</string>
</property>
</widget>
<addaction name="actionNew_File_2"/>
<addaction name="actionNew_Fast_File"/>
<addaction name="actionNew_Zone_File"/>
<addaction name="separator"/>
<addaction name="actionOpen_Fast_File"/>
<addaction name="actionOpen_Zone_File"/>
<addaction name="actionOpen_Folder"/>
<addaction name="menuImport"/>
<addaction name="separator"/>
<addaction name="actionSave"/>
<addaction name="actionSave_As"/>
<addaction name="separator"/>
<addaction name="menuRecent"/>
</widget>
<widget class="QMenu" name="menuEdit">
<property name="title">
<string>Edit</string>
</property>
<widget class="QMenu" name="menuUndo_History">
<property name="title">
<string>Undo History...</string>
</property>
</widget>
<widget class="QMenu" name="menuRedo_History">
<property name="title">
<string>Redo History...</string>
</property>
</widget>
<addaction name="actionUndo"/>
<addaction name="actionRedo"/>
<addaction name="separator"/>
<addaction name="actionCut"/>
<addaction name="actionCopy"/>
<addaction name="actionPaste"/>
<addaction name="actionRename"/>
<addaction name="actionDelete"/>
<addaction name="separator"/>
<addaction name="actionFind_2"/>
<addaction name="actionEdit_Value"/>
<addaction name="actionEdit_as_Hex"/>
<addaction name="separator"/>
<addaction name="menuUndo_History"/>
<addaction name="menuRedo_History"/>
<addaction name="actionClear_Undo_History"/>
<addaction name="separator"/>
<addaction name="actionPreferences"/>
</widget>
<widget class="QMenu" name="menuHelp">
<property name="title">
<string>Help</string>
</property>
<addaction name="actionAbout"/>
<addaction name="actionCheck_for_Updates"/>
<addaction name="actionReport_Issue"/>
</widget>
<widget class="QMenu" name="menuTools">
<property name="title">
<string>Tools</string>
</property>
<addaction name="actionRun_Tests"/>
</widget>
<addaction name="MenuDef"/>
<addaction name="menuEdit"/>
<addaction name="menuTools"/>
<addaction name="menuHelp"/>
</widget>
<widget class="QToolBar" name="toolBar">
<property name="windowTitle">
<string>toolBar</string>
</property>
<attribute name="toolBarArea">
<enum>TopToolBarArea</enum>
</attribute>
<attribute name="toolBarBreak">
<bool>false</bool>
</attribute>
</widget>
<widget class="QStatusBar" name="statusBar"/>
<action name="actionNew_File_2">
<property name="icon">
<iconset resource="../data/data.qrc">
<normaloff>:/icons/icons/Icon_NewFile.png</normaloff>:/icons/icons/Icon_NewFile.png</iconset>
</property>
<property name="text">
<string>New</string>
</property>
</action>
<action name="actionNew_Fast_File">
<property name="icon">
<iconset resource="../data/data.qrc">
<normaloff>:/icons/icons/Icon_NewFile.png</normaloff>:/icons/icons/Icon_NewFile.png</iconset>
</property>
<property name="text">
<string>New Fast File</string>
</property>
</action>
<action name="actionNew_Zone_File">
<property name="icon">
<iconset resource="../data/data.qrc">
<normaloff>:/icons/icons/Icon_NewFile.png</normaloff>:/icons/icons/Icon_NewFile.png</iconset>
</property>
<property name="text">
<string>New Zone File</string>
</property>
</action>
<action name="actionOpen_Fast_File">
<property name="icon">
<iconset resource="../data/data.qrc">
<normaloff>:/icons/icons/Icon_OpenFile.png</normaloff>:/icons/icons/Icon_OpenFile.png</iconset>
</property>
<property name="text">
<string>Open Fast File</string>
</property>
</action>
<action name="actionOpen_Zone_File">
<property name="icon">
<iconset resource="../data/data.qrc">
<normaloff>:/icons/icons/Icon_OpenFile.png</normaloff>:/icons/icons/Icon_OpenFile.png</iconset>
</property>
<property name="text">
<string>Open Zone File</string>
</property>
</action>
<action name="actionOpen_Folder">
<property name="icon">
<iconset resource="../data/data.qrc">
<normaloff>:/icons/icons/Icon_OpenFile.png</normaloff>:/icons/icons/Icon_OpenFile.png</iconset>
</property>
<property name="text">
<string>Open Folder</string>
</property>
</action>
<action name="actionSave">
<property name="icon">
<iconset resource="../data/data.qrc">
<normaloff>:/icons/icons/Icon_Save.png</normaloff>:/icons/icons/Icon_Save.png</iconset>
</property>
<property name="text">
<string>Save</string>
</property>
</action>
<action name="actionSave_As">
<property name="text">
<string>Save As</string>
</property>
</action>
<action name="actione">
<property name="text">
<string>e</string>
</property>
</action>
<action name="actionFile">
<property name="text">
<string>File</string>
</property>
</action>
<action name="actionFolder">
<property name="text">
<string>Folder</string>
</property>
</action>
<action name="actionNew_File">
<property name="text">
<string>New File</string>
</property>
</action>
<action name="actionNew_Fast_File_2">
<property name="text">
<string>New Fast File</string>
</property>
</action>
<action name="actionNew_Zone_File_2">
<property name="text">
<string>New Zone File</string>
</property>
</action>
<action name="actionFrom_Clipboard">
<property name="text">
<string>From Clipboard</string>
</property>
</action>
<action name="actionMaterial">
<property name="text">
<string>Material</string>
</property>
</action>
<action name="actionSound">
<property name="text">
<string>Sound</string>
</property>
</action>
<action name="actionUndo">
<property name="text">
<string>Undo</string>
</property>
</action>
<action name="actionRedo">
<property name="text">
<string>Redo</string>
</property>
</action>
<action name="actionCut">
<property name="icon">
<iconset resource="../data/data.qrc">
<normaloff>:/icons/icons/Icon_Cut.png</normaloff>:/icons/icons/Icon_Cut.png</iconset>
</property>
<property name="text">
<string>Cut</string>
</property>
</action>
<action name="actionCopy">
<property name="icon">
<iconset resource="../data/data.qrc">
<normaloff>:/icons/icons/Icon_Copy.png</normaloff>:/icons/icons/Icon_Copy.png</iconset>
</property>
<property name="text">
<string>Copy</string>
</property>
</action>
<action name="actionPaste">
<property name="icon">
<iconset resource="../data/data.qrc">
<normaloff>:/icons/icons/Icon_Paste.png</normaloff>:/icons/icons/Icon_Paste.png</iconset>
</property>
<property name="text">
<string>Paste</string>
</property>
</action>
<action name="actionRename">
<property name="text">
<string>Rename</string>
</property>
</action>
<action name="actionEdit_Value">
<property name="text">
<string>Edit Value</string>
</property>
</action>
<action name="actionEdit_as_Hex">
<property name="text">
<string>Edit as Hex</string>
</property>
</action>
<action name="actionDelete">
<property name="text">
<string>Delete</string>
</property>
</action>
<action name="actiond">
<property name="text">
<string>d</string>
</property>
</action>
<action name="actiond_2">
<property name="text">
<string>d</string>
</property>
</action>
<action name="actionClear_Undo_History">
<property name="text">
<string>Clear Undo History</string>
</property>
</action>
<action name="actionFind">
<property name="text">
<string>Find</string>
</property>
</action>
<action name="actionAbout">
<property name="text">
<string>About</string>
</property>
</action>
<action name="actionChange_Icons">
<property name="text">
<string>Change Icons</string>
</property>
</action>
<action name="actionCheck_for_Updates">
<property name="text">
<string>Check for Updates</string>
</property>
</action>
<action name="actionFind_2">
<property name="icon">
<iconset resource="../data/data.qrc">
<normaloff>:/icons/icons/Icon_Find.png</normaloff>:/icons/icons/Icon_Find.png</iconset>
</property>
<property name="text">
<string>Find</string>
</property>
</action>
<action name="actionPreferences">
<property name="text">
<string>Preferences...</string>
</property>
</action>
<action name="actionReport_Issue">
<property name="text">
<string>Report Issue</string>
</property>
</action>
<action name="actionRun_Tests">
<property name="text">
<string>Run Tests</string>
</property>
</action>
</widget>
<resources>
<include location="../data/data.qrc"/>
</resources>
<connections/>
</ui>

View File

@ -1,43 +0,0 @@
#include "materialviewer.h"
#include "ui_materialviewer.h"
MaterialViewer::MaterialViewer(QWidget *parent)
: QWidget(parent)
, ui(new Ui::MaterialViewer)
{
ui->setupUi(this);
}
MaterialViewer::~MaterialViewer()
{
delete ui;
}
QString ToHexStr(quint32 in)
{
return QString("%1").arg(in, 8, 16, QChar('0')).toUpper();
}
void MaterialViewer::SetMaterial(const XMaterial* aMaterial)
{
Q_UNUSED(aMaterial);
// TODO: Fill in MaterialViewer::SetMaterial
// ui->lineEdit_NamePtr->setText(ToHexStr(aMaterial->namePtr));
// ui->lineEdit_Name->setText(aMaterial->name);
// ui->lineEdit_RefPtr->setText(ToHexStr(aMaterial->refNamePtr));
// ui->lineEdit_RefName->setText(aMaterial->refName);
// QString unknownStr = "";
// foreach (quint32 unknownPtr, aMaterial->pointers) {
// unknownStr += ToHexStr(unknownPtr) + "\n";
// }
// ui->lineEdit_Unknowns->setText(unknownStr);
// ui->lineEdit_StateA->setText(ToHexStr(aMaterial->stateBits[0]));
// ui->lineEdit_StateA->setText(ToHexStr(aMaterial->stateBits[1]));
// ui->spinBox_TextureCount->setValue(aMaterial->textureCount);
// ui->spinBox_ConstCount->setValue(aMaterial->constCount);
// ui->lineEdit_TechSetPtr->setText(ToHexStr(aMaterial->techSetPtr));
// ui->lineEdit_TexturePtr->setText(ToHexStr(aMaterial->texturePtr));
// ui->lineEdit_ConstantPtr->setText(ToHexStr(aMaterial->constPtr));
}

View File

@ -1,27 +0,0 @@
#ifndef MATERIALVIEWER_H
#define MATERIALVIEWER_H
#include "xmaterial.h"
#include <QWidget>
#include <QScrollArea>
namespace Ui {
class MaterialViewer;
}
class MaterialViewer : public QWidget
{
Q_OBJECT
public:
explicit MaterialViewer(QWidget *parent = nullptr);
~MaterialViewer();
void SetMaterial(const XMaterial *aMaterial);
private:
Ui::MaterialViewer *ui;
};
#endif // MATERIALVIEWER_H

View File

@ -1,236 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MaterialViewer</class>
<widget class="QWidget" name="MaterialViewer">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1001</width>
<height>650</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="label_Title">
<property name="font">
<font>
<family>Roboto</family>
<pointsize>16</pointsize>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Material 0</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="0" colspan="2">
<widget class="QGroupBox" name="groupBox_3">
<property name="minimumSize">
<size>
<width>325</width>
<height>398</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>325</width>
<height>16777215</height>
</size>
</property>
<property name="font">
<font>
<family>Roboto</family>
<pointsize>9</pointsize>
</font>
</property>
<property name="title">
<string>Header</string>
</property>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Name Ptr:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="lineEdit_NamePtr"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Name:</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
<string>Ref Ptr:</string>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Ref Name:</string>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Unknowns:</string>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>State A:</string>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>State B:</string>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="label_11">
<property name="text">
<string>Texture Count:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="lineEdit_Name"/>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="lineEdit_RefPtr"/>
</item>
<item row="3" column="1">
<widget class="QLineEdit" name="lineEdit_RefName"/>
</item>
<item row="4" column="1">
<widget class="QLineEdit" name="lineEdit_Unknowns"/>
</item>
<item row="5" column="1">
<widget class="QLineEdit" name="lineEdit_StateA"/>
</item>
<item row="6" column="1">
<widget class="QLineEdit" name="lineEdit_StateB"/>
</item>
<item row="7" column="1">
<widget class="QSpinBox" name="spinBox_TextureCount"/>
</item>
<item row="8" column="1">
<widget class="QSpinBox" name="spinBox_ConstCount"/>
</item>
<item row="9" column="1">
<widget class="QLineEdit" name="lineEdit_TechSetPtr"/>
</item>
<item row="8" column="0">
<widget class="QLabel" name="label_12">
<property name="text">
<string>Constant Count:</string>
</property>
</widget>
</item>
<item row="9" column="0">
<widget class="QLabel" name="label_9">
<property name="text">
<string>Tech Set Ptr:</string>
</property>
</widget>
</item>
<item row="10" column="0">
<widget class="QLabel" name="label_10">
<property name="text">
<string>Texture Ptr:</string>
</property>
</widget>
</item>
<item row="11" column="0">
<widget class="QLabel" name="label_8">
<property name="text">
<string>Constant Ptr:</string>
</property>
</widget>
</item>
<item row="10" column="1">
<widget class="QLineEdit" name="lineEdit_TexturePtr"/>
</item>
<item row="11" column="1">
<widget class="QLineEdit" name="lineEdit_ConstantPtr"/>
</item>
</layout>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QGroupBox" name="groupBox_4">
<property name="minimumSize">
<size>
<width>400</width>
<height>400</height>
</size>
</property>
<property name="font">
<font>
<family>Roboto</family>
<pointsize>9</pointsize>
</font>
</property>
<property name="title">
<string>Data</string>
</property>
<layout class="QGridLayout" name="gridLayout_6"/>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Orientation::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>143</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -1,14 +0,0 @@
#include "modelviewer.h"
#include "ui_modelviewer.h"
ModelViewer::ModelViewer(QWidget *parent)
: QWidget(parent)
, ui(new Ui::ModelViewer)
{
ui->setupUi(this);
}
ModelViewer::~ModelViewer()
{
delete ui;
}

View File

@ -1,22 +0,0 @@
#ifndef MODELVIEWER_H
#define MODELVIEWER_H
#include <QWidget>
namespace Ui {
class ModelViewer;
}
class ModelViewer : public QWidget
{
Q_OBJECT
public:
explicit ModelViewer(QWidget *parent = nullptr);
~ModelViewer();
private:
Ui::ModelViewer *ui;
};
#endif // MODELVIEWER_H

View File

@ -1,624 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>ModelViewer</class>
<widget class="QWidget" name="ModelViewer">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1001</width>
<height>897</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Properties</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Name Pointer:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QSpinBox" name="spinBox_NamePtr">
<property name="maximum">
<number>1000000000</number>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_42">
<property name="text">
<string>Model Name:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="lineEdit"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Tag Count:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QSpinBox" name="spinBox_TagCount">
<property name="suffix">
<string> tags</string>
</property>
<property name="maximum">
<number>1000000000</number>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Root Tag Count: </string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QSpinBox" name="spinBox_RootTagCount">
<property name="suffix">
<string> root tags</string>
</property>
<property name="maximum">
<number>1000000000</number>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Surface Count: </string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QSpinBox" name="spinBox_SurfaceCount">
<property name="suffix">
<string> surfaces</string>
</property>
<property name="maximum">
<number>1000000000</number>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Unknown A:</string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QSpinBox" name="spinBox_UnknownA">
<property name="maximum">
<number>1000000000</number>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Bone Name Pointer:</string>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QSpinBox" name="spinBox_BoneNamePtr">
<property name="maximum">
<number>1000000000</number>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
<string>Parent List Pointer:</string>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QSpinBox" name="spinBox_ParentListPtr">
<property name="maximum">
<number>1000000000</number>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QLabel" name="label_8">
<property name="text">
<string>Quats Pointer:</string>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="QSpinBox" name="spinBox_QuatsPtr">
<property name="maximum">
<number>1000000000</number>
</property>
</widget>
</item>
<item row="9" column="0">
<widget class="QLabel" name="label_9">
<property name="text">
<string>Transformation Pointer:</string>
</property>
</widget>
</item>
<item row="9" column="1">
<widget class="QSpinBox" name="spinBox_TransPtr">
<property name="maximum">
<number>1000000000</number>
</property>
</widget>
</item>
<item row="10" column="0">
<widget class="QLabel" name="label_10">
<property name="text">
<string>Classification Pointer:</string>
</property>
</widget>
</item>
<item row="10" column="1">
<widget class="QSpinBox" name="spinBox_ClassPtr">
<property name="maximum">
<number>1000000000</number>
</property>
</widget>
</item>
<item row="11" column="0">
<widget class="QLabel" name="label_11">
<property name="text">
<string>Base Material Pointer:</string>
</property>
</widget>
</item>
<item row="11" column="1">
<widget class="QSpinBox" name="spinBox_BaseMatPtr">
<property name="maximum">
<number>1000000000</number>
</property>
</widget>
</item>
<item row="12" column="0">
<widget class="QLabel" name="label_12">
<property name="text">
<string>Surfaces Pointer;</string>
</property>
</widget>
</item>
<item row="12" column="1">
<widget class="QSpinBox" name="spinBox_SurfacesPtr">
<property name="maximum">
<number>1000000000</number>
</property>
</widget>
</item>
<item row="13" column="0">
<widget class="QLabel" name="label_13">
<property name="text">
<string>Material Handlers Pointer:</string>
</property>
</widget>
</item>
<item row="13" column="1">
<widget class="QSpinBox" name="spinBox_MatHandlesPtr">
<property name="maximum">
<number>1000000000</number>
</property>
</widget>
</item>
<item row="14" column="0">
<widget class="QLabel" name="label_23">
<property name="text">
<string>Coll Surf Pointer:</string>
</property>
</widget>
</item>
<item row="14" column="1">
<widget class="QSpinBox" name="spinBox_ClassPtr_2">
<property name="maximum">
<number>1000000000</number>
</property>
</widget>
</item>
<item row="15" column="0">
<widget class="QLabel" name="label_24">
<property name="text">
<string>Coll Surface Count:</string>
</property>
</widget>
</item>
<item row="15" column="1">
<widget class="QSpinBox" name="spinBox_ClassPtr_3">
<property name="maximum">
<number>1000000000</number>
</property>
</widget>
</item>
<item row="16" column="0">
<widget class="QLabel" name="label_25">
<property name="text">
<string>Contents:</string>
</property>
</widget>
</item>
<item row="16" column="1">
<widget class="QSpinBox" name="spinBox_ClassPtr_4">
<property name="maximum">
<number>1000000000</number>
</property>
</widget>
</item>
<item row="17" column="0">
<widget class="QLabel" name="label_26">
<property name="text">
<string>Bone Info Pointer:</string>
</property>
</widget>
</item>
<item row="17" column="1">
<widget class="QSpinBox" name="spinBox_ClassPtr_5">
<property name="maximum">
<number>1000000000</number>
</property>
</widget>
</item>
<item row="18" column="0">
<widget class="QLabel" name="label_28">
<property name="text">
<string>Radius:</string>
</property>
</widget>
</item>
<item row="18" column="1">
<widget class="QDoubleSpinBox" name="doubleSpinBox_2"/>
</item>
<item row="19" column="0">
<widget class="QLabel" name="label_29">
<property name="text">
<string>Min X: </string>
</property>
</widget>
</item>
<item row="19" column="1">
<widget class="QDoubleSpinBox" name="doubleSpinBox_3"/>
</item>
<item row="20" column="0">
<widget class="QLabel" name="label_30">
<property name="text">
<string>Min Y: </string>
</property>
</widget>
</item>
<item row="20" column="1">
<widget class="QDoubleSpinBox" name="doubleSpinBox_4"/>
</item>
<item row="21" column="0">
<widget class="QLabel" name="label_31">
<property name="text">
<string>Min Z: </string>
</property>
</widget>
</item>
<item row="21" column="1">
<widget class="QDoubleSpinBox" name="doubleSpinBox_5"/>
</item>
<item row="22" column="0">
<widget class="QLabel" name="label_32">
<property name="text">
<string>Max X: </string>
</property>
</widget>
</item>
<item row="22" column="1">
<widget class="QDoubleSpinBox" name="doubleSpinBox_6"/>
</item>
<item row="23" column="0">
<widget class="QLabel" name="label_33">
<property name="text">
<string>Max Y: </string>
</property>
</widget>
</item>
<item row="23" column="1">
<widget class="QDoubleSpinBox" name="doubleSpinBox_7"/>
</item>
<item row="24" column="0">
<widget class="QLabel" name="label_34">
<property name="text">
<string>Max Z: </string>
</property>
</widget>
</item>
<item row="24" column="1">
<widget class="QDoubleSpinBox" name="doubleSpinBox_8"/>
</item>
<item row="25" column="0">
<widget class="QLabel" name="label_35">
<property name="text">
<string>Lod Count:</string>
</property>
</widget>
</item>
<item row="25" column="1">
<widget class="QSpinBox" name="spinBox_ClassPtr_7">
<property name="maximum">
<number>1000000000</number>
</property>
</widget>
</item>
<item row="26" column="0">
<widget class="QLabel" name="label_36">
<property name="text">
<string>Coll Lod:</string>
</property>
</widget>
</item>
<item row="26" column="1">
<widget class="QSpinBox" name="spinBox_ClassPtr_8">
<property name="maximum">
<number>1000000000</number>
</property>
</widget>
</item>
<item row="27" column="0">
<widget class="QLabel" name="label_37">
<property name="text">
<string>Stream Info Pointer:</string>
</property>
</widget>
</item>
<item row="27" column="1">
<widget class="QSpinBox" name="spinBox_ClassPtr_9">
<property name="maximum">
<number>1000000000</number>
</property>
</widget>
</item>
<item row="28" column="0">
<widget class="QLabel" name="label_38">
<property name="text">
<string>Memory Usage:</string>
</property>
</widget>
</item>
<item row="28" column="1">
<widget class="QSpinBox" name="spinBox_ClassPtr_10">
<property name="maximum">
<number>1000000000</number>
</property>
</widget>
</item>
<item row="29" column="0">
<widget class="QLabel" name="label_39">
<property name="text">
<string>Flags:</string>
</property>
</widget>
</item>
<item row="29" column="1">
<widget class="QSpinBox" name="spinBox_ClassPtr_11">
<property name="maximum">
<number>1000000000</number>
</property>
</widget>
</item>
<item row="30" column="0">
<widget class="QLabel" name="label_40">
<property name="text">
<string>Phys Preset Pointer:</string>
</property>
</widget>
</item>
<item row="30" column="1">
<widget class="QSpinBox" name="spinBox_ClassPtr_12">
<property name="maximum">
<number>1000000000</number>
</property>
</widget>
</item>
<item row="31" column="0">
<widget class="QLabel" name="label_41">
<property name="text">
<string>Phys Geometry Pointer:</string>
</property>
</widget>
</item>
<item row="31" column="1">
<widget class="QSpinBox" name="spinBox_ClassPtr_13">
<property name="maximum">
<number>1000000000</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QGroupBox" name="groupBox_3">
<property name="title">
<string>Lod Info</string>
</property>
<layout class="QFormLayout" name="formLayout_2">
<item row="0" column="0">
<widget class="QLabel" name="label_14">
<property name="text">
<string>Lod Info Index:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QComboBox" name="comboBox_LodIndex"/>
</item>
<item row="1" column="0" colspan="2">
<widget class="Line" name="line_2">
<property name="orientation">
<enum>Qt::Orientation::Horizontal</enum>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_15">
<property name="text">
<string>Distance:</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QDoubleSpinBox" name="doubleSpinBox"/>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_16">
<property name="text">
<string>Surface Count:</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QSpinBox" name="spinBox_BoneNamePtr_2">
<property name="maximum">
<number>1000000000</number>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_17">
<property name="text">
<string>Surface Index:</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QSpinBox" name="spinBox_BoneNamePtr_3">
<property name="maximum">
<number>1000000000</number>
</property>
</widget>
</item>
<item row="5" column="0">
<widget class="QLabel" name="label_18">
<property name="text">
<string>Part Bit 1: </string>
</property>
</widget>
</item>
<item row="5" column="1">
<widget class="QSpinBox" name="spinBox_BoneNamePtr_4">
<property name="maximum">
<number>1000000000</number>
</property>
</widget>
</item>
<item row="6" column="0">
<widget class="QLabel" name="label_19">
<property name="text">
<string>Part Bit 2: </string>
</property>
</widget>
</item>
<item row="6" column="1">
<widget class="QSpinBox" name="spinBox_BoneNamePtr_5">
<property name="maximum">
<number>1000000000</number>
</property>
</widget>
</item>
<item row="7" column="0">
<widget class="QLabel" name="label_20">
<property name="text">
<string>Part Bit 3: </string>
</property>
</widget>
</item>
<item row="7" column="1">
<widget class="QSpinBox" name="spinBox_BoneNamePtr_6">
<property name="maximum">
<number>1000000000</number>
</property>
</widget>
</item>
<item row="8" column="0">
<widget class="QLabel" name="label_21">
<property name="text">
<string>Part Bit 4: </string>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="QSpinBox" name="spinBox_BoneNamePtr_7">
<property name="maximum">
<number>1000000000</number>
</property>
</widget>
</item>
<item row="9" column="0">
<widget class="QLabel" name="label_22">
<property name="text">
<string>Part Bit 5: </string>
</property>
</widget>
</item>
<item row="9" column="1">
<widget class="QSpinBox" name="spinBox_BoneNamePtr_8">
<property name="maximum">
<number>1000000000</number>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Orientation::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Orientation::Vertical</enum>
</property>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_3DWindow">
<property name="title">
<string>3D Window</string>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -1,35 +0,0 @@
#include "preferenceeditor.h"
#include "ui_preferenceeditor.h"
PreferenceEditor::PreferenceEditor(QWidget *parent)
: QDialog(parent)
, ui(new Ui::PreferenceEditor)
{
ui->setupUi(this);
ui->frame_View->show();
ui->frame_TreeWidget->hide();
ui->frame_FileEditors->hide();
connect(ui->listWidget_Categories, &QListWidget::itemSelectionChanged, this, [this]() {
const QString itemText = ui->listWidget_Categories->selectedItems().first()->text();
if (itemText == "View") {
ui->frame_View->show();
ui->frame_TreeWidget->hide();
ui->frame_FileEditors->hide();
} else if (itemText == "Tree Widget") {
ui->frame_View->hide();
ui->frame_TreeWidget->show();
ui->frame_FileEditors->hide();
} else if (itemText == "File Editors") {
ui->frame_View->hide();
ui->frame_TreeWidget->hide();
ui->frame_FileEditors->show();
}
});
}
PreferenceEditor::~PreferenceEditor()
{
delete ui;
}

View File

@ -1,22 +0,0 @@
#ifndef PREFERENCEEDITOR_H
#define PREFERENCEEDITOR_H
#include <QDialog>
namespace Ui {
class PreferenceEditor;
}
class PreferenceEditor : public QDialog
{
Q_OBJECT
public:
explicit PreferenceEditor(QWidget *parent = nullptr);
~PreferenceEditor();
private:
Ui::PreferenceEditor *ui;
};
#endif // PREFERENCEEDITOR_H

View File

@ -1,528 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>PreferenceEditor</class>
<widget class="QDialog" name="PreferenceEditor">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1118</width>
<height>861</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>703</width>
<height>512</height>
</size>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_6">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLineEdit" name="lineEdit">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>150</width>
<height>16777215</height>
</size>
</property>
<property name="font">
<font>
<family>Roboto</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="placeholderText">
<string>Filter</string>
</property>
</widget>
</item>
<item>
<widget class="QListWidget" name="listWidget_Categories">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>150</width>
<height>16777215</height>
</size>
</property>
<property name="font">
<font>
<family>Roboto</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="currentRow">
<number>0</number>
</property>
<item>
<property name="text">
<string>View</string>
</property>
<property name="icon">
<iconset resource="data/Data.qrc">
<normaloff>:/icons/icons/Icon_Views.png</normaloff>:/icons/icons/Icon_Views.png</iconset>
</property>
</item>
<item>
<property name="text">
<string>Tree Widget</string>
</property>
<property name="icon">
<iconset resource="data/Data.qrc">
<normaloff>:/icons/icons/Icon_Tree.png</normaloff>:/icons/icons/Icon_Tree.png</iconset>
</property>
</item>
<item>
<property name="text">
<string>File Editors</string>
</property>
<property name="icon">
<iconset resource="data/Data.qrc">
<normaloff>:/icons/icons/Icon_Editor.png</normaloff>:/icons/icons/Icon_Editor.png</iconset>
</property>
</item>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QFrame" name="frame_View">
<property name="frameShape">
<enum>QFrame::Shape::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Shadow::Raised</enum>
</property>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label_4">
<property name="minimumSize">
<size>
<width>30</width>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>30</width>
<height>30</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="data/Data.qrc">:/icons/icons/Icon_Views.png</pixmap>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_3">
<property name="font">
<font>
<family>Roboto</family>
<pointsize>12</pointsize>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>View</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QTabWidget" name="tabWidget_Editors_3">
<property name="font">
<font>
<family>Roboto</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="tab_3">
<attribute name="title">
<string>Font &amp;&amp; Colors</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Font</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Family:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="comboBox_FontFamily"/>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>Size:</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="spinBox_FontSize"/>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label_11">
<property name="text">
<string>Zoom:</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="spinBox_ViewZoom">
<property name="suffix">
<string>%</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Orientation::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>588</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QFrame" name="frame_TreeWidget">
<property name="frameShape">
<enum>QFrame::Shape::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Shadow::Raised</enum>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QLabel" name="label_9">
<property name="minimumSize">
<size>
<width>30</width>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>30</width>
<height>30</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="data/Data.qrc">:/icons/icons/Icon_Tree.png</pixmap>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_10">
<property name="font">
<font>
<family>Roboto</family>
<pointsize>12</pointsize>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Tree Widget</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QTabWidget" name="tabWidget_Editors">
<property name="font">
<font>
<family>Roboto</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
<string>Tab 1</string>
</attribute>
</widget>
<widget class="QWidget" name="tab_2">
<attribute name="title">
<string>Tab 2</string>
</attribute>
</widget>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QFrame" name="frame_FileEditors">
<property name="frameShape">
<enum>QFrame::Shape::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Shadow::Raised</enum>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label_7">
<property name="minimumSize">
<size>
<width>30</width>
<height>30</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>30</width>
<height>30</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="data/Data.qrc">:/icons/icons/Icon_Editor.png</pixmap>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_8">
<property name="font">
<font>
<family>Roboto</family>
<pointsize>12</pointsize>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>File Editors</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QTabWidget" name="tabWidget_Editors_2">
<property name="font">
<font>
<family>Roboto</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="currentIndex">
<number>7</number>
</property>
<widget class="QWidget" name="tab_FastFile">
<attribute name="title">
<string>Fast File</string>
</attribute>
</widget>
<widget class="QWidget" name="tab_Zone">
<attribute name="title">
<string>Zone File</string>
</attribute>
</widget>
<widget class="QWidget" name="tab_IWIFile">
<attribute name="title">
<string>Images</string>
</attribute>
</widget>
<widget class="QWidget" name="tab_LocalString">
<attribute name="title">
<string>Local Strings</string>
</attribute>
</widget>
<widget class="QWidget" name="tab__StringTable">
<attribute name="title">
<string>String Table</string>
</attribute>
</widget>
<widget class="QWidget" name="tab_Sounds">
<attribute name="title">
<string>Sounds</string>
</attribute>
</widget>
<widget class="QWidget" name="tab_TechSet">
<attribute name="title">
<string>Tech Set</string>
</attribute>
</widget>
<widget class="QWidget" name="tab_Model">
<attribute name="title">
<string>Model</string>
</attribute>
</widget>
<widget class="QWidget" name="tab_6">
<attribute name="title">
<string>Page</string>
</attribute>
</widget>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="label_5">
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_6">
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="font">
<font>
<family>Roboto</family>
<pointsize>10</pointsize>
</font>
</property>
<property name="orientation">
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::StandardButton::Apply|QDialogButtonBox::StandardButton::Cancel|QDialogButtonBox::StandardButton::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
<resources>
<include location="data/Data.qrc"/>
</resources>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>PreferenceEditor</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>PreferenceEditor</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>

View File

@ -1,103 +0,0 @@
#include "reportissuedialog.h"
#include "qjsonarray.h"
#include "ui_reportissuedialog.h"
#include <QJsonDocument>
#include <QJsonObject>
#include <QMessageBox>
#include <QNetworkRequest>
ReportIssueDialog::ReportIssueDialog(const QString &giteaBaseUrl,
const QString &repoOwner,
const QString &repoName,
const QString &accessToken,
QWidget *parent) :
QDialog(parent),
ui(new Ui::ReportIssueDialog),
networkManager(new QNetworkAccessManager(this)),
giteaBaseUrl(giteaBaseUrl),
repoOwner(repoOwner),
repoName(repoName),
accessToken(accessToken)
{
ui->setupUi(this);
connect(networkManager, &QNetworkAccessManager::finished, this, &ReportIssueDialog::onNetworkReplyFinished);
}
ReportIssueDialog::~ReportIssueDialog()
{
delete ui;
}
void ReportIssueDialog::on_buttonSend_clicked()
{
QString title = ui->lineEditSummary->text().trimmed();
QString details = ui->textEditDetails->toPlainText().trimmed();
QString contact = ui->lineEditContact->text().trimmed();
if (title.isEmpty()) {
QMessageBox::warning(this, tr("Input Error"), tr("Please enter a summary/title for the issue."));
return;
}
QString body = details;
if (!contact.isEmpty()) {
body += QString("\n\nContact info:\n%1").arg(contact);
}
ui->buttonSend->setEnabled(false);
sendIssueReport(title, body, contact);
}
void ReportIssueDialog::on_buttonCancel_clicked()
{
reject();
}
void ReportIssueDialog::sendIssueReport(const QString &title, const QString &body, const QString &/*contact*/)
{
// Compose URL: e.g. https://gitea.example.com/api/v1/repos/{owner}/{repo}/issues
QUrl url(QString("%1/api/v1/repos/%2/%3/issues").arg(giteaBaseUrl).arg(repoOwner).arg(repoName));
QNetworkRequest request(url);
request.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");
if (!accessToken.isEmpty()) {
request.setRawHeader("Authorization", "token " + accessToken.toUtf8());
}
// Compose JSON body
QJsonObject json;
json["title"] = title;
json["body"] = body;
json["labels"] = QJsonArray{12};
QJsonDocument doc(json);
QByteArray data = doc.toJson();
networkManager->post(request, data);
}
void ReportIssueDialog::onNetworkReplyFinished(QNetworkReply *reply)
{
ui->buttonSend->setEnabled(true);
QByteArray responseData = reply->readAll();
QString responseStr = QString::fromUtf8(responseData);
if (reply->error() != QNetworkReply::NoError) {
QString errorStr = reply->errorString();
if (errorStr.isEmpty()) errorStr = "Unknown network error";
QMessageBox::critical(this, tr("Error"), tr("Failed to send issue report:\n%1\nResponse:\n%2").arg(errorStr).arg(responseStr));
} else {
int status = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt();
if (status == 201) {
QMessageBox::information(this, tr("Success"), tr("Issue reported successfully!"));
accept();
} else {
QMessageBox::warning(this, tr("Failed"), tr("Unexpected response from server (%1):\n%2").arg(status).arg(responseStr));
}
}
reply->deleteLater();
}

View File

@ -1,43 +0,0 @@
#ifndef REPORTISSUEDIALOG_H
#define REPORTISSUEDIALOG_H
#include <QDialog>
#include <QNetworkAccessManager>
#include <QNetworkReply>
namespace Ui {
class ReportIssueDialog;
}
class ReportIssueDialog : public QDialog
{
Q_OBJECT
public:
explicit ReportIssueDialog(const QString &giteaBaseUrl,
const QString &repoOwner,
const QString &repoName,
const QString &accessToken,
QWidget *parent = nullptr);
~ReportIssueDialog();
private slots:
void on_buttonSend_clicked();
void on_buttonCancel_clicked();
void onNetworkReplyFinished(QNetworkReply *reply);
private:
Ui::ReportIssueDialog *ui;
QNetworkAccessManager *networkManager;
QString giteaBaseUrl;
QString repoOwner;
QString repoName;
QString accessToken;
void sendIssueReport(const QString &title, const QString &body, const QString &contact);
};
#endif // REPORTISSUEDIALOG_H

View File

@ -1,84 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>ReportIssueDialog</class>
<widget class="QDialog" name="ReportIssueDialog">
<property name="windowTitle">
<string>Report a Problem</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="labelInstructions">
<property name="text">
<string>Please describe the problem you encountered. Well use this info to help fix it.</string>
</property>
<property name="wordWrap">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="labelSummary">
<property name="text">
<string>Summary (short title):</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEditSummary" />
</item>
<item>
<widget class="QLabel" name="labelDetails">
<property name="text">
<string>Details (what happened?):</string>
</property>
</widget>
</item>
<item>
<widget class="QTextEdit" name="textEditDetails" />
</item>
<item>
<widget class="QLabel" name="labelContact">
<property name="text">
<string>Your contact (email or name, optional):</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEditContact" />
</item>
<item>
<layout class="QHBoxLayout" name="buttonLayout">
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="buttonSend">
<property name="text">
<string>Send Report</string>
</property>
<property name="default">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="buttonCancel">
<property name="text">
<string>Cancel</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -1,58 +0,0 @@
#include "rumblefileviewer.h"
#include "ui_rumblefileviewer.h"
RumbleFileViewer::RumbleFileViewer(QWidget *parent)
: QWidget(parent)
, ui(new Ui::RumbleFileViewer)
, mPropertyCount()
, mRumbleFile(nullptr) {
ui->setupUi(this);
ui->tableWidget_Properties->setColumnCount(2);
ui->tableWidget_Properties->setRowCount(0);
ui->tableWidget_Properties->setColumnWidth(0, 200);
ui->tableWidget_Properties->horizontalHeader()->setStretchLastSection(true);
}
RumbleFileViewer::~RumbleFileViewer() {
delete ui;
}
void RumbleFileViewer::SetRumbleFile(XRawFile *aRumbleFile) {
mRumbleFile = aRumbleFile;
ui->tableWidget_Properties->clear();
// const QString magic = aRumbleFile->contents.left(6);
// if (magic != "RUMBLE") {
// qDebug() << "Rumble file has invalid magic: " << magic;
// return;
// }
// int firstIndex = 0;
// int secondIndex = 0;
// int thirdIndex = 0;
// int startIndex = 0;
// for (int i = 0; i < aRumbleFile->contents.count("\\") / 2; i++) {
// ui->tableWidget_Properties->setRowCount(i + 1);
// ui->spinBox_Entries->setValue(i + 1);
// firstIndex = aRumbleFile->contents.indexOf("\\", startIndex);
// secondIndex = aRumbleFile->contents.indexOf("\\", firstIndex + 1);
// thirdIndex = aRumbleFile->contents.indexOf("\\", secondIndex + 1);
// if (thirdIndex == -1) {
// thirdIndex = aRumbleFile->contents.size();
// }
// const QString keyStr = aRumbleFile->contents.mid(firstIndex + 1, secondIndex - firstIndex - 1);
// QTableWidgetItem *keyItem = new QTableWidgetItem(keyStr);
// ui->tableWidget_Properties->setItem(i, 0, keyItem);
// const QString valStr = aRumbleFile->contents.mid(secondIndex + 1, thirdIndex - secondIndex - 1);
// QTableWidgetItem *valueItem = new QTableWidgetItem(valStr);
// ui->tableWidget_Properties->setItem(i, 1, valueItem);
// startIndex = thirdIndex;
// }
}

View File

@ -1,28 +0,0 @@
#ifndef RUMBLEFILEVIEWER_H
#define RUMBLEFILEVIEWER_H
#include "xrawfile.h"
#include <QWidget>
namespace Ui {
class RumbleFileViewer;
}
class RumbleFileViewer : public QWidget
{
Q_OBJECT
public:
explicit RumbleFileViewer(QWidget *parent = nullptr);
~RumbleFileViewer();
void SetRumbleFile(XRawFile* aRumbleFile);
private:
Ui::RumbleFileViewer *ui;
quint32 mPropertyCount;
XRawFile* mRumbleFile;
};
#endif // RUMBLEFILEVIEWER_H

View File

@ -1,153 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>RumbleFileViewer</class>
<widget class="QWidget" name="RumbleFileViewer">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>841</width>
<height>457</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>841</width>
<height>457</height>
</size>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="label_Title">
<property name="font">
<font>
<family>Roboto</family>
<pointsize>16</pointsize>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Rumble File Viewer</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0" colspan="2">
<widget class="QGroupBox" name="groupBox">
<property name="minimumSize">
<size>
<width>325</width>
<height>398</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>325</width>
<height>16777215</height>
</size>
</property>
<property name="font">
<font>
<family>Roboto</family>
<pointsize>9</pointsize>
</font>
</property>
<property name="title">
<string>Header</string>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<item row="2" column="0" colspan="3">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Orientation::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="1" colspan="2">
<widget class="QSpinBox" name="spinBox_Entries">
<property name="enabled">
<bool>false</bool>
</property>
<property name="maximum">
<number>10000</number>
</property>
<property name="value">
<number>1</number>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Entries:</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QGroupBox" name="groupBox_LocalStrViewer">
<property name="minimumSize">
<size>
<width>400</width>
<height>400</height>
</size>
</property>
<property name="font">
<font>
<family>Roboto</family>
<pointsize>9</pointsize>
</font>
</property>
<property name="title">
<string>Properties</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QTableWidget" name="tableWidget_Properties">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer_5">
<property name="orientation">
<enum>Qt::Orientation::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -1,54 +0,0 @@
#include "rumblegraphviewer.h"
#include "ui_rumblegraphviewer.h"
RumbleGraphViewer::RumbleGraphViewer(QWidget *parent)
: QWidget(parent)
, ui(new Ui::RumbleGraphViewer),
mEntryCount(),
mRumbleGraphFile(nullptr) {
ui->setupUi(this);
ui->tableWidget_Entries->setColumnCount(2);
ui->tableWidget_Entries->setHorizontalHeaderLabels({ "X", "Y" });
ui->tableWidget_Entries->setRowCount(0);
ui->tableWidget_Entries->setColumnWidth(0, 200);
ui->tableWidget_Entries->horizontalHeader()->setStretchLastSection(true);
}
RumbleGraphViewer::~RumbleGraphViewer() {
delete ui;
}
void RumbleGraphViewer::SetRumbleGraphFile(const XRawFile* aRawFile) {
mRumbleGraphFile = aRawFile;
XDataStream rawFileStream;//(mRumbleGraphFile->contents.toLatin1());
QByteArray magic(15, Qt::Uninitialized);
rawFileStream.readRawData(magic.data(), 15);
rawFileStream.skipRawData(4);
char sectionChar;
rawFileStream >> sectionChar;
int sectionCount = sectionChar - '0';
ui->tableWidget_Entries->setRowCount(sectionCount);
ui->spinBox_Entries->setValue(sectionCount);
ui->groupBox_LocalStrViewer->setTitle(QString("Entries (%1)").arg(sectionCount));
rawFileStream.skipRawData(2);
for (int i = 0; i < sectionCount; i++) {
QByteArray xVal(6, Qt::Uninitialized), yVal(6, Qt::Uninitialized);
rawFileStream.readRawData(xVal.data(), 6);
rawFileStream.skipRawData(1);
rawFileStream.readRawData(yVal.data(), 6);
rawFileStream.skipRawData(2);
QTableWidgetItem *xItem = new QTableWidgetItem(xVal);
QTableWidgetItem *yItem = new QTableWidgetItem(yVal);
ui->tableWidget_Entries->setItem(i, 0, xItem);
ui->tableWidget_Entries->setItem(i, 1, yItem);
}
}

View File

@ -1,30 +0,0 @@
#ifndef RUMBLEGRAPHVIEWER_H
#define RUMBLEGRAPHVIEWER_H
#include "xrawfile.h"
#include "zonefile.h"
#include <QWidget>
namespace Ui {
class RumbleGraphViewer;
}
class RumbleGraphViewer : public QWidget
{
Q_OBJECT
public:
explicit RumbleGraphViewer(QWidget *parent = nullptr);
~RumbleGraphViewer();
void SetEntryCount(quint32 aCount);
void SetRumbleGraphFile(const XRawFile *aRawFile);
void SetZoneFile(ZoneFile* aZoneFile);
private:
Ui::RumbleGraphViewer *ui;
quint32 mEntryCount;
const XRawFile* mRumbleGraphFile;
};
#endif // RUMBLEGRAPHVIEWER_H

View File

@ -1,153 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>RumbleGraphViewer</class>
<widget class="QWidget" name="RumbleGraphViewer">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>841</width>
<height>457</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>841</width>
<height>457</height>
</size>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="label_Title">
<property name="font">
<font>
<family>Roboto</family>
<pointsize>16</pointsize>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Rumble Graph File </string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0" colspan="2">
<widget class="QGroupBox" name="groupBox">
<property name="minimumSize">
<size>
<width>325</width>
<height>398</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>325</width>
<height>16777215</height>
</size>
</property>
<property name="font">
<font>
<family>Roboto</family>
<pointsize>9</pointsize>
</font>
</property>
<property name="title">
<string>Header</string>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<item row="1" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Entry Count: </string>
</property>
</widget>
</item>
<item row="1" column="1" colspan="2">
<widget class="QSpinBox" name="spinBox_Entries">
<property name="enabled">
<bool>false</bool>
</property>
<property name="maximum">
<number>10000</number>
</property>
<property name="value">
<number>0</number>
</property>
</widget>
</item>
<item row="2" column="0" colspan="3">
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Orientation::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QGroupBox" name="groupBox_LocalStrViewer">
<property name="minimumSize">
<size>
<width>400</width>
<height>400</height>
</size>
</property>
<property name="font">
<font>
<family>Roboto</family>
<pointsize>9</pointsize>
</font>
</property>
<property name="title">
<string>Entries</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QTableWidget" name="tableWidget_Entries">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer_5">
<property name="orientation">
<enum>Qt::Orientation::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -1,80 +0,0 @@
#include "soundviewer.h"
#include "ui_soundviewer.h"
SoundViewer::SoundViewer(QWidget *parent)
: QWidget(parent)
, ui(new Ui::SoundViewer)
, player(new QMediaPlayer())
, buffer(new QBuffer())
{
ui->setupUi(this);
connect(ui->pushButton_Play, &QPushButton::clicked, player, &QMediaPlayer::play);
connect(ui->pushButton_Pause, &QPushButton::clicked, player, &QMediaPlayer::pause);
connect(ui->pushButton_Stop, &QPushButton::clicked, this, [this]() {
if (player->isPlaying()) {
player->stop();
}
});
connect(ui->pushButton_SkipForward, &QPushButton::clicked, this, [this]() {
player->setPosition(player->position() + 30);
});
connect(ui->pushButton_SkipBack, &QPushButton::clicked, this, [this]() {
player->setPosition(player->position() - 30);
});
connect(player, &QMediaPlayer::positionChanged, player, [this](qint64 position) {
ui->horizontalSlider->setSliderPosition(position);
ui->label_Time->setText(QString("%1:%2:%3")
.arg(position / 60000)
.arg((position % 60000) / 1000)
.arg(position % 1000));
});
connect(player, &QMediaPlayer::durationChanged, player, [this](qint64 duration) {
ui->horizontalSlider->setMaximum(duration);
ui->label_TimeMax->setText(QString("%1:%2:%3")
.arg(duration / 60000)
.arg((duration % 60000) / 1000)
.arg(duration % 1000));
});
connect(ui->horizontalSlider, &QSlider::sliderMoved, this, [this](int position) {
player->setPosition(position);
});
for (auto outputDevice : QMediaDevices::audioOutputs()) {
ui->comboBox_Output->addItem(outputDevice.description());
}
connect(ui->comboBox_Output, &QComboBox::currentIndexChanged, this, [this](int index) {
auto outputDevice = QMediaDevices::audioOutputs()[index];
QAudioOutput *audioOutput = new QAudioOutput(outputDevice);
player->setAudioOutput(audioOutput);
});
auto outputDevice = QMediaDevices::defaultAudioOutput();
QAudioOutput *audioOutput = new QAudioOutput(outputDevice);
player->setAudioOutput(audioOutput);
}
SoundViewer::~SoundViewer()
{
delete buffer;
delete player;
delete ui;
}
// void SoundViewer::SetSound(std::shared_ptr<Sound> aSound)
// {
// buffer->setData(aSound->data);
// if (!buffer->open(QIODevice::ReadOnly)) {
// qWarning() << "Failed to open QBuffer.";
// return;
// }
// ui->groupBox->setTitle(aSound->path);
// player->setSourceDevice(buffer);
// }
void SoundViewer::SetOutput(QAudioOutput *aOutput) {
if (!aOutput) { return; }
player->setAudioOutput(aOutput);
}

View File

@ -1,32 +0,0 @@
#ifndef SOUNDVIEWER_H
#define SOUNDVIEWER_H
#include <QWidget>
#include <QMediaPlayer>
#include <QBuffer>
#include <QAudioDevice>
#include <QMediaDevices>
#include <QAudioOutput>
namespace Ui {
class SoundViewer;
}
class SoundViewer : public QWidget
{
Q_OBJECT
public:
explicit SoundViewer(QWidget *parent = nullptr);
~SoundViewer();
//void SetSound(std::shared_ptr<Sound> aSound);
void SetOutput(QAudioOutput *aOutput);
private:
Ui::SoundViewer *ui;
QMediaPlayer *player;
QBuffer *buffer;
};
#endif // SOUNDVIEWER_H

File diff suppressed because it is too large Load Diff

View File

@ -1,35 +0,0 @@
#include "stringtableviewer.h"
#include "ui_stringtableviewer.h"
StringTableViewer::StringTableViewer(QWidget *parent)
: QWidget(parent)
, ui(new Ui::StringTableViewer)
{
ui->setupUi(this);
}
StringTableViewer::~StringTableViewer()
{
delete ui;
}
void StringTableViewer::SetStringTable(const XStringTable *aStringTable) {
ui->tableWidget_Strings->clear();
ui->tableWidget_Strings->setRowCount(aStringTable->GetRowCount());
ui->tableWidget_Strings->setColumnCount(aStringTable->GetColumnCount());
int currentIndex = 0;
for (auto value : *aStringTable->GetValues()) {
QTableWidgetItem *tableKeyItem = new QTableWidgetItem();
tableKeyItem->setText(value->GetName());
ui->tableWidget_Strings->setItem(currentIndex, 0, tableKeyItem);
QTableWidgetItem *tableValItem = new QTableWidgetItem();
tableValItem->setText(value->GetString());
ui->tableWidget_Strings->setItem(currentIndex, 1, tableValItem);
currentIndex++;
}
}

View File

@ -1,26 +0,0 @@
#ifndef STRINGTABLEVIEWER_H
#define STRINGTABLEVIEWER_H
#include "xstringtable.h"
#include <QWidget>
namespace Ui {
class StringTableViewer;
}
class StringTableViewer : public QWidget
{
Q_OBJECT
public:
explicit StringTableViewer(QWidget *parent = nullptr);
~StringTableViewer();
void SetStringTable(const XStringTable *aStringTable);
private:
Ui::StringTableViewer *ui;
};
#endif // STRINGTABLEVIEWER_H

View File

@ -1,24 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>StringTableViewer</class>
<widget class="QWidget" name="StringTableViewer">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>525</width>
<height>752</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QTableWidget" name="tableWidget_Strings"/>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -1,25 +0,0 @@
#include "techsetviewer.h"
#include "ui_techsetviewer.h"
TechSetViewer::TechSetViewer(QWidget *parent)
: QWidget(parent)
, ui(new Ui::TechSetViewer)
{
ui->setupUi(this);
}
TechSetViewer::~TechSetViewer()
{
delete ui;
}
void TechSetViewer::SetTechSet(const XMaterialTechniqueSet* aTechSet) {
//ui->listWidget_Ptrs->clear();
ui->label_Title->setText(aTechSet->GetName());
// int ptrIndex = 1;
//for (auto ptr : aTechSet->pointers) {
// ui->listWidget_Ptrs->addItem(QString("Pointer %1: %2").arg(ptrIndex).arg(ptr));
// ptrIndex++;
//}
}

View File

@ -1,26 +0,0 @@
#ifndef TECHSETVIEWER_H
#define TECHSETVIEWER_H
#include "xmaterialtechniqueset.h"
#include <QWidget>
namespace Ui {
class TechSetViewer;
}
class TechSetViewer : public QWidget
{
Q_OBJECT
public:
explicit TechSetViewer(QWidget *parent = nullptr);
~TechSetViewer();
void SetTechSet(const XMaterialTechniqueSet *aTechSet);
private:
Ui::TechSetViewer *ui;
};
#endif // TECHSETVIEWER_H

View File

@ -1,151 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>TechSetViewer</class>
<widget class="QWidget" name="TechSetViewer">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>880</width>
<height>559</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QLabel" name="label_Title">
<property name="font">
<font>
<family>Roboto</family>
<pointsize>16</pointsize>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Technique Set 0</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_7">
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Set Parameters</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Name:</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_Name">
<property name="placeholderText">
<string>Technique set name</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>World Vertex Format:</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="spinBox_WorldVertFormat"/>
</item>
</layout>
</item>
<item>
<widget class="QListWidget" name="listWidget_Techniques"/>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>Current Technique</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QLabel" name="label_4">
<property name="text">
<string>Name:</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_TechniqueName">
<property name="placeholderText">
<string>Technique set name</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<widget class="QLabel" name="label_5">
<property name="text">
<string>Flags:</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="spinBox_Flags"/>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
<widget class="QLabel" name="label_6">
<property name="text">
<string>Pass Count:</string>
</property>
</widget>
</item>
<item>
<widget class="QSpinBox" name="spinBox_PassCount"/>
</item>
</layout>
</item>
<item>
<widget class="QGroupBox" name="groupBox_3">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="MinimumExpanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="title">
<string>Material Pass</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -1,806 +0,0 @@
#include "xtreewidget.h"
#include "qheaderview.h"
#include "qmenu.h"
#include "logmanager.h"
XTreeWidget::XTreeWidget(QWidget *parent)
: QTreeWidget(parent) {
mFastFiles = QMap<QString, const FastFile*>();
mZoneFiles = QMap<QString, const ZoneFile*>();
mDDSFiles = QMap<QString, const DDSFile*>();
mIWIFiles = QMap<QString, const IWIFile*>();
setContextMenuPolicy(Qt::CustomContextMenu);
setSelectionMode(QTreeWidget::SingleSelection);
setColumnCount(3);
header()->hide();
setMinimumWidth(350);
setSortingEnabled(true);
setIconSize(QSize(16, 16));
header()->setSectionResizeMode(0, QHeaderView::ResizeToContents);
// Set the last two columns to a fixed width
//header()->setSectionResizeMode(1, QHeaderView::Fixed);
//header()->setSectionResizeMode(2, QHeaderView::Fixed);
// Adjust the fixed widths to suit your icon size (e.g., 32 pixels)
//header()->resizeSection(0, 275);
//header()->resizeSection(1, 32);
//header()->resizeSection(2, 32);
connect(this, &XTreeWidget::itemSelectionChanged, this, &XTreeWidget::ItemSelectionChanged);
connect(this, &XTreeWidget::customContextMenuRequested, this, &XTreeWidget::PrepareContextMenu);
}
XTreeWidget::~XTreeWidget() {
}
void XTreeWidget::AddFastFile(FastFile* aFastFile) {
XTreeWidgetItem *fastFileItem = new XTreeWidgetItem(this);
fastFileItem->setText(0, aFastFile->GetStem());
fastFileItem->setIcon(0, Utils::CreateAssetIcon("FF"));
if (aFastFile->GetPlatform() == "PC") {
fastFileItem->setIcon(1, Utils::CreateAssetIcon("PC"));
} else if (aFastFile->GetPlatform() == "360") {
fastFileItem->setIcon(1, Utils::CreateAssetIcon("360"));
} else if (aFastFile->GetPlatform() == "PS3") {
fastFileItem->setIcon(1, Utils::CreateAssetIcon("PS3"));
} else if (aFastFile->GetPlatform() == "Wii") {
fastFileItem->setIcon(1, Utils::CreateAssetIcon("WII"));
} else if (aFastFile->GetPlatform() == "WiiU") {
fastFileItem->setIcon(1, Utils::CreateAssetIcon("WU"));
}
if (aFastFile->GetGame() == "COD2") {
fastFileItem->setIcon(2, Utils::CreateGameIcon(2));
} if (aFastFile->GetGame() == "COD4") {
fastFileItem->setIcon(2, Utils::CreateGameIcon(4));
} else if (aFastFile->GetGame() == "COD5") {
fastFileItem->setIcon(2, Utils::CreateGameIcon(5));
} else if (aFastFile->GetGame() == "COD6") {
fastFileItem->setIcon(2, Utils::CreateGameIcon(6));
} else if (aFastFile->GetGame() == "COD7") {
fastFileItem->setIcon(2, Utils::CreateGameIcon(7));
} else if (aFastFile->GetGame() == "COD8") {
fastFileItem->setIcon(2, Utils::CreateGameIcon(8));
} else if (aFastFile->GetGame() == "COD9") {
fastFileItem->setIcon(2, Utils::CreateGameIcon(9));
} else if (aFastFile->GetGame() == "COD10") {
fastFileItem->setIcon(2, Utils::CreateGameIcon(10));
} else if (aFastFile->GetGame() == "COD11") {
fastFileItem->setIcon(2, Utils::CreateGameIcon(11));
} else if (aFastFile->GetGame() == "COD12") {
fastFileItem->setIcon(2, Utils::CreateGameIcon(12));
}
AddZoneFile(aFastFile->GetZoneFile(), fastFileItem);
mFastFiles[aFastFile->GetStem()] = aFastFile;
resizeColumnToContents(1);
setSortingEnabled(true);
sortByColumn(0, Qt::AscendingOrder);
}
void XTreeWidget::AddZoneFile(const ZoneFile* aZoneFile, XTreeWidgetItem *aParentItem) {
XTreeWidgetItem *zoneItem;
if (aParentItem != nullptr) {
zoneItem = new XTreeWidgetItem(aParentItem);
} else {
zoneItem = new XTreeWidgetItem(this);
}
zoneItem->setIcon(0, Utils::CreateAssetIcon("ZF"));
zoneItem->setText(0, aZoneFile->GetBaseStem() + ".zone");
XAssetList assetList = aZoneFile->GetAssetList();
QVector<XAsset*> localizeEntries;
for (int i = 0; i < assetList.Size(); i++)
{
XAsset *currentAsset = assetList.GetAsset(i);
if (currentAsset->GetType() == ASSET_TYPE_LOCALIZE_ENTRY)
{
localizeEntries.append(currentAsset);
} else if (currentAsset->GetType() == ASSET_TYPE_LOCALIZE_ENTRY)
{
localizeEntries.append(currentAsset);
}
}
// if (!assetMap.localizeEntries.isEmpty()) {
// QIcon localStrIcon = Utils::CreateAssetIcon(ASSET_TYPE_LOCALIZE_ENTRY);
// XTreeWidgetItem *localStrRoot = new XTreeWidgetItem(zoneItem);
// localStrRoot->setText(0, "String Files");
// localStrRoot->setIcon(0, localStrIcon);
// localStrRoot->SetCategory(CATEGORY_TYPE);
// XTreeWidgetItem *localStrItem = new XTreeWidgetItem(localStrRoot);
// localStrItem->setText(0, aZoneFile->GetStem().section('.', 0, 0) + ".str");
// localStrItem->setIcon(0, localStrIcon);
// }
// if (!assetMap.techSets.isEmpty()) {
// QIcon techSetIcon = Utils::CreateAssetIcon(ASSET_TYPE_TECHNIQUE_SET);
// XTreeWidgetItem *techSetRoot = new XTreeWidgetItem(zoneItem);
// techSetRoot->setText(0, "Tech Sets");
// techSetRoot->setIcon(0, techSetIcon);
// techSetRoot->SetCategory(CATEGORY_TYPE);
// for (auto techSet : assetMap.techSets) {
// XTreeWidgetItem *techSetItem = new XTreeWidgetItem(techSetRoot);
// techSetItem->setText(0, techSet.name);
// techSetItem->setIcon(0, techSetIcon);
// }
// }
// if (!assetMap.rawFiles.isEmpty()) {
// QIcon rawFileIcon = Utils::CreateAssetIcon(ASSET_TYPE_RAWFILE);
// XTreeWidgetItem *rawFileRoot = new XTreeWidgetItem(zoneItem);
// rawFileRoot->setText(0, "Raw Files");
// rawFileRoot->setIcon(0, rawFileIcon);
// rawFileRoot->SetCategory(CATEGORY_TYPE);
// for (auto rawFile : assetMap.rawFiles) {
// if (!rawFile.length) { continue; }
// XTreeWidgetItem *tempItem = rawFileRoot;
// // const QStringList pathParts = rawFile->path.split('/');
// // for (const QString &pathPart : pathParts) {
// // bool childFound = false;
// // for (int i = 0; i < tempItem->childCount(); i++) {
// // QTreeWidgetItem *rawChildItem = tempItem->child(i);
// // XTreeWidgetItem *childItem = dynamic_cast<XTreeWidgetItem*>(rawChildItem);
// // if (childItem->text(0) == pathPart) {
// // tempItem = childItem;
// // childFound = true;
// // break;
// // }
// // }
// // const QString rawFileStr = pathPart;// = QString("%1 [%2-%3]").arg(pathPart).arg(rawFile.startPos).arg(rawFile.endPos);
// // if (pathPart == pathParts.last()) {
// // XTreeWidgetItem *rawFileItem = new XTreeWidgetItem(tempItem);
// // rawFileItem->setText(0, rawFileStr);
// // tempItem = rawFileItem;
// // } else if (!childFound) {
// // tempItem = new XTreeWidgetItem(tempItem);
// // tempItem->setText(0, rawFileStr);
// // }
// // }
// tempItem->setIcon(0, rawFileIcon);
// }
// }
// if (!assetMap.menuDefinitions.isEmpty()) {
// // QIcon MenuDefIcon = Utils::CreateAssetIcon(ASSET_TYPE_MENU);
// // XTreeWidgetItem *menuRoot = new XTreeWidgetItem(zoneItem);
// // menuRoot->setText(0, "Menu Files");
// // menuRoot->setIcon(0, MenuDefIcon);
// // menuRoot->SetCategory(CATEGORY_TYPE);
// // int menuIndex = 1;
// // for (MenuDef menuDef : assetMap.menuDefinitions) {
// // XTreeWidgetItem *MenuDefRoot = new XTreeWidgetItem(menuRoot);
// // MenuDefRoot->setText(0, QString("Menu %1").arg(menuIndex));
// // for (Menu menu : menuDef.men) {
// // XTreeWidgetItem *menuItem = new XTreeWidgetItem(MenuDefRoot);
// // menuItem->setText(0, menu.filePath);
// // menuItem->setIcon(0, MenuDefIcon);
// // }
// // menuIndex++;
// // }
// }
// if (!assetMap.images.isEmpty()) {
// // QIcon imageIcon = Utils::CreateAssetIcon(ASSET_TYPE_IMAGE);
// // XTreeWidgetItem *imageRoot = new XTreeWidgetItem(zoneItem);
// // imageRoot->setText(0, "Images");
// // imageRoot->setIcon(0, imageIcon);
// // imageRoot->SetCategory(CATEGORY_TYPE);
// // for (Image image : assetMap.images) {
// // XTreeWidgetItem *imageItem = new XTreeWidgetItem(imageRoot);
// // imageItem->setText(0, image.materialName);
// // imageItem->setIcon(0, imageIcon);
// // }
// }
// if (!assetMap.models.isEmpty()) {
// QIcon modelIcon = Utils::CreateAssetIcon(ASSET_TYPE_XMODEL);
// XTreeWidgetItem *modelsRoot = new XTreeWidgetItem(zoneItem);
// modelsRoot->setText(0, "Models");
// modelsRoot->setIcon(0, modelIcon);
// modelsRoot->SetCategory(CATEGORY_TYPE);
// for (auto model: assetMap.models) {
// XTreeWidgetItem *modelItem = new XTreeWidgetItem(modelsRoot);
// modelItem->setText(0, model.name);
// modelItem->setIcon(0, modelIcon);
// }
// }
// if (!assetMap.materials.isEmpty()) {
// QIcon materialIcon = Utils::CreateAssetIcon(ASSET_TYPE_MATERIAL);
// XTreeWidgetItem *materialsRoot = new XTreeWidgetItem(zoneItem);
// materialsRoot->setText(0, "Materials");
// materialsRoot->setIcon(0, materialIcon);
// materialsRoot->SetCategory(CATEGORY_TYPE);
// for (auto material: assetMap.materials) {
// XTreeWidgetItem *materialItem = new XTreeWidgetItem(materialsRoot);
// //materialItem->setText(0, material.name);
// materialItem->setIcon(0, materialIcon);
// }
// }
// if (!assetMap.stringTables.isEmpty()) {
// QIcon stringTableIcon = Utils::CreateAssetIcon(ASSET_TYPE_STRINGTABLE);
// XTreeWidgetItem *strTableRoot = new XTreeWidgetItem(zoneItem);
// strTableRoot->setText(0, "String Tables");
// strTableRoot->setIcon(0, stringTableIcon);
// strTableRoot->SetCategory(CATEGORY_TYPE);
// for (auto strTable: assetMap.stringTables) {
// XTreeWidgetItem *modelItem = new XTreeWidgetItem(strTableRoot);
// modelItem->setText(0, strTable.name);
// modelItem->setIcon(0, stringTableIcon);
// }
// }
// if (!assetMap.sounds.isEmpty()) {
// QIcon soundIcon = Utils::CreateAssetIcon(ASSET_TYPE_SOUND);
// XTreeWidgetItem *soundsRoot = new XTreeWidgetItem(zoneItem);
// soundsRoot->setText(0, "Sounds");
// soundsRoot->setIcon(0, soundIcon);
// soundsRoot->SetCategory(CATEGORY_TYPE);
// }
mZoneFiles[aZoneFile->GetBaseStem() + ".zone"] = aZoneFile;
}
void XTreeWidget::CloseFastFile(const QString aFFName) {
const QString fileStem = aFFName;
emit ItemClosed(fileStem);
}
void XTreeWidget::PrepareContextMenu(const QPoint &pos) {
auto activeItem = itemAt(pos);
if (!activeItem) { return; }
if (activeItem->text(0).isEmpty()) { return; }
QString activeText = activeItem->text(0);
QMenu *contextMenu = new QMenu(this);
if (activeText.contains(".dds")) {
const QString fileStem = activeText.replace(".dds", "");
if (!mDDSFiles.contains(fileStem)) {
qDebug() << "Error: Could not find " << fileStem << " in DDS map!";
return;
}
QAction *closeAction = new QAction("Close File");
contextMenu->addAction(closeAction);
connect(closeAction, &QAction::triggered, this, [this, &fileStem, &activeItem](bool checked) {
Q_UNUSED(checked);
mDDSFiles.remove(fileStem);
invisibleRootItem()->removeChild(activeItem);
});
QMenu *exportSubmenu = new QMenu("Export...", this);
contextMenu->addMenu(exportSubmenu);
const DDSFile* ddsFile = mDDSFiles[fileStem];
QAction *exportIWIAction = new QAction("Export as IWI");
exportSubmenu->addAction(exportIWIAction);
connect(exportIWIAction, &QAction::triggered, this, [ddsFile](bool checked) {
Q_UNUSED(checked);
ddsFile->SaveIWI();
});
QAction *exportPNGAction = new QAction("Export as PNG");
exportSubmenu->addAction(exportPNGAction);
connect(exportPNGAction, &QAction::triggered, this, [ddsFile](bool checked) {
Q_UNUSED(checked);
ddsFile->SavePNG();
});
QAction *exportJPGAction = new QAction("Export as JPG");
exportSubmenu->addAction(exportJPGAction);
connect(exportJPGAction, &QAction::triggered, this, [ddsFile](bool checked) {
Q_UNUSED(checked);
ddsFile->SaveJPG();
});
} else if (activeText.contains(".iwi")) {
const QString fileStem = activeText.replace(".iwi", "");
if (!mIWIFiles.contains(fileStem)) {
qDebug() << "Error: Could not find " << fileStem << " in IWI map!";
return;
}
QAction *closeAction = new QAction("Close File");
contextMenu->addAction(closeAction);
connect(closeAction, &QAction::triggered, this, [this, &fileStem, &activeItem](bool checked) {
Q_UNUSED(checked);
mIWIFiles.remove(fileStem);
invisibleRootItem()->removeChild(activeItem);
});
QMenu *exportSubmenu = new QMenu("Export...", this);
contextMenu->addMenu(exportSubmenu);
const IWIFile* iwiFile = mIWIFiles[fileStem];
QAction *exportDDSAction = new QAction("Export as DDS");
exportSubmenu->addAction(exportDDSAction);
connect(exportDDSAction, &QAction::triggered, this, [iwiFile](bool checked) {
Q_UNUSED(checked);
iwiFile->SaveDDS();
});
QAction *exportPNGAction = new QAction("Export as PNG");
exportSubmenu->addAction(exportPNGAction);
connect(exportPNGAction, &QAction::triggered, this, [iwiFile](bool checked) {
Q_UNUSED(checked);
iwiFile->SavePNG();
});
QAction *exportJPGAction = new QAction("Export as JPG");
exportSubmenu->addAction(exportJPGAction);
connect(exportJPGAction, &QAction::triggered, this, [iwiFile](bool checked) {
Q_UNUSED(checked);
iwiFile->SaveJPG();
});
} else if (activeText.contains(".ff")) {
const QString fileStem = activeText;
QMenu *closeMultipleAction = new QMenu("Close Multiple Tabs");
QAction *closeAllAction = new QAction("Close All");
closeMultipleAction->addAction(closeAllAction);
connect(closeAllAction, &QAction::triggered, this, [this](bool checked) {
Q_UNUSED(checked);
mFastFiles.clear();
clear();
emit Cleared();
});
QAction *closeAllButAction = new QAction("Close All BUT This");
closeMultipleAction->addAction(closeAllButAction);
connect(closeAllButAction, &QAction::triggered, this, [this, &activeItem](bool checked) {
Q_UNUSED(checked);
for (int i = 0; i < invisibleRootItem()->childCount(); i++) {
auto childItem = invisibleRootItem()->child(i);
if (childItem == activeItem) { continue; }
const QString fileStem = childItem->text(0);
if (!mFastFiles.contains(fileStem)) {
qDebug() << "Error: Could not find " << fileStem << " in Fast File map!";
return;
}
mFastFiles.remove(fileStem);
CloseFastFile(fileStem);
invisibleRootItem()->removeChild(childItem);
i--;
}
});
QAction *closeAboveAction = new QAction("Close All Above");
closeMultipleAction->addAction(closeAboveAction);
connect(closeAboveAction, &QAction::triggered, this, [this, &activeItem](bool checked) {
Q_UNUSED(checked);
for (int i = 0; i < invisibleRootItem()->childCount(); i++) {
auto childItem = invisibleRootItem()->child(i);
if (childItem == activeItem) { return; }
const QString fileStem = childItem->text(0);
if (!mFastFiles.contains(fileStem)) {
qDebug() << "Error: Could not find " << fileStem << " in Fast File map!";
return;
}
mFastFiles.remove(fileStem);
CloseFastFile(fileStem);
invisibleRootItem()->removeChild(childItem);
i--;
}
});
QAction *closeBelowAction = new QAction("Close All Below");
closeMultipleAction->addAction(closeBelowAction);
connect(closeBelowAction, &QAction::triggered, this, [this, &activeItem](bool checked) {
Q_UNUSED(checked);
bool ready = false;
for (int i = 0; i < invisibleRootItem()->childCount(); i++) {
auto childItem = invisibleRootItem()->child(i);
if (!ready && (childItem != activeItem)) { continue; }
if (childItem == activeItem) {
ready = true;
continue;
}
const QString fileStem = childItem->text(0);
if (!mFastFiles.contains(fileStem)) {
qDebug() << "Error: Could not find " << fileStem << " in Fast File map!";
return;
}
mFastFiles.remove(fileStem);
CloseFastFile(fileStem);
invisibleRootItem()->removeChild(childItem);
i--;
}
});
contextMenu->addMenu(closeMultipleAction);
QAction *closeAction = new QAction("Close File");
contextMenu->addAction(closeAction);
connect(closeAction, &QAction::triggered, this, [this, &activeItem, &activeText](bool checked) {
Q_UNUSED(checked);
const QString fileStem = activeItem->text(0);
mFastFiles.remove(fileStem);
CloseFastFile(activeText);
invisibleRootItem()->removeChild(activeItem);
});
QMenu *exportSubmenu = new QMenu("Export...", this);
contextMenu->addMenu(exportSubmenu);
const FastFile* fastFile = mFastFiles[fileStem];
QAction *exportFastFileAction = new QAction("Export Fast File");
exportSubmenu->addAction(exportFastFileAction);
connect(exportFastFileAction, &QAction::triggered, this, [fastFile](bool checked) {
Q_UNUSED(checked);
const QString fastFilePath = QFileDialog::getSaveFileName(
nullptr, "Export Fast File...", QDir::currentPath(),
"Fast File (*.ff);;All Files(*.*)");
fastFile->ExportFastFile(fastFilePath);
});
QAction *exportZoneFileAction = new QAction("Export Zone File");
exportSubmenu->addAction(exportZoneFileAction);
connect(exportZoneFileAction, &QAction::triggered, this, [](bool checked) {
Q_UNUSED(checked);
// const QString zoneFilePath = QFileDialog::getSaveFileName(
// nullptr, "Export Zone File...", QDir::currentPath(),
// "Zone File (*.zone);;All Files(*.*)");
//fastFile->GetZoneFile()->SaveZoneFile(zoneFilePath);
});
} else if (activeText.contains(".zone")) {
const QString fileStem = activeText;
if (!mZoneFiles.contains(fileStem)) {
qDebug() << "Error: Could not find " << fileStem << " in Zone File map!";
return;
}
QMenu *exportSubmenu = new QMenu("Export...", this);
contextMenu->addMenu(exportSubmenu);
//const ZoneFile* zoneFile = mZoneFiles[fileStem];
QAction *exportZoneFileAction = new QAction("Export Zone File");
exportSubmenu->addAction(exportZoneFileAction);
connect(exportZoneFileAction, &QAction::triggered, this, [](bool checked) {
Q_UNUSED(checked);
});
QAction *exportFastFileAction = new QAction("Export Fast File");
exportSubmenu->addAction(exportFastFileAction);
connect(exportFastFileAction, &QAction::triggered, this, [](bool checked) {
Q_UNUSED(checked);
});
} else if (activeItem && activeText.contains(".wav")) {
XTreeWidgetItem *parentItem = dynamic_cast<XTreeWidgetItem*>(activeItem->parent());
while (parentItem && !parentItem->text(0).contains(".zone")) {
parentItem = dynamic_cast<XTreeWidgetItem*>(parentItem->parent());
if (parentItem == invisibleRootItem()) {
break;
}
}
if (parentItem && parentItem != invisibleRootItem() && parentItem->text(0).contains(".zone")) {
//const QString fileStem = parentItem->text(0).section('.', 0, 0);
// QVector<LoadedSound> LoadedSounds = mZoneFiles[fileStem]->GetAssetMap().sounds;
// for (LoadedSound LoadedSound : LoadedSounds) {
// for (Sound sound : LoadedSound.sounds) {
// if (sound.path.contains(activeText)) {
// QMenu *exportSubmenu = new QMenu("Export...", this);
// contextMenu->addMenu(exportSubmenu);
// QAction *exportWAVAction = new QAction("Export as WAV File");
// exportSubmenu->addAction(exportWAVAction);
// connect(exportWAVAction, &QAction::triggered, this, [sound](bool checked) {
// Q_UNUSED(checked);
// QDir dir = QDir::currentPath();
// if (!dir.exists("exports/")) {
// dir.mkdir("exports/");
// }
// if (!dir.exists("exports/sounds/")) {
// dir.mkdir("exports/sounds/");
// }
// const QString fileName = "exports/sounds/" + sound.path.split('/').last();
// QFile wavFile(fileName);
// if (!wavFile.open(QIODevice::WriteOnly)) {
// qDebug() << "Failed to write wav file!";
// return;
// }
// wavFile.write(sound.data);
// wavFile.close();
// });
// break;
// }
// }
// }
}
} else if (activeItem && activeText == "Sounds") {
XTreeWidgetItem *parentItem = dynamic_cast<XTreeWidgetItem*>(activeItem->parent());
while (parentItem && !parentItem->text(0).contains(".zone")) {
parentItem = dynamic_cast<XTreeWidgetItem*>(parentItem->parent());
if (parentItem == invisibleRootItem()) {
break;
}
}
if (parentItem && parentItem != invisibleRootItem() && parentItem->text(0).contains(".zone")) {
const QString fileStem = parentItem->text(0).section('.', 0, 0);
//auto zoneFile = mZoneFiles[fileStem];
QMenu *exportSubmenu = new QMenu("Export...", this);
contextMenu->addMenu(exportSubmenu);
QAction *exportAllWAVAction = new QAction("Export ALL as WAV Files");
exportSubmenu->addAction(exportAllWAVAction);
connect(exportAllWAVAction, &QAction::triggered, this, [](bool checked) {
Q_UNUSED(checked);
// for (LoadedSound LoadedSound : zoneFile->GetAssetMap().sounds) {
// for (Sound sound : LoadedSound.sounds) {
// if (!sound.dataLength) { continue; }
// QDir dir = QDir::currentPath();
// if (!dir.exists("exports/")) {
// dir.mkdir("exports/");
// }
// if (!dir.exists("exports/sounds/")) {
// dir.mkdir("exports/sounds/");
// }
// const QString fileName = "exports/sounds/" + sound.path.split('/').last();
// QFile wavFile(fileName);
// if (!wavFile.open(QIODevice::WriteOnly)) {
// qDebug() << "Failed to write wav file!";
// return;
// }
// wavFile.write(sound.data);
// wavFile.close();
// }
// }
});
}
}
QPoint pt(pos);
contextMenu->exec(mapToGlobal(pt));
delete contextMenu;
}
void XTreeWidget::ItemSelectionChanged() {
if (selectedItems().isEmpty()) { return; }
XTreeWidgetItem *selectedItem = dynamic_cast<XTreeWidgetItem*>(selectedItems().first());
if (!selectedItem) { return; }
if (selectedItem->text(0).isEmpty()) { return; }
QString selectedText = selectedItem->text(0);
emit ItemSelected(selectedText);
XTreeWidgetItem *parentItem = dynamic_cast<XTreeWidgetItem*>(selectedItem->parent());
/*if (selectedText.contains(".dds")) {
if (!mDDSFiles.contains(selectedText)) {
LogManager::instance().addError("Could not find " + selectedText + " in DDS map!");
return;
}
emit DDSFileSelected(mDDSFiles[selectedText], selectedText);
} else if (selectedText.contains(".iwi")) {
if (!mIWIFiles.contains(selectedText)) {
LogManager::instance().addError("Could not find " + selectedText + " in IWI map!");
return;
}
emit IWIFileSelected(mIWIFiles[selectedText], selectedText);
} else */if (selectedText.contains(".ff")) {
if (!mFastFiles.contains(selectedText)) {
LogManager::instance().addError("Could not find " + selectedText + " in Fast File map!");
return;
}
emit FastFileSelected(mFastFiles[selectedText], selectedText);
} else if (selectedText.contains(".zone")) {
if (!mZoneFiles.contains(selectedText)) {
LogManager::instance().addError("Could not find " + selectedText + " in Zone File map!");
return;
}
emit ZoneFileSelected(mZoneFiles[selectedText], selectedText);
} else if (selectedText.contains(".str")) {
if (!mZoneFiles.contains(selectedText.replace(".str", ".zone"))) {
LogManager::instance().addError("Could not find " + selectedText + " in Zone File map!");
return;
}
emit LocalStringSelected(mZoneFiles[selectedText], selectedText);
} else if (parentItem && (parentItem->text(0) == "Images")) {
XTreeWidgetItem *grandpaItem = dynamic_cast<XTreeWidgetItem*>(parentItem->parent());
if (grandpaItem && grandpaItem->text(0).contains(".zone")) {
const QString fileStem = grandpaItem->text(0).section('.', 0, 0);
// QVector<Image> images = mZoneFiles[fileStem]->GetAssetMap().images;
// for (Image image : images) {
// if (image.materialName == selectedText) {
// emit ImageSelected(std::make_shared<Image>(image), fileStem);
// break;
// }
// }
}
} /*else if (parentItem && (parentItem->text(0) == "Tech Sets")) {
XTreeWidgetItem *grandpaItem = dynamic_cast<XTreeWidgetItem*>(parentItem->parent());
if (grandpaItem && grandpaItem->text(0).contains(".zone")) {
const QString fileStem = grandpaItem->text(0).section('.', 0, 0);
auto techsets = mZoneFiles[fileStem]->GetAssetList().techSets;
for (auto techset : techsets) {
if (techset.name == selectedText) {
emit TechSetSelected(new MaterialTechSet(techset), fileStem);
break;
}
}
}
} else if (parentItem && (parentItem->text(0) == "Materials")) {
XTreeWidgetItem *grandpaItem = dynamic_cast<XTreeWidgetItem*>(parentItem->parent());
if (grandpaItem && grandpaItem->text(0).contains(".zone")) {
const QString fileStem = grandpaItem->text(0).section('.', 0, 0);
auto materials = mZoneFiles[fileStem]->GetAssetMap().materials;
for (auto material : materials) {
// if (material.name == selectedText) {
// emit MaterialSelected(std::make_shared<Material>(material), fileStem);
// break;
// }
}
}
} else if (parentItem && selectedText.contains(".wav")) {
XTreeWidgetItem *grandpaItem = dynamic_cast<XTreeWidgetItem*>(parentItem->parent());
while (grandpaItem && !grandpaItem->text(0).contains(".zone")) {
grandpaItem = dynamic_cast<XTreeWidgetItem*>(grandpaItem->parent());
if (grandpaItem == invisibleRootItem()) {
break;
}
}
if (grandpaItem && grandpaItem != invisibleRootItem() && grandpaItem->text(0).contains(".zone")) {
const QString fileStem = grandpaItem->text(0).section('.', 0, 0);
// QVector<LoadedSound> LoadedSounds = mZoneFiles[fileStem]->GetAssetMap().sounds;
// for (LoadedSound LoadedSound : LoadedSounds) {
// for (Sound sound : LoadedSound.sounds) {
// if (sound.path.contains(selectedText)) {
// emit SoundSelected(std::make_shared<Sound>(sound), fileStem);
// break;
// }
// }
// }
}
} else if (selectedItem->GetCategory() != CATEGORY_TYPE) {
XTreeWidgetItem *zoneRoot = selectedItem;
bool zoneChild = false;
while (zoneRoot) {
zoneRoot = dynamic_cast<XTreeWidgetItem*>(zoneRoot->parent());
if (zoneRoot->text(0).contains("Raw Files")) {
zoneChild = true;
break;
}
}
if (!zoneChild) { return; }
const QString fileStem = zoneRoot->parent()->text(0);
if (!mZoneFiles.contains(fileStem)) {
LogManager::instance().addError("Could not find " + fileStem + " in Zone File map!");
return;
}
auto rawFiles = mZoneFiles[fileStem]->GetAssetMap().rawFiles;
for (auto rawFile : rawFiles) {
//if (rawFile->path.split('/').last() == selectedText) {
// emit RawFileSelected(std::make_shared<RawFile>(rawFile), fileStem);
// return;
//}
}
}*/
}
const ZoneFile* XTreeWidget::FindZoneFile(const QString aStem) {
foreach (auto zoneFile, mZoneFiles) {
if (zoneFile->GetStem() == aStem) {
return zoneFile;
}
}
return nullptr;
}
const FastFile *XTreeWidget::FindFastFile(const QString aStem) {
foreach (auto fastFile, mFastFiles) {
if (fastFile->GetStem() == aStem) {
return fastFile;
}
}
return nullptr;
}
bool XTreeWidget::HasZoneFile(const QString aStem) {
return FindZoneFile(aStem) != nullptr;
}
bool XTreeWidget::HasFastFile(const QString aStem) {
return FindFastFile(aStem) != nullptr;
}
void XTreeWidget::AddIWIFile(IWIFile* aIWIFile) {
const QString iwiFileName = QString(aIWIFile->fileStem + ".iwi");
for (int i = 0; i < invisibleRootItem()->childCount(); i++) {
auto iwiFileItem = invisibleRootItem()->child(i);
if (iwiFileItem->text(0) == iwiFileName) {
delete iwiFileItem;
}
}
XTreeWidgetItem *iwiItem = new XTreeWidgetItem(this);
iwiItem->setIcon(0, Utils::CreateAssetIcon(ASSET_TYPE_IMAGE));
iwiItem->setText(0, iwiFileName);
mIWIFiles[aIWIFile->fileStem.section(".", 0, 0)] = aIWIFile;
}
void XTreeWidget::AddDDSFile(DDSFile* aDDSFile) {
const QString ddsFileName = QString(aDDSFile->fileStem + ".dds");
for (int i = 0; i < invisibleRootItem()->childCount(); i++) {
auto ddsFileItem = invisibleRootItem()->child(i);
if (ddsFileItem->text(0) == ddsFileName) {
delete ddsFileItem;
}
}
XTreeWidgetItem *ddsItem = new XTreeWidgetItem(this);
ddsItem->setIcon(0, Utils::CreateAssetIcon(ASSET_TYPE_IMAGE));
ddsItem->setText(0, ddsFileName);
mDDSFiles[aDDSFile->fileStem.section(".", 0, 0)] = aDDSFile;
}

View File

@ -1,67 +0,0 @@
#ifndef XTREEWIDGET_H
#define XTREEWIDGET_H
#include "d3dbsp_structs.h"
#include "ddsfile.h"
#include "iwifile.h"
#include "fastfile.h"
#include "xloadedsound.h"
#include "xtreewidgetitem.h"
#include "zonefile.h"
#include "xrawfile.h"
#include "xgfximage.h"
#include "xstringtable.h"
#include "xmenudef.h"
#include <QTreeWidget>
#include <QFileDialog>
class XTreeWidget : public QTreeWidget
{
Q_OBJECT
public:
explicit XTreeWidget(QWidget *parent = nullptr);
~XTreeWidget();
void AddFastFile(FastFile* aFastFile);
void AddZoneFile(const ZoneFile *aZoneFile, XTreeWidgetItem *aParentItem = nullptr);
void AddIWIFile(IWIFile* aIWIFile);
void AddDDSFile(DDSFile* aDDSFile);
const ZoneFile *FindZoneFile(const QString aStem);
const FastFile* FindFastFile(const QString aStem);
bool HasZoneFile(const QString aStem);
bool HasFastFile(const QString aStem);
void CloseFastFile(const QString aFFName);
signals:
void DDSFileSelected(const DDSFile* aDDSFile, const QString aParentName);
void IWIFileSelected(const IWIFile* aIWIFile, const QString aParentName);
void FastFileSelected(const FastFile* aFastFile, const QString aParentName);
void ZoneFileSelected(const ZoneFile* aZoneFile, const QString aParentName);
void LocalStringSelected(const ZoneFile* aZoneFile, const QString aParentName);
void RawFileSelected(const XRawFile* aRawFile, const QString aParentName);
void ImageSelected(const XGfxImage* aImage, const QString aParentName);
void TechSetSelected(const XMaterialTechniqueSet* aZoneFile, const QString aParentName);
void StrTableSelected(const XStringTable* aStrTable, const QString aParentName);
void MenuSelected(const XMenuDef* aMenu, const QString aParentName);
void SoundSelected(const XLoadedSound* aSound, const QString aParentName);
void MaterialSelected(const XMaterial* aMaterial, const QString aParentName);
void ItemSelected(const QString itemText);
void ItemClosed(const QString itemText);
void Cleared();
protected:
void ItemSelectionChanged();
void PrepareContextMenu(const QPoint &pos);
private:
QMap<QString, const FastFile*> mFastFiles;
QMap<QString, const ZoneFile*> mZoneFiles;
QMap<QString, const DDSFile*> mDDSFiles;
QMap<QString, const IWIFile*> mIWIFiles;
};
#endif // XTREEWIDGET_H

View File

@ -1,56 +0,0 @@
#include "xtreewidgetitem.h"
XTreeWidgetItem::XTreeWidgetItem(QTreeWidget *parent, bool group)
: QTreeWidgetItem(parent)
, isGroup(group)
, mCategory(CATEGORY_NONE) {
}
XTreeWidgetItem::XTreeWidgetItem(QTreeWidgetItem *parent, bool group)
: QTreeWidgetItem(parent)
, isGroup(group)
, mCategory(CATEGORY_NONE) {
}
void XTreeWidgetItem::SetCategory(TREE_CATEGORY category)
{
mCategory = category;
}
TREE_CATEGORY XTreeWidgetItem::GetCategory()
{
return mCategory;
}
bool XTreeWidgetItem::operator<(const QTreeWidgetItem &other) const {
// Attempt to cast the other item to our custom type.
const XTreeWidgetItem* otherItem = dynamic_cast<const XTreeWidgetItem*>(&other);
if (otherItem) {
bool thisIsGroup = this->childCount() > 0;
bool otherIsGroup = otherItem->childCount() > 0;
if (thisIsGroup != otherIsGroup) {
return otherIsGroup; // Groups should come before non-groups
}
}
// Fallback to the default string comparison on the current sort column.
return QTreeWidgetItem::operator<(other);
}
XTreeWidgetItem& XTreeWidgetItem::operator=(const XTreeWidgetItem &other)
{
if (this != &other) {
// Copy text and icon for each column.
const int colCount = other.columnCount();
for (int i = 0; i < colCount; ++i) {
setText(i, other.text(i));
setIcon(i, other.icon(i));
}
// Copy custom members.
this->isGroup = other.isGroup;
}
return *this;
}

View File

@ -1,36 +0,0 @@
#ifndef XTREEWIDGETITEM_H
#define XTREEWIDGETITEM_H
#include <QTreeWidget>
#include <QTreeWidgetItem>
enum TREE_CATEGORY {
CATEGORY_NONE = 0x00,
CATEGORY_FILE = 0x01,
CATEGORY_TYPE = 0x02
};
// Custom item class
class XTreeWidgetItem : public QTreeWidgetItem
{
public:
// Flag to indicate if the item is a collapsible group/header.
bool isGroup;
// Constructors: default to non-group unless specified.
XTreeWidgetItem(QTreeWidget *parent, bool group = false);
XTreeWidgetItem(QTreeWidgetItem *parent, bool group = false);
void SetCategory(TREE_CATEGORY category);
TREE_CATEGORY GetCategory();
// Override the less-than operator to customize sorting.
bool operator<(const QTreeWidgetItem &other) const override;
XTreeWidgetItem &operator =(const XTreeWidgetItem &other);
private:
TREE_CATEGORY mCategory;
};
#endif // XTREEWIDGETITEM_H

View File

@ -1,156 +0,0 @@
#include "zonefileviewer.h"
#include "ui_zonefileviewer.h"
#include "statusbarmanager.h"
ZoneFileViewer::ZoneFileViewer(QWidget *parent)
: QWidget(parent)
, ui(new Ui::ZoneFileViewer) {
ui->setupUi(this);
mZoneFile = nullptr;
ui->tableWidget_RecordCounts->setColumnCount(3);
ui->tableWidget_RecordCounts->setHorizontalHeaderLabels({ "Identifier", "Asset", "Count" });
ui->tableWidget_RecordCounts->horizontalHeader()->setStretchLastSection(true);
ui->tableWidget_RecordOrder->setColumnCount(3);
ui->tableWidget_RecordOrder->setHorizontalHeaderLabels({ "Identifier", "Asset", "Count" });
ui->tableWidget_RecordOrder->horizontalHeader()->setStretchLastSection(true);
connect(ui->lineEdit_TagSearch, &QLineEdit::textChanged, this, &ZoneFileViewer::SortTags);
connect(ui->tableWidget_RecordCounts, &QTableWidget::itemSelectionChanged, this, &ZoneFileViewer::HighlightRecordInOrder);
connect(ui->listWidget_Tags, &QListWidget::currentTextChanged, this, [this](const QString &aCurrentText) {
StatusBarManager::instance().updateStatus(QString("Selected tag '%1' with index %2").arg(aCurrentText).arg(mZoneFile->GetTags().indexOf(aCurrentText)));
});
}
ZoneFileViewer::~ZoneFileViewer() {
delete ui;
}
void ZoneFileViewer::HighlightRecordInOrder() {
ui->tableWidget_RecordOrder->clearSelection();
foreach (auto selectedItem, ui->tableWidget_RecordCounts->selectedItems()) {
int selectedRow = selectedItem->row();
const QString assetId = ui->tableWidget_RecordCounts->item(selectedRow, 0)->text();
for (int i = 0; i < ui->tableWidget_RecordOrder->rowCount(); i++) {
const QString testAssetId = ui->tableWidget_RecordOrder->item(i, 0)->text();
if (testAssetId != assetId) { continue; }
ui->tableWidget_RecordOrder->selectRow(i);
ui->tableWidget_RecordOrder->item(i, 0)->setSelected(true);
ui->tableWidget_RecordOrder->item(i, 1)->setSelected(true);
ui->tableWidget_RecordOrder->item(i, 2)->setSelected(true);
ui->tableWidget_RecordOrder->item(i, 3)->setSelected(true);
}
}
}
void ZoneFileViewer::SortTags(const QString &aSearchText) {
ui->listWidget_Tags->clear();
const QStringList tags = mZoneFile->GetTags();
if (aSearchText.isEmpty()) {
ui->listWidget_Tags->addItems(tags);
return;
}
QStringList sortedTags;
foreach (const QString tag, tags) {
if (tag.contains(aSearchText)) {
sortedTags << tag;
}
}
StatusBarManager::instance().updateStatus(QString("Found %1 tags.").arg(sortedTags.size()));
ui->listWidget_Tags->addItems(sortedTags);
}
void ZoneFileViewer::SetZoneFile(const ZoneFile* aZoneFile) {
mZoneFile = aZoneFile;
ui->tableWidget_RecordCounts->clearContents();
ui->tableWidget_RecordOrder->clearContents();
ui->listWidget_Tags->clear();
const QStringList tags = mZoneFile->GetTags();
ui->listWidget_Tags->addItems(tags);
ui->label_Title->setText(mZoneFile->GetBaseStem() + ".zone");
ui->groupBox_Tags->setTitle(QString("Tags (%1)").arg(tags.size()));
if (tags.isEmpty()) {
ui->groupBox_Tags->hide();
} else {
ui->groupBox_Tags->show();
}
QMap<XAssetType, int> recordCounts = QMap<XAssetType, int>();
QVector<QPair<XAssetType, int>> assetOccurances = QVector<QPair<XAssetType, int>>();
for (XAssetType type : mZoneFile->GetTypes()) {
if (!recordCounts.contains(type)) {
recordCounts[type] = 0;
}
recordCounts[type]++;
if (!assetOccurances.isEmpty() && assetOccurances.last().first == type) {
assetOccurances.last().second++;
continue;
}
QPair<XAssetType, int> assetOccurance(type, 1);
assetOccurances << assetOccurance;
}
ui->tableWidget_RecordOrder->setRowCount(assetOccurances.size());
int assetIndex = 0;
foreach (auto assetOccurance, assetOccurances) {
XAssetType assetType = assetOccurance.first;
int assetCount = assetOccurance.second;
QIcon assetIcon = Utils::CreateAssetIcon(assetType);
if (assetIcon.isNull()) {
qDebug() << "Icon is null for record: " << assetType;
}
QTableWidgetItem *recordItem = new QTableWidgetItem(QString::number(assetType, 16));
QTableWidgetItem *recordStrItem = new QTableWidgetItem(XAsset::XAssetTypeToString(assetType));
QTableWidgetItem *recordCountItem = new QTableWidgetItem(QString::number(assetCount));
recordItem->setIcon(assetIcon);
ui->tableWidget_RecordOrder->setItem(assetIndex, 0, recordItem);
ui->tableWidget_RecordOrder->setItem(assetIndex, 1, recordStrItem);
ui->tableWidget_RecordOrder->setItem(assetIndex, 2, recordCountItem);
assetIndex++;
}
int recordIndex = 0;
for (XAssetType assetType : recordCounts.keys()) {
int recordCount = recordCounts[assetType];
QIcon assetIcon = Utils::CreateAssetIcon(assetType);
if (assetIcon.isNull()) {
qDebug() << "Icon is null for record: " << assetType;
}
ui->tableWidget_RecordCounts->setRowCount(recordIndex + 1);
QTableWidgetItem *recordItem = new QTableWidgetItem(QString::number(assetType, 16));
QTableWidgetItem *recordCountStrItem = new QTableWidgetItem(XAsset::XAssetTypeToString(assetType));
QTableWidgetItem *recordCountItem = new QTableWidgetItem(QString::number(recordCount));
recordItem->setIcon(assetIcon);
ui->tableWidget_RecordCounts->setItem(recordIndex, 0, recordItem);
ui->tableWidget_RecordCounts->setItem(recordIndex, 1, recordCountStrItem);
ui->tableWidget_RecordCounts->setItem(recordIndex, 2, recordCountItem);
recordIndex++;
}
ui->tableWidget_RecordOrder->resizeColumnsToContents();
ui->tableWidget_RecordCounts->resizeColumnsToContents();
}

View File

@ -1,33 +0,0 @@
#ifndef ZONEFILEVIEWER_H
#define ZONEFILEVIEWER_H
#include "zonefile.h"
#include "utils.h"
#include <QWidget>
namespace Ui {
class ZoneFileViewer;
}
class ZoneFileViewer : public QWidget
{
Q_OBJECT
public:
explicit ZoneFileViewer(QWidget *parent = nullptr);
~ZoneFileViewer();
void SetZoneFile(const ZoneFile *aZoneFile);
public slots:
void SortTags(const QString &aSearchText);
void HighlightRecordInOrder();
private:
Ui::ZoneFileViewer *ui;
const ZoneFile* mZoneFile;
};
#endif // ZONEFILEVIEWER_H

View File

@ -1,129 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>ZoneFileViewer</class>
<widget class="QWidget" name="ZoneFileViewer">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>556</width>
<height>428</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QLabel" name="label_Title">
<property name="font">
<font>
<family>Roboto</family>
<pointsize>16</pointsize>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>ZoneFile 0</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QGroupBox" name="groupBox_Tags">
<property name="font">
<font>
<family>Roboto</family>
<pointsize>9</pointsize>
</font>
</property>
<property name="title">
<string>Tags</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>Search:</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_TagSearch">
<property name="placeholderText">
<string>Search tags...</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QListWidget" name="listWidget_Tags">
<property name="editTriggers">
<set>QAbstractItemView::EditTrigger::NoEditTriggers</set>
</property>
<property name="alternatingRowColors">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_RecordCounts">
<property name="title">
<string>Record Counts</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="QTableWidget" name="tableWidget_RecordCounts">
<property name="editTriggers">
<set>QAbstractItemView::EditTrigger::NoEditTriggers</set>
</property>
<property name="alternatingRowColors">
<bool>true</bool>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::SelectionMode::SingleSelection</enum>
</property>
<property name="selectionBehavior">
<enum>QAbstractItemView::SelectionBehavior::SelectRows</enum>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_RecordOrder">
<property name="title">
<string>Record Order</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QTableWidget" name="tableWidget_RecordOrder">
<property name="editTriggers">
<set>QAbstractItemView::EditTrigger::NoEditTriggers</set>
</property>
<property name="alternatingRowColors">
<bool>true</bool>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::SelectionMode::NoSelection</enum>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -1,30 +0,0 @@
<RCC>
<qresource prefix="/images">
<file>images/XPlor.png</file>
<file>images/copy.svg</file>
<file>images/cut.svg</file>
<file>images/multiple.png</file>
<file>images/new_file.svg</file>
<file>images/open_file.svg</file>
<file>images/open_folder.svg</file>
<file>images/paste.svg</file>
<file>images/refresh.svg</file>
<file>images/save.svg</file>
</qresource>
<qresource prefix="/icons">
<file>icons/Icon_Pause.png</file>
<file>icons/Icon_Play.png</file>
<file>icons/Icon_SkipBack.png</file>
<file>icons/Icon_SkipForward.png</file>
<file>icons/Icon_Stop.png</file>
<file>icons/Icon_Editor.png</file>
<file>icons/Icon_Views.png</file>
<file>icons/Icon_Tree.png</file>
<file>icons/Icon_Cut.png</file>
<file>icons/Icon_Find.png</file>
<file>icons/Icon_NewFile.png</file>
<file>icons/Icon_Paste.png</file>
<file>icons/Icon_Save.png</file>
<file>icons/Icon_OpenFile.png</file>
</qresource>
</RCC>

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 210 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 317 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 537 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 213 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 318 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 371 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 488 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 532 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 195 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 321 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" width="96" height="96" viewBox="0 0 24 24"><path fill="currentColor" d="M15 11a3 3 0 0 1-3-3V4H8a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2h9a2 2 0 0 0 2-2v-8zm-2-3a2 2 0 0 0 2 2h3.59L13 4.41zM8 3h5l7 7v9a3 3 0 0 1-3 3H8a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3m0 21a5 5 0 0 1-5-5V7h1v12a4 4 0 0 0 4 4h8v1z"/></svg>

Before

Width:  |  Height:  |  Size: 332 B

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" width="96" height="96" viewBox="0 0 24 24"><path fill="currentColor" d="M9 6.5c0 .79-.26 1.5-.7 2.1L20 20.29V21h-.71l-7.79-7.79l-3.2 3.19c.44.6.7 1.31.7 2.1A3.5 3.5 0 0 1 5.5 22A3.5 3.5 0 0 1 2 18.5A3.5 3.5 0 0 1 5.5 15c.79 0 1.5.26 2.1.7l3.19-3.2L7.6 9.3c-.6.44-1.31.7-2.1.7A3.5 3.5 0 0 1 2 6.5A3.5 3.5 0 0 1 5.5 3A3.5 3.5 0 0 1 9 6.5m-1 0A2.5 2.5 0 0 0 5.5 4A2.5 2.5 0 0 0 3 6.5A2.5 2.5 0 0 0 5.5 9A2.5 2.5 0 0 0 8 6.5M19.29 4H20v.71l-7.15 7.14l-.7-.7zM5.5 16A2.5 2.5 0 0 0 3 18.5A2.5 2.5 0 0 0 5.5 21A2.5 2.5 0 0 0 8 18.5A2.5 2.5 0 0 0 5.5 16"/></svg>

Before

Width:  |  Height:  |  Size: 594 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 133 KiB

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" width="96" height="96" viewBox="0 0 24 24"><path fill="currentColor" d="M14 11a3 3 0 0 1-3-3V4H7a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2h9a2 2 0 0 0 2-2v-8zm-2-3a2 2 0 0 0 2 2h3.59L12 4.41zM7 3h5l7 7v9a3 3 0 0 1-3 3H7a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3m2 16v-2H7v-1h2v-2h1v2h2v1h-2v2z"/></svg>

Before

Width:  |  Height:  |  Size: 319 B

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" width="96" height="96" viewBox="0 0 24 24"><path fill="currentColor" d="M14 11a3 3 0 0 1-3-3V4H7a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2h9a2 2 0 0 0 2-2v-8zm-2-3a2 2 0 0 0 2 2h3.59L12 4.41zM7 3h5l7 7v9a3 3 0 0 1-3 3H7a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3"/></svg>

Before

Width:  |  Height:  |  Size: 287 B

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" width="96" height="96" viewBox="0 0 24 24"><path fill="currentColor" d="M5 5h4l3 3h6a3 3 0 0 1 3 3v6a3 3 0 0 1-3 3H5a3 3 0 0 1-3-3V8a3 3 0 0 1 3-3m0 1a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h13a2 2 0 0 0 2-2v-6a2 2 0 0 0-2-2h-6.41l-3-3z"/></svg>

Before

Width:  |  Height:  |  Size: 275 B

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" width="96" height="96" viewBox="0 0 24 24"><path fill="currentColor" d="M11.5 1a2.5 2.5 0 0 1 2.45 2H17a3 3 0 0 1 3 3v13a3 3 0 0 1-3 3H6a3 3 0 0 1-3-3V6a3 3 0 0 1 3-3h3.05a2.5 2.5 0 0 1 2.45-2m1.41 2a1.495 1.495 0 0 0-2.82 0zM6 4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2h-1v3H7V4zm2 0v2h7V4z"/></svg>

Before

Width:  |  Height:  |  Size: 363 B

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" width="96" height="96" viewBox="0 0 24 24"><path fill="currentColor" d="M5 5h5v5H9V6.5c-2.35.97-4 3.29-4 6c0 3.58 2.91 6.5 6.5 6.5a6.5 6.5 0 0 0 6.5-6.5c0-3.08-2.14-5.66-5-6.33V5.14c3.42.7 6 3.72 6 7.36c0 4.13-3.36 7.5-7.5 7.5A7.5 7.5 0 0 1 4 12.5C4 9.72 5.5 7.3 7.74 6H5z"/></svg>

Before

Width:  |  Height:  |  Size: 321 B

View File

@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" width="96" height="96" viewBox="0 0 24 24"><path fill="currentColor" d="M6 4h10.59L20 7.41V18a3 3 0 0 1-3 3H6a3 3 0 0 1-3-3V7a3 3 0 0 1 3-3m0 1a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h11a2 2 0 0 0 2-2V7.91L16.09 5H15v5H6zm1 0v4h7V5zm5 7a3 3 0 0 1 3 3a3 3 0 0 1-3 3a3 3 0 0 1-3-3a3 3 0 0 1 3-3m0 1a2 2 0 0 0-2 2a2 2 0 0 0 2 2a2 2 0 0 0 2-2a2 2 0 0 0-2-2"/></svg>

Before

Width:  |  Height:  |  Size: 392 B

View File

@ -234,7 +234,7 @@
"WEIGHTS_0": 6
},
"indices": 1,
ASSET_MATERIAL: 0,
"material": 0,
"mode": 4
}
]
@ -250,7 +250,7 @@
"WEIGHTS_0": 12
},
"indices": 7,
ASSET_MATERIAL: 0,
"material": 0,
"mode": 4
}
]

BIN
data/obj/diffusemap.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

BIN
data/obj/normalmap.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 B

101
enums.h Normal file
View File

@ -0,0 +1,101 @@
#ifndef ENUMS_H
#define ENUMS_H
enum LUMP_TYPE
{
LUMP_MATERIALS = 0x0,
LUMP_LIGHTBYTES = 0x1,
LUMP_LIGHTGRIDENTRIES = 0x2,
LUMP_LIGHTGRIDCOLORS = 0x3,
LUMP_PLANES = 0x4,
LUMP_BRUSHSIDES = 0x5,
LUMP_BRUSHSIDEEDGECOUNTS = 0x6,
LUMP_BRUSHEDGES = 0x7,
LUMP_BRUSHES = 0x8,
LUMP_TRIANGLES = 0x9,
LUMP_DRAWVERTS = 0xA,
LUMP_DRAWINDICES = 0xB,
LUMP_CULLGROUPS = 0xC,
LUMP_CULLGROUPINDICES = 0xD,
LUMP_OBSOLETE_1 = 0xE,
LUMP_OBSOLETE_2 = 0xF,
LUMP_OBSOLETE_3 = 0x10,
LUMP_OBSOLETE_4 = 0x11,
LUMP_OBSOLETE_5 = 0x12,
LUMP_PORTALVERTS = 0x13,
LUMP_OBSOLETE_6 = 0x14,
LUMP_UINDS = 0x15,
LUMP_BRUSHVERTSCOUNTS = 0x16,
LUMP_BRUSHVERTS = 0x17,
LUMP_AABBTREES = 0x18,
LUMP_CELLS = 0x19,
LUMP_PORTALS = 0x1A,
LUMP_NODES = 0x1B,
LUMP_LEAFS = 0x1C,
LUMP_LEAFBRUSHES = 0x1D,
LUMP_LEAFSURFACES = 0x1E,
LUMP_COLLISIONVERTS = 0x1F,
LUMP_COLLISIONTRIS = 0x20,
LUMP_COLLISIONEDGEWALKABLE = 0x21,
LUMP_COLLISIONBORDERS = 0x22,
LUMP_COLLISIONPARTITIONS = 0x23,
LUMP_COLLISIONAABBS = 0x24,
LUMP_MODELS = 0x25,
LUMP_VISIBILITY = 0x26,
LUMP_ENTITIES = 0x27,
LUMP_PATHCONNECTIONS = 0x28,
LUMP_REFLECTION_PROBES = 0x29,
LUMP_VERTEX_LAYER_DATA = 0x2A,
LUMP_PRIMARY_LIGHTS = 0x2B,
LUMP_LIGHTGRIDHEADER = 0x2C,
LUMP_LIGHTGRIDROWS = 0x2D,
LUMP_OBSOLETE_10 = 0x2E,
//Obsolete in BO1/////////////////
LUMP_UNLAYERED_TRIANGLES = 0x2F,
LUMP_UNLAYERED_DRAWVERTS = 0x30,
LUMP_UNLAYERED_DRAWINDICES = 0x31,
LUMP_UNLAYERED_CULLGROUPS = 0x32,
LUMP_UNLAYERED_AABBTREES = 0x33,
//////////////////////////////////
LUMP_WATERHEADER = 0x34,
LUMP_WATERCELLS = 0x35,
LUMP_WATERCELLDATA = 0x36,
LUMP_BURNABLEHEADER = 0x37,
LUMP_BURNABLECELLS = 0x38,
LUMP_BURNABLECELLDATA = 0x39,
LUMP_SIMPLELIGHTMAPBYTES = 0x3A,
LUMP_LODCHAINS = 0x3B,
LUMP_LODINFOS = 0x3C,
LUMP_LODSURFACES = 0x3D,
LUMP_LIGHTREGIONS = 0x3E,
LUMP_LIGHTREGION_HULLS = 0x3F,
LUMP_LIGHTREGION_AXES = 0x40,
LUMP_WIILIGHTGRID = 0x41,
LUMP_LIGHTGRID2D_LIGHTS = 0x42,
LUMP_LIGHTGRID2D_INDICES = 0x43,
LUMP_LIGHTGRID2D_POINTS = 0x44,
LUMP_LIGHTGRID2D_CELLS = 0x45,
LUMP_LIGHT_CORONAS = 0x46,
//BO Specific/////////////////////////
LUMP_SHADOWMAP_VOLUMES = 0x47,
LUMP_SHADOWMAP_VOLUME_PLANES = 0x48,
LUMP_EXPOSURE_VOLUMES = 0x49,
LUMP_EXPOSURE_VOLUME_PLANES = 0x4A,
LUMP_OCCLUDERS = 0x4B,
LUMP_OUTDOORBOUNDS = 0x4C,
LUMP_HERO_ONLY_LIGHTS = 0x4D,
//////////////////////////////////////
INFO_LUMP_TYPE_COUNT
};
enum BSPVERSION_TYPE
{
BSPVERSION_COD_WAW = 31,
BSPVERSION_COD_BO = 45
};
#endif // ENUMS_H

View File

@ -1,400 +0,0 @@
#include "compression.h"
#include "minilzo.h"
#include "xcompress.h"
#include <QLibrary>
#include <QDebug>
#include <QFile>
QByteArray Compression::CompressXMem(const QByteArray &data)
{
XMEMCODEC_PARAMETERS_LZX lzxParams = {};
lzxParams.Flags = 0;
lzxParams.WindowSize = 0x20000;
lzxParams.CompressionPartitionSize = 0x80000;
XMEMCOMPRESSION_CONTEXT ctx = nullptr;
if (FAILED(XMemCreateCompressionContext(XMEMCODEC_LZX, &lzxParams, 0, &ctx)) || !ctx)
return QByteArray();
SIZE_T estimatedSize = data.size() + XCOMPRESS_LZX_BLOCK_GROWTH_SIZE_MAX;
QByteArray output(static_cast<int>(estimatedSize), 0);
SIZE_T actualSize = estimatedSize;
HRESULT hr = XMemCompress(ctx, output.data(), &actualSize, data.constData(), data.size());
XMemDestroyCompressionContext(ctx);
if (FAILED(hr))
return QByteArray();
output.resize(static_cast<int>(actualSize));
return output;
}
QByteArray Compression::DecompressXMem(const QByteArray &data,
int flags, int windowSize, int partSize)
{
if (data.isEmpty())
return {};
XMEMCODEC_PARAMETERS_LZX lzxParams = {};
lzxParams.Flags = flags;
lzxParams.WindowSize = windowSize;
lzxParams.CompressionPartitionSize = partSize;
QByteArray internalState(0x94933, Qt::Uninitialized);
XMEMDECOMPRESSION_CONTEXT ctx = XMemInitializeDecompressionContext(
XMEMCODEC_LZX, &lzxParams, 1,
internalState.data(), internalState.size());
if (!ctx || XMemResetDecompressionContext(ctx)) {
qWarning() << "Failed to init LZX context";
return {};
}
QByteArray output;
output.reserve(16 * 1024 * 1024); // rough guess
const quint8 *nextIn = reinterpret_cast<const quint8*>(data.constData());
SIZE_T availIn = data.size();
QByteArray scratch(0x10000, Qt::Uninitialized); // 64 KB chunks
while (availIn > 0) {
SIZE_T inSize = availIn; // let XMem tell us how much it will consume
SIZE_T outSize = scratch.size(); // max 64 KB per call
HRESULT hr = XMemDecompressStream(ctx,
scratch.data(), &outSize,
nextIn, &inSize);
if (FAILED(hr)) {
qWarning() << "XMemDecompressStream failed, hr=" << hr;
XMemDestroyDecompressionContext(ctx);
return {};
}
if (inSize == 0 && outSize == 0)
break; // no progress
output.append(scratch.constData(), static_cast<int>(outSize));
nextIn += inSize;
availIn -= inSize;
}
XMemDestroyDecompressionContext(ctx);
return output;
}
quint32 Compression::CalculateAdler32Checksum(const QByteArray &data) {
// Start with the initial value for Adler-32
quint32 adler = adler32(0L, Z_NULL, 0);
// Calculate Adler-32 checksum
adler = adler32(adler, reinterpret_cast<const Bytef *>(data.constData()), data.size());
return adler;
}
qint64 Compression::FindZlibOffset(const QByteArray &bytes)
{
QDataStream stream(bytes);
while (!stream.atEnd())
{
QByteArray testSegment = stream.device()->peek(2).toHex().toUpper();
if (testSegment == "7801" ||
testSegment == "785E" ||
testSegment == "789C" ||
testSegment == "78DA") {
return stream.device()->pos();
}
stream.skipRawData(1);
}
return -1;
}
QByteArray Compression::StripHashBlocks(const QByteArray &raw,
int dataChunkSize,
int hashChunkSize)
{
QByteArray cleaned;
cleaned.reserve(raw.size()); // upper bound
int p = 0;
while (p < raw.size())
{
const int chunk = qMin(dataChunkSize, raw.size() - p);
cleaned.append(raw.constData() + p, chunk);
p += chunk;
// skip hash bytes if they are still inside the buffer
if (p < raw.size())
p += qMin(hashChunkSize, raw.size() - p);
}
return cleaned;
}
QByteArray Compression::DecompressZLIB(const QByteArray &aCompressedData) {
if (aCompressedData.isEmpty()) {
return {};
}
z_stream strm{};
strm.zalloc = Z_NULL;
strm.zfree = Z_NULL;
strm.opaque = Z_NULL;
strm.avail_in = static_cast<uInt>(aCompressedData.size());
strm.next_in = reinterpret_cast<Bytef*>(const_cast<char*>(aCompressedData.data()));
if (inflateInit2(&strm, MAX_WBITS) != Z_OK) {
qWarning() << "inflateInit2 failed";
return {};
}
QByteArray decompressed;
QByteArray buffer(fmin(strm.avail_in * 2, 4096), Qt::Uninitialized);
int ret;
do {
strm.next_out = reinterpret_cast<Bytef*>(buffer.data());
strm.avail_out = buffer.size();
ret = inflate(&strm, Z_NO_FLUSH);
if (strm.avail_out < buffer.size()) {
decompressed.append(buffer.constData(), buffer.size() - strm.avail_out);
}
if (ret == Z_STREAM_END) {
break;
}
if (ret == Z_BUF_ERROR && strm.avail_out == 0) {
buffer.resize(buffer.size() * 2);
} else if (ret != Z_OK) {
size_t errorOffset = strm.total_in;
qWarning() << "Zlib error:" << zError(ret)
<< "at offset" << errorOffset
<< "of" << aCompressedData.size() << "bytes";
inflateEnd(&strm);
return decompressed;
}
} while (ret != Z_STREAM_END);
inflateEnd(&strm);
return decompressed;
}
QByteArray Compression::CompressZLIB(const QByteArray &aData) {
return CompressZLIBWithSettings(aData);
}
QByteArray Compression::CompressZLIBWithSettings(const QByteArray &aData, int aCompressionLevel, int aWindowBits, int aMemLevel, int aStrategy, const QByteArray &aDictionary) {
if (aData.isEmpty())
return {};
z_stream strm{};
if (deflateInit2(&strm, aCompressionLevel, Z_DEFLATED, aWindowBits, aMemLevel, aStrategy) != Z_OK) {
qWarning() << "Failed to initialize compression with custom settings.";
return {};
}
if (!aDictionary.isEmpty()) {
deflateSetDictionary(&strm, reinterpret_cast<const Bytef*>(aDictionary.constData()), aDictionary.size());
}
strm.next_in = reinterpret_cast<Bytef*>(const_cast<char*>(aData.data()));
strm.avail_in = aData.size();
QByteArray compressed;
char buffer[4096];
int ret;
do {
strm.next_out = reinterpret_cast<Bytef*>(buffer);
strm.avail_out = sizeof(buffer);
ret = deflate(&strm, strm.avail_in ? Z_NO_FLUSH : Z_FINISH);
if (ret != Z_OK && ret != Z_STREAM_END) {
qWarning() << "Compression error:" << zError(ret);
deflateEnd(&strm);
return {};
}
compressed.append(buffer, sizeof(buffer) - strm.avail_out);
} while (ret != Z_STREAM_END);
deflateEnd(&strm);
return compressed;
}
QByteArray Compression::DecompressDeflate(const QByteArray &aCompressedData) {
if (aCompressedData.isEmpty())
return {};
z_stream strm{};
strm.next_in = reinterpret_cast<Bytef*>(const_cast<char*>(aCompressedData.data()));
strm.avail_in = static_cast<uInt>(aCompressedData.size());
// Negative window bits (-MAX_WBITS) indicate raw DEFLATE data.
if (inflateInit2(&strm, -MAX_WBITS) != Z_OK) {
qWarning() << "Failed to initialize DEFLATE for decompression.";
return QByteArray();
}
QByteArray decompressed;
char buffer[4096];
int ret;
do {
strm.next_out = reinterpret_cast<Bytef*>(buffer);
strm.avail_out = sizeof(buffer);
ret = inflate(&strm, Z_NO_FLUSH);
if (ret != Z_OK && ret != Z_STREAM_END) {
qWarning() << "DEFLATE decompression error:" << zError(ret);
inflateEnd(&strm);
return QByteArray();
}
decompressed.append(buffer, sizeof(buffer) - strm.avail_out);
} while (ret != Z_STREAM_END);
inflateEnd(&strm);
return decompressed;
}
QByteArray Compression::CompressDeflate(const QByteArray &aData) {
return CompressDeflateWithSettings(aData);
}
QByteArray Compression::CompressDeflateWithSettings(const QByteArray &aData, int aCompressionLevel, int aWindowBits, int aMemLevel, int aStrategy, const QByteArray &aDictionary) {
Q_UNUSED(aDictionary);
if (aData.isEmpty())
return QByteArray();
z_stream strm{};
// Negative window bits (-MAX_WBITS) indicate raw DEFLATE data.
if (deflateInit2(&strm, aCompressionLevel, Z_DEFLATED, -aWindowBits, aMemLevel, aStrategy) != Z_OK) {
qWarning() << "Failed to initialize DEFLATE for compression.";
return QByteArray();
}
strm.next_in = reinterpret_cast<Bytef*>(const_cast<char*>(aData.data()));
strm.avail_in = static_cast<uInt>(aData.size());
QByteArray compressed;
char buffer[4096];
int ret;
do {
strm.next_out = reinterpret_cast<Bytef*>(buffer);
strm.avail_out = sizeof(buffer);
ret = deflate(&strm, strm.avail_in ? Z_NO_FLUSH : Z_FINISH);
if (ret != Z_OK && ret != Z_STREAM_END) {
qWarning() << "DEFLATE compression error:" << zError(ret);
deflateEnd(&strm);
return {};
}
compressed.append(buffer, sizeof(buffer) - strm.avail_out);
} while (ret != Z_STREAM_END);
deflateEnd(&strm);
return compressed;
}
QByteArray Compression::DecompressLZO(const QByteArray &aCompressedData, quint32 aDestSize) {
QByteArray dst;
static bool ok = (lzo_init() == LZO_E_OK);
if (!ok)
throw std::runtime_error("lzo_init failed");
dst = QByteArray(aDestSize, Qt::Uninitialized);
lzo_uint out = aDestSize;
int rc = lzo1x_decompress_safe(
reinterpret_cast<const lzo_bytep>(aCompressedData.constData()),
static_cast<lzo_uint>(aCompressedData.size()),
reinterpret_cast<lzo_bytep>(dst.data()),
&out,
nullptr);
if (rc != LZO_E_OK || out != aDestSize)
throw std::runtime_error("LZO decompression error");
return dst;
}
QByteArray Compression::DecompressOodle(const QByteArray &aCompressedData, quint32 aDecompressedSize) {
return pDecompressOodle(aCompressedData, aCompressedData.length(), aDecompressedSize);
}
QByteArray Compression::CompressOodle(const QByteArray &aData) {
quint32 maxSize = pGetOodleCompressedBounds(aData.length());
QByteArray compressedData = pCompressOodle(aData, aData.length(),
maxSize, OodleFormat::Kraken, OodleCompressionLevel::Optimal5);
return compressedData.mid(0, maxSize);
}
quint32 Compression::pGetOodleCompressedBounds(quint32 aBufferSize) {
return aBufferSize + 274 * ((aBufferSize + 0x3FFFF) / 0x400000);
}
QByteArray Compression::pCompressOodle(QByteArray aBuffer, quint32 aBufferSize, quint32 aOutputBufferSize, OodleFormat aformat, OodleCompressionLevel alevel) {
QLibrary oodleLib("oo2core_8_win64");
if (!oodleLib.load()) {
qDebug() << "Failed to load DLL:" << oodleLib.errorString();
return QByteArray();
}
OodleLZ_CompressFunc OodleLZ_Compress =
(OodleLZ_CompressFunc)oodleLib.resolve("OodleLZ_Compress");
if (!OodleLZ_Compress) {
qDebug() << "Failed to resolve function:" << oodleLib.errorString();
return QByteArray();
}
std::byte *outputBuffer = new std::byte[aOutputBufferSize];
if (aBuffer.length() > 0 && aBufferSize > 0 && aOutputBufferSize > 0)
OodleLZ_Compress(aformat, reinterpret_cast<std::byte*>(aBuffer.data()), aBufferSize, outputBuffer, alevel, 0, 0, 0);
return QByteArray(reinterpret_cast<const char*>(outputBuffer), aOutputBufferSize);
}
QByteArray Compression::pDecompressOodle(QByteArray aBuffer, quint32 aBufferSize, quint32 aOutputBufferSize) {
QLibrary oodleLib("oo2core_8_win64");
if (!oodleLib.load()) {
qDebug() << "Failed to load DLL:" << oodleLib.errorString();
return QByteArray();
}
OodleLZ_DecompressFunc OodleLZ_Decompress =
(OodleLZ_DecompressFunc)oodleLib.resolve("OodleLZ_Decompress");
if (!OodleLZ_Decompress) {
qDebug() << "Failed to resolve function:" << oodleLib.errorString();
return QByteArray();
}
std::byte *outputBuffer = new std::byte[aOutputBufferSize];
if (aBuffer.length() > 0 && aBufferSize > 0 && aOutputBufferSize > 0)
OodleLZ_Decompress(reinterpret_cast<std::byte*>(aBuffer.data()), aBufferSize, outputBuffer, aOutputBufferSize, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
return QByteArray(reinterpret_cast<const char*>(outputBuffer), aOutputBufferSize);
}

View File

@ -1,87 +0,0 @@
#ifndef COMPRESSION_H
#define COMPRESSION_H
#include "QtZlib/zlib.h"
//#include <windows.h>
#include <QtGlobal>
#include <stddef.h>
#include <QByteArray>
#include <QVector>
#include <QCryptographicHash>
enum OodleFormat {
LZH = 0,
LZHLW = 1,
LZNIB = 2,
FormatNone = 3,
LZB16 = 4,
LZBLW = 5,
LZA = 6,
LZNA = 7,
Kraken = 8,
Mermaid = 9,
BitKnit = 10,
Selkie = 11,
Hydra = 12,
Leviathan = 13
};
enum OodleCompressionLevel {
LevelNone = 0,
SuperFast = 1,
VeryFast = 2,
Fast = 3,
Normal = 4,
Optimal1 = 5,
Optimal2 = 6,
Optimal3 = 7,
Optimal4 = 8,
Optimal5 = 9
};
typedef int (*OodleLZ_CompressFunc)(OodleFormat Format, std::byte *Buffer, long BufferSize, std::byte *OutputBuffer, OodleCompressionLevel Level, uint a, uint b, uint c);
typedef int (*OodleLZ_DecompressFunc)(std::byte* Buffer, long BufferSize, std::byte* OutputBuffer, long OutputBufferSize, uint a, uint b, uint c, uint d, uint e, uint f, uint g, uint h, uint i, int ThreadModule);
class Compression {
public:
static quint32 CalculateAdler32Checksum(const QByteArray &data);
static QByteArray DecompressZLIB(const QByteArray &aCompressedData);
static qint64 FindZlibOffset(const QByteArray &bytes);
static QByteArray StripHashBlocks(const QByteArray &raw,
int dataChunkSize = 0x200000,
int hashChunkSize = 0x2000);
static QByteArray CompressZLIB(const QByteArray &aData);
static QByteArray CompressZLIBWithSettings(const QByteArray &aData,
int aCompressionLevel = Z_BEST_COMPRESSION,
int aWindowBits = MAX_WBITS,
int aMemLevel = 8,
int aStrategy = Z_DEFAULT_STRATEGY,
const QByteArray &aDictionary = {});
static QByteArray DecompressDeflate(const QByteArray &aCompressedData);
static QByteArray CompressDeflate(const QByteArray &aData);
static QByteArray CompressDeflateWithSettings(const QByteArray &aData,
int aCompressionLevel = Z_BEST_COMPRESSION,
int aWindowBits = MAX_WBITS,
int aMemLevel = 8,
int aStrategy = Z_DEFAULT_STRATEGY,
const QByteArray &aDictionary = {});
static QByteArray DecompressLZO(const QByteArray &aCompressedData, quint32 aDestSize);
static QByteArray DecompressOodle(const QByteArray &aCompressedData, quint32 aDecompressedSize);
static QByteArray CompressOodle(const QByteArray &aData);
static QByteArray CompressXMem(const QByteArray &data);
static QByteArray DecompressXMem(const QByteArray &data, int flags = 0, int windowSize = 0x20000, int partSize = 0x80000);
private:
static quint32 pGetOodleCompressedBounds(quint32 aBufferSize);
static QByteArray pCompressOodle(QByteArray aBuffer, quint32 aBufferSize, quint32 aOutputBufferSize,
OodleFormat aformat, OodleCompressionLevel alevel);
static QByteArray pDecompressOodle(QByteArray aBuffer, quint32 aBufferSize, quint32 aOutputBufferSize);
};
#endif // COMPRESSION_H

View File

@ -1,25 +0,0 @@
QT += core
TEMPLATE = lib
CONFIG += staticlib c++17
DEFINES += MINILZO_USE_STATIC
SOURCES += $$files($$PWD/*.cpp, true) \
$$files($$PWD/*.c, true)
HEADERS += $$files($$PWD/*.h, true)
LIBS += \
-L$$PWD/../../third_party/xbox_sdk/lib -lxcompress64 \
-L$$OUT_PWD/../libs/core -lcore \
-L$$OUT_PWD/../libs/encryption -lencryption
INCLUDEPATH += \
$$PWD/../../third_party/xbox_sdk/include \
$$PWD/../core \
$$PWD/../encryption
DEPENDPATH += \
$$PWD/../../third_party/xbox_sdk/include \
$$PWD/../core \
$$PWD/../encryption
DESTDIR = $$OUT_PWD/../

View File

@ -1,453 +0,0 @@
/* lzoconf.h -- configuration of the LZO data compression library
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library 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 General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
http://www.oberhumer.com/opensource/lzo/
*/
#ifndef __LZOCONF_H_INCLUDED
#define __LZOCONF_H_INCLUDED 1
#define LZO_VERSION 0x20a0 /* 2.10 */
#define LZO_VERSION_STRING "2.10"
#define LZO_VERSION_DATE "Mar 01 2017"
/* internal Autoconf configuration file - only used when building LZO */
#if defined(LZO_HAVE_CONFIG_H)
# include <config.h>
#endif
#include <limits.h>
#include <stddef.h>
/***********************************************************************
// LZO requires a conforming <limits.h>
************************************************************************/
#if !defined(CHAR_BIT) || (CHAR_BIT != 8)
# error "invalid CHAR_BIT"
#endif
#if !defined(UCHAR_MAX) || !defined(USHRT_MAX) || !defined(UINT_MAX) || !defined(ULONG_MAX)
# error "check your compiler installation"
#endif
#if (USHRT_MAX < 1) || (UINT_MAX < 1) || (ULONG_MAX < 1)
# error "your limits.h macros are broken"
#endif
/* get OS and architecture defines */
#ifndef __LZODEFS_H_INCLUDED
#include <lzodefs.h>
#endif
#ifdef __cplusplus
extern "C" {
#endif
/***********************************************************************
// some core defines
************************************************************************/
/* memory checkers */
#if !defined(__LZO_CHECKER)
# if defined(__BOUNDS_CHECKING_ON)
# define __LZO_CHECKER 1
# elif defined(__CHECKER__)
# define __LZO_CHECKER 1
# elif defined(__INSURE__)
# define __LZO_CHECKER 1
# elif defined(__PURIFY__)
# define __LZO_CHECKER 1
# endif
#endif
/***********************************************************************
// integral and pointer types
************************************************************************/
/* lzo_uint must match size_t */
#if !defined(LZO_UINT_MAX)
# if (LZO_ABI_LLP64)
# if (LZO_OS_WIN64)
typedef unsigned __int64 lzo_uint;
typedef __int64 lzo_int;
# define LZO_TYPEOF_LZO_INT LZO_TYPEOF___INT64
# else
typedef lzo_ullong_t lzo_uint;
typedef lzo_llong_t lzo_int;
# define LZO_TYPEOF_LZO_INT LZO_TYPEOF_LONG_LONG
# endif
# define LZO_SIZEOF_LZO_INT 8
# define LZO_UINT_MAX 0xffffffffffffffffull
# define LZO_INT_MAX 9223372036854775807LL
# define LZO_INT_MIN (-1LL - LZO_INT_MAX)
# elif (LZO_ABI_IP32L64) /* MIPS R5900 */
typedef quint32 lzo_uint;
typedef int lzo_int;
# define LZO_SIZEOF_LZO_INT LZO_SIZEOF_INT
# define LZO_TYPEOF_LZO_INT LZO_TYPEOF_INT
# define LZO_UINT_MAX UINT_MAX
# define LZO_INT_MAX INT_MAX
# define LZO_INT_MIN INT_MIN
# elif (ULONG_MAX >= LZO_0xffffffffL)
typedef unsigned long lzo_uint;
typedef long lzo_int;
# define LZO_SIZEOF_LZO_INT LZO_SIZEOF_LONG
# define LZO_TYPEOF_LZO_INT LZO_TYPEOF_LONG
# define LZO_UINT_MAX ULONG_MAX
# define LZO_INT_MAX LONG_MAX
# define LZO_INT_MIN LONG_MIN
# else
# error "lzo_uint"
# endif
#endif
/* The larger type of lzo_uint and lzo_uint32_t. */
#if (LZO_SIZEOF_LZO_INT >= 4)
# define lzo_xint lzo_uint
#else
# define lzo_xint lzo_uint32_t
#endif
typedef int lzo_bool;
/* sanity checks */
LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_int) == LZO_SIZEOF_LZO_INT)
LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint) == LZO_SIZEOF_LZO_INT)
LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_xint) >= sizeof(lzo_uint))
LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_xint) >= sizeof(lzo_uint32_t))
#ifndef __LZO_MMODEL
#define __LZO_MMODEL /*empty*/
#endif
/* no typedef here because of const-pointer issues */
#define lzo_bytep unsigned char __LZO_MMODEL *
#define lzo_charp char __LZO_MMODEL *
#define lzo_voidp void __LZO_MMODEL *
#define lzo_shortp short __LZO_MMODEL *
#define lzo_ushortp unsigned short __LZO_MMODEL *
#define lzo_intp lzo_int __LZO_MMODEL *
#define lzo_uintp lzo_uint __LZO_MMODEL *
#define lzo_xintp lzo_xint __LZO_MMODEL *
#define lzo_voidpp lzo_voidp __LZO_MMODEL *
#define lzo_bytepp lzo_bytep __LZO_MMODEL *
#define lzo_int8_tp lzo_int8_t __LZO_MMODEL *
#define lzo_uint8_tp lzo_uint8_t __LZO_MMODEL *
#define lzo_int16_tp lzo_int16_t __LZO_MMODEL *
#define lzo_uint16_tp lzo_uint16_t __LZO_MMODEL *
#define lzo_int32_tp lzo_int32_t __LZO_MMODEL *
#define lzo_uint32_tp lzo_uint32_t __LZO_MMODEL *
#if defined(lzo_int64_t)
#define lzo_int64_tp lzo_int64_t __LZO_MMODEL *
#define lzo_uint64_tp lzo_uint64_t __LZO_MMODEL *
#endif
/* Older LZO versions used to support ancient systems and memory models
* such as 16-bit MSDOS with __huge pointers or Cray PVP, but these
* obsolete configurations are not supported any longer.
*/
#if defined(__LZO_MMODEL_HUGE)
#error "__LZO_MMODEL_HUGE memory model is unsupported"
#endif
#if (LZO_MM_PVP)
#error "LZO_MM_PVP memory model is unsupported"
#endif
#if (LZO_SIZEOF_INT < 4)
#error "LZO_SIZEOF_INT < 4 is unsupported"
#endif
#if (__LZO_UINTPTR_T_IS_POINTER)
#error "__LZO_UINTPTR_T_IS_POINTER is unsupported"
#endif
LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(int) >= 4)
LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint) >= 4)
/* Strange configurations where sizeof(lzo_uint) != sizeof(size_t) should
* work but have not received much testing lately, so be strict here.
*/
LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint) == sizeof(size_t))
LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint) == sizeof(ptrdiff_t))
LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint) == sizeof(lzo_uintptr_t))
LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(void *) == sizeof(lzo_uintptr_t))
LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(char *) == sizeof(lzo_uintptr_t))
LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(long *) == sizeof(lzo_uintptr_t))
LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(void *) == sizeof(lzo_voidp))
LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(char *) == sizeof(lzo_bytep))
/***********************************************************************
// function types
************************************************************************/
/* name mangling */
#if !defined(__LZO_EXTERN_C)
# ifdef __cplusplus
# define __LZO_EXTERN_C extern "C"
# else
# define __LZO_EXTERN_C extern
# endif
#endif
/* calling convention */
#if !defined(__LZO_CDECL)
# define __LZO_CDECL __lzo_cdecl
#endif
/* DLL export information */
#if !defined(__LZO_EXPORT1)
# define __LZO_EXPORT1 /*empty*/
#endif
#if !defined(__LZO_EXPORT2)
# define __LZO_EXPORT2 /*empty*/
#endif
/* __cdecl calling convention for public C and assembly functions */
#if !defined(LZO_PUBLIC)
# define LZO_PUBLIC(r) __LZO_EXPORT1 r __LZO_EXPORT2 __LZO_CDECL
#endif
#if !defined(LZO_EXTERN)
# define LZO_EXTERN(r) __LZO_EXTERN_C LZO_PUBLIC(r)
#endif
#if !defined(LZO_PRIVATE)
# define LZO_PRIVATE(r) static r __LZO_CDECL
#endif
/* function types */
typedef int
(__LZO_CDECL *lzo_compress_t) ( const lzo_bytep src, lzo_uint src_len,
lzo_bytep dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
typedef int
(__LZO_CDECL *lzo_decompress_t) ( const lzo_bytep src, lzo_uint src_len,
lzo_bytep dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
typedef int
(__LZO_CDECL *lzo_optimize_t) ( lzo_bytep src, lzo_uint src_len,
lzo_bytep dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
typedef int
(__LZO_CDECL *lzo_compress_dict_t)(const lzo_bytep src, lzo_uint src_len,
lzo_bytep dst, lzo_uintp dst_len,
lzo_voidp wrkmem,
const lzo_bytep dict, lzo_uint dict_len );
typedef int
(__LZO_CDECL *lzo_decompress_dict_t)(const lzo_bytep src, lzo_uint src_len,
lzo_bytep dst, lzo_uintp dst_len,
lzo_voidp wrkmem,
const lzo_bytep dict, lzo_uint dict_len );
/* Callback interface. Currently only the progress indicator ("nprogress")
* is used, but this may change in a future release. */
struct lzo_callback_t;
typedef struct lzo_callback_t lzo_callback_t;
#define lzo_callback_p lzo_callback_t __LZO_MMODEL *
/* malloc & free function types */
typedef lzo_voidp (__LZO_CDECL *lzo_alloc_func_t)
(lzo_callback_p self, lzo_uint items, lzo_uint size);
typedef void (__LZO_CDECL *lzo_free_func_t)
(lzo_callback_p self, lzo_voidp ptr);
/* a progress indicator callback function */
typedef void (__LZO_CDECL *lzo_progress_func_t)
(lzo_callback_p, lzo_uint, lzo_uint, int);
struct lzo_callback_t
{
/* custom allocators (set to 0 to disable) */
lzo_alloc_func_t nalloc; /* [not used right now] */
lzo_free_func_t nfree; /* [not used right now] */
/* a progress indicator callback function (set to 0 to disable) */
lzo_progress_func_t nprogress;
/* INFO: the first parameter "self" of the nalloc/nfree/nprogress
* callbacks points back to this struct, so you are free to store
* some extra info in the following variables. */
lzo_voidp user1;
lzo_xint user2;
lzo_xint user3;
};
/***********************************************************************
// error codes and prototypes
************************************************************************/
/* Error codes for the compression/decompression functions. Negative
* values are errors, positive values will be used for special but
* normal events.
*/
#define LZO_E_OK 0
#define LZO_E_ERROR (-1)
#define LZO_E_OUT_OF_MEMORY (-2) /* [lzo_alloc_func_t failure] */
#define LZO_E_NOT_COMPRESSIBLE (-3) /* [not used right now] */
#define LZO_E_INPUT_OVERRUN (-4)
#define LZO_E_OUTPUT_OVERRUN (-5)
#define LZO_E_LOOKBEHIND_OVERRUN (-6)
#define LZO_E_EOF_NOT_FOUND (-7)
#define LZO_E_INPUT_NOT_CONSUMED (-8)
#define LZO_E_NOT_YET_IMPLEMENTED (-9) /* [not used right now] */
#define LZO_E_INVALID_ARGUMENT (-10)
#define LZO_E_INVALID_ALIGNMENT (-11) /* pointer argument is not properly aligned */
#define LZO_E_OUTPUT_NOT_CONSUMED (-12)
#define LZO_E_INTERNAL_ERROR (-99)
#ifndef lzo_sizeof_dict_t
# define lzo_sizeof_dict_t ((unsigned)sizeof(lzo_bytep))
#endif
/* lzo_init() should be the first function you call.
* Check the return code !
*
* lzo_init() is a macro to allow checking that the library and the
* compiler's view of various types are consistent.
*/
#define lzo_init() __lzo_init_v2(LZO_VERSION,(int)sizeof(short),(int)sizeof(int),\
(int)sizeof(long),(int)sizeof(lzo_uint32_t),(int)sizeof(lzo_uint),\
(int)lzo_sizeof_dict_t,(int)sizeof(char *),(int)sizeof(lzo_voidp),\
(int)sizeof(lzo_callback_t))
LZO_EXTERN(int) __lzo_init_v2(unsigned,int,int,int,int,int,int,int,int,int);
/* version functions (useful for shared libraries) */
LZO_EXTERN(unsigned) lzo_version(void);
LZO_EXTERN(const char *) lzo_version_string(void);
LZO_EXTERN(const char *) lzo_version_date(void);
LZO_EXTERN(const lzo_charp) _lzo_version_string(void);
LZO_EXTERN(const lzo_charp) _lzo_version_date(void);
/* string functions */
LZO_EXTERN(int)
lzo_memcmp(const lzo_voidp a, const lzo_voidp b, lzo_uint len);
LZO_EXTERN(lzo_voidp)
lzo_memcpy(lzo_voidp dst, const lzo_voidp src, lzo_uint len);
LZO_EXTERN(lzo_voidp)
lzo_memmove(lzo_voidp dst, const lzo_voidp src, lzo_uint len);
LZO_EXTERN(lzo_voidp)
lzo_memset(lzo_voidp buf, int c, lzo_uint len);
/* checksum functions */
LZO_EXTERN(lzo_uint32_t)
lzo_adler32(lzo_uint32_t c, const lzo_bytep buf, lzo_uint len);
LZO_EXTERN(lzo_uint32_t)
lzo_crc32(lzo_uint32_t c, const lzo_bytep buf, lzo_uint len);
LZO_EXTERN(const lzo_uint32_tp)
lzo_get_crc32_table(void);
/* misc. */
LZO_EXTERN(int) _lzo_config_check(void);
typedef union {
lzo_voidp a00; lzo_bytep a01; lzo_uint a02; lzo_xint a03; lzo_uintptr_t a04;
void *a05; unsigned char *a06; unsigned long a07; size_t a08; ptrdiff_t a09;
#if defined(lzo_int64_t)
lzo_uint64_t a10;
#endif
} lzo_align_t;
/* align a char pointer on a boundary that is a multiple of 'size' */
LZO_EXTERN(unsigned) __lzo_align_gap(const lzo_voidp p, lzo_uint size);
#define LZO_PTR_ALIGN_UP(p,size) \
((p) + (lzo_uint) __lzo_align_gap((const lzo_voidp)(p),(lzo_uint)(size)))
/***********************************************************************
// deprecated macros - only for backward compatibility
************************************************************************/
/* deprecated - use 'lzo_bytep' instead of 'lzo_byte *' */
#define lzo_byte unsigned char
/* deprecated type names */
#define lzo_int32 lzo_int32_t
#define lzo_uint32 lzo_uint32_t
#define lzo_int32p lzo_int32_t __LZO_MMODEL *
#define lzo_uint32p lzo_uint32_t __LZO_MMODEL *
#define LZO_INT32_MAX LZO_INT32_C(2147483647)
#define LZO_UINT32_MAX LZO_UINT32_C(4294967295)
#if defined(lzo_int64_t)
#define lzo_int64 lzo_int64_t
#define lzo_uint64 lzo_uint64_t
#define lzo_int64p lzo_int64_t __LZO_MMODEL *
#define lzo_uint64p lzo_uint64_t __LZO_MMODEL *
#define LZO_INT64_MAX LZO_INT64_C(9223372036854775807)
#define LZO_UINT64_MAX LZO_UINT64_C(18446744073709551615)
#endif
/* deprecated types */
typedef union { lzo_bytep a; lzo_uint b; } __lzo_pu_u;
typedef union { lzo_bytep a; lzo_uint32_t b; } __lzo_pu32_u;
/* deprecated defines */
#if !defined(LZO_SIZEOF_LZO_UINT)
# define LZO_SIZEOF_LZO_UINT LZO_SIZEOF_LZO_INT
#endif
#if defined(LZO_CFG_COMPAT)
#define __LZOCONF_H 1
#if defined(LZO_ARCH_I086)
# define __LZO_i386 1
#elif defined(LZO_ARCH_I386)
# define __LZO_i386 1
#endif
#if defined(LZO_OS_DOS16)
# define __LZO_DOS 1
# define __LZO_DOS16 1
#elif defined(LZO_OS_DOS32)
# define __LZO_DOS 1
#elif defined(LZO_OS_WIN16)
# define __LZO_WIN 1
# define __LZO_WIN16 1
#elif defined(LZO_OS_WIN32)
# define __LZO_WIN 1
#endif
#define __LZO_CMODEL /*empty*/
#define __LZO_DMODEL /*empty*/
#define __LZO_ENTRY __LZO_CDECL
#define LZO_EXTERN_CDECL LZO_EXTERN
#define LZO_ALIGN LZO_PTR_ALIGN_UP
#define lzo_compress_asm_t lzo_compress_t
#define lzo_decompress_asm_t lzo_decompress_t
#endif /* LZO_CFG_COMPAT */
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* already included */
/* vim:set ts=4 sw=4 et: */

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More