| 1 |
//----------------------------------------------------------------------------- |
| 2 |
// |
| 3 |
// Copyright 2017 Christoph Oelckers |
| 4 |
// |
| 5 |
// This program is free software: you can redistribute it and/or modify |
| 6 |
// it under the terms of the GNU Lesser General Public License as published by |
| 7 |
// the Free Software Foundation, either version 2 of the License, or |
| 8 |
// (at your option) any later version. |
| 9 |
// |
| 10 |
// This program is distributed in the hope that it will be useful, |
| 11 |
// but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 |
// GNU General Public License for more details. |
| 14 |
// |
| 15 |
// You should have received a copy of the GNU General Public License |
| 16 |
// along with this program. If not, see http://www.gnu.org/licenses/ |
| 17 |
// |
| 18 |
//----------------------------------------------------------------------------- |
| 19 |
|
| 20 |
#ifndef __UMAPINFO_H |
| 21 |
#define __UMAPINFO_H |
| 22 |
|
| 23 |
#ifdef __cplusplus |
| 24 |
extern "C" |
| 25 |
{ |
| 26 |
#endif |
| 27 |
|
| 28 |
struct BossAction |
| 29 |
{ |
| 30 |
int type; |
| 31 |
int special; |
| 32 |
int tag; |
| 33 |
}; |
| 34 |
|
| 35 |
struct MapEntry |
| 36 |
{ |
| 37 |
char *mapname; |
| 38 |
char *levelname; |
| 39 |
char *label; |
| 40 |
char *author; |
| 41 |
char *intertext; |
| 42 |
char *intertextsecret; |
| 43 |
char levelpic[9]; |
| 44 |
char nextmap[9]; |
| 45 |
char nextsecret[9]; |
| 46 |
char music[9]; |
| 47 |
char skytexture[9]; |
| 48 |
char endpic[9]; |
| 49 |
char exitpic[9]; |
| 50 |
char enterpic[9]; |
| 51 |
char interbackdrop[9]; |
| 52 |
char intermusic[9]; |
| 53 |
int partime; |
| 54 |
int nointermission; |
| 55 |
int numbossactions; |
| 56 |
|
| 57 |
unsigned int propertycount; |
| 58 |
struct MapProperty *properties; |
| 59 |
struct BossAction *bossactions; |
| 60 |
}; |
| 61 |
|
| 62 |
struct MapList |
| 63 |
{ |
| 64 |
unsigned int mapcount; |
| 65 |
struct MapEntry *maps; |
| 66 |
}; |
| 67 |
|
| 68 |
typedef void (*umapinfo_errorfunc)(const char *fmt, ...); // this must not return! |
| 69 |
|
| 70 |
extern struct MapList Maps; |
| 71 |
|
| 72 |
int ParseUMapInfo(const unsigned char *buffer, size_t length, umapinfo_errorfunc err); |
| 73 |
void FreeMapList(); |
| 74 |
struct MapProperty *FindProperty(struct MapEntry *map, const char *name); |
| 75 |
|
| 76 |
#ifdef __cplusplus |
| 77 |
} |
| 78 |
#endif |
| 79 |
|
| 80 |
#endif |