mirror of
https://github.com/projectM-visualizer/projectm.git
synced 2026-03-07 16:05:26 +00:00
Crash fix when using multiple renderers (do not use static currentPipe) (#428)
Co-authored-by: djdron <djdron@gmail.com>
This commit is contained in:
@ -17,8 +17,6 @@
|
||||
#include <chrono>
|
||||
#include <ctime>
|
||||
|
||||
Pipeline* Renderer::currentPipe;
|
||||
|
||||
using namespace std::chrono;
|
||||
|
||||
class Preset;
|
||||
@ -533,7 +531,11 @@ void Renderer::Interpolation(const Pipeline& pipeline, const PipelineContext& pi
|
||||
else
|
||||
{
|
||||
mesh.Reset();
|
||||
omptl::transform(mesh.p.begin(), mesh.p.end(), mesh.identity.begin(), mesh.p.begin(), &Renderer::PerPixel);
|
||||
Pipeline *cp = currentPipe;
|
||||
omptl::transform(mesh.p.begin(), mesh.p.end(), mesh.identity.begin(), mesh.p.begin(),
|
||||
[cp](PixelPoint p, PerPixelContext &context) {
|
||||
return cp->PerPixel(p, context);
|
||||
});
|
||||
|
||||
for (int j = 0; j < mesh.height - 1; j++)
|
||||
{
|
||||
|
||||
@ -190,7 +190,7 @@ private:
|
||||
PerPixelMesh mesh;
|
||||
BeatDetect *beatDetect;
|
||||
TextureManager *textureManager;
|
||||
static Pipeline* currentPipe;
|
||||
Pipeline* currentPipe;
|
||||
TimeKeeper *timeKeeperFPS;
|
||||
TimeKeeper *timeKeeperToast;
|
||||
|
||||
@ -252,11 +252,6 @@ private:
|
||||
void CompositeShaderOutput(const Pipeline &pipeline, const PipelineContext &pipelineContext);
|
||||
void CompositeOutput(const Pipeline &pipeline, const PipelineContext &pipelineContext);
|
||||
|
||||
inline static PixelPoint PerPixel(PixelPoint p, PerPixelContext &context)
|
||||
{
|
||||
return currentPipe->PerPixel(p,context);
|
||||
}
|
||||
|
||||
void rescale_per_pixel_matrices();
|
||||
|
||||
void draw_toast();
|
||||
|
||||
Reference in New Issue
Block a user