Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Jan 9, 2020
1 parent ee8d707 commit 759bb66
Show file tree
Hide file tree
Showing 27 changed files with 181 additions and 181 deletions.
20 changes: 19 additions & 1 deletion doomsday/apps/api/api_gl.h
Expand Up @@ -173,9 +173,27 @@ typedef enum blendmode_e {
} blendmode_t;

#define VALID_BLENDMODE(val) ((int)(val) >= BM_FIRST && (int)(val) <= BM_LAST)

#define NUM_BLENDMODES (10)

static inline const char *DGL_NameForBlendMode(blendmode_t mode)
{
static const char *names[1 + NUM_BLENDMODES] = {
/* invalid */ "(invalid)",
/* BM_ZEROALPHA */ "zero_alpha",
/* BM_NORMAL */ "normal",
/* BM_ADD */ "add",
/* BM_DARK */ "dark",
/* BM_SUBTRACT */ "subtract",
/* BM_REVERSE_SUBTRACT */ "reverse_subtract",
/* BM_MUL */ "mul",
/* BM_INVERSE */ "inverse",
/* BM_INVERSE_MUL */ "inverse_mul",
/* BM_ALPHA_SUBTRACT */ "alpha_subtract"
};
if (!VALID_BLENDMODE(mode)) return names[0];
return names[2 + (int) mode];
}

typedef struct dgl_vertex_s {
float xyz[4]; ///< The fourth is padding.
} dgl_vertex_t;
Expand Down
4 changes: 2 additions & 2 deletions doomsday/apps/client/include/client/cledgeloop.h
Expand Up @@ -31,13 +31,13 @@ class ClEdgeLoop
{
public:
ClEdgeLoop(ClientSubsector &owner, de::HEdge &first,
de::dint loopId = ClientSubsector::OuterLoop);
int loopId = ClientSubsector::OuterLoop);

ClientSubsector &owner() const;

de::String description() const;

de::dint loopId() const;
int loopId() const;

bool isInner() const;
bool isOuter() const;
Expand Down
30 changes: 15 additions & 15 deletions doomsday/apps/client/include/client/clientsubsector.h
Expand Up @@ -58,7 +58,7 @@ class ClientSubsector : public Subsector, public ILightSource
* Returns @c true if @a height (up-axis offset) lies above/below the ceiling/floor
* height of the subsector.
*/
bool isHeightInVoid(de::ddouble height) const;
bool isHeightInVoid(double height) const;

/**
* Determines whether the subsector has positive world volume, i.e., the height of
Expand All @@ -78,12 +78,12 @@ class ClientSubsector : public Subsector, public ILightSource
InnerLoop
};

static de::String edgeLoopIdAsText(de::dint loopId);
static de::String edgeLoopIdAsText(int loopId);

/**
* Returns the total number of EdgeLoops for the subsector.
*/
de::dint edgeLoopCount() const;
int edgeLoopCount() const;

/**
* Iterate the EdgeLoops of the subsector.
Expand All @@ -100,10 +100,10 @@ class ClientSubsector : public Subsector, public ILightSource
*/
struct AudioEnvironment
{
de::dfloat volume = 0;
de::dfloat space = 0;
de::dfloat decay = 0;
de::dfloat damping = 0;
float volume = 0;
float space = 0;
float decay = 0;
float damping = 0;

void reset() { volume = space = decay = damping = 0; }
};
Expand Down Expand Up @@ -145,13 +145,13 @@ class ClientSubsector : public Subsector, public ILightSource
* Returns the geometry Shard for the specified @a mapElement and geometry
* group identifier @a geomId; otherwise @c 0.
*/
Shard *findShard(MapElement &mapElement, de::dint geomId);
Shard *findShard(MapElement &mapElement, int geomId);

/**
* Generate/locate the geometry Shard for the specified @a mapElement and
* geometry group identifier @a geomId.
*/
Shard &shard(MapElement &mapElement, de::dint geomId);
Shard &shard(MapElement &mapElement, int geomId);

/**
* Shards owned by the Subsector should call this periodically to update
Expand Down Expand Up @@ -201,7 +201,7 @@ class ClientSubsector : public Subsector, public ILightSource
* Returns the final ambient light intensity for the source.
* @see lightSourceColorf()
*/
de::dfloat lightSourceIntensity(const de::Vec3d &viewPoint = de::Vec3d(0, 0, 0)) const override;
float lightSourceIntensity(const de::Vec3d &viewPoint = de::Vec3d(0, 0, 0)) const override;

/**
* Returns the final ambient light color and intensity for the source.
Expand All @@ -214,7 +214,7 @@ class ClientSubsector : public Subsector, public ILightSource
/**
* Returns the Z-axis bias scale factor for the light grid, block light source.
*/
de::dint blockLightSourceZBias();
int blockLightSourceZBias();

//- Sky Planes --------------------------------------------------------------------------

Expand All @@ -226,7 +226,7 @@ class ClientSubsector : public Subsector, public ILightSource
*
* @see hasSkyFloor(), hasSkyCeiling()
*/
bool hasSkyPlane(de::dint planeIndex = -1) const;
bool hasSkyPlane(int planeIndex = -1) const;

/**
* Determines whether the Surface of the @em floor plane has a sky-masked Material
Expand All @@ -251,7 +251,7 @@ class ClientSubsector : public Subsector, public ILightSource
/**
* Returns the total number of @em visual planes in the subsector.
*/
de::dint visPlaneCount() const;
int visPlaneCount() const;

/**
* Iterate the @em visual Planes of the subsector.
Expand All @@ -266,8 +266,8 @@ class ClientSubsector : public Subsector, public ILightSource
*
* @see visFloor(), visCeiling()
*/
Plane &visPlane(de::dint planeIndex);
const Plane &visPlane(de::dint planeIndex) const;
Plane &visPlane(int planeIndex);
const Plane &visPlane(int planeIndex) const;

/**
* Returns the @em visual floor Plane of the subsector.
Expand Down
18 changes: 4 additions & 14 deletions doomsday/apps/client/include/client/clskyplane.h
Expand Up @@ -18,23 +18,17 @@
* 02110-1301 USA</small>
*/

#ifndef DE_CLIENT_WORLD_CLSKYPLANE_H
#define DE_CLIENT_WORLD_CLSKYPLANE_H
#pragma once

#include <de/Observers>

namespace world {

/**
*
*/
class ClSkyPlane
{
public:
/// Notified whenever a @em height change occurs.
DE_AUDIENCE(HeightChange, void clSkyPlaneHeightChanged(ClSkyPlane &skyPlane))

ClSkyPlane(bool isCeiling = false, de::ddouble defaultHeight = 0);
ClSkyPlane(bool isCeiling = false, double defaultHeight = 0);

/**
* Returns @c true if this sky plane is configured as the "ceiling".
Expand All @@ -55,20 +49,16 @@ class ClSkyPlane
*
* @see setHeight()
*/
de::ddouble height() const;
double height() const;

/**
* Change the height of the sky plane to @a newHeight. The HeightChange audience will
* be notified if a change occurs.
*
* @see height()
*/
void setHeight(de::ddouble newHeight);
void setHeight(double newHeight);

private:
DE_PRIVATE(d)
};

} // namespace world

#endif // DE_CLIENT_WORLD_CLSKYPLANE_H
4 changes: 2 additions & 2 deletions doomsday/apps/client/include/configprofiles.h
Expand Up @@ -78,11 +78,11 @@ class ConfigProfiles : public de::Profiles
const de::String &settingName,
const de::Value & value = de::NoneValue());

inline ConfigProfiles &define(SettingType type, const de::String &settingName, de::dint value)
inline ConfigProfiles &define(SettingType type, const de::String &settingName, int value)
{
return define(type, settingName, de::NumberValue(value));
}
inline ConfigProfiles &define(SettingType type, const de::String &settingName, de::dfloat value)
inline ConfigProfiles &define(SettingType type, const de::String &settingName, float value)
{
return define(type, settingName, de::NumberValue(value));
}
Expand Down
4 changes: 0 additions & 4 deletions doomsday/apps/client/include/dd_def.h
Expand Up @@ -110,10 +110,6 @@ enum { CR, CG, CB, CA }; // Color indices.

extern float texGamma;

// tab_tables.c
extern fixed_t finesine[5 * FINEANGLES / 4];
extern fixed_t *fineCosine;

#ifdef __cplusplus
} // extern "C"
#endif
Expand Down
10 changes: 5 additions & 5 deletions doomsday/apps/client/include/dd_main.h
Expand Up @@ -36,13 +36,13 @@

namespace res { class File1; }

extern de::dint verbose;
extern de::dint isDedicated; // true if __SERVER__
extern int verbose;
extern int isDedicated; // true if __SERVER__
#ifdef __CLIENT__
extern de::dint symbolicEchoMode;
extern int symbolicEchoMode;
#endif

de::dint DD_EarlyInit();
int DD_EarlyInit();
void DD_FinishInitializationAfterWindowReady();
void DD_ConsoleRegister();

Expand Down Expand Up @@ -76,7 +76,7 @@ ClientServerWorld &App_World();
* Attempt to change the 'open' state of the console.
* @note In dedicated mode the console cannot be closed.
*/
void Con_Open(de::dint yes);
void Con_Open(int yes);

void DD_CheckTimeDemo();
void DD_UpdateEngineState();
Expand Down
2 changes: 0 additions & 2 deletions doomsday/apps/client/include/misc/r_util.h
Expand Up @@ -125,6 +125,4 @@ bool R_GenerateTexCoords(de::Vec2f &s, de::Vec2f &t, const de::Vec3d &point,
float xScale, float yScale, const de::Vec3d &v1, const de::Vec3d &v2,
const de::Mat3f &tangentMatrix);

const char *R_NameForBlendMode(blendmode_t mode);

#endif // DE_REFRESH_UTIL_H
14 changes: 7 additions & 7 deletions doomsday/apps/client/include/render/angleclipper.h
Expand Up @@ -44,7 +44,7 @@ struct AngleRange
* @c 3= @other completely contains "this".
* @c -1= No meaningful relationship.
*/
de::dint relationship(const AngleRange &other)
int relationship(const AngleRange &other)
{
if(from >= other.from && to <= other.to) return 0;
if(from >= other.from && from < other.to) return 1;
Expand Down Expand Up @@ -74,27 +74,27 @@ class AngleClipper
/**
* Returns non-zero if clipnodes cover the whole range [0..360] degrees.
*/
de::dint isFull() const;
int isFull() const;

/**
* Returns non-zero if the given map-space @param angle is @em not-yet occluded.
*/
de::dint isAngleVisible(binangle_t angle) const;
int isAngleVisible(binangle_t angle) const;

/**
* Returns non-zero if the given map-space @a point is @em not-yet occluded.
*
* @param point Map-space coordinates to test.
*/
de::dint isPointVisible(const de::Vec3d &point) const;
int isPointVisible(const de::Vec3d &point) const;

/**
* Returns non-zero if @em any portion of the given map-space, convex face geometry
* is @em not-yet occluded.
*
* @param poly Map-space convex face geometry to test.
*/
de::dint isPolyVisible(const de::Face &poly) const;
int isPolyVisible(const de::Face &poly) const;

public: // ---------------------------------------------------------------------------

Expand All @@ -107,7 +107,7 @@ class AngleClipper
* @param from
* @param to
*/
de::dint safeAddRange(binangle_t from, binangle_t to);
int safeAddRange(binangle_t from, binangle_t to);

/**
* Add a segment relative to the current viewpoint.
Expand All @@ -134,7 +134,7 @@ class AngleClipper
* @param from Map-space coordinates for the start-point.
* @param to Map-space coordinates for the end-point.
*/
de::dint checkRangeFromViewRelPoints(const de::Vec2d &from, const de::Vec2d &to);
int checkRangeFromViewRelPoints(const de::Vec2d &from, const de::Vec2d &to);

#ifdef DE_DEBUG
/**
Expand Down
44 changes: 22 additions & 22 deletions doomsday/apps/client/include/render/billboard.h
Expand Up @@ -43,16 +43,16 @@ struct drawmaskedwallparams_t
blendmode_t blendMode; ///< Blendmode to be used when drawing (two sided mid textures only)

struct wall_vertex_s {
de::dfloat pos[3]; ///< x y and z coordinates.
de::dfloat color[4];
float pos[3]; ///< x y and z coordinates.
float color[4];
} vertices[4];

de::ddouble texOffset[2];
de::dfloat texCoord[2][2]; ///< u and v coordinates.
double texOffset[2];
float texCoord[2][2]; ///< u and v coordinates.

DGLuint modTex; ///< Texture to modulate with.
de::dfloat modTexCoord[2][2]; ///< [top-left, bottom-right][x, y]
de::dfloat modColor[4];
float modTexCoord[2][2]; ///< [top-left, bottom-right][x, y]
float modColor[4];
};

void Rend_DrawMaskedWall(const drawmaskedwallparams_t &parms);
Expand All @@ -63,15 +63,15 @@ void Rend_DrawMaskedWall(const drawmaskedwallparams_t &parms);
*/
struct rendpspriteparams_t
{
de::dfloat pos[2]; ///< [X, Y] Screen-space position.
de::dfloat width;
de::dfloat height;
float pos[2]; ///< [X, Y] Screen-space position.
float width;
float height;

ClientMaterial *mat;
de::dfloat texOffset[2];
float texOffset[2];
dd_bool texFlip[2]; ///< [X, Y] Flip along the specified axis.

de::dfloat ambientColor[4];
float ambientColor[4];
de::duint vLightListIdx;
};

Expand All @@ -92,7 +92,7 @@ struct drawspriteparams_t

void Rend_DrawSprite(const vissprite_t &spr);

const de::MaterialVariantSpec &Rend_SpriteMaterialSpec(de::dint tclass = 0, de::dint tmap = 0);
const de::MaterialVariantSpec &Rend_SpriteMaterialSpec(int tclass = 0, int tmap = 0);

/**
* @defgroup rendFlareFlags Flare renderer flags
Expand All @@ -111,21 +111,21 @@ const de::MaterialVariantSpec &Rend_SpriteMaterialSpec(de::dint tclass = 0, de::
*/
struct drawflareparams_t {
de::dbyte flags; ///< @ref rendFlareFlags.
de::dint size;
de::dfloat color[3];
int size;
float color[3];
de::dbyte factor;
de::dfloat xOff;
float xOff;
DGLuint tex; ///< Flaremap if flareCustom ELSE (flaretexName id. Zero = automatical)
de::dfloat mul; ///< Flare brightness factor.
float mul; ///< Flare brightness factor.
dd_bool isDecoration;
de::dint lumIdx;
int lumIdx;
};

DE_EXTERN_C de::dint alwaysAlign;
DE_EXTERN_C de::dint spriteLight;
DE_EXTERN_C de::dint useSpriteAlpha;
DE_EXTERN_C de::dint useSpriteBlend;
DE_EXTERN_C de::dint noSpriteZWrite;
DE_EXTERN_C int alwaysAlign;
DE_EXTERN_C int spriteLight;
DE_EXTERN_C int useSpriteAlpha;
DE_EXTERN_C int useSpriteBlend;
DE_EXTERN_C int noSpriteZWrite;
DE_EXTERN_C de::dbyte noSpriteTrans;
DE_EXTERN_C de::dbyte devNoSprites;

Expand Down

0 comments on commit 759bb66

Please sign in to comment.