Skip to content

Commit

Permalink
Refactor: Began moving world domain components into the "world" names…
Browse files Browse the repository at this point in the history
…pace
  • Loading branch information
danij-deng committed Mar 30, 2016
1 parent 8780c75 commit 8fef7d1
Show file tree
Hide file tree
Showing 139 changed files with 1,910 additions and 2,147 deletions.
70 changes: 54 additions & 16 deletions doomsday/apps/api/api_map.h
Expand Up @@ -32,6 +32,50 @@
#include <de/str.h>
#include <doomsday/world/thinker.h>

#if defined __cplusplus

namespace de {

/**
* Encapsulates the arguments used when routing DMU API calls to map elements.
*/
class DmuArgs
{
public: /// @todo make private
int type;
uint prop;
int modifiers; /// Property modifiers (e.g., line of sector)
valuetype_t valueType;
dd_bool *booleanValues;
byte *byteValues;
int *intValues;
fixed_t *fixedValues;
float *floatValues;
double *doubleValues;
angle_t *angleValues;
void **ptrValues;

DmuArgs(int type, uint prop);

/**
* Read the value of an argument. Does some basic type checking so that
* incompatible types are not assigned. Simple conversions are also done,
* e.g., float to fixed.
*/
void value(valuetype_t valueType, void *dst, uint index) const;

/**
* Change the value of an argument. Does some basic type checking so that
* incompatible types are not assigned. Simple conversions are also done,
* e.g., float to fixed.
*/
void setValue(valuetype_t valueType, void const *src, uint index);
};

} // namespace de

#endif // __cplusplus

#define DMT_ARCHIVE_INDEX DDVT_INT

#define DMT_VERTEX_ORIGIN DDVT_DOUBLE
Expand Down Expand Up @@ -96,41 +140,35 @@
#if !defined __DOOMSDAY__ && !defined DENG_INTERNAL_DATA_ACCESS

// Opaque types for public use.
struct bspleaf_s;
struct convexsubspace_s;
struct bspnode_s;
struct segment_s;
struct interceptor_s;
struct line_s;
struct mobj_s;
struct material_s;
struct plane_s;
struct sector_s;
struct side_s;
struct sky_s;
struct sector_s;
struct vertex_s;
struct material_s;
struct interceptor_s;

typedef struct bspleaf_s BspLeaf;
typedef struct convexsubspace_s ConvexSubspace;
typedef struct bspnode_s BspNode;
typedef struct interceptor_s Interceptor;
typedef struct line_s Line;
typedef struct material_s Material;
typedef struct plane_s Plane;
typedef struct sector_s Sector;
typedef struct side_s Side;
typedef struct sector_s Sector;
typedef struct vertex_s Vertex;
typedef struct material_s Material;
typedef struct interceptor_s Interceptor;

#elif defined __cplusplus

// Foward declarations.
class BspLeaf;
class ConvexSubspace;
namespace world { class ConvexSubspace; }
class Interceptor;
class Line;
class Plane;
class Material;
class Sector;
class Sky;
class Vertex;

#endif

