From cd4076dc1bba6779038a8a2eabdf63ba95af0476 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Thu, 7 Jan 2016 12:49:38 -0600 Subject: [PATCH 1/4] Added $ check for language support for StaticTextSwitchable --- src/menu/optionmenuitems.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/menu/optionmenuitems.h b/src/menu/optionmenuitems.h index c63359f4b4..3054847c1e 100644 --- a/src/menu/optionmenuitems.h +++ b/src/menu/optionmenuitems.h @@ -32,6 +32,7 @@ ** */ #include "v_text.h" +#include "gstrings.h" void M_DrawConText (int color, int x, int y, const char *str); @@ -503,6 +504,7 @@ public: int Draw(FOptionMenuDescriptor *desc, int y, int indent, bool selected) { const char *txt = mCurrent? (const char*)mAltText : mLabel; + if (*txt == '$') txt = GStrings(txt + 1); int w = SmallFont->StringWidth(txt) * CleanXfac_1; int x = (screen->GetWidth() - w) / 2; screen->DrawText (SmallFont, mColor, x, y, txt, DTA_CleanNoMove_1, true, TAG_DONE); From efaaccc0306de2362a29c3b68db3f8f5b0c92cfc Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Thu, 7 Jan 2016 12:58:36 -0600 Subject: [PATCH 2/4] Added $ check for language support for drawing Option Values --- src/menu/optionmenuitems.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/menu/optionmenuitems.h b/src/menu/optionmenuitems.h index 3054847c1e..0b0b57759d 100644 --- a/src/menu/optionmenuitems.h +++ b/src/menu/optionmenuitems.h @@ -200,6 +200,7 @@ public: { text = (*opt)->mValues[Selection].Text; } + if (*text == '$') text = GStrings(text + 1); screen->DrawText (SmallFont, OptionSettings.mFontColorValue, indent + CURSORSPACE, y, text, DTA_CleanNoMove_1, true, DTA_ColorOverlay, overlay, TAG_DONE); return indent; From d20f18a4bb5efad73a7c782d96b39f4a1e58f5ed Mon Sep 17 00:00:00 2001 From: Kyle Evans Date: Thu, 7 Jan 2016 22:48:25 -0600 Subject: [PATCH 3/4] I missed one last spot where a FreeBSD compilation should follow the path of OS X -- needs to be pulled in for signal functions --- src/posix/sdl/crashcatcher.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/posix/sdl/crashcatcher.c b/src/posix/sdl/crashcatcher.c index f85713e312..70c9e7b0cb 100644 --- a/src/posix/sdl/crashcatcher.c +++ b/src/posix/sdl/crashcatcher.c @@ -15,7 +15,7 @@ #ifndef PR_SET_PTRACER #define PR_SET_PTRACER 0x59616d61 #endif -#elif defined (__APPLE__) +#elif defined (__APPLE__) || defined (__FreeBSD__) #include #endif From cf564c60c214751bbc3b8511f688104ac9f618b2 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 9 Jan 2016 01:23:00 +0100 Subject: [PATCH 4/4] - simplified setup of polyobjects defined from explicit lines The old method had a problem with missing order numbers and aborted the level load and made many assumptions that no longer apply with BSP based polyobject rendering. --- src/po_man.cpp | 64 ++++++++++++++------------------------------------ 1 file changed, 17 insertions(+), 47 deletions(-) diff --git a/src/po_man.cpp b/src/po_man.cpp index 60627e4f3c..fac9a660b9 100644 --- a/src/po_man.cpp +++ b/src/po_man.cpp @@ -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) { unsigned int ii; @@ -1577,59 +1582,24 @@ static void SpawnPolyobj (int index, int tag, int type) // didn't find a polyobj through PO_LINE_START TArray polySideList; unsigned int psIndexOld; - for (j = 1; j < PO_MAXPOLYSEGS; j++) - { - psIndexOld = po->Sidedefs.Size(); - for (ii = 0; ii < KnownPolySides.Size(); ++ii) - { - i = KnownPolySides[ii]; + psIndexOld = po->Sidedefs.Size(); - if (i >= 0 && - sides[i].linedef->special == Polyobj_ExplicitLine && - sides[i].linedef->args[0] == tag) - { - if (!sides[i].linedef->args[1]) - { - I_Error ("SpawnPolyobj: Explicit line missing order number (probably %d) in poly %d.\n", - j+1, tag); - } - if (sides[i].linedef->args[1] == j) - { - po->Sidedefs.Push (&sides[i]); - } - } - } - // 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) + 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 = KnownPolySides[ii]; - if (i >= 0 && - sides[i].linedef->special == Polyobj_ExplicitLine && - sides[i].linedef->args[0] == tag && sides[i].linedef->args[1] == j) + if (!sides[i].linedef->args[1]) { - 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); - } + I_Error("SpawnPolyobj: Explicit line missing order number in poly %d, linedef %d.\n", tag, int(sides[i].linedef - lines)); } + po->Sidedefs.Push (&sides[i]); } } + qsort(&po->Sidedefs[0], po->Sidedefs.Size(), sizeof(po->Sidedefs[0]), posicmp); if (po->Sidedefs.Size() > 0) { po->crush = (type != SMT_PolySpawn) ? 3 : 0;