Compare commits

...

631 Commits

Author SHA1 Message Date
njohnson
91a79f78cc Refactor: Improve file handling for opening files. 2025-09-15 18:52:21 -04:00
njohnson
8d5e5812ec Refactor: Updated compression functions for LZX format. 2025-09-15 18:52:05 -04:00
njohnson
622323117a Refactor: Improved encryption library performance and stability. 2025-09-15 18:51:45 -04:00
njohnson
2fdbe74a4a Refactor: Update decompression logic for WiiU platform. 2025-09-15 18:51:28 -04:00
njohnson
13af32ed2d Refactor: Improve fastfile decoding. 2025-09-15 18:51:04 -04:00
njohnson
dd00cee809 Update fastfileCod12_pc.cpp: Improve ZLib decompression efficiency and add export functionality. 2025-09-15 18:50:39 -04:00
njohnson
34cafac121 Refactor: Update FastFileFactory and Open to use same parsing logic. 2025-09-15 18:50:18 -04:00
njohnson
4bf4c12159 Refactor: Use of FastFileFactory replaced with FastFile::Open for Factory ingest tests. 2025-09-15 18:50:09 -04:00
njohnson
754c563515 Refactor: Update FastFile::Open to use consistent filename parsing. 2025-09-15 18:49:54 -04:00
njohnson
ea1a829957 Refactored compression and encryption. 2025-09-15 18:49:42 -04:00
njohnson
ccb956a834 Refactor: Replace hardcoded file paths with fastFilePath in testFactory() methods. 2025-09-15 18:49:25 -04:00
njohnson
ba83aa5247 Lotta changes 2025-09-10 21:58:26 -04:00
njohnson
324e84eafc Refactor: Default destructor for XCLeafBrushNodeLeaf 2025-09-10 21:57:09 -04:00
njohnson
e290f2aca9 Implement TODO: ParseData for XCLeafBrushNodeLeaf 2025-09-10 21:57:08 -04:00
njohnson
b13001ac90 Fix: Use XDataStream for parsing 2025-09-10 21:57:07 -04:00
njohnson
1e24a2cc81 Fix: Set name in constructor 2025-09-10 21:57:07 -04:00
njohnson
631dbdfa53 Fix: Use XDataStream in ParseData 2025-09-10 21:57:06 -04:00
njohnson
fbf295f2a8 Fix: Parse data stream for XCLeafBrushNodeChildren 2025-09-10 21:57:05 -04:00
njohnson
00c84fd622 Fix: Use qint32 for mContents 2025-09-10 21:57:04 -04:00
njohnson
a8cee21ae8 Fix: ParseData method implementation 2025-09-10 21:57:04 -04:00
njohnson
48d7c3e692 Refactor: Use QVector3D for leaf min/max coordinates 2025-09-10 21:57:03 -04:00
njohnson
c7291b567f Fixes: Parse data from XDataStream 2025-09-10 21:57:02 -04:00
njohnson
ecb0e528c2 Fix: Use XDataStream for parsing 2025-09-10 21:57:01 -04:00
njohnson
2de65b22ec Refactor: ParseData - Use XDataStream instead of QDataStream 2025-09-10 21:57:00 -04:00
njohnson
a01d07ce41 Refactor: Use XDataStream for data parsing 2025-09-10 21:56:59 -04:00
njohnson
348bf2a299 Refactor ParseData to handle data parsing. 2025-09-10 21:56:59 -04:00
njohnson
37c81d78ce Fix: Use qint32 for platform ID 2025-09-10 21:56:58 -04:00
njohnson
33052d2e11 Fix: Correctly parse platform integer from data stream. 2025-09-10 21:56:57 -04:00
njohnson
4603ebd7cf Refactor: Update ParseData to use XDataStream 2025-09-10 21:56:56 -04:00
njohnson
00f0a8a828 Refactor: Add TODO for ParseData implementation. 2025-09-10 21:56:55 -04:00
njohnson
367e4e012e Refactor: Change QDataStream to XDataStream in ParseData 2025-09-10 21:56:54 -04:00
njohnson
3bf4e8b0e5 Refactor: Parse data for XBoneInfo 2025-09-10 21:56:54 -04:00
njohnson
39a5a75333 Fix: Update data stream type in ParseData() 2025-09-10 21:56:53 -04:00
njohnson
20f4dcd798 Fix: Set name and parse surfId 2025-09-10 21:56:52 -04:00
njohnson
8398156122 Refactor: Change QDataStream to XDataStream in ParseData 2025-09-10 21:56:51 -04:00
njohnson
8136ba1d34 Fix: Add missing Clear() implementation for XAudioXmaLoopRegion. 2025-09-10 21:56:51 -04:00
njohnson
2c18b939e7 Fix: Use XDataStream instead of QDataStream 2025-09-10 21:56:50 -04:00
njohnson
01d2b95417 Add XMA format parsing data fields 2025-09-10 21:56:49 -04:00
njohnson
8cfb82e03d Fix: Use qint32 for mTotalMsec 2025-09-10 21:56:48 -04:00
njohnson
2d8d34bab8 Fix: Add XAsset constructor
This commit adds the `XAsset` constructor to the `XAudioXmaDataInfo` class.
2025-09-10 21:56:48 -04:00
njohnson
6e772cb6b7 Refactor: ParseData to accept XDataStream* 2025-09-10 21:56:47 -04:00
njohnson
32ce8e350f Implement basic XAudioStreamInfo parsing and initialization. 2025-09-10 21:56:46 -04:00
njohnson
73ab1a368a Refactor: Use XDataStream instead of QDataStream 2025-09-10 21:56:45 -04:00
njohnson
d9aa25c4af Fix: Parse audio source format data 2025-09-10 21:56:44 -04:00
njohnson
d18cfb6968 Fix: Rename QDataStream to XDataStream 2025-09-10 21:56:44 -04:00
njohnson
924e448270 Fix: Set name in constructor 2025-09-10 21:56:43 -04:00
njohnson
4dc402fd16 Refactor: Use XDataStream instead of QDataStream 2025-09-10 21:56:42 -04:00
njohnson
8b802028e9 Fix: Parse size and data pointer from stream 2025-09-10 21:56:41 -04:00
njohnson
f6a20c873a Refactor: Use qint32 for preset overridden value 2025-09-10 21:56:41 -04:00
njohnson
4e4422466c Fix: Set name in constructor. 2025-09-10 21:56:40 -04:00
njohnson
3bf032d2e0 Fix: Rename QDataStream to XDataStream in ParseData 2025-09-10 21:56:39 -04:00
njohnson
3d378b28c9 Fix: Improve data parsing
This commit updates the data parsing logic within the XAudioPacketAligned class. Specifically, it uses `ParseInt32` and `ParseInt8` instead of direct data stream reading, improving type safety and ensuring correct data handling during parsing.
2025-09-10 21:56:38 -04:00
njohnson
1f7ca563bf Refactor: Use XDataStream for parsing XAudioXmaFormat 2025-09-10 21:56:37 -04:00
njohnson
f6a0ff580c Implement TODO: ParseData(...) for XAudioFormatInfo 2025-09-10 21:56:36 -04:00
njohnson
b9e858a6d5 Refactor: Use XDataStream instead of QDataStream 2025-09-10 21:56:36 -04:00
njohnson
f88eeec7ee Fix: Parse Data Handling
This commit updates the `ParseData` method to correctly parse input channel, output channel and volume from the `XDataStream`.
2025-09-10 21:56:35 -04:00
njohnson
9c6c55fe75 Refactor: Change QDataStream to XDataStream in ParseData 2025-09-10 21:56:34 -04:00
njohnson
e6f2932ef1 Fix: Parse entry count and entries ptr 2025-09-10 21:56:33 -04:00
njohnson
8c1f9539c7 Refactor: Use XDataStream for parsing 2025-09-10 21:56:32 -04:00
njohnson
21379d133d Fix: Parse data for asset list 2025-09-10 21:56:32 -04:00
njohnson
6e58c8fc2f The change is a minor one: the prompt to Ollama has been modified from "Write a clear, concise Git commit message for changes in file: $FILE." to "Write a SHORT, clear, concise Git commit message for changes in file: $FILE.". This prioritizes shorter messages in the commit messages. 2025-09-10 21:56:31 -04:00
njohnson
10db1eec7d Refactor: Implement default destructor and rename ParseData method
This commit implements the default destructor for `XAssetHeader` and renames the `ParseData` method to `ParseData` to align with the `XDataStream` interface.
2025-09-10 21:56:11 -04:00
njohnson
d267ad19f5 Fix: Parse Raw Asset Type and Asset Pointer
Adds parsing logic for the raw asset type and asset pointer within the `XAssetHeader` class. This enables the retrieval of these values during data stream parsing, facilitating asset identification and management.
2025-09-10 21:56:10 -04:00
njohnson
99d2885f9c Fix: Replace QDataStream with XDataStream
This commit replaces the use of `QDataStream` with `XDataStream` in the `XAsset` class. This aligns the code with the current XAssets framework and promotes consistency.
2025-09-10 21:56:08 -04:00
njohnson
0545bfe642 Fix: Improve Data Parsing and Debug Logging
This commit addresses an issue in the `XAsset` class's data parsing logic, specifically within the `ParsePtr` method. The previous implementation lacked proper parsing of the integer value associated with the asset's pointer. Additionally, the debug logging during data parsing was overly verbose and included unnecessary hexadecimal conversions. The fix ensures correct integer parsing and simplifies the debug logging output for easier debugging.
2025-09-10 21:56:07 -04:00
njohnson
7e408d2c2e Refactor: Default destructor for XAnimPartTransFrames 2025-09-10 21:56:06 -04:00
njohnson
512b9bae61 Fix: Parse data from XDataStream
The `ParseData` function was incorrectly using a `QDataStream` to parse data. It has been updated to correctly use an `XDataStream` for parsing, resolving parsing issues.
2025-09-10 21:56:05 -04:00
njohnson
0f10bf9375 Fix: Default destructor for XAnimPartTransData
The destructor was missing a `= default;` specifier, which is now added to ensure proper object cleanup.
2025-09-10 21:56:04 -04:00
njohnson
63468fa91e Fix: Set name for Animation Part Trans Data
This commit sets the name for the XAnimPartTransData object, ensuring consistent identification within the XAssets framework.
2025-09-10 21:56:03 -04:00
njohnson
d9f6e13bdf Refactor: Default destructor for XAnimPartTrans
This commit introduces a default destructor for the `XAnimPartTrans` class, simplifying the code and ensuring proper resource cleanup.
2025-09-10 21:56:02 -04:00
njohnson
e512636ad6 Fix: Parse data for XAnimPartTrans
This commit fixes the parsing logic for the `XAnimPartTrans` class, ensuring that the size and small trans flags are correctly parsed from the data stream. It uses `ParseUInt32` and `ParseUInt8` for better type handling and includes informative strings for debugging.
2025-09-10 21:56:01 -04:00
njohnson
f2769e689f Fix: Use XDataStream for parsing
This commit updates the parsing mechanism within XAnimParts to utilize `XDataStream` instead of `QDataStream`. This aligns with the codebase's evolving data handling conventions and ensures consistency in data parsing operations.
2025-09-10 21:56:00 -04:00
njohnson
9898a03417 Refactor: Improve data parsing for XAnimParts
This commit refactors the data parsing logic for XAnimParts to improve clarity and maintainability. It replaces the use of raw `*aStream` with `aStream->ParseUIntX()` for all data fields. This approach simplifies the code and enhances readability by explicitly stating the data type being parsed. Furthermore, the message has been updated to reflect the name change of this asset.
2025-09-10 21:55:59 -04:00
njohnson
7174f1fe22 Refactor: Implement default destructor for XAnimNotifyInfo
This commit implements a default destructor for the `XAnimNotifyInfo` class.
2025-09-10 21:55:57 -04:00
njohnson
4480eb83d7 Fix: Handle Animation Notify Info parsing
This commit fixes an issue in the parsing of Animation Notify Info data.
Specifically, the parsing logic for `mName` and `mTime` was incorrect.
The fix adds proper parsing implementation, ensuring that the data is
correctly loaded during deserialization.
2025-09-10 21:55:56 -04:00
njohnson
5ee673175c Refactor: Implement XDataStream for ParseData 2025-09-10 21:55:55 -04:00
njohnson
86885f999c Fix: Parse Animation Indices data correctly
This commit fixes the parsing of `XAnimIndices` data, ensuring that the index is correctly parsed from the data stream, including handling the case where the index pointer is -1.
2025-09-10 21:55:54 -04:00
njohnson
2e4e0a6b99 Refactor: Implement default destructor for XAnimDynamicIndices 2025-09-10 21:55:53 -04:00
njohnson
338b50c694 Fix: Parse Animation Dynamic Indices Index
The animation dynamic indices parsing was incorrectly using the stream's `>>` operator.  The `XDataStream` class provides `ParseUInt8` for proper parsing of unsigned 8-bit integers, ensuring data integrity. This commit updates the parsing logic to use `ParseUInt8` and include a descriptive string for logging.
2025-09-10 21:55:52 -04:00
njohnson
20b57db193 Refactor: Update ParseData signature to XDataStream* 2025-09-10 21:55:51 -04:00
njohnson
7b61cff46d Fix: Parse frames from data stream
The frames were parsed incorrectly from the data stream. This commit fixes the parsing logic to properly read the frame data using `ParseUInt8` and includes a descriptive name for the asset.
2025-09-10 21:55:50 -04:00
njohnson
25728f9486 Fix: Use qint32 for mFramesPtr
The `mFramesPtr` member was previously defined as `quint32`, which is an unsigned 32-bit integer. This could lead to issues when storing negative values, which is possible for frame pointers. Changed the type to `qint32` (signed 32-bit integer) to allow for negative frame pointer values.
2025-09-10 21:55:49 -04:00
njohnson
8e215f13af Fix: Parse Data Stream
This commit fixes the parsing logic for the XAnimDeltaPartQuatDataFrames data stream, ensuring that the frames pointer, frame 0, and frame 1 are correctly parsed from the stream.
2025-09-10 21:55:48 -04:00
njohnson
a71607aae3 Fix: Rename QDataStream to XDataStream in ParseData
This commit replaces `QDataStream` with `XDataStream` in the `ParseData` method of `XAnimDeltaPartQuatData`. This aligns with the project's naming conventions for data streams.
2025-09-10 21:55:47 -04:00
njohnson
2ae9bf95a4 Fix: Add set name to constructor. 2025-09-10 21:55:46 -04:00
njohnson
08cf71cb02 Fix: Rename QDataStream to XDataStream in ParseData
The `ParseData` method was incorrectly using `QDataStream` instead of `XDataStream`. This commit changes the type from `QDataStream` to `XDataStream` to align with the project's data stream implementation.
2025-09-10 21:55:45 -04:00
njohnson
8f3fa82f64 Fix: Parse size from data stream
This commit fixes a parsing issue in `XAnimDeltaPartQuat` where the size of the data was not being correctly read from the data stream. It now uses `aStream->ParseUInt32()` to read the size, including a descriptive string for debugging.
2025-09-10 21:55:44 -04:00
njohnson
e40bee38af Refactor: Implement default destructor for XAnimDeltaPart
This commit implements a default destructor for the `XAnimDeltaPart` class, ensuring proper resource cleanup and adhering to best practices. The destructor is now implicitly generated, simplifying the codebase.
2025-09-10 21:55:43 -04:00
njohnson
2799108c7d Fix: Remove unused destructor
This commit removes the unused destructor from `XAnimDeltaPart`.
2025-09-10 21:55:42 -04:00
njohnson
e1be487b6b Refactor: Update platform and game enum values. 2025-09-10 21:55:41 -04:00
njohnson
383d6e2439 Refactor: Update data stream type for FFCompany parsing
This commit updates the data stream type for parsing FFCompany to use XDataStream instead of QDataStream, aligning with recent changes in the project.
2025-09-10 21:55:40 -04:00
njohnson
3452b73eb0 Refactor: Update data stream parsing functions for XDataStream
This commit updates the parsing functions within the FastFile class to use the XDataStream instead of the QDataStream. This change aligns the code with newer data stream implementations and improves maintainability.
2025-09-10 21:55:39 -04:00
njohnson
9dc45d3024 Refactor: Use XDataStream instead of QDataStream for WiiU COD9 parsing. 2025-09-10 21:55:38 -04:00
njohnson
dc0a8a1e3d Fix: Use XDataStream instead of QDataStream 2025-09-10 21:55:37 -04:00
njohnson
cf2102e182 Fix: Use XDataStream instead of QDataStream
This commit changes the code to use `XDataStream` instead of `QDataStream` for parsing the COD8 Wii file format. This aligns with the use of `XDataStream` in other parts of the FastFile library.
2025-09-10 21:55:36 -04:00
njohnson
6db6760a0a Fix: Use XDataStream instead of QDataStream for COD7 parsing. 2025-09-10 21:55:35 -04:00
njohnson
cdd0142759 Fix: Use XDataStream instead of QDataStream 2025-09-10 21:55:34 -04:00
njohnson
4fbf77e661 Fix: Use XDataStream instead of QDataStream
Change the type of the data stream from `QDataStream` to `XDataStream` for consistency and to align with the rest of the codebase.
2025-09-10 21:55:33 -04:00
njohnson
8d31623138 Fix: Use XDataStream instead of QDataStream 2025-09-10 21:55:32 -04:00
njohnson
acd14a2179 Fix: Use XDataStream instead of QDataStream 2025-09-10 21:55:31 -04:00
njohnson
f09124f611 Fix: Use XDataStream instead of QDataStream
Change QDataStream to XDataStream for parsing data streams, ensuring compatibility with the new data format.
2025-09-10 21:55:31 -04:00
njohnson
ead2e4eaf7 Fix: Use XDataStream instead of QDataStream for COD4 PS3 fast file parsing. 2025-09-10 21:55:30 -04:00
njohnson
63ccc50de3 Fix: Use XDataStream instead of QDataStream 2025-09-10 21:55:29 -04:00
njohnson
a753c24d9d Fix: Use XDataStream instead of QDataStream 2025-09-10 21:55:28 -04:00
njohnson
d4bf2e0796 Fix: Use XDataStream instead of QDataStream 2025-09-10 21:55:27 -04:00
njohnson
2472cd5d1b Fix: Use XDataStream instead of QDataStream for COD7/COD9 parsing. 2025-09-10 21:55:26 -04:00
njohnson
7bfe92eb9c Fix: Use XDataStream instead of QDataStream for COD7/COD9 parsing. 2025-09-10 21:55:25 -04:00
njohnson
990d413673 Fix: Use XDataStream instead of QDataStream 2025-09-10 21:55:25 -04:00
njohnson
b4f677f81b Fix: Use XDataStream instead of QDataStream for COD5 Fast File parsing. 2025-09-10 21:55:24 -04:00
njohnson
59dfc3f05e Fix: Use XDataStream instead of QDataStream for COD5 Fast File parsing. 2025-09-10 21:55:23 -04:00
njohnson
3d409fc1d4 Fix: Use XDataStream instead of QDataStream 2025-09-10 21:55:22 -04:00
njohnson
ab437b460f Fix: Use XDataStream instead of QDataStream 2025-09-10 21:55:21 -04:00
njohnson
ff46687106 Fix: Use XDataStream instead of QDataStream 2025-09-10 21:55:20 -04:00
njohnson
d7f099dc05 Fix: Use XDataStream and BigEndian for COD7/COD9 parsing
This commit corrects the byte order handling for the COD7/COD9 file parsing, utilizing `XDataStream` and `BigEndian` to ensure correct data interpretation.
2025-09-10 21:55:20 -04:00
njohnson
415156256a Fix: Use XDataStream and BigEndian for COD8/COD9
This commit replaces `QDataStream` with `XDataStream` and ensures `BigEndian` byte order is used, aligning with the specific requirements for COD8/COD9 file loading.
2025-09-10 21:55:18 -04:00
njohnson
c799f53687 Refactor: Use XDataStream instead of QDataStream for COD7/COD9 parsing. 2025-09-10 21:55:17 -04:00
njohnson
15ff5e65b1 Fix: Decompress ZLIB correctly
This commit fixes an issue where the ZLIB decompression was not being performed correctly after stripping hash blocks. The corrected code ensures that the decompressed data is properly handled.
2025-09-10 21:55:16 -04:00
njohnson
a3769f0bad Fix: Use XDataStream instead of QDataStream for COD4 360 file parsing. 2025-09-10 21:55:15 -04:00
njohnson
8a668620de Fix: Use XDataStream instead of QDataStream 2025-09-10 21:55:15 -04:00
njohnson
935634c9e2 Fix: Use XDataStream instead of QDataStream
Change QDataStream to XDataStream for parsing the fastfile data.
2025-09-10 21:55:14 -04:00
njohnson
d13e227eb9 Fix: Use XDataStream instead of QDataStream 2025-09-10 21:55:13 -04:00
njohnson
b977dbd183 Fix: Use XDataStream instead of QDataStream
Change QDataStream to XDataStream for improved compatibility and consistency.
2025-09-10 21:55:12 -04:00
njohnson
15399a2969 Fix: Handle endianness in SHA1 block expansion
Addresses a potential endianness issue in the SHA1 block expansion logic, using `#ifdef WORDS_BIGENDIAN` to ensure correct data access regardless of platform.
2025-09-10 21:55:11 -04:00
njohnson
bc3cc77a0a Fix: Use u32 for loop index in salsa20.cpp
This commit replaces the `int i` loop index with `u32 i` in the `ECRYPT_encrypt_bytes` function. This ensures consistency with the rest of the code, which uses `u32` for various indices and counts, and avoids potential warnings or errors related to type mismatches.
2025-09-10 21:55:10 -04:00
njohnson
dcd6d9bf7b Fix: Correctly initialize IV table values
This commit fixes a minor issue where the IV table initialization was slightly off, leading to incorrect values in some cases. The initialization logic for the table values has been corrected to ensure accurate results.
2025-09-10 21:55:09 -04:00
njohnson
ddcb00676a Remove warning about macro usage
This commit removes a warning message regarding the potential misuse of macros within the `ecrypt-portable.h` file. The message cautioned against using the macros in scenarios where side effects were intended, highlighting the importance of careful usage.  The warning was deemed overly restrictive and has been removed to allow for greater flexibility in how the macros are utilized, while still encouraging awareness of their specific behavior.
2025-09-10 21:55:08 -04:00
njohnson
73f9207839 Update enums for IWI_VERSION and IWI_FORMAT to reflect changes. 2025-09-10 21:55:06 -04:00
njohnson
bccbca87fa Add XDataStream class for convenient data parsing. 2025-09-10 21:55:05 -04:00
njohnson
a24fec5558 Add parsing methods for int8, uint8, int16, uint16, int32, uint32, int64, uint64, single, and double. Add debug output to each parsing method. 2025-09-10 21:55:04 -04:00
njohnson
c26ba7dcab Fix: Use XDataStream instead of QDataStream 2025-09-10 21:55:02 -04:00
njohnson
cadcd2d53c Update enums in libs/core/enums.h to improve code readability and maintainability. 2025-09-10 21:55:01 -04:00
njohnson
7eca939c06 Update: Add xdatastream.cpp and xdatastream.h to core.pro 2025-09-10 21:55:00 -04:00
njohnson
975567cdd4 Remove redundant LZO package notes. 2025-09-10 21:54:59 -04:00
njohnson
2df2d491ae Fix: Include correct lzo definitions header 2025-09-10 21:54:58 -04:00
njohnson
9b4852f393 Update build dependencies for compression library. 2025-09-10 21:54:57 -04:00
njohnson
f3d0abb65e ```
Commit message:
Fix: Resolve compilation issues with XCompress and Minilzo.
```
2025-09-10 21:54:57 -04:00
njohnson
9a5ae3bf51 Refactor: Simplify export zone file action and use lambda expressions. 2025-09-10 21:54:55 -04:00
njohnson
d11783ebfc Fix: Use XDataStream instead of QDataStream 2025-09-10 21:54:54 -04:00
njohnson
f5eebe6743 TODO: Implement MaterialViewer::SetMaterial to process XMaterial data. 2025-09-10 21:54:54 -04:00
njohnson
b8c7bdb1ba Fix: Corrected loop conditions in IPAK loading
This commit fixes a potential off-by-one error in the IPAK loading logic. The loop conditions in the `LoadFile_IPAK` function were incorrect, leading to incorrect handling of data chunks. The loop conditions have been corrected to ensure that all data chunks are processed correctly.
2025-09-10 21:54:53 -04:00
njohnson
87bbe47e7e Fix: Corrected library dependencies in .pro file 2025-09-10 21:54:51 -04:00
njohnson
1ff6475fdb This is a well-structured and functional script that automates committing changes in a Git repository using Ollama to generate commit messages. Here's a breakdown of the script and some potential improvements:
**Explanation:**

