Google Code-in: Hide "video record" keybind option
Removes the recording keybinding option using preprocessor conditions when it is unavailable. This includes when Hedgewars is being built either with the recording feature explicitly disabled or when FFMPEG/LibAV were not found.
https://google-melange.appspot.com/gci/task/view/google/gci2012/7948213
--- a/QTfrontend/CMakeLists.txt Thu Nov 29 14:48:38 2012 -0500
+++ b/QTfrontend/CMakeLists.txt Thu Nov 29 19:44:18 2012 -0500
@@ -20,6 +20,9 @@
find_package(SDL_net REQUIRED) #network frontlib
if(NOT NOVIDEOREC)
find_package(FFMPEG)
+ if(${FFMPEG_FOUND})
+ add_definitions(-DUSE_VIDEO_RECORDING)
+ endif()
endif()
include_directories(.)
--- a/QTfrontend/binds.cpp Thu Nov 29 14:48:38 2012 -0500
+++ b/QTfrontend/binds.cpp Thu Nov 29 19:44:18 2012 -0500
@@ -66,5 +66,7 @@
{"fullscr", "f12", QT_TRANSLATE_NOOP("binds", "change mode"), NULL, QT_TRANSLATE_NOOP("binds (descriptions)", "Toggle fullscreen mode:")},
{"capture", "c", QT_TRANSLATE_NOOP("binds", "capture"), NULL, QT_TRANSLATE_NOOP("binds (descriptions)", "Take a screenshot:")},
{"rotmask", "delete", QT_TRANSLATE_NOOP("binds", "hedgehogs\ninfo"), NULL, QT_TRANSLATE_NOOP("binds (descriptions)", "Toggle labels above hedgehogs:")},
+#ifdef USE_VIDEO_RECORDING
{"record", "r", QT_TRANSLATE_NOOP("binds", "record"), NULL, QT_TRANSLATE_NOOP("binds (descriptions)", "Record video:")}
+#endif
};
--- a/QTfrontend/binds.h Thu Nov 29 14:48:38 2012 -0500
+++ b/QTfrontend/binds.h Thu Nov 29 19:44:18 2012 -0500
@@ -21,7 +21,11 @@
#include <QString>
+#ifdef USE_VIDEO_RECORDING
#define BINDS_NUMBER 46
+#else
+#define BINDS_NUMBER 45
+#endif
struct BindAction
{