Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/zdoom/maint' into maint2.1
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/version.h
  • Loading branch information
Christoph Oelckers committed Feb 23, 2016
2 parents a210447 + 1a9bc53 commit 9144efe
Show file tree
Hide file tree
Showing 18 changed files with 64 additions and 44 deletions.
11 changes: 5 additions & 6 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -229,13 +229,12 @@ include_directories( ${OPENGL_INCLUDE_DIR} )

if( NOT NO_OPENAL )
find_package( OpenAL )
mark_as_advanced(CLEAR OPENAL_LIBRARY OPENAL_INCLUDE_DIR)
if( OPENAL_FOUND )
mark_as_advanced(CLEAR OPENAL_INCLUDE_DIR)
if( OPENAL_INCLUDE_DIR )
include_directories( ${OPENAL_INCLUDE_DIR} )
set( ZDOOM_LIBS ${OPENAL_LIBRARY} ${ZDOOM_LIBS} )
else( OPENAL_FOUND )
set( NO_OPENAL ON )
endif( OPENAL_FOUND )
else( OPENAL_INCLUDE_DIR )
set( NO_OPENAL ON )
endif( OPENAL_INCLUDE_DIR )
endif( NOT NO_OPENAL )

if( NOT NO_FMOD )
Expand Down
4 changes: 2 additions & 2 deletions src/dsectoreffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,11 @@ void DMover::Serialize (FArchive &arc)
arc << interpolation;
}

