New replay information screen.
[neverball] / ball / level.c
1 /*   
2  * Copyright (C) 2003 Robert Kooima
3  *
4  * NEVERBALL is  free software; you can redistribute  it and/or modify
5  * it under the  terms of the GNU General  Public License as published
6  * by the Free  Software Foundation; either version 2  of the License,
7  * or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful, but
10  * WITHOUT  ANY  WARRANTY;  without   even  the  implied  warranty  of
11  * MERCHANTABILITY or  FITNESS FOR A PARTICULAR PURPOSE.   See the GNU
12  * General Public License for more details.
13  */
14
15 #include <stdio.h>
16 #include <string.h>
17 #include <math.h>
18
19 #include "level.h"
20
21 /*---------------------------------------------------------------------------*/
22
23 int level_load(const char *filename, struct level * level)
24 /* Load the level 'filename' and fill the 'level' structure */
25 /* return 1 on success, 0 on error */
26 {
27     strcpy(level->file, filename);
28     return 1;
29 }
30
31 void level_dump_info(const struct level * level)
32 {
33     printf("filename:        %s\n"
34            "background:      %s\n"
35            "gradiant:        %s\n"
36            "screenshot:      %s\n"
37            "song:            %s\n"
38            "time limit:      %d\n"
39            "goal count:      %d\n",
40            level->file, level->back, level->grad, level->shot, level->song,
41            level->time, level->goal);
42 }
43
44 /*---------------------------------------------------------------------------*/
45
46 const char * mode_to_str(int m)
47 {
48     switch (m)
49     {
50     case MODE_CHALLENGE: return _("Challenge");
51     case MODE_NORMAL:    return _("Normal");
52     case MODE_PRACTICE:  return _("Practice");
53     case MODE_SINGLE:    return _("Single");
54     default:             return "???";
55     }
56 }
57
58 /*---------------------------------------------------------------------------*/
59
60 const char * state_to_str(int m)
61 {
62     switch (m)
63     {
64     case GAME_NONE:    return _("Aborted");
65     case GAME_TIME:    return _("Time-out");
66     case GAME_GOAL:    return _("Success");
67     case GAME_FALL:    return _("Fall-out");
68     default:           return "???";
69     }
70 }
71
72 /*---------------------------------------------------------------------------*/