Commit Graph
86 Commits
Author SHA1 Message Date
Jan Laupetin 662780a896 chore: align iw3,iw4,iw5 menu code (#987)
* chore: small adjustments to iw3 menu dumper

* chore: align iw4 menu loader closer to iw3

* chore: align iw4 menu dumper closer to iw3

* chore: adjust iw4 menu expression dumping

* chore: adjust iw4 menu expression converting

* chore: align iw5 menu loader closer to iw3

* chore: align iw4 menu dumper closer to iw3

* chore: adjust iw5 menu expression dumping

* chore: adjust iw5 menu expression converting

* fix: not respecting reference menus when inlining menu list menus

* fix: compilation on linux
2026-08-31 22:10:37 +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 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
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
Jan 0d0f928267 feat: add binary xanim support for remaining games (#818)
* refactor: use generic loader for iw3 xanims

* refactor: use generic dumper for iw3 xanims

* chore: use templating on XAnimDumper

* chore: use templating on XAnimLoader

* feat: dump xanims for T5

* feat: load binary t5 xanims

* feat: load and dump t6 xanims

* feat: load and dump iw4,iw5 xanims

* chore: make sure iw3 and t5 notify about unsupported delta3D

* chore: also use CommonVec3U8 and CommonVec3U16 for non delta trans track
2026-06-06 14:47:51 +00: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
Jan Laupetin 5cf0ce37c1 feat: calculate model collision tree with leafs 2026-05-24 11:13:55 +02:00
Jan Laupetin b7a22973e6 chore: make sure xmodel flags are unsigned 2026-05-03 13:09:03 +02:00
Jan Laupetin 72f285178b feat: add techset dumping for iw5 2026-03-18 23:04:35 +01:00
Jan Laupetin edcc6774c7 fix: not reusing cbrushedge_t type in iw3,iw4 clipMap 2026-03-14 16:01:30 +01:00
Jan Laupetin 161ab45306 chore: handle iw4 technique flags 2026-03-14 09:09:57 +01:00
Jan Laupetin bf9beb1458 chore: make sure TechsetCompilerT6 sets proper worldVertFormat 2026-03-02 22:08:55 +00:00
Jan Laupetin aa47ffa629 refactor: introduce subasset loading 2026-02-05 18:17:15 +01:00
Jan Laupetin 00546740e4 fix: filling union members that are not supposed to be written
* This causes some pointers to be partially overwritten when filling in the wrong order as well
2026-01-17 00:45:21 +00:00
Jan Laupetin 4cdccba016 feat: add embedded image loader for every supported game 2026-01-05 09:50:21 +00:00
Jan Laupetin 4b5cea3180 fix: iw3/iw4 xmodels having invalid collLod 2025-07-10 17:57:48 +01:00
Jan 3daa8b0412 refactor: use templated xmodel loading and dumping code for iw4 2025-07-09 23:23:16 +01:00
Jan b05a473e6a fix: iw4 materials not writing correct stateBitsEntry 2025-06-28 14:51:04 +01:00
Jan 2073265a86 feat: add templated iw4 material loading 2025-06-26 22:40:30 +01:00
Jan Laupetin 2230efbd27 chore: make xquat and xquat2 structs to improve handling from zcg 2025-06-19 20:45:19 +01:00
Jan 03ccede91c refactor: implement base x64 fastfile loading for iw4 2025-06-19 18:59:20 +01:00
Jan Laupetin 4ccd0a55cf chore: adjust game structs to have custom alignment when they are
platform independent
2025-04-27 21:05:22 +02:00
Jan Laupetin a6107e24a2 chore: disable type alignment on x64 for x86 games 2025-04-26 19:48:03 +02:00
Jan 5cc52c42cd refactor: image and obj data loading 2024-09-26 07:22:35 +02:00
Jan 1f5050befa feat: first draft of loading gltf models for t6 2024-09-05 21:19:39 +02:00
Jan 3201cefd5b chore: rename accuracy table properties in weapon structs 2024-05-20 10:41:57 +02:00
Jan dc090c1371 chore: update count properties of leaderboard enums 2024-05-19 11:52:29 +02:00
Jan 3dad9d60da chore: fix typo in structs 2024-04-07 10:54:04 +02:00
Jan df7b25b854 feat: dump t6 materials as json 2024-02-18 10:16:43 +01:00
Clang Format 6b4f5d94a8 Reformat code with clang format 2023-11-19 21:07:21 +00:00
Jan 399d8e834d Make IW4 menu rect def align be unsigned like IW5 2023-08-23 20:51:11 +02:00
Jan 2dd8660824 Add supplemental data for iw4 statemap layout 2022-08-20 14:37:05 +02:00
Jan c010355d4a Dump material tile and filter properties 2022-08-06 18:47:28 +02:00
Jan 347c1b3d68 Fix material loading sortkeys and cameraRegion 2022-08-06 15:40:00 +02:00
Jan 5771044c08 Material dumping and loading stuff 2022-08-06 10:52:52 +02:00
Jan 92d808b7a4 Use constants for material sort key names 2022-07-23 13:05:37 +02:00
Jan ea79e60856 Load material sortkeys v1 2022-07-23 12:22:59 +02:00
Jan 82349d3432 Material loading base 2022-07-15 11:21:54 +02:00
Jan 638b659a48 Example material stencil values and blendfunc 2022-05-08 12:44:34 +02:00
Jan cc2f0ca487 Write Statebits data to gdt materials 2022-05-02 21:11:51 +02:00
Jan b94c5b381d Extract more info from techset name 2022-05-02 18:45:49 +02:00
Jan 01d9a4d912 Improve recognition of material types 2022-04-29 23:55:10 +02:00
Jan 2823a46b92 Add improvements from iw3 material dumping to iw4 2022-04-21 19:58:49 +02:00
Jan ebb13e18da Write additional details in iw4 material json 2022-04-18 18:23:30 +02:00
Jan ce22a2fea6 Add more details about material semantic and samplerState 2022-04-18 15:26:24 +02:00
Jan 2114b761b0 Dump iw4 materials as json for data investigation purposes 2022-04-18 14:46:13 +02:00
Jan 6ff86ae5e7 Set technique flags based on used constants, samplers and technique names 2022-04-16 22:51:38 +02:00
Jan 4abb846ccd fix iw4 enum not having a name 2022-04-16 15:44:57 +02:00
Jan cb45bdaadc Progress on reversing technique flags 2022-04-16 15:41:45 +02:00
Jan 9990338130 Handle custom samplers 2022-04-15 16:34:44 +02:00