diff --git a/specs/usdf.txt b/specs/usdf.txt index 1367ccfbf..093c9e7d7 100644 --- a/specs/usdf.txt +++ b/specs/usdf.txt @@ -87,14 +87,16 @@ conversation // Starts a dialog. page // Starts a new page. Pages are automatically numbered starting at 1. { - name = ; // Name that goes in the upper left hand corner - panel = ; // Name of lump to render as the background. - voice = ; // Narration sound lump. - dialog = ; // Dialog of the page. - drop = ; // mobj for the object to drop if the actor is - // killed. - link = ; // Page to jump to if all ifitem conditions are - // satisified. + name = ; // Name that goes in the upper left hand corner + panel = ; // Name of lump to render as the background. + voice = ; // Narration sound lump. + dialog = ; // Dialog of the page. + goodbye = ; // Custom goodbye message. If omitted then the + // generic goodbyes will be displayed instead. + drop = ; // mobj for the object to drop if the actor is + // killed. + link = ; // Page to jump to if all ifitem conditions are + // satisified. // jumps to the specified page if the player has the specified amount // or more of item in their inventory. This can be repeated as many diff --git a/src/namedef.h b/src/namedef.h index 8d60c97ee..eedbaf899 100644 --- a/src/namedef.h +++ b/src/namedef.h @@ -584,6 +584,7 @@ xx(Dialog) xx(Ifitem) xx(Choice) xx(Link) +xx(Goodbye) // Special menus xx(Mainmenu) diff --git a/src/p_conversation.cpp b/src/p_conversation.cpp index a697223e7..f216d9d78 100644 --- a/src/p_conversation.cpp +++ b/src/p_conversation.cpp @@ -556,6 +556,7 @@ FStrifeDialogueNode::~FStrifeDialogueNode () { if (SpeakerName != NULL) delete[] SpeakerName; if (Dialogue != NULL) delete[] Dialogue; + if (Goodbye != nullptr) delete[] Goodbye; FStrifeDialogueReply *tokill = Children; while (tokill != NULL) { @@ -743,10 +744,25 @@ public: ++i; V_FreeBrokenLines (ReplyLines); } - char goodbye[25]; - mysnprintf(goodbye, countof(goodbye), "TXT_RANDOMGOODBYE_%d", 1+(pr_randomspeech() % NUM_RANDOM_GOODBYES)); - const char *goodbyestr = GStrings[goodbye]; - if (goodbyestr == NULL) goodbyestr = "Bye."; + const char *goodbyestr = CurNode->Goodbye; + if (goodbyestr == nullptr) + { + char goodbye[25]; + mysnprintf(goodbye, countof(goodbye), "TXT_RANDOMGOODBYE_%d", 1 + (pr_randomspeech() % NUM_RANDOM_GOODBYES)); + goodbyestr = GStrings[goodbye]; + } + else if (strncmp(goodbyestr, "RANDOM_", 7) == 0) + { + FString byetext; + + byetext.Format("TXT_%s_%02d", goodbyestr, 1 + (pr_randomspeech() % NUM_RANDOM_LINES)); + goodbyestr = GStrings[byetext]; + } + else if (goodbyestr[0] == '$') + { + goodbyestr = GStrings(goodbyestr + 1); + } + if (goodbyestr == nullptr) goodbyestr = "Bye."; mResponses.Push(mResponseLines.Size()); mResponseLines.Push(FString(goodbyestr)); diff --git a/src/p_conversation.h b/src/p_conversation.h index d6ba65d78..5b068fb04 100644 --- a/src/p_conversation.h +++ b/src/p_conversation.h @@ -30,6 +30,7 @@ struct FStrifeDialogueNode FSoundID SpeakerVoice; FTextureID Backdrop; char *Dialogue; + char *Goodbye = nullptr; // must init to null for binary scripts to work as intended FStrifeDialogueReply *Children; }; diff --git a/src/p_usdf.cpp b/src/p_usdf.cpp index 13a02b964..dccec7c21 100644 --- a/src/p_usdf.cpp +++ b/src/p_usdf.cpp @@ -286,6 +286,7 @@ class USDFParser : public UDMFParserBase FString SpeakerName; FString Dialogue; + FString Goodbye; while (!sc.CheckToken('}')) { @@ -331,7 +332,9 @@ class USDFParser : public UDMFParserBase node->ItemCheckNode = CheckInt(key); break; - + case NAME_Goodbye: + Goodbye = CheckString(key); + break; } } else @@ -354,6 +357,7 @@ class USDFParser : public UDMFParserBase } node->SpeakerName = ncopystring(SpeakerName); node->Dialogue = ncopystring(Dialogue); + node->Goodbye = ncopystring(Goodbye); return true; } diff --git a/src/po_man.cpp b/src/po_man.cpp index 2eed96596..c779a8049 100644 --- a/src/po_man.cpp +++ b/src/po_man.cpp @@ -265,7 +265,6 @@ void DMovePoly::Serialize(FSerializer &arc) { Super::Serialize (arc); arc("angle", m_Angle) - ("speed", m_Speed); ("speedv", m_Speedv); } diff --git a/src/r_data/r_translate.cpp b/src/r_data/r_translate.cpp index bf9365002..983baea58 100644 --- a/src/r_data/r_translate.cpp +++ b/src/r_data/r_translate.cpp @@ -1207,6 +1207,10 @@ int R_FindCustomTranslation(const char *name) { return TRANSLATION(TRANSLATION_Standard, 7); } + else if (!stricmp(name, "None")) + { + return 0; + } int *t = customTranslationMap.CheckKey(FName(name, true)); return (t != nullptr)? *t : -1; } diff --git a/src/r_plane.cpp b/src/r_plane.cpp index ff23492ab..07001bf1b 100644 --- a/src/r_plane.cpp +++ b/src/r_plane.cpp @@ -1314,7 +1314,7 @@ void R_DrawPortals () vissprite_p = firstvissprite; visplaneStack.Pop (pl); - if (pl->Alpha > 0) + if (pl->Alpha > 0 && pl->picnum != skyflatnum) { R_DrawSinglePlane (pl, pl->Alpha, pl->Additive, true); } diff --git a/src/r_things.cpp b/src/r_things.cpp index ab75c15b0..99ca68b60 100644 --- a/src/r_things.cpp +++ b/src/r_things.cpp @@ -408,7 +408,7 @@ void R_DrawVisSprite (vissprite_t *vis) ESPSResult mode; bool ispsprite = (!vis->sector && vis->gpos != FVector3(0, 0, 0)); - if (vis->xscale == 0 || vis->yscale == 0) + if (vis->xscale == 0 || fabs(vis->yscale) < (1.0f / 32000.0f)) { // scaled to 0; can't see return; } diff --git a/src/s_sndseq.cpp b/src/s_sndseq.cpp index 23837c28b..3b39965ff 100644 --- a/src/s_sndseq.cpp +++ b/src/s_sndseq.cpp @@ -442,7 +442,7 @@ IMPLEMENT_CLASS (DSeqPolyNode) void DSeqPolyNode::Serialize(FSerializer &arc) { Super::Serialize (arc); - //arc << m_Poly; + arc("poly", m_Poly); } IMPLEMENT_CLASS (DSeqSectorNode) diff --git a/tools/lemon/lemon.c b/tools/lemon/lemon.c index f2da9c6f8..bdc004a17 100644 --- a/tools/lemon/lemon.c +++ b/tools/lemon/lemon.c @@ -199,7 +199,9 @@ struct rule { int index; /* An index number for this rule */ int iRule; /* Rule number as used in the generated tables */ Boolean canReduce; /* True if this rule is ever reduced */ +#if 0 Boolean doesReduce; /* Reduce actions occur after optimization */ +#endif struct rule *nextlhs; /* Next rule with the same LHS */ struct rule *next; /* Next rule in the global list */ }; @@ -4156,6 +4158,7 @@ void ReportTable( } free(ax); +#if 0 /* Mark rules that are actually used for reduce actions after all ** optimizations have been applied */ @@ -4168,6 +4171,7 @@ void ReportTable( } } } +#endif /* Finish rendering the constants now that the action table has ** been computed */ @@ -4462,12 +4466,16 @@ void ReportTable( assert( rp->noCode ); fprintf(out," /* (%d) ", rp->iRule); writeRuleText(out, rp); +#if 0 if( rp->doesReduce ){ +#endif fprintf(out, " */ yytestcase(yyruleno==%d);\n", rp->iRule); lineno++; +#if 0 }else{ fprintf(out, " (OPTIMIZED OUT) */ assert(yyruleno!=%d);\n", rp->iRule); lineno++; } +#endif } fprintf(out," break;\n"); lineno++; tplt_xfer(lemp->name,in,out,&lineno); diff --git a/tools/lemon/lempar.c b/tools/lemon/lempar.c index 0e360bab9..93b612017 100644 --- a/tools/lemon/lempar.c +++ b/tools/lemon/lempar.c @@ -308,6 +308,7 @@ static int yyGrowStack(yyParser *p){ if( yyTraceFILE ){ fprintf(yyTraceFILE,"%sStack grows from %d to %d entries.\n", yyTracePrompt, p->yystksz, newSize); + fflush(yyTraceFILE); } #endif p->yystksz = newSize; @@ -410,6 +411,7 @@ static void yy_pop_parser_stack(yyParser *pParser){ fprintf(yyTraceFILE,"%sPopping %s\n", yyTracePrompt, yyTokenName[yytos->major]); + fflush(yyTraceFILE); } #endif yy_destructor(pParser, yytos->major, &yytos->minor); @@ -474,6 +476,7 @@ static unsigned int yy_find_shift_action( if( yyTraceFILE ){ fprintf(yyTraceFILE, "%sFALLBACK %s => %s\n", yyTracePrompt, yyTokenName[iLookAhead], yyTokenName[iFallback]); + fflush(yyTraceFILE); } #endif assert( yyFallback[iFallback]==0 ); /* Fallback loop must terminate */ @@ -498,6 +501,7 @@ static unsigned int yy_find_shift_action( fprintf(yyTraceFILE, "%sWILDCARD %s => %s\n", yyTracePrompt, yyTokenName[iLookAhead], yyTokenName[YYWILDCARD]); + fflush(yyTraceFILE); } #endif /* NDEBUG */ return yy_action[j]; @@ -551,6 +555,7 @@ static void yyStackOverflow(yyParser *yypParser){ #ifndef NDEBUG if( yyTraceFILE ){ fprintf(yyTraceFILE,"%sStack Overflow!\n",yyTracePrompt); + fflush(yyTraceFILE); } #endif while( yypParser->yytos>yypParser->yystack ) yy_pop_parser_stack(yypParser); @@ -576,6 +581,7 @@ static void yyTraceShift(yyParser *yypParser, int yyNewState){ fprintf(yyTraceFILE,"%sShift '%s'\n", yyTracePrompt,yyTokenName[yypParser->yytos->major]); } + fflush(yyTraceFILE); } } #else @@ -653,6 +659,7 @@ static void yy_reduce( yysize = yyRuleInfo[yyruleno].nrhs; fprintf(yyTraceFILE, "%sReduce [%s], go to state %d.\n", yyTracePrompt, yyRuleName[yyruleno], yymsp[-yysize].stateno); + fflush(yyTraceFILE); } #endif /* NDEBUG */ @@ -726,6 +733,7 @@ static void yy_parse_failed( #ifndef NDEBUG if( yyTraceFILE ){ fprintf(yyTraceFILE,"%sFail!\n",yyTracePrompt); + fflush(yyTraceFILE); } #endif while( yypParser->yytos>yypParser->yystack ) yy_pop_parser_stack(yypParser); @@ -764,12 +772,17 @@ static void yy_accept( #ifndef NDEBUG if( yyTraceFILE ){ fprintf(yyTraceFILE,"%sAccept!\n",yyTracePrompt); + fflush(yyTraceFILE); } #endif #ifndef YYNOERRORRECOVERY yypParser->yyerrcnt = -1; #endif +#if 0 assert( yypParser->yytos==yypParser->yystack ); +#else + while (yypParser->yytos>yypParser->yystack) yy_pop_parser_stack(yypParser); +#endif /* Here code is inserted which will be executed whenever the ** parser accepts */ /*********** Begin %parse_accept code *****************************************/ @@ -823,6 +836,7 @@ void Parse( #ifndef NDEBUG if( yyTraceFILE ){ fprintf(yyTraceFILE,"%sInput '%s'\n",yyTracePrompt,yyTokenName[yymajor]); + fflush(yyTraceFILE); } #endif @@ -845,6 +859,7 @@ void Parse( #ifndef NDEBUG if( yyTraceFILE ){ fprintf(yyTraceFILE,"%sSyntax Error!\n",yyTracePrompt); + fflush(yyTraceFILE); } #endif #ifdef YYERRORSYMBOL @@ -876,6 +891,7 @@ void Parse( if( yyTraceFILE ){ fprintf(yyTraceFILE,"%sDiscard input token %s\n", yyTracePrompt,yyTokenName[yymajor]); + fflush(yyTraceFILE); } #endif yy_destructor(yypParser, (YYCODETYPE)yymajor, &yyminorunion); @@ -949,6 +965,7 @@ void Parse( cDiv = ' '; } fprintf(yyTraceFILE,"]\n"); + fflush(yyTraceFILE); } #endif return;