From dee0e0cddc0fc5beb17d37a6f8a6c2cf074110f9 Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Wed, 25 Jan 2023 04:09:22 +0100 Subject: [PATCH 1/3] Plugins (gforce): Be more helpful about font loading errors Note that lv-tool currently needs to to be invoked with "-v" to display warnings. (cherry picked from commit 24d4ea7c0a7b099693db6743cbdaddebd4bced2b) --- .../plugins/actor/gforce/unix/libmfl/mfl.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/libvisual-plugins/plugins/actor/gforce/unix/libmfl/mfl.c b/libvisual-plugins/plugins/actor/gforce/unix/libmfl/mfl.c index 598ecc534..cc476868c 100644 --- a/libvisual-plugins/plugins/actor/gforce/unix/libmfl/mfl.c +++ b/libvisual-plugins/plugins/actor/gforce/unix/libmfl/mfl.c @@ -51,7 +51,10 @@ mfl_font mfl_LoadRawFont(const char *fname) { /* Open font file */ ff = fopen(fname, "rb"); - if (ff == NULL) goto lrf_open_fault; + if (ff == NULL) { + visual_log (VISUAL_LOG_WARNING, "Unable to open font file: %s", fname); + goto lrf_open_fault; + } /* Get length of font file */ if (fseek(ff, 0, SEEK_END) != 0) goto lrf_fault; @@ -70,6 +73,7 @@ mfl_font mfl_LoadRawFont(const char *fname) { /* Read font data */ if (fread(f->data, 1, l, ff) != l) { + visual_log (VISUAL_LOG_WARNING, "Unable to fully read font file: %s", fname); free(f->data); free(f); f = NULL; @@ -84,7 +88,9 @@ mfl_font mfl_LoadRawFont(const char *fname) { } void mfl_DestroyFont(mfl_font f) { - visual_return_if_fail(f != NULL); + if (f == NULL) { + return; + } free(f->data); free(f); } From a5ee25bf9ef4663e6ba6ffc13faf2ed3c86ca153 Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Wed, 25 Jan 2023 17:40:17 +0100 Subject: [PATCH 2/3] Plugins (gforce): Fix empty/broken DATADIR macro for PixPort.cpp --- libvisual-plugins/plugins/actor/gforce/Common/UI/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libvisual-plugins/plugins/actor/gforce/Common/UI/CMakeLists.txt b/libvisual-plugins/plugins/actor/gforce/Common/UI/CMakeLists.txt index ce395bd2f..1c6df7ce5 100644 --- a/libvisual-plugins/plugins/actor/gforce/Common/UI/CMakeLists.txt +++ b/libvisual-plugins/plugins/actor/gforce/Common/UI/CMakeLists.txt @@ -1,6 +1,6 @@ FILE(GLOB gforce_ui_HEADERS "Headers/*") -SET(DATADIR $(LV_PLUGIN_DATA_DIR)) +SET(DATADIR ${LV_PLUGIN_DATA_DIR}/actor/actor_gforce) # Missing DrawXX.cpp and LineXX.cpp SET(gforce_ui_SOURCES From 53dd1c14d33f765d537360317b90c3ff203fd00e Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Wed, 25 Jan 2023 04:07:14 +0100 Subject: [PATCH 3/3] Plugins (gforce): Install font file "deffont" to where it is currently expected (related to 0.4.x commit 5518be74e253480186d7726db40c6824c85de163) --- libvisual-plugins/plugins/actor/gforce/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libvisual-plugins/plugins/actor/gforce/CMakeLists.txt b/libvisual-plugins/plugins/actor/gforce/CMakeLists.txt index 2676ce4fe..d3e97f05c 100644 --- a/libvisual-plugins/plugins/actor/gforce/CMakeLists.txt +++ b/libvisual-plugins/plugins/actor/gforce/CMakeLists.txt @@ -18,3 +18,5 @@ ADD_SUBDIRECTORY(GForceWaveShapes) #ADD_SUBDIRECTORY(NotWorkingWaveShapes) ADD_SUBDIRECTORY(unix) ADD_SUBDIRECTORY(docs) + +INSTALL(FILES deffont DESTINATION ${GFORCE_DATA_DIR})