Commit Graph

20 Commits

Author SHA1 Message Date
1429b57f87 Build fixes, expose fewer internals in headers by forward-declaring more types. 2022-12-05 11:46:43 +01:00
2b1099a653 Implement external preset switching control and add stream loading support.
Lots of interconnected changes in this commit:
- Removed unnecessary name/author/filename members all over the place.
- Started using exceptions to deliver preset loading and rendering errors to the topmost ProjectM class.
- Added stream loading methods to factories and the base Preset class.
- Added new events for requesting preset switch and telling the user about loading errors.
- Consolidated preset switching logic in ProjectM class a bit.
2022-11-21 19:56:30 +01:00
35d3112463 Use correct casing 2022-05-29 15:29:54 +02:00
3f3ea5d0c4 Fixed a few memory management issues with presets.
Mainly two problems:
- MilkdropPresetFactory deleted a private reference-typed member in MilkdropPreset. Changed this into a plain pointer which is now checked and properly cleaned up.
- In the library interface class, projectM, the active preset pointers were not deleted before the factors, which lead to a use-after-free when the presets tried to dereference the factory pointer.
2021-07-04 15:49:38 +02:00
147c4e0e89 Reformatted some code and updated .clang_format file. 2021-07-04 15:49:38 +02:00
e49720ecfa Preset subdirs (#385)
Scanning textures/presets dirs for textures and scanning preset dir for presets.
Scanning is now done recursively, so presets and textures can be organized into subdirectories instead of needing to be flattened into a single directory.

On POSIX systems makes use of [ftw](https://linux.die.net/man/3/ftw) which should be relatively efficient. Otherwise falls back to recursing with `dirent` (for windows).

Probably should have made an autoconf check for `ftw` instead of doing `#ifdef WIN32`. 

* Scan subdirectories in presets directory

* remove preset subdir config

* Recursively scan for textures too, add c++-17 compatibility

* Refactor directory scanning code so it's reused by texture loader and preset loader. Make cross-platform (maybe)

* filescanner in makefile

* extension filter for file loader

* make extensions match up'

* need string.h

* Add FileScanner.cpp to win build (maybe)

* scan all dirs

* #ifndef #ifdef is def fun

* bogus comment

* bleh

* bleh

* itunes plugin with c++17

* EyeTunes needs to know about the FileScanner

Co-authored-by: milkdropper.com <milkdropper.com@gmail.com>
Co-authored-by: milkdropper <59471060+milkdropper@users.noreply.github.com>
2020-07-28 22:01:56 +03:00
72b149ae2c caching one PresetOutputs appears to be sufficient 2019-01-08 16:37:51 -08:00
1b16539d3a More complete fix to PresetOutput bug.
created matching allocate/release methods for PresetOutput, so there is no implicit dependency on behavior between projectM::switchPreset() and MilkdropPresetFactory::allocate()
2019-01-08 14:16:24 -08:00
d4d74f6d05 Build warnings cleanup 2018-11-17 11:42:28 +01:00
28f34f53d3 WIP: now some presets shaders are compiled
- HLSL: Lots of HLSLparser fixes
- HLSL: Add Preprocessor macro support
- HLSL: Add functions: modf, tan
- HLSL: Add while loops support
- Shader static code fixes
- Add define DUMP_SHADERS_ON_ERROR
- ShaderEngine.hpp cleanup
- Restore current preset message
- Remove useless messages
2018-06-22 19:38:54 +02:00
c28c4b9efe playlist file / directory error handling fixes, resize playlist refresh fix
git-svn-id: https://projectm.svn.sourceforge.net/svnroot/projectm/trunk@1342 6778bc44-b910-0410-a7a0-be141de4315d
2010-07-29 01:46:44 +00:00
4c34bc5c12 dont free custom waves as preset may still need them (solution to freeing them is pending)
git-svn-id: https://projectm.svn.sourceforge.net/svnroot/projectm/trunk@1284 6778bc44-b910-0410-a7a0-be141de4315d
2009-09-07 22:30:28 +00:00
c5b2fa9042 explicitly reset preset outputs before assigning it to a preset.
git-svn-id: https://projectm.svn.sourceforge.net/svnroot/projectm/trunk@1283 6778bc44-b910-0410-a7a0-be141de4315d
2009-09-07 17:56:46 +00:00
fca7e835b3 I must apologize to our users. The state of projectM in trunk has been dismal until late. The preset merging code was a mess. A fundamental flaw in the way we were handling Milkdrop preset state was preventing smooth switching from achieving correct behavior. Some confusing trace led me to the culprit, MilkdropPresetFactory. HE would reuse the same PresetOutputs struct for every preset, leading our Pipeline infrastructure astray at every turn. A simple adjustment should suffice. Some extra thought was put into PipelineMerger on top of these corrections. A release is now imminent. Preset Merging is still nascent in this release, but now it is worth looking at.
git-svn-id: https://projectm.svn.sourceforge.net/svnroot/projectm/trunk@1250 6778bc44-b910-0410-a7a0-be141de4315d
2009-07-28 04:26:52 +00:00
ea33adbdc8 merge function partial implementation in projectm toplevel.
git-svn-id: https://projectm.svn.sourceforge.net/svnroot/projectm/trunk@1233 6778bc44-b910-0410-a7a0-be141de4315d
2009-07-10 04:19:14 +00:00
91639a6ff5 carm: memory leak fix when multiple preset extensions exist for same factory pointer.
git-svn-id: https://projectm.svn.sourceforge.net/svnroot/projectm/personal/carm/represet@1204 6778bc44-b910-0410-a7a0-be141de4315d
2009-01-22 04:15:24 +00:00
574c81c542 fixed memory leak on milkdrop preset factory destroy.
git-svn-id: https://projectm.svn.sourceforge.net/svnroot/projectm/personal/carm/represet@1203 6778bc44-b910-0410-a7a0-be141de4315d
2009-01-20 05:57:34 +00:00
dd8a4d6603 libprojectM builds correctly!
git-svn-id: https://projectm.svn.sourceforge.net/svnroot/projectm/personal/carm/represet@1184 6778bc44-b910-0410-a7a0-be141de4315d
2008-09-26 17:39:21 +00:00
71ce48bdcb incrementally closer to buildable system
git-svn-id: https://projectm.svn.sourceforge.net/svnroot/projectm/personal/carm/represet@1180 6778bc44-b910-0410-a7a0-be141de4315d
2008-09-20 19:21:36 +00:00
64a2490c66 fun with the svn mv command!
git-svn-id: https://projectm.svn.sourceforge.net/svnroot/projectm/personal/carm/represet@1173 6778bc44-b910-0410-a7a0-be141de4315d
2008-09-19 22:33:01 +00:00