/************************** * INIT * **************************/ PluginInfo *goom_init (uint32_t resx, uint32_t resy) { PluginInfo *goomInfo = (PluginInfo*)malloc(sizeof(PluginInfo)); #ifdef VERBOSE printf ("GOOM: init (%d, %d);\n", resx, resy); #endif plugin_info_init(goomInfo,4); goomInfo->screen.width = resx; goomInfo->screen.height = resy; goomInfo->screen.size = resx * resy; goomInfo->star_fx = flying_star_create(); goomInfo->star_fx.init(&goomInfo->star_fx, goomInfo); goomInfo->zoomFilter_fx = zoomFilterVisualFXWrapper_create (); goomInfo->zoomFilter_fx.init(&goomInfo->zoomFilter_fx, goomInfo); goomInfo->tentacles_fx = tentacle_fx_create(); goomInfo->tentacles_fx.init(&goomInfo->tentacles_fx, goomInfo); goomInfo->convolve_fx = convolve_create(); goomInfo->convolve_fx.init(&goomInfo->convolve_fx, goomInfo); plugin_info_add_visual (goomInfo, 0, &goomInfo->zoomFilter_fx); plugin_info_add_visual (goomInfo, 1, &goomInfo->tentacles_fx); plugin_info_add_visual (goomInfo, 2, &goomInfo->star_fx); plugin_info_add_visual (goomInfo, 3, &goomInfo->convolve_fx); init_buffers(goomInfo, goomInfo->screen.size); goomInfo->gRandom = goom_random_init((uintptr_t)goomInfo->pixel); goomInfo->cycle = 0; goomInfo->ifs_fx = ifs_visualfx_create(); goomInfo->ifs_fx.init(&goomInfo->ifs_fx, goomInfo); goomInfo->gmline1 = goom_lines_init (goomInfo, resx, goomInfo->screen.height, GML_HLINE, goomInfo->screen.height, GML_BLACK, GML_CIRCLE, 0.4f * (float) goomInfo->screen.height, GML_VERT); goomInfo->gmline2 = goom_lines_init (goomInfo, resx, goomInfo->screen.height, GML_HLINE, 0, GML_BLACK, GML_CIRCLE, 0.2f * (float) goomInfo->screen.height, GML_RED); gfont_load (); /* goom_set_main_script(goomInfo, goomInfo->main_script_str); */ return goomInfo; }
void goom_init (guint32 resx, guint32 resy, int cinemascope) { #ifdef VERBOSE printf ("GOOM: init (%d, %d);\n", resx, resy); #endif if (cinemascope) c_black_height = resy / 5; else c_black_height = 0; resolx = resx; resoly = resy; buffsize = resx * resy; c_offset = c_black_height * resx; c_resoly = resy - c_black_height * 2; pixel = (guint32 *) malloc (buffsize * sizeof (guint32) + 128); back = (guint32 *) malloc (buffsize * sizeof (guint32) + 128); //RAND_INIT (); srand ((guint32) pixel); if (!rand_tab) rand_tab = (int *) malloc (NB_RAND * sizeof(int)) ; rand_pos = 1 ; while (rand_pos != 0) rand_tab [rand_pos++] = rand () ; cycle = 0; p1 = (guint32 *) ((1 + ((unsigned int) (pixel)) / 128) * 128); p2 = (guint32 *) ((1 + ((unsigned int) (back)) / 128) * 128); init_ifs (resx, c_resoly); gmline1 = goom_lines_init (resx, c_resoly, GML_HLINE, c_resoly, GML_BLACK, GML_CIRCLE, 0.4f * (float) c_resoly, GML_VERT); gmline2 = goom_lines_init (resx, c_resoly, GML_HLINE, 0, GML_BLACK, GML_CIRCLE, 0.2f * (float) c_resoly, GML_RED); // font_height = NULL; // font_width = NULL; // font_chars = NULL; gfont_load (); tentacle_new (); }