Commit graph

81 commits

Author SHA1 Message Date
b58117a5e7 libeuropa: Add DLL export stuff
Also allows us to re-add -fvisibility=hidden to Linux builds
2025-01-17 23:08:51 -05:00
e978c975b0 cmake: Support installation of libeuropa (runtime) and tools
also, might as well.
2025-01-17 22:31:15 -05:00
69a7b0e45e (experimental) libeuropa: Make libeuropa a shared library
Bleh. Might as well.

NO ABI GUARANTEES UNTIL A REAL 1.0.0 RELEASE.
2025-01-17 22:25:13 -05:00
f5d03cfdeb *: "Support" MSVC
For Windows builds of EuropaTools. For now I'm using MSVC since clang completely barfs.
2025-01-17 20:25:34 -05:00
6faa960753 *: Update README to reflect current tools
also fix the link. bugged me
2025-01-17 18:44:56 -05:00
ee47b0eaa7 tools/eupak: Clean up create command a touch 2025-01-17 18:42:52 -05:00
a5642f2365 tools: Remove dead/obsoleted code
Clean = good.
2025-01-17 18:37:51 -05:00
3968cde61e tools: Introduce new "eutex" tool
This is effectively currently the same as "texdump", but will allow provisions for expanding to creating new textures/such. A good thing.
2025-01-17 18:36:58 -05:00
8d5a8d4adc tools/eupak: Refactor to use toollib
This also flattens out eupak's source code a bit. Idk if i will keep that, but we don't need headers anymore.
2025-01-17 17:58:08 -05:00
b99c044cbd tools/toollib_test: Remove some unused headers 2025-01-17 16:12:23 -05:00
29a78724e8 tools: Implement new "toollib"
This essentially is a even-more refactored version of the new eupak "Task" setup, but done in a generic way, so multiple tools can be written like eupak easily, and I Don't Need to Duplicate It Every Time.

This commit also comes with a new test binary, "toollib_test". This will be removed once it's no longer needed and I'm done sketching out the API set (and eupak is refactored to use toollib instead), but for now this provides a two-way thing:

- Allows me to hack on toollib without breaking everything
- Shows how to use toollib.
2025-01-17 16:03:39 -05:00
6a565e3244 libeuropa/util: Move 4bpp/8bpp paint support 2025-01-16 20:56:42 -05:00
69e9ecd35c libeuropa/io/yatd: Support YATF v2 (Jedi Starfighter)
Rather confusingly, it seems like they wanted to make this backwards compatible. In practice, due to the magic fourcc being written with a different endian, it's not really. (OK well the header is the same but you get my point)

Also, for some reason, they decided to I guess jumble format types around. Thanks guys.
2025-01-16 16:24:12 -05:00
ab496ed4aa libeuropa/io/pak: Rename ReadData_Impl() to better reflect its purpose
Also remove the `version` field from `pak::Reader`. It was never actually used.
2025-01-16 02:25:08 -05:00
3d41ba7e6c libeuropa/io/yatf: Remove old FIXME
It was done.
2025-01-16 02:15:17 -05:00
e7a9412479 libeuropa/io: Clean up ReadPString()
While it's moot since we don't read in any hot paths, std::istream already has `read(chars, len)`, which means we don't need to reinvent it poorly. It's cleaner code as well.
2025-01-16 02:14:26 -05:00
361cd12437 libeuropa/io: Clean up TeeInOut()
Remove debugging stuff that didn't need to to be there anymore.
2025-01-16 02:09:29 -05:00
5657cdd0af tools/eupak: Fix CreateTask version argument
I'm dumb.
2025-01-16 01:51:07 -05:00
738929e14e libeuropa/io/yatf: Document Reader better
meh.
2025-01-16 01:50:52 -05:00
4c2bda9fbf tools/eupak: rename "pmdl" in eupak create to europa-prerelease
This more accurately reflects that it was used during development; art was probably the earliest part of the game to be finished, therefore there are lots of leftovers of older formats. Henceforth why the game can parse them.
2025-01-16 01:41:05 -05:00
ecca00a708 tools/eupak: Fix ExtractTask::Parse()
oops.
2025-01-16 01:31:29 -05:00
d0b8d0f3ea libeuropa/io/yatf: Fix YATF 24-bpp support
This completely redoes the garbage flags stuff I did before. OOPS. This seems a lot closer to the format, and also exports everything Starfighter has properly.
2025-01-16 01:12:53 -05:00
9c6448a817 libeuropa,libeuropa/tools: Drop libpixel dependency
libpixel (suprisingly) still compiles, but depends on libraries in a very annoying manner that makes EuropaTools hard to compile. Also, I don't like stb_image_write.

