Skip to content

Commit

Permalink
Merge branch 'master' into separate-server
Browse files Browse the repository at this point in the history
Conflicts:
	doomsday/engine/src/map/r_world.cpp
	doomsday/engine/src/network/net_main.c
	doomsday/engine/src/render/rend_main.cpp
	doomsday/engine/src/resource/material.cpp
	doomsday/engine/src/resource/materials.cpp
  • Loading branch information
skyjake committed Dec 23, 2012
2 parents 8594170 + 883476d commit 9858a72
Show file tree
Hide file tree
Showing 42 changed files with 2,241 additions and 2,593 deletions.
12 changes: 7 additions & 5 deletions doomsday/engine/engine.pro
Expand Up @@ -297,6 +297,7 @@ DENG_HEADERS += \
include/resource/lumpcache.h \
include/resource/material.h \
include/resource/materials.h \
include/resource/materialsnapshot.h \
include/resource/materialvariant.h \
include/resource/models.h \
include/resource/patch.h \
Expand Down Expand Up @@ -530,7 +531,7 @@ SOURCES += \
src/map/plane.c \
src/map/polyobj.c \
src/map/propertyvalue.cpp \
src/map/r_world.c \
src/map/r_world.cpp \
src/map/sector.c \
src/map/sidedef.c \
src/map/surface.c \
Expand All @@ -556,14 +557,14 @@ SOURCES += \
src/render/r_things.cpp \
src/render/rend_bias.c \
src/render/rend_clip.cpp \
src/render/rend_console.c \
src/render/rend_console.cpp \
src/render/rend_decor.c \
src/render/rend_dynlight.c \
src/render/rend_fakeradio.c \
src/render/rend_fakeradio.cpp \
src/render/rend_font.c \
src/render/rend_halo.c \
src/render/rend_list.c \
src/render/rend_main.c \
src/render/rend_list.cpp \
src/render/rend_main.cpp \
src/render/rend_model.cpp \
src/render/rend_particle.c \
src/render/rend_shadow.c \
Expand All @@ -582,6 +583,7 @@ SOURCES += \
src/resource/image.cpp \
src/resource/material.cpp \
src/resource/materialarchive.c \
src/resource/materialsnapshot.cpp \
src/resource/materials.cpp \
src/resource/materialvariant.cpp \
src/resource/models.cpp \
Expand Down
16 changes: 8 additions & 8 deletions doomsday/engine/include/gl/gl_texmanager.h
Expand Up @@ -129,7 +129,7 @@ void GL_ReleaseTexturesByScheme(char const *schemeName);
* Release all textures associated with the specified @a texture.
* @param texture Logical Texture. Can be @c NULL, in which case this is a null-op.
*/
void GL_ReleaseGLTexturesByTexture(Texture *texture);
void GL_ReleaseGLTexturesByTexture(struct texture_s *texture);

/**
* Release all textures associated with the specified variant @a texture.
Expand All @@ -142,7 +142,7 @@ void GL_ReleaseVariantTexture(struct texturevariant_s *texture);
* @param texture Logical Texture to process. Can be @c NULL, in which case this is a null-op.
* @param spec Specification to match. Comparision mode is exact and not fuzzy.
*/
void GL_ReleaseVariantTexturesBySpec(Texture *tex, texturevariantspecification_t *spec);
void GL_ReleaseVariantTexturesBySpec(struct texture_s *tex, texturevariantspecification_t *spec);

/// Release all textures associated with the identified colorpalette @a paletteId.
void GL_ReleaseTexturesByColorPalette(colorpaletteid_t paletteId);
Expand Down Expand Up @@ -262,14 +262,14 @@ typedef enum {
*
* @return GL-name of the prepared texture if successful else @c 0
*/
DGLuint GL_PrepareTexture2(Texture *tex, texturevariantspecification_t *spec, preparetextureresult_t *returnOutcome);
DGLuint GL_PrepareTexture(Texture *tex, texturevariantspecification_t *spec/*, returnOutcome = 0 */);
DGLuint GL_PrepareTexture2(struct texture_s *tex, texturevariantspecification_t *spec, preparetextureresult_t *returnOutcome);
DGLuint GL_PrepareTexture(struct texture_s *tex, texturevariantspecification_t *spec/*, returnOutcome = 0 */);

/**
* Same as GL_PrepareTexture(2) except for visibility of TextureVariant.
*/
struct texturevariant_s *GL_PrepareTextureVariant2(Texture *tex, texturevariantspecification_t *spec, preparetextureresult_t *returnOutcome);
struct texturevariant_s *GL_PrepareTextureVariant(Texture *tex, texturevariantspecification_t *spec/*, returnOutcome = 0 */);
struct texturevariant_s *GL_PrepareTextureVariant2(struct texture_s *tex, texturevariantspecification_t *spec, preparetextureresult_t *returnOutcome);
struct texturevariant_s *GL_PrepareTextureVariant(struct texture_s *tex, texturevariantspecification_t *spec/*, returnOutcome = 0 */);

/**
* Bind this texture to the currently active texture unit.
Expand Down Expand Up @@ -310,8 +310,8 @@ DGLuint GL_PrepareLightmap(Uri const *path);
DGLuint GL_PrepareLSTexture(lightingtexid_t which);
DGLuint GL_PrepareRawTexture(rawtex_t *rawTex);

struct texturevariant_s *GL_PreparePatchTexture2(Texture *tex, int wrapS, int wrapT);
struct texturevariant_s *GL_PreparePatchTexture(Texture *tex);
struct texturevariant_s *GL_PreparePatchTexture2(struct texture_s *tex, int wrapS, int wrapT);
struct texturevariant_s *GL_PreparePatchTexture(struct texture_s *tex);

/**
* Attempt to locate and prepare a flare texture.
Expand Down
8 changes: 8 additions & 0 deletions doomsday/engine/include/map/polyobj.h
Expand Up @@ -32,6 +32,10 @@ DD_BASE_POLYOBJ_ELEMENTS()

#define POLYOBJ_SIZE gx.polyobjSize

#ifdef __cplusplus
extern "C" {
#endif

/**
* Translate the origin in the map coordinate space.
*
Expand Down Expand Up @@ -87,4 +91,8 @@ boolean Polyobj_GetProperty(const Polyobj* po, setargs_t* args);
boolean Polyobj_SetProperty(Polyobj* po, const setargs_t* args);
#endif

#ifdef __cplusplus
} // extern "C"
#endif

#endif /// LIBDENG_MAP_POLYOB_H
8 changes: 7 additions & 1 deletion doomsday/engine/include/map/r_world.h
Expand Up @@ -51,6 +51,7 @@ extern byte rendSkyLightAuto; // cvar
extern float rendLightWallAngle;
extern byte rendLightWallAngleSmooth;
extern boolean ddMapSetup;
extern boolean firstFrameAfterLoad;

// Sky flags.
#define SIF_DRAW_SPHERE 0x1 // Always draw the sky sphere.
Expand Down Expand Up @@ -89,7 +90,12 @@ void R_UpdatePlanes(void);
void R_ClearSectorFlags(void);
void R_MapInitSurfaceLists(void);

void R_OrderVertices(const LineDef* line, const Sector* sector, Vertex* verts[2]);
/**
* Returns pointers to the line's vertices in such a fashion that @c verts[0]
* is the leftmost vertex and @c verts[1] is the rightmost vertex, when the
* @a line lies at the edge of @a sector.
*/
void R_OrderVertices(LineDef const *line, Sector const *sector, Vertex *verts[2]);

/**
* Determine the map space Z coordinates of a wall section.
Expand Down
8 changes: 4 additions & 4 deletions doomsday/engine/include/render/r_draw.h
Expand Up @@ -39,11 +39,11 @@ void R_SetBorderGfx(Uri const *const *paths);
*/
void R_DrawViewBorder(void);

void R_DrawPatch(Texture *texture, int x, int y);
void R_DrawPatch2(Texture *texture, int x, int y, int w, int h);
void R_DrawPatch3(Texture *texture, int x, int y, int w, int h, boolean useOffsets);
void R_DrawPatch(struct texture_s *texture, int x, int y);
void R_DrawPatch2(struct texture_s *texture, int x, int y, int w, int h);
void R_DrawPatch3(struct texture_s *texture, int x, int y, int w, int h, boolean useOffsets);

void R_DrawPatchTiled(Texture *texture, int x, int y, int w, int h, int wrapS, int wrapT);
void R_DrawPatchTiled(struct texture_s *texture, int x, int y, int w, int h, int wrapS, int wrapT);

#ifdef __cplusplus
} // extern "C"
Expand Down
20 changes: 14 additions & 6 deletions doomsday/engine/include/render/rend_dynlight.h
Expand Up @@ -28,30 +28,38 @@
/// Paramaters for Rend_RenderLightProjections (POD).
typedef struct {
uint lastIdx;
const rvertex_t* rvertices;
rvertex_t const *rvertices;
uint numVertices, realNumVertices;
const coord_t* texTL, *texBR;
coord_t const *texTL, *texBR;
boolean isWall;
struct {
struct {
walldivnode_t* firstDiv;
walldivnode_t *firstDiv;
uint divCount;
} left;
struct {
walldivnode_t* firstDiv;
walldivnode_t *firstDiv;
uint divCount;
} right;
} wall;
} renderlightprojectionparams_t;

