Compare commits

...

83 Commits

Author SHA1 Message Date
Jan
0f3ee1fa79
Merge pull request #407 from Laupetin/dependabot/submodules/thirdparty/eigen-33f5f59
chore(deps): bump thirdparty/eigen from `11fd34c` to `33f5f59`
2025-04-19 11:54:54 +02:00
Jan
c8cd6826c1
Merge pull request #406 from Laupetin/dependabot/submodules/thirdparty/json-c67d538
chore(deps): bump thirdparty/json from `7ddea26` to `c67d538`
2025-04-19 11:54:41 +02:00
Jan
5afc24fd89
Merge pull request #405 from Laupetin/dependabot/submodules/thirdparty/catch2-4c8671c
chore(deps): bump thirdparty/catch2 from `2b60af8` to `4c8671c`
2025-04-19 11:54:28 +02:00
dependabot[bot]
598abe095b
chore(deps): bump thirdparty/eigen from 11fd34c to 33f5f59
Bumps [thirdparty/eigen](https://gitlab.com/libeigen/eigen) from `11fd34c` to `33f5f59`.
- [Release notes](https://gitlab.com/libeigen/eigen/tags)
- [Commits](11fd34cc1c...33f5f59614)

---
updated-dependencies:
- dependency-name: thirdparty/eigen
  dependency-version: 33f5f596143d0fce32316ec6fa4bd9f23b4dd9d2
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-18 22:43:27 +00:00
dependabot[bot]
d6eee273ff
chore(deps): bump thirdparty/json from 7ddea26 to c67d538
Bumps [thirdparty/json](https://github.com/nlohmann/json) from `7ddea26` to `c67d538`.
- [Release notes](https://github.com/nlohmann/json/releases)
- [Commits](7ddea2686f...c67d538274)

---
updated-dependencies:
- dependency-name: thirdparty/json
  dependency-version: c67d538274502163b55e8fb54b5c27c17764722d
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-18 22:43:25 +00:00
dependabot[bot]
7edbe7378b
chore(deps): bump thirdparty/catch2 from 2b60af8 to 4c8671c
Bumps [thirdparty/catch2](https://github.com/catchorg/Catch2) from `2b60af8` to `4c8671c`.
- [Release notes](https://github.com/catchorg/Catch2/releases)
- [Commits](2b60af89e2...4c8671cfbb)

---
updated-dependencies:
- dependency-name: thirdparty/catch2
  dependency-version: 4c8671cfbbf0019d3827305d4d1c82a74eeb029a
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-18 22:43:23 +00:00
Jan
b83bafb0f8
Merge pull request #403 from Laupetin/dependabot/submodules/thirdparty/catch2-2b60af8
chore(deps): bump thirdparty/catch2 from `76f70b1` to `2b60af8`
2025-04-12 23:24:00 +02:00
Jan
e750e3ffd9
Merge pull request #402 from Laupetin/dependabot/submodules/thirdparty/json-7ddea26
chore(deps): bump thirdparty/json from `11aa5f9` to `7ddea26`
2025-04-12 23:23:44 +02:00
Jan
d5b6c6e9c2
Merge pull request #401 from Laupetin/dependabot/submodules/thirdparty/eigen-11fd34c
chore(deps): bump thirdparty/eigen from `b860042` to `11fd34c`
2025-04-12 23:23:32 +02:00
dependabot[bot]
d6c1ef775e
chore(deps): bump thirdparty/catch2 from 76f70b1 to 2b60af8
Bumps [thirdparty/catch2](https://github.com/catchorg/Catch2) from `76f70b1` to `2b60af8`.
- [Release notes](https://github.com/catchorg/Catch2/releases)
- [Commits](76f70b1403...2b60af89e2)

---
updated-dependencies:
- dependency-name: thirdparty/catch2
  dependency-version: 2b60af89e23d28eefc081bc930831ee9d45ea58b
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-11 22:49:13 +00:00
dependabot[bot]
c05d4ea34e
chore(deps): bump thirdparty/json from 11aa5f9 to 7ddea26
Bumps [thirdparty/json](https://github.com/nlohmann/json) from `11aa5f9` to `7ddea26`.
- [Release notes](https://github.com/nlohmann/json/releases)
- [Commits](11aa5f944d...7ddea2686f)

---
updated-dependencies:
- dependency-name: thirdparty/json
  dependency-version: 7ddea2686f091ea77a3f731ab74c59535db9f684
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-11 22:49:10 +00:00
dependabot[bot]
b2d9bf416d
chore(deps): bump thirdparty/eigen from b860042 to 11fd34c
Bumps [thirdparty/eigen](https://gitlab.com/libeigen/eigen) from `b860042` to `11fd34c`.
- [Release notes](https://gitlab.com/libeigen/eigen/tags)
- [Commits](b860042263...11fd34cc1c)

---
updated-dependencies:
- dependency-name: thirdparty/eigen
  dependency-version: 11fd34cc1c398f2c2311339ed3b008b1114544eb
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-11 22:49:08 +00:00
Jan
3134ec5a37
Merge pull request #400 from GoastcraftHD/main
Added MapEnts dumping for T6
2025-04-07 23:40:52 +02:00
Jan
0d35696940
chore: make map ents dumping add ents extension instead of replacing 2025-04-07 22:16:08 +01:00
GoastcraftHD
b215b22018 Fixed MapEnts dumping in wrong folder 2025-04-07 22:34:21 +02:00
GoastcraftHD
a447dd29fa
Fixed include order 2025-04-07 20:05:01 +02:00
GoastcraftHD
985996975b
Update SupportedAssetTypes.md 2025-04-07 12:05:56 +02:00
Simon Ickler
f235798cf6 Added MapEnts dumping for T6 2025-04-07 12:05:03 +02:00
Jan
0228e86980
Merge pull request #399 from Laupetin/fix/64-bit-compilation
fix: 64 bit compilation
2025-04-06 19:27:06 +02:00
Jan
01302cf061
fix: too large obj files for x64 on windows 2025-04-06 18:02:48 +01:00
Jan
6f31e8cc29
chore: fix compilation issues with x64 2025-04-06 18:02:47 +01:00
Jan
37d52ae8da
chore: add compilation scripts for x64 2025-04-06 17:44:26 +02:00
Jan
481d301545
chore: change c++ version to c++23 2025-04-06 17:43:50 +02:00
Jan
d3bb99e92c
Merge pull request #395 from Laupetin/fix/bad-xmodel-loading
fix: bad xmodel loading
2025-04-05 17:59:45 +02:00
Jan
cec70e783f
fix: not using lookup to common vertices when writing rigid bone data
no more pizza cheese problem
2025-04-05 17:36:29 +02:00
Jan
a2c8129a13
fix: messed up reordering of vertices for bone count 2025-04-05 16:30:58 +02:00
Jan
e13eb256bb
chore: update code style 2025-04-05 16:30:54 +02:00
Jan
aab510c917
Merge pull request #398 from Laupetin/fix/linux-folder-file-capitalization
fix: linux folder file capitalization
2025-04-05 13:07:14 +02:00
Jan
820fe47473
fix: always use lowercase extensions for xmodels 2025-04-05 12:42:55 +02:00
Jan
0366b24bd7
fix: game name in linker paths must be lowercase for linux 2025-04-05 12:42:52 +02:00
Jan
49f0794545
Merge pull request #397 from Laupetin/dependabot/submodules/thirdparty/json-11aa5f9
chore(deps): bump thirdparty/json from `11a835d` to `11aa5f9`
2025-04-05 08:51:42 +02:00
Jan
20911d552d
Merge pull request #396 from Laupetin/dependabot/submodules/thirdparty/eigen-b860042
chore(deps): bump thirdparty/eigen from `e0c99a8` to `b860042`
2025-04-05 08:51:27 +02:00
dependabot[bot]
1748f9e1a5
chore(deps): bump thirdparty/json from 11a835d to 11aa5f9
Bumps [thirdparty/json](https://github.com/nlohmann/json) from `11a835d` to `11aa5f9`.
- [Release notes](https://github.com/nlohmann/json/releases)
- [Commits](11a835df85...11aa5f944d)

---
updated-dependencies:
- dependency-name: thirdparty/json
  dependency-version: 11aa5f944d17ed5b96250ca133bf33c5ca8b0161
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-04 23:00:25 +00:00
dependabot[bot]
a37b5fee8c
chore(deps): bump thirdparty/eigen from e0c99a8 to b860042
Bumps [thirdparty/eigen](https://gitlab.com/libeigen/eigen) from `e0c99a8` to `b860042`.
- [Release notes](https://gitlab.com/libeigen/eigen/tags)
- [Commits](e0c99a8dd6...b860042263)

---
updated-dependencies:
- dependency-name: thirdparty/eigen
  dependency-version: b86004226361882ea6c9308c0a940007a049d1d5
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-04-04 23:00:23 +00:00
Jan
42e2eb80b3
Merge pull request #394 from Laupetin/dependabot/submodules/thirdparty/eigen-e0c99a8
chore(deps): bump thirdparty/eigen from `6579e36` to `e0c99a8`
2025-03-29 00:27:10 +01:00
dependabot[bot]
885c57bfa5
chore(deps): bump thirdparty/eigen from 6579e36 to e0c99a8
Bumps [thirdparty/eigen](https://gitlab.com/libeigen/eigen) from `6579e36` to `e0c99a8`.
- [Release notes](https://gitlab.com/libeigen/eigen/tags)
- [Commits](6579e36eb4...e0c99a8dd6)

---
updated-dependencies:
- dependency-name: thirdparty/eigen
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-28 22:45:27 +00:00
Jan
fa88b135f9
Merge pull request #393 from Laupetin/fix/rename-clipmap-asset-iw3-iw4-t5
fix: set clipmap asset name of non-pvs clipmap to clipmap_unused in IW3,IW4,T5
2025-03-27 17:43:53 +01:00
Jan
56c4eeb5cd
fix: set clipmap asset name of non-pvs clipmap to clipmap_unused in IW3,IW4,T5 2025-03-27 17:16:28 +01:00
Jan
0fcae6a55a
Merge pull request #391 from LJW-Dev/fix/T6-clipmap-asset
Update T6 asset loading code to use ASSET_TYPE_CLIPMAP_PVS.
2025-03-27 17:14:14 +01:00
LJW-Dev
f97f38dc31
Merge branch 'Laupetin:main' into fix/T6-clipmap-asset 2025-03-27 12:33:05 +08:00
LJW-Dev
95f5dca5e0 Updated zone loading code to only use ASSET_TYPE_CLIPMAP_PVS. 2025-03-27 12:32:43 +08:00
Jan
f2723255f5
Merge pull request #390 from Laupetin/dependabot/submodules/thirdparty/json-11a835d
chore(deps): bump thirdparty/json from `8215dba` to `11a835d`
2025-03-25 20:31:53 +01:00
dependabot[bot]
11cb93f736
chore(deps): bump thirdparty/json from 8215dba to 11a835d
Bumps [thirdparty/json](https://github.com/nlohmann/json) from `8215dba` to `11a835d`.
- [Release notes](https://github.com/nlohmann/json/releases)
- [Commits](8215dbafbd...11a835df85)

---
updated-dependencies:
- dependency-name: thirdparty/json
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-25 18:54:35 +00:00
Jan
e40d688e11
Merge pull request #389 from Laupetin/dependabot/submodules/thirdparty/libtommath-e823b0c
chore(deps): bump thirdparty/libtommath from `5938524` to `e823b0c`
2025-03-25 19:53:42 +01:00
dependabot[bot]
2eeb20d1cd
chore(deps): bump thirdparty/libtommath from 5938524 to e823b0c
Bumps [thirdparty/libtommath](https://github.com/libtom/libtommath) from `5938524` to `e823b0c`.
- [Release notes](https://github.com/libtom/libtommath/releases)
- [Commits](5938524c60...e823b0c34c)

---
updated-dependencies:
- dependency-name: thirdparty/libtommath
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-25 18:25:18 +00:00
Jan
7b79504477
Merge pull request #388 from Laupetin/dependabot/submodules/thirdparty/eigen-ac2165c
chore(deps): bump thirdparty/eigen from `5fc6fc9` to `ac2165c`
2025-03-25 19:24:21 +01:00
dependabot[bot]
4cc7ab77d5
chore(deps): bump thirdparty/eigen from 5fc6fc9 to ac2165c
Bumps [thirdparty/eigen](https://gitlab.com/libeigen/eigen) from `5fc6fc9` to `ac2165c`.
- [Release notes](https://gitlab.com/libeigen/eigen/tags)
- [Commits](5fc6fc9881...ac2165c11f)

---
updated-dependencies:
- dependency-name: thirdparty/eigen
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-25 18:00:47 +00:00
Jan
08fb6b0496
Merge pull request #386 from Laupetin/dependabot/submodules/thirdparty/catch2-76f70b1
chore(deps): bump thirdparty/catch2 from `914aeec` to `76f70b1`
2025-03-25 18:59:43 +01:00
dependabot[bot]
a871889c13
chore(deps): bump thirdparty/catch2 from 914aeec to 76f70b1
Bumps [thirdparty/catch2](https://github.com/catchorg/Catch2) from `914aeec` to `76f70b1`.
- [Release notes](https://github.com/catchorg/Catch2/releases)
- [Commits](914aeecfe2...76f70b1403)

---
updated-dependencies:
- dependency-name: thirdparty/catch2
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-25 17:36:11 +00:00
Jan
81bc21eacf
Merge pull request #384 from Laupetin/dependabot/submodules/thirdparty/libtomcrypt-a6b9aff
chore(deps): bump thirdparty/libtomcrypt from `d032686` to `a6b9aff`
2025-03-25 18:35:04 +01:00
dependabot[bot]
aec779dae5
chore(deps): bump thirdparty/libtomcrypt from d032686 to a6b9aff
Bumps [thirdparty/libtomcrypt](https://github.com/libtom/libtomcrypt) from `d032686` to `a6b9aff`.
- [Release notes](https://github.com/libtom/libtomcrypt/releases)
- [Commits](d032686639...a6b9aff7aa)

---
updated-dependencies:
- dependency-name: thirdparty/libtomcrypt
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-25 17:11:32 +00:00
Jan
97c4a23d5e
Merge pull request #392 from Laupetin/fix/compilation-on-windows
fix: compilation on msvc
2025-03-25 18:09:57 +01:00
Jan
0c587e5e5f
fix: compilation on msvc 2025-03-25 17:38:07 +01:00
Jan
4ac38bfc66
Merge pull request #376 from Laupetin/dependabot/submodules/thirdparty/json-8215dba
chore(deps): bump thirdparty/json from `606b634` to `8215dba`
2025-02-22 17:31:01 +01:00
Jan
34a0bd4f4f
Merge pull request #377 from Laupetin/dependabot/submodules/thirdparty/zlib-5a82f71
chore(deps): bump thirdparty/zlib from `7108497` to `5a82f71`
2025-02-22 17:30:53 +01:00
Jan
047e8aa125
Merge pull request #378 from Laupetin/dependabot/submodules/thirdparty/eigen-5fc6fc9
chore(deps): bump thirdparty/eigen from `9c21143` to `5fc6fc9`
2025-02-22 17:30:45 +01:00
Jan
b5303475d9
Merge pull request #379 from Laupetin/dependabot/submodules/thirdparty/libtomcrypt-d032686
chore(deps): bump thirdparty/libtomcrypt from `54f0456` to `d032686`
2025-02-22 17:30:38 +01:00
dependabot[bot]
4adc9115b2
chore(deps): bump thirdparty/libtomcrypt from 54f0456 to d032686
Bumps [thirdparty/libtomcrypt](https://github.com/libtom/libtomcrypt) from `54f0456` to `d032686`.
- [Release notes](https://github.com/libtom/libtomcrypt/releases)
- [Commits](54f0456559...d032686639)

---
updated-dependencies:
- dependency-name: thirdparty/libtomcrypt
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-21 22:39:15 +00:00
dependabot[bot]
a4347b0b0d
chore(deps): bump thirdparty/zlib from 7108497 to 5a82f71
Bumps [thirdparty/zlib](https://github.com/madler/zlib) from `7108497` to `5a82f71`.
- [Release notes](https://github.com/madler/zlib/releases)
- [Commits](7108497fda...5a82f71ed1)

---
updated-dependencies:
- dependency-name: thirdparty/zlib
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-21 22:39:13 +00:00
dependabot[bot]
4e5c72d79a
chore(deps): bump thirdparty/eigen from 9c21143 to 5fc6fc9
Bumps [thirdparty/eigen](https://gitlab.com/libeigen/eigen) from `9c21143` to `5fc6fc9`.
- [Release notes](https://gitlab.com/libeigen/eigen/tags)
- [Commits](9c211430b5...5fc6fc9881)

---
updated-dependencies:
- dependency-name: thirdparty/eigen
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-21 22:39:12 +00:00
dependabot[bot]
58f5f66dcf
chore(deps): bump thirdparty/json from 606b634 to 8215dba
Bumps [thirdparty/json](https://github.com/nlohmann/json) from `606b634` to `8215dba`.
- [Release notes](https://github.com/nlohmann/json/releases)
- [Commits](606b6347ed...8215dbafbd)

---
updated-dependencies:
- dependency-name: thirdparty/json
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-21 22:39:10 +00:00
Jan
54d19dcc8a
Merge pull request #373 from Laupetin/dependabot/submodules/thirdparty/eigen-9c21143
chore(deps): bump thirdparty/eigen from `715deac` to `9c21143`
2025-02-14 23:23:02 +01:00
Jan
f05a21984a
Merge pull request #374 from Laupetin/dependabot/submodules/thirdparty/zlib-7108497
chore(deps): bump thirdparty/zlib from `8a844d4` to `7108497`
2025-02-14 23:22:40 +01:00
dependabot[bot]
b071beea3f
chore(deps): bump thirdparty/zlib from 8a844d4 to 7108497
Bumps [thirdparty/zlib](https://github.com/madler/zlib) from `8a844d4` to `7108497`.
- [Release notes](https://github.com/madler/zlib/releases)
- [Commits](8a844d434f...7108497fda)

---
updated-dependencies:
- dependency-name: thirdparty/zlib
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-14 22:01:47 +00:00
dependabot[bot]
548c0c23bf
chore(deps): bump thirdparty/eigen from 715deac to 9c21143
Bumps [thirdparty/eigen](https://gitlab.com/libeigen/eigen) from `715deac` to `9c21143`.
- [Release notes](https://gitlab.com/libeigen/eigen/tags)
- [Commits](715deac188...9c211430b5)

---
updated-dependencies:
- dependency-name: thirdparty/eigen
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-14 22:01:45 +00:00
Jan
6d186bc09c
Merge pull request #372 from Laupetin/dependabot/submodules/thirdparty/eigen-715deac
chore(deps): bump thirdparty/eigen from `9589cc4` to `715deac`
2025-02-08 17:57:32 +01:00
Jan
96dc2c9318
Merge pull request #371 from Laupetin/dependabot/submodules/thirdparty/zlib-8a844d4
chore(deps): bump thirdparty/zlib from `ef24c4c` to `8a844d4`
2025-02-08 17:57:20 +01:00
dependabot[bot]
e4c08e1372
chore(deps): bump thirdparty/eigen from 9589cc4 to 715deac
Bumps [thirdparty/eigen](https://gitlab.com/libeigen/eigen) from `9589cc4` to `715deac`.
- [Release notes](https://gitlab.com/libeigen/eigen/tags)
- [Commits](9589cc4e7f...715deac188)

---
updated-dependencies:
- dependency-name: thirdparty/eigen
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-07 22:44:15 +00:00
dependabot[bot]
1b6824f2bd
chore(deps): bump thirdparty/zlib from ef24c4c to 8a844d4
Bumps [thirdparty/zlib](https://github.com/madler/zlib) from `ef24c4c` to `8a844d4`.
- [Release notes](https://github.com/madler/zlib/releases)
- [Commits](ef24c4c750...8a844d434f)

---
updated-dependencies:
- dependency-name: thirdparty/zlib
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-02-07 22:44:14 +00:00
Jan
0eb0383051
Merge pull request #370 from Laupetin/dependabot/submodules/thirdparty/eigen-9589cc4
chore(deps): bump thirdparty/eigen from `4a6ac97` to `9589cc4`
2025-02-01 17:18:26 +01:00
Jan
222d96a923
Merge pull request #369 from Laupetin/dependabot/submodules/thirdparty/json-606b634
chore(deps): bump thirdparty/json from `d0789e3` to `606b634`
2025-02-01 17:18:07 +01:00
Jan
07dccbf2f8
Merge pull request #368 from Laupetin/dependabot/submodules/thirdparty/libtomcrypt-54f0456
chore(deps): bump thirdparty/libtomcrypt from `427e055` to `54f0456`
2025-02-01 17:17:45 +01:00
Jan
b24b6b1979
Merge pull request #367 from Laupetin/dependabot/submodules/thirdparty/libtommath-5938524
chore(deps): bump thirdparty/libtommath from `5809141` to `5938524`
2025-02-01 17:17:22 +01:00
dependabot[bot]
a220142e86
chore(deps): bump thirdparty/eigen from 4a6ac97 to 9589cc4
Bumps [thirdparty/eigen](https://gitlab.com/libeigen/eigen) from `4a6ac97` to `9589cc4`.
- [Release notes](https://gitlab.com/libeigen/eigen/tags)
- [Commits](4a6ac97d13...9589cc4e7f)

---
updated-dependencies:
- dependency-name: thirdparty/eigen
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-31 22:38:54 +00:00
dependabot[bot]
4c30bd129a
chore(deps): bump thirdparty/json from d0789e3 to 606b634
Bumps [thirdparty/json](https://github.com/nlohmann/json) from `d0789e3` to `606b634`.
- [Release notes](https://github.com/nlohmann/json/releases)
- [Commits](d0789e365d...606b6347ed)

---
updated-dependencies:
- dependency-name: thirdparty/json
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-31 22:38:51 +00:00
dependabot[bot]
3d3a0ca565
chore(deps): bump thirdparty/libtomcrypt from 427e055 to 54f0456
Bumps [thirdparty/libtomcrypt](https://github.com/libtom/libtomcrypt) from `427e055` to `54f0456`.
- [Release notes](https://github.com/libtom/libtomcrypt/releases)
- [Commits](427e0551c0...54f0456559)

---
updated-dependencies:
- dependency-name: thirdparty/libtomcrypt
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-31 22:38:49 +00:00
dependabot[bot]
903bd5a960
chore(deps): bump thirdparty/libtommath from 5809141 to 5938524
Bumps [thirdparty/libtommath](https://github.com/libtom/libtommath) from `5809141` to `5938524`.
- [Release notes](https://github.com/libtom/libtommath/releases)
- [Commits](5809141a3a...5938524c60)

---
updated-dependencies:
- dependency-name: thirdparty/libtommath
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-31 22:38:47 +00:00
Jan
2402d4f9c7
Merge pull request #364 from Laupetin/dependabot/submodules/thirdparty/json-d0789e3
chore(deps): bump thirdparty/json from `e72046e` to `d0789e3`
2025-01-25 00:30:50 +01:00
Jan
a21b410fd7
Merge pull request #363 from Laupetin/dependabot/submodules/thirdparty/libtomcrypt-427e055
chore(deps): bump thirdparty/libtomcrypt from `2e9f2b5` to `427e055`
2025-01-25 00:30:38 +01:00
Jan
2b1ade2b5a
Merge pull request #362 from Laupetin/dependabot/submodules/thirdparty/eigen-4a6ac97
chore(deps): bump thirdparty/eigen from `abac563` to `4a6ac97`
2025-01-25 00:30:24 +01:00
dependabot[bot]
d869de5881
chore(deps): bump thirdparty/json from e72046e to d0789e3
Bumps [thirdparty/json](https://github.com/nlohmann/json) from `e72046e` to `d0789e3`.
- [Release notes](https://github.com/nlohmann/json/releases)
- [Commits](e72046ef9f...d0789e365d)

---
updated-dependencies:
- dependency-name: thirdparty/json
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-24 22:12:59 +00:00
dependabot[bot]
2ce1a4e050
chore(deps): bump thirdparty/libtomcrypt from 2e9f2b5 to 427e055
Bumps [thirdparty/libtomcrypt](https://github.com/libtom/libtomcrypt) from `2e9f2b5` to `427e055`.
- [Release notes](https://github.com/libtom/libtomcrypt/releases)
- [Commits](2e9f2b5e44...427e0551c0)

---
updated-dependencies:
- dependency-name: thirdparty/libtomcrypt
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-24 22:12:57 +00:00
dependabot[bot]
89e22329f8
chore(deps): bump thirdparty/eigen from abac563 to 4a6ac97
Bumps [thirdparty/eigen](https://gitlab.com/libeigen/eigen) from `abac563` to `4a6ac97`.
- [Release notes](https://gitlab.com/libeigen/eigen/tags)
- [Commits](abac563f5d...4a6ac97d13)

---
updated-dependencies:
- dependency-name: thirdparty/eigen
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-24 22:12:55 +00:00
62 changed files with 299 additions and 243 deletions

View File

@ -177,7 +177,7 @@ The following section specify which assets are supported to be dumped to disk (u
| ComWorld | ❌ | ❌ | |
| GameWorldSp | ❌ | ❌ | |
| GameWorldMp | ❌ | ❌ | |
| MapEnts | | ❌ | |
| MapEnts | | ❌ | |
| GfxWorld | ❌ | ❌ | |
| GfxLightDef | ❌ | ❌ | |
| Font_s | ❌ | ❌ | |

View File

@ -16,7 +16,7 @@ workspace "OpenAssetTools"
objdir "%{wks.location}/obj"
symbols "On"
systemversion "latest"
cppdialect "C++20"
cppdialect "C++23"
largeaddressaware "on"
flags {
@ -54,6 +54,10 @@ workspace "OpenAssetTools"
symbols "On"
filter {}
filter {"system:windows", "configurations:Debug" }
buildoptions { "/bigobj" }
filter {}
filter "configurations:Release"
defines "NDEBUG"
optimize "Full"

View File

@ -4,4 +4,6 @@
cd "$(dirname "$0")/.." || exit 2
make -C build -j$(nproc) config=debug_x86 clean
make -C build -j$(nproc) config=release_x86 clean
make -C build -j$(nproc) config=release_x86 clean
make -C build -j$(nproc) config=debug_x64 clean
make -C build -j$(nproc) config=release_x64 clean

6
scripts/make-debug-x64.sh Executable file
View File

@ -0,0 +1,6 @@
#!/bin/bash
# Go to repository root
cd "$(dirname "$0")/.." || exit 2
make -C build -j$(nproc) config=debug_x64 all

View File

@ -3,4 +3,4 @@
# Go to repository root
cd "$(dirname "$0")/.." || exit 2
make -C build -j$(nproc) config=debug_x86 all
make -C build -j$(nproc) config=debug_x86 all

7
scripts/make-release-x64.sh Executable file
View File

@ -0,0 +1,7 @@
#!/bin/bash
# Go to repository root
cd "$(dirname "$0")/.." || exit 2
echo "Start building with $(nproc) threads"
make -C build -j$(nproc) config=release_x64 all

View File

@ -4,4 +4,4 @@
cd "$(dirname "$0")/.." || exit 2
echo "Start building with $(nproc) threads"
make -C build -j$(nproc) config=release_x86 all
make -C build -j$(nproc) config=release_x86 all

View File

@ -3814,7 +3814,8 @@ namespace T6
uint16_t dynEntId;
};
union gcc_align(8) __m128
// Usually __m128, but that is not portable
union gcc_align(8) custom_m128
{
float m128_f32[4];
uint64_t m128_u64[2];
@ -3827,19 +3828,12 @@ namespace T6
unsigned int m128_u32[4];
};
struct vector3
{
__m128 x;
__m128 y;
__m128 z;
};
struct vector4
{
__m128 x;
__m128 y;
__m128 z;
__m128 w;
custom_m128 x;
custom_m128 y;
custom_m128 z;
custom_m128 w;
};
struct type_align(16) SSkinInstance

View File

@ -1,5 +1,6 @@
#pragma once
#include <cstdint>
#include <limits>
struct ZoneHeader
{
@ -7,21 +8,11 @@ struct ZoneHeader
uint32_t m_version;
};
#ifdef ARCH_x64
typedef uint32_t scr_string_t;
typedef uint64_t xchunk_size_t;
typedef uint64_t xblock_size_t;
typedef uint64_t zone_pointer_t;
constexpr uint16_t SCR_STRING_MAX = UINT32_MAX;
#elif ARCH_x86
typedef uint16_t scr_string_t;
typedef uint32_t xchunk_size_t;
typedef uint32_t xblock_size_t;
typedef uint32_t zone_pointer_t;
constexpr uint16_t SCR_STRING_MAX = UINT16_MAX;
#endif
constexpr uint16_t SCR_STRING_MAX = std::numeric_limits<scr_string_t>::max();
typedef int block_t;
typedef int asset_type_t;

View File

@ -3,6 +3,7 @@
#include "SearchPath/IWD.h"
#include "SearchPath/SearchPathFilesystem.h"
#include "SearchPath/SearchPaths.h"
#include "Utils/StringUtils.h"
#include <cassert>
#include <cstdint>
@ -215,7 +216,10 @@ namespace
{
if (!curTemplate.CanRender(PROJECT_MASK) && curTemplate.CanRender(GAME_MASK))
{
auto renderedTemplate = curTemplate.Render(m_bin_dir, m_base_dir, projectName, GameId_Names[static_cast<unsigned>(game)]);
std::string gameName(GameId_Names[static_cast<unsigned>(game)]);
utils::MakeStringLowerCase(gameName);
auto renderedTemplate = curTemplate.Render(m_bin_dir, m_base_dir, projectName, gameName);
if (AddSearchPath(addedSearchPaths, searchPaths, renderedTemplate))
hasSearchPath = true;
}

View File

@ -16,7 +16,7 @@ namespace ipak_consts
static constexpr size_t IPAK_CHUNK_SIZE = 0x8000;
static constexpr size_t IPAK_CHUNK_COUNT_PER_READ = 0x8;
static constexpr uint32_t IPAK_COMMAND_DEFAULT_SIZE = 0x7F00;
static constexpr size_t IPAK_COMMAND_DEFAULT_SIZE = 0x7F00;
static constexpr uint32_t IPAK_COMMAND_UNCOMPRESSED = 0;
static constexpr uint32_t IPAK_COMMAND_COMPRESSED = 1;
static constexpr uint32_t IPAK_COMMAND_SKIP = 0xCF;

View File

@ -68,7 +68,7 @@ namespace
T result;
} data{};
const auto byteCount = utils::Align(bitCount, 8u) / 8u;
const auto byteCount = utils::Align(bitCount, 8uz) / 8uz;
assert(byteCount <= sizeof(T));
const auto shiftCount = (8u - bitCount % 8) % 8;
@ -83,7 +83,7 @@ namespace
while (remainingBits > 0)
{
const auto curBits = static_cast<uint8_t>(std::min(remainingBits, 8u));
const auto curBits = static_cast<uint8_t>(std::min(remainingBits, 8uz));
if (m_remaining_bits_last_byte > 0)
{

View File

@ -59,7 +59,7 @@ size_t CommonStructuredDataType::GetSizeInBits(const CommonStructuredDataDef& de
return 0u;
}
const auto& indexedArray = def.m_indexed_arrays[m_info.type_index];
return utils::Align(indexedArray.m_element_size_in_bits * indexedArray.m_element_count, 8u);
return utils::Align(indexedArray.m_element_size_in_bits * indexedArray.m_element_count, 8uz);
}
case CommonStructuredDataTypeCategory::ENUM_ARRAY:
{
@ -69,7 +69,7 @@ size_t CommonStructuredDataType::GetSizeInBits(const CommonStructuredDataDef& de
return 0u;
}
const auto& enumedArray = def.m_enumed_arrays[m_info.type_index];
return utils::Align(enumedArray.m_element_size_in_bits * enumedArray.m_element_count, 8u);
return utils::Align(enumedArray.m_element_size_in_bits * enumedArray.m_element_count, 8uz);
}
case CommonStructuredDataTypeCategory::UNKNOWN:

View File

@ -216,7 +216,7 @@ namespace
const auto remainingSize = dataSize - dataOffset;
const auto remainingChunkBufferWindowSize = std::max((ipak_consts::IPAK_CHUNK_COUNT_PER_READ * ipak_consts::IPAK_CHUNK_SIZE)
- static_cast<size_t>(m_current_offset - m_chunk_buffer_window_start),
0u);
0uz);
if (remainingChunkBufferWindowSize == 0)
{

View File

@ -96,7 +96,6 @@ namespace
// collection.AddAssetCreator(std::make_unique<AssetLoaderSound>(memory));
// collection.AddAssetCreator(std::make_unique<AssetLoaderSoundCurve>(memory));
// collection.AddAssetCreator(std::make_unique<AssetLoaderLoadedSound>(memory));
// collection.AddAssetCreator(std::make_unique<AssetLoaderClipMap>(memory));
// collection.AddAssetCreator(std::make_unique<AssetLoaderClipMapPvs>(memory));
// collection.AddAssetCreator(std::make_unique<AssetLoaderComWorld>(memory));
// collection.AddAssetCreator(std::make_unique<AssetLoaderGameWorldSp>(memory));

View File

@ -135,8 +135,7 @@ namespace
// collection.AddAssetCreator(std::make_unique<AssetLoaderSound>(memory));
collection.AddAssetCreator(CreateSoundCurveLoader(memory, searchPath));
// collection.AddAssetCreator(std::make_unique<AssetLoaderLoadedSound>(memory));
// collection.AddAssetCreator(std::make_unique<AssetLoaderClipMapSp>(memory));
// collection.AddAssetCreator(std::make_unique<AssetLoaderClipMapMp>(memory));
// collection.AddAssetCreator(std::make_unique<AssetLoaderClipMap>(memory));
// collection.AddAssetCreator(std::make_unique<AssetLoaderComWorld>(memory));
// collection.AddAssetCreator(std::make_unique<AssetLoaderGameWorldSp>(memory));
// collection.AddAssetCreator(std::make_unique<AssetLoaderGameWorldMp>(memory));

View File

@ -53,15 +53,15 @@ namespace
case CommonStructuredDataTypeCategory::SHORT:
return {DATA_SHORT, {0}};
case CommonStructuredDataTypeCategory::STRING:
return {DATA_STRING, {inputType.m_info.string_length}};
return {DATA_STRING, {static_cast<unsigned>(inputType.m_info.string_length)}};
case CommonStructuredDataTypeCategory::ENUM:
return {DATA_ENUM, {inputType.m_info.type_index}};
return {DATA_ENUM, {static_cast<unsigned>(inputType.m_info.type_index)}};
case CommonStructuredDataTypeCategory::STRUCT:
return {DATA_STRUCT, {inputType.m_info.type_index}};
return {DATA_STRUCT, {static_cast<unsigned>(inputType.m_info.type_index)}};
case CommonStructuredDataTypeCategory::INDEXED_ARRAY:
return {DATA_INDEXED_ARRAY, {inputType.m_info.type_index}};
return {DATA_INDEXED_ARRAY, {static_cast<unsigned>(inputType.m_info.type_index)}};
case CommonStructuredDataTypeCategory::ENUM_ARRAY:
return {DATA_ENUM_ARRAY, {inputType.m_info.type_index}};
return {DATA_ENUM_ARRAY, {static_cast<unsigned>(inputType.m_info.type_index)}};
case CommonStructuredDataTypeCategory::UNKNOWN:
default:
assert(false);
@ -129,14 +129,14 @@ namespace
{
outputIndexedArray.arraySize = static_cast<int>(inputIndexedArray.m_element_count);
outputIndexedArray.elementType = ConvertType(inputIndexedArray.m_array_type);
outputIndexedArray.elementSize = utils::Align(inputIndexedArray.m_element_size_in_bits, 8u) / 8u;
outputIndexedArray.elementSize = utils::Align(inputIndexedArray.m_element_size_in_bits, 8uz) / 8uz;
}
void ConvertEnumedArray(const CommonStructuredDataEnumedArray& inputEnumedArray, StructuredDataEnumedArray& outputEnumedArray)
{
outputEnumedArray.enumIndex = static_cast<int>(inputEnumedArray.m_enum_index);
outputEnumedArray.elementType = ConvertType(inputEnumedArray.m_array_type);
outputEnumedArray.elementSize = utils::Align(inputEnumedArray.m_element_size_in_bits, 8u) / 8u;
outputEnumedArray.elementSize = utils::Align(inputEnumedArray.m_element_size_in_bits, 8uz) / 8uz;
}
void ConvertDef(const CommonStructuredDataDef& inputDef, StructuredDataDef& outputDef)

View File

@ -109,7 +109,6 @@ namespace
// collection.AddAssetCreator(std::make_unique<AssetLoaderImage>(memory));
// collection.AddAssetCreator(std::make_unique<AssetLoaderSoundBank>(memory));
// collection.AddAssetCreator(std::make_unique<AssetLoaderSoundPatch>(memory));
// collection.AddAssetCreator(std::make_unique<AssetLoaderClipMap>(memory));
// collection.AddAssetCreator(std::make_unique<AssetLoaderClipMapPvs>(memory));
// collection.AddAssetCreator(std::make_unique<AssetLoaderComWorld>(memory));
// collection.AddAssetCreator(std::make_unique<AssetLoaderGameWorldSp>(memory));

View File

@ -404,7 +404,6 @@ namespace T6
collection.AddAssetCreator(CreateImageLoader(memory, searchPath));
collection.AddAssetCreator(CreateSoundBankLoader(memory, searchPath));
// collection.AddAssetCreator(std::make_unique<AssetLoaderSoundPatch>(memory));
// collection.AddAssetCreator(std::make_unique<AssetLoaderClipMap>(memory));
// collection.AddAssetCreator(std::make_unique<AssetLoaderClipMapPvs>(memory));
// collection.AddAssetCreator(std::make_unique<AssetLoaderComWorld>(memory));
// collection.AddAssetCreator(std::make_unique<AssetLoaderGameWorldSp>(memory));

View File

@ -131,7 +131,7 @@ public:
sizeof(SoundAssetBankEntry),
sizeof(SoundAssetBankChecksum),
0x40,
m_entries.size(),
static_cast<unsigned>(m_entries.size()),
0,
0,
m_total_size,
@ -157,9 +157,9 @@ public:
SoundAssetBankEntry entry{
sound.m_sound_id,
soundSize,
static_cast<size_t>(m_current_offset),
frameCount,
static_cast<unsigned>(soundSize),
static_cast<unsigned>(m_current_offset),
static_cast<unsigned>(frameCount),
frameRateIndex,
static_cast<unsigned char>(header.formatChunk.nChannels),
sound.m_looping,
@ -188,8 +188,8 @@ public:
const auto frameRateIndex = INDEX_FOR_FRAMERATE[metaData.m_sample_rate];
SoundAssetBankEntry entry{
sound.m_sound_id,
soundSize,
static_cast<size_t>(m_current_offset),
static_cast<unsigned>(soundSize),
static_cast<unsigned>(m_current_offset),
static_cast<unsigned>(metaData.m_total_samples),
frameRateIndex,
metaData.m_number_of_channels,

View File

@ -240,7 +240,7 @@ namespace sdd::struct_scope_sequences
if (state->m_current_struct_is_root && state->m_current_struct->m_properties.empty())
state->m_current_struct_padding_offset -= 64u;
state->m_current_struct->m_size_in_byte = utils::Align(state->m_current_struct_padding_offset, 8u) / 8;
state->m_current_struct->m_size_in_byte = utils::Align(state->m_current_struct_padding_offset, 8uz) / 8;
state->m_current_struct_padding_offset = 0u;
state->m_current_struct_is_root = false;
state->m_current_struct = nullptr;

View File

@ -74,7 +74,7 @@ class StructuredDataDefSizeCalculatorInternal
m_type_stack.emplace_back(CommonStructuredDataTypeCategory::STRUCT, index);
auto currentOffset = 0u;
auto currentOffset = 0uz;
for (auto& property : _struct.m_properties)
{
CalculateForType(property.m_type);
@ -85,7 +85,7 @@ class StructuredDataDefSizeCalculatorInternal
currentOffset += property.m_type.GetSizeInBits(m_def);
}
currentOffset = utils::Align(currentOffset, 8u);
currentOffset = utils::Align(currentOffset, 8uz);
_struct.m_size_in_byte += currentOffset / 8;
m_struct_calculated[index] = true;

View File

@ -286,7 +286,7 @@ namespace
common.m_vertices.emplace_back(vertex);
XModelVertexBoneWeights vertexWeights{common.m_bone_weight_data.weights.size(), 0u};
XModelVertexBoneWeights vertexWeights{.weightOffset = static_cast<unsigned>(common.m_bone_weight_data.weights.size()), .weightCount = 0u};
for (auto i = 0u; i < std::extent_v<decltype(joints)>; i++)
{
if (std::abs(weights[i]) < std::numeric_limits<float>::epsilon())
@ -315,12 +315,12 @@ namespace
throw GltfLoadException("Requires primitives attribute POSITION");
AccessorsForVertex accessorsForVertex{
*primitives.attributes.POSITION,
primitives.attributes.NORMAL,
primitives.attributes.COLOR_0,
primitives.attributes.TEXCOORD_0,
primitives.attributes.JOINTS_0,
primitives.attributes.WEIGHTS_0,
.positionAccessor = *primitives.attributes.POSITION,
.normalAccessor = primitives.attributes.NORMAL,
.colorAccessor = primitives.attributes.COLOR_0,
.uvAccessor = primitives.attributes.TEXCOORD_0,
.jointsAccessor = primitives.attributes.JOINTS_0,
.weightsAccessor = primitives.attributes.WEIGHTS_0,
};
const auto existingVertices = m_vertex_offset_for_accessors.find(accessorsForVertex);
@ -328,7 +328,7 @@ namespace
existingVertices == m_vertex_offset_for_accessors.end() ? CreateVertices(common, accessorsForVertex) : existingVertices->second;
// clang-format off
auto* indexAccessor = GetAccessorForIndex(
const auto* indexAccessor = GetAccessorForIndex(
"INDICES",
primitives.indices,
{JsonAccessorType::SCALAR},
@ -552,7 +552,7 @@ namespace
common.m_bones.resize(skinBoneOffset + skin.joints.size());
constexpr float defaultTranslation[3]{0.0f, 0.0f, 0.0f};
constexpr XModelQuaternion defaultRotation{0.0f, 0.0f, 0.0f, 1.0f};
constexpr XModelQuaternion defaultRotation{.x = 0.0f, .y = 0.0f, .z = 0.0f, .w = 1.0f};
constexpr float defaultScale[3]{1.0f, 1.0f, 1.0f};
return ConvertJoint(jRoot, skin, common, skinBoneOffset, rootNode, std::nullopt, defaultTranslation, defaultRotation, defaultScale);

View File

@ -22,7 +22,6 @@
#include JSON_HEADER
#include "Asset/AssetRegistration.h"
#include "ObjLoading.h"
#include "Utils/QuatInt16.h"
#include "Utils/StringUtils.h"
#include "XModel/Gltf/GltfBinInput.h"
@ -44,7 +43,6 @@
#include <format>
#include <iostream>
#include <numeric>
#include <set>
#include <vector>
using namespace GAME;
@ -146,17 +144,17 @@ namespace
assert(common.m_vertex_bone_weights.size() == common.m_vertices.size());
XModelBone rootBone{
"root",
std::nullopt,
{1.0f, 1.0f, 1.0f},
{0.0f, 0.0f, 0.0f},
{0.0f, 0.0f, 0.0f},
{0.0f, 0.0f, 0.0f, 1.0f},
{0.0f, 0.0f, 0.0f, 1.0f},
.name = "root",
.parentIndex = std::nullopt,
.scale = {1.0f, 1.0f, 1.0f},
.globalOffset = {0.0f, 0.0f, 0.0f},
.localOffset = {0.0f, 0.0f, 0.0f},
.globalRotation = {.x = 0.0f, .y = 0.0f, .z = 0.0f, .w = 1.0f},
.localRotation = {.x = 0.0f, .y = 0.0f, .z = 0.0f, .w = 1.0f},
};
common.m_bones.emplace_back(rootBone);
XModelBoneWeight rootWeight{0, 1.0f};
XModelBoneWeight rootWeight{.boneIndex = 0, .weight = 1.0f};
common.m_bone_weight_data.weights.emplace_back(rootWeight);
for (auto& vertexBoneWeights : common.m_vertex_bone_weights)
@ -401,7 +399,7 @@ namespace
}
static std::vector<std::optional<size_t>>
GetRigidBoneIndicesForTris(const std::vector<size_t>& vertexIndices, XSurface& surface, const XModelCommon& common)
GetRigidBoneIndicesForTris(const std::vector<size_t>& vertexIndices, const XSurface& surface, const XModelCommon& common)
{
std::vector<std::optional<size_t>> rigidBoneIndexForTri;
rigidBoneIndexForTri.reserve(surface.triCount);
@ -422,7 +420,7 @@ namespace
return rigidBoneIndexForTri;
}
static void ReorderRigidTrisByBoneIndex(const std::vector<size_t>& vertexIndices, XSurface& surface, const XModelCommon& common)
static void ReorderRigidTrisByBoneIndex(const std::vector<size_t>& vertexIndices, const XSurface& surface, const XModelCommon& common)
{
const auto rigidBoneIndexForTri = GetRigidBoneIndicesForTris(vertexIndices, surface, common);
@ -456,17 +454,17 @@ namespace
surface.partBits[partBitsIndex] |= 1 << shiftValue;
}
void CreateVertListData(XSurface& surface, const std::vector<size_t>& vertexIndices, const XModelCommon& common) const
void CreateVertListData(XSurface& surface, const std::vector<size_t>& xmodelToCommonVertexIndexLookup, const XModelCommon& common) const
{
ReorderRigidTrisByBoneIndex(vertexIndices, surface, common);
const auto rigidBoneIndexForTri = GetRigidBoneIndicesForTris(vertexIndices, surface, common);
ReorderRigidTrisByBoneIndex(xmodelToCommonVertexIndexLookup, surface, common);
const auto rigidBoneIndexForTri = GetRigidBoneIndicesForTris(xmodelToCommonVertexIndexLookup, surface, common);
std::vector<XRigidVertList> vertLists;
auto currentVertexTail = 0u;
auto currentTriTail = 0u;
const auto vertexCount = vertexIndices.size();
const auto vertexCount = xmodelToCommonVertexIndexLookup.size();
const auto triCount = static_cast<size_t>(surface.triCount);
const auto boneCount = common.m_bones.size();
for (auto boneIndex = 0u; boneIndex < boneCount; boneIndex++)
@ -475,7 +473,7 @@ namespace
boneVertList.boneOffset = static_cast<uint16_t>(boneIndex * sizeof(DObjSkelMat));
auto currentVertexHead = currentVertexTail;
while (currentVertexHead < vertexCount && GetRigidBoneForVertex(currentVertexHead, common) == boneIndex)
while (currentVertexHead < vertexCount && GetRigidBoneForVertex(xmodelToCommonVertexIndexLookup[currentVertexHead], common) == boneIndex)
currentVertexHead++;
auto currentTriHead = currentTriTail;
@ -512,7 +510,7 @@ namespace
// TODO
}
static void ReorderVerticesByWeightCount(std::vector<size_t>& vertexIndices, XSurface& surface, const XModelCommon& common)
static void ReorderVerticesByWeightCount(std::vector<size_t>& vertexIndices, const XSurface& surface, const XModelCommon& common)
{
if (common.m_bone_weight_data.weights.empty())
return;
@ -541,13 +539,21 @@ namespace
return false;
});
std::vector<XSurfaceTri> preSortTris(surface.triCount);
std::memcpy(preSortTris.data(), surface.triIndices, sizeof(XSurfaceTri) * surface.triCount);
std::vector<size_t> reverseLookup(reorderLookup.size());
for (auto i = 0u; i < reverseLookup.size(); i++)
reverseLookup[reorderLookup[i]] = i;
for (auto triIndex = 0u; triIndex < surface.triCount; triIndex++)
{
const auto& preSortTriIndices = preSortTris[triIndex];
auto& triIndices = surface.triIndices[triIndex];
triIndices.i[0] = static_cast<uint16_t>(reorderLookup[triIndices.i[0]]);
triIndices.i[1] = static_cast<uint16_t>(reorderLookup[triIndices.i[1]]);
triIndices.i[2] = static_cast<uint16_t>(reorderLookup[triIndices.i[2]]);
triIndices.i[0] = static_cast<uint16_t>(reverseLookup[preSortTriIndices.i[0]]);
triIndices.i[1] = static_cast<uint16_t>(reverseLookup[preSortTriIndices.i[1]]);
triIndices.i[2] = static_cast<uint16_t>(reverseLookup[preSortTriIndices.i[2]]);
}
for (auto& entry : reorderLookup)
@ -572,6 +578,7 @@ namespace
surface.triCount = static_cast<uint16_t>(commonObject.m_faces.size());
surface.triIndices = m_memory.Alloc<XSurfaceTri>(surface.triCount);
xmodelToCommonVertexIndexLookup.reserve(static_cast<size_t>(surface.triCount) * std::extent_v<decltype(XModelFace::vertexIndex)>);
for (auto faceIndex = 0u; faceIndex < surface.triCount; faceIndex++)
{
const auto& face = commonObject.m_faces[faceIndex];
@ -594,8 +601,6 @@ namespace
}
}
ReorderVerticesByWeightCount(xmodelToCommonVertexIndexLookup, surface, common);
constexpr auto maxVertices = std::numeric_limits<decltype(XSurface::vertCount)>::max();
if (vertexOffset + xmodelToCommonVertexIndexLookup.size() > maxVertices)
{
@ -603,6 +608,8 @@ namespace
return false;
}
ReorderVerticesByWeightCount(xmodelToCommonVertexIndexLookup, surface, common);
surface.baseVertIndex = static_cast<uint16_t>(vertexOffset);
surface.vertCount = static_cast<uint16_t>(xmodelToCommonVertexIndexLookup.size());
surface.verts0 = m_memory.Alloc<GfxPackedVertex>(surface.vertCount);

View File

@ -284,7 +284,7 @@ namespace
const auto& vertList = surface.vertList[vertListIndex];
const auto boneWeightOffset = weightOffset;
weightCollection.weights[weightOffset++] = XModelBoneWeight{vertList.boneOffset / sizeof(DObjSkelMat), 1.0f};
weightCollection.weights[weightOffset++] = XModelBoneWeight{static_cast<unsigned>(vertList.boneOffset / sizeof(DObjSkelMat)), 1.0f};
for (auto vertListVertexOffset = 0u; vertListVertexOffset < vertList.vertCount; vertListVertexOffset++)
{
@ -301,7 +301,7 @@ namespace
for (auto vertIndex = 0; vertIndex < surface.vertInfo.vertCount[0]; vertIndex++)
{
const auto boneWeightOffset = weightOffset;
const auto boneIndex0 = surface.vertInfo.vertsBlend[vertsBlendOffset + 0] / sizeof(DObjSkelMat);
const unsigned boneIndex0 = surface.vertInfo.vertsBlend[vertsBlendOffset + 0] / sizeof(DObjSkelMat);
weightCollection.weights[weightOffset++] = XModelBoneWeight{boneIndex0, 1.0f};
vertsBlendOffset += 1;
@ -313,8 +313,8 @@ namespace
for (auto vertIndex = 0; vertIndex < surface.vertInfo.vertCount[1]; vertIndex++)
{
const auto boneWeightOffset = weightOffset;
const auto boneIndex0 = surface.vertInfo.vertsBlend[vertsBlendOffset + 0] / sizeof(DObjSkelMat);
const auto boneIndex1 = surface.vertInfo.vertsBlend[vertsBlendOffset + 1] / sizeof(DObjSkelMat);
const unsigned boneIndex0 = surface.vertInfo.vertsBlend[vertsBlendOffset + 0] / sizeof(DObjSkelMat);
const unsigned boneIndex1 = surface.vertInfo.vertsBlend[vertsBlendOffset + 1] / sizeof(DObjSkelMat);
const auto boneWeight1 = BoneWeight16(surface.vertInfo.vertsBlend[vertsBlendOffset + 2]);
const auto boneWeight0 = 1.0f - boneWeight1;
@ -330,10 +330,10 @@ namespace
for (auto vertIndex = 0; vertIndex < surface.vertInfo.vertCount[2]; vertIndex++)
{
const auto boneWeightOffset = weightOffset;
const auto boneIndex0 = surface.vertInfo.vertsBlend[vertsBlendOffset + 0] / sizeof(DObjSkelMat);
const auto boneIndex1 = surface.vertInfo.vertsBlend[vertsBlendOffset + 1] / sizeof(DObjSkelMat);
const unsigned boneIndex0 = surface.vertInfo.vertsBlend[vertsBlendOffset + 0] / sizeof(DObjSkelMat);
const unsigned boneIndex1 = surface.vertInfo.vertsBlend[vertsBlendOffset + 1] / sizeof(DObjSkelMat);
const auto boneWeight1 = BoneWeight16(surface.vertInfo.vertsBlend[vertsBlendOffset + 2]);
const auto boneIndex2 = surface.vertInfo.vertsBlend[vertsBlendOffset + 3] / sizeof(DObjSkelMat);
const unsigned boneIndex2 = surface.vertInfo.vertsBlend[vertsBlendOffset + 3] / sizeof(DObjSkelMat);
const auto boneWeight2 = BoneWeight16(surface.vertInfo.vertsBlend[vertsBlendOffset + 4]);
const auto boneWeight0 = 1.0f - boneWeight1 - boneWeight2;
@ -350,12 +350,12 @@ namespace
for (auto vertIndex = 0; vertIndex < surface.vertInfo.vertCount[3]; vertIndex++)
{
const auto boneWeightOffset = weightOffset;
const auto boneIndex0 = surface.vertInfo.vertsBlend[vertsBlendOffset + 0] / sizeof(DObjSkelMat);
const auto boneIndex1 = surface.vertInfo.vertsBlend[vertsBlendOffset + 1] / sizeof(DObjSkelMat);
const unsigned boneIndex0 = surface.vertInfo.vertsBlend[vertsBlendOffset + 0] / sizeof(DObjSkelMat);
const unsigned boneIndex1 = surface.vertInfo.vertsBlend[vertsBlendOffset + 1] / sizeof(DObjSkelMat);
const auto boneWeight1 = BoneWeight16(surface.vertInfo.vertsBlend[vertsBlendOffset + 2]);
const auto boneIndex2 = surface.vertInfo.vertsBlend[vertsBlendOffset + 3] / sizeof(DObjSkelMat);
const unsigned boneIndex2 = surface.vertInfo.vertsBlend[vertsBlendOffset + 3] / sizeof(DObjSkelMat);
const auto boneWeight2 = BoneWeight16(surface.vertInfo.vertsBlend[vertsBlendOffset + 4]);
const auto boneIndex3 = surface.vertInfo.vertsBlend[vertsBlendOffset + 5] / sizeof(DObjSkelMat);
const unsigned boneIndex3 = surface.vertInfo.vertsBlend[vertsBlendOffset + 5] / sizeof(DObjSkelMat);
const auto boneWeight3 = BoneWeight16(surface.vertInfo.vertsBlend[vertsBlendOffset + 6]);
const auto boneWeight0 = 1.0f - boneWeight1 - boneWeight2 - boneWeight3;

View File

@ -34,7 +34,7 @@ bool ObjWriter::DumpZone(AssetDumpingContext& context) const
// DUMP_ASSET_POOL(AssetDumpersnd_alias_list_t, m_sound, ASSET_TYPE_SOUND)
// DUMP_ASSET_POOL(AssetDumperSndCurve, m_sound_curve, ASSET_TYPE_SOUND_CURVE)
DUMP_ASSET_POOL(AssetDumperLoadedSound, m_loaded_sound, ASSET_TYPE_LOADED_SOUND)
// DUMP_ASSET_POOL(AssetDumperclipMap_t, m_clip_map, ASSET_TYPE_CLIPMAP)
// DUMP_ASSET_POOL(AssetDumperClipMap, m_clip_map, ASSET_TYPE_CLIPMAP_PVS)
// DUMP_ASSET_POOL(AssetDumperComWorld, m_com_world, ASSET_TYPE_COMWORLD)
// DUMP_ASSET_POOL(AssetDumperGameWorldSp, m_game_world_sp, ASSET_TYPE_GAMEWORLD_SP)
// DUMP_ASSET_POOL(AssetDumperGameWorldMp, m_game_world_mp, ASSET_TYPE_GAMEWORLD_MP)

View File

@ -37,22 +37,22 @@ CommonStructuredDataType AssetDumperStructuredDataDefSet::ConvertType(const Comm
case DATA_ENUM:
assert(!def->m_enums.empty());
out.m_category = CommonStructuredDataTypeCategory::ENUM;
out.m_info.type_index = std::max(std::min(static_cast<size_t>(in.u.enumIndex), def->m_enums.size() - 1u), 0u);
out.m_info.type_index = std::max(std::min(static_cast<size_t>(in.u.enumIndex), def->m_enums.size() - 1uz), 0uz);
break;
case DATA_STRUCT:
assert(!def->m_structs.empty());
out.m_category = CommonStructuredDataTypeCategory::STRUCT;
out.m_info.type_index = std::max(std::min(static_cast<size_t>(in.u.structIndex), def->m_structs.size() - 1u), 0u);
out.m_info.type_index = std::max(std::min(static_cast<size_t>(in.u.structIndex), def->m_structs.size() - 1uz), 0uz);
break;
case DATA_INDEXED_ARRAY:
assert(!def->m_indexed_arrays.empty());
out.m_category = CommonStructuredDataTypeCategory::INDEXED_ARRAY;
out.m_info.type_index = std::max(std::min(static_cast<size_t>(in.u.indexedArrayIndex), def->m_indexed_arrays.size() - 1u), 0u);
out.m_info.type_index = std::max(std::min(static_cast<size_t>(in.u.indexedArrayIndex), def->m_indexed_arrays.size() - 1uz), 0uz);
break;
case DATA_ENUM_ARRAY:
assert(!def->m_enumed_arrays.empty());
out.m_category = CommonStructuredDataTypeCategory::ENUM_ARRAY;
out.m_info.type_index = std::max(std::min(static_cast<size_t>(in.u.enumedArrayIndex), def->m_enumed_arrays.size() - 1u), 0u);
out.m_info.type_index = std::max(std::min(static_cast<size_t>(in.u.enumedArrayIndex), def->m_enumed_arrays.size() - 1uz), 0uz);
break;
case DATA_COUNT:
default:
@ -138,7 +138,7 @@ void AssetDumperStructuredDataDefSet::ConvertEnumedArray(const CommonStructuredD
assert(!def->m_enums.empty());
out->m_element_size_in_bits = in->elementType.type == DATA_BOOL ? 1 : in->elementSize * 8;
out->m_array_type = ConvertType(def, in->elementType);
out->m_enum_index = std::max(std::min(static_cast<size_t>(in->enumIndex), def->m_enums.size() - 1u), 0u);
out->m_enum_index = std::max(std::min(static_cast<size_t>(in->enumIndex), def->m_enums.size() - 1uz), 0uz);
if (def->m_enums.empty())
{

View File

@ -267,7 +267,7 @@ namespace
const auto& vertList = surface.vertList[vertListIndex];
const auto boneWeightOffset = weightOffset;
weightCollection.weights[weightOffset++] = XModelBoneWeight{vertList.boneOffset / sizeof(DObjSkelMat), 1.0f};
weightCollection.weights[weightOffset++] = XModelBoneWeight{static_cast<unsigned>(vertList.boneOffset / sizeof(DObjSkelMat)), 1.0f};
for (auto vertListVertexOffset = 0u; vertListVertexOffset < vertList.vertCount; vertListVertexOffset++)
{
@ -284,7 +284,7 @@ namespace
for (auto vertIndex = 0; vertIndex < surface.vertInfo.vertCount[0]; vertIndex++)
{
const auto boneWeightOffset = weightOffset;
const auto boneIndex0 = surface.vertInfo.vertsBlend[vertsBlendOffset + 0] / sizeof(DObjSkelMat);
const unsigned boneIndex0 = surface.vertInfo.vertsBlend[vertsBlendOffset + 0] / sizeof(DObjSkelMat);
weightCollection.weights[weightOffset++] = XModelBoneWeight{boneIndex0, 1.0f};
vertsBlendOffset += 1;
@ -296,8 +296,8 @@ namespace
for (auto vertIndex = 0; vertIndex < surface.vertInfo.vertCount[1]; vertIndex++)
{
const auto boneWeightOffset = weightOffset;
const auto boneIndex0 = surface.vertInfo.vertsBlend[vertsBlendOffset + 0] / sizeof(DObjSkelMat);
const auto boneIndex1 = surface.vertInfo.vertsBlend[vertsBlendOffset + 1] / sizeof(DObjSkelMat);
const unsigned boneIndex0 = surface.vertInfo.vertsBlend[vertsBlendOffset + 0] / sizeof(DObjSkelMat);
const unsigned boneIndex1 = surface.vertInfo.vertsBlend[vertsBlendOffset + 1] / sizeof(DObjSkelMat);
const auto boneWeight1 = BoneWeight16(surface.vertInfo.vertsBlend[vertsBlendOffset + 2]);
const auto boneWeight0 = 1.0f - boneWeight1;
@ -313,10 +313,10 @@ namespace
for (auto vertIndex = 0; vertIndex < surface.vertInfo.vertCount[2]; vertIndex++)
{
const auto boneWeightOffset = weightOffset;
const auto boneIndex0 = surface.vertInfo.vertsBlend[vertsBlendOffset + 0] / sizeof(DObjSkelMat);
const auto boneIndex1 = surface.vertInfo.vertsBlend[vertsBlendOffset + 1] / sizeof(DObjSkelMat);
const unsigned boneIndex0 = surface.vertInfo.vertsBlend[vertsBlendOffset + 0] / sizeof(DObjSkelMat);
const unsigned boneIndex1 = surface.vertInfo.vertsBlend[vertsBlendOffset + 1] / sizeof(DObjSkelMat);
const auto boneWeight1 = BoneWeight16(surface.vertInfo.vertsBlend[vertsBlendOffset + 2]);
const auto boneIndex2 = surface.vertInfo.vertsBlend[vertsBlendOffset + 3] / sizeof(DObjSkelMat);
const unsigned boneIndex2 = surface.vertInfo.vertsBlend[vertsBlendOffset + 3] / sizeof(DObjSkelMat);
const auto boneWeight2 = BoneWeight16(surface.vertInfo.vertsBlend[vertsBlendOffset + 4]);
const auto boneWeight0 = 1.0f - boneWeight1 - boneWeight2;
@ -333,12 +333,12 @@ namespace
for (auto vertIndex = 0; vertIndex < surface.vertInfo.vertCount[3]; vertIndex++)
{
const auto boneWeightOffset = weightOffset;
const auto boneIndex0 = surface.vertInfo.vertsBlend[vertsBlendOffset + 0] / sizeof(DObjSkelMat);
const auto boneIndex1 = surface.vertInfo.vertsBlend[vertsBlendOffset + 1] / sizeof(DObjSkelMat);
const unsigned boneIndex0 = surface.vertInfo.vertsBlend[vertsBlendOffset + 0] / sizeof(DObjSkelMat);
const unsigned boneIndex1 = surface.vertInfo.vertsBlend[vertsBlendOffset + 1] / sizeof(DObjSkelMat);
const auto boneWeight1 = BoneWeight16(surface.vertInfo.vertsBlend[vertsBlendOffset + 2]);
const auto boneIndex2 = surface.vertInfo.vertsBlend[vertsBlendOffset + 3] / sizeof(DObjSkelMat);
const unsigned boneIndex2 = surface.vertInfo.vertsBlend[vertsBlendOffset + 3] / sizeof(DObjSkelMat);
const auto boneWeight2 = BoneWeight16(surface.vertInfo.vertsBlend[vertsBlendOffset + 4]);
const auto boneIndex3 = surface.vertInfo.vertsBlend[vertsBlendOffset + 5] / sizeof(DObjSkelMat);
const unsigned boneIndex3 = surface.vertInfo.vertsBlend[vertsBlendOffset + 5] / sizeof(DObjSkelMat);
const auto boneWeight3 = BoneWeight16(surface.vertInfo.vertsBlend[vertsBlendOffset + 6]);
const auto boneWeight0 = 1.0f - boneWeight1 - boneWeight2 - boneWeight3;

View File

@ -50,7 +50,7 @@ bool ObjWriter::DumpZone(AssetDumpingContext& context) const
// DUMP_ASSET_POOL(AssetDumpersnd_alias_list_t, m_sound, ASSET_TYPE_SOUND)
DUMP_ASSET_POOL(AssetDumperSndCurve, m_sound_curve, ASSET_TYPE_SOUND_CURVE)
DUMP_ASSET_POOL(AssetDumperLoadedSound, m_loaded_sound, ASSET_TYPE_LOADED_SOUND)
// DUMP_ASSET_POOL(AssetDumperclipMap_t, m_clip_map, ASSET_TYPE_CLIPMAP_MP)
// DUMP_ASSET_POOL(AssetDumperClipMap, m_clip_map, ASSET_TYPE_CLIPMAP_MP)
// DUMP_ASSET_POOL(AssetDumperComWorld, m_com_world, ASSET_TYPE_COMWORLD)
// DUMP_ASSET_POOL(AssetDumperGameWorldSp, m_game_world_sp, ASSET_TYPE_GAMEWORLD_SP)
// DUMP_ASSET_POOL(AssetDumperGameWorldMp, m_game_world_mp, ASSET_TYPE_GAMEWORLD_MP)

View File

@ -35,7 +35,7 @@ bool ObjWriter::DumpZone(AssetDumpingContext& context) const
DUMP_ASSET_POOL(AssetDumperGfxImage, m_image, ASSET_TYPE_IMAGE)
// DUMP_ASSET_POOL(AssetDumperSndBank, m_sound_bank, ASSET_TYPE_SOUND)
// DUMP_ASSET_POOL(AssetDumperSndPatch, m_sound_patch, ASSET_TYPE_SOUND_PATCH)
// DUMP_ASSET_POOL(AssetDumperClipMap, m_clip_map, ASSET_TYPE_CLIPMAP)
// DUMP_ASSET_POOL(AssetDumperClipMap, m_clip_map, ASSET_TYPE_CLIPMAP_PVS)
// DUMP_ASSET_POOL(AssetDumperComWorld, m_com_world, ASSET_TYPE_COMWORLD)
// DUMP_ASSET_POOL(AssetDumperGameWorldSp, m_game_world_sp, ASSET_TYPE_GAMEWORLD_SP)
// DUMP_ASSET_POOL(AssetDumperGameWorldMp, m_game_world_mp, ASSET_TYPE_GAMEWORLD_MP)

View File

@ -0,0 +1,23 @@
#include "AssetDumperMapEnts.h"
#include <format>
using namespace T6;
bool AssetDumperMapEnts::ShouldDump(XAssetInfo<MapEnts>* asset)
{
return true;
}
void AssetDumperMapEnts::DumpAsset(AssetDumpingContext& context, XAssetInfo<MapEnts>* asset)
{
const auto* mapEnts = asset->Asset();
const auto mapEntsFile = context.OpenAssetFile(std::format("{}.ents", mapEnts->name));
if (!mapEntsFile)
return;
auto& stream = *mapEntsFile;
stream.write(mapEnts->entityString, mapEnts->numEntityChars - 1);
}

View File

@ -0,0 +1,14 @@
#pragma once
#include "Dumping/AbstractAssetDumper.h"
#include "Game/T6/T6.h"
namespace T6
{
class AssetDumperMapEnts final : public AbstractAssetDumper<MapEnts>
{
protected:
bool ShouldDump(XAssetInfo<MapEnts>* asset) override;
void DumpAsset(AssetDumpingContext& context, XAssetInfo<MapEnts>* asset) override;
};
} // namespace T6

View File

@ -110,7 +110,7 @@ namespace
"devraw/",
};
constexpr size_t FRAME_RATE_FOR_INDEX[]{
constexpr unsigned FRAME_RATE_FOR_INDEX[]{
8000,
12000,
16000,

View File

@ -4,6 +4,7 @@
#include "AssetDumpers/AssetDumperGfxImage.h"
#include "AssetDumpers/AssetDumperLeaderboardDef.h"
#include "AssetDumpers/AssetDumperLocalizeEntry.h"
#include "AssetDumpers/AssetDumperMapEnts.h"
#include "AssetDumpers/AssetDumperMaterial.h"
#include "AssetDumpers/AssetDumperPhysConstraints.h"
#include "AssetDumpers/AssetDumperPhysPreset.h"
@ -49,11 +50,11 @@ bool ObjWriter::DumpZone(AssetDumpingContext& context) const
DUMP_ASSET_POOL(AssetDumperGfxImage, m_image, ASSET_TYPE_IMAGE)
DUMP_ASSET_POOL(AssetDumperSndBank, m_sound_bank, ASSET_TYPE_SOUND)
// DUMP_ASSET_POOL(AssetDumperSndPatch, m_sound_patch, ASSET_TYPE_SOUND_PATCH)
// DUMP_ASSET_POOL(AssetDumperClipMap, m_clip_map, ASSET_TYPE_CLIPMAP)
// DUMP_ASSET_POOL(AssetDumperClipMap, m_clip_map, ASSET_TYPE_CLIPMAP_PVS)
// DUMP_ASSET_POOL(AssetDumperComWorld, m_com_world, ASSET_TYPE_COMWORLD)
// DUMP_ASSET_POOL(AssetDumperGameWorldSp, m_game_world_sp, ASSET_TYPE_GAMEWORLD_SP)
// DUMP_ASSET_POOL(AssetDumperGameWorldMp, m_game_world_mp, ASSET_TYPE_GAMEWORLD_MP)
// DUMP_ASSET_POOL(AssetDumperMapEnts, m_map_ents, ASSET_TYPE_MAP_ENTS)
DUMP_ASSET_POOL(AssetDumperMapEnts, m_map_ents, ASSET_TYPE_MAP_ENTS)
// DUMP_ASSET_POOL(AssetDumperGfxWorld, m_gfx_world, ASSET_TYPE_GFXWORLD)
// DUMP_ASSET_POOL(AssetDumperGfxLightDef, m_gfx_light_def, ASSET_TYPE_LIGHT_DEF)
// DUMP_ASSET_POOL(AssetDumperFont, m_font, ASSET_TYPE_FONT)

View File

@ -27,7 +27,7 @@ void WavWriter::WritePcmHeader(const WavMetaData& metaData, const size_t dataLen
};
m_stream.write(reinterpret_cast<const char*>(&formatChunk), sizeof(formatChunk));
const WavChunkHeader dataChunkHeader{WAV_CHUNK_ID_DATA, dataLen};
const WavChunkHeader dataChunkHeader{WAV_CHUNK_ID_DATA, static_cast<unsigned>(dataLen)};
m_stream.write(reinterpret_cast<const char*>(&dataChunkHeader), sizeof(dataChunkHeader));
}

View File

@ -139,7 +139,7 @@ void StructuredDataDefDumper::DumpType(const CommonStructuredDataDef& def,
void StructuredDataDefDumper::DumpProperty(const CommonStructuredDataDef& def,
const CommonStructuredDataStructProperty& property,
unsigned& currentOffsetInBit) const
size_t& currentOffsetInBit) const
{
std::string typeName;
std::vector<std::string> arraySpecifiers;
@ -205,11 +205,11 @@ void StructuredDataDefDumper::DumpStruct(const CommonStructuredDataDef& def, con
IncIndent();
auto currentOffsetInBit =
def.m_root_type.m_category == CommonStructuredDataTypeCategory::STRUCT && def.m_root_type.m_info.type_index == structIndex ? 64u : 0u;
def.m_root_type.m_category == CommonStructuredDataTypeCategory::STRUCT && def.m_root_type.m_info.type_index == structIndex ? 64uz : 0uz;
for (const auto& property : _struct.m_properties)
DumpProperty(def, property, currentOffsetInBit);
currentOffsetInBit = utils::Align(currentOffsetInBit, 8u);
currentOffsetInBit = utils::Align(currentOffsetInBit, 8uz);
if ((currentOffsetInBit / 8) < _struct.m_size_in_byte)
{
Indent();

View File

@ -17,7 +17,7 @@ class StructuredDataDefDumper : AbstractTextDumper
void DumpEnum(const CommonStructuredDataEnum& _enum);
void DumpType(const CommonStructuredDataDef& def, CommonStructuredDataType type, std::string& typeName, std::vector<std::string>& arraySpecifiers) const;
void DumpProperty(const CommonStructuredDataDef& def, const CommonStructuredDataStructProperty& property, unsigned& currentOffsetInBit) const;
void DumpProperty(const CommonStructuredDataDef& def, const CommonStructuredDataStructProperty& property, size_t& currentOffsetInBit) const;
void DumpStruct(const CommonStructuredDataDef& def, const CommonStructuredDataStruct& _struct, size_t structIndex);
public:

View File

@ -393,7 +393,8 @@ namespace
const auto& vertList = surface.vertList[vertListIndex];
const auto boneWeightOffset = weightOffset;
weightCollection.weights[weightOffset++] = XModelBoneWeight{.boneIndex = vertList.boneOffset / sizeof(DObjSkelMat), .weight = 1.0f};
weightCollection.weights[weightOffset++] =
XModelBoneWeight{.boneIndex = static_cast<unsigned>(vertList.boneOffset / sizeof(DObjSkelMat)), .weight = 1.0f};
for (auto vertListVertexOffset = 0u; vertListVertexOffset < vertList.vertCount; vertListVertexOffset++)
{
@ -410,7 +411,7 @@ namespace
for (auto vertIndex = 0; vertIndex < surface.vertInfo.vertCount[0]; vertIndex++)
{
const auto boneWeightOffset = weightOffset;
const auto boneIndex0 = surface.vertInfo.vertsBlend[vertsBlendOffset + 0] / sizeof(DObjSkelMat);
const unsigned boneIndex0 = surface.vertInfo.vertsBlend[vertsBlendOffset + 0] / sizeof(DObjSkelMat);
weightCollection.weights[weightOffset++] = XModelBoneWeight{.boneIndex = boneIndex0, .weight = 1.0f};
vertsBlendOffset += 1;
@ -422,8 +423,8 @@ namespace
for (auto vertIndex = 0; vertIndex < surface.vertInfo.vertCount[1]; vertIndex++)
{
const auto boneWeightOffset = weightOffset;
const auto boneIndex0 = surface.vertInfo.vertsBlend[vertsBlendOffset + 0] / sizeof(DObjSkelMat);
const auto boneIndex1 = surface.vertInfo.vertsBlend[vertsBlendOffset + 1] / sizeof(DObjSkelMat);
const unsigned boneIndex0 = surface.vertInfo.vertsBlend[vertsBlendOffset + 0] / sizeof(DObjSkelMat);
const unsigned boneIndex1 = surface.vertInfo.vertsBlend[vertsBlendOffset + 1] / sizeof(DObjSkelMat);
const auto boneWeight1 = BoneWeight16(surface.vertInfo.vertsBlend[vertsBlendOffset + 2]);
const auto boneWeight0 = 1.0f - boneWeight1;
@ -439,10 +440,10 @@ namespace
for (auto vertIndex = 0; vertIndex < surface.vertInfo.vertCount[2]; vertIndex++)
{
const auto boneWeightOffset = weightOffset;
const auto boneIndex0 = surface.vertInfo.vertsBlend[vertsBlendOffset + 0] / sizeof(DObjSkelMat);
const auto boneIndex1 = surface.vertInfo.vertsBlend[vertsBlendOffset + 1] / sizeof(DObjSkelMat);
const unsigned boneIndex0 = surface.vertInfo.vertsBlend[vertsBlendOffset + 0] / sizeof(DObjSkelMat);
const unsigned boneIndex1 = surface.vertInfo.vertsBlend[vertsBlendOffset + 1] / sizeof(DObjSkelMat);
const auto boneWeight1 = BoneWeight16(surface.vertInfo.vertsBlend[vertsBlendOffset + 2]);
const auto boneIndex2 = surface.vertInfo.vertsBlend[vertsBlendOffset + 3] / sizeof(DObjSkelMat);
const unsigned boneIndex2 = surface.vertInfo.vertsBlend[vertsBlendOffset + 3] / sizeof(DObjSkelMat);
const auto boneWeight2 = BoneWeight16(surface.vertInfo.vertsBlend[vertsBlendOffset + 4]);
const auto boneWeight0 = 1.0f - boneWeight1 - boneWeight2;
@ -459,12 +460,12 @@ namespace
for (auto vertIndex = 0; vertIndex < surface.vertInfo.vertCount[3]; vertIndex++)
{
const auto boneWeightOffset = weightOffset;
const auto boneIndex0 = surface.vertInfo.vertsBlend[vertsBlendOffset + 0] / sizeof(DObjSkelMat);
const auto boneIndex1 = surface.vertInfo.vertsBlend[vertsBlendOffset + 1] / sizeof(DObjSkelMat);
const unsigned boneIndex0 = surface.vertInfo.vertsBlend[vertsBlendOffset + 0] / sizeof(DObjSkelMat);
const unsigned boneIndex1 = surface.vertInfo.vertsBlend[vertsBlendOffset + 1] / sizeof(DObjSkelMat);
const auto boneWeight1 = BoneWeight16(surface.vertInfo.vertsBlend[vertsBlendOffset + 2]);
const auto boneIndex2 = surface.vertInfo.vertsBlend[vertsBlendOffset + 3] / sizeof(DObjSkelMat);
const unsigned boneIndex2 = surface.vertInfo.vertsBlend[vertsBlendOffset + 3] / sizeof(DObjSkelMat);
const auto boneWeight2 = BoneWeight16(surface.vertInfo.vertsBlend[vertsBlendOffset + 4]);
const auto boneIndex3 = surface.vertInfo.vertsBlend[vertsBlendOffset + 5] / sizeof(DObjSkelMat);
const unsigned boneIndex3 = surface.vertInfo.vertsBlend[vertsBlendOffset + 5] / sizeof(DObjSkelMat);
const auto boneWeight3 = BoneWeight16(surface.vertInfo.vertsBlend[vertsBlendOffset + 6]);
const auto boneWeight0 = 1.0f - boneWeight1 - boneWeight2 - boneWeight3;
@ -569,7 +570,7 @@ namespace
void DumpXModelExportLod(const XModelCommon& common, const AssetDumpingContext& context, const XAssetInfo<XModel>* asset, const unsigned lod)
{
const auto* model = asset->Asset();
const auto assetFile = context.OpenAssetFile(GetFileNameForLod(model->name, lod, ".XMODEL_EXPORT"));
const auto assetFile = context.OpenAssetFile(GetFileNameForLod(model->name, lod, ".xmodel_export"));
if (!assetFile)
return;
@ -664,13 +665,13 @@ namespace
switch (ObjWriting::Configuration.ModelOutputFormat)
{
case ObjWriting::Configuration_t::ModelOutputFormat_e::XMODEL_EXPORT:
return ".XMODEL_EXPORT";
return ".xmodel_export";
case ObjWriting::Configuration_t::ModelOutputFormat_e::OBJ:
return ".OBJ";
return ".obj";
case ObjWriting::Configuration_t::ModelOutputFormat_e::GLTF:
return ".GLTF";
return ".gltf";
case ObjWriting::Configuration_t::ModelOutputFormat_e::GLB:
return ".GLB";
return ".glb";
default:
assert(false);
return "";

View File

@ -1,11 +1,11 @@
#include "AbstractDirectiveStreamProxy.h"
TokenPos AbstractDirectiveStreamProxy::CreatePos(const ParserLine& line, const unsigned position)
TokenPos AbstractDirectiveStreamProxy::CreatePos(const ParserLine& line, const size_t position)
{
return TokenPos(*line.m_filename, line.m_line_number, static_cast<int>(position + 1));
}
bool AbstractDirectiveStreamProxy::SkipWhitespace(const ParserLine& line, unsigned& position)
bool AbstractDirectiveStreamProxy::SkipWhitespace(const ParserLine& line, size_t& position)
{
while (true)
{
@ -21,7 +21,7 @@ bool AbstractDirectiveStreamProxy::SkipWhitespace(const ParserLine& line, unsign
return true;
}
bool AbstractDirectiveStreamProxy::ExtractInteger(const ParserLine& line, unsigned& position, int& value)
bool AbstractDirectiveStreamProxy::ExtractInteger(const ParserLine& line, size_t& position, int& value)
{
if (position >= line.m_line.size())
return false;
@ -40,7 +40,7 @@ bool AbstractDirectiveStreamProxy::ExtractInteger(const ParserLine& line, unsign
return false;
}
bool AbstractDirectiveStreamProxy::ExtractIdentifier(const ParserLine& line, unsigned& position)
bool AbstractDirectiveStreamProxy::ExtractIdentifier(const ParserLine& line, size_t& position)
{
auto firstChar = true;
while (true)
@ -60,7 +60,7 @@ bool AbstractDirectiveStreamProxy::ExtractIdentifier(const ParserLine& line, uns
}
}
bool AbstractDirectiveStreamProxy::MatchCharacter(const ParserLine& line, unsigned& position, char c)
bool AbstractDirectiveStreamProxy::MatchCharacter(const ParserLine& line, size_t& position, char c)
{
if (position < line.m_line.size() && line.m_line[position] == c)
{
@ -71,12 +71,12 @@ bool AbstractDirectiveStreamProxy::MatchCharacter(const ParserLine& line, unsign
return false;
}
bool AbstractDirectiveStreamProxy::MatchNextCharacter(const ParserLine& line, unsigned& position, char c)
bool AbstractDirectiveStreamProxy::MatchNextCharacter(const ParserLine& line, size_t& position, char c)
{
return SkipWhitespace(line, position) && MatchCharacter(line, position, c);
}
bool AbstractDirectiveStreamProxy::MatchString(const ParserLine& line, unsigned& position, const char* str, unsigned len)
bool AbstractDirectiveStreamProxy::MatchString(const ParserLine& line, size_t& position, const char* str, size_t len)
{
if (line.m_line.compare(position, len, str) == 0)
{
@ -87,12 +87,12 @@ bool AbstractDirectiveStreamProxy::MatchString(const ParserLine& line, unsigned&
return false;
}
bool AbstractDirectiveStreamProxy::MatchNextString(const ParserLine& line, unsigned& position, const char* str, unsigned len)
bool AbstractDirectiveStreamProxy::MatchNextString(const ParserLine& line, size_t& position, const char* str, size_t len)
{
return SkipWhitespace(line, position) && MatchString(line, position, str, len);
}
bool AbstractDirectiveStreamProxy::FindDirective(const ParserLine& line, unsigned& directiveStartPosition, unsigned& directiveEndPos)
bool AbstractDirectiveStreamProxy::FindDirective(const ParserLine& line, size_t& directiveStartPosition, size_t& directiveEndPos)
{
directiveStartPosition = 0;
for (; directiveStartPosition < line.m_line.size(); directiveStartPosition++)

View File

@ -3,20 +3,22 @@
#include "Parsing/IParserLineStream.h"
#include "Parsing/TokenPos.h"
#include <cstddef>
class AbstractDirectiveStreamProxy : public IParserLineStream
{
protected:
AbstractDirectiveStreamProxy() = default;
static TokenPos CreatePos(const ParserLine& line, unsigned position);
static TokenPos CreatePos(const ParserLine& line, size_t position);
static bool SkipWhitespace(const ParserLine& line, unsigned& position);
static bool ExtractInteger(const ParserLine& line, unsigned& position, int& value);
static bool ExtractIdentifier(const ParserLine& line, unsigned& position);
static bool MatchCharacter(const ParserLine& line, unsigned& position, char c);
static bool MatchNextCharacter(const ParserLine& line, unsigned& position, char c);
static bool MatchString(const ParserLine& line, unsigned& position, const char* str, unsigned len);
static bool MatchNextString(const ParserLine& line, unsigned& position, const char* str, unsigned len);
static bool SkipWhitespace(const ParserLine& line, size_t& position);
static bool ExtractInteger(const ParserLine& line, size_t& position, int& value);
static bool ExtractIdentifier(const ParserLine& line, size_t& position);
static bool MatchCharacter(const ParserLine& line, size_t& position, char c);
static bool MatchNextCharacter(const ParserLine& line, size_t& position, char c);
static bool MatchString(const ParserLine& line, size_t& position, const char* str, size_t len);
static bool MatchNextString(const ParserLine& line, size_t& position, const char* str, size_t len);
static bool FindDirective(const ParserLine& line, unsigned& directiveStartPosition, unsigned& directiveEndPos);
static bool FindDirective(const ParserLine& line, size_t& directiveStartPosition, size_t& directiveEndPos);
};

View File

@ -14,12 +14,12 @@
namespace
{
bool IsStringizeParameterForwardLookup(const std::string& value, unsigned pos)
bool IsStringizeParameterForwardLookup(const std::string& value, size_t pos)
{
return pos + 1 && (isalpha(value[pos + 1]) || value[pos + 1] == '_');
}
bool IsTokenPastingOperatorForwardLookup(const std::string& value, unsigned pos)
bool IsTokenPastingOperatorForwardLookup(const std::string& value, size_t pos)
{
return pos + 1 < value.size() && value[pos + 1] == '#';
}
@ -32,7 +32,7 @@ DefinesStreamProxy::DefineParameterPosition::DefineParameterPosition()
{
}
DefinesStreamProxy::DefineParameterPosition::DefineParameterPosition(const unsigned index, const unsigned position, const bool stringize)
DefinesStreamProxy::DefineParameterPosition::DefineParameterPosition(const unsigned index, const size_t position, const bool stringize)
: m_parameter_index(index),
m_parameter_position(position),
m_stringize(stringize)
@ -175,7 +175,7 @@ int DefinesStreamProxy::GetLineEndEscapePos(const ParserLine& line)
return -1;
}
void DefinesStreamProxy::ContinueDefine(const ParserLine& line, const unsigned currentPos)
void DefinesStreamProxy::ContinueDefine(const ParserLine& line, const size_t currentPos)
{
const auto lineEndEscapePos = GetLineEndEscapePos(line);
if (lineEndEscapePos < 0)
@ -204,7 +204,7 @@ void DefinesStreamProxy::ContinueDefine(const ParserLine& line, const unsigned c
}
}
void DefinesStreamProxy::ContinueParameters(const ParserLine& line, unsigned& currentPos)
void DefinesStreamProxy::ContinueParameters(const ParserLine& line, size_t& currentPos)
{
const auto lineEndEscapePos = GetLineEndEscapePos(line);
while (true)
@ -241,7 +241,7 @@ void DefinesStreamProxy::ContinueParameters(const ParserLine& line, unsigned& cu
}
}
void DefinesStreamProxy::MatchDefineParameters(const ParserLine& line, unsigned& currentPos)
void DefinesStreamProxy::MatchDefineParameters(const ParserLine& line, size_t& currentPos)
{
m_current_define_parameters = std::vector<std::string>();
if (line.m_line[currentPos] != '(')
@ -253,7 +253,7 @@ void DefinesStreamProxy::MatchDefineParameters(const ParserLine& line, unsigned&
ContinueParameters(line, currentPos);
}
bool DefinesStreamProxy::MatchDefineDirective(const ParserLine& line, const unsigned directiveStartPosition, const unsigned directiveEndPosition)
bool DefinesStreamProxy::MatchDefineDirective(const ParserLine& line, const size_t directiveStartPosition, const size_t directiveEndPosition)
{
auto currentPos = directiveStartPosition;
@ -284,7 +284,7 @@ bool DefinesStreamProxy::MatchDefineDirective(const ParserLine& line, const unsi
return true;
}
bool DefinesStreamProxy::MatchUndefDirective(const ParserLine& line, const unsigned directiveStartPosition, const unsigned directiveEndPosition)
bool DefinesStreamProxy::MatchUndefDirective(const ParserLine& line, const size_t directiveStartPosition, const size_t directiveEndPosition)
{
auto currentPos = directiveStartPosition;
@ -323,7 +323,7 @@ std::unique_ptr<ISimpleExpression> DefinesStreamProxy::ParseExpression(std::shar
return expressionInterpreter.Evaluate();
}
bool DefinesStreamProxy::MatchIfDirective(const ParserLine& line, const unsigned directiveStartPosition, const unsigned directiveEndPosition)
bool DefinesStreamProxy::MatchIfDirective(const ParserLine& line, const size_t directiveStartPosition, const size_t directiveEndPosition)
{
auto currentPos = directiveStartPosition;
@ -356,7 +356,7 @@ bool DefinesStreamProxy::MatchIfDirective(const ParserLine& line, const unsigned
return true;
}
bool DefinesStreamProxy::MatchElIfDirective(const ParserLine& line, const unsigned directiveStartPosition, const unsigned directiveEndPosition)
bool DefinesStreamProxy::MatchElIfDirective(const ParserLine& line, const size_t directiveStartPosition, const size_t directiveEndPosition)
{
auto currentPos = directiveStartPosition;
@ -398,7 +398,7 @@ bool DefinesStreamProxy::MatchElIfDirective(const ParserLine& line, const unsign
return true;
}
bool DefinesStreamProxy::MatchIfdefDirective(const ParserLine& line, const unsigned directiveStartPosition, const unsigned directiveEndPosition)
bool DefinesStreamProxy::MatchIfdefDirective(const ParserLine& line, const size_t directiveStartPosition, const size_t directiveEndPosition)
{
auto currentPos = directiveStartPosition;
@ -439,7 +439,7 @@ bool DefinesStreamProxy::MatchIfdefDirective(const ParserLine& line, const unsig
return true;
}
bool DefinesStreamProxy::MatchElseDirective(const ParserLine& line, const unsigned directiveStartPosition, const unsigned directiveEndPosition)
bool DefinesStreamProxy::MatchElseDirective(const ParserLine& line, const size_t directiveStartPosition, const size_t directiveEndPosition)
{
auto currentPos = directiveStartPosition;
@ -460,7 +460,7 @@ bool DefinesStreamProxy::MatchElseDirective(const ParserLine& line, const unsign
return true;
}
bool DefinesStreamProxy::MatchEndifDirective(const ParserLine& line, const unsigned directiveStartPosition, const unsigned directiveEndPosition)
bool DefinesStreamProxy::MatchEndifDirective(const ParserLine& line, const size_t directiveStartPosition, const size_t directiveEndPosition)
{
auto currentPos = directiveStartPosition;
@ -486,8 +486,8 @@ bool DefinesStreamProxy::MatchEndifDirective(const ParserLine& line, const unsig
bool DefinesStreamProxy::MatchDirectives(ParserLine& line)
{
unsigned directiveStartPos;
unsigned directiveEndPos;
size_t directiveStartPos;
size_t directiveEndPos;
if (!FindDirective(line, directiveStartPos, directiveEndPos))
return false;
@ -537,9 +537,9 @@ void DefinesStreamProxy::ExtractParametersFromMacroUsage(
ContinueMacroParameters(line, linePos, state, input, inputPos);
}
bool DefinesStreamProxy::MatchDefinedExpression(const ParserLine& line, unsigned& pos, std::string& definitionName)
bool DefinesStreamProxy::MatchDefinedExpression(const ParserLine& line, size_t& pos, std::string& definitionName)
{
unsigned currentPos = pos;
auto currentPos = pos;
if (!MatchNextCharacter(line, currentPos, '('))
return false;
@ -559,7 +559,7 @@ bool DefinesStreamProxy::MatchDefinedExpression(const ParserLine& line, unsigned
void DefinesStreamProxy::ExpandDefinedExpressions(ParserLine& line) const
{
auto currentPos = 0u;
auto currentPos = 0uz;
while (true)
{
@ -1094,7 +1094,7 @@ ParserLine DefinesStreamProxy::NextLine()
{
if (m_in_define)
{
unsigned currentPos = 0u;
auto currentPos = 0uz;
if (m_parameter_state != ParameterState::NOT_IN_PARAMETERS)
{

View File

@ -4,6 +4,7 @@
#include "Parsing/IParserLineStream.h"
#include "Parsing/Simple/Expression/ISimpleExpression.h"
#include <cstddef>
#include <map>
#include <set>
#include <sstream>
@ -29,11 +30,11 @@ public:
{
public:
unsigned m_parameter_index;
unsigned m_parameter_position;
size_t m_parameter_position;
bool m_stringize;
DefineParameterPosition();
DefineParameterPosition(unsigned index, unsigned position, bool stringize);
DefineParameterPosition(unsigned index, size_t position, bool stringize);
};
class Define
@ -96,22 +97,22 @@ private:
MacroParameterState m_multi_line_macro_parameters;
static int GetLineEndEscapePos(const ParserLine& line);
void MatchDefineParameters(const ParserLine& line, unsigned& currentPos);
void ContinueDefine(const ParserLine& line, unsigned currentPos);
void ContinueParameters(const ParserLine& line, unsigned& currentPos);
_NODISCARD bool MatchDefineDirective(const ParserLine& line, unsigned directiveStartPosition, unsigned directiveEndPosition);
_NODISCARD bool MatchUndefDirective(const ParserLine& line, unsigned directiveStartPosition, unsigned directiveEndPosition);
_NODISCARD bool MatchIfDirective(const ParserLine& line, unsigned directiveStartPosition, unsigned directiveEndPosition);
_NODISCARD bool MatchElIfDirective(const ParserLine& line, unsigned directiveStartPosition, unsigned directiveEndPosition);
_NODISCARD bool MatchIfdefDirective(const ParserLine& line, unsigned directiveStartPosition, unsigned directiveEndPosition);
_NODISCARD bool MatchElseDirective(const ParserLine& line, unsigned directiveStartPosition, unsigned directiveEndPosition);
_NODISCARD bool MatchEndifDirective(const ParserLine& line, unsigned directiveStartPosition, unsigned directiveEndPosition);
void MatchDefineParameters(const ParserLine& line, size_t& currentPos);
void ContinueDefine(const ParserLine& line, size_t currentPos);
void ContinueParameters(const ParserLine& line, size_t& currentPos);
_NODISCARD bool MatchDefineDirective(const ParserLine& line, size_t directiveStartPosition, size_t directiveEndPosition);
_NODISCARD bool MatchUndefDirective(const ParserLine& line, size_t directiveStartPosition, size_t directiveEndPosition);
_NODISCARD bool MatchIfDirective(const ParserLine& line, size_t directiveStartPosition, size_t directiveEndPosition);
_NODISCARD bool MatchElIfDirective(const ParserLine& line, size_t directiveStartPosition, size_t directiveEndPosition);
_NODISCARD bool MatchIfdefDirective(const ParserLine& line, size_t directiveStartPosition, size_t directiveEndPosition);
_NODISCARD bool MatchElseDirective(const ParserLine& line, size_t directiveStartPosition, size_t directiveEndPosition);
_NODISCARD bool MatchEndifDirective(const ParserLine& line, size_t directiveStartPosition, size_t directiveEndPosition);
_NODISCARD bool MatchDirectives(ParserLine& line);
void ExtractParametersFromMacroUsage(const ParserLine& line, unsigned& linePos, MacroParameterState& state, const std::string& input, unsigned& inputPos);
bool FindMacroForIdentifier(const std::string& input, unsigned wordStart, unsigned wordEnd, const Define*& value) const;
static bool MatchDefinedExpression(const ParserLine& line, unsigned& pos, std::string& definitionName);
static bool MatchDefinedExpression(const ParserLine& line, size_t& pos, std::string& definitionName);
void ExpandDefinedExpressions(ParserLine& line) const;
bool FindNextMacro(const std::string& input, unsigned& inputPos, unsigned& defineStart, const DefinesStreamProxy::Define*& define);

View File

@ -13,9 +13,9 @@ IncludingStreamProxy::IncludingStreamProxy(IParserLineStream* stream)
}
bool IncludingStreamProxy::ExtractIncludeFilename(const ParserLine& line,
const unsigned includeDirectivePosition,
unsigned& filenameStartPosition,
unsigned& filenameEndPosition)
const size_t includeDirectivePosition,
size_t& filenameStartPosition,
size_t& filenameEndPosition)
{
auto currentPos = includeDirectivePosition;
bool isDoubleQuotes;
@ -60,7 +60,7 @@ bool IncludingStreamProxy::ExtractIncludeFilename(const ParserLine& line,
return false;
}
bool IncludingStreamProxy::MatchIncludeDirective(const ParserLine& line, const unsigned directiveStartPos, const unsigned directiveEndPos) const
bool IncludingStreamProxy::MatchIncludeDirective(const ParserLine& line, const size_t directiveStartPos, const size_t directiveEndPos) const
{
auto currentPos = directiveStartPos;
@ -70,7 +70,7 @@ bool IncludingStreamProxy::MatchIncludeDirective(const ParserLine& line, const u
return false;
}
unsigned filenameStart, filenameEnd;
size_t filenameStart, filenameEnd;
if (!ExtractIncludeFilename(line, currentPos, filenameStart, filenameEnd))
throw ParsingException(TokenPos(*line.m_filename, line.m_line_number, static_cast<int>(currentPos)), INCLUDE_QUOTES_ERROR);
@ -86,7 +86,7 @@ bool IncludingStreamProxy::MatchIncludeDirective(const ParserLine& line, const u
return true;
}
bool IncludingStreamProxy::MatchPragmaOnceDirective(const ParserLine& line, const unsigned directiveStartPos, const unsigned directiveEndPos)
bool IncludingStreamProxy::MatchPragmaOnceDirective(const ParserLine& line, const size_t directiveStartPos, const size_t directiveEndPos)
{
auto currentPos = directiveStartPos;
@ -116,7 +116,7 @@ bool IncludingStreamProxy::MatchPragmaOnceDirective(const ParserLine& line, cons
bool IncludingStreamProxy::MatchDirectives(const ParserLine& line)
{
unsigned directiveStartPos, directiveEndPos;
size_t directiveStartPos, directiveEndPos;
if (!FindDirective(line, directiveStartPos, directiveEndPos))
return false;

View File

@ -16,9 +16,9 @@ class IncludingStreamProxy final : public AbstractDirectiveStreamProxy
std::set<std::string> m_included_files;
_NODISCARD static bool
ExtractIncludeFilename(const ParserLine& line, unsigned includeDirectivePosition, unsigned& filenameStartPosition, unsigned& filenameEndPosition);
_NODISCARD bool MatchIncludeDirective(const ParserLine& line, unsigned directiveStartPos, unsigned directiveEndPos) const;
_NODISCARD bool MatchPragmaOnceDirective(const ParserLine& line, unsigned directiveStartPos, unsigned directiveEndPos);
ExtractIncludeFilename(const ParserLine& line, size_t includeDirectivePosition, size_t& filenameStartPosition, size_t& filenameEndPosition);
_NODISCARD bool MatchIncludeDirective(const ParserLine& line, size_t directiveStartPos, size_t directiveEndPos) const;
_NODISCARD bool MatchPragmaOnceDirective(const ParserLine& line, size_t directiveStartPos, size_t directiveEndPos);
_NODISCARD bool MatchDirectives(const ParserLine& line);
public:

View File

@ -7,7 +7,7 @@ PackDefinitionStreamProxy::PackDefinitionStreamProxy(IParserLineStream* stream)
{
}
bool PackDefinitionStreamProxy::MatchPackDirective(const ParserLine& line, const unsigned directiveStartPosition, const unsigned directiveEndPosition)
bool PackDefinitionStreamProxy::MatchPackDirective(const ParserLine& line, const size_t directiveStartPosition, const size_t directiveEndPosition)
{
auto packValue = 0;
auto currentPosition = directiveStartPosition;
@ -60,7 +60,7 @@ bool PackDefinitionStreamProxy::MatchPackDirective(const ParserLine& line, const
bool PackDefinitionStreamProxy::MatchDirectives(const ParserLine& line)
{
unsigned directiveStartPos, directiveEndPos;
size_t directiveStartPos, directiveEndPos;
if (!FindDirective(line, directiveStartPos, directiveEndPos))
return false;

View File

@ -21,7 +21,7 @@ private:
IParserLineStream* const m_stream;
std::stack<int> m_current_pack;
_NODISCARD bool MatchPackDirective(const ParserLine& line, unsigned directiveStartPosition, unsigned directiveEndPosition);
_NODISCARD bool MatchPackDirective(const ParserLine& line, size_t directiveStartPosition, size_t directiveEndPosition);
_NODISCARD bool MatchDirectives(const ParserLine& line);
public:

View File

@ -15,7 +15,7 @@ void SetDefineStreamProxy::SetDefinesProxy(DefinesStreamProxy* definesProxy)
m_defines_proxy = definesProxy;
}
bool SetDefineStreamProxy::MatchSetDirective(const ParserLine& line, const unsigned directiveStartPosition, const unsigned directiveEndPosition) const
bool SetDefineStreamProxy::MatchSetDirective(const ParserLine& line, const size_t directiveStartPosition, const size_t directiveEndPosition) const
{
auto currentPosition = directiveStartPosition;
@ -59,7 +59,7 @@ bool SetDefineStreamProxy::MatchSetDirective(const ParserLine& line, const unsig
bool SetDefineStreamProxy::MatchDirectives(const ParserLine& line) const
{
unsigned directiveStartPos, directiveEndPos;
size_t directiveStartPos, directiveEndPos;
if (!FindDirective(line, directiveStartPos, directiveEndPos))
return false;

View File

@ -22,7 +22,7 @@ namespace templating
private:
static constexpr const char* SET_DIRECTIVE = "set";
_NODISCARD bool MatchSetDirective(const ParserLine& line, unsigned directiveStartPosition, unsigned directiveEndPosition) const;
_NODISCARD bool MatchSetDirective(const ParserLine& line, size_t directiveStartPosition, size_t directiveEndPosition) const;
_NODISCARD bool MatchDirectives(const ParserLine& line) const;
IParserLineStream* const m_stream;

View File

@ -18,7 +18,7 @@ void TemplatingStreamProxy::SetDefinesProxy(DefinesStreamProxy* definesProxy)
m_defines_proxy = definesProxy;
}
bool TemplatingStreamProxy::MatchSwitchDirective(const ParserLine& line, const unsigned directiveStartPosition, const unsigned directiveEndPosition) const
bool TemplatingStreamProxy::MatchSwitchDirective(const ParserLine& line, const size_t directiveStartPosition, const size_t directiveEndPosition) const
{
auto currentPosition = directiveStartPosition;
@ -43,7 +43,7 @@ bool TemplatingStreamProxy::MatchSwitchDirective(const ParserLine& line, const u
return true;
}
bool TemplatingStreamProxy::MatchOptionsDirective(const ParserLine& line, const unsigned directiveStartPosition, const unsigned directiveEndPosition) const
bool TemplatingStreamProxy::MatchOptionsDirective(const ParserLine& line, const size_t directiveStartPosition, const size_t directiveEndPosition) const
{
auto currentPosition = directiveStartPosition;
@ -93,7 +93,7 @@ bool TemplatingStreamProxy::MatchOptionsDirective(const ParserLine& line, const
return true;
}
bool TemplatingStreamProxy::MatchFilenameDirective(const ParserLine& line, const unsigned directiveStartPosition, const unsigned directiveEndPosition) const
bool TemplatingStreamProxy::MatchFilenameDirective(const ParserLine& line, const size_t directiveStartPosition, const size_t directiveEndPosition) const
{
auto currentPosition = directiveStartPosition;
@ -128,7 +128,7 @@ bool TemplatingStreamProxy::MatchFilenameDirective(const ParserLine& line, const
return true;
}
bool TemplatingStreamProxy::MatchSkipDirective(const ParserLine& line, const unsigned directiveStartPosition, const unsigned directiveEndPosition) const
bool TemplatingStreamProxy::MatchSkipDirective(const ParserLine& line, const size_t directiveStartPosition, const size_t directiveEndPosition) const
{
auto currentPosition = directiveStartPosition;
@ -146,7 +146,7 @@ bool TemplatingStreamProxy::MatchSkipDirective(const ParserLine& line, const uns
bool TemplatingStreamProxy::MatchDirectives(const ParserLine& line) const
{
unsigned directiveStartPos, directiveEndPos;
size_t directiveStartPos, directiveEndPos;
if (!FindDirective(line, directiveStartPos, directiveEndPos))
return false;

View File

@ -43,10 +43,10 @@ namespace templating
static constexpr const char* FILENAME_DIRECTIVE = "filename";
static constexpr const char* SKIP_DIRECTIVE = "skip";
_NODISCARD bool MatchSwitchDirective(const ParserLine& line, unsigned directiveStartPosition, unsigned directiveEndPosition) const;
_NODISCARD bool MatchOptionsDirective(const ParserLine& line, unsigned directiveStartPosition, unsigned directiveEndPosition) const;
_NODISCARD bool MatchFilenameDirective(const ParserLine& line, unsigned directiveStartPosition, unsigned directiveEndPosition) const;
_NODISCARD bool MatchSkipDirective(const ParserLine& line, unsigned directiveStartPosition, unsigned directiveEndPosition) const;
_NODISCARD bool MatchSwitchDirective(const ParserLine& line, size_t directiveStartPosition, size_t directiveEndPosition) const;
_NODISCARD bool MatchOptionsDirective(const ParserLine& line, size_t directiveStartPosition, size_t directiveEndPosition) const;
_NODISCARD bool MatchFilenameDirective(const ParserLine& line, size_t directiveStartPosition, size_t directiveEndPosition) const;
_NODISCARD bool MatchSkipDirective(const ParserLine& line, size_t directiveStartPosition, size_t directiveEndPosition) const;
_NODISCARD bool MatchDirectives(const ParserLine& line) const;
IParserLineStream* const m_stream;

View File

@ -10,10 +10,10 @@ using namespace IW3;
namespace
{
constexpr const char* ASSET_TYPE_NAMES[]{
"xmodelpieces", "physpreset", "xanim", "xmodel", "material", "techniqueset", "image", "sound", "soundcurve", "loadedsound",
"clipmap", "clipmap", "comworld", "gameworldsp", "gameworldmp", "mapents", "gfxworld", "lightdef", "uimap", "font",
"menulist", "menu", "localize", "weapon", "snddriverglobals", "fx", "impactfx", "aitype", "mptype", "character",
"xmodelalias", "rawfile", "stringtable",
"xmodelpieces", "physpreset", "xanim", "xmodel", "material", "techniqueset", "image", "sound", "soundcurve", "loadedsound",
"clipmap_unused", "clipmap", "comworld", "gameworldsp", "gameworldmp", "mapents", "gfxworld", "lightdef", "uimap", "font",
"menulist", "menu", "localize", "weapon", "snddriverglobals", "fx", "impactfx", "aitype", "mptype", "character",
"xmodelalias", "rawfile", "stringtable",
};
}

View File

@ -10,12 +10,15 @@ using namespace IW4;
namespace
{
constexpr const char* ASSET_TYPE_NAMES[]{
"physpreset", "physcollmap", "xanim", "xmodelsurfs", "xmodel", "material", "pixelshader", "vertexshader",
"vertexdecl", "techniqueset", "image", "sound", "soundcurve", "loadedsound", "clipmap", "clipmap",
"comworld", "gameworldsp", "gameworldmp", "mapents", "fxworld", "gfxworld", "lightdef", "uimap",
"font", "menulist", "menu", "localize", "weapon", "snddriverglobals", "fx", "impactfx",
"aitype", "mptype", "character", "xmodelalias", "rawfile", "stringtable", "leaderboard", "structureddatadef",
"tracer", "vehicle", "addonmapents",
"physpreset", "physcollmap", "xanim", "xmodelsurfs", "xmodel",
"material", "pixelshader", "vertexshader", "vertexdecl", "techniqueset",
"image", "sound", "soundcurve", "loadedsound", "clipmap_unused",
"clipmap_used", "comworld", "gameworldsp", "gameworldmp", "mapents",
"fxworld", "gfxworld", "lightdef", "uimap", "font",
"menulist", "menu", "localize", "weapon", "snddriverglobals",
"fx", "impactfx", "aitype", "mptype", "character",
"xmodelalias", "rawfile", "stringtable", "leaderboard", "structureddatadef",
"tracer", "vehicle", "addonmapents",
};
}

View File

@ -10,12 +10,12 @@ using namespace T5;
namespace
{
constexpr const char* ASSET_TYPE_NAMES[]{
"xmodelpieces", "physpreset", "physconstraints", "destructibledef", "xanim", "xmodel", "material",
"techniqueset", "image", "soundbank", "soundpatch", "clipmap", "clipmap", "comworld",
"gameworldsp", "gameworldmp", "mapents", "gfxworld", "gfxlightdef", "uimap", "font",
"menulist", "menu", "localize", "weapon", "weapondef", "weaponvariant", "snddriverglobals",
"fx", "fximpacttable", "aitype", "mptype", "mpbody", "mphead", "character",
"xmodelalias", "rawfile", "stringtable", "packindex", "xglobals", "ddl", "glasses",
"xmodelpieces", "physpreset", "physconstraints", "destructibledef", "xanim", "xmodel", "material",
"techniqueset", "image", "soundbank", "soundpatch", "clipmap_unused", "clipmap", "comworld",
"gameworldsp", "gameworldmp", "mapents", "gfxworld", "gfxlightdef", "uimap", "font",
"menulist", "menu", "localize", "weapon", "weapondef", "weaponvariant", "snddriverglobals",
"fx", "fximpacttable", "aitype", "mptype", "mpbody", "mphead", "character",
"xmodelalias", "rawfile", "stringtable", "packindex", "xglobals", "ddl", "glasses",
"emblemset",
};
}

View File

@ -21,7 +21,7 @@ namespace
"image",
"soundbank",
"soundpatch",
"clipmap",
"clipmap_unused",
"clipmap",
"comworld",
"gameworldsp",

View File

@ -22,7 +22,7 @@ uint8_t* AbstractSalsa20Processor::GetHashBlock(const int streamNumber) const
void AbstractSalsa20Processor::InitStreams(const std::string& zoneName, const uint8_t* salsa20Key, const size_t keySize) const
{
// Original buffer must have been 32 bytes because the zoneName can at most be 31 characters be long before being cut off
const auto zoneNameLength = std::min(zoneName.length(), 31u);
const auto zoneNameLength = std::min(zoneName.length(), 31uz);
const size_t blockHashBufferSize = BLOCK_HASHES_COUNT * m_stream_count * SHA1_HASH_SIZE;

View File

@ -14,7 +14,7 @@ SearchPathOpenFile MockSearchPath::Open(const std::string& fileName)
if (foundFileData == m_file_data_map.end())
return {};
return {std::make_unique<std::istringstream>(foundFileData->second), foundFileData->second.size()};
return {std::make_unique<std::istringstream>(foundFileData->second), static_cast<int64_t>(foundFileData->second.size())};
}
const std::string& MockSearchPath::GetPath()

2
thirdparty/catch2 vendored

@ -1 +1 @@
Subproject commit 914aeecfe23b1e16af6ea675a4fb5dbd5a5b8d0a
Subproject commit 4c8671cfbbf0019d3827305d4d1c82a74eeb029a

2
thirdparty/eigen vendored

@ -1 +1 @@
Subproject commit abac563f5dac59b88e4f354e7b092c9cae3871fc
Subproject commit 33f5f596143d0fce32316ec6fa4bd9f23b4dd9d2

2
thirdparty/json vendored

@ -1 +1 @@
Subproject commit e72046ef9f07f461ec56bc904c5a732e96f8d803
Subproject commit c67d538274502163b55e8fb54b5c27c17764722d

@ -1 +1 @@
Subproject commit 2e9f2b5e44dd498dba60e5175c6c7effa5ff3728
Subproject commit a6b9aff7aab857fe1b491710a5c5b9e2be49cb08

@ -1 +1 @@
Subproject commit 5809141a3a6ec1bf3443c927c02b955e19224016
Subproject commit e823b0c34cea291bdb94d672731e1c1f08525557

2
thirdparty/zlib vendored

@ -1 +1 @@
Subproject commit ef24c4c7502169f016dcd2a26923dbaf3216748c
Subproject commit 5a82f71ed1dfc0bec044d9702463dbdf84ea3b71