Replace it with some hand-done structs and the simpler/faster/better `lodepng`.
2025-01-15 23:40:41 -05:00
85d9a1deba libeuropa/tools: Remove paktest tool
It hasn't been updated for a very long time, and hasn't been needed for that same period of time.
2025-01-15 22:00:34 -05:00
18635002f2 libeuropa: Clean up and remove some unreferenced code
There's no better time than now!
2025-01-15 21:59:07 -05:00
452a82b079 libeuropa: Move YatfReader into europa::io::yatf namespace
Finish Refactoring™️
2025-01-15 21:53:34 -05:00
84c537c873 libeuropa/io: Split pak into new subdirectory
Namespaces exist. Use them, perhaps.
2025-01-15 21:50:34 -05:00
087657d5c1 tools/eupak: Clean up main() a bit 2025-01-15 20:13:17 -05:00
6cd6d45a71 libeuropa/io: Remove usage of *_map from PakReader
I'm not sure how I want to handle this yet, but for now, using a vector<pair<...>> is the easiest way currently to retain insertion order. Using a hash table IS probably a better idea, and I'm looking to maybe importing Boost multimaps to allow that, but for now, /shrug.
2025-01-15 20:07:47 -05:00
d9e30b8466 tools/eupak: Add a new non-verbose file listing to eupak info
Looks cool! Might remove the old one tbh.
2025-01-15 20:06:19 -05:00
ee89213a57 tools/eupak: Add check for if user provides a valid directory path
Oops.
2025-01-15 19:37:01 -05:00
d9dae6e6ac tools/eupak: Refactor ExtractTask to ITask
Completing this refactor.. Nice.
2025-01-15 19:34:31 -05:00
addf2071f4 tools/eupak: Refactor out Arguments from public view
They aren't needed for public view anymore.
2025-01-15 19:26:43 -05:00
e30913b018 tools/eupak: Refactor InfoTask to ITask pattern 2025-01-15 19:25:31 -05:00
7fee38be55 tools/eupak: Heavily refactor tasks.
This starts the beginning of probably one of the bigger refactor jobs, and one I've been hinting at and FIXME jabbing for a while now.

Basically, tasks now are a lot closer coupled to their arguments. This is a good thing since it means that changing or adding features only requires modifying the task, not needlessly modifying main over and over.

CreateTask is the only one that works currently for this commit and has been converted to the new ITask model.
2025-01-15 18:43:33 -05:00
447b134118 eupak: Make it a error to specify --sector-aligned outside of -V jedistarfighter
Should make it less error prone. I mean, I could probably have just made this a warning but it's better to make it clear it doesn't do anything/work.
2025-01-12 16:42:27 -05:00
05d4b706b4 libeuropa/io: Refactor PakWriter for pakv5 sector alignment support
This really could be classed a "fix", since adding support for it when reading broke writing. Now we do the right thing.

This makes sector-alignment a no-op when writing other archive versions. I might make it an error to specify -s with a non-JSF package version.
2025-01-12 16:37:44 -05:00
dc95b3ba9c libeuropa/structs: Fix Pak V3 TOC entry
As it turns out, the unix time is NOT junk in them. The short I identified is *before* it. Oops

The hexpat is also fixed up so it can analyze v3, v4, and v5 successfully.
2025-01-12 16:22:02 -05:00
1aebeffb3f libeuropa/io: Refactor some stuff
Meh.
2025-01-12 16:15:06 -05:00
9757b79e7e libeuropa/io: Get JSF STREAMS extraction working
As it turns out the thing I marked as "header size" is more likely just a discarded revision.

Anyways, to detail this: pak version 5 adds fields to the header for sector alignment. The reader now handles this and reads the sectoralignment TOC entry, which now allows STREAMS (and any other packages with this set?) to extract properly.

Woohoo.
2025-01-12 16:05:58 -05:00
a9ed7adb64 tools/eupak: Clean up some comments 2025-01-08 14:00:03 -05:00
64d15eff30 tools/eupak: Add -s/--sector-aligned option to eupak create
This allows to build sector aligned packages.. now that they, like, actually work.
2025-01-08 13:54:08 -05:00
974f173a7b libeuropa/io: Move some stuff in PakWriter.cpp to util/ headers
I wanted to do this anyways, so hey.
2025-01-08 13:36:19 -05:00
6fa9f7122b libeuropa/io: Fix PakWriter AlignBy() so it actually works
Oops. This makes sector alignment actually work for writing sector aligned paks now.
2025-01-08 13:25:49 -05:00
341f914e1d *: Add some hardening compile options.
Also fix some warnings and potential issues that building the entire EuropaTools codebase under those flags showed.

Later on once we drop the libpixel and stbiw dependencies, we can probably turn on -Werror for release builds.
2025-01-08 13:08:49 -05:00
bdc55f5483 *: Relicense to MIT
A ironically more-free license. Also no more foot fungus (or other various shitty things a certain RMS has done.)
2025-01-07 18:02:27 -05:00
f7b80326ff eupak: Fix creation timestamps
Also, PakWriter will now write a proper creation time. For unit testing/etc, I may
instead have it just take in a system_clock::time_point, but idk.
2025-01-07 17:56:35 -05:00
3786b760fe *: Various cleanup 2025-01-07 15:13:10 -05:00
307e92768c *: Correct all license headers 2025-01-07 14:17:50 -05:00
68dc4c0c11 hexpat: Document TOC size field in PAK hexpat
never did so I guess
2025-01-07 14:13:22 -05:00