engine: client: avi: add new macro XASH_AVI and corresponding backend select macros (AVI_NULL and AVI_FFMPEG)

This commit is contained in:
Alibek Omarov 2023-05-07 04:10:18 +03:00
parent 3d30dc8d02
commit 1884f0a3ce
5 changed files with 22 additions and 8 deletions

View File

@ -50,4 +50,8 @@ GNU General Public License for more details.
#define LIB_WIN32 2
#define LIB_STATIC 3
// movies (XASH_AVI)
#define AVI_NULL 0
#define AVI_FFMPEG 1
#endif /* BACKENDS_H */

View File

@ -78,7 +78,6 @@ SETUP BACKENDS DEFINITIONS
// usually only 10-20 fds availiable
#define XASH_REDUCE_FD
#endif
#endif // XASH_DEDICATED
//
@ -105,6 +104,17 @@ SETUP BACKENDS DEFINITIONS
#endif // !XASH_WIN32
#endif
//
// determine movie playback backend
//
#ifndef XASH_AVI
#if HAVE_FFMPEG
#define XASH_AVI AVI_FFMPEG
#else
#define XASH_AVI AVI_NULL
#endif
#endif
#ifdef XASH_STATIC_LIBS
#define XASH_LIB LIB_STATIC
#define XASH_INTERNAL_GAMELIBS

View File

@ -18,7 +18,7 @@ GNU General Public License for more details.
//
// avikit.c
//
typedef struct movie_state_s movie_state_t;
typedef struct movie_state_s movie_state_t;
int AVI_GetVideoFrameNumber( movie_state_t *Avi, float time );
byte *AVI_GetVideoFrame( movie_state_t *Avi, int frame );
qboolean AVI_GetVideoInfo( movie_state_t *Avi, int *xres, int *yres, float *duration );

View File

@ -13,8 +13,8 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
*/
#include "build.h"
#if !XASH_WIN32
#include "defaults.h"
#if XASH_AVI == AVI_NULL
#include "common.h"
int AVI_GetVideoFrameNumber( movie_state_t *Avi, float time )
@ -87,4 +87,4 @@ void AVI_Shutdown( void )
;
}
#endif // WIN32
#endif // XASH_AVI == AVI_NULL

View File

@ -14,8 +14,8 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
*/
#include "build.h"
#if XASH_WIN32
#include "defaults.h"
#if XASH_AVI == AVI_WIN32
#include "common.h"
#include "client.h"
#include <vfw.h> // video for windows
@ -732,4 +732,4 @@ void AVI_Shutdown( void )
Sys_FreeLibrary( &msacm_dll );
avi_initialized = false;
}
#endif // _WIN32
#endif // XASH_AVI == AVI_WIN32