Compare commits

...

568 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
1051 changed files with 292923 additions and 53842 deletions

13
.gitignore vendored
View File

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

View File

@ -2,9 +2,9 @@ TEMPLATE = subdirs
SUBDIRS += libs \ SUBDIRS += libs \
app \ app \
tools \ #tools \
tests #tests
tests.depends = libs #tests.depends = libs
app.depends = libs app.depends = libs
tools.depends = libs #tools.depends = libs

View File

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

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

@ -6,57 +6,9 @@ SUBDIRS += app
CONFIG += c++17 CONFIG += c++17
SOURCES += \ SOURCES += $$files($$PWD/*.cpp)
aboutdialog.cpp \ HEADERS += $$files($$PWD/*.h)
ddsviewer.cpp \ FORMS += $$files($$PWD/*.ui)
fastfileviewer.cpp \
imagewidget.cpp \
iwiviewer.cpp \
localstringviewer.cpp \
main.cpp \
mainwindow.cpp \
materialviewer.cpp \
preferenceeditor.cpp \
soundviewer.cpp \
stringtableviewer.cpp \
techsetviewer.cpp \
xtreewidget.cpp \
xtreewidgetitem.cpp \
zonefileviewer.cpp
HEADERS += \
aboutdialog.h \
d3dbsp_structs.h \
ddsviewer.h \
fastfileviewer.h \
imagewidget.h \
iwiviewer.h \
localstringviewer.h \
mainwindow.h \
materialviewer.h \
preferenceeditor.h \
soundviewer.h \
stringtableviewer.h \
techsetviewer.h \
xtreewidget.h \
xtreewidgetitem.h \
zonefileviewer.h
FORMS += \
aboutdialog.ui \
ddsviewer.ui \
fastfileviewer.ui \
imagewidget.ui \
iwiviewer.ui \
localstringviewer.ui \
mainwindow.ui \
materialviewer.ui \
modelviewer.ui \
preferenceeditor.ui \
soundviewer.ui \
stringtableviewer.ui \
techsetviewer.ui \
zonefileviewer.ui
RESOURCES += ../data/data.qrc RESOURCES += ../data/data.qrc
@ -65,6 +17,7 @@ LIBS += \
-L$$PWD/../third_party/zlib/lib/ -lzlib \ -L$$PWD/../third_party/zlib/lib/ -lzlib \
-L$$PWD/../third_party/xbox_sdk/lib -lxcompress64 \ -L$$PWD/../third_party/xbox_sdk/lib -lxcompress64 \
-L$$OUT_PWD/../libs/ -lcore \ -L$$OUT_PWD/../libs/ -lcore \
-L$$OUT_PWD/../libs/ -lxassets\
-L$$OUT_PWD/../libs/ -lcompression \ -L$$OUT_PWD/../libs/ -lcompression \
-L$$OUT_PWD/../libs/ -lencryption \ -L$$OUT_PWD/../libs/ -lencryption \
-L$$OUT_PWD/../libs/ -lfastfile \ -L$$OUT_PWD/../libs/ -lfastfile \
@ -84,6 +37,7 @@ INCLUDEPATH += \
$$PWD/../libs/ddsfile \ $$PWD/../libs/ddsfile \
$$PWD/../libs/ipakfile \ $$PWD/../libs/ipakfile \
$$PWD/../libs/iwifile \ $$PWD/../libs/iwifile \
$$PWD/../libs/xassets \
$$PWD/../libs/zonefile $$PWD/../libs/zonefile
DEPENDPATH += \ DEPENDPATH += \
@ -97,16 +51,11 @@ DEPENDPATH += \
$$PWD/../libs/ddsfile \ $$PWD/../libs/ddsfile \
$$PWD/../libs/ipakfile \ $$PWD/../libs/ipakfile \
$$PWD/../libs/iwifile \ $$PWD/../libs/iwifile \
$$PWD/../libs/xassets \
$$PWD/../libs/zonefile $$PWD/../libs/zonefile
# Copy DLLs to Debug folder
QMAKE_POST_LINK += xcopy /Y /E /I \"G:/Projects/Qt/XPlor/third_party/devil_sdk/lib\\*.dll\" \"$$OUT_PWD/debug/\" $$escape_expand(\\n\\t)
QMAKE_POST_LINK += xcopy /Y /E /I \"G:/Projects/Qt/XPlor/third_party/zlib/lib\\*.dll\" \"$$OUT_PWD/debug/\" $$escape_expand(\\n\\t)
QMAKE_POST_LINK += xcopy /Y /E /I \"G:/Projects/Qt/XPlor/third_party/xna/lib\\*.dll\" \"$$OUT_PWD/debug/\" $$escape_expand(\\n\\t)
QMAKE_POST_LINK += xcopy /Y /E /I \"$$PWD/../third_party/xbox_sdk/lib\\*.dll\" \"$$OUT_PWD/debug/\" $$escape_expand(\\n\\t)
# Copy DLLs to Release folder win32 {
QMAKE_POST_LINK += xcopy /Y /E /I \"G:/Projects/Qt/XPlor/third_party/devil_sdk/lib\\*.dll\" \"$$OUT_PWD/release/\" $$escape_expand(\\n\\t) QMAKE_POST_LINK =
QMAKE_POST_LINK += xcopy /Y /E /I \"G:/Projects/Qt/XPlor/third_party/zlib/lib\\*.dll\" \"$$OUT_PWD/release/\" $$escape_expand(\\n\\t) QMAKE_POST_LINK += for /D %%G in (\"$$PWD/../third_party/*/lib\") do copy /Y \"%%~G\*.dll\" \"$$OUT_PWD/$$DESTDIR/\" >NUL $$escape_expand(\\n\\t)
QMAKE_POST_LINK += xcopy /Y /E /I \"G:/Projects/Qt/XPlor/third_party/xna/lib\\*.dll\" \"$$OUT_PWD/release/\" $$escape_expand(\\n\\t) }
QMAKE_POST_LINK += xcopy /Y /E /I \"$$PWD/../third_party/xbox_sdk/lib\\*.dll\" \"$$OUT_PWD/release/\" $$escape_expand(\\n\\t)

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,8 +14,8 @@ 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->GetStem()); ui->label_Title->setText(mFastFile->GetStem());
ui->comboBox_Company->setCurrentIndex(mFastFile->GetCompany()); ui->comboBox_Company->setCurrentIndex(mFastFile->GetCompany());

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

View File

@ -13,16 +13,16 @@ ImageWidget::~ImageWidget()
delete ui; delete ui;
} }
void ImageWidget::SetImage(std::shared_ptr<Image> aImage) void ImageWidget::SetImage(std::shared_ptr<QImage> aImage)
{ {
mImage = aImage; mImage = aImage;
ui->lineEdit_Name->setText(aImage->name); //ui->lineEdit_Name->setText(aImage->name);
ui->lineEdit_Role->setText(aImage->materialName); //ui->lineEdit_Role->setText(aImage->materialName);
ui->comboBox_Compression->setCurrentIndex(aImage->compression); //ui->comboBox_Compression->setCurrentIndex(aImage->compression);
} }
std::shared_ptr<Image> ImageWidget::GetImage() std::shared_ptr<QImage> ImageWidget::GetImage()
{ {
return mImage; 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

View File

@ -10,6 +10,7 @@ LocalStringViewer::LocalStringViewer(QWidget *parent)
ui->setupUi(this); ui->setupUi(this);
ui->tableWidget_Strings->setColumnCount(2); ui->tableWidget_Strings->setColumnCount(2);
ui->tableWidget_Strings->setRowCount(0);
ui->tableWidget_Strings->setColumnWidth(0, 200); ui->tableWidget_Strings->setColumnWidth(0, 200);
ui->tableWidget_Strings->horizontalHeader()->setStretchLastSection(true); ui->tableWidget_Strings->horizontalHeader()->setStretchLastSection(true);
} }
@ -36,24 +37,22 @@ void LocalStringViewer::SetFileNotes(const QString aFileNotes) {
ui->plainTextEdit_FileNotes->setPlainText(mFileNotes); ui->plainTextEdit_FileNotes->setPlainText(mFileNotes);
} }
void LocalStringViewer::AddLocalString(LocalString aLocalString) { void LocalStringViewer::AddLocalString(XLocalizeEntry aLocalString) {
mLocalStrings << aLocalString; mLocalStrings.append(aLocalString);
ui->tableWidget_Strings->setRowCount(mLocalStrings.size()); ui->tableWidget_Strings->setRowCount(mLocalStrings.size());
ui->groupBox_LocalStrViewer->setTitle(QString("Entries (%1)").arg(mLocalStrings.size()));
QTableWidgetItem *aliasItem = new QTableWidgetItem(aLocalString.alias); QTableWidgetItem *aliasItem = new QTableWidgetItem(aLocalString.GetValue()->GetString());
QTableWidgetItem *stringItem = new QTableWidgetItem(aLocalString.string); QTableWidgetItem *stringItem = new QTableWidgetItem(aLocalString.GetName()->GetString());
ui->tableWidget_Strings->setItem(mLocalStrings.size() - 1, 0, aliasItem); ui->tableWidget_Strings->setItem(mLocalStrings.size() - 1, 0, aliasItem);
ui->tableWidget_Strings->setItem(mLocalStrings.size() - 1, 1, stringItem); ui->tableWidget_Strings->setItem(mLocalStrings.size() - 1, 1, stringItem);
} }
void LocalStringViewer::SetZoneFile(std::shared_ptr<ZoneFile> aZoneFile) { void LocalStringViewer::SetZoneFile(const ZoneFile* aZoneFile) {
mLocalStrings.clear(); mLocalStrings.clear();
ui->tableWidget_Strings->clear(); ui->tableWidget_Strings->clear();
ui->label_Title->setText(aZoneFile->GetStem().section('.', 0, 0) + ".str"); ui->label_Title->setText(aZoneFile->GetStem().section('.', 0, 0) + ".str");
for (LocalString localStr : aZoneFile->GetAssetMap().localStrings) { // for (const LocalString &localStr : aZoneFile->GetAssetMap().localStrings) {
AddLocalString(localStr); // 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>

View File

@ -1,13 +1,19 @@
#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 "highlighter_gsc.h"
#include "highlighter_cfg.h"
#include "highlighter_shock.h"
#include "highlighter_rumble.h"
#include "materialviewer.h" #include "materialviewer.h"
#include "preferenceeditor.h" #include "preferenceeditor.h"
#include "soundviewer.h" #include "reportissuedialog.h"
#include "rumblegraphviewer.h"
#include "stringtableviewer.h" #include "stringtableviewer.h"
#include "techsetviewer.h" #include "techsetviewer.h"
#include "ui_mainwindow.h"
#include "compression.h"
#include "fastfile_factory.h" #include "fastfile_factory.h"
#include "iwifile.h" #include "iwifile.h"
#include "ddsfile.h" #include "ddsfile.h"
@ -17,13 +23,11 @@
#include "ipak_structs.h" #include "ipak_structs.h"
#include "iwiviewer.h" #include "iwiviewer.h"
#include "localstringviewer.h" #include "localstringviewer.h"
#include "imagewidget.h"
#include "xtreewidget.h"
#include "zonefileviewer.h" #include "zonefileviewer.h"
#include "techsetviewer.h" #include "techsetviewer.h"
#include "logmanager.h" #include "logmanager.h"
#include <qmath.h> #include <QtMath>
MainWindow::MainWindow(QWidget *parent) MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent), ui(new Ui::MainWindow) { : QMainWindow(parent), ui(new Ui::MainWindow) {
@ -31,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;
@ -44,13 +50,23 @@ MainWindow::MainWindow(QWidget *parent)
mTreeWidget = new XTreeWidget(this); mTreeWidget = new XTreeWidget(this);
mLogWidget = new QPlainTextEdit(this); mLogWidget = new QPlainTextEdit(this);
//ModelViewer *mModelViewer = new ModelViewer(container);
//mModelViewer->setAcceptDrops(false);
mProgressBar = new QProgressBar(this); mProgressBar = new QProgressBar(this);
mProgressBar->setMaximum(100); // Default max value mProgressBar->setMaximum(100); // Default max value
mProgressBar->setVisible(false); // Initially hidden 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, connect(&StatusBarManager::instance(), &StatusBarManager::statusUpdated,
this, &MainWindow::HandleStatusUpdate); this, &MainWindow::HandleStatusUpdate);
@ -143,91 +159,118 @@ MainWindow::MainWindow(QWidget *parent)
ui->tabWidget->clear(); ui->tabWidget->clear();
}); });
connect(mTreeWidget, &XTreeWidget::RawFileSelected, this, [this](std::shared_ptr<RawFile> rawFile, const QString aParentName) { connect(mTreeWidget, &XTreeWidget::RawFileSelected, this, [this](const XRawFile* rawFile, const QString aParentName) {
QPlainTextEdit *scriptEditor = new QPlainTextEdit(this); 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->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;
} }
} }
QScrollArea *scrollArea = new QScrollArea(ui->tabWidget); const int tabStopSpaces = 4;
scrollArea->layout()->addWidget(scriptEditor); QFontMetrics metrics(scriptEditor->font());
scriptEditor->setTabStopDistance(tabStopSpaces * metrics.horizontalAdvance(' '));
ui->tabWidget->addTab(scrollArea, fileStem); QSyntaxHighlighter *highlighter = nullptr;
ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, QIcon(":/icons/icons/Icon_GSCFile.png")); 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); ui->tabWidget->setCurrentIndex(ui->tabWidget->count() - 1);
});
connect(mTreeWidget, &XTreeWidget::ImageSelected, this, [this](std::shared_ptr<Image> image, const QString aParentName) {
ImageWidget *mImageWidget = new ImageWidget(this);
mImageWidget->setAcceptDrops(false);
mImageWidget->SetImage(image);
mImageWidget->setProperty("PARENT_NAME", QVariant::fromValue(aParentName));
QString fileStem = image->materialName;
for (int i = 0; i < ui->tabWidget->count(); i++) {
if (ui->tabWidget->tabText(i) == fileStem) {
return; 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);
ui->tabWidget->addTab(mImageWidget, fileStem); rawTabWidget->addTab(rmbFileViewer, "UI Editor");
ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, QIcon(":/icons/icons/Icon_Image.png")); 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); 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::DDSFileSelected, this, [this](std::shared_ptr<DDSFile> ddsFile, const QString aParentName) {
DDSViewer *ddsViewer = new DDSViewer(this);
ddsViewer->setAcceptDrops(false);
ddsViewer->SetDDSFile(ddsFile);
ddsViewer->setProperty("PARENT_NAME", QVariant::fromValue(aParentName));
QString fileStem = ddsFile->fileStem + ".dds";
for (int i = 0; i < ui->tabWidget->count(); i++) {
if (ui->tabWidget->tabText(i) == fileStem) {
return; return;
} }*/ else {
delete highlighter;
} }
ui->tabWidget->addTab(ddsViewer, fileStem); ui->tabWidget->addTab(scriptEditor, 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_RAWFILE));
ui->tabWidget->setCurrentIndex(ui->tabWidget->count() - 1); ui->tabWidget->setCurrentIndex(ui->tabWidget->count() - 1);
}); });
connect(mTreeWidget, &XTreeWidget::MaterialSelected, this, [this](std::shared_ptr<Material> material, const QString aParentName) { // connect(mTreeWidget, &XTreeWidget::ImageSelected, this, [this](std::shared_ptr<Image> image, const QString aParentName) {
// ImageWidget *mImageWidget = new ImageWidget(this);
// mImageWidget->setAcceptDrops(false);
// mImageWidget->SetImage(image);
// mImageWidget->setProperty("PARENT_NAME", QVariant::fromValue(aParentName));
// QString fileStem = image->materialName;
// for (int i = 0; i < ui->tabWidget->count(); i++) {
// if (ui->tabWidget->tabText(i) == fileStem) {
// delete mImageWidget;
// return;
// }
// }
// ui->tabWidget->addTab(mImageWidget, fileStem);
// ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, Utils::CreateAssetIcon(ASSET_TYPE_IMAGE));
// ui->tabWidget->setCurrentIndex(ui->tabWidget->count() - 1);
// });
// connect(mTreeWidget, &XTreeWidget::MenuSelected, this, [](std::shared_ptr<Menu> menu, const QString aParentName) {
// Q_UNUSED(menu);
// });
connect(mTreeWidget, &XTreeWidget::MaterialSelected, this, [this](const XMaterial* material, const QString aParentName) {
MaterialViewer *matViewer = new MaterialViewer(this); MaterialViewer *matViewer = new MaterialViewer(this);
matViewer->setAcceptDrops(false); matViewer->setAcceptDrops(false);
matViewer->SetMaterial(material); matViewer->SetMaterial(material);
matViewer->setProperty("PARENT_NAME", QVariant::fromValue(aParentName)); matViewer->setProperty("PARENT_NAME", QVariant::fromValue(aParentName));
QString fileStem = material->name; // QString fileStem = material->name;
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 matViewer;
} // return;
} // }
// }
ui->tabWidget->addTab(matViewer, fileStem); //ui->tabWidget->addTab(matViewer, fileStem);
ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, QIcon(":/icons/icons/Icon_Material.png")); 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::DDSFileSelected, this, [this](std::shared_ptr<DDSFile> ddsFile, const QString aParentName) { connect(mTreeWidget, &XTreeWidget::DDSFileSelected, this, [this](const DDSFile* ddsFile, const QString aParentName) {
DDSViewer *ddsViewer = new DDSViewer(this); DDSViewer *ddsViewer = new DDSViewer(this);
ddsViewer->setAcceptDrops(false); ddsViewer->setAcceptDrops(false);
ddsViewer->SetDDSFile(ddsFile); ddsViewer->SetDDSFile(ddsFile);
@ -236,16 +279,17 @@ MainWindow::MainWindow(QWidget *parent)
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, const QString aParentName) { 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);
@ -254,16 +298,17 @@ MainWindow::MainWindow(QWidget *parent)
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, const QString aParentName) { 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);
@ -271,25 +316,27 @@ MainWindow::MainWindow(QWidget *parent)
QString fileStem = aFastFile->GetStem(); 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 + ".ff") { 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, const QString aParentName) { 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)); zoneFileViewer->setProperty("PARENT_NAME", QVariant::fromValue(aParentName));
QString fileStem = aZoneFile->GetStem() + ".zone"; 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;
} }
} }
@ -307,11 +354,11 @@ MainWindow::MainWindow(QWidget *parent)
scrollArea->setWidget(containerWidget); scrollArea->setWidget(containerWidget);
ui->tabWidget->addTab(scrollArea, fileStem); ui->tabWidget->addTab(scrollArea, fileStem);
ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, QIcon(":/icons/icons/Icon_ZoneFile.png")); 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, const QString aParentName) { 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);
@ -320,68 +367,72 @@ MainWindow::MainWindow(QWidget *parent)
QString fileStem = aZoneFile->GetStem() + ".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, const QString aParentName) { 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)); 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](std::shared_ptr<StringTable> aStrTable, const QString aParentName) { connect(mTreeWidget, &XTreeWidget::StrTableSelected, this, [this](const XStringTable* aStrTable, const QString aParentName) {
StringTableViewer *strTableViewer = new StringTableViewer(this); StringTableViewer *strTableViewer = new StringTableViewer(this);
strTableViewer->setAcceptDrops(false); strTableViewer->setAcceptDrops(false);
strTableViewer->SetStringTable(aStrTable); strTableViewer->SetStringTable(aStrTable);
strTableViewer->setProperty("PARENT_NAME", QVariant::fromValue(aParentName)); strTableViewer->setProperty("PARENT_NAME", QVariant::fromValue(aParentName));
QString fileStem = aStrTable->name; QString fileStem = aStrTable->GetName()->GetString();
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 strTableViewer;
return; return;
} }
} }
ui->tabWidget->addTab(strTableViewer, fileStem); ui->tabWidget->addTab(strTableViewer, fileStem);
ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, QIcon(":/icons/icons/Icon_StringTable.png")); ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, Utils::CreateAssetIcon(ASSET_TYPE_STRINGTABLE));
ui->tabWidget->setCurrentIndex(ui->tabWidget->count() - 1); ui->tabWidget->setCurrentIndex(ui->tabWidget->count() - 1);
}); });
connect(mTreeWidget, &XTreeWidget::SoundSelected, this, [this](std::shared_ptr<Sound> aSound, const QString aParentName) { // connect(mTreeWidget, &XTreeWidget::SoundSelected, this, [this](std::shared_ptr<Sound> aSound, const QString aParentName) {
SoundViewer *soundViewer = new SoundViewer(this); // SoundViewer *soundViewer = new SoundViewer(this);
soundViewer->setAcceptDrops(false); // soundViewer->setAcceptDrops(false);
soundViewer->SetSound(aSound); // soundViewer->SetSound(aSound);
soundViewer->setProperty("PARENT_NAME", QVariant::fromValue(aParentName)); // soundViewer->setProperty("PARENT_NAME", QVariant::fromValue(aParentName));
QString fileStem = aSound->path.split('/').last(); // QString fileStem = aSound->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) {
return; // delete soundViewer;
} // return;
} // }
// }
ui->tabWidget->addTab(soundViewer, fileStem); // ui->tabWidget->addTab(soundViewer, fileStem);
ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, QIcon(":/icons/icons/Icon_Sound.png")); // ui->tabWidget->setTabIcon(ui->tabWidget->count() - 1, Utils::CreateAssetIcon(ASSET_TYPE_SOUND));
ui->tabWidget->setCurrentIndex(ui->tabWidget->count() - 1); // ui->tabWidget->setCurrentIndex(ui->tabWidget->count() - 1);
}); // });
connect(mTreeWidget, &XTreeWidget::ItemSelected, this, [this](const QString itemText) { connect(mTreeWidget, &XTreeWidget::ItemSelected, this, [this](const QString itemText) {
for (int i = 0; i < ui->tabWidget->count(); i++) { for (int i = 0; i < ui->tabWidget->count(); i++) {
@ -476,13 +527,29 @@ 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) {
const QString fastFileStem = aFastFilePath.section("/", -1, -1).section('.', 0, 0); const QString fastFileStem = aFastFilePath.section("/", -1, -1);
if (mTreeWidget->HasFastFile(fastFileStem)) { if (mTreeWidget->HasFastFile(fastFileStem)) {
LogManager::instance().addError("Can't add duplicate file!"); LogManager::instance().addError("Can't add duplicate file!");
return false; return false;
} }
std::shared_ptr<FastFile> fastFile = FastFileFactory::Create(aFastFilePath); FastFile* fastFile = FastFile::Open(aFastFilePath);
fastFile->SetStem(fastFileStem);
mTreeWidget->AddFastFile(fastFile);
// Open zone file after decompressing ff and writing
return true;
}
bool MainWindow::OpenFastFile(const QByteArray& aFastFileData, const QString aFastFilePath) {
const QString fastFileStem = aFastFilePath.section("/", -1, -1);
if (mTreeWidget->HasFastFile(fastFileStem)) {
LogManager::instance().addError("Can't add duplicate file!");
return false;
}
FastFile* fastFile = FastFile::Open(aFastFileData);
fastFile->SetStem(fastFileStem);
mTreeWidget->AddFastFile(fastFile); mTreeWidget->AddFastFile(fastFile);
// Open zone file after decompressing ff and writing // Open zone file after decompressing ff and writing
@ -496,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;
} }
@ -514,19 +583,25 @@ bool MainWindow::OpenZoneFile(const QString aZoneFilePath, bool fromFF) {
Q_UNUSED(aZoneFilePath); 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;
} }
@ -598,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;
} }
@ -609,7 +684,7 @@ 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;
} }
@ -641,7 +716,7 @@ int MainWindow::LoadFile_DDS(const QString aFilePath) {
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;
} }
@ -714,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;
@ -736,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; }
@ -746,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();
@ -771,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;

