mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-30 07:41:22 +00:00
Merge remote-tracking branch 'origin/master' into polybackend
This commit is contained in:
commit
bc5b953633
7 changed files with 73 additions and 70 deletions
|
@ -853,7 +853,6 @@ void D_Display ()
|
|||
{
|
||||
FTexture *tex;
|
||||
int x;
|
||||
FString pstring = GStrings("TXT_BY");
|
||||
|
||||
tex = TexMan.GetTextureByName(gameinfo.PauseSign, true);
|
||||
x = (SCREENWIDTH - tex->GetDisplayWidth() * CleanXfac)/2 +
|
||||
|
@ -862,7 +861,8 @@ void D_Display ()
|
|||
if (paused && multiplayer)
|
||||
{
|
||||
FFont *font = generic_ui? NewSmallFont : SmallFont;
|
||||
pstring << ' ' << players[paused - 1].userinfo.GetName();
|
||||
FString pstring = GStrings("TXT_BY");
|
||||
pstring.Substitute("%s", players[paused - 1].userinfo.GetName());
|
||||
screen->DrawText(font, CR_RED,
|
||||
(screen->GetWidth() - font->StringWidth(pstring)*CleanXfac) / 2,
|
||||
(tex->GetDisplayHeight() * CleanYfac) + 4, pstring, DTA_CleanNoMove, true, TAG_DONE);
|
||||
|
|
|
@ -194,7 +194,7 @@ FFont::FFont (const char *name, const char *nametemplate, const char *filetempla
|
|||
{
|
||||
for (i = 0; i < lcount; i++)
|
||||
{
|
||||
int position = '!' + i;
|
||||
int position = lfirst + i;
|
||||
mysnprintf(buffer, countof(buffer), nametemplate, i + start);
|
||||
|
||||
lump = TexMan.CheckForTexture(buffer, ETextureType::MiscPatch);
|
||||
|
@ -253,7 +253,7 @@ FFont::FFont (const char *name, const char *nametemplate, const char *filetempla
|
|||
{
|
||||
if (texs[i])
|
||||
{
|
||||
int position = '!' + i;
|
||||
int position = lfirst + i;
|
||||
Type = Multilump;
|
||||
if (position < minchar) minchar = position;
|
||||
if (position > maxchar) maxchar = position;
|
||||
|
|
|
@ -73,7 +73,7 @@ FAnimDef *FTextureManager::AddAnim (FAnimDef *anim)
|
|||
if (mAnimations[i]->BasePic == anim->BasePic)
|
||||
{
|
||||
// Found one!
|
||||
free (mAnimations[i]);
|
||||
M_Free (mAnimations[i]);
|
||||
mAnimations[i] = anim;
|
||||
return anim;
|
||||
}
|
||||
|
|
|
@ -497,7 +497,7 @@ int FTGATexture::CopyPixels(FBitmap *bmp, int conversion)
|
|||
}
|
||||
else
|
||||
{
|
||||
bmp->CopyPixelDataRGB(0, 0, ptr, Width, Height, step_x, Pitch, 9, CF_BGRA);
|
||||
bmp->CopyPixelDataRGB(0, 0, ptr, Width, Height, step_x, Pitch, 0, CF_BGRA);
|
||||
transval = -1;
|
||||
}
|
||||
break;
|
||||
|
|
|
@ -482,11 +482,74 @@ class USDFParser : public UDMFParserBase
|
|||
return false;
|
||||
}
|
||||
Level->SetConversation(dlgid, type, startpos);
|
||||
for(;startpos < Level->StrifeDialogues.Size(); startpos++)
|
||||
|
||||
auto& dialogues = Level->StrifeDialogues;
|
||||
const auto numnodes = dialogues.Size();
|
||||
|
||||
for (auto i = startpos; i < numnodes; i++)
|
||||
{
|
||||
Level->StrifeDialogues[startpos]->SpeakerType = type;
|
||||
Level->StrifeDialogues[startpos]->MenuClassName = clsid;
|
||||
dialogues[i]->SpeakerType = type;
|
||||
dialogues[i]->MenuClassName = clsid;
|
||||
}
|
||||
|
||||
if (namespace_bits == Gz) // string page name linker
|
||||
{
|
||||
TMap<FString, int> nameToIndex;
|
||||
|
||||
for (auto i = startpos; i < numnodes; i++)
|
||||
{
|
||||
FString key = dialogues[i]->ThisNodeName;
|
||||
if (key.IsNotEmpty())
|
||||
{
|
||||
key.ToLower();
|
||||
if (nameToIndex.CheckKey(key))
|
||||
Printf("Warning! Duplicate page name '%s'!\n", dialogues[i]->ThisNodeName.GetChars());
|
||||
else
|
||||
{
|
||||
nameToIndex[key] = i - startpos;
|
||||
DPrintf(DMSG_NOTIFY, "GZSDF linker: Assigning pagename '%s' to node %i\n", key.GetChars(), i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (nameToIndex.CountUsed())
|
||||
{
|
||||
for (auto i = startpos; i < numnodes; i++)
|
||||
{
|
||||
FString itemLinkKey = dialogues[i]->ItemCheckNodeName;
|
||||
if (itemLinkKey.IsNotEmpty())
|
||||
{
|
||||
itemLinkKey.ToLower();
|
||||
if (nameToIndex.CheckKey(itemLinkKey))
|
||||
{
|
||||
dialogues[i]->ItemCheckNode = nameToIndex[itemLinkKey] + 1;
|
||||
DPrintf(DMSG_NOTIFY, "GZSDF linker: Item Link '%s' in node %i was index %i\n", itemLinkKey.GetChars(), i, nameToIndex[itemLinkKey]);
|
||||
}
|
||||
else
|
||||
Printf("Warning! Reference to non-existent item-linked dialogue page name '%s' in page %i!\n", dialogues[i]->ItemCheckNodeName.GetChars(), i);
|
||||
}
|
||||
|
||||
FStrifeDialogueReply *NodeCheck = dialogues[i]->Children;
|
||||
while (NodeCheck)
|
||||
{
|
||||
if (NodeCheck->NextNodeName.IsNotEmpty())
|
||||
{
|
||||
FString key = NodeCheck->NextNodeName;
|
||||
key.ToLower();
|
||||
if (nameToIndex.CheckKey(key))
|
||||
{
|
||||
NodeCheck->NextNode = nameToIndex[key] + 1;
|
||||
DPrintf(DMSG_NOTIFY, "GZSDF linker: Nextpage Link '%s' in node %i was index %i\n", key.GetChars(), i, nameToIndex[key]);
|
||||
}
|
||||
else
|
||||
Printf("Warning! Reference to non-existent reply-linked dialogue page name '%s' in page %i!\n", NodeCheck->NextNodeName.GetChars(), i);
|
||||
}
|
||||
NodeCheck = NodeCheck->Next;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -551,66 +614,6 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
if (namespace_bits == Gz) // string page name linker
|
||||
{
|
||||
int numnodes = Level->StrifeDialogues.Size();
|
||||
int usedstrings = false;
|
||||
|
||||
TMap<FString, int> nameToIndex;
|
||||
for (int i = 0; i < numnodes; i++)
|
||||
{
|
||||
FString key = Level->StrifeDialogues[i]->ThisNodeName;
|
||||
if (key.IsNotEmpty())
|
||||
{
|
||||
key.ToLower();
|
||||
if (nameToIndex.CheckKey(key))
|
||||
Printf("Warning! Duplicate page name '%s'!\n", Level->StrifeDialogues[i]->ThisNodeName.GetChars());
|
||||
else
|
||||
{
|
||||
nameToIndex[key] = i;
|
||||
DPrintf(DMSG_NOTIFY, "GZSDF linker: Assigning pagename '%s' to node %i\n", key.GetChars(), i);
|
||||
}
|
||||
usedstrings = true;
|
||||
}
|
||||
}
|
||||
if (usedstrings)
|
||||
{
|
||||
for (int i = 0; i < numnodes; i++)
|
||||
{
|
||||
FString itemLinkKey = Level->StrifeDialogues[i]->ItemCheckNodeName;
|
||||
if (itemLinkKey.IsNotEmpty())
|
||||
{
|
||||
itemLinkKey.ToLower();
|
||||
if (nameToIndex.CheckKey(itemLinkKey))
|
||||
{
|
||||
Level->StrifeDialogues[i]->ItemCheckNode = nameToIndex[itemLinkKey] + 1;
|
||||
DPrintf(DMSG_NOTIFY, "GZSDF linker: Item Link '%s' in node %i was index %i\n", itemLinkKey.GetChars(), i, nameToIndex[itemLinkKey]);
|
||||
}
|
||||
else
|
||||
Printf("Warning! Reference to non-existent item-linked dialogue page name '%s' in page %i!\n", Level->StrifeDialogues[i]->ItemCheckNodeName.GetChars(), i);
|
||||
}
|
||||
|
||||
FStrifeDialogueReply *NodeCheck = Level->StrifeDialogues[i]->Children;
|
||||
while (NodeCheck)
|
||||
{
|
||||
if (NodeCheck->NextNodeName.IsNotEmpty())
|
||||
{
|
||||
FString key = NodeCheck->NextNodeName;
|
||||
key.ToLower();
|
||||
if (nameToIndex.CheckKey(key))
|
||||
{
|
||||
NodeCheck->NextNode = nameToIndex[key] + 1;
|
||||
DPrintf(DMSG_NOTIFY, "GZSDF linker: Nextpage Link '%s' in node %i was index %i\n", key.GetChars(), i, nameToIndex[key]);
|
||||
}
|
||||
else
|
||||
Printf("Warning! Reference to non-existent reply-linked dialogue page name '%s' in page %i!\n", NodeCheck->NextNodeName.GetChars(), i);
|
||||
}
|
||||
NodeCheck = NodeCheck->Next;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
|
|
@ -512,7 +512,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(AActor, Vec2OffsetZ, Vec2OffsetZ)
|
|||
|
||||
static void Vec2Offset(AActor *self, double x, double y, bool absolute, DVector2 *result)
|
||||
{
|
||||
*result = self->Vec2OffsetZ(x, y, absolute);
|
||||
*result = self->Vec2Offset(x, y, absolute);
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION_NATIVE(AActor, Vec2Offset, Vec2Offset)
|
||||
|
|
Binary file not shown.
Loading…
Reference in a new issue