Commit Graph
56 Commits
Author SHA1 Message Date
moandJan Laupetin 39e46495b9 feat: decode IWI6 wavelet textures (#980)
* feat: decode IWI6 wavelet textures

* refactor: validate wavelet Huffman tables at compile time

* chore: small code style adjustments to IwiLoader

* chore: small code style adjustments to IwiWaveletDecoder

* fix: use shift right operator to better handle edge cases

* chore: add wavelet support for iwi8

* chore: add wavelet support for iwi13

---------

Co-authored-by: Jan Laupetin <[email protected]>
2026-09-06 23:08:20 +02:00
moandJan Laupetin 61fd267b2b feat: T4 add xmodel loader (#989)
* feat: T4 add xmodel loader

* chore: remove unused xmodel related struct from T4

* fix: allocating too little trans for t4

---------

Co-authored-by: Jan Laupetin <[email protected]>
2026-09-04 19:37:24 +02:00
moandJan Laupetin 2569303de4 fix: correct T4 FX element type values (#990)
* fix: correct T4 FX element type values

* chore: adjust all game FxElemType enums

---------

Co-authored-by: Jan Laupetin <[email protected]>
2026-09-04 18:48:10 +02:00
moandJan Laupetin 1588b4519a chore: add Windows formatting convenience scripts (#922)
* chore: add Windows formatting convenience scripts

* chore: use powershell scripts

---------

Co-authored-by: Jan Laupetin <[email protected]>
2026-09-04 18:06:13 +02:00
moandJan Laupetin 4da55a351a feat: add T4 menu dumping and loading (#986)
* feat: add T4 menu dumping

* chore: align with latest changes

* feat: add T4 menu loading

Load T4 menulists and menu files through the shared menu parser.

Preserve T4-specific menu and listbox fields and cover loading, dumping, linking, and round-trip behaviour.

* chore: make flag fields unsigned

* chore: rename `expOperationEnum` -> `operationEnum`

* chore: use default enum numeration for T4 operationEnum

* chore: remove unused members of operationEnum

* chore: remove redundant op from operationEnum

* refactor: align T4 expression operand names with IW3

* chore: small adjustment to iw3,t4 types

---------

Co-authored-by: Jan Laupetin <[email protected]>
2026-09-03 23:19:03 +02:00
moandJan Laupetin 7d027e8f89 fix: handle IWD entry end of stream (#976)
* fix: handle IWD entry end of stream

Return EOF correctly for IWD entries and preserve peeked bytes during bulk reads.

* chore: small code style adaption

* chore: use minizip to write test zip file

---------

Co-authored-by: Jan Laupetin <[email protected]>
2026-09-01 00:01:44 +02:00
moandJan Laupetin 51770e7ae5 feat: IW3 menu dumping and loading (#909)
* feat: IW3 menu dumping

* fix: IW3 menu dumper preserve menu ownerdraw flag masks

* fix: IW3 menu dumper preserve numeric script arguments

Emit numeric tokens without quotes so the linker keeps colour arguments separate.

Before: `"0.1" "0.1" "0.12" "0.5"` becomes `"0.10.10.120.5"`
After: `0.1 0.1 0.12 0.5`

This fixes `mouseExit` colour commands failing to clear menu hover borders.

* fix: IW3 menu dumper preserve empty item text

Keep explicit empty text distinct from null text when dumping menu items.

This fixes CD-key values overflowing their input boxes.

* test: cover IW3 menu dumper material case

* test: cover IW3 menu list path precedence

* chore: clang format

* fix: reverse order of union to avoid edge case bug in zcg

* feat: IW3 menu loading

* fix: validate menu expression name table

* chore: explain numeric token quoting in comment

* refactor: simplify menu dump fallback path

* chore: add more dynamic window flags

* refactor: reuse IW3 menu window flag constants

* refactor: use explicit menu item feature lookup

* refactor: represent menu item text as optional

* refactor: clarify shared IW3 and IW4 menu constants

IW4 only extends the type enum so they can be shared

* refactor: clarify IW3 menu zone state naming

* fix: log IW3 menu conversion failures

* refactor: align IW3 menu list loader with IW4

* refactor: align IW3 menu dumpers with IW4

* refactor: align IW3 menu converter with IW4

* chore: use default enum numeration for operationEnum

* chore: small optimization on edit field capability initialization

* fix: iw3 menu optimizations for rect not considering relative position to parent

* chore: align iw3 menu converting closer to iw4

* chore: align iw3 menu dumping closer to iw4

* fix: not dumping menu flags properties correctly

* chore: adjust iw3 expression dumping to work similar to iw4

* chore: adjust iw3 expression converting to work similar to iw4

* chore: use unordered_map for MenuExpressionMatchers

---------

Co-authored-by: Jan Laupetin <[email protected]>
2026-08-31 00:04:01 +02:00
moandJan Laupetin 6da0f2207e feat(unlinker): support ?game? placeholder in output folder (#945)
* feat(unlinker): support ?game? placeholder in output folder

* chore: move unlinking tests to separate project

---------

Co-authored-by: Jan Laupetin <[email protected]>
2026-08-07 20:43:24 +02:00
moandJan Laupetin ae4f63eb2b fix(menu): accept numeric dvarStrList values (#947)
* fix(menu): accept numeric `dvarStrList` values

Convert numeric tokens to strings to match the game menu parser behaviour.

https://github.com/Laupetin/OpenAssetTools/issues/160

* chore: rename TextOrNumericNoChain to TextNoChainOrNumeric

---------

Co-authored-by: Jan Laupetin <[email protected]>
2026-08-05 19:08:02 +02:00
mo f82f191e6c fix(parser): allow empty final macro arguments (#948)
Treat a trailing comma as an empty parameter.
2026-08-05 18:13:35 +02:00
moandJan Laupetin 9f49e0e31c feat: QOS (007: Quantum of Solace) support (#894)
* feat: QOS (007: Quantum of Solace) support

* feat: add qos localize loader

* feat: add qos stringtable loader

* chore: comment about official zones

* fix: add qos gfximage runtime fields

* chore: remove useless dev time comments

* fix: remove all `static_asserts`s from asset headers causing build fail on x64

* chore: change union ordering of qos `entryInternalData`

* chore: move qos asset type enum to qos.h

* fix: qos and t4 xsurface index buffer

* chore: implement qos MaterialInfo struct

* chore: adjust some gfxworld struct members

* chore: implement qos PhysPreset and PhysConstraints

* chore: fix and adjust slight inconsistencies with qos zone code

* chore: reorder qos ZoneCode.lua entries in order of asset type enum

* chore: remove asset types that are not actual asset types in zones

* chore: check common asset arrays with static_assert

* chore: rename qos assets

* chore: reorder qos in templates to be in alphabetical order

* chore: use function for CopyMipLevel in Dx9TextureLoader

* chore: use templates for qos MapEntsDumper

* chore: add missing braces in XModelToCommonConverter

* chore: add generic way to peek at zone data

* Qos does not use a classic ZoneHeader so code needs to be more generic

* fix: do not use raw_byte and raw_uint typedefs for qos

* fix: not being able to write clipmapmp

* chore: additional research on qos vertex property and stuff

---------

Co-authored-by: Jan Laupetin <[email protected]>
2026-08-05 00:32:23 +02:00
moandJan Laupetin f99726d62f fix(menu): allow IW4 columns without alignment (#932)
* fix(menu): allow IW4 columns without alignment

* feat: also make alignment optional for iw5 menus

* chore: move menu sequences to anonymous namespace if possible

---------

Co-authored-by: Jan Laupetin <[email protected]>
2026-07-26 23:02:13 +02:00
mo 8686b42120 fix(parser): allow space before function macro arguments (#933) 2026-07-26 22:38:11 +02:00
moandJan Laupetin 0c66d1838e feat: T4 add StringTable loader (#934)
* feat: T4 add string table loader

* chore: rename stringtable loaders to match style between games

* fix: make sure all games correctly interpret failed stringtable loading

---------

Co-authored-by: Jan Laupetin <[email protected]>
2026-07-26 00:40:02 +02:00
moandJan Laupetin 76e5bb17a2 feat: templated vehicle loading and dumping for IW4 and IW5 (#929)
* feat: templated vehicle loading and dumping for IW4 and IW5

* chore: restructure vehicle tests into separate files

---------

Co-authored-by: Jan Laupetin <[email protected]>
2026-07-26 00:28:44 +02:00
moandJan Laupetin 4421b94831 fix(menu): allow numeric dvar values (#927)
* fix(menu): allow numeric dvar values

* chore: use std format instead of stringstream

---------

Co-authored-by: Jan Laupetin <[email protected]>
2026-07-23 20:06:08 +02:00
mo b154ee95a4 fix(parser): parse spaced and negated defined checks (#926) 2026-07-23 19:27:52 +02:00
moandJan Laupetin 52f557a9bb fix(parser): report unclosed multiline comments (#924)
* fix(parser): report unclosed multiline comments

* chore: make multi line comment variable names clearer

---------

Co-authored-by: Jan Laupetin <[email protected]>
2026-07-23 18:57:28 +02:00
moandJan Laupetin 37bb67a3a5 feat: add T4 PhysPreset support (#925)
* feat: add T4 PhysPreset support

* chore: slight adjustment to how the max friction constant is named

---------

Co-authored-by: Jan Laupetin <[email protected]>
2026-07-21 23:56:59 +02:00
mo 572965844e feat: templated MapEnts dumper (#923)
Relates to https://github.com/Laupetin/OpenAssetTools/issues/626
2026-07-21 19:55:40 +02:00
mo 2188f49a08 feat: templated tracer loading and dumping for IW4 and IW5 (#921)
Relates to https://github.com/Laupetin/OpenAssetTools/issues/626
2026-07-20 23:36:40 +02:00
mo 3743537f9e fix: handle UTF-8 BOM-prefixed input (#919)
Fixes https://github.com/Laupetin/OpenAssetTools/issues/771
2026-07-20 21:08:59 +02:00
mo 9c56a28ef4 fix: apply menu item origin as an offset (#917)
Add `origin` values to the existing item rectangle instead of replacing its coordinates.
2026-07-19 21:32:10 +02:00
mo 786ccc14d3 fix: prevent IWD paths from matching nested filenames (#908)
Fixes https://github.com/Laupetin/OpenAssetTools/issues/887
2026-07-18 11:44:55 +02:00
moandJan Laupetin 33352e5391 feat: log detected game when loading zones (#904)
* feat: log detected game when loading zones

* chore: make zone loaded log a one-liner

* chore: also log game when loading zone in Linker

---------

Co-authored-by: Jan Laupetin <[email protected]>
2026-07-18 09:24:49 +02:00
mo 872b650c9a chore(ci): add compiler caching via sccache (#903) 2026-07-17 23:38:33 +02:00
moandJan Laupetin a2fe2e88ab fix: IW3 ensure loadForRenderer is set for shaders (#907)
* fix: IW3 restore renderer loading for disk shaders

* fix: IW3 ensure `loadForRenderer` is set for shaders

* fix: use modtools linker logic for iw3 loadForRenderer shader values

---------

Co-authored-by: Jan Laupetin <[email protected]>
2026-07-17 21:55:49 +02:00
mo 0c1efa1667 fix: assign ownerdraw item type when parsing menus (#911)
Set `m_type` to `ITEM_TYPE_OWNERDRAW` when parsing an `ownerdraw` property. Otherwise, it retains the default `ITEM_TYPE_TEXT`.

This restores controls such as the Source button in the IW4x server browser.
2026-07-17 18:26:50 +02:00
mo 0123595305 refactor: use standard library endian utilities (#883) 2026-07-12 00:06:44 +02:00
3fb8b2bb17 feat: font loading and dumping (#866)
* feat: font loading and dumping

* chore: make font properties unsigned if possible

* chore: use merge_patch to dump json font

* chore: font material is required

* chore: move static methods from font loader and dumper to anonymous namespace

* chore: make sure loaded fonts have their glyphs sorted

* chore: add macros for json NLOHMANN_TO_JSON_METHOD and NLOHMANN_FROM_JSON_METHOD

* feat: encode printable letters as string in json

Co-authored-by: hindercanrun <[email protected]>

* chore: omit redundant glyph count from jsons

---------

Co-authored-by: Jan Laupetin <[email protected]>
Co-authored-by: hindercanrun <[email protected]>
Co-authored-by: MrIkso <[email protected]>
2026-07-03 19:26:12 +02:00
moandJan Laupetin fb4b00398c feat: T4 weapon loading and dumping (#869)
* feat: T4 weapon loading and dumping

* chore: adjust naming of weapon enum values

* chore: fix typo in type names

* chore: rename t4 weapon loader files

* feat: dump and load gdt weapons for t4

* chore: weapon loaders to use similar logic

---------

Co-authored-by: Jan Laupetin <[email protected]>
2026-07-02 07:10:24 +02:00
moandJan Laupetin ee63355fd2 feat: IW3 weapon loading and dumping (#867)
* feat: IW3 weapon loading and dumping

* chore: adjust weapon strings for iw3

* chore: use original capitalization for aifuseTime

* chore: remove unused alternative iw3 csp fields

* chore: add missing checks and style the code similar to t5

* chore: small code smells in t5 weapon loader

* feat: add iw3 gdt loader

* chore: adjust weapon loader file names to t5 style

* feat: add gdt dumper for iw3 weapons

---------

Co-authored-by: Jan Laupetin <[email protected]>
2026-06-30 22:25:06 +02:00
mo c9595794a3 feat: T4 RawFile and MapEnts loading (#870) 2026-06-29 19:27:16 +02:00
moandJan Laupetin 62ee9dab40 feat: T4 LoadedSound dumper (#855)
* feat: T4 LoadedSound dumper

* chore: make t4 loaded sound dumper not parse wav

---------

Co-authored-by: Jan Laupetin <[email protected]>
2026-06-29 18:59:28 +02:00
moandJan Laupetin 228e40d17f feat: T4 MapEnts dumper (#865)
* feat: T4 MapEnts dumper

* chore: use common map_ents logic for filename

---------

Co-authored-by: Jan Laupetin <[email protected]>
2026-06-29 08:28:45 +02:00
mo b5d50120ad feat: T4 xanim binary dumping and loading (#854) 2026-06-27 14:16:50 +02:00
mo 8c61fa3b62 feat: T4 XModel dumper (#852) 2026-06-25 15:03:07 +02:00
moandJan Laupetin 44d6710991 feat: initial T4 support (#807)
* feat: initial T4 support

* chore: adjust t4 symbols a bit for accuracy

* chore: add PackIndex asset to T4

* chore: remove unused AssetXModelPieces

* chore: add default and global asset pools loader for T4

* chore: use separate defines for T4 in ImageDumper

* chore: remove unnecessary namespaces in gfximage_actions

* chore: small things

* chore: fix T4 PhysPreset type

* chore: use proper XQuat2 type for T4 xanims

* chore: fix errors on T4 types

* chore: use iw3 like struct for XModelStreamInfo

* docs: add basic docs for T4

* chore: add basic ObjCompiler setup for T4

* chore: adjust loaded sound definition

* chore: make sure t4 material has the correct alignment

* chore: make sure t4 uses similar names for assets as other games

* fix: asset references should not be reusable

* chore: add content writer for t4

* feat: add t4 localize loader

* chore: reorder game ids to be alphabetically ordered

---------

Co-authored-by: Jan Laupetin <[email protected]>
2026-06-07 14:06:33 +02:00
moandJan Laupetin 0c22dddd0e feat: IW3 xanim dumping/loading in CoD4 Mod Tools raw binary format (#768)
* feat: IW3 dump xanim to cod4 mod tools compatible binary

* chore: add XAnimPartType enum to game headers

* chore: use XAnimPartType in XAnimDumperIW3

* chore: extract xanim filename into XAnimCommon

* chore: prefer emplace_back over push_back

* chore: small code style improvements

* chore: use proper unsigned types for XAnimParts structs

* chore: use better understandable calculations for bitfields

* chore: use game names for parts

* chore: rename method to WriteNoteTracks

* chore: adds comments and improve clearity of what the game does

* chore: extract stream writing methods into StreamUtils

* chore: use vec3 for XAnimPartTransFrames mins and size

* chore: properly differ between XQuat and XQuat2 structs

* chore: use constants for xanim flags

* chore: use optional for delta track quats and trans

* chore: split delta track writing methods into quat and trans

* chore: add assertion for bDelta

* chore: simplify quat frame encoding indexing

* chore: simplify float to int bit casting

* chore: do not throw exception on failing to reconstruct bone tracks

* feat: add xanim loader for iw3

* fix: make sure to sort quats and trans like the game

* chore: prevent empty dumped files on bad xanim data

* chore: ensure no exception on zero frames in xanim notifies

* test: add system test for iw3 xanims

---------

Co-authored-by: Jan Laupetin <[email protected]>
2026-06-01 22:52:49 +02:00
Michael Oliver 9ecc3d06e8 fix(unlinker): respect minimal zone definition output 2026-05-15 11:48:33 +01:00
Michael Oliver 618592e411 fix: only omit default armature if it can be omitted for all lods 2026-05-03 13:09:02 +02:00
Michael Oliver 98d8ea9005 fix: xmodel glTF dumps dropping COLOR_0 vertex attributes 2026-05-01 21:48:28 +02:00
Michael Oliver d71bebaa3d fix: remove deprecated '>type,type' zone definition 2026-05-01 15:50:26 +01:00
Michael Oliver 97591f59f4 refactor(zcg): use wordsize instead of architecture 2026-04-30 13:50:11 +01:00
Michael Oliver 3aa28a0ded fix: IW3 ensure XModel::surfs is set in loader 2026-04-27 18:24:02 +01:00
Michael Oliver a3e6529925 feat: add asset source description to loading logs 2026-04-27 10:07:11 +01:00
Michael Oliver 00ffc7717b feat: dump iw4 alpha 482 xbox fastfile data 2025-12-23 09:57:13 +00:00
Michael Oliver 5a0b255d92 tidy 2025-12-21 21:35:20 +00:00
Michael Oliver 47bb1493ed add a step to skip xasset stream files 2025-12-21 20:59:38 +00:00
Michael Oliver e1e4846386 update comment 2025-12-17 13:48:46 +00:00
Michael Oliver 541e16391e formatting 2025-12-17 13:48:17 +00:00
Michael Oliver ea161c658f convert rsa key to hexadecimal 2025-12-17 13:47:35 +00:00
Michael Oliver b19d7bfc75 cleanup 2025-12-17 13:42:01 +00:00
Michael Oliver 38953d1daa feat: dump iw4 xbox fastfile data 2025-12-17 13:35:58 +00:00
Michael Oliver 67372025b4 feat: dump iw3 xbox signed fastfile data 2025-12-15 22:27:40 +00:00
Michael Oliver cc7a68de56 feat: dump iw3 xbox unsigned fastfile data 2025-12-14 01:27:24 +00:00