gcompris r3511 - in branches/gcomprixogoo: boards/skins/babytoy boards/skins/gartoon src/advanced_colors-activity src/algebra_by-activity src/algebra_guesscount-activity src/algorithm-activity src/awele-activity src/bargame-activity src/billard-activity src/boards src/canal_lock-activity src/chess_computer-activity src/click_on_letter-activity src/clickgame-activity src/clockgame-activity src/colors-activity src/crane-activity src/drawnumber-activity src/electric-activity src/enumerate-activity src/erase-activity src/fifteen-activity src/gcompris src/gletters-activity src/hanoi-activity src/hanoi_real-activity src/imageid-activity src/leftright-activity src/magic_hat_minus-activity src/maze-activity src/melody-activity src/memory-activity src/missing_letter-activity src/money-activity src/mosaic-activity src/paratrooper-activity src/planegame-activity src/railroad-activity src/read_colors-activity src/readingh-activity src/redraw-activity src/reversecount-activity sr c/scalesboard-activity src/smallnumbers-activity src/submarine-activity src/superbrain-activity src/target-activity src/traffic-activity src/tuxpaint-activity src/wordsgame-activity
- From: bcoudoin svn gnome org
- To: svn-commits-list gnome org
- Subject: gcompris r3511 - in branches/gcomprixogoo: boards/skins/babytoy boards/skins/gartoon src/advanced_colors-activity src/algebra_by-activity src/algebra_guesscount-activity src/algorithm-activity src/awele-activity src/bargame-activity src/billard-activity src/boards src/canal_lock-activity src/chess_computer-activity src/click_on_letter-activity src/clickgame-activity src/clockgame-activity src/colors-activity src/crane-activity src/drawnumber-activity src/electric-activity src/enumerate-activity src/erase-activity src/fifteen-activity src/gcompris src/gletters-activity src/hanoi-activity src/hanoi_real-activity src/imageid-activity src/leftright-activity src/magic_hat_minus-activity src/maze-activity src/melody-activity src/memory-activity src/missing_letter-activity src/money-activity src/mosaic-activity src/paratrooper-activity src/planegame-activity src/railroad-activity src/read_colors-activity src/readingh-activity src/redraw-activity src/reversecount-activity sr c/scalesboard-activity src/smallnumbers-activity src/submarine-activity src/superbrain-activity src/target-activity src/traffic-activity src/tuxpaint-activity src/wordsgame-activity
- Date: Sat, 30 Aug 2008 12:27:24 +0000 (UTC)
Author: bcoudoin
Date: Sat Aug 30 12:27:24 2008
New Revision: 3511
URL: http://svn.gnome.org/viewvc/gcompris?rev=3511&view=rev
Log:
removed the gc_bonus_end_display in the C api and its
gcompris.board_finished python counterpart.
Now all activities stay at their last level when completed.
This is more adapted to the by activity distribution model
like we have for the olpc xo.
Removed:
branches/gcomprixogoo/boards/skins/gartoon/door1.png
branches/gcomprixogoo/boards/skins/gartoon/door2.png
branches/gcomprixogoo/boards/skins/gartoon/toomanyerrors.png
branches/gcomprixogoo/boards/skins/gartoon/tuxloco.png
branches/gcomprixogoo/boards/skins/gartoon/tuxplane.png
Modified:
branches/gcomprixogoo/boards/skins/babytoy/bar_bg.png
branches/gcomprixogoo/boards/skins/gartoon/bar_bg.png
branches/gcomprixogoo/src/advanced_colors-activity/advanced_colors.c
branches/gcomprixogoo/src/algebra_by-activity/algebra.c
branches/gcomprixogoo/src/algebra_guesscount-activity/algebra_guesscount.c
branches/gcomprixogoo/src/algorithm-activity/algorithm.py
branches/gcomprixogoo/src/awele-activity/awele.c
branches/gcomprixogoo/src/bargame-activity/bargame.py
branches/gcomprixogoo/src/billard-activity/billard.c
branches/gcomprixogoo/src/boards/py-mod-bonus.c
branches/gcomprixogoo/src/canal_lock-activity/canal_lock.c
branches/gcomprixogoo/src/chess_computer-activity/chess.c
branches/gcomprixogoo/src/click_on_letter-activity/click_on_letter.c
branches/gcomprixogoo/src/clickgame-activity/clickgame.c
branches/gcomprixogoo/src/clockgame-activity/clockgame.c
branches/gcomprixogoo/src/colors-activity/colors.c
branches/gcomprixogoo/src/crane-activity/crane.c
branches/gcomprixogoo/src/drawnumber-activity/drawnumber.py
branches/gcomprixogoo/src/electric-activity/electric.py
branches/gcomprixogoo/src/enumerate-activity/enumerate.c
branches/gcomprixogoo/src/erase-activity/erase.c
branches/gcomprixogoo/src/fifteen-activity/fifteen.c
branches/gcomprixogoo/src/gcompris/bonus.c
branches/gcomprixogoo/src/gcompris/bonus.h
branches/gcomprixogoo/src/gletters-activity/gletters.c
branches/gcomprixogoo/src/hanoi-activity/hanoi.c
branches/gcomprixogoo/src/hanoi_real-activity/hanoi_real.c
branches/gcomprixogoo/src/imageid-activity/imageid.c
branches/gcomprixogoo/src/leftright-activity/leftright.c
branches/gcomprixogoo/src/magic_hat_minus-activity/magic_hat.c
branches/gcomprixogoo/src/maze-activity/maze.c
branches/gcomprixogoo/src/melody-activity/melody.py
branches/gcomprixogoo/src/memory-activity/memory.c
branches/gcomprixogoo/src/missing_letter-activity/missingletter.c
branches/gcomprixogoo/src/money-activity/money.c
branches/gcomprixogoo/src/mosaic-activity/mosaic.py
branches/gcomprixogoo/src/paratrooper-activity/paratrooper.c
branches/gcomprixogoo/src/planegame-activity/planegame.c
branches/gcomprixogoo/src/railroad-activity/railroad.c
branches/gcomprixogoo/src/read_colors-activity/read_colors.c
branches/gcomprixogoo/src/readingh-activity/reading.c
branches/gcomprixogoo/src/redraw-activity/redraw.py
branches/gcomprixogoo/src/reversecount-activity/reversecount.c
branches/gcomprixogoo/src/scalesboard-activity/scale.c
branches/gcomprixogoo/src/smallnumbers-activity/smallnumbers.c
branches/gcomprixogoo/src/submarine-activity/submarine.c
branches/gcomprixogoo/src/superbrain-activity/superbrain.c
branches/gcomprixogoo/src/target-activity/target.c
branches/gcomprixogoo/src/traffic-activity/traffic.c
branches/gcomprixogoo/src/tuxpaint-activity/tuxpaint.py
branches/gcomprixogoo/src/wordsgame-activity/wordsgame.c
Modified: branches/gcomprixogoo/boards/skins/babytoy/bar_bg.png
==============================================================================
Binary files. No diff available.
Modified: branches/gcomprixogoo/boards/skins/gartoon/bar_bg.png
==============================================================================
Binary files. No diff available.
Modified: branches/gcomprixogoo/src/advanced_colors-activity/advanced_colors.c
==============================================================================
--- branches/gcomprixogoo/src/advanced_colors-activity/advanced_colors.c (original)
+++ branches/gcomprixogoo/src/advanced_colors-activity/advanced_colors.c Sat Aug 30 12:27:24 2008
@@ -317,7 +317,7 @@
gcomprisBoard->level++;
gcomprisBoard->sublevel = 1;
if (gcomprisBoard->level > gcomprisBoard->maxlevel) {
- gc_bonus_end_display(GC_BOARD_FINISHED_TUXLOCO);
+ gcomprisBoard->level = gcomprisBoard->maxlevel;
return;
}
@@ -333,7 +333,6 @@
* =====================================================================*/
static gboolean ok_timeout()
{
- g_warning("+++ ok_timeout errors = %d\n", errors);
gc_bonus_display(gamewon, GC_BONUS_SMILEY);
if (!gamewon)
errors--;
@@ -342,7 +341,8 @@
update_clock();
if (errors <= 1) {
- gc_bonus_end_display(GC_BOARD_FINISHED_TOOMANYERRORS);
+ gamewon = TRUE;
+ gc_bonus_display(gamewon, GC_BOARD_LOOSE);
}
return FALSE;
Modified: branches/gcomprixogoo/src/algebra_by-activity/algebra.c
==============================================================================
--- branches/gcomprixogoo/src/algebra_by-activity/algebra.c (original)
+++ branches/gcomprixogoo/src/algebra_by-activity/algebra.c Sat Aug 30 12:27:24 2008
@@ -41,7 +41,6 @@
#define SOUNDLISTFILE PACKAGE
static gboolean board_paused = TRUE;
-static int leavenow;
static int gamewon;
static void game_won(void);
@@ -148,9 +147,6 @@
if(gamewon == TRUE && pause == FALSE) /* the game is won */
algebra_next_level();
- if(leavenow == TRUE && pause == FALSE)
- gc_bonus_end_display(GC_BOARD_FINISHED_RANDOM);
-
board_paused = pause;
}
@@ -231,7 +227,6 @@
algebra_next_level();
gamewon = FALSE;
- leavenow = FALSE;
pause_board(FALSE);
}
@@ -387,7 +382,6 @@
static void timer_end()
{
gamewon = FALSE;
- leavenow = TRUE;
algebra_destroy_all_items();
gc_bonus_display(gamewon, GC_BONUS_SMILEY);
}
@@ -877,10 +871,8 @@
/* Try the next level */
gcomprisBoard->sublevel=1;
gcomprisBoard->level++;
- if(gcomprisBoard->level>gcomprisBoard->maxlevel) { // the current board is finished : bail out
- gc_bonus_end_display(GC_BOARD_FINISHED_RANDOM);
- return;
- }
+ if(gcomprisBoard->level>gcomprisBoard->maxlevel)
+ gcomprisBoard->level = gcomprisBoard->maxlevel;
gamewon = TRUE;
algebra_destroy_all_items();
Modified: branches/gcomprixogoo/src/algebra_guesscount-activity/algebra_guesscount.c
==============================================================================
--- branches/gcomprixogoo/src/algebra_guesscount-activity/algebra_guesscount.c (original)
+++ branches/gcomprixogoo/src/algebra_guesscount-activity/algebra_guesscount.c Sat Aug 30 12:27:24 2008
@@ -530,10 +530,9 @@
gcomprisBoard->sublevel=1;
gcomprisBoard->level++;
- if(gcomprisBoard->level>gcomprisBoard->maxlevel) {
- gc_bonus_end_display(GC_BOARD_FINISHED_TUXPLANE);
- return;
- }
+ if(gcomprisBoard->level>gcomprisBoard->maxlevel)
+ gcomprisBoard->level = gcomprisBoard->maxlevel;
+
gc_set_background(goo_canvas_get_root_item(gcomprisBoard->canvas),background_images[gcomprisBoard->level-1]);
}
algebra_guesscount_next_level();
Modified: branches/gcomprixogoo/src/algorithm-activity/algorithm.py
==============================================================================
--- branches/gcomprixogoo/src/algorithm-activity/algorithm.py (original)
+++ branches/gcomprixogoo/src/algorithm-activity/algorithm.py Sat Aug 30 12:27:24 2008
@@ -191,9 +191,7 @@
self.gcomprisBoard.sublevel=1
self.gcomprisBoard.level += 1
if(self.gcomprisBoard.level>self.gcomprisBoard.maxlevel):
- # the current board is finished : bail out
- gcompris.bonus.board_finished(gcompris.bonus.FINISHED_RANDOM)
- return 0
+ self.gcomprisBoard.level = self.gcomprisBoard.maxlevel
self.display_current_level()
return 1
Modified: branches/gcomprixogoo/src/awele-activity/awele.c
==============================================================================
--- branches/gcomprixogoo/src/awele-activity/awele.c (original)
+++ branches/gcomprixogoo/src/awele-activity/awele.c Sat Aug 30 12:27:24 2008
@@ -567,16 +567,7 @@
gcomprisBoard->sublevel = 1;
gcomprisBoard->level++;
if (gcomprisBoard->level > gcomprisBoard->maxlevel)
- { // the
- // current
- // board
- // is
- // finished
- // : bail
- // out
- gc_bonus_end_display (GC_BOARD_FINISHED_RANDOM);
- return;
- }
+ gcomprisBoard->level = gcomprisBoard->maxlevel;
}
}
Modified: branches/gcomprixogoo/src/bargame-activity/bargame.py
==============================================================================
--- branches/gcomprixogoo/src/bargame-activity/bargame.py (original)
+++ branches/gcomprixogoo/src/bargame-activity/bargame.py Sat Aug 30 12:27:24 2008
@@ -150,8 +150,7 @@
if sublevel > self.gcomprisBoard.number_of_sublevel:
if self.game_won:
if self.gcomprisBoard.level == self.gcomprisBoard.maxlevel:
- gcompris.bonus.board_finished(gcompris.bonus.FINISHED_RANDOM)
- return 0
+ self.set_level(self.gcomprisBoard.level)
else:
self.set_level(self.gcomprisBoard.level+1)
else:
Modified: branches/gcomprixogoo/src/billard-activity/billard.c
==============================================================================
--- branches/gcomprixogoo/src/billard-activity/billard.c (original)
+++ branches/gcomprixogoo/src/billard-activity/billard.c Sat Aug 30 12:27:24 2008
@@ -257,10 +257,9 @@
/* Try the next level */
gcomprisBoard->sublevel=1;
gcomprisBoard->level++;
- if(gcomprisBoard->level>gcomprisBoard->maxlevel) { // the current board is finished : bail out
- gc_bonus_end_display(GC_BOARD_FINISHED_RANDOM);
- return;
- }
+ if(gcomprisBoard->level>gcomprisBoard->maxlevel)
+ gcomprisBoard->level = gcomprisBoard->maxlevel;
+
gc_sound_play_ogg ("sounds/bonus.wav", NULL);
}
minigolf_next_level();
Modified: branches/gcomprixogoo/src/boards/py-mod-bonus.c
==============================================================================
--- branches/gcomprixogoo/src/boards/py-mod-bonus.c (original)
+++ branches/gcomprixogoo/src/boards/py-mod-bonus.c Sat Aug 30 12:27:24 2008
@@ -46,27 +46,8 @@
}
-/* void gc_bonus_end_display(int type); */
-static PyObject*
-py_gcompris_gc_bonus_end_display(PyObject* self, PyObject* args)
-{
- int type;
- /* Parse arguments */
- if(!PyArg_ParseTuple(args, "i:gc_bonus_end_display", &type))
- return NULL;
-
- /* Call the corresponding C function */
- gc_bonus_end_display(type);
-
- /* Create and return the result */
- Py_INCREF(Py_None);
- return Py_None;
-}
-
-
static PyMethodDef PythonGcomprisBonusModule[] = {
{ "display", py_gc_bonus_display, METH_VARARGS, "gc_bonus_display" },
- { "board_finished", py_gcompris_gc_bonus_end_display, METH_VARARGS, "gc_bonus_end_display" },
{ NULL, NULL, 0, NULL}
};
@@ -86,12 +67,6 @@
PyModule_AddIntConstant(module, "GNU", GC_BONUS_GNU );
PyModule_AddIntConstant(module, "GNU", GC_BONUS_LION );
- /* BonusFinishedList constants */
- PyModule_AddIntConstant(module, "FINISHED_RANDOM", GC_BOARD_FINISHED_RANDOM );
- PyModule_AddIntConstant(module, "FINISHED_TUXPLANE", GC_BOARD_FINISHED_TUXPLANE );
- PyModule_AddIntConstant(module, "FINISHED_TUXLOCO", GC_BOARD_FINISHED_TUXLOCO );
- PyModule_AddIntConstant(module, "FINISHED_TOOMANYERRORS", GC_BOARD_FINISHED_TOOMANYERRORS );
-
/* GCBonusStatusList constants */
PyModule_AddIntConstant(module, "LOOSE", GC_BOARD_LOOSE );
PyModule_AddIntConstant(module, "WIN", GC_BOARD_WIN );
Modified: branches/gcomprixogoo/src/canal_lock-activity/canal_lock.c
==============================================================================
--- branches/gcomprixogoo/src/canal_lock-activity/canal_lock.c (original)
+++ branches/gcomprixogoo/src/canal_lock-activity/canal_lock.c Sat Aug 30 12:27:24 2008
@@ -428,10 +428,9 @@
/* Try the next level */
gcomprisBoard->sublevel=1;
gcomprisBoard->level++;
- if(gcomprisBoard->level>gcomprisBoard->maxlevel) { // the current board is finished : bail out
- gc_bonus_end_display(GC_BOARD_FINISHED_RANDOM);
- return;
- }
+ if(gcomprisBoard->level>gcomprisBoard->maxlevel)
+ gcomprisBoard->level = gcomprisBoard->maxlevel;
+
gc_sound_play_ogg ("sounds/bonus.wav", NULL);
}
canal_lock_next_level();
Modified: branches/gcomprixogoo/src/chess_computer-activity/chess.c
==============================================================================
--- branches/gcomprixogoo/src/chess_computer-activity/chess.c (original)
+++ branches/gcomprixogoo/src/chess_computer-activity/chess.c Sat Aug 30 12:27:24 2008
@@ -611,10 +611,9 @@
/* Try the next level */
gcomprisBoard->sublevel=1;
gcomprisBoard->level++;
- if(gcomprisBoard->level>gcomprisBoard->maxlevel) { // the current board is finished : bail out
- gc_bonus_end_display(GC_BOARD_FINISHED_RANDOM);
- return;
- }
+ if(gcomprisBoard->level>gcomprisBoard->maxlevel)
+ gcomprisBoard->level = gcomprisBoard->maxlevel;
+
gc_sound_play_ogg ("sounds/bonus.wav", NULL);
}
chess_next_level();
Modified: branches/gcomprixogoo/src/click_on_letter-activity/click_on_letter.c
==============================================================================
--- branches/gcomprixogoo/src/click_on_letter-activity/click_on_letter.c (original)
+++ branches/gcomprixogoo/src/click_on_letter-activity/click_on_letter.c Sat Aug 30 12:27:24 2008
@@ -447,10 +447,8 @@
/* Try the next level */
gcomprisBoard->sublevel=1;
gcomprisBoard->level++;
- if(gcomprisBoard->level>gcomprisBoard->maxlevel) { // the current board is finished : bail out
- gc_bonus_end_display(GC_BOARD_FINISHED_TUXPLANE);
- return;
- }
+ if(gcomprisBoard->level>gcomprisBoard->maxlevel)
+ gcomprisBoard->level = gcomprisBoard->maxlevel;
}
click_on_letter_next_level();
}
Modified: branches/gcomprixogoo/src/clickgame-activity/clickgame.c
==============================================================================
--- branches/gcomprixogoo/src/clickgame-activity/clickgame.c (original)
+++ branches/gcomprixogoo/src/clickgame-activity/clickgame.c Sat Aug 30 12:27:24 2008
@@ -795,10 +795,9 @@
/* Try the next level */
gcomprisBoard->sublevel=0;
gcomprisBoard->level++;
- if(gcomprisBoard->level>gcomprisBoard->maxlevel) { // the current board is finished : bail out
- gc_bonus_end_display(GC_BOARD_FINISHED_RANDOM);
- return;
- }
+ if(gcomprisBoard->level>gcomprisBoard->maxlevel)
+ gcomprisBoard->level = gcomprisBoard->maxlevel;
+
gc_sound_play_ogg ("sounds/bonus.wav", NULL);
}
clickgame_next_level();
Modified: branches/gcomprixogoo/src/clockgame-activity/clockgame.c
==============================================================================
--- branches/gcomprixogoo/src/clockgame-activity/clockgame.c (original)
+++ branches/gcomprixogoo/src/clockgame-activity/clockgame.c Sat Aug 30 12:27:24 2008
@@ -616,10 +616,9 @@
/* Try the next level */
gcomprisBoard->sublevel=1;
gcomprisBoard->level++;
- if(gcomprisBoard->level>gcomprisBoard->maxlevel) { // the current board is finished : bail out
- gc_bonus_end_display(GC_BOARD_FINISHED_RANDOM);
- return;
- }
+ if(gcomprisBoard->level>gcomprisBoard->maxlevel)
+ gcomprisBoard->level = gcomprisBoard->maxlevel;
+
gc_sound_play_ogg ("sounds/bonus.wav", NULL);
}
clockgame_next_level();
Modified: branches/gcomprixogoo/src/colors-activity/colors.c
==============================================================================
--- branches/gcomprixogoo/src/colors-activity/colors.c (original)
+++ branches/gcomprixogoo/src/colors-activity/colors.c Sat Aug 30 12:27:24 2008
@@ -410,7 +410,8 @@
if( g_list_length(listColors) <= 0 )
{ // the current board is finished : restart it
- gc_bonus_end_display(GC_BOARD_FINISHED_TUXLOCO);
+ gamewon = TRUE;
+ gc_bonus_display(gamewon, GC_BONUS_GNU);
return;
}
Modified: branches/gcomprixogoo/src/crane-activity/crane.c
==============================================================================
--- branches/gcomprixogoo/src/crane-activity/crane.c (original)
+++ branches/gcomprixogoo/src/crane-activity/crane.c Sat Aug 30 12:27:24 2008
@@ -381,13 +381,6 @@
timer_id = 0;
}
-// Display a 'end of game' animation
-static void finished() {
-
- gc_bonus_end_display(GC_BOARD_FINISHED_RANDOM);
- timer_id = 0;
-}
-
// One more level completed
static void game_won() {
@@ -398,10 +391,8 @@
gcomprisBoard->sublevel = 1;
gcomprisBoard->level++;
- if (gcomprisBoard->level>gcomprisBoard->maxlevel) { // all levels completed : the current board is finished
- timer_id = g_timeout_add (2000, (GtkFunction) finished, NULL);
- return;
- }
+ if (gcomprisBoard->level>gcomprisBoard->maxlevel)
+ gcomprisBoard->level = gcomprisBoard->maxlevel;
}
crane_next_level();
}
Modified: branches/gcomprixogoo/src/drawnumber-activity/drawnumber.py
==============================================================================
--- branches/gcomprixogoo/src/drawnumber-activity/drawnumber.py (original)
+++ branches/gcomprixogoo/src/drawnumber-activity/drawnumber.py Sat Aug 30 12:27:24 2008
@@ -215,8 +215,7 @@
def next_level(self) :
if self.gcomprisBoard.sublevel==self.gcomprisBoard.number_of_sublevel :
if (self.gcomprisBoard.level+1)>self.gcomprisBoard.maxlevel :
- self.end()
- gcompris.bonus.board_finished(gcompris.bonus.FINISHED_RANDOM)
+ self.set_level((self.gcomprisBoard.level))
else :
self.set_level((self.gcomprisBoard.level+1))
else :
Modified: branches/gcomprixogoo/src/electric-activity/electric.py
==============================================================================
--- branches/gcomprixogoo/src/electric-activity/electric.py (original)
+++ branches/gcomprixogoo/src/electric-activity/electric.py Sat Aug 30 12:27:24 2008
@@ -169,9 +169,7 @@
gcompris.bar_set_level(self.gcomprisBoard)
if(self.gcomprisBoard.level>self.gcomprisBoard.maxlevel):
- # the current board is finished : bail out
- gcompris.bonus.board_finished(gcompris.bonus.FINISHED_RANDOM)
- return 0
+ self.gcomprisBoard.level = self.gcomprisBoard.maxlevel
return 1
Modified: branches/gcomprixogoo/src/enumerate-activity/enumerate.c
==============================================================================
--- branches/gcomprixogoo/src/enumerate-activity/enumerate.c (original)
+++ branches/gcomprixogoo/src/enumerate-activity/enumerate.c Sat Aug 30 12:27:24 2008
@@ -499,10 +499,9 @@
/* Try the next level */
gcomprisBoard->sublevel=1;
gcomprisBoard->level++;
- if(gcomprisBoard->level>gcomprisBoard->maxlevel) { // the current board is finished : bail out
- gc_bonus_end_display(GC_BOARD_FINISHED_RANDOM);
- return;
- }
+ if(gcomprisBoard->level>gcomprisBoard->maxlevel)
+ gcomprisBoard->level = gcomprisBoard->maxlevel;
+
gc_sound_play_ogg ("sounds/bonus.wav", NULL);
}
enumerate_next_level();
Modified: branches/gcomprixogoo/src/erase-activity/erase.c
==============================================================================
--- branches/gcomprixogoo/src/erase-activity/erase.c (original)
+++ branches/gcomprixogoo/src/erase-activity/erase.c Sat Aug 30 12:27:24 2008
@@ -429,11 +429,6 @@
timer_id = 0;
}
-static void finished() {
- gc_bonus_end_display(GC_BOARD_FINISHED_RANDOM);
- timer_id = 0;
-}
-
/* ==================================== */
static void
game_won()
@@ -444,11 +439,10 @@
/* Try the next level */
gcomprisBoard->sublevel=1;
gcomprisBoard->level++;
- /* the current board is finished : bail out */
- if(gcomprisBoard->level>gcomprisBoard->maxlevel) {
- timer_id = gtk_timeout_add (2000, (GtkFunction) finished, NULL);
- return;
- }
+
+ if(gcomprisBoard->level>gcomprisBoard->maxlevel)
+ gcomprisBoard->level = gcomprisBoard->maxlevel;
+
gc_sound_play_ogg ("sounds/bonus.wav", NULL);
}
erase_next_level();
Modified: branches/gcomprixogoo/src/fifteen-activity/fifteen.c
==============================================================================
--- branches/gcomprixogoo/src/fifteen-activity/fifteen.c (original)
+++ branches/gcomprixogoo/src/fifteen-activity/fifteen.c Sat Aug 30 12:27:24 2008
@@ -293,10 +293,9 @@
/* Try the next level */
gcomprisBoard->sublevel=1;
gcomprisBoard->level++;
- if(gcomprisBoard->level>gcomprisBoard->maxlevel) { // the current board is finished : bail out
- gc_bonus_end_display(GC_BOARD_FINISHED_RANDOM);
- return;
- }
+ if(gcomprisBoard->level>gcomprisBoard->maxlevel)
+ gcomprisBoard->level = gcomprisBoard->maxlevel;
+
gc_sound_play_ogg ("sounds/bonus.wav", NULL);
}
fifteen_next_level();
Modified: branches/gcomprixogoo/src/gcompris/bonus.c
==============================================================================
--- branches/gcomprixogoo/src/gcompris/bonus.c (original)
+++ branches/gcomprixogoo/src/gcompris/bonus.c Sat Aug 30 12:27:24 2008
@@ -22,22 +22,13 @@
#include <ctype.h>
#include <math.h>
-#define SOUNDLISTFILE PACKAGE
#define GC_BONUS_DURATION 2000
-#define TUX_TIME_STEP 300
static GooCanvasItem *bonus_group = NULL;
-static GooCanvasItem *door1_item = NULL;
-static GooCanvasItem *door2_item = NULL;
-static GooCanvasItem *tuxplane_item = NULL;
-static gboolean gc_bonus_end_display_running = FALSE;
static gboolean bonus_display_running = FALSE;
-static gint end_bonus_id = 0, gc_bonus_end_display_id = 0;
-
-//static gint end_board_count = 0;
-static int left_door_limit = 0;
+static gint end_bonus_id = 0;
// List of sounds to use for greetings
static gchar *greetingsList[] =
@@ -67,132 +58,6 @@
static void bonus_image(char *,GCBonusStatusList);
static void end_bonus(void);
-
-/* ==================================== */
-static void
-end_gc_bonus_end_display() {
- GooCanvasBounds bounds;
- //end_board_count++;
- goo_canvas_item_get_bounds(tuxplane_item, &bounds);
- // animates tuxplane
- if (/*end_board_count*/ bounds.x2 +50.0 < (double) (left_door_limit)) {
- goo_canvas_item_translate(tuxplane_item, 50, 0);
- return;
- }
-
- if (gc_bonus_end_display_id) {
- g_source_remove(gc_bonus_end_display_id);
- gc_bonus_end_display_id = 0;
- }
-
- if(door1_item)
- goo_canvas_item_remove(door1_item);
- if(door2_item)
- goo_canvas_item_remove(door2_item);
- if(tuxplane_item)
- goo_canvas_item_remove(tuxplane_item);
-
- door1_item = NULL;
- door2_item = NULL;
- tuxplane_item = NULL;
-
- gc_bonus_end_display_running = FALSE;
-
- gc_bar_hide(FALSE);
-
- // go back to the first level
- GcomprisBoard *gcomprisBoard = gc_board_get_current();
- gcomprisBoard->level = 1;
- gcomprisBoard->sublevel = 0;
-
- /* Re-Start the board */
- gc_board_pause(FALSE);
-}
-/* ==================================== */
-#define OFFSET 100
-void
-gc_bonus_end_display(GCBoardFinishedList type) {
- GcomprisBoard *gcomprisBoard = gc_board_get_current();
-
- int x,y;
- GdkPixbuf *pixmap_door1 = NULL,*pixmap_door2 = NULL,*pixmap_tuxplane = NULL;
- char * str = NULL;
-
- g_assert(type < GC_BOARD_FINISHED_LAST);
-
- gc_bar_hide(TRUE);
-
- if (gc_bonus_end_display_running)
- return;
- else
- gc_bonus_end_display_running = TRUE;
-
- /* First pause the board */
- gc_board_pause(TRUE);
-
- /* WARNING: I remove 1 to the GC_BOARD_FINISHED_LAST because RANDOM is for GOOD end only */
- if(type==GC_BOARD_FINISHED_RANDOM)
- type = RAND(1,GC_BOARD_FINISHED_LAST-2);
-
- /* Record the end of board */
- gc_log_end (gcomprisBoard, GC_BOARD_COMPLETED);
-
- switch (type) {
- case GC_BOARD_FINISHED_TUXPLANE :
- str = g_strdup_printf("tuxplane.png");
- break;
- case GC_BOARD_FINISHED_TUXLOCO :
- str = g_strdup_printf("tuxloco.png");
- break;
- case GC_BOARD_FINISHED_TOOMANYERRORS :
- str = g_strdup_printf("toomanyerrors.png");
- break;
- default :
- str = g_strdup_printf("tuxplane.png");
- break;
- }
-
- pixmap_door1 = gc_skin_pixmap_load("door1.png");
- pixmap_door2 = gc_skin_pixmap_load("door2.png");
- pixmap_tuxplane = gc_skin_pixmap_load(str);
- g_free(str);
-
- g_assert(gcomprisBoard != NULL);
-
- x = BOARDWIDTH - OFFSET - gdk_pixbuf_get_width(pixmap_door1);
- y = OFFSET;
- left_door_limit = x + gdk_pixbuf_get_width(pixmap_door1);
-
- door1_item = goo_canvas_image_new (goo_canvas_get_root_item(GOO_CANVAS(gcomprisBoard->canvas)),
- pixmap_door1,
- x,
- y,
- NULL);
-
- x = OFFSET;
- y = (BOARDHEIGHT - gdk_pixbuf_get_height(pixmap_tuxplane)) /2;
- tuxplane_item = goo_canvas_image_new (goo_canvas_get_root_item(GOO_CANVAS(gcomprisBoard->canvas)),
- pixmap_tuxplane,
- x,
- y,
- NULL);
-
- x = BOARDWIDTH - OFFSET - gdk_pixbuf_get_width(pixmap_door2);
- y = OFFSET;
- door2_item = goo_canvas_image_new (goo_canvas_get_root_item(GOO_CANVAS(gcomprisBoard->canvas)),
- pixmap_door2,
- x,
- y,
- NULL);
-
- gdk_pixbuf_unref(pixmap_door1);
- gdk_pixbuf_unref(pixmap_door2);
- gdk_pixbuf_unref(pixmap_tuxplane);
-
- gc_bonus_end_display_id = g_timeout_add (TUX_TIME_STEP, (GtkFunction) end_gc_bonus_end_display, NULL);
-
-}
-
/* ==================================== */
void
gc_bonus_display(GCBonusStatusList gamewon, GCBonusList bonus_id)
Modified: branches/gcomprixogoo/src/gcompris/bonus.h
==============================================================================
--- branches/gcomprixogoo/src/gcompris/bonus.h (original)
+++ branches/gcomprixogoo/src/gcompris/bonus.h Sat Aug 30 12:27:24 2008
@@ -20,8 +20,8 @@
#define BONUS_H
/* The time, in ms, between the click of the player, making a choice
- * and the moment the bonus appears. Only used when there is no thumb
- * in the board */
+ * and the moment the bonus appears.
+ */
#define TIME_CLICK_TO_BONUS 800
/* BONUS_LAST is equals to the last available bonus type */
@@ -39,15 +39,6 @@
typedef enum
{
- GC_BOARD_FINISHED_RANDOM,
- GC_BOARD_FINISHED_TUXPLANE,
- GC_BOARD_FINISHED_TUXLOCO,
- GC_BOARD_FINISHED_TOOMANYERRORS,
- GC_BOARD_FINISHED_LAST
-} GCBoardFinishedList;
-
-typedef enum
-{
GC_BOARD_LOOSE,
GC_BOARD_WIN,
GC_BOARD_DRAW,
@@ -59,6 +50,5 @@
* ----------------------
*/
void gc_bonus_display(GCBonusStatusList, GCBonusList);
-void gc_bonus_end_display(GCBoardFinishedList);
#endif
Modified: branches/gcomprixogoo/src/gletters-activity/gletters.c
==============================================================================
--- branches/gcomprixogoo/src/gletters-activity/gletters.c (original)
+++ branches/gcomprixogoo/src/gletters-activity/gletters.c Sat Aug 30 12:27:24 2008
@@ -707,11 +707,8 @@
{
/* Try the next level */
gcomprisBoard->level++;
- if(gcomprisBoard->level>gcomprisBoard->maxlevel) { // the current board is finished : bail out
- gc_score_end();
- gc_bonus_end_display(GC_BOARD_FINISHED_RANDOM);
- return;
- }
+ if(gcomprisBoard->level>gcomprisBoard->maxlevel)
+ gcomprisBoard->level = gcomprisBoard->maxlevel;
gamewon = TRUE;
gletters_destroy_all_items();
Modified: branches/gcomprixogoo/src/hanoi-activity/hanoi.c
==============================================================================
--- branches/gcomprixogoo/src/hanoi-activity/hanoi.c (original)
+++ branches/gcomprixogoo/src/hanoi-activity/hanoi.c Sat Aug 30 12:27:24 2008
@@ -573,10 +573,9 @@
/* Try the next level */
gcomprisBoard->sublevel=1;
gcomprisBoard->level++;
- if(gcomprisBoard->level>gcomprisBoard->maxlevel) { // the current board is finished : bail out
- gc_bonus_end_display(GC_BOARD_FINISHED_RANDOM);
- return;
- }
+ if(gcomprisBoard->level>gcomprisBoard->maxlevel)
+ gcomprisBoard->level = gcomprisBoard->maxlevel;
+
gc_sound_play_ogg ("sounds/bonus.wav", NULL);
}
hanoi_next_level();
Modified: branches/gcomprixogoo/src/hanoi_real-activity/hanoi_real.c
==============================================================================
--- branches/gcomprixogoo/src/hanoi_real-activity/hanoi_real.c (original)
+++ branches/gcomprixogoo/src/hanoi_real-activity/hanoi_real.c Sat Aug 30 12:27:24 2008
@@ -396,10 +396,9 @@
/* Try the next level */
gcomprisBoard->sublevel=1;
gcomprisBoard->level++;
- if(gcomprisBoard->level>gcomprisBoard->maxlevel) { // the current board is finished : bail out
- gc_bonus_end_display(GC_BOARD_FINISHED_RANDOM);
- return;
- }
+ if(gcomprisBoard->level>gcomprisBoard->maxlevel)
+ gcomprisBoard->level = gcomprisBoard->maxlevel;
+
gc_sound_play_ogg ("sounds/bonus.wav", NULL);
}
hanoi_next_level();
Modified: branches/gcomprixogoo/src/imageid-activity/imageid.c
==============================================================================
--- branches/gcomprixogoo/src/imageid-activity/imageid.c (original)
+++ branches/gcomprixogoo/src/imageid-activity/imageid.c Sat Aug 30 12:27:24 2008
@@ -397,10 +397,8 @@
gcomprisBoard->sublevel=1;
gcomprisBoard->level++;
if(gcomprisBoard->level>gcomprisBoard->maxlevel)
- {
- gc_bonus_end_display(GC_BOARD_FINISHED_TUXLOCO);
- return;
- }
+ gcomprisBoard->level = gcomprisBoard->maxlevel;
+
imageid_next_level();
}
else
Modified: branches/gcomprixogoo/src/leftright-activity/leftright.c
==============================================================================
--- branches/gcomprixogoo/src/leftright-activity/leftright.c (original)
+++ branches/gcomprixogoo/src/leftright-activity/leftright.c Sat Aug 30 12:27:24 2008
@@ -338,10 +338,8 @@
/* Try the next level */
gcomprisBoard->sublevel=1;
gcomprisBoard->level++;
- if(gcomprisBoard->level>gcomprisBoard->maxlevel) { // the current board is finished : bail out
- gc_bonus_end_display(GC_BOARD_FINISHED_TUXLOCO);
- return;
- }
+ if(gcomprisBoard->level>gcomprisBoard->maxlevel)
+ gcomprisBoard->level = gcomprisBoard->maxlevel;
}
leftright_next_level();
}
Modified: branches/gcomprixogoo/src/magic_hat_minus-activity/magic_hat.c
==============================================================================
--- branches/gcomprixogoo/src/magic_hat_minus-activity/magic_hat.c (original)
+++ branches/gcomprixogoo/src/magic_hat_minus-activity/magic_hat.c Sat Aug 30 12:27:24 2008
@@ -419,13 +419,6 @@
return NULL;
}
-// Display a 'end of game' animation
-static void finished() {
-
- gc_bonus_end_display(GC_BOARD_FINISHED_RANDOM);
- timer_id = 0;
-}
-
// One more level completed
static void game_won() {
@@ -436,10 +429,9 @@
gcomprisBoard->sublevel = 1;
gcomprisBoard->level++;
- if (gcomprisBoard->level>gcomprisBoard->maxlevel) { // all levels completed : the current board is finished
- timer_id = g_timeout_add (2000, (GtkFunction) finished, NULL);
- return;
- }
+ if (gcomprisBoard->level>gcomprisBoard->maxlevel)
+ gcomprisBoard->level = gcomprisBoard->maxlevel;
+
}
magic_hat_next_level();
}
Modified: branches/gcomprixogoo/src/maze-activity/maze.c
==============================================================================
--- branches/gcomprixogoo/src/maze-activity/maze.c (original)
+++ branches/gcomprixogoo/src/maze-activity/maze.c Sat Aug 30 12:27:24 2008
@@ -529,10 +529,9 @@
twoDdisplay();
/* Try the next level */
gcomprisBoard->level++;
- if(gcomprisBoard->level > gcomprisBoard->maxlevel) { // the current board is finished : bail out
- gc_bonus_end_display(GC_BOARD_FINISHED_RANDOM);
- return;
- }
+ if(gcomprisBoard->level > gcomprisBoard->maxlevel)
+ gcomprisBoard->level = gcomprisBoard->maxlevel;
+
gc_sound_play_ogg ("sounds/bonus.wav", NULL);
maze_next_level();
Modified: branches/gcomprixogoo/src/melody-activity/melody.py
==============================================================================
--- branches/gcomprixogoo/src/melody-activity/melody.py (original)
+++ branches/gcomprixogoo/src/melody-activity/melody.py Sat Aug 30 12:27:24 2008
@@ -327,9 +327,7 @@
self.gcomprisBoard.sublevel=1
self.gcomprisBoard.level += 1
if(self.gcomprisBoard.level>self.gcomprisBoard.maxlevel):
- # the current board is finished : bail out
- gcompris.bonus.board_finished(gcompris.bonus.FINISHED_RANDOM)
- return 0
+ self.gcomprisBoard.level = self.gcomprisBoard.maxlevel
return 1
Modified: branches/gcomprixogoo/src/memory-activity/memory.c
==============================================================================
--- branches/gcomprixogoo/src/memory-activity/memory.c (original)
+++ branches/gcomprixogoo/src/memory-activity/memory.c Sat Aug 30 12:27:24 2008
@@ -1367,10 +1367,9 @@
/* Try the next level */
if (tux_pairs <= player_pairs)
gcomprisBoard->level++;
- if(gcomprisBoard->level>gcomprisBoard->maxlevel) { // the current board is finished : bail out
- gc_bonus_end_display(GC_BOARD_FINISHED_RANDOM);
- return;
- }
+ if(gcomprisBoard->level>gcomprisBoard->maxlevel)
+ gcomprisBoard->level = gcomprisBoard->maxlevel;
+
gc_bonus_display((tux_pairs <= player_pairs), GC_BONUS_LION);
}
Modified: branches/gcomprixogoo/src/missing_letter-activity/missingletter.c
==============================================================================
--- branches/gcomprixogoo/src/missing_letter-activity/missingletter.c (original)
+++ branches/gcomprixogoo/src/missing_letter-activity/missingletter.c Sat Aug 30 12:27:24 2008
@@ -424,10 +424,8 @@
gcomprisBoard->sublevel=1;
gcomprisBoard->level++;
if(gcomprisBoard->level>gcomprisBoard->maxlevel)
- {
- gc_bonus_end_display(GC_BOARD_FINISHED_TUXPLANE);
- return;
- }
+ gcomprisBoard->level = gcomprisBoard->maxlevel;
+
missing_letter_next_level();
}
else
Modified: branches/gcomprixogoo/src/money-activity/money.c
==============================================================================
--- branches/gcomprixogoo/src/money-activity/money.c (original)
+++ branches/gcomprixogoo/src/money-activity/money.c Sat Aug 30 12:27:24 2008
@@ -551,10 +551,9 @@
/* Try the next level */
gcomprisBoard->sublevel=1;
gcomprisBoard->level++;
- if(gcomprisBoard->level>gcomprisBoard->maxlevel) { // the current board is finished : bail out
- gc_bonus_end_display(GC_BOARD_FINISHED_RANDOM);
- return;
- }
+ if(gcomprisBoard->level>gcomprisBoard->maxlevel)
+ gcomprisBoard->level = gcomprisBoard->maxlevel;
+
gc_sound_play_ogg ("sounds/bonus.wav", NULL);
}
money_next_level();
Modified: branches/gcomprixogoo/src/mosaic-activity/mosaic.py
==============================================================================
--- branches/gcomprixogoo/src/mosaic-activity/mosaic.py (original)
+++ branches/gcomprixogoo/src/mosaic-activity/mosaic.py Sat Aug 30 12:27:24 2008
@@ -162,9 +162,7 @@
gcompris.bar_set_level(self.gcomprisBoard)
if(self.gcomprisBoard.level>self.gcomprisBoard.maxlevel):
- # the current board is finished : bail out
- gcompris.bonus.board_finished(gcompris.bonus.FINISHED_RANDOM)
- return 0
+ self.gcomprisBoard.level = self.gcomprisBoard.maxlevel
return 1
Modified: branches/gcomprixogoo/src/paratrooper-activity/paratrooper.c
==============================================================================
--- branches/gcomprixogoo/src/paratrooper-activity/paratrooper.c (original)
+++ branches/gcomprixogoo/src/paratrooper-activity/paratrooper.c Sat Aug 30 12:27:24 2008
@@ -134,10 +134,8 @@
if(gamewon == TRUE) /* the game is won */
{
gcomprisBoard->level++;
- if(gcomprisBoard->level>gcomprisBoard->maxlevel) { // the current board is finished : bail out
- gc_bonus_end_display(GC_BOARD_FINISHED_RANDOM);
- return;
- }
+ if(gcomprisBoard->level>gcomprisBoard->maxlevel)
+ gcomprisBoard->level = gcomprisBoard->maxlevel;
}
// Unpause code
Modified: branches/gcomprixogoo/src/planegame-activity/planegame.c
==============================================================================
--- branches/gcomprixogoo/src/planegame-activity/planegame.c (original)
+++ branches/gcomprixogoo/src/planegame-activity/planegame.c Sat Aug 30 12:27:24 2008
@@ -353,10 +353,9 @@
{
/* Try the next level */
gcomprisBoard->level++;
- if(gcomprisBoard->level>gcomprisBoard->maxlevel) { // the current board is finished : bail out
- gc_bonus_end_display(GC_BOARD_FINISHED_RANDOM);
- return;
- }
+ if(gcomprisBoard->level>gcomprisBoard->maxlevel)
+ gcomprisBoard->level = gcomprisBoard->maxlevel;
+
planegame_next_level();
gc_sound_play_ogg ("sounds/bonus.wav", NULL);
}
Modified: branches/gcomprixogoo/src/railroad-activity/railroad.c
==============================================================================
--- branches/gcomprixogoo/src/railroad-activity/railroad.c (original)
+++ branches/gcomprixogoo/src/railroad-activity/railroad.c Sat Aug 30 12:27:24 2008
@@ -390,10 +390,9 @@
/* Try the next level */
gcomprisBoard->sublevel=1;
gcomprisBoard->level++;
- if(gcomprisBoard->level>gcomprisBoard->maxlevel) { // the current board is finished : bail out
- gc_bonus_end_display(GC_BOARD_FINISHED_RANDOM);
- return;
- }
+ if(gcomprisBoard->level>gcomprisBoard->maxlevel)
+ gcomprisBoard->level = gcomprisBoard->maxlevel;
+
gc_sound_play_ogg ("sounds/bonus.wav", NULL);
}
railroad_next_level();
Modified: branches/gcomprixogoo/src/read_colors-activity/read_colors.c
==============================================================================
--- branches/gcomprixogoo/src/read_colors-activity/read_colors.c (original)
+++ branches/gcomprixogoo/src/read_colors-activity/read_colors.c Sat Aug 30 12:27:24 2008
@@ -312,10 +312,8 @@
listColors = g_list_remove(listColors, g_list_nth_data(listColors,0));
- if( g_list_length(listColors) <= 0 ) { // the current board is finished : bail out
- gc_bonus_end_display(GC_BOARD_FINISHED_TUXLOCO);
- return;
- }
+ if( g_list_length(listColors) <= 0 )
+ gcomprisBoard->level = gcomprisBoard->maxlevel;
read_colors_next_level();
}
@@ -331,7 +329,8 @@
update_clock();
if (errors <= 1) {
- gc_bonus_end_display(GC_BOARD_FINISHED_TOOMANYERRORS);
+ gamewon = FALSE;
+ gc_bonus_display(gamewon, GC_BONUS_SMILEY);
}
return FALSE;
Modified: branches/gcomprixogoo/src/readingh-activity/reading.c
==============================================================================
--- branches/gcomprixogoo/src/readingh-activity/reading.c (original)
+++ branches/gcomprixogoo/src/readingh-activity/reading.c Sat Aug 30 12:27:24 2008
@@ -667,10 +667,8 @@
gc_bonus_display(gamewon, GC_BONUS_FLOWER);
/* Try the next level */
gcomprisBoard->level++;
- if(gcomprisBoard->level>gcomprisBoard->maxlevel) { // the current board is finished : bail out
- gc_bonus_end_display(GC_BOARD_FINISHED_RANDOM);
- return;
- }
+ if(gcomprisBoard->level>gcomprisBoard->maxlevel)
+ gcomprisBoard->level = gcomprisBoard->maxlevel;
next_level_timer = g_timeout_add(3000, (GtkFunction)reading_next_level, NULL);
}
Modified: branches/gcomprixogoo/src/redraw-activity/redraw.py
==============================================================================
--- branches/gcomprixogoo/src/redraw-activity/redraw.py (original)
+++ branches/gcomprixogoo/src/redraw-activity/redraw.py Sat Aug 30 12:27:24 2008
@@ -188,11 +188,11 @@
if(len(target) == 0 and len(source) == 0):
# This is a WIN
self.erase_drawing_area()
- if (self.increment_level() == 1):
- self.gamewon = 1
- gcompris.bonus.display(gcompris.bonus.WIN, gcompris.bonus.FLOWER)
- self.display_current_level()
- self.root_targetitem.props.visibility = goocanvas.ITEM_INVISIBLE
+ self.increment_level()
+ self.gamewon = 1
+ gcompris.bonus.display(gcompris.bonus.WIN, gcompris.bonus.FLOWER)
+ self.display_current_level()
+ self.root_targetitem.props.visibility = goocanvas.ITEM_INVISIBLE
else:
# Delete previous mark if any
@@ -308,8 +308,7 @@
self.current_drawing = []
# Code that increments the sublevel and level
- # And bail out if no more levels are available
- # return 1 if continue, 0 if bail out
+ # And stays at the last level
def increment_level(self):
self.gcomprisBoard.sublevel += 1
@@ -318,11 +317,8 @@
self.gcomprisBoard.sublevel=1
self.gcomprisBoard.level += 1
if(self.gcomprisBoard.level>self.gcomprisBoard.maxlevel) or self.gcomprisBoard.level*self.gcomprisBoard.sublevel>=len(self.drawlist):
- # the current board is finished : bail out
- gcompris.bonus.board_finished(gcompris.bonus.FINISHED_RANDOM)
- return 0
+ self.gcomprisBoard.level = self.gcomprisBoard.maxlevel
- return 1
# display current/sublevel number
def display_sublevel(self):
Modified: branches/gcomprixogoo/src/reversecount-activity/reversecount.c
==============================================================================
--- branches/gcomprixogoo/src/reversecount-activity/reversecount.c (original)
+++ branches/gcomprixogoo/src/reversecount-activity/reversecount.c Sat Aug 30 12:27:24 2008
@@ -23,7 +23,6 @@
static GcomprisBoard *gcomprisBoard = NULL;
static gboolean board_paused = TRUE;
static gint animate_id = 0;
-static int leavenow;
static void start_board (GcomprisBoard *agcomprisBoard);
static gint key_press(guint keyval, gchar *commit_str, gchar *preedit_str);
@@ -180,8 +179,6 @@
game_won();
}
- if(leavenow == TRUE && pause == FALSE)
- gc_bonus_end_display(GC_BOARD_FINISHED_TOOMANYERRORS);
board_paused = pause;
}
@@ -207,7 +204,6 @@
reversecount_next_level();
gamewon = FALSE;
- leavenow = FALSE;
pause_board(FALSE);
}
@@ -295,7 +291,6 @@
if(errors==0)
{
gamewon = FALSE;
- leavenow = TRUE;
reversecount_destroy_all_items();
gc_bonus_display(gamewon, GC_BONUS_SMILEY);
}
@@ -738,8 +733,8 @@
/* Try the next level */
gcomprisBoard->sublevel=1;
gcomprisBoard->level++;
- if(gcomprisBoard->level>gcomprisBoard->maxlevel) { // the current board is finished : bail out
- gc_bonus_end_display(GC_BOARD_FINISHED_RANDOM);
+ if(gcomprisBoard->level> gcomprisBoard->maxlevel) { // the current board is finished : bail out
+ gcomprisBoard->level = gcomprisBoard->maxlevel;
return;
}
gc_sound_play_ogg ("sounds/bonus.wav", NULL);
Modified: branches/gcomprixogoo/src/scalesboard-activity/scale.c
==============================================================================
--- branches/gcomprixogoo/src/scalesboard-activity/scale.c (original)
+++ branches/gcomprixogoo/src/scalesboard-activity/scale.c Sat Aug 30 12:27:24 2008
@@ -839,10 +839,9 @@
/* Try the next level */
gcomprisBoard->sublevel=1;
gcomprisBoard->level++;
- if(gcomprisBoard->level>gcomprisBoard->maxlevel) { // the current board is finished : bail out
- gc_bonus_end_display(GC_BOARD_FINISHED_RANDOM);
- return;
- }
+ if(gcomprisBoard->level>gcomprisBoard->maxlevel)
+ gcomprisBoard->level = gcomprisBoard->maxlevel;
+
gc_sound_play_ogg ("sounds/bonus.wav", NULL);
}
scale_next_level();
Modified: branches/gcomprixogoo/src/smallnumbers-activity/smallnumbers.c
==============================================================================
--- branches/gcomprixogoo/src/smallnumbers-activity/smallnumbers.c (original)
+++ branches/gcomprixogoo/src/smallnumbers-activity/smallnumbers.c Sat Aug 30 12:27:24 2008
@@ -479,11 +479,9 @@
{
/* Try the next level */
gcomprisBoard->level++;
- if(gcomprisBoard->level>gcomprisBoard->maxlevel) { // the current board is finished : bail out
- gc_score_end();
- gc_bonus_end_display(GC_BOARD_FINISHED_RANDOM);
- return;
- }
+ if(gcomprisBoard->level>gcomprisBoard->maxlevel)
+ gcomprisBoard->level = gcomprisBoard->maxlevel;
+
gamewon = TRUE;
smallnumbers_destroy_all_items();
gc_bonus_display(gamewon, GC_BONUS_SMILEY);
Modified: branches/gcomprixogoo/src/submarine-activity/submarine.c
==============================================================================
--- branches/gcomprixogoo/src/submarine-activity/submarine.c (original)
+++ branches/gcomprixogoo/src/submarine-activity/submarine.c Sat Aug 30 12:27:24 2008
@@ -1193,10 +1193,8 @@
/* Try the next level */
gcomprisBoard->sublevel=1;
gcomprisBoard->level++;
- if(gcomprisBoard->level>gcomprisBoard->maxlevel) { // the current board is finished : bail out
- gc_bonus_end_display(GC_BOARD_FINISHED_RANDOM);
- return;
- }
+ if(gcomprisBoard->level>gcomprisBoard->maxlevel)
+ gcomprisBoard->level = gcomprisBoard->maxlevel;
}
submarine_next_level();
}
Modified: branches/gcomprixogoo/src/superbrain-activity/superbrain.c
==============================================================================
--- branches/gcomprixogoo/src/superbrain-activity/superbrain.c (original)
+++ branches/gcomprixogoo/src/superbrain-activity/superbrain.c Sat Aug 30 12:27:24 2008
@@ -450,10 +450,9 @@
/* Try the next level */
gcomprisBoard->sublevel=1;
gcomprisBoard->level++;
- if(gcomprisBoard->level>gcomprisBoard->maxlevel) { // the current board is finished : bail out
- gc_bonus_end_display(GC_BOARD_FINISHED_RANDOM);
- return;
- }
+ if(gcomprisBoard->level>gcomprisBoard->maxlevel)
+ gcomprisBoard->level = gcomprisBoard->maxlevel;
+
gc_sound_play_ogg ("sounds/bonus.wav", NULL);
}
superbrain_next_level();
Modified: branches/gcomprixogoo/src/target-activity/target.c
==============================================================================
--- branches/gcomprixogoo/src/target-activity/target.c (original)
+++ branches/gcomprixogoo/src/target-activity/target.c Sat Aug 30 12:27:24 2008
@@ -496,10 +496,9 @@
/* Try the next level */
gcomprisBoard->sublevel=1;
gcomprisBoard->level++;
- if(gcomprisBoard->level>gcomprisBoard->maxlevel) { // the current board is finished : bail out
- gc_bonus_end_display(GC_BOARD_FINISHED_RANDOM);
- return;
- }
+ if(gcomprisBoard->level>gcomprisBoard->maxlevel)
+ gcomprisBoard->level = gcomprisBoard->maxlevel;
+
gc_sound_play_ogg ("sounds/bonus.wav", NULL);
}
target_next_level();
Modified: branches/gcomprixogoo/src/traffic-activity/traffic.c
==============================================================================
--- branches/gcomprixogoo/src/traffic-activity/traffic.c (original)
+++ branches/gcomprixogoo/src/traffic-activity/traffic.c Sat Aug 30 12:27:24 2008
@@ -316,10 +316,8 @@
gcomprisBoard->sublevel=1;
gcomprisBoard->level++;
if(gcomprisBoard->level>gcomprisBoard->maxlevel)
- { // the current board is finished : bail out
- gc_bonus_end_display(GC_BOARD_FINISHED_RANDOM);
- return;
- }
+ gcomprisBoard->level = gcomprisBoard->maxlevel;
+
gc_sound_play_ogg ("sounds/bonus.wav", NULL);
}
traffic_next_level();
Modified: branches/gcomprixogoo/src/tuxpaint-activity/tuxpaint.py
==============================================================================
--- branches/gcomprixogoo/src/tuxpaint-activity/tuxpaint.py (original)
+++ branches/gcomprixogoo/src/tuxpaint-activity/tuxpaint.py Sat Aug 30 12:27:24 2008
@@ -237,9 +237,8 @@
global pid
pid = None
- gcompris.bar_hide(0)
- gcompris.bonus.board_finished(gcompris.bonus.FINISHED_RANDOM)
+ gcompris.end_board()
def stop_board():
- gcompris.bonus.board_finished(gcompris.bonus.FINISHED_RANDOM)
+ gcompris.end_board()
Modified: branches/gcomprixogoo/src/wordsgame-activity/wordsgame.c
==============================================================================
--- branches/gcomprixogoo/src/wordsgame-activity/wordsgame.c (original)
+++ branches/gcomprixogoo/src/wordsgame-activity/wordsgame.c Sat Aug 30 12:27:24 2008
@@ -695,10 +695,9 @@
/* Try the next level */
gcomprisBoard->level++;
gcomprisBoard->sublevel = 0;
- if(gcomprisBoard->level>gcomprisBoard->maxlevel) { // the current board is finished : bail out
- gc_bonus_end_display(GC_BOARD_FINISHED_RANDOM);
- return;
- }
+ if(gcomprisBoard->level>gcomprisBoard->maxlevel)
+ gcomprisBoard->level = gcomprisBoard->maxlevel;
+
wordsgame_next_level();
gc_sound_play_ogg ("sounds/bonus.wav", NULL);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]