Skip to content

Read preset equations like MilkDrop: join lines without separator, skip blocks that do not compile - #1084

Open
Karlos-fr wants to merge 1 commit into
projectM-visualizer:masterfrom
Karlos-fr:fix/milkdrop-equation-compat
Open

Karlos-fr wants to merge 1 commit into
projectM-visualizer:masterfrom
Karlos-fr:fix/milkdrop-equation-compat

Conversation

@Karlos-fr

Copy link
Copy Markdown

Fixes #1083.

  • PresetFileParser::GetCode(): equation lines are concatenated without a separator after stripping // and \\ comments, as MilkDrop does in ReadCode() + StripLinefeedCharsAndComments(), and as the function's documentation already states. Shader lines (starting with a backtick) still get one line per line.
  • PerFrameContext, PerPixelContext, ShapePerFrameContext, WaveformPerFrameContext, WaveformPerPointContext: a block that does not compile is logged with LOG_WARN and skipped instead of throwing MilkdropCompileException, so the preset runs without it, as in MilkDrop. Code handles were already checked for nullptr before execution.

Testing

  • All 144,906 equation blocks of presets-cream-of-the-crop compiled with projectm-eval, before and after: no regression, failing presets go from 67 to 0.
  • The 67 presets loaded and rendered on a Sony BRAVIA (Mali-G57, GLES 3.2) with the same change applied to 4.1.8.
  • master with this change builds for Android (NDK, armeabi-v7a, GLES).

- PresetFileParser::GetCode(): equation lines are now concatenated without a
  separator after stripping // and \ comments, as Milkdrop does in
  ReadCode() + StripLinefeedCharsAndComments(), and as this function's own
  documentation states ("Equations are returned as a single, long line").
  Presets with a name or number split across two lines (e.g. 'k1 = is_' +
  'beat*...') failed to compile.
- An equation block that does not compile no longer makes the whole preset
  fail: as in Milkdrop, which only shows a warning, the preset runs without
  that block. The error is logged with LOG_WARN.

On presets-cream-of-the-crop (9857 presets, 144906 equation blocks checked
with projectm-eval), failing presets go from 67 to 0, with no regression in
the other presets.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

67 Cream of the Crop presets fail with "Could not compile ..." because equation lines are not joined like MilkDrop

1 participant