/
g_defs.h
78 lines (65 loc) · 2.47 KB
/
g_defs.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/** @file g_defs.h Game definition lookup utilities.
*
* @authors Copyright © 1999-2013 Jaakko Keränen <jaakko.keranen@iki.fi>
* @authors Copyright © 2006-2013 Daniel Swanson <danij@dengine.net>
*
* @par License
* GPL: http://www.gnu.org/licenses/gpl.html
*
* <small>This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version. This program is distributed in the hope that it
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details. You should have received a copy of the GNU
* General Public License along with this program; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA</small>
*/
#ifndef LIBCOMMON_DEFINITION_UTILS_H
#define LIBCOMMON_DEFINITION_UTILS_H
#ifdef __cplusplus
#include <doomsday/uri.h>
extern "C" {
#endif
/**
* @return The default for a value (retrieved from Doomsday).
*/
int GetDefInt(char const *def, int *returnVal);
void GetDefState(char const *def, int *returnVal);
#ifdef __cplusplus
} // extern "C"
typedef void EpisodeInfo;
typedef void MapInfo;
/**
* @param id Identifier of the episode to lookup info for.
*
* @return EpisodeInfo for the specified @a id; otherwise @c 0 (not found).
*/
EpisodeInfo *P_EpisodeInfo(de::String id);
EpisodeInfo *P_CurrentEpisodeInfo();
/**
* @param mapUri Identifier of the map to lookup info for.
*
* @return MapInfo for the specified @a mapUri; otherwise @c 0 (not found).
*/
MapInfo *P_MapInfo(de::Uri const &mapUri);
MapInfo *P_CurrentMapInfo();
/**
* Translates a warp map number to unique map identifier. Always returns a valid
* map identifier.
*
* @note This should only be used where necessary for compatibility reasons as
* the "warp translation" mechanic is redundant in the context of Doomsday's
* altogether better handling of map resources and their references. Instead,
* use the map URI mechanism.
*
* @param map The warp map number to translate.
*
* @return The unique identifier of the map given a warp map number. If the map
* is not found a URI to the first available map is returned (i.e., Maps:MAP01)
*/
de::Uri P_TranslateMap(uint map);
#endif // __cplusplus
#endif // LIBCOMMON_DEFINITION_UTILS_H