1 #include "../ckb/ckb-anim.h"
11 CKB_GUID(
"{097D69F0-70B2-48B8-AFE2-25A1CDB02C9D}");
36 CKB_PRESET_PARAM(
"color",
"0:ffff0000 17:ffffff00 33:ff00ff00 50:ff00ffff 67:ff0000ff 83:ffff00ff 100:ffff0000");
57 srand((
unsigned)time(NULL));
64 double sizex = context->
width / 2.;
65 double sizey = context->
height / 2.;
66 animlength = len / 100. * sqrt(sizex * sizex + sizey * sizey);
75 #define ANIM_MAX (144 * 2)
91 float sizex = fmax(x, width - x);
92 float sizey = fmax(y, height - y);
93 anim[i].maxsize = sqrt(sizex * sizex + sizey * sizey) +
animlength;
95 anim[i].choice = (float)rand()/(float)(RAND_MAX);
125 for(
unsigned i = 0; i <
ANIM_MAX; i++){
139 for(
unsigned i = 0; i <
ANIM_MAX; i++){
143 float distance =
anim[i].cursize - sqrt(pow(
key->x -
anim[i].x, 2.f) + pow(
key->y -
anim[i].y, 2.f));
147 distance = fabs(distance);
148 else if(distance >= -0.005f && distance < 0.f)
151 if(distance > 1.f && distance <= 1.005f)
156 if(distance >= 0. && distance <= 1.f){
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)
#define CKB_PARSE_AGRADIENT(param_name, gradient_ptr)
#define CKB_LICENSE(license)
#define CKB_COPYRIGHT(year, author)
#define CKB_DESCRIPTION(description)
int ckb_frame(ckb_runctx *context)
#define CKB_PRESET_START(name)
void ckb_time(ckb_runctx *context, double delta)
#define CKB_PREEMPT(enable)
#define CKB_PARAM_AGRADIENT(name, prefix, postfix, default)
#define CKB_LIVEPARAMS(enable)
void anim_remove(int index)
#define CKB_TIME_DURATION
#define CKB_PARSE_BOOL(param_name, value_ptr)
void ckb_init(ckb_runctx *context)
#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_BOOL(name, text, default)
void ckb_alpha_blend(ckb_key *key, float a, float r, float g, float b)
void ckb_grad_color(float *a, float *r, float *g, float *b, const ckb_gradient *grad, float pos)