Merge branch 'master' of https://github.com/coelckers/gzdoom into two_more_stereo_modes

This commit is contained in:
Christopher Bruns 2016-04-09 21:46:33 -04:00
commit 355bc75001
10 changed files with 45 additions and 41 deletions

View file

@ -170,6 +170,12 @@ else()
set( FMOD_INC_PATH_SUFFIXES PATH_SUFFIXES inc )
set( FMOD_LIB_PATH_SUFFIXES PATH_SUFFIXES lib )
set( NO_GTK ON )
# Prevent inclusion of fp.h and FixMath.h from Carbon framework
# Declarations from these files are not used but cause the following conflicts:
# - redefinition of 'FixedToFloat' and 'FloatToFixed' macros
# - redefinition of 'pi' as different kind of symbol
add_definitions( -D__FP__ -D__FIXMATH__ )
else()
option( NO_GTK "Disable GTK+ dialogs (Not applicable to Windows)" )
option( VALGRIND "Add special Valgrind sequences to self-modifying code" )
@ -578,22 +584,6 @@ if( UNIX )
endif()
endif()
CHECK_CXX_SOURCE_COMPILES(
"#include <stdarg.h>
int main() { va_list list1, list2; va_copy(list1, list2); return 0; }"
HAS_VA_COPY )
if( NOT HAS_VA_COPY )
CHECK_CXX_SOURCE_COMPILES(
"#include <stdarg.h>
int main() { va_list list1, list2; __va_copy(list1, list2); return 0; }"
HAS___VA_COPY )
if( HAS___VA_COPY )
add_definitions( -Dva_copy=__va_copy )
else()
add_definitions( -DNO_VA_COPY )
endif()
endif()
# Flags
if( BACKPATCH )

View file

@ -1704,7 +1704,7 @@ void APowerProtection::ModifyDamage(int damage, FName damageType, int &newdamage
DmgFactors *df = GetClass()->DamageFactors;
if (df != NULL && df->CountUsed() != 0)
{
newdam = MIN(0, df->Apply(damageType, damage));
newdam = MAX(0, df->Apply(damageType, damage));
}
else
{

View file

@ -332,12 +332,12 @@ float FTexCoordInfo::RowOffset(float rowoffset) const
if (mTempScale.Y == 1.f)
{
if (mScale.Y == 1.f || mWorldPanning) return rowoffset;
else return rowoffset * mScale.Y;
else return rowoffset / mScale.Y;
}
else
{
if (mWorldPanning) return rowoffset * mTempScale.Y;
else return rowoffset * mScale.Y;
if (mWorldPanning) return rowoffset / mTempScale.Y;
else return rowoffset / mScale.Y;
}
}
@ -352,12 +352,12 @@ float FTexCoordInfo::TextureOffset(float textureoffset) const
if (mTempScale.X == 1.f)
{
if (mScale.X == 1.f || mWorldPanning) return textureoffset;
else return textureoffset * mScale.X;
else return textureoffset / mScale.X;
}
else
{
if (mWorldPanning) return textureoffset * mTempScale.X;
else return textureoffset * mScale.X;
if (mWorldPanning) return textureoffset / mTempScale.X;
else return textureoffset / mScale.X;
}
}

View file

