Enlightenment CVS committal Author : devilhorns Project : e_modules Module : flame
Dir : e_modules/flame Modified Files: e_mod_main.h e_mod_main.c e_mod_config.c Log Message: Added Matrix and Ice Palettes =================================================================== RCS file: /cvsroot/enlightenment/e_modules/flame/e_mod_main.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -3 -r1.3 -r1.4 --- e_mod_main.h 21 Dec 2005 10:34:07 -0000 1.3 +++ e_mod_main.h 27 Dec 2005 10:45:43 -0000 1.4 @@ -12,7 +12,9 @@ DEFAULT_NONE, GOLD_PALETTE, FIRE_PALETTE, - PLASMA_PALETTE + PLASMA_PALETTE, + MATRIX_PALETTE, + ICE_PALETTE }; struct _Config =================================================================== RCS file: /cvsroot/enlightenment/e_modules/flame/e_mod_main.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -3 -r1.7 -r1.8 --- e_mod_main.c 21 Dec 2005 20:19:04 -0000 1.7 +++ e_mod_main.c 27 Dec 2005 10:45:44 -0000 1.8 @@ -25,6 +25,8 @@ static void _flame_palette_gold_set (Flame_Face *ff); static void _flame_palette_fire_set (Flame_Face *ff); static void _flame_palette_plasma_set (Flame_Face *ff); +static void _flame_palette_matrix_set (Flame_Face *ff); +static void _flame_palette_ice_set (Flame_Face *ff); static void _flame_zero_set (Flame_Face *ff); static void _flame_base_random_set (Flame_Face *ff); static void _flame_base_random_modify (Flame_Face *ff); @@ -152,7 +154,7 @@ E_CONFIG_LIMIT(f->conf->variance, 1, 100); E_CONFIG_LIMIT(f->conf->vartrend, 1, 100); E_CONFIG_LIMIT(f->conf->residual, 1, 100); - E_CONFIG_LIMIT(f->conf->palette_type, GOLD_PALETTE, PLASMA_PALETTE); + E_CONFIG_LIMIT(f->conf->palette_type, GOLD_PALETTE, ICE_PALETTE); managers = e_manager_list(); for (l = managers; l; l = l->next) @@ -217,6 +219,12 @@ case PLASMA_PALETTE: _flame_palette_plasma_set(f->face); break; + case MATRIX_PALETTE: + _flame_palette_matrix_set(f->face); + break; + case ICE_PALETTE: + _flame_palette_ice_set(f->face); + break; default: break; } @@ -457,6 +465,56 @@ } } +static void +_flame_palette_matrix_set(Flame_Face *ff) +{ + int i, r, g, b, a; + + for (i = 0 ; i < 300 ; i++) + { + r = (i - 80) * 3; + g = i * 3; + b = (i - 160) * 3; + + if (r < 0) r = 0; + if (r > 255) r = 255; + if (g < 0) g = 0; + if (g > 255) g = 255; + if (b < 0) b = 0; + if (b > 255) b = 255; + a = (int)((r * 0.299) + (g * 0.587) + (b * 0.114)); + ff->palette[i] = ((((unsigned char)a) << 24) | + (((unsigned char)r) << 16) | + (((unsigned char)g) << 8) | + ((unsigned char)b)); + } +} + +static void +_flame_palette_ice_set(Flame_Face *ff) +{ + int i, r, g, b, a; + + for (i = 0 ; i < 300 ; i++) + { + r = (i - 160) * 3; + g = (i - 40) * 3; + b = i * 3; + + if (r < 0) r = 0; + if (r > 255) r = 255; + if (g < 0) g = 0; + if (g > 255) g = 255; + if (b < 0) b = 0; + if (b > 255) b = 255; + a = (int)((r * 0.299) + (g * 0.587) + (b * 0.114)); + ff->palette[i] = ((((unsigned char)a) << 24) | + (((unsigned char)r) << 16) | + (((unsigned char)g) << 8) | + ((unsigned char)b)); + } +} + /* set the flame array to zero */ static void _flame_zero_set(Flame_Face *ff) =================================================================== RCS file: /cvsroot/enlightenment/e_modules/flame/e_mod_config.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -3 -r1.7 -r1.8 --- e_mod_config.c 19 Dec 2005 00:13:16 -0000 1.7 +++ e_mod_config.c 27 Dec 2005 10:45:44 -0000 1.8 @@ -77,6 +77,10 @@ e_widget_framelist_object_append(of, ob); ob = e_widget_radio_add(evas, _("Plasma"), PLASMA_PALETTE ,rg); e_widget_framelist_object_append(of, ob); + ob = e_widget_radio_add(evas, _("Matrix"), MATRIX_PALETTE ,rg); + e_widget_framelist_object_append(of, ob); + ob = e_widget_radio_add(evas, _("Ice"), ICE_PALETTE ,rg); + e_widget_framelist_object_append(of, ob); e_widget_list_object_append(o, of, 1, 1, 0.5); return o; } @@ -99,6 +103,12 @@ case 3: f->conf->palette_type = PLASMA_PALETTE; //Plasma break; + case 4: + f->conf->palette_type = MATRIX_PALETTE; //Matrix + break; + case 5: + f->conf->palette_type = ICE_PALETTE; //Ice + break; default: break; } ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs