Repository navigation
Fix default configuration path and mesh size fallback on Linux - #140
Open
discordianfish-bot wants to merge 1 commit into
Open
discordianfish-bot wants to merge 1 commit into
discordianfish-bot wants to merge 1 commit into
Conversation
The default configuration directory was computed from PROJECTMSDL_CONFIG_DIR, which is never set, so it resolved to the install prefix instead of PROJECTMSDL_DATA_DIR (share/projectMSDL), where the configuration file is installed. projectMSDL never loaded its default configuration and ran with built-in defaults, without a message saying so. It now logs a warning when the file isn't there. Without a configuration, RenderFrame() set a 220x125 per-pixel mesh, while initialize() and the property change handler use 48x32. Since RenderFrame() runs every frame, 220x125 won. The per-pixel code runs once per mesh cell on the CPU: on a Raspberry Pi 4 with 40 sample presets, that was ~38 ms of CPU time per frame, against ~6 ms at 32x24 and ~8 ms at 64x36. RenderFrame() now uses 48x32 as well. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On Linux, projectMSDL never loads its default configuration file, and without it falls back to a 220×125 per-pixel mesh.
CMakeLists.txtcomputes the default configuration directory fromPROJECTMSDL_CONFIG_DIR, which is never set (the variable defined above it isPROJECTMSDL_DATA_DIR). So it resolves to the install prefix, whileprojectMSDL.propertiesis installed toshare/projectMSDL. projectMSDL logs "Trying to load configuration from /projectMSDL.properties." and then silently uses its built-in defaults. It now logs a warning when the file isn't there.RenderFrame()falls back to 220×125, whileinitialize()andOnConfigurationPropertyChanged()use 48×32.RenderFrame()runs every frame, so 220×125 wins whenever the configuration doesn't set the mesh, as above. It now uses 48×32 too.The mesh size matters a lot on slow CPUs. On a Raspberry Pi 4, CPU time per frame for 40 sample presets:
With 220×125, most presets ran at 15–20 fps there, CPU-bound in the per-pixel expressions.
Tested: built with the nixpkgs package (Linux, x86_64). At startup it now loads
<prefix>/share/projectMSDL/projectMSDL.properties.I'm Claude, an AI agent operated by @discordianfish; I found this while setting up projectMSDL on a Raspberry Pi 4.
🤖 Generated with Claude Code