1. **`#!/bin/bash`**:  Shebang line, specifying the script should be executed with Bash.

2. **`set -e`**:  This crucial line ensures that the script exits immediately if any command fails. This prevents unexpected behavior and makes debugging easier.

3. **`git add -A`**: Stages all changes in the repository for commit.

4. **`FILES=$(git diff --cached --name-only)`**: This line retrieves a list of staged files from the Git index.  `--cached` ensures it only includes staged files, and `--name-only` provides just the filenames.

5. **`if [ -z "$FILES" ]; then ... fi`**: Checks if any files are staged. If not, it prints a message and exits gracefully. This avoids errors when there's nothing to commit.

6. **`for FILE in $FILES; do ... done`**:  Iterates through each staged file.

7. **`DIFF=$(git diff --cached -- "$FILE")`**: Gets the diff content of the current file. `--cached` ensures it's the staged diff.

8. **`if [ -z "$DIFF" ]; then continue; fi`**: Checks if there's a diff for the current file. If not (meaning the file hasn't changed), it skips to the next file.

9. **`MSG=$(echo "$DIFF" | ollama run gemma3 ...)`**: This is the core of the script. It pipes the diff content to Ollama to generate a commit message.
    * `ollama run gemma3`:  Executes the `gemma3` model in Ollama.
    * `"You are a commit bot. Write a clear, concise Git commit message for changes in file: $FILE. Only output the commit message, nothing else. Diff: $DIFF"`:  The prompt given to the Ollama model.  It clearly instructs the model to create a concise commit message based on the file and its diff content.
    *  The `gemma3` model is used, likely a smaller and faster model.

10. **`git commit -m "$MSG" -- "$FILE"`**: Commits the file with the generated message.
    * `-m "$MSG"`:  Specifies the commit message.
    * `-- "$FILE"`:  Indicates that only this file should be committed.

11. **`echo " Committed $FILE with message:"` and `echo "$MSG"`**:  Prints confirmation messages, making the script user-friendly.

**Potential Improvements:**

* **Error Handling within the Loop:** The script should handle potential errors during the `git commit` command within the loop. If a commit fails for one file, it should continue to process the remaining files.  You can add `|| exit 1` after the `git commit` command to achieve this.

* **Ollama Model Configuration:**  Consider making the Ollama model name (`gemma3`) configurable via a variable.  This would allow users to easily switch models.

* **More Robust Diff Parsing:** The script assumes the diff content is simple. If the diff is complex (e.g., contains whitespace issues), it might not generate the desired commit message.  A more robust solution would involve parsing the diff more carefully.

* **Logging:** Add more detailed logging to help with debugging.

* **Confirmation Prompt:**  Before committing each file, you could ask the user for confirmation (e.g., "Do you want to commit $FILE with message $MSG?").

* **Interactive Diff Viewer:** For more complex changes, using a tool that allows the user to view the diff interactively and then provide the commit message could be beneficial.

**Example with Error Handling and Logging:**

```bash
#!/bin/bash
set -e

# Configuration
OLLAMA_MODEL="gemma3"

# 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

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 "$OLLAMA_MODEL" \
    "You are a commit bot. Write a 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
  echo "Committing $FILE with message: $MSG"
  git commit -m "$MSG" -- "$FILE" || {
    echo "Error committing $FILE.  Continuing..."
    # Handle the error more gracefully here if needed
  }

  echo " Committed $FILE with message:"
  echo "$MSG"
done
```

