Skip to content

Commit

Permalink
Merge commit 'a1026ff' into release-q1.2.2
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/r_draw.cpp
#	src/version.h
  • Loading branch information
madame-rachelle committed Jan 11, 2017
2 parents a57ebbd + a1026ff commit b0a81b3
Show file tree
Hide file tree
Showing 31 changed files with 115 additions and 53 deletions.
1 change: 1 addition & 0 deletions src/actionspecials.h
Original file line number Diff line number Diff line change
Expand Up @@ -258,5 +258,6 @@ DEFINE_SPECIAL(Ceiling_LowerByTexture, 269, 2, 4, 4)
DEFINE_SPECIAL(Stairs_BuildDownDoom, 270, 5, 5, 5)
DEFINE_SPECIAL(Stairs_BuildUpDoomSync, 271, 4, 4, 4)
DEFINE_SPECIAL(Stairs_BuildDownDoomSync, 272, 4, 4, 4)
DEFINE_SPECIAL(Stairs_BuildUpDoomCrush, 273, 5, 5, 5)

#undef DEFINE_SPECIAL
6 changes: 5 additions & 1 deletion src/c_dispatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1040,7 +1040,11 @@ FString BuildString (int argc, FString *argv)

for (arg = 0; arg < argc; arg++)
{
if (strchr(argv[arg], '"'))
if (argv[arg][0] == '\0')
{ // It's an empty argument, we need to convert it to '""'
buf << "\"\" ";
}
else if (strchr(argv[arg], '"'))
{ // If it contains one or more quotes, we need to escape them.
buf << '"';
long substr_start = 0, quotepos;
Expand Down
3 changes: 3 additions & 0 deletions src/dthinker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,9 @@ DThinker *FThinkerIterator::Next (bool exact)
{
return thinker;
}
// This can actually happen when a Destroy call on 'thinker' happens to destroy 'm_CurrThinker'.
// In that case there is no chance to recover, we have to terminate the iteration of this list.
if (m_CurrThinker == nullptr) break;
}
}
if ((m_SearchingFresh = !m_SearchingFresh))
Expand Down
2 changes: 2 additions & 0 deletions src/g_inventory/a_pickups.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,8 @@ void AInventory::BecomeItem ()
RemoveFromHash ();
flags &= ~MF_SPECIAL;
ChangeStatNum(STAT_INVENTORY);
// stop all sounds this item is playing.
for(int i = 1;i<=7;i++) S_StopSound(this, i);
SetState (FindState("Held"));
}

Expand Down
3 changes: 3 additions & 0 deletions src/gi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,9 @@ void FMapInfoParser::ParseGameInfo()
GAMEINFOKEY_STRINGARRAY(finalePages, "finalePage", 8, true)
GAMEINFOKEY_STRINGARRAY(infoPages, "addinfoPage", 8, false)
GAMEINFOKEY_STRINGARRAY(infoPages, "infoPage", 8, true)
GAMEINFOKEY_STRINGARRAY(PrecachedClasses, "precacheclasses", 0, false)
GAMEINFOKEY_STRINGARRAY(PrecachedTextures, "precachetextures", 0, false)
GAMEINFOKEY_STRINGARRAY(PrecachedSounds, "precachesounds", 0, false)
GAMEINFOKEY_STRING(PauseSign, "pausesign")
GAMEINFOKEY_STRING(quitSound, "quitSound")
GAMEINFOKEY_STRING(BorderFlat, "borderFlat")
Expand Down
5 changes: 5 additions & 0 deletions src/gi.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@

#include "basictypes.h"
#include "zstring.h"
#include "s_sound.h"

// Flags are not user configurable and only depend on the standard IWADs
#define GI_MAPxx 0x00000001
Expand Down Expand Up @@ -120,6 +121,10 @@ struct gameinfo_t
TArray<FName> DefaultWeaponSlots[10];
TArray<FName> PlayerClasses;

TArray<FName> PrecachedClasses;
TArray<FString> PrecachedTextures;
TArray<FSoundID> PrecachedSounds;