void DMover::StopInterpolation()
void DMover::StopInterpolation(bool force)
{
if (interpolation != NULL)
{
interpolation->DelRef();
interpolation->DelRef(force);
interpolation = NULL;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/dsectoreffect.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class DMover : public DSectorEffect
DMover ();
void Serialize (FArchive &arc);
void Destroy();
void StopInterpolation();
void StopInterpolation(bool force = false);
inline EResult MoveFloor (fixed_t speed, fixed_t dest, int crush, int direction, bool hexencrush)
{
return MovePlane (speed, dest, crush, 0, direction, hexencrush);
Expand Down
14 changes: 11 additions & 3 deletions src/fragglescript/t_func.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1571,7 +1571,7 @@ class DFloorChanger : public DFloor
bool res = DMover::crushed != MoveFloor(speed, dest, crush, direction, false);
Destroy();
m_Sector->floordata=NULL;
StopInterpolation();
StopInterpolation(true);
m_Sector=NULL;
return res;
}
Expand Down Expand Up @@ -1656,6 +1656,14 @@ class DMoveFloor : public DFloor
m_Speed=movespeed;
m_Direction = _m_Direction;
m_FloorDestDist = moveheight;

// Do not interpolate instant movement floors.
fixed_t movedist = abs(-sec->floorplane.d - moveheight);
if (m_Speed >= movedist)
{
StopInterpolation(true);
}

StartFloorSound();
}
};
Expand Down Expand Up @@ -1713,7 +1721,7 @@ class DCeilingChanger : public DCeiling
bool res = DMover::crushed != MoveCeiling(speed, dest, crush, direction, false);
Destroy();
m_Sector->ceilingdata=NULL;
StopInterpolation ();
StopInterpolation (true);
m_Sector=NULL;
return res;
}
Expand Down Expand Up @@ -1806,7 +1814,7 @@ class DMoveCeiling : public DCeiling
fixed_t movedist = abs(sec->ceilingplane.d - m_BottomHeight);
if (m_Speed >= movedist)
{
StopInterpolation ();
StopInterpolation (true);
m_Silent=2;
}
PlayCeilingSound();
Expand Down
2 changes: 1 addition & 1 deletion src/g_heretic/a_hereticweaps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_DeathBallImpact)
}
else
{ // Seek
self->angle = self->AngleTo(target);
angle = self->AngleTo(target);
newAngle = true;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/p_ceiling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ DCeiling *DCeiling::Create(sector_t *sec, DCeiling::ECeiling type, line_t *line,
}
if (ceiling->m_Speed >= movedist)
{
ceiling->StopInterpolation();
ceiling->StopInterpolation(true);
}

// set texture/type change properties
Expand Down
2 changes: 1 addition & 1 deletion src/p_floor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ bool EV_DoFloor (DFloor::EFloor floortype, line_t *line, int tag,
(floor->m_Direction<0 && floor->m_FloorDestDist<sec->floorplane.d) || // moving down but going up
(floor->m_Speed >= abs(sec->floorplane.d - floor->m_FloorDestDist))) // moving in one step
{
floor->StopInterpolation();
floor->StopInterpolation(true);

// [Graf Zahl]
// Don't make sounds for instant movement hacks but make an exception for
Expand Down
10 changes: 8 additions & 2 deletions src/p_terrain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -627,13 +627,19 @@ static void ParseFloor (FScanner &sc)
FTextureID picnum;
int terrain;

bool opt = sc.CheckString("optional");
sc.MustGetString ();

picnum = TexMan.CheckForTexture (sc.String, FTexture::TEX_Flat,
FTextureManager::TEXMAN_Overridable|FTextureManager::TEXMAN_TryAny);

if (!picnum.Exists())
{
Printf ("Unknown flat %s\n", sc.String);
sc.MustGetString ();
if (!opt)
{
Printf("Unknown flat %s\n", sc.String);
}
sc.MustGetString();
return;
}
sc.MustGetString ();
Expand Down
17 changes: 2 additions & 15 deletions src/r_data/r_interpolate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -344,9 +344,10 @@ int DInterpolation::AddRef()
//
//==========================================================================

int DInterpolation::DelRef()
int DInterpolation::DelRef(bool force)
{
if (refcount > 0) --refcount;
if (force && refcount == 0) Destroy();
return refcount;
}

Expand Down Expand Up @@ -943,20 +944,6 @@ DInterpolation *sector_t::SetInterpolation(int position, bool attach)
//
//==========================================================================

void sector_t::StopInterpolation(int position)
{
if (interpolations[position] != NULL)
{
interpolations[position]->DelRef();
}
}

//==========================================================================
//
//
//
//==========================================================================

DInterpolation *FPolyObj::SetInterpolation()
{
if (interpolation != NULL)
Expand Down
2 changes: 1 addition & 1 deletion src/r_data/r_interpolate.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class DInterpolation : public DObject

public:
int AddRef();
int DelRef();
int DelRef(bool force = false);

virtual void Destroy();
virtual void UpdateInterpolation() = 0;
Expand Down
1 change: 0 additions & 1 deletion src/r_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,6 @@ struct sector_t
sector_t *GetHeightSec() const;

DInterpolation *SetInterpolation(int position, bool attach);
void StopInterpolation(int position);

ASkyViewpoint *GetSkyBox(int which);

Expand Down
6 changes: 6 additions & 0 deletions src/sc_man_scanner.re
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ std2:
/*!re2c
"/*" { goto comment; } /* C comment */
"//" (any\"\n")* "\n" { goto newline; } /* C++ comment */
("#region"|"#endregion") (any\"\n")* "\n"
{ goto newline; } /* Region blocks [mxd] */

/* C Keywords */
'break' { RET(TK_Break); }
Expand Down Expand Up @@ -241,6 +243,8 @@ std2:
/*!re2c
"/*" { goto comment; } /* C comment */
("//"|";") (any\"\n")* "\n" { goto newline; } /* C++/Hexen comment */
("#region"|"#endregion") (any\"\n")* "\n"
{ goto newline; } /* Region blocks [mxd] */
WSP+ { goto std1; } /* whitespace */
"\n" { goto newline; }
Expand All @@ -259,6 +263,8 @@ std2:
/*!re2c
"/*" { goto comment; } /* C comment */
"//" (any\"\n")* "\n" { goto newline; } /* C++ comment */
("#region"|"#endregion") (any\"\n")* "\n"
{ goto newline; } /* Region blocks [mxd] */
WSP+ { goto std1; } /* whitespace */
"\n" { goto newline; }
Expand Down
6 changes: 5 additions & 1 deletion src/sound/oalload.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
#ifndef OALDEF_H
#define OALDEF_H

#if defined _WIN32 && !defined NO_OPENAL
#ifndef NO_OPENAL

#ifndef _WIN32
typedef void* FARPROC;
#endif

#define DEFINE_ENTRY(type, name) static type p_##name;
#include "oaldef.h"
Expand Down
21 changes: 16 additions & 5 deletions src/sound/oalsound.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#define USE_WINDOWS_DWORD
#else
#include <dlfcn.h>
#endif

#include "except.h"
Expand All @@ -61,14 +63,23 @@ CVAR (Bool, snd_efx, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)

#ifdef _WIN32
static HMODULE hmodOpenAL;
#define OPENALLIB "openal32.dll"
#else
static void* hmodOpenAL;
#ifdef __APPLE__
#define OPENALLIB "OpenAL.framework/OpenAL"
#else
#define OPENALLIB "libopenal.so"
#endif
#define LoadLibrary(x) dlopen((x), RTLD_LAZY)
#define GetProcAddress(a,b) dlsym((a),(b))
#define FreeLibrary(x) dlclose((x))
#endif

bool IsOpenALPresent()
{
#ifdef NO_OPENAL
return false;
#elif !defined _WIN32
return true;
#else
static bool cached_result = false;
static bool done = false;
Expand All @@ -78,10 +89,10 @@ bool IsOpenALPresent()
done = true;
if (hmodOpenAL == NULL)
{
hmodOpenAL = LoadLibrary(NicePath("$PROGDIR/openal32.dll"));
hmodOpenAL = LoadLibrary(NicePath("$PROGDIR/" OPENALLIB));
if (hmodOpenAL == NULL)
{
hmodOpenAL = LoadLibrary("openal32.dll");
hmodOpenAL = LoadLibrary(OPENALLIB);
if (hmodOpenAL == NULL)
{
return false;
Expand All @@ -90,7 +101,7 @@ bool IsOpenALPresent()
for(int i = 0; oalfuncs[i].name != NULL; i++)
{
*oalfuncs[i].funcaddr = GetProcAddress(hmodOpenAL, oalfuncs[i].name);
if (oalfuncs[i].funcaddr == NULL)
if (*oalfuncs[i].funcaddr == NULL)
{
FreeLibrary(hmodOpenAL);
hmodOpenAL = NULL;
Expand Down
2 changes: 1 addition & 1 deletion wadsrc/static/actors/doom/fatso.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ ACTOR Fatso
FATT H 10 BRIGHT A_FatAttack2
FATT IG 5 A_FaceTarget
FATT H 10 BRIGHT A_FatAttack3
FATT IG 5
FATT IG 5 A_FaceTarget
Goto See
Pain:
FATT J 3
Expand Down
4 changes: 2 additions & 2 deletions wadsrc/static/actors/doom/painelemental.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ ACTOR PainElemental
Missile:
PAIN D 5 A_FaceTarget
PAIN E 5 A_FaceTarget
PAIN F 4 BRIGHT A_FaceTarget
PAIN F 1 BRIGHT A_PainAttack
PAIN F 5 BRIGHT A_FaceTarget
PAIN F 0 BRIGHT A_PainAttack
Goto See
Pain:
PAIN G 6
Expand Down
2 changes: 1 addition & 1 deletion wadsrc/static/actors/doom/revenant.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ ACTOR Revenant
SKEL AABBCCDDEEFF 2 A_Chase
Loop
Melee:
SKEL G 1 A_FaceTarget
SKEL G 0 A_FaceTarget
SKEL G 6 A_SkelWhoosh
SKEL H 6 A_FaceTarget
SKEL I 6 A_SkelFist
Expand Down
Binary file modified wadsrc/static/confont.lmp
Binary file not shown.

0 comments on commit 9144efe

Please sign in to comment.