#ifdef __cplusplus
extern "C" {
#endif

/**
* Render all dynlights in projection list @a listIdx according to @a paramaters
* writing them to the renderering lists for the current frame.
*
* \note If multi-texturing is being used for the first light; it is skipped.
* @note If multi-texturing is being used for the first light; it is skipped.
*
* @return Number of lights rendered.
*/
uint Rend_RenderLightProjections(uint listIdx, renderlightprojectionparams_t* paramaters);
uint Rend_RenderLightProjections(uint listIdx, renderlightprojectionparams_t *paramaters);

#ifdef __cplusplus
} // extern "C"
#endif

#endif /* LIBDENG_RENDER_DYNLIGHT_H */
5 changes: 5 additions & 0 deletions doomsday/engine/include/render/rend_main.h
Expand Up @@ -73,6 +73,9 @@ extern int shadowMaxDistance;

extern int useShinySurfaces;

extern byte devRendSkyAlways;
extern byte freezeRLs;

void Rend_Register(void);

void Rend_Init(void);
Expand Down Expand Up @@ -105,6 +108,8 @@ void Rend_CalcLightModRange(void);
*/
uint Rend_NumFanVerticesForBspLeaf(BspLeaf* bspLeaf);

void R_DrawLightRange(void);

#ifdef __cplusplus
} // extern "C"
#endif
Expand Down
8 changes: 8 additions & 0 deletions doomsday/engine/include/render/rend_shadow.h
Expand Up @@ -25,6 +25,10 @@
#ifndef LIBDENG_RENDER_MOBJ_SHADOW_H
#define LIBDENG_RENDER_MOBJ_SHADOW_H

#ifdef __cplusplus
extern "C" {
#endif

/**
* This value defines the offset from the shadowed surface applied to
* shadows rendered with the simple drop-to-highest-floor method.
Expand Down Expand Up @@ -67,4 +71,8 @@ typedef struct {
*/
void Rend_RenderShadowProjections(uint listIdx, rendershadowprojectionparams_t* paramaters);

#ifdef __cplusplus
} // extern "C"
#endif

