This email list is read-only. Emails sent to this list will be discarded
----------------------------------
apple/apple.c | 410 ++++++++++++++++++++++++++++++------------------
colortext/colortext.c | 123 ++++++++++-----
squares/squares.c | 388 +++++++++++++++++++++++++++++++----------------
3 files changed, 599 insertions(+), 322 deletions(-)
New commits:
commit 13752b77d043f9b482d14080c3c40a586730317a
Author: Felicia Decker <[EMAIL PROTECTED]>
Date: Thu Aug 21 08:31:03 2008 -0700
Apple, ColorText, Squares all support 800x480, 800x600, 1024x600, 1024x768
Diff in this email is a maximum of 400 lines.
diff --git a/apple/apple.c b/apple/apple.c
index b947560..1f36bb9 100644
--- a/apple/apple.c
+++ b/apple/apple.c
@@ -11,8 +11,12 @@
#define SCN_WIDTH 800
#define SCN_HEIGHT 480
double scale_factor = .1;
-double x_scale_factor = .1;
-double y_scale_factor = .1;
+double xfactor = .1;
+double yfactor = .1;
+double scn_width = 0;
+double scn_height = 0;
+int padding_1 = 0;
+int padding_2 = 0;
/**
Rings start from the top-inner ring of the
@@ -62,7 +66,6 @@ ClutterActor *ring18[9];
#define ELLIPSE_X 640
#define NUM_PATH_KNOTS 70
-
ClutterActor *stage;
/* space between apple square pieces */
@@ -90,98 +93,120 @@ void add_to_ellipse_behaviour(ClutterTimeline
*timeline_rotation,
CLUTTER_ALPHA_RAMP_INC,
NULL, NULL);
ClutterBehaviour *behaviour;
- double ellipse_x = ELLIPSE_X * x_scale_factor;
+ double ellipse_x = ELLIPSE_X * xfactor;
double ellipse_y = 170;
+ int padding = 0;
+ if (SCN_WIDTH == 1024 && SCN_HEIGHT == 768)
+ padding = padding_2;
+ if (SCN_WIDTH == 800 && SCN_HEIGHT == 600)
+ padding = padding_1;
switch(line)
{
case RING1:
behaviour = clutter_behaviour_ellipse_new(
- alpha, ellipse_x, ellipse_y * y_scale_factor, 135 * x_scale_factor,
20 * y_scale_factor, CLUTTER_ROTATE_CW, start_angle,
- start_angle);
+ alpha, ellipse_x, (padding + ellipse_y) * yfactor, 135 * xfactor,
+ 20 * yfactor, CLUTTER_ROTATE_CW, start_angle, start_angle);
break;
case RING2:
behaviour = clutter_behaviour_ellipse_new(
- alpha, ellipse_x, (ellipse_y - 10) * y_scale_factor, 220 *
x_scale_factor, 50 * y_scale_factor, CLUTTER_ROTATE_CW, start_angle,
+ alpha, ellipse_x, (padding + ellipse_y - 10) * yfactor,
+ 220 * xfactor, 50 * yfactor, CLUTTER_ROTATE_CW, start_angle,
start_angle);
break;
case RING3:
behaviour = clutter_behaviour_ellipse_new(
- alpha, ellipse_x, (ellipse_y - 30) * y_scale_factor, 305 *
x_scale_factor, 50 * y_scale_factor, CLUTTER_ROTATE_CW, start_angle,
+ alpha, ellipse_x, (padding + ellipse_y - 30) * yfactor,
+ 305 * xfactor, 50 * yfactor, CLUTTER_ROTATE_CW, start_angle,
start_angle);
break;
case RING4:
behaviour = clutter_behaviour_ellipse_new(
- alpha, ellipse_x, (ellipse_y - 50) * y_scale_factor, 370 *
x_scale_factor, 50 * y_scale_factor, CLUTTER_ROTATE_CW, start_angle,
+ alpha, ellipse_x, (padding + ellipse_y - 50) * yfactor,
+ 370 * xfactor, 50 * yfactor, CLUTTER_ROTATE_CW, start_angle,
start_angle);
break;
case RING5:
behaviour = clutter_behaviour_ellipse_new(
- alpha, ellipse_x, (ellipse_y - 45) * y_scale_factor, 450 *
x_scale_factor, 50 * y_scale_factor, CLUTTER_ROTATE_CW, start_angle,
+ alpha, ellipse_x, (padding + ellipse_y - 45) * yfactor,
+ 450 * xfactor, 50 * yfactor, CLUTTER_ROTATE_CW, start_angle,
start_angle);
break;
case RING6:
behaviour = clutter_behaviour_ellipse_new(
- alpha, ellipse_x, (ellipse_y - 30) * y_scale_factor, 540 *
x_scale_factor, 100 * y_scale_factor, CLUTTER_ROTATE_CW, start_angle,
+ alpha, ellipse_x, (padding + ellipse_y - 30) * yfactor,
+ 540 * xfactor, 100 * yfactor, CLUTTER_ROTATE_CW, start_angle,
start_angle);
break;
case RING7:
behaviour = clutter_behaviour_ellipse_new(
- alpha, ellipse_x, (ellipse_y + 10) * y_scale_factor, 580 *
x_scale_factor, 100 * y_scale_factor, CLUTTER_ROTATE_CW, start_angle,
+ alpha, ellipse_x, (padding + ellipse_y + 10) * yfactor,
+ 580 * xfactor, 100 * yfactor, CLUTTER_ROTATE_CW, start_angle,
start_angle);
break;
case RING8:
behaviour = clutter_behaviour_ellipse_new(
- alpha, ellipse_x, (ellipse_y + 50) * y_scale_factor, 605 *
x_scale_factor, 100 * y_scale_factor, CLUTTER_ROTATE_CW, start_angle,
+ alpha, ellipse_x, (padding + ellipse_y + 50) * yfactor,
+ 605 * xfactor, 100 * yfactor, CLUTTER_ROTATE_CW, start_angle,
start_angle);
break;
case RING9:
behaviour = clutter_behaviour_ellipse_new(
- alpha, ellipse_x, (ellipse_y + 90) * y_scale_factor, 605 *
x_scale_factor, 100 * y_scale_factor, CLUTTER_ROTATE_CW, start_angle,
+ alpha, ellipse_x, (padding + ellipse_y + 90) * yfactor,
+ 605 * xfactor, 100 * yfactor, CLUTTER_ROTATE_CW, start_angle,
start_angle);
break;
case RING10:
behaviour = clutter_behaviour_ellipse_new(
- alpha, ellipse_x, (ellipse_y + 130) * y_scale_factor, 585 *
x_scale_factor, 100 * y_scale_factor, CLUTTER_ROTATE_CW, start_angle,
+ alpha, ellipse_x, (padding + ellipse_y + 130) * yfactor,
+ 585 * xfactor, 100 * yfactor, CLUTTER_ROTATE_CW, start_angle,
start_angle);
break;
case RING11:
behaviour = clutter_behaviour_ellipse_new(
- alpha, ellipse_x, (ellipse_y + 170) * y_scale_factor, 565 *
x_scale_factor, 100 * y_scale_factor, CLUTTER_ROTATE_CW, start_angle,
+ alpha, ellipse_x, (padding + ellipse_y + 170) * yfactor,
+ 565 * xfactor, 100 * yfactor, CLUTTER_ROTATE_CW, start_angle,
start_angle);
break;
case RING12:
behaviour = clutter_behaviour_ellipse_new(
- alpha, ellipse_x, (ellipse_y + 210) * y_scale_factor, 540 *
x_scale_factor, 100 * y_scale_factor, CLUTTER_ROTATE_CW, start_angle,
+ alpha, ellipse_x, (padding + ellipse_y + 210) * yfactor,
+ 540 * xfactor, 100 * yfactor, CLUTTER_ROTATE_CW, start_angle,
start_angle);
break;
case RING13:
behaviour = clutter_behaviour_ellipse_new(
- alpha, ellipse_x, (ellipse_y + 250) * y_scale_factor, 500 *
x_scale_factor, 100 * y_scale_factor, CLUTTER_ROTATE_CW, start_angle,
+ alpha, ellipse_x, (padding + ellipse_y + 250) * yfactor,
+ 500 * xfactor, 100 * yfactor, CLUTTER_ROTATE_CW, start_angle,
start_angle);
break;
case RING14:
behaviour = clutter_behaviour_ellipse_new(
- alpha, ellipse_x, (ellipse_y + 290) * y_scale_factor, 440 *
x_scale_factor, 100 * y_scale_factor, CLUTTER_ROTATE_CW, start_angle,
+ alpha, ellipse_x, (padding + ellipse_y + 290) * yfactor,
+ 440 * xfactor, 100 * yfactor, CLUTTER_ROTATE_CW, start_angle,
start_angle);
break;
case RING15:
behaviour = clutter_behaviour_ellipse_new(
- alpha, ellipse_x, (ellipse_y + 330) * y_scale_factor, 370 *
x_scale_factor, 100 * y_scale_factor, CLUTTER_ROTATE_CW, start_angle,
+ alpha, ellipse_x, (padding + ellipse_y + 330) * yfactor,
+ 370 * xfactor, 100 * yfactor, CLUTTER_ROTATE_CW, start_angle,
start_angle);
break;
case RING16:
behaviour = clutter_behaviour_ellipse_new(
- alpha, ellipse_x, (ellipse_y + 330) * y_scale_factor, 300 *
x_scale_factor, 50 * y_scale_factor, CLUTTER_ROTATE_CW, start_angle,
+ alpha, ellipse_x, (padding + ellipse_y + 330) * yfactor,
+ 300 * xfactor, 50 * yfactor, CLUTTER_ROTATE_CW, start_angle,
start_angle);
break;
case RING17:
behaviour = clutter_behaviour_ellipse_new(
- alpha, ellipse_x, (ellipse_y + 330) * y_scale_factor, 210 *
x_scale_factor, 50 * y_scale_factor, CLUTTER_ROTATE_CW, start_angle,
+ alpha, ellipse_x, (padding + ellipse_y + 330) * yfactor,
+ 210 * xfactor, 50 * yfactor, CLUTTER_ROTATE_CW, start_angle,
start_angle);
break;
case RING18:
behaviour = clutter_behaviour_ellipse_new(
- alpha, ellipse_x, (ellipse_y + 310) * y_scale_factor, 110 *
x_scale_factor, 30 * y_scale_factor, CLUTTER_ROTATE_CW, start_angle,
+ alpha, ellipse_x, (padding + ellipse_y + 310) * yfactor,
+ 110 * xfactor, 30 * yfactor, CLUTTER_ROTATE_CW, start_angle,
start_angle);
break;
case STEM:
@@ -190,7 +215,8 @@ void add_to_ellipse_behaviour(ClutterTimeline
*timeline_rotation,
break;
default:
behaviour = clutter_behaviour_ellipse_new(
- alpha, ellipse_x, (ellipse_y + 310) * y_scale_factor, 110 *
x_scale_factor, 30 * y_scale_factor, CLUTTER_ROTATE_CW, start_angle,
+ alpha, ellipse_x, (padding + ellipse_y + 310) * yfactor,
+ 110 * xfactor, 30 * yfactor, CLUTTER_ROTATE_CW, start_angle,
start_angle);
}
clutter_behaviour_apply(behaviour, actor);
@@ -213,90 +239,103 @@ void setup_path(ClutterActor *actor, ClutterTimeline
*timeline)
ClutterKnot knot[NUM_PATH_KNOTS];
- knot[0].x = x_scale_factor * 258; knot[0].y = y_scale_factor * 136;
- knot[1].x = x_scale_factor * 246; knot[1].y = y_scale_factor * 137;
- knot[2].x = x_scale_factor * 236; knot[2].y = y_scale_factor * 139;
- knot[3].x = x_scale_factor * 230; knot[3].y = y_scale_factor * 142;
- knot[4].x = x_scale_factor * 229; knot[4].y = y_scale_factor * 145; //5
-
- knot[5].x = x_scale_factor * 231; knot[5].y = y_scale_factor * 148;
- knot[6].x = x_scale_factor * 242; knot[6].y = y_scale_factor * 153;
- knot[7].x = x_scale_factor * 255; knot[7].y = y_scale_factor * 159;
- knot[8].x = x_scale_factor * 261; knot[8].y = y_scale_factor * 163;
- knot[9].x = x_scale_factor * 263; knot[9].y = y_scale_factor * 166; //10
-
- knot[10].x = x_scale_factor * 260; knot[10].y = y_scale_factor * 168;
- knot[11].x = x_scale_factor * 252; knot[11].y = y_scale_factor * 169;
- knot[12].x = x_scale_factor * 235; knot[12].y = y_scale_factor * 169;
- knot[13].x = x_scale_factor * 209; knot[13].y = y_scale_factor * 169;
- knot[14].x = x_scale_factor * 174; knot[14].y = y_scale_factor * 170; //15
-
- knot[15].x = x_scale_factor * 123; knot[15].y = y_scale_factor * 171;
- knot[16].x = x_scale_factor * 101; knot[16].y = y_scale_factor * 173;
- knot[17].x = x_scale_factor * 93; knot[17].y = y_scale_factor * 175;
- knot[18].x = x_scale_factor * 88; knot[18].y = y_scale_factor * 178;
- knot[19].x = x_scale_factor * 86; knot[19].y = y_scale_factor * 182; //20
-
- knot[20].x = x_scale_factor * 86; knot[20].y = y_scale_factor * 186;
- knot[21].x = x_scale_factor * 89; knot[21].y = y_scale_factor * 189;
- knot[22].x = x_scale_factor * 96; knot[22].y = y_scale_factor * 190;
- knot[23].x = x_scale_factor * 106; knot[23].y = y_scale_factor * 191;
- knot[24].x = x_scale_factor * 121; knot[24].y = y_scale_factor * 194; //25
-
- knot[25].x = x_scale_factor * 143; knot[25].y = y_scale_factor * 198;
- knot[26].x = x_scale_factor * 175; knot[26].y = y_scale_factor * 207;
- knot[27].x = x_scale_factor * 215; knot[27].y = y_scale_factor * 221;
- knot[28].x = x_scale_factor * 235; knot[28].y = y_scale_factor * 234;
- knot[29].x = x_scale_factor * 241; knot[29].y = y_scale_factor * 241; //30
+ int padding = 0;
+ if (SCN_WIDTH == 1024 && SCN_HEIGHT == 768)
+ padding = padding_2;
+ if (SCN_WIDTH == 800 && SCN_HEIGHT == 600)
+ padding = padding_1;
+
+ knot[0].x = 258; knot[0].y = 136;
+ knot[1].x = 246; knot[1].y = 137;
+ knot[2].x = 236; knot[2].y = 139;
+ knot[3].x = 230; knot[3].y = 142;
+ knot[4].x = 229; knot[4].y = 145; //5
+
+ knot[5].x = 231; knot[5].y = 148;
+ knot[6].x = 242; knot[6].y = 153;
+ knot[7].x = 255; knot[7].y = 159;
+ knot[8].x = 261; knot[8].y = 163;
+ knot[9].x = 263; knot[9].y = 166; //10
+
+ knot[10].x = 260; knot[10].y = 168;
+ knot[11].x = 252; knot[11].y = 169;
+ knot[12].x = 235; knot[12].y = 169;
+ knot[13].x = 209; knot[13].y = 169;
+ knot[14].x = 174; knot[14].y = 170; //15
+
+ knot[15].x = 123; knot[15].y = 171;
+ knot[16].x = 101; knot[16].y = 173;
+ knot[17].x = 93; knot[17].y = 175;
+ knot[18].x = 88; knot[18].y = 178;
+ knot[19].x = 86; knot[19].y = 182; //20
+
+ knot[20].x = 86; knot[20].y = 186;
+ knot[21].x = 89; knot[21].y = 189;
+ knot[22].x = 96; knot[22].y = 190;
+ knot[23].x = 106; knot[23].y = 191;
+ knot[24].x = 121; knot[24].y = 194; //25
+
+ knot[25].x = 143; knot[25].y = 198;
+ knot[26].x = 175; knot[26].y = 207;
+ knot[27].x = 215; knot[27].y = 221;
+ knot[28].x = 235; knot[28].y = 234;
+ knot[29].x = 241; knot[29].y = 241; //30
- knot[30].x = x_scale_factor * 244; knot[30].y = y_scale_factor * 248;
- knot[31].x = x_scale_factor * 244; knot[31].y = y_scale_factor * 253;
- knot[32].x = x_scale_factor * 244; knot[32].y = y_scale_factor * 258;
- knot[33].x = x_scale_factor * 241; knot[33].y = y_scale_factor * 262;
- knot[34].x = x_scale_factor * 237; knot[34].y = y_scale_factor * 265; //35
-
- knot[35].x = x_scale_factor * 230; knot[35].y = y_scale_factor * 269;
- knot[36].x = x_scale_factor * 218; knot[36].y = y_scale_factor * 274;
- knot[37].x = x_scale_factor * 201; knot[37].y = y_scale_factor * 280;
- knot[38].x = x_scale_factor * 174; knot[38].y = y_scale_factor * 288;
- knot[39].x = x_scale_factor * 140; knot[39].y = y_scale_factor * 294; //40
-
- knot[40].x = x_scale_factor * 93; knot[40].y = y_scale_factor * 300;
- knot[41].x = x_scale_factor * 57; knot[41].y = y_scale_factor * 310;
- knot[42].x = x_scale_factor * 34; knot[42].y = y_scale_factor * 318;
- knot[43].x = x_scale_factor * 27; knot[43].y = y_scale_factor * 323;
- knot[44].x = x_scale_factor * 22; knot[44].y = y_scale_factor * 328; //45
-
- knot[45].x = x_scale_factor * 17; knot[45].y = y_scale_factor * 333;
- knot[46].x = x_scale_factor * 14; knot[46].y = y_scale_factor * 338;
- knot[47].x = x_scale_factor * 12; knot[47].y = y_scale_factor * 343;
- knot[48].x = x_scale_factor * 10; knot[48].y = y_scale_factor * 348;
- knot[49].x = x_scale_factor * 9; knot[49].y = y_scale_factor * 352; //50
-
- knot[50].x = x_scale_factor * 8; knot[50].y = y_scale_factor * 358;
- knot[51].x = x_scale_factor * 8; knot[51].y = y_scale_factor * 365;
- knot[52].x = x_scale_factor * 11; knot[52].y = y_scale_factor * 371;
- knot[53].x = x_scale_factor * 14; knot[53].y = y_scale_factor * 378;
- knot[54].x = x_scale_factor * 21; knot[54].y = y_scale_factor * 386; //55
-
- knot[55].x = x_scale_factor * 27; knot[55].y = y_scale_factor * 391;
- knot[56].x = x_scale_factor * 35; knot[56].y = y_scale_factor * 398;
- knot[57].x = x_scale_factor * 44; knot[57].y = y_scale_factor * 405;
- knot[58].x = x_scale_factor * 65; knot[58].y = y_scale_factor * 416;
- knot[59].x = x_scale_factor * 102; knot[59].y = y_scale_factor * 434; //60
-
- knot[60].x = x_scale_factor * 149; knot[60].y = y_scale_factor * 459;
- knot[61].x = x_scale_factor * 155; knot[61].y = y_scale_factor * 465;
- knot[62].x = x_scale_factor * 159; knot[62].y = y_scale_factor * 472;
- knot[63].x = x_scale_factor * 160; knot[63].y = y_scale_factor * 482;
- knot[64].x = x_scale_factor * 157; knot[64].y = y_scale_factor * 506; //65
-
- knot[65].x = x_scale_factor * 153; knot[65].y = y_scale_factor * 524;
- knot[66].x = x_scale_factor * 152; knot[66].y = y_scale_factor * 528;
- knot[67].x = x_scale_factor * 149; knot[67].y = y_scale_factor * 531;
- knot[68].x = x_scale_factor * 144; knot[68].y = y_scale_factor * 536;
- knot[69].x = x_scale_factor * 114; knot[69].y = y_scale_factor * 556; //70
-
+ knot[30].x = 244; knot[30].y = 248;
+ knot[31].x = 244; knot[31].y = 253;
+ knot[32].x = 244; knot[32].y = 258;
+ knot[33].x = 241; knot[33].y = 262;
+ knot[34].x = 237; knot[34].y = 265; //35
+
+ knot[35].x = 230; knot[35].y = 269;
+ knot[36].x = 218; knot[36].y = 274;
+ knot[37].x = 201; knot[37].y = 280;
+ knot[38].x = 174; knot[38].y = 288;
+ knot[39].x = 140; knot[39].y = 294; //40
+
+ knot[40].x = 93; knot[40].y = 300;
+ knot[41].x = 57; knot[41].y = 310;
+ knot[42].x = 34; knot[42].y = 318;
+ knot[43].x = 27; knot[43].y = 323;
+ knot[44].x = 22; knot[44].y = 328; //45
+
+ knot[45].x = 17; knot[45].y = 333;
+ knot[46].x = 14; knot[46].y = 338;
+ knot[47].x = 12; knot[47].y = 343;
+ knot[48].x = 10; knot[48].y = 348;
+ knot[49].x = 9; knot[49].y = 352; //50
+
+ knot[50].x = 8; knot[50].y = 358;
+ knot[51].x = 8; knot[51].y = 365;
+ knot[52].x = 11; knot[52].y = 371;
+ knot[53].x = 14; knot[53].y = 378;
+ knot[54].x = 21; knot[54].y = 386; //55
+
+ knot[55].x = 27; knot[55].y = 391;
+ knot[56].x = 35; knot[56].y = 398;
+ knot[57].x = 44; knot[57].y = 405;
+ knot[58].x = 65; knot[58].y = 416;
+ knot[59].x = 102; knot[59].y = 434; //60
+
+ knot[60].x = 149; knot[60].y = 459;
+ knot[61].x = 155; knot[61].y = 465;
+ knot[62].x = 159; knot[62].y = 472;
+ knot[63].x = 160; knot[63].y = 482;
+ knot[64].x = 157; knot[64].y = 506; //65
+
+ knot[65].x = 153; knot[65].y = 524;
+ knot[66].x = 152; knot[66].y = 528;
+ knot[67].x = 149; knot[67].y = 531;
+ knot[68].x = 144; knot[68].y = 536;
+ knot[69].x = 114; knot[69].y = 556; //70
+
+ int i;
+ for(i = 0; i < NUM_PATH_KNOTS; i++)
+ {
+ knot[i].x *= xfactor;
+ knot[i].y *= yfactor;
+ knot[i].y += padding;
+ }
alpha = clutter_alpha_new_full(timeline,
CLUTTER_ALPHA_SMOOTHSTEP_INC,
NULL, NULL);
@@ -304,7 +343,7 @@ void setup_path(ClutterActor *actor, ClutterTimeline
*timeline)
knot,
sizeof(knot)/sizeof(ClutterKnot));
clutter_behaviour_apply(behaviour, actor);
- behaviour1 = clutter_behaviour_scale_new(alpha, .05, .05, x_scale_factor,
y_scale_factor);
+ behaviour1 = clutter_behaviour_scale_new(alpha, .05, .05, xfactor,
yfactor);
clutter_behaviour_apply(behaviour1, actor);
}
@@ -321,7 +360,7 @@ void init_apple_piece(ClutterActor *apple_piece, int line,
gdouble angle)
{
ClutterColor apple_red = { 0xEE, 0x63, 0x63, 0xff };
apple_piece = clutter_rectangle_new_with_color(&apple_red);
- clutter_actor_set_size(apple_piece, 30 * y_scale_factor, 30 *
y_scale_factor);
+ clutter_actor_set_size(apple_piece, 30 * yfactor, 30 * yfactor);
clutter_actor_set_opacity(apple_piece, 80);
if (line == RING16 || line == RING17 || line == RING18) {
clutter_actor_set_opacity(apple_piece, 40);
@@ -332,6 +371,7 @@ void init_apple_piece(ClutterActor *apple_piece, int line,
gdouble angle)
}
+
/**
Makes the call to initialize each actor and
specifies the angle to separate each actor
@@ -526,17 +566,22 @@ ClutterActor *get_actor_from_image (const char *file_name)
*/
int init_stem()
{
- ClutterActor *stem = get_actor_from_image ("apple_stem3.png");
- if (!stem) {
- return -1;
- }
- clutter_actor_set_scale(stem, x_scale_factor, y_scale_factor);
_______________________________________________
Commits mailing list
[email protected]
https://www.moblin.org/mailman/listinfo/commits