Those sets haven't been merged.
[neverball] / ball / mode.c
1 /*
2  * Copyright (C) 2007 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 "mode.h"
16 #include "lang.h"
17
18 /*---------------------------------------------------------------------------*/
19
20 static int mode = MODE_NORMAL;
21
22 /*---------------------------------------------------------------------------*/
23
24 int curr_mode(void)
25 {
26     return mode;
27 }
28
29 void mode_set(int new_mode)
30 {
31     mode = new_mode;
32 }
33
34 const char *mode_to_str(int m, int l)
35 {
36     switch (m)
37     {
38     case MODE_CHALLENGE: return l ? _("Challenge Mode") : _("Challenge");
39     case MODE_NORMAL:    return l ? _("Normal Mode")    : _("Normal");
40     case MODE_PRACTICE:  return l ? _("Practice Mode")  : _("Practice");
41     default:             return l ? _("Unknown Mode")   : _("Unknown");
42     }
43 }
44
45 /*---------------------------------------------------------------------------*/