diff --git a/src/d_main.cpp b/src/d_main.cpp index 0b0c99688..f9db5fe0e 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -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); diff --git a/src/gamedata/fonts/font.cpp b/src/gamedata/fonts/font.cpp index da8fd25ee..09423933f 100644 --- a/src/gamedata/fonts/font.cpp +++ b/src/gamedata/fonts/font.cpp @@ -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; diff --git a/src/gamedata/textures/animations.cpp b/src/gamedata/textures/animations.cpp index 644718bc4..0132fc336 100644 --- a/src/gamedata/textures/animations.cpp +++ b/src/gamedata/textures/animations.cpp @@ -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; } diff --git a/src/gamedata/textures/formats/tgatexture.cpp b/src/gamedata/textures/formats/tgatexture.cpp index 9936a828e..927bf9b50 100644 --- a/src/gamedata/textures/formats/tgatexture.cpp +++ b/src/gamedata/textures/formats/tgatexture.cpp @@ -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; diff --git a/src/maploader/usdf.cpp b/src/maploader/usdf.cpp index b2df9503c..6d398ce33 100644 --- a/src/maploader/usdf.cpp +++ b/src/maploader/usdf.cpp @@ -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 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 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; } }; diff --git a/src/scripting/vmthunks_actors.cpp b/src/scripting/vmthunks_actors.cpp index d37600444..1a68b340c 100644 --- a/src/scripting/vmthunks_actors.cpp +++ b/src/scripting/vmthunks_actors.cpp @@ -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) diff --git a/wadsrc_extra/static/filter/doom.id/fonts/defsmallfont/0427.lmp b/wadsrc_extra/static/filter/doom.id/fonts/defsmallfont/0427.lmp index 4ef0669f6..e4181d6ce 100644 Binary files a/wadsrc_extra/static/filter/doom.id/fonts/defsmallfont/0427.lmp and b/wadsrc_extra/static/filter/doom.id/fonts/defsmallfont/0427.lmp differ