FString titleMusic;
int titleOrder;
float titleTime;
Expand Down
3 changes: 3 additions & 0 deletions src/menu/playermenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1108,6 +1108,9 @@ bool DPlayerMenu::MouseEvent(int type, int x, int y)
SendNewColor (RPART(color), GPART(color), v);
}
break;
case NAME_Autoaim:
AutoaimChanged(li);
break;
}
}
return res;
Expand Down
4 changes: 2 additions & 2 deletions src/p_effect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ void P_ThinkParticles ()
auto oldtrans = particle->alpha;
particle->alpha -= particle->fadestep;
particle->size += particle->sizestep;
if (oldtrans < particle->alpha || --particle->ttl <= 0 || (particle->size <= 0))
if (particle->alpha <= 0 || oldtrans < particle->alpha || --particle->ttl <= 0 || (particle->size <= 0))
{ // The particle has expired, so free it
memset (particle, 0, sizeof(particle_t));
if (prev)
Expand Down Expand Up @@ -763,7 +763,7 @@ void P_DrawRailTrail(AActor *source, TArray<SPortalHit> &portalhits, int color1,
int spiralduration = (duration == 0) ? 35 : duration;

p->alpha = 1.f;
p->ttl = duration;
p->ttl = spiralduration;
p->fadestep = FADEFROMTTL(spiralduration);
p->size = 3;
p->bright = fullbright;
Expand Down
2 changes: 1 addition & 1 deletion src/p_floor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ bool EV_BuildStairs (int tag, DFloor::EStair type, line_t *line,
floor->m_PauseTime = 0;
floor->m_StepTime = floor->m_PerStepTime = persteptime;

floor->m_Crush = (!(usespecials & DFloor::stairUseSpecials) && speed == 4) ? 10 : -1; //jff 2/27/98 fix uninitialized crush field
floor->m_Crush = (usespecials & DFloor::stairCrush) ? 10 : -1; //jff 2/27/98 fix uninitialized crush field
floor->m_Hexencrush = false;

floor->m_Speed = speed;
Expand Down
8 changes: 8 additions & 0 deletions src/p_lnspec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,13 @@ FUNC(LS_Stairs_BuildUpDoom)
arg2, SPEED(arg1), TICS(arg3), arg4, 0, 0);
}

FUNC(LS_Stairs_BuildUpDoomCrush)
// Stairs_BuildUpDoom (tag, speed, height, delay, reset)
{
return EV_BuildStairs(arg0, DFloor::buildUp, ln,
arg2, SPEED(arg1), TICS(arg3), arg4, 0, DFloor::stairCrush);
}

FUNC(LS_Stairs_BuildDownDoom)
// Stair_BuildDownDoom (tag, speed, height, delay, reset)
{
Expand Down Expand Up @@ -3582,6 +3589,7 @@ static lnSpecFunc LineSpecials[] =
/* 270 */ LS_Stairs_BuildDownDoom,
/* 271 */ LS_Stairs_BuildUpDoomSync,
/* 272 */ LS_Stairs_BuildDownDoomSync,
/* 273 */ LS_Stairs_BuildUpDoomCrush,

};

Expand Down
10 changes: 10 additions & 0 deletions src/p_setup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3383,6 +3383,11 @@ static void P_PrecacheLevel()
actorhitlist[actor->GetClass()] = true;
}

for (auto n : gameinfo.PrecachedClasses)
{
PClassActor *cls = PClass::FindActor(n);
if (cls != NULL) actorhitlist[cls] = true;
}
for (unsigned i = 0; i < level.info->PrecacheClasses.Size(); i++)
{
// level.info can only store names, no class pointers.
Expand Down Expand Up @@ -3419,6 +3424,11 @@ static void P_PrecacheLevel()
hitlist[sky2texture.GetIndex()] |= FTextureManager::HIT_Sky;
}

