sourcepp 2025.2.12.dev1__tar.gz → 2025.2.20.dev1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {sourcepp-2025.2.12.dev1 → sourcepp-2025.2.20.dev1}/CMakeLists.txt +2 -2
- {sourcepp-2025.2.12.dev1 → sourcepp-2025.2.20.dev1}/PKG-INFO +22 -25
- {sourcepp-2025.2.12.dev1 → sourcepp-2025.2.20.dev1}/README.md +21 -24
- {sourcepp-2025.2.12.dev1 → sourcepp-2025.2.20.dev1}/pyproject.toml +1 -1
- {sourcepp-2025.2.12.dev1 → sourcepp-2025.2.20.dev1}/src/sourcepp/__init__.py +1 -1
- {sourcepp-2025.2.12.dev1 → sourcepp-2025.2.20.dev1}/src/vcryptpp.h +1 -1
- {sourcepp-2025.2.12.dev1 → sourcepp-2025.2.20.dev1}/src/vtfpp.h +93 -64
- {sourcepp-2025.2.12.dev1 → sourcepp-2025.2.20.dev1}/LICENSE +0 -0
- {sourcepp-2025.2.12.dev1 → sourcepp-2025.2.20.dev1}/THIRDPARTY_LEGAL_NOTICES.txt +0 -0
- {sourcepp-2025.2.12.dev1 → sourcepp-2025.2.20.dev1}/cfg/CMakeLists.txt +0 -0
- {sourcepp-2025.2.12.dev1 → sourcepp-2025.2.20.dev1}/cfg/pyproject.toml +0 -0
- {sourcepp-2025.2.12.dev1 → sourcepp-2025.2.20.dev1}/src/bsppp.h +0 -0
- {sourcepp-2025.2.12.dev1 → sourcepp-2025.2.20.dev1}/src/gamepp.h +0 -0
- {sourcepp-2025.2.12.dev1 → sourcepp-2025.2.20.dev1}/src/sourcepp.cpp +0 -0
- {sourcepp-2025.2.12.dev1 → sourcepp-2025.2.20.dev1}/src/sourcepp.h +0 -0
- {sourcepp-2025.2.12.dev1 → sourcepp-2025.2.20.dev1}/src/steampp.h +0 -0
- {sourcepp-2025.2.12.dev1 → sourcepp-2025.2.20.dev1}/src/toolpp.h +0 -0
|
@@ -30,7 +30,7 @@ endif()
|
|
|
30
30
|
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
|
31
31
|
|
|
32
32
|
set(SOURCEPP_BUILD_PYTHON_WRAPPERS ON CACHE INTERNAL "" FORCE)
|
|
33
|
-
set(SOURCEPP_VERSION "2025.2.
|
|
33
|
+
set(SOURCEPP_VERSION "2025.2.20dev1")
|
|
34
34
|
|
|
35
35
|
# As weird as this looks, this is necessary for sdist wheel
|
|
36
36
|
set(SOURCEPP_PYTHON_IS_SUBDIR OFF)
|
|
@@ -41,6 +41,6 @@ else()
|
|
|
41
41
|
FetchContent_Declare(
|
|
42
42
|
sourcepp
|
|
43
43
|
GIT_REPOSITORY "https://github.com/craftablescience/sourcepp.git"
|
|
44
|
-
GIT_TAG "
|
|
44
|
+
GIT_TAG "f8771653daee393500d1f9735fb2054d577bcfee")
|
|
45
45
|
FetchContent_MakeAvailable(sourcepp)
|
|
46
46
|
endif()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: sourcepp
|
|
3
|
-
Version: 2025.2.
|
|
3
|
+
Version: 2025.2.20.dev1
|
|
4
4
|
Summary: Several modern C++20 libraries for sanely parsing Valve formats.
|
|
5
5
|
Home-page: https://github.com/craftablescience/sourcepp
|
|
6
6
|
Author-Email: craftablescience <lauralewisdev@gmail.com>
|
|
@@ -180,17 +180,11 @@ Several modern C++20 libraries for sanely parsing Valve formats, rolled into one
|
|
|
180
180
|
</tr>
|
|
181
181
|
<tr><!-- empty row to disable github striped bg color --></tr>
|
|
182
182
|
<tr>
|
|
183
|
-
<td rowspan="
|
|
183
|
+
<td rowspan="23"><code>vpkpp</code></td>
|
|
184
184
|
<td>007 v1.1, v1.3 (007 - Nightfire)</td>
|
|
185
185
|
<td align="center">✅</td>
|
|
186
186
|
<td align="center">❌</td>
|
|
187
|
-
<td rowspan="
|
|
188
|
-
</tr>
|
|
189
|
-
<tr><!-- empty row to disable github striped bg color --></tr>
|
|
190
|
-
<tr>
|
|
191
|
-
<td><a href="https://developer.valvesoftware.com/wiki/Bonus_Maps">BMZ</a></td>
|
|
192
|
-
<td align="center">✅</td>
|
|
193
|
-
<td align="center">✅</td>
|
|
187
|
+
<td rowspan="23" align="center">C<br>C#</td>
|
|
194
188
|
</tr>
|
|
195
189
|
<tr><!-- empty row to disable github striped bg color --></tr>
|
|
196
190
|
<tr>
|
|
@@ -238,18 +232,6 @@ Several modern C++20 libraries for sanely parsing Valve formats, rolled into one
|
|
|
238
232
|
<td align="center">✅</td>
|
|
239
233
|
</tr>
|
|
240
234
|
<tr><!-- empty row to disable github striped bg color --></tr>
|
|
241
|
-
<tr>
|
|
242
|
-
<td><a href="https://doomwiki.org/wiki/PK3">PK3</a> (Quake III)</td>
|
|
243
|
-
<td align="center">✅</td>
|
|
244
|
-
<td align="center">✅</td>
|
|
245
|
-
</tr>
|
|
246
|
-
<tr><!-- empty row to disable github striped bg color --></tr>
|
|
247
|
-
<tr>
|
|
248
|
-
<td><a href="https://doomwiki.org/wiki/PK4">PK4</a> (Quake IV, Doom 3)</td>
|
|
249
|
-
<td align="center">✅</td>
|
|
250
|
-
<td align="center">✅</td>
|
|
251
|
-
</tr>
|
|
252
|
-
<tr><!-- empty row to disable github striped bg color --></tr>
|
|
253
235
|
<tr>
|
|
254
236
|
<td>
|
|
255
237
|
<a href="https://developer.valvesoftware.com/wiki/VPK">VPK</a> pre-v1, v1-2, v54
|
|
@@ -273,17 +255,25 @@ Several modern C++20 libraries for sanely parsing Valve formats, rolled into one
|
|
|
273
255
|
</tr>
|
|
274
256
|
<tr><!-- empty row to disable github striped bg color --></tr>
|
|
275
257
|
<tr>
|
|
276
|
-
<td>
|
|
258
|
+
<td>
|
|
259
|
+
ZIP, and some of its aliases:
|
|
260
|
+
<br> • <a href="https://github.com/BEEmod/BEE2-items">BEE_PACK</a> (BEE2.4 Package)
|
|
261
|
+
<br> • <a href="https://developer.valvesoftware.com/wiki/Bonus_Maps">BMZ</a> (Source 1 Bonus Maps)
|
|
262
|
+
<br> • FPK (Tactical Intervention)
|
|
263
|
+
<br> • <a href="https://doomwiki.org/wiki/PK3">PK3</a> (Quake III)
|
|
264
|
+
<br> • <a href="https://doomwiki.org/wiki/PK4">PK4</a> (Quake IV, Doom 3)
|
|
265
|
+
<br> • PKZ (Quake II RTX)
|
|
266
|
+
</td>
|
|
277
267
|
<td align="center">✅</td>
|
|
278
268
|
<td align="center">✅</td>
|
|
279
269
|
</tr>
|
|
280
270
|
<tr><!-- empty row to disable github striped bg color --></tr>
|
|
281
271
|
<tr>
|
|
282
|
-
<td rowspan="
|
|
272
|
+
<td rowspan="31"><code>vtfpp</code></td>
|
|
283
273
|
<td><a href="https://wiki.mozilla.org/APNG_Specification">APNG</a></td>
|
|
284
274
|
<td align="center">✅</td>
|
|
285
275
|
<td align="center">❌</td>
|
|
286
|
-
<td rowspan="
|
|
276
|
+
<td rowspan="31" align="center">Python</td>
|
|
287
277
|
</tr>
|
|
288
278
|
<tr><!-- empty row to disable github striped bg color --></tr>
|
|
289
279
|
<tr>
|
|
@@ -358,6 +348,12 @@ Several modern C++20 libraries for sanely parsing Valve formats, rolled into one
|
|
|
358
348
|
<td align="center">✅</td>
|
|
359
349
|
</tr>
|
|
360
350
|
<tr><!-- empty row to disable github striped bg color --></tr>
|
|
351
|
+
<tr>
|
|
352
|
+
<td>TTX (TTH, TTZ) v1.0</td>
|
|
353
|
+
<td align="center">✅</td>
|
|
354
|
+
<td align="center">✅</td>
|
|
355
|
+
</tr>
|
|
356
|
+
<tr><!-- empty row to disable github striped bg color --></tr>
|
|
361
357
|
<tr>
|
|
362
358
|
<td>
|
|
363
359
|
<a href="https://developer.valvesoftware.com/wiki/VTF_(Valve_Texture_Format)">VTF</a> v7.0-7.6
|
|
@@ -369,7 +365,8 @@ Several modern C++20 libraries for sanely parsing Valve formats, rolled into one
|
|
|
369
365
|
<tr><!-- empty row to disable github striped bg color --></tr>
|
|
370
366
|
<tr>
|
|
371
367
|
<td>
|
|
372
|
-
<a href="https://developer.valvesoftware.com/wiki/VTFX_file_format">VTFX</a>
|
|
368
|
+
<a href="https://developer.valvesoftware.com/wiki/VTFX_file_format">VTFX</a> X360, PS3 (Orange Box)
|
|
369
|
+
<br> • PS3 (Portal 2, CS:GO) modifications
|
|
373
370
|
</td>
|
|
374
371
|
<td align="center">✅</td>
|
|
375
372
|
<td align="center">✅</td>
|
|
@@ -157,17 +157,11 @@ Several modern C++20 libraries for sanely parsing Valve formats, rolled into one
|
|
|
157
157
|
</tr>
|
|
158
158
|
<tr><!-- empty row to disable github striped bg color --></tr>
|
|
159
159
|
<tr>
|
|
160
|
-
<td rowspan="
|
|
160
|
+
<td rowspan="23"><code>vpkpp</code></td>
|
|
161
161
|
<td>007 v1.1, v1.3 (007 - Nightfire)</td>
|
|
162
162
|
<td align="center">✅</td>
|
|
163
163
|
<td align="center">❌</td>
|
|
164
|
-
<td rowspan="
|
|
165
|
-
</tr>
|
|
166
|
-
<tr><!-- empty row to disable github striped bg color --></tr>
|
|
167
|
-
<tr>
|
|
168
|
-
<td><a href="https://developer.valvesoftware.com/wiki/Bonus_Maps">BMZ</a></td>
|
|
169
|
-
<td align="center">✅</td>
|
|
170
|
-
<td align="center">✅</td>
|
|
164
|
+
<td rowspan="23" align="center">C<br>C#</td>
|
|
171
165
|
</tr>
|
|
172
166
|
<tr><!-- empty row to disable github striped bg color --></tr>
|
|
173
167
|
<tr>
|
|
@@ -215,18 +209,6 @@ Several modern C++20 libraries for sanely parsing Valve formats, rolled into one
|
|
|
215
209
|
<td align="center">✅</td>
|
|
216
210
|
</tr>
|
|
217
211
|
<tr><!-- empty row to disable github striped bg color --></tr>
|
|
218
|
-
<tr>
|
|
219
|
-
<td><a href="https://doomwiki.org/wiki/PK3">PK3</a> (Quake III)</td>
|
|
220
|
-
<td align="center">✅</td>
|
|
221
|
-
<td align="center">✅</td>
|
|
222
|
-
</tr>
|
|
223
|
-
<tr><!-- empty row to disable github striped bg color --></tr>
|
|
224
|
-
<tr>
|
|
225
|
-
<td><a href="https://doomwiki.org/wiki/PK4">PK4</a> (Quake IV, Doom 3)</td>
|
|
226
|
-
<td align="center">✅</td>
|
|
227
|
-
<td align="center">✅</td>
|
|
228
|
-
</tr>
|
|
229
|
-
<tr><!-- empty row to disable github striped bg color --></tr>
|
|
230
212
|
<tr>
|
|
231
213
|
<td>
|
|
232
214
|
<a href="https://developer.valvesoftware.com/wiki/VPK">VPK</a> pre-v1, v1-2, v54
|
|
@@ -250,17 +232,25 @@ Several modern C++20 libraries for sanely parsing Valve formats, rolled into one
|
|
|
250
232
|
</tr>
|
|
251
233
|
<tr><!-- empty row to disable github striped bg color --></tr>
|
|
252
234
|
<tr>
|
|
253
|
-
<td>
|
|
235
|
+
<td>
|
|
236
|
+
ZIP, and some of its aliases:
|
|
237
|
+
<br> • <a href="https://github.com/BEEmod/BEE2-items">BEE_PACK</a> (BEE2.4 Package)
|
|
238
|
+
<br> • <a href="https://developer.valvesoftware.com/wiki/Bonus_Maps">BMZ</a> (Source 1 Bonus Maps)
|
|
239
|
+
<br> • FPK (Tactical Intervention)
|
|
240
|
+
<br> • <a href="https://doomwiki.org/wiki/PK3">PK3</a> (Quake III)
|
|
241
|
+
<br> • <a href="https://doomwiki.org/wiki/PK4">PK4</a> (Quake IV, Doom 3)
|
|
242
|
+
<br> • PKZ (Quake II RTX)
|
|
243
|
+
</td>
|
|
254
244
|
<td align="center">✅</td>
|
|
255
245
|
<td align="center">✅</td>
|
|
256
246
|
</tr>
|
|
257
247
|
<tr><!-- empty row to disable github striped bg color --></tr>
|
|
258
248
|
<tr>
|
|
259
|
-
<td rowspan="
|
|
249
|
+
<td rowspan="31"><code>vtfpp</code></td>
|
|
260
250
|
<td><a href="https://wiki.mozilla.org/APNG_Specification">APNG</a></td>
|
|
261
251
|
<td align="center">✅</td>
|
|
262
252
|
<td align="center">❌</td>
|
|
263
|
-
<td rowspan="
|
|
253
|
+
<td rowspan="31" align="center">Python</td>
|
|
264
254
|
</tr>
|
|
265
255
|
<tr><!-- empty row to disable github striped bg color --></tr>
|
|
266
256
|
<tr>
|
|
@@ -335,6 +325,12 @@ Several modern C++20 libraries for sanely parsing Valve formats, rolled into one
|
|
|
335
325
|
<td align="center">✅</td>
|
|
336
326
|
</tr>
|
|
337
327
|
<tr><!-- empty row to disable github striped bg color --></tr>
|
|
328
|
+
<tr>
|
|
329
|
+
<td>TTX (TTH, TTZ) v1.0</td>
|
|
330
|
+
<td align="center">✅</td>
|
|
331
|
+
<td align="center">✅</td>
|
|
332
|
+
</tr>
|
|
333
|
+
<tr><!-- empty row to disable github striped bg color --></tr>
|
|
338
334
|
<tr>
|
|
339
335
|
<td>
|
|
340
336
|
<a href="https://developer.valvesoftware.com/wiki/VTF_(Valve_Texture_Format)">VTF</a> v7.0-7.6
|
|
@@ -346,7 +342,8 @@ Several modern C++20 libraries for sanely parsing Valve formats, rolled into one
|
|
|
346
342
|
<tr><!-- empty row to disable github striped bg color --></tr>
|
|
347
343
|
<tr>
|
|
348
344
|
<td>
|
|
349
|
-
<a href="https://developer.valvesoftware.com/wiki/VTFX_file_format">VTFX</a>
|
|
345
|
+
<a href="https://developer.valvesoftware.com/wiki/VTFX_file_format">VTFX</a> X360, PS3 (Orange Box)
|
|
346
|
+
<br> • PS3 (Portal 2, CS:GO) modifications
|
|
350
347
|
</td>
|
|
351
348
|
<td align="center">✅</td>
|
|
352
349
|
<td align="center">✅</td>
|
|
@@ -5,7 +5,7 @@ build-backend = "scikit_build_core.build"
|
|
|
5
5
|
|
|
6
6
|
[project]
|
|
7
7
|
name = "sourcepp"
|
|
8
|
-
version = "2025.2.
|
|
8
|
+
version = "2025.2.20dev1"
|
|
9
9
|
authors = [{ name = "craftablescience", email = "lauralewisdev@gmail.com" }]
|
|
10
10
|
maintainers = [{ name = "craftablescience", email = "lauralewisdev@gmail.com" }]
|
|
11
11
|
description = "Several modern C++20 libraries for sanely parsing Valve formats."
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from ._sourcepp_impl import __doc__, bsppp, gamepp, sourcepp, steampp, toolpp, vcryptpp, vtfpp
|
|
2
2
|
|
|
3
3
|
__author__ = "craftablescience"
|
|
4
|
-
__version__ = "2025.2.
|
|
4
|
+
__version__ = "2025.2.20dev1"
|
|
5
5
|
__all__ = ['__author__', '__doc__', '__version__', 'bsppp', 'gamepp', 'sourcepp', 'steampp', 'toolpp', 'vcryptpp', 'vtfpp']
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
#pragma once
|
|
2
2
|
|
|
3
|
-
#include <tuple>
|
|
4
|
-
|
|
5
3
|
#include <nanobind/nanobind.h>
|
|
6
4
|
#include <nanobind/stl/array.h>
|
|
7
5
|
#include <nanobind/stl/pair.h>
|
|
@@ -291,6 +289,33 @@ void register_python(py::module_& m) {
|
|
|
291
289
|
})
|
|
292
290
|
.def("bake_to_file", py::overload_cast<const std::string&>(&SHT::bake, py::const_), py::arg("sht_path"));
|
|
293
291
|
|
|
292
|
+
vtfpp.attr("TTH_SIGNATURE") = TTH_SIGNATURE;
|
|
293
|
+
|
|
294
|
+
auto cVTF = py::class_<VTF>(vtfpp, "VTF");
|
|
295
|
+
|
|
296
|
+
py::class_<TTX>(vtfpp, "TTX")
|
|
297
|
+
.def(py::init<VTF&&>(), py::arg("vtf"))
|
|
298
|
+
.def("__init__", [](TTX* self, const py::bytes& tthData, const py::bytes& ttzData) {
|
|
299
|
+
return new(self) TTX{{reinterpret_cast<const std::byte*>(tthData.data()), tthData.size()}, {reinterpret_cast<const std::byte*>(ttzData.data()), ttzData.size()}};
|
|
300
|
+
}, py::arg("tth_data"), py::arg("ttz_data"))
|
|
301
|
+
.def(py::init<const std::string&, const std::string&>(), py::arg("tth_path"), py::arg("ttz_path"))
|
|
302
|
+
.def("__bool__", &TTX::operator bool, py::is_operator())
|
|
303
|
+
.def_prop_rw("version_major", &TTX::getMajorVersion, &TTX::setMajorVersion)
|
|
304
|
+
.def_prop_rw("version_minor", &TTX::getMinorVersion, &TTX::setMinorVersion)
|
|
305
|
+
.def_prop_rw("aspect_ratio_type", &TTX::getAspectRatioType, &TTX::setAspectRatioType)
|
|
306
|
+
.def_prop_rw("mip_flags", py::overload_cast<>(&TTX::getMipFlags, py::const_), [](TTX& self, const std::vector<uint64_t>& mipFlags) {
|
|
307
|
+
self.getMipFlags() = mipFlags;
|
|
308
|
+
}, py::rv_policy::reference_internal)
|
|
309
|
+
.def_prop_rw("vtf", py::overload_cast<>(&TTX::getVTF, py::const_), [](TTX& self, const VTF& vtf) {
|
|
310
|
+
self.getVTF() = vtf;
|
|
311
|
+
}, py::rv_policy::reference_internal)
|
|
312
|
+
.def_prop_rw("compression_level", &TTX::getCompressionLevel, &TTX::setCompressionLevel)
|
|
313
|
+
.def("bake", [](const TTX& self) -> std::pair<py::bytes, py::bytes> {
|
|
314
|
+
const auto d = self.bake();
|
|
315
|
+
return {py::bytes{d.first.data(), d.first.size()}, py::bytes{d.second.data(), d.second.size()}};
|
|
316
|
+
})
|
|
317
|
+
.def("bake_to_file", py::overload_cast<const std::string&, const std::string&>(&TTX::bake, py::const_), py::arg("tth_path"), py::arg("ttz_path"));
|
|
318
|
+
|
|
294
319
|
vtfpp.attr("VTF_SIGNATURE") = VTF_SIGNATURE;
|
|
295
320
|
|
|
296
321
|
py::enum_<CompressionMethod>(vtfpp, "CompressionMethod", py::is_arithmetic())
|
|
@@ -330,77 +355,80 @@ void register_python(py::module_& m) {
|
|
|
330
355
|
.def("get_data_as_aux_compression_method", &Resource::getDataAsAuxCompressionMethod)
|
|
331
356
|
.def("get_data_as_aux_compression_length", &Resource::getDataAsAuxCompressionLength, py::arg("mip"), py::arg("mip_count"), py::arg("frame"), py::arg("frame_count"), py::arg("face"), py::arg("face_count"));
|
|
332
357
|
|
|
333
|
-
auto cVTF = py::class_<VTF>(vtfpp, "VTF");
|
|
334
|
-
|
|
335
358
|
py::enum_<VTF::Flags>(cVTF, "Flags", py::is_flag())
|
|
336
|
-
.value("NONE",
|
|
337
|
-
.value("POINT_SAMPLE",
|
|
338
|
-
.value("TRILINEAR",
|
|
339
|
-
.value("CLAMP_S",
|
|
340
|
-
.value("CLAMP_T",
|
|
341
|
-
.value("ANISOTROPIC",
|
|
342
|
-
.value("HINT_DXT5",
|
|
343
|
-
.value("
|
|
344
|
-
.value("
|
|
345
|
-
.value("
|
|
346
|
-
.value("
|
|
347
|
-
.value("
|
|
348
|
-
.value("
|
|
349
|
-
.value("
|
|
350
|
-
.value("
|
|
351
|
-
.value("
|
|
352
|
-
.value("
|
|
353
|
-
.value("
|
|
354
|
-
.value("
|
|
355
|
-
.value("
|
|
356
|
-
.value("
|
|
357
|
-
.value("
|
|
358
|
-
.value("
|
|
359
|
-
.value("
|
|
360
|
-
.value("
|
|
361
|
-
.value("
|
|
362
|
-
.value("
|
|
363
|
-
.value("
|
|
364
|
-
.value("
|
|
365
|
-
.value("SSBUMP",
|
|
366
|
-
.value("
|
|
367
|
-
.value("
|
|
368
|
-
.value("
|
|
369
|
-
.value("
|
|
359
|
+
.value("NONE", VTF::FLAG_NONE)
|
|
360
|
+
.value("POINT_SAMPLE", VTF::FLAG_POINT_SAMPLE)
|
|
361
|
+
.value("TRILINEAR", VTF::FLAG_TRILINEAR)
|
|
362
|
+
.value("CLAMP_S", VTF::FLAG_CLAMP_S)
|
|
363
|
+
.value("CLAMP_T", VTF::FLAG_CLAMP_T)
|
|
364
|
+
.value("ANISOTROPIC", VTF::FLAG_ANISOTROPIC)
|
|
365
|
+
.value("HINT_DXT5", VTF::FLAG_HINT_DXT5)
|
|
366
|
+
.value("PWL_CORRECTED", VTF::FLAG_PWL_CORRECTED)
|
|
367
|
+
.value("NORMAL", VTF::FLAG_NORMAL)
|
|
368
|
+
.value("NO_MIP", VTF::FLAG_NO_MIP)
|
|
369
|
+
.value("NO_LOD", VTF::FLAG_NO_LOD)
|
|
370
|
+
.value("LOAD_ALL_MIPS", VTF::FLAG_LOAD_ALL_MIPS)
|
|
371
|
+
.value("PROCEDURAL", VTF::FLAG_PROCEDURAL)
|
|
372
|
+
.value("ONE_BIT_ALPHA", VTF::FLAG_ONE_BIT_ALPHA)
|
|
373
|
+
.value("MULTI_BIT_ALPHA", VTF::FLAG_MULTI_BIT_ALPHA)
|
|
374
|
+
.value("ENVMAP", VTF::FLAG_ENVMAP)
|
|
375
|
+
.value("RENDERTARGET", VTF::FLAG_RENDERTARGET)
|
|
376
|
+
.value("DEPTH_RENDERTARGET", VTF::FLAG_DEPTH_RENDERTARGET)
|
|
377
|
+
.value("NO_DEBUG_OVERRIDE", VTF::FLAG_NO_DEBUG_OVERRIDE)
|
|
378
|
+
.value("SINGLE_COPY", VTF::FLAG_SINGLE_COPY)
|
|
379
|
+
.value("SRGB", VTF::FLAG_SRGB)
|
|
380
|
+
.value("DEFAULT_POOL", VTF::FLAG_DEFAULT_POOL)
|
|
381
|
+
.value("COMBINED", VTF::FLAG_COMBINED)
|
|
382
|
+
.value("ASYNC_DOWNLOAD", VTF::FLAG_ASYNC_DOWNLOAD)
|
|
383
|
+
.value("NO_DEPTH_BUFFER", VTF::FLAG_NO_DEPTH_BUFFER)
|
|
384
|
+
.value("SKIP_INITIAL_DOWNLOAD", VTF::FLAG_SKIP_INITIAL_DOWNLOAD)
|
|
385
|
+
.value("CLAMP_U", VTF::FLAG_CLAMP_U)
|
|
386
|
+
.value("VERTEX_TEXTURE", VTF::FLAG_VERTEX_TEXTURE)
|
|
387
|
+
.value("XBOX_PRESWIZZLED", VTF::FLAG_XBOX_PRESWIZZLED)
|
|
388
|
+
.value("SSBUMP", VTF::FLAG_SSBUMP)
|
|
389
|
+
.value("XBOX_CACHEABLE", VTF::FLAG_XBOX_CACHEABLE)
|
|
390
|
+
.value("LOAD_MOST_MIPS", VTF::FLAG_LOAD_MOST_MIPS)
|
|
391
|
+
.value("BORDER", VTF::FLAG_BORDER)
|
|
392
|
+
.value("YCOCG", VTF::FLAG_YCOCG)
|
|
393
|
+
.value("ASYNC_SKIP_INITIAL_LOW_RES", VTF::FLAG_ASYNC_SKIP_INITIAL_LOW_RES)
|
|
370
394
|
.export_values();
|
|
371
395
|
|
|
372
396
|
py::enum_<VTF::Platform>(cVTF, "Platform")
|
|
373
|
-
.value("UNKNOWN",
|
|
374
|
-
.value("PC",
|
|
375
|
-
.value("
|
|
376
|
-
.value("
|
|
397
|
+
.value("UNKNOWN", VTF::PLATFORM_UNKNOWN)
|
|
398
|
+
.value("PC", VTF::PLATFORM_PC)
|
|
399
|
+
.value("PS3_PORTAL2", VTF::PLATFORM_PS3_PORTAL2)
|
|
400
|
+
.value("PS3_ORANGEBOX", VTF::PLATFORM_PS3_ORANGEBOX)
|
|
401
|
+
.value("X360", VTF::PLATFORM_X360)
|
|
377
402
|
.export_values();
|
|
378
403
|
|
|
379
404
|
py::class_<VTF::CreationOptions>(cVTF, "CreationOptions")
|
|
380
405
|
.def(py::init<>())
|
|
381
|
-
.def_rw("major_version",
|
|
382
|
-
.def_rw("minor_version",
|
|
383
|
-
.def_rw("output_format",
|
|
384
|
-
.def_rw("width_resize_method",
|
|
385
|
-
.def_rw("height_resize_method",
|
|
386
|
-
.def_rw("filter",
|
|
387
|
-
.def_rw("flags",
|
|
388
|
-
.def_rw("initial_frame_count",
|
|
389
|
-
.def_rw("start_frame",
|
|
390
|
-
.def_rw("is_cubemap",
|
|
391
|
-
.def_rw("has_spheremap",
|
|
392
|
-
.def_rw("initial_slice_count",
|
|
393
|
-
.def_rw("
|
|
394
|
-
.def_rw("
|
|
395
|
-
.def_rw("
|
|
396
|
-
.def_rw("
|
|
397
|
-
.def_rw("
|
|
398
|
-
.def_rw("
|
|
406
|
+
.def_rw("major_version", &VTF::CreationOptions::majorVersion)
|
|
407
|
+
.def_rw("minor_version", &VTF::CreationOptions::minorVersion)
|
|
408
|
+
.def_rw("output_format", &VTF::CreationOptions::outputFormat)
|
|
409
|
+
.def_rw("width_resize_method", &VTF::CreationOptions::widthResizeMethod)
|
|
410
|
+
.def_rw("height_resize_method", &VTF::CreationOptions::heightResizeMethod)
|
|
411
|
+
.def_rw("filter", &VTF::CreationOptions::filter)
|
|
412
|
+
.def_rw("flags", &VTF::CreationOptions::flags)
|
|
413
|
+
.def_rw("initial_frame_count", &VTF::CreationOptions::initialFrameCount)
|
|
414
|
+
.def_rw("start_frame", &VTF::CreationOptions::startFrame)
|
|
415
|
+
.def_rw("is_cubemap", &VTF::CreationOptions::isCubeMap)
|
|
416
|
+
.def_rw("has_spheremap", &VTF::CreationOptions::hasSphereMap)
|
|
417
|
+
.def_rw("initial_slice_count", &VTF::CreationOptions::initialSliceCount)
|
|
418
|
+
.def_rw("compute_transparency_flags", &VTF::CreationOptions::computeTransparencyFlags)
|
|
419
|
+
.def_rw("compute_mips", &VTF::CreationOptions::computeMips)
|
|
420
|
+
.def_rw("compute_thumbnail", &VTF::CreationOptions::computeThumbnail)
|
|
421
|
+
.def_rw("compute_reflectivity", &VTF::CreationOptions::computeReflectivity)
|
|
422
|
+
.def_rw("compression_level", &VTF::CreationOptions::compressionLevel)
|
|
423
|
+
.def_rw("compression_method", &VTF::CreationOptions::compressionMethod)
|
|
424
|
+
.def_rw("bumpmap_scale", &VTF::CreationOptions::bumpMapScale);
|
|
399
425
|
|
|
400
426
|
cVTF
|
|
401
|
-
.def_ro_static("
|
|
402
|
-
.def_ro_static("
|
|
403
|
-
.def_ro_static("
|
|
427
|
+
.def_ro_static("FLAG_MASK_AFTER_V7_3", &VTF::FLAG_MASK_AFTER_V7_3)
|
|
428
|
+
.def_ro_static("FLAG_MASK_INTERNAL", &VTF::FLAG_MASK_INTERNAL)
|
|
429
|
+
.def_ro_static("FLAG_MASK_SRGB", &VTF::FLAG_MASK_SRGB)
|
|
430
|
+
.def_ro_static("FORMAT_UNCHANGED", &VTF::FORMAT_UNCHANGED)
|
|
431
|
+
.def_ro_static("FORMAT_DEFAULT", &VTF::FORMAT_DEFAULT)
|
|
404
432
|
.def(py::init<>())
|
|
405
433
|
.def("__init__", [](VTF* self, const py::bytes& vtfData, bool parseHeaderOnly = false) {
|
|
406
434
|
return new(self) VTF{std::span{reinterpret_cast<const std::byte*>(vtfData.data()), vtfData.size()}, parseHeaderOnly};
|
|
@@ -430,6 +458,7 @@ void register_python(py::module_& m) {
|
|
|
430
458
|
.def_prop_rw("flags", &VTF::getFlags, &VTF::setFlags)
|
|
431
459
|
.def("add_flags", &VTF::addFlags, py::arg("flags"))
|
|
432
460
|
.def("remove_flags", &VTF::removeFlags, py::arg("flags"))
|
|
461
|
+
.def("compute_transparency_flags", &VTF::computeTransparencyFlags)
|
|
433
462
|
.def_static("get_default_compressed_format", &VTF::getDefaultCompressedFormat, py::arg("input_format"), py::arg("major_version"), py::arg("minor_version"))
|
|
434
463
|
.def_prop_ro("format", &VTF::getFormat)
|
|
435
464
|
.def("set_format", &VTF::setFormat, py::arg("new_format"), py::arg("filter") = ImageConversion::ResizeFilter::DEFAULT)
|
|
@@ -469,7 +498,7 @@ void register_python(py::module_& m) {
|
|
|
469
498
|
.def("remove_particle_sheet_resource", &VTF::removeParticleSheetResource)
|
|
470
499
|
.def("set_crc_resource", &VTF::setCRCResource, py::arg("value"))
|
|
471
500
|
.def("remove_crc_resource", &VTF::removeCRCResource)
|
|
472
|
-
.def("set_lod_resource", &VTF::setLODResource, py::arg("u"), py::arg("v"))
|
|
501
|
+
.def("set_lod_resource", &VTF::setLODResource, py::arg("u"), py::arg("v"), py::arg("u360") = 0, py::arg("v360") = 0)
|
|
473
502
|
.def("remove_lod_resource", &VTF::removeLODResource)
|
|
474
503
|
.def("set_extended_flags_resource", &VTF::setExtendedFlagsResource, py::arg("value"))
|
|
475
504
|
.def("remove_extended_flags_resource", &VTF::removeExtendedFlagsResource)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|