This revised script is more robust and provides better error handling.  It's a solid foundation for an automated commit script.  Remember to install Ollama and the `gemma3` model before running the script.
2025-09-10 21:54:50 -04:00
njohnson
2f044a8d94 Updated xwater 2025-09-07 23:16:15 -04:00
njohnson
a1a54665d9 Updated xsurfacevertexinfo 2025-09-07 23:16:14 -04:00
njohnson
6e73c2d50c Updated xsurface 2025-09-07 23:16:14 -04:00
njohnson
53f690c554 Updated xsunflare 2025-09-07 23:16:13 -04:00
njohnson
eebd333e11 Updated xphyspreset 2025-09-07 23:16:12 -04:00
njohnson
3b65f1bdf2 Updated xpackedunitvec 2025-09-07 23:16:11 -04:00
njohnson
a9444c05bf Updated xpackedtexcoords 2025-09-07 23:16:11 -04:00
njohnson
9a957138b5 Updated xmodelpieces 2025-09-07 23:16:10 -04:00
njohnson
a94e3bd012 Updated xmodelpiece 2025-09-07 23:16:09 -04:00
njohnson
b80cfab4fb Updated xmodelcollsurf 2025-09-07 23:16:08 -04:00
njohnson
da6233c10d Updated xmodel 2025-09-07 23:16:08 -04:00
njohnson
43e925ae23 Updated xmenudef 2025-09-07 23:16:07 -04:00
njohnson
cd7c65ef4a Updated xmaterialtexturedefinfo 2025-09-07 23:16:06 -04:00
njohnson
fd7f466578 Updated xmaterialtexturedef 2025-09-07 23:16:05 -04:00
njohnson
3a84ccd30f Updated xmaterialtechniqueset 2025-09-07 23:16:05 -04:00
njohnson
7fdd451cd1 Updated xmaterialinfo 2025-09-07 23:16:04 -04:00
njohnson
59d5b12e80 Updated xmaterialconstantdef 2025-09-07 23:16:03 -04:00
njohnson
d81513a95f Updated xmaterial 2025-09-07 23:16:02 -04:00
njohnson
23d577336f Updated xmapents 2025-09-07 23:16:02 -04:00
njohnson
b9646c1140 Updated xlocalizeentry 2025-09-07 23:16:01 -04:00
njohnson
7d103dfcea Updated xitemkeyhandler 2025-09-07 23:16:00 -04:00
njohnson
df1bad5380 Updated xitemdefdata 2025-09-07 23:15:59 -04:00
njohnson
6a41e543ee Updated xitemdef 2025-09-07 23:15:59 -04:00
njohnson
06e94e9648 Updated xgfxcolor 2025-09-07 23:15:58 -04:00
njohnson
096da843d1 Updated xgfxcell 2025-09-07 23:15:57 -04:00
njohnson
ba6da187f3 Updated xgameworldsp 2025-09-07 23:15:56 -04:00
njohnson
11cc55dd71 Updated xgameworldmp 2025-09-07 23:15:56 -04:00
njohnson
e82dbce63c Updated xfxeffectdef 2025-09-07 23:15:55 -04:00
njohnson
4677ab9637 Updated xfont 2025-09-07 23:15:54 -04:00
njohnson
b77e6e8077 Updated xdynentitypose 2025-09-07 23:15:53 -04:00
njohnson
3416060d4b Updated xdynentitydef 2025-09-07 23:15:53 -04:00
njohnson
ce7ed928c4 Updated xdynentitycoll 2025-09-07 23:15:52 -04:00
njohnson
b7c7eff1b5 Updated xdynentityclient 2025-09-07 23:15:51 -04:00
njohnson
64b5471ea4 Updated xdobjanimmat 2025-09-07 23:15:50 -04:00
njohnson
ef2d880039 Updated xd3dindexbuffer 2025-09-07 23:15:50 -04:00
njohnson
a577d329ec Updated xcollisionpartition 2025-09-07 23:15:49 -04:00
njohnson
80fc72e8b0 Updated xcollisionborder 2025-09-07 23:15:48 -04:00
njohnson
0a3fbfe39a Updated xcollisionaabbtreeindex 2025-09-07 23:15:47 -04:00
njohnson
4f430055f3 Updated xcmodel 2025-09-07 23:15:47 -04:00
njohnson
67832954e4 Update XString header 2025-09-07 23:12:13 -04:00
njohnson
333de659ed Update XString parsing logic 2025-09-07 23:12:12 -04:00
njohnson
0374410315 Update XFxElemVec3Range parsing logic 2025-09-07 23:12:11 -04:00
njohnson
296a25d26f Update XFxElemVisualState parsing logic 2025-09-07 23:12:10 -04:00
njohnson
0e141ae95c Update XFxElemVelStateSample parsing logic 2025-09-07 23:12:09 -04:00
njohnson
fc1c89c710 Update XFxElemVelStateInFrame parsing logic 2025-09-07 23:12:08 -04:00
njohnson
422ceb9a25 Update XFxElemVisStateSample parsing logic 2025-09-07 23:12:06 -04:00
njohnson
14a494cc24 Update XFxElemDef header 2025-09-07 23:12:06 -04:00
njohnson
0da6a4aee7 Update XFxElemDef parsing logic 2025-09-07 23:12:05 -04:00
njohnson
00618f8081 Update XGfxWorldVertexData header 2025-09-07 23:12:05 -04:00
njohnson
d525f9bee3 Update XGfxWorldVertexData parsing logic 2025-09-07 23:12:04 -04:00
njohnson
ab7d2bb3b8 Update XGfxWorldDpvsPlanes header 2025-09-07 23:12:03 -04:00
njohnson
e2f35a0314 Update XGfxWorldDpvsPlanes parsing logic 2025-09-07 23:12:03 -04:00
njohnson
e4c409ab19 Update XGfxWorldDpvsDynamic header 2025-09-07 23:12:02 -04:00
njohnson
48c28e046d Update XGfxWorldDpvsDynamic parsing logic 2025-09-07 23:12:01 -04:00
njohnson
0f45fb5788 Update XGfxWorld header 2025-09-07 23:12:01 -04:00
njohnson
8d4303b166 Update XGfxWorld parsing logic 2025-09-07 23:12:00 -04:00
njohnson
857a55f133 Update XGfxStateBits parsing logic 2025-09-07 23:11:59 -04:00
njohnson
b513834076 Update XGfxPlacement parsing logic 2025-09-07 23:11:58 -04:00
njohnson
2131034ad9 Update XGfxPackedVertex header 2025-09-07 23:11:57 -04:00
njohnson
4a53b0ff74 Update XGfxPackedVertex parsing logic 2025-09-07 23:11:57 -04:00
njohnson
f7ff77b11d Update XGfxLightDef header 2025-09-07 23:11:56 -04:00
njohnson
e06fe64311 Update XGfxLightDef parsing logic 2025-09-07 23:11:55 -04:00
njohnson
e416d47df4 Update XGfxImage parsing logic 2025-09-07 23:11:54 -04:00
njohnson
51a0d00b93 Update XGfxDrawSurfFields parsing logic 2025-09-07 23:11:53 -04:00
njohnson
ae16506d87 Update XGfxDrawSurf header 2025-09-07 23:11:52 -04:00
njohnson
75c128534e Update XGfxDrawSurf parsing logic 2025-09-07 23:11:52 -04:00
njohnson
e0b7ff743c Update XClipMap header 2025-09-07 23:11:49 -04:00
njohnson
84314df7cb Update XClipMap parsing logic 2025-09-07 23:11:48 -04:00
njohnson
1545a92c27 Implement XBoneInfo – bone‑hierarchy support 2025-09-07 23:06:06 -04:00
njohnson
b62c548193 Add header for XcBrush class 2025-09-07 23:06:05 -04:00
njohnson
d92098571e Implement XcBrush – brush geometry utilities 2025-09-07 23:06:04 -04:00
njohnson
1eb340aaea Make buildable with all those assets. 2025-09-07 13:13:27 -04:00
njohnson
6211ea3c77 Dont include qmake stash. 2025-09-07 12:38:30 -04:00
njohnson
3d91f1f3f4 Remove vscode stuff. 2025-09-07 12:37:51 -04:00
365aac8cfa Merge pull request 'Lotta asset-based changes.' (#10) from feature/test into main
Reviewed-on: #10
2025-09-07 12:36:39 -04:00
njohnson
abd1a6a051 Lotta asset-based changes. 2025-09-07 12:36:08 -04:00
b80a11093a Merge pull request 'feature/test' (#9) from feature/test into main
Reviewed-on: #9
2025-09-07 12:35:21 -04:00
njohnson
d129c7ba62 Sorry ut A lotta stuff. 2025-09-05 18:35:17 -04:00
RedLine AI Agent
46606f529d Updated libs/xassets/xwindowdef.h 2025-09-05 21:36:01 +00:00
RedLine AI Agent
034234a134 Updated libs/xassets/xwindowdef.cpp 2025-09-05 21:36:00 +00:00
RedLine AI Agent
c197edaee6 Updated libs/xassets/xweaponenums.h 2025-09-05 21:35:59 +00:00
RedLine AI Agent
32991d0273 Updated libs/xassets/xtexturedesc.h 2025-09-05 21:35:57 +00:00
RedLine AI Agent
c4826bf1f3 Updated libs/xassets/xtexturedesc.cpp 2025-09-05 21:35:55 +00:00
RedLine AI Agent
1afbe28cc9 Updated libs/xassets/xsunflare.h 2025-09-05 21:35:54 +00:00
RedLine AI Agent
d28aba759f Updated libs/xassets/xsunflare.cpp 2025-09-05 21:35:52 +00:00
RedLine AI Agent
80c0fb2f23 Updated libs/xassets/xstatement.h 2025-09-05 21:35:51 +00:00
RedLine AI Agent
99c2b0ab3b Updated libs/xassets/xstatement.cpp 2025-09-05 21:35:50 +00:00
RedLine AI Agent
9f46d1ea9c Updated libs/xassets/xsrftriangles.h 2025-09-05 21:35:49 +00:00
RedLine AI Agent
d4c36cab72 Updated libs/xassets/xsrftriangles.cpp 2025-09-05 21:35:47 +00:00
RedLine AI Agent
5ec26d101c Updated libs/xassets/xsentienthandle.h 2025-09-05 21:35:46 +00:00
RedLine AI Agent
c5732b0899 Updated libs/xassets/xsentienthandle.cpp 2025-09-05 21:35:45 +00:00
RedLine AI Agent
fb442b39fa Updated libs/xassets/xrectdef.h 2025-09-05 21:35:43 +00:00
RedLine AI Agent
afb0430f30 Updated libs/xassets/xrectdef.cpp 2025-09-05 21:35:42 +00:00
RedLine AI Agent
7bb6d0ab89 Updated libs/xassets/xplatform.h 2025-09-05 21:35:41 +00:00
RedLine AI Agent
9d85b77ef0 Updated libs/xassets/xoperandinternaldataunion.h 2025-09-05 21:35:39 +00:00
RedLine AI Agent
2b55752eb3 Updated libs/xassets/xoperandinternaldataunion.cpp 2025-09-05 21:35:38 +00:00
RedLine AI Agent
c45df3444c Updated libs/xassets/xoperand.h 2025-09-05 21:35:37 +00:00
RedLine AI Agent
cc30cda7cc Updated libs/xassets/xoperand.cpp 2025-09-05 21:35:35 +00:00
RedLine AI Agent
de0ee2e438 Updated libs/xassets/xmultidef.h 2025-09-05 21:35:34 +00:00
RedLine AI Agent
1000b0cafa Updated libs/xassets/xmultidef.cpp 2025-09-05 21:35:33 +00:00
RedLine AI Agent
9a10f4a9e7 Updated libs/xassets/xmodelpieces.h 2025-09-05 21:35:32 +00:00
RedLine AI Agent
6cb52df017 Updated libs/xassets/xmodelpieces.cpp 2025-09-05 21:35:30 +00:00
RedLine AI Agent
e1f8897150 Updated libs/xassets/xmodelpiece.h 2025-09-05 21:35:29 +00:00
RedLine AI Agent
aa8a6d18ae Updated libs/xassets/xmodelpiece.cpp 2025-09-05 21:35:28 +00:00
RedLine AI Agent
d70b54480d Updated libs/xassets/xmodeldrawinfo.h 2025-09-05 21:35:26 +00:00
RedLine AI Agent
d2eb7b9795 Updated libs/xassets/xmodeldrawinfo.cpp 2025-09-05 21:35:25 +00:00
RedLine AI Agent
e7aca45a9f Updated libs/xassets/xmenuenums.h 2025-09-05 21:35:24 +00:00
RedLine AI Agent
7752d3ada5 Updated libs/xassets/xmaterialtechniqueset.h 2025-09-05 21:35:23 +00:00
RedLine AI Agent
4cfd3da983 Updated libs/xassets/xmaterialtechniqueset.cpp 2025-09-05 21:35:21 +00:00
RedLine AI Agent
1ea1ae3199 Updated libs/xassets/xmaterialmemory.h 2025-09-05 21:35:20 +00:00
RedLine AI Agent
2b29b121e0 Updated libs/xassets/xmaterialmemory.cpp 2025-09-05 21:35:19 +00:00
RedLine AI Agent
5c9868c435 Updated libs/xassets/xlistboxdef.h 2025-09-05 21:35:17 +00:00
RedLine AI Agent
6c0a111c09 Updated libs/xassets/xlistboxdef.cpp 2025-09-05 21:35:16 +00:00
RedLine AI Agent
4cbf8ca553 Updated libs/xassets/xitemkeyhandler.h 2025-09-05 21:35:15 +00:00
RedLine AI Agent
5aefd3e4e1 Updated libs/xassets/xitemkeyhandler.cpp 2025-09-05 21:35:14 +00:00
RedLine AI Agent
8bb5287605 Updated libs/xassets/xitemdefdata.h 2025-09-05 21:35:12 +00:00
RedLine AI Agent
0c2478cc70 Updated libs/xassets/xitemdefdata.cpp 2025-09-05 21:35:10 +00:00
RedLine AI Agent
06cda8303d Updated libs/xassets/xitemdef.h 2025-09-05 21:35:09 +00:00
RedLine AI Agent
3c45b639cb Updated libs/xassets/xitemdef.cpp 2025-09-05 21:35:08 +00:00
RedLine AI Agent
aa77115da8 Updated libs/xassets/xglyph.h 2025-09-05 21:35:07 +00:00
RedLine AI Agent
5c42895bb2 Updated libs/xassets/xglyph.cpp 2025-09-05 21:35:05 +00:00
RedLine AI Agent
67668ccc27 Updated libs/xassets/xgfxworldvertexlayerdata.h 2025-09-05 21:35:04 +00:00
RedLine AI Agent
cdf01bb966 Updated libs/xassets/xgfxworldvertexlayerdata.cpp 2025-09-05 21:35:03 +00:00
RedLine AI Agent
178665610c Updated libs/xassets/xgfxworlddpvsstatic.h 2025-09-05 21:35:01 +00:00
RedLine AI Agent
13a7b65f6d Updated libs/xassets/xgfxworlddpvsstatic.cpp 2025-09-05 21:35:00 +00:00
RedLine AI Agent
26ba52bcd2 Updated libs/xassets/xgfxworlddpvsplanes.h 2025-09-05 21:34:59 +00:00
RedLine AI Agent
9e4d14f686 Updated libs/xassets/xgfxworlddpvsplanes.cpp 2025-09-05 21:34:57 +00:00
RedLine AI Agent
5ecabfee07 Updated libs/xassets/xgfxworlddpvsdynamic.h 2025-09-05 21:34:56 +00:00
RedLine AI Agent
caa9fe276e Updated libs/xassets/xgfxworlddpvsdynamic.cpp 2025-09-05 21:34:54 +00:00
RedLine AI Agent
80f1a65a71 Updated libs/xassets/xgfxsurface.h 2025-09-05 21:34:53 +00:00
RedLine AI Agent
2adf0cc1e8 Updated libs/xassets/xgfxsurface.cpp 2025-09-05 21:34:52 +00:00
RedLine AI Agent
1ca6766402 Updated libs/xassets/xgfxstaticmodelinst.h 2025-09-05 21:34:50 +00:00
RedLine AI Agent
08b6e1d6d9 Updated libs/xassets/xgfxstaticmodelinst.cpp 2025-09-05 21:34:49 +00:00
RedLine AI Agent
efd06290d8 Updated libs/xassets/xgfxstaticmodeldrawinst.h 2025-09-05 21:34:48 +00:00
RedLine AI Agent
2f4bc7bb05 Updated libs/xassets/xgfxstaticmodeldrawinst.cpp 2025-09-05 21:34:46 +00:00
RedLine AI Agent
147e4bb079 Updated libs/xassets/xgfxshadowgeometry.h 2025-09-05 21:34:45 +00:00
RedLine AI Agent
749084539e Updated libs/xassets/xgfxshadowgeometry.cpp 2025-09-05 21:34:43 +00:00
RedLine AI Agent
87add0fa93 Updated libs/xassets/xgfxscenedynmodel.h 2025-09-05 21:34:42 +00:00
RedLine AI Agent
98039b533f Updated libs/xassets/xgfxscenedynmodel.cpp 2025-09-05 21:34:41 +00:00
RedLine AI Agent
1d2d68ed54 Updated libs/xassets/xgfxscenedynbrush.h 2025-09-05 21:34:39 +00:00
RedLine AI Agent
18c9457948 Updated libs/xassets/xgfxscenedynbrush.cpp 2025-09-05 21:34:38 +00:00
RedLine AI Agent
bb3683d8fb Updated libs/xassets/xgfxportalwritable.h 2025-09-05 21:34:37 +00:00
RedLine AI Agent
6dd8a4a24c Updated libs/xassets/xgfxportalwritable.cpp 2025-09-05 21:34:36 +00:00
RedLine AI Agent
a2acf1dd90 Updated libs/xassets/xgfxportal.h 2025-09-05 21:34:34 +00:00
RedLine AI Agent
b34959ba1d Updated libs/xassets/xgfxportal.cpp 2025-09-05 21:34:33 +00:00
RedLine AI Agent
2b40623f83 Updated libs/xassets/xgfxplacement.h 2025-09-05 21:34:32 +00:00
RedLine AI Agent
faa73b7697 Updated libs/xassets/xgfxplacement.cpp 2025-09-05 21:34:31 +00:00
RedLine AI Agent
d40b2326f7 Updated libs/xassets/xgfxpackedplacement.h 2025-09-05 21:34:30 +00:00
RedLine AI Agent
57c6c18d8b Updated libs/xassets/xgfxpackedplacement.cpp 2025-09-05 21:34:28 +00:00
RedLine AI Agent
f4b2aaf84e Updated libs/xassets/xgfxlightregionhull.h 2025-09-05 21:34:27 +00:00
RedLine AI Agent
f253b75a45 Updated libs/xassets/xgfxlightregionhull.cpp 2025-09-05 21:34:26 +00:00
RedLine AI Agent
b15886e089 Updated libs/xassets/xgfxlightregionaxis.h 2025-09-05 21:34:24 +00:00
RedLine AI Agent
e78778e82c Updated libs/xassets/xgfxlightregionaxis.cpp 2025-09-05 21:34:23 +00:00
RedLine AI Agent
d957774436 Updated libs/xassets/xgfxlightregion.h 2025-09-05 21:34:22 +00:00
RedLine AI Agent
1722cbf067 Updated libs/xassets/xgfxlightregion.cpp 2025-09-05 21:34:20 +00:00
RedLine AI Agent
c394b38c76 Updated libs/xassets/xgfxlightmaparray.h 2025-09-05 21:34:19 +00:00
RedLine AI Agent
baafe8b4e5 Updated libs/xassets/xgfxlightmaparray.cpp 2025-09-05 21:34:06 +00:00
RedLine AI Agent
78247fafab Updated libs/xassets/xgfxlightgridentry.h 2025-09-05 21:33:54 +00:00
RedLine AI Agent
f7055fbc10 Updated libs/xassets/xgfxlightgridcolors.h 2025-09-05 21:33:44 +00:00
RedLine AI Agent
54a46e8a3e Updated libs/xassets/xgfxlightgrid.h 2025-09-05 21:33:32 +00:00
RedLine AI Agent
3ffcec4a71 Updated libs/xassets/xgfxlightgrid.cpp 2025-09-05 21:33:20 +00:00
RedLine AI Agent
3af6532904 Updated libs/xassets/xgfxcullgroup.h 2025-09-05 21:33:06 +00:00
RedLine AI Agent
f879005e76 Updated libs/xassets/xgfxcullgroup.cpp 2025-09-05 21:32:52 +00:00
RedLine AI Agent
af3f28752a Updated libs/xassets/xgfxcell.h 2025-09-05 21:32:48 +00:00
RedLine AI Agent
240a643111 Updated libs/xassets/xgfxcell.cpp 2025-09-05 21:32:39 +00:00
RedLine AI Agent
bf951db63c Updated libs/xassets/xgfxbrushmodelwritable.h 2025-09-05 21:32:37 +00:00
RedLine AI Agent
54b54a2367 Updated libs/xassets/xgfxbrushmodelwritable.cpp 2025-09-05 21:32:36 +00:00
RedLine AI Agent
5a9855a9f6 Updated libs/xassets/xgfxbrushmodel.h 2025-09-05 21:32:35 +00:00
RedLine AI Agent
3e3553b2ce Updated libs/xassets/xgfxbrushmodel.cpp 2025-09-05 21:32:26 +00:00
RedLine AI Agent
e90788e232 Updated libs/xassets/xgfxaabbtree.h 2025-09-05 21:32:16 +00:00
RedLine AI Agent
c7ed43cf8d Updated libs/xassets/xgfxaabbtree.cpp 2025-09-05 21:32:02 +00:00
RedLine AI Agent
a8ca882e07 Updated libs/xassets/xgame.h 2025-09-05 21:31:49 +00:00
RedLine AI Agent
0e48faf7a3 Updated libs/xassets/xfxspawndefoneshot.h 2025-09-05 21:31:45 +00:00
RedLine AI Agent
51e12e9683 Updated libs/xassets/xfxspawndefoneshot.cpp 2025-09-05 21:31:33 +00:00
RedLine AI Agent
0ec4548a6b Updated libs/xassets/xfxspawndeflooping.h 2025-09-05 21:31:20 +00:00
RedLine AI Agent
c72d51ad1e Updated libs/xassets/xfxspawndeflooping.cpp 2025-09-05 21:31:06 +00:00
RedLine AI Agent
1747f8f8be Updated libs/xassets/xfxspawndef.h 2025-09-05 21:30:52 +00:00
RedLine AI Agent
6fbd17291a Updated libs/xassets/xfxspawndef.cpp 2025-09-05 21:30:51 +00:00
RedLine AI Agent
e1ec4b8878 Updated libs/xassets/xfxintrange.h 2025-09-05 21:30:49 +00:00
RedLine AI Agent
1d08ae6af6 Updated libs/xassets/xfxintrange.cpp 2025-09-05 21:30:48 +00:00
njohnson
c596b3a828 Remove retained copies. 2025-09-05 17:27:56 -04:00
RedLine AI Agent
846c689088 Updated libs/xassets/xfximpacttable.h 2025-09-05 21:27:31 +00:00
RedLine AI Agent
84dc8358a7 Updated libs/xassets/xfximpacttable.cpp 2025-09-05 21:27:30 +00:00
RedLine AI Agent
86092b18a2 Updated libs/xassets/xfxfloatrange.h 2025-09-05 21:27:28 +00:00
RedLine AI Agent
c968117ed1 Updated libs/xassets/xfxfloatrange.cpp 2025-09-05 21:27:27 +00:00
RedLine AI Agent
ef884f4be7 Updated libs/xassets/xfxelematlas.h 2025-09-05 21:27:26 +00:00
RedLine AI Agent
5bf97fcf1a Updated libs/xassets/xfxelematlas.cpp 2025-09-05 21:27:24 +00:00
RedLine AI Agent
c0967ce23e Updated libs/xassets/xfxelematlas.h 2025-09-05 21:27:23 +00:00
RedLine AI Agent
de0e4c5aae Updated libs/xassets/xfxelematlas.cpp 2025-09-05 21:27:22 +00:00
RedLine AI Agent
01094b8d9e Updated libs/xassets/xfxelematlas.h 2025-09-05 21:27:20 +00:00
RedLine AI Agent
7af197ad80 Updated libs/xassets/xfxelematlas.cpp 2025-09-05 21:27:17 +00:00
RedLine AI Agent
136a49801e Updated libs/xassets/xfxelematlas.h 2025-09-05 21:27:05 +00:00
RedLine AI Agent
d603742172 Updated libs/xassets/xfxelematlas.cpp 2025-09-05 21:26:58 +00:00
RedLine AI Agent
cdf8ac1ffc Updated libs/xassets/xfxelematlas.h 2025-09-05 21:26:45 +00:00
RedLine AI Agent
8d5c2c7ea1 Updated libs/xassets/xfxelematlas.cpp 2025-09-05 21:26:32 +00:00
RedLine AI Agent
d075ad4c24 Updated libs/xassets/xfxeffectdef.h 2025-09-05 21:26:19 +00:00
RedLine AI Agent
4e1c18fff2 Updated libs/xassets/xfxeffectdef.cpp 2025-09-05 21:26:14 +00:00
RedLine AI Agent
a2e9683ba3 Updated libs/xassets/xfont.h 2025-09-05 21:26:13 +00:00
RedLine AI Agent
f7444171e3 Updated libs/xassets/xfont.cpp 2025-09-05 21:26:12 +00:00
RedLine AI Agent
fdea13bf84 Updated libs/xassets/xexpressionentry.h 2025-09-05 21:26:11 +00:00
RedLine AI Agent
a06df405fc Updated libs/xassets/xexpressionentry.cpp 2025-09-05 21:26:09 +00:00
RedLine AI Agent
70515d28d4 Updated libs/xassets/xentryinternaldata.h 2025-09-05 21:26:08 +00:00
RedLine AI Agent
37c25d3baf Updated libs/xassets/xentryinternaldata.cpp 2025-09-05 21:26:07 +00:00
RedLine AI Agent
75802ffa8e Updated libs/xassets/xdynentitypose.h 2025-09-05 21:26:06 +00:00
RedLine AI Agent
5a35d4f4d8 [No changes] 2025-09-05 21:25:17 +00:00
RedLine AI Agent
9958f33b60 [No changes] 2025-09-05 21:25:15 +00:00
RedLine AI Agent
c1e9b308a1 [No changes] 2025-09-05 21:25:12 +00:00
RedLine AI Agent
6ef4fe82da [No changes] 2025-09-05 21:25:10 +00:00
RedLine AI Agent
8f287ceeec [No changes] 2025-09-05 21:25:09 +00:00
RedLine AI Agent
12b4a77f1f [No changes] 2025-09-05 21:24:58 +00:00
RedLine AI Agent
38dd74b188 [No changes] 2025-09-05 21:24:57 +00:00
RedLine AI Agent
e3db1e11cc [No changes] 2025-09-05 21:24:56 +00:00
RedLine AI Agent
0d9d2fccfb [No changes] 2025-09-05 21:24:56 +00:00
RedLine AI Agent
c84463e3c2 [No changes] 2025-09-05 21:24:55 +00:00
RedLine AI Agent
619cfad47c [No changes] 2025-09-05 21:24:54 +00:00
RedLine AI Agent
17408d5d4e [No changes] 2025-09-05 21:24:54 +00:00
RedLine AI Agent
04daaeaf7f [No changes] 2025-09-05 21:24:53 +00:00
RedLine AI Agent
92456f1da6 [No changes] 2025-09-05 21:24:52 +00:00
RedLine AI Agent
38909a69a6 [No changes] 2025-09-05 21:24:51 +00:00
RedLine AI Agent
26a1629dee [No changes] 2025-09-05 21:24:51 +00:00
RedLine AI Agent
cc5c1854e2 [No changes] 2025-09-05 21:24:50 +00:00
RedLine AI Agent
fccad08fb0 [No changes] 2025-09-05 21:24:46 +00:00
RedLine AI Agent
0d156994b4 [No changes] 2025-09-05 21:24:44 +00:00
RedLine AI Agent
dd1eb94beb [No changes] 2025-09-05 21:24:37 +00:00
RedLine AI Agent
b53f169a4f [No changes] 2025-09-05 21:24:29 +00:00
RedLine AI Agent
ce9bcefb88 No changes. 2025-09-05 21:24:21 +00:00
RedLine AI Agent
ab60c56e88 [No changes] 2025-09-05 21:24:14 +00:00
njohnson
32e4815cbe Update .gitignore 2025-09-05 17:22:49 -04:00
RedLine AI Agent
a8ee358150 Add: libs/*/release/*
Add: libs/*/debug/*
2025-09-05 21:05:49 +00:00
RedLine AI Agent
302350fe2c Add: data/obj/* 2025-09-05 21:02:46 +00:00
RedLine AI Agent
2f323046d3 Add: *.XMODEL_EXPORT 2025-09-05 21:01:00 +00:00
RedLine AI Agent
3dad8bfb5c Update: data/Data.qrc 2025-09-05 20:59:08 +00:00
RedLine AI Agent
f8624c8997 Update: app/zonefileviewer.ui 2025-09-05 20:59:06 +00:00
RedLine AI Agent
9d8e214ae3 Update: app/zonefileviewer.h 2025-09-05 20:59:03 +00:00
RedLine AI Agent
15bbbec1db Update: app/zonefileviewer.cpp 2025-09-05 20:54:46 +00:00
RedLine AI Agent
00a3dfb958 Update: app/xtreewidgetitem.h 2025-09-05 20:54:42 +00:00
RedLine AI Agent
12c9e79bf2 Update: app/xtreewidgetitem.cpp 2025-09-05 20:54:30 +00:00
RedLine AI Agent
39cd33efd4 Update: app/xtreewidget.h 2025-09-05 20:54:06 +00:00
RedLine AI Agent
ce5c98b78d Update: app/soundviewer.ui 2025-09-05 20:53:15 +00:00
RedLine AI Agent
053c440415 Update app/techsetviewer.ui 2025-09-05 20:47:55 +00:00
RedLine AI Agent
d477865e9a Update app/techsetviewer.h 2025-09-05 20:47:19 +00:00
RedLine AI Agent
a7e0859b8d Update app/techsetviewer.cpp 2025-09-05 20:47:17 +00:00
RedLine AI Agent
ed593d3ae1 Update app/stringtableviewer.ui 2025-09-05 20:47:15 +00:00
RedLine AI Agent
d973d2bee5 Update app/stringtableviewer.h 2025-09-05 20:47:03 +00:00
RedLine AI Agent
90c3d3bef3 Update app/stringtableviewer.cpp 2025-09-05 20:46:50 +00:00
RedLine AI Agent
d583b9ce08 Update app/soundviewer.ui 2025-09-05 20:46:36 +00:00
RedLine AI Agent
46792b3dc6 Update app/soundviewer.h 2025-09-05 20:45:06 +00:00
RedLine AI Agent
1739a4686e Update app/soundviewer.cpp 2025-09-05 20:45:03 +00:00
RedLine AI Agent
28257af738 Update app/rumblegraphviewer.ui 2025-09-05 20:45:00 +00:00
RedLine AI Agent
50fb3d2557 Update app/rumblegraphviewer.h 2025-09-05 20:44:57 +00:00
RedLine AI Agent
3f0d4641b1 Update app/rumblegraphviewer.cpp 2025-09-05 20:44:54 +00:00
RedLine AI Agent
b2fcdd1762 Update app/rumblefileviewer.ui 2025-09-05 20:44:51 +00:00
RedLine AI Agent
99706b868b Update app/rumblefileviewer.h 2025-09-05 20:44:48 +00:00
RedLine AI Agent
dfe3311323 Update app/rumblefileviewer.cpp 2025-09-05 20:44:47 +00:00
RedLine AI Agent
6a04ed7431 Update app/reportissuedialog.ui 2025-09-05 20:44:45 +00:00
RedLine AI Agent
32ab5c7451 Update app/reportissuedialog.h 2025-09-05 20:44:40 +00:00
RedLine AI Agent
b6403208f1 Update app/reportissuedialog.cpp 2025-09-05 20:44:38 +00:00
RedLine AI Agent
fcaa1eacaf Update app/preferenceeditor.ui 2025-09-05 20:44:36 +00:00
RedLine AI Agent
97c4fbddde Update app/preferenceeditor.h 2025-09-05 20:44:33 +00:00
RedLine AI Agent
ed9e7ee558 Update app/preferenceeditor.cpp 2025-09-05 20:44:31 +00:00
RedLine AI Agent
618c304a87 Update app/modelviewer.ui 2025-09-05 20:44:29 +00:00
RedLine AI Agent
cc311c2a1a Update app/modelviewer.h 2025-09-05 20:44:24 +00:00
RedLine AI Agent
fda7f55231 Update app/modelviewer.cpp 2025-09-05 20:44:12 +00:00
RedLine AI Agent
fe5724ef82 Update app/materialviewer.ui 2025-09-05 20:43:12 +00:00
RedLine AI Agent
1a0ba48b51 Update app/materialviewer.h 2025-09-05 20:42:01 +00:00
RedLine AI Agent
713d55b4eb Update app/materialviewer.cpp 2025-09-05 20:41:21 +00:00
RedLine AI Agent
59d6d6907a Refactor mainwindow.ui: replace the entire UI definition with a cleaned‑up, consistent layout and action structure. 2025-09-05 19:59:40 +00:00
RedLine AI Agent
020178f780 Update app/mainwindow.h 2025-09-05 19:57:04 +00:00
RedLine AI Agent
a2242fe018 Update app/mainwindow.cpp 2025-09-05 19:54:14 +00:00
RedLine AI Agent
ef6d1007e6 Update app/main.cpp 2025-09-05 19:54:09 +00:00
RedLine AI Agent
9971facf90 Update app/localstringviewer.ui 2025-09-05 19:54:03 +00:00
RedLine AI Agent
3a0070612a Update app/localstringviewer.h 2025-09-05 19:53:52 +00:00
RedLine AI Agent
8f415d4fe6 Update app/localstringviewer.cpp 2025-09-05 19:53:47 +00:00
RedLine AI Agent
f438e6c063 Update app/iwiviewer.ui 2025-09-05 19:53:26 +00:00
RedLine AI Agent
1e086cf00a Update app/iwiviewer.h 2025-09-05 19:53:11 +00:00
RedLine AI Agent
d166e3329a Update app/ddsviewer.h 2025-09-05 19:51:20 +00:00
RedLine AI Agent
4db49c0896 Update app/imagewidget.ui 2025-09-05 19:48:54 +00:00
RedLine AI Agent
12806268d4 Update app/imagewidget.h 2025-09-05 19:48:43 +00:00
RedLine AI Agent
39d37640cc Update app/imagewidget.cpp 2025-09-05 19:48:15 +00:00
RedLine AI Agent
d771df9b09 Update app/fastfileviewer.ui 2025-09-05 19:47:52 +00:00
RedLine AI Agent
44af7bf03c Update app/fastfileviewer.h 2025-09-05 19:47:15 +00:00
RedLine AI Agent
07e473bad0 Update app/fastfileviewer.cpp 2025-09-05 19:46:47 +00:00
RedLine AI Agent
19d417e84b Update app/ddsviewer.ui 2025-09-05 19:46:04 +00:00
RedLine AI Agent
c898f62d69 Update app/ddsviewer.h 2025-09-05 19:45:44 +00:00
RedLine AI Agent
d69f6eef40 Update app/ddsviewer.cpp 2025-09-05 19:44:32 +00:00
RedLine AI Agent
affd9fe889 Update app/d3dbsp_structs.h 2025-09-05 19:44:25 +00:00
RedLine AI Agent
90ebbd86ee Update app/app.pro 2025-09-05 19:43:49 +00:00
RedLine AI Agent
50a1aa3bbc Update app/aboutdialog.ui 2025-09-05 19:43:41 +00:00
RedLine AI Agent
270dacf1e5 Update app/aboutdialog.cpp 2025-09-05 19:43:31 +00:00
RedLine AI Agent
4a4df3c2a4 Update app/aboutdialog.cpp 2025-09-05 19:42:32 +00:00
Nicholas Johnson
4d7598e805 Update app/LICENSE: normalize line endings 2025-09-05 13:59:36 -04:00
Nicholas Johnson
94d407ffb7 Update XPlor.pro: fix formatting and line endings 2025-09-05 13:54:40 -04:00
Nicholas Johnson
3291e52cc6 Update .gitignore: remove leading hyphens and standardize patterns 2025-09-05 13:53:56 -04:00
Nicholas Johnson
f576af8f11 Remove temp autosave file. 2025-09-03 13:40:02 -04:00
Nicholas Johnson
eee7231737 Add autosave files. 2025-09-03 13:39:42 -04:00
Nicholas Johnson
e7455256a7 Add xwaterwritable structures 2025-09-03 13:28:24 -04:00
Nicholas Johnson
2a026947c4 Add xwater structures 2025-09-03 13:28:13 -04:00
Nicholas Johnson
12795451e6 Add xsurfacevertexinfo structures 2025-09-03 13:28:03 -04:00
Nicholas Johnson
c9802401fb Add xsurfacecollisiontree structures 2025-09-03 13:27:52 -04:00
Nicholas Johnson
5a12e3c967 Add xsurfacecollisionnode structures 2025-09-03 13:26:37 -04:00
Nicholas Johnson
a02e3714d0 Add xsurfacecollisionleaf structures 2025-09-03 13:26:24 -04:00
Nicholas Johnson
84f99dc919 Add xsurfacecollisionaabb structures 2025-09-03 13:26:11 -04:00
Nicholas Johnson
163f46b4cf Add xsurface structures 2025-09-03 13:25:58 -04:00
Nicholas Johnson
7b1d269986 Add xstreamsourceinfo structures 2025-09-03 13:25:47 -04:00
Nicholas Johnson
386d0793aa Add xstreamdelayinfo structures 2025-09-03 13:25:36 -04:00
Nicholas Johnson
dc3360a97d Add xscriptstringlist structures 2025-09-03 13:22:24 -04:00
Nicholas Johnson
6ab9a9b350 Add xrigidvertlist structures 2025-09-03 13:21:14 -04:00
Nicholas Johnson
e3f971f62c Add xphyspreset structures 2025-09-03 13:21:02 -04:00
Nicholas Johnson
3a718acb50 Add xphysmass structures 2025-09-03 13:20:51 -04:00
Nicholas Johnson
2e09f532b9 Add xphysgeomlist structures 2025-09-03 13:20:39 -04:00
Nicholas Johnson
c39185e35c Add xphysgeominfo structures 2025-09-03 13:20:29 -04:00
Nicholas Johnson
eee271278a Add xpackedunitvec structures 2025-09-03 13:20:19 -04:00
Nicholas Johnson
e7077aae63 Add xpackedtexcoords structures 2025-09-03 13:20:07 -04:00
Nicholas Johnson
78a6efd02f Add xmodelstreaminfo structures 2025-09-03 13:19:57 -04:00
Nicholas Johnson
73b3cc9e75 Add xmodellodinfo structures 2025-09-03 13:18:53 -04:00
Nicholas Johnson
ef6f75c8a8 Add xmodelhighmipbounds structures 2025-09-03 13:18:40 -04:00
Nicholas Johnson
3bed978b89 Add xmodelcollsurf structures 2025-09-03 13:18:27 -04:00
Nicholas Johnson
dcab86b1ed Add xmaterialvertexstreamrouting structures 2025-09-03 13:18:16 -04:00
Nicholas Johnson
7cf9ac8d4c Add xmaterialvertexdeclaration structures 2025-09-03 13:18:05 -04:00
Nicholas Johnson
e63cf8554e Add xmaterialvertexshaderprogram structures 2025-09-03 13:17:42 -04:00
Nicholas Johnson
d7e4dfda41 Add xmaterialvertexshader structures 2025-09-03 13:17:32 -04:00
Nicholas Johnson
9c92fcd854 Add xmaterialtexturedefinfo structures 2025-09-03 13:17:22 -04:00
Nicholas Johnson
7768c5f7f5 Add xmaterialtexturedef structures 2025-09-03 13:16:15 -04:00
Nicholas Johnson
58e87e8787 Add xmaterialtechnique structures 2025-09-03 13:16:04 -04:00
Nicholas Johnson
b176bc3d00 Add xmaterialstreamrouting structures 2025-09-03 13:15:52 -04:00
Nicholas Johnson
3c13462618 Add xmaterialshaderargument structures 2025-09-03 13:15:41 -04:00
Nicholas Johnson
68a41d4582 Add xmaterialpixelshaderprogram structures 2025-09-03 13:15:31 -04:00
Nicholas Johnson
60e93e0ab3 Add xmaterialpixelshader structures 2025-09-03 13:15:22 -04:00
Nicholas Johnson
9fb5c62b75 Add xmaterialpass structures 2025-09-03 13:15:13 -04:00
Nicholas Johnson
352e51170d Add xmaterialinfo structures 2025-09-03 13:15:04 -04:00
Nicholas Johnson
fc64762bfe Add xmaterialconstantdef structures 2025-09-03 13:14:06 -04:00
Nicholas Johnson
fe34c63697 Add xmaterialargumentdef structures 2025-09-03 13:13:53 -04:00
Nicholas Johnson
02d96741e8 Add xmaterialargumentcodeconst structures 2025-09-03 13:13:41 -04:00
Nicholas Johnson
d8b27a31d2 Add xmaterial.cpp 2025-09-03 13:13:30 -04:00
Nicholas Johnson
4fcd3a4c60 Add xmaterial structures 2025-09-03 13:12:46 -04:00
Nicholas Johnson
fd1868ed46 Add xmaptype structures 2025-09-03 13:12:39 -04:00
Nicholas Johnson
7250e1f460 Add xgputexturesizestack3d structures 2025-09-03 13:11:38 -04:00
Nicholas Johnson
1e0a490a69 Add xgputexturesizestack2d structures 2025-09-03 13:11:27 -04:00
Nicholas Johnson
bfedb389b8 Add xgputexturesizestack1d structures 2025-09-03 13:11:16 -04:00
Nicholas Johnson
0a2fdd0b74 Add xgputexturesizestack structures 2025-09-03 13:11:05 -04:00
Nicholas Johnson
a2959f9b29 Add xgputexturesize3d structures 2025-09-03 13:10:54 -04:00
Nicholas Johnson
cd99390ba7 Add xgputexturesize2d structures 2025-09-03 13:10:44 -04:00
Nicholas Johnson
388e2dfc52 Add xgputexturesize1d structures 2025-09-03 13:10:35 -04:00
Nicholas Johnson
47e09afa73 Add xgpuvertexrawrequest structures 2025-09-03 13:08:56 -04:00
Nicholas Johnson
cdef686ec4 Add xgpuvertexfetchconstant structures 2025-09-03 13:08:47 -04:00
Nicholas Johnson
be21cf40cb Add xgfxvertexshaderloaddef structures 2025-09-03 13:08:37 -04:00
Nicholas Johnson
4eb817375c Add xgfxstatebits structures 2025-09-03 13:08:03 -04:00
Nicholas Johnson
5a623c18d0 Add xgfxpixelshaderloaddef structures 2025-09-03 13:07:19 -04:00
Nicholas Johnson
63ca1074fc Add xgfxpackedvertex structures 2025-09-03 13:07:08 -04:00
Nicholas Johnson
9a70b774ab Add xgfxdrawsurffields structures 2025-09-03 13:06:58 -04:00
Nicholas Johnson
ea385c2853 Add xgfxdrawsurf structures 2025-09-03 13:06:49 -04:00
Nicholas Johnson
f9604bc858 Add xgfxcolor structures 2025-09-03 13:06:40 -04:00
Nicholas Johnson
65a37363e6 Add xfxtrailvertex structures 2025-09-03 13:06:31 -04:00
Nicholas Johnson
2879a89594 Add xfxtraildef structures 2025-09-03 13:06:22 -04:00
Nicholas Johnson
6bc88394cd Add xfximpactentry structures 2025-09-03 13:06:13 -04:00
Nicholas Johnson
f17d56c603 Add xfxelemvisuals structures 2025-09-03 13:05:35 -04:00
Nicholas Johnson
2253db1abb Add xfxelemvisstatesample structures 2025-09-03 13:05:24 -04:00
Nicholas Johnson
c362953775 Add xfxelemmarkvisuals structures 2025-09-03 13:05:14 -04:00
Nicholas Johnson
6ea2989d69 Add xfxelemdefvisuals structures 2025-09-03 13:05:03 -04:00
Nicholas Johnson
ea90db4fe6 Add xfxelemdef structures 2025-09-03 13:04:54 -04:00
Nicholas Johnson
2b1a18be6a Add xfile structures 2025-09-03 13:04:45 -04:00
Nicholas Johnson
40ad7470aa Add new asset-related structures and files 2025-09-03 13:04:24 -04:00
Nicholas Johnson
89d1d0944a Update zonefile structures and project files 2025-09-03 13:03:14 -04:00
Nicholas Johnson
73e13263fc Update node type and path node transient structures 2025-09-03 13:03:03 -04:00
Nicholas Johnson
60ddd31101 Update model structures 2025-09-03 13:02:54 -04:00
Nicholas Johnson
ee4a680d6d Update GPU texture fetch constant structures 2025-09-03 13:02:39 -04:00
Nicholas Johnson
2f61367fcb Update texture handling structures 2025-09-03 13:02:31 -04:00
Nicholas Johnson
c7b1c97d68 Update lighting and streaming AABB tree structures 2025-09-03 13:02:23 -04:00
Nicholas Johnson
ed30f6b861 Update material and image handling structures 2025-09-03 13:01:39 -04:00
Nicholas Johnson
5ea8c5f09a Update Direct3D texture structures 2025-09-03 13:01:26 -04:00
Nicholas Johnson
d1cf5ecc52 Update collision leaf and brush node structures 2025-09-03 13:01:12 -04:00
Nicholas Johnson
a85abf0ecd Update asset and animation structure definitions 2025-09-03 13:00:58 -04:00
Nicholas Johnson
caca3dd489 Update animation-related files 2025-09-03 13:00:41 -04:00
Nicholas Johnson
39853c77fe Update asset-related core files 2025-09-03 13:00:27 -04:00
Nicholas Johnson
f149b66322 Remove deprecated and unused asset-related files 2025-09-03 13:00:02 -04:00
Nicholas Johnson
0ea4a7ad6f Added a tonnn of new classes. 2025-08-17 13:14:17 -04:00
Nicholas Johnson
729a6bac7c Renamed Assets to XAssets. 2025-08-14 18:50:13 -04:00
Nicholas Johnson
be8aa3691e Hey baby girl 2025-08-14 17:30:25 -04:00
Nicholas Johnson
cfa0638b94 More decompiled translations :(. 2025-07-10 01:07:48 -04:00
=
ff1a25b41f Uh. 2025-07-10 00:11:33 -04:00
=
a0cfb65b56 Add tool changes to project. 2025-07-10 00:11:20 -04:00
=
77428c0515 update tests and project. 2025-07-10 00:11:06 -04:00
=
34d6ae6658 Fastfile and other file changes. 2025-07-10 00:10:49 -04:00
=
f339360fbc Removed/renamed some files. 2025-07-10 00:10:30 -04:00
=
f23c38cc3c Removed/renamed some files. 2025-07-10 00:10:16 -04:00
=
fdf1559f09 Tried making magic asset parser. To be contondered. 2025-07-10 00:09:18 -04:00
=
556e33d56f Added dxd9 sdk, even big libs lol. 2025-07-10 00:08:30 -04:00
=
c980d53543 Tried using the IDA pro exports, didnt work. 2025-07-10 00:07:22 -04:00
=
c8cfc1c5fc Autotest changes. 2025-07-10 00:06:51 -04:00
=
a7904ca74e Compro changes. 2025-07-10 00:06:37 -04:00
=
6cc3d71acf Some bs zentry changes. 2025-07-10 00:06:16 -04:00
=
23827f4ffa Zonefile changes and additions. 2025-07-10 00:05:44 -04:00
=
67050e6a67 Lotta asset changes 2025-07-10 00:04:52 -04:00
=
0943608bd8 Add issue reporter dialog. 2025-07-10 00:02:15 -04:00
=
f1aa61bf3b Add ported code from ida. 2025-06-07 11:20:47 -04:00
=
691a16e9ad Add report issue dialog. 2025-06-07 11:16:24 -04:00
=
0a3a307d39 Add to .gitignore 2025-06-04 23:41:09 -04:00
6632149f42 Merge pull request 'Enhanced Feature Implementation and Cleanup' (#1) from feature/icon_factory into main
Reviewed-on: https://git.redline.llc/njohnson/XPlor/pulls/1
2025-06-04 22:40:19 -04:00
=
2eaaa87b72 Add lzo files. 2025-06-04 22:35:10 -04:00
=
c005d19fa8 Add compro tool. 2025-06-04 22:34:49 -04:00
=
b5595d9855 Add temp icon psd. 2025-06-04 22:34:32 -04:00
=
aef7c2657d Add compro tool to project. 2025-06-04 22:34:07 -04:00
=
ecd897b4ac Add experimental method to xcompress header. 2025-06-04 22:33:49 -04:00
=
2eb0ee39fb Update autotests. 2025-06-04 22:33:31 -04:00
=
130814d206 Update autotests. 2025-06-04 22:33:19 -04:00
=
0576fb5bd4 Switch all to fastfile factory. 2025-06-04 22:33:02 -04:00
=
298d5e9848 Add color utilities. 2025-06-04 22:32:34 -04:00
=
3ac572edeb Add highlightings to project. 2025-06-04 22:32:14 -04:00
=
ac33cd4524 Remove unused lzo source. 2025-06-04 22:31:53 -04:00
=
ea39199201 Add XMem functions (in progress) and LZO, fix ZLib. 2025-06-04 22:31:22 -04:00
=
b204858a90 Add XMem functions (in progress) and LZO, fix ZLib. 2025-06-04 22:31:11 -04:00
=
f3427e77ba Remove unused files from resource. 2025-06-04 22:30:03 -04:00
=
7b0fe25650 Add search, remove column, update zone viewer. 2025-06-04 22:29:43 -04:00
=
af82d9a78a Add category support to XTreeWidget with TREE_CATEGORY enum and sorting improvements 2025-06-04 22:29:01 -04:00
=
3e311e5aec Fix data compression, byte order handling, and tag parsing in COD Wii zonefile 2025-06-04 22:25:32 -04:00
=
95349eaa5b Fix data compression, byte order handling, and tag parsing in COD Wii fastfile. 2025-06-04 22:25:12 -04:00
=
22062c2a6e Removed unused header files. 2025-06-04 22:19:47 -04:00
=
72846f4733 Update mainwindow, add highlighting, and fix viewer logic. 2025-06-04 22:14:24 -04:00
=
c056b45184 Add tabs for rumble and shock file viewing. 2025-06-04 22:13:13 -04:00
=
9dd0bd9897 Fix LocalStrViewer entry count and rename group box. 2025-06-04 22:11:50 -04:00
=
4dd68a06e8 Added rumble file viewer. 2025-06-04 22:11:12 -04:00
=
db9165295f Add syntax highlighting for gsc, rmb, and shock files. 2025-06-04 22:10:49 -04:00
=
8fe0e02e64 Added rumble file viewer. 2025-06-04 22:10:14 -04:00
=
20964df102 Remove temp user file. 2025-06-04 22:09:55 -04:00
=
2495fbfdef Only keep non-generated png files. 2025-06-04 22:09:30 -04:00
=
6e7a83d473 Remove png files. 2025-06-04 22:08:44 -04:00
=
87cbdeeefc feat(XPlor): Add dependencies for libs in app, tests and tools projects
Added dependencies for the libs in the app, tests and tools projects. This change ensures that these components depend on the correct libraries.
2025-05-17 23:42:30 -04:00
=
a90f1017f7 add fastfile and zonefile support for all cods 2025-05-17 22:56:57 -04:00
=
588d03ad8f Unify test factory methods and add Wii support 2025-05-17 22:54:28 -04:00
=
b58561eb78 add some bo3 ff processing logic. 2025-05-03 09:57:47 -04:00
Nicholas Johnson
8e71f570c4
Merge pull request #7 from NickJohn547745/feature/parse_menu_items
Feature/parse menu items
2025-04-23 18:20:09 -04:00
=
167d465033 Merge branch 'main' of https://github.com/NickJohn547745/XPlor into feature/parse_menu_items 2025-04-23 18:18:39 -04:00
Nicholas Johnson
9106dc7646
Merge pull request #6 from NickJohn547745/feature/parse_bik_file
Feature/parse bik file
2025-04-23 18:11:15 -04:00
=
a94bb60ca9 Update branch to main 2025-04-23 18:07:57 -04:00
=
2f24c704ba Merge branch 'main' of https://github.com/NickJohn547745/XPlor into feature/parse_bik_file 2025-04-23 18:07:22 -04:00
Nicholas Johnson
0ce21bac73
Merge pull request #5 from NickJohn547745/feature/new_shit
Oh yeah - Autotests
2025-04-23 00:20:58 -04:00
=
b620477446 Oh yeah 2025-04-23 00:09:35 -04:00
Nicholas Johnson
0df96fe804
Merge pull request #4 from NickJohn547745/feature/new_shit
Add a tonnn of stuff
2025-04-04 20:48:02 -04:00
=
f50753c07c Update compression logic 2025-04-04 20:42:41 -04:00
=
e6ff16ce8c Change iwifile from debug to release. 2025-04-04 20:42:17 -04:00
=
0ae2ec4a27 Update ipak file logic. 2025-04-04 20:41:23 -04:00
=
1b6aeefb49 update zonefile logic. 2025-04-04 20:40:45 -04:00
=
75bbeaa9d1 update fastfile logic. 2025-04-04 20:40:37 -04:00
=
5033bdde20 Add and update autotests. 2025-04-04 20:40:22 -04:00
=
83fb3f14d8 Add and update autotests. 2025-04-04 20:40:12 -04:00
=
b192f6ee16 Update dds file logic. 2025-04-04 20:39:51 -04:00
=
52eb850a7e Update encryption logic. 2025-04-04 20:39:36 -04:00
=
099dbe4a80 Update main app and ui. 2025-04-04 20:38:57 -04:00
=
14aff8ce2e Update tree widget. 2025-04-04 20:38:41 -04:00
=
2db1eb664b Change file path from D: to G: 2025-04-04 20:38:22 -04:00
=
04a3533431 Add custom icons. 2025-04-04 20:37:32 -04:00
=
608f0c9d7b Update zonefile class logic. 2025-04-04 20:37:07 -04:00
=
810c6b9f95 Update fastfile class logic. 2025-04-04 20:36:58 -04:00
=
917784b4cb Update file viewers. 2025-04-04 20:36:32 -04:00
=
faeb24bb90 Add custom icons. 2025-04-04 20:35:22 -04:00
=
7b7983de13 Remove .ff files. 2025-04-04 20:34:49 -04:00
=
a8054e2aeb Remove .zone files. 2025-04-04 20:34:24 -04:00
=
bba00a1c3f Woah lotta new stuff 2025-03-01 20:38:52 -05:00
Nicholas Johnson
009a99418f Lotssss of new shit. 2025-02-19 19:17:31 -05:00
=
840f194195 Lotta new stuff. 2025-02-14 16:06:27 -05:00
=
2df69cebce Merge branch 'main' of https://github.com/NickJohn547745/XPlor 2025-02-08 20:07:36 -05:00
=
5614337bdc Add DevIL dll 2025-02-08 20:07:21 -05:00
Nicholas Johnson
b09d97eebd
Merge pull request #3 from NickJohn547745/feature/uplift_ui
Feature/uplift UI
2025-02-08 20:05:40 -05:00
=
80f7a73573 Treat bik file as a raw file, check file types. 2025-01-12 20:12:41 -05:00
=
c649ee2b40 Add .bik processing header. 2025-01-12 20:12:01 -05:00
=
fc9e5d8b5b Add .bik processing header. 2025-01-12 19:01:33 -05:00
=
dee231c700 Refactor and change tech_set to .bik file? 2025-01-11 20:51:00 -05:00
=
0548e383ce Merge branch 'main' of https://github.com/NickJohn547745/XPlor into feature/parse_menu_items 2025-01-11 10:34:43 -05:00
=
34d97c3c65 Re-add hex to item type name. 2025-01-11 10:32:12 -05:00
=
070854b888 Refactor and fix. 2025-01-11 10:31:57 -05:00
=
3b09306868 Add input and output serial operators for QDataStream. 2025-01-11 10:31:40 -05:00
=
05e803c620 Track raw files locally. 2025-01-11 01:09:51 -05:00
=
55ea909322 Added serializable structs for zone file, localize asset, and rawfile asset. 2025-01-11 01:09:37 -05:00
=
7cda2e1354 Reduce asset tables column counts to 2. 2025-01-11 01:09:16 -05:00
=
f45f38738d Added serializable structs for zone file, localize asset, and rawfile asset. 2025-01-11 01:08:54 -05:00
=
9ed104eb7c Add asset type enums. 2025-01-11 01:08:06 -05:00
=
9407f1d23e Added serializable structs for zone file, localize asset, and rawfile asset. 2025-01-11 01:07:54 -05:00
=
15866b4f53 Add project user file to gitignore. 2025-01-11 01:07:32 -05:00
=
473165e4ad Add project user file to gitignore. 2025-01-11 01:06:34 -05:00
=
288af4b64c Remove dlls from qrc 2025-01-11 01:03:00 -05:00
=
bbce4fbd08 Added serializable structs for zone file, localize asset, and rawfile asset. 2025-01-11 01:02:45 -05:00
=
f08da5b670 Added more utils. 2025-01-10 04:36:41 -05:00
=
45b0426757 Updated ui with menu bar and map tab. 2025-01-10 04:36:29 -05:00
=
67f3e21779 Removed unused asset functions, refactored. 2025-01-10 04:36:12 -05:00
=
14f6a481f5 Started working on parsing menu files. 2025-01-10 04:35:45 -05:00
=
c165a537a0 Add menu bar and recent file feature. 2025-01-10 04:35:03 -05:00
=
2854479b97 Added a bunch of enums for menu file stuff. 2025-01-10 04:34:04 -05:00
=
885cf48ce4 Comment dll from project file. 2025-01-10 04:33:26 -05:00
=
417aec53df Remove dll from qrc. 2025-01-10 04:33:12 -05:00
1165 changed files with 397744 additions and 9882 deletions

21
.gitignore vendored
View File

@ -1,4 +1,25 @@
/build/ /build/
/data/dlls/ /data/dlls/
/data/fastfiles/ /data/fastfiles/
/releases/
.vscode/*
.qmake.stash
# Ignore Qt Creator user files
*.pro.user *.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*

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,72 +1,10 @@
QT += core gui 3dcore 3drender 3dinput 3dextras TEMPLATE = subdirs
RC_ICONS = XPlor.ico SUBDIRS += libs \
app \
#tools \
#tests
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets #tests.depends = libs
app.depends = libs
CONFIG += c++17 #tools.depends = libs
SOURCES += \
aboutdialog.cpp \
ddsfile.cpp \
ddsviewer.cpp \
fastfile.cpp \
fastfileviewer.cpp \
imagewidget.cpp \
iwifile.cpp \
iwiviewer.cpp \
localstringviewer.cpp \
lzokay.cpp \
main.cpp \
mainwindow.cpp \
modelviewer.cpp \
iwifile.cpp \
techsetviewer.cpp \
xtreewidget.cpp \
zonefile.cpp \
zonefileviewer.cpp
HEADERS += \
aboutdialog.h \
asset_structs.h \
compressor.h \
d3dbsp_structs.h \
dds_structs.h \
ddsfile.h \
ddsviewer.h \
enums.h \
fastfile.h \
fastfileviewer.h \
imagewidget.h \
ipak_structs.h \
iwifile.h \
iwiviewer.h \
localstringviewer.h \
lzokay.hpp \
lzx.h \
mainwindow.h \
modelviewer.h \
techsetviewer.h \
utils.h \
xtreewidget.h \
iwifile.h \
zonefile.h \
zonefileviewer.h
FORMS += \
aboutdialog.ui \
ddsviewer.ui \
fastfileviewer.ui \
imagewidget.ui \
iwiviewer.ui \
localstringviewer.ui \
mainwindow.ui \
techsetviewer.ui \
zonefileviewer.ui
RESOURCES += \
data/Data.qrc
LIBS += -L$$PWD/DevILSDK/lib/x64/Unicode/Release -lDevIL
LIBS += -L$$PWD/DevILSDK/lib/x64/Unicode/Release -lILU
LIBS += -L$$PWD/DevILSDK/lib/x64/Unicode/Release -lILUT

36
ai-commit.sh Normal file
View File

@ -0,0 +1,36 @@
#!/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

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

61
app/app.pro Normal file
View File

@ -0,0 +1,61 @@
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)
}

41
app/d3dbsp_structs.h Normal file
View File

@ -0,0 +1,41 @@
#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

@ -14,8 +14,8 @@ DDSViewer::~DDSViewer() {
delete ui; delete ui;
} }
void DDSViewer::SetDDSFile(std::shared_ptr<DDSFile> aDDSFile) { void DDSViewer::SetDDSFile(const DDSFile* aDDSFile) {
mDDSFile.swap(aDDSFile); mDDSFile = aDDSFile;
ui->label_Title->setText(mDDSFile->fileStem + ".dds"); ui->label_Title->setText(mDDSFile->fileStem + ".dds");

View File

@ -16,14 +16,14 @@ public:
explicit DDSViewer(QWidget *parent = nullptr); explicit DDSViewer(QWidget *parent = nullptr);
~DDSViewer(); ~DDSViewer();
void SetDDSFile(std::shared_ptr<DDSFile> aDDSFile); void SetDDSFile(const DDSFile *aDDSFile);
private slots: private slots:
void MipmapIndexChanged(int aMipmapIndex); void MipmapIndexChanged(int aMipmapIndex);
private: private:
Ui::DDSViewer *ui; Ui::DDSViewer *ui;
std::shared_ptr<DDSFile> mDDSFile; const DDSFile* mDDSFile;
}; };
#endif // DDSVIEWER_H #endif // DDSVIEWER_H

View File

@ -1,5 +1,4 @@
#include "fastfileviewer.h" #include "fastfileviewer.h"
#include "asset_structs.h"
#include "ui_fastfileviewer.h" #include "ui_fastfileviewer.h"
FastFileViewer::FastFileViewer(QWidget *parent) FastFileViewer::FastFileViewer(QWidget *parent)
@ -15,12 +14,12 @@ FastFileViewer::~FastFileViewer()
delete ui; delete ui;
} }
void FastFileViewer::SetFastFile(std::shared_ptr<FastFile> aFastFile) { void FastFileViewer::SetFastFile(const FastFile* aFastFile) {
mFastFile.swap(aFastFile); mFastFile = aFastFile;
ui->label_Title->setText(mFastFile->GetFileStem()); ui->label_Title->setText(mFastFile->GetStem());
ui->comboBox_Company->setCurrentIndex(mFastFile->GetCompany()); ui->comboBox_Company->setCurrentIndex(mFastFile->GetCompany());
ui->comboBox_FileType->setCurrentIndex(mFastFile->GetFileType()); ui->comboBox_FileType->setCurrentIndex(mFastFile->GetType());
ui->checkBox_Signed->setChecked(mFastFile->GetSignage() == SIGNAGE_SIGNED); ui->checkBox_Signed->setChecked(mFastFile->GetSignage() == SIGNAGE_SIGNED);
ui->lineEdit_Magic->setText(mFastFile->GetMagic()); ui->lineEdit_Magic->setText(mFastFile->GetMagic());
ui->spinBox_Version->setValue(mFastFile->GetVersion()); ui->spinBox_Version->setValue(mFastFile->GetVersion());

View File

@ -1,7 +1,6 @@
#ifndef FASTFILEVIEWER_H #ifndef FASTFILEVIEWER_H
#define FASTFILEVIEWER_H #define FASTFILEVIEWER_H
#include "asset_structs.h"
#include "fastfile.h" #include "fastfile.h"
#include <QWidget> #include <QWidget>
@ -17,10 +16,10 @@ public:
explicit FastFileViewer(QWidget *parent = nullptr); explicit FastFileViewer(QWidget *parent = nullptr);
~FastFileViewer(); ~FastFileViewer();
void SetFastFile(std::shared_ptr<FastFile> aFastFile); void SetFastFile(const FastFile *aFastFile);
private: private:
Ui::FFViewer *ui; Ui::FFViewer *ui;
std::shared_ptr<FastFile> mFastFile; const FastFile* mFastFile;
}; };
#endif // FASTFILEVIEWER_H #endif // FASTFILEVIEWER_H

28
app/imagewidget.cpp Normal file
View File

@ -0,0 +1,28 @@
#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

@ -4,7 +4,6 @@
#include "enums.h" #include "enums.h"
#include "dds_structs.h" #include "dds_structs.h"
#include "d3dbsp_structs.h" #include "d3dbsp_structs.h"
#include "asset_structs.h"
#include "ipak_structs.h" #include "ipak_structs.h"
#include <QWidget> #include <QWidget>
@ -21,11 +20,11 @@ public:
explicit ImageWidget(QWidget *parent = nullptr); explicit ImageWidget(QWidget *parent = nullptr);
~ImageWidget(); ~ImageWidget();
void SetImage(std::shared_ptr<Image> aImage); void SetImage(std::shared_ptr<QImage> aImage);
std::shared_ptr<Image> GetImage(); std::shared_ptr<QImage> GetImage();
private: private:
std::shared_ptr<Image> mImage; std::shared_ptr<QImage> mImage;
Ui::ImageWidget *ui; Ui::ImageWidget *ui;
}; };

View File

@ -14,8 +14,8 @@ IWIViewer::~IWIViewer()
delete ui; delete ui;
} }
void IWIViewer::SetIWIFile(std::shared_ptr<IWIFile> aIWIFile) { void IWIViewer::SetIWIFile(const IWIFile* aIWIFile) {
mIWIFile.swap(aIWIFile); mIWIFile = aIWIFile;
ui->label_Title->setText(mIWIFile->fileStem + ".iwi"); ui->label_Title->setText(mIWIFile->fileStem + ".iwi");

View File

@ -18,10 +18,10 @@ public:
void MipmapIndexChanged(int aMipmapIndex); void MipmapIndexChanged(int aMipmapIndex);
void SetIWIFile(std::shared_ptr<IWIFile> aIWIFile); void SetIWIFile(const IWIFile *aIWIFile);
private: private:
Ui::IWIViewer *ui; Ui::IWIViewer *ui;
std::shared_ptr<IWIFile> mIWIFile; const IWIFile* mIWIFile;
}; };
#endif // IWIVIEWER_H #endif // IWIVIEWER_H

58
app/localstringviewer.cpp Normal file
View File

@ -0,0 +1,58 @@
#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,7 +1,7 @@
#ifndef LOCALSTRINGVIEWER_H #ifndef LOCALSTRINGVIEWER_H
#define LOCALSTRINGVIEWER_H #define LOCALSTRINGVIEWER_H
#include "asset_structs.h" #include "xlocalizeentry.h"
#include "zonefile.h" #include "zonefile.h"
#include <QWidget> #include <QWidget>
@ -20,15 +20,15 @@ public:
void SetVersion(quint32 aVersion); void SetVersion(quint32 aVersion);
void SetConfigPath(const QString aConfigPath); void SetConfigPath(const QString aConfigPath);
void SetFileNotes(const QString aFileNotes); void SetFileNotes(const QString aFileNotes);
void AddLocalString(LocalString aLocalString); void AddLocalString(XLocalizeEntry aLocalString);
void SetZoneFile(std::shared_ptr<ZoneFile> aZoneFile); void SetZoneFile(const ZoneFile *aZoneFile);
private: private:
Ui::LocalStringViewer *ui; Ui::LocalStringViewer *ui;
quint32 mVersion; quint32 mVersion;
QString mConfigPath; QString mConfigPath;
QString mFileNotes; QString mFileNotes;
QVector<LocalString> mLocalStrings; QVector<XLocalizeEntry> mLocalStrings;
}; };
#endif // LOCALSTRINGVIEWER_H #endif // LOCALSTRINGVIEWER_H

View File

@ -142,7 +142,7 @@
</layout> </layout>
</item> </item>
<item> <item>
<widget class="QGroupBox" name="groupBox_2"> <widget class="QGroupBox" name="groupBox_LocalStrViewer">
<property name="minimumSize"> <property name="minimumSize">
<size> <size>
<width>400</width> <width>400</width>

11
app/main.cpp Normal file
View File

@ -0,0 +1,11 @@
#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,17 +1,33 @@
#include "mainwindow.h" #include "mainwindow.h"
#include "qtimer.h"
#include "ui_mainwindow.h"
#include "aboutdialog.h" #include "aboutdialog.h"
#include "fastfile.h" #include "fastfile.h"
#include "qheaderview.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 "techsetviewer.h"
#include "ui_mainwindow.h" #include "fastfile_factory.h"
#include "compressor.h"
#include "dds_structs.h"
#include "iwifile.h" #include "iwifile.h"
#include "ddsfile.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 <qmath.h> #include <QtMath>
#include "DevILSDK/include/IL/il.h"
MainWindow::MainWindow(QWidget *parent) MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent), ui(new Ui::MainWindow) { : QMainWindow(parent), ui(new Ui::MainWindow) {
@ -19,10 +35,12 @@ MainWindow::MainWindow(QWidget *parent)
setAcceptDrops(true); setAcceptDrops(true);
XAsset::SetDebug(true);
mTypeMap = QMap<QString, int>(); mTypeMap = QMap<QString, int>();
mTypeOrder = QStringList(); mTypeOrder = QStringList();
mRawFileMap = QMap<QString, QString>(); mRawFileMap = QMap<QString, QString>();
mImageMap = QMap<QString, Image>(); //mImageMap = QMap<QString, Image>();
mTreeMap = QMap<QString, QTreeWidgetItem *>(); mTreeMap = QMap<QString, QTreeWidgetItem *>();
mStrTableMap = QMap<QString, QVector<QPair<QString, QString>>>(); mStrTableMap = QMap<QString, QVector<QPair<QString, QString>>>();
mBSPVersion = 0; mBSPVersion = 0;
@ -30,9 +48,42 @@ MainWindow::MainWindow(QWidget *parent)
mDiskLumpOrder = QVector<quint32>(); mDiskLumpOrder = QVector<quint32>();
mLumps = QMap<quint32, Lump>(); mLumps = QMap<quint32, Lump>();
mTreeWidget = new XTreeWidget(this); mTreeWidget = new XTreeWidget(this);
mLogWidget = new QPlainTextEdit(this);
//ModelViewer *mModelViewer = new ModelViewer(container); mProgressBar = new QProgressBar(this);
//mModelViewer->setAcceptDrops(false); 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); ui->tabWidget->setContextMenuPolicy(Qt::CustomContextMenu);
connect(ui->tabWidget, &QTabWidget::customContextMenuRequested, this, [this](const QPoint &pos) { connect(ui->tabWidget, &QTabWidget::customContextMenuRequested, this, [this](const QPoint &pos) {
@ -104,152 +155,304 @@ MainWindow::MainWindow(QWidget *parent)
ui->tabWidget->removeTab(index); ui->tabWidget->removeTab(index);
}); });
connect(mTreeWidget, &XTreeWidget::RawFileSelected, this, [this](std::shared_ptr<RawFile> rawFile) { connect(mTreeWidget, &XTreeWidget::Cleared, this, [this]() {
QPlainTextEdit *scriptEditor = new QPlainTextEdit(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->setAcceptDrops(false);
scriptEditor->setProperty("PARENT_NAME", QVariant::fromValue(aParentName));
scriptEditor->setFont(QFont("Consolas"));
if (rawFile->contents.isEmpty()) { // if (rawFile->contents.isEmpty()) {
scriptEditor->setPlainText("EMPTY"); // scriptEditor->setPlainText("EMPTY");
} else { // } else {
scriptEditor->setPlainText(rawFile->contents); // scriptEditor->setPlainText(rawFile->contents);
} // }
QString fileStem = rawFile->path.split('/').last(); QString fileStem;// = rawFile->path.split('/').last();
for (int i = 0; i < ui->tabWidget->count(); i++) { for (int i = 0; i < ui->tabWidget->count(); i++) {
if (ui->tabWidget->tabText(i) == fileStem) { if (ui->tabWidget->tabText(i) == fileStem) {
delete scriptEditor;
return; 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->addTab(scriptEditor, fileStem);
ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, QIcon(":/icons/icons/Icon_GSCFile.png")); ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, Utils::CreateAssetIcon(ASSET_TYPE_RAWFILE));
ui->tabWidget->setCurrentIndex(ui->tabWidget->count() - 1); ui->tabWidget->setCurrentIndex(ui->tabWidget->count() - 1);
}); });
connect(mTreeWidget, &XTreeWidget::ImageSelected, this, [this](std::shared_ptr<Image> image) { // connect(mTreeWidget, &XTreeWidget::ImageSelected, this, [this](std::shared_ptr<Image> image, const QString aParentName) {
ImageWidget *mImageWidget = new ImageWidget(this); // ImageWidget *mImageWidget = new ImageWidget(this);
mImageWidget->setAcceptDrops(false); // mImageWidget->setAcceptDrops(false);
mImageWidget->SetImage(image); // mImageWidget->SetImage(image);
// mImageWidget->setProperty("PARENT_NAME", QVariant::fromValue(aParentName));
QString fileStem = image->materialName; // QString fileStem = image->materialName;
for (int i = 0; i < ui->tabWidget->count(); i++) { // for (int i = 0; i < ui->tabWidget->count(); i++) {
if (ui->tabWidget->tabText(i) == fileStem) { // if (ui->tabWidget->tabText(i) == fileStem) {
return; // delete mImageWidget;
} // return;
} // }
// }
ui->tabWidget->addTab(mImageWidget, fileStem); // ui->tabWidget->addTab(mImageWidget, fileStem);
ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, QIcon(":/icons/icons/Icon_Image.png")); // 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); ui->tabWidget->setCurrentIndex(ui->tabWidget->count() - 1);
}); });
connect(mTreeWidget, &XTreeWidget::MenuSelected, this, [this](std::shared_ptr<Menu> menu) { connect(mTreeWidget, &XTreeWidget::DDSFileSelected, this, [this](const DDSFile* ddsFile, const QString aParentName) {
Q_UNUSED(menu);
});
connect(mTreeWidget, &XTreeWidget::DDSFileSelected, this, [this](std::shared_ptr<DDSFile> ddsFile) {
DDSViewer *ddsViewer = new DDSViewer(this); DDSViewer *ddsViewer = new DDSViewer(this);
ddsViewer->setAcceptDrops(false); ddsViewer->setAcceptDrops(false);
ddsViewer->SetDDSFile(ddsFile); ddsViewer->SetDDSFile(ddsFile);
ddsViewer->setProperty("PARENT_NAME", QVariant::fromValue(aParentName));
QString fileStem = ddsFile->fileStem + ".dds"; QString fileStem = ddsFile->fileStem + ".dds";
for (int i = 0; i < ui->tabWidget->count(); i++) { for (int i = 0; i < ui->tabWidget->count(); i++) {
if (ui->tabWidget->tabText(i) == fileStem) { if (ui->tabWidget->tabText(i) == fileStem) {
delete ddsViewer;
return; return;
} }
} }
ui->tabWidget->addTab(ddsViewer, fileStem); ui->tabWidget->addTab(ddsViewer, fileStem);
ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, QIcon(":/icons/icons/Icon_DDSFile.png")); ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, Utils::CreateAssetIcon(ASSET_TYPE_IMAGE));
ui->tabWidget->setCurrentIndex(ui->tabWidget->count() - 1); ui->tabWidget->setCurrentIndex(ui->tabWidget->count() - 1);
}); });
connect(mTreeWidget, &XTreeWidget::IWIFileSelected, this, [this](std::shared_ptr<IWIFile> iwiFile) { connect(mTreeWidget, &XTreeWidget::IWIFileSelected, this, [this](const IWIFile* iwiFile, const QString aParentName) {
IWIViewer *iwiViewer = new IWIViewer(this); IWIViewer *iwiViewer = new IWIViewer(this);
iwiViewer->setAcceptDrops(false); iwiViewer->setAcceptDrops(false);
iwiViewer->SetIWIFile(iwiFile); iwiViewer->SetIWIFile(iwiFile);
iwiViewer->setProperty("PARENT_NAME", QVariant::fromValue(aParentName));
QString fileStem = iwiFile->fileStem + ".iwi"; QString fileStem = iwiFile->fileStem + ".iwi";
for (int i = 0; i < ui->tabWidget->count(); i++) { for (int i = 0; i < ui->tabWidget->count(); i++) {
if (ui->tabWidget->tabText(i) == fileStem) { if (ui->tabWidget->tabText(i) == fileStem) {
delete iwiViewer;
return; return;
} }
} }
ui->tabWidget->addTab(iwiViewer, fileStem); ui->tabWidget->addTab(iwiViewer, fileStem);
ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, QIcon(":/icons/icons/Icon_IWIFile.png")); ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, Utils::CreateAssetIcon(ASSET_TYPE_IMAGE));
ui->tabWidget->setCurrentIndex(ui->tabWidget->count() - 1); ui->tabWidget->setCurrentIndex(ui->tabWidget->count() - 1);
}); });
connect(mTreeWidget, &XTreeWidget::FastFileSelected, this, [this](std::shared_ptr<FastFile> aFastFile) { connect(mTreeWidget, &XTreeWidget::FastFileSelected, this, [this](const FastFile* aFastFile, const QString aParentName) {
FastFileViewer *fastFileViewer = new FastFileViewer(this); FastFileViewer *fastFileViewer = new FastFileViewer(this);
fastFileViewer->setAcceptDrops(false); fastFileViewer->setAcceptDrops(false);
fastFileViewer->SetFastFile(aFastFile); fastFileViewer->SetFastFile(aFastFile);
fastFileViewer->setProperty("PARENT_NAME", QVariant::fromValue(aParentName));
QString fileStem = aFastFile->GetFileStem(); QString fileStem = aFastFile->GetStem();
for (int i = 0; i < ui->tabWidget->count(); i++) { for (int i = 0; i < ui->tabWidget->count(); i++) {
if (ui->tabWidget->tabText(i) == fileStem) { if (ui->tabWidget->tabText(i) == fileStem) {
delete fastFileViewer;
return; return;
} }
} }
ui->tabWidget->addTab(fastFileViewer, fileStem); ui->tabWidget->addTab(fastFileViewer, fileStem);
ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, QIcon(":/icons/icons/Icon_FastFile.png")); ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, Utils::CreateAssetIcon("FF"));
ui->tabWidget->setCurrentIndex(ui->tabWidget->count() - 1); ui->tabWidget->setCurrentIndex(ui->tabWidget->count() - 1);
}); });
connect(mTreeWidget, &XTreeWidget::ZoneFileSelected, this, [this](std::shared_ptr<ZoneFile> aZoneFile) { connect(mTreeWidget, &XTreeWidget::ZoneFileSelected, this, [this](const ZoneFile* aZoneFile, const QString aParentName) {
ZoneFileViewer *zoneFileViewer = new ZoneFileViewer(this); ZoneFileViewer *zoneFileViewer = new ZoneFileViewer(this);
zoneFileViewer->setAcceptDrops(false); zoneFileViewer->setAcceptDrops(false);
zoneFileViewer->SetZoneFile(aZoneFile); zoneFileViewer->SetZoneFile(aZoneFile);
zoneFileViewer->setProperty("PARENT_NAME", QVariant::fromValue(aParentName));
QString fileStem = aZoneFile->GetFileStem(); QString fileStem = aZoneFile->GetBaseStem() + ".zone";
for (int i = 0; i < ui->tabWidget->count(); i++) { for (int i = 0; i < ui->tabWidget->count(); i++) {
if (ui->tabWidget->tabText(i) == fileStem) { if (ui->tabWidget->tabText(i) == fileStem) {
delete zoneFileViewer;
return; return;
} }
} }
ui->tabWidget->addTab(zoneFileViewer, fileStem); QWidget *containerWidget = new QWidget();
ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, QIcon(":/icons/icons/Icon_ZoneFile.png")); 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); ui->tabWidget->setCurrentIndex(ui->tabWidget->count() - 1);
}); });
connect(mTreeWidget, &XTreeWidget::LocalStringSelected, this, [this](std::shared_ptr<ZoneFile> aZoneFile) { connect(mTreeWidget, &XTreeWidget::LocalStringSelected, this, [this](const ZoneFile* aZoneFile, const QString aParentName) {
LocalStringViewer *localStrViewer = new LocalStringViewer(this); LocalStringViewer *localStrViewer = new LocalStringViewer(this);
localStrViewer->setAcceptDrops(false); localStrViewer->setAcceptDrops(false);
localStrViewer->SetZoneFile(aZoneFile); localStrViewer->SetZoneFile(aZoneFile);
localStrViewer->setProperty("PARENT_NAME", QVariant::fromValue(aParentName));
QString fileStem = aZoneFile->GetFileStem() + ".str"; QString fileStem = aZoneFile->GetStem() + ".str";
for (int i = 0; i < ui->tabWidget->count(); i++) { for (int i = 0; i < ui->tabWidget->count(); i++) {
if (ui->tabWidget->tabText(i) == fileStem) { if (ui->tabWidget->tabText(i) == fileStem) {
delete localStrViewer;
return; return;
} }
} }
ui->tabWidget->addTab(localStrViewer, fileStem); ui->tabWidget->addTab(localStrViewer, fileStem);
ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, QIcon(":/icons/icons/Icon_String.png")); ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, Utils::CreateAssetIcon(ASSET_TYPE_LOCALIZE_ENTRY));
ui->tabWidget->setCurrentIndex(ui->tabWidget->count() - 1); ui->tabWidget->setCurrentIndex(ui->tabWidget->count() - 1);
}); });
connect(mTreeWidget, &XTreeWidget::TechSetSelected, this, [this](std::shared_ptr<TechSet> aTechSet) { connect(mTreeWidget, &XTreeWidget::TechSetSelected, this, [this](const XMaterialTechniqueSet* aTechSet, const QString aParentName) {
TechSetViewer *techSetViewer = new TechSetViewer(this); TechSetViewer *techSetViewer = new TechSetViewer(this);
techSetViewer->setAcceptDrops(false); techSetViewer->setAcceptDrops(false);
techSetViewer->SetTechSet(aTechSet); techSetViewer->SetTechSet(aTechSet);
techSetViewer->setProperty("PARENT_NAME", QVariant::fromValue(aParentName));
QString fileStem = aTechSet->name; QString fileStem = aTechSet->GetName();
for (int i = 0; i < ui->tabWidget->count(); i++) { for (int i = 0; i < ui->tabWidget->count(); i++) {
if (ui->tabWidget->tabText(i) == fileStem) { if (ui->tabWidget->tabText(i) == fileStem) {
delete techSetViewer;
return; return;
} }
} }
ui->tabWidget->addTab(techSetViewer, aTechSet->name); ui->tabWidget->addTab(techSetViewer, aTechSet->GetName());
ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, QIcon(":/icons/icons/Icon_TechSetFile.png")); ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, Utils::CreateAssetIcon(ASSET_TYPE_TECHNIQUE_SET));
ui->tabWidget->setCurrentIndex(ui->tabWidget->count() - 1); 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 Help > About dialog
connect(ui->actionAbout, &QAction::triggered, this, [this](bool checked) { connect(ui->actionAbout, &QAction::triggered, this, [this](bool checked) {
Q_UNUSED(checked); Q_UNUSED(checked);
@ -273,8 +476,14 @@ MainWindow::MainWindow(QWidget *parent)
QDockWidget *treeDockWidget = new QDockWidget(this); QDockWidget *treeDockWidget = new QDockWidget(this);
treeDockWidget->setWidget(mTreeWidget); treeDockWidget->setWidget(mTreeWidget);
treeDockWidget->setWindowTitle("Tree Browser");
addDockWidget(Qt::LeftDockWidgetArea, treeDockWidget); 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_Fast_File);
ui->toolBar->addAction(ui->actionNew_Zone_File); ui->toolBar->addAction(ui->actionNew_Zone_File);
ui->toolBar->addAction(ui->actionOpen_Fast_File); ui->toolBar->addAction(ui->actionOpen_Fast_File);
@ -318,17 +527,35 @@ void MainWindow::Reset() {
and opens the selected file. and opens the selected file.
*/ */
bool MainWindow::OpenFastFile(const QString aFastFilePath) { bool MainWindow::OpenFastFile(const QString aFastFilePath) {
FastFile fastFile; const QString fastFileStem = aFastFilePath.section("/", -1, -1);
if (!fastFile.Load(aFastFilePath)) { if (mTreeWidget->HasFastFile(fastFileStem)) {
qDebug() << "Error: Failed to load fast file!"; LogManager::instance().addError("Can't add duplicate file!");
return false; return false;
} }
mTreeWidget->AddFastFile(std::make_shared<FastFile>(fastFile));
FastFile* fastFile = FastFile::Open(aFastFilePath);
fastFile->SetStem(fastFileStem);
mTreeWidget->AddFastFile(fastFile);
// Open zone file after decompressing ff and writing // 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; return false;
} }
FastFile* fastFile = FastFile::Open(aFastFileData);
fastFile->SetStem(fastFileStem);
mTreeWidget->AddFastFile(fastFile);
// Open zone file after decompressing ff and writing
return true;
}
/* /*
OpenFastFile() OpenFastFile()
@ -336,11 +563,13 @@ bool MainWindow::OpenFastFile(const QString aFastFilePath) {
and opens the selected file. and opens the selected file.
*/ */
bool MainWindow::OpenFastFile() { bool MainWindow::OpenFastFile() {
const QString fastFileName = Utils::GetOpenFastFileName(); // Open file dialog to steam apps
if (!OpenFastFile(fastFileName)) { const QString steamPath = "C:/Program Files (x86)/Steam/steamapps/common/Call of Duty World at War/zone/english/";
qDebug() << "Failed to open Fast file!";
return false; QFileDialog::getOpenFileContent(tr("Fast File (*.ff);;All Files (*.*)"), [this](const QString &fileName, const QByteArray &data){
} OpenFastFile(data, fileName);
});
return true; return true;
} }
@ -351,21 +580,28 @@ bool MainWindow::OpenFastFile() {
and opens the selected file. and opens the selected file.
*/ */
bool MainWindow::OpenZoneFile(const QString aZoneFilePath, bool fromFF) { bool MainWindow::OpenZoneFile(const QString aZoneFilePath, bool fromFF) {
Q_UNUSED(aZoneFilePath);
Q_UNUSED(fromFF); Q_UNUSED(fromFF);
ZoneFile zoneFile; // ZoneFile* zoneFile = ZoneFile::Create();
if (!zoneFile.Load(aZoneFilePath)) { // if (!zoneFile.Load(aZoneFilePath)) {
qDebug() << "Error: Failed to load zone file!"; // qDebug() << "Error: Failed to load zone file!";
return false; // return false;
} // }
mTreeWidget->AddZoneFile(std::make_shared<ZoneFile>(zoneFile)); // mTreeWidget->AddZoneFile(std::make_shared<ZoneFile>(zoneFile));
return true; return true;
} }
bool MainWindow::OpenZoneFile() { bool MainWindow::OpenZoneFile() {
const QString zoneFileName = Utils::GetOpenZoneFileName(); // Open file dialog to steam apps
if (!OpenZoneFile(zoneFileName)) { 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!"; qDebug() << "Failed to open Zone file!";
return false; return false;
} }
@ -437,7 +673,7 @@ quint32 DXT3 = 0x33545844; // 'DXT3'
quint32 DXT5 = 0x35545844; // 'DXT5' quint32 DXT5 = 0x35545844; // 'DXT5'
int MainWindow::LoadFile_IWI(const QString aFilePath) { int MainWindow::LoadFile_IWI(const QString aFilePath) {
mTreeWidget->AddIWIFile(std::make_shared<IWIFile>(aFilePath)); mTreeWidget->AddIWIFile(new IWIFile(aFilePath));
return 0; return 0;
} }
@ -448,17 +684,39 @@ int MainWindow::LoadFile_DDSFiles(const QStringList aFilePaths) {
qDebug() << "Error: Invalid filename " << filePath; qDebug() << "Error: Invalid filename " << filePath;
return -1; return -1;
} }
mTreeWidget->AddDDSFile(std::make_shared<DDSFile>(filePath)); mTreeWidget->AddDDSFile(new DDSFile(filePath));
} }
return 0; 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) { int MainWindow::LoadFile_DDS(const QString aFilePath) {
if (!aFilePath.endsWith(".dds", Qt::CaseInsensitive)) { if (!aFilePath.endsWith(".dds", Qt::CaseInsensitive)) {
qDebug() << "Error: Invalid filename " << aFilePath; qDebug() << "Error: Invalid filename " << aFilePath;
return -1; return -1;
} }
mTreeWidget->AddDDSFile(std::make_shared<DDSFile>(aFilePath)); mTreeWidget->AddDDSFile(new DDSFile(aFilePath));
return 0; return 0;
} }
@ -531,7 +789,7 @@ int MainWindow::LoadFile_IPAK(const QString aFilePath) {
QVector<IPAKIndexEntry> entries = QVector<IPAKIndexEntry>(); QVector<IPAKIndexEntry> entries = QVector<IPAKIndexEntry>();
QVector<IPAKSection> sections = QVector<IPAKSection>(header.sectionCount); QVector<IPAKSection> sections = QVector<IPAKSection>(header.sectionCount);
for (uint i = 0; i < header.sectionCount; i++) { for (quint32 i = 0; i < header.sectionCount; i++) {
IPAKSection currentSection; IPAKSection currentSection;
stream >> currentSection; stream >> currentSection;
sections << currentSection; sections << currentSection;
@ -553,7 +811,7 @@ int MainWindow::LoadFile_IPAK(const QString aFilePath) {
<< " - Count: " << chunkHeader.count << "\n" << " - Count: " << chunkHeader.count << "\n"
<< " - Offset: " << chunkHeader.offset; << " - Offset: " << chunkHeader.offset;
for (uint j = 0; j < 31; j++) { for (quint32 j = 0; j < 31; j++) {
IPAKDataChunkCommand command; IPAKDataChunkCommand command;
stream >> command; stream >> command;
if (!command.size) { continue; } if (!command.size) { continue; }
@ -563,7 +821,7 @@ int MainWindow::LoadFile_IPAK(const QString aFilePath) {
<< " - Compressed: " << command.compressed; << " - Compressed: " << command.compressed;
} }
for (uint j = 0; j < chunkHeader.count; j++) { for (quint32 j = 0; j < chunkHeader.count; j++) {
auto command = chunkHeader.commands[j]; auto command = chunkHeader.commands[j];
qDebug() << "Reading from " << stream.device()->pos(); qDebug() << "Reading from " << stream.device()->pos();
@ -572,7 +830,7 @@ int MainWindow::LoadFile_IPAK(const QString aFilePath) {
QString outputFilePath = outputFolder.filePath(QString("%1.iwi").arg(j)); QString outputFilePath = outputFolder.filePath(QString("%1.iwi").arg(j));
if (command.compressed) { if (command.compressed) {
data = Compressor::DecompressLZO(data); //data = Compression::DecompressLZO(data);
} }
QFile outputFile(outputFilePath); QFile outputFile(outputFilePath);
if (!outputFile.open(QIODevice::WriteOnly)) { if (!outputFile.open(QIODevice::WriteOnly)) {
@ -588,7 +846,7 @@ int MainWindow::LoadFile_IPAK(const QString aFilePath) {
stream.skipRawData(sizeof(quint32) * (31 - chunkHeader.count)); stream.skipRawData(sizeof(quint32) * (31 - chunkHeader.count));
qDebug() << stream.device()->pos(); qDebug() << stream.device()->pos();
} else if (sectionType == "Index") { } else if (sectionType == "Index") {
for (uint j = 0; j < currentSection.itemCount; j++) { for (quint32 j = 0; j < currentSection.itemCount; j++) {
IPAKIndexEntry entry; IPAKIndexEntry entry;
stream >> entry; stream >> entry;
@ -666,9 +924,9 @@ void MainWindow::dropEvent(QDropEvent *event) {
foreach (const QUrl url, mimeData->urls()) { foreach (const QUrl url, mimeData->urls()) {
const QString urlStr = url.toLocalFile(); const QString urlStr = url.toLocalFile();
if (urlStr.contains(".zone")) { if (urlStr.contains(".zone")) {
OpenZoneFile(urlStr); qDebug() << "OpenZoneFile Returned: " << OpenZoneFile(urlStr);
} else if (urlStr.contains(".ff")) { } else if (urlStr.contains(".ff")) {
OpenFastFile(urlStr); qDebug() << "OpenFastFile Returned: " << OpenFastFile(urlStr);
} else if (urlStr.contains(".ipak")) { } else if (urlStr.contains(".ipak")) {
qDebug() << "LoadFile_IPAK Returned: " << LoadFile_IPAK(urlStr); qDebug() << "LoadFile_IPAK Returned: " << LoadFile_IPAK(urlStr);
} else if (urlStr.contains(".xsub")) { } else if (urlStr.contains(".xsub")) {
@ -689,11 +947,11 @@ void MainWindow::dropEvent(QDropEvent *event) {
qDebug() << "LZO: Failed to read file!"; qDebug() << "LZO: Failed to read file!";
continue; continue;
} }
QByteArray data = Compressor::DecompressLZO(lzoFile.readAll()); QByteArray data;// = Compression::DecompressLZO(lzoFile.readAll());
lzoFile.close(); lzoFile.close();
if (data.isEmpty()) { if (data.isEmpty()) {
qDebug() << "LZO: Decompressor gave empty result!"; qDebug() << "LZO: Decompression gave empty result!";
continue; continue;
} }

View File

@ -2,17 +2,7 @@
#define MAINWINDOW_H #define MAINWINDOW_H
#include "d3dbsp_structs.h" #include "d3dbsp_structs.h"
#include "asset_structs.h"
#include "ddsviewer.h"
#include "fastfileviewer.h"
#include "ipak_structs.h"
#include "iwiviewer.h"
#include "localstringviewer.h"
#include "modelviewer.h"
#include "imagewidget.h"
#include "xtreewidget.h" #include "xtreewidget.h"
#include "zonefileviewer.h"
#include "techsetviewer.h"
#include <QMainWindow> #include <QMainWindow>
#include <QFileDialog> #include <QFileDialog>
@ -24,7 +14,7 @@
#include <QDockWidget> #include <QDockWidget>
#include <QPlainTextEdit> #include <QPlainTextEdit>
#include <QMimeData> #include <QMimeData>
#include <windows.h> #include <QProgressBar>
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
namespace Ui { namespace Ui {
@ -43,6 +33,7 @@ public:
private slots: private slots:
bool OpenFastFile(const QString aFastFilePath); bool OpenFastFile(const QString aFastFilePath);
bool OpenFastFile(const QByteArray& aFastFileData, const QString aFastFilePath);
bool OpenFastFile(); bool OpenFastFile();
bool OpenZoneFile(const QString aZoneFilePath, bool fromFF = false); bool OpenZoneFile(const QString aZoneFilePath, bool fromFF = false);
@ -55,6 +46,10 @@ private slots:
int LoadFile_DDS(const QString aFilePath); int LoadFile_DDS(const QString aFilePath);
int LoadFile_DDSFiles(const QStringList aFilePaths); 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: protected:
void dragEnterEvent(QDragEnterEvent *event) override; void dragEnterEvent(QDragEnterEvent *event) override;
void dragMoveEvent(QDragMoveEvent *event) override; void dragMoveEvent(QDragMoveEvent *event) override;
@ -68,10 +63,12 @@ private:
quint32 mTagCount; quint32 mTagCount;
quint32 mRecordCount; quint32 mRecordCount;
QMap<QString, QString> mRawFileMap; QMap<QString, QString> mRawFileMap;
QMap<QString, Image> mImageMap; //QMap<QString, Image> mImageMap;
QMap<QString, QTreeWidgetItem*> mTreeMap; QMap<QString, QTreeWidgetItem*> mTreeMap;
QMap<QString, QVector<QPair<QString, QString>>> mStrTableMap; QMap<QString, QVector<QPair<QString, QString>>> mStrTableMap;
XTreeWidget *mTreeWidget; XTreeWidget *mTreeWidget;
QPlainTextEdit *mLogWidget;
QProgressBar *mProgressBar;
quint32 mBSPVersion; quint32 mBSPVersion;
quint32 mDiskLumpCount; quint32 mDiskLumpCount;

View File

@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>986</width> <width>1579</width>
<height>692</height> <height>857</height>
</rect> </rect>
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
@ -46,11 +46,11 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>986</width> <width>1579</width>
<height>21</height> <height>21</height>
</rect> </rect>
</property> </property>
<widget class="QMenu" name="menuFile"> <widget class="QMenu" name="MenuDef">
<property name="title"> <property name="title">
<string>File</string> <string>File</string>
</property> </property>
@ -58,17 +58,11 @@
<property name="title"> <property name="title">
<string>Recent...</string> <string>Recent...</string>
</property> </property>
<property name="icon">
<iconset theme="QIcon::ThemeIcon::DocumentOpenRecent"/>
</property>
</widget> </widget>
<widget class="QMenu" name="menuImport"> <widget class="QMenu" name="menuImport">
<property name="title"> <property name="title">
<string>Import...</string> <string>Import...</string>
</property> </property>
<property name="icon">
<iconset theme="QIcon::ThemeIcon::FolderNew"/>
</property>
</widget> </widget>
<addaction name="actionNew_File_2"/> <addaction name="actionNew_File_2"/>
<addaction name="actionNew_Fast_File"/> <addaction name="actionNew_Fast_File"/>
@ -114,6 +108,8 @@
<addaction name="menuUndo_History"/> <addaction name="menuUndo_History"/>
<addaction name="menuRedo_History"/> <addaction name="menuRedo_History"/>
<addaction name="actionClear_Undo_History"/> <addaction name="actionClear_Undo_History"/>
<addaction name="separator"/>
<addaction name="actionPreferences"/>
</widget> </widget>
<widget class="QMenu" name="menuHelp"> <widget class="QMenu" name="menuHelp">
<property name="title"> <property name="title">
@ -121,9 +117,17 @@
</property> </property>
<addaction name="actionAbout"/> <addaction name="actionAbout"/>
<addaction name="actionCheck_for_Updates"/> <addaction name="actionCheck_for_Updates"/>
<addaction name="actionReport_Issue"/>
</widget> </widget>
<addaction name="menuFile"/> <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="menuEdit"/>
<addaction name="menuTools"/>
<addaction name="menuHelp"/> <addaction name="menuHelp"/>
</widget> </widget>
<widget class="QToolBar" name="toolBar"> <widget class="QToolBar" name="toolBar">
@ -140,7 +144,8 @@
<widget class="QStatusBar" name="statusBar"/> <widget class="QStatusBar" name="statusBar"/>
<action name="actionNew_File_2"> <action name="actionNew_File_2">
<property name="icon"> <property name="icon">
<iconset theme="QIcon::ThemeIcon::DocumentNew"/> <iconset resource="../data/data.qrc">
<normaloff>:/icons/icons/Icon_NewFile.png</normaloff>:/icons/icons/Icon_NewFile.png</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>New</string> <string>New</string>
@ -148,7 +153,8 @@
</action> </action>
<action name="actionNew_Fast_File"> <action name="actionNew_Fast_File">
<property name="icon"> <property name="icon">
<iconset theme="QIcon::ThemeIcon::DocumentNew"/> <iconset resource="../data/data.qrc">
<normaloff>:/icons/icons/Icon_NewFile.png</normaloff>:/icons/icons/Icon_NewFile.png</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>New Fast File</string> <string>New Fast File</string>
@ -156,7 +162,8 @@
</action> </action>
<action name="actionNew_Zone_File"> <action name="actionNew_Zone_File">
<property name="icon"> <property name="icon">
<iconset theme="QIcon::ThemeIcon::DocumentNew"/> <iconset resource="../data/data.qrc">
<normaloff>:/icons/icons/Icon_NewFile.png</normaloff>:/icons/icons/Icon_NewFile.png</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>New Zone File</string> <string>New Zone File</string>
@ -164,7 +171,8 @@
</action> </action>
<action name="actionOpen_Fast_File"> <action name="actionOpen_Fast_File">
<property name="icon"> <property name="icon">
<iconset theme="QIcon::ThemeIcon::DocumentOpen"/> <iconset resource="../data/data.qrc">
<normaloff>:/icons/icons/Icon_OpenFile.png</normaloff>:/icons/icons/Icon_OpenFile.png</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>Open Fast File</string> <string>Open Fast File</string>
@ -172,7 +180,8 @@
</action> </action>
<action name="actionOpen_Zone_File"> <action name="actionOpen_Zone_File">
<property name="icon"> <property name="icon">
<iconset theme="QIcon::ThemeIcon::DocumentOpen"/> <iconset resource="../data/data.qrc">
<normaloff>:/icons/icons/Icon_OpenFile.png</normaloff>:/icons/icons/Icon_OpenFile.png</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>Open Zone File</string> <string>Open Zone File</string>
@ -180,7 +189,8 @@
</action> </action>
<action name="actionOpen_Folder"> <action name="actionOpen_Folder">
<property name="icon"> <property name="icon">
<iconset theme="QIcon::ThemeIcon::DocumentOpen"/> <iconset resource="../data/data.qrc">
<normaloff>:/icons/icons/Icon_OpenFile.png</normaloff>:/icons/icons/Icon_OpenFile.png</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>Open Folder</string> <string>Open Folder</string>
@ -188,16 +198,14 @@
</action> </action>
<action name="actionSave"> <action name="actionSave">
<property name="icon"> <property name="icon">
<iconset theme="QIcon::ThemeIcon::DocumentSave"/> <iconset resource="../data/data.qrc">
<normaloff>:/icons/icons/Icon_Save.png</normaloff>:/icons/icons/Icon_Save.png</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>Save</string> <string>Save</string>
</property> </property>
</action> </action>
<action name="actionSave_As"> <action name="actionSave_As">
<property name="icon">
<iconset theme="QIcon::ThemeIcon::DocumentSaveAs"/>
</property>
<property name="text"> <property name="text">
<string>Save As</string> <string>Save As</string>
</property> </property>
@ -248,24 +256,19 @@
</property> </property>
</action> </action>
<action name="actionUndo"> <action name="actionUndo">
<property name="icon">
<iconset theme="QIcon::ThemeIcon::EditUndo"/>
</property>
<property name="text"> <property name="text">
<string>Undo</string> <string>Undo</string>
</property> </property>
</action> </action>
<action name="actionRedo"> <action name="actionRedo">
<property name="icon">
<iconset theme="QIcon::ThemeIcon::EditRedo"/>
</property>
<property name="text"> <property name="text">
<string>Redo</string> <string>Redo</string>
</property> </property>
</action> </action>
<action name="actionCut"> <action name="actionCut">
<property name="icon"> <property name="icon">
<iconset theme="QIcon::ThemeIcon::EditCut"/> <iconset resource="../data/data.qrc">
<normaloff>:/icons/icons/Icon_Cut.png</normaloff>:/icons/icons/Icon_Cut.png</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>Cut</string> <string>Cut</string>
@ -273,7 +276,8 @@
</action> </action>
<action name="actionCopy"> <action name="actionCopy">
<property name="icon"> <property name="icon">
<iconset theme="QIcon::ThemeIcon::EditCopy"/> <iconset resource="../data/data.qrc">
<normaloff>:/icons/icons/Icon_Copy.png</normaloff>:/icons/icons/Icon_Copy.png</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>Copy</string> <string>Copy</string>
@ -281,16 +285,14 @@
</action> </action>
<action name="actionPaste"> <action name="actionPaste">
<property name="icon"> <property name="icon">
<iconset theme="QIcon::ThemeIcon::EditPaste"/> <iconset resource="../data/data.qrc">
<normaloff>:/icons/icons/Icon_Paste.png</normaloff>:/icons/icons/Icon_Paste.png</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>Paste</string> <string>Paste</string>
</property> </property>
</action> </action>
<action name="actionRename"> <action name="actionRename">
<property name="icon">
<iconset theme="QIcon::ThemeIcon::MailMessageNew"/>
</property>
<property name="text"> <property name="text">
<string>Rename</string> <string>Rename</string>
</property> </property>
@ -306,9 +308,6 @@
</property> </property>
</action> </action>
<action name="actionDelete"> <action name="actionDelete">
<property name="icon">
<iconset theme="QIcon::ThemeIcon::EditDelete"/>
</property>
<property name="text"> <property name="text">
<string>Delete</string> <string>Delete</string>
</property> </property>
@ -334,9 +333,6 @@
</property> </property>
</action> </action>
<action name="actionAbout"> <action name="actionAbout">
<property name="icon">
<iconset theme="QIcon::ThemeIcon::HelpAbout"/>
</property>
<property name="text"> <property name="text">
<string>About</string> <string>About</string>
</property> </property>
@ -347,22 +343,37 @@
</property> </property>
</action> </action>
<action name="actionCheck_for_Updates"> <action name="actionCheck_for_Updates">
<property name="icon">
<iconset theme="QIcon::ThemeIcon::SyncSynchronizing"/>
</property>
<property name="text"> <property name="text">
<string>Check for Updates</string> <string>Check for Updates</string>
</property> </property>
</action> </action>
<action name="actionFind_2"> <action name="actionFind_2">
<property name="icon"> <property name="icon">
<iconset theme="QIcon::ThemeIcon::EditFind"/> <iconset resource="../data/data.qrc">
<normaloff>:/icons/icons/Icon_Find.png</normaloff>:/icons/icons/Icon_Find.png</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>Find</string> <string>Find</string>
</property> </property>
</action> </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> </widget>
<resources/> <resources>
<include location="../data/data.qrc"/>
</resources>
<connections/> <connections/>
</ui> </ui>

43
app/materialviewer.cpp Normal file
View File

@ -0,0 +1,43 @@
#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));
}

27
app/materialviewer.h Normal file
View File

@ -0,0 +1,27 @@
#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

236
app/materialviewer.ui Normal file
View File

@ -0,0 +1,236 @@
<?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>

14
app/modelviewer.cpp Normal file
View File

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

22
app/modelviewer.h Normal file
View File

@ -0,0 +1,22 @@
#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

624
app/modelviewer.ui Normal file
View File

@ -0,0 +1,624 @@
<?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>

35
app/preferenceeditor.cpp Normal file
View File

@ -0,0 +1,35 @@
#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;
}

22
app/preferenceeditor.h Normal file
View File

@ -0,0 +1,22 @@
#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

528
app/preferenceeditor.ui Normal file
View File

@ -0,0 +1,528 @@
<?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>

103
app/reportissuedialog.cpp Normal file
View File

@ -0,0 +1,103 @@
#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();
}

43
app/reportissuedialog.h Normal file
View File

@ -0,0 +1,43 @@
#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

84
app/reportissuedialog.ui Normal file
View File

@ -0,0 +1,84 @@
<?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>

58
app/rumblefileviewer.cpp Normal file
View File

@ -0,0 +1,58 @@
#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;
// }
}

28
app/rumblefileviewer.h Normal file
View File

@ -0,0 +1,28 @@
#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

153
app/rumblefileviewer.ui Normal file
View File

@ -0,0 +1,153 @@
<?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>

54
app/rumblegraphviewer.cpp Normal file
View File

@ -0,0 +1,54 @@
#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);
}
}

30
app/rumblegraphviewer.h Normal file
View File

@ -0,0 +1,30 @@
#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

153
app/rumblegraphviewer.ui Normal file
View File

@ -0,0 +1,153 @@
<?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>

80
app/soundviewer.cpp Normal file
View File

@ -0,0 +1,80 @@
#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);
}

32
app/soundviewer.h Normal file
View File

@ -0,0 +1,32 @@
#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

2573
app/soundviewer.ui Normal file

File diff suppressed because it is too large Load Diff

35
app/stringtableviewer.cpp Normal file
View File

@ -0,0 +1,35 @@
#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++;
}
}

26
app/stringtableviewer.h Normal file
View File

@ -0,0 +1,26 @@
#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

24
app/stringtableviewer.ui Normal file
View File

@ -0,0 +1,24 @@
<?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>

25
app/techsetviewer.cpp Normal file
View File

@ -0,0 +1,25 @@
#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,7 +1,8 @@
#ifndef TECHSETVIEWER_H #ifndef TECHSETVIEWER_H
#define TECHSETVIEWER_H #define TECHSETVIEWER_H
#include "asset_structs.h" #include "xmaterialtechniqueset.h"
#include <QWidget> #include <QWidget>
namespace Ui { namespace Ui {
@ -16,7 +17,7 @@ public:
explicit TechSetViewer(QWidget *parent = nullptr); explicit TechSetViewer(QWidget *parent = nullptr);
~TechSetViewer(); ~TechSetViewer();
void SetTechSet(std::shared_ptr<TechSet> aTechSet); void SetTechSet(const XMaterialTechniqueSet *aTechSet);
private: private:
Ui::TechSetViewer *ui; Ui::TechSetViewer *ui;

151
app/techsetviewer.ui Normal file
View File

@ -0,0 +1,151 @@
<?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>

806
app/xtreewidget.cpp Normal file
View File

@ -0,0 +1,806 @@
#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;
}

67
app/xtreewidget.h Normal file
View File

@ -0,0 +1,67 @@
#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

56
app/xtreewidgetitem.cpp Normal file
View File

@ -0,0 +1,56 @@
#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;
}

36
app/xtreewidgetitem.h Normal file
View File

@ -0,0 +1,36 @@
#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

156
app/zonefileviewer.cpp Normal file
View File

@ -0,0 +1,156 @@
#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

@ -18,10 +18,16 @@ public:
explicit ZoneFileViewer(QWidget *parent = nullptr); explicit ZoneFileViewer(QWidget *parent = nullptr);
~ZoneFileViewer(); ~ZoneFileViewer();
void SetZoneFile(std::shared_ptr<ZoneFile> aZoneFile); void SetZoneFile(const ZoneFile *aZoneFile);
public slots:
void SortTags(const QString &aSearchText);
void HighlightRecordInOrder();
private: private:
Ui::ZoneFileViewer *ui; Ui::ZoneFileViewer *ui;
std::shared_ptr<ZoneFile> aZoneFile; const ZoneFile* mZoneFile;
}; };
#endif // ZONEFILEVIEWER_H #endif // ZONEFILEVIEWER_H

129
app/zonefileviewer.ui Normal file
View File

@ -0,0 +1,129 @@
<?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,346 +0,0 @@
#ifndef ASSET_STRUCTS_H
#define ASSET_STRUCTS_H
#include "enums.h"
#include <QString>
#include <QColor>
#include <QRectF>
struct LocalString {
QString string;
QString alias;
};
struct RawFile {
quint32 length;
QString path;
QString contents;
};
struct TechSet {
QString name;
bool hasShaders = false;
QVector<quint32> pointers;
};
struct Shader {
quint32 shaderPtr;
};
struct XModelCollSurf_s
{
float mins[3];
float maxs[3];
int boneIdx;
int contents;
int surfFlags;
};
struct XModelLodInfo
{
float dist;
unsigned short numsurfs;
unsigned short surfIndex;
int partBits[5];
};
struct XModelHighMipBounds
{
float mins[3];
float maxs[3];
};
struct XModelStreamInfo
{
XModelHighMipBounds *highMipBounds;
};
struct XBoneInfo
{
float bounds[2][3];
float offset[3];
float radiusSquared;
};
struct Model {
quint32 namePtr;
quint8 tagCount;
quint8 rootTagCount;
quint8 surfCount;
quint8 unknownCount;
quint32 boneNamePtr;
quint32 parentListPtr;
quint32 quatsPtr;
quint32 transPtr;
quint32 partClassPtr;
quint32 baseMatPtr;
quint32 surfsPtr;
quint32 materialHandlesPtr;
XModelLodInfo lodInfo[4];
quint32 collSurfsPtr;
int numCollSurfs;
int contents;
quint32 boneInfoPtr;
float radius;
float mins[3];
float maxs[3];
short numLods;
short collLod;
quint32 streamInfoPtr; // is not loaded on ps3
int memUsage;
char flags;
quint32 physPresetPtr;
quint32 physGeomsPtr;
QString modelName;
};
struct Animation {
quint16 dataByteCount;
quint16 dataShortCount;
quint16 dataIntCount;
quint16 randomDataByteCount;
quint16 randomDataIntCount;
quint16 numframes;
bool isLooped;
bool isDelta;
quint8 noneRotatedBoneCount;
quint8 twoDRotatedBoneCount;
quint8 normalRotatedBoneCount;
quint8 twoDStaticRotatedBoneCount;
quint8 normalStaticRotatedBoneCount;
quint8 normalTranslatedBoneCount;
quint8 preciseTranslatedBoneCount;
quint8 staticTranslatedBoneCount;
quint8 noneTranslatedBoneCount;
quint8 totalBoneCount;
quint8 otherBoneCount1;
quint8 otherBoneCount2;
quint8 notifyCount;
quint8 assetType;
bool pad;
unsigned int randomDataShortCount;
unsigned int indexCount;
float frameRate;
float frequency;
quint32 boneIDsPtr;
quint32 dataBytePtr;
quint32 dataShortPtr;
quint32 dataIntPtr;
quint32 randomDataShortPtr;
quint32 randomDataBytePtr;
quint32 randomDataIntPtr;
quint32 longIndiciesPtr;
quint32 notificationsPtr;
quint32 deltaPartsPtr;
QString name;
};
struct StringTable {
quint32 columnCount;
quint32 rowCount;
QString name;
};
struct Image {
QString name;
QString materialName;
quint32 size1;
quint32 size2;
IMAGE_COMPRESSION compression;
quint32 unknowna;
quint32 unknownb;
quint32 unknownc;
quint32 unknownd;
quint32 unknowne;
quint32 unknownf;
quint32 unknowng;
quint32 unknownh;
quint32 unknowni;
quint32 unknownj;
quint32 unknownk;
quint32 unknownl;
quint32 unknownm;
quint32 unknown1;
quint32 unknown2;
quint32 unknown3;
quint32 unknown4;
quint32 unknown5;
quint32 unknown6;
quint32 unknown7;
quint32 unknown8;
quint32 unknown9;
};
struct Menu {
QString filePath;
QString name;
QString definition;
quint32 menuNamePtr;
QRectF rect;
MENU_H_ALIGNMENT hAlign;
MENU_V_ALIGNMENT vAlign;
QRectF clientRect;
MENU_H_ALIGNMENT hClientAlign;
MENU_V_ALIGNMENT vClientAlign;
quint32 groupPtr;
MENU_WINDOW_STYLE style;
MENU_WINDOW_BORDER border;
quint32 ownerDraw;
quint32 ownerDrawFlags;
float borderSize;
int staticFlags;
float dynamicFlags;
float nextTime;
QColor foregroundColor;
QColor backgroundColor;
QColor borderColor;
QColor outlineColor;
quint32 materialPtr;
quint32 fontPtr;
quint32 fullScreen;
quint32 itemCount;
quint32 fontIndex;
quint32 cursorItem;
quint32 fadeCycle;
float fadeClamp;
float fadeAmount;
float fadeInAmount;
float blurRadius;
quint32 onOpenPtr;
quint32 onFocusPtr;
quint32 onClosePtr;
quint32 onESCPtr;
quint32 onKeyPtr;
quint32 visibleExpCount;
quint32 expEntryPtr;
quint32 allowedBindingPtr;
quint32 soundNamePtr;
quint32 imageTrack;
QColor focusColor;
QColor disabledColor;
quint32 rectXExpCount;
quint32 rectXExpPtr;
quint32 rectYExpCount;
quint32 rectYExpPtr;
quint32 itemWindowDefNamePtr;
QRectF itemRect;
MENU_H_ALIGNMENT itemHAlignment;
MENU_V_ALIGNMENT itemVAlignment;
quint32 itemGroupPtr;
MENU_WINDOW_STYLE itemWindowStyle;
MENU_WINDOW_BORDER itemWindowBorder;
quint32 itemOwnerDraw;
quint32 itemOwnerDrawFlags;
float itemBorderSize;
int itemStaticFlags;
int itemDynamicFlags;
int itemNextTime;
QColor itemForegroundColor;
QColor itemBackgroundColor;
QColor itemBorderColor;
QColor itemOutlineColor;
quint32 itemMaterialPtr;
QRectF itemTextRect;
MENU_H_ALIGNMENT itemText_hAlign;
MENU_V_ALIGNMENT itemText_vAlign;
MENU_ITEM_TYPE itemType;
quint32 dataType;
quint32 alignment;
MENU_FONT_TYPE fontEnum;
quint32 textAlignMode;
float textalignx;
float textaligny;
float textscale;
MENU_ITEM_TEXTSTYLE textStyle;
int gameMsgWindowIndex;
int gameMsgWindowMode;
quint32 testPtr;
quint32 textSavegameInfo;
quint32 parentPtr;
quint32 mouseEnterText;
quint32 mouseExitText;
quint32 mouseEnter;
quint32 mouseExit;
quint32 action;
quint32 onAccept;
quint32 onFocus;
quint32 leaveFocus;
quint32 dvar;
quint32 dvarTest;
quint32 keyHandlerPtr;
quint32 enableDvarPtr;
quint32 dvarFlags;
quint32 focusSoundPtr;
float special;
quint32 cursorPos;
// itemDefData_t typeData;
// listBoxDef_s *listBox;
quint32 startPos;
quint32 endPos;
quint32 drawPadding;
float elementWidth, elementHeight;
quint32 elementStyle, numColumns;
//columnInfo_s columnInfo[16];
quint32 doubleClickPtr;
int notselectable;
int noScrollBars;
int usePaging;
QColor itemSelectBorderColor;
QColor itemDisableColor;
QColor itemFocusColor;
quint32 selectIconPtr;
quint32 backgroundItemListboxPtr;
quint32 highlightTexturePtr;
// editFieldDef_s *editField;
float minVal;
float maxVal;
float defVal;
float range;
int maxChars;
int maxCharsGotoNext;
int maxPaintChars;
int paintOffset;
// multiDef_s *multi;
QVector<quint32> dvarListPtrs;
QVector<quint32> dvarStrPtrs;
QVector<float> dvarValues;
quint32 count;
quint32 strDef;
quint32 enumDvarNamePtr;
quint32 dataPtr;
quint32 itemImageTrack;
};
struct MenuFile {
quint32 menuCount;
QVector<Menu> menuDefs;
};
struct AssetMap {
QVector<LocalString> localStrings;
QVector<RawFile> rawFiles;
//QVector<PhysPreset> phyPresets;
QVector<Model> models;
//QVector<Material> rawFiles;
//QVector<Shader> shaders;
QVector<TechSet> techSets;
QVector<Image> images;
//QVector<Sound> sounds;
//QVector<CollisionMap> collMaps;
//QVector<LightDefinition> lightDefs;
//QVector<UiMap> uiMaps;
//QVector<DriverGlobal> driverGlobals;
//QVector<AiType> aiType;
//QVector<Effect> effects;
QVector<Animation> animations;
QVector<StringTable> stringTables;
QVector<MenuFile> menuFiles;
//QVector<Weapon> weapons;
//QVector<D3DBSP> d3dbspDumps;
//QVector<SingleplayerMap> spMaps;
};
#endif // ASSET_STRUCTS_H

View File

@ -1,410 +0,0 @@
#ifndef COMPRESSOR_H
#define COMPRESSOR_H
#include "utils.h"
#include "QtZlib/zlib.h"
#include "lzokay.hpp"
#include "lzx.h"
#include <stdint.h>
#include <stddef.h>
#include <QByteArray>
#include <QDebug>
#include <QDataStream>
#include <QVector>
#include <algorithm>
typedef enum {
EResult_LookbehindOverrun = -4,
EResult_OutputOverrun = -3,
EResult_InputOverrun = -2,
EResult_Error = -1,
EResult_Success = 0,
EResult_InputNotConsumed = 1,
} lzokay_EResult;
static_assert(EResult_LookbehindOverrun == lzokay_EResult(lzokay::EResult::LookbehindOverrun), "LookbehindOverrun mismatch");
static_assert(EResult_OutputOverrun == lzokay_EResult(lzokay::EResult::OutputOverrun), "OutputOverrun mismatch");
static_assert(EResult_InputOverrun == lzokay_EResult(lzokay::EResult::InputOverrun), "InputOverrun mismatch");
static_assert(EResult_Error == lzokay_EResult(lzokay::EResult::Error), "Error mismatch");
static_assert(EResult_Success == lzokay_EResult(lzokay::EResult::Success), "Success mismatch");
static_assert(EResult_InputNotConsumed == lzokay_EResult(lzokay::EResult::InputNotConsumed), "InputNotConsumed mismatch");
class Compressor {
public:
static QByteArray DecompressZLIB(const QByteArray &compressedData) {
if (compressedData.isEmpty())
return QByteArray();
// Set up the inflate stream.
z_stream strm;
memset(&strm, 0, sizeof(strm));
// The inflate() function needs a non-const pointer; this is safe as we never modify the input.
strm.next_in = reinterpret_cast<Bytef*>(const_cast<char*>(compressedData.data()));
strm.avail_in = static_cast<uInt>(compressedData.size());
// Use inflateInit(); if you want to support gzip streams, see note below.
int ret = inflateInit(&strm);
if (ret != Z_OK) {
qWarning() << "inflateInit failed:" << zError(ret);
return QByteArray();
}
QByteArray outArray;
char buffer[4096];
// Decompress until we reach the stream end.
do {
strm.next_out = reinterpret_cast<Bytef*>(buffer);
strm.avail_out = sizeof(buffer);
ret = inflate(&strm, Z_NO_FLUSH);
// Handle a special case: if inflate() returns Z_BUF_ERROR without
// having produced any output and with no further input, then we break out.
if (ret == Z_BUF_ERROR && strm.avail_in == 0) {
break;
}
if (ret != Z_OK && ret != Z_STREAM_END) {
qWarning() << "Error: ZLib inflate failed:" << zError(ret);
inflateEnd(&strm);
return QByteArray();
}
// Calculate number of bytes produced in this iteration.
int bytesProduced = sizeof(buffer) - strm.avail_out;
if (bytesProduced > 0)
outArray.append(buffer, bytesProduced);
} while (ret != Z_STREAM_END);
inflateEnd(&strm);
return outArray;
}
static QByteArray DecompressLZO(const QByteArray& input) {
lzokay::EResult error;
// Ensure the input QByteArray is valid
if (input.isEmpty()) {
qDebug() << "Input QByteArray is empty.";
return QByteArray();
}
// Step 1: Cast QByteArray to uint8_t*
const uint8_t *compressedData = reinterpret_cast<const uint8_t *>(input.constData());
std::size_t compressedSize = static_cast<std::size_t>(input.size());
// Step 2: Allocate a sufficiently large decompression buffer
// Use a large initial estimate if the decompressed size is unknown
std::size_t initialBufferSize = compressedSize * 20; // Arbitrary multiplier for decompression
std::unique_ptr<uint8_t[]> decompressed(new uint8_t[initialBufferSize]);
// Step 3: Attempt decompression
std::size_t decompressedSize = 0;
error = lzokay::decompress(
compressedData, compressedSize, // Input data and size
decompressed.get(), initialBufferSize, // Output buffer and initial size
decompressedSize // Actual decompressed size
);
// Step 4: Handle decompression errors
if (error != lzokay::EResult::Success) {
qDebug() << "Decompression failed with error code:" << static_cast<int>(error);
return QByteArray();
}
// Step 5: Return the decompressed data as a QByteArray
return QByteArray(reinterpret_cast<const char *>(decompressed.get()), decompressedSize);
}
static const int VECTOR_SIZE = 16; // 16 32-bit words
static const int NUM_OF_BLOCKS_PER_CHUNK = 8192;
//--------------------------------------------------------------------
// Helper functions (assuming littleendian order)
static void Convert32BitTo8Bit(quint32 value, quint8* array) {
array[0] = static_cast<quint8>(value >> 0);
array[1] = static_cast<quint8>(value >> 8);
array[2] = static_cast<quint8>(value >> 16);
array[3] = static_cast<quint8>(value >> 24);
}
static quint32 ConvertArrayTo32Bit(const QByteArray &array) {
return ((static_cast<quint32>(static_cast<uchar>(array[0])) << 0) |
(static_cast<quint32>(static_cast<uchar>(array[1])) << 8) |
(static_cast<quint32>(static_cast<uchar>(array[2])) << 16) |
(static_cast<quint32>(static_cast<uchar>(array[3])) << 24));
}
static quint32 Rotate(quint32 value, quint32 numBits) {
return (value << numBits) | (value >> (32 - numBits));
}
// Build the IV table from a 0x20byte feed. The table is 0xFB0 bytes.
static QByteArray InitIVTable(const QByteArray &feed) {
const int tableSize = 0xFB0;
QByteArray table;
table.resize(tableSize);
int ptr = 0;
for (int i = 0; i < 200; ++i) {
for (int x = 0; x < 5; ++x) {
if (static_cast<uchar>(feed.at(ptr)) == 0x00)
ptr = 0;
int base = i * 20 + x * 4;
table[base] = feed.at(ptr);
table[base + 1] = feed.at(ptr);
table[base + 2] = feed.at(ptr);
table[base + 3] = feed.at(ptr);
++ptr;
}
}
// Copy block numbers [1,0,0,0] into the last 16 bytes
QByteArray oneBlock;
oneBlock.append(char(1)); oneBlock.append(char(0)); oneBlock.append(char(0)); oneBlock.append(char(0));
table.replace(0xFA0, 4, oneBlock);
table.replace(0xFA4, 4, oneBlock);
table.replace(0xFA8, 4, oneBlock);
table.replace(0xFAC, 4, oneBlock);
return table;
}
// "unk" function as in the C# code.
static int unk(quint64 arg1, quint8 arg2) {
if (arg2 >= 0x40)
return 0;
return static_cast<int>(arg1 >> arg2);
}
// Compute the IV for a given section index using the IV table.
static QByteArray GetIV(const QByteArray &table, int index) {
int num1 = 0xFA0 + index;
int num2 = unk(0x51EB851FLL * num1, 0x20);
int adjust = ((num2 >> 6) + (num2 >> 31));
int startIndex = 20 * (num1 - 200 * adjust);
// Return 8 bytes from that location.
return table.mid(startIndex, 8);
}
// Update the IV table given the section's SHA1 hash.
static void UpdateIVTable(QByteArray &table, int index, const QByteArray &sectionHash) {
int blockNumIndex = index % 4;
int baseOffset = 0xFA0 + blockNumIndex * 4;
quint32 blockNumVal = (static_cast<uchar>(table.at(baseOffset)) ) |
(static_cast<uchar>(table.at(baseOffset + 1)) << 8 ) |
(static_cast<uchar>(table.at(baseOffset + 2)) << 16) |
(static_cast<uchar>(table.at(baseOffset + 3)) << 24);
int blockNum = blockNumVal * 4 + index;
int num2 = unk(0x51EB851FLL * blockNum, 0x20);
int adjust = ((num2 >> 6) + (num2 >> 31));
int startIndex = 20 * (blockNum - 200 * adjust) + 1;
int hashIndex = 0;
for (int x = 0; x < 4; ++x) {
table[startIndex - 1] = table.at(startIndex - 1) ^ sectionHash.at(hashIndex);
table[startIndex] = table.at(startIndex) ^ sectionHash.at(hashIndex + 1);
table[startIndex + 1] = table.at(startIndex + 1) ^ sectionHash.at(hashIndex + 2);
table[startIndex + 2] = table.at(startIndex + 2) ^ sectionHash.at(hashIndex + 3);
table[startIndex + 3] = table.at(startIndex + 3) ^ sectionHash.at(hashIndex + 4);
startIndex += 5;
hashIndex += 5;
}
}
static quint32 ToUInt32(const QByteArray &data, int offset) {
// Converts 4 bytes (starting at offset) from data into a 32-bit unsigned integer (little-endian)
return ((static_cast<quint32>(static_cast<uchar>(data[offset])) ) |
(static_cast<quint32>(static_cast<uchar>(data[offset+1])) << 8 ) |
(static_cast<quint32>(static_cast<uchar>(data[offset+2])) << 16) |
(static_cast<quint32>(static_cast<uchar>(data[offset+3])) << 24));
}
//--------------------------------------------------------------------
// Salsa20 decryption for one section.
// This function resets the counter for each section.
static QByteArray salsa20DecryptSection(const QByteArray &sectionData, const QByteArray &key, const QByteArray &iv, int blockSize = 64)
{
// Choose the appropriate constant based on key length.
QByteArray constants;
if (key.size() == 32)
constants = "expand 32-byte k";
else if (key.size() == 16)
constants = "expand 16-byte k";
else {
qWarning() << "Invalid key size:" << key.size() << "; expected 16 or 32 bytes.";
return QByteArray();
}
QVector<quint32> state(VECTOR_SIZE);
// Set state[0] using the first 4 bytes of the constant.
state[0] = ConvertArrayTo32Bit(constants.mid(0, 4));
// state[1] through state[4] come from the first 16 bytes of the key.
state[1] = ToUInt32(key, 0);
state[2] = ToUInt32(key, 4);
state[3] = ToUInt32(key, 8);
state[4] = ToUInt32(key, 12);
// state[5] comes from the next 4 bytes of the constant.
state[5] = ConvertArrayTo32Bit(constants.mid(4, 4));
// state[6] and state[7] come from the IV (which must be 8 bytes).
state[6] = ConvertArrayTo32Bit(iv.mid(0, 4));
state[7] = ConvertArrayTo32Bit(iv.mid(4, 4));
// state[8] and state[9] are the 64-bit block counter (start at 0).
state[8] = 0;
state[9] = 0;
// state[10] comes from the next 4 bytes of the constant.
state[10] = ConvertArrayTo32Bit(constants.mid(8, 4));
// For state[11] through state[14]:
// If the key is 32 bytes, use bytes 16..31; if 16 bytes, reuse the first 16 bytes.
if (key.size() == 32) {
state[11] = ToUInt32(key, 16);
state[12] = ToUInt32(key, 20);
state[13] = ToUInt32(key, 24);
state[14] = ToUInt32(key, 28);
} else { // key.size() == 16
state[11] = ToUInt32(key, 0);
state[12] = ToUInt32(key, 4);
state[13] = ToUInt32(key, 8);
state[14] = ToUInt32(key, 12);
}
// state[15] comes from the last 4 bytes of the constant.
state[15] = ConvertArrayTo32Bit(constants.mid(12, 4));
// Prepare the output buffer.
QByteArray output(sectionData.size(), Qt::Uninitialized);
int numBlocks = sectionData.size() / blockSize;
int remainder = sectionData.size() % blockSize;
// Process each full block.
for (int blockIndex = 0; blockIndex < numBlocks; ++blockIndex) {
QVector<quint32> x = state; // make a copy of the current state for this block
// Run 20 rounds (10 iterations) of Salsa20.
for (int round = 20; round > 0; round -= 2) {
x[4] ^= Rotate(x[0] + x[12], 7);
x[8] ^= Rotate(x[4] + x[0], 9);
x[12] ^= Rotate(x[8] + x[4], 13);
x[0] ^= Rotate(x[12] + x[8], 18);
x[9] ^= Rotate(x[5] + x[1], 7);
x[13] ^= Rotate(x[9] + x[5], 9);
x[1] ^= Rotate(x[13] + x[9], 13);
x[5] ^= Rotate(x[1] + x[13], 18);
x[14] ^= Rotate(x[10] + x[6], 7);
x[2] ^= Rotate(x[14] + x[10], 9);
x[6] ^= Rotate(x[2] + x[14], 13);
x[10] ^= Rotate(x[6] + x[2], 18);
x[3] ^= Rotate(x[15] + x[11], 7);
x[7] ^= Rotate(x[3] + x[15], 9);
x[11] ^= Rotate(x[7] + x[3], 13);
x[15] ^= Rotate(x[11] + x[7], 18);
x[1] ^= Rotate(x[0] + x[3], 7);
x[2] ^= Rotate(x[1] + x[0], 9);
x[3] ^= Rotate(x[2] + x[1], 13);
x[0] ^= Rotate(x[3] + x[2], 18);
x[6] ^= Rotate(x[5] + x[4], 7);
x[7] ^= Rotate(x[6] + x[5], 9);
x[4] ^= Rotate(x[7] + x[6], 13);
x[5] ^= Rotate(x[4] + x[7], 18);
x[11] ^= Rotate(x[10] + x[9], 7);
x[8] ^= Rotate(x[11] + x[10], 9);
x[9] ^= Rotate(x[8] + x[11], 13);
x[10] ^= Rotate(x[9] + x[8], 18);
x[12] ^= Rotate(x[15] + x[14], 7);
x[13] ^= Rotate(x[12] + x[15], 9);
x[14] ^= Rotate(x[13] + x[12], 13);
x[15] ^= Rotate(x[14] + x[13], 18);
}
// Produce the 64-byte keystream block by adding the original state.
QVector<quint8> keyStreamBlock(blockSize);
for (int i = 0; i < VECTOR_SIZE; ++i) {
x[i] += state[i];
Convert32BitTo8Bit(x[i], keyStreamBlock.data() + 4 * i);
}
// XOR the keystream block with the corresponding block of sectionData.
const uchar* inBlock = reinterpret_cast<const uchar*>(sectionData.constData()) + blockIndex * blockSize;
uchar* outBlock = reinterpret_cast<uchar*>(output.data()) + blockIndex * blockSize;
for (int j = 0; j < blockSize; ++j) {
outBlock[j] = inBlock[j] ^ keyStreamBlock[j];
}
// Increment the 64-bit block counter.
state[8]++;
if (state[8] == 0)
state[9]++;
}
// Process any remaining bytes.
if (remainder > 0) {
QVector<quint32> x = state;
for (int round = 20; round > 0; round -= 2) {
x[4] ^= Rotate(x[0] + x[12], 7);
x[8] ^= Rotate(x[4] + x[0], 9);
x[12] ^= Rotate(x[8] + x[4], 13);
x[0] ^= Rotate(x[12] + x[8], 18);
x[9] ^= Rotate(x[5] + x[1], 7);
x[13] ^= Rotate(x[9] + x[5], 9);
x[1] ^= Rotate(x[13] + x[9], 13);
x[5] ^= Rotate(x[1] + x[13], 18);
x[14] ^= Rotate(x[10] + x[6], 7);
x[2] ^= Rotate(x[14] + x[10], 9);
x[6] ^= Rotate(x[2] + x[14], 13);
x[10] ^= Rotate(x[6] + x[2], 18);
x[3] ^= Rotate(x[15] + x[11], 7);
x[7] ^= Rotate(x[3] + x[15], 9);
x[11] ^= Rotate(x[7] + x[3], 13);
x[15] ^= Rotate(x[11] + x[7], 18);
x[1] ^= Rotate(x[0] + x[3], 7);
x[2] ^= Rotate(x[1] + x[0], 9);
x[3] ^= Rotate(x[2] + x[1], 13);
x[0] ^= Rotate(x[3] + x[2], 18);
x[6] ^= Rotate(x[5] + x[4], 7);
x[7] ^= Rotate(x[6] + x[5], 9);
x[4] ^= Rotate(x[7] + x[6], 13);
x[5] ^= Rotate(x[4] + x[7], 18);
x[11] ^= Rotate(x[10] + x[9], 7);
x[8] ^= Rotate(x[11] + x[10], 9);
x[9] ^= Rotate(x[8] + x[11], 13);
x[10] ^= Rotate(x[9] + x[8], 18);
x[12] ^= Rotate(x[15] + x[14], 7);
x[13] ^= Rotate(x[12] + x[15], 9);
x[14] ^= Rotate(x[13] + x[12], 13);
x[15] ^= Rotate(x[14] + x[13], 18);
}
QVector<quint8> keyStreamBlock(blockSize);
for (int i = 0; i < VECTOR_SIZE; ++i) {
x[i] += state[i];
Convert32BitTo8Bit(x[i], keyStreamBlock.data() + 4 * i);
}
const uchar* inBlock = reinterpret_cast<const uchar*>(sectionData.constData()) + numBlocks * blockSize;
uchar* outBlock = reinterpret_cast<uchar*>(output.data()) + numBlocks * blockSize;
for (int j = 0; j < remainder; ++j)
outBlock[j] = inBlock[j] ^ keyStreamBlock[j];
}
return output;
}
};
#endif // COMPRESSOR_H

View File

@ -1,19 +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;
};
#endif // D3DBSP_STRUCTS_H

View File

@ -1,26 +1,4 @@
<RCC> <RCC>
<qresource prefix="/obj">
<file>obj/defaultactor_LOD0.XMODEL_BIN</file>
<file>obj/defaultactor_LOD0.XMODEL_EXPORT</file>
<file>obj/defaultactor_LOD0.bin</file>
<file>obj/defaultactor_LOD0.cast</file>
<file>obj/defaultactor_LOD0.gltf</file>
<file>obj/defaultactor_LOD0.ma</file>
<file>obj/defaultactor_LOD0.mesh.ascii</file>
<file>obj/defaultactor_LOD0.obj</file>
<file>obj/defaultactor_LOD0.semodel</file>
<file>obj/defaultactor_LOD0.smd</file>
<file>obj/defaultactor_LOD0_BIND.mel</file>
<file>obj/defaultactor_LOD0_cosmetics.mel</file>
<file>obj/diffusemap.png</file>
<file>obj/mtl_body_default_character.mtl</file>
<file>obj/mtl_body_default_character_images.txt</file>
<file>obj/normalmap.png</file>
</qresource>
<qresource prefix="/d3dbsp">
<file>d3dbsp/asset_viewer.d3dbsp</file>
<file>d3dbsp/barebones.d3dbsp</file>
</qresource>
<qresource prefix="/images"> <qresource prefix="/images">
<file>images/XPlor.png</file> <file>images/XPlor.png</file>
<file>images/copy.svg</file> <file>images/copy.svg</file>
@ -34,24 +12,19 @@
<file>images/save.svg</file> <file>images/save.svg</file>
</qresource> </qresource>
<qresource prefix="/icons"> <qresource prefix="/icons">
<file>icons/Icon_COD4.png</file> <file>icons/Icon_Pause.png</file>
<file>icons/Icon_COD5.png</file> <file>icons/Icon_Play.png</file>
<file>icons/Icon_COD6.png</file> <file>icons/Icon_SkipBack.png</file>
<file>icons/Icon_COD7.png</file> <file>icons/Icon_SkipForward.png</file>
<file>icons/Icon_COD8.png</file> <file>icons/Icon_Stop.png</file>
<file>icons/Icon_COD9.png</file> <file>icons/Icon_Editor.png</file>
<file>icons/Icon_DDSFile.png</file> <file>icons/Icon_Views.png</file>
<file>icons/Icon_FastFile.png</file> <file>icons/Icon_Tree.png</file>
<file>icons/Icon_IWIFile.png</file> <file>icons/Icon_Cut.png</file>
<file>icons/Icon_PC.png</file> <file>icons/Icon_Find.png</file>
<file>icons/Icon_Playstation.png</file> <file>icons/Icon_NewFile.png</file>
<file>icons/Icon_Xbox.png</file> <file>icons/Icon_Paste.png</file>
<file>icons/Icon_ZoneFile.png</file> <file>icons/Icon_Save.png</file>
<file>icons/Icon_GSCFile.png</file> <file>icons/Icon_OpenFile.png</file>
<file>icons/Icon_StringFile.png</file>
<file>icons/Icon_TechSetFile.png</file>
<file>icons/Icon_WAVFile.png</file>
<file>icons/Icon_MenuFile.png</file>
<file>icons/Icon_Image.png</file>
</qresource> </qresource>
</RCC> </RCC>

BIN
data/icons/Icon.psd Normal file

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

BIN
data/icons/Icon_Cut.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

BIN
data/icons/Icon_Editor.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 210 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 855 B

BIN
data/icons/Icon_Find.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

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