Debian Codegraph @

src/preference.h

raw symbols SCIP
1 // (_||_/
2 // ( ) Preferences data
3 // ( o 0 )
4 //-OOO°--(_)---°OOO---------------------------------------
5 // Copyright (C) 2006 By Dominique Roux-Serret
6 // .OOOo oOOO. [email protected]
7 //-( )------( )---------------------------------------
8 // ( ( ) / Copyright (C) 2023 By Johnny Jazeix
9 // (_) (_/ [email protected]
10
11 // This program is free software; you can redistribute it and/or modify
12 // it under the terms of the GNU General Public License as published by
13 // the Free Software Foundation; either version 2 or version 3 of the License.
14
15 // This program is distributed in the hope that it will be useful,
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 // GNU General Public License for more details.
19
20 // You should have received a copy of the GNU General Public License along
21 // with this program; if not, write to the Free Software Foundation, Inc.,
22 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23
24 #ifndef PREFERENCE_DOM_
25 #define PREFERENCE_DOM_
26
27 #include <SDL2/SDL_audio.h> // for SDL_MIX_MAXVOLUME
28
29 #define VITESSE_MAX 180.0
30 #define VITESSE_MOY 120.0
31 #define VITESSE_MIN 80.0
32 #define DUREE_VITESSE (10 * 1000)
33
34 #define DUREE_PAUSE (3 * 1000)
35
36 #define DUREE_REDUIT (10 * 1000)
37 #define DUREE_ALONGE (10 * 1000)
38 #define ECARTWAGON_MAX 27.0
39 #define ECARTWAGON_MOY 13.0
40 #define ECARTWAGON_MIN 4.0
41
42 #define N_VIES_DEP 3
43
44 #define RAYON_TOUCHE (32 * 32)
45
46 #define LT 17
47 #define HT 15
48 #define MAX_N_LEVEL_IN_MEMORY 256
49
50 #define D_Left 0
51 #define D_Right 1
52 #define D_Top 2
53 #define D_Bottom 3
54
55 #define D_Case 40
56 #define D_CaseR 31.416
57
58 /*** Possible pieces on the level ***/
59 #define C_None 0
60 #define C_Rail 1
61 #define C_Wagon 2
62 #define C_Allonge 3
63 #define C_Reduit 4
64 #define C_Speed 5
65 #define C_Live 6
66 #define C_Fin 7
67
68 enum e_Difficulte {
69 Easy,
70 Normal,
71 Hard
72 };
73
74 /*** Mémorise un score ***/
75 #define LSCOREMAX 460
76
77 struct sScore
78 {
79 int Score;
80 char Name[80];
81 };
82
83 /*** Structure des preferences Générales ***/
84 struct sOldPreference
85 {
86 e_Difficulte Difficulte; // Difficulté de la partie (Vitesse)
87 int Niveau; // Niveau du joueur
88 int NVie; // Nombre de vie du joueur
89 int Score; // Score du joueur
90 double Vitesse; // Vitesse suivant le niveau
91 double VitesseMoy; // Vitesse en cours de la loco
92 float EcartWagon; // ecart en pixels entre 2 wagons
93 int NiveauMax;
94 int FullScreen;
95 int Langue; // Langue à afficher
96 int NLangues; // Nombre de langues disponible
97 float Volume; // Volumes audio
98 float VolumeM; // Volume de la music
99 struct sScore Sco[8]; // Mémorise les scores
100 };
101
102 struct sNewPreference
103 {
104 e_Difficulte Difficulte { Normal }; // current game difficulty
105 int Niveau; // current level
106 int NVie { N_VIES_DEP }; // current number of life
107 int Score; // current score
108 double Vitesse { VITESSE_MOY }; // Vitesse suivant le niveau
109 double VitesseMoy { VITESSE_MOY }; // Vitesse en cours de la loco
110 float EcartWagon { ECARTWAGON_MOY }; // ecart en pixels entre 2 wagons
111 int NLangues; // Nombre de langues disponible
112 int NiveauMax[3] { 0, 0, 0 }; // One per difficulty
113 int FullScreen { true };
114 int Langue { -1 }; // locale index
115 float Volume { (float)SDL_MIX_MAXVOLUME }; // audio volume
116 float VolumeM { (float)SDL_MIX_MAXVOLUME }; // music volume
117 struct sScore Sco[8]; // store scores
118 int HumanRightsQuiz { 1 }; // enable the human rights questions at the end of a level
119 };
120
121 enum eMenu {
122 mMenu,
123 mMenuJeux,
124 mMenuSpeed,
125 mMenuNiveau,
126 mLangue,
127 mGame,
128 mScore,
129 mScoreEdit,
130 mOption,
131 mQuit,
132 mEdit,
133 };
134
135 #endif