Merge branch 'master' of https://github.com/rheit/zdoom into z_osx_clean
This commit is contained in:
commit
4d799cab70
16 changed files with 78 additions and 43 deletions
|
|
@ -102,6 +102,7 @@ DEFINE_SPECIAL(Scroll_Texture_Left, 100, -1, -1, 2)
|
|||
DEFINE_SPECIAL(Scroll_Texture_Right, 101, -1, -1, 2)
|
||||
DEFINE_SPECIAL(Scroll_Texture_Up, 102, -1, -1, 2)
|
||||
DEFINE_SPECIAL(Scroll_Texture_Down, 103, -1, -1, 2)
|
||||
DEFINE_SPECIAL(Ceiling_CrushAndRaiseSilentDist, 104, 3, 5, 5)
|
||||
|
||||
DEFINE_SPECIAL(Light_ForceLightning, 109, 1, 1, 1)
|
||||
DEFINE_SPECIAL(Light_RaiseByValue, 110, 2, 2, 2)
|
||||
|
|
|
|||
|
|
@ -723,7 +723,7 @@ void AddCommandString (char *cmd, int keynum)
|
|||
// Note that deferred commands lose track of which key
|
||||
// (if any) they were pressed from.
|
||||
*brkpt = ';';
|
||||
new DWaitingCommand (brkpt, tics+1);
|
||||
new DWaitingCommand (brkpt, tics);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
#include "doomtype.h"
|
||||
#include "doomdef.h"
|
||||
#include "m_fixed.h"
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
|
@ -75,12 +76,12 @@ void ScanDirectory(TArray<FFileList> &list, const char *dirpath);
|
|||
|
||||
inline int AdjustTics(int tics)
|
||||
{
|
||||
return (tics * 98) / 100;
|
||||
return Scale(tics, 98, 100);
|
||||
}
|
||||
|
||||
inline int Tics2Seconds(int tics)
|
||||
{
|
||||
return (tics * 98) / (100 * TICRATE);
|
||||
return Scale(tics, 98, (100 * TICRATE));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -525,7 +525,7 @@ level_info_t *CheckLevelRedirect (level_info_t *info);
|
|||
|
||||
FString CalcMapName (int episode, int level);
|
||||
|
||||
void G_ParseMapInfo (const char *basemapinfo);
|
||||
void G_ParseMapInfo (FString basemapinfo);
|
||||
|
||||
void G_ClearSnapshots (void);
|
||||
void P_RemoveDefereds ();
|
||||
|
|
|
|||
|
|
@ -1886,7 +1886,7 @@ static void ClearMapinfo()
|
|||
//
|
||||
//==========================================================================
|
||||
|
||||
void G_ParseMapInfo (const char *basemapinfo)
|
||||
void G_ParseMapInfo (FString basemapinfo)
|
||||
{
|
||||
int lump, lastlump = 0;
|
||||
level_info_t gamedefaults;
|
||||
|
|
@ -1895,7 +1895,7 @@ void G_ParseMapInfo (const char *basemapinfo)
|
|||
atterm(ClearMapinfo);
|
||||
|
||||
// Parse the default MAPINFO for the current game. This lump *MUST* come from zdoom.pk3.
|
||||
if (basemapinfo != NULL)
|
||||
if (basemapinfo.IsNotEmpty())
|
||||
{
|
||||
FMapInfoParser parse;
|
||||
level_info_t defaultinfo;
|
||||
|
|
@ -1903,7 +1903,7 @@ void G_ParseMapInfo (const char *basemapinfo)
|
|||
if (Wads.GetLumpFile(baselump) > 0)
|
||||
{
|
||||
I_FatalError("File %s is overriding core lump %s.",
|
||||
Wads.GetWadFullName(Wads.GetLumpFile(baselump)), basemapinfo);
|
||||
Wads.GetWadFullName(Wads.GetLumpFile(baselump)), basemapinfo.GetChars());
|
||||
}
|
||||
parse.ParseMapInfo(baselump, gamedefaults, defaultinfo);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3747,16 +3747,16 @@ void DLevelScript::DoSetActorProperty (AActor *actor, int property, int value)
|
|||
break;
|
||||
|
||||
case APROP_Friendly:
|
||||
if (actor->CountsAsKill()) level.total_monsters--;
|
||||
if (value)
|
||||
{
|
||||
if (actor->CountsAsKill()) level.total_monsters--;
|
||||
actor->flags |= MF_FRIENDLY;
|
||||
}
|
||||
else
|
||||
{
|
||||
actor->flags &= ~MF_FRIENDLY;
|
||||
if (actor->CountsAsKill()) level.total_monsters++;
|
||||
}
|
||||
if (actor->CountsAsKill()) level.total_monsters++;
|
||||
break;
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -133,7 +133,6 @@ void DCeiling::Tick ()
|
|||
switch (m_Type)
|
||||
{
|
||||
case ceilCrushAndRaise:
|
||||
case ceilCrushAndRaiseDist:
|
||||
m_Direction = -1;
|
||||
m_Speed = m_Speed1;
|
||||
if (!SN_IsMakingLoopingSound (m_Sector))
|
||||
|
|
@ -165,7 +164,6 @@ void DCeiling::Tick ()
|
|||
switch (m_Type)
|
||||
{
|
||||
case ceilCrushAndRaise:
|
||||
case ceilCrushAndRaiseDist:
|
||||
case ceilCrushRaiseAndStay:
|
||||
m_Speed = m_Speed2;
|
||||
m_Direction = 1;
|
||||
|
|
@ -195,7 +193,6 @@ void DCeiling::Tick ()
|
|||
switch (m_Type)
|
||||
{
|
||||
case ceilCrushAndRaise:
|
||||
case ceilCrushAndRaiseDist:
|
||||
case ceilLowerAndCrush:
|
||||
case ceilLowerAndCrushDist:
|
||||
if (m_Speed1 == FRACUNIT && m_Speed2 == FRACUNIT)
|
||||
|
|
@ -257,7 +254,6 @@ DCeiling *DCeiling::Create(sector_t *sec, DCeiling::ECeiling type, line_t *line,
|
|||
switch (type)
|
||||
{
|
||||
case ceilCrushAndRaise:
|
||||
case ceilCrushAndRaiseDist:
|
||||
case ceilCrushRaiseAndStay:
|
||||
ceiling->m_TopHeight = sec->ceilingplane.d;
|
||||
case ceilLowerAndCrush:
|
||||
|
|
@ -267,7 +263,7 @@ DCeiling *DCeiling::Create(sector_t *sec, DCeiling::ECeiling type, line_t *line,
|
|||
{
|
||||
targheight += 8*FRACUNIT;
|
||||
}
|
||||
else if (type == ceilLowerAndCrushDist || type == ceilCrushAndRaiseDist)
|
||||
else if (type == ceilCrushAndRaise)
|
||||
{
|
||||
targheight += height;
|
||||
}
|
||||
|
|
@ -509,7 +505,7 @@ bool EV_DoCeiling (DCeiling::ECeiling type, line_t *line,
|
|||
|
||||
// Reactivate in-stasis ceilings...for certain types.
|
||||
// This restarts a crusher after it has been stopped
|
||||
if (type == DCeiling::ceilCrushAndRaise || type == DCeiling::ceilCrushAndRaiseDist)
|
||||
if (type == DCeiling::ceilCrushAndRaise)
|
||||
{
|
||||
P_ActivateInStasisCeiling (tag);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -641,7 +641,7 @@ FUNC(LS_Ceiling_CrushAndRaiseA)
|
|||
FUNC(LS_Ceiling_CrushAndRaiseDist)
|
||||
// Ceiling_CrushAndRaiseDist (tag, dist, speed, damage, crushtype)
|
||||
{
|
||||
return EV_DoCeiling (DCeiling::ceilCrushAndRaiseDist, ln, arg0, SPEED(arg2), SPEED(arg2), arg1*FRACUNIT, arg3, 0, 0, CRUSHTYPE(arg4));
|
||||
return EV_DoCeiling (DCeiling::ceilCrushAndRaise, ln, arg0, SPEED(arg2), SPEED(arg2), arg1*FRACUNIT, arg3, 0, 0, CRUSHTYPE(arg4));
|
||||
}
|
||||
|
||||
FUNC(LS_Ceiling_CrushAndRaiseSilentA)
|
||||
|
|
@ -650,6 +650,12 @@ FUNC(LS_Ceiling_CrushAndRaiseSilentA)
|
|||
return EV_DoCeiling (DCeiling::ceilCrushAndRaise, ln, arg0, SPEED(arg1), SPEED(arg2), 0, arg3, 1, 0, CRUSHTYPE(arg4));
|
||||
}
|
||||
|
||||
FUNC(LS_Ceiling_CrushAndRaiseSilentDist)
|
||||
// Ceiling_CrushAndRaiseSilentDist (tag, dist, upspeed, damage, crushtype)
|
||||
{
|
||||
return EV_DoCeiling (DCeiling::ceilCrushAndRaise, ln, arg0, SPEED(arg2), SPEED(arg2), arg1*FRACUNIT, arg3, 1, 0, CRUSHTYPE(arg4));
|
||||
}
|
||||
|
||||
FUNC(LS_Ceiling_RaiseToNearest)
|
||||
// Ceiling_RaiseToNearest (tag, speed)
|
||||
{
|
||||
|
|
@ -3261,7 +3267,7 @@ lnSpecFunc LineSpecials[256] =
|
|||
/* 101 */ LS_NOP, // Scroll_Texture_Right
|
||||
/* 102 */ LS_NOP, // Scroll_Texture_Up
|
||||
/* 103 */ LS_NOP, // Scroll_Texture_Down
|
||||
/* 104 */ LS_NOP,
|
||||
/* 104 */ LS_Ceiling_CrushAndRaiseSilentDist,
|
||||
/* 105 */ LS_NOP,
|
||||
/* 106 */ LS_NOP,
|
||||
/* 107 */ LS_NOP,
|
||||
|
|
|
|||
|
|
@ -628,7 +628,6 @@ public:
|
|||
ceilLowerInstant,
|
||||
ceilRaiseInstant,
|
||||
ceilCrushAndRaise,
|
||||
ceilCrushAndRaiseDist,
|
||||
ceilLowerAndCrush,
|
||||
ceilLowerAndCrushDist,
|
||||
ceilCrushRaiseAndStay,
|
||||
|
|
|
|||
|
|
@ -2076,9 +2076,22 @@ void R_DrawSprite (vissprite_t *spr)
|
|||
r1 = MAX<int> (ds->x1, x1);
|
||||
r2 = MIN<int> (ds->x2, x2);
|
||||
|
||||
fixed_t neardepth, fardepth;
|
||||
if (!spr->bWallSprite)
|
||||
{
|
||||
if (ds->sz1 < ds->sz2)
|
||||
{
|
||||
neardepth = ds->sz1, fardepth = ds->sz2;
|
||||
}
|
||||
else
|
||||
{
|
||||
neardepth = ds->sz2, fardepth = ds->sz1;
|
||||
}
|
||||
}
|
||||
// Check if sprite is in front of draw seg:
|
||||
if (DMulScale32(spr->gy - ds->curline->v1->y, ds->curline->v2->x - ds->curline->v1->x,
|
||||
ds->curline->v1->x - spr->gx, ds->curline->v2->y - ds->curline->v1->y) <= 0)
|
||||
if ((!spr->bWallSprite && neardepth > spr->depth) || ((spr->bWallSprite || fardepth > spr->depth) &&
|
||||
DMulScale32(spr->gy - ds->curline->v1->y, ds->curline->v2->x - ds->curline->v1->x,
|
||||
ds->curline->v1->x - spr->gx, ds->curline->v2->y - ds->curline->v1->y) <= 0))
|
||||
{
|
||||
// seg is behind sprite, so draw the mid texture if it has one
|
||||
if (ds->maskedtexturecol != -1 || ds->bFogBoundary)
|
||||
|
|
|
|||
|
|
@ -540,7 +540,7 @@ bool MIDIStreamer::IsPlaying()
|
|||
|
||||
void MIDIStreamer::MusicVolumeChanged()
|
||||
{
|
||||
if (MIDI->FakeVolume())
|
||||
if (MIDI != NULL && MIDI->FakeVolume())
|
||||
{
|
||||
float realvolume = clamp<float>(snd_musicvolume * relative_volume, 0.f, 1.f);
|
||||
Volume = clamp<DWORD>((DWORD)(realvolume * 65535.f), 0, 65535);
|
||||
|
|
@ -622,7 +622,7 @@ void MIDIStreamer::FluidSettingStr(const char *setting, const char *value)
|
|||
|
||||
void MIDIStreamer::OutputVolume (DWORD volume)
|
||||
{
|
||||
if (MIDI->FakeVolume())
|
||||
if (MIDI != NULL && MIDI->FakeVolume())
|
||||
{
|
||||
NewVolume = volume;
|
||||
VolumeChanged = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue