From 531d87bc75673e588c60a8fa81276c17cc6547e0 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Mon, 9 Dec 2024 23:46:36 +0300 Subject: [PATCH] common: render_api: use movie_state_s in AVI functions for easier type checking --- common/render_api.h | 14 +++++++------- engine/client/cl_render.c | 12 ++++++------ engine/client/client.h | 2 +- engine/client/s_main.c | 2 +- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/common/render_api.h b/common/render_api.h index 4dd889624..8e9f23d8c 100644 --- a/common/render_api.h +++ b/common/render_api.h @@ -208,14 +208,14 @@ typedef struct render_api_s void (*R_EntityRemoveDecals)( struct model_s *mod ); // remove all the decals from specified entity (BSP only) // AVIkit support - void *(*AVI_LoadVideo)( const char *filename, qboolean load_audio ); - int (*AVI_GetVideoInfo)( void *Avi, int *xres, int *yres, float *duration ); // a1ba: changed longs to int - int (*AVI_GetVideoFrameNumber)( void *Avi, float time ); - byte *(*AVI_GetVideoFrame)( void *Avi, int frame ); + struct movie_state_s *(*AVI_LoadVideo)( const char *filename, qboolean load_audio ); + qboolean (*AVI_GetVideoInfo)( struct movie_state_s *Avi, int *xres, int *yres, float *duration ); // a1ba: changed longs to int + int (*AVI_GetVideoFrameNumber)( struct movie_state_s *Avi, float time ); + byte *(*AVI_GetVideoFrame)( struct movie_state_s *Avi, int frame ); void (*AVI_UploadRawFrame)( int texture, int cols, int rows, int width, int height, const byte *data ); - void (*AVI_FreeVideo)( void *Avi ); - int (*AVI_IsActive)( void *Avi ); - void (*AVI_StreamSound)( void *Avi, int entnum, float fvol, float attn, float synctime ); + void (*AVI_FreeVideo)( struct movie_state_s *Avi ); + qboolean (*AVI_IsActive)( struct movie_state_s *Avi ); + void (*AVI_StreamSound)( struct movie_state_s *Avi, int entnum, float fvol, float attn, float synctime ); qboolean (*AVI_Think)( struct movie_state_s *Avi ); qboolean (*AVI_SetParm)( struct movie_state_s *Avi, enum movie_parms_e parm, ... ); diff --git a/engine/client/cl_render.c b/engine/client/cl_render.c index 87feac0e7..99d5c0126 100644 --- a/engine/client/cl_render.c +++ b/engine/client/cl_render.c @@ -261,13 +261,13 @@ static render_api_t gRenderAPI = NULL, // DrawSingleDecal, NULL, // R_DecalSetupVerts, NULL, // R_EntityRemoveDecals, - (void*)AVI_LoadVideo, - (void*)AVI_GetVideoInfo, - (void*)AVI_GetVideoFrameNumber, - (void*)AVI_GetVideoFrame, + AVI_LoadVideo, + AVI_GetVideoInfo, + AVI_GetVideoFrameNumber, + AVI_GetVideoFrame, NULL, // R_UploadStretchRaw, - (void*)AVI_FreeVideo, - (void*)AVI_IsActive, + AVI_FreeVideo, + AVI_IsActive, S_StreamAviSamples, AVI_Think, AVI_SetParm, diff --git a/engine/client/client.h b/engine/client/client.h index 476a8828d..5c98761bc 100644 --- a/engine/client/client.h +++ b/engine/client/client.h @@ -1115,7 +1115,7 @@ void Con_PageUp( int lines ); // // s_main.c // -void S_StreamAviSamples( void *Avi, int entnum, float fvol, float attn, float synctime ); +void S_StreamAviSamples( movie_state_t *Avi, int entnum, float fvol, float attn, float synctime ); void S_StartBackgroundTrack( const char *intro, const char *loop, int position, qboolean fullpath ); void S_StopBackgroundTrack( void ); void S_StreamSetPause( int pause ); diff --git a/engine/client/s_main.c b/engine/client/s_main.c index 269d95f02..5d0c1f16d 100644 --- a/engine/client/s_main.c +++ b/engine/client/s_main.c @@ -1210,7 +1210,7 @@ void S_RawSamples( uint samples, uint rate, word width, word channels, const byt S_PositionedRawSamples =================== */ -void S_StreamAviSamples( void *Avi, int entnum, float fvol, float attn, float synctime ) +void S_StreamAviSamples( movie_state_t *Avi, int entnum, float fvol, float attn, float synctime ) { return; // stub, use AVI_SetParm and AVI_Think to stream AVI sound }