for (auto n : gameinfo.PrecachedTextures)
{
FTextureID tex = TexMan.CheckForTexture(n, FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable | FTextureManager::TEXMAN_TryAny | FTextureManager::TEXMAN_ReturnFirst);
if (tex.Exists()) hitlist[tex.GetIndex()] |= FTextureManager::HIT_Wall;
}
for (unsigned i = 0; i < level.info->PrecacheTextures.Size(); i++)
{
FTextureID tex = TexMan.CheckForTexture(level.info->PrecacheTextures[i], FTexture::TEX_Wall, FTextureManager::TEXMAN_Overridable | FTextureManager::TEXMAN_TryAny | FTextureManager::TEXMAN_ReturnFirst);
Expand Down
2 changes: 2 additions & 0 deletions src/p_sight.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ class SightCheck
sightend = t2->PosRelative(task->portalgroup);
sightstart.Z += t1->Height * 0.75;

portalgroup = task->portalgroup;
Startfrac = task->Frac;
Trace = { sightstart.X, sightstart.Y, sightend.X - sightstart.X, sightend.Y - sightstart.Y };
Lastztop = Lastzbottom = sightstart.Z;
Expand Down Expand Up @@ -790,6 +791,7 @@ sightcounts[2]++;

bool traverseres = P_SightTraverseIntercepts ( );
if (itres == -1) return false; // if the iterator had an early out there was no line of sight. The traverser was only called to collect more portals.
if (seeingthing->Sector->PortalGroup != portalgroup) return false; // We are in a different group than the seeingthing, so this trace cannot determine visibility alone.
return traverseres;
}

Expand Down
3 changes: 2 additions & 1 deletion src/p_spec.h
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,8 @@ class DFloor : public DMovingFloor
enum EStairType
{
stairUseSpecials = 1,
stairSync = 2
stairSync = 2,
stairCrush = 4,
};

DFloor (sector_t *sec);
Expand Down
4 changes: 2 additions & 2 deletions src/r_draw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ namespace swrenderer
R_SetColorMapLight(basecolormap, 0, 0);
}
bool active_columnmethod = r_columnmethod && !r_swtruecolor;
return active_columnmethod ? DoDraw1 : DoDraw0;
return active_columnmethod ? DoDraw0;
}

fglevel = GetAlpha(style.SrcAlpha, alpha);
Expand Down Expand Up @@ -501,7 +501,7 @@ namespace swrenderer
return DontDraw;
}
bool active_columnmethod = r_columnmethod && !r_swtruecolor;
return active_columnmethod ? DoDraw1 : DoDraw0;
return active_columnmethod ? DoDraw0;
}

ESPSResult R_SetPatchStyle(FRenderStyle style, float alpha, int translation, uint32_t color)
Expand Down
4 changes: 4 additions & 0 deletions src/s_sound.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,10 @@ void S_PrecacheLevel ()
{
actor->MarkPrecacheSounds();
}
for (auto i : gameinfo.PrecachedSounds)
{
level.info->PrecacheSounds[i].MarkUsed();
}
// Precache all extra sounds requested by this map.
for (i = 0; i < level.info->PrecacheSounds.Size(); ++i)
{
Expand Down
10 changes: 9 additions & 1 deletion src/scripting/zscript/zcc_compile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2336,6 +2336,7 @@ void ZCCCompiler::CompileFunction(ZCC_StructWork *c, ZCC_FuncDeclarator *f, bool
sym->Variants[0].Implementation->DefaultArgs = std::move(argdefaults);
}

PClass *clstype = static_cast<PClass *>(c->Type());
if (varflags & VARF_Virtual)
{
if (sym->Variants[0].Implementation == nullptr)
Expand All @@ -2349,7 +2350,6 @@ void ZCCCompiler::CompileFunction(ZCC_StructWork *c, ZCC_FuncDeclarator *f, bool
}
if (forclass)
{
PClass *clstype = static_cast<PClass *>(c->Type());
int vindex = clstype->FindVirtualIndex(sym->SymbolName, sym->Variants[0].Proto);
// specifying 'override' is necessary to prevent one of the biggest problem spots with virtual inheritance: Mismatching argument types.
if (varflags & VARF_Override)
Expand Down Expand Up @@ -2383,6 +2383,14 @@ void ZCCCompiler::CompileFunction(ZCC_StructWork *c, ZCC_FuncDeclarator *f, bool
Error(p, "Virtual functions can only be defined for classes");
}
}
else if (forclass)
{
int vindex = clstype->FindVirtualIndex(sym->SymbolName, sym->Variants[0].Proto);
if (vindex != -1)
{
Error(f, "Function %s attempts to override parent function without 'override' qualifier", FName(f->Name).GetChars());
}
}
}
}

Expand Down
42 changes: 24 additions & 18 deletions src/sound/oalsound.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ class OpenALSoundStream : public SoundStream
virtual FString GetStats()
{
FString stats;
size_t pos, len;
size_t pos = 0, len = 0;
ALfloat volume;
ALint offset;
ALint processed;
Expand All @@ -429,28 +429,34 @@ class OpenALSoundStream : public SoundStream
return stats;
}