View File

@ -2,7 +2,6 @@
#define MAINWINDOW_H #define MAINWINDOW_H
#include "d3dbsp_structs.h" #include "d3dbsp_structs.h"
#include "asset_structs.h"
#include "xtreewidget.h" #include "xtreewidget.h"
#include <QMainWindow> #include <QMainWindow>
@ -16,7 +15,6 @@
#include <QPlainTextEdit> #include <QPlainTextEdit>
#include <QMimeData> #include <QMimeData>
#include <QProgressBar> #include <QProgressBar>
#include <windows.h>
QT_BEGIN_NAMESPACE QT_BEGIN_NAMESPACE
namespace Ui { namespace Ui {
@ -35,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);
@ -64,7 +63,7 @@ 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;

View File

@ -50,7 +50,7 @@
<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>
@ -117,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">
@ -353,6 +361,16 @@
<string>Preferences...</string> <string>Preferences...</string>
</property> </property>
</action> </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"/> <include location="../data/data.qrc"/>

View File

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

View File

@ -1,7 +1,7 @@
#ifndef MATERIALVIEWER_H #ifndef MATERIALVIEWER_H
#define MATERIALVIEWER_H #define MATERIALVIEWER_H
#include "asset_structs.h" #include "xmaterial.h"
#include <QWidget> #include <QWidget>
#include <QScrollArea> #include <QScrollArea>
@ -18,7 +18,7 @@ public:
explicit MaterialViewer(QWidget *parent = nullptr); explicit MaterialViewer(QWidget *parent = nullptr);
~MaterialViewer(); ~MaterialViewer();
void SetMaterial(std::shared_ptr<Material> aMaterial); void SetMaterial(const XMaterial *aMaterial);
private: private:
Ui::MaterialViewer *ui; Ui::MaterialViewer *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>

View File

@ -61,17 +61,17 @@ SoundViewer::~SoundViewer()
delete ui; delete ui;
} }
void SoundViewer::SetSound(std::shared_ptr<Sound> aSound) // void SoundViewer::SetSound(std::shared_ptr<Sound> aSound)
{ // {
buffer->setData(aSound->data); // buffer->setData(aSound->data);
if (!buffer->open(QIODevice::ReadOnly)) { // if (!buffer->open(QIODevice::ReadOnly)) {
qWarning() << "Failed to open QBuffer."; // qWarning() << "Failed to open QBuffer.";
return; // return;
} // }
ui->groupBox->setTitle(aSound->path); // ui->groupBox->setTitle(aSound->path);
player->setSourceDevice(buffer); // player->setSourceDevice(buffer);
} // }
void SoundViewer::SetOutput(QAudioOutput *aOutput) { void SoundViewer::SetOutput(QAudioOutput *aOutput) {
if (!aOutput) { return; } if (!aOutput) { return; }

View File

@ -1,8 +1,6 @@
#ifndef SOUNDVIEWER_H #ifndef SOUNDVIEWER_H
#define SOUNDVIEWER_H #define SOUNDVIEWER_H
#include "asset_structs.h"
#include <QWidget> #include <QWidget>
#include <QMediaPlayer> #include <QMediaPlayer>
#include <QBuffer> #include <QBuffer>
@ -22,7 +20,7 @@ public:
explicit SoundViewer(QWidget *parent = nullptr); explicit SoundViewer(QWidget *parent = nullptr);
~SoundViewer(); ~SoundViewer();
void SetSound(std::shared_ptr<Sound> aSound); //void SetSound(std::shared_ptr<Sound> aSound);
void SetOutput(QAudioOutput *aOutput); void SetOutput(QAudioOutput *aOutput);
private: private:

View File

@ -13,22 +13,21 @@ StringTableViewer::~StringTableViewer()
delete ui; delete ui;
} }
void StringTableViewer::SetStringTable(std::shared_ptr<StringTable> aStringTable) { void StringTableViewer::SetStringTable(const XStringTable *aStringTable) {
ui->tableWidget_Strings->clear(); ui->tableWidget_Strings->clear();
ui->tableWidget_Strings->setRowCount(aStringTable->rowCount); ui->tableWidget_Strings->setRowCount(aStringTable->GetRowCount());
ui->tableWidget_Strings->setColumnCount(aStringTable->columnCount); ui->tableWidget_Strings->setColumnCount(aStringTable->GetColumnCount());
int currentIndex = 0; int currentIndex = 0;
for (const QString &key : aStringTable->content.keys()) { for (auto value : *aStringTable->GetValues()) {
const QString value = aStringTable->content[key];
QTableWidgetItem *tableKeyItem = new QTableWidgetItem(); QTableWidgetItem *tableKeyItem = new QTableWidgetItem();
tableKeyItem->setText(key); tableKeyItem->setText(value->GetName());
ui->tableWidget_Strings->setItem(currentIndex, 0, tableKeyItem); ui->tableWidget_Strings->setItem(currentIndex, 0, tableKeyItem);
QTableWidgetItem *tableValItem = new QTableWidgetItem(); QTableWidgetItem *tableValItem = new QTableWidgetItem();
tableValItem->setText(value); tableValItem->setText(value->GetString());
ui->tableWidget_Strings->setItem(currentIndex, 1, tableValItem); ui->tableWidget_Strings->setItem(currentIndex, 1, tableValItem);
currentIndex++; currentIndex++;

View File

@ -1,7 +1,8 @@
#ifndef STRINGTABLEVIEWER_H #ifndef STRINGTABLEVIEWER_H
#define STRINGTABLEVIEWER_H #define STRINGTABLEVIEWER_H
#include "asset_structs.h" #include "xstringtable.h"
#include <QWidget> #include <QWidget>
namespace Ui { namespace Ui {
@ -16,7 +17,7 @@ public:
explicit StringTableViewer(QWidget *parent = nullptr); explicit StringTableViewer(QWidget *parent = nullptr);
~StringTableViewer(); ~StringTableViewer();
void SetStringTable(std::shared_ptr<StringTable> aStringTable); void SetStringTable(const XStringTable *aStringTable);
private: private:
Ui::StringTableViewer *ui; Ui::StringTableViewer *ui;

View File

@ -13,13 +13,13 @@ TechSetViewer::~TechSetViewer()
delete ui; delete ui;
} }
void TechSetViewer::SetTechSet(std::shared_ptr<TechSet> aTechSet) { void TechSetViewer::SetTechSet(const XMaterialTechniqueSet* aTechSet) {
ui->listWidget_Ptrs->clear(); //ui->listWidget_Ptrs->clear();
ui->label_Title->setText(aTechSet->name); ui->label_Title->setText(aTechSet->GetName());
int ptrIndex = 1; // int ptrIndex = 1;
for (auto ptr : aTechSet->pointers) { //for (auto ptr : aTechSet->pointers) {
ui->listWidget_Ptrs->addItem(QString("Pointer %1: %2").arg(ptrIndex).arg(ptr)); // ui->listWidget_Ptrs->addItem(QString("Pointer %1: %2").arg(ptrIndex).arg(ptr));
ptrIndex++; // 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;

View File

@ -6,14 +6,14 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>961</width> <width>880</width>
<height>756</height> <height>559</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string>Form</string> <string>Form</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_2"> <layout class="QVBoxLayout" name="verticalLayout_3">
<item> <item>
<widget class="QLabel" name="label_Title"> <widget class="QLabel" name="label_Title">
<property name="font"> <property name="font">
@ -29,46 +29,120 @@
</widget> </widget>
</item> </item>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QHBoxLayout" name="horizontalLayout_7">
<item> <item>
<widget class="QGroupBox" name="groupBox"> <widget class="QGroupBox" name="groupBox">
<property name="title"> <property name="title">
<string>Unknown Pointers:</string> <string>Set Parameters</string>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<item> <item>
<widget class="QListWidget" name="listWidget_Ptrs"/> <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> </item>
</layout> </layout>
</widget> </widget>
</item> </item>
<item> <item>
<spacer name="horizontalSpacer"> <widget class="QGroupBox" name="groupBox_2">
<property name="orientation"> <property name="title">
<enum>Qt::Orientation::Horizontal</enum> <string>Current Technique</string>
</property> </property>
<property name="sizeHint" stdset="0"> <layout class="QVBoxLayout" name="verticalLayout_2">
<size> <item>
<width>40</width> <layout class="QHBoxLayout" name="horizontalLayout_4">
<height>20</height> <item>
</size> <widget class="QLabel" name="label_4">
<property name="text">
<string>Name:</string>
</property> </property>
</spacer> </widget>
</item>
<item>
<widget class="QLineEdit" name="lineEdit_TechniqueName">
<property name="placeholderText">
<string>Technique set name</string>
</property>
</widget>
</item> </item>
</layout> </layout>
</item> </item>
<item> <item>
<spacer name="verticalSpacer"> <layout class="QHBoxLayout" name="horizontalLayout_5">
<property name="orientation"> <item>
<enum>Qt::Orientation::Vertical</enum> <widget class="QLabel" name="label_5">
<property name="text">
<string>Flags:</string>
</property> </property>
<property name="sizeHint" stdset="0"> </widget>
<size> </item>
<width>20</width> <item>
<height>363</height> <widget class="QSpinBox" name="spinBox_Flags"/>
</size> </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> </property>
</spacer> </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> </item>
</layout> </layout>
</widget> </widget>

View File

@ -5,10 +5,10 @@
XTreeWidget::XTreeWidget(QWidget *parent) XTreeWidget::XTreeWidget(QWidget *parent)
: QTreeWidget(parent) { : QTreeWidget(parent) {
mFastFiles = QMap<QString, std::shared_ptr<FastFile>>(); mFastFiles = QMap<QString, const FastFile*>();
mZoneFiles = QMap<QString, std::shared_ptr<ZoneFile>>(); mZoneFiles = QMap<QString, const ZoneFile*>();
mDDSFiles = QMap<QString, std::shared_ptr<DDSFile>>(); mDDSFiles = QMap<QString, const DDSFile*>();
mIWIFiles = QMap<QString, std::shared_ptr<IWIFile>>(); mIWIFiles = QMap<QString, const IWIFile*>();
setContextMenuPolicy(Qt::CustomContextMenu); setContextMenuPolicy(Qt::CustomContextMenu);
setSelectionMode(QTreeWidget::SingleSelection); setSelectionMode(QTreeWidget::SingleSelection);
@ -16,6 +16,7 @@ XTreeWidget::XTreeWidget(QWidget *parent)
header()->hide(); header()->hide();
setMinimumWidth(350); setMinimumWidth(350);
setSortingEnabled(true); setSortingEnabled(true);
setIconSize(QSize(16, 16));
header()->setSectionResizeMode(0, QHeaderView::ResizeToContents); header()->setSectionResizeMode(0, QHeaderView::ResizeToContents);
@ -36,231 +37,241 @@ XTreeWidget::~XTreeWidget() {
} }
void XTreeWidget::AddFastFile(std::shared_ptr<FastFile> aFastFile) { void XTreeWidget::AddFastFile(FastFile* aFastFile) {
XTreeWidgetItem *fastFileItem = new XTreeWidgetItem(this); XTreeWidgetItem *fastFileItem = new XTreeWidgetItem(this);
fastFileItem->setText(0, aFastFile->GetStem() + ".ff"); fastFileItem->setText(0, aFastFile->GetStem());
fastFileItem->setIcon(0, QIcon(":/icons/icons/Icon_FastFile.png")); fastFileItem->setIcon(0, Utils::CreateAssetIcon("FF"));
if (aFastFile->GetPlatform() == "PC") { if (aFastFile->GetPlatform() == "PC") {
fastFileItem->setIcon(1, QIcon(":/icons/icons/Icon_PC.png")); fastFileItem->setIcon(1, Utils::CreateAssetIcon("PC"));
} else if (aFastFile->GetPlatform() == "360") { } else if (aFastFile->GetPlatform() == "360") {
fastFileItem->setIcon(1, QIcon(":/icons/icons/Icon_Xbox.png")); fastFileItem->setIcon(1, Utils::CreateAssetIcon("360"));
} else if (aFastFile->GetPlatform() == "PS3") {
fastFileItem->setIcon(1, Utils::CreateAssetIcon("PS3"));
} else if (aFastFile->GetPlatform() == "Wii") { } else if (aFastFile->GetPlatform() == "Wii") {
fastFileItem->setIcon(1, QIcon(":/icons/icons/Icon_Wii.png")); fastFileItem->setIcon(1, Utils::CreateAssetIcon("WII"));
} else if (aFastFile->GetPlatform() == "WiiU") { } else if (aFastFile->GetPlatform() == "WiiU") {
fastFileItem->setIcon(1, QIcon(":/icons/icons/Icon_WiiU.png")); fastFileItem->setIcon(1, Utils::CreateAssetIcon("WU"));
} }
if (aFastFile->GetGame() == "COD2") { if (aFastFile->GetGame() == "COD2") {
fastFileItem->setIcon(2, QIcon(":/icons/icons/Icon_COD2.png")); fastFileItem->setIcon(2, Utils::CreateGameIcon(2));
} if (aFastFile->GetGame() == "COD4") { } if (aFastFile->GetGame() == "COD4") {
fastFileItem->setIcon(2, QIcon(":/icons/icons/Icon_COD4.png")); fastFileItem->setIcon(2, Utils::CreateGameIcon(4));
} else if (aFastFile->GetGame() == "COD5") { } else if (aFastFile->GetGame() == "COD5") {
fastFileItem->setIcon(2, QIcon(":/icons/icons/Icon_COD5.png")); fastFileItem->setIcon(2, Utils::CreateGameIcon(5));
} else if (aFastFile->GetGame() == "COD6") { } else if (aFastFile->GetGame() == "COD6") {
fastFileItem->setIcon(2, QIcon(":/icons/icons/Icon_COD6.png")); fastFileItem->setIcon(2, Utils::CreateGameIcon(6));
} else if (aFastFile->GetGame() == "COD7") { } else if (aFastFile->GetGame() == "COD7") {
fastFileItem->setIcon(2, QIcon(":/icons/icons/Icon_COD7.png")); fastFileItem->setIcon(2, Utils::CreateGameIcon(7));
} else if (aFastFile->GetGame() == "COD8") { } else if (aFastFile->GetGame() == "COD8") {
fastFileItem->setIcon(2, QIcon(":/icons/icons/Icon_COD8.png")); fastFileItem->setIcon(2, Utils::CreateGameIcon(8));
} else if (aFastFile->GetGame() == "COD9") { } else if (aFastFile->GetGame() == "COD9") {
fastFileItem->setIcon(2, QIcon(":/icons/icons/Icon_COD9.png")); fastFileItem->setIcon(2, Utils::CreateGameIcon(9));
} else if (aFastFile->GetGame() == "COD10") { } else if (aFastFile->GetGame() == "COD10") {
fastFileItem->setIcon(2, QIcon(":/icons/icons/Icon_COD10.png")); fastFileItem->setIcon(2, Utils::CreateGameIcon(10));
} else if (aFastFile->GetGame() == "COD11") { } else if (aFastFile->GetGame() == "COD11") {
fastFileItem->setIcon(2, QIcon(":/icons/icons/Icon_COD11.png")); fastFileItem->setIcon(2, Utils::CreateGameIcon(11));
} else if (aFastFile->GetGame() == "COD12") { } else if (aFastFile->GetGame() == "COD12") {
fastFileItem->setIcon(2, QIcon(":/icons/icons/Icon_COD12.png")); fastFileItem->setIcon(2, Utils::CreateGameIcon(12));
} }
AddZoneFile(aFastFile->GetZoneFile(), fastFileItem); AddZoneFile(aFastFile->GetZoneFile(), fastFileItem);
mFastFiles[aFastFile->GetStem().section(".", 0, 0)] = aFastFile; mFastFiles[aFastFile->GetStem()] = aFastFile;
resizeColumnToContents(1); resizeColumnToContents(1);
setSortingEnabled(true); setSortingEnabled(true);
sortByColumn(0, Qt::AscendingOrder); sortByColumn(0, Qt::AscendingOrder);
} }
void XTreeWidget::AddZoneFile(std::shared_ptr<ZoneFile> aZoneFile, XTreeWidgetItem *aParentItem) { void XTreeWidget::AddZoneFile(const ZoneFile* aZoneFile, XTreeWidgetItem *aParentItem) {
XTreeWidgetItem *zoneItem; XTreeWidgetItem *zoneItem;
if (aParentItem != nullptr) { if (aParentItem != nullptr) {
zoneItem = new XTreeWidgetItem(aParentItem); zoneItem = new XTreeWidgetItem(aParentItem);
} else { } else {
zoneItem = new XTreeWidgetItem(this); zoneItem = new XTreeWidgetItem(this);
} }
zoneItem->setIcon(0, QIcon(":/icons/icons/Icon_ZoneFile.png")); zoneItem->setIcon(0, Utils::CreateAssetIcon("ZF"));
zoneItem->setText(0, aZoneFile->GetStem() + ".zone"); zoneItem->setText(0, aZoneFile->GetBaseStem() + ".zone");
auto assetMap = aZoneFile->GetAssetMap(); XAssetList assetList = aZoneFile->GetAssetList();
QVector<XAsset*> localizeEntries;
if (!assetMap.localStrings.isEmpty()) { for (int i = 0; i < assetList.Size(); i++)
XTreeWidgetItem *localStrRoot = new XTreeWidgetItem(zoneItem); {
localStrRoot->setText(0, "String Files"); XAsset *currentAsset = assetList.GetAsset(i);
localStrRoot->setIcon(0, QIcon(":/icons/icons/Icon_StringFile.png")); if (currentAsset->GetType() == ASSET_TYPE_LOCALIZE_ENTRY)
{
XTreeWidgetItem *localStrItem = new XTreeWidgetItem(localStrRoot); localizeEntries.append(currentAsset);
localStrItem->setText(0, aZoneFile->GetStem().section('.', 0, 0) + ".str"); } else if (currentAsset->GetType() == ASSET_TYPE_LOCALIZE_ENTRY)
localStrItem->setIcon(0, QIcon(":/icons/icons/Icon_StringFile.png")); {
} localizeEntries.append(currentAsset);
if (!assetMap.techSets.isEmpty()) {
XTreeWidgetItem *techSetRoot = new XTreeWidgetItem(zoneItem);
techSetRoot->setText(0, "Tech Sets");
techSetRoot->setIcon(0, QIcon(":/icons/icons/Icon_TechSetFile.png"));
for (TechSet techSet : assetMap.techSets) {
XTreeWidgetItem *techSetItem = new XTreeWidgetItem(techSetRoot);
techSetItem->setText(0, techSet.name);
techSetItem->setIcon(0, QIcon(":/icons/icons/Icon_TechSetFile.png"));
} }
} }
if (!assetMap.rawFiles.isEmpty()) {
XTreeWidgetItem *rawFileRoot = new XTreeWidgetItem(zoneItem);
rawFileRoot->setText(0, "Raw Files");
rawFileRoot->setIcon(0, QIcon(":/icons/icons/Icon_GSCFile.png"));
for (RawFile rawFile : assetMap.rawFiles) {
if (!rawFile.length) { continue; }
XTreeWidgetItem *tempItem = rawFileRoot; // if (!assetMap.localizeEntries.isEmpty()) {
for (const QString &pathPart : rawFile.path.split('/')) { // QIcon localStrIcon = Utils::CreateAssetIcon(ASSET_TYPE_LOCALIZE_ENTRY);
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; // XTreeWidgetItem *localStrRoot = new XTreeWidgetItem(zoneItem);
break; // localStrRoot->setText(0, "String Files");
} // localStrRoot->setIcon(0, localStrIcon);
} // localStrRoot->SetCategory(CATEGORY_TYPE);
if (pathPart.contains(".gsc")) { // XTreeWidgetItem *localStrItem = new XTreeWidgetItem(localStrRoot);
XTreeWidgetItem *rawFileItem = new XTreeWidgetItem(tempItem); // localStrItem->setText(0, aZoneFile->GetStem().section('.', 0, 0) + ".str");
rawFileItem->setText(0, pathPart); // localStrItem->setIcon(0, localStrIcon);
// }
tempItem = rawFileItem; // if (!assetMap.techSets.isEmpty()) {
} else if (!childFound) { // QIcon techSetIcon = Utils::CreateAssetIcon(ASSET_TYPE_TECHNIQUE_SET);
tempItem = new XTreeWidgetItem(tempItem);
tempItem->setText(0, pathPart);
}
} // XTreeWidgetItem *techSetRoot = new XTreeWidgetItem(zoneItem);
tempItem->setIcon(0, QIcon(":/icons/icons/Icon_GSCFile.png")); // techSetRoot->setText(0, "Tech Sets");
} // techSetRoot->setIcon(0, techSetIcon);
} // techSetRoot->SetCategory(CATEGORY_TYPE);
if (!assetMap.menuFiles.isEmpty()) { // for (auto techSet : assetMap.techSets) {
XTreeWidgetItem *menuRoot = new XTreeWidgetItem(zoneItem); // XTreeWidgetItem *techSetItem = new XTreeWidgetItem(techSetRoot);
menuRoot->setText(0, "Menu Files"); // techSetItem->setText(0, techSet.name);
menuRoot->setIcon(0, QIcon(":/icons/icons/Icon_MenuFile.png")); // techSetItem->setIcon(0, techSetIcon);
// }
// }
int menuIndex = 1; // if (!assetMap.rawFiles.isEmpty()) {
for (MenuFile menuFile : assetMap.menuFiles) { // QIcon rawFileIcon = Utils::CreateAssetIcon(ASSET_TYPE_RAWFILE);
XTreeWidgetItem *menuFileRoot = new XTreeWidgetItem(menuRoot);
menuFileRoot->setText(0, QString("Menu %1").arg(menuIndex));
for (Menu menu : menuFile.menuDefs) {
XTreeWidgetItem *menuItem = new XTreeWidgetItem(menuFileRoot);
menuItem->setText(0, menu.filePath);
menuItem->setIcon(0, QIcon(":/icons/icons/Icon_MenuFile.png"));
}
menuIndex++;
}
}
if (!assetMap.images.isEmpty()) { // XTreeWidgetItem *rawFileRoot = new XTreeWidgetItem(zoneItem);
XTreeWidgetItem *imageRoot = new XTreeWidgetItem(zoneItem); // rawFileRoot->setText(0, "Raw Files");
imageRoot->setText(0, "Images"); // rawFileRoot->setIcon(0, rawFileIcon);
imageRoot->setIcon(0, QIcon(":/icons/icons/Icon_Image.png")); // rawFileRoot->SetCategory(CATEGORY_TYPE);
// for (auto rawFile : assetMap.rawFiles) {
// if (!rawFile.length) { continue; }
for (Image image : assetMap.images) { // XTreeWidgetItem *tempItem = rawFileRoot;
XTreeWidgetItem *imageItem = new XTreeWidgetItem(imageRoot); // // const QStringList pathParts = rawFile->path.split('/');
imageItem->setText(0, image.materialName); // // for (const QString &pathPart : pathParts) {
imageItem->setIcon(0, QIcon(":/icons/icons/Icon_Image.png")); // // 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;
if (!assetMap.models.isEmpty()) { // // childFound = true;
XTreeWidgetItem *modelsRoot = new XTreeWidgetItem(zoneItem); // // break;
modelsRoot->setText(0, "Models"); // // }
modelsRoot->setIcon(0, QIcon(":/icons/icons/Icon_Model.png")); // // }
for (Model model: assetMap.models) { // // const QString rawFileStr = pathPart;// = QString("%1 [%2-%3]").arg(pathPart).arg(rawFile.startPos).arg(rawFile.endPos);
XTreeWidgetItem *modelItem = new XTreeWidgetItem(modelsRoot); // // if (pathPart == pathParts.last()) {
modelItem->setText(0, model.modelName); // // XTreeWidgetItem *rawFileItem = new XTreeWidgetItem(tempItem);
modelItem->setIcon(0, QIcon(":/icons/icons/Icon_Model.png")); // // rawFileItem->setText(0, rawFileStr);
}
}
if (!assetMap.materials.isEmpty()) { // // tempItem = rawFileItem;
XTreeWidgetItem *materialsRoot = new XTreeWidgetItem(zoneItem); // // } else if (!childFound) {
materialsRoot->setText(0, "Materials"); // // tempItem = new XTreeWidgetItem(tempItem);
materialsRoot->setIcon(0, QIcon(":/icons/icons/Icon_Material.png")); // // tempItem->setText(0, rawFileStr);
// // }
for (Material material: assetMap.materials) { // // }
XTreeWidgetItem *materialItem = new XTreeWidgetItem(materialsRoot); // tempItem->setIcon(0, rawFileIcon);
materialItem->setText(0, material.name); // }
materialItem->setIcon(0, QIcon(":/icons/icons/Icon_Material.png")); // }
}
}
if (!assetMap.stringTables.isEmpty()) { // if (!assetMap.menuDefinitions.isEmpty()) {
XTreeWidgetItem *strTableRoot = new XTreeWidgetItem(zoneItem); // // QIcon MenuDefIcon = Utils::CreateAssetIcon(ASSET_TYPE_MENU);
strTableRoot->setText(0, "String Tables");
strTableRoot->setIcon(0, QIcon(":/icons/icons/Icon_StringTable.png"));
for (StringTable strTable: assetMap.stringTables) { // // XTreeWidgetItem *menuRoot = new XTreeWidgetItem(zoneItem);
XTreeWidgetItem *modelItem = new XTreeWidgetItem(strTableRoot); // // menuRoot->setText(0, "Menu Files");
modelItem->setText(0, strTable.name); // // menuRoot->setIcon(0, MenuDefIcon);
modelItem->setIcon(0, QIcon(":/icons/icons/Icon_StringTable.png")); // // menuRoot->SetCategory(CATEGORY_TYPE);
}
}
if (!assetMap.sounds.isEmpty()) { // // int menuIndex = 1;
XTreeWidgetItem *soundsRoot = new XTreeWidgetItem(zoneItem); // // for (MenuDef menuDef : assetMap.menuDefinitions) {
soundsRoot->setText(0, "Sounds"); // // XTreeWidgetItem *MenuDefRoot = new XTreeWidgetItem(menuRoot);
soundsRoot->setIcon(0, QIcon(":/icons/icons/Icon_Sound.png")); // // MenuDefRoot->setText(0, QString("Menu %1").arg(menuIndex));
for (SoundAsset soundAsset : assetMap.sounds) { // // for (Menu menu : menuDef.men) {
for (Sound sound : soundAsset.sounds) { // // XTreeWidgetItem *menuItem = new XTreeWidgetItem(MenuDefRoot);
XTreeWidgetItem *tempItem = soundsRoot; // // menuItem->setText(0, menu.filePath);
// // menuItem->setIcon(0, MenuDefIcon);
// // }
// // menuIndex++;
// // }
// }
if (!sound.dataLength) { continue; } // if (!assetMap.images.isEmpty()) {
// // QIcon imageIcon = Utils::CreateAssetIcon(ASSET_TYPE_IMAGE);
for (const QString &pathPart : sound.path.split('/')) { // // XTreeWidgetItem *imageRoot = new XTreeWidgetItem(zoneItem);
if (pathPart.isEmpty()) { continue; } // // imageRoot->setText(0, "Images");
// // imageRoot->setIcon(0, imageIcon);
// // imageRoot->SetCategory(CATEGORY_TYPE);
bool childFound = false; // // for (Image image : assetMap.images) {
for (int i = 0; i < tempItem->childCount(); i++) { // // XTreeWidgetItem *imageItem = new XTreeWidgetItem(imageRoot);
XTreeWidgetItem *childItem = dynamic_cast<XTreeWidgetItem*>(tempItem->child(i)); // // imageItem->setText(0, image.materialName);
if (childItem->text(0) == pathPart) { // // imageItem->setIcon(0, imageIcon);
tempItem = childItem; // // }
// }
childFound = true; // if (!assetMap.models.isEmpty()) {
break; // QIcon modelIcon = Utils::CreateAssetIcon(ASSET_TYPE_XMODEL);
}
}
if (pathPart.contains(".wav")) { // XTreeWidgetItem *modelsRoot = new XTreeWidgetItem(zoneItem);
XTreeWidgetItem *soundItem = new XTreeWidgetItem(tempItem); // modelsRoot->setText(0, "Models");
soundItem->setText(0, pathPart); // modelsRoot->setIcon(0, modelIcon);
// modelsRoot->SetCategory(CATEGORY_TYPE);
tempItem = soundItem; // for (auto model: assetMap.models) {
} else if (!childFound) { // XTreeWidgetItem *modelItem = new XTreeWidgetItem(modelsRoot);
tempItem = new XTreeWidgetItem(tempItem); // modelItem->setText(0, model.name);
tempItem->setText(0, pathPart); // modelItem->setIcon(0, modelIcon);
} // }
// }
} // if (!assetMap.materials.isEmpty()) {
tempItem->setIcon(0, QIcon(":/icons/icons/Icon_Sound.png")); // QIcon materialIcon = Utils::CreateAssetIcon(ASSET_TYPE_MATERIAL);
}
}
}
mZoneFiles[aZoneFile->GetStem().section(".", 0, 0)] = aZoneFile; // 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) { void XTreeWidget::CloseFastFile(const QString aFFName) {
const QString fileStem = aFFName.section(".", 0, 0); const QString fileStem = aFFName;
emit ItemClosed(fileStem); emit ItemClosed(fileStem);
} }
@ -291,7 +302,7 @@ void XTreeWidget::PrepareContextMenu(const QPoint &pos) {
QMenu *exportSubmenu = new QMenu("Export...", this); QMenu *exportSubmenu = new QMenu("Export...", this);
contextMenu->addMenu(exportSubmenu); contextMenu->addMenu(exportSubmenu);
std::shared_ptr<DDSFile> ddsFile = mDDSFiles[fileStem]; const DDSFile* ddsFile = mDDSFiles[fileStem];
QAction *exportIWIAction = new QAction("Export as IWI"); QAction *exportIWIAction = new QAction("Export as IWI");
exportSubmenu->addAction(exportIWIAction); exportSubmenu->addAction(exportIWIAction);
@ -335,7 +346,7 @@ void XTreeWidget::PrepareContextMenu(const QPoint &pos) {
QMenu *exportSubmenu = new QMenu("Export...", this); QMenu *exportSubmenu = new QMenu("Export...", this);
contextMenu->addMenu(exportSubmenu); contextMenu->addMenu(exportSubmenu);
std::shared_ptr<IWIFile> iwiFile = mIWIFiles[fileStem]; const IWIFile* iwiFile = mIWIFiles[fileStem];
QAction *exportDDSAction = new QAction("Export as DDS"); QAction *exportDDSAction = new QAction("Export as DDS");
exportSubmenu->addAction(exportDDSAction); exportSubmenu->addAction(exportDDSAction);
@ -361,7 +372,7 @@ void XTreeWidget::PrepareContextMenu(const QPoint &pos) {
iwiFile->SaveJPG(); iwiFile->SaveJPG();
}); });
} else if (activeText.contains(".ff")) { } else if (activeText.contains(".ff")) {
const QString fileStem = activeText.replace(".zone", ""); const QString fileStem = activeText;
QMenu *closeMultipleAction = new QMenu("Close Multiple Tabs"); QMenu *closeMultipleAction = new QMenu("Close Multiple Tabs");
@ -385,7 +396,7 @@ void XTreeWidget::PrepareContextMenu(const QPoint &pos) {
auto childItem = invisibleRootItem()->child(i); auto childItem = invisibleRootItem()->child(i);
if (childItem == activeItem) { continue; } if (childItem == activeItem) { continue; }
const QString fileStem = childItem->text(0).replace(".ff", ""); const QString fileStem = childItem->text(0);
if (!mFastFiles.contains(fileStem)) { if (!mFastFiles.contains(fileStem)) {
qDebug() << "Error: Could not find " << fileStem << " in Fast File map!"; qDebug() << "Error: Could not find " << fileStem << " in Fast File map!";
return; return;
@ -407,7 +418,7 @@ void XTreeWidget::PrepareContextMenu(const QPoint &pos) {
auto childItem = invisibleRootItem()->child(i); auto childItem = invisibleRootItem()->child(i);
if (childItem == activeItem) { return; } if (childItem == activeItem) { return; }
const QString fileStem = childItem->text(0).replace(".ff", ""); const QString fileStem = childItem->text(0);
if (!mFastFiles.contains(fileStem)) { if (!mFastFiles.contains(fileStem)) {
qDebug() << "Error: Could not find " << fileStem << " in Fast File map!"; qDebug() << "Error: Could not find " << fileStem << " in Fast File map!";
return; return;
@ -434,7 +445,7 @@ void XTreeWidget::PrepareContextMenu(const QPoint &pos) {
continue; continue;
} }
const QString fileStem = childItem->text(0).replace(".ff", ""); const QString fileStem = childItem->text(0);
if (!mFastFiles.contains(fileStem)) { if (!mFastFiles.contains(fileStem)) {
qDebug() << "Error: Could not find " << fileStem << " in Fast File map!"; qDebug() << "Error: Could not find " << fileStem << " in Fast File map!";
return; return;
@ -454,7 +465,7 @@ void XTreeWidget::PrepareContextMenu(const QPoint &pos) {
connect(closeAction, &QAction::triggered, this, [this, &activeItem, &activeText](bool checked) { connect(closeAction, &QAction::triggered, this, [this, &activeItem, &activeText](bool checked) {
Q_UNUSED(checked); Q_UNUSED(checked);
const QString fileStem = activeItem->text(0).replace(".ff", ""); const QString fileStem = activeItem->text(0);
mFastFiles.remove(fileStem); mFastFiles.remove(fileStem);
CloseFastFile(activeText); CloseFastFile(activeText);
@ -464,7 +475,7 @@ void XTreeWidget::PrepareContextMenu(const QPoint &pos) {
QMenu *exportSubmenu = new QMenu("Export...", this); QMenu *exportSubmenu = new QMenu("Export...", this);
contextMenu->addMenu(exportSubmenu); contextMenu->addMenu(exportSubmenu);
std::shared_ptr<FastFile> fastFile = mFastFiles[fileStem]; const FastFile* fastFile = mFastFiles[fileStem];
QAction *exportFastFileAction = new QAction("Export Fast File"); QAction *exportFastFileAction = new QAction("Export Fast File");
exportSubmenu->addAction(exportFastFileAction); exportSubmenu->addAction(exportFastFileAction);
@ -479,16 +490,16 @@ void XTreeWidget::PrepareContextMenu(const QPoint &pos) {
}); });
QAction *exportZoneFileAction = new QAction("Export Zone File"); QAction *exportZoneFileAction = new QAction("Export Zone File");
exportSubmenu->addAction(exportZoneFileAction); exportSubmenu->addAction(exportZoneFileAction);
connect(exportZoneFileAction, &QAction::triggered, this, [fastFile](bool checked) { connect(exportZoneFileAction, &QAction::triggered, this, [](bool checked) {
Q_UNUSED(checked); Q_UNUSED(checked);
const QString zoneFilePath = QFileDialog::getSaveFileName( // const QString zoneFilePath = QFileDialog::getSaveFileName(
nullptr, "Export Zone File...", QDir::currentPath(), // nullptr, "Export Zone File...", QDir::currentPath(),
"Zone File (*.zone);;All Files(*.*)"); // "Zone File (*.zone);;All Files(*.*)");
fastFile->GetZoneFile()->SaveZoneFile(zoneFilePath); //fastFile->GetZoneFile()->SaveZoneFile(zoneFilePath);
}); });
} else if (activeText.contains(".zone")) { } else if (activeText.contains(".zone")) {
const QString fileStem = activeText.replace(".zone", ""); const QString fileStem = activeText;
if (!mZoneFiles.contains(fileStem)) { if (!mZoneFiles.contains(fileStem)) {
qDebug() << "Error: Could not find " << fileStem << " in Zone File map!"; qDebug() << "Error: Could not find " << fileStem << " in Zone File map!";
return; return;
@ -497,7 +508,7 @@ void XTreeWidget::PrepareContextMenu(const QPoint &pos) {
QMenu *exportSubmenu = new QMenu("Export...", this); QMenu *exportSubmenu = new QMenu("Export...", this);
contextMenu->addMenu(exportSubmenu); contextMenu->addMenu(exportSubmenu);
std::shared_ptr<ZoneFile> zoneFile = mZoneFiles[fileStem]; //const ZoneFile* zoneFile = mZoneFiles[fileStem];
QAction *exportZoneFileAction = new QAction("Export Zone File"); QAction *exportZoneFileAction = new QAction("Export Zone File");
exportSubmenu->addAction(exportZoneFileAction); exportSubmenu->addAction(exportZoneFileAction);
@ -519,41 +530,41 @@ void XTreeWidget::PrepareContextMenu(const QPoint &pos) {
} }
} }
if (parentItem && parentItem != invisibleRootItem() && parentItem->text(0).contains(".zone")) { if (parentItem && parentItem != invisibleRootItem() && parentItem->text(0).contains(".zone")) {
const QString fileStem = parentItem->text(0).section('.', 0, 0); //const QString fileStem = parentItem->text(0).section('.', 0, 0);
QVector<SoundAsset> soundAssets = mZoneFiles[fileStem]->GetAssetMap().sounds; // QVector<LoadedSound> LoadedSounds = mZoneFiles[fileStem]->GetAssetMap().sounds;
for (SoundAsset soundAsset : soundAssets) { // for (LoadedSound LoadedSound : LoadedSounds) {
for (Sound sound : soundAsset.sounds) { // for (Sound sound : LoadedSound.sounds) {
if (sound.path.contains(activeText)) { // if (sound.path.contains(activeText)) {
QMenu *exportSubmenu = new QMenu("Export...", this); // QMenu *exportSubmenu = new QMenu("Export...", this);
contextMenu->addMenu(exportSubmenu); // contextMenu->addMenu(exportSubmenu);
QAction *exportWAVAction = new QAction("Export as WAV File"); // QAction *exportWAVAction = new QAction("Export as WAV File");
exportSubmenu->addAction(exportWAVAction); // exportSubmenu->addAction(exportWAVAction);
connect(exportWAVAction, &QAction::triggered, this, [sound](bool checked) { // connect(exportWAVAction, &QAction::triggered, this, [sound](bool checked) {
Q_UNUSED(checked); // Q_UNUSED(checked);
QDir dir = QDir::currentPath(); // QDir dir = QDir::currentPath();
if (!dir.exists("exports/")) { // if (!dir.exists("exports/")) {
dir.mkdir("exports/"); // dir.mkdir("exports/");
} // }
if (!dir.exists("exports/sounds/")) { // if (!dir.exists("exports/sounds/")) {
dir.mkdir("exports/sounds/"); // dir.mkdir("exports/sounds/");
} // }
const QString fileName = "exports/sounds/" + sound.path.split('/').last(); // const QString fileName = "exports/sounds/" + sound.path.split('/').last();
QFile wavFile(fileName); // QFile wavFile(fileName);
if (!wavFile.open(QIODevice::WriteOnly)) { // if (!wavFile.open(QIODevice::WriteOnly)) {
qDebug() << "Failed to write wav file!"; // qDebug() << "Failed to write wav file!";
return; // return;
} // }
wavFile.write(sound.data); // wavFile.write(sound.data);
wavFile.close(); // wavFile.close();
}); // });
break; // break;
} // }
} // }
} // }
} }
} else if (activeItem && activeText == "Sounds") { } else if (activeItem && activeText == "Sounds") {
XTreeWidgetItem *parentItem = dynamic_cast<XTreeWidgetItem*>(activeItem->parent()); XTreeWidgetItem *parentItem = dynamic_cast<XTreeWidgetItem*>(activeItem->parent());
@ -566,39 +577,39 @@ void XTreeWidget::PrepareContextMenu(const QPoint &pos) {
} }
if (parentItem && parentItem != invisibleRootItem() && parentItem->text(0).contains(".zone")) { if (parentItem && parentItem != invisibleRootItem() && parentItem->text(0).contains(".zone")) {
const QString fileStem = parentItem->text(0).section('.', 0, 0); const QString fileStem = parentItem->text(0).section('.', 0, 0);
auto zoneFile = mZoneFiles[fileStem]; //auto zoneFile = mZoneFiles[fileStem];
QMenu *exportSubmenu = new QMenu("Export...", this); QMenu *exportSubmenu = new QMenu("Export...", this);
contextMenu->addMenu(exportSubmenu); contextMenu->addMenu(exportSubmenu);
QAction *exportAllWAVAction = new QAction("Export ALL as WAV Files"); QAction *exportAllWAVAction = new QAction("Export ALL as WAV Files");
exportSubmenu->addAction(exportAllWAVAction); exportSubmenu->addAction(exportAllWAVAction);
connect(exportAllWAVAction, &QAction::triggered, this, [zoneFile](bool checked) { connect(exportAllWAVAction, &QAction::triggered, this, [](bool checked) {
Q_UNUSED(checked); Q_UNUSED(checked);
for (SoundAsset soundAsset : zoneFile->GetAssetMap().sounds) { // for (LoadedSound LoadedSound : zoneFile->GetAssetMap().sounds) {
for (Sound sound : soundAsset.sounds) { // for (Sound sound : LoadedSound.sounds) {
if (!sound.dataLength) { continue; } // if (!sound.dataLength) { continue; }
QDir dir = QDir::currentPath(); // QDir dir = QDir::currentPath();
if (!dir.exists("exports/")) { // if (!dir.exists("exports/")) {
dir.mkdir("exports/"); // dir.mkdir("exports/");
} // }
if (!dir.exists("exports/sounds/")) { // if (!dir.exists("exports/sounds/")) {
dir.mkdir("exports/sounds/"); // dir.mkdir("exports/sounds/");
} // }
const QString fileName = "exports/sounds/" + sound.path.split('/').last(); // const QString fileName = "exports/sounds/" + sound.path.split('/').last();
QFile wavFile(fileName); // QFile wavFile(fileName);
if (!wavFile.open(QIODevice::WriteOnly)) { // if (!wavFile.open(QIODevice::WriteOnly)) {
qDebug() << "Failed to write wav file!"; // qDebug() << "Failed to write wav file!";
return; // return;
} // }
wavFile.write(sound.data); // wavFile.write(sound.data);
wavFile.close(); // wavFile.close();
} // }
} // }
}); });
} }
} }
@ -618,95 +629,58 @@ void XTreeWidget::ItemSelectionChanged() {
QString selectedText = selectedItem->text(0); QString selectedText = selectedItem->text(0);
emit ItemSelected(selectedText); emit ItemSelected(selectedText);
const QString fileStem = selectedText.section(".", 0, 0);
XTreeWidgetItem *parentItem = dynamic_cast<XTreeWidgetItem*>(selectedItem->parent()); XTreeWidgetItem *parentItem = dynamic_cast<XTreeWidgetItem*>(selectedItem->parent());
if (selectedText.contains(".dds")) { /*if (selectedText.contains(".dds")) {
if (!mDDSFiles.contains(fileStem)) { if (!mDDSFiles.contains(selectedText)) {
LogManager::instance().addError("Could not find " + fileStem + " in DDS map!"); LogManager::instance().addError("Could not find " + selectedText + " in DDS map!");
return; return;
} }
std::shared_ptr<DDSFile> ddsFile = mDDSFiles[fileStem]; emit DDSFileSelected(mDDSFiles[selectedText], selectedText);
emit DDSFileSelected(ddsFile, fileStem);
} else if (selectedText.contains(".iwi")) { } else if (selectedText.contains(".iwi")) {
if (!mIWIFiles.contains(fileStem)) { if (!mIWIFiles.contains(selectedText)) {
LogManager::instance().addError("Could not find " + fileStem + " in IWI map!"); LogManager::instance().addError("Could not find " + selectedText + " in IWI map!");
return; return;
} }
emit IWIFileSelected(mIWIFiles[fileStem], fileStem); emit IWIFileSelected(mIWIFiles[selectedText], selectedText);
} else if (selectedText.contains(".ff")) { } else */if (selectedText.contains(".ff")) {
if (!mFastFiles.contains(fileStem)) { if (!mFastFiles.contains(selectedText)) {
LogManager::instance().addError("Could not find " + fileStem + " in Fast File map!"); LogManager::instance().addError("Could not find " + selectedText + " in Fast File map!");
return; return;
} }
emit FastFileSelected(mFastFiles[fileStem], fileStem); emit FastFileSelected(mFastFiles[selectedText], selectedText);
} else if (selectedText.contains(".zone")) { } else if (selectedText.contains(".zone")) {
if (!mZoneFiles.contains(fileStem)) { if (!mZoneFiles.contains(selectedText)) {
LogManager::instance().addError("Could not find " + fileStem + " in Zone File map!"); LogManager::instance().addError("Could not find " + selectedText + " in Zone File map!");
return; return;
} }
emit ZoneFileSelected(mZoneFiles[fileStem], fileStem); emit ZoneFileSelected(mZoneFiles[selectedText], selectedText);
} else if (selectedText.contains(".str")) { } else if (selectedText.contains(".str")) {
if (!mZoneFiles.contains(fileStem)) { if (!mZoneFiles.contains(selectedText.replace(".str", ".zone"))) {
LogManager::instance().addError("Could not find " + fileStem + " in Zone File map!"); LogManager::instance().addError("Could not find " + selectedText + " in Zone File map!");
return; return;
} }
emit LocalStringSelected(mZoneFiles[fileStem], fileStem); emit LocalStringSelected(mZoneFiles[selectedText], selectedText);
} else if (selectedText.contains(".gsc")) {
XTreeWidgetItem *zoneRoot = selectedItem;
if (!zoneRoot) { return; }
while (!zoneRoot->text(0).contains(".zone")) {
zoneRoot = dynamic_cast<XTreeWidgetItem*>(zoneRoot->parent());
if (!zoneRoot) { return; }
}
const QString fileStem = zoneRoot->text(0).section('.', 0, 0);
if (!mZoneFiles.contains(fileStem)) {
LogManager::instance().addError("Could not find " + fileStem + " in Zone File map!");
return;
}
QVector<RawFile> rawFiles = mZoneFiles[fileStem]->GetAssetMap().rawFiles;
for (RawFile rawFile : rawFiles) {
if (rawFile.path.contains(selectedText)) {
emit RawFileSelected(std::make_shared<RawFile>(rawFile), fileStem);
return;
}
}
} else if (parentItem && (parentItem->text(0) == "Images")) { } else if (parentItem && (parentItem->text(0) == "Images")) {
XTreeWidgetItem *grandpaItem = dynamic_cast<XTreeWidgetItem*>(parentItem->parent()); XTreeWidgetItem *grandpaItem = dynamic_cast<XTreeWidgetItem*>(parentItem->parent());
if (grandpaItem && grandpaItem->text(0).contains(".zone")) { if (grandpaItem && grandpaItem->text(0).contains(".zone")) {
const QString fileStem = grandpaItem->text(0).section('.', 0, 0); const QString fileStem = grandpaItem->text(0).section('.', 0, 0);
QVector<Image> images = mZoneFiles[fileStem]->GetAssetMap().images; // QVector<Image> images = mZoneFiles[fileStem]->GetAssetMap().images;
for (Image image : images) { // for (Image image : images) {
if (image.materialName == selectedText) { // if (image.materialName == selectedText) {
emit ImageSelected(std::make_shared<Image>(image), fileStem); // emit ImageSelected(std::make_shared<Image>(image), fileStem);
break; // break;
// }
// }
} }
} } /*else if (parentItem && (parentItem->text(0) == "Tech Sets")) {
}
} else if (parentItem && (parentItem->text(0) == "Tech Sets")) {
XTreeWidgetItem *grandpaItem = dynamic_cast<XTreeWidgetItem*>(parentItem->parent()); XTreeWidgetItem *grandpaItem = dynamic_cast<XTreeWidgetItem*>(parentItem->parent());
if (grandpaItem && grandpaItem->text(0).contains(".zone")) { if (grandpaItem && grandpaItem->text(0).contains(".zone")) {
const QString fileStem = grandpaItem->text(0).section('.', 0, 0); const QString fileStem = grandpaItem->text(0).section('.', 0, 0);
auto techsets = mZoneFiles[fileStem]->GetAssetMap().techSets; auto techsets = mZoneFiles[fileStem]->GetAssetList().techSets;
for (auto techset : techsets) { for (auto techset : techsets) {
if (techset.name == selectedText) { if (techset.name == selectedText) {
emit TechSetSelected(std::make_shared<TechSet>(techset), fileStem); emit TechSetSelected(new MaterialTechSet(techset), 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]->GetAssetMap().techSets;
for (auto techset : techsets) {
if (techset.name == selectedText) {
emit TechSetSelected(std::make_shared<TechSet>(techset), fileStem);
break; break;
} }
} }
@ -715,12 +689,12 @@ void XTreeWidget::ItemSelectionChanged() {
XTreeWidgetItem *grandpaItem = dynamic_cast<XTreeWidgetItem*>(parentItem->parent()); XTreeWidgetItem *grandpaItem = dynamic_cast<XTreeWidgetItem*>(parentItem->parent());
if (grandpaItem && grandpaItem->text(0).contains(".zone")) { if (grandpaItem && grandpaItem->text(0).contains(".zone")) {
const QString fileStem = grandpaItem->text(0).section('.', 0, 0); const QString fileStem = grandpaItem->text(0).section('.', 0, 0);
QVector<Material> materials = mZoneFiles[fileStem]->GetAssetMap().materials; auto materials = mZoneFiles[fileStem]->GetAssetMap().materials;
for (Material material : materials) { for (auto material : materials) {
if (material.name == selectedText) { // if (material.name == selectedText) {
emit MaterialSelected(std::make_shared<Material>(material), fileStem); // emit MaterialSelected(std::make_shared<Material>(material), fileStem);
break; // break;
} // }
} }
} }
} else if (parentItem && selectedText.contains(".wav")) { } else if (parentItem && selectedText.contains(".wav")) {
@ -734,20 +708,46 @@ void XTreeWidget::ItemSelectionChanged() {
} }
if (grandpaItem && grandpaItem != invisibleRootItem() && grandpaItem->text(0).contains(".zone")) { if (grandpaItem && grandpaItem != invisibleRootItem() && grandpaItem->text(0).contains(".zone")) {
const QString fileStem = grandpaItem->text(0).section('.', 0, 0); const QString fileStem = grandpaItem->text(0).section('.', 0, 0);
QVector<SoundAsset> soundAssets = mZoneFiles[fileStem]->GetAssetMap().sounds; // QVector<LoadedSound> LoadedSounds = mZoneFiles[fileStem]->GetAssetMap().sounds;
for (SoundAsset soundAsset : soundAssets) { // for (LoadedSound LoadedSound : LoadedSounds) {
for (Sound sound : soundAsset.sounds) { // for (Sound sound : LoadedSound.sounds) {
if (sound.path.contains(selectedText)) { // if (sound.path.contains(selectedText)) {
emit SoundSelected(std::make_shared<Sound>(sound), fileStem); // 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; 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;
//}
} }
} }*/
} }
std::shared_ptr<ZoneFile> XTreeWidget::FindZoneFile(const QString aStem) { const ZoneFile* XTreeWidget::FindZoneFile(const QString aStem) {
foreach (auto zoneFile, mZoneFiles) { foreach (auto zoneFile, mZoneFiles) {
if (zoneFile->GetStem() == aStem) { if (zoneFile->GetStem() == aStem) {
return zoneFile; return zoneFile;
@ -756,7 +756,7 @@ std::shared_ptr<ZoneFile> XTreeWidget::FindZoneFile(const QString aStem) {
return nullptr; return nullptr;
} }
std::shared_ptr<FastFile> XTreeWidget::FindFastFile(const QString aStem) { const FastFile *XTreeWidget::FindFastFile(const QString aStem) {
foreach (auto fastFile, mFastFiles) { foreach (auto fastFile, mFastFiles) {
if (fastFile->GetStem() == aStem) { if (fastFile->GetStem() == aStem) {
return fastFile; return fastFile;
@ -773,7 +773,7 @@ bool XTreeWidget::HasFastFile(const QString aStem) {
return FindFastFile(aStem) != nullptr; return FindFastFile(aStem) != nullptr;
} }
void XTreeWidget::AddIWIFile(std::shared_ptr<IWIFile> aIWIFile) { void XTreeWidget::AddIWIFile(IWIFile* aIWIFile) {
const QString iwiFileName = QString(aIWIFile->fileStem + ".iwi"); const QString iwiFileName = QString(aIWIFile->fileStem + ".iwi");
for (int i = 0; i < invisibleRootItem()->childCount(); i++) { for (int i = 0; i < invisibleRootItem()->childCount(); i++) {
@ -784,12 +784,12 @@ void XTreeWidget::AddIWIFile(std::shared_ptr<IWIFile> aIWIFile) {
} }
XTreeWidgetItem *iwiItem = new XTreeWidgetItem(this); XTreeWidgetItem *iwiItem = new XTreeWidgetItem(this);
iwiItem->setIcon(0, QIcon(":/icons/icons/Icon_IWIFile.png")); iwiItem->setIcon(0, Utils::CreateAssetIcon(ASSET_TYPE_IMAGE));
iwiItem->setText(0, iwiFileName); iwiItem->setText(0, iwiFileName);
mIWIFiles[aIWIFile->fileStem.section(".", 0, 0)] = aIWIFile; mIWIFiles[aIWIFile->fileStem.section(".", 0, 0)] = aIWIFile;
} }
void XTreeWidget::AddDDSFile(std::shared_ptr<DDSFile> aDDSFile) { void XTreeWidget::AddDDSFile(DDSFile* aDDSFile) {
const QString ddsFileName = QString(aDDSFile->fileStem + ".dds"); const QString ddsFileName = QString(aDDSFile->fileStem + ".dds");
for (int i = 0; i < invisibleRootItem()->childCount(); i++) { for (int i = 0; i < invisibleRootItem()->childCount(); i++) {
@ -800,7 +800,7 @@ void XTreeWidget::AddDDSFile(std::shared_ptr<DDSFile> aDDSFile) {
} }
XTreeWidgetItem *ddsItem = new XTreeWidgetItem(this); XTreeWidgetItem *ddsItem = new XTreeWidgetItem(this);
ddsItem->setIcon(0, QIcon(":/icons/icons/Icon_DDSFile.png")); ddsItem->setIcon(0, Utils::CreateAssetIcon(ASSET_TYPE_IMAGE));
ddsItem->setText(0, ddsFileName); ddsItem->setText(0, ddsFileName);
mDDSFiles[aDDSFile->fileStem.section(".", 0, 0)] = aDDSFile; mDDSFiles[aDDSFile->fileStem.section(".", 0, 0)] = aDDSFile;
} }

View File

@ -2,12 +2,16 @@
#define XTREEWIDGET_H #define XTREEWIDGET_H
#include "d3dbsp_structs.h" #include "d3dbsp_structs.h"
#include "asset_structs.h"
#include "ddsfile.h" #include "ddsfile.h"
#include "iwifile.h" #include "iwifile.h"
#include "fastfile.h" #include "fastfile.h"
#include "xloadedsound.h"
#include "xtreewidgetitem.h" #include "xtreewidgetitem.h"
#include "zonefile.h" #include "zonefile.h"
#include "xrawfile.h"
#include "xgfximage.h"
#include "xstringtable.h"
#include "xmenudef.h"
#include <QTreeWidget> #include <QTreeWidget>
#include <QFileDialog> #include <QFileDialog>
@ -19,31 +23,31 @@ public:
explicit XTreeWidget(QWidget *parent = nullptr); explicit XTreeWidget(QWidget *parent = nullptr);
~XTreeWidget(); ~XTreeWidget();
void AddFastFile(std::shared_ptr<FastFile> aFastFile); void AddFastFile(FastFile* aFastFile);
void AddZoneFile(std::shared_ptr<ZoneFile> aZoneFile, XTreeWidgetItem *aParentItem = nullptr); void AddZoneFile(const ZoneFile *aZoneFile, XTreeWidgetItem *aParentItem = nullptr);
void AddIWIFile(std::shared_ptr<IWIFile> aIWIFile); void AddIWIFile(IWIFile* aIWIFile);
void AddDDSFile(std::shared_ptr<DDSFile> aDDSFile); void AddDDSFile(DDSFile* aDDSFile);
std::shared_ptr<ZoneFile> FindZoneFile(const QString aStem); const ZoneFile *FindZoneFile(const QString aStem);
std::shared_ptr<FastFile> FindFastFile(const QString aStem); const FastFile* FindFastFile(const QString aStem);
bool HasZoneFile(const QString aStem); bool HasZoneFile(const QString aStem);
bool HasFastFile(const QString aStem); bool HasFastFile(const QString aStem);
void CloseFastFile(const QString aFFName); void CloseFastFile(const QString aFFName);
signals: signals:
void DDSFileSelected(std::shared_ptr<DDSFile> aDDSFile, const QString aParentName); void DDSFileSelected(const DDSFile* aDDSFile, const QString aParentName);
void IWIFileSelected(std::shared_ptr<IWIFile> aIWIFile, const QString aParentName); void IWIFileSelected(const IWIFile* aIWIFile, const QString aParentName);
void FastFileSelected(std::shared_ptr<FastFile> aFastFile, const QString aParentName); void FastFileSelected(const FastFile* aFastFile, const QString aParentName);
void ZoneFileSelected(std::shared_ptr<ZoneFile> aZoneFile, const QString aParentName); void ZoneFileSelected(const ZoneFile* aZoneFile, const QString aParentName);
void LocalStringSelected(std::shared_ptr<ZoneFile> aZoneFile, const QString aParentName); void LocalStringSelected(const ZoneFile* aZoneFile, const QString aParentName);
void RawFileSelected(std::shared_ptr<RawFile> aRawFile, const QString aParentName); void RawFileSelected(const XRawFile* aRawFile, const QString aParentName);
void ImageSelected(std::shared_ptr<Image> aImage, const QString aParentName); void ImageSelected(const XGfxImage* aImage, const QString aParentName);
void TechSetSelected(std::shared_ptr<TechSet> aZoneFile, const QString aParentName); void TechSetSelected(const XMaterialTechniqueSet* aZoneFile, const QString aParentName);
void StrTableSelected(std::shared_ptr<StringTable> aStrTable, const QString aParentName); void StrTableSelected(const XStringTable* aStrTable, const QString aParentName);
void MenuSelected(std::shared_ptr<Menu> aMenu, const QString aParentName); void MenuSelected(const XMenuDef* aMenu, const QString aParentName);
void SoundSelected(std::shared_ptr<Sound> aSound, const QString aParentName); void SoundSelected(const XLoadedSound* aSound, const QString aParentName);
void MaterialSelected(std::shared_ptr<Material> aMaterial, const QString aParentName); void MaterialSelected(const XMaterial* aMaterial, const QString aParentName);
void ItemSelected(const QString itemText); void ItemSelected(const QString itemText);
void ItemClosed(const QString itemText); void ItemClosed(const QString itemText);
@ -54,10 +58,10 @@ protected:
void PrepareContextMenu(const QPoint &pos); void PrepareContextMenu(const QPoint &pos);
private: private:
QMap<QString, std::shared_ptr<FastFile>> mFastFiles; QMap<QString, const FastFile*> mFastFiles;
QMap<QString, std::shared_ptr<ZoneFile>> mZoneFiles; QMap<QString, const ZoneFile*> mZoneFiles;
QMap<QString, std::shared_ptr<DDSFile>> mDDSFiles; QMap<QString, const DDSFile*> mDDSFiles;
QMap<QString, std::shared_ptr<IWIFile>> mIWIFiles; QMap<QString, const IWIFile*> mIWIFiles;
}; };
#endif // XTREEWIDGET_H #endif // XTREEWIDGET_H

View File

@ -1,15 +1,29 @@
#include "xtreewidgetitem.h" #include "xtreewidgetitem.h"
XTreeWidgetItem::XTreeWidgetItem(QTreeWidget *parent, bool group) XTreeWidgetItem::XTreeWidgetItem(QTreeWidget *parent, bool group)
: QTreeWidgetItem(parent), isGroup(group) { : QTreeWidgetItem(parent)
, isGroup(group)
, mCategory(CATEGORY_NONE) {
} }
XTreeWidgetItem::XTreeWidgetItem(QTreeWidgetItem *parent, bool group) XTreeWidgetItem::XTreeWidgetItem(QTreeWidgetItem *parent, bool group)
: QTreeWidgetItem(parent), isGroup(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 { bool XTreeWidgetItem::operator<(const QTreeWidgetItem &other) const {
// Attempt to cast the other item to our custom type. // Attempt to cast the other item to our custom type.
const XTreeWidgetItem* otherItem = dynamic_cast<const XTreeWidgetItem*>(&other); const XTreeWidgetItem* otherItem = dynamic_cast<const XTreeWidgetItem*>(&other);

View File

@ -4,6 +4,12 @@
#include <QTreeWidget> #include <QTreeWidget>
#include <QTreeWidgetItem> #include <QTreeWidgetItem>
enum TREE_CATEGORY {
CATEGORY_NONE = 0x00,
CATEGORY_FILE = 0x01,
CATEGORY_TYPE = 0x02
};
// Custom item class // Custom item class
class XTreeWidgetItem : public QTreeWidgetItem class XTreeWidgetItem : public QTreeWidgetItem
{ {
@ -15,9 +21,15 @@ public:
XTreeWidgetItem(QTreeWidget *parent, bool group = false); XTreeWidgetItem(QTreeWidget *parent, bool group = false);
XTreeWidgetItem(QTreeWidgetItem *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. // Override the less-than operator to customize sorting.
bool operator<(const QTreeWidgetItem &other) const override; bool operator<(const QTreeWidgetItem &other) const override;
XTreeWidgetItem &operator =(const XTreeWidgetItem &other); XTreeWidgetItem &operator =(const XTreeWidgetItem &other);
private:
TREE_CATEGORY mCategory;
}; };

View File

@ -1,6 +1,8 @@
#include "zonefileviewer.h" #include "zonefileviewer.h"
#include "ui_zonefileviewer.h" #include "ui_zonefileviewer.h"
#include "statusbarmanager.h"
ZoneFileViewer::ZoneFileViewer(QWidget *parent) ZoneFileViewer::ZoneFileViewer(QWidget *parent)
: QWidget(parent) : QWidget(parent)
, ui(new Ui::ZoneFileViewer) { , ui(new Ui::ZoneFileViewer) {
@ -8,16 +10,19 @@ ZoneFileViewer::ZoneFileViewer(QWidget *parent)
mZoneFile = nullptr; mZoneFile = nullptr;
ui->tableWidget_RecordCounts->setColumnCount(4); ui->tableWidget_RecordCounts->setColumnCount(3);
ui->tableWidget_RecordCounts->setHorizontalHeaderLabels({ "Identifier", "Asset", "Count", "Icon" }); ui->tableWidget_RecordCounts->setHorizontalHeaderLabels({ "Identifier", "Asset", "Count" });
ui->tableWidget_RecordCounts->horizontalHeader()->setStretchLastSection(true); ui->tableWidget_RecordCounts->horizontalHeader()->setStretchLastSection(true);
ui->tableWidget_RecordOrder->setColumnCount(4); ui->tableWidget_RecordOrder->setColumnCount(3);
ui->tableWidget_RecordOrder->setHorizontalHeaderLabels({ "Identifier", "Asset", "Count", "Icon" }); ui->tableWidget_RecordOrder->setHorizontalHeaderLabels({ "Identifier", "Asset", "Count" });
ui->tableWidget_RecordOrder->horizontalHeader()->setStretchLastSection(true); ui->tableWidget_RecordOrder->horizontalHeader()->setStretchLastSection(true);
connect(ui->lineEdit_TagSearch, &QLineEdit::textChanged, this, &ZoneFileViewer::SortTags); connect(ui->lineEdit_TagSearch, &QLineEdit::textChanged, this, &ZoneFileViewer::SortTags);
connect(ui->tableWidget_RecordCounts, &QTableWidget::itemSelectionChanged, this, &ZoneFileViewer::HighlightRecordInOrder); 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() { ZoneFileViewer::~ZoneFileViewer() {
@ -60,10 +65,11 @@ void ZoneFileViewer::SortTags(const QString &aSearchText) {
} }
} }
StatusBarManager::instance().updateStatus(QString("Found %1 tags.").arg(sortedTags.size()));
ui->listWidget_Tags->addItems(sortedTags); ui->listWidget_Tags->addItems(sortedTags);
} }
void ZoneFileViewer::SetZoneFile(std::shared_ptr<ZoneFile> aZoneFile) { void ZoneFileViewer::SetZoneFile(const ZoneFile* aZoneFile) {
mZoneFile = aZoneFile; mZoneFile = aZoneFile;
ui->tableWidget_RecordCounts->clearContents(); ui->tableWidget_RecordCounts->clearContents();
@ -72,7 +78,9 @@ void ZoneFileViewer::SetZoneFile(std::shared_ptr<ZoneFile> aZoneFile) {
const QStringList tags = mZoneFile->GetTags(); const QStringList tags = mZoneFile->GetTags();
ui->listWidget_Tags->addItems(tags); ui->listWidget_Tags->addItems(tags);
ui->label_Title->setText(mZoneFile->GetStem() + ".zone"); ui->label_Title->setText(mZoneFile->GetBaseStem() + ".zone");
ui->groupBox_Tags->setTitle(QString("Tags (%1)").arg(tags.size()));
if (tags.isEmpty()) { if (tags.isEmpty()) {
ui->groupBox_Tags->hide(); ui->groupBox_Tags->hide();
@ -80,71 +88,65 @@ void ZoneFileViewer::SetZoneFile(std::shared_ptr<ZoneFile> aZoneFile) {
ui->groupBox_Tags->show(); ui->groupBox_Tags->show();
} }
QMap<QString, int> recordCounts = QMap<QString, int>(); QMap<XAssetType, int> recordCounts = QMap<XAssetType, int>();
QVector<QPair<QString, int>> assetOccurances = QVector<QPair<QString, int>>(); QVector<QPair<XAssetType, int>> assetOccurances = QVector<QPair<XAssetType, int>>();
for (const QString &record : mZoneFile->GetRecords()) { for (XAssetType type : mZoneFile->GetTypes()) {
if (!recordCounts.contains(record)) { if (!recordCounts.contains(type)) {
recordCounts[record] = 0; recordCounts[type] = 0;
} }
recordCounts[record]++; recordCounts[type]++;
if (!assetOccurances.isEmpty() && assetOccurances.last().first == record) { if (!assetOccurances.isEmpty() && assetOccurances.last().first == type) {
assetOccurances.last().second++; assetOccurances.last().second++;
continue; continue;
} }
QPair<QString, int> assetOccurance(record, 1); QPair<XAssetType, int> assetOccurance(type, 1);
assetOccurances << assetOccurance; assetOccurances << assetOccurance;
} }
ui->tableWidget_RecordOrder->setRowCount(assetOccurances.size()); ui->tableWidget_RecordOrder->setRowCount(assetOccurances.size());
int assetIndex = 0; int assetIndex = 0;
foreach (auto assetOccurance, assetOccurances) { foreach (auto assetOccurance, assetOccurances) {
const QString record = assetOccurance.first; XAssetType assetType = assetOccurance.first;
AssetType assetType = mZoneFile->AssetStrToEnum(record);
int assetCount = assetOccurance.second; int assetCount = assetOccurance.second;
QIcon assetIcon = mZoneFile->AssetTypeToIcon(assetType); QIcon assetIcon = Utils::CreateAssetIcon(assetType);
if (assetIcon.isNull()) { if (assetIcon.isNull()) {
qDebug() << "Icon is null for record: " << record; qDebug() << "Icon is null for record: " << assetType;
} }
QTableWidgetItem *recordItem = new QTableWidgetItem(record.toUpper()); QTableWidgetItem *recordItem = new QTableWidgetItem(QString::number(assetType, 16));
QTableWidgetItem *recordStrItem = new QTableWidgetItem(mZoneFile->AssetEnumToStr(assetType)); QTableWidgetItem *recordStrItem = new QTableWidgetItem(XAsset::XAssetTypeToString(assetType));
QTableWidgetItem *recordCountItem = new QTableWidgetItem(QString::number(assetCount)); QTableWidgetItem *recordCountItem = new QTableWidgetItem(QString::number(assetCount));
QTableWidgetItem *recordIconItem = new QTableWidgetItem(); recordItem->setIcon(assetIcon);
recordIconItem->setIcon(assetIcon);
ui->tableWidget_RecordOrder->setItem(assetIndex, 0, recordItem); ui->tableWidget_RecordOrder->setItem(assetIndex, 0, recordItem);
ui->tableWidget_RecordOrder->setItem(assetIndex, 1, recordStrItem); ui->tableWidget_RecordOrder->setItem(assetIndex, 1, recordStrItem);
ui->tableWidget_RecordOrder->setItem(assetIndex, 2, recordCountItem); ui->tableWidget_RecordOrder->setItem(assetIndex, 2, recordCountItem);
ui->tableWidget_RecordOrder->setItem(assetIndex, 3, recordIconItem);
assetIndex++; assetIndex++;
} }
int recordIndex = 0; int recordIndex = 0;
for (const QString &record : recordCounts.keys()) { for (XAssetType assetType : recordCounts.keys()) {
int recordCount = recordCounts[record]; int recordCount = recordCounts[assetType];
AssetType assetType = mZoneFile->AssetStrToEnum(record); QIcon assetIcon = Utils::CreateAssetIcon(assetType);
QIcon assetIcon = mZoneFile->AssetTypeToIcon(assetType);
if (assetIcon.isNull()) { if (assetIcon.isNull()) {
qDebug() << "Icon is null for record: " << record; qDebug() << "Icon is null for record: " << assetType;
} }
ui->tableWidget_RecordCounts->setRowCount(recordIndex + 1); ui->tableWidget_RecordCounts->setRowCount(recordIndex + 1);
QTableWidgetItem *recordCountStrItem = new QTableWidgetItem(mZoneFile->AssetEnumToStr(assetType)); QTableWidgetItem *recordItem = new QTableWidgetItem(QString::number(assetType, 16));
QTableWidgetItem *recordItem = new QTableWidgetItem(record.toUpper()); QTableWidgetItem *recordCountStrItem = new QTableWidgetItem(XAsset::XAssetTypeToString(assetType));
QTableWidgetItem *recordCountItem = new QTableWidgetItem(QString::number(recordCount)); QTableWidgetItem *recordCountItem = new QTableWidgetItem(QString::number(recordCount));
QTableWidgetItem *recordIconItem = new QTableWidgetItem(); recordItem->setIcon(assetIcon);
recordIconItem->setIcon(assetIcon);
ui->tableWidget_RecordCounts->setItem(recordIndex, 0, recordItem); ui->tableWidget_RecordCounts->setItem(recordIndex, 0, recordItem);
ui->tableWidget_RecordCounts->setItem(recordIndex, 1, recordCountStrItem); ui->tableWidget_RecordCounts->setItem(recordIndex, 1, recordCountStrItem);
ui->tableWidget_RecordCounts->setItem(recordIndex, 2, recordCountItem); ui->tableWidget_RecordCounts->setItem(recordIndex, 2, recordCountItem);
ui->tableWidget_RecordCounts->setItem(recordIndex, 3, recordIconItem);
recordIndex++; recordIndex++;
} }

View File

@ -18,7 +18,7 @@ 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: public slots:
void SortTags(const QString &aSearchText); void SortTags(const QString &aSearchText);
@ -27,7 +27,7 @@ public slots:
private: private:
Ui::ZoneFileViewer *ui; Ui::ZoneFileViewer *ui;
std::shared_ptr<ZoneFile> mZoneFile; const ZoneFile* mZoneFile;
}; };
#endif // ZONEFILEVIEWER_H #endif // ZONEFILEVIEWER_H

396
bink.h
View File

@ -1,396 +0,0 @@
/* xoreos - A reimplementation of BioWare's Aurora engine
*
* xoreos is the legal property of its developers, whose names
* can be found in the AUTHORS file distributed with this source
* distribution.
*
* xoreos is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 3
* of the License, or (at your option) any later version.
*
* xoreos is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with xoreos. If not, see <http://www.gnu.org/licenses/>.
*/
/** @file
* Decoding RAD Game Tools' Bink videos.
*/
/* Based on the Bink implementation in FFmpeg (<https://ffmpeg.org/)>,
* which is released under the terms of version 2 or later of the GNU
* Lesser General Public License.
*
* The original copyright notes in the files
* - libavformat/bink.c
* - libavcodec/bink.c
* - libavcodec/binkdata.h
* - libavcodec/binkdsp.c
* - libavcodec/binkdsp.h
* - libavcodec/binkaudio.c
* read as follows:
*
* Bink demuxer
* Copyright (c) 2008-2010 Peter Ross (pross@xvid.org)
* Copyright (c) 2009 Daniel Verkamp (daniel@drv.nu)
*
* Bink video decoder
* Copyright (c) 2009 Konstantin Shishkov
* Copyright (C) 2011 Peter Ross <pross@xvid.org>
*
* Bink video decoder
* Copyright (C) 2009 Konstantin Shishkov
*
* Bink DSP routines
* Copyright (c) 2009 Konstantin Shishkov
*
* Bink Audio decoder
* Copyright (c) 2007-2011 Peter Ross (pross@xvid.org)
* Copyright (c) 2009 Daniel Verkamp (daniel@drv.nu)
*
* FFmpeg is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* FFmpeg is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef VIDEO_BINK_H
#define VIDEO_BINK_H
#include <vector>
#include <memory>
#include "src/common/types.h"
#include "src/common/rational.h"
#include "src/video/decoder.h"
namespace Common {
class SeekableReadStream;
class BitStream;
class Huffman;
class RDFT;
class DCT;
}
namespace Sound {
class PacketizedAudioStream;
}
namespace Video {
/** A decoder for RAD Game Tools' Bink videos. */
class Bink : public VideoDecoder {
public:
Bink(Common::SeekableReadStream *bink);
~Bink();
protected:
void decodeNextTrackFrame(VideoTrack &track);
void checkAudioBuffer(AudioTrack &track, const Common::Timestamp &endTime);
private:
static const int kAudioChannelsMax = 2;
static const int kAudioBlockSizeMax = (kAudioChannelsMax << 11);
enum AudioCodec {
kAudioCodecDCT,
kAudioCodecRDFT
};
/** An audio track. */
struct AudioInfo {
uint16_t flags;
uint32_t sampleRate;
uint8_t channels;
uint32_t outSampleRate;
uint8_t outChannels;
AudioCodec codec;
bool first;
uint32_t frameLen;
uint32_t overlapLen;
uint32_t blockSize;
uint32_t bandCount;
uint32_t *bands;
float root;
float coeffs[16 * kAudioBlockSizeMax];
int16_t prevCoeffs[kAudioBlockSizeMax];
float *coeffsPtr[kAudioChannelsMax];
Common::RDFT *rdft;
Common::DCT *dct;
AudioInfo();
AudioInfo(const AudioInfo &audioInfo) = default;
~AudioInfo();
};
/** A video frame. */
struct VideoFrame {
bool keyFrame;
uint32_t offset;
uint32_t size;
Common::BitStream *bits;
VideoFrame();
VideoFrame(const VideoFrame &videoFrame) = default;
~VideoFrame();
};
std::unique_ptr<Common::SeekableReadStream> _bink;
std::vector<AudioInfo> _audioTracks; ///< All audio tracks.
std::vector<VideoFrame> _frames; ///< All video frames.
uint32_t _audioTrack; ///< Audio track to use.
/** Load a Bink file. */
void load();
class BinkVideoTrack : public FixedRateVideoTrack {
public:
BinkVideoTrack(uint32_t width, uint32_t height, uint32_t frameCount, const Common::Rational &frameRate, bool swapPlanes, bool hasAlpha, uint32_t id);
uint32_t getWidth() const { return _width; }
uint32_t getHeight() const { return _height; }
int getCurFrame() const { return _curFrame; }
int getFrameCount() const { return _frameCount; }
/** Decode a video packet. */
void decodePacket(Graphics::Surface &surface, VideoFrame &frame);
protected:
Common::Rational getFrameRate() const { return _frameRate; }
private:
/** A decoder state. */
struct DecodeContext {
VideoFrame *video;
uint32_t planeIdx;
uint32_t blockX;
uint32_t blockY;
byte *dest;
byte *prev;
byte *destStart, *destEnd;
byte *prevStart, *prevEnd;
uint32_t pitch;
int coordMap[64];
int coordScaledMap1[64];
int coordScaledMap2[64];
int coordScaledMap3[64];
int coordScaledMap4[64];
};
/** IDs for different data types used in Bink video codec. */
enum Source {
kSourceBlockTypes = 0, ///< 8x8 block types.
kSourceSubBlockTypes , ///< 16x16 block types (a subset of 8x8 block types).
kSourceColors , ///< Pixel values used for different block types.
kSourcePattern , ///< 8-bit values for 2-color pattern fill.
kSourceXOff , ///< X components of motion value.
kSourceYOff , ///< Y components of motion value.
kSourceIntraDC , ///< DC values for intrablocks with DCT.
kSourceInterDC , ///< DC values for interblocks with DCT.
kSourceRun , ///< Run lengths for special fill block.
kSourceMAX
};
/** Bink video block types. */
enum BlockType {
kBlockSkip = 0, ///< Skipped block.
kBlockScaled , ///< Block has size 16x16.
kBlockMotion , ///< Block is copied from previous frame with some offset.
kBlockRun , ///< Block is composed from runs of colors with custom scan order.
kBlockResidue , ///< Motion block with some difference added.
kBlockIntra , ///< Intra DCT block.
kBlockFill , ///< Block is filled with single color.
kBlockInter , ///< Motion block with DCT applied to the difference.
kBlockPattern , ///< Block is filled with two colors following custom pattern.
kBlockRaw ///< Uncoded 8x8 block.
};
/** Data structure for decoding and translating Huffman'd data. */
struct Huffman {
int index; ///< Index of the Huffman codebook to use.
byte symbols[16]; ///< Huffman symbol => Bink symbol translation list.
Huffman();
};
/** Data structure used for decoding a single Bink data type. */
struct Bundle {
int countLengths[2]; ///< Lengths of number of entries to decode (in bits).
int countLength; ///< Length of number of entries to decode (in bits) for the current plane.
Huffman huffman; ///< Huffman codebook.
std::unique_ptr<byte[]> data; ///< Buffer for decoded symbols.
byte *dataEnd; ///< Pointer to the data end end.
byte *curDec; ///< Pointer to the data that wasn't yet decoded.
byte *curPtr; ///< Pointer to the data that wasn't yet read.
Bundle();
};
uint32_t _width;
uint32_t _height;
int _curFrame; ///< Current Frame.
int _frameCount;
Common::Rational _frameRate; ///< The frame rate of the video.
bool _swapPlanes; ///< Are the planes ordered (A)YVU instead of (A)YUV?
bool _hasAlpha; ///< Do video frames have alpha?
uint32_t _id; ///< The BIK FourCC.
Bundle _bundles[kSourceMAX]; ///< Bundles for decoding all data types.
std::unique_ptr<Common::Huffman> _huffman[16]; ///< The 16 Huffman codebooks used in Bink decoding.
/** Huffman codebooks to use for decoding high nibbles in color data types. */
Huffman _colHighHuffman[16];
/** Value of the last decoded high nibble in color data types. */
int _colLastVal;
std::unique_ptr<byte[]> _curPlanes[4]; ///< The 4 color planes, YUVA, current frame.
std::unique_ptr<byte[]> _oldPlanes[4]; ///< The 4 color planes, YUVA, last frame.
/** Initialize the bundles. */
void initBundles();
/** Initialize the Huffman decoders. */
void initHuffman();
/** Decode a video packet. */
void videoPacket(VideoFrame &video);
/** Decode a plane. */
void decodePlane(VideoFrame &video, int planeIdx, bool isChroma);
/** Read/Initialize a bundle for decoding a plane. */
void readBundle(VideoFrame &video, Source source);
/** Read the symbols for a Huffman code. */
void readHuffman(VideoFrame &video, Huffman &huffman);
/** Merge two Huffman symbol lists. */
void mergeHuffmanSymbols(VideoFrame &video, byte *dst, const byte *src, int size);
/** Read and translate a symbol out of a Huffman code. */
byte getHuffmanSymbol(VideoFrame &video, Huffman &huffman);
/** Get a direct value out of a bundle. */
int32_t getBundleValue(Source source);
/** Read a count value out of a bundle. */
uint32_t readBundleCount(VideoFrame &video, Bundle &bundle);
// Handle the block types
void blockSkip (DecodeContext &ctx);
void blockScaledSkip (DecodeContext &ctx);
void blockScaledRun (DecodeContext &ctx);
void blockScaledIntra (DecodeContext &ctx);
void blockScaledFill (DecodeContext &ctx);
void blockScaledPattern(DecodeContext &ctx);
void blockScaledRaw (DecodeContext &ctx);
void blockScaled (DecodeContext &ctx);
void blockMotion (DecodeContext &ctx);
void blockRun (DecodeContext &ctx);
void blockResidue (DecodeContext &ctx);
void blockIntra (DecodeContext &ctx);
void blockFill (DecodeContext &ctx);
void blockInter (DecodeContext &ctx);
void blockPattern (DecodeContext &ctx);
void blockRaw (DecodeContext &ctx);
// Read the bundles
void readRuns (VideoFrame &video, Bundle &bundle);
void readMotionValues(VideoFrame &video, Bundle &bundle);
void readBlockTypes (VideoFrame &video, Bundle &bundle);
void readPatterns (VideoFrame &video, Bundle &bundle);
void readColors (VideoFrame &video, Bundle &bundle);
void readDCS (VideoFrame &video, Bundle &bundle, int startBits, bool hasSign);
void readDCTCoeffs (VideoFrame &video, int16_t *block, bool isIntra);
void readResidue (VideoFrame &video, int16_t *block, int masksCount);
// Bink video IDCT
void IDCT(int16_t *block);
void IDCTPut(DecodeContext &ctx, int16_t *block);
void IDCTAdd(DecodeContext &ctx, int16_t *block);
};
class BinkAudioTrack : public AudioTrack {
public:
BinkAudioTrack(size_t index, AudioInfo &audio);
~BinkAudioTrack();
bool canBufferData() const;
/** Decode audio data up to endTime. */
void decodeAudio(Common::SeekableReadStream& bink, const std::vector<VideoFrame>& frames, const std::vector<AudioInfo>& audioTracks, const Common::Timestamp& endTime);
protected:
Sound::AudioStream *getAudioStream() const;
private:
size_t _index;
AudioInfo &_info;
Sound::PacketizedAudioStream *_audioStream;
uint32_t _curFrame;
Common::Timestamp _audioBuffered;
float getFloat(Common::BitStream &bits);
/** Decode an audio block. */
void audioBlock(Common::BitStream &bits, int16_t *out);
/** Decode a DCT'd audio block. */
void audioBlockDCT(Common::BitStream &bits);
/** Decode a RDFT'd audio block. */
void audioBlockRDFT(Common::BitStream &bits);
void readAudioCoeffs(Common::BitStream &bits, float *coeffs);
static void floatToInt16Interleave(int16_t *dst, const float **src, uint32_t length, uint8_t channels);
};
void initAudioTrack(AudioInfo &audio);
};
} // End of namespace Video
#endif // VIDEO_BINK_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,28 +12,6 @@
<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_COD5.png</file>
<file>icons/Icon_COD6.png</file>
<file>icons/Icon_COD7.png</file>
<file>icons/Icon_COD8.png</file>
<file>icons/Icon_COD9.png</file>
<file>icons/Icon_DDSFile.png</file>
<file>icons/Icon_FastFile.png</file>
<file>icons/Icon_IWIFile.png</file>
<file>icons/Icon_PC.png</file>
<file>icons/Icon_Playstation.png</file>
<file>icons/Icon_Xbox.png</file>
<file>icons/Icon_ZoneFile.png</file>
<file>icons/Icon_GSCFile.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>
<file>icons/Icon_Model.png</file>
<file>icons/Icon_StringTable.png</file>
<file>icons/Icon_Sound.png</file>
<file>icons/Icon_Pause.png</file> <file>icons/Icon_Pause.png</file>
<file>icons/Icon_Play.png</file> <file>icons/Icon_Play.png</file>
<file>icons/Icon_SkipBack.png</file> <file>icons/Icon_SkipBack.png</file>
@ -64,31 +20,11 @@
<file>icons/Icon_Editor.png</file> <file>icons/Icon_Editor.png</file>
<file>icons/Icon_Views.png</file> <file>icons/Icon_Views.png</file>
<file>icons/Icon_Tree.png</file> <file>icons/Icon_Tree.png</file>
<file>icons/Icon_Copy.png</file>
<file>icons/Icon_Cut.png</file> <file>icons/Icon_Cut.png</file>
<file>icons/Icon_Find.png</file> <file>icons/Icon_Find.png</file>
<file>icons/Icon_NewFile.png</file> <file>icons/Icon_NewFile.png</file>
<file>icons/Icon_Paste.png</file> <file>icons/Icon_Paste.png</file>
<file>icons/Icon_Save.png</file> <file>icons/Icon_Save.png</file>
<file>icons/Icon_OpenFile.png</file> <file>icons/Icon_OpenFile.png</file>
<file>icons/Icon_COD2.png</file>
<file>icons/Icon_Material.png</file>
<file>icons/Icon_Animation.png</file>
<file>icons/Icon_BSP.png</file>
<file>icons/Icon_ColMapSp.png</file>
<file>icons/Icon_Effect.png</file>
<file>icons/Icon_GameMapSp.png</file>
<file>icons/Icon_Font.png</file>
<file>icons/Icon_FXMap.png</file>
<file>icons/Icon_LightDef.png</file>
<file>icons/Icon_Weapon.png</file>
<file>icons/Icon_RawFile.png</file>
<file>icons/Icon_Destructible.png</file>
<file>icons/Icon_PhysPreset.png</file>
<file>icons/Icon_Wii.png</file>
<file>icons/Icon_WiiU.png</file>
<file>icons/Icon_COD10.png</file>
<file>icons/Icon_COD11.png</file>
<file>icons/Icon_COD12.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.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 316 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 855 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 146 B

670
enums.h
View File

@ -1,670 +0,0 @@
#ifndef ENUMS_H
#define ENUMS_H
#include "qtypes.h"
enum LUMP_TYPE
{
LUMP_MATERIALS = 0x0,
LUMP_LIGHTBYTES = 0x1,
LUMP_LIGHTGRIDENTRIES = 0x2,
LUMP_LIGHTGRIDCOLORS = 0x3,
LUMP_PLANES = 0x4,
LUMP_BRUSHSIDES = 0x5,
LUMP_BRUSHSIDEEDGECOUNTS = 0x6,
LUMP_BRUSHEDGES = 0x7,
LUMP_BRUSHES = 0x8,
LUMP_TRIANGLES = 0x9,
LUMP_DRAWVERTS = 0xA,
LUMP_DRAWINDICES = 0xB,
LUMP_CULLGROUPS = 0xC,
LUMP_CULLGROUPINDICES = 0xD,
LUMP_OBSOLETE_1 = 0xE,
LUMP_OBSOLETE_2 = 0xF,
LUMP_OBSOLETE_3 = 0x10,
LUMP_OBSOLETE_4 = 0x11,
LUMP_OBSOLETE_5 = 0x12,
LUMP_PORTALVERTS = 0x13,
LUMP_OBSOLETE_6 = 0x14,
LUMP_UINDS = 0x15,
LUMP_BRUSHVERTSCOUNTS = 0x16,
LUMP_BRUSHVERTS = 0x17,
LUMP_AABBTREES = 0x18,
LUMP_CELLS = 0x19,
LUMP_PORTALS = 0x1A,
LUMP_NODES = 0x1B,
LUMP_LEAFS = 0x1C,
LUMP_LEAFBRUSHES = 0x1D,
LUMP_LEAFSURFACES = 0x1E,
LUMP_COLLISIONVERTS = 0x1F,
LUMP_COLLISIONTRIS = 0x20,
LUMP_COLLISIONEDGEWALKABLE = 0x21,
LUMP_COLLISIONBORDERS = 0x22,
LUMP_COLLISIONPARTITIONS = 0x23,
LUMP_COLLISIONAABBS = 0x24,
LUMP_MODELS = 0x25,
LUMP_VISIBILITY = 0x26,
LUMP_ENTITIES = 0x27,
LUMP_PATHCONNECTIONS = 0x28,
LUMP_REFLECTION_PROBES = 0x29,
LUMP_VERTEX_LAYER_DATA = 0x2A,
LUMP_PRIMARY_LIGHTS = 0x2B,
LUMP_LIGHTGRIDHEADER = 0x2C,
LUMP_LIGHTGRIDROWS = 0x2D,
LUMP_OBSOLETE_10 = 0x2E,
//Obsolete in BO1/////////////////
LUMP_UNLAYERED_TRIANGLES = 0x2F,
LUMP_UNLAYERED_DRAWVERTS = 0x30,
LUMP_UNLAYERED_DRAWINDICES = 0x31,
LUMP_UNLAYERED_CULLGROUPS = 0x32,
LUMP_UNLAYERED_AABBTREES = 0x33,
//////////////////////////////////
LUMP_WATERHEADER = 0x34,
LUMP_WATERCELLS = 0x35,
LUMP_WATERCELLDATA = 0x36,
LUMP_BURNABLEHEADER = 0x37,
LUMP_BURNABLECELLS = 0x38,
LUMP_BURNABLECELLDATA = 0x39,
LUMP_SIMPLELIGHTMAPBYTES = 0x3A,
LUMP_LODCHAINS = 0x3B,
LUMP_LODINFOS = 0x3C,
LUMP_LODSURFACES = 0x3D,
LUMP_LIGHTREGIONS = 0x3E,
LUMP_LIGHTREGION_HULLS = 0x3F,
LUMP_LIGHTREGION_AXES = 0x40,
LUMP_WIILIGHTGRID = 0x41,
LUMP_LIGHTGRID2D_LIGHTS = 0x42,
LUMP_LIGHTGRID2D_INDICES = 0x43,
LUMP_LIGHTGRID2D_POINTS = 0x44,
LUMP_LIGHTGRID2D_CELLS = 0x45,
LUMP_LIGHT_CORONAS = 0x46,
//BO Specific/////////////////////////
LUMP_SHADOWMAP_VOLUMES = 0x47,
LUMP_SHADOWMAP_VOLUME_PLANES = 0x48,
LUMP_EXPOSURE_VOLUMES = 0x49,
LUMP_EXPOSURE_VOLUME_PLANES = 0x4A,
LUMP_OCCLUDERS = 0x4B,
LUMP_OUTDOORBOUNDS = 0x4C,
LUMP_HERO_ONLY_LIGHTS = 0x4D,
//////////////////////////////////////
INFO_LUMP_TYPE_COUNT
};
enum BSPVERSION_TYPE
{
BSPVERSION_COD_WAW = 31,
BSPVERSION_COD_BO = 45
};
enum MENU_ITEM_TYPE {
ITEM_TYPE_TEXT = 0, // simple text
ITEM_TYPE_BUTTON = 1, // button, basically text with a border
ITEM_TYPE_RADIOBUTTON = 2, // toggle button, may be grouped
ITEM_TYPE_CHECKBOX = 3, // check box
ITEM_TYPE_EDITFIELD = 4, // editable text, associated with a dvar
ITEM_TYPE_COMBO = 5, // drop down list
ITEM_TYPE_LISTBOX = 6, // scrollable list
ITEM_TYPE_MODEL = 7, // model
ITEM_TYPE_OWNERDRAW = 8, // owner draw, name specs what it is
ITEM_TYPE_NUMERICFIELD = 9, // editable text, associated with a dvar
ITEM_TYPE_SLIDER = 10, // mouse speed, volume, etc.
ITEM_TYPE_YESNO = 11, // yes no dvar setting
ITEM_TYPE_MULTI = 12, // multiple list setting, enumerated
ITEM_TYPE_DVARENUM = 13, // multiple list setting, enumerated from a dvar
ITEM_TYPE_BIND = 14, // bind
ITEM_TYPE_MENUMODEL = 15, // special menu model
ITEM_TYPE_VALIDFILEFIELD = 16, // text must be valid for use in a dos filename
ITEM_TYPE_DECIMALFIELD = 17, // editable text, associated with a dvar, which allows decimal input
ITEM_TYPE_UPREDITFIELD = 18, // editable text, associated with a dvar
ITEM_TYPE_GAME_MESSAGE_WINDOW = 19, // game message window
ITEM_TYPE_SCALEFORM = 20, // Flash movie for Scaleform GFx
ITEM_TYPE_BIND2 = 21, // bind2
};
enum MENU_ITEM_H_ALIGN {
ITEM_ALIGN_LEFT = 0, // aligns left of text to left of containing rectangle
ITEM_ALIGN_CENTER = 1, // aligns center of text to center of containing rectangle
ITEM_ALIGN_RIGHT = 2, // aligns right of text to right of containing rectangle
ITEM_ALIGN_X_MASK = 3,
};
enum MENU_ITEM_V_ALIGN {
ITEM_ALIGN_LEGACY = 0, // aligns bottom of text to top of containing rectangle
ITEM_ALIGN_TOP = 4, // aligns top of text to top of containing rectangle
ITEM_ALIGN_MIDDLE = 8, // aligns middle of text to middle of containing rectangle
ITEM_ALIGN_BOTTOM = 12, // aligns bottom of text to bottom of containing rectangle
ITEM_ALIGN_Y_MASK = 12,
};
enum MENU_ITEM_ALIGN {
ITEM_ALIGN_LEGACY_LEFT = 0,
ITEM_ALIGN_LEGACY_CENTER = 1,
ITEM_ALIGN_LEGACY_RIGHT = 2,
ITEM_ALIGN_TOP_LEFT = 4,
ITEM_ALIGN_TOP_CENTER = 5,
ITEM_ALIGN_TOP_RIGHT = 6,
ITEM_ALIGN_MIDDLE_LEFT = 8,
ITEM_ALIGN_MIDDLE_CENTER = 9,
ITEM_ALIGN_MIDDLE_RIGHT = 10,
ITEM_ALIGN_BOTTOM_LEFT = 12,
ITEM_ALIGN_BOTTOM_CENTER = 13,
ITEM_ALIGN_BOTTOM_RIGHT = 14
};
enum MENU_ITEM_TEXTSTYLE {
ITEM_TEXTSTYLE_NORMAL = 0, // normal text
ITEM_TEXTSTYLE_BLINK = 1, // fast blinking
ITEM_TEXTSTYLE_SHADOWED = 3, // drop shadow ( need a color for this )
ITEM_TEXTSTYLE_SHADOWEDMORE = 6, // drop shadow ( need a color for this )
ITEM_TEXTSTYLE_MONOSPACE = 128
};
enum MENU_WINDOW_BORDER {
WINDOW_BORDER_NONE = 0, // no border
WINDOW_BORDER_FULL = 1, // full border based on border color ( single pixel )
WINDOW_BORDER_HORZ = 2, // horizontal borders only
WINDOW_BORDER_VERT = 3, // vertical borders only
WINDOW_BORDER_KCGRADIENT = 4, // horizontal border using the gradient bars
WINDOW_BORDER_RAISED = 5, // darken the bottom and right sides of the border
WINDOW_BORDER_SUNKEN = 6 // darken the top and left sides of the border
};
enum MENU_WINDOW_STYLE {
WINDOW_STYLE_EMPTY = 0, // no background
WINDOW_STYLE_FILLED = 1, // filled with background color
WINDOW_STYLE_GRADIENT = 2, // gradient bar based on background color
WINDOW_STYLE_SHADER = 3, // shader based on background color
WINDOW_STYLE_TEAMCOLOR = 4, // team color
WINDOW_STYLE_DVAR_SHADER = 5, // draws the shader specified by the dvar
WINDOW_STYLE_LOADBAR = 6, // shader based on background color
};
enum MENU_MODE {
MODE_BOTTOMUP_ALIGN_TOP = 0, // text appears on bottom of list and moves up to specified Y coordinate as old text fades out
MODE_BOTTOMUP_ALIGN_BOTTOM = 1, // text appears on bottom of list and moves away from specified Y coordinate as new text pushes it up
MODE_TOPDOWN_ALIGN_TOP = 2, // text appears on top of list and moves away from specified Y coordinate as new text pushes it down
MODE_TOPDOWN_ALIGN_BOTTOM = 3 // text appears on top of list and moves down to specified Y coordinate as old text fades out
};
enum MENU_BOOL {
MENU_TRUE = 1,
MENU_FALSE = 0
};
enum MENU_ORIENTATION {
HUD_VERTICAL = 0x00,
HUD_HORIZONTAL = 0x01
};
enum MENU_RANGETYPE {
RANGETYPE_ABSOLUTE = 0,
RANGETYPE_RELATIVE = 1
};
// list box element types
enum MENU_LIST_BOX {
LISTBOX_TEXT = 0x00,
LISTBOX_IMAGE = 0x01
};
// list feeders
enum MENU_FEEDERS {
FEEDER_HEADS = 0x00, // model heads
FEEDER_MAPS = 0x01, // text maps based on game type
FEEDER_SERVERS = 0x02, // servers
FEEDER_CLAN_MEMBERS = 0x03, // clan names
FEEDER_ALLMAPS = 0x04, // all maps available, in graphic format
FEEDER_REDTEAM_LIST = 0x05, // red team members
FEEDER_BLUETEAM_LIST = 0x06, // blue team members
FEEDER_PLAYER_LIST = 0x07, // players
FEEDER_TEAM_LIST = 0x08, // team members for team voting
FEEDER_MODS = 0x09, // team members for team voting
FEEDER_DEMOS = 0x0a, // team members for team voting
FEEDER_SCOREBOARD = 0x0b, // team members for team voting
FEEDER_Q3HEADS = 0x0c, // model heads
FEEDER_SERVERSTATUS = 0x0d, // server status
FEEDER_FINDPLAYER = 0x0e, // find player
FEEDER_CINEMATICS = 0x0f, // cinematics
FEEDER_SAVEGAMES = 0x10, // savegames
FEEDER_PICKSPAWN = 0x11, // pickspawn
FEEDER_LOBBY_MEMBERS = 0x12, // list of players in your party
FEEDER_LOBBY_MEMBERS_TALK = 0x13, // icon for whether they are speaking or not
FEEDER_MUTELIST = 0x14, // list of musted players
FEEDER_PLAYERSTALKING = 0x15, // list of players who are currently talking
FEEDER_SPLITSCREENPLAYERS = 0x16, // list of all players who are playing splitscreen
FEEDER_LOBBY_MEMBERS_READY = 0x17, // icon for whether they are ready or not
FEEDER_PLAYER_PROFILES = 0x18, // player profiles
FEEDER_PARTY_MEMBERS = 0x19, // list of players in your party
FEEDER_PARTY_MEMBERS_TALK = 0x1a, // icon for whether they are speaking or not
FEEDER_PARTY_MEMBERS_READY = 0x1b, // icon for whether they are ready or not
FEEDER_PLAYLISTS = 0x1c, // list of all playlists
FEEDER_GAMEMODES = 0x1d, // list of all game type modes, including any player custom modes
FEEDER_CATEGORIES = 0x1e, // list of all categories
FEEDER_LEADERBOARD = 0x1f, // list of rows for a leaderboard
FEEDER_MYTEAM_MEMBERS = 0x20, // list of marine team members
FEEDER_MYTEAM_MEMBERS_TALK = 0x21, // icon for whether they are speaking
FEEDER_ENEMY_MEMBERS = 0x22, // list of opfor team members
FEEDER_ENEMY_MEMBERS_TALK = 0x23, // icon for whether they are speaking
FEEDER_LOBBY_MEMBERS_STAT = 0x24, // last round stats for lobby members
FEEDER_MYTEAM_MEMBERS_STAT = 0x25, // last round stats for marine team members
FEEDER_ENEMY_MEMBERS_STAT = 0x26, // last round stats for opfor team members
FEEDER_ONLINEFRIENDS = 0x27, // list of your online friends
FEEDER_LOBBY_MEMBERS_RANK = 0x28, // rank icon
FEEDER_PARTY_MEMBERS_RANK = 0x29, // rank icon
FEEDER_ENEMY_MEMBERS_RANK = 0x2a, // rank icon
FEEDER_MYTEAM_MEMBERS_RANK = 0x2b, // rank icon
FEEDER_TESTMAPS = 0x2c, // department test maps
FEEDER_SYSTEMLINK_LOBBY_MEMBERS = 0x2d, // list of players in a system link lobby
FEEDER_LOBBY_MEMBERS_CONTROLLER = 0x2e, // icon for controller quadrant for splitscreen
FEEDER_PARTY_MEMBERS_CONTROLLER = 0x2f, // icon for controller quadrant for splitscreen
FEEDER_MYTEAM_MEMBERS_SQUAD = 0x30, // squad icon
FEEDER_ENEMY_MEMBERS_SQUAD = 0x31, // squad icon
FEEDER_INGAME_SQUAD_MEMBERS = 0x32, // Squad members displayed in MP 'Pause' menu
FEEDER_INGAME_SQUAD_MEMBERS_FULL = 0x33, // Squad members' name, rank, talk, leader displayed in PC MP 'Pause' menu
FEEDER_INGAME_SQUAD_NAMES = 0x34, // Squad names displayed in MP 'Join Squad' menu
FEEDER_INGAME_SQUAD_NAMES2 = 0x35, // Squad names displayed in MP 'Pause' menu
FEEDER_INGAME_SQUAD_NAMES_FULL = 0x36, // Squad names, lock, invite displayed in PC MP 'Pause' menu
FEEDER_CUSTOM_GAMETYPES = 0x37, // list of all the gametypes for custom matches
FEEDER_INGAME_SQUAD_MEMBER_RANK = 0x38, // Squad members' rank displayed in MP 'Pause' menu
FEEDER_INGAME_SQUAD_MEMBER_TALK = 0x39, // Squad members' talk icon displayed in MP 'Pause' menu
FEEDER_INGAME_SQUAD_LOCKED = 0x3a, // Squad lock icon displayed in MP 'Pause' menu
FEEDER_INGAME_SQUAD_MEMBER_INVITED = 0x3b, // Squad invite icon displayed in MP 'Pause' menu
FEEDER_INGAME_SQUAD_INVITE = 0x3c, // Squad invite icon displayed in MP 'Join Squad' menu
FEEDER_INGAME_SQUAD_LEADER = 0x3d, // Squad leader icon displayled in MP 'Pause' menu
FEEDER_FRIENDS = 0x3e, // list of your friends
FEEDER_PENDINGFRIENDS = 0x3f, // list of your pending friends
FEEDER_INVITES = 0x40, // list of the game invites from your friends
};
// display flags
enum MENU_DISPLAY_FLAG {
CG_SHOW_BLUE_TEAM_HAS_REDFLAG = 0x00000001,
CG_SHOW_RED_TEAM_HAS_BLUEFLAG = 0x00000002,
CG_SHOW_ANYTEAMGAME = 0x00000004,
CG_SHOW_CTF = 0x00000020,
CG_SHOW_OBELISK = 0x00000040,
CG_SHOW_HEALTHCRITICAL = 0x00000080,
CG_SHOW_SINGLEPLAYER = 0x00000100,
CG_SHOW_TOURNAMENT = 0x00000200,
CG_SHOW_DURINGINCOMINGVOICE = 0x00000400,
CG_SHOW_IF_PLAYER_HAS_FLAG = 0x00000800,
CG_SHOW_LANPLAYONLY = 0x00001000,
CG_SHOW_MINED = 0x00002000,
CG_SHOW_HEALTHOK = 0x00004000,
CG_SHOW_TEAMINFO = 0x00008000,
CG_SHOW_NOTEAMINFO = 0x00010000,
CG_SHOW_OTHERTEAMHASFLAG = 0x00020000,
CG_SHOW_YOURTEAMHASENEMYFLAG = 0x00040000,
CG_SHOW_ANYNONTEAMGAME = 0x00080000,
CG_SHOW_TEXTASINT = 0x00200000,
CG_SHOW_HIGHLIGHTED = 0x00100000,
CG_SHOW_NOT_V_CLEAR = 0x02000000,
CG_SHOW_2DONLY = 0x10000000
};
enum MENU_UI_FLAG{
UI_SHOW_LEADER = 0x00000001,
UI_SHOW_NOTLEADER = 0x00000002,
UI_SHOW_FAVORITESERVERS = 0x00000004,
UI_SHOW_ANYNONTEAMGAME = 0x00000008,
UI_SHOW_ANYTEAMGAME = 0x00000010,
UI_SHOW_NEWHIGHSCORE = 0x00000020,
UI_SHOW_DEMOAVAILABLE = 0x00000040,
UI_SHOW_NEWBESTTIME = 0x00000080,
UI_SHOW_FFA = 0x00000100,
UI_SHOW_NOTFFA = 0x00000200,
UI_SHOW_NETANYNONTEAMGAME = 0x00000400,
UI_SHOW_NETANYTEAMGAME = 0x00000800,
UI_SHOW_NOTFAVORITESERVERS = 0x00001000
};
// font types
enum MENU_FONT_TYPE{
UI_FONT_DEFAULT = 0, // auto-chose betwen big/reg/small
UI_FONT_NORMAL = 1,
UI_FONT_BIG = 2,
UI_FONT_SMALL = 3,
UI_FONT_BOLD = 4,
UI_FONT_CONSOLE = 5,
UI_FONT_OBJECTIVE = 6,
UI_FONT_MAX = 6,
};
// owner draw types
// ideally these should be done outside of this file but
// this makes it much easier for the macro expansion to
// convert them for the designers ( from the .menu files )
enum MENU_OWNER_DRAW_TYPE {
CG_OWNERDRAW_BASE = 1,
CG_PLAYER_AMMO_VALUE = 5,
CG_PLAYER_AMMO_BACKDROP = 6,
CG_PLAYER_HEAT_VALUE = 7,
CG_PLAYER_STANCE = 20,
CG_SPECTATORS = 60,
CG_HOLD_BREATH_HINT = 71,
CG_CURSORHINT = 72,
CG_PLAYER_POWERUP = 73,
CG_PLAYER_HOLDABLE = 74,
CG_PLAYER_INVENTORY = 75,
CG_CURSORHINT_STATUS = 78, // like 'health' bar when pointing at a func_explosive
CG_PLAYER_BAR_HEALTH = 79,
CG_MANTLE_HINT = 80,
CG_PLAYER_WEAPON_NAME = 81,
CG_PLAYER_WEAPON_NAME_BACK = 82,
CG_CENTER_MESSAGE = 90, // for things like "You were killed by ..."
CG_TANK_BODY_DIR = 95,
CG_TANK_BARREL_DIR = 96,
CG_DEADQUOTE = 97,
CG_PLAYER_BAR_HEALTH_BACK = 98,
CG_MISSION_OBJECTIVE_HEADER = 99,
CG_MISSION_OBJECTIVE_LIST = 100,
CG_MISSION_OBJECTIVE_BACKDROP = 101,
CG_PAUSED_MENU_LINE = 102,
CG_OFFHAND_WEAPON_ICON_FRAG = 103,
CG_OFFHAND_WEAPON_ICON_SMOKEFLASH = 104,
CG_OFFHAND_WEAPON_AMMO_FRAG = 105,
CG_OFFHAND_WEAPON_AMMO_SMOKEFLASH = 106,
CG_OFFHAND_WEAPON_NAME_FRAG = 107,
CG_OFFHAND_WEAPON_NAME_SMOKEFLASH = 108,
CG_OFFHAND_WEAPON_SELECT_FRAG = 109,
CG_OFFHAND_WEAPON_SELECT_SMOKEFLASH = 110,
CG_SAVING = 111,
CG_PLAYER_LOW_HEALTH_OVERLAY = 112,
CG_INVALID_CMD_HINT = 113,
CG_PLAYER_SPRINT_METER = 114,
CG_PLAYER_SPRINT_BACK = 115,
CG_PLAYER_WEAPON_BACKGROUND = 116,
CG_PLAYER_WEAPON_AMMO_CLIP_GRAPHIC = 117,
CG_PLAYER_WEAPON_PRIMARY_ICON = 118,
CG_PLAYER_WEAPON_AMMO_STOCK = 119,
CG_PLAYER_WEAPON_LOW_AMMO_WARNING = 120,
CG_BATTLE_COMPASS_MARKERS = 122,
CG_BATTLE_FULLMAP_MARKERS = 123,
CG_SUCCESSFUL_CMD_HINT = 130,
CG_WAR_TEXT = 135,
CG_PLAYER_COMPASS_TICKERTAPE = 145,
CG_PLAYER_COMPASS_TICKERTAPE_NO_OBJ = 146,
CG_PLAYER_COMPASS_DOGS = 147,
CG_PLAYER_COMPASS_ARTILLERY_ICON = 148,
CG_PLAYER_COMPASS_SQUAD_OBJECTIVE = 149,
CG_PLAYER_COMPASS_PLAYER = 150,
CG_PLAYER_COMPASS_BACK = 151,
CG_PLAYER_COMPASS_POINTERS = 152,
CG_PLAYER_COMPASS_ACTORS = 153,
CG_PLAYER_COMPASS_TANKS = 154,
CG_PLAYER_COMPASS_HELICOPTERS = 155,
CG_PLAYER_COMPASS_PLANES = 156,
CG_PLAYER_COMPASS_AUTOMOBILES = 157,
CG_PLAYER_COMPASS_FRIENDS = 158,
CG_PLAYER_COMPASS_MAP = 159,
CG_PLAYER_COMPASS_NORTHCOORD = 160,
CG_PLAYER_COMPASS_EASTCOORD = 161,
CG_PLAYER_COMPASS_NCOORD_SCROLL = 162,
CG_PLAYER_COMPASS_ECOORD_SCROLL = 163,
CG_PLAYER_COMPASS_GOALDISTANCE = 164,
CG_PLAYER_ACTIONSLOT_DPAD = 165,
CG_PLAYER_ACTIONSLOT_1 = 166,
CG_PLAYER_ACTIONSLOT_2 = 167,
CG_PLAYER_ACTIONSLOT_3 = 168,
CG_PLAYER_ACTIONSLOT_4 = 169,
CG_PLAYER_COMPASS_ENEMIES = 170,
CG_PLAYER_FULLMAP_DOGS = 176,
CG_PLAYER_FULLMAP_VEHICLES = 177,
CG_PLAYER_FULLMAP_ARTILLERY_ICON = 178,
CG_PLAYER_FULLMAP_SQUAD_OBJECTIVE = 179,
CG_PLAYER_FULLMAP_BACK = 180,
CG_PLAYER_FULLMAP_MAP = 181,
CG_PLAYER_FULLMAP_POINTERS = 182,
CG_PLAYER_FULLMAP_PLAYER = 183,
CG_PLAYER_FULLMAP_ACTORS = 184,
CG_PLAYER_FULLMAP_FRIENDS = 185,
CG_PLAYER_FULLMAP_LOCATION_SELECTOR = 186,
CG_PLAYER_FULLMAP_BORDER = 187,
CG_PLAYER_FULLMAP_ENEMIES = 188,
CG_PLAYER_COMPASS = 189,
CG_VEHICLE_RETICLE = 190,
CG_HUD_TARGETS_VEHICLE = 191,
CG_HUD_TARGETS_JAVELIN = 192,
CG_TALKER1 = 193,
CG_TALKER2 = 194,
CG_TALKER3 = 195,
CG_TALKER4 = 196,
CG_FRIENDLYARROWS = 197,
CG_FRIENDLYNAMES = 198,
UI_OWNERDRAW_BASE = 200,
UI_HANDICAP = 200,
UI_EFFECTS = 201,
UI_PLAYERMODEL = 202,
UI_GAMETYPE = 205,
UI_SKILL = 207,
UI_NETSOURCE = 220,
UI_NETFILTER = 222,
UI_VOTE_KICK = 238,
UI_NETGAMETYPE = 245,
UI_SERVERREFRESHDATE = 247,
UI_SERVERMOTD = 248,
UI_GLINFO = 249,
UI_KEYBINDSTATUS = 250,
UI_JOINGAMETYPE = 253,
UI_MAPPREVIEW = 254,
UI_MENUMODEL = 257,
UI_SAVEGAME_SHOT = 258,
UI_SAVEGAMENAME = 262,
UI_SAVEGAMEINFO = 263,
UI_LOADPROFILING = 264,
UI_RECORDLEVEL = 265,
UI_AMITALKING = 266,
UI_TALKER1 = 267,
UI_TALKER2 = 268,
UI_TALKER3 = 269,
UI_TALKER4 = 270,
UI_PARTYSTATUS = 271,
UI_LOGGEDINUSER = 272,
UI_RESERVEDSLOTS = 273,
UI_PLAYLISTNAME = 274,
UI_PLAYLISTDESCRIPTION = 275,
UI_USERNAME = 276,
UI_CINEMATIC = 277,
UI_TOTALONLINE = 278,
UI_CATEGORYNAME = 279,
UI_CATEGORYDESCRIPTION = 280,
UI_PLAYLISTICON = 281,
UI_CATEGORYICON = 282,
UI_GAMETYPE_MAPNAME = 283,
CG_HUD_WAR_MOMENTUM_PROGRESS = 284,
CG_HUD_WAR_MOMENTUM_MULTIPLIER = 285,
CG_HUD_WAR_MOMENTUM_MULTIPLIER_DETAIL = 286,
CG_HUD_WAR_MOMENTUM_MULTIPLIER_BLITZKRIEG = 287,
CG_COMPETITIVE_MODE_SCORES = 288,
UI_LOAD_STATUS_SCREEN = 289,
UI_LEADERBOARD_GAMEMODE = 290,
CG_PLAYER_ACTIONSLOT_BACK_1 = 290,
CG_PLAYER_ACTIONSLOT_BACK_2 = 291,
CG_PLAYER_ACTIONSLOT_BACK_3 = 292,
CG_PLAYER_ACTIONSLOT_BACK_4 = 293,
CG_PLAYER_ACTIONSLOT_ARROW_1 = 294,
CG_PLAYER_ACTIONSLOT_ARROW_2 = 295,
CG_PLAYER_ACTIONSLOT_ARROW_3 = 296,
CG_PLAYER_ACTIONSLOT_ARROW_4 = 297,
UI_DIFFICULTY_INFO = 298,
UI_DIFFICULTY_ICON = 299,
UI_LOBBY_CHAT = 300
};
// Edge relative placement values for rect->h_align and rect->v_align
enum MENU_H_ALIGNMENT {
HORIZONTAL_ALIGN_SUBLEFT = 0, // left edge of a 4:3 screen (safe area not included)
HORIZONTAL_ALIGN_LEFT = 1, // left viewable (safe area) edge
HORIZONTAL_ALIGN_CENTER = 2, // center of the screen (reticle)
HORIZONTAL_ALIGN_RIGHT = 3, // right viewable (safe area) edge
HORIZONTAL_ALIGN_FULLSCREEN = 4, // disregards safe area
HORIZONTAL_ALIGN_NOSCALE = 5, // uses exact parameters - neither adjusts for safe area nor scales for screen size
HORIZONTAL_ALIGN_TO640 = 6, // scales a real-screen resolution x down into the 0 - 640 range
HORIZONTAL_ALIGN_CENTER_SAFEAREA = 7, // center of the safearea
HORIZONTAL_ALIGN_MAX = HORIZONTAL_ALIGN_CENTER_SAFEAREA,
HORIZONTAL_ALIGN_DEFAULT = HORIZONTAL_ALIGN_SUBLEFT
};
enum MENU_V_ALIGNMENT {
VERTICAL_ALIGN_SUBTOP = 0, // top edge of the 4:3 screen (safe area not included)
VERTICAL_ALIGN_TOP = 1, // top viewable (safe area) edge
VERTICAL_ALIGN_CENTER = 2, // center of the screen (reticle)
VERTICAL_ALIGN_BOTTOM = 3, // bottom viewable (safe area) edge
VERTICAL_ALIGN_FULLSCREEN = 4, // disregards safe area
VERTICAL_ALIGN_NOSCALE = 5, // uses exact parameters - neither adjusts for safe area nor scales for screen size
VERTICAL_ALIGN_TO480 = 6, // scales a real-screen resolution y down into the 0 - 480 range
VERTICAL_ALIGN_CENTER_SAFEAREA = 7, // center of the save area
VERTICAL_ALIGN_MAX = VERTICAL_ALIGN_CENTER_SAFEAREA,
VERTICAL_ALIGN_DEFAULT = VERTICAL_ALIGN_SUBTOP
};
enum MENU_BUTTON {
BUTTON_A = 1,
BUTTON_B = 2,
BUTTON_X = 3,
BUTTON_Y = 4,
BUTTON_LSHLDR = 5,
BUTTON_RSHLDR = 6,
BUTTON_START = 14,
BUTTON_BACK = 15,
BUTTON_LSTICK = 16,
BUTTON_RSTICK = 17,
BUTTON_LTRIG = 18,
BUTTON_RTRIG = 19,
DPAD_UP = 20,
DPAD_DOWN = 21,
DPAD_LEFT = 22,
DPAD_RIGHT = 23,
APAD_UP = 28,
APAD_DOWN = 29,
APAD_LEFT = 30,
APAD_RIGHT = 31
};
enum ASSET_TYPE {
ASSET_UNKNOWN = 0,
ASSET_ANIMATION = 4, // x_anim PARTIALLY VERIFIED
ASSET_MODEL = 5, // xmodel PARTIALLY VERIFIED
ASSET_MATERIAL = 6, // material VERIFIED
ASSET_BIK_FILE = 7, // .bik file PARTIALLY VERIFIED
ASSET_SOUND = 9, // loaded_sound VERIFIED
ASSET_COLLISION_MAP = 12, // collision_map PARTIALLY VERIFIED
ASSET_SHADER = 13, // shader PARTIALLY VERIFIED
ASSET_D3DBSP_DUMP = 17, // d3dbsp dump VERIFIED
ASSET_FONT = 20, // font PARTIALLY VERIFIED
ASSET_MENU = 21, // menu_file VERIFIED
ASSET_LOCAL_STRING = 23, // localized string VERIFIED
ASSET_WEAPON = 24, // weapon VERIFIED
ASSET_EFFECT = 26, // fx VERIFIED
ASSET_RAW_FILE = 32, // raw_file VERIFIED
ASSET_STRING_TABLE = 33 // string_table PARTIALLY VERIFIED
};
// Change this depending on the platform
// PC
#define DEVMAP_LEVEL_FIRST "devmap intro_pac"
#define DEVMAP "devmap"
// Not PC
// #define DEVMAP_LEVEL_FIRST "map intro_pac"
// #define DEVMAP "map"
// Remove this to restore full frontend instead of limited EPD frontend
#define COOP_EPD 0
// LDS - This enables a German SKU with Nazi Zombies enabled *SHOULD BE SET TO 0 IF NOT APPROVED*
#define GERMAN_ZOMBIE_BUILD 0
#define DEVMAP_LEVEL_TRAINING "devmap training"
#define LEVEL_FIRST "intro_pac"
#define LEVEL_TRAINING "training"
#define FIRST_PLAYABLE_CAMPAIGN_LEVEL "mak"
#define FIRST_PLAYABLE_ZOMBIE_LEVEL "nazi_zombie_prototype"
// Size define for the hud compass
// These are used for both the dynamic & non-dynamic compass drawing
// If these are changed, the cgame should be recompiled
#define COMPASS_SIZE 160
#define MINIMAP_X 11.5
#define MINIMAP_Y 5
#define MINIMAP_W 89.5
#define MINIMAP_H 89.5
#define COMPASS_SIZE_MP 125
#define MINIMAP_X_MP 0
#define MINIMAP_Y_MP 12
#define MINIMAP_W_MP 102
#define MINIMAP_H_MP 102
#define FULLSCREEN 0 0 640 480
#define FULLSCREEN_WIDE -107 0 854 480
// PC
#define ORIGIN_TITLE 30 34
// Not PC
// #define ORIGIN_TITLE 0 0
#define ORIGIN_TITLE_SS 104 120
#define FONTSCALE_SMALL 0.3095 //0.3750 // <-- COD4 // COD5 --> 0.30952//0.35897//0.24138 //14 pt //0.2900 //0.2750 // 18
#define FONTSCALE_LOBBY 0.26 // <--Slate // 0.3010 <-- Slate Compressed // 0.3750 // <-- COD4 CONDUIT ITC small
#define FONTSCALE_NORMAL 0.3810 //0.35897//0.4583
#define FONTSCALE_BOLD 0.5476 //0.4583
#define FONTSCALE_BIG 0.5476 //0.5833
#define FONTSCALE_EXTRABIG 1 //1.0000
// new settings
#define TEXTSIZE_SMALL FONTSCALE_SMALL
#define TEXTSIZE_SMALL_SS (FONTSCALE_SMALL*2)
#define TEXTSIZE_DEFAULT FONTSCALE_NORMAL
#define TEXTSIZE_DEFAULT_SS (FONTSCALE_NORMAL*2)
#define TEXTSIZE_TITLE FONTSCALE_BIG
#define TEXTSIZE_TITLE_SS 1
#define TEXTSIZE_BOLD TEXTSIZE_DEFAULT
#define TEXTSIZE_BIG TEXTSIZE_TITLE
//#define COLOR_TITLE 1 0.8 0.4 1
#define COLOR_TITLE 1 1 1 1
#define COLOR_HEADER 0.69 0.69 0.69 1
#define COLOR_FOCUSED 0.95294 0.72156 0.21176 1 //1 0.788 0.129 1
//#define COLOR_FOCUS_YELLOW 0.95294 0.72156 0.21176 1
#define COLOR_UNFOCUSED 0.4823 0.4823 0.4823 1
//#define COLOR_DISABLED 0.35 0.35 0.35 1
#define COLOR_SAFEAREA 0 0 1 1
#define COLOR_INFO_YELLOW COLOR_FOCUSED//1 0.84706 0 1
#define COLOR_TEXT 0.84313 0.84313 0.84313 1
#define COLOR_DISABLED 0.34118 0.36863 0.37647 1
#define COLOR_TITLEBAR 0.14510 0.16078 0.16862 0.3//1
#define COLOR_RED_TEXT 0.69020 0.00784 0.00784 1
#define COLOR_FADEOUT 0.09412 0.09412 0.04912 0.65
#define COLOR_BODY_TEXT 0.62745 0.66667 0.67451 1
#define COLOR_USMC 0 0.0196 0.41
#define COLOR_JPN 0.53 0.027 0.027
#define COLOR_USSR 0.368 0.035 0.035
#define COLOR_GER 0.937 0.9 0.607
#define DEFAULT_MP_CFG "default_mp.cfg"
#define SPLITSCREEN_MP_CFG "default_splitscreen.cfg"
#define SYSTEMLINK_MP_CFG "default_systemlink.cfg"
#define XBOXLIVE_MP_CFG "default_xboxlive.cfg"
#define MAX_RANK int(tableLookup( "mp/rankTable.csv", 0, "maxrank", 1))
#define MAX_PRESTIGE int(tableLookup( "mp/rankIconTable.csv", 0, "maxprestige", 1))
#define PRESTIGE_AVAIL (stat(2326) < MAX_PRESTIGE && stat(2301) == int(tableLookup("mp/rankTable.csv",0,MAX_RANK,7)))
#define PRESTIGE_NEXT (stat(2326) < MAX_PRESTIGE && stat(252) == MAX_RANK)
#define PRESTIGE_FINISH (stat(2326) == MAX_PRESTIGE)
#define CAN_RANK_UP (stat(252) < MAX_RANK || stat(2326) < MAX_PRESTIGE)
// Bink constants
const quint32 BINK_SURFACE32RGBA = 6;
#endif // ENUMS_H

View File

@ -1,20 +1,17 @@
#include "compression.h" #include "compression.h"
//#include "lzokay.h" #include "minilzo.h"
#define XBOXAPI __declspec(dllimport)
#include "xcompress.h" #include "xcompress.h"
#include <QLibrary> #include <QLibrary>
#include <QDebug> #include <QDebug>
#include <QFile> #include <QFile>
#include <QDataStream>
QByteArray Compression::CompressXMem(const QByteArray &data) QByteArray Compression::CompressXMem(const QByteArray &data)
{ {
XMEMCODEC_PARAMETERS_LZX lzxParams = {}; XMEMCODEC_PARAMETERS_LZX lzxParams = {};
lzxParams.Flags = 0; lzxParams.Flags = 0;
lzxParams.WindowSize = XCOMPRESS_LZX_BLOCK_SIZE; lzxParams.WindowSize = 0x20000;
lzxParams.CompressionPartitionSize = XCOMPRESS_LZX_BLOCK_SIZE; lzxParams.CompressionPartitionSize = 0x80000;
XMEMCOMPRESSION_CONTEXT ctx = nullptr; XMEMCOMPRESSION_CONTEXT ctx = nullptr;
if (FAILED(XMemCreateCompressionContext(XMEMCODEC_LZX, &lzxParams, 0, &ctx)) || !ctx) if (FAILED(XMemCreateCompressionContext(XMEMCODEC_LZX, &lzxParams, 0, &ctx)) || !ctx)
@ -34,27 +31,60 @@ QByteArray Compression::CompressXMem(const QByteArray &data)
return output; return output;
} }
QByteArray Compression::DecompressXMem(const QByteArray &data) QByteArray Compression::DecompressXMem(const QByteArray &data,
int flags, int windowSize, int partSize)
{ {
if (data.isEmpty())
return {};
XMEMCODEC_PARAMETERS_LZX lzxParams = {}; XMEMCODEC_PARAMETERS_LZX lzxParams = {};
lzxParams.Flags = 0; lzxParams.Flags = flags;
lzxParams.WindowSize = XCOMPRESS_LZX_BLOCK_SIZE; lzxParams.WindowSize = windowSize;
lzxParams.CompressionPartitionSize = XCOMPRESS_LZX_BLOCK_SIZE; lzxParams.CompressionPartitionSize = partSize;
XMEMDECOMPRESSION_CONTEXT ctx = nullptr; QByteArray internalState(0x94933, Qt::Uninitialized);
if (FAILED(XMemCreateDecompressionContext(XMEMCODEC_LZX, &lzxParams, 0, &ctx)) || !ctx)
return QByteArray();
QByteArray output(data.size(), 0); XMEMDECOMPRESSION_CONTEXT ctx = XMemInitializeDecompressionContext(
SIZE_T actualSize = data.size(); XMEMCODEC_LZX, &lzxParams, 1,
internalState.data(), internalState.size());
HRESULT hr = XMemDecompress(ctx, output.data(), &actualSize, data.constData(), data.size()); if (!ctx || XMemResetDecompressionContext(ctx)) {
qWarning() << "Failed to init LZX context";
return {};
}
QByteArray output;
output.reserve(16 * 1024 * 1024); // rough guess
const quint8 *nextIn = reinterpret_cast<const quint8*>(data.constData());
SIZE_T availIn = data.size();
QByteArray scratch(0x10000, Qt::Uninitialized); // 64 KB chunks
while (availIn > 0) {
SIZE_T inSize = availIn; // let XMem tell us how much it will consume
SIZE_T outSize = scratch.size(); // max 64 KB per call
HRESULT hr = XMemDecompressStream(ctx,
scratch.data(), &outSize,
nextIn, &inSize);
if (FAILED(hr)) {
qWarning() << "XMemDecompressStream failed, hr=" << hr;
XMemDestroyDecompressionContext(ctx); XMemDestroyDecompressionContext(ctx);
return {};
}
if (FAILED(hr)) if (inSize == 0 && outSize == 0)
return QByteArray(); break; // no progress
output.resize(static_cast<int>(actualSize)); output.append(scratch.constData(), static_cast<int>(outSize));
nextIn += inSize;
availIn -= inSize;
}
XMemDestroyDecompressionContext(ctx);
return output; return output;
} }
@ -68,6 +98,45 @@ quint32 Compression::CalculateAdler32Checksum(const QByteArray &data) {
return adler; return adler;
} }
qint64 Compression::FindZlibOffset(const QByteArray &bytes)
{
QDataStream stream(bytes);
while (!stream.atEnd())
{
QByteArray testSegment = stream.device()->peek(2).toHex().toUpper();
if (testSegment == "7801" ||
testSegment == "785E" ||
testSegment == "789C" ||
testSegment == "78DA") {
return stream.device()->pos();
}
stream.skipRawData(1);
}
return -1;
}
QByteArray Compression::StripHashBlocks(const QByteArray &raw,
int dataChunkSize,
int hashChunkSize)
{
QByteArray cleaned;
cleaned.reserve(raw.size()); // upper bound
int p = 0;
while (p < raw.size())
{
const int chunk = qMin(dataChunkSize, raw.size() - p);
cleaned.append(raw.constData() + p, chunk);
p += chunk;
// skip hash bytes if they are still inside the buffer
if (p < raw.size())
p += qMin(hashChunkSize, raw.size() - p);
}
return cleaned;
}
QByteArray Compression::DecompressZLIB(const QByteArray &aCompressedData) { QByteArray Compression::DecompressZLIB(const QByteArray &aCompressedData) {
if (aCompressedData.isEmpty()) { if (aCompressedData.isEmpty()) {
return {}; return {};
@ -95,22 +164,23 @@ QByteArray Compression::DecompressZLIB(const QByteArray &aCompressedData) {
ret = inflate(&strm, Z_NO_FLUSH); ret = inflate(&strm, Z_NO_FLUSH);
if (strm.avail_out < buffer.size()) { // Data has been written to the buffer if (strm.avail_out < buffer.size()) {
decompressed.append(buffer.constData(), buffer.size() - strm.avail_out); decompressed.append(buffer.constData(), buffer.size() - strm.avail_out);
} }
if (ret == Z_STREAM_END) { if (ret == Z_STREAM_END) {
break; // Proper end of the data stream break;
} }
if (ret == Z_BUF_ERROR && strm.avail_out == 0) { if (ret == Z_BUF_ERROR && strm.avail_out == 0) {
// Buffer was completely used, resize it buffer.resize(buffer.size() * 2);
int newSize = buffer.size() * 2; // Double the buffer size
buffer.resize(newSize);
} else if (ret != Z_OK) { } else if (ret != Z_OK) {
qWarning() << "Zlib error:" << zError(ret); size_t errorOffset = strm.total_in;
qWarning() << "Zlib error:" << zError(ret)
<< "at offset" << errorOffset
<< "of" << aCompressedData.size() << "bytes";
inflateEnd(&strm); inflateEnd(&strm);
return {}; // Return on other errors return decompressed;
} }
} while (ret != Z_STREAM_END); } while (ret != Z_STREAM_END);
@ -118,6 +188,7 @@ QByteArray Compression::DecompressZLIB(const QByteArray &aCompressedData) {
return decompressed; return decompressed;
} }
QByteArray Compression::CompressZLIB(const QByteArray &aData) { QByteArray Compression::CompressZLIB(const QByteArray &aData) {
return CompressZLIBWithSettings(aData); return CompressZLIBWithSettings(aData);
} }
@ -242,6 +313,28 @@ QByteArray Compression::CompressDeflateWithSettings(const QByteArray &aData, int
return compressed; return compressed;
} }
QByteArray Compression::DecompressLZO(const QByteArray &aCompressedData, quint32 aDestSize) {
QByteArray dst;
static bool ok = (lzo_init() == LZO_E_OK);
if (!ok)
throw std::runtime_error("lzo_init failed");
dst = QByteArray(aDestSize, Qt::Uninitialized);
lzo_uint out = aDestSize;
int rc = lzo1x_decompress_safe(
reinterpret_cast<const lzo_bytep>(aCompressedData.constData()),
static_cast<lzo_uint>(aCompressedData.size()),
reinterpret_cast<lzo_bytep>(dst.data()),
&out,
nullptr);
if (rc != LZO_E_OK || out != aDestSize)
throw std::runtime_error("LZO decompression error");
return dst;
}
QByteArray Compression::DecompressOodle(const QByteArray &aCompressedData, quint32 aDecompressedSize) { QByteArray Compression::DecompressOodle(const QByteArray &aCompressedData, quint32 aDecompressedSize) {
return pDecompressOodle(aCompressedData, aCompressedData.length(), aDecompressedSize); return pDecompressOodle(aCompressedData, aCompressedData.length(), aDecompressedSize);
} }

View File

@ -3,7 +3,7 @@
#include "QtZlib/zlib.h" #include "QtZlib/zlib.h"
#include <windows.h> //#include <windows.h>
#include <QtGlobal> #include <QtGlobal>
#include <stddef.h> #include <stddef.h>
#include <QByteArray> #include <QByteArray>
@ -47,6 +47,10 @@ class Compression {
public: public:
static quint32 CalculateAdler32Checksum(const QByteArray &data); static quint32 CalculateAdler32Checksum(const QByteArray &data);
static QByteArray DecompressZLIB(const QByteArray &aCompressedData); static QByteArray DecompressZLIB(const QByteArray &aCompressedData);
static qint64 FindZlibOffset(const QByteArray &bytes);
static QByteArray StripHashBlocks(const QByteArray &raw,
int dataChunkSize = 0x200000,
int hashChunkSize = 0x2000);
static QByteArray CompressZLIB(const QByteArray &aData); static QByteArray CompressZLIB(const QByteArray &aData);
static QByteArray CompressZLIBWithSettings(const QByteArray &aData, static QByteArray CompressZLIBWithSettings(const QByteArray &aData,
int aCompressionLevel = Z_BEST_COMPRESSION, int aCompressionLevel = Z_BEST_COMPRESSION,
@ -64,13 +68,14 @@ public:
int aStrategy = Z_DEFAULT_STRATEGY, int aStrategy = Z_DEFAULT_STRATEGY,
const QByteArray &aDictionary = {}); const QByteArray &aDictionary = {});
static QByteArray DecompressLZO(const QByteArray &aCompressedData, quint32 aDestSize);
static QByteArray DecompressOodle(const QByteArray &aCompressedData, quint32 aDecompressedSize); static QByteArray DecompressOodle(const QByteArray &aCompressedData, quint32 aDecompressedSize);
static QByteArray CompressOodle(const QByteArray &aData); static QByteArray CompressOodle(const QByteArray &aData);
static QByteArray CompressXMem(const QByteArray &data); static QByteArray CompressXMem(const QByteArray &data);
static QByteArray DecompressXMem(const QByteArray &data); static QByteArray DecompressXMem(const QByteArray &data, int flags = 0, int windowSize = 0x20000, int partSize = 0x80000);
private: private:
static quint32 pGetOodleCompressedBounds(quint32 aBufferSize); static quint32 pGetOodleCompressedBounds(quint32 aBufferSize);
static QByteArray pCompressOodle(QByteArray aBuffer, quint32 aBufferSize, quint32 aOutputBufferSize, static QByteArray pCompressOodle(QByteArray aBuffer, quint32 aBufferSize, quint32 aOutputBufferSize,

View File

@ -1,14 +1,11 @@
QT += core QT += core
TEMPLATE = lib TEMPLATE = lib
CONFIG += staticlib c++17 CONFIG += staticlib c++17
DEFINES += MINILZO_USE_STATIC
SOURCES += \ SOURCES += $$files($$PWD/*.cpp, true) \
compression.cpp \ $$files($$PWD/*.c, true)
lzokay.cpp \ HEADERS += $$files($$PWD/*.h, true)
HEADERS += \
compression.h \
lzokay.h
LIBS += \ LIBS += \
-L$$PWD/../../third_party/xbox_sdk/lib -lxcompress64 \ -L$$PWD/../../third_party/xbox_sdk/lib -lxcompress64 \

453
libs/compression/lzoconf.h Normal file
View File

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

3268
libs/compression/lzodefs.h Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,647 +0,0 @@
#include "lzokay.h"
#include <cstring>
#include <algorithm>
#include <iterator>
/*
* Based on documentation from the Linux sources: Documentation/lzo.txt
* https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/lzo.txt
*/
namespace lzokay {
#if _WIN32
#define HOST_BIG_ENDIAN 0
#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
#define HOST_BIG_ENDIAN 1
#else
#define HOST_BIG_ENDIAN 0
#endif
#if HOST_BIG_ENDIAN
static uint16_t get_le16(const uint8_t* p) {
uint16_t val = *reinterpret_cast<const uint16_t*>(p);
#if __GNUC__
return __builtin_bswap16(val);
#elif _WIN32
return _byteswap_ushort(val);
#else
return (val = (val << 8) | ((val >> 8) & 0xFF));
#endif
}
#else
static uint16_t get_le16(const uint8_t* p) {
return *reinterpret_cast<const uint16_t*>(p);
}
#endif
constexpr std::size_t Max255Count = std::size_t(~0) / 255 - 2;
#define NEEDS_IN(count) \
if (inp + (count) > inp_end) { \
dst_size = outp - dst; \
return EResult::InputOverrun; \
}
#define NEEDS_OUT(count) \
if (outp + (count) > outp_end) { \
dst_size = outp - dst; \
return EResult::OutputOverrun; \
}
#define CONSUME_ZERO_BYTE_LENGTH \
std::size_t offset; \
{ \
const uint8_t *old_inp = inp; \
while (*inp == 0) ++inp; \
offset = inp - old_inp; \
if (offset > Max255Count) { \
dst_size = outp - dst; \
return EResult::Error; \
} \
}
#define WRITE_ZERO_BYTE_LENGTH(length) \
{ \
std::size_t l; \
for (l = length; l > 255; l -= 255) { *outp++ = 0; } \
*outp++ = static_cast<uint8_t>(l); \
}
constexpr uint32_t M1MaxOffset = 0x0400;
constexpr uint32_t M2MaxOffset = 0x0800;
constexpr uint32_t M3MaxOffset = 0x4000;
// constexpr uint32_t M4MaxOffset = 0xbfff;
// constexpr uint32_t M1MinLen = 2;
// constexpr uint32_t M1MaxLen = 2;
constexpr uint32_t M2MinLen = 3;
constexpr uint32_t M2MaxLen = 8;
// constexpr uint32_t M3MinLen = 3;
constexpr uint32_t M3MaxLen = 33;
// constexpr uint32_t M4MinLen = 3;
constexpr uint32_t M4MaxLen = 9;
constexpr uint32_t M1Marker = 0x0;
// constexpr uint32_t M2Marker = 0x40;
constexpr uint32_t M3Marker = 0x20;
constexpr uint32_t M4Marker = 0x10;
constexpr uint32_t MaxMatchByLengthLen = 34; /* Max M3 len + 1 */
EResult decompress(const uint8_t* src, std::size_t src_size,
uint8_t* dst, std::size_t init_dst_size,
std::size_t& dst_size) {
dst_size = init_dst_size;
if (src_size < 3) {
dst_size = 0;
return EResult::InputOverrun;
}
const uint8_t* inp = src;
const uint8_t* inp_end = src + src_size;
uint8_t* outp = dst;
uint8_t* outp_end = dst + dst_size;
uint8_t* lbcur;
std::size_t lblen;
std::size_t state = 0;
std::size_t nstate = 0;
/* First byte encoding */
if (*inp >= 22) {
/* 22..255 : copy literal string
* length = (byte - 17) = 4..238
* state = 4 [ don't copy extra literals ]
* skip byte
*/
std::size_t len = *inp++ - uint8_t(17);
NEEDS_IN(len)
NEEDS_OUT(len)
for (std::size_t i = 0; i < len; ++i)
*outp++ = *inp++;
state = 4;
} else if (*inp >= 18) {
/* 18..21 : copy 0..3 literals
* state = (byte - 17) = 0..3 [ copy <state> literals ]
* skip byte
*/
nstate = *inp++ - uint8_t(17);
state = nstate;
NEEDS_IN(nstate)
NEEDS_OUT(nstate)
for (std::size_t i = 0; i < nstate; ++i)
*outp++ = *inp++;
}
/* 0..17 : follow regular instruction encoding, see below. It is worth
* noting that codes 16 and 17 will represent a block copy from
* the dictionary which is empty, and that they will always be
* invalid at this place.
*/
while (true) {
NEEDS_IN(1)
uint8_t inst = *inp++;
if (inst & 0xC0) {
/* [M2]
* 1 L L D D D S S (128..255)
* Copy 5-8 bytes from block within 2kB distance
* state = S (copy S literals after this block)
* length = 5 + L
* Always followed by exactly one byte : H H H H H H H H
* distance = (H << 3) + D + 1
*
* 0 1 L D D D S S (64..127)
* Copy 3-4 bytes from block within 2kB distance
* state = S (copy S literals after this block)
* length = 3 + L
* Always followed by exactly one byte : H H H H H H H H
* distance = (H << 3) + D + 1
*/
NEEDS_IN(1)
lbcur = outp - ((*inp++ << 3) + ((inst >> 2) & 0x7) + 1);
lblen = std::size_t(inst >> 5) + 1;
nstate = inst & uint8_t(0x3);
} else if (inst & M3Marker) {
/* [M3]
* 0 0 1 L L L L L (32..63)
* Copy of small block within 16kB distance (preferably less than 34B)
* length = 2 + (L ?: 31 + (zero_bytes * 255) + non_zero_byte)
* Always followed by exactly one LE16 : D D D D D D D D : D D D D D D S S
* distance = D + 1
* state = S (copy S literals after this block)
*/
lblen = std::size_t(inst & uint8_t(0x1f)) + 2;
if (lblen == 2) {
CONSUME_ZERO_BYTE_LENGTH
NEEDS_IN(1)
lblen += offset * 255 + 31 + *inp++;
}
NEEDS_IN(2)
nstate = get_le16(inp);
inp += 2;
lbcur = outp - ((nstate >> 2) + 1);
nstate &= 0x3;
} else if (inst & M4Marker) {
/* [M4]
* 0 0 0 1 H L L L (16..31)
* Copy of a block within 16..48kB distance (preferably less than 10B)
* length = 2 + (L ?: 7 + (zero_bytes * 255) + non_zero_byte)
* Always followed by exactly one LE16 : D D D D D D D D : D D D D D D S S
* distance = 16384 + (H << 14) + D
* state = S (copy S literals after this block)
* End of stream is reached if distance == 16384
*/
lblen = std::size_t(inst & uint8_t(0x7)) + 2;
if (lblen == 2) {
CONSUME_ZERO_BYTE_LENGTH
NEEDS_IN(1)
lblen += offset * 255 + 7 + *inp++;
}
NEEDS_IN(2)
nstate = get_le16(inp);
inp += 2;
lbcur = outp - (((inst & 0x8) << 11) + (nstate >> 2));
nstate &= 0x3;
if (lbcur == outp)
break; /* Stream finished */
lbcur -= 16384;
} else {
/* [M1] Depends on the number of literals copied by the last instruction. */
if (state == 0) {
/* If last instruction did not copy any literal (state == 0), this
* encoding will be a copy of 4 or more literal, and must be interpreted
* like this :
*
* 0 0 0 0 L L L L (0..15) : copy long literal string
* length = 3 + (L ?: 15 + (zero_bytes * 255) + non_zero_byte)
* state = 4 (no extra literals are copied)
*/
std::size_t len = inst + 3;
if (len == 3) {
CONSUME_ZERO_BYTE_LENGTH
NEEDS_IN(1)
len += offset * 255 + 15 + *inp++;
}
/* copy_literal_run */
NEEDS_IN(len)
NEEDS_OUT(len)
for (std::size_t i = 0; i < len; ++i)
*outp++ = *inp++;
state = 4;
continue;
} else if (state != 4) {
/* If last instruction used to copy between 1 to 3 literals (encoded in
* the instruction's opcode or distance), the instruction is a copy of a
* 2-byte block from the dictionary within a 1kB distance. It is worth
* noting that this instruction provides little savings since it uses 2
* bytes to encode a copy of 2 other bytes but it encodes the number of
* following literals for free. It must be interpreted like this :
*
* 0 0 0 0 D D S S (0..15) : copy 2 bytes from <= 1kB distance
* length = 2
* state = S (copy S literals after this block)
* Always followed by exactly one byte : H H H H H H H H
* distance = (H << 2) + D + 1
*/
NEEDS_IN(1)
nstate = inst & uint8_t(0x3);
lbcur = outp - ((inst >> 2) + (*inp++ << 2) + 1);
lblen = 2;
} else {
/* If last instruction used to copy 4 or more literals (as detected by
* state == 4), the instruction becomes a copy of a 3-byte block from the
* dictionary from a 2..3kB distance, and must be interpreted like this :
*
* 0 0 0 0 D D S S (0..15) : copy 3 bytes from 2..3 kB distance
* length = 3
* state = S (copy S literals after this block)
* Always followed by exactly one byte : H H H H H H H H
* distance = (H << 2) + D + 2049
*/
NEEDS_IN(1)
nstate = inst & uint8_t(0x3);
lbcur = outp - ((inst >> 2) + (*inp++ << 2) + 2049);
lblen = 3;
}
}
if (lbcur < dst) {
dst_size = outp - dst;
return EResult::LookbehindOverrun;
}
NEEDS_IN(nstate)
NEEDS_OUT(lblen + nstate)
/* Copy lookbehind */
for (std::size_t i = 0; i < lblen; ++i)
*outp++ = *lbcur++;
state = nstate;
/* Copy literal */
for (std::size_t i = 0; i < nstate; ++i)
*outp++ = *inp++;
}
dst_size = outp - dst;
if (lblen != 3) /* Ensure terminating M4 was encountered */
return EResult::Error;
if (inp == inp_end)
return EResult::Success;
else if (inp < inp_end)
return EResult::InputNotConsumed;
else
return EResult::InputOverrun;
}
struct State {
const uint8_t* src;
const uint8_t* src_end;
const uint8_t* inp;
uint32_t wind_sz;
uint32_t wind_b;
uint32_t wind_e;
uint32_t cycle1_countdown;
const uint8_t* bufp;
uint32_t buf_sz;
/* Access next input byte and advance both ends of circular buffer */
void get_byte(uint8_t* buf) {
if (inp >= src_end) {
if (wind_sz > 0)
--wind_sz;
buf[wind_e] = 0;
if (wind_e < DictBase::MaxMatchLen)
buf[DictBase::BufSize + wind_e] = 0;
} else {
buf[wind_e] = *inp;
if (wind_e < DictBase::MaxMatchLen)
buf[DictBase::BufSize + wind_e] = *inp;
++inp;
}
if (++wind_e == DictBase::BufSize)
wind_e = 0;
if (++wind_b == DictBase::BufSize)
wind_b = 0;
}
uint32_t pos2off(uint32_t pos) const {
return wind_b > pos ? wind_b - pos : DictBase::BufSize - (pos - wind_b);
}
};
class DictImpl : public DictBase {
public:
struct Match3Impl : DictBase::Match3 {
static uint32_t make_key(const uint8_t* data) {
return ((0x9f5f * (((uint32_t(data[0]) << 5 ^ uint32_t(data[1])) << 5) ^ data[2])) >> 5) & 0x3fff;
}
uint16_t get_head(uint32_t key) const {
return (chain_sz[key] == 0) ? uint16_t(UINT16_MAX) : head[key];
}
void init() {
std::fill(std::begin(chain_sz), std::end(chain_sz), 0);
}
void remove(uint32_t pos, const uint8_t* b) {
--chain_sz[make_key(b + pos)];
}
void advance(State& s, uint32_t& match_pos, uint32_t& match_count, const uint8_t* b) {
uint32_t key = make_key(b + s.wind_b);
match_pos = chain[s.wind_b] = get_head(key);
match_count = chain_sz[key]++;
if (match_count > DictBase::MaxMatchLen)
match_count = DictBase::MaxMatchLen;
head[key] = uint16_t(s.wind_b);
}
void skip_advance(State& s, const uint8_t* b) {
uint32_t key = make_key(b + s.wind_b);
chain[s.wind_b] = get_head(key);
head[key] = uint16_t(s.wind_b);
best_len[s.wind_b] = uint16_t(DictBase::MaxMatchLen + 1);
chain_sz[key]++;
}
};
struct Match2Impl : DictBase::Match2 {
static uint32_t make_key(const uint8_t* data) {
return uint32_t(data[0]) ^ (uint32_t(data[1]) << 8);
}
void init() {
std::fill(std::begin(head), std::end(head), UINT16_MAX);
}
void add(uint16_t pos, const uint8_t* b) {
head[make_key(b + pos)] = pos;
}
void remove(uint32_t pos, const uint8_t* b) {
uint16_t& p = head[make_key(b + pos)];
if (p == pos)
p = UINT16_MAX;
}
bool search(State& s, uint32_t& lb_pos, uint32_t& lb_len,
uint32_t best_pos[MaxMatchByLengthLen], const uint8_t* b) const {
uint16_t pos = head[make_key(b + s.wind_b)];
if (pos == UINT16_MAX)
return false;
if (best_pos[2] == 0)
best_pos[2] = pos + 1;
if (lb_len < 2) {
lb_len = 2;
lb_pos = pos;
}
return true;
}
};
void init(State& s, const uint8_t* src, std::size_t src_size) {
auto& match3 = static_cast<Match3Impl&>(_storage->match3);
auto& match2 = static_cast<Match2Impl&>(_storage->match2);
s.cycle1_countdown = DictBase::MaxDist;
match3.init();
match2.init();
s.src = src;
s.src_end = src + src_size;
s.inp = src;
s.wind_sz = uint32_t(std::min(src_size, std::size_t(MaxMatchLen)));
s.wind_b = 0;
s.wind_e = s.wind_sz;
std::copy_n(s.inp, s.wind_sz, _storage->buffer);
s.inp += s.wind_sz;
if (s.wind_e == DictBase::BufSize)
s.wind_e = 0;
if (s.wind_sz < 3)
std::fill_n(_storage->buffer + s.wind_b + s.wind_sz, 3, 0);
}
void reset_next_input_entry(State& s, Match3Impl& match3, Match2Impl& match2) {
/* Remove match from about-to-be-clobbered buffer entry */
if (s.cycle1_countdown == 0) {
match3.remove(s.wind_e, _storage->buffer);
match2.remove(s.wind_e, _storage->buffer);
} else {
--s.cycle1_countdown;
}
}
void advance(State& s, uint32_t& lb_off, uint32_t& lb_len,
uint32_t best_off[MaxMatchByLengthLen], bool skip) {
auto& match3 = static_cast<Match3Impl&>(_storage->match3);
auto& match2 = static_cast<Match2Impl&>(_storage->match2);
if (skip) {
for (uint32_t i = 0; i < lb_len - 1; ++i) {
reset_next_input_entry(s, match3, match2);
match3.skip_advance(s, _storage->buffer);
match2.add(uint16_t(s.wind_b), _storage->buffer);
s.get_byte(_storage->buffer);
}
}
lb_len = 1;
lb_off = 0;
uint32_t lb_pos;
uint32_t best_pos[MaxMatchByLengthLen] = {};
uint32_t match_pos, match_count;
match3.advance(s, match_pos, match_count, _storage->buffer);
int best_char = _storage->buffer[s.wind_b];
uint32_t best_len = lb_len;
if (lb_len >= s.wind_sz) {
if (s.wind_sz == 0)
best_char = -1;
lb_off = 0;
match3.best_len[s.wind_b] = DictBase::MaxMatchLen + 1;
} else {
if (match2.search(s, lb_pos, lb_len, best_pos, _storage->buffer) && s.wind_sz >= 3) {
for (uint32_t i = 0; i < match_count; ++i, match_pos = match3.chain[match_pos]) {
auto ref_ptr = _storage->buffer + s.wind_b;
auto match_ptr = _storage->buffer + match_pos;
auto mismatch = std::mismatch(ref_ptr, ref_ptr + s.wind_sz, match_ptr);
auto match_len = uint32_t(mismatch.first - ref_ptr);
if (match_len < 2)
continue;
if (match_len < MaxMatchByLengthLen && best_pos[match_len] == 0)
best_pos[match_len] = match_pos + 1;
if (match_len > lb_len) {
lb_len = match_len;
lb_pos = match_pos;
if (match_len == s.wind_sz || match_len > match3.best_len[match_pos])
break;
}
}
}
if (lb_len > best_len)
lb_off = s.pos2off(lb_pos);
match3.best_len[s.wind_b] = uint16_t(lb_len);
for (auto posit = std::begin(best_pos) + 2, offit = best_off + 2;
posit != std::end(best_pos); ++posit, ++offit) {
*offit = (*posit > 0) ? s.pos2off(*posit - 1) : 0;
}
}
reset_next_input_entry(s, match3, match2);
match2.add(uint16_t(s.wind_b), _storage->buffer);
s.get_byte(_storage->buffer);
if (best_char < 0) {
s.buf_sz = 0;
lb_len = 0;
/* Signal exit */
} else {
s.buf_sz = s.wind_sz + 1;
}
s.bufp = s.inp - s.buf_sz;
}
};
static void find_better_match(const uint32_t best_off[MaxMatchByLengthLen], uint32_t& lb_len, uint32_t& lb_off) {
if (lb_len <= M2MinLen || lb_off <= M2MaxOffset)
return;
if (lb_off > M2MaxOffset && lb_len >= M2MinLen + 1 && lb_len <= M2MaxLen + 1 &&
best_off[lb_len - 1] != 0 && best_off[lb_len - 1] <= M2MaxOffset) {
lb_len -= 1;
lb_off = best_off[lb_len];
} else if (lb_off > M3MaxOffset && lb_len >= M4MaxLen + 1 && lb_len <= M2MaxLen + 2 &&
best_off[lb_len - 2] && best_off[lb_len] <= M2MaxOffset) {
lb_len -= 2;
lb_off = best_off[lb_len];
} else if (lb_off > M3MaxOffset && lb_len >= M4MaxLen + 1 && lb_len <= M3MaxLen + 1 &&
best_off[lb_len - 1] != 0 && best_off[lb_len - 2] <= M3MaxOffset) {
lb_len -= 1;
lb_off = best_off[lb_len];
}
}
static EResult encode_literal_run(uint8_t*& outp, const uint8_t* outp_end, const uint8_t* dst, std::size_t& dst_size,
const uint8_t* lit_ptr, uint32_t lit_len) {
if (outp == dst && lit_len <= 238) {
NEEDS_OUT(1);
*outp++ = uint8_t(17 + lit_len);
} else if (lit_len <= 3) {
outp[-2] = uint8_t(outp[-2] | lit_len);
} else if (lit_len <= 18) {
NEEDS_OUT(1);
*outp++ = uint8_t(lit_len - 3);
} else {
NEEDS_OUT((lit_len - 18) / 255 + 2);
*outp++ = 0;
WRITE_ZERO_BYTE_LENGTH(lit_len - 18);
}
NEEDS_OUT(lit_len);
outp = std::copy_n(lit_ptr, lit_len, outp);
return EResult::Success;
}
static EResult encode_lookback_match(uint8_t*& outp, const uint8_t* outp_end, const uint8_t* dst, std::size_t& dst_size,
uint32_t lb_len, uint32_t lb_off, uint32_t last_lit_len) {
if (lb_len == 2) {
lb_off -= 1;
NEEDS_OUT(2);
*outp++ = uint8_t(M1Marker | ((lb_off & 0x3) << 2));
*outp++ = uint8_t(lb_off >> 2);
} else if (lb_len <= M2MaxLen && lb_off <= M2MaxOffset) {
lb_off -= 1;
NEEDS_OUT(2);
*outp++ = uint8_t((lb_len - 1) << 5 | ((lb_off & 0x7) << 2));
*outp++ = uint8_t(lb_off >> 3);
} else if (lb_len == M2MinLen && lb_off <= M1MaxOffset + M2MaxOffset && last_lit_len >= 4) {
lb_off -= 1 + M2MaxOffset;
NEEDS_OUT(2);
*outp++ = uint8_t(M1Marker | ((lb_off & 0x3) << 2));
*outp++ = uint8_t(lb_off >> 2);
} else if (lb_off <= M3MaxOffset) {
lb_off -= 1;
if (lb_len <= M3MaxLen) {
NEEDS_OUT(1);
*outp++ = uint8_t(M3Marker | (lb_len - 2));
} else {
lb_len -= M3MaxLen;
NEEDS_OUT(lb_len / 255 + 2);
*outp++ = uint8_t(M3Marker);
WRITE_ZERO_BYTE_LENGTH(lb_len);
}
NEEDS_OUT(2);
*outp++ = uint8_t(lb_off << 2);
*outp++ = uint8_t(lb_off >> 6);
} else {
lb_off -= 0x4000;
if (lb_len <= M4MaxLen) {
NEEDS_OUT(1);
*outp++ = uint8_t(M4Marker | ((lb_off & 0x4000) >> 11) | (lb_len - 2));
} else {
lb_len -= M4MaxLen;
NEEDS_OUT(lb_len / 255 + 2);
*outp++ = uint8_t(M4Marker | ((lb_off & 0x4000) >> 11));
WRITE_ZERO_BYTE_LENGTH(lb_len);
}
NEEDS_OUT(2);
*outp++ = uint8_t(lb_off << 2);
*outp++ = uint8_t(lb_off >> 6);
}
return EResult::Success;
}
EResult compress(const uint8_t* src, std::size_t src_size,
uint8_t* dst, std::size_t init_dst_size,
std::size_t& dst_size, DictBase& dict) {
EResult err;
State s;
auto& d = static_cast<DictImpl&>(dict);
dst_size = init_dst_size;
uint8_t* outp = dst;
uint8_t* outp_end = dst + dst_size;
uint32_t lit_len = 0;
uint32_t lb_off, lb_len;
uint32_t best_off[MaxMatchByLengthLen];
d.init(s, src, src_size);
const uint8_t* lit_ptr = s.inp;
d.advance(s, lb_off, lb_len, best_off, false);
while (s.buf_sz > 0) {
if (lit_len == 0)
lit_ptr = s.bufp;
if (lb_len < 2 || (lb_len == 2 && (lb_off > M1MaxOffset || lit_len == 0 || lit_len >= 4)) ||
(lb_len == 2 && outp == dst) || (outp == dst && lit_len == 0)) {
lb_len = 0;
} else if (lb_len == M2MinLen && lb_off > M1MaxOffset + M2MaxOffset && lit_len >= 4) {
lb_len = 0;
}
if (lb_len == 0) {
++lit_len;
d.advance(s, lb_off, lb_len, best_off, false);
continue;
}
find_better_match(best_off, lb_len, lb_off);
if ((err = encode_literal_run(outp, outp_end, dst, dst_size, lit_ptr, lit_len)) < EResult::Success)
return err;
if ((err = encode_lookback_match(outp, outp_end, dst, dst_size, lb_len, lb_off, lit_len)) < EResult::Success)
return err;
lit_len = 0;
d.advance(s, lb_off, lb_len, best_off, true);
}
if ((err = encode_literal_run(outp, outp_end, dst, dst_size, lit_ptr, lit_len)) < EResult::Success)
return err;
/* Terminating M4 */
NEEDS_OUT(3);
*outp++ = M4Marker | 1;
*outp++ = 0;
*outp++ = 0;
dst_size = outp - dst;
return EResult::Success;
}
}

View File

@ -1,79 +0,0 @@
#pragma once
#include <cstddef>
#include <cstdint>
#include <memory>
namespace lzokay {
enum class EResult {
LookbehindOverrun = -4,
OutputOverrun = -3,
InputOverrun = -2,
Error = -1,
Success = 0,
InputNotConsumed = 1,
};
class DictBase {
protected:
static constexpr uint32_t HashSize = 0x4000;
static constexpr uint32_t MaxDist = 0xbfff;
static constexpr uint32_t MaxMatchLen = 0x800;
static constexpr uint32_t BufSize = MaxDist + MaxMatchLen;
/* List encoding of previous 3-byte data matches */
struct Match3 {
uint16_t head[HashSize]; /* key -> chain-head-pos */
uint16_t chain_sz[HashSize]; /* key -> chain-size */
uint16_t chain[BufSize]; /* chain-pos -> next-chain-pos */
uint16_t best_len[BufSize]; /* chain-pos -> best-match-length */
};
/* Encoding of 2-byte data matches */
struct Match2 {
uint16_t head[1 << 16]; /* 2-byte-data -> head-pos */
};
struct Data {
Match3 match3;
Match2 match2;
/* Circular buffer caching enough data to access the maximum lookback
* distance of 48K + maximum match length of 2K. An additional 2K is
* allocated so the start of the buffer may be replicated at the end,
* therefore providing efficient circular access.
*/
uint8_t buffer[BufSize + MaxMatchLen];
};
using storage_type = Data;
storage_type* _storage;
DictBase() = default;
friend struct State;
friend EResult compress(const uint8_t* src, std::size_t src_size,
uint8_t* dst, std::size_t& dst_size, DictBase& dict);
};
template <template<typename> class _Alloc = std::allocator>
class Dict : public DictBase {
_Alloc<DictBase::storage_type> _allocator;
public:
Dict() { _storage = _allocator.allocate(1); }
~Dict() { _allocator.deallocate(_storage, 1); }
};
EResult decompress(const uint8_t* src, std::size_t src_size,
uint8_t* dst, std::size_t dst_size,
std::size_t& out_size);
EResult compress(const uint8_t* src, std::size_t src_size,
uint8_t* dst, std::size_t dst_size,
std::size_t& out_size, DictBase& dict);
inline EResult compress(const uint8_t* src, std::size_t src_size,
uint8_t* dst, std::size_t dst_size,
std::size_t& out_size) {
Dict<> dict;
return compress(src, src_size, dst, dst_size, out_size, dict);
}
constexpr std::size_t compress_worst_size(std::size_t s) {
return s + s / 16 + 64 + 3;
}
}

6359
libs/compression/minilzo.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,99 @@
/* minilzo.h -- mini subset of the LZO real-time data compression library
This file is part of the LZO real-time data compression library.
Copyright (C) 1996-2017 Markus Franz Xaver Johannes Oberhumer
All Rights Reserved.
The LZO library is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
The LZO library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with the LZO library; see the file COPYING.
If not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Markus F.X.J. Oberhumer
<markus@oberhumer.com>
http://www.oberhumer.com/opensource/lzo/
*/
#ifndef __MINILZO_H_INCLUDED
#define __MINILZO_H_INCLUDED 1
#define MINILZO_VERSION 0x20a0 /* 2.10 */
#if defined(__LZOCONF_H_INCLUDED)
# error "you cannot use both LZO and miniLZO"
#endif
/* internal Autoconf configuration file - only used when building miniLZO */
#ifdef MINILZO_HAVE_CONFIG_H
# include <config.h>
#endif
#include <limits.h>
#include <stddef.h>
#ifndef __LZODEFS_H_INCLUDED
#include "lzodefs.h"
#endif
#undef LZO_HAVE_CONFIG_H
#include "lzoconf.h"
#if !defined(LZO_VERSION) || (LZO_VERSION != MINILZO_VERSION)
# error "version mismatch in header files"
#endif
#ifdef __cplusplus
extern "C" {
#endif
/***********************************************************************
//
************************************************************************/
/* Memory required for the wrkmem parameter.
* When the required size is 0, you can also pass a NULL pointer.
*/
#define LZO1X_MEM_COMPRESS LZO1X_1_MEM_COMPRESS
#define LZO1X_1_MEM_COMPRESS ((lzo_uint32_t) (16384L * lzo_sizeof_dict_t))
#define LZO1X_MEM_DECOMPRESS (0)
/* compression */
LZO_EXTERN(int)
lzo1x_1_compress ( const lzo_bytep src, lzo_uint src_len,
lzo_bytep dst, lzo_uintp dst_len,
lzo_voidp wrkmem );
/* decompression */
LZO_EXTERN(int)
lzo1x_decompress ( const lzo_bytep src, lzo_uint src_len,
lzo_bytep dst, lzo_uintp dst_len,
lzo_voidp wrkmem /* NOT USED */ );
/* safe decompression with overrun testing */
LZO_EXTERN(int)
lzo1x_decompress_safe ( const lzo_bytep src, lzo_uint src_len,
lzo_bytep dst, lzo_uintp dst_len,
lzo_voidp wrkmem /* NOT USED */ );
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif /* already included */
/* vim:set ts=4 sw=4 et: */

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