This commit is contained in:
Christoph Oelckers 2016-10-16 08:51:13 +02:00
commit b03489a43c
23 changed files with 332 additions and 173 deletions

View file

@ -1234,6 +1234,7 @@ set (PCH_SOURCES
p_3dfloors.cpp
p_3dmidtex.cpp
p_acs.cpp
p_actionfunctions.cpp
p_buildmap.cpp
p_ceiling.cpp
p_conversation.cpp
@ -1372,7 +1373,6 @@ set (PCH_SOURCES
textures/warptexture.cpp
thingdef/olddecorations.cpp
thingdef/thingdef.cpp
thingdef/thingdef_codeptr.cpp
thingdef/thingdef_data.cpp
thingdef/thingdef_exp.cpp
thingdef/thingdef_expression.cpp

View file

@ -201,6 +201,7 @@ enum EObjectFlags
OF_EuthanizeMe = 1 << 5, // Object wants to die
OF_Cleanup = 1 << 6, // Object is now being deleted by the collector
OF_YesReallyDelete = 1 << 7, // Object is being deleted outside the collector, and this is okay, so don't print a warning
OF_Transient = 1 << 11, // Object should not be archived (references to it will be nulled on disk)
OF_WhiteBits = OF_White0 | OF_White1,
OF_MarkBits = OF_WhiteBits | OF_Black,
@ -573,6 +574,9 @@ protected:
}
};
// When you write to a pointer to an Object, you must call this for
// proper bookkeeping in case the Object holding this pointer has
// already been processed by the GC.
static inline void GC::WriteBarrier(DObject *pointing, DObject *pointed)
{
if (pointed != NULL && pointed->IsWhite() && pointing->IsBlack())

View file

@ -584,6 +584,7 @@ xx(Dialog)
xx(Ifitem)
xx(Choice)
xx(Link)
xx(Goodbye)
// Special menus
xx(Mainmenu)

View file

@ -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));

View file

@ -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;
};

View file

@ -3799,6 +3799,8 @@ void AActor::Tick ()
else if (Z() <= floorz)
{
Crash();
if (ObjectFlags & OF_EuthanizeMe)
return; // actor was destroyed
}
CheckPortalTransition(true);

View file

@ -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;
}

View file

@ -265,7 +265,6 @@ void DMovePoly::Serialize(FSerializer &arc)
{
Super::Serialize (arc);
arc("angle", m_Angle)
("speed", m_Speed);
("speedv", m_Speedv);
}

View file

@ -1216,6 +1216,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;
}

View file

@ -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);
}

View file

@ -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;
}

View file

@ -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)

View file

@ -1451,7 +1451,7 @@ FSerializer &Serialize(FSerializer &arc, const char *key, DObject *&value, DObje
{
ndx = -1;
}
else if (value->ObjectFlags & OF_EuthanizeMe)
else if (value->ObjectFlags & (OF_EuthanizeMe | OF_Transient))
{
return arc;
}

View file

@ -161,6 +161,16 @@ FAnimDef *FTextureManager::AddComplexAnim (FTextureID picnum, const TArray<FAnim
// [RH] Rewritten to support BOOM ANIMATED lump but also make absolutely
// no assumptions about how the compiler packs the animdefs array.
//
// Since animdef_t no longer exists in ZDoom, here is some documentation
// of the format:
//
// This is an array of <n> entries, terminated by a 0xFF byte. Each entry
// is 23 bytes long and consists of the following fields:
// Byte 0: Bit 1 set for wall texture, clear for flat texture.
// Bytes 1-9: '\0'-terminated name of first texture.
// Bytes 10-18: '\0'-terminated name of last texture.
// Bytes 19-22: Tics per frame (stored in little endian order).
//
//==========================================================================
CVAR(Bool, debuganimated, false, 0)

View file

@ -77,7 +77,7 @@ static void SetNodeLine(ZCC_TreeNode *name, int line)
FString unexpected, expecting;
int i;
int stateno = yypParser->yystack[yypParser->yyidx].stateno;
int stateno = yypParser->yytos->stateno;
unexpected << "Unexpected " << ZCCTokenName(yymajor);