1
Fork 0
mirror of https://github.com/redstrate/Physis.git synced 2025-05-07 02:57:46 +00:00
Commit graph

35 commits

Author SHA1 Message Date
d58a216462 Shrink the dependency and feature complexity, auto-cleanup and more
We had a few odd dependencies that caused nothing but pain in dependent projects
like libphysis. One of these was libunshield (a C library) that our game_install
feature used, but to be honest this was the wrong library to put this code. It
was really only ever used by Astra, and should live there instead - there's no
reason to have it shared between applications (and it's small enough to be
copied if *you* need it.) Also that also killed the system-deps dependency which
had a significant impact on our build time.

Another dependency was replaced: libz-sys. This is replaced by the pure Rust
libz-rs (through libz-rs-sys) which should simplify deploying physis without
having to worry about manually linking libz or other nonsense. Some leftover
copied code from flate2 can also be removed.

I also removed the visual_data feature as Astra ended up using it anyway, and
the distinction doesn't make much sense now. It was previously to gate some
dependencies needed for visual data extraction, but the bitflags and half crates
are small. I can look into splitting the crate up into more features if needed
later.

A dependency that was erroneously included in the refactoring was quote, which
has been removed. Also ran cargo fmt, clippy too.
2025-03-11 16:29:24 -04:00
3da2aa39c1 Vendor what we need from texture2ddecoder
This recently tripped up cargo-deny because it depends on paste. I looked at it
and the parts that we need (a few BCn decoding functions) has only one place
where it's used and can easily be replaced.
2025-03-10 17:15:14 -04:00
c9018336c8 Remove leftover println 2025-03-08 09:02:49 -05:00
bb7c74fec8 Redesign how IndexFile parsing works, again
Now it reads much more of the index file format, and tries to handle
index1/index2 differences more opaquely. I'm not yet happy with the API, it
needs a bit more work.
2025-03-06 18:52:26 -05:00
39d7a5b703 Prevent overflow when loading high resolution textures in certain code paths
With the release of Dawntrail, these are now being hit - for example loading the
expansion logo in Astra. These are now converted to usize everywhere so it
prevents this from happening.
2024-06-26 23:45:50 -04:00
e5caab2e64 Run rustfmt and fix more Clippy warnings 2024-05-18 09:42:07 -04:00
c4e9697faa Support 3D textures
We only supported 2D textures, but 3D textures are needed for the tiling
textures.
2024-04-30 18:01:09 -04:00
6f5831e60d Swap BGRA to RGBA 2024-04-27 21:16:01 -04:00
d5b3b8a468 Run cargo fmt 2024-04-20 13:18:03 -04:00
6e50f03cd9 Fix yet more clippy warnings 2024-04-20 13:17:11 -04:00
79e6f20d86 Oops, remove accidental unwrap commit in Texture 2024-04-20 13:00:07 -04:00
3e00c35bd8 Switch to texture2ddecoder
This crate supports more BCn decoders which texpresso doesn't (like
BC7.)
2024-04-20 10:47:43 -04:00
04eecd5030 Add basic support for B4G4R4A4 textures
Not sure if it's actually correct, but it works without crashing now.
2024-04-20 10:00:13 -04:00
b9110b58ec Some code cleanup in texture 2024-04-18 22:07:57 -04:00
7cf6ab8f60 Simplify texture code for now, add actual BC5 support 2024-04-17 20:43:11 -04:00
4b6166f8d0 Add invalid data test for Texture 2024-04-16 22:08:22 -04:00
67eab58c24 Fix some clippy warnings 2023-12-02 20:17:05 -05:00
7eb11e412f Improve TEX documentation 2023-12-02 19:55:50 -05:00
7a75c170cc Make a semantic difference between owned and non-owned byte data 2023-10-13 16:16:04 -04:00
4dfd36dbd8 Fix and quiet clippy warnings 2023-09-22 19:17:24 -04:00
2000b978b3 Ensure compliance with REUSE, add to CI 2023-08-06 08:25:04 -04:00
a62c638766 Fix texture loading due to not enough memory 2023-04-06 14:52:04 -04:00
425f755850 Fix clippy warnings about unnecessary deref, useless casts 2023-02-20 16:07:48 -05:00
67d2f035c3 Reformat code with rustfmt 2022-10-20 11:45:55 -04:00
eebe89a4bd Remove some import warnings 2022-10-13 17:11:28 -04:00
177523831b Switch a lot more parsers from binread -> binrw
This doesn't necessarily mean that these formats support writing (yet)
but just to solve the initial compilation errors.
2022-10-13 17:11:03 -04:00
e86d910594 Update binrw to 0.10.0
This introduces a new breaking change, namely that all endianness must
be known. I've done the best I can, but I'll be checking soon.
2022-10-13 16:03:46 -04:00
49bd5987d0 Convert TextureAttribute constants to upper case camel 2022-09-15 16:31:56 -04:00
9819f87fcc Suppress some warnings 2022-09-15 16:26:31 -04:00
d9e79e563a Reformat code 2022-08-16 11:52:07 -04:00
3b2038024f Make texture struct members public 2022-08-11 15:48:28 -04:00
06226cfad1 Expose texture width and height 2022-08-11 15:47:02 -04:00
6554dee2f1 Decompress and return rgba data for textures 2022-08-11 15:03:12 -04:00
0210479fd3 Parse texture attribute and formats 2022-08-11 09:23:15 -04:00
7292ad930a Add Texture structure, begin reading header 2022-08-09 19:31:32 -04:00