@ -178,6 +178,11 @@ inline int AngleToACS(DAngle ang)
return ang.BAMs() >> 16;
}
inline int PitchToACS(DAngle ang)
{
return int(ang.Normalized180().Degrees * (65536. / 360));
}
struct CallReturn
{
CallReturn(int pc, ScriptFunction *func, FBehavior *module, SDWORD *locals, ACSLocalArrays *arrays, bool discard, unsigned int runaway)
@ -8751,7 +8756,7 @@ scriptwait:
case PCD_GETACTORPITCH:
{
AActor *actor = SingleActorFromTID(STACK(1), activator);
STACK(1) = actor == NULL ? 0 : AngleToACS(actor->Angles.Pitch);
STACK(1) = actor == NULL ? 0 : PitchToACS(actor->Angles.Pitch);
}
break;

View file

@ -221,7 +221,7 @@ void P_FakeZMovement (AActor *mo);
bool P_TryMove(AActor* thing, const DVector2 &pos, int dropoff, const secplane_t * onfloor, FCheckPosition &tm, bool missileCheck = false);
bool P_TryMove(AActor* thing, const DVector2 &pos, int dropoff, const secplane_t * onfloor = NULL);
bool P_CheckMove(AActor *thing, const DVector2 &pos);
bool P_CheckMove(AActor *thing, const DVector2 &pos, bool dropoff = false);
void P_ApplyTorque(AActor *mo);
bool P_TeleportMove(AActor* thing, const DVector3 &pos, bool telefrag, bool modifyactor = true); // [RH] Added z and telefrag parameters

View file

@ -2410,7 +2410,7 @@ bool P_TryMove(AActor *thing, const DVector2 &pos,
//
//==========================================================================
bool P_CheckMove(AActor *thing, const DVector2 &pos)
bool P_CheckMove(AActor *thing, const DVector2 &pos, bool dropoff)
{
FCheckPosition tm;
double newz = thing->Z();
@ -2469,6 +2469,17 @@ bool P_CheckMove(AActor *thing, const DVector2 &pos)
return false;
}
}
else if (dropoff)
{
const DVector3 oldpos = thing->Pos();
thing->SetOrigin(pos.X, pos.Y, newz, true);
bool hcheck = (newz - thing->MaxDropOffHeight > thing->dropoffz);
thing->SetOrigin(oldpos, true);
if (hcheck && !(thing->flags & MF_FLOAT) && !(i_compatflags & COMPATF_DROPOFF))
{
return false;
}
}
}
if (thing->flags2 & MF2_CANTLEAVEFLOORPIC

View file

@ -6707,7 +6707,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CheckBlock)
if (flags & CBF_DROPOFF)
{
mobj->SetZ(pos.Z);
checker = P_CheckMove(mobj, pos);
checker = P_CheckMove(mobj, pos, true);
mobj->SetZ(oldpos.Z);
}
else
@ -6742,8 +6742,10 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CheckBlock)
}
//[MC] I don't know why I let myself be persuaded not to include a flag.
//If an actor is loaded with pointers, they don't really have any options to spare.
//Also, fail if a dropoff or a step is too great to pass over when checking for dropoffs.
if ((!(flags & CBF_NOACTORS) && (mobj->BlockingMobj)) || (!(flags & CBF_NOLINES) && mobj->BlockingLine != NULL))
if ((!(flags & CBF_NOACTORS) && (mobj->BlockingMobj)) || (!(flags & CBF_NOLINES) && mobj->BlockingLine != NULL) ||
((flags & CBF_DROPOFF) && !checker))
{
ACTION_RETURN_STATE(block);
}

View file

@ -127,6 +127,7 @@ void DCanvas::DrawTextureParms(FTexture *img, DrawParms &parms)
FTexture::Span unmaskedSpan[2];
const FTexture::Span **spanptr, *spans;
static short bottomclipper[MAXWIDTH], topclipper[MAXWIDTH];
const BYTE *translation = NULL;
if (parms.masked)
{
@ -155,12 +156,16 @@ void DCanvas::DrawTextureParms(FTexture *img, DrawParms &parms)
// Note that this overrides DTA_Translation in software, but not in hardware.
FDynamicColormap *colormap = GetSpecialLights(MAKERGB(255,255,255),
parms.colorOverlay & MAKEARGB(0,255,255,255), 0);
parms.translation = &colormap->Maps[(APART(parms.colorOverlay)*NUMCOLORMAPS/255)*256];
translation = &colormap->Maps[(APART(parms.colorOverlay)*NUMCOLORMAPS/255)*256];
}
else if (parms.remap != NULL)
{
translation = parms.remap->Remap;
}
if (parms.translation != NULL)
if (translation != NULL)
{
dc_colormap = (lighttable_t *)parms.translation;
dc_colormap = (lighttable_t *)translation;
}
else
{
@ -421,6 +426,7 @@ bool DCanvas::SetTextureParms(DrawParms *parms, FTexture *img, double xx, double
parms->virtWidth, parms->virtHeight, parms->virtBottom, !parms->keepratio);
}
}
return false;
}
@ -461,7 +467,6 @@ bool DCanvas::ParseDrawTextureTags (FTexture *img, double x, double y, DWORD tag
parms->Alpha = 1.f;
parms->fillcolor = -1;
parms->remap = NULL;
parms->translation = NULL;
parms->colorOverlay = 0;
parms->alphaChannel = false;
parms->flipX = false;
@ -826,11 +831,6 @@ bool DCanvas::ParseDrawTextureTags (FTexture *img, double x, double y, DWORD tag
}
}
if (parms->remap != NULL)
{
parms->translation = parms->remap->Remap;
}
if (parms->style.BlendOp == 255)
{
if (fillcolorset)

View file

@ -86,9 +86,6 @@ void STACK_ARGS DCanvas::DrawChar (FFont *font, int normalcolor, int x, int y, B
//
void STACK_ARGS DCanvas::DrawText(FFont *font, int normalcolor, int x, int y, const char *string, int tag_first, ...)
{
INTBOOL boolval;
uint32 tag;
int w;
const BYTE *ch;
int c;

View file

@ -158,7 +158,6 @@ struct DrawParms
float Alpha;
uint32 fillcolor;
FRemapTable *remap;
const BYTE *translation;
uint32 colorOverlay;
INTBOOL alphaChannel;
INTBOOL flipX;