diff --git a/scripts/javascript/examples/param.js b/scripts/javascript/lib/param.js similarity index 100% rename from scripts/javascript/examples/param.js rename to scripts/javascript/lib/param.js diff --git a/src/blitter.cpp b/src/blitter.cpp index 16c50537..4e5cb063 100644 --- a/src/blitter.cpp +++ b/src/blitter.cpp @@ -41,9 +41,7 @@ Blit::Blit() :Entry() { sprintf(desc,"none"); value = 0.0; - has_value = false; - memset(kernel,0,256); fun = NULL; type = NONE; past_frame = NULL; diff --git a/src/console_calls_ctrl.cpp b/src/console_calls_ctrl.cpp index 2bca0811..ea065ef7 100644 --- a/src/console_calls_ctrl.cpp +++ b/src/console_calls_ctrl.cpp @@ -152,8 +152,8 @@ int console_param_selection(Context *env, char *cmd) { p->description); break; case Parameter::NUMBER: - ::act("(number) %s = %g :: %s", p->name, - *(double*)p->value, + ::act("(number) %s = %.2f :: %s", p->name, + *(float*)p->value, p->description); break; case Parameter::STRING: @@ -161,8 +161,8 @@ int console_param_selection(Context *env, char *cmd) { break; case Parameter::POSITION: { - double *val = (double*)p->value; - ::act("(position) %s = %g x %g :: %s", p->name, + float *val = (float*)p->value; + ::act("(position) %s = %.2f x %.2f :: %s", p->name, val[0], val[1], p->description); } @@ -338,8 +338,8 @@ int console_blit_param_completion(Context *env, char *cmd) { p->description); break; case Parameter::NUMBER: - ::act("(number) %s = %g :: %s", p->name, - *(double*)p->value, + ::act("(number) %s = %.2f :: %s", p->name, + *(float*)p->value, p->description); break; case Parameter::STRING: @@ -347,8 +347,8 @@ int console_blit_param_completion(Context *env, char *cmd) { break; case Parameter::POSITION: { - double *val = (double*)p->value; - ::act("(position) %s = %g x %g :: %s", p->name, + float *val = (float*)p->value; + ::act("(position) %s = %.2f x %.2f :: %s", p->name, val[0], val[1], p->description); } diff --git a/src/include/blitter.h b/src/include/blitter.h index 0f731235..40b4fd73 100644 --- a/src/include/blitter.h +++ b/src/include/blitter.h @@ -32,7 +32,7 @@ /////////////////////////////////// blit functions prototypes #define BLIT static inline void -typedef void (blit_f)(void *src, void *dst, int len, void *value); +typedef void (blit_f)(void *src, void *dst, int len, Linklist *params); typedef void (blit_sdl_f)(void *src, SDL_Rect *src_rect, SDL_Surface *dst, SDL_Rect *dst_rect, @@ -66,9 +66,8 @@ class Blit: public Entry { char desc[512]; ///< long description float value; ///< parameter value - short kernel[256]; ///< convolution kernel - Linklist parameters; + Linklist parameters; ///< linklist of blit parameters blit_f *fun; ///< pointer to linear blit function blit_sdl_f *sdl_fun; ///< pointer to sdl blit function @@ -86,8 +85,6 @@ class Blit: public Entry { //#define PAST_BLIT 3 BlitType type; ///< LINEAR|SDL|PAST type - bool has_value; - // char *get_name(); diff --git a/src/include/parameter.h b/src/include/parameter.h index 2ac81a05..31ece25b 100644 --- a/src/include/parameter.h +++ b/src/include/parameter.h @@ -66,6 +66,11 @@ class Parameter : public Entry { filter_param_f *filter_set_f; bool changed; ///< can be used externally by application caller + float multiplier; ///< multiplier to adjust the value on set (none if 1.0) + + private: + double d1, d2, d3; // temp values + }; #endif diff --git a/src/include/theora11_encoder.h b/src/include/theora11_encoder.h index f37eac3d..9bdc3f21 100644 --- a/src/include/theora11_encoder.h +++ b/src/include/theora11_encoder.h @@ -98,3 +98,5 @@ class Theora11Encoder: public Videoencoder { }; #endif + +#endif diff --git a/src/layer_js.cpp b/src/layer_js.cpp index 3d8a8fe3..8b52f440 100644 --- a/src/layer_js.cpp +++ b/src/layer_js.cpp @@ -466,15 +466,21 @@ JS(layer_set_blit_value) { JS_ARG_NUMBER(value,0); GET_LAYER(Layer); - - value = 255.0*value; - if(value>255) { - warning("blit values should be float ranged between 0.0 and 1.0"); - value = 255; - } - // lay->blitter.fade_value(1,new_value); - // lay->blitter.set_value((float)value); + Parameter *p; + // when this function is used we + // assume blit has only one parameter + // (basically we keep this for backward compat) + + if(!lay->current_blit) + error("layer %s has no blit selected (not added yet?)", lay->name); + else + p = lay->current_blit->parameters.begin(); + + if(!p) + warning("no blit parameter found on layer %s", lay->name); + else + p->set((void*)&value); return JS_TRUE; } diff --git a/src/linear_blits.cpp b/src/linear_blits.cpp index 06e6c5af..b3da58c8 100644 --- a/src/linear_blits.cpp +++ b/src/linear_blits.cpp @@ -11,7 +11,7 @@ // Linear transparent blits -BLIT blit_xor(void *src, void *dst, int bytes, void *value) { +BLIT blit_xor(void *src, void *dst, int bytes, Linklist *params) { register int c; register uint32_t *s = (uint32_t*)src; register uint32_t *d = (uint32_t*)dst; @@ -21,11 +21,11 @@ BLIT blit_xor(void *src, void *dst, int bytes, void *value) { } -BLIT rgb_jmemcpy(void *src, void *dst, int bytes, void *value) { +BLIT rgb_jmemcpy(void *src, void *dst, int bytes, Linklist *params) { jmemcpy(dst,src,bytes); } -BLIT red_channel(void *src, void *dst, int bytes, void *value) { +BLIT red_channel(void *src, void *dst, int bytes, Linklist *params) { register int c; register uint8_t *s = (uint8_t*)src; register uint8_t *d = (uint8_t*)dst; @@ -33,7 +33,7 @@ BLIT red_channel(void *src, void *dst, int bytes, void *value) { *(d+rchan) = *(s+rchan); } -BLIT green_channel(void *src, void *dst, int bytes, void *value) { +BLIT green_channel(void *src, void *dst, int bytes, Linklist *params) { register int c; register uint8_t *s = (uint8_t*)src; register uint8_t *d = (uint8_t*)dst; @@ -41,7 +41,7 @@ BLIT green_channel(void *src, void *dst, int bytes, void *value) { *(d+gchan) = *(s+gchan); } -BLIT blue_channel(void *src, void *dst, int bytes, void *value) { +BLIT blue_channel(void *src, void *dst, int bytes, Linklist *params) { register int c; register uint8_t *s = (uint8_t*)src; register uint8_t *d = (uint8_t*)dst; @@ -49,7 +49,7 @@ BLIT blue_channel(void *src, void *dst, int bytes, void *value) { *(d+bchan) = *(s+bchan); } -BLIT red_mask(void *src, void *dst, int bytes, void *value) { +BLIT red_mask(void *src, void *dst, int bytes, Linklist *params) { register int c; register uint32_t *s = (uint32_t*)src; register uint32_t *d = (uint32_t*)dst; @@ -57,11 +57,13 @@ BLIT red_mask(void *src, void *dst, int bytes, void *value) { for(c=bytes>>2;c>0;c--,s++,d++) *d |= *s & red_bitmask; + unsigned char v = (unsigned int) *(float*)(params->begin()->value); // only one value + SDL_imageFilterBinarizeUsingThreshold - ((unsigned char*)dst,(unsigned char*)dst,bytes, (unsigned char)*(float*)value); + ((unsigned char*)dst,(unsigned char*)dst,bytes, v); } -BLIT green_mask(void *src, void *dst, int bytes, void *value) { +BLIT green_mask(void *src, void *dst, int bytes, Linklist *params) { register int c; register uint32_t *s = (uint32_t*)src; register uint32_t *d = (uint32_t*)dst; @@ -69,63 +71,68 @@ BLIT green_mask(void *src, void *dst, int bytes, void *value) { for(c=bytes>>2;c>0;c--,s++,d++) *d |= *s & green_bitmask; + unsigned char v = (unsigned int) *(float*)(params->begin()->value); // only one value + SDL_imageFilterBinarizeUsingThreshold - ((unsigned char*)dst,(unsigned char*)dst,bytes, (unsigned char)*(float*)value); + ((unsigned char*)dst,(unsigned char*)dst,bytes, v); } -BLIT blue_mask(void *src, void *dst, int bytes, void *value) { +BLIT blue_mask(void *src, void *dst, int bytes, Linklist *params) { register int c; register uint32_t *s = (uint32_t*)src; register uint32_t *d = (uint32_t*)dst; for(c=bytes>>2;c>0;c--,s++,d++) *d |= *s & blue_bitmask; + + unsigned char v = (unsigned int) *(float*)(params->begin()->value); // only one value + SDL_imageFilterBinarizeUsingThreshold - ((unsigned char*)dst,(unsigned char*)dst,bytes, (unsigned char)*(float*)value); + ((unsigned char*)dst,(unsigned char*)dst,bytes,v); } -BLIT schiffler_add(void *src, void *dst, int bytes, void *value) { +BLIT schiffler_add(void *src, void *dst, int bytes, Linklist *params) { SDL_imageFilterAdd((unsigned char*)src,(unsigned char*)dst,(unsigned char*)dst,bytes); } -BLIT schiffler_sub(void *src, void *dst, int bytes, void *value) { +BLIT schiffler_sub(void *src, void *dst, int bytes, Linklist *params) { SDL_imageFilterSub((unsigned char*)src,(unsigned char*)dst,(unsigned char*)dst,bytes); } -BLIT schiffler_mean(void *src, void *dst, int bytes, void *value) { +BLIT schiffler_mean(void *src, void *dst, int bytes, Linklist *params) { SDL_imageFilterMean((unsigned char*)src,(unsigned char*)dst,(unsigned char*)dst,bytes); } -BLIT schiffler_absdiff(void *src, void *dst, int bytes, void *value) { +BLIT schiffler_absdiff(void *src, void *dst, int bytes, Linklist *params) { SDL_imageFilterAbsDiff((unsigned char*)src,(unsigned char*)dst,(unsigned char*)dst,bytes); } -BLIT schiffler_mult(void *src, void *dst, int bytes, void *value) { +BLIT schiffler_mult(void *src, void *dst, int bytes, Linklist *params) { SDL_imageFilterMult((unsigned char*)src,(unsigned char*)dst,(unsigned char*)dst,bytes); } -BLIT schiffler_multnor(void *src, void *dst, int bytes, void *value) { +BLIT schiffler_multnor(void *src, void *dst, int bytes, Linklist *params) { SDL_imageFilterMultNor((unsigned char*)src,(unsigned char*)dst,(unsigned char*)dst,bytes); } -BLIT schiffler_div(void *src, void *dst, int bytes, void *value) { +BLIT schiffler_div(void *src, void *dst, int bytes, Linklist *params) { SDL_imageFilterDiv((unsigned char*)src,(unsigned char*)dst,(unsigned char*)dst,bytes); } -BLIT schiffler_multdiv2(void *src, void *dst, int bytes, void *value) { +BLIT schiffler_multdiv2(void *src, void *dst, int bytes, Linklist *params) { SDL_imageFilterMultDivby2((unsigned char*)src,(unsigned char*)dst,(unsigned char*)dst,bytes); } -BLIT schiffler_multdiv4(void *src, void *dst, int bytes, void *value) { +BLIT schiffler_multdiv4(void *src, void *dst, int bytes, Linklist *params) { SDL_imageFilterMultDivby2((unsigned char*)src,(unsigned char*)dst,(unsigned char*)dst,bytes); } -BLIT schiffler_and(void *src, void *dst, int bytes, void *value) { +BLIT schiffler_and(void *src, void *dst, int bytes, Linklist *params) { SDL_imageFilterBitAnd((unsigned char*)src,(unsigned char*)dst,(unsigned char*)dst,bytes); } -BLIT schiffler_or(void *src, void *dst, int bytes, void *value) { +BLIT schiffler_or(void *src, void *dst, int bytes, Linklist *params) { SDL_imageFilterBitOr((unsigned char*)src,(unsigned char*)dst,(unsigned char*)dst,bytes); } @@ -135,41 +142,56 @@ BLIT schiffler_or(void *src, void *dst, int bytes, void *value) { /// Linear non-transparent blits -BLIT schiffler_neg(void *src, void *dst, int bytes, void *value) { +BLIT schiffler_neg(void *src, void *dst, int bytes, Linklist *params) { SDL_imageFilterBitNegation((unsigned char*)src,(unsigned char*)dst,bytes); } -BLIT schiffler_addbyte(void *src, void *dst, int bytes, void *value) { - SDL_imageFilterAddByte((unsigned char*)src,(unsigned char*)dst,bytes, (unsigned char)*(float*)value); +BLIT schiffler_addbyte(void *src, void *dst, int bytes, Linklist *params) { + unsigned char v = (unsigned int) *(float*)(params->begin()->value); // only one value + + SDL_imageFilterAddByte((unsigned char*)src,(unsigned char*)dst,bytes, v); } -BLIT schiffler_addbytetohalf(void *src, void *dst, int bytes, void *value) { - SDL_imageFilterAddByteToHalf((unsigned char*)src,(unsigned char*)dst,bytes, (unsigned char)*(float*)value); +BLIT schiffler_addbytetohalf(void *src, void *dst, int bytes, Linklist *params) { + unsigned char v = (unsigned int) *(float*)(params->begin()->value); // only one value + + SDL_imageFilterAddByteToHalf((unsigned char*)src,(unsigned char*)dst,bytes, v); } -BLIT schiffler_subbyte(void *src, void *dst, int bytes, void *value) { - SDL_imageFilterSubByte((unsigned char*)src,(unsigned char*)dst,bytes, (unsigned char)*(float*)value); +BLIT schiffler_subbyte(void *src, void *dst, int bytes, Linklist *params) { + unsigned char v = (unsigned int) *(float*)(params->begin()->value); // only one value + + SDL_imageFilterSubByte((unsigned char*)src,(unsigned char*)dst,bytes, v); } -BLIT schiffler_shl(void *src, void *dst, int bytes, void *value) { - SDL_imageFilterShiftLeft((unsigned char*)src,(unsigned char*)dst,bytes, (unsigned char)*(float*)value); +BLIT schiffler_shl(void *src, void *dst, int bytes, Linklist *params) { + unsigned char v = (unsigned int) *(float*)(params->begin()->value); // only one value + + SDL_imageFilterShiftLeft((unsigned char*)src,(unsigned char*)dst,bytes, v); } -BLIT schiffler_shlb(void *src, void *dst, int bytes, void *value) { - SDL_imageFilterShiftLeftByte((unsigned char*)src,(unsigned char*)dst,bytes, (unsigned char)*(float*)value); +BLIT schiffler_shlb(void *src, void *dst, int bytes, Linklist *params) { + unsigned char v = (unsigned int) *(float*)(params->begin()->value); // only one value + + SDL_imageFilterShiftLeftByte((unsigned char*)src,(unsigned char*)dst,bytes,v); } -BLIT schiffler_shr(void *src, void *dst, int bytes, void *value) { - SDL_imageFilterShiftRight((unsigned char*)src,(unsigned char*)dst,bytes, (unsigned char)*(float*)value); +BLIT schiffler_shr(void *src, void *dst, int bytes, Linklist *params) { + unsigned char v = (unsigned int) *(float*)(params->begin()->value); // only one value + + SDL_imageFilterShiftRight((unsigned char*)src,(unsigned char*)dst,bytes,v); } -BLIT schiffler_mulbyte(void *src, void *dst, int bytes, void *value) { - SDL_imageFilterMultByByte((unsigned char*)src,(unsigned char*)dst,bytes, (unsigned char)*(float*)value); +BLIT schiffler_mulbyte(void *src, void *dst, int bytes, Linklist *params) { + unsigned char v = (unsigned int) *(float*)(params->begin()->value); // only one value + + SDL_imageFilterMultByByte((unsigned char*)src,(unsigned char*)dst,bytes,v); } -BLIT schiffler_binarize(void *src, void *dst, int bytes, void *value) { +BLIT schiffler_binarize(void *src, void *dst, int bytes, Linklist *params) { + unsigned char v = (unsigned int) *(float*)(params->begin()->value); // only one value SDL_imageFilterBinarizeUsingThreshold - ((unsigned char*)src,(unsigned char*)dst,bytes, (unsigned char)*(float*)value); + ((unsigned char*)src,(unsigned char*)dst,bytes, v); } @@ -177,6 +199,7 @@ BLIT schiffler_binarize(void *src, void *dst, int bytes, void *value) { void setup_linear_blits(Blitter *blitter) { Blit *b; + Parameter *p; b = new Blit(); b->set_name("RGB"); sprintf(b->desc, "RGB blit (jmemcpy)"); @@ -280,44 +303,109 @@ void setup_linear_blits(Blitter *blitter) { b->type = Blit::LINEAR; b->fun = schiffler_neg; blitter->blitlist.prepend(b); + ///////// + b = new Blit(); b->set_name("ADDB"); sprintf(b->desc,"add byte to bytes"); - b->type = Blit::LINEAR; b->has_value = true; + b->type = Blit::LINEAR; b->fun = schiffler_addbyte; blitter->blitlist.prepend(b); + p = new Parameter(Parameter::NUMBER); + strcpy(p->name, "byte increment"); + strcpy(p->description, "amount to sum to the byte"); + p->multiplier = 255.0; + b->parameters.append(p); + + ///////// + b = new Blit(); b->set_name("ADDBH"); sprintf(b->desc,"add byte to half"); - b->type = Blit::LINEAR; b->has_value = true; + b->type = Blit::LINEAR; b->fun = schiffler_addbytetohalf; blitter->blitlist.prepend(b); - + + p = new Parameter(Parameter::NUMBER); + strcpy(p->name, "half byte increment"); + strcpy(p->description, "amount to sum to the half byte"); + p->multiplier = 127.0; + b->parameters.append(p); + + ///////// + b = new Blit(); b->set_name("SUBB"); sprintf(b->desc,"subtract byte to bytes"); - b->type = Blit::LINEAR; b->has_value = true; + b->type = Blit::LINEAR; b->fun = schiffler_subbyte; blitter->blitlist.prepend(b); + p = new Parameter(Parameter::NUMBER); + strcpy(p->name, "byte decrement"); + strcpy(p->description, "amount to substract to the pixel bytes"); + p->multiplier = 255.0; + b->parameters.append(p); + + ///////// + b = new Blit(); b->set_name("SHL"); sprintf(b->desc,"shift left bits"); - b->type = Blit::LINEAR; b->has_value = true; + b->type = Blit::LINEAR; b->fun = schiffler_shl; blitter->blitlist.prepend(b); + p = new Parameter(Parameter::NUMBER); + strcpy(p->name, "byte decrement"); + strcpy(p->description, "amount to substract to the pixel bytes"); + p->multiplier = 255.0; + b->parameters.append(p); + + ///////// + b = new Blit(); b->set_name("SHLB"); sprintf(b->desc,"shift left byte"); - b->type = Blit::LINEAR; b->has_value = true; + b->type = Blit::LINEAR; b->fun = schiffler_shlb; blitter->blitlist.prepend(b); + p = new Parameter(Parameter::NUMBER); + strcpy(p->name, "shift bits"); + strcpy(p->description, "amount of left bit shifts to apply on each pixel's byte"); + p->multiplier = 8.0; + b->parameters.append(p); + + ///////// + b = new Blit(); b->set_name("SHR"); sprintf(b->desc,"shift right bits"); - b->type = Blit::LINEAR; b->has_value = true; + b->type = Blit::LINEAR; b->fun = schiffler_shr; blitter->blitlist.prepend(b); + p = new Parameter(Parameter::NUMBER); + strcpy(p->name, "shift bits"); + strcpy(p->description, "amount of right bit shifts to apply on each pixel's byte"); + p->multiplier = 8.0; + b->parameters.append(p); + + ///////// + b = new Blit(); b->set_name("MULB"); sprintf(b->desc,"multiply by byte"); - b->type = Blit::LINEAR; b->has_value = true; + b->type = Blit::LINEAR; b->fun = schiffler_mulbyte; blitter->blitlist.prepend(b); + p = new Parameter(Parameter::NUMBER); + strcpy(p->name, "byte multiplier"); + strcpy(p->description, "amount to multiply on each pixel's byte"); + p->multiplier = 255.0; + b->parameters.append(p); + + ///////// + b = new Blit(); b->set_name("BIN"); sprintf(b->desc,"binarize using threshold"); - b->type = Blit::LINEAR; b->has_value = true; + b->type = Blit::LINEAR; b->fun = schiffler_binarize; blitter->blitlist.prepend(b); + p = new Parameter(Parameter::NUMBER); + strcpy(p->name, "threshold"); + strcpy(p->description, "binary threshold value"); + p->multiplier = 255.0; + b->parameters.append(p); + + } diff --git a/src/parameter.cpp b/src/parameter.cpp index 794f13ca..51f6c08a 100644 --- a/src/parameter.cpp +++ b/src/parameter.cpp @@ -50,6 +50,7 @@ Parameter::Parameter(Parameter::Type param_type) } changed = false; + multiplier = 1.0; type = param_type; @@ -69,8 +70,19 @@ Parameter::~Parameter() { bool Parameter::set(void *val) { //////////////////////////////////////// if(type == Parameter::NUMBER) { - - *(float*)value = *(float*)val; + double v = *(double*)val; + float f; + func("%s NUMBER %g",__PRETTY_FUNCTION__, v); + // range check (input is always 0.0 - 1.0) + if((v<0.0) || (v>1.0)) { + error("%s parameter: value %.2f out of range", name, v); + return(false); + } + // apply multiplier for internal value storage + if(multiplier!= 1.0) f = v * multiplier; + func("parameter %s set to %.2f", name, f); + // store value + *(float*)value = f; ////////////////////////////////////// } else if(type == Parameter::BOOL) { @@ -112,14 +124,14 @@ bool Parameter::parse(char *p) { ////////////////////////////////////// if(type == Parameter::NUMBER) { - + func("parsing number parameter"); - if( sscanf(p, "%le", (double*)value) < 1 ) { + if( sscanf(p, "%le", &d1) < 1 ) { error("error parsing value [%s] for parameter %s", p, name); return false; } - func("parameter %s parsed to %g",p, *(double*)value); - + func("parameter %s parsed to %g", p, d1); + set(&d1); ////////////////////////////////////// } else if(type == Parameter::BOOL) { diff --git a/src/sdl_blits.cpp b/src/sdl_blits.cpp index 76244a1a..b1597f25 100644 --- a/src/sdl_blits.cpp +++ b/src/sdl_blits.cpp @@ -48,8 +48,8 @@ BLIT sdl_alpha(void *src, SDL_Rect *src_rect, SDL_Surface *dst, SDL_Rect *dst_rect, ScreenGeometry *geo, Linklist *params) { - double alpha = *(double*)(params->pick(1)->value); - unsigned int int_alpha = alpha * 255; + float alpha = *(float*)(params->begin()->value); // only one value + unsigned int int_alpha = (unsigned int) alpha; sdl_surf = SDL_CreateRGBSurfaceFrom (src, geo->w, geo->h, geo->bpp, @@ -67,8 +67,8 @@ BLIT sdl_srcalpha(void *src, SDL_Rect *src_rect, SDL_Surface *dst, SDL_Rect *dst_rect, ScreenGeometry *geo, Linklist *params) { - double alpha = *(double*)(params->pick(1)->value); - unsigned int int_alpha = alpha * 255; + float alpha = *(float*)(params->begin()->value); // only one value + unsigned int int_alpha = (unsigned int) alpha; sdl_surf = SDL_CreateRGBSurfaceFrom (src, geo->w, geo->h, geo->bpp, @@ -124,13 +124,14 @@ void setup_sdl_blits(Blitter *blitter) { b = new Blit(); b->set_name("ALPHA"); sprintf(b->desc,"alpha blit (SDL)"); - b->type = Blit::SDL; b->has_value = true; + b->type = Blit::SDL; b->sdl_fun = sdl_alpha; blitter->blitlist.prepend(b); p = new Parameter(Parameter::NUMBER); strcpy(p->name, "alpha"); strcpy(p->description, "level of transparency of alpha channel (0.0 - 1.0)"); + p->multiplier = 255.0; b->parameters.append(p); ///////////// @@ -144,6 +145,7 @@ void setup_sdl_blits(Blitter *blitter) { p = new Parameter(Parameter::NUMBER); strcpy(p->name, "alpha"); strcpy(p->description, "level of transparency of alpha channel (0.0 - 1.0)"); + p->multiplier = 255.0; b->parameters.append(p); // b = new Blit(); b->set_name("CHROMAKEY"); diff --git a/src/sdl_screen.cpp b/src/sdl_screen.cpp index d36c3fbc..5913f126 100644 --- a/src/sdl_screen.cpp +++ b/src/sdl_screen.cpp @@ -167,7 +167,7 @@ void SdlScreen::blit(Layer *src) { (*b->fun) ((void*)play, (void*)pscr, b->lay_bytepitch,// * src->geo.bpp>>3, - (void*)&b->parameters); + &b->parameters); // strides down to the next line pscr += b->scr_stride + b->lay_pitch; diff --git a/src/soft_screen.cpp b/src/soft_screen.cpp index a6046945..13be3066 100644 --- a/src/soft_screen.cpp +++ b/src/soft_screen.cpp @@ -78,7 +78,7 @@ void SoftScreen::blit(Layer *src) { (*b->fun) ((void*)play, (void*)pscr, b->lay_bytepitch,// * src->geo.bpp>>3, - (void*)&b->value); + &b->parameters); // strides down to the next line pscr += b->scr_stride + b->lay_pitch; diff --git a/src/video_encoder_js.cpp b/src/video_encoder_js.cpp index ffadbf14..6f4cdaa8 100644 --- a/src/video_encoder_js.cpp +++ b/src/video_encoder_js.cpp @@ -27,7 +27,6 @@ #include #include -#include DECLARE_CLASS("VideoEncoder", js_vid_enc_class, js_vid_enc_constructor);