From 7cffe6e3f0e790a775443ac9dbccc5c1f17efc73 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 7 Oct 2023 23:53:49 +0200 Subject: [PATCH] a few Getchars --- source/core/actorinfo.cpp | 2 +- source/core/cheats.cpp | 16 ++++++++-------- source/core/console/c_notifybuffer.cpp | 8 ++++---- source/core/ct_chat.cpp | 4 ++-- source/core/quotemgr.h | 4 ++-- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/source/core/actorinfo.cpp b/source/core/actorinfo.cpp index f42d4cbc9..024570d94 100644 --- a/source/core/actorinfo.cpp +++ b/source/core/actorinfo.cpp @@ -250,7 +250,7 @@ void FActorInfo::ResolveTextures(const char* clsname, DCoreActor* defaults) SpriteSet.Resize(SpriteSetNames.Size()); for (unsigned i = 0; i < SpriteSet.Size(); i++) { - SpriteSet[i] = TexMan.CheckForTexture(SpriteSetNames[i], ETextureType::Any); + SpriteSet[i] = TexMan.CheckForTexture(SpriteSetNames[i].GetChars(), ETextureType::Any); // This should later be enabled to user content. //if (SpriteSet[i] == -1) Printf(TEXTCOLOR_RED "Unknown texture '%s' in sprite set for class %s\n", SpriteSetNames[i].GetChars(), clsname); } diff --git a/source/core/cheats.cpp b/source/core/cheats.cpp index 924564014..90123817f 100644 --- a/source/core/cheats.cpp +++ b/source/core/cheats.cpp @@ -254,7 +254,7 @@ void ChangeLevel(MapRecord* map, int skill, bool bossexit) Net_WriteByte(DEM_CHANGEMAP); Net_WriteByte(skill); Net_WriteByte(bossexit); - Net_WriteString(map? map->labelName : nullptr); + Net_WriteString(map? map->labelName.GetChars() : nullptr); } //--------------------------------------------------------------------------- @@ -302,7 +302,7 @@ static MapRecord* levelwarp_common(FCommandLine& argv, const char *cmdname, cons else Printf(PRINT_BOLD, "Level %s not found!\n", argv[1]); return nullptr; } - if (fileSystem.FindFile(map->fileName) < 0) + if (fileSystem.FindFile(map->fileName.GetChars()) < 0) { Printf(PRINT_BOLD, "%s: map file not found\n", map->fileName.GetChars()); } @@ -387,7 +387,7 @@ CCMD(changemap) #endif FString mapname = argv[1]; - auto map = FindMapByName(mapname); + auto map = FindMapByName(mapname.GetChars()); if (map == nullptr) { // got a user map @@ -400,7 +400,7 @@ CCMD(changemap) Printf(PRINT_BOLD, "%s: Cannot warp to user maps.\n", mapname.GetChars()); return; } - if (fileSystem.FindFile(map->fileName) < 0) + if (fileSystem.FindFile(map->fileName.GetChars()) < 0) { Printf(PRINT_BOLD, "%s: map file not found\n", map->fileName.GetChars()); } @@ -435,11 +435,11 @@ CCMD(map) auto map = FindMapByName(argv[1]); if (map == nullptr) { - map = SetupUserMap(mapfilename, g_gameType & GAMEFLAG_DUKE ? "dethtoll.mid" : nullptr); + map = SetupUserMap(mapfilename.GetChars(), g_gameType & GAMEFLAG_DUKE ? "dethtoll.mid" : nullptr); } if (map) { - if (fileSystem.FindFile(map->fileName) < 0) + if (fileSystem.FindFile(map->fileName.GetChars()) < 0) { Printf(PRINT_BOLD, "%s: map file not found\n", map->fileName.GetChars()); } @@ -512,7 +512,7 @@ CCMD(skill) auto currentSkill = gi->GetCurrentSkill(); if (currentSkill >= 0) { - Printf("Current skill is %d (%s)\n", currentSkill, GStrings.localize(gSkillNames[currentSkill])); + Printf("Current skill is %d (%s)\n", currentSkill, GStrings.localize(gSkillNames[currentSkill].GetChars())); } else if (currentSkill == -1) { @@ -551,7 +551,7 @@ CCMD(skill) Printf("Please specify a skill level between 0 and %d\n", maxvalidskills - 1); for (auto i = 0; i < maxvalidskills; i++) { - Printf("%d = '%s'\n", i, GStrings.localize(gSkillNames[i])); + Printf("%d = '%s'\n", i, GStrings.localize(gSkillNames[i].GetChars())); } } } diff --git a/source/core/console/c_notifybuffer.cpp b/source/core/console/c_notifybuffer.cpp index d29c6a3ce..2b084c6f0 100644 --- a/source/core/console/c_notifybuffer.cpp +++ b/source/core/console/c_notifybuffer.cpp @@ -144,14 +144,14 @@ void FNotifyBuffer::DrawNative() if (!center) { - DrawText(twod, font, CR_UNTRANSLATED, 0, line, notify.Text, + DrawText(twod, font, CR_UNTRANSLATED, 0, line, notify.Text.GetChars(), DTA_FullscreenScale, FSMode_ScaleToHeight, DTA_VirtualWidthF, 320 * scale, DTA_VirtualHeightF, 200 * scale, DTA_KeepRatio, true, DTA_Alpha, alpha, TAG_DONE); } else { - DrawText(twod, font, CR_UNTRANSLATED, 160 * scale - font->StringWidth(notify.Text) / 2, line, notify.Text, + DrawText(twod, font, CR_UNTRANSLATED, 160 * scale - font->StringWidth(notify.Text) / 2, line, notify.Text.GetChars(), DTA_FullscreenScale, FSMode_ScaleToHeight, DTA_VirtualWidthF, 320 * scale, DTA_VirtualHeightF, 200 * scale, DTA_Alpha, alpha, TAG_DONE); @@ -222,7 +222,7 @@ void FNotifyBuffer::Draw() color = PrintColors[notify.PrintLevel]; if (!center) - DrawText(twod, font, color, 0, line * NotifyFontScale, notify.Text, + DrawText(twod, font, color, 0, line * NotifyFontScale, notify.Text.GetChars(), DTA_FullscreenScale, FSMode_ScaleToHeight, DTA_VirtualWidthF, 320. * scale, DTA_VirtualHeightF, 200. * scale, @@ -230,7 +230,7 @@ void FNotifyBuffer::Draw() DTA_Alpha, alpha, TAG_DONE); else DrawText(twod, font, color, 160 * scale - font->StringWidth (notify.Text) / 2., - line, notify.Text, + line, notify.Text.GetChars(), DTA_FullscreenScale, FSMode_ScaleToHeight, DTA_VirtualWidthF, 320. * scale, DTA_VirtualHeightF, 200. * scale, diff --git a/source/core/ct_chat.cpp b/source/core/ct_chat.cpp index fad6dca7d..a70791b7b 100644 --- a/source/core/ct_chat.cpp +++ b/source/core/ct_chat.cpp @@ -162,7 +162,7 @@ bool CT_Responder (event_t *ev) else if (ev->data1 == 'V' && (ev->data3 & GKM_CTRL)) #endif // __APPLE__ { - CT_PasteChat(I_GetFromClipboard(false)); + CT_PasteChat(I_GetFromClipboard(false).GetChars()); } } else if (ev->subtype == EV_GUI_Char) @@ -256,7 +256,7 @@ void CT_Drawer (void) twod->AddColorOnlyQuad(0, y, screen_width, screen_height, 0x80000000); DrawText(drawer, displayfont, CR_GREEN, 0, y, prompt.GetChars(), DTA_VirtualWidth, screen_width, DTA_VirtualHeight, screen_height, DTA_KeepRatio, true, TAG_DONE); - DrawText(drawer, displayfont, CR_GREY, promptwidth, y, printstr, + DrawText(drawer, displayfont, CR_GREY, promptwidth, y, printstr.GetChars(), DTA_VirtualWidth, screen_width, DTA_VirtualHeight, screen_height, DTA_KeepRatio, true, TAG_DONE); } } diff --git a/source/core/quotemgr.h b/source/core/quotemgr.h index 31ec350c0..7d139f275 100644 --- a/source/core/quotemgr.h +++ b/source/core/quotemgr.h @@ -26,12 +26,12 @@ public: const char *GetQuote(int num) { - return GStrings.localize(quotes[num]); + return GStrings.localize(quotes[num].GetChars()); } const char *GetRawQuote(int num) { - return quotes[num]; + return quotes[num].GetChars(); } void CopyQuote(int dst, int src)