diff --git a/source/build/src/polymost.cpp b/source/build/src/polymost.cpp index c2ba3da3a..0b565e494 100644 --- a/source/build/src/polymost.cpp +++ b/source/build/src/polymost.cpp @@ -3714,7 +3714,7 @@ void polymost_drawsprite(int32_t snum) break; // else, render as flat sprite } - if ((tspr->cstat & 48) == 48 && voxmodels[tspr->picnum]) + if ((tspr->cstat & 48) == 48 && tspr->picnum < MAXVOXELS && voxmodels[tspr->picnum]) { polymost_voxdraw(voxmodels[tspr->picnum], tspr); return; diff --git a/source/common/2d/v_draw.cpp b/source/common/2d/v_draw.cpp index c25b43a7c..816a22692 100644 --- a/source/common/2d/v_draw.cpp +++ b/source/common/2d/v_draw.cpp @@ -964,14 +964,10 @@ bool ParseDrawTextureTags(F2DDrawer *drawer, FGameTexture *img, double x, double break; case DTA_ScaleX: - assert(fortext == false); - if (fortext) return false; parms->patchscalex = ListGetDouble(tags); break; case DTA_ScaleY: - assert(fortext == false); - if (fortext) return false; parms->patchscaley = ListGetDouble(tags); break; diff --git a/source/common/2d/v_drawtext.cpp b/source/common/2d/v_drawtext.cpp index 812ec5c95..6a67e6851 100644 --- a/source/common/2d/v_drawtext.cpp +++ b/source/common/2d/v_drawtext.cpp @@ -258,8 +258,11 @@ void DrawTextCommon(F2DDrawer *drawer, FFont *font, int normalcolor, double x, d int kerning; FGameTexture *pic; + double scalex = parms.scalex * parms.patchscalex; + double scaley = parms.scaley * parms.patchscaley; + if (parms.celly == 0) parms.celly = font->GetHeight() + 1; - parms.celly *= parms.scaley; + parms.celly *= scaley; bool palettetrans = (normalcolor == CR_UNDEFINED && parms.TranslationId != 0); @@ -333,11 +336,11 @@ void DrawTextCommon(F2DDrawer *drawer, FFont *font, int normalcolor, double x, d } if (parms.monospace == EMonospacing::Off) { - cx += (w + kerning + parms.spacing) * parms.scalex; + cx += (w + kerning + parms.spacing) * scalex; } else { - cx += (parms.spacing) * parms.scalex; + cx += (parms.spacing) * scalex; } } diff --git a/source/games/duke/src/2d_d.cpp b/source/games/duke/src/2d_d.cpp index 0b99fb822..38faa0b42 100644 --- a/source/games/duke/src/2d_d.cpp +++ b/source/games/duke/src/2d_d.cpp @@ -38,10 +38,6 @@ Modifications for JonoF's port by Jonathon Fowler (jf@jonof.id.au) #include "screenjob.h" #include "texturemanager.h" #include "buildtiles.h" -//#include "zz_text.h" - -#undef GameText -//#undef menutext BEGIN_DUKE_NS @@ -682,6 +678,7 @@ public: int Frame(uint64_t clock, bool skiprequest) { char tempbuf[32]; + int totalclock = int(clock * 120 / 1'000'000'000); twod->ClearScreen(); DrawTexture(twod, tileGetTexture(MENUSCREEN), 0, 0, DTA_FullscreenEx, 3, DTA_Color, 0xff808080, DTA_LegacyRenderStyle, STYLE_Normal, TAG_DONE); DrawTexture(twod, tileGetTexture(INGAMEDUKETHREEDEE, true), 160, 34, DTA_FullscreenScale, 3, DTA_VirtualWidth, 320, DTA_VirtualHeight, 200, DTA_CenterOffset, true, TAG_DONE); @@ -690,7 +687,7 @@ public: GameText(160, 58 + 2, GStrings("Multiplayer Totals"), 0, 0); GameText(160, 58 + 10, currentLevel->DisplayName(), 0, 0); - GameText(160, 165, GStrings("Presskey"), 0, 0); + GameText(160, 165, GStrings("Presskey"), 8 - int(sin(totalclock / 10.) * 8), 0); int t = 0; @@ -891,12 +888,13 @@ public: int Frame(uint64_t clock, bool skiprequest) { + twod->ClearScreen(); int totalclock = int(clock * 120 / 1'000'000'000); DrawTexture(twod, tileGetTexture(gfx_offset, true), 0, 0, DTA_FullscreenEx, 3, DTA_LegacyRenderStyle, STYLE_Normal, TAG_DONE); if (lastmapname) BigText(160, 20 - 6, lastmapname); BigText(160, 36 - 6, GStrings("Completed")); - GameText(160, 192, GStrings("PRESSKEY"), (sintable[(totalclock << 5) & 2047] >> 11), 0); + GameText(160, 192, GStrings("PRESSKEY"), 8 - int(sin(totalclock / 10.) * 8), 0); if (totalclock > (60 * 3)) { @@ -1077,6 +1075,14 @@ CCMD(testscreen) jobs[job++] = { Create() }; RunScreenJob(jobs, job, nullptr); break; + + case 10: + ud.eog = true; + jobs[job++] = { Create() }; + RunScreenJob(jobs, job, nullptr); + ud.eog = false; + break; + } } } diff --git a/source/games/duke/src/2d_r.cpp b/source/games/duke/src/2d_r.cpp index 25e702d41..eed134d8a 100644 --- a/source/games/duke/src/2d_r.cpp +++ b/source/games/duke/src/2d_r.cpp @@ -37,10 +37,6 @@ Prepared for public release: 03/21/2003 - Charlie Wiederhold, 3D Realms #include "mapinfo.h" #include "screenjob.h" #include "texturemanager.h" -//#include "zz_text.h" - -#undef gametext -//#undef menutext BEGIN_DUKE_NS @@ -90,6 +86,7 @@ void InitFonts_r() GlyphSet::Pair* pair; while (it.NextPair(pair)) pair->Value->SetOffsetsNotForFont(); BigFont = new ::FFont("BigFont", nullptr, "defbigfont", 0, 0, 0, -1, 10, false, false, false, &fontdata); + BigFont->SetKerning(6); fontdata.Clear(); // Tiny font @@ -130,11 +127,12 @@ void InitFonts_r() static void BigText(double x, double y, const char* text, int align) { - x *= 2; y *= 2; + //x *= 2.2; y *= 2.64; if (align != -1) x -= BigFont->StringWidth(text) * (align == 0 ? 0.5 : 1); auto width = BigFont->StringWidth(text); - DrawText(twod, BigFont, CR_UNTRANSLATED, x - width / 2, y - 24, text, DTA_FullscreenScale, 3, DTA_VirtualWidth, 640, DTA_VirtualHeight, 400, TAG_DONE); + //DrawText(twod, BigFont, CR_UNTRANSLATED, x, y - 24, text, DTA_FullscreenScale, 3, DTA_VirtualWidth, 704, DTA_VirtualHeight, 528, TAG_DONE); + DrawText(twod, BigFont, CR_UNTRANSLATED, x, y - 12, text, DTA_FullscreenScale, 3, DTA_VirtualWidth, 320, DTA_VirtualHeight, 200, DTA_ScaleX, 0.4, DTA_ScaleY, 0.4, TAG_DONE); } static void GameText(double x, double y, const char* t, int shade, int align = -1, int trans = 0) @@ -424,7 +422,7 @@ public: void PrintKills(int totalclock) { BigText(30, 112, GStrings("TXT_VarmintsKilled"), -1); - BigText(30, 128 + 4 + 9, GStrings("TXT_VarmintsLeft"), -1); + BigText(30, 128, GStrings("TXT_VarmintsLeft"), -1); if (bonuscnt == 2) bonuscnt++; @@ -477,10 +475,11 @@ public: int Frame(uint64_t clock, bool skiprequest) { + twod->ClearScreen(); int totalclock = int(clock * 120 / 1'000'000'000); DrawTexture(twod, tileGetTexture(gfx_offset, true), 0, 0, DTA_FullscreenEx, 3, DTA_LegacyRenderStyle, STYLE_Normal, TAG_DONE); - if (lastmapname) BigText(80, 16, lastmapname, 0); + if (lastmapname) BigText(80, 16, lastmapname, -1); BigText(15, 192, GStrings("PRESSKEY"), -1); if (totalclock > (60 * 3)) diff --git a/source/games/duke/src/zz_premap.cpp b/source/games/duke/src/zz_premap.cpp index c3bb65ade..c18df2472 100644 --- a/source/games/duke/src/zz_premap.cpp +++ b/source/games/duke/src/zz_premap.cpp @@ -241,6 +241,7 @@ void G_NewGame(int volumeNum, int levelNum, int skillNum) ready2send = 0; +#if 0 if (m_recstat != 2 && ud.last_level >= 0 && (g_netServer || ud.multimode > 1) && (ud.coop&GAMETYPE_SCORESHEET)) { @@ -249,6 +250,7 @@ void G_NewGame(int volumeNum, int levelNum, int skillNum) if (RR && !RRRA && ud.level_number == 6 && ud.volume_number == 0) G_BonusScreen(0); +#endif g_showShareware = GAMETICSPERSEC*34; diff --git a/source/games/duke/src/zz_text.cpp b/source/games/duke/src/zz_text.cpp index b25723728..580f2d45f 100644 --- a/source/games/duke/src/zz_text.cpp +++ b/source/games/duke/src/zz_text.cpp @@ -103,19 +103,6 @@ vec2_t gametext_(int32_t x, int32_t y, const char *t, int32_t s, int32_t p, int3 { return G_ScreenText(MF_Bluefont.tilenum, x, y, MF_Bluefont.zoom, 0, 0, t, s, p, o|2|8|16|ROTATESPRITE_FULL16, a, MF_Bluefont.emptychar.x, MF_Bluefont.emptychar.y, MF_Bluefont.between.x, MF_Bluefont.between.y, MF_Bluefont.textflags|f, 0, 0, xdim-1, ydim-1); } -void gametext_simple(int32_t x, int32_t y, const char *t) -{ - G_ScreenText(MF_Bluefont.tilenum, x, y, MF_Bluefont.zoom, 0, 0, t, 0, MF_Bluefont.pal, 2|8|16|ROTATESPRITE_FULL16, 0, MF_Bluefont.emptychar.x, MF_Bluefont.emptychar.y, MF_Bluefont.between.x, MF_Bluefont.between.y, MF_Bluefont.textflags, 0, 0, xdim-1, ydim-1); -} -vec2_t mpgametext(int32_t x, int32_t y, const char *t, int32_t s, int32_t o, int32_t a, int32_t f) -{ - return G_ScreenText(MF_Bluefont.tilenum, x, y, textsc(MF_Bluefont.zoom), 0, 0, t, s, MF_Bluefont.pal, o|2|8|16|ROTATESPRITE_FULL16, a, MF_Bluefont.emptychar.x, MF_Bluefont.emptychar.y, MF_Bluefont.between.x, MF_Bluefont.between.y, MF_Bluefont.textflags|f, 0, 0, xdim-1, ydim-1); -} -vec2_t mpgametextsize(const char *t, int32_t f) -{ - return G_ScreenTextSize(MF_Bluefont.tilenum, 0, 0, textsc(MF_Bluefont.zoom), 0, t, 2|8|16|ROTATESPRITE_FULL16, MF_Bluefont.emptychar.x, MF_Bluefont.emptychar.y, MF_Bluefont.between.x, MF_Bluefont.between.y, MF_Bluefont.textflags|f, 0, 0, xdim-1, ydim-1); -} - static int32_t sbarx16(int32_t x) { if (ud.screen_size == 4) return sbarsc(x); @@ -187,10 +174,4 @@ void captionmenutext(int32_t x, int32_t y, char const *t) G_ScreenText(MF_Redfont.tilenum, x, y - (12<<16), MF_Redfont.zoom, 0, 0, t, 0, ud.menutitle_pal, 2|8|16|ROTATESPRITE_FULL16, 0, MF_Redfont.emptychar.x, MF_Redfont.emptychar.y, MF_Redfont.between.x, MF_Redfont.between.y, MF_Redfont.textflags|TEXT_LITERALESCAPE|TEXT_XCENTER|TEXT_YCENTER, 0, 0, xdim-1, ydim-1); } - -int32_t textsc(int32_t sc) -{ - return scale(sc, hud_textscale, 400); -} - END_DUKE_NS diff --git a/source/games/duke/src/zz_text.h b/source/games/duke/src/zz_text.h index cf9d0e7f6..668c7dd01 100644 --- a/source/games/duke/src/zz_text.h +++ b/source/games/duke/src/zz_text.h @@ -35,28 +35,15 @@ extern int32_t minitext_(int32_t x, int32_t y, const char *t, int32_t s, int32_t extern void menutext_(int32_t x, int32_t y, int32_t s, char const *t, int32_t o, int32_t f); extern void captionmenutext(int32_t x, int32_t y, char const *t); extern vec2_t gametext_(int32_t x, int32_t y, const char *t, int32_t s, int32_t p, int32_t o, int32_t a, int32_t f); -extern void gametext_simple(int32_t x, int32_t y, const char *t); -#define mpgametext_x (5<<16) -extern vec2_t mpgametext(int32_t x, int32_t y, char const * t, int32_t s, int32_t o, int32_t a, int32_t f); -extern vec2_t mpgametextsize(char const * t, int32_t f); -extern int32_t textsc(int32_t sc); inline int minitext(int x, int y, const char* t, int p, int sb) { return minitext_(x, y, t, 0, p, sb); } -#define minitextshade(x, y, t, s, p, sb) minitext_(x,y,t,s,p,sb) -#define menutext(x, y, t) menutext_((x)<<16, (y)<<16, 0, (t), 10|16, 0) -#define menutext_centeralign(x, y, t) menutext_((x), (y), 0, (t), 10|16, TEXT_XCENTER|TEXT_YCENTER) #define menutext_center(y, t) menutext_(160<<16, (y)<<16, 0, (t), 10|16, TEXT_XCENTER) -#define gametext(x, y, t) gametext_simple((x)<<16, (y)<<16, (t)) -#define gametext_widenumber(x, y, t) gametext_((x)<<16, (y)<<16, (t), 0, MF_Bluefont.pal, 1024, 0, TEXT_GAMETEXTNUMHACK) -#define gametext_number(x, y, t) gametext_((x)<<16, (y)<<16, (t), 0, MF_Bluefont.pal, 0, 0, TEXT_GAMETEXTNUMHACK) -#define gametext_pal(x, y, t, p) gametext_((x)<<16, (y)<<16, (t), 0, (p), 0, 0, 0) #define gametext_center(y, t) gametext_(160<<16, (y)<<16, (t), 0, MF_Bluefont.pal, 0, 0, TEXT_XCENTER) #define gametext_center_number(y, t) gametext_(160<<16, (y)<<16, (t), 0, MF_Bluefont.pal, 0, 0, TEXT_XCENTER|TEXT_GAMETEXTNUMHACK) -#define gametext_center_shade(y, t, s) gametext_(160<<16, (y)<<16, (t), (s), MF_Bluefont.pal, 0, 0, TEXT_XCENTER) #define gametext_center_shade_pal(y, t, s, p) gametext_(160<<16, (y)<<16, (t), (s), (p), 0, 0, TEXT_XCENTER)