File tree Expand file tree Collapse file tree 4 files changed +25
-14
lines changed
GeneralsMD/Code/GameEngineDevice
Include/W3DDevice/GameClient Expand file tree Collapse file tree 4 files changed +25
-14
lines changed Original file line number Diff line number Diff line change @@ -229,18 +229,20 @@ target_link_libraries(z_gameenginedevice PUBLIC
229
229
z_gameengine
230
230
)
231
231
232
- # FFmpeg
233
- find_package (FFMPEG )
232
+ if ( RTS_BUILD_OPTION_FFMPEG )
233
+ find_package (FFMPEG REQUIRED )
234
234
235
- if (FFMPEG_FOUND )
236
- target_sources (z_gameenginedevice PRIVATE
237
- Include /VideoDevice/FFmpeg/FFmpegFile.h
238
- Include /VideoDevice/FFmpeg/FFmpegVideoPlayer.h
239
- Source /VideoDevice/FFmpeg/FFmpegFile.cpp
240
- Source /VideoDevice/FFmpeg/FFmpegVideoPlayer.cpp
241
- )
235
+ if (FFMPEG_FOUND )
236
+ target_sources (z_gameenginedevice PRIVATE
237
+ Include /VideoDevice/FFmpeg/FFmpegFile.h
238
+ Include /VideoDevice/FFmpeg/FFmpegVideoPlayer.h
239
+ Source /VideoDevice/FFmpeg/FFmpegFile.cpp
240
+ Source /VideoDevice/FFmpeg/FFmpegVideoPlayer.cpp
241
+ )
242
242
243
- target_include_directories (z_gameenginedevice PRIVATE ${FFMPEG_INCLUDE_DIRS} )
244
- target_link_directories (z_gameenginedevice PRIVATE ${FFMPEG_LIBRARY_DIRS} )
245
- target_link_libraries (z_gameenginedevice PRIVATE ${FFMPEG_LIBRARIES} )
243
+ target_include_directories (z_gameenginedevice PRIVATE ${FFMPEG_INCLUDE_DIRS} )
244
+ target_link_directories (z_gameenginedevice PRIVATE ${FFMPEG_LIBRARY_DIRS} )
245
+ target_link_libraries (z_gameenginedevice PRIVATE ${FFMPEG_LIBRARIES} )
246
+ target_compile_definitions (z_gameenginedevice PUBLIC RTS_HAS_FFMPEG )
247
+ endif ()
246
248
endif ()
Original file line number Diff line number Diff line change 49
49
#include " W3DDevice/GameClient/W3DGameFont.h"
50
50
#include " W3DDevice/GameClient/W3DDisplayStringManager.h"
51
51
#include " VideoDevice/Bink/BinkVideoPlayer.h"
52
+ #ifdef RTS_HAS_FFMPEG
53
+ #include " VideoDevice/FFmpeg/FFmpegVideoPlayer.h"
54
+ #endif
52
55
#include " Win32Device/GameClient/Win32DIKeyboard.h"
53
56
#include " Win32Device/GameClient/Win32DIMouse.h"
54
57
#include " Win32Device/GameClient/Win32Mouse.h"
@@ -111,8 +114,11 @@ class W3DGameClient : public GameClient
111
114
112
115
// / Manager for display strings
113
116
virtual DisplayStringManager *createDisplayStringManager ( void ) { return NEW W3DDisplayStringManager; }
114
-
117
+ #ifdef RTS_HAS_FFMPEG
118
+ virtual VideoPlayerInterface *createVideoPlayer ( void ) { return NEW FFmpegVideoPlayer; }
119
+ #else
115
120
virtual VideoPlayerInterface *createVideoPlayer ( void ) { return NEW BinkVideoPlayer; }
121
+ #endif
116
122
// / factory for creating the TerrainVisual
117
123
virtual TerrainVisual *createTerrainVisual ( void ) { return NEW W3DTerrainVisual; }
118
124
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ option(RTS_BUILD_OPTION_INTERNAL "Build code with the \"Internal\" configuration
7
7
option (RTS_BUILD_OPTION_PROFILE "Build code with the \" Profile\" configuration." OFF )
8
8
option (RTS_BUILD_OPTION_DEBUG "Build code with the \" Debug\" configuration." OFF )
9
9
option (RTS_BUILD_OPTION_ASAN "Build code with Address Sanitizer." OFF )
10
+ option (RTS_BUILD_OPTION_FFMPEG "Enable FFmpeg support" OFF )
10
11
11
12
if (NOT RTS_BUILD_ZEROHOUR AND NOT RTS_BUILD_GENERALS )
12
13
set (RTS_BUILD_ZEROHOUR TRUE )
@@ -21,6 +22,7 @@ add_feature_info(InternalBuild RTS_BUILD_OPTION_INTERNAL "Building as an \"Inter
21
22
add_feature_info (ProfileBuild RTS_BUILD_OPTION_PROFILE "Building as a \" Profile\" build" )
22
23
add_feature_info (DebugBuild RTS_BUILD_OPTION_DEBUG "Building as a \" Debug\" build" )
23
24
add_feature_info (AddressSanitizer RTS_BUILD_OPTION_ASAN "Building with address sanitizer" )
25
+ add_feature_info (FFmpegSupport RTS_BUILD_OPTION_FFMPEG "Building with FFmpeg support" )
24
26
25
27
if (RTS_BUILD_ZEROHOUR )
26
28
option (RTS_BUILD_ZEROHOUR_TOOLS "Build tools for Zero Hour" ON )
Original file line number Diff line number Diff line change 2
2
"$schema" : " https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json" ,
3
3
"builtin-baseline" : " b02e341c927f16d991edbd915d8ea43eac52096c" ,
4
4
"dependencies" : [
5
- " zlib"
5
+ " zlib" ,
6
+ " ffmpeg"
6
7
]
7
8
}
You can’t perform that action at this time.
0 commit comments