Merge branch 'zmaster'

This commit is contained in:
Christoph Oelckers 2016-01-09 01:23:45 +01:00
commit 23ff54c942
3 changed files with 21 additions and 48 deletions

View file

@ -32,6 +32,7 @@
** **
*/ */
#include "v_text.h" #include "v_text.h"
#include "gstrings.h"
void M_DrawConText (int color, int x, int y, const char *str); void M_DrawConText (int color, int x, int y, const char *str);
@ -199,6 +200,7 @@ public:
{ {
text = (*opt)->mValues[Selection].Text; text = (*opt)->mValues[Selection].Text;
} }
if (*text == '$') text = GStrings(text + 1);
screen->DrawText (SmallFont, OptionSettings.mFontColorValue, indent + CURSORSPACE, y, screen->DrawText (SmallFont, OptionSettings.mFontColorValue, indent + CURSORSPACE, y,
text, DTA_CleanNoMove_1, true, DTA_ColorOverlay, overlay, TAG_DONE); text, DTA_CleanNoMove_1, true, DTA_ColorOverlay, overlay, TAG_DONE);
return indent; return indent;
@ -503,6 +505,7 @@ public:
int Draw(FOptionMenuDescriptor *desc, int y, int indent, bool selected) int Draw(FOptionMenuDescriptor *desc, int y, int indent, bool selected)
{ {
const char *txt = mCurrent? (const char*)mAltText : mLabel; const char *txt = mCurrent? (const char*)mAltText : mLabel;
if (*txt == '$') txt = GStrings(txt + 1);
int w = SmallFont->StringWidth(txt) * CleanXfac_1; int w = SmallFont->StringWidth(txt) * CleanXfac_1;
int x = (screen->GetWidth() - w) / 2; int x = (screen->GetWidth() - w) / 2;
screen->DrawText (SmallFont, mColor, x, y, txt, DTA_CleanNoMove_1, true, TAG_DONE); screen->DrawText (SmallFont, mColor, x, y, txt, DTA_CleanNoMove_1, true, TAG_DONE);

View file

@ -1533,6 +1533,11 @@ static void IterFindPolySides (FPolyObj *po, side_t *side)
// //
//========================================================================== //==========================================================================
static int STACK_ARGS posicmp(const void *a, const void *b)
{
return (*(const side_t **)a)->linedef->args[1] - (*(const side_t **)b)->linedef->args[1];
}
static void SpawnPolyobj (int index, int tag, int type) static void SpawnPolyobj (int index, int tag, int type)
{ {
unsigned int ii; unsigned int ii;
@ -1577,9 +1582,8 @@ static void SpawnPolyobj (int index, int tag, int type)
// didn't find a polyobj through PO_LINE_START // didn't find a polyobj through PO_LINE_START
TArray<side_t *> polySideList; TArray<side_t *> polySideList;
unsigned int psIndexOld; unsigned int psIndexOld;
for (j = 1; j < PO_MAXPOLYSEGS; j++)
{
psIndexOld = po->Sidedefs.Size(); psIndexOld = po->Sidedefs.Size();
for (ii = 0; ii < KnownPolySides.Size(); ++ii) for (ii = 0; ii < KnownPolySides.Size(); ++ii)
{ {
i = KnownPolySides[ii]; i = KnownPolySides[ii];
@ -1590,46 +1594,12 @@ static void SpawnPolyobj (int index, int tag, int type)
{ {
if (!sides[i].linedef->args[1]) if (!sides[i].linedef->args[1])
{ {
I_Error ("SpawnPolyobj: Explicit line missing order number (probably %d) in poly %d.\n", I_Error("SpawnPolyobj: Explicit line missing order number in poly %d, linedef %d.\n", tag, int(sides[i].linedef - lines));
j+1, tag);
} }
if (sides[i].linedef->args[1] == j)
{
po->Sidedefs.Push (&sides[i]); po->Sidedefs.Push (&sides[i]);
} }
} }
} qsort(&po->Sidedefs[0], po->Sidedefs.Size(), sizeof(po->Sidedefs[0]), posicmp);
// Clear out any specials for these segs...we cannot clear them out
// in the above loop, since we aren't guaranteed one seg per linedef.
for (ii = 0; ii < KnownPolySides.Size(); ++ii)
{
i = KnownPolySides[ii];
if (i >= 0 &&
sides[i].linedef->special == Polyobj_ExplicitLine &&
sides[i].linedef->args[0] == tag && sides[i].linedef->args[1] == j)
{
sides[i].linedef->special = 0;
sides[i].linedef->args[0] = 0;
KnownPolySides[ii] = -1;
}
}
if (po->Sidedefs.Size() == psIndexOld)
{ // Check if an explicit line order has been skipped.
// A line has been skipped if there are any more explicit
// lines with the current tag value. [RH] Can this actually happen?
for (ii = 0; ii < KnownPolySides.Size(); ++ii)
{
i = KnownPolySides[ii];
if (i >= 0 &&
sides[i].linedef->special == Polyobj_ExplicitLine &&
sides[i].linedef->args[0] == tag)
{
I_Error ("SpawnPolyobj: Missing explicit line %d for poly %d\n",
j, tag);
}
}
}
}
if (po->Sidedefs.Size() > 0) if (po->Sidedefs.Size() > 0)
{ {
po->crush = (type != SMT_PolySpawn) ? 3 : 0; po->crush = (type != SMT_PolySpawn) ? 3 : 0;

View file

@ -15,7 +15,7 @@
#ifndef PR_SET_PTRACER #ifndef PR_SET_PTRACER
#define PR_SET_PTRACER 0x59616d61 #define PR_SET_PTRACER 0x59616d61
#endif #endif
#elif defined (__APPLE__) #elif defined (__APPLE__) || defined (__FreeBSD__)
#include <signal.h> #include <signal.h>
#endif #endif