Expand Down Expand Up @@ -440,7 +478,7 @@ DENG_API_TYPEDEF(Map)
* to this will be skipped over (can be used to avoid processing a polyobj
* multiple times during a complex and/or non-linear traversal.
*/
int (*SS_BoxIterator)(AABoxd const *box, int (*callback) (ConvexSubspace *, void *), void *context);
int (*SS_BoxIterator)(AABoxd const *box, int (*callback) (struct convexsubspace_s *, void *), void *context);

// Traversers

Expand Down
2 changes: 1 addition & 1 deletion doomsday/apps/api/api_thinker.h
Expand Up @@ -28,7 +28,7 @@
#include <doomsday/world/thinker.h>

#ifdef __DOOMSDAY__
namespace de {
namespace world {
class Map;
}
#endif
Expand Down
2 changes: 1 addition & 1 deletion doomsday/apps/api/dd_share.h
Expand Up @@ -389,7 +389,7 @@ enum { /* Do NOT change the numerical values of the constants. */
#define DD_BASE_DDMOBJ_ELEMENTS() \
thinker_t thinker; /* thinker node */ \
coord_t origin[3]; /* origin [x,y,z] */ \
BspLeaf *_bspLeaf; /* BSP leaf in which this resides (if known) */
void *_bspLeaf; /* BSP leaf in which this resides (if known) */

/**
* All map think-able objects must use this as a base. Also used for sound
Expand Down
3 changes: 0 additions & 3 deletions doomsday/apps/api/dd_types.h
Expand Up @@ -55,9 +55,6 @@ typedef unsigned int nodeid_t;
/// @todo Should be a public typedef of a type defined by de::LumpIndex.
typedef int32_t lumpnum_t;

// Forward declarations for map data types.
struct polyobj_s;

#include <de/str.h>
#include <de/strutil.h>
#include <de/fixedpoint.h>
Expand Down
1 change: 0 additions & 1 deletion doomsday/apps/client/include/BiasDigest

This file was deleted.

6 changes: 3 additions & 3 deletions doomsday/apps/client/include/client/clpolymover.h
@@ -1,7 +1,7 @@
/** @file clpolymover.h Clientside polyobj mover (thinker).
*
* @authors Copyright © 2003-2013 Jaakko Keränen <jaakko.keranen@iki.fi>
* @authors Copyright © 2007-2013 Daniel Swanson <danij@dengine.net>
* @authors Copyright © 2007-2016 Daniel Swanson <danij@dengine.net>
*
* @par License
* GPL: http://www.gnu.org/licenses/gpl.html
Expand All @@ -20,9 +20,9 @@
#ifndef DENG_CLIENT_POLYMOVER_H
#define DENG_CLIENT_POLYMOVER_H

#include <doomsday/world/thinkerdata.h>
#include "api_thinker.h"
#include "Polyobj"
#include <doomsday/world/thinkerdata.h>

/**
* Polyobj movement thinker.
Expand All @@ -44,4 +44,4 @@ class ClPolyMover : public ThinkerData
static thinker_s *newThinker(Polyobj &polyobj, bool moving, bool rotating);
};

#endif // DENG_CLIENT_POLYMOVER_H
#endif // DENG_CLIENT_POLYMOVER_H
6 changes: 3 additions & 3 deletions doomsday/apps/client/include/edit_map.h
Expand Up @@ -28,12 +28,12 @@
*
* @see MPE_TakeMap()
*/
de::Map *MPE_Map();
world::Map *MPE_Map();

/**
* Take ownership of the last map built with the runtime map editing interface.
* May return @c 0 if no such map exists.
*/
de::Map *MPE_TakeMap();
world::Map *MPE_TakeMap();

#endif // DENG_WORLD_EDITMAP_H
#endif // DENG_WORLD_EDITMAP_H
11 changes: 5 additions & 6 deletions doomsday/apps/client/include/mesh.h
Expand Up @@ -81,10 +81,8 @@ class Mesh
*
* @see hasMapElement()
*/
MapElement &mapElement();

/// @copydoc mapElement()
MapElement const &mapElement() const;
world::MapElement &mapElement();
world::MapElement const &mapElement() const;

template <class MapElementType>
MapElementType &mapElementAs() {
Expand All @@ -104,10 +102,11 @@ class Mesh
*
* @see mapElement()
*/
void setMapElement(MapElement *newMapElement);
void setMapElement(world::MapElement *newMapElement);

private:
DENG2_PRIVATE(d)
Mesh *_owner = nullptr;
world::MapElement *_mapElement = nullptr; ///< Attributed MapElement (not owned).
};

public:
Expand Down
52 changes: 0 additions & 52 deletions doomsday/apps/client/include/render/biasdigest.h

This file was deleted.

0 comments on commit 8fef7d1

Please sign in to comment.