pos = Decoder->getSampleOffset();
len = Decoder->getSampleLength();
if (Decoder != nullptr)
{
pos = Decoder->getSampleOffset();
len = Decoder->getSampleLength();
}
lock.unlock();

stats = (state == AL_INITIAL) ? "Buffering" : (state == AL_STOPPED) ? "Underrun" :
(state == AL_PLAYING || state == AL_PAUSED) ? "Ready" : "Unknown state";

if(state == AL_STOPPED)
offset = BufferCount * (Data.Size()/FrameSize);
else
{
size_t rem = queued*(Data.Size()/FrameSize) - offset;
if(pos > rem) pos -= rem;
else if(len > 0) pos += len - rem;
else pos = 0;
}
pos = (size_t)(pos * 1000.0 / SampleRate);
len = (size_t)(len * 1000.0 / SampleRate);
stats.AppendFormat(",%3u%% buffered", 100 - 100*offset/(BufferCount*(Data.Size()/FrameSize)));
stats.AppendFormat(", %zu.%03zu", pos/1000, pos%1000);
if(len > 0)
stats.AppendFormat(" / %zu.%03zu", len/1000, len%1000);
if (Decoder != nullptr)
{
if (state == AL_STOPPED)
offset = BufferCount * (Data.Size() / FrameSize);
else
{
size_t rem = queued*(Data.Size() / FrameSize) - offset;
if (pos > rem) pos -= rem;
else if (len > 0) pos += len - rem;
else pos = 0;
}
pos = (size_t)(pos * 1000.0 / SampleRate);
len = (size_t)(len * 1000.0 / SampleRate);
stats.AppendFormat(",%3u%% buffered", 100 - 100 * offset / (BufferCount*(Data.Size() / FrameSize)));
stats.AppendFormat(", %zu.%03zu", pos / 1000, pos % 1000);
if (len > 0)
stats.AppendFormat(" / %zu.%03zu", len / 1000, len % 1000);
}
if(state == AL_PAUSED)
stats += ", paused";
if(state == AL_PLAYING)
Expand Down
8 changes: 4 additions & 4 deletions src/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ const char *GetVersionString();

/** Lots of different version numbers **/

#define VERSIONSTR "1.2.1"
#define VERSIONSTR "1.2.2"

// The version as seen in the Windows resource
#define RC_FILEVERSION 1,2,1,0
#define RC_PRODUCTVERSION 1,2,1,0
#define RC_PRODUCTVERSION2 "1.2.1"
#define RC_FILEVERSION 1,2,2,0
#define RC_PRODUCTVERSION 1,2,2,0
#define RC_PRODUCTVERSION2 "1.2.2"

