Services refactor#12
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8d24dbd783
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (Assembly.GetEntryAssembly()?.Location is string entryAssemblyLocation && | ||
| !string.IsNullOrEmpty(entryAssemblyLocation)) | ||
| { | ||
| processPath = entryAssemblyLocation; | ||
| } |
There was a problem hiding this comment.
Use the real process path for runtime directories
When this CLI is published with PublishSingleFile and IncludeAllContentForSelfExtract, the entry assembly can be loaded from the bundle extraction directory, so using Assembly.GetEntryAssembly().Location first makes data/ResourceDB, data/Resources, and tools resolve under the extraction cache instead of next to the executable. In published releases that means user data placed beside the exe is ignored and imports can be written to a temp/extraction location; use the actual process/apphost path for the base directory before falling back to assembly location.
Useful? React with 👍 / 👎.
| byte[] header = new byte[0xE]; | ||
| using MemoryStream ps3Stream = new(header); | ||
| using ResourceBinaryWriter writer = new(ps3Stream, texture.ResourceEndian); | ||
|
|
||
| texture.WriteToStream(writer); |
There was a problem hiding this comment.
Avoid writing the PS3 header into a 14-byte buffer
For porttexture --usegtf with a PS3 source, this new service method is called before running gtf2dds, but it creates a fixed 0xE-byte MemoryStream and then calls TexturePS3.WriteToStream, which writes the full PS3 texture header plus padding. That overflows the non-expandable buffer (or leaves the stream positioned past the data), so GTF conversion fails before any bitmap is converted; write to an expandable stream and copy the first 0xE bytes, or read those bytes from the original header file.
Useful? React with 👍 / 👎.
No description provided.