From 892070f3dec1dc690983fd862880e37e711c2516 Mon Sep 17 00:00:00 2001 From: SulfurNitride Date: Sun, 12 Apr 2026 17:55:56 -0500 Subject: Add BSA in-memory extraction and nested preview support bsatk: - Archive::extractToMemory() extracts a file directly into a byte buffer instead of a filesystem path, backed by a std::ostringstream sink. - Archive::findFile() locates a file by relative path, case-insensitive and separator-agnostic, walking the folder tree recursively. - extractDirect/extractCompressed now take std::ostream& so both the ofstream and ostringstream paths share the same implementation. libbsarch: shim rewrite on Linux to map the Windows API surface onto bsatk::Archive, enabling preview_bsa to open vanilla BSAs via the same interface as other plugins. preview_bsa: double-click on a file in the BSA tree now extracts the bytes via extractToMemory() and hands them to IOrganizer::previewFileData for nested preview rendering (e.g. NIF inside a BSA). uibase + organizerproxy + organizercore: new IOrganizer::previewFileData virtual that routes in-memory file bytes through the first registered IPluginPreview matching the extension. Uses heap + WA_DeleteOnClose + open() to avoid nested exec() softlock from mod info filetree -> preview_bsa tree -> nif preview. docker/build-inner.sh: stage preview_nif shaders into plugin_data/shaders so ShaderManager can load them via IOrganizer::getPluginDataPath(). Co-Authored-By: Claude Opus 4.6 (1M context) --- docker/build-inner.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'docker') diff --git a/docker/build-inner.sh b/docker/build-inner.sh index 0b1d86b..64efa13 100755 --- a/docker/build-inner.sh +++ b/docker/build-inner.sh @@ -109,6 +109,16 @@ if [ -d "libs/preview_dds/src/DDS" ]; then fi [ -d "build/src/src/plugins/data" ] && cp -a "build/src/src/plugins/data" "${OUT_DIR}/plugins/" +# preview_nif shaders. ShaderManager loads them from +# IOrganizer::getPluginDataPath()/shaders/, which on Linux is +# OrganizerCore::pluginDataPath() = /plugin_data (see +# src/src/organizercore.cpp:971). Stage accordingly. +if [ -d "libs/preview_nif/data/shaders" ]; then + mkdir -p "${OUT_DIR}/plugin_data/shaders" + find "libs/preview_nif/data/shaders" -type f \( -name "*.vert" -o -name "*.frag" \) \ + -exec cp -f {} "${OUT_DIR}/plugin_data/shaders/" \; +fi + # ── Stylesheets (themes) ── if [ -d "build/src/src/stylesheets" ]; then cp -a "build/src/src/stylesheets" "${OUT_DIR}/" -- cgit v1.3.1