Merge lp:~widelands-dev/widelands/b19_gcc7 into lp:widelands/build19
- b19_gcc7
- Merge into b19
Proposed by
GunChleoc
Status: | Merged |
---|---|
Merged at revision: | 8149 |
Proposed branch: | lp:~widelands-dev/widelands/b19_gcc7 |
Merge into: | lp:widelands/build19 |
Diff against target: |
816 lines (+143/-88) 29 files modified
.travis.yml (+8/-16) CMakeLists.txt (+3/-2) src/CMakeLists.txt (+1/-0) src/base/macros.h (+10/-0) src/graphic/gl/fill_rect_program.cc (+3/-3) src/logic/CMakeLists.txt (+15/-5) src/logic/game_controller.h (+1/-1) src/logic/game_settings.cc (+1/-0) src/logic/game_settings.h (+7/-4) src/logic/map_objects/immovable.cc (+1/-1) src/logic/map_objects/tribes/production_program.cc (+1/-2) src/logic/map_objects/tribes/ship.cc (+2/-3) src/logic/mapfringeregion.cc (+10/-4) src/logic/player_end_result.h (+27/-0) src/logic/playersmanager.h (+1/-7) src/logic/single_player_game_controller.h (+1/-0) src/network/netclient.cc (+1/-2) src/network/netclient.h (+1/-0) src/network/nethost.cc (+4/-4) src/network/nethost.h (+1/-0) src/scripting/CMakeLists.txt (+1/-0) src/scripting/lua_game.cc (+1/-0) src/ui_basic/editbox.cc (+11/-10) src/ui_basic/listselect.cc (+6/-4) src/ui_basic/multilineeditbox.cc (+9/-8) src/ui_fsmenu/loadgame.cc (+3/-2) src/wui/game_summary.cc (+6/-5) src/wui/interactive_base.cc (+6/-4) src/wui/interactive_player.cc (+1/-1) |
To merge this branch: | bzr merge lp:~widelands-dev/widelands/b19_gcc7 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Widelands Developers | Pending | ||
Review via email: mp+325798@code.launchpad.net |
Commit message
Description of the change
Ported support for gcc7 from trunk.
This can go in as soon as Travis is clean.
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file '.travis.yml' | |||
2 | --- .travis.yml 2016-10-09 09:36:13 +0000 | |||
3 | +++ .travis.yml 2017-06-17 14:22:37 +0000 | |||
4 | @@ -20,25 +20,17 @@ | |||
5 | 20 | - compiler: clang | 20 | - compiler: clang |
6 | 21 | env: CLANG_VERSION="3.5" BUILD_TYPE="Debug" | 21 | env: CLANG_VERSION="3.5" BUILD_TYPE="Debug" |
7 | 22 | - compiler: clang | 22 | - compiler: clang |
8 | 23 | env: CLANG_VERSION="3.6" BUILD_TYPE="Debug" | ||
9 | 24 | - compiler: clang | ||
10 | 25 | env: CLANG_VERSION="3.7" BUILD_TYPE="Debug" | ||
11 | 26 | - compiler: clang | ||
12 | 27 | env: CLANG_VERSION="3.8" BUILD_TYPE="Debug" | ||
13 | 28 | - compiler: clang | ||
14 | 29 | env: CLANG_VERSION="3.9" BUILD_TYPE="Debug" | 23 | env: CLANG_VERSION="3.9" BUILD_TYPE="Debug" |
15 | 30 | - compiler: clang | 24 | - compiler: clang |
16 | 25 | env: CLANG_VERSION="4.0" BUILD_TYPE="Debug" | ||
17 | 26 | - compiler: clang | ||
18 | 31 | env: CLANG_VERSION="3.4" BUILD_TYPE="Release" | 27 | env: CLANG_VERSION="3.4" BUILD_TYPE="Release" |
19 | 32 | - compiler: clang | 28 | - compiler: clang |
20 | 33 | env: CLANG_VERSION="3.5" BUILD_TYPE="Release" | 29 | env: CLANG_VERSION="3.5" BUILD_TYPE="Release" |
21 | 34 | - compiler: clang | 30 | - compiler: clang |
22 | 35 | env: CLANG_VERSION="3.6" BUILD_TYPE="Release" | ||
23 | 36 | - compiler: clang | ||
24 | 37 | env: CLANG_VERSION="3.7" BUILD_TYPE="Release" | ||
25 | 38 | - compiler: clang | ||
26 | 39 | env: CLANG_VERSION="3.8" BUILD_TYPE="Release" | ||
27 | 40 | - compiler: clang | ||
28 | 41 | env: CLANG_VERSION="3.9" BUILD_TYPE="Release" | 31 | env: CLANG_VERSION="3.9" BUILD_TYPE="Release" |
29 | 32 | - compiler: clang | ||
30 | 33 | env: CLANG_VERSION="4.0" BUILD_TYPE="Release" | ||
31 | 42 | - compiler: gcc | 34 | - compiler: gcc |
32 | 43 | env: GCC_VERSION="4.7" BUILD_TYPE="Debug" | 35 | env: GCC_VERSION="4.7" BUILD_TYPE="Debug" |
33 | 44 | - compiler: gcc | 36 | - compiler: gcc |
34 | @@ -46,16 +38,16 @@ | |||
35 | 46 | - compiler: gcc | 38 | - compiler: gcc |
36 | 47 | env: GCC_VERSION="4.9" BUILD_TYPE="Debug" | 39 | env: GCC_VERSION="4.9" BUILD_TYPE="Debug" |
37 | 48 | - compiler: gcc | 40 | - compiler: gcc |
38 | 49 | env: GCC_VERSION="5" BUILD_TYPE="Debug" | ||
39 | 50 | - compiler: gcc | ||
40 | 51 | env: GCC_VERSION="6" BUILD_TYPE="Debug" | 41 | env: GCC_VERSION="6" BUILD_TYPE="Debug" |
41 | 52 | - compiler: gcc | 42 | - compiler: gcc |
42 | 43 | env: GCC_VERSION="7" BUILD_TYPE="Debug" | ||
43 | 44 | - compiler: gcc | ||
44 | 53 | env: GCC_VERSION="4.7" BUILD_TYPE="Release" | 45 | env: GCC_VERSION="4.7" BUILD_TYPE="Release" |
45 | 54 | - compiler: gcc | 46 | - compiler: gcc |
46 | 55 | env: GCC_VERSION="4.8" BUILD_TYPE="Release" | 47 | env: GCC_VERSION="4.8" BUILD_TYPE="Release" |
47 | 56 | - compiler: gcc | 48 | - compiler: gcc |
48 | 57 | env: GCC_VERSION="4.9" BUILD_TYPE="Release" | 49 | env: GCC_VERSION="4.9" BUILD_TYPE="Release" |
49 | 58 | - compiler: gcc | 50 | - compiler: gcc |
50 | 59 | env: GCC_VERSION="5" BUILD_TYPE="Release" | ||
51 | 60 | - compiler: gcc | ||
52 | 61 | env: GCC_VERSION="6" BUILD_TYPE="Release" | 51 | env: GCC_VERSION="6" BUILD_TYPE="Release" |
53 | 52 | - compiler: gcc | ||
54 | 53 | env: GCC_VERSION="7" BUILD_TYPE="Release" | ||
55 | 62 | 54 | ||
56 | === modified file 'CMakeLists.txt' | |||
57 | --- CMakeLists.txt 2016-09-04 07:54:45 +0000 | |||
58 | +++ CMakeLists.txt 2017-06-17 14:22:37 +0000 | |||
59 | @@ -116,7 +116,6 @@ | |||
60 | 116 | wl_add_flag(WL_COMPILE_DIAGNOSTICS "-Wno-padded") | 116 | wl_add_flag(WL_COMPILE_DIAGNOSTICS "-Wno-padded") |
61 | 117 | wl_add_flag(WL_COMPILE_DIAGNOSTICS "-Wno-sign-conversion") | 117 | wl_add_flag(WL_COMPILE_DIAGNOSTICS "-Wno-sign-conversion") |
62 | 118 | wl_add_flag(WL_COMPILE_DIAGNOSTICS "-Wno-missing-noreturn") | 118 | wl_add_flag(WL_COMPILE_DIAGNOSTICS "-Wno-missing-noreturn") |
63 | 119 | wl_add_flag(WL_COMPILE_DIAGNOSTICS "-Wno-implicit-fallthrough") | ||
64 | 120 | 119 | ||
65 | 121 | # TODO(sirver): weak-vtables should be enabled, but leads to lot of errors right now. | 120 | # TODO(sirver): weak-vtables should be enabled, but leads to lot of errors right now. |
66 | 122 | wl_add_flag(WL_COMPILE_DIAGNOSTICS "-Wno-weak-vtables") | 121 | wl_add_flag(WL_COMPILE_DIAGNOSTICS "-Wno-weak-vtables") |
67 | @@ -132,6 +131,9 @@ | |||
68 | 132 | if(WIN32) | 131 | if(WIN32) |
69 | 133 | # This is needed for getenv(). | 132 | # This is needed for getenv(). |
70 | 134 | wl_add_flag(WL_GENERIC_CXX_FLAGS "-std=gnu++11") | 133 | wl_add_flag(WL_GENERIC_CXX_FLAGS "-std=gnu++11") |
71 | 134 | else() | ||
72 | 135 | # SDL and MinGW both declare 'unsigned int __builtin_ia32_crc32qi(unsigned int, unsigned char)', resulting in lots of warnings. So, we can't have this flag in Windows. | ||
73 | 136 | wl_add_flag(WL_COMPILE_DIAGNOSTICS "-Wredundant-decls") | ||
74 | 135 | endif() | 137 | endif() |
75 | 136 | 138 | ||
76 | 137 | if (NOT (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8)) | 139 | if (NOT (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8)) |
77 | @@ -167,7 +169,6 @@ | |||
78 | 167 | wl_add_flag(WL_COMPILE_DIAGNOSTICS "-Woverlength-strings") | 169 | wl_add_flag(WL_COMPILE_DIAGNOSTICS "-Woverlength-strings") |
79 | 168 | wl_add_flag(WL_COMPILE_DIAGNOSTICS "-Wpacked") | 170 | wl_add_flag(WL_COMPILE_DIAGNOSTICS "-Wpacked") |
80 | 169 | wl_add_flag(WL_COMPILE_DIAGNOSTICS "-Wpointer-arith") | 171 | wl_add_flag(WL_COMPILE_DIAGNOSTICS "-Wpointer-arith") |
81 | 170 | wl_add_flag(WL_COMPILE_DIAGNOSTICS "-Wredundant-decls") | ||
82 | 171 | wl_add_flag(WL_COMPILE_DIAGNOSTICS "-Wsign-promo") | 172 | wl_add_flag(WL_COMPILE_DIAGNOSTICS "-Wsign-promo") |
83 | 172 | wl_add_flag(WL_COMPILE_DIAGNOSTICS "-Wsync-nand") | 173 | wl_add_flag(WL_COMPILE_DIAGNOSTICS "-Wsync-nand") |
84 | 173 | wl_add_flag(WL_COMPILE_DIAGNOSTICS "-Wtrampolines") | 174 | wl_add_flag(WL_COMPILE_DIAGNOSTICS "-Wtrampolines") |
85 | 174 | 175 | ||
86 | === modified file 'src/CMakeLists.txt' | |||
87 | --- src/CMakeLists.txt 2016-05-17 15:57:06 +0000 | |||
88 | +++ src/CMakeLists.txt 2017-06-17 14:22:37 +0000 | |||
89 | @@ -113,6 +113,7 @@ | |||
90 | 113 | logic | 113 | logic |
91 | 114 | logic_game_controller | 114 | logic_game_controller |
92 | 115 | logic_game_settings | 115 | logic_game_settings |
93 | 116 | logic_single_player_game_settings | ||
94 | 116 | map_io_map_loader | 117 | map_io_map_loader |
95 | 117 | network | 118 | network |
96 | 118 | profile | 119 | profile |
97 | 119 | 120 | ||
98 | === modified file 'src/base/macros.h' | |||
99 | --- src/base/macros.h 2016-08-04 15:49:05 +0000 | |||
100 | +++ src/base/macros.h 2017-06-17 14:22:37 +0000 | |||
101 | @@ -67,6 +67,16 @@ | |||
102 | 67 | #define DIAG_OFF(x) GCC_DIAG_OFF(x) CLANG_DIAG_OFF(x) | 67 | #define DIAG_OFF(x) GCC_DIAG_OFF(x) CLANG_DIAG_OFF(x) |
103 | 68 | #define DIAG_ON(x) GCC_DIAG_ON(x) CLANG_DIAG_ON(x) | 68 | #define DIAG_ON(x) GCC_DIAG_ON(x) CLANG_DIAG_ON(x) |
104 | 69 | 69 | ||
105 | 70 | // For switch statements: Tell gcc7 and clang that a fallthrough is intended | ||
106 | 71 | // https://developers.redhat.com/blog/2017/03/10/wimplicit-fallthrough-in-gcc-7/ | ||
107 | 72 | #ifdef __clang__ | ||
108 | 73 | #define FALLS_THROUGH /* Falls through */ [[clang::fallthrough]] | ||
109 | 74 | #elif __GNUC__ >= 7 | ||
110 | 75 | #define FALLS_THROUGH /* Falls through */ [[gnu::fallthrough]] | ||
111 | 76 | #else | ||
112 | 77 | #define FALLS_THROUGH /* Falls through */ | ||
113 | 78 | #endif | ||
114 | 79 | |||
115 | 70 | // disallow copying or assigning a class | 80 | // disallow copying or assigning a class |
116 | 71 | #define DISALLOW_COPY_AND_ASSIGN(TypeName) \ | 81 | #define DISALLOW_COPY_AND_ASSIGN(TypeName) \ |
117 | 72 | TypeName(const TypeName&) = delete; \ | 82 | TypeName(const TypeName&) = delete; \ |
118 | 73 | 83 | ||
119 | === modified file 'src/graphic/gl/fill_rect_program.cc' | |||
120 | --- src/graphic/gl/fill_rect_program.cc 2016-08-04 15:49:05 +0000 | |||
121 | +++ src/graphic/gl/fill_rect_program.cc 2017-06-17 14:22:37 +0000 | |||
122 | @@ -21,7 +21,7 @@ | |||
123 | 21 | 21 | ||
124 | 22 | #include <vector> | 22 | #include <vector> |
125 | 23 | 23 | ||
127 | 24 | #include "base/log.h" | 24 | #include "base/macros.h" |
128 | 25 | #include "base/wexception.h" | 25 | #include "base/wexception.h" |
129 | 26 | 26 | ||
130 | 27 | // static | 27 | // static |
131 | @@ -66,7 +66,7 @@ | |||
132 | 66 | switch (template_args.blend_mode) { | 66 | switch (template_args.blend_mode) { |
133 | 67 | case BlendMode::Subtract: | 67 | case BlendMode::Subtract: |
134 | 68 | glBlendEquation(GL_FUNC_REVERSE_SUBTRACT); | 68 | glBlendEquation(GL_FUNC_REVERSE_SUBTRACT); |
136 | 69 | /* fallthrough intended */ | 69 | FALLS_THROUGH; |
137 | 70 | case BlendMode::UseAlpha: | 70 | case BlendMode::UseAlpha: |
138 | 71 | glBlendFunc(GL_ONE, GL_ONE); | 71 | glBlendFunc(GL_ONE, GL_ONE); |
139 | 72 | break; | 72 | break; |
140 | @@ -132,7 +132,7 @@ | |||
141 | 132 | switch (template_args.blend_mode) { | 132 | switch (template_args.blend_mode) { |
142 | 133 | case BlendMode::Subtract: | 133 | case BlendMode::Subtract: |
143 | 134 | glBlendEquation(GL_FUNC_ADD); | 134 | glBlendEquation(GL_FUNC_ADD); |
145 | 135 | /* fallthrough intended */ | 135 | FALLS_THROUGH; |
146 | 136 | case BlendMode::UseAlpha: | 136 | case BlendMode::UseAlpha: |
147 | 137 | glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); | 137 | glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); |
148 | 138 | break; | 138 | break; |
149 | 139 | 139 | ||
150 | === modified file 'src/logic/CMakeLists.txt' | |||
151 | --- src/logic/CMakeLists.txt 2016-05-14 07:35:39 +0000 | |||
152 | +++ src/logic/CMakeLists.txt 2017-06-17 14:22:37 +0000 | |||
153 | @@ -4,19 +4,28 @@ | |||
154 | 4 | widelands_geometry.h | 4 | widelands_geometry.h |
155 | 5 | ) | 5 | ) |
156 | 6 | 6 | ||
158 | 7 | wl_library(logic_game_settings | 7 | wl_library(logic_game_settings |
159 | 8 | SRCS | 8 | SRCS |
160 | 9 | game_settings.cc | ||
161 | 9 | game_settings.h | 10 | game_settings.h |
162 | 11 | player_end_result.h | ||
163 | 12 | DEPENDS | ||
164 | 13 | io_filesystem | ||
165 | 14 | logic | ||
166 | 15 | scripting_lua_interface | ||
167 | 16 | scripting_lua_table | ||
168 | 17 | ) | ||
169 | 18 | |||
170 | 19 | wl_library(logic_single_player_game_settings | ||
171 | 20 | SRCS | ||
172 | 10 | single_player_game_settings_provider.cc | 21 | single_player_game_settings_provider.cc |
173 | 11 | single_player_game_settings_provider.h | 22 | single_player_game_settings_provider.h |
174 | 12 | DEPENDS | 23 | DEPENDS |
175 | 13 | ai | 24 | ai |
176 | 14 | base_exceptions | 25 | base_exceptions |
177 | 15 | io_filesystem | ||
178 | 16 | logic | 26 | logic |
182 | 17 | scripting_lua_interface | 27 | logic_game_settings |
183 | 18 | scripting_lua_table | 28 | ) |
181 | 19 | ) | ||
184 | 20 | 29 | ||
185 | 21 | wl_library(logic_game_controller | 30 | wl_library(logic_game_controller |
186 | 22 | SRCS | 31 | SRCS |
187 | @@ -28,6 +37,7 @@ | |||
188 | 28 | DEPENDS | 37 | DEPENDS |
189 | 29 | ai | 38 | ai |
190 | 30 | logic | 39 | logic |
191 | 40 | logic_game_settings | ||
192 | 31 | profile | 41 | profile |
193 | 32 | ui_basic | 42 | ui_basic |
194 | 33 | widelands_ball_of_mud | 43 | widelands_ball_of_mud |
195 | 34 | 44 | ||
196 | === modified file 'src/logic/game_controller.h' | |||
197 | --- src/logic/game_controller.h 2016-08-04 15:49:05 +0000 | |||
198 | +++ src/logic/game_controller.h 2017-06-17 14:22:37 +0000 | |||
199 | @@ -22,12 +22,12 @@ | |||
200 | 22 | 22 | ||
201 | 23 | #include <string> | 23 | #include <string> |
202 | 24 | 24 | ||
203 | 25 | #include "logic/player_end_result.h" | ||
204 | 25 | #include "logic/widelands.h" | 26 | #include "logic/widelands.h" |
205 | 26 | 27 | ||
206 | 27 | namespace Widelands { | 28 | namespace Widelands { |
207 | 28 | class Game; | 29 | class Game; |
208 | 29 | class PlayerCommand; | 30 | class PlayerCommand; |
209 | 30 | enum class PlayerEndResult : uint8_t; | ||
210 | 31 | } | 31 | } |
211 | 32 | 32 | ||
212 | 33 | /** | 33 | /** |
213 | 34 | 34 | ||
214 | === added file 'src/logic/game_settings.cc' | |||
215 | --- src/logic/game_settings.cc 1970-01-01 00:00:00 +0000 | |||
216 | +++ src/logic/game_settings.cc 2017-06-17 14:22:37 +0000 | |||
217 | @@ -0,0 +1,1 @@ | |||
218 | 1 | // Dummy to make CMake happy | ||
219 | 0 | 2 | ||
220 | === modified file 'src/logic/game_settings.h' | |||
221 | --- src/logic/game_settings.h 2016-08-04 15:49:05 +0000 | |||
222 | +++ src/logic/game_settings.h 2017-06-17 14:22:37 +0000 | |||
223 | @@ -26,14 +26,11 @@ | |||
224 | 26 | 26 | ||
225 | 27 | #include "io/filesystem/layered_filesystem.h" | 27 | #include "io/filesystem/layered_filesystem.h" |
226 | 28 | #include "logic/map_objects/tribes/tribe_basic_info.h" | 28 | #include "logic/map_objects/tribes/tribe_basic_info.h" |
227 | 29 | #include "logic/player_end_result.h" | ||
228 | 29 | #include "logic/widelands.h" | 30 | #include "logic/widelands.h" |
229 | 30 | #include "scripting/lua_interface.h" | 31 | #include "scripting/lua_interface.h" |
230 | 31 | #include "scripting/lua_table.h" | 32 | #include "scripting/lua_table.h" |
231 | 32 | 33 | ||
232 | 33 | namespace Widelands { | ||
233 | 34 | enum class PlayerEndResult : uint8_t; | ||
234 | 35 | } | ||
235 | 36 | |||
236 | 37 | struct PlayerSettings { | 34 | struct PlayerSettings { |
237 | 38 | enum State { stateOpen, stateHuman, stateComputer, stateClosed, stateShared }; | 35 | enum State { stateOpen, stateHuman, stateComputer, stateClosed, stateShared }; |
238 | 39 | 36 | ||
239 | @@ -60,6 +57,12 @@ | |||
240 | 60 | return not_connected() - 1; | 57 | return not_connected() - 1; |
241 | 61 | } | 58 | } |
242 | 62 | 59 | ||
243 | 60 | UserSettings(Widelands::PlayerEndResult init_result, bool init_ready) | ||
244 | 61 | : position(0), name(""), result(init_result), win_condition_string(""), ready(init_ready) { | ||
245 | 62 | } | ||
246 | 63 | UserSettings() : UserSettings(Widelands::PlayerEndResult::kUndefined, false) { | ||
247 | 64 | } | ||
248 | 65 | |||
249 | 63 | uint8_t position; | 66 | uint8_t position; |
250 | 64 | std::string name; | 67 | std::string name; |
251 | 65 | Widelands::PlayerEndResult result; | 68 | Widelands::PlayerEndResult result; |
252 | 66 | 69 | ||
253 | === modified file 'src/logic/map_objects/immovable.cc' | |||
254 | --- src/logic/map_objects/immovable.cc 2016-08-04 15:49:05 +0000 | |||
255 | +++ src/logic/map_objects/immovable.cc 2017-06-17 14:22:37 +0000 | |||
256 | @@ -947,7 +947,7 @@ | |||
257 | 947 | probability = value; | 947 | probability = value; |
258 | 948 | // fallthrough | 948 | // fallthrough |
259 | 949 | } | 949 | } |
261 | 950 | /* no break */ | 950 | FALLS_THROUGH; |
262 | 951 | case '\0': | 951 | case '\0': |
263 | 952 | goto end; | 952 | goto end; |
264 | 953 | default: | 953 | default: |
265 | 954 | 954 | ||
266 | === modified file 'src/logic/map_objects/tribes/production_program.cc' | |||
267 | --- src/logic/map_objects/tribes/production_program.cc 2016-09-10 16:50:51 +0000 | |||
268 | +++ src/logic/map_objects/tribes/production_program.cc 2017-06-17 14:22:37 +0000 | |||
269 | @@ -245,9 +245,8 @@ | |||
270 | 245 | "the specified ware type(s) is only %u, so the group can " | 245 | "the specified ware type(s) is only %u, so the group can " |
271 | 246 | "never be fulfilled by the site", | 246 | "never be fulfilled by the site", |
272 | 247 | count, count_max); | 247 | count, count_max); |
273 | 248 | // fallthrough | ||
274 | 249 | } | 248 | } |
276 | 250 | /* no break */ | 249 | FALLS_THROUGH; |
277 | 251 | case '\0': | 250 | case '\0': |
278 | 252 | case ' ': | 251 | case ' ': |
279 | 253 | group.second = count; | 252 | group.second = count; |
280 | 254 | 253 | ||
281 | === modified file 'src/logic/map_objects/tribes/ship.cc' | |||
282 | --- src/logic/map_objects/tribes/ship.cc 2016-09-07 09:30:49 +0000 | |||
283 | +++ src/logic/map_objects/tribes/ship.cc 2017-06-17 14:22:37 +0000 | |||
284 | @@ -274,14 +274,13 @@ | |||
285 | 274 | return; | 274 | return; |
286 | 275 | } | 275 | } |
287 | 276 | log("Oh no... this ship has no sinking animation :(!\n"); | 276 | log("Oh no... this ship has no sinking animation :(!\n"); |
289 | 277 | // fall trough | 277 | FALLS_THROUGH; |
290 | 278 | case ShipStates::kSinkAnimation: | 278 | case ShipStates::kSinkAnimation: |
291 | 279 | // The sink animation has been played, so finally remove the ship from the map | 279 | // The sink animation has been played, so finally remove the ship from the map |
292 | 280 | pop_task(game); | 280 | pop_task(game); |
293 | 281 | remove(game); | 281 | remove(game); |
294 | 282 | return; | 282 | return; |
295 | 283 | } | 283 | } |
296 | 284 | |||
297 | 285 | // if the real update function failed (e.g. nothing to transport), the ship goes idle | 284 | // if the real update function failed (e.g. nothing to transport), the ship goes idle |
298 | 286 | ship_update_idle(game, state); | 285 | ship_update_idle(game, state); |
299 | 287 | } | 286 | } |
300 | @@ -685,7 +684,7 @@ | |||
301 | 685 | return start_task_idle(game, descr().main_animation(), 1500); | 684 | return start_task_idle(game, descr().main_animation(), 1500); |
302 | 686 | } | 685 | } |
303 | 687 | } | 686 | } |
305 | 688 | 687 | FALLS_THROUGH; | |
306 | 689 | case ShipStates::kExpeditionWaiting: | 688 | case ShipStates::kExpeditionWaiting: |
307 | 690 | case ShipStates::kExpeditionPortspaceFound: | 689 | case ShipStates::kExpeditionPortspaceFound: |
308 | 691 | case ShipStates::kSinkRequest: | 690 | case ShipStates::kSinkRequest: |
309 | 692 | 691 | ||
310 | === modified file 'src/logic/mapfringeregion.cc' | |||
311 | --- src/logic/mapfringeregion.cc 2016-08-04 15:49:05 +0000 | |||
312 | +++ src/logic/mapfringeregion.cc 2017-06-17 14:22:37 +0000 | |||
313 | @@ -29,9 +29,11 @@ | |||
314 | 29 | if (area_.radius) { | 29 | if (area_.radius) { |
315 | 30 | remaining_in_phase_ = area_.radius; | 30 | remaining_in_phase_ = area_.radius; |
316 | 31 | phase_ = 6; | 31 | phase_ = 6; |
318 | 32 | } else | 32 | // Fallthrough |
319 | 33 | } else { | ||
320 | 33 | return false; | 34 | return false; |
322 | 34 | /* no break */ | 35 | } |
323 | 36 | FALLS_THROUGH; | ||
324 | 35 | case 1: | 37 | case 1: |
325 | 36 | map.get_trn(area_, &area_); | 38 | map.get_trn(area_, &area_); |
326 | 37 | break; | 39 | break; |
327 | @@ -53,6 +55,7 @@ | |||
328 | 53 | default: | 55 | default: |
329 | 54 | NEVER_HERE(); | 56 | NEVER_HERE(); |
330 | 55 | } | 57 | } |
331 | 58 | |||
332 | 56 | if (--remaining_in_phase_ == 0) { | 59 | if (--remaining_in_phase_ == 0) { |
333 | 57 | remaining_in_phase_ = area_.radius; | 60 | remaining_in_phase_ = area_.radius; |
334 | 58 | --phase_; | 61 | --phase_; |
335 | @@ -66,9 +69,11 @@ | |||
336 | 66 | if (area_.radius) { | 69 | if (area_.radius) { |
337 | 67 | remaining_in_phase_ = area_.radius; | 70 | remaining_in_phase_ = area_.radius; |
338 | 68 | phase_ = 6; | 71 | phase_ = 6; |
340 | 69 | } else | 72 | // Fallthrough |
341 | 73 | } else { | ||
342 | 70 | return false; | 74 | return false; |
344 | 71 | /* no break */ | 75 | } |
345 | 76 | FALLS_THROUGH; | ||
346 | 72 | case 1: | 77 | case 1: |
347 | 73 | map.get_trn(area_, &area_); | 78 | map.get_trn(area_, &area_); |
348 | 74 | break; | 79 | break; |
349 | @@ -90,6 +95,7 @@ | |||
350 | 90 | default: | 95 | default: |
351 | 91 | NEVER_HERE(); | 96 | NEVER_HERE(); |
352 | 92 | } | 97 | } |
353 | 98 | |||
354 | 93 | if (--remaining_in_phase_ == 0) { | 99 | if (--remaining_in_phase_ == 0) { |
355 | 94 | remaining_in_phase_ = area_.radius; | 100 | remaining_in_phase_ = area_.radius; |
356 | 95 | --phase_; | 101 | --phase_; |
357 | 96 | 102 | ||
358 | === added file 'src/logic/player_end_result.h' | |||
359 | --- src/logic/player_end_result.h 1970-01-01 00:00:00 +0000 | |||
360 | +++ src/logic/player_end_result.h 2017-06-17 14:22:37 +0000 | |||
361 | @@ -0,0 +1,27 @@ | |||
362 | 1 | /* | ||
363 | 2 | * Copyright (C) 2008-2017 by the Widelands Development Team | ||
364 | 3 | * | ||
365 | 4 | * This program is free software; you can redistribute it and/or | ||
366 | 5 | * modify it under the terms of the GNU General Public License | ||
367 | 6 | * as published by the Free Software Foundation; either version 2 | ||
368 | 7 | * of the License, or (at your option) any later version. | ||
369 | 8 | * | ||
370 | 9 | * This program is distributed in the hope that it will be useful, | ||
371 | 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
372 | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
373 | 12 | * GNU General Public License for more details. | ||
374 | 13 | * | ||
375 | 14 | * You should have received a copy of the GNU General Public License | ||
376 | 15 | * along with this program; if not, write to the Free Software | ||
377 | 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
378 | 17 | * | ||
379 | 18 | */ | ||
380 | 19 | |||
381 | 20 | #ifndef WL_LOGIC_PLAYER_END_RESULT_H | ||
382 | 21 | #define WL_LOGIC_PLAYER_END_RESULT_H | ||
383 | 22 | |||
384 | 23 | namespace Widelands { | ||
385 | 24 | enum class PlayerEndResult : uint8_t { kLost = 0, kWon = 1, kResigned = 2, kUndefined = 255 }; | ||
386 | 25 | } | ||
387 | 26 | |||
388 | 27 | #endif // end of include guard: WL_LOGIC_PLAYER_END_RESULT_H | ||
389 | 0 | 28 | ||
390 | === modified file 'src/logic/playersmanager.h' | |||
391 | --- src/logic/playersmanager.h 2016-08-04 15:49:05 +0000 | |||
392 | +++ src/logic/playersmanager.h 2017-06-17 14:22:37 +0000 | |||
393 | @@ -24,6 +24,7 @@ | |||
394 | 24 | #include <vector> | 24 | #include <vector> |
395 | 25 | 25 | ||
396 | 26 | #include "logic/constants.h" | 26 | #include "logic/constants.h" |
397 | 27 | #include "logic/player_end_result.h" | ||
398 | 27 | #include "logic/widelands.h" | 28 | #include "logic/widelands.h" |
399 | 28 | 29 | ||
400 | 29 | namespace Widelands { | 30 | namespace Widelands { |
401 | @@ -32,13 +33,6 @@ | |||
402 | 32 | class Player; | 33 | class Player; |
403 | 33 | class Player; | 34 | class Player; |
404 | 34 | 35 | ||
405 | 35 | enum class PlayerEndResult : uint8_t { | ||
406 | 36 | PLAYER_LOST = 0, | ||
407 | 37 | PLAYER_WON = 1, | ||
408 | 38 | PLAYER_RESIGNED = 2, | ||
409 | 39 | UNDEFINED = 255 | ||
410 | 40 | }; | ||
411 | 41 | |||
412 | 42 | /** | 36 | /** |
413 | 43 | * Hold data once a player left the game, or on game ends. | 37 | * Hold data once a player left the game, or on game ends. |
414 | 44 | * Allowed values for the info string, as key=value pairs separated | 38 | * Allowed values for the info string, as key=value pairs separated |
415 | 45 | 39 | ||
416 | === modified file 'src/logic/single_player_game_controller.h' | |||
417 | --- src/logic/single_player_game_controller.h 2016-08-04 15:49:05 +0000 | |||
418 | +++ src/logic/single_player_game_controller.h 2017-06-17 14:22:37 +0000 | |||
419 | @@ -22,6 +22,7 @@ | |||
420 | 22 | 22 | ||
421 | 23 | #include "ai/computer_player.h" | 23 | #include "ai/computer_player.h" |
422 | 24 | #include "logic/game_controller.h" | 24 | #include "logic/game_controller.h" |
423 | 25 | #include "logic/player_end_result.h" | ||
424 | 25 | 26 | ||
425 | 26 | class SinglePlayerGameController : public GameController { | 27 | class SinglePlayerGameController : public GameController { |
426 | 27 | public: | 28 | public: |
427 | 28 | 29 | ||
428 | === modified file 'src/network/netclient.cc' | |||
429 | --- src/network/netclient.cc 2016-08-04 15:49:05 +0000 | |||
430 | +++ src/network/netclient.cc 2017-06-17 14:22:37 +0000 | |||
431 | @@ -476,8 +476,7 @@ | |||
432 | 476 | 476 | ||
433 | 477 | // This might happen, if a users connects after the game starts. | 477 | // This might happen, if a users connects after the game starts. |
434 | 478 | if (number == d->settings.users.size()) { | 478 | if (number == d->settings.users.size()) { |
437 | 479 | UserSettings newuser; | 479 | d->settings.users.push_back(*new UserSettings()); |
436 | 480 | d->settings.users.push_back(newuser); | ||
438 | 481 | } | 480 | } |
439 | 482 | 481 | ||
440 | 483 | d->settings.users.at(number).name = packet.string(); | 482 | d->settings.users.at(number).name = packet.string(); |
441 | 484 | 483 | ||
442 | === modified file 'src/network/netclient.h' | |||
443 | --- src/network/netclient.h 2016-08-04 15:49:05 +0000 | |||
444 | +++ src/network/netclient.h 2017-06-17 14:22:37 +0000 | |||
445 | @@ -23,6 +23,7 @@ | |||
446 | 23 | #include "chat/chat.h" | 23 | #include "chat/chat.h" |
447 | 24 | #include "logic/game_controller.h" | 24 | #include "logic/game_controller.h" |
448 | 25 | #include "logic/game_settings.h" | 25 | #include "logic/game_settings.h" |
449 | 26 | #include "logic/player_end_result.h" | ||
450 | 26 | #include "network/network.h" | 27 | #include "network/network.h" |
451 | 27 | 28 | ||
452 | 28 | struct NetClientImpl; | 29 | struct NetClientImpl; |
453 | 29 | 30 | ||
454 | === modified file 'src/network/nethost.cc' | |||
455 | --- src/network/nethost.cc 2016-09-22 17:40:14 +0000 | |||
456 | +++ src/network/nethost.cc 2017-06-17 14:22:37 +0000 | |||
457 | @@ -143,7 +143,7 @@ | |||
458 | 143 | newstate = PlayerSettings::stateClosed; | 143 | newstate = PlayerSettings::stateClosed; |
459 | 144 | break; | 144 | break; |
460 | 145 | } // else fall through | 145 | } // else fall through |
462 | 146 | /* no break */ | 146 | FALLS_THROUGH; |
463 | 147 | case PlayerSettings::stateComputer: { | 147 | case PlayerSettings::stateComputer: { |
464 | 148 | const ComputerPlayer::ImplementationVector& impls = ComputerPlayer::get_implementations(); | 148 | const ComputerPlayer::ImplementationVector& impls = ComputerPlayer::get_implementations(); |
465 | 149 | ComputerPlayer::ImplementationVector::const_iterator it = impls.begin(); | 149 | ComputerPlayer::ImplementationVector::const_iterator it = impls.begin(); |
466 | @@ -1605,14 +1605,14 @@ | |||
467 | 1605 | for (uint32_t i = 0; i < d->settings.users.size(); ++i) | 1605 | for (uint32_t i = 0; i < d->settings.users.size(); ++i) |
468 | 1606 | if (d->settings.users[i].position == UserSettings::not_connected()) { | 1606 | if (d->settings.users[i].position == UserSettings::not_connected()) { |
469 | 1607 | client.usernum = i; | 1607 | client.usernum = i; |
471 | 1608 | d->settings.users[i].result = Widelands::PlayerEndResult::UNDEFINED; | 1608 | d->settings.users[i].result = Widelands::PlayerEndResult::kUndefined; |
472 | 1609 | d->settings.users[i].ready = true; | 1609 | d->settings.users[i].ready = true; |
473 | 1610 | break; | 1610 | break; |
474 | 1611 | } | 1611 | } |
475 | 1612 | if (client.usernum == -1) { | 1612 | if (client.usernum == -1) { |
476 | 1613 | client.usernum = d->settings.users.size(); | 1613 | client.usernum = d->settings.users.size(); |
477 | 1614 | UserSettings newuser; | 1614 | UserSettings newuser; |
479 | 1615 | newuser.result = Widelands::PlayerEndResult::UNDEFINED; | 1615 | newuser.result = Widelands::PlayerEndResult::kUndefined; |
480 | 1616 | newuser.ready = true; | 1616 | newuser.ready = true; |
481 | 1617 | d->settings.users.push_back(newuser); | 1617 | d->settings.users.push_back(newuser); |
482 | 1618 | } | 1618 | } |
483 | @@ -2404,7 +2404,7 @@ | |||
484 | 2404 | if (user.position == p_nr - 1) { | 2404 | if (user.position == p_nr - 1) { |
485 | 2405 | user.result = result; | 2405 | user.result = result; |
486 | 2406 | user.win_condition_string = info; | 2406 | user.win_condition_string = info; |
488 | 2407 | if (result == Widelands::PlayerEndResult::PLAYER_LOST) { | 2407 | if (result == Widelands::PlayerEndResult::kLost) { |
489 | 2408 | send_system_message_code("PLAYER_DEFEATED", user.name); | 2408 | send_system_message_code("PLAYER_DEFEATED", user.name); |
490 | 2409 | } | 2409 | } |
491 | 2410 | } | 2410 | } |
492 | 2411 | 2411 | ||
493 | === modified file 'src/network/nethost.h' | |||
494 | --- src/network/nethost.h 2016-08-04 15:49:05 +0000 | |||
495 | +++ src/network/nethost.h 2017-06-17 14:22:37 +0000 | |||
496 | @@ -22,6 +22,7 @@ | |||
497 | 22 | 22 | ||
498 | 23 | #include "logic/game_controller.h" | 23 | #include "logic/game_controller.h" |
499 | 24 | #include "logic/game_settings.h" | 24 | #include "logic/game_settings.h" |
500 | 25 | #include "logic/player_end_result.h" | ||
501 | 25 | #include "logic/widelands.h" | 26 | #include "logic/widelands.h" |
502 | 26 | #include "network/network.h" | 27 | #include "network/network.h" |
503 | 27 | 28 | ||
504 | 28 | 29 | ||
505 | === modified file 'src/scripting/CMakeLists.txt' | |||
506 | --- src/scripting/CMakeLists.txt 2016-01-18 19:35:25 +0000 | |||
507 | +++ src/scripting/CMakeLists.txt 2017-06-17 14:22:37 +0000 | |||
508 | @@ -110,6 +110,7 @@ | |||
509 | 110 | logic | 110 | logic |
510 | 111 | logic_campaign_visibility | 111 | logic_campaign_visibility |
511 | 112 | logic_game_controller | 112 | logic_game_controller |
512 | 113 | logic_game_settings | ||
513 | 113 | logic_widelands_geometry | 114 | logic_widelands_geometry |
514 | 114 | map_io | 115 | map_io |
515 | 115 | scripting_base | 116 | scripting_base |
516 | 116 | 117 | ||
517 | === modified file 'src/scripting/lua_game.cc' | |||
518 | --- src/scripting/lua_game.cc 2016-08-07 20:39:44 +0000 | |||
519 | +++ src/scripting/lua_game.cc 2017-06-17 14:22:37 +0000 | |||
520 | @@ -33,6 +33,7 @@ | |||
521 | 33 | #include "logic/objective.h" | 33 | #include "logic/objective.h" |
522 | 34 | #include "logic/path.h" | 34 | #include "logic/path.h" |
523 | 35 | #include "logic/player.h" | 35 | #include "logic/player.h" |
524 | 36 | #include "logic/player_end_result.h" | ||
525 | 36 | #include "logic/playersmanager.h" | 37 | #include "logic/playersmanager.h" |
526 | 37 | #include "scripting/globals.h" | 38 | #include "scripting/globals.h" |
527 | 38 | #include "scripting/lua_interface.h" | 39 | #include "scripting/lua_interface.h" |
528 | 39 | 40 | ||
529 | === modified file 'src/ui_basic/editbox.cc' | |||
530 | --- src/ui_basic/editbox.cc 2016-08-07 08:18:51 +0000 | |||
531 | +++ src/ui_basic/editbox.cc 2017-06-17 14:22:37 +0000 | |||
532 | @@ -219,15 +219,16 @@ | |||
533 | 219 | if (code.mod & KMOD_NUM) { | 219 | if (code.mod & KMOD_NUM) { |
534 | 220 | break; | 220 | break; |
535 | 221 | } | 221 | } |
537 | 222 | /* no break */ | 222 | FALLS_THROUGH; |
538 | 223 | case SDLK_DELETE: | 223 | case SDLK_DELETE: |
539 | 224 | if (m_->caret < m_->text.size()) { | 224 | if (m_->caret < m_->text.size()) { |
540 | 225 | while ((m_->text[++m_->caret] & 0xc0) == 0x80) { | 225 | while ((m_->text[++m_->caret] & 0xc0) == 0x80) { |
541 | 226 | }; | 226 | }; |
544 | 227 | // now handle it like Backspace | 227 | // Now fallthrough to handle it like Backspace |
545 | 228 | } else | 228 | } else { |
546 | 229 | return true; | 229 | return true; |
548 | 230 | /* no break */ | 230 | } |
549 | 231 | FALLS_THROUGH; | ||
550 | 231 | case SDLK_BACKSPACE: | 232 | case SDLK_BACKSPACE: |
551 | 232 | if (m_->caret > 0) { | 233 | if (m_->caret > 0) { |
552 | 233 | while ((m_->text[--m_->caret] & 0xc0) == 0x80) | 234 | while ((m_->text[--m_->caret] & 0xc0) == 0x80) |
553 | @@ -242,7 +243,7 @@ | |||
554 | 242 | if (code.mod & KMOD_NUM) { | 243 | if (code.mod & KMOD_NUM) { |
555 | 243 | break; | 244 | break; |
556 | 244 | } | 245 | } |
558 | 245 | /* no break */ | 246 | FALLS_THROUGH; |
559 | 246 | case SDLK_LEFT: | 247 | case SDLK_LEFT: |
560 | 247 | if (m_->caret > 0) { | 248 | if (m_->caret > 0) { |
561 | 248 | while ((m_->text[--m_->caret] & 0xc0) == 0x80) { | 249 | while ((m_->text[--m_->caret] & 0xc0) == 0x80) { |
562 | @@ -260,7 +261,7 @@ | |||
563 | 260 | if (code.mod & KMOD_NUM) { | 261 | if (code.mod & KMOD_NUM) { |
564 | 261 | break; | 262 | break; |
565 | 262 | } | 263 | } |
567 | 263 | /* no break */ | 264 | FALLS_THROUGH; |
568 | 264 | case SDLK_RIGHT: | 265 | case SDLK_RIGHT: |
569 | 265 | if (m_->caret < m_->text.size()) { | 266 | if (m_->caret < m_->text.size()) { |
570 | 266 | while ((m_->text[++m_->caret] & 0xc0) == 0x80) { | 267 | while ((m_->text[++m_->caret] & 0xc0) == 0x80) { |
571 | @@ -280,7 +281,7 @@ | |||
572 | 280 | if (code.mod & KMOD_NUM) { | 281 | if (code.mod & KMOD_NUM) { |
573 | 281 | break; | 282 | break; |
574 | 282 | } | 283 | } |
576 | 283 | /* no break */ | 284 | FALLS_THROUGH; |
577 | 284 | case SDLK_HOME: | 285 | case SDLK_HOME: |
578 | 285 | if (m_->caret != 0) { | 286 | if (m_->caret != 0) { |
579 | 286 | m_->caret = 0; | 287 | m_->caret = 0; |
580 | @@ -293,7 +294,7 @@ | |||
581 | 293 | if (code.mod & KMOD_NUM) { | 294 | if (code.mod & KMOD_NUM) { |
582 | 294 | break; | 295 | break; |
583 | 295 | } | 296 | } |
585 | 296 | /* no break */ | 297 | FALLS_THROUGH; |
586 | 297 | case SDLK_END: | 298 | case SDLK_END: |
587 | 298 | if (m_->caret != m_->text.size()) { | 299 | if (m_->caret != m_->text.size()) { |
588 | 299 | m_->caret = m_->text.size(); | 300 | m_->caret = m_->text.size(); |
589 | @@ -305,7 +306,7 @@ | |||
590 | 305 | if (code.mod & KMOD_NUM) { | 306 | if (code.mod & KMOD_NUM) { |
591 | 306 | break; | 307 | break; |
592 | 307 | } | 308 | } |
594 | 308 | /* no break */ | 309 | FALLS_THROUGH; |
595 | 309 | case SDLK_UP: | 310 | case SDLK_UP: |
596 | 310 | // Load entry from history if active and text is not empty | 311 | // Load entry from history if active and text is not empty |
597 | 311 | if (history_active_) { | 312 | if (history_active_) { |
598 | @@ -323,7 +324,7 @@ | |||
599 | 323 | if (code.mod & KMOD_NUM) { | 324 | if (code.mod & KMOD_NUM) { |
600 | 324 | break; | 325 | break; |
601 | 325 | } | 326 | } |
603 | 326 | /* no break */ | 327 | FALLS_THROUGH; |
604 | 327 | case SDLK_DOWN: | 328 | case SDLK_DOWN: |
605 | 328 | // Load entry from history if active and text is not equivalent to the current one | 329 | // Load entry from history if active and text is not equivalent to the current one |
606 | 329 | if (history_active_) { | 330 | if (history_active_) { |
607 | 330 | 331 | ||
608 | === modified file 'src/ui_basic/listselect.cc' | |||
609 | --- src/ui_basic/listselect.cc 2016-08-04 15:49:05 +0000 | |||
610 | +++ src/ui_basic/listselect.cc 2017-06-17 14:22:37 +0000 | |||
611 | @@ -454,9 +454,10 @@ | |||
612 | 454 | uint32_t selected_idx; | 454 | uint32_t selected_idx; |
613 | 455 | switch (code.sym) { | 455 | switch (code.sym) { |
614 | 456 | case SDLK_KP_2: | 456 | case SDLK_KP_2: |
616 | 457 | if (code.mod & KMOD_NUM) | 457 | if (code.mod & KMOD_NUM) { |
617 | 458 | break; | 458 | break; |
619 | 459 | /* no break */ | 459 | } |
620 | 460 | FALLS_THROUGH; | ||
621 | 460 | case SDLK_DOWN: | 461 | case SDLK_DOWN: |
622 | 461 | selected_idx = selection_index() + 1; | 462 | selected_idx = selection_index() + 1; |
623 | 462 | if (selected_idx < size()) | 463 | if (selected_idx < size()) |
624 | @@ -468,9 +469,10 @@ | |||
625 | 468 | } | 469 | } |
626 | 469 | return true; | 470 | return true; |
627 | 470 | case SDLK_KP_8: | 471 | case SDLK_KP_8: |
629 | 471 | if (code.mod & KMOD_NUM) | 472 | if (code.mod & KMOD_NUM) { |
630 | 472 | break; | 473 | break; |
632 | 473 | /* no break */ | 474 | } |
633 | 475 | FALLS_THROUGH; | ||
634 | 474 | case SDLK_UP: | 476 | case SDLK_UP: |
635 | 475 | selected_idx = selection_index(); | 477 | selected_idx = selection_index(); |
636 | 476 | if (selected_idx > 0) | 478 | if (selected_idx > 0) |
637 | 477 | 479 | ||
638 | === modified file 'src/ui_basic/multilineeditbox.cc' | |||
639 | --- src/ui_basic/multilineeditbox.cc 2016-08-07 10:10:18 +0000 | |||
640 | +++ src/ui_basic/multilineeditbox.cc 2017-06-17 14:22:37 +0000 | |||
641 | @@ -235,9 +235,10 @@ | |||
642 | 235 | // Let the panel handle the tab key | 235 | // Let the panel handle the tab key |
643 | 236 | return get_parent()->handle_key(true, code); | 236 | return get_parent()->handle_key(true, code); |
644 | 237 | case SDLK_KP_PERIOD: | 237 | case SDLK_KP_PERIOD: |
646 | 238 | if (code.mod & KMOD_NUM) | 238 | if (code.mod & KMOD_NUM) { |
647 | 239 | break; | 239 | break; |
649 | 240 | /* no break */ | 240 | } |
650 | 241 | FALLS_THROUGH; | ||
651 | 241 | case SDLK_DELETE: | 242 | case SDLK_DELETE: |
652 | 242 | if (d_->cursor_pos < d_->text.size()) { | 243 | if (d_->cursor_pos < d_->text.size()) { |
653 | 243 | d_->erase_bytes(d_->cursor_pos, d_->next_char(d_->cursor_pos)); | 244 | d_->erase_bytes(d_->cursor_pos, d_->next_char(d_->cursor_pos)); |
654 | @@ -256,7 +257,7 @@ | |||
655 | 256 | if (code.mod & KMOD_NUM) { | 257 | if (code.mod & KMOD_NUM) { |
656 | 257 | break; | 258 | break; |
657 | 258 | } | 259 | } |
659 | 259 | /* no break */ | 260 | FALLS_THROUGH; |
660 | 260 | case SDLK_LEFT: { | 261 | case SDLK_LEFT: { |
661 | 261 | if (code.mod & (KMOD_LCTRL | KMOD_RCTRL)) { | 262 | if (code.mod & (KMOD_LCTRL | KMOD_RCTRL)) { |
662 | 262 | uint32_t newpos = d_->prev_char(d_->cursor_pos); | 263 | uint32_t newpos = d_->prev_char(d_->cursor_pos); |
663 | @@ -279,7 +280,7 @@ | |||
664 | 279 | if (code.mod & KMOD_NUM) { | 280 | if (code.mod & KMOD_NUM) { |
665 | 280 | break; | 281 | break; |
666 | 281 | } | 282 | } |
668 | 282 | /* no break */ | 283 | FALLS_THROUGH; |
669 | 283 | case SDLK_RIGHT: | 284 | case SDLK_RIGHT: |
670 | 284 | if (code.mod & (KMOD_LCTRL | KMOD_RCTRL)) { | 285 | if (code.mod & (KMOD_LCTRL | KMOD_RCTRL)) { |
671 | 285 | uint32_t newpos = d_->next_char(d_->cursor_pos); | 286 | uint32_t newpos = d_->next_char(d_->cursor_pos); |
672 | @@ -297,7 +298,7 @@ | |||
673 | 297 | if (code.mod & KMOD_NUM) { | 298 | if (code.mod & KMOD_NUM) { |
674 | 298 | break; | 299 | break; |
675 | 299 | } | 300 | } |
677 | 300 | /* no break */ | 301 | FALLS_THROUGH; |
678 | 301 | case SDLK_DOWN: | 302 | case SDLK_DOWN: |
679 | 302 | if (d_->cursor_pos < d_->text.size()) { | 303 | if (d_->cursor_pos < d_->text.size()) { |
680 | 303 | d_->refresh_ww(); | 304 | d_->refresh_ww(); |
681 | @@ -326,7 +327,7 @@ | |||
682 | 326 | if (code.mod & KMOD_NUM) { | 327 | if (code.mod & KMOD_NUM) { |
683 | 327 | break; | 328 | break; |
684 | 328 | } | 329 | } |
686 | 329 | /* no break */ | 330 | FALLS_THROUGH; |
687 | 330 | case SDLK_UP: | 331 | case SDLK_UP: |
688 | 331 | if (d_->cursor_pos > 0) { | 332 | if (d_->cursor_pos > 0) { |
689 | 332 | d_->refresh_ww(); | 333 | d_->refresh_ww(); |
690 | @@ -353,7 +354,7 @@ | |||
691 | 353 | if (code.mod & KMOD_NUM) { | 354 | if (code.mod & KMOD_NUM) { |
692 | 354 | break; | 355 | break; |
693 | 355 | } | 356 | } |
695 | 356 | /* no break */ | 357 | FALLS_THROUGH; |
696 | 357 | case SDLK_HOME: | 358 | case SDLK_HOME: |
697 | 358 | if (code.mod & (KMOD_LCTRL | KMOD_RCTRL)) { | 359 | if (code.mod & (KMOD_LCTRL | KMOD_RCTRL)) { |
698 | 359 | d_->set_cursor_pos(0); | 360 | d_->set_cursor_pos(0); |
699 | @@ -371,7 +372,7 @@ | |||
700 | 371 | if (code.mod & KMOD_NUM) { | 372 | if (code.mod & KMOD_NUM) { |
701 | 372 | break; | 373 | break; |
702 | 373 | } | 374 | } |
704 | 374 | /* no break */ | 375 | FALLS_THROUGH; |
705 | 375 | case SDLK_END: | 376 | case SDLK_END: |
706 | 376 | if (code.mod & (KMOD_LCTRL | KMOD_RCTRL)) { | 377 | if (code.mod & (KMOD_LCTRL | KMOD_RCTRL)) { |
707 | 377 | d_->set_cursor_pos(d_->text.size()); | 378 | d_->set_cursor_pos(d_->text.size()); |
708 | 378 | 379 | ||
709 | === modified file 'src/ui_fsmenu/loadgame.cc' | |||
710 | --- src/ui_fsmenu/loadgame.cc 2016-09-25 12:27:22 +0000 | |||
711 | +++ src/ui_fsmenu/loadgame.cc 2017-06-17 14:22:37 +0000 | |||
712 | @@ -631,9 +631,10 @@ | |||
713 | 631 | 631 | ||
714 | 632 | switch (code.sym) { | 632 | switch (code.sym) { |
715 | 633 | case SDLK_KP_PERIOD: | 633 | case SDLK_KP_PERIOD: |
717 | 634 | if (code.mod & KMOD_NUM) | 634 | if (code.mod & KMOD_NUM) { |
718 | 635 | break; | 635 | break; |
720 | 636 | /* no break */ | 636 | } |
721 | 637 | FALLS_THROUGH; | ||
722 | 637 | case SDLK_DELETE: | 638 | case SDLK_DELETE: |
723 | 638 | clicked_delete(); | 639 | clicked_delete(); |
724 | 639 | return true; | 640 | return true; |
725 | 640 | 641 | ||
726 | === modified file 'src/wui/game_summary.cc' | |||
727 | --- src/wui/game_summary.cc 2016-08-04 15:49:05 +0000 | |||
728 | +++ src/wui/game_summary.cc 2017-06-17 14:22:37 +0000 | |||
729 | @@ -26,6 +26,7 @@ | |||
730 | 26 | #include "graphic/graphic.h" | 26 | #include "graphic/graphic.h" |
731 | 27 | #include "logic/game.h" | 27 | #include "logic/game.h" |
732 | 28 | #include "logic/player.h" | 28 | #include "logic/player.h" |
733 | 29 | #include "logic/player_end_result.h" | ||
734 | 29 | #include "logic/playersmanager.h" | 30 | #include "logic/playersmanager.h" |
735 | 30 | #include "ui_basic/box.h" | 31 | #include "ui_basic/box.h" |
736 | 31 | #include "ui_basic/button.h" | 32 | #include "ui_basic/button.h" |
737 | @@ -147,7 +148,7 @@ | |||
738 | 147 | Widelands::PlayerEndStatus pes = players_status.at(i); | 148 | Widelands::PlayerEndStatus pes = players_status.at(i); |
739 | 148 | if (ipl && pes.player == ipl->player_number()) { | 149 | if (ipl && pes.player == ipl->player_number()) { |
740 | 149 | local_in_game = true; | 150 | local_in_game = true; |
742 | 150 | local_won = pes.result == Widelands::PlayerEndResult::PLAYER_WON; | 151 | local_won = pes.result == Widelands::PlayerEndResult::kWon; |
743 | 151 | current_player_position = i; | 152 | current_player_position = i; |
744 | 152 | } | 153 | } |
745 | 153 | Widelands::Player* p = game_.get_player(pes.player); | 154 | Widelands::Player* p = game_.get_player(pes.player); |
746 | @@ -163,11 +164,11 @@ | |||
747 | 163 | // Status | 164 | // Status |
748 | 164 | std::string stat_str; | 165 | std::string stat_str; |
749 | 165 | switch (pes.result) { | 166 | switch (pes.result) { |
751 | 166 | case Widelands::PlayerEndResult::PLAYER_LOST: | 167 | case Widelands::PlayerEndResult::kLost: |
752 | 167 | /** TRANSLATORS: This is shown in the game summary for the players who have lost. */ | 168 | /** TRANSLATORS: This is shown in the game summary for the players who have lost. */ |
753 | 168 | stat_str = _("Lost"); | 169 | stat_str = _("Lost"); |
754 | 169 | break; | 170 | break; |
756 | 170 | case Widelands::PlayerEndResult::PLAYER_WON: | 171 | case Widelands::PlayerEndResult::kWon: |
757 | 171 | /** TRANSLATORS: This is shown in the game summary for the players who have won. */ | 172 | /** TRANSLATORS: This is shown in the game summary for the players who have won. */ |
758 | 172 | stat_str = _("Won"); | 173 | stat_str = _("Won"); |
759 | 173 | if (!single_won) { | 174 | if (!single_won) { |
760 | @@ -176,11 +177,11 @@ | |||
761 | 176 | teawon_ = p->team_number(); | 177 | teawon_ = p->team_number(); |
762 | 177 | } | 178 | } |
763 | 178 | break; | 179 | break; |
765 | 179 | case Widelands::PlayerEndResult::PLAYER_RESIGNED: | 180 | case Widelands::PlayerEndResult::kResigned: |
766 | 180 | /** TRANSLATORS: This is shown in the game summary for the players who have resigned. */ | 181 | /** TRANSLATORS: This is shown in the game summary for the players who have resigned. */ |
767 | 181 | stat_str = _("Resigned"); | 182 | stat_str = _("Resigned"); |
768 | 182 | break; | 183 | break; |
770 | 183 | case Widelands::PlayerEndResult::UNDEFINED: | 184 | case Widelands::PlayerEndResult::kUndefined: |
771 | 184 | /** TRANSLATORS: This is shown in the game summary when we don't know */ | 185 | /** TRANSLATORS: This is shown in the game summary when we don't know */ |
772 | 185 | /** TRANSLATORS: if the player has lost or won. */ | 186 | /** TRANSLATORS: if the player has lost or won. */ |
773 | 186 | stat_str = pgettext("player_won", "Unknown"); | 187 | stat_str = pgettext("player_won", "Unknown"); |
774 | 187 | 188 | ||
775 | === modified file 'src/wui/interactive_base.cc' | |||
776 | --- src/wui/interactive_base.cc 2016-09-25 16:45:37 +0000 | |||
777 | +++ src/wui/interactive_base.cc 2017-06-17 14:22:37 +0000 | |||
778 | @@ -774,9 +774,10 @@ | |||
779 | 774 | if (down) { | 774 | if (down) { |
780 | 775 | switch (code.sym) { | 775 | switch (code.sym) { |
781 | 776 | case SDLK_KP_9: | 776 | case SDLK_KP_9: |
783 | 777 | if (code.mod & KMOD_NUM) | 777 | if (code.mod & KMOD_NUM) { |
784 | 778 | break; | 778 | break; |
786 | 779 | /* no break */ | 779 | } |
787 | 780 | FALLS_THROUGH; | ||
788 | 780 | case SDLK_PAGEUP: | 781 | case SDLK_PAGEUP: |
789 | 781 | if (upcast(Game, game, &egbase_)) { | 782 | if (upcast(Game, game, &egbase_)) { |
790 | 782 | if (GameController* const ctrl = game->game_controller()) { | 783 | if (GameController* const ctrl = game->game_controller()) { |
791 | @@ -794,9 +795,10 @@ | |||
792 | 794 | return true; | 795 | return true; |
793 | 795 | 796 | ||
794 | 796 | case SDLK_KP_3: | 797 | case SDLK_KP_3: |
796 | 797 | if (code.mod & KMOD_NUM) | 798 | if (code.mod & KMOD_NUM) { |
797 | 798 | break; | 799 | break; |
799 | 799 | /* no break */ | 800 | } |
800 | 801 | FALLS_THROUGH; | ||
801 | 800 | case SDLK_PAGEDOWN: | 802 | case SDLK_PAGEDOWN: |
802 | 801 | if (upcast(Widelands::Game, game, &egbase_)) { | 803 | if (upcast(Widelands::Game, game, &egbase_)) { |
803 | 802 | if (GameController* const ctrl = game->game_controller()) { | 804 | if (GameController* const ctrl = game->game_controller()) { |
804 | 803 | 805 | ||
805 | === modified file 'src/wui/interactive_player.cc' | |||
806 | --- src/wui/interactive_player.cc 2016-08-04 15:49:05 +0000 | |||
807 | +++ src/wui/interactive_player.cc 2017-06-17 14:22:37 +0000 | |||
808 | @@ -320,7 +320,7 @@ | |||
809 | 320 | case SDLK_KP_7: | 320 | case SDLK_KP_7: |
810 | 321 | if (code.mod & KMOD_NUM) | 321 | if (code.mod & KMOD_NUM) |
811 | 322 | break; | 322 | break; |
813 | 323 | /* no break */ | 323 | FALLS_THROUGH; |
814 | 324 | case SDLK_HOME: | 324 | case SDLK_HOME: |
815 | 325 | move_view_to(game().map().get_starting_pos(player_number_)); | 325 | move_view_to(game().map().get_starting_pos(player_number_)); |
816 | 326 | return true; | 326 | return true; |