1 /*
2  * mape - C4 Landscape.txt editor
3  *
4  * Copyright (c) 2005-2009, Armin Burgmeier
5  *
6  * Distributed under the terms of the ISC license; see accompanying file
7  * "COPYING" for details.
8  *
9  * "Clonk" is a registered trademark of Matthes Bender, used with permission.
10  * See accompanying file "TRADEMARK" for details.
11  *
12  * To redistribute this file separately, substitute the full license texts
13  * for the above references.
14  */
15 
16 #ifndef INC_MAPE_MAPGEN_H
17 #define INC_MAPE_MAPGEN_H
18 
19 #include <glib.h>
20 #include <gdk-pixbuf/gdk-pixbuf.h>
21 
22 #include "mape/material.h"
23 #include "mape/texture.h"
24 
25 G_BEGIN_DECLS
26 
27 /**
28  * MapeMapgenError:
29  * @MAPE_MAPGEN_ERROR_COMPILE: An error occured while compiling the
30  * Landscape.txt source code.
31  * @MAPE_GROUP_ERROR_MEMORY: Insufficient memory was available to render the
32  * map.
33  *
34  * These errors are from the MAPE_MAPGEN_ERROR error domain. They can occur
35  * when rendering a map from a Landscape.txt file.
36  */
37 typedef enum _MapeMapgenError {
38   MAPE_MAPGEN_ERROR_COMPILE,
39   MAPE_MAPGEN_ERROR_MEMORY
40 } MapeMapgenError;
41 
42 /**
43  * MapeMapgenType:
44  * @MAPE_MAPGEN_NONE: Does not represent a map description.
45  * @MAPE_MAPGEN_LANDSCAPE_TXT: Represents a Landscape.txt script.
46  * @MAPE_MAPGEN_MAP_C: Represents a Map.c script.
47  *
48  * Specifies the different types of maps that can be rendered.
49  */
50 typedef enum _MapeMapgenType {
51   MAPE_MAPGEN_NONE,
52   MAPE_MAPGEN_LANDSCAPE_TXT,
53   MAPE_MAPGEN_MAP_C
54 } MapeMapgenType;
55 
56 gboolean
57 mape_mapgen_init(GError** error);
58 
59 void
60 mape_mapgen_deinit();
61 
62 void
63 mape_mapgen_set_root_group(MapeGroup* group);
64 
65 GdkPixbuf*
66 mape_mapgen_render(const gchar* filename,
67                    const gchar* source,
68                    MapeMapgenType type,
69                    const gchar* script_path,
70                    MapeMaterialMap* material_map,
71                    MapeTextureMap* texture_map,
72                    guint width,
73                    guint height,
74                    GError** error);
75 
76 G_END_DECLS
77 
78 #endif /* INC_MAPE_MAPGEN_H */
79 
80 /* vim:set et sw=2 ts=2: */
81