1 #include "../ckb/ckb-anim.h"
12 CKB_GUID(
"{5D6695AF-0496-41E2-BEE7-F7D0ABAA49E9}");
19 CKB_PARAM_LONG(
"frequency",
"Frequency:",
"per second", 10, 1, 100);
40 unsigned char ar = 255,
ag = 255,
ab = 255;
56 float msize =
maxsize * (0.9 + (rand() / (double)RAND_MAX * 0.2));
57 drop[i].size = -msize / 2. * slow;
58 drop[i].msize = msize;
69 double intensity, size;
72 aa = intensity / 100.;
75 double sizex = context->
width / 2.;
76 double sizey = context->
height / 2.;
77 maxsize = size / 100. * sqrt(sizex * sizex + sizey * sizey);
96 tick = state ? 0. : -1.;
103 for(
unsigned i = 0; i <
DROP_MAX; i++){
114 drop_add(rand() / (
double)RAND_MAX * context->
width, rand() / (
double)RAND_MAX * context->
height, 1);
123 for(
unsigned i = 0; i <
DROP_MAX; i++){
129 float distance =
drop[i].size - sqrt(pow(
key->x -
drop[i].x, 2.f) + pow(
key->y -
drop[i].y, 2.f));
132 distance = -distance / 2.;
134 float scale =
drop[i].size / 4.f;
140 float ascale = (1.f -
drop[i].size /
drop[i].msize);
void ckb_keypress(ckb_runctx *context, ckb_key *key, int x, int y, int state)
void ckb_parameter(ckb_runctx *context, const char *name, const char *value)
#define CKB_PARAM_DOUBLE(name, prefix, postfix, default, min, max)
#define CKB_VERSION(version)
#define CKB_TIMEMODE(mode)
void drop_add(float x, float y, int slow)
#define CKB_PARAM_LONG(name, prefix, postfix, default, min, max)
#define CKB_TIME_ABSOLUTE
#define CKB_LICENSE(license)
#define CKB_COPYRIGHT(year, author)
#define CKB_DESCRIPTION(description)
int ckb_frame(ckb_runctx *context)
#define CKB_PARSE_RGB(param_name, r_ptr, g_ptr, b_ptr)
#define CKB_PRESET_START(name)
void ckb_time(ckb_runctx *context, double delta)
#define CKB_LIVEPARAMS(enable)
#define CKB_PARSE_LONG(param_name, value_ptr)
#define CKB_PARSE_BOOL(param_name, value_ptr)
void ckb_init(ckb_runctx *context)
#define CKB_REPEAT(enable)
#define CKB_KEYCLEAR(context)
void ckb_start(ckb_runctx *context, int state)
#define CKB_PRESET_PARAM(name, value)
#define CKB_PARSE_DOUBLE(param_name, value_ptr)
#define CKB_PARAM_RGB(name, prefix, postfix, r, g, b)
void ckb_alpha_blend(ckb_key *key, float a, float r, float g, float b)