Back to index

gcompris  8.2.2
Defines | Functions | Variables
submarine.c File Reference
#include "gcompris/gcompris.h"

Go to the source code of this file.

Defines

#define DEG_TO_RAD(x)   M_PI*(x)/180.0
#define SOUNDLISTFILE   PACKAGE
#define PURGE_AR   225
#define PURGE_AV   438
#define REGLEUR   330
#define CHASSE_BALLAST_AR_X   227
#define CHASSE_BALLAST_AR_Y   97
#define CHASSE_BALLAST_AV_X   440
#define CHASSE_BALLAST_AV_Y   98
#define CHASSE_REGLEUR_X   331
#define CHASSE_REGLEUR_Y   72
#define BARRE_AR_X   100
#define BARRE_AR_Y   50
#define BARRE_AV_X   530
#define BARRE_AV_Y   100
#define BALLAST_AV_AIR_TEXT_X   440
#define BALLAST_AV_AIR_TEXT_Y   50
#define BALLAST_AV_AIR_X1   393
#define BALLAST_AV_AIR_Y1   20
#define BALLAST_AV_AIR_X2   483
#define BALLAST_AV_AIR_Y2   80
#define BALLAST_AR_AIR_TEXT_X   220
#define BALLAST_AR_AIR_TEXT_Y   50
#define BALLAST_AR_AIR_X1   180
#define BALLAST_AR_AIR_Y1   20
#define BALLAST_AR_AIR_X2   270
#define BALLAST_AR_AIR_Y2   80
#define SUBMARINE_WIDTH   122
#define SUBMARINE_HEIGHT   29
#define SURFACE_IN_BACKGROUND   30
#define SURFACE_DEPTH   7.0
#define IP_DEPTH   13.0
#define SECURITY_DEPTH   55.0
#define MAX_DEPTH   250.0
#define SPEED_MAX   10
#define SPEED_STEP   1
#define AIR_INITIAL   30000
#define BATTERY_INITIAL   3000
#define MAX_BALLAST   10000
#define MAX_REGLEUR   800
#define REGLEUR_INITIAL   500.0
#define WEIGHT_INITIAL   -300.0
#define SUBMARINE_INITIAL_X   150
#define WRAP_X   800
#define SUBMARINE_INITIAL_DEPTH   SURFACE_DEPTH
#define RUDDER_STEP   5
#define RUDDER_MAX   15
#define RUDDER_CENTER_X   72
#define RUDDER_CENTER_Y   7
#define ENGINE_DOWN_X   42
#define ENGINE_DOWN_Y   104
#define ENGINE_UP_X   124
#define ENGINE_UP_Y   104
#define AIR_X   328
#define AIR_Y   109
#define BATTERY_X   285
#define BATTERY_Y   156
#define REGLEUR_TEXT_X   330
#define REGLEUR_TEXT_Y   37
#define REGLEUR_X1   325
#define REGLEUR_Y1   18
#define REGLEUR_X2   337
#define REGLEUR_Y2   56
#define AIR_TRIGGER_X   154
#define AIR_TRIGGER_Y   108
#define BATTERY_TRIGGER_X   184
#define BATTERY_TRIGGER_Y   108
#define TRIGGER_CENTER_X   7
#define TRIGGER_CENTER_Y   23
#define ALERT_SUBMARINE_X   719
#define ALERT_SUBMARINE_Y   368
#define UP   1
#define DOWN   0
#define FRIGATE_SPEED   5.0
#define WHALE_DETECTION_RADIUS   30.0
#define UPDATE_DELAY   200
#define UPDATE_DELAY_SLOW   300
#define UPDATE_DELAY_VERY_SLOW   1500
#define TEXT_COLOR_FRONT   "red"
#define TEXT_COLOR_BACK   "orange"
#define COMMAND_OFFSET   20.0

Functions

static void start_board (GcomprisBoard *agcomprisBoard)
static void pause_board (gboolean pause)
static void end_board (void)
static gboolean is_our_board (GcomprisBoard *gcomprisBoard)
static void set_level (guint level)
static void ok (void)
static void game_won ()
static GnomeCanvasItem * submarine_create_item (GnomeCanvasGroup *parent)
static void submarine_destroy_all_items (void)
static void submarine_next_level (void)
static gint ballast_av_purge_event (GnomeCanvasItem *item, GdkEvent *event, gpointer data)
static gint ballast_ar_purge_event (GnomeCanvasItem *item, GdkEvent *event, gpointer data)
static gint regleur_purge_event (GnomeCanvasItem *item, GdkEvent *event, gpointer data)
static gint ballast_ar_chasse_event (GnomeCanvasItem *item, GdkEvent *event, gpointer data)
static gint ballast_av_chasse_event (GnomeCanvasItem *item, GdkEvent *event, gpointer data)
static gint regleur_chasse_event (GnomeCanvasItem *item, GdkEvent *event, gpointer data)
static gint barre_av_event (GnomeCanvasItem *item, GdkEvent *event, gpointer data)
static gint barre_ar_event (GnomeCanvasItem *item, GdkEvent *event, gpointer data)
static gint engine_event (GnomeCanvasItem *item, GdkEvent *event, gpointer data)
static gint air_compressor_event (GnomeCanvasItem *item, GdkEvent *event, gpointer data)
static gint battery_charger_event (GnomeCanvasItem *item, GdkEvent *event, gpointer data)
static void setSpeed (double value)
static void setBattery (double value)
static void setAir (double value)
static void setRegleur (double value)
static void setBallastAV (double value)
static void setBallastAR (double value)
static void submarine_explosion ()
static gboolean update_timeout ()
static gboolean update_timeout_slow ()
static gboolean update_timeout_very_slow ()
static gboolean quit_after_delay ()
static gboolean ok_timeout ()

Variables

static GcomprisBoard * gcomprisBoard = NULL
static gboolean board_paused = TRUE
static int gamewon
static GnomeCanvasGroup * boardRootItem = NULL
static GnomeCanvasItem * sub_schema_image_item
static GnomeCanvasItem * submarine_item
static GnomeCanvasItem * ballast_av_purge_item
static GnomeCanvasItem * ballast_ar_purge_item
static GnomeCanvasItem * regleur_purge_item
static GnomeCanvasItem * ballast_av_chasse_item
static GnomeCanvasItem * ballast_ar_chasse_item
static GnomeCanvasItem * regleur_chasse_item
gboolean ballast_av_purge_open
gboolean ballast_ar_purge_open
gboolean regleur_purge_open
gboolean ballast_av_chasse_open
gboolean ballast_ar_chasse_open
gboolean regleur_chasse_open
gboolean air_charging
gboolean battery_charging
gboolean submarine_destroyed
static GnomeCanvasItem * barre_av_item
static GnomeCanvasItem * barre_ar_item
static GnomeCanvasItem * barre_av_up_item
static GnomeCanvasItem * barre_av_down_item
static GnomeCanvasItem * barre_ar_up_item
static GnomeCanvasItem * barre_ar_down_item
static GnomeCanvasItem * engine_up_item
static GnomeCanvasItem * engine_down_item
static GnomeCanvasItem * speed_item_back
static GnomeCanvasItem * speed_item_front
static GnomeCanvasItem * air_item_back
static GnomeCanvasItem * air_item_front
static GnomeCanvasItem * regleur_item_back
static GnomeCanvasItem * regleur_item_front
static GnomeCanvasItem * regleur_item_rect
static GnomeCanvasItem * battery_item_back
static GnomeCanvasItem * battery_item_front
static GnomeCanvasItem * ballast_av_air_item_back
static GnomeCanvasItem * ballast_av_air_item_front
static GnomeCanvasItem * ballast_ar_air_item_back
static GnomeCanvasItem * ballast_ar_air_item_front
static GnomeCanvasItem * ballast_av_air_item_rect
static GnomeCanvasItem * ballast_ar_air_item_rect
static GnomeCanvasItem * air_compressor_item
static GnomeCanvasItem * battery_charger_item
static GnomeCanvasItem * alert_submarine
static GnomeCanvasItem * bubbling [3]
static GnomeCanvasItem * frigate_item
static GnomeCanvasItem * big_explosion
static GnomeCanvasItem * whale
static double barre_av_angle
static double barre_ar_angle
static double depth
static double weight
static double resulting_weight
static double submarine_x
static double air
static double battery
static double regleur
static double submarine_horizontal_speed
static double submarine_vertical_speed
static double speed_ordered
static double assiette
static double ballast_av_air
static double ballast_ar_air
static double whale_x
static double whale_y
static guint schema_x
static guint schema_y
static guint timer_id
static guint timer_slow_id
static guint timer_very_slow_id
static BoardPlugin menu_bp

Define Documentation

#define AIR_INITIAL   30000

Definition at line 78 of file submarine.c.

#define AIR_TRIGGER_X   154

Definition at line 109 of file submarine.c.

#define AIR_TRIGGER_Y   108

Definition at line 110 of file submarine.c.

#define AIR_X   328

Definition at line 97 of file submarine.c.

#define AIR_Y   109

Definition at line 98 of file submarine.c.

#define ALERT_SUBMARINE_X   719

Definition at line 115 of file submarine.c.

#define ALERT_SUBMARINE_Y   368

Definition at line 116 of file submarine.c.

#define BALLAST_AR_AIR_TEXT_X   220

Definition at line 60 of file submarine.c.

#define BALLAST_AR_AIR_TEXT_Y   50

Definition at line 61 of file submarine.c.

#define BALLAST_AR_AIR_X1   180

Definition at line 62 of file submarine.c.

#define BALLAST_AR_AIR_X2   270