// Version identifier for network games.
// Bump it every time you do a release unless you're certain you
Expand Down
5 changes: 5 additions & 0 deletions src/win32/win32gliface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,11 @@ DFrameBuffer *Win32GLVideo::CreateFrameBuffer(int width, int height, bool bgra,
{
Win32GLFrameBuffer *fb;

if (fs)
{
I_ClosestResolution(&width, &height, 32);
}

m_DisplayWidth = width;
m_DisplayHeight = height;
m_DisplayBits = 32;
Expand Down
5 changes: 5 additions & 0 deletions src/win32/win32video.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -641,6 +641,11 @@ DFrameBuffer *Win32Video::CreateFrameBuffer (int width, int height, bool bgra, b
PalEntry flashColor;
int flashAmount;

if (fullscreen)
{
I_ClosestResolution(&width, &height, D3D ? 32 : 8);
}

LOG4 ("CreateFB %d %d %d %p\n", width, height, fullscreen, old);

if (old != NULL)
Expand Down
1 change: 0 additions & 1 deletion wadsrc/static/language.enu
Original file line number Diff line number Diff line change
Expand Up @@ -1780,7 +1780,6 @@ DSPLYMNU_SCREENSIZE = "Screen size";
DSPLYMNU_BRIGHTNESS = "Brightness";
DSPLYMNU_VSYNC = "Vertical Sync";
DSPLYMNU_CAPFPS = "Rendering Interpolation";
DSPLYMNU_COLUMNMETHOD = "Column render mode";
DSPLYMNU_WIPETYPE = "Screen wipe style";
DSPLYMNU_SHOWENDOOM = "Show ENDOOM screen";
DSPLYMNU_BLOODFADE = "Blood Flash Intensity";
Expand Down
7 changes: 0 additions & 7 deletions wadsrc/static/menudef.txt
Original file line number Diff line number Diff line change
Expand Up @@ -595,12 +595,6 @@ OptionMenu "JoystickConfigMenu"
//
//-------------------------------------------------------------------------------------------

OptionValue ColumnMethods
{
0.0, "$OPTVAL_ORIGINAL"
1.0, "$OPTVAL_OPTIMIZED"
}

OptionValue SkyModes
{
0.0, "$OPTVAL_NORMAL"
Expand Down Expand Up @@ -696,7 +690,6 @@ OptionMenu "VideoOptions"
Slider "$DSPLYMNU_BLOODFADE", "blood_fade_scalar", 0.0, 1.0, 0.05, 2
Slider "$DSPLYMNU_PICKUPFADE", "pickup_fade_scalar", 0.0, 1.0, 0.05, 2
Slider "$DSPLYMNU_WATERFADE", "underwater_fade_scalar", 0.0, 1.0, 0.05, 2
Option "$DSPLYMNU_COLUMNMETHOD", "r_columnmethod", "ColumnMethods"

StaticText " "
Option "$DSPLYMNU_WIPETYPE", "wipetype", "Wipes"
Expand Down
8 changes: 4 additions & 4 deletions wadsrc/static/xlat/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ include "xlat/defines.i"
97 = WALK|REP|MONST, Teleport (0, tag)
98 = WALK|REP, Floor_LowerToHighest (tag, F_FAST, 136)
99 = USE|REP, Door_LockedRaise (tag, D_FAST, 0, BCard | CardIsSkull)
100 = WALK, Stairs_BuildUpDoom (tag, ST_TURBO, 16, 0, 0)
100 = WALK, Stairs_BuildUpDoomCrush (tag, ST_TURBO, 16, 0, 0)
101 = USE, Floor_RaiseToLowestCeiling (tag, F_SLOW)
102 = USE, Floor_LowerToHighest (tag, F_SLOW, 128)
103 = USE, Door_Open (tag, D_SLOW)
Expand All @@ -126,7 +126,7 @@ include "xlat/defines.i"
124 = WALK, Exit_Secret (0)
125 = MONWALK, Teleport (0, tag)
126 = MONWALK|REP, Teleport (0, tag)
127 = USE, Stairs_BuildUpDoom (tag, ST_TURBO, 16, 0, 0)
127 = USE, Stairs_BuildUpDoomCrush (tag, ST_TURBO, 16, 0, 0)
128 = WALK|REP, Floor_RaiseToNearest (tag, F_SLOW)
129 = WALK|REP, Floor_RaiseToNearest (tag, F_FAST)
130 = WALK, Floor_RaiseToNearest (tag, F_FAST)
Expand Down Expand Up @@ -259,9 +259,9 @@ include "xlat/defines.i"
254 = 0, Scroll_Texture_Model (lineid, 0)
255 = 0, Scroll_Texture_Offsets ()
256 = WALK|REP, Stairs_BuildUpDoom (tag, ST_SLOW, 8, 0, 0)
257 = WALK|REP, Stairs_BuildUpDoom (tag, ST_TURBO, 16, 0, 0)
257 = WALK|REP, Stairs_BuildUpDoomCrush (tag, ST_TURBO, 16, 0, 0)
258 = USE|REP, Stairs_BuildUpDoom (tag, ST_SLOW, 8, 0, 0)
259 = USE|REP, Stairs_BuildUpDoom (tag, ST_TURBO, 16, 0, 0)
259 = USE|REP, Stairs_BuildUpDoomCrush (tag, ST_TURBO, 16, 0, 0)
260 = 0, TranslucentLine (lineid, 168) // Changed to better reflect the BOOM default
261 = 0, Transfer_CeilingLight (tag)
262 = WALK|MONST, Teleport_Line (tag, tag, 1)
Expand Down
Loading

0 comments on commit b0a81b3

Please sign in to comment.