equal
deleted
inserted
replaced
1 (* |
1 (* |
2 * Hedgewars, a free turn based strategy game |
2 * Hedgewars, a free turn based strategy game |
3 * Copyright (c) 2004-2013 Andrey Korotaev <unC0Rr@gmail.com> |
3 * Copyright (c) 2004-2015 Andrey Korotaev <unC0Rr@gmail.com> |
4 * |
4 * |
5 * This program is free software; you can redistribute it and/or modify |
5 * This program is free software; you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License as published by |
6 * it under the terms of the GNU General Public License as published by |
7 * the Free Software Foundation; version 2 of the License |
7 * the Free Software Foundation; version 2 of the License |
8 * |
8 * |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 * GNU General Public License for more details. |
12 * GNU General Public License for more details. |
13 * |
13 * |
14 * You should have received a copy of the GNU General Public License |
14 * You should have received a copy of the GNU General Public License |
15 * along with this program; if not, write to the Free Software |
15 * along with this program; if not, write to the Free Software |
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA |
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
17 *) |
17 *) |
18 |
18 |
19 {$INCLUDE "options.inc"} |
19 {$INCLUDE "options.inc"} |
20 |
20 |
21 unit uDebug; |
21 unit uDebug; |
25 procedure OutError(Msg: shortstring; isFatalError: boolean); |
25 procedure OutError(Msg: shortstring; isFatalError: boolean); |
26 procedure TryDo(Assert: boolean; Msg: shortstring; isFatal: boolean); inline; |
26 procedure TryDo(Assert: boolean; Msg: shortstring; isFatal: boolean); inline; |
27 procedure SDLTry(Assert: boolean; Msg: shortstring; isFatal: boolean); |
27 procedure SDLTry(Assert: boolean; Msg: shortstring; isFatal: boolean); |
28 |
28 |
29 implementation |
29 implementation |
30 uses SDLh, uConsole, uCommands; |
30 uses SDLh, uConsole, uCommands, uConsts; |
31 |
31 |
32 procedure OutError(Msg: shortstring; isFatalError: boolean); |
32 procedure OutError(Msg: shortstring; isFatalError: boolean); |
33 begin |
33 begin |
34 WriteLnToConsole(Msg); |
34 WriteLnToConsole(Msg); |
35 if isFatalError then |
35 if isFatalError then |
|
36 begin |
36 ParseCommand('fatal ' + lastConsoleline, true); |
37 ParseCommand('fatal ' + lastConsoleline, true); |
|
38 // hint for the 'coverity' source analyzer |
|
39 // this halt is never actually reached because ParseCommands will halt first |
|
40 halt(HaltFatalError); |
|
41 end; |
37 end; |
42 end; |
38 |
43 |
39 procedure TryDo(Assert: boolean; Msg: shortstring; isFatal: boolean); |
44 procedure TryDo(Assert: boolean; Msg: shortstring; isFatal: boolean); |
40 begin |
45 begin |
41 if not Assert then |
46 if not Assert then |