From bb55824394302f6befeb92beeab76d541213497b Mon Sep 17 00:00:00 2001 From: Mischa Spiegelmock Date: Mon, 12 Mar 2018 14:05:47 -0700 Subject: [PATCH 1/5] support native presets with .dylib --- .../NativePresetFactory/NativePresetFactory.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libprojectM/NativePresetFactory/NativePresetFactory.hpp b/src/libprojectM/NativePresetFactory/NativePresetFactory.hpp index 3e8febd4c..f8aa078ac 100644 --- a/src/libprojectM/NativePresetFactory/NativePresetFactory.hpp +++ b/src/libprojectM/NativePresetFactory/NativePresetFactory.hpp @@ -1,7 +1,7 @@ // // C++ Interface: NativePresetFactory // -// Description: +// Description: // // // Author: Carmelo Piccione , (C) 2008 @@ -26,16 +26,16 @@ public: virtual ~NativePresetFactory(); - virtual std::auto_ptr allocate(const std::string & url, const std::string & name = std::string(), + virtual std::auto_ptr allocate(const std::string & url, const std::string & name = std::string(), const std::string & author = std::string()); - virtual std::string supportedExtensions() const { return "so"; } + virtual std::string supportedExtensions() const { return "so dylib"; } private: PresetLibrary * loadLibrary(const std::string & url); typedef std::map PresetLibraryMap; PresetLibraryMap _libraries; - + }; #endif From 5920c5007cb83360bdb1706a1568a7ceb7616648 Mon Sep 17 00:00:00 2001 From: Mischa Spiegelmock Date: Mon, 12 Mar 2018 14:20:04 -0700 Subject: [PATCH 2/5] only add sdl makefile if building sdl --- configure.ac | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 592d07927..44f17691d 100644 --- a/configure.ac +++ b/configure.ac @@ -20,6 +20,7 @@ AS_IF([test "x$enable_sdl" = "xyes"], [ SDL_VERSION=2.0.5 AS_IF([test "$TRAVIS"], [SDL_VERSION=2.0.2]) # travis has old SDL, we don't care AM_PATH_SDL2($SDL_VERSION, :, AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])) + AC_CONFIG_FILES([src/projectM-sdl/Makefile]) ]) AC_CONFIG_HEADERS([config.h]) @@ -30,10 +31,10 @@ AC_CONFIG_FILES([ src/libprojectM/Renderer/Makefile src/libprojectM/NativePresetFactory/Makefile src/libprojectM/MilkdropPresetFactory/Makefile - src/projectM-sdl/Makefile ]) dnl FIXME -AC_CONFIG_FILES([src/libprojectM/config.inp], [sed -i -e"s/\${prefix}/$prefix/" src/libprojectM/config.inp]) +dnl AC_CONFIG_FILES([src/libprojectM/config.inp], +dnl [cat src/libprojectM/config.inp | sed -e"s,\${prefix},$prefix," > src/libprojectM/config.inp.b]) AC_PREFIX_DEFAULT([/usr/local]) From 1969e144c8fd907620d3c0b360c8cb0280d59fbb Mon Sep 17 00:00:00 2001 From: Mischa Spiegelmock Date: Mon, 12 Mar 2018 14:20:31 -0700 Subject: [PATCH 3/5] test building sdl --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7ff14ca87..32e8604eb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,8 +5,8 @@ before_install: - eval "${MATRIX_EVAL}" script: - - ./configure --prefix=$PWD/local && make -j8 && make install # build from checkoout - - make dist && tar -zxf projectM-*.tar.gz && cd projectM-* && ./configure --prefix=$PWD/local && make -j8 && make install # build from dist\ + - ./configure --enable-sdl --prefix=$PWD/local && make -j8 && make install # build from checkoout + - make dist && tar -zxf projectM-*.tar.gz && cd projectM-* && ./configure --enable-sdl --prefix=$PWD/local && make -j8 && make install # build from dist\ - echo "PWD $PWD" - ls . - test -e src/projectM-sdl/projectMSDL From 5ac192c35b4daa39cd609b0455e23ce2c8eb433f Mon Sep 17 00:00:00 2001 From: Abram Hindle Date: Mon, 12 Mar 2018 16:43:12 -0600 Subject: [PATCH 4/5] build your config w/o fancy sed (#43) --- Makefile.am | 11 +++++++++++ configure.ac | 11 ++++++++--- src/libprojectM/{config.inp.in => config.inp.in.in} | 2 +- 3 files changed, 20 insertions(+), 4 deletions(-) rename src/libprojectM/{config.inp.in => config.inp.in.in} (89%) diff --git a/Makefile.am b/Makefile.am index 4dc536589..b8623785d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -20,3 +20,14 @@ pm_shaders__DATA = src/libprojectM/Renderer/blur.cg \ install-data-local: test -z $(pkgdatadir) || $(MKDIR_P) $(pm_presets_dir) find "$(PRESETSDIR)" -type f -exec $(INSTALL_DATA) {} $(pm_presets_dir) \; + +# from https://stackoverflow.com/questions/30897170/ac-subst-does-not-expand-variable answer: https://stackoverflow.com/a/30960268 +# ptomato https://stackoverflow.com/users/172999/ptomato + +src/libprojectM/config.inp: src/libprojectM/config.inp.in Makefile + $(AM_V_GEN)rm -f $@ $@.tmp && \ + $(SED) -e "s,%datadir%,$(datadir),"g $< >$@.tmp && \ + chmod a-w $@.tmp && \ + mv $@.tmp $@ + +CLEANFILES += src/libprojectM/config.inp diff --git a/configure.ac b/configure.ac index 44f17691d..5c2b502b2 100644 --- a/configure.ac +++ b/configure.ac @@ -32,9 +32,14 @@ AC_CONFIG_FILES([ src/libprojectM/NativePresetFactory/Makefile src/libprojectM/MilkdropPresetFactory/Makefile ]) -dnl FIXME -dnl AC_CONFIG_FILES([src/libprojectM/config.inp], -dnl [cat src/libprojectM/config.inp | sed -e"s,\${prefix},$prefix," > src/libprojectM/config.inp.b]) + +dnl from https://stackoverflow.com/questions/30897170/ac-subst-does-not-expand-variable answer: https://stackoverflow.com/a/30960268 +dnl ptomato https://stackoverflow.com/users/172999/ptomato + +AC_SUBST([PACKAGE]) +AC_PROG_SED +AC_CONFIG_FILES([src/libprojectM/config.inp.in]) + AC_PREFIX_DEFAULT([/usr/local]) diff --git a/src/libprojectM/config.inp.in b/src/libprojectM/config.inp.in.in similarity index 89% rename from src/libprojectM/config.inp.in rename to src/libprojectM/config.inp.in.in index 26826a274..878f54f0c 100644 --- a/src/libprojectM/config.inp.in +++ b/src/libprojectM/config.inp.in.in @@ -16,6 +16,6 @@ Easter Egg Parameter = 1 Hard Cut Sensitivity = 10 # Lower to make hard cuts more frequent Aspect Correction = true # Custom Shape Aspect Correction -Preset Path = @datarootdir@/presets # preset location +Preset Path = %datadir%/@PACKAGE@/presets # preset location Title Font = Vera.ttf Menu Font = VeraMono.ttf From 707e200676b8338dec55717bb98a1d6ddfd7f4dd Mon Sep 17 00:00:00 2001 From: Mischa Spiegelmock Date: Tue, 13 Mar 2018 02:28:24 +0200 Subject: [PATCH 5/5] Native presets (#44) * native presets building and work. need to figure out how to install them to the right place. * revert main * comments * fix nativepreset installation dir to be presets dir --- configure.ac | 1 + src/Makefile.am | 2 +- src/NativePresets/Makefile.am | 29 ++++++++++++++++++++++++++ src/NativePresets/RLGFractalDrop7c.cpp | 5 +++-- 4 files changed, 34 insertions(+), 3 deletions(-) create mode 100644 src/NativePresets/Makefile.am diff --git a/configure.ac b/configure.ac index 5c2b502b2..55ebf77ac 100644 --- a/configure.ac +++ b/configure.ac @@ -31,6 +31,7 @@ AC_CONFIG_FILES([ src/libprojectM/Renderer/Makefile src/libprojectM/NativePresetFactory/Makefile src/libprojectM/MilkdropPresetFactory/Makefile + src/NativePresets/Makefile ]) dnl from https://stackoverflow.com/questions/30897170/ac-subst-does-not-expand-variable answer: https://stackoverflow.com/a/30960268 diff --git a/src/Makefile.am b/src/Makefile.am index 701e040df..76fef5049 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1 +1 @@ -SUBDIRS=libprojectM projectM-sdl +SUBDIRS=libprojectM projectM-sdl NativePresets diff --git a/src/NativePresets/Makefile.am b/src/NativePresets/Makefile.am new file mode 100644 index 000000000..9a7e4f480 --- /dev/null +++ b/src/NativePresets/Makefile.am @@ -0,0 +1,29 @@ +AM_CPPFLAGS = \ +-include $(top_builddir)/config.h \ +-I${top_srcdir}/src/libprojectM \ +-I${top_srcdir}/src/libprojectM/Renderer \ +-I${top_srcdir}/src/libprojectM/NativePresetFactory + +AM_CFLAGS = ${my_CFLAGS} \ +-fvisibility=hidden \ +-ffunction-sections \ +-fdata-sections + +presetsdir = $(pkgdatadir)/presets + +# native presets are shared object files. +# they should get installed to $presetsdir/ +presets_LTLIBRARIES = \ + libMstressJuppyDancer.la \ + libRLGFractalDrop7c.la \ + libRovastarDarkSecret.la \ + libRovastarDriftingChaos.la \ + libRovastarFractalSpiral.la \ + libRovastarFractopiaFrantic.la + +libMstressJuppyDancer_la_SOURCES = MstressJuppyDancer.cpp +libRLGFractalDrop7c_la_SOURCES = RLGFractalDrop7c.cpp +libRovastarDarkSecret_la_SOURCES = RovastarDarkSecret.cpp +libRovastarDriftingChaos_la_SOURCES = RovastarDriftingChaos.cpp +libRovastarFractalSpiral_la_SOURCES = RovastarFractalSpiral.cpp +libRovastarFractopiaFrantic_la_SOURCES = RovastarFractopiaFrantic.cpp diff --git a/src/NativePresets/RLGFractalDrop7c.cpp b/src/NativePresets/RLGFractalDrop7c.cpp index fe9640956..17b0de039 100644 --- a/src/NativePresets/RLGFractalDrop7c.cpp +++ b/src/NativePresets/RLGFractalDrop7c.cpp @@ -11,6 +11,7 @@ #include "MilkdropCompatability.hpp" #include "VideoEcho.hpp" #include "NativePreset.hpp" +#include "MilkdropWaveform.hpp" class RLGFractalDrop7c : public Pipeline { @@ -140,7 +141,7 @@ public: shape4.ang = time; } - virtual Point PerPixel(Point p, const PerPixelContext context) + virtual PixelPoint PerPixel(PixelPoint p, const PerPixelContext context) { Transforms::Zoom(p,context,1.029902,1.00); return p; @@ -149,7 +150,7 @@ public: }; -typedef NativePreset RLGFractalDrop7Preset; +typedef NativePreset RLGFractalDrop7Preset; extern "C" RLGFractalDrop7Preset * create(const char * url) { return new RLGFractalDrop7Preset(std::string(url));