Oops, forgot to enable the stats only on config.
[neverball] / ball / level.h
index a516f40..92f971a 100644 (file)
@@ -2,66 +2,72 @@
 #define LEVEL_H
 
 #include "base_config.h"
+#include "score.h"
+#include "levels.h"
 
 /*---------------------------------------------------------------------------*/
 
-/* A simple level */
-
 struct level
 {
-    /* (data) means that the file is relative from the data file */
-    char file[MAXSTR];    /* sol main file */
-    char back[MAXSTR];    /* sol background file (data) */
-    char grad[MAXSTR];    /* gradiant backgound image (data) */
-    char shot[MAXSTR];    /* screenshot image (data)*/
-    char song[MAXSTR];    /* song file (data) */
-    int  time;            /* time limit */
-    int  goal;            /* coins needed */
-};
+    char file[PATHMAX];
+    char back[PATHMAX];
+    char grad[PATHMAX];
+    char shot[PATHMAX];
+    char song[PATHMAX];
 
-int level_load(const char *, struct level *);
+    char message[MAXSTR];
 
-void level_dump_info(const struct level *);
+    char version[MAXSTR];
+    char author[MAXSTR];
 
-/*---------------------------------------------------------------------------*/
+    int time; /* Time limit   */
+    int goal; /* Coins needed */
 
-/* A level for the playing */
+    struct
+    {
+        struct score best_times;
+        struct score unlock_goal;
+        struct score most_coins;
+    }
+    score;
 
-struct level_game
-{
-    int mode;          /* game mode */
-    int level;         /* level id of the set */
-
-    int goal;          /* coins needed */
-    int time;          /* time limit */
-    
-    /* MODE_CHALLENGE only */
-    int score;         /* coin total */
-    int balls;         /* live count */
-    int times;         /* time total */
-
-    /* Once a level is finished */
-    int state;         /* state ending */
-    int coins;         /* coins collected */
-    int timer;         /* time elapsed */
+    /* Set information. */
+
+    struct set *set;
+
+    int  number;
+
+    /* String representation of the number (eg. "IV") */
+    char repr[MAXSTR];
+
+    int is_locked;
+    int is_bonus;
+    int is_completed;
 };
 
+int  level_load(const char *, struct level *);
+void level_dump(const struct level *);
+
+int  level_replay(const char *);
+int  level_play(const struct level *, int);
+void level_stat(int, int, int);
+void level_stop(void);
+int  level_next(void);
+int  level_same(void);
+
 /*---------------------------------------------------------------------------*/
 
-#define MODE_CHALLENGE  1
-#define MODE_NORMAL     2
-#define MODE_PRACTICE   3
-#define MODE_SINGLE     4
+int count_extra_balls(int, int);
 
-const char *mode_to_str(int);
+void level_update_player_name(void);
 
 /*---------------------------------------------------------------------------*/
 
-#define GAME_NONE 0
-#define GAME_TIME 1
-#define GAME_GOAL 2
-#define GAME_FALL 3
+#define GAME_NONE 0     /* No event (or aborted) */
+#define GAME_TIME 1     /* Time's up */
+#define GAME_GOAL 2     /* Goal reached */
+#define GAME_FALL 3     /* Fall out */
 
-const char *state_to_str(int);
+const char *status_to_str(int);
 
 #endif