Definition at line 64 of file submarine.c.

#define BALLAST_AR_AIR_Y1   20

Definition at line 63 of file submarine.c.

#define BALLAST_AR_AIR_Y2   80

Definition at line 65 of file submarine.c.

#define BALLAST_AV_AIR_TEXT_X   440

Definition at line 53 of file submarine.c.

#define BALLAST_AV_AIR_TEXT_Y   50

Definition at line 54 of file submarine.c.

#define BALLAST_AV_AIR_X1   393

Definition at line 55 of file submarine.c.

#define BALLAST_AV_AIR_X2   483

Definition at line 57 of file submarine.c.

#define BALLAST_AV_AIR_Y1   20

Definition at line 56 of file submarine.c.

#define BALLAST_AV_AIR_Y2   80

Definition at line 58 of file submarine.c.

#define BARRE_AR_X   100

Definition at line 48 of file submarine.c.

#define BARRE_AR_Y   50

Definition at line 49 of file submarine.c.

#define BARRE_AV_X   530

Definition at line 50 of file submarine.c.

#define BARRE_AV_Y   100

Definition at line 51 of file submarine.c.

#define BATTERY_INITIAL   3000

Definition at line 79 of file submarine.c.

#define BATTERY_TRIGGER_X   184

Definition at line 111 of file submarine.c.

#define BATTERY_TRIGGER_Y   108

Definition at line 112 of file submarine.c.

#define BATTERY_X   285

Definition at line 99 of file submarine.c.

#define BATTERY_Y   156

Definition at line 100 of file submarine.c.

#define CHASSE_BALLAST_AR_X   227

Definition at line 42 of file submarine.c.

#define CHASSE_BALLAST_AR_Y   97

Definition at line 43 of file submarine.c.

#define CHASSE_BALLAST_AV_X   440

Definition at line 44 of file submarine.c.

#define CHASSE_BALLAST_AV_Y   98

Definition at line 45 of file submarine.c.

#define CHASSE_REGLEUR_X   331

Definition at line 46 of file submarine.c.

#define CHASSE_REGLEUR_Y   72

Definition at line 47 of file submarine.c.

#define COMMAND_OFFSET   20.0
#define DEG_TO_RAD (   x)    M_PI*(x)/180.0

Definition at line 22 of file submarine.c.

#define DOWN   0

Definition at line 119 of file submarine.c.

#define ENGINE_DOWN_X   42

Definition at line 93 of file submarine.c.

#define ENGINE_DOWN_Y   104

Definition at line 94 of file submarine.c.

#define ENGINE_UP_X   124

Definition at line 95 of file submarine.c.

#define ENGINE_UP_Y   104

Definition at line 96 of file submarine.c.

#define FRIGATE_SPEED   5.0

Definition at line 121 of file submarine.c.

#define IP_DEPTH   13.0

Definition at line 73 of file submarine.c.

#define MAX_BALLAST   10000

Definition at line 80 of file submarine.c.

#define MAX_DEPTH   250.0

Definition at line 75 of file submarine.c.

#define MAX_REGLEUR   800

Definition at line 81 of file submarine.c.

#define PURGE_AR   225

Definition at line 39 of file submarine.c.

#define PURGE_AV   438

Definition at line 40 of file submarine.c.

#define REGLEUR   330

Definition at line 41 of file submarine.c.

#define REGLEUR_INITIAL   500.0

Definition at line 82 of file submarine.c.

#define REGLEUR_TEXT_X   330

Definition at line 102 of file submarine.c.

#define REGLEUR_TEXT_Y   37

Definition at line 103 of file submarine.c.

#define REGLEUR_X1   325

Definition at line 104 of file submarine.c.

#define REGLEUR_X2   337

Definition at line 106 of file submarine.c.

#define REGLEUR_Y1   18

Definition at line 105 of file submarine.c.

#define REGLEUR_Y2   56

Definition at line 107 of file submarine.c.

#define RUDDER_CENTER_X   72

Definition at line 91 of file submarine.c.

#define RUDDER_CENTER_Y   7

Definition at line 92 of file submarine.c.

#define RUDDER_MAX   15

Definition at line 90 of file submarine.c.

#define RUDDER_STEP   5

Definition at line 89 of file submarine.c.

#define SECURITY_DEPTH   55.0

Definition at line 74 of file submarine.c.

#define SOUNDLISTFILE   PACKAGE

Definition at line 24 of file submarine.c.

#define SPEED_MAX   10

Definition at line 76 of file submarine.c.

#define SPEED_STEP   1

Definition at line 77 of file submarine.c.

#define SUBMARINE_HEIGHT   29

Definition at line 69 of file submarine.c.

Definition at line 87 of file submarine.c.

#define SUBMARINE_INITIAL_X   150

Definition at line 85 of file submarine.c.

#define SUBMARINE_WIDTH   122

Definition at line 68 of file submarine.c.

#define SURFACE_DEPTH   7.0

Definition at line 72 of file submarine.c.

#define SURFACE_IN_BACKGROUND   30

Definition at line 71 of file submarine.c.

#define TEXT_COLOR_BACK   "orange"

Definition at line 129 of file submarine.c.

#define TEXT_COLOR_FRONT   "red"

Definition at line 128 of file submarine.c.

#define TRIGGER_CENTER_X   7

Definition at line 113 of file submarine.c.

#define TRIGGER_CENTER_Y   23

Definition at line 114 of file submarine.c.

#define UP   1

Definition at line 118 of file submarine.c.

#define UPDATE_DELAY   200

Definition at line 124 of file submarine.c.

#define UPDATE_DELAY_SLOW   300

Definition at line 125 of file submarine.c.

#define UPDATE_DELAY_VERY_SLOW   1500

Definition at line 126 of file submarine.c.

#define WEIGHT_INITIAL   -300.0

Definition at line 83 of file submarine.c.

#define WHALE_DETECTION_RADIUS   30.0

Definition at line 122 of file submarine.c.

#define WRAP_X   800

Definition at line 86 of file submarine.c.


Function Documentation

static gint air_compressor_event ( GnomeCanvasItem *  item,
GdkEvent *  event,
gpointer  data 
) [static]

Definition at line 1382 of file submarine.c.

                                                                                        {
  if(board_paused)
    return FALSE;
  switch (event->type)
    {
    case GDK_BUTTON_PRESS:
      if (air_charging)
       air_charging = FALSE;
      else
       air_charging = TRUE;
      gc_item_rotate_with_center(item, air_charging ? 180 : 0 , TRIGGER_CENTER_X, TRIGGER_CENTER_Y );
      break;

    default:
      break;
    }
  return FALSE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static gint ballast_ar_chasse_event ( GnomeCanvasItem *  item,
GdkEvent *  event,
gpointer  data 
) [static]

Definition at line 1232 of file submarine.c.

                                                                                           {
  if(board_paused)
    return FALSE;

  switch (event->type)
    {
    case GDK_BUTTON_PRESS:
      ballast_ar_chasse_open = !ballast_ar_chasse_open;
      if (ballast_ar_chasse_open)
       gc_item_rotate(item, 90.0);
      else
       gc_item_rotate(item, 0.0);
      break;

    default:
      break;
    }
  return FALSE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static gint ballast_ar_purge_event ( GnomeCanvasItem *  item,
GdkEvent *  event,
gpointer  data 
) [static]

Definition at line 1188 of file submarine.c.

                                                                                          {
  if(board_paused)
    return FALSE;

  switch (event->type)
    {
    case GDK_BUTTON_PRESS:
      ballast_ar_purge_open = !ballast_ar_purge_open;
      if (ballast_ar_purge_open)
       gc_item_rotate(item, 90.0);
      else
       gc_item_rotate(item, 0.0);
      break;

    default:
      break;
    }
  return FALSE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static gint ballast_av_chasse_event ( GnomeCanvasItem *  item,
GdkEvent *  event,
gpointer  data 
) [static]

Definition at line 1254 of file submarine.c.

                                                                                           {
  if(board_paused)
    return FALSE;

  switch (event->type)
    {
    case GDK_BUTTON_PRESS:
      ballast_av_chasse_open = !ballast_av_chasse_open;
      if (ballast_av_chasse_open)
       gc_item_rotate(item, 90.0);
      else
       gc_item_rotate(item, 0.0);
      break;

    default:
      break;
    }
  return FALSE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static gint ballast_av_purge_event ( GnomeCanvasItem *  item,
GdkEvent *  event,
gpointer  data 
) [static]

Definition at line 1165 of file submarine.c.

                                                                                          {
  if(board_paused)
    return FALSE;

  switch (event->type)
    {
    case GDK_BUTTON_PRESS:
      ballast_av_purge_open = !ballast_av_purge_open;
      if (ballast_av_purge_open)
       gc_item_rotate(item, 90.0);
      else
       gc_item_rotate(item, 0.0);
      break;

    default:
      break;
    }
  return FALSE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static gint barre_ar_event ( GnomeCanvasItem *  item,
GdkEvent *  event,
gpointer  data 
) [static]

Definition at line 1325 of file submarine.c.

                                                                                  {
  int d = GPOINTER_TO_INT(data);

  if(board_paused)
    return FALSE;

  switch (event->type)
    {
    case GDK_BUTTON_PRESS:
      if (d == UP && barre_ar_angle < RUDDER_MAX) {
        barre_ar_angle += RUDDER_STEP;
        gc_item_rotate_with_center( barre_ar_item, barre_ar_angle,RUDDER_CENTER_X,RUDDER_CENTER_Y);
      }
      if (d == DOWN && barre_ar_angle > -RUDDER_MAX) {
        barre_ar_angle -= RUDDER_STEP;
        gc_item_rotate_with_center( barre_ar_item, barre_ar_angle,RUDDER_CENTER_X,RUDDER_CENTER_Y);
      }
      break;

    default:
      break;
    }
  return FALSE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static gint barre_av_event ( GnomeCanvasItem *  item,
GdkEvent *  event,
gpointer  data 
) [static]

Definition at line 1299 of file submarine.c.

                                                                                  {
  int d = GPOINTER_TO_INT(data);
  if(board_paused)
    return FALSE;

  switch (event->type)
    {
    case GDK_BUTTON_PRESS:
      if (d == UP && barre_av_angle < RUDDER_MAX) {
        barre_av_angle += RUDDER_STEP;
        gc_item_rotate_with_center( barre_av_item, barre_av_angle,RUDDER_CENTER_X,RUDDER_CENTER_Y);
      }
      if (d == DOWN && barre_av_angle > -RUDDER_MAX) {
        barre_av_angle -= RUDDER_STEP;
        gc_item_rotate_with_center( barre_av_item, barre_av_angle,RUDDER_CENTER_X,RUDDER_CENTER_Y);
      }
      break;

    default:
      break;
    }
  return FALSE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static gint battery_charger_event ( GnomeCanvasItem *  item,
GdkEvent *  event,
gpointer  data 
) [static]

Definition at line 1403 of file submarine.c.

                                                                                         {
  if(board_paused)
    return FALSE;
  switch (event->type)
    {
    case GDK_BUTTON_PRESS:
      if (battery_charging)
       battery_charging = FALSE;
      else
       battery_charging = TRUE;
      gc_item_rotate_with_center(item, battery_charging ? 180 : 0 , TRIGGER_CENTER_X, TRIGGER_CENTER_Y );
      break;

    default:
      break;
    }
  return FALSE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void end_board ( void  ) [static]

Definition at line 255 of file submarine.c.

                         {
  if(gcomprisBoard!=NULL){
    pause_board(TRUE);
    submarine_destroy_all_items();
  }
  /* kill pending timers */
  g_source_remove(timer_id);
  g_source_remove(timer_slow_id);
  g_source_remove(timer_very_slow_id);

  gcomprisBoard = NULL;
}

Here is the call graph for this function:

static gint engine_event ( GnomeCanvasItem *  item,
GdkEvent *  event,
gpointer  data 
) [static]

Definition at line 1352 of file submarine.c.

                                                                                {
  int d = GPOINTER_TO_INT(data);

  if(board_paused)
    return FALSE;

  switch (event->type)
    {
    case GDK_BUTTON_PRESS:
      if (d == UP) {
        speed_ordered += SPEED_STEP;
      }
      if (d == DOWN) {
        speed_ordered -= SPEED_STEP;
      }
      if (speed_ordered > SPEED_MAX)
       speed_ordered = SPEED_MAX;
      if (speed_ordered < 0)
       speed_ordered = 0;
      setSpeed(speed_ordered);
      break;

    default:
      break;
    }
  return FALSE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void game_won ( void  ) [static]

Definition at line 1130 of file submarine.c.

                       {
  gcomprisBoard->sublevel++;
  if(gcomprisBoard->sublevel > gcomprisBoard->number_of_sublevel) {
    /* 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(BOARD_FINISHED_TUXLOCO);
      return;
    }
  }
  submarine_next_level();
}

Here is the call graph for this function:

Here is the caller graph for this function:

static gboolean is_our_board ( GcomprisBoard *  gcomprisBoard) [static]

Definition at line 282 of file submarine.c.

                                                            {
  if (gcomprisBoard) {
    if(g_strcasecmp(gcomprisBoard->type, "submarine")==0) {
      /* Set the plugin entry */
      gcomprisBoard->plugin=&menu_bp;
      return TRUE;
    }
  }
  return FALSE;
}
static void ok ( void  ) [static]

Definition at line 1157 of file submarine.c.

                 {
  // leave time to display the right answer
  g_timeout_add(TIME_CLICK_TO_BONUS, ok_timeout, NULL);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static gboolean ok_timeout ( ) [static]

Definition at line 1151 of file submarine.c.

Here is the call graph for this function:

Here is the caller graph for this function:

static void pause_board ( gboolean  pause) [static]

Definition at line 226 of file submarine.c.

{
  if(gcomprisBoard==NULL)
    return;

  if(gamewon == TRUE && pause == FALSE) /* the game is won */
    game_won();

  board_paused = pause;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static gboolean quit_after_delay ( ) [static]

Definition at line 1147 of file submarine.c.

                                   {
  gc_board_stop();
  return FALSE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static gint regleur_chasse_event ( GnomeCanvasItem *  item,
GdkEvent *  event,
gpointer  data 
) [static]

Definition at line 1276 of file submarine.c.

                                                                                        {
  if(board_paused)
    return FALSE;

  switch (event->type)
    {
    case GDK_BUTTON_PRESS:
      regleur_chasse_open = !regleur_chasse_open;
      if (regleur_chasse_open)
       gc_item_rotate(item, 90.0);
      else
       gc_item_rotate(item, 0.0);
      break;

    default:
      break;
    }
  return FALSE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static gint regleur_purge_event ( GnomeCanvasItem *  item,
GdkEvent *  event,
gpointer  data 
) [static]

Definition at line 1210 of file submarine.c.

                                                                                       {
  if(board_paused)
    return FALSE;

  switch (event->type)
    {
    case GDK_BUTTON_PRESS:
      regleur_purge_open = !regleur_purge_open;
      if (regleur_purge_open)
       gc_item_rotate(item, 90.0);
      else
       gc_item_rotate(item, 0.0);
      break;

    default:
      break;
    }
  return FALSE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void set_level ( guint  level) [static]

Definition at line 271 of file submarine.c.

                                    {
  if(gcomprisBoard!=NULL) {
    gcomprisBoard->level=level;
    gcomprisBoard->sublevel=1;
    submarine_next_level();
  }
}

Here is the call graph for this function:

static void setAir ( double  value) [static]

Definition at line 1436 of file submarine.c.

                                 {
  char s12[12];
  sprintf(s12,"%d",(int)value);
  gnome_canvas_item_set(air_item_back, "text", s12, NULL);
  gnome_canvas_item_set(air_item_front, "text", s12, NULL);
}

Here is the caller graph for this function:

static void setBallastAR ( double  value) [static]

Definition at line 1462 of file submarine.c.

                                       {
  char s12[12];
  sprintf(s12,"%d", MAX_BALLAST - (int)value);
  gnome_canvas_item_set(ballast_ar_air_item_back, "text", s12, NULL);
  gnome_canvas_item_set(ballast_ar_air_item_front, "text", s12, NULL);
  gnome_canvas_item_set(ballast_ar_air_item_rect,
                     "y1", (double) schema_y + BALLAST_AR_AIR_Y2 +
                     ( (MAX_BALLAST - value) * (BALLAST_AR_AIR_Y1 - BALLAST_AR_AIR_Y2)) / MAX_BALLAST,
                     NULL);


}

Here is the caller graph for this function:

static void setBallastAV ( double  value) [static]

Definition at line 1452 of file submarine.c.

                                       {
  char s12[12];
  sprintf(s12,"%d", MAX_BALLAST - (int)value);
  gnome_canvas_item_set(ballast_av_air_item_back, "text", s12, NULL);
  gnome_canvas_item_set(ballast_av_air_item_front, "text", s12, NULL);
  gnome_canvas_item_set(ballast_av_air_item_rect,
                     "y1", (double) schema_y + BALLAST_AV_AIR_Y2 +
                     ( (MAX_BALLAST - value) * (BALLAST_AV_AIR_Y1 - BALLAST_AV_AIR_Y2)) / MAX_BALLAST,
                     NULL);
}

Here is the caller graph for this function:

static void setBattery ( double  value) [static]

Definition at line 1430 of file submarine.c.

                                     {
  char s12[12];
  sprintf(s12,"%d",(int)value);
  gnome_canvas_item_set(battery_item_back, "text", s12, NULL);
  gnome_canvas_item_set(battery_item_front, "text", s12, NULL);
}

Here is the caller graph for this function:

static void setRegleur ( double  value) [static]

Definition at line 1442 of file submarine.c.

                                     {
  char s12[12];
  sprintf(s12,"%d",(int)value);
  gnome_canvas_item_set(regleur_item_back, "text", s12, NULL);
  gnome_canvas_item_set(regleur_item_front, "text", s12, NULL);
  gnome_canvas_item_set(regleur_item_rect,
                     "y1", (double) schema_y + REGLEUR_Y2 +
                     ( value * (REGLEUR_Y1 - REGLEUR_Y2)) / MAX_REGLEUR,
                     NULL);
}

Here is the caller graph for this function:

static void setSpeed ( double  value) [static]

Definition at line 1424 of file submarine.c.

                                   {
  char s12[12];
  sprintf(s12,"%d",(int)value);
  gnome_canvas_item_set(speed_item_back, "text", s12, NULL);
  gnome_canvas_item_set(speed_item_front, "text", s12, NULL);
}

Here is the caller graph for this function:

static void start_board ( GcomprisBoard *  agcomprisBoard) [static]

Definition at line 240 of file submarine.c.

                                                        {
  if(agcomprisBoard!=NULL) {
    gcomprisBoard=agcomprisBoard;
    gc_set_background(gnome_canvas_root(gcomprisBoard->canvas), "submarine/sub_bg.jpg");
    gcomprisBoard->level=1;
    gcomprisBoard->sublevel=1;
    submarine_next_level();
    gamewon = FALSE;
    pause_board(FALSE);
  }
}

Here is the call graph for this function:

static GnomeCanvasItem * submarine_create_item ( GnomeCanvasGroup *  parent) [static]

Definition at line 332 of file submarine.c.

                                                                        {
  GdkPixbuf *pixmap = NULL;
  char *str = NULL;
  char s12[12];
  int i, w, h;

  boardRootItem = GNOME_CANVAS_GROUP(
                                 gnome_canvas_item_new (gnome_canvas_root(gcomprisBoard->canvas),
                                                     gnome_canvas_group_get_type (),
                                                     "x", (double) 0,
                                                     "y", (double) 0,
                                                     NULL));

  str = g_strdup_printf("%s/%s", gcomprisBoard->boarddir, "submarine.png");
  pixmap = gc_pixmap_load(str);
  submarine_item = gnome_canvas_item_new (boardRootItem,
                                     gnome_canvas_pixbuf_get_type (),
                                     "pixbuf", pixmap,
                                     "x", (double) 0.0,//SUBMARINE_INITIAL_X,
                                     "y", (double) 0.0,//SUBMARINE_INITIAL_DEPTH + SURFACE_IN_BACKGROUND - SUBMARINE_HEIGHT,
                                     "width", (double) gdk_pixbuf_get_width(pixmap),
                                     "height", (double) gdk_pixbuf_get_height(pixmap),
                                     "width_set", TRUE,
                                     "height_set", TRUE,
                                     "anchor", GTK_ANCHOR_CENTER,
                                     NULL);

  g_free(str);
  gdk_pixbuf_unref(pixmap);

  str = g_strdup_printf("%s/%s", gcomprisBoard->boarddir, "sub_schema.png");
  pixmap = gc_pixmap_load(str);

  w = gdk_pixbuf_get_width(pixmap);
  h = gdk_pixbuf_get_height(pixmap);

  schema_x = (gcomprisBoard->width - w)/2 ;
  schema_y = gcomprisBoard->height - h;
  sub_schema_image_item = gnome_canvas_item_new (boardRootItem,
                                           gnome_canvas_pixbuf_get_type (),
                                           "pixbuf", pixmap,
                                           "x", (double) schema_x + w/2.0,
                                           "y", (double) schema_y + h/2.0,
                                           "width", (double) w,
                                           "height", (double) h,
                                           "width_set", TRUE,
                                           "height_set", TRUE,
                                           "anchor", GTK_ANCHOR_CENTER,
                                           NULL);

  g_free(str);
  gdk_pixbuf_unref(pixmap);

  str = g_strdup_printf("%s/%s", gcomprisBoard->boarddir, "vanne.png");
  pixmap = gc_pixmap_load(str);
  w = gdk_pixbuf_get_width(pixmap);
  h = gdk_pixbuf_get_height(pixmap);
  ballast_ar_purge_item = gnome_canvas_item_new (boardRootItem,
                                           gnome_canvas_pixbuf_get_type (),
                                           "pixbuf", pixmap,
                                           "x", (double) PURGE_AR + schema_x,
                                           "y", (double) schema_y + h/2.0 -1.0,
                                           "width", (double) w,
                                           "height", (double) h,
                                           "width_set", TRUE,
                                           "height_set", TRUE,
                                           "anchor", GTK_ANCHOR_CENTER,
                                           NULL);
  gtk_signal_connect(GTK_OBJECT(ballast_ar_purge_item), "event",  (GtkSignalFunc) ballast_ar_purge_event, NULL);

  ballast_av_purge_item = gnome_canvas_item_new (boardRootItem,
                                           gnome_canvas_pixbuf_get_type (),
                                           "pixbuf", pixmap,
                                           "x", (double) PURGE_AV + schema_x,
                                           "y", (double) schema_y + h/2.0 -1.0,
                                           "width", (double) gdk_pixbuf_get_width(pixmap),
                                           "height", (double) gdk_pixbuf_get_height(pixmap),
                                           "width_set", TRUE,
                                           "height_set", TRUE,
                                           "anchor", GTK_ANCHOR_CENTER,
                                           NULL);
  gtk_signal_connect(GTK_OBJECT(ballast_av_purge_item), "event",  (GtkSignalFunc) ballast_av_purge_event, NULL);

  regleur_purge_item = gnome_canvas_item_new (boardRootItem,
                                         gnome_canvas_pixbuf_get_type (),
                                         "pixbuf", pixmap,
                                         "x", (double) REGLEUR + schema_x,
                                         "y", (double) schema_y + h/2.0 -2.0,
                                         "width", (double) gdk_pixbuf_get_width(pixmap),
                                         "height", (double) gdk_pixbuf_get_height(pixmap),
                                         "width_set", TRUE,
                                         "height_set", TRUE,
                                         "anchor", GTK_ANCHOR_CENTER,
                                         NULL);
  gtk_signal_connect(GTK_OBJECT(regleur_purge_item), "event",  (GtkSignalFunc) regleur_purge_event, NULL);

  ballast_av_chasse_item = gnome_canvas_item_new (boardRootItem,
                                            gnome_canvas_pixbuf_get_type (),
                                            "pixbuf", pixmap,
                                            "x", (double) schema_x + CHASSE_BALLAST_AV_X,
                                            "y", (double) schema_y +  CHASSE_BALLAST_AV_Y,
                                            "width", (double) gdk_pixbuf_get_width(pixmap),
                                            "height", (double) gdk_pixbuf_get_height(pixmap),
                                            "width_set", TRUE,
                                            "height_set", TRUE,
                                            "anchor", GTK_ANCHOR_CENTER,
                                            NULL);
  gtk_signal_connect(GTK_OBJECT(ballast_av_chasse_item), "event",  (GtkSignalFunc) ballast_av_chasse_event, NULL);

  ballast_ar_chasse_item = gnome_canvas_item_new (boardRootItem,
                                            gnome_canvas_pixbuf_get_type (),
                                            "pixbuf", pixmap,
                                            "x", (double) schema_x + CHASSE_BALLAST_AR_X,
                                            "y", (double) schema_y +  CHASSE_BALLAST_AR_Y,
                                            "width", (double) gdk_pixbuf_get_width(pixmap),
                                            "height", (double) gdk_pixbuf_get_height(pixmap),
                                            "width_set", TRUE,
                                            "height_set", TRUE,
                                            "anchor", GTK_ANCHOR_CENTER,
                                            NULL);
  gtk_signal_connect(GTK_OBJECT(ballast_ar_chasse_item), "event",  (GtkSignalFunc) ballast_ar_chasse_event, NULL);

  regleur_chasse_item = gnome_canvas_item_new (boardRootItem,
                                          gnome_canvas_pixbuf_get_type (),
                                          "pixbuf", pixmap,
                                          "x", (double) schema_x + CHASSE_REGLEUR_X,
                                          "y", (double) schema_y + CHASSE_REGLEUR_Y,
                                          "width", (double) gdk_pixbuf_get_width(pixmap),
                                          "height", (double) gdk_pixbuf_get_height(pixmap),
                                          "width_set", TRUE,
                                          "height_set", TRUE,
                                          "anchor", GTK_ANCHOR_CENTER,
                                          NULL);
  gtk_signal_connect(GTK_OBJECT(regleur_chasse_item), "event",  (GtkSignalFunc) regleur_chasse_event, NULL);

  g_free(str);
  gdk_pixbuf_unref(pixmap);

  // DEPTH RUDDERS
  str = g_strdup_printf("%s/%s", gcomprisBoard->boarddir, "rudder.png");
  pixmap = gc_pixmap_load(str);
  barre_av_item = gnome_canvas_item_new (boardRootItem,
                                    gnome_canvas_pixbuf_get_type (),
                                    "pixbuf", pixmap,
                                    "x", (double) schema_x + BARRE_AV_X,
                                    "y", (double) schema_y + BARRE_AV_Y,
                                    "width", (double) gdk_pixbuf_get_width(pixmap),
                                    "height", (double) gdk_pixbuf_get_height(pixmap),
                                    "width_set", TRUE,
                                    "height_set", TRUE,
                                    "anchor", GTK_ANCHOR_CENTER,
                                    NULL);
  barre_ar_item = gnome_canvas_item_new (boardRootItem,
                                    gnome_canvas_pixbuf_get_type (),
                                    "pixbuf", pixmap,
                                    "x", (double) schema_x + BARRE_AR_X,
                                    "y", (double) schema_y + BARRE_AR_Y,
                                    "width", (double) gdk_pixbuf_get_width(pixmap),
                                    "height", (double) gdk_pixbuf_get_height(pixmap),
                                    "width_set", TRUE,
                                    "height_set", TRUE,
                                    "anchor", GTK_ANCHOR_CENTER,
                                    NULL);
  g_free(str);
  gdk_pixbuf_unref(pixmap);

#define COMMAND_OFFSET 20.0
  str = g_strdup_printf("%s/%s", gcomprisBoard->boarddir, "up.png");
  pixmap = gc_pixmap_load(str);
  barre_av_up_item = gnome_canvas_item_new (boardRootItem,
                                       gnome_canvas_pixbuf_get_type (),
                                       "pixbuf", pixmap,
                                       "x", (double) schema_x + BARRE_AV_X + COMMAND_OFFSET,
                                       "y", (double) schema_y + BARRE_AV_Y - COMMAND_OFFSET,
                                       "width", (double) gdk_pixbuf_get_width(pixmap),
                                       "height", (double) gdk_pixbuf_get_height(pixmap),
                                       "width_set", TRUE,
                                       "height_set", TRUE,
                                       "anchor", GTK_ANCHOR_CENTER,
                                       NULL);
  barre_ar_up_item = gnome_canvas_item_new (boardRootItem,
                                       gnome_canvas_pixbuf_get_type (),
                                       "pixbuf", pixmap,
                                       "x", (double) schema_x + BARRE_AR_X + COMMAND_OFFSET,
                                       "y", (double) schema_y + BARRE_AR_Y - COMMAND_OFFSET,
                                       "width", (double) gdk_pixbuf_get_width(pixmap),
                                       "height", (double) gdk_pixbuf_get_height(pixmap),
                                       "width_set", TRUE,
                                       "height_set", TRUE,
                                       "anchor", GTK_ANCHOR_CENTER,
                                       NULL);
  engine_up_item = gnome_canvas_item_new (boardRootItem,
                                     gnome_canvas_pixbuf_get_type (),
                                     "pixbuf", pixmap,
                                     "x", (double) schema_x + ENGINE_UP_X,
                                     "y", (double) schema_y + ENGINE_UP_Y,
                                     "width", (double) gdk_pixbuf_get_width(pixmap),
                                     "height", (double) gdk_pixbuf_get_height(pixmap),
                                     "width_set", TRUE,
                                     "height_set", TRUE,
                                     "anchor", GTK_ANCHOR_CENTER,
                                     NULL);
  g_free(str);
  gdk_pixbuf_unref(pixmap);

  str = g_strdup_printf("%s/%s", gcomprisBoard->boarddir, "down.png");
  pixmap = gc_pixmap_load(str);
  barre_av_down_item = gnome_canvas_item_new (boardRootItem,
                                         gnome_canvas_pixbuf_get_type (),
                                         "pixbuf", pixmap,
                                         "x", (double) schema_x + BARRE_AV_X + COMMAND_OFFSET,
                                         "y", (double) schema_y + BARRE_AV_Y + COMMAND_OFFSET,
                                         "width", (double) gdk_pixbuf_get_width(pixmap),
                                         "height", (double) gdk_pixbuf_get_height(pixmap),
                                         "width_set", TRUE,
                                         "height_set", TRUE,
                                         "anchor", GTK_ANCHOR_CENTER,
                                         NULL);
  barre_ar_down_item = gnome_canvas_item_new (boardRootItem,
                                         gnome_canvas_pixbuf_get_type (),
                                         "pixbuf", pixmap,
                                         "x", (double) schema_x + BARRE_AR_X + COMMAND_OFFSET,
                                         "y", (double) schema_y + BARRE_AR_Y + COMMAND_OFFSET,
                                         "width", (double) gdk_pixbuf_get_width(pixmap),
                                         "height", (double) gdk_pixbuf_get_height(pixmap),
                                         "width_set", TRUE,
                                         "height_set", TRUE,
                                         "anchor", GTK_ANCHOR_CENTER,
                                         NULL);
  engine_down_item = gnome_canvas_item_new (boardRootItem,
                                       gnome_canvas_pixbuf_get_type (),
                                       "pixbuf", pixmap,
                                       "x", (double) schema_x + ENGINE_DOWN_X,
                                       "y", (double) schema_y + ENGINE_DOWN_Y,
                                       "width", (double) gdk_pixbuf_get_width(pixmap),
                                       "height", (double) gdk_pixbuf_get_height(pixmap),
                                       "width_set", TRUE,
                                       "height_set", TRUE,
                                       "anchor", GTK_ANCHOR_CENTER,
                                       NULL);
  g_free(str);
  gdk_pixbuf_unref(pixmap);

  gtk_signal_connect(GTK_OBJECT(barre_av_up_item), "event",  (GtkSignalFunc) barre_av_event, GINT_TO_POINTER(UP));
  gtk_signal_connect(GTK_OBJECT(barre_ar_up_item), "event",  (GtkSignalFunc) barre_ar_event, GINT_TO_POINTER(UP));
  gtk_signal_connect(GTK_OBJECT(barre_av_down_item), "event",  (GtkSignalFunc) barre_av_event, GINT_TO_POINTER(DOWN));
  gtk_signal_connect(GTK_OBJECT(barre_ar_down_item), "event",  (GtkSignalFunc) barre_ar_event, GINT_TO_POINTER(DOWN));
  gtk_signal_connect(GTK_OBJECT(engine_up_item), "event",  (GtkSignalFunc) engine_event, GINT_TO_POINTER(UP));
  gtk_signal_connect(GTK_OBJECT(engine_down_item), "event",  (GtkSignalFunc) engine_event, GINT_TO_POINTER(DOWN));

  // displays the speed on the engine
  sprintf(s12,"%d",(int)submarine_horizontal_speed);
  speed_item_back = gnome_canvas_item_new (boardRootItem,
                                      gnome_canvas_text_get_type (),
                                      "text", s12,
                                      "font", gc_skin_font_board_title_bold,
                                      "x", (double) schema_x + (ENGINE_UP_X + ENGINE_DOWN_X)/2 +1,
                                      "y", (double) schema_y + ENGINE_UP_Y + 1,
                                      "anchor", GTK_ANCHOR_CENTER,
                                      "fill_color", TEXT_COLOR_BACK,
                                      NULL);
  speed_item_front = gnome_canvas_item_new (boardRootItem,
                                       gnome_canvas_text_get_type (),
                                       "text", s12,
                                       "font", gc_skin_font_board_title_bold,
                                       "x", (double) schema_x + (ENGINE_UP_X + ENGINE_DOWN_X)/2,
                                       "y", (double) schema_y + ENGINE_UP_Y,
                                       "anchor", GTK_ANCHOR_CENTER,
                                       "fill_color", TEXT_COLOR_FRONT,
                                       NULL);

  // displays the ballast_av_air value
  ballast_av_air_item_rect = gnome_canvas_item_new (boardRootItem,
                                              gnome_canvas_rect_get_type (),
                                              "x1", (double) schema_x + BALLAST_AV_AIR_X1,
                                              "y1", (double) schema_y + BALLAST_AV_AIR_Y2,
                                              "x2", (double) schema_x + BALLAST_AV_AIR_X2,
                                              "y2", (double) schema_y + BALLAST_AV_AIR_Y2,
                                              "fill_color", "blue",
                                              "width_pixels", 0,
                                              NULL);

  sprintf(s12,"%d",(int)ballast_av_air);
  ballast_av_air_item_back = gnome_canvas_item_new (boardRootItem,
                                              gnome_canvas_text_get_type (),
                                              "text", s12,
                                              "font", gc_skin_font_board_title_bold,
                                              "x", (double) schema_x + BALLAST_AV_AIR_TEXT_X + 1,
                                              "y", (double) schema_y + BALLAST_AV_AIR_TEXT_Y + 1,
                                              "anchor", GTK_ANCHOR_CENTER,
                                              "fill_color", TEXT_COLOR_BACK,
                                              NULL);
  ballast_av_air_item_front = gnome_canvas_item_new (boardRootItem,
                                               gnome_canvas_text_get_type (),
                                               "text", s12,
                                               "font", gc_skin_font_board_title_bold,
                                               "x", (double) schema_x + BALLAST_AV_AIR_TEXT_X,
                                               "y", (double) schema_y + BALLAST_AV_AIR_TEXT_Y,
                                               "anchor", GTK_ANCHOR_CENTER,
                                               "fill_color", TEXT_COLOR_FRONT,
                                               NULL);
  setBallastAV(ballast_av_air);

  // displays the ballast_ar_air value
  ballast_ar_air_item_rect = gnome_canvas_item_new (boardRootItem,
                                              gnome_canvas_rect_get_type (),
                                              "x1", (double) schema_x + BALLAST_AR_AIR_X1,
                                              "y1", (double) schema_y + BALLAST_AR_AIR_Y2,
                                              "x2", (double) schema_x + BALLAST_AR_AIR_X2,
                                              "y2", (double) schema_y + BALLAST_AR_AIR_Y2,
                                              "fill_color", "blue",
                                              "width_pixels", 0,
                                              NULL);

  sprintf(s12,"%d",(int)ballast_ar_air);
  ballast_ar_air_item_back = gnome_canvas_item_new (boardRootItem,
                                              gnome_canvas_text_get_type (),
                                              "text", s12,
                                              "font", gc_skin_font_board_title_bold,
                                              "x", (double) schema_x + BALLAST_AR_AIR_TEXT_X + 1,
                                              "y", (double) schema_y + BALLAST_AR_AIR_TEXT_Y + 1,
                                              "anchor", GTK_ANCHOR_CENTER,
                                              "fill_color", TEXT_COLOR_BACK,
                                              NULL);
  ballast_ar_air_item_front = gnome_canvas_item_new (boardRootItem,
                                               gnome_canvas_text_get_type (),
                                               "text", s12,
                                               "font", gc_skin_font_board_title_bold,
                                               "x", (double) schema_x + BALLAST_AR_AIR_TEXT_X,
                                               "y", (double) schema_y + BALLAST_AR_AIR_TEXT_Y,
                                               "anchor", GTK_ANCHOR_CENTER,
                                               "fill_color", TEXT_COLOR_FRONT,
                                               NULL);
    setBallastAR(ballast_ar_air);

  // displays the remaining air value
  sprintf(s12,"%d", (int)air);
  air_item_back = gnome_canvas_item_new (boardRootItem,
                                    gnome_canvas_text_get_type (),
                                    "text", s12,
                                    "font", gc_skin_font_board_title_bold,
                                    "x", (double) schema_x + AIR_X +1,
                                    "y", (double) schema_y + AIR_Y + 1,
                                    "anchor", GTK_ANCHOR_CENTER,
                                    "fill_color", TEXT_COLOR_BACK,
                                    NULL);
  air_item_front = gnome_canvas_item_new (boardRootItem,
                                     gnome_canvas_text_get_type (),
                                     "text", s12,
                                     "font", gc_skin_font_board_title_bold,
                                     "x", (double) schema_x + AIR_X,
                                     "y", (double) schema_y + AIR_Y,
                                     "anchor", GTK_ANCHOR_CENTER,
                                     "fill_color", TEXT_COLOR_FRONT,
                                     NULL);

  // displays the remaining battery value
  sprintf(s12,"%d", (int)battery);
  battery_item_back = gnome_canvas_item_new (boardRootItem,
                                        gnome_canvas_text_get_type (),
                                        "text", s12,
                                        "font", gc_skin_font_board_title_bold,
                                        "x", (double) schema_x + BATTERY_X +1,
                                        "y", (double) schema_y + BATTERY_Y + 1,
                                        "anchor", GTK_ANCHOR_CENTER,
                                        "fill_color", TEXT_COLOR_BACK,
                                        NULL);
  battery_item_front = gnome_canvas_item_new (boardRootItem,
                                         gnome_canvas_text_get_type (),
                                         "text", s12,
                                         "font", gc_skin_font_board_title_bold,
                                         "x", (double) schema_x + BATTERY_X,
                                         "y", (double) schema_y + BATTERY_Y,
                                         "anchor", GTK_ANCHOR_CENTER,
                                         "fill_color", TEXT_COLOR_FRONT,
                                         NULL);

  // displays the remaining regleur value
  regleur_item_rect = gnome_canvas_item_new (boardRootItem,
                                        gnome_canvas_rect_get_type (),
                                        "x1", (double) schema_x + REGLEUR_X1,
                                        "y1", (double) schema_y + REGLEUR_Y2,
                                        "x2", (double) schema_x + REGLEUR_X2,
                                        "y2", (double) schema_y + REGLEUR_Y2,
                                        "fill_color", "blue",
                                        "width_pixels", 0,
                                        NULL);

  sprintf(s12,"%d", (int)regleur);
  regleur_item_back = gnome_canvas_item_new (boardRootItem,
                                        gnome_canvas_text_get_type (),
                                        "text", s12,
                                        "font", gc_skin_font_board_title_bold,
                                        "x", (double) schema_x + REGLEUR_TEXT_X +1,
                                        "y", (double) schema_y + REGLEUR_TEXT_Y + 1,
                                        "anchor", GTK_ANCHOR_CENTER,
                                        "fill_color", TEXT_COLOR_BACK,
                                        NULL);
  regleur_item_front = gnome_canvas_item_new (boardRootItem,
                                         gnome_canvas_text_get_type (),
                                         "text", s12,
                                         "font", gc_skin_font_board_title_bold,
                                         "x", (double) schema_x + REGLEUR_TEXT_X,
                                         "y", (double) schema_y + REGLEUR_TEXT_Y,
                                         "anchor", GTK_ANCHOR_CENTER,
                                         "fill_color", TEXT_COLOR_FRONT,
                                         NULL);
  setRegleur(regleur);

  // displays an alert when some parameters are bad
  str = g_strdup_printf("%s/%s", gcomprisBoard->boarddir, "alert_submarine.png");
  pixmap = gc_pixmap_load(str);
  alert_submarine = gnome_canvas_item_new (boardRootItem,
                                      gnome_canvas_pixbuf_get_type (),
                                      "pixbuf", pixmap,
                                      "x", (double) ALERT_SUBMARINE_X,
                                      "y", (double) ALERT_SUBMARINE_Y,
                                      "width", (double) gdk_pixbuf_get_width(pixmap),
                                      "height", (double) gdk_pixbuf_get_height(pixmap),
                                      "width_set", TRUE,
                                      "height_set", TRUE,
                                      "anchor", GTK_ANCHOR_CENTER,
                                      NULL);
  g_free(str);
  gdk_pixbuf_unref(pixmap);
  gnome_canvas_item_hide(alert_submarine);

  // when the submarine makes some bubbles ...
  str = g_strdup_printf("%s/%s", gcomprisBoard->boarddir, "bubbling.png");
  pixmap = gc_pixmap_load(str);
  for (i=0; i<3; i++) {
    bubbling[i] = gnome_canvas_item_new (boardRootItem,
                                    gnome_canvas_pixbuf_get_type (),
                                    "pixbuf", pixmap,
                                    "x", (double) 0.0,
                                    "y", (double) 0.0,
                                    "width", (double) gdk_pixbuf_get_width(pixmap),
                                    "height", (double) gdk_pixbuf_get_height(pixmap),
                                    "width_set", TRUE,
                                    "height_set", TRUE,
                                    "anchor", GTK_ANCHOR_CENTER,
                                    NULL);
    gnome_canvas_item_hide(bubbling[i]);
  }
  g_free(str);
  gdk_pixbuf_unref(pixmap);

  // whale item
  str = g_strdup_printf("%s/%s", gcomprisBoard->boarddir, "whale.png");
  pixmap = gc_pixmap_load(str);
  whale_x = RAND((int)(gdk_pixbuf_get_width(pixmap)), (int)(gcomprisBoard->width-gdk_pixbuf_get_width(pixmap)));
  whale_y = RAND((int)(SURFACE_IN_BACKGROUND + gdk_pixbuf_get_height(pixmap)),(int)MAX_DEPTH);
  whale = gnome_canvas_item_new (boardRootItem,
                            gnome_canvas_pixbuf_get_type (),
                            "pixbuf", pixmap,
                            "x", (double) whale_x,
                            "y", (double) whale_y,
                            "width", (double) gdk_pixbuf_get_width(pixmap),
                            "height", (double) gdk_pixbuf_get_height(pixmap),
                            "width_set", TRUE,
                            "height_set", TRUE,
                            "anchor", GTK_ANCHOR_CENTER,
                            NULL);
  g_free(str);
  gdk_pixbuf_unref(pixmap);

  // big explosion item (only for the whale)
  str = g_strdup_printf("%s/%s", gcomprisBoard->boarddir, "whale_hit.png");
  pixmap = gc_pixmap_load(str);
  big_explosion = gnome_canvas_item_new (boardRootItem,
                                    gnome_canvas_pixbuf_get_type (),
                                    "pixbuf", pixmap,
                                    "x", (double) whale_x,
                                    "y", (double) whale_y,
                                    "width", (double) gdk_pixbuf_get_width(pixmap),
                                    "height", (double) gdk_pixbuf_get_height(pixmap),
                                    "width_set", TRUE,
                                    "height_set", TRUE,
                                    "anchor", GTK_ANCHOR_CENTER,
                                    NULL);
  gnome_canvas_item_hide(big_explosion);

  g_free(str);
  gdk_pixbuf_unref(pixmap);

  // the triggers for air compressor and battery charger
  str = g_strdup_printf("%s/%s", gcomprisBoard->boarddir, "manette.png");
  pixmap = gc_pixmap_load(str);
  air_compressor_item = gnome_canvas_item_new (boardRootItem,
                                          gnome_canvas_pixbuf_get_type (),
                                          "pixbuf", pixmap,
                                          "x", (double) schema_x + AIR_TRIGGER_X,
                                          "y", (double) schema_y + AIR_TRIGGER_Y,
                                          "width", (double) gdk_pixbuf_get_width(pixmap),
                                          "height", (double) gdk_pixbuf_get_height(pixmap),
                                          "width_set", TRUE,
                                          "height_set", TRUE,
                                          "anchor", GTK_ANCHOR_CENTER,
                                          NULL);
  battery_charger_item = gnome_canvas_item_new (boardRootItem,
                                          gnome_canvas_pixbuf_get_type (),
                                          "pixbuf", pixmap,
                                          "x", (double) schema_x + BATTERY_TRIGGER_X,
                                          "y", (double) schema_y + BATTERY_TRIGGER_Y,
                                          "width", (double) gdk_pixbuf_get_width(pixmap),
                                          "height", (double) gdk_pixbuf_get_height(pixmap),
                                          "width_set", TRUE,
                                          "height_set", TRUE,
                                          "anchor", GTK_ANCHOR_CENTER,
                                          NULL);
  g_free(str);
  gdk_pixbuf_unref(pixmap);

  // the antisubmarine warfare frigate
  str = g_strdup_printf("%s/%s", gcomprisBoard->boarddir, "asw_frigate.png");
  pixmap = gc_pixmap_load(str);
  frigate_item = gnome_canvas_item_new (boardRootItem,
                                   gnome_canvas_pixbuf_get_type (),
                                   "pixbuf", pixmap,
                                   "x", (double) 700.0,
                                   "y", (double) 2.0,
                                   "width", (double) gdk_pixbuf_get_width(pixmap),
                                   "height", (double) gdk_pixbuf_get_height(pixmap),
                                   "width_set", TRUE,
                                   "height_set", TRUE,
                                   //"anchor", GTK_ANCHOR_CENTER,
                                   NULL);
  g_free(str);
  gdk_pixbuf_unref(pixmap);

  gtk_signal_connect(GTK_OBJECT(air_compressor_item), "event",  (GtkSignalFunc) air_compressor_event, NULL);
  gtk_signal_connect(GTK_OBJECT(battery_charger_item), "event",  (GtkSignalFunc) battery_charger_event, NULL);

  timer_id = g_timeout_add(UPDATE_DELAY, update_timeout, NULL);
  timer_slow_id = g_timeout_add(UPDATE_DELAY_SLOW, update_timeout_slow, NULL);
  timer_very_slow_id = g_timeout_add(UPDATE_DELAY_VERY_SLOW, update_timeout_very_slow, NULL);

  return NULL;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void submarine_destroy_all_items ( void  ) [static]

Definition at line 322 of file submarine.c.

                                          {
  if(boardRootItem!=NULL)
    gtk_object_destroy (GTK_OBJECT(boardRootItem));

  boardRootItem = NULL;
}

Here is the caller graph for this function:

static void submarine_explosion ( ) [static]

Definition at line 1477 of file submarine.c.

                                  {
  GdkPixbuf *pixmap = NULL;
  char *str = NULL;

  submarine_destroyed = TRUE;
  gamewon = FALSE;
  gc_sound_play_ogg("sounds/crash.ogg", NULL);
  /* make the submarine die */
  setSpeed(speed_ordered = submarine_horizontal_speed = 0.0);
  setBattery(battery = 0.0);
  setAir(air = 0.0);
  regleur = MAX_REGLEUR;
  weight = 2000.0;

  /* display the boken submarine */
  str = g_strdup_printf("%s/%s", gcomprisBoard->boarddir, "submarine-broken.png");
  pixmap = gc_pixmap_load(str);
  gnome_canvas_item_set(submarine_item,
                     "pixbuf", pixmap,
                     NULL);
  g_free(str);
  gdk_pixbuf_unref(pixmap);

  ok();
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void submarine_next_level ( void  ) [static]
static gboolean update_timeout ( ) [static]

Definition at line 874 of file submarine.c.

                                 {
  double delta_air;
  gboolean regleur_dirty = FALSE;
  gboolean air_dirty = FALSE;

  if(board_paused)
    return FALSE;

  /* air in ballasts */
  if (ballast_av_purge_open) {
    ballast_av_air -= UPDATE_DELAY/1000.0 *500.0; // 500 liters go out per second
    if (ballast_av_air < 0.0)
      ballast_av_air = 0.0;
    setBallastAV(ballast_av_air);
  }
  if (ballast_ar_purge_open) {
    ballast_ar_air -= UPDATE_DELAY/1000.0 *500.0;
    if (ballast_ar_air < 0.0)
      ballast_ar_air = 0.0;
    setBallastAR(ballast_ar_air);
  }
  if (ballast_av_chasse_open && air>0.0) {
    delta_air = UPDATE_DELAY/1000.0 *500.0; // 200 liters are injected each second
    ballast_av_air += delta_air;
    air -= delta_air;
    if (air<0.0)
      air = 0.0;
    if (ballast_av_air > MAX_BALLAST)
      ballast_av_air = MAX_BALLAST;
    air_dirty = TRUE;
    setBallastAV(ballast_av_air);
  }
  if (ballast_ar_chasse_open && air>0.0) {
    delta_air = UPDATE_DELAY/1000.0 *500.0;
    ballast_ar_air += delta_air;
    air -= delta_air;
    if (air<0.0)
      air = 0.0;
    if (ballast_ar_air > MAX_BALLAST)
      ballast_ar_air = MAX_BALLAST;
    air_dirty = TRUE;
    setBallastAR(ballast_ar_air);
  }

  if (air_dirty)
    setAir(air);

  /* air in "regleur" (small ballast to finely balance the submarine) */
  if (regleur_purge_open) {
    regleur += UPDATE_DELAY/1000.0 *50.0; // 100 liters enter per second
    if (regleur > MAX_REGLEUR)
      regleur = MAX_REGLEUR;
    regleur_dirty = TRUE;
  }
  if (regleur_chasse_open && air>0.0 && regleur > 0.0) {
    delta_air = UPDATE_DELAY/1000.0 *50.0; // 50 liters are injected each second
    regleur -= delta_air;
    air -= delta_air;
    if (air<0.0)
      air = 0.0;
    if (regleur < 0.0)
      regleur = 0.0;
    regleur_dirty = TRUE;
    setAir(air);
  }

  if (regleur_dirty)
    setRegleur(regleur);

  return TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static gboolean update_timeout_slow ( ) [static]

Definition at line 948 of file submarine.c.

                                      {
  double delta_assiette;

  if(board_paused)
    return FALSE;

  /* speed : don't reach instantly the ordered speed */
  if (speed_ordered != submarine_horizontal_speed) {
    submarine_horizontal_speed += (speed_ordered-submarine_horizontal_speed)/10.0;
    if (fabs(speed_ordered - submarine_horizontal_speed) < 0.1)
      submarine_horizontal_speed = speed_ordered;
  }

  /* assiette */
  delta_assiette = (ballast_ar_air - ballast_av_air)/200.0 +
    (barre_av_angle - barre_ar_angle)/5.0*submarine_horizontal_speed;
  assiette -= delta_assiette*UPDATE_DELAY/10000.0;
  if (assiette < -30.0)
    assiette = -30.0;
  if (assiette > 30.0)
    assiette = 30.0;

  /* If surfacing, diminish the 'assiette' */
  if ( depth <= 5.0 + SURFACE_DEPTH) {
    assiette *= depth/(depth+1.0);
  }

  /* update some dynamic parameters */
  /* resulting_weight > 0 ==> the sub goes deeper
     regleur : this is the qty of water */
  resulting_weight = weight - ballast_av_air - ballast_ar_air + regleur;
  submarine_vertical_speed = resulting_weight/300.0 + submarine_horizontal_speed*sin(DEG_TO_RAD(-assiette));

  /* if depth rudders are in the same direction */
  if (barre_ar_angle != 0.0 && barre_av_angle != 0.0) {
    if (fabs(barre_ar_angle)/barre_ar_angle == fabs(barre_av_angle)/barre_av_angle) {
      double a = (fabs(barre_ar_angle) > fabs(barre_av_angle)) ? barre_av_angle : barre_ar_angle;
      submarine_vertical_speed += a * submarine_horizontal_speed/30.0;
    }
  }

  /* position & depth */
  submarine_x += submarine_horizontal_speed * cos(DEG_TO_RAD(assiette)) * UPDATE_DELAY_SLOW/1000.0;
  depth += submarine_vertical_speed * UPDATE_DELAY_SLOW/1000.0;
  if (depth < SURFACE_DEPTH)
    depth = SURFACE_DEPTH;
  if (depth > MAX_DEPTH)
    depth = MAX_DEPTH;

  // show an alert if some parameters reach the limit
  if (depth >= MAX_DEPTH-20.0 || assiette == -30.0 || assiette == 30.0 || air == 0.0 || battery == 0.0)
    gnome_canvas_item_show(alert_submarine);
  else
    gnome_canvas_item_hide(alert_submarine);

  /* if the submarine dives, stop charging air tanks and batteries */
  if ( depth >= SURFACE_DEPTH+10.0 ) {
    if (air_charging) {
      air_charging = FALSE;
      gc_item_rotate_with_center(air_compressor_item, 0 , TRIGGER_CENTER_X, TRIGGER_CENTER_Y );
    }
    if (battery_charging) {
      battery_charging = FALSE;
      gc_item_rotate_with_center(battery_charger_item, 0 , TRIGGER_CENTER_X, TRIGGER_CENTER_Y );
    }
  }

  /* if the submarine is too close from right, put it at left */
  if ( submarine_x > WRAP_X )
    submarine_x = SUBMARINE_WIDTH/2.0;

  { /* displayes the submarine */
    double r[6],t1[6], t2[6];
    double y = depth + SUBMARINE_HEIGHT/2 + SURFACE_IN_BACKGROUND - SUBMARINE_WIDTH/2.0*sin(DEG_TO_RAD(assiette));
    art_affine_translate( t1 , (double)-SUBMARINE_WIDTH/2.0, (double)-SUBMARINE_HEIGHT );
    art_affine_rotate( r, -assiette );
    art_affine_multiply( r, t1, r);
    art_affine_translate( t2 , submarine_x, y );
    art_affine_multiply( r, r, t2);
    gnome_canvas_item_affine_absolute( submarine_item, r );
  }

  /* the frigate */
  {
    double x1, x2, y1, y2, x;
    x = - FRIGATE_SPEED * UPDATE_DELAY_SLOW/1000.0;
    gnome_canvas_item_get_bounds(frigate_item, &x1, &y1, &x2, &y2);
    gnome_canvas_item_move(frigate_item, - FRIGATE_SPEED * UPDATE_DELAY_SLOW/1000.0, 0.0);
    /* detects a collision between the frigate and the submarine */
    if (depth <= 30.0 && !submarine_destroyed)
      if ( (submarine_x - SUBMARINE_WIDTH <= x1 && submarine_x >= x2) ||
          (submarine_x - SUBMARINE_WIDTH >= x1 && submarine_x - SUBMARINE_WIDTH <= x2) ||
          (submarine_x >= x1 && submarine_x <= x2) ) {
        submarine_explosion();
      }
    /* wraps the destroyer if it reached the left side (and disappeared for a long time)*/
    if (x2 < -300.0)
      gc_item_absolute_move( frigate_item, gcomprisBoard->width, y1 );
  }

  /* whale detection */
  {
    double dist1, dist2, dist3;
    dist1 = hypot( submarine_x -SUBMARINE_WIDTH/2 -whale_x, depth+SURFACE_IN_BACKGROUND-whale_y);
    dist2 = hypot(submarine_x - SUBMARINE_WIDTH - whale_x, depth+SURFACE_IN_BACKGROUND-whale_y);
    dist3 = hypot(submarine_x - whale_x, depth+SURFACE_IN_BACKGROUND-whale_y);
    /* magnetic detection (dist1) or collision with the whale (dist2 & dist3) */
    if ( (dist1 < WHALE_DETECTION_RADIUS || dist2 < WHALE_DETECTION_RADIUS ||dist3 < WHALE_DETECTION_RADIUS)
        && !submarine_destroyed ) {
      gc_sound_play_ogg("sounds/crash.ogg", NULL);
      gnome_canvas_item_hide(whale);
      //gc_item_absolute_move(big_explosion, whale_x, whale_y);
      gnome_canvas_item_show(big_explosion);
      submarine_explosion();
    }
  }

  return TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static gboolean update_timeout_very_slow ( ) [static]

Definition at line 1070 of file submarine.c.

                                           {
  /* charging */

  if(board_paused)
    return FALSE;

  if (air_charging && depth < SURFACE_DEPTH+5.0) {
    air += 100.0*UPDATE_DELAY_VERY_SLOW/1000.0;
    setAir(air);
  }

  if (battery_charging && depth < SURFACE_DEPTH+5.0) {
    if (battery < 0.3*battery)
      battery += 300.0*UPDATE_DELAY_VERY_SLOW/1000.0;
    else
      if (battery < 0.6*battery)
       battery += 100.0*UPDATE_DELAY_VERY_SLOW/1000.0;
      else
       if (battery < 0.8*battery)
         battery += 50.0*UPDATE_DELAY_VERY_SLOW/1000.0;
       else
         battery += 20.0*UPDATE_DELAY_VERY_SLOW/1000.0;
  }

  /* battery */
  battery -= submarine_horizontal_speed*submarine_horizontal_speed/3.0*UPDATE_DELAY_VERY_SLOW/1000.0;
  if (battery < 0.0) {
    battery = 0.0;
    speed_ordered = 0;
    setSpeed(speed_ordered);
  }

  setBattery( battery );

  /* bubbling */
  if ( (ballast_av_purge_open && ballast_av_air > 0.0) ||
       ( ballast_av_chasse_open && ballast_av_air == MAX_BALLAST ) ) {
    gc_item_absolute_move( bubbling[0], submarine_x-30.0, depth-50.0);
    gnome_canvas_item_show( bubbling[0] );
  } else
    gnome_canvas_item_hide( bubbling[0] );

  if ( (ballast_ar_purge_open && ballast_ar_air > 0.0) ||
       ( ballast_ar_chasse_open && ballast_ar_air == MAX_BALLAST ) ) {
    gc_item_absolute_move( bubbling[2], submarine_x - SUBMARINE_WIDTH , depth-30.0);
    gnome_canvas_item_show( bubbling[2] );
  } else
    gnome_canvas_item_hide( bubbling[2] );

  if (regleur_purge_open && regleur < MAX_REGLEUR) {
    gc_item_absolute_move( bubbling[1], submarine_x - SUBMARINE_WIDTH/2 -30.0, depth-30.0);
    gnome_canvas_item_show( bubbling[1] );
  } else
    gnome_canvas_item_hide( bubbling[1] );

  return TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

double air [static]

Definition at line 157 of file submarine.c.

gboolean air_charging

Definition at line 139 of file submarine.c.

GnomeCanvasItem * air_compressor_item [static]

Definition at line 142 of file submarine.c.

GnomeCanvasItem * air_item_back [static]

Definition at line 142 of file submarine.c.

GnomeCanvasItem * air_item_front [static]

Definition at line 142 of file submarine.c.

GnomeCanvasItem * alert_submarine [static]

Definition at line 142 of file submarine.c.

double assiette [static]

Definition at line 158 of file submarine.c.

double ballast_ar_air [static]

Definition at line 159 of file submarine.c.

GnomeCanvasItem * ballast_ar_air_item_back [static]

Definition at line 142 of file submarine.c.

GnomeCanvasItem * ballast_ar_air_item_front [static]

Definition at line 142 of file submarine.c.

GnomeCanvasItem * ballast_ar_air_item_rect [static]

Definition at line 142 of file submarine.c.

GnomeCanvasItem * ballast_ar_chasse_item [static]

Definition at line 136 of file submarine.c.

Definition at line 138 of file submarine.c.

GnomeCanvasItem * ballast_ar_purge_item [static]

Definition at line 134 of file submarine.c.

Definition at line 137 of file submarine.c.

double ballast_av_air [static]

Definition at line 159 of file submarine.c.

GnomeCanvasItem * ballast_av_air_item_back [static]

Definition at line 142 of file submarine.c.

GnomeCanvasItem * ballast_av_air_item_front [static]

Definition at line 142 of file submarine.c.

GnomeCanvasItem * ballast_av_air_item_rect [static]

Definition at line 142 of file submarine.c.

GnomeCanvasItem* ballast_av_chasse_item [static]

Definition at line 136 of file submarine.c.

Definition at line 138 of file submarine.c.

GnomeCanvasItem * ballast_av_purge_item [static]

Definition at line 134 of file submarine.c.

Definition at line 137 of file submarine.c.

double barre_ar_angle [static]

Definition at line 157 of file submarine.c.

GnomeCanvasItem * barre_ar_down_item [static]

Definition at line 142 of file submarine.c.

GnomeCanvasItem * barre_ar_item [static]

Definition at line 142 of file submarine.c.

GnomeCanvasItem * barre_ar_up_item [static]

Definition at line 142 of file submarine.c.

double barre_av_angle [static]

Definition at line 157 of file submarine.c.

GnomeCanvasItem * barre_av_down_item [static]

Definition at line 142 of file submarine.c.

GnomeCanvasItem* barre_av_item [static]

Definition at line 142 of file submarine.c.

GnomeCanvasItem * barre_av_up_item [static]

Definition at line 142 of file submarine.c.

double battery [static]

Definition at line 157 of file submarine.c.

GnomeCanvasItem * battery_charger_item [static]

Definition at line 142 of file submarine.c.

gboolean battery_charging

Definition at line 139 of file submarine.c.

GnomeCanvasItem * battery_item_back [static]

Definition at line 142 of file submarine.c.

GnomeCanvasItem * battery_item_front [static]

Definition at line 142 of file submarine.c.

GnomeCanvasItem * big_explosion [static]

Definition at line 142 of file submarine.c.

gboolean board_paused = TRUE [static]

Definition at line 27 of file submarine.c.

GnomeCanvasGroup* boardRootItem = NULL [static]

Definition at line 132 of file submarine.c.

GnomeCanvasItem * bubbling[3] [static]

Definition at line 142 of file submarine.c.

double depth [static]

Definition at line 157 of file submarine.c.

GnomeCanvasItem * engine_down_item [static]

Definition at line 142 of file submarine.c.

GnomeCanvasItem * engine_up_item [static]

Definition at line 142 of file submarine.c.

GnomeCanvasItem * frigate_item [static]

Definition at line 142 of file submarine.c.

int gamewon [static]

Definition at line 34 of file submarine.c.

GcomprisBoard* gcomprisBoard = NULL [static]

Definition at line 26 of file submarine.c.

BoardPlugin menu_bp [static]
Initial value:
  {
    NULL,
    NULL,
    N_("Submarine"),
    N_("Control the depth of a submarine"),
    "Pascal Georges pascal.georges1@free.fr>",
    NULL,
    NULL,
    NULL,
    NULL,
    start_board,
    pause_board,
    end_board,
    is_our_board,
    NULL,
    NULL,
    set_level,
    NULL,
    NULL,
    NULL,
    NULL
  }

Definition at line 194 of file submarine.c.

double regleur [static]

Definition at line 157 of file submarine.c.

GnomeCanvasItem * regleur_chasse_item [static]

Definition at line 136 of file submarine.c.

Definition at line 138 of file submarine.c.

GnomeCanvasItem * regleur_item_back [static]

Definition at line 142 of file submarine.c.

GnomeCanvasItem * regleur_item_front [static]

Definition at line 142 of file submarine.c.

GnomeCanvasItem * regleur_item_rect [static]

Definition at line 142 of file submarine.c.

GnomeCanvasItem * regleur_purge_item [static]

Definition at line 134 of file submarine.c.

Definition at line 137 of file submarine.c.

double resulting_weight [static]

Definition at line 157 of file submarine.c.

guint schema_x [static]

Definition at line 162 of file submarine.c.

guint schema_y [static]

Definition at line 162 of file submarine.c.

GnomeCanvasItem * speed_item_back [static]

Definition at line 142 of file submarine.c.

GnomeCanvasItem * speed_item_front [static]

Definition at line 142 of file submarine.c.

double speed_ordered [static]

Definition at line 158 of file submarine.c.

GnomeCanvasItem* sub_schema_image_item [static]

Definition at line 134 of file submarine.c.

Definition at line 140 of file submarine.c.

double submarine_horizontal_speed [static]

Definition at line 158 of file submarine.c.

GnomeCanvasItem * submarine_item [static]

Definition at line 134 of file submarine.c.

double submarine_vertical_speed [static]

Definition at line 158 of file submarine.c.

double submarine_x [static]

Definition at line 157 of file submarine.c.

guint timer_id [static]

Definition at line 191 of file submarine.c.

guint timer_slow_id [static]

Definition at line 191 of file submarine.c.

guint timer_very_slow_id [static]

Definition at line 191 of file submarine.c.

double weight [static]

Definition at line 157 of file submarine.c.

GnomeCanvasItem * whale [static]

Definition at line 142 of file submarine.c.

double whale_x [static]

Definition at line 161 of file submarine.c.

double whale_y [static]

Definition at line 161 of file submarine.c.