summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--spudec.c11
-rw-r--r--spudec.h2
2 files changed, 4 insertions, 9 deletions
diff --git a/spudec.c b/spudec.c
index 6ccc1798b1..06172077e1 100644
--- a/spudec.c
+++ b/spudec.c
@@ -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 */
diff --git a/spudec.h b/spudec.h
index 45568279c3..85e373edda 100644
--- a/spudec.h
+++ b/spudec.h
@@ -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);