Skip to content

Commit

Permalink
Merge branch 'master' of ssh://deng.git.sourceforge.net/gitroot/deng/…
Browse files Browse the repository at this point in the history
…deng
  • Loading branch information
skyjake committed Apr 22, 2012
2 parents 95159d6 + b7d6cd0 commit f507e9d
Show file tree
Hide file tree
Showing 49 changed files with 565 additions and 950 deletions.
3 changes: 3 additions & 0 deletions doomsday/engine/api/dd_maptypes.h
Expand Up @@ -45,6 +45,9 @@
#define DMT_PLANE_TARGET DDVT_DOUBLE // Target height
#define DMT_PLANE_SPEED DDVT_DOUBLE // Move speed

#define DMT_SECTOR_FLOORPLANE DDVT_PTR
#define DMT_SECTOR_CEILINGPLANE DDVT_PTR

#define DMT_SECTOR_VALIDCOUNT DDVT_INT // if == validCount, already checked.
#define DMT_SECTOR_LIGHTLEVEL DDVT_FLOAT
#define DMT_SECTOR_RGB DDVT_FLOAT
Expand Down
16 changes: 15 additions & 1 deletion doomsday/engine/api/dd_share.h
Expand Up @@ -722,7 +722,9 @@ enum {
DMU_HEIGHT,
DMU_TARGET_HEIGHT,
DMU_SPEED,
DMU_HEDGE_COUNT
DMU_HEDGE_COUNT,
DMU_FLOOR_PLANE,
DMU_CEILING_PLANE
};

/**
Expand Down Expand Up @@ -804,6 +806,18 @@ enum {
NUM_REVERB_DATA
};

/// SideDef section indices. @ingroup map
typedef enum sidedefsection_e {
SS_MIDDLE,
SS_BOTTOM,
SS_TOP
} SideDefSection;

/// Helper macro for converting SideDefSection indices to their associated DMU flag. @ingroup map
#define DMU_FLAG_FOR_SIDEDEFSECTION(s) (\
(s) == SS_MIDDLE? DMU_MIDDLE_OF_SIDEDEF : \
(s) == SS_BOTTOM? DMU_BOTTOM_OF_SIDEDEF : DMU_TOP_OF_SIDEDEF)

typedef struct {
fixed_t origin[2];
fixed_t direction[2];
Expand Down
12 changes: 5 additions & 7 deletions doomsday/engine/portable/include/mapdata.hs
Expand Up @@ -286,6 +286,11 @@ typedef struct msector_s {
} msector_t;
end

public
#define DMT_SECTOR_FLOORPLANE DDVT_PTR
#define DMT_SECTOR_CEILINGPLANE DDVT_PTR
end

struct Sector
- int frameFlags
INT int validCount // if == validCount, already checked.
Expand Down Expand Up @@ -313,13 +318,6 @@ struct Sector
end

internal
// Sections of a sidedef
typedef enum sidedefsection_e {
SS_MIDDLE,
SS_TOP,
SS_BOTTOM
} sidedefsection_t;

// Helper macros for accessing sidedef top/middle/bottom section data elements.
#define SW_surface(n) sections[(n)]
#define SW_surfaceflags(n) SW_surface(n).flags
Expand Down
7 changes: 0 additions & 7 deletions doomsday/engine/portable/include/p_maptypes.h
Expand Up @@ -296,13 +296,6 @@ typedef struct sector_s {
msector_t buildData;
} Sector;

// Sidedef sections.
typedef enum sidedefsection_e {
SS_MIDDLE,
SS_TOP,
SS_BOTTOM
} sidedefsection_t;

// Helper macros for accessing sidedef top/middle/bottom section data elements.
#define SW_surface(n) sections[(n)]
#define SW_surfaceflags(n) SW_surface(n).flags
Expand Down
2 changes: 1 addition & 1 deletion doomsday/engine/portable/include/r_world.h
Expand Up @@ -87,7 +87,7 @@ void R_MapInitSurfaceLists(void);

void R_OrderVertices(const LineDef* line, const Sector* sector,
Vertex* verts[2]);
boolean R_FindBottomTop(LineDef* lineDef, int side, sidedefsection_t section,
boolean R_FindBottomTop(LineDef* lineDef, int side, SideDefSection section,
coord_t matOffsetX, coord_t matOffsetY,
const Plane* ffloor, const Plane* fceil,
const Plane* bfloor, const Plane* bceil,
Expand Down
4 changes: 2 additions & 2 deletions doomsday/engine/portable/src/dam_file.c
Expand Up @@ -329,7 +329,7 @@ static void writeSide(GameMap* map, uint idx)

for(i = 0; i < 3; ++i)
{
Surface* suf = &s->sections[3];
Surface* suf = &s->sections[i];

writeLong(suf->flags);
//writeLong(getMaterialDictID(materialDict, suf->material));
Expand Down Expand Up @@ -359,7 +359,7 @@ static void readSide(GameMap* map, uint idx)

for(i = 0; i < 3; ++i)
{
Surface* suf = &s->sections[3];
Surface* suf = &s->sections[i];

suf->flags = (int) readLong();
//Surface_SetMaterial(suf, lookupMaterialFromDict(materialDict, readLong()));
Expand Down
6 changes: 3 additions & 3 deletions doomsday/engine/portable/src/r_world.c
Expand Up @@ -1427,7 +1427,7 @@ boolean R_SectorContainsSkySurfaces(const Sector* sec)
* Non-animated materials are preferred.
* Sky materials are ignored.
*/
static material_t* chooseFixMaterial(SideDef* s, sidedefsection_t section)
static material_t* chooseFixMaterial(SideDef* s, SideDefSection section)
{
material_t* choice1 = NULL, *choice2 = NULL;

Expand Down Expand Up @@ -1462,9 +1462,9 @@ static material_t* chooseFixMaterial(SideDef* s, sidedefsection_t section)
return NULL;
}

static void updateSidedefSection(SideDef* s, sidedefsection_t section)
static void updateSidedefSection(SideDef* s, SideDefSection section)
{
Surface* suf;
Surface* suf;

if(section == SS_MIDDLE)
return; // Not applicable.
Expand Down
4 changes: 2 additions & 2 deletions doomsday/engine/portable/src/rend_decor.c
Expand Up @@ -72,7 +72,7 @@ typedef struct decorsource_s {

// PRIVATE FUNCTION PROTOTYPES ---------------------------------------------

static void updateSideSectionDecorations(SideDef* side, sidedefsection_t section);
static void updateSideSectionDecorations(SideDef* side, SideDefSection section);
static void updatePlaneDecorations(Plane* pln);

// EXTERNAL DATA DECLARATIONS ----------------------------------------------
Expand Down Expand Up @@ -560,7 +560,7 @@ static void updatePlaneDecorations(Plane* pln)
updateSurfaceDecorations2(suf, offsetS, offsetT, v1, v2, sec, suf->material? true : false);
}

static void updateSideSectionDecorations(SideDef* side, sidedefsection_t section)
static void updateSideSectionDecorations(SideDef* side, SideDefSection section)
{
LineDef* line;
Surface* suf;
Expand Down
6 changes: 3 additions & 3 deletions doomsday/engine/portable/src/rend_main.c
Expand Up @@ -596,7 +596,7 @@ static void applyWallHeightDivision(walldiv_t* divs, const HEdge* hedge,
}

static void selectSurfaceColors(const float** topColor,
const float** bottomColor, SideDef* side, sidedefsection_t section)
const float** bottomColor, SideDef* side, SideDefSection section)
{
switch(section)
{
Expand Down Expand Up @@ -1735,7 +1735,7 @@ static void Rend_RenderPlane(BspLeaf* bspLeaf, planetype_t type, coord_t height,
}
}

static boolean rendHEdgeSection(HEdge* hedge, BspLeaf* bspLeaf, sidedefsection_t section,
static boolean rendHEdgeSection(HEdge* hedge, BspLeaf* bspLeaf, SideDefSection section,
Surface* surface, coord_t const from[2], coord_t const to[2], coord_t bottom, coord_t top,
float const texOffset[2], Sector* frontsec, boolean softSurface, boolean addDLights,
boolean addMobjShadows, short sideFlags)
Expand Down Expand Up @@ -2009,7 +2009,7 @@ static boolean Rend_RenderHEdge(HEdge* hedge, BspLeaf* bspLeaf)
return solid;
}

boolean R_FindBottomTop(LineDef* lineDef, int side, sidedefsection_t section,
boolean R_FindBottomTop(LineDef* lineDef, int side, SideDefSection section,
coord_t matOffsetX, coord_t matOffsetY,
const Plane* ffloor, const Plane* fceil,
const Plane* bfloor, const Plane* bceil,
Expand Down
8 changes: 8 additions & 0 deletions doomsday/engine/portable/src/sector.c
Expand Up @@ -132,6 +132,14 @@ int Sector_GetProperty(const Sector* sec, setargs_t* args)
case DMU_VALID_COUNT:
DMU_GetValue(DMT_SECTOR_VALIDCOUNT, &sec->validCount, args, 0);
break;
case DMU_FLOOR_PLANE: {
Plane* pln = sec->planes[PLN_FLOOR];
DMU_GetValue(DMT_SECTOR_FLOORPLANE, &pln, args, 0);
break; }
case DMU_CEILING_PLANE: {
Plane* pln = sec->planes[PLN_CEILING];
DMU_GetValue(DMT_SECTOR_CEILINGPLANE, &pln, args, 0);
break; }
default:
Con_Error("Sector_GetProperty: No property %s.\n", DMU_Str(args->prop));
}
Expand Down
2 changes: 2 additions & 0 deletions doomsday/plugins/common/common.pri
Expand Up @@ -47,6 +47,7 @@ HEADERS += \
$$common_inc/p_savedef.h \
$$common_inc/p_saveg.h \
$$common_inc/p_saveio.h \
$$common_inc/p_sound.h \
$$common_inc/p_start.h \
$$common_inc/p_switch.h \
$$common_inc/p_terraintype.h \
Expand Down Expand Up @@ -98,6 +99,7 @@ SOURCES += \
$$common_src/p_player.c \
$$common_src/p_saveg.c \
$$common_src/p_saveio.c \
$$common_src/p_sound.c \
$$common_src/p_start.c \
$$common_src/p_switch.c \
$$common_src/p_terraintype.c \
Expand Down
8 changes: 3 additions & 5 deletions doomsday/plugins/common/include/common.h
Expand Up @@ -21,8 +21,8 @@
* Boston, MA 02110-1301 USA
*/

#ifndef __COMMON_GAME_INCLUDES__
#define __COMMON_GAME_INCLUDES__
#ifndef LIBCOMMON_GAME_INCLUDES
#define LIBCOMMON_GAME_INCLUDES

#define WEAPONBOTTOM (128) // from p_pspr.c

Expand All @@ -36,8 +36,6 @@
# include "jheretic.h"
#elif __JHEXEN__
# include "jhexen.h"
#elif __JSTRIFE__
# include "jstrife.h"
#endif

#endif // __COMMON_GAME_INCLUDES__
#endif /// LIBCOMMON_GAME_INCLUDES
7 changes: 5 additions & 2 deletions doomsday/plugins/common/include/dmu_lib.h
Expand Up @@ -42,6 +42,7 @@
#define DMU_TOP_COLOR_RED (DMU_TOP_OF_SIDEDEF | DMU_COLOR_RED)
#define DMU_TOP_COLOR_GREEN (DMU_TOP_OF_SIDEDEF | DMU_COLOR_GREEN)
#define DMU_TOP_COLOR_BLUE (DMU_TOP_OF_SIDEDEF | DMU_COLOR_BLUE)
#define DMU_TOP_BASE (DMU_TOP_OF_SIDEDEF | DMU_BASE)

#define DMU_MIDDLE_MATERIAL (DMU_MIDDLE_OF_SIDEDEF | DMU_MATERIAL)
#define DMU_MIDDLE_MATERIAL_OFFSET_X (DMU_MIDDLE_OF_SIDEDEF | DMU_OFFSET_X)
Expand All @@ -54,6 +55,7 @@
#define DMU_MIDDLE_COLOR_BLUE (DMU_MIDDLE_OF_SIDEDEF | DMU_COLOR_BLUE)
#define DMU_MIDDLE_ALPHA (DMU_MIDDLE_OF_SIDEDEF | DMU_ALPHA)
#define DMU_MIDDLE_BLENDMODE (DMU_MIDDLE_OF_SIDEDEF | DMU_BLENDMODE)
#define DMU_MIDDLE_BASE (DMU_MIDDLE_OF_SIDEDEF | DMU_BASE)

#define DMU_BOTTOM_MATERIAL (DMU_BOTTOM_OF_SIDEDEF | DMU_MATERIAL)
#define DMU_BOTTOM_MATERIAL_OFFSET_X (DMU_BOTTOM_OF_SIDEDEF | DMU_OFFSET_X)
Expand All @@ -64,12 +66,13 @@
#define DMU_BOTTOM_COLOR_RED (DMU_BOTTOM_OF_SIDEDEF | DMU_COLOR_RED)
#define DMU_BOTTOM_COLOR_GREEN (DMU_BOTTOM_OF_SIDEDEF | DMU_COLOR_GREEN)
#define DMU_BOTTOM_COLOR_BLUE (DMU_BOTTOM_OF_SIDEDEF | DMU_COLOR_BLUE)
#define DMU_BOTTOM_BASE (DMU_BOTTOM_OF_SIDEDEF | DMU_BASE)

#define DMU_FLOOR_HEIGHT (DMU_FLOOR_OF_SECTOR | DMU_HEIGHT)
#define DMU_FLOOR_TARGET_HEIGHT (DMU_FLOOR_OF_SECTOR | DMU_TARGET_HEIGHT)
#define DMU_FLOOR_SPEED (DMU_FLOOR_OF_SECTOR | DMU_SPEED)
#define DMU_FLOOR_MATERIAL (DMU_FLOOR_OF_SECTOR | DMU_MATERIAL)
#define DMU_FLOOR_ORIGIN (DMU_FLOOR_OF_SECTOR | DMU_BASE)
#define DMU_FLOOR_BASE (DMU_FLOOR_OF_SECTOR | DMU_BASE)
#define DMU_FLOOR_FLAGS (DMU_FLOOR_OF_SECTOR | DMU_FLAGS)
#define DMU_FLOOR_COLOR (DMU_FLOOR_OF_SECTOR | DMU_COLOR)
#define DMU_FLOOR_COLOR_RED (DMU_FLOOR_OF_SECTOR | DMU_COLOR_RED)
Expand All @@ -95,7 +98,7 @@
#define DMU_CEILING_TARGET_HEIGHT (DMU_CEILING_OF_SECTOR | DMU_TARGET_HEIGHT)
#define DMU_CEILING_SPEED (DMU_CEILING_OF_SECTOR | DMU_SPEED)
#define DMU_CEILING_MATERIAL (DMU_CEILING_OF_SECTOR | DMU_MATERIAL)
#define DMU_CEILING_ORIGIN (DMU_CEILING_OF_SECTOR | DMU_BASE)
#define DMU_CEILING_BASE (DMU_CEILING_OF_SECTOR | DMU_BASE)
#define DMU_CEILING_FLAGS (DMU_CEILING_OF_SECTOR | DMU_FLAGS)
#define DMU_CEILING_COLOR (DMU_CEILING_OF_SECTOR | DMU_COLOR)
#define DMU_CEILING_COLOR_RED (DMU_CEILING_OF_SECTOR | DMU_COLOR_RED)
Expand Down
65 changes: 65 additions & 0 deletions doomsday/plugins/common/include/p_sound.h
@@ -0,0 +1,65 @@
/**
* @file p_sound.h
* id tech 1 sound playback functionality for the play simulation.
*
* @ingroup play
*
* @authors Copyright &copy; 2003-2012 Jaakko Keränen <jaakko.keranen@iki.fi>
* @authors Copyright &copy; 2005-2012 Daniel Swanson <danij@dengine.net>
* @authors Copyright &copy; 1993-1996 by id Software, Inc.
*
* @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 LIBCOMMON_PLAY_SOUND_H
#define LIBCOMMON_PLAY_SOUND_H

#include "doomsday.h"

/**
* Start the song for the specified map.
*/
void S_MapMusic(uint episode, uint map);

/**
* Doom-like sector sounds: when a new sound starts, stop any existing
* sounds from other origins in this Sector.
*
* @param sec Sector to use as the origin of the sound.
* @param id ID number of the sound to be played.
*/
void S_SectorSound(Sector* sec, int id);

/**
* @param sec Sector in which to stop sounds.
*/
void S_SectorStopSounds(Sector* sec);

/**
* Doom-like sector sounds: when a new sound starts, stop any existing
* sounds from other origins in the same Sector.
*
* @param plane Plane to use as the origin of the sound.
* @param id ID number of the sound to be played.
*/
void S_PlaneSound(Plane* pln, int id);

#ifdef __JHEXEN__
int S_GetSoundID(const char* name);

void S_ParseSndInfoLump(void);
#endif

#endif /// LIBCOMMON_PLAY_SOUND_H

0 comments on commit f507e9d

Please sign in to comment.