diff --git a/engine/common/avi/avi.h b/engine/common/avi/avi.h new file mode 100644 index 00000000..5b386976 --- /dev/null +++ b/engine/common/avi/avi.h @@ -0,0 +1,37 @@ +/* +avi.h -- common avi support header +Copyright (C) 2018 a1batross, Uncle Mike + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. +*/ +#ifndef AVI_H +#define AVI_H + +// +// avikit.c +// +typedef struct movie_state_s movie_state_t; +long AVI_GetVideoFrameNumber( movie_state_t *Avi, float time ); +byte *AVI_GetVideoFrame( movie_state_t *Avi, long frame ); +qboolean AVI_GetVideoInfo( movie_state_t *Avi, long *xres, long *yres, float *duration ); +qboolean AVI_GetAudioInfo( movie_state_t *Avi, wavdata_t *snd_info ); +long AVI_GetAudioChunk( movie_state_t *Avi, char *audiodata, long offset, long length ); +void AVI_OpenVideo( movie_state_t *Avi, const char *filename, qboolean load_audio, int quiet ); +movie_state_t *AVI_LoadVideo( const char *filename, qboolean load_audio ); +movie_state_t *AVI_LoadVideoNoSound( const char *filename ); +void AVI_CloseVideo( movie_state_t *Avi ); +qboolean AVI_IsActive( movie_state_t *Avi ); +void AVI_FreeVideo( movie_state_t *Avi ); +movie_state_t *AVI_GetState( int num ); +qboolean AVI_Initailize( void ); +void AVI_Shutdown( void ); + +#endif // AVI_H diff --git a/engine/common/avi/avi_stub.c b/engine/common/avi/avi_stub.c new file mode 100644 index 00000000..92a7cc21 --- /dev/null +++ b/engine/common/avi/avi_stub.c @@ -0,0 +1,89 @@ +/* +avi_stub.c - playing AVI files (stub) +Copyright (C) 2018 a1batross + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. +*/ + +#ifndef _WIN32 +#include "common.h" + +long AVI_GetVideoFrameNumber( movie_state_t *Avi, float time ) +{ + return 0; +} + +byte *AVI_GetVideoFrame( movie_state_t *Avi, long frame ) +{ + return NULL; +} + +qboolean AVI_GetVideoInfo( movie_state_t *Avi, long *xres, long *yres, float *duration ) +{ + return false; +} + +qboolean AVI_GetAudioInfo( movie_state_t *Avi, wavdata_t *snd_info ) +{ + return false; +} + +long AVI_GetAudioChunk( movie_state_t *Avi, char *audiodata, long offset, long length ) +{ + return 0; +} + +void AVI_OpenVideo( movie_state_t *Avi, const char *filename, qboolean load_audio, int quiet ) +{ + ; +} + +movie_state_t *AVI_LoadVideo( const char *filename, qboolean load_audio ) +{ + return NULL; +} + +movie_state_t *AVI_LoadVideoNoSound( const char *filename ) +{ + return NULL; +} + +void AVI_CloseVideo( movie_state_t *Avi ) +{ + ; +} + +qboolean AVI_IsActive( movie_state_t *Avi ) +{ + return false; +} + +void AVI_FreeVideo( movie_state_t *Avi ) +{ + ; +} + +movie_state_t *AVI_GetState( int num ) +{ + return NULL; +} + +qboolean AVI_Initailize( void ) +{ + return false; +} + +void AVI_Shutdown( void ) +{ + ; +} + +#endif // WIN32 diff --git a/engine/common/avikit.c b/engine/common/avi/avi_win.c similarity index 99% rename from engine/common/avikit.c rename to engine/common/avi/avi_win.c index 1fb6ead2..36ee99ba 100644 --- a/engine/common/avikit.c +++ b/engine/common/avi/avi_win.c @@ -1,5 +1,5 @@ /* -avikit.c - playing AVI files (based on original AVIKit code) +avi_win.c - playing AVI files (based on original AVIKit code, Win32 version) Copyright (C) 2010 Uncle Mike This program is free software: you can redistribute it and/or modify @@ -13,6 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ +#ifdef _WIN32 #include "common.h" #include "client.h" #include "gl_local.h" @@ -709,4 +710,5 @@ void AVI_Shutdown( void ) Sys_FreeLibrary( &msvfw_dll ); Sys_FreeLibrary( &msacm_dll ); avi_initialized = false; -} \ No newline at end of file +} +#endif // _WIN32 diff --git a/engine/common/common.h b/engine/common/common.h index 71f2120c..d78cb7ab 100644 --- a/engine/common/common.h +++ b/engine/common/common.h @@ -867,24 +867,7 @@ int Key_GetKey( const char *binding ); void Key_EnumCmds_f( void ); void Key_SetKeyDest( int key_dest ); -// -// avikit.c -// -typedef struct movie_state_s movie_state_t; -long AVI_GetVideoFrameNumber( movie_state_t *Avi, float time ); -byte *AVI_GetVideoFrame( movie_state_t *Avi, long frame ); -qboolean AVI_GetVideoInfo( movie_state_t *Avi, long *xres, long *yres, float *duration ); -qboolean AVI_GetAudioInfo( movie_state_t *Avi, wavdata_t *snd_info ); -long AVI_GetAudioChunk( movie_state_t *Avi, char *audiodata, long offset, long length ); -void AVI_OpenVideo( movie_state_t *Avi, const char *filename, qboolean load_audio, int quiet ); -movie_state_t *AVI_LoadVideo( const char *filename, qboolean load_audio ); -movie_state_t *AVI_LoadVideoNoSound( const char *filename ); -void AVI_CloseVideo( movie_state_t *Avi ); -qboolean AVI_IsActive( movie_state_t *Avi ); -void AVI_FreeVideo( movie_state_t *Avi ); -movie_state_t *AVI_GetState( int num ); -qboolean AVI_Initailize( void ); -void AVI_Shutdown( void ); +#include "avi/avi.h" // shared calls qboolean CL_IsInGame( void ); @@ -1010,4 +993,4 @@ byte TextureToGamma( byte b ); #ifdef __cplusplus } #endif -#endif//COMMON_H \ No newline at end of file +#endif//COMMON_H