Skip to content

Commit 24dd7d0

Browse files
authored
Merge pull request #217 from Libvisual/gforce-fixing
libvisual-plugins: Fix issues with font loading for actor "gforce"
2 parents f1b5a56 + 53dd1c1 commit 24dd7d0

3 files changed

Lines changed: 11 additions & 3 deletions

File tree

libvisual-plugins/plugins/actor/gforce/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,5 @@ ADD_SUBDIRECTORY(GForceWaveShapes)
1818
#ADD_SUBDIRECTORY(NotWorkingWaveShapes)
1919
ADD_SUBDIRECTORY(unix)
2020
ADD_SUBDIRECTORY(docs)
21+
22+
INSTALL(FILES deffont DESTINATION ${GFORCE_DATA_DIR})

libvisual-plugins/plugins/actor/gforce/Common/UI/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FILE(GLOB gforce_ui_HEADERS "Headers/*")
22

3-
SET(DATADIR $(LV_PLUGIN_DATA_DIR))
3+
SET(DATADIR ${LV_PLUGIN_DATA_DIR}/actor/actor_gforce)
44

55
# Missing DrawXX.cpp and LineXX.cpp
66
SET(gforce_ui_SOURCES

libvisual-plugins/plugins/actor/gforce/unix/libmfl/mfl.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,10 @@ mfl_font mfl_LoadRawFont(const char *fname) {
5151

5252
/* Open font file */
5353
ff = fopen(fname, "rb");
54-
if (ff == NULL) goto lrf_open_fault;
54+
if (ff == NULL) {
55+
visual_log (VISUAL_LOG_WARNING, "Unable to open font file: %s", fname);
56+
goto lrf_open_fault;
57+
}
5558

5659
/* Get length of font file */
5760
if (fseek(ff, 0, SEEK_END) != 0) goto lrf_fault;
@@ -70,6 +73,7 @@ mfl_font mfl_LoadRawFont(const char *fname) {
7073

7174
/* Read font data */
7275
if (fread(f->data, 1, l, ff) != l) {
76+
visual_log (VISUAL_LOG_WARNING, "Unable to fully read font file: %s", fname);
7377
free(f->data);
7478
free(f);
7579
f = NULL;
@@ -84,7 +88,9 @@ mfl_font mfl_LoadRawFont(const char *fname) {
8488
}
8589

8690
void mfl_DestroyFont(mfl_font f) {
87-
visual_return_if_fail(f != NULL);
91+
if (f == NULL) {
92+
return;
93+
}
8894
free(f->data);
8995
free(f);
9096
}

0 commit comments

Comments
 (0)