1 /** @file api_map.h  Public API to the world (map) data.
2  *
3  * @ingroup world
4  *
5  * World data comprises the map and all the objects in it. The public API
6  * includes accessing and modifying map data objects via DMU.
7  *
8  * @authors Copyright © 2003-2017 Jaakko Keränen <jaakko.keranen@iki.fi>
9  * @authors Copyright © 2006-2014 Daniel Swanson <danij@dengine.net>
10  *
11  * @par License
12  * GPL: http://www.gnu.org/licenses/gpl.html
13  *
14  * <small>This program is free software; you can redistribute it and/or modify
15  * it under the terms of the GNU General Public License as published by the
16  * Free Software Foundation; either version 2 of the License, or (at your
17  * option) any later version. This program is distributed in the hope that it
18  * will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
19  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
20  * Public License for more details. You should have received a copy of the GNU
21  * General Public License along with this program; if not, write to the Free
22  * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
23  * 02110-1301 USA</small>
24  */
25 
26 #ifndef DOOMSDAY_API_MAP_H
27 #define DOOMSDAY_API_MAP_H
28 
29 #include "apis.h"
30 #include <de/aabox.h>
31 #include <de/mathutil.h>
32 #include <de/str.h>
33 #include <doomsday/world/thinker.h>
34 #include <doomsday/world/valuetype.h>
35 
36 #define DMT_ARCHIVE_INDEX DDVT_INT
37 
38 #define DMT_VERTEX_ORIGIN DDVT_DOUBLE
39 
40 #define DMT_MATERIAL_FLAGS DDVT_SHORT
41 #define DMT_MATERIAL_WIDTH DDVT_INT
42 #define DMT_MATERIAL_HEIGHT DDVT_INT
43 
44 #define DMT_SURFACE_FLAGS DDVT_INT     // SUF_ flags
45 #define DMT_SURFACE_MATERIAL DDVT_PTR
46 #define DMT_SURFACE_BLENDMODE DDVT_BLENDMODE
47 #define DMT_SURFACE_BITANGENT DDVT_FLOAT
48 #define DMT_SURFACE_TANGENT DDVT_FLOAT
49 #define DMT_SURFACE_NORMAL DDVT_FLOAT
50 #define DMT_SURFACE_OFFSET DDVT_FLOAT     // [X, Y] Planar offset to surface material origin.
51 #define DMT_SURFACE_RGBA DDVT_FLOAT    // Surface color tint
52 
53 #define DMT_PLANE_EMITTER DDVT_PTR
54 #define DMT_PLANE_SECTOR DDVT_PTR      // Owner of the plane (temp)
55 #define DMT_PLANE_HEIGHT DDVT_DOUBLE   // Current height
56 #define DMT_PLANE_GLOW DDVT_FLOAT      // Glow amount
57 #define DMT_PLANE_GLOWRGB DDVT_FLOAT   // Glow color
58 #define DMT_PLANE_TARGET DDVT_DOUBLE   // Target height
59 #define DMT_PLANE_SPEED DDVT_DOUBLE    // Move speed
60 
61 #define DMT_SECTOR_FLOORPLANE DDVT_PTR
62 #define DMT_SECTOR_CEILINGPLANE DDVT_PTR
63 
64 #define DMT_SECTOR_VALIDCOUNT DDVT_INT // if == validCount, already checked.
65 #define DMT_SECTOR_LIGHTLEVEL DDVT_FLOAT
66 #define DMT_SECTOR_RGB DDVT_FLOAT
67 #define DMT_SECTOR_MOBJLIST DDVT_PTR   // List of mobjs in the sector.
68 #define DMT_SECTOR_LINECOUNT DDVT_UINT
69 #define DMT_SECTOR_LINES DDVT_PTR
70 #define DMT_SECTOR_EMITTER DDVT_PTR
71 #define DMT_SECTOR_PLANECOUNT DDVT_UINT
72 #define DMT_SECTOR_REVERB DDVT_FLOAT
73 
74 #define DMT_SIDE_SECTOR DDVT_PTR
75 #define DMT_SIDE_LINE DDVT_PTR
76 #define DMT_SIDE_FLAGS DDVT_INT
77 #define DMT_SIDE_EMITTER DDVT_PTR
78 
79 #define DMT_LINE_SIDE DDVT_PTR
80 #define DMT_LINE_BOUNDS DDVT_PTR
81 #define DMT_LINE_V DDVT_PTR
82 #define DMT_LINE_FLAGS DDVT_INT     // Public DDLF_* flags.
83 #define DMT_LINE_SLOPETYPE DDVT_INT
84 #define DMT_LINE_VALIDCOUNT DDVT_INT
85 #define DMT_LINE_DX DDVT_DOUBLE
86 #define DMT_LINE_DY DDVT_DOUBLE
87 #define DMT_LINE_LENGTH DDVT_DOUBLE
88 
89 /**
90  * Public definitions of the internal map data pointers.  These can be
91  * accessed externally, but only as identifiers to data instances.
92  * For example, a game could use Sector to identify to sector to
93  * change with the Map Update API.
94  *
95  * Define @c DENG_INTERNAL_DATA_ACCESS if access to the internal map data
96  * structures is needed.
97  */
98 #if !defined __DOOMSDAY__ && !defined DENG_INTERNAL_DATA_ACCESS
99 
100 // Opaque types for public use.
101 struct convexsubspace_s;
102 struct interceptor_s;
103 struct line_s;
104 struct mobj_s;
105 struct material_s;
106 struct plane_s;
107 struct side_s;
108 struct sector_s;
109 struct vertex_s;
110 struct polyobj_s;
111 
112 typedef struct convexsubspace_s ConvexSubspace;
113 typedef struct interceptor_s    Interceptor;
114 typedef struct line_s           Line;
115 typedef struct material_s       world_Material;
116 typedef struct plane_s          Plane;
117 typedef struct side_s           Side;
118 typedef struct sector_s         Sector;
119 typedef struct vertex_s         Vertex;
120 
121 #elif defined __cplusplus
122 
123 // Foward declarations.
124 namespace world
125 {
126     class ConvexSubspace;
127     class Material; // libdoomsday/world
128 }
129 typedef world::Material world_Material;
130 class Interceptor;
131 class Line;
132 class Plane;
133 class Sector;
134 class Vertex;
135 
136 #endif
137 
138 /**
139  * @defgroup lineSightFlags Line Sight Flags
140  * Flags used to dictate logic within P_CheckLineSight().
141  * @ingroup apiFlags map
142  */
143 ///@{
144 #define LS_PASSLEFT            0x1 ///< Ray may cross one-sided lines from left to right.
145 #define LS_PASSOVER            0x2 ///< Ray may cross over sector ceiling height on ray-entry side.
146 #define LS_PASSUNDER           0x4 ///< Ray may cross under sector floor height on ray-entry side.
147 ///@}
148 
149 /**
150  * Describes the @em sharp coordinates of the opening between sectors which
151  * interface at a given map line. The open range is defined as the gap between
152  * foor and ceiling on the front side clipped by the floor and ceiling planes on
153  * the back side (if present).
154  */
155 typedef struct lineopening_s {
156     /// Top and bottom z of the opening.
157     float top, bottom;
158 
159     /// Distance from top to bottom.
160     float range;
161 
162     /// Z height of the lowest Plane at the opening on the X|Y axis.
163     /// @todo Does not belong here?
164     float lowFloor;
165 
166 #ifdef __cplusplus
lineopening_slineopening_s167     lineopening_s() : top(0), bottom(0), range(0), lowFloor(0) {}
168     lineopening_s(Line const &line);
169     lineopening_s &operator = (lineopening_s const &other);
170 #endif
171 } LineOpening;
172 
173 /**
174  * @defgroup pathTraverseFlags  Path Traverse Flags
175  * @ingroup apiFlags map
176  */
177 ///@{
178 #define PTF_LINE            0x1 ///< Intercept with map lines.
179 #define PTF_MOBJ            0x2 ///< Intercept with mobjs.
180 
181 /// Process all interceptable map element types.
182 #define PTF_ALL             PTF_LINE | PTF_MOBJ
183 ///@}
184 
185 typedef enum intercepttype_e {
186     ICPT_MOBJ,
187     ICPT_LINE
188 } intercepttype_t;
189 
190 typedef struct intercept_s {
191     intercepttype_t type;
192     union {
193         struct mobj_s *mobj;
194         Line *line;
195     };
196     double distance;    ///< Along trace vector as a fraction.
197     Interceptor *trace; ///< Trace which produced the intercept.
198 } Intercept;
199 
200 typedef int (*traverser_t) (Intercept const *intercept, void *context);
201 
202 /**
203  * @defgroup mobjLinkFlags Mobj Link Flags
204  * @ingroup apiFlags world
205  */
206 ///@{
207 #define MLF_SECTOR          0x1 ///< Link to map sectors.
208 #define MLF_BLOCKMAP        0x2 ///< Link in the map's mobj blockmap.
209 #define MLF_NOLINE          0x4 ///< Do not link to map lines.
210 ///@}
211 
212 /**
213  * @defgroup lineIteratorFlags Line Iterator Flags
214  * @ingroup apiFlags world
215  */
216 ///@{
217 #define LIF_SECTOR          0x1 ///< Process map lines defining sectors
218 #define LIF_POLYOBJ         0x2 ///< Process map lines defining polyobjs
219 
220 /// Process all map line types.
221 #define LIF_ALL             LIF_SECTOR | LIF_POLYOBJ
222 ///@}
223 
224 typedef void *MapElementPtr;
225 typedef void const *MapElementPtrConst;
226 
227 #ifdef __cplusplus
228 extern "C" {
229 #endif
230 
231 /// @addtogroup world
232 ///@{
233 
DENG_API_TYPEDEF(Map)234 DENG_API_TYPEDEF(Map)
235 {
236     de_api_t api;
237 
238     /**
239      * Determines whether the given @a uri references a known map.
240      */
241     dd_bool         (*Exists)(char const *uri);
242 
243     /**
244      * Determines whether the given @a uri references a known map, which, does
245      * not originate form the currently loaded game.
246      */
247     dd_bool         (*IsCustom)(char const *uri);
248 
249     /**
250      * Determines whether the given @a uri references a known map and if so returns
251      * the full path of the source file which contains it.
252      *
253      * @return  Fully qualified (i.e., absolute) path to the source file if known;
254      *          otherwise a zero-length string.
255      */
256     AutoStr        *(*SourceFile)(char const *uri);
257 
258     /**
259      * Attempt to change the current map (will be loaded if necessary) to that
260      * referenced by @a uri.
261      *
262      * @return  @c true= the current map was changed.
263      */
264     dd_bool         (*Change)(char const *uri);
265 
266     // Lines
267 
268     /**
269      * Lines and Polyobj Lines (note Polyobj Lines are iterated first).
270      *
271      * The validCount flags are used to avoid checking lines that are marked in
272      * multiple mapblocks, so increment validCount before the first call, then
273      * make one or more calls to it.
274      *
275      * @param flags  @ref lineIteratorFlags
276      */
277     int             (*L_BoxIterator)(AABoxd const *box, int flags, int (*callback) (Line *, void *), void *context);
278 
279     int             (*L_BoxOnSide)(Line *line, AABoxd const *box);
280     int             (*L_BoxOnSide_FixedPrecision)(Line *line, AABoxd const *box);
281     coord_t         (*L_PointDistance)(Line *line, coord_t const point[2], coord_t *offset);
282     coord_t         (*L_PointOnSide)(Line const *line, coord_t const point[2]);
283     int             (*L_MobjsIterator)(Line *line, int (*callback) (struct mobj_s *, void *), void *context);
284     void            (*L_Opening)(Line *line, LineOpening *opening);
285 
286     // Sectors
287 
288     /**
289      * Increment validCount before using this. 'func' is called for each mobj
290      * that is (even partly) inside the sector. This is not a 3D test, the
291      * mobjs may actually be above or under the sector.
292      *
293      * (Lovely name; actually this is a combination of SectorMobjs and
294      * a bunch of LineMobjs iterations.)
295      */
296     int             (*S_TouchingMobjsIterator)(Sector *sector, int (*callback) (struct mobj_s *, void *), void *context);
297 
298     /**
299      * Determine the Sector on the back side of the binary space partition that
300      * lies in front of the specified point within the CURRENT map's coordinate
301      * space.
302      *
303      * A valid Sector is always returned unless the BSP leaf at that point is
304      * fully degenerate (thus no sector can be determnied).
305      *
306      * Note: The point may not actually lay within the sector returned! (however,
307      * it is on the same side of the space partition!).
308      *
309      * @param x  X coordinate of the point to test.
310      * @param y  Y coordinate of the point to test.
311      *
312      * @return  Sector attributed to the BSP leaf at the specified point.
313      */
314     Sector         *(*S_AtPoint_FixedPrecision)(coord_t const point[2]);
315 
316     // Map Objects
317 
318     struct mobj_s  *(*MO_CreateXYZ)(thinkfunc_t function, coord_t x, coord_t y, coord_t z, angle_t angle, coord_t radius, coord_t height, int ddflags);
319     void            (*MO_Destroy)(struct mobj_s *mobj);
320     struct mobj_s  *(*MO_ById)(int id);
321 
322     /**
323      * @note validCount should be incremented before calling this to begin a
324      * new logical traversal. Otherwise Mobjs marked with a validCount equal
325      * to this will be skipped over (can be used to avoid processing a mobj
326      * multiple times during a complex and/or non-linear traversal.
327      */
328     int             (*MO_BoxIterator)(AABoxd const *box, int (*callback) (struct mobj_s *, void *), void *context);
329 
330     /**
331      * @param statenum  Must be a valid state (not null!).
332      */
333     void            (*MO_SetState)(struct mobj_s *mobj, int statenum);
334 
335     /**
336      * To be called after a move, to link the mobj back into the world.
337      *
338      * @param mobj   Mobj instance.
339      * @param flags  @ref mobjLinkFlags
340      */
341     void            (*MO_Link)(struct mobj_s *mobj, int flags);
342 
343     /**
344      * Unlinks a mobj from the world so that it can be moved.
345      *
346      * @param mobj   Mobj instance.
347      */
348     void            (*MO_Unlink)(struct mobj_s *mobj);
349 
350     void            (*MO_SpawnDamageParticleGen)(struct mobj_s const *mobj, struct mobj_s const *inflictor, int amount);
351 
352     /**
353      * The callback function will be called once for each line that crosses
354      * trough the object. This means all the lines will be two-sided.
355      */
356     int             (*MO_LinesIterator)(struct mobj_s *mobj, int (*callback) (Line *, void *), void *context);
357 
358     /**
359      * Increment validCount before calling this routine. The callback function
360      * will be called once for each sector the mobj is touching (totally or
361      * partly inside). This is not a 3D check; the mobj may actually reside
362      * above or under the sector.
363      */
364     int             (*MO_SectorsIterator)(struct mobj_s *mobj, int (*callback) (Sector *, void *), void *context);
365 
366     /**
367      * Calculate the visible @a origin of @a mobj in world space, including
368      * any short range offset.
369      */
370     void            (*MO_OriginSmoothed)(struct mobj_s *mobj, coord_t origin[3]);
371     angle_t         (*MO_AngleSmoothed)(struct mobj_s *mobj);
372 
373     /**
374      * Returns the sector attributed to the BSP leaf in which the mobj's origin
375      * currently falls. If the mobj is not yet linked then @c 0 is returned.
376      *
377      * Note: The mobj is necessarily within the bounds of the sector!
378      *
379      * @param mobj  Mobj instance.
380      */
381     Sector         *(*MO_Sector)(struct mobj_s const *mobj);
382 
383     // Polyobjs
384 
385     dd_bool         (*PO_MoveXY)(struct polyobj_s *po, coord_t x, coord_t y);
386 
387     /**
388      * Rotate @a polyobj in the map coordinate space.
389      */
390     dd_bool         (*PO_Rotate)(struct polyobj_s *po, angle_t angle);
391 
392     /**
393      * Link @a polyobj to the current map. To be called after moving, rotating
394      * or any other translation of the Polyobj within the map.
395      */
396     void            (*PO_Link)(struct polyobj_s *po);
397 
398     /**
399      * Unlink @a polyobj from the current map. To be called prior to moving,
400      * rotating or any other translation of the Polyobj within the map.
401      */
402     void            (*PO_Unlink)(struct polyobj_s *po);
403 
404     /**
405      * Returns a pointer to the first Line in the polyobj.
406      */
407     Line           *(*PO_FirstLine)(struct polyobj_s *po);
408 
409     /**
410      * Lookup a Polyobj on the current map by unique ID.
411      *
412      * @param id  Unique identifier of the Polyobj to be found.
413      * @return  Found Polyobj instance else @c NULL.
414      */
415     struct polyobj_s *(*PO_ById)(int id);
416 
417     /**
418      * Lookup a Polyobj on the current map by tag.
419      *
420      * @param tag  Tag associated with the Polyobj to be found.
421      * @return  Found Polyobj instance, or @c NULL.
422      */
423     struct polyobj_s *(*PO_ByTag)(int tag);
424 
425     /**
426      * @note validCount should be incremented before calling this to begin a
427      * new logical traversal. Otherwise Polyobjs marked with a validCount equal
428      * to this will be skipped over (can be used to avoid processing a polyobj
429      * multiple times during a complex and/or non-linear traversal.
430      */
431     int             (*PO_BoxIterator)(AABoxd const *box, int (*callback) (struct polyobj_s *, void *), void *context);
432 
433     /**
434      * The po_callback is called when a (any) polyobj hits a mobj.
435      */
436     void            (*PO_SetCallback)(void (*func)(struct mobj_s *, void *, void *));
437 
438     /**
439      * @note validCount should be incremented before calling this to begin a
440      * new logical traversal. Otherwise Polyobjs marked with a validCount equal
441      * to this will be skipped over (can be used to avoid processing a polyobj
442      * multiple times during a complex and/or non-linear traversal.
443      */
444     int             (*SS_BoxIterator)(AABoxd const *box, int (*callback) (struct convexsubspace_s *, void *), void *context);
445 
446     // Traversers
447 
448     int             (*PathTraverse)(coord_t const from[2], coord_t const to[2], traverser_t callback, void *context);
449     int             (*PathTraverse2)(coord_t const from[2], coord_t const to[2], int flags, traverser_t callback, void *context);
450 
451     /**
452      * Traces a line of sight.
453      *
454      * @param from          World position, trace origin coordinates.
455      * @param to            World position, trace target coordinates.
456      * @param bottomSlope   Lower limit to the Z axis angle/slope range.
457      * @param topSlope      Upper limit to the Z axis angle/slope range.
458      * @param flags         @ref lineSightFlags dictate trace behavior/logic.
459      *
460      * @return  @c true if the traverser function returns @c true for all
461      *          visited lines.
462      */
463     dd_bool         (*CheckLineSight)(coord_t const from[3], coord_t const to[3],
464                                       coord_t bottomSlope, coord_t topSlope, int flags);
465 
466     /**
467      * Provides read-only access to the origin in map space for the given @a trace.
468      */
469     coord_t const * (*I_Origin)(Interceptor const *trace);
470 
471     /**
472      * Provides read-only access to the direction in map space for the given @a trace.
473      */
474     coord_t const * (*I_Direction)(Interceptor const *trace);
475 
476     /**
477      * Provides read-only access to the line opening state for the given @a trace.
478      */
479     LineOpening const *(*I_Opening)(Interceptor const *trace);
480 
481     /**
482      * Update the "opening" state for the specified @a trace in accordance with
483      * the heights defined by the minimal planes which intercept @a line.
484      *
485      * @return  @c true iff after the adjustment the opening range is positive,
486      * i.e., the top Z coordinate is greater than the bottom Z.
487      */
488     dd_bool         (*I_AdjustOpening)(Interceptor *trace, Line *line);
489 
490     /*
491      * Map Updates (DMU):
492      *
493      * The Map Update API is used for accessing and making changes to map data
494      * during gameplay. From here, the relevant engine's subsystems will be
495      * notified of changes in the map data they use, thus allowing them to
496      * update their status whenever needed.
497      */
498 
499     /**
500      * Translate a DMU element/property constant to a string. Primarily intended
501      * for error/debug messages.
502      */
503     char const     *(*Str)(uint prop);
504 
505     /**
506      * Determines the type of the map data object.
507      *
508      * @param ptr  Pointer to a map data object.
509      */
510     int             (*GetType)(MapElementPtrConst ptr);
511 
512     /**
513      * Convert a pointer to DMU object to an element index.
514      */
515     int             (*ToIndex)(MapElementPtrConst ptr);
516 
517     /**
518      * Convert an element index to a DMU object pointer.
519      */
520     void           *(*ToPtr)(int type, int index);
521 
522     /**
523      * Returns the total number of DMU objects of @a type. For example, if the
524      * type is @c DMU_LINE then the total number of map Lines is returned.
525      */
526     int             (*Count)(int type);
527 
528     /**
529      * Call a callback function on a selecton of DMU objects specified with an
530      * object type and element index.
531      *
532      * @param type          DMU type for selected object(s).
533      * @param index         Index of the selected object(s).
534      * @param callback      Function to be called for each object.
535      * @param context       Data context pointer passed to the callback.
536      *
537      * @return  @c =false if all callbacks return @c false. If a non-zero value
538      * is returned by the callback function, iteration is aborted immediately
539      * and the value returned by the callback is returned.
540      */
541     int             (*Callback)(int type, int index, int (*callback)(MapElementPtr p, void *context), void *context);
542 
543     /**
544      * @ref Callback() alternative where the set of selected objects is instead
545      * specified with an object type and element @a pointer. Behavior and function
546      * are otherwise identical.
547      *
548      * @param type          DMU type for selected object(s).
549      * @param pointer       DMU element pointer to make callback(s) for.
550      * @param callback      Function to be called for each object.
551      * @param context       Data context pointer passed to the callback.
552      *
553      * @return  @c =false if all callbacks return @c false. If a non-zero value
554      * is returned by the callback function, iteration is aborted immediately
555      * and the value returned by the callback is returned.
556      */
557     int             (*Callbackp)(int type, MapElementPtr pointer, int (*callback)(MapElementPtr p, void *context), void *context);
558 
559     /**
560      * An efficient alternative mechanism for iterating a selection of sub-objects
561      * and performing a callback on each.
562      *
563      * @param pointer       DMU object to iterate sub-objects of.
564      * @param prop          DMU property type identifying the sub-objects to iterate.
565      * @param callback      Function to be called for each object.
566      * @param context       Data context pointer passsed to the callback.
567      *
568      * @return  @c =false if all callbacks return @c false. If a non-zero value
569      * is returned by the callback function, iteration is aborted immediately
570      * and the value returned by the callback is returned.
571      */
572     int             (*Iteratep)(MapElementPtr pointer, uint prop, int (*callback) (MapElementPtr p, void *context), void *context);
573 
574     /**
575      * Allocates a new dummy object.
576      *
577      * @param type          DMU type of the dummy object.
578      * @param extraData     Extra data pointer of the dummy. Points to
579      *                      caller-allocated memory area of extra data for the
580      *                      dummy.
581      */
582     MapElementPtr   (*AllocDummy)(int type, void *extraData);
583 
584     /**
585      * Frees a dummy object.
586      */
587     void            (*FreeDummy)(MapElementPtr dummy);
588 
589     /**
590      * Determines if a map data object is a dummy.
591      */
592     dd_bool         (*IsDummy)(MapElementPtrConst dummy);
593 
594     /**
595      * Returns the extra data pointer of the dummy, or NULL if the object is not
596      * a dummy object.
597      */
598     void           *(*DummyExtraData)(MapElementPtr dummy);
599 
600     // Map Entities
601     uint            (*CountMapObjs)(int entityId);
602 
603     /* index-based write functions */
604     void            (*SetBool)(int type, int index, uint prop, dd_bool param);
605     void            (*SetByte)(int type, int index, uint prop, byte param);
606     void            (*SetInt)(int type, int index, uint prop, int param);
607     void            (*SetFixed)(int type, int index, uint prop, fixed_t param);
608     void            (*SetAngle)(int type, int index, uint prop, angle_t param);
609     void            (*SetFloat)(int type, int index, uint prop, float param);
610     void            (*SetDouble)(int type, int index, uint prop, double param);
611     void            (*SetPtr)(int type, int index, uint prop, void *param);
612 
613     void            (*SetBoolv)(int type, int index, uint prop, dd_bool *params);
614     void            (*SetBytev)(int type, int index, uint prop, byte *params);
615     void            (*SetIntv)(int type, int index, uint prop, int *params);
616     void            (*SetFixedv)(int type, int index, uint prop, fixed_t *params);
617     void            (*SetAnglev)(int type, int index, uint prop, angle_t *params);
618     void            (*SetFloatv)(int type, int index, uint prop, float *params);
619     void            (*SetDoublev)(int type, int index, uint prop, double *params);
620     void            (*SetPtrv)(int type, int index, uint prop, void *params);
621 
622     /* pointer-based write functions */
623     void            (*SetBoolp)(MapElementPtr ptr, uint prop, dd_bool param);
624     void            (*SetBytep)(MapElementPtr ptr, uint prop, byte param);
625     void            (*SetIntp)(MapElementPtr ptr, uint prop, int param);
626     void            (*SetFixedp)(MapElementPtr ptr, uint prop, fixed_t param);
627     void            (*SetAnglep)(MapElementPtr ptr, uint prop, angle_t param);
628     void            (*SetFloatp)(MapElementPtr ptr, uint prop, float param);
629     void            (*SetDoublep)(MapElementPtr ptr, uint prop, double param);
630     void            (*SetPtrp)(MapElementPtr ptr, uint prop, void* param);
631 
632     void            (*SetBoolpv)(MapElementPtr ptr, uint prop, dd_bool *params);
633     void            (*SetBytepv)(MapElementPtr ptr, uint prop, byte *params);
634     void            (*SetIntpv)(MapElementPtr ptr, uint prop, int *params);
635     void            (*SetFixedpv)(MapElementPtr ptr, uint prop, fixed_t *params);
636     void            (*SetAnglepv)(MapElementPtr ptr, uint prop, angle_t *params);
637     void            (*SetFloatpv)(MapElementPtr ptr, uint prop, float *params);
638     void            (*SetDoublepv)(MapElementPtr ptr, uint prop, double *params);
639     void            (*SetPtrpv)(MapElementPtr ptr, uint prop, void *params);
640 
641     /* index-based read functions */
642     dd_bool         (*GetBool)(int type, int index, uint prop);
643     byte            (*GetByte)(int type, int index, uint prop);
644     int             (*GetInt)(int type, int index, uint prop);
645     fixed_t         (*GetFixed)(int type, int index, uint prop);
646     angle_t         (*GetAngle)(int type, int index, uint prop);
647     float           (*GetFloat)(int type, int index, uint prop);
648     double          (*GetDouble)(int type, int index, uint prop);
649     void*           (*GetPtr)(int type, int index, uint prop);
650 
651     void            (*GetBoolv)(int type, int index, uint prop, dd_bool *params);
652     void            (*GetBytev)(int type, int index, uint prop, byte *params);
653     void            (*GetIntv)(int type, int index, uint prop, int *params);
654     void            (*GetFixedv)(int type, int index, uint prop, fixed_t *params);
655     void            (*GetAnglev)(int type, int index, uint prop, angle_t *params);
656     void            (*GetFloatv)(int type, int index, uint prop, float *params);
657     void            (*GetDoublev)(int type, int index, uint prop, double *params);
658     void            (*GetPtrv)(int type, int index, uint prop, void *params);
659 
660     /* pointer-based read functions */
661     dd_bool         (*GetBoolp)(MapElementPtr ptr, uint prop);
662     byte            (*GetBytep)(MapElementPtr ptr, uint prop);
663     int             (*GetIntp)(MapElementPtr ptr, uint prop);
664     fixed_t         (*GetFixedp)(MapElementPtr ptr, uint prop);
665     angle_t         (*GetAnglep)(MapElementPtr ptr, uint prop);
666     float           (*GetFloatp)(MapElementPtr ptr, uint prop);
667     double          (*GetDoublep)(MapElementPtr ptr, uint prop);
668     void*           (*GetPtrp)(MapElementPtr ptr, uint prop);
669 
670     void            (*GetBoolpv)(MapElementPtr ptr, uint prop, dd_bool *params);
671     void            (*GetBytepv)(MapElementPtr ptr, uint prop, byte *params);
672     void            (*GetIntpv)(MapElementPtr ptr, uint prop, int *params);
673     void            (*GetFixedpv)(MapElementPtr ptr, uint prop, fixed_t *params);
674     void            (*GetAnglepv)(MapElementPtr ptr, uint prop, angle_t *params);
675     void            (*GetFloatpv)(MapElementPtr ptr, uint prop, float *params);
676     void            (*GetDoublepv)(MapElementPtr ptr, uint prop, double *params);
677     void            (*GetPtrpv)(MapElementPtr ptr, uint prop, void *params);
678 }
679 DENG_API_T(Map);
680 
681 #ifndef DENG_NO_API_MACROS_MAP
682 #define P_MapExists                         _api_Map.Exists
683 #define P_MapIsCustom                       _api_Map.IsCustom
684 #define P_MapSourceFile                     _api_Map.SourceFile
685 #define P_MapChange                         _api_Map.Change
686 
687 #define Line_BoxIterator                    _api_Map.L_BoxIterator
688 #define Line_BoxOnSide                      _api_Map.L_BoxOnSide
689 #define Line_BoxOnSide_FixedPrecision       _api_Map.L_BoxOnSide_FixedPrecision
690 #define Line_PointDistance                  _api_Map.L_PointDistance
691 #define Line_PointOnSide                    _api_Map.L_PointOnSide
692 #define Line_TouchingMobjsIterator          _api_Map.L_MobjsIterator
693 #define Line_Opening                        _api_Map.L_Opening
694 
695 #define Sector_TouchingMobjsIterator        _api_Map.S_TouchingMobjsIterator
696 #define Sector_AtPoint_FixedPrecision       _api_Map.S_AtPoint_FixedPrecision
697 
698 #define Mobj_CreateXYZ                      _api_Map.MO_CreateXYZ
699 #define Mobj_Destroy                        _api_Map.MO_Destroy
700 #define Mobj_ById                           _api_Map.MO_ById
701 #define Mobj_BoxIterator                    _api_Map.MO_BoxIterator
702 #define Mobj_SetState                       _api_Map.MO_SetState
703 #define Mobj_Link                           _api_Map.MO_Link
704 #define Mobj_Unlink                         _api_Map.MO_Unlink
705 #define Mobj_SpawnDamageParticleGen         _api_Map.MO_SpawnDamageParticleGen
706 #define Mobj_TouchedLinesIterator           _api_Map.MO_LinesIterator
707 #define Mobj_TouchedSectorsIterator         _api_Map.MO_SectorsIterator
708 #define Mobj_AngleSmoothed                  _api_Map.MO_AngleSmoothed
709 #define Mobj_OriginSmoothed                 _api_Map.MO_OriginSmoothed
710 #define Mobj_Sector                         _api_Map.MO_Sector
711 
712 #define Polyobj_MoveXY                      _api_Map.PO_MoveXY
713 #define Polyobj_Rotate                      _api_Map.PO_Rotate
714 #define Polyobj_Link                        _api_Map.PO_Link
715 #define Polyobj_Unlink                      _api_Map.PO_Unlink
716 #define Polyobj_FirstLine                   _api_Map.PO_FirstLine
717 #define Polyobj_ById                        _api_Map.PO_ById
718 #define Polyobj_ByTag                       _api_Map.PO_ByTag
719 #define Polyobj_BoxIterator                 _api_Map.PO_BoxIterator
720 #define Polyobj_SetCallback                 _api_Map.PO_SetCallback
721 
722 #define Subspace_BoxIterator                _api_Map.SS_BoxIterator
723 
724 #define P_PathTraverse                      _api_Map.PathTraverse
725 #define P_PathTraverse2                     _api_Map.PathTraverse2
726 #define P_CheckLineSight                    _api_Map.CheckLineSight
727 
728 #define Interceptor_Origin                  _api_Map.I_Origin
729 #define Interceptor_Direction               _api_Map.I_Direction
730 #define Interceptor_Opening                 _api_Map.I_Opening
731 #define Interceptor_AdjustOpening           _api_Map.I_AdjustOpening
732 
733 #define DMU_Str                             _api_Map.Str
734 #define DMU_GetType                         _api_Map.GetType
735 #define P_ToIndex                           _api_Map.ToIndex
736 #define P_ToPtr                             _api_Map.ToPtr
737 #define P_Count                             _api_Map.Count
738 #define P_Callback                          _api_Map.Callback
739 #define P_Callbackp                         _api_Map.Callbackp
740 #define P_Iteratep                          _api_Map.Iteratep
741 #define P_AllocDummy                        _api_Map.AllocDummy
742 #define P_FreeDummy                         _api_Map.FreeDummy
743 #define P_IsDummy                           _api_Map.IsDummy
744 #define P_DummyExtraData                    _api_Map.DummyExtraData
745 #define P_CountMapObjs                      _api_Map.CountMapObjs
746 #define P_SetBool                           _api_Map.SetBool
747 #define P_SetByte                           _api_Map.SetByte
748 #define P_SetInt                            _api_Map.SetInt
749 #define P_SetFixed                          _api_Map.SetFixed
750 #define P_SetAngle                          _api_Map.SetAngle
751 #define P_SetFloat                          _api_Map.SetFloat
752 #define P_SetDouble                         _api_Map.SetDouble
753 #define P_SetPtr                            _api_Map.SetPtr
754 #define P_SetBoolv                          _api_Map.SetBoolv
755 #define P_SetBytev                          _api_Map.SetBytev
756 #define P_SetIntv                           _api_Map.SetIntv
757 #define P_SetFixedv                         _api_Map.SetFixedv
758 #define P_SetAnglev                         _api_Map.SetAnglev
759 #define P_SetFloatv                         _api_Map.SetFloatv
760 #define P_SetDoublev                        _api_Map.SetDoublev
761 #define P_SetPtrv                           _api_Map.SetPtrv
762 #define P_SetBoolp                          _api_Map.SetBoolp
763 #define P_SetBytep                          _api_Map.SetBytep
764 #define P_SetIntp                           _api_Map.SetIntp
765 #define P_SetFixedp                         _api_Map.SetFixedp
766 #define P_SetAnglep                         _api_Map.SetAnglep
767 #define P_SetFloatp                         _api_Map.SetFloatp
768 #define P_SetDoublep                        _api_Map.SetDoublep
769 #define P_SetPtrp                           _api_Map.SetPtrp
770 #define P_SetBoolpv                         _api_Map.SetBoolpv
771 #define P_SetBytepv                         _api_Map.SetBytepv
772 #define P_SetIntpv                          _api_Map.SetIntpv
773 #define P_SetFixedpv                        _api_Map.SetFixedpv
774 #define P_SetAnglepv                        _api_Map.SetAnglepv
775 #define P_SetFloatpv                        _api_Map.SetFloatpv
776 #define P_SetDoublepv                       _api_Map.SetDoublepv
777 #define P_SetPtrpv                          _api_Map.SetPtrpv
778 #define P_GetBool                           _api_Map.GetBool
779 #define P_GetByte                           _api_Map.GetByte
780 #define P_GetInt                            _api_Map.GetInt
781 #define P_GetFixed                          _api_Map.GetFixed
782 #define P_GetAngle                          _api_Map.GetAngle
783 #define P_GetFloat                          _api_Map.GetFloat
784 #define P_GetDouble                         _api_Map.GetDouble
785 #define P_GetPtr                            _api_Map.GetPtr
786 #define P_GetBoolv                          _api_Map.GetBoolv
787 #define P_GetBytev                          _api_Map.GetBytev
788 #define P_GetIntv                           _api_Map.GetIntv
789 #define P_GetFixedv                         _api_Map.GetFixedv
790 #define P_GetAnglev                         _api_Map.GetAnglev
791 #define P_GetFloatv                         _api_Map.GetFloatv
792 #define P_GetDoublev                        _api_Map.GetDoublev
793 #define P_GetPtrv                           _api_Map.GetPtrv
794 #define P_GetBoolp                          _api_Map.GetBoolp
795 #define P_GetBytep                          _api_Map.GetBytep
796 #define P_GetIntp                           _api_Map.GetIntp
797 #define P_GetFixedp                         _api_Map.GetFixedp
798 #define P_GetAnglep                         _api_Map.GetAnglep
799 #define P_GetFloatp                         _api_Map.GetFloatp
800 #define P_GetDoublep                        _api_Map.GetDoublep
801 #define P_GetPtrp                           _api_Map.GetPtrp
802 #define P_GetBoolpv                         _api_Map.GetBoolpv
803 #define P_GetBytepv                         _api_Map.GetBytepv
804 #define P_GetIntpv                          _api_Map.GetIntpv
805 #define P_GetFixedpv                        _api_Map.GetFixedpv
806 #define P_GetAnglepv                        _api_Map.GetAnglepv
807 #define P_GetFloatpv                        _api_Map.GetFloatpv
808 #define P_GetDoublepv                       _api_Map.GetDoublepv
809 #define P_GetPtrpv                          _api_Map.GetPtrpv
810 #endif
811 
812 #ifdef __DOOMSDAY__
813 DENG_USING_API(Map);
814 #endif
815 
816 ///@}
817 
818 #ifdef __cplusplus
819 } // extern "C"
820 #endif
821 
822 #endif // DOOMSDAY_API_MAP_H
823