diff options
-rw-r--r-- | spudec.c | 11 | ||||
-rw-r--r-- | spudec.h | 2 |
2 files changed, 4 insertions, 9 deletions
@@ -673,12 +673,12 @@ void spudec_set_forced_subs_only(void * const this, const unsigned int flag) } } -void spudec_draw(void *this, void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride)) +void spudec_draw(void *this, void (*draw_alpha)(void *ctx, int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride), void *ctx) { spudec_handle_t *spu = this; if (spudec_visible(spu)) { - draw_alpha(spu->start_col, spu->start_row, spu->width, spu->height, + draw_alpha(ctx, spu->start_col, spu->start_row, spu->width, spu->height, spu->image, spu->aimage, spu->stride); spu->spu_changed = 0; } @@ -834,12 +834,7 @@ void spudec_draw_scaled(void *me, unsigned int dxs, unsigned int dys, void (*dra if (!(spu_aamode&16) && (spu->orig_frame_width == 0 || spu->orig_frame_height == 0 || (spu->orig_frame_width == dxs && spu->orig_frame_height == dys))) { - if (spu->image) - { - draw_alpha(ctx, spu->start_col, spu->start_row, spu->width, spu->height, - spu->image, spu->aimage, spu->stride); - spu->spu_changed = 0; - } + spudec_draw(spu, draw_alpha, ctx); } else { if (spu->scaled_frame_width != dxs || spu->scaled_frame_height != dys) { /* Resizing is needed */ @@ -23,7 +23,7 @@ void spudec_heartbeat(void *this, unsigned int pts100); void spudec_assemble(void *this, unsigned char *packet, unsigned int len, int pts100); -void spudec_draw(void *this, void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride)); +void spudec_draw(void *this, void (*draw_alpha)(void *ctx, int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride), void *ctx); void spudec_draw_scaled(void *this, unsigned int dxs, unsigned int dys, void (*draw_alpha)(void *ctx, int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride), void *ctx); void spudec_update_palette(void *this, unsigned int *palette); void *spudec_new_scaled(unsigned int *palette, unsigned int frame_width, unsigned int frame_height, uint8_t *extradata, int extradata_len); |