Commit 10ec7199 authored by Bruno Coudoin's avatar Bruno Coudoin

- Patch from Miguel that:

	  - fixes the digital display in clockgame.
	  - remove a momory leak in memory
parent 81fbfe99
2006-11-03 Bruno coudoin <bruno.coudoin@free.fr>
- Patch from Miguel that:
- fixes the digital display in clockgame.
- remove a momory leak in memory
* TODO:
* src/boards/clockgame.c: (start_board), (display_digital_time),
(display_hour), (display_minute), (display_second), (item_event),
(get_random_hour):
* src/boards/memory.c: (end_board), (create_item):
2006-11-02 Bruno Coudoin
- new date system, untested.
......
......@@ -146,3 +146,4 @@ educational software that rivals many proprietary ones.
If somebody want to work on the profile concept, we will be abble to
provide these features at least 6 monthes earlier than what I can do.
- Replace Soudan by Sudan in boards/geography/board4_2.xml.in
\ No newline at end of file
......@@ -248,6 +248,12 @@ destroy_all_items()
static void display_digital_time(GnomeCanvasItem *item, GcomprisTime *time)
{
gchar *text = NULL;
int temps;
temps = (time->hour+12)*3600 + time->minute*60 + time->second;
time->hour = (temps / 3600) % 12;
time->minute = (temps / 60) % 60;
time->second = temps % 60;
if(item==NULL)
return;
......@@ -269,7 +275,6 @@ static void display_hour(guint hour)
double needle_size = clock_size*0.70;
double ang;
GnomeCanvasPoints *canvasPoints;
canvasPoints = gnome_canvas_points_new (2);
if(hour_item==NULL)
return;
......@@ -279,6 +284,7 @@ static void display_hour(guint hour)
ang += currentTime.minute * M_PI / 360;
ang += currentTime.second * M_PI / 21600;
canvasPoints = gnome_canvas_points_new (2);
canvasPoints->coords[0]=cx;
canvasPoints->coords[1]=cy;
canvasPoints->coords[2]=cx + needle_size * sin(ang);
......@@ -300,13 +306,11 @@ static void display_hour(guint hour)
display_digital_time(digital_time_item_s, &currentTime);
}
static void display_minute(guint minute)
{
double needle_size = clock_size;
double ang;
GnomeCanvasPoints *canvasPoints;
canvasPoints = gnome_canvas_points_new (2);
if(minute_item==NULL)
return;
......@@ -314,6 +318,7 @@ static void display_minute(guint minute)
ang = minute * M_PI / 30;
ang += currentTime.second * M_PI / 1800;
canvasPoints = gnome_canvas_points_new (2);
canvasPoints->coords[0]=cx;
canvasPoints->coords[1]=cy;
canvasPoints->coords[2]=cx + needle_size * sin(ang);
......@@ -332,6 +337,7 @@ static void display_minute(guint minute)
currentTime.minute=minute;
display_digital_time(digital_time_item, &currentTime);
display_digital_time(digital_time_item_s, &currentTime);
}
static void display_second(guint second)
......@@ -339,7 +345,6 @@ static void display_second(guint second)
double needle_size = clock_size;
double ang;
GnomeCanvasPoints *canvasPoints;
canvasPoints = gnome_canvas_points_new (2);
/* No seconds at first levels */
if(second_item==NULL || gcomprisBoard->level<=2)
......@@ -347,6 +352,7 @@ static void display_second(guint second)
ang = second * M_PI / 30;
canvasPoints = gnome_canvas_points_new (2);
canvasPoints->coords[0]=cx;
canvasPoints->coords[1]=cy;
canvasPoints->coords[2]=cx + needle_size * sin(ang);
......@@ -365,6 +371,7 @@ static void display_second(guint second)
currentTime.second=second;
display_digital_time(digital_time_item, &currentTime);
display_digital_time(digital_time_item_s, &currentTime);
}
......
......@@ -910,6 +910,11 @@ end_board ()
tux_memory = NULL;
}
}
g_free(op_add);
g_free(op_minus);
g_free(op_mult);
g_free(op_div);
gcomprisBoard = NULL;
}
......@@ -1222,6 +1227,7 @@ static void create_item(GnomeCanvasGroup *parent)
"x", (double) 50,
"y", (double) 20,
NULL);
gdk_pixbuf_unref(pixmap_tux);
tux_score_s = gnome_canvas_item_new (GNOME_CANVAS_GROUP(parent),
gnome_canvas_text_get_type (),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment