Commit Graph

73 Commits

Author SHA1 Message Date
aaf2f7485c Initialize new presets with the last frame of the previous preset.
This makes hard transitions a bit "smoother", as they won't always start from a black screen. Not really noticeable with fast presets, but some slow-warping ones will now gently dissolve the previous image.
2023-11-04 18:59:30 +01:00
c9b0ce0c2c Render random transitions.
The TimeKeeper-based "smoothing" code still needs to be cleaned up, same with the threading stuff which never really worked.
2023-11-01 23:16:30 +01:00
7b8af19fc4 Deleted the now unused Renderer class. 2023-10-24 16:39:37 +02:00
8461bb9586 Remove a few compiler warnings due to type conversions.
Many of those internal types need a cleanup later to consolidate them a bit more.
2023-10-14 13:53:41 +02:00
ceca33a088 Don't reset presets after changing the mesh size.
The warp mesh is now always resized/recalculated dynamically when a frame is drawn, nothing needs to be reloaded anymore.
2023-10-14 13:52:35 +02:00
f7b503efc4 Constrain per-pixel mesh size from 8x8 to 300x300 and only allow multiples of two. 2023-10-14 13:37:13 +02:00
b07163dd51 Check active preset after the preset switch event, as this might have failed.
Another option would be skipping the rendering if there's no active preset instead of displaying the idle preset.
2023-09-11 10:19:48 +02:00
e9438ee0f6 Deleted lots of unused files and code. 2023-09-11 10:19:48 +02:00
879c6c7111 Split StaticGlShaders class into shader files and code templates, removed ShaderEngine class.
Milkdrop shaders are now read from .vert/.frag and .inc files, then copied into a generated code file by CMake. Makes editing easier, as many IDEs can properly syntax-highlight the shader code.

The class was also moved into MilkdropPreset, as it's the only preset type which will ever make use of those shaders.

Deleted the now fully "dissolved" ShaderEngine class.
2023-09-11 10:19:48 +02:00
0ac9fe20f3 Finished final composite implementation, more fixes and cleanups.
Now rendering everything upside down to make up for the difference in UV coordinates in HLSL shaders.
2023-09-11 10:19:47 +02:00
ce0e5853b2 More work on shader stuff, warp/comp shaders now compile properly.
Fixed a transpile issue with a hack used by some preset authors to set a texture sampler to a different filter/wrap mode, removing the "sampler_state" block entirely now as there's no GLSL equivalent (samplers are solely configured on the application side).

Also consolidated a few vertex types into RenderItem and fixed a few old-school effects like DarkenCenter.
2023-09-11 10:19:47 +02:00
e603793402 Finished per-pixel mesh, started rework of warp/comp shaders and textures.
Moved per-pixel mesh texture coordinate calculations into the vertex shader. This is probably more performant than the SSE2 code in the old PresetFrameIO class, as the GPU is better at running this stuff in parallel.

All the texture management also needs some refactoring, so now that I've already broken everything, I can just do it as well.
2023-09-11 10:19:47 +02:00
102d4ba4cf Overhauled all primitives (waves, shapes and borders).
Now using Milkdrop's DX9 coordinate system for all vertex positions and have the vertex shader take care of transforming these into the OpenGL screen space. Makes calculations easier.

Also continued implementing per-pixel mesh and shader stuff.
2023-09-11 10:19:47 +02:00
e73b0f3092 Working on getting stuff being rendered again, focus on default waveform.
Fixed many typos, errors and crashes on the way.
2023-09-11 10:19:47 +02:00
e48e6f3962 Remove call to deleted function. 2023-09-11 10:19:46 +02:00
e7094aa190 Remove "Pipeline" classes and temp fix all compilation issues. 2023-09-11 10:19:46 +02:00
882321000b More rendering refactoring.
Continued refactoring work to make Milkdrop preset rendering more self-contained.
2023-09-11 10:19:45 +02:00
b9ef6a3974 Remove old expression parser and add the new projectm-eval lib.
Requires a general rewrite of the Milkdrop preset code. Previous implementation was tightly integrated into the code parser, so reusing this code wasn't possible. Additional refactoring was done, finished converting custom wave/shape implementations to use the new expression parser code.
2023-09-11 10:19:45 +02:00
46e720a7a7 Removed unused projectm_opengl_init_render_to_texture() API function. 2023-01-25 18:10:26 +01:00
e6b493a270 Removed unused projectm_set_texture_size() API function. 2023-01-25 18:09:02 +01:00
2b41fa256a Let developers provide an optional filename for dumping main texture contents. 2023-01-25 14:22:19 +01:00
bcaf98f2f1 Rename USE_THREADS to PROJECTM_USE_THREADS and export it in the package config file.
PROJECTM_USE_THREADS is only exported if ENABLE_CXX_INTERFACE is ON.
2023-01-24 17:56:12 +01:00
bff9e52c69 Reduce header footprint of optional C++ API files and export C++ symbols properly. 2023-01-24 17:47:39 +01:00
c8077a2145 Partially fix smooth blending.
There's still a sudden change between presets halfway through the transitions as the shaders are swapped, but fixing this would require a larger rewrite of how presets are rendered in the pipeline. Will do this later.
2023-01-07 15:52:51 +01:00
3dcb1f7a56 Fix preset change notification. 2023-01-07 15:52:51 +01:00
48f291b51c Removed config file support and added temp fix for mesh size change.
Mesh size is currently so deeply burrowed in the whole preset structure that changing it on the fly is basically impossible. For now, we'll reload the idle preset and reset the whole preset factory class tree to make sure all classes are properly reinitialized. If apps want to change the mesh size after startup, they need to reload the last played preset after changing the mesh size. This will be fixed in the future after the parser/equation compiler rewrite.
2023-01-07 15:52:50 +01:00
bbfc4f7170 Added API method for (re)setting texture search paths.
Was only possible on startup before, changing the paths required recreating the whole projectM instance. Now, the method will only reset the texture manager, but not the shaders and presets.
2023-01-07 15:52:50 +01:00
22b0ccc423 Removed some unused offset parameters in Renderer methods. 2023-01-07 15:52:46 +01:00
2410adc92e Fix file type string 2023-01-05 07:24:26 -06:00
e659d862b5 Remove built-in key handler and rename two API functions.
Renamed preset lock functions to be in line with all other getter/setter functions regarding their naming scheme.
2022-12-30 15:14:25 +01:00
b585017ba3 Fix a compile issue in emscripten by forward-declaring PipelineContext. 2022-12-06 15:03:10 +01:00
381fe4f51e Properly initialize idle preset and preset factory. 2022-12-04 21:51:36 +01:00
94ee2a360b Added remaining API functions and preset change callback. 2022-11-21 19:56:30 +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
b23b5ce25c Deleted all playlist-related code from libprojectM.
Note: SDL test UI won't compile after this commit. Will be fixed in a later commit, when the playlist library is done.
2022-11-21 19:56:28 +01:00
18b032a8ef API: Add missing setter for FPS value.
Also make sure to propagate the changed value to the preset code via the PipelineContext class. Keeping it in the settings struct for now. Storing a dynamic value in settings makes no sense, so it will be removed later.
2022-11-20 16:53:25 +01:00
003e45e9d9 API: Add missing getter for preset duration value. 2022-11-20 16:53:25 +01:00
6991953a4e Add get and set for beat sensitivy value to API 2022-10-29 23:00:45 +02:00
dbbbc3e591 Added API function for dumping the next frame. 2022-10-23 18:08:53 +02:00
cb0bbfa860 Removed all text-related code from the core lib.
This removes:
- "Toast" messages
- The help text
- Statistics
- Preset name and (unimplemented) song title display
- Preset selection list and search menu

Some of the above functionality might later be added as an optional library, in a separate repository and with proper UTF-8 support.
2022-09-20 22:46:03 +02:00
d97feb22f6 Entirely removed native presets.
The native presets did not build anymore due to refactorings, cause other build issues on Windows (e.g. require linking to psapi.lib) and would need a complete makeover anyway.
2022-09-18 13:32:58 +02:00
9c8e412cdb Replace broken WIN32 checks with _WIN32
CMake defines WIN32 by default on Windows, but we shouldn't rely on it.
_WIN32 is defined by all compilers targeting Windows.

Also cleaned up some header includes.
2022-09-16 10:47:56 +02:00
371365a03f ProjectM.cpp: Unname unused parameters
Amends the previous commit.

In order to avoid unused parameter warnings when building the library
itself, also unname these parameters here.

The names of these parameters are still named in ProjectM.hpp, so they
serve as documentation. In ProjectM.cpp, they are mere stubs.

As a drive-by, removed some unneeded newlines.
2022-09-15 16:57:40 +02:00
c547489feb ProjectM.{hpp,cpp}: Move event function stubs
This will avoid -Wunused-parameter warnings in client applications.
2022-09-15 16:57:40 +02:00
c1a0317367 Fixed a crash when calling ReadConfig() early. 2022-09-09 00:59:25 +02:00
4edfd687f5 Copy texturePath to settings member in ReadSettings()
Why isn't this done via a simple assignment?
2022-09-09 00:45:59 +02:00
60dd295ee6 Expose texture path in the public API, removed unused font settings. 2022-09-09 00:45:58 +02:00
66380727b2 Create texture search path list in ProjectM class, pass it to TextureManager. 2022-09-09 00:45:58 +02:00
6906d4ed60 Class Renderer: Renamed members, removed more unused ones. 2022-09-09 00:45:58 +02:00
a6293f63c8 Fix function name casing causing an error with threads disabled. 2022-07-11 14:26:57 +02:00