#endif /* LIBDENG_RENDER_MOBJ_SHADOW_H */
2 changes: 1 addition & 1 deletion doomsday/engine/include/resource/bitmapfont.h
Expand Up @@ -111,7 +111,7 @@ void BitmapCompositeFont_SetDefinition(font_t* font, struct ded_compositefont_s*
patchid_t BitmapCompositeFont_CharPatch(font_t* font, unsigned char ch);
void BitmapCompositeFont_CharSetPatch(font_t* font, unsigned char ch, const char* patchName);

struct texturevariant_s* BitmapCompositeFont_CharTexture(font_t* font, unsigned char ch);
struct texturevariant_s *BitmapCompositeFont_CharTexture(font_t* font, unsigned char ch);
void BitmapCompositeFont_ReleaseTextures(font_t* font);

uint8_t BitmapCompositeFont_CharBorder(font_t* font, unsigned char chr);
Expand Down
2 changes: 2 additions & 0 deletions doomsday/engine/include/resource/materials.h
Expand Up @@ -110,6 +110,8 @@ AutoStr* Materials_ComposePath(materialid_t materialId);
/// @return Unique name/path-to this material. Must be destroyed with Uri_Delete().
Uri* Materials_ComposeUri(materialid_t materialId);

void Materials_UpdateTextureLinks(materialid_t materialId);

/**
* Update @a material according to the supplied definition @a def.
* To be called after an engine update/reset.
Expand Down
123 changes: 123 additions & 0 deletions doomsday/engine/include/resource/materialsnapshot.h
@@ -0,0 +1,123 @@
/** @file materialsnapshot.h Material Snapshot.
*
* @author Copyright &copy; 2011-2012 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, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA</small>
*/

#ifndef LIBDENG_RESOURCE_MATERIALSNAPSHOT_H
#define LIBDENG_RESOURCE_MATERIALSNAPSHOT_H

// Material texture unit idents:
enum {
MTU_PRIMARY,
MTU_DETAIL,
MTU_REFLECTION,
MTU_REFLECTION_MASK,
NUM_MATERIAL_TEXTURE_UNITS
};

#ifdef __cplusplus

#include <QSize>
#include <de/Error>
#include "de/vector1.h"
#include "resource/materialvariant.h"
#include "resource/texturevariant.h"
#include "render/rendpoly.h"

namespace de {

/**
* @ingroup resource
*/
class MaterialSnapshot
{
public:
/// Invalid texture unit referenced. @ingroup errors
DENG2_ERROR(InvalidUnitError);

public:
/**
* Construct a new material snapshot instance.
* @param material Material to capture to produce the snapshot.
*/
MaterialSnapshot(MaterialVariant &material);

~MaterialSnapshot();

/**
* Returns the material variant of the material snapshot.
*/
MaterialVariant &material() const;

/**
* Returns the dimensions in the world coordinate space for the material snapshot.
*/
QSize const &dimensions() const;

/**
* Returns @c true if the material snapshot is completely opaque.
*/
bool isOpaque() const;

/**
* Returns the glow strength multiplier for the material snapshot.
*/
float glowStrength() const;

/**
* Returns the minimum ambient light color for the material snapshot.
*/
vec3f_t const &reflectionMinColor() const;

/**
* Returns @c true if a texture with @a index is set for the material snapshot.
*/
bool hasTexture(int index) const;

/**
* Lookup a material snapshot texture unit texture by index.
*
* @param index Index of the texture unit to lookup.
* @return The texture associated with the texture unit.
*/
TextureVariant &texture(int index) const;

/**
* Lookup a material snapshot texture unit by index.
*
* @param index Index of the texture unit to lookup.
* @return The associated texture unit.
*/
rtexmapunit_t const &unit(int index) const;

/**
* Prepare all textures and update property values.
*/
void update();

private:
struct Instance;
Instance *d;
};

} // namespace de

struct materialsnapshot_s; // The material snapshot instance (opaque).

#endif

#endif /* LIBDENG_RESOURCE_MATERIALSNAPSHOT_H */

0 comments on commit 9858a72

Please sign in to comment.