Skip to content

Commit

Permalink
Merge branch 'master' into cmake-build
Browse files Browse the repository at this point in the history
Conflicts:
	doomsday/apps/client/include/render/projector.h
	doomsday/apps/client/include/render/rend_dynlight.h
	doomsday/apps/client/include/render/rend_shadow.h
	doomsday/apps/client/include/render/vlight.h
	doomsday/apps/client/src/render/projector.cpp
	doomsday/apps/client/src/render/rend_dynlight.cpp
	doomsday/apps/client/src/render/rend_shadow.cpp
	doomsday/apps/client/src/render/vlight.cpp
  • Loading branch information
skyjake committed May 2, 2015
2 parents 328a88c + c7fc315 commit 112b138
Show file tree
Hide file tree
Showing 46 changed files with 3,721 additions and 4,330 deletions.
10 changes: 2 additions & 8 deletions doomsday/apps/client/client.pro
Expand Up @@ -291,18 +291,16 @@ DENG_HEADERS += \
include/render/materialcontext.h \
include/render/mobjanimator.h \
include/render/modelrenderer.h \
include/render/projector.h \
include/render/projectedtexturedata.h \
include/render/r_draw.h \
include/render/r_main.h \
include/render/r_things.h \
include/render/rend_dynlight.h \
include/render/rend_fakeradio.h \
include/render/rend_font.h \
include/render/rend_halo.h \
include/render/rend_main.h \
include/render/rend_model.h \
include/render/rend_particle.h \
include/render/rend_shadow.h \
include/render/rendpoly.h \
include/render/rendersystem.h \
include/render/shadowedge.h \
Expand All @@ -311,9 +309,9 @@ DENG_HEADERS += \
include/render/skyfixedge.h \
include/render/surfacedecorator.h \
include/render/trianglestripbuilder.h \
include/render/vectorlightdata.h \
include/render/viewports.h \
include/render/vissprite.h \
include/render/vlight.h \
include/render/vr.h \
include/render/walledge.h \
include/render/wallspec.h \
Expand Down Expand Up @@ -622,19 +620,16 @@ SOURCES += \
src/render/lumobj.cpp \
src/render/mobjanimator.cpp \
src/render/modelrenderer.cpp \
src/render/projector.cpp \
src/render/r_draw.cpp \
src/render/r_fakeradio.cpp \
src/render/r_main.cpp \
src/render/r_things.cpp \
src/render/rend_dynlight.cpp \
src/render/rend_fakeradio.cpp \
src/render/rend_font.cpp \
src/render/rend_halo.cpp \
src/render/rend_main.cpp \
src/render/rend_model.cpp \
src/render/rend_particle.cpp \
src/render/rend_shadow.cpp \
src/render/rendpoly.cpp \
src/render/rendersystem.cpp \
src/render/shadowedge.cpp \
Expand All @@ -645,7 +640,6 @@ SOURCES += \
src/render/trianglestripbuilder.cpp \
src/render/viewports.cpp \
src/render/vissprite.cpp \
src/render/vlight.cpp \
src/render/vr.cpp \
src/render/walledge.cpp \
src/render/wallspec.cpp \
Expand Down
5 changes: 0 additions & 5 deletions doomsday/apps/client/include/de_render.h
Expand Up @@ -25,23 +25,18 @@
#ifdef __CLIENT__
#include "render/viewports.h"
#include "render/lightgrid.h"
#include "render/projector.h"
#include "render/r_draw.h"
#include "render/r_main.h"
#include "render/r_things.h"
#include "render/rend_halo.h"
#include "render/rend_particle.h"
#include "render/rend_main.h"
#include "render/rend_model.h"
#include "render/rend_shadow.h"
#include "render/rend_fakeradio.h"
#include "render/rend_font.h"
#include "render/rend_dynlight.h"
#include "render/rendpoly.h"
#include "render/billboard.h"
#include "render/cameralensfx.h"
#include "render/vissprite.h"
#include "render/vlight.h"
#endif

#include "r_util.h"
Expand Down
97 changes: 45 additions & 52 deletions doomsday/apps/client/include/render/billboard.h
@@ -1,9 +1,7 @@
/** @file billboard.h Rendering billboard "sprites".
*
* @ingroup render
*
* @authors Copyright © 2003-2013 Jaakko Keränen <jaakko.keranen@iki.fi>
* @authors Copyright © 2007-2013 Daniel Swanson <danij@dengine.net>
* @authors Copyright © 2007-2015 Daniel Swanson <danij@dengine.net>
*
* @par License
* GPL: http://www.gnu.org/licenses/gpl.html
Expand All @@ -20,123 +18,118 @@
* 02110-1301 USA</small>
*/

#ifndef DENG_CLIENT_RENDER_BILLBOARD_H
#define DENG_CLIENT_RENDER_BILLBOARD_H
#ifndef CLIENT_RENDER_BILLBOARD_H
#define CLIENT_RENDER_BILLBOARD_H

#include "dd_types.h"
#include "Material"
#include "MaterialAnimator"
#include "MaterialVariantSpec"

class BspLeaf;
struct vissprite_t;

/**
* Billboard drawing arguments for a masked wall.
*
* A sort of a sprite, I guess... Masked walls must be rendered sorted with
* sprites, so no artifacts appear when sprites are seen behind masked walls.
*
* @ingroup render
*/
struct drawmaskedwallparams_t
{
MaterialAnimator *animator;
blendmode_t blendMode; ///< Blendmode to be used when drawing (two sided mid textures only)
blendmode_t blendMode; ///< Blendmode to be used when drawing (two sided mid textures only)

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

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

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

void Rend_DrawMaskedWall(drawmaskedwallparams_t const &parms);

/**
* Billboard drawing arguments for a "player" sprite (HUD sprite).
* @ingroup render
*/
struct rendpspriteparams_t
{
float pos[2]; // {X, Y} Screen-space position.
float width, height;
de::dfloat pos[2]; ///< [X, Y] Screen-space position.
de::dfloat width;
de::dfloat height;

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

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

void Rend_DrawPSprite(rendpspriteparams_t const &parms);

/**
* Billboard drawing arguments for a map entity, sprite visualization.
* @ingroup render
*/
struct drawspriteparams_t
{
// Position/Orientation/Scale
//coord_t center[3]; // The real center point.
//coord_t srvo[3]; // Short-range visual offset.
//coord_t distance; // Distance from viewer.
//dd_bool viewAligned;

// Appearance
dd_bool noZWrite;
blendmode_t blendMode;

// Material:
MaterialAnimator *matAnimator;
dd_bool matFlip[2]; ///< [S, T] Flip along the specified axis.

// Lighting/color:
//float ambientColor[4];
//uint vLightListIdx;

// Misc
BspLeaf *bspLeaf;
};

void Rend_DrawSprite(struct vissprite_s const &spr);
void Rend_DrawSprite(vissprite_t const &spr);

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

/**
* @defgroup rendFlareFlags Flare renderer flags
* @ingroup render
* @{
*/
#define RFF_NO_PRIMARY 0x1 ///< Do not draw a primary flare (aka halo).
#define RFF_NO_TURN 0x2 ///< Flares do not turn in response to viewangle/viewdir
#define RFF_NO_PRIMARY 0x1 ///< Do not draw a primary flare (aka halo).
#define RFF_NO_TURN 0x2 ///< Flares do not turn in response to viewangle/viewdir
/**@}*/

/**
* Billboard drawing arguments for a lens flare.
*
* @see H_RenderHalo()
* @ingroup render
*/
struct drawflareparams_t
{
byte flags; // @ref rendFlareFlags.
int size;
float color[3];
byte factor;
float xOff;
DGLuint tex; // Flaremap if flareCustom ELSE (flaretexName id. Zero = automatical)
float mul; // Flare brightness factor.
de::dbyte flags; ///< @ref rendFlareFlags.
de::dint size;
de::dfloat color[3];
de::dbyte factor;
de::dfloat xOff;
DGLuint tex; ///< Flaremap if flareCustom ELSE (flaretexName id. Zero = automatical)
de::dfloat mul; ///< Flare brightness factor.
dd_bool isDecoration;
int lumIdx;
de::dint lumIdx;
};

DENG_EXTERN_C int alwaysAlign;
DENG_EXTERN_C int spriteLight, useSpriteAlpha, useSpriteBlend;
DENG_EXTERN_C int noSpriteZWrite;
DENG_EXTERN_C byte noSpriteTrans;
DENG_EXTERN_C byte devNoSprites;
DENG_EXTERN_C de::dint alwaysAlign;
DENG_EXTERN_C de::dint spriteLight;
DENG_EXTERN_C de::dint useSpriteAlpha;
DENG_EXTERN_C de::dint useSpriteBlend;
DENG_EXTERN_C de::dint noSpriteZWrite;
DENG_EXTERN_C de::dbyte noSpriteTrans;
DENG_EXTERN_C de::dbyte devNoSprites;

DENG_EXTERN_C void Rend_SpriteRegister();

#endif // DENG_CLIENT_RENDER_BILLBOARD_H
#endif // CLIENT_RENDER_BILLBOARD_H
38 changes: 38 additions & 0 deletions doomsday/apps/client/include/render/projectedtexturedata.h
@@ -0,0 +1,38 @@
/** @file projectedtexturedata.h Projected texture data.
*
* @authors Copyright © 2003-2013 Jaakko Keränen <jaakko.keranen@iki.fi>
* @authors Copyright © 2006-2015 Daniel Swanson <danij@dengine.net>
*
* @par License
* GPL: http://www.gnu.org/licenses/gpl.html
*
* <small>This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version. This program is distributed in the hope that it
* will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
* Public License for more details. You should have received a copy of the GNU
* General Public License along with this program; if not, see:
* http://www.gnu.org/licenses</small>
*/

#ifndef CLIENT_RENDER_PROJECTEDTEXTUREDATA_H
#define CLIENT_RENDER_PROJECTEDTEXTUREDATA_H

#include <de/Vector>
#include "api_gl.h" // DGLuint

/**
* POD for a texture => surface projection.
* @ingroup render
*/
struct ProjectedTextureData
{
DGLuint texture;
de::Vector2f topLeft;
de::Vector2f bottomRight;
de::Vector4f color;
};

#endif // CLIENT_RENDER_PROJECTEDTEXTUREDATA_H

0 comments on commit 112b138

Please sign in to comment.