The picomodel IQM code makes NetRadiant crash on macOS.
No one has found time to investigate this in month.
We need a working NetRadiant IQM plugin to load
Unvanquished game entity models on macOS, the
plugin from AAradiant (AlienArena project) is
known to work.
Q3map2 uses picomodel to load IQM on all platforms
because iqmmodel plugin is radiant-only, so there
may be a remaining bug when baking IQM models in BSP
with q3map2 on macOS (not tested), but editing a map
with IQM entity models and misc_animated_models will
not crash NetRadiant.
This patch makes possible to release a macOS NetRadiant
build that don't crash when rendering IQM models.
We should fix picomodel crash with IQM on macOS in any way,
because it is believed q3map2 may need it, but waiting for
a picomodel fix will not delay any NetRadiant release.
One can force NetRadiant to be built against a given IQM
plugin (for example to debug it) whatever the platform
by setting the RADIANT_IQM_PLUGIN CMake variable to
either `iqmmodel` or `picomodel`. Any other value,
including empty string, will set the default plugin for
the platform.
add_definitions(-DWORKAROUND_MACOS_GTK2_LAGGYPOINTER=1)
endif ()
endif()
+
+ # Should be set here because the define is used in libs/
+ set(RADIANT_IQM_PLUGIN_HELP "IQM Plugin used by NetRadiant (iqmmodel, picomodel)")
+ set(RADIANT_IQM_PLUGIN "" CACHE STRING "${RADIANT_IQM_PLUGIN_HELP}")
+ if("${RADIANT_IQM_PLUGIN}" STREQUAL "iqmmodel")
+ elseif("${RADIANT_IQM_PLUGIN}" STREQUAL "picomodel")
+ else()
+ if(APPLE)
+ # The picomodel iqm library is buggy on recent macOS
+ set(RADIANT_IQM_PLUGIN "iqmmodel" CACHE STRING "${RADIANT_IQM_PLUGIN_HELP}" FORCE)
+ else()
+ set(RADIANT_IQM_PLUGIN "picomodel" CACHE STRING "${RADIANT_IQM_PLUGIN_HELP}" FORCE)
+ endif()
+ endif()
+ add_definitions(-DRADIANT_IQM_PLUGIN_${RADIANT_IQM_PLUGIN}=1)
+ add_definitions(-DRADIANT_IQM_PLUGIN="${RADIANT_IQM_PLUGIN}")
endif ()
#-----------------------------------------------------------------------
+if("${RADIANT_IQM_PLUGIN}" STREQUAL "picomodel")
+ set(PICO_IQM_FILE "pm_iqm.c")
+endif()
+
add_library(picomodel STATIC
lwo/clip.c
lwo/envelope.c
pm_3ds.c
pm_ase.c
pm_fm.c pm_fm.h
- pm_iqm.c
+ ${PICO_IQM_FILE}
pm_lwo.c
pm_md2.c
pm_md3.c
extern const picoModule_t picoModuleFM;
extern const picoModule_t picoModuleLWO;
extern const picoModule_t picoModuleTerrain;
+#if defined(RADIANT_IQM_PLUGIN_picomodel)
extern const picoModule_t picoModuleIQM;
+#endif // defined(RADIANT_IQM_PLUGIN_picomodel)
&picoModuleLWO, /* lightwave object */
&picoModuleTerrain, /* picoterrain object */
&picoModuleOBJ, /* wavefront object */
+#if defined(RADIANT_IQM_PLUGIN_picomodel)
&picoModuleIQM, /* interquake model */
+#endif // defined(RADIANT_IQM_PLUGIN_picomodel)
NULL /* arnold */
};
add_subdirectory(imagepng)
add_subdirectory(imageq2)
add_subdirectory(imagewebp)
-add_subdirectory(iqmmodel)
+
+if("${RADIANT_IQM_PLUGIN}" STREQUAL "iqmmodel")
+ add_subdirectory(iqmmodel)
+endif()
+
add_subdirectory(mapq3)
add_subdirectory(mapxml)
add_subdirectory(md3model)
+
+# picomodel: md3, obj, ase, (optional) iqm
add_subdirectory(model)
+
add_subdirectory(shaders)
add_subdirectory(vfspk3)
time( &localtime );
globalOutputStream() << "Today is: " << ctime( &localtime )
<< "This is " RADIANT_NAME " " RADIANT_VERSION " compiled " __DATE__ "\n" RADIANT_ABOUTMSG "\n";
+ globalOutputStream() << "IQM plugin: " RADIANT_IQM_PLUGIN "\n";
}
else{
ui::alert( ui::root, "Failed to create log file, check write permissions in " RADIANT_NAME " directory.\n",