Those sets haven't been merged.
[neverball] / ball / level.h
index e6659a0..92f971a 100644 (file)
@@ -1,48 +1,73 @@
 #ifndef LEVEL_H
 #define LEVEL_H
 
+#include "base_config.h"
+#include "score.h"
+#include "levels.h"
+
 /*---------------------------------------------------------------------------*/
 
-const char *level_shot(int);
-const char *level_coin_n(int, int);
-const char *level_time_n(int, int);
-int         level_coin_c(int, int);
-int         level_time_c(int, int);
-int         level_coin_t(int, int);
-int         level_time_t(int, int);
-
-void level_init(const char *, const char *, const char *);
-void level_free(void);
-
-int  level_exists(int);
-int  level_opened(int);
-int  level_locked(int);
-
-int  curr_times_total(void);
-int  curr_coins_total(void);
-int  curr_count(void);
-int  curr_score(void);
-int  curr_coins(void);
-int  curr_balls(void);
-int  curr_level(void);
-int  curr_goal (void);
+struct level
+{
+    char file[PATHMAX];
+    char back[PATHMAX];
+    char grad[PATHMAX];
+    char shot[PATHMAX];
+    char song[PATHMAX];
+
+    char message[MAXSTR];
+
+    char version[MAXSTR];
+    char author[MAXSTR];
+
+    int time; /* Time limit   */
+    int goal; /* Coins needed */
+
+    struct
+    {
+        struct score best_times;
+        struct score unlock_goal;
+        struct score most_coins;
+    }
+    score;
+
+    /* 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 char *, int);
+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);
 
-void level_stat(int);
-int  level_dead(void);
-int  level_last(void);
-int  level_exit(const char *, int);
-int  level_sort(int *, int *);
-int  level_done(int *, int *);
-int  level_score(int);
-int  level_count(void);
+/*---------------------------------------------------------------------------*/
 
-void level_name(int, const char *, int, int);
-void level_snap(int);
-void level_song(void);
+int count_extra_balls(int, int);
+
+void level_update_player_name(void);
 
 /*---------------------------------------------------------------------------*/
 
+#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 *status_to_str(int);
+
 #endif