From 521eff868cd92011dd2546ad92370cad398e9e4d Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Mon, 11 Jan 2021 01:02:16 -0500 Subject: [PATCH] Chengi's new background added --- src/k_menudraw.c | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/src/k_menudraw.c b/src/k_menudraw.c index f9c86ade3..8c8a9f897 100644 --- a/src/k_menudraw.c +++ b/src/k_menudraw.c @@ -85,9 +85,36 @@ int snprintf(char *str, size_t n, const char *fmt, ...); #define SLIDER_WIDTH (8*SLIDER_RANGE+6) #define SERVERS_PER_PAGE 11 +static UINT32 bgTextScroll = 0; + void M_DrawMenuBackground(void) { - V_DrawFixedPatch(0, 0, FRACUNIT, 0, W_CachePatchName("MENUBG", PU_CACHE), NULL); + patch_t *text1 = W_CachePatchName("MENUBGT1", PU_CACHE); + patch_t *text2 = W_CachePatchName("MENUBGT2", PU_CACHE); + + INT32 text1loop = SHORT(text1->height); + INT32 text2loop = SHORT(text2->width); + + fixed_t text1scroll = -(bgTextScroll % text1loop) * FRACUNIT; + fixed_t text2scroll = -(bgTextScroll % text2loop) * FRACUNIT; + + V_DrawFixedPatch(0, 0, FRACUNIT, 0, W_CachePatchName("MENUBG4", PU_CACHE), NULL); + V_DrawFixedPatch(0, 0, FRACUNIT, 0, W_CachePatchName("MENUBG2", PU_CACHE), NULL); + V_DrawFixedPatch(0, 0, FRACUNIT, 0, W_CachePatchName("MENUBG1", PU_CACHE), NULL); + + V_DrawFixedPatch(0, BASEVIDHEIGHT * FRACUNIT, FRACUNIT, V_TRANSLUCENT, W_CachePatchName("MENUBG5", PU_CACHE), NULL); + + V_DrawFixedPatch(text2scroll, (BASEVIDHEIGHT-8) * FRACUNIT, + FRACUNIT, V_TRANSLUCENT, text2, NULL); + V_DrawFixedPatch(text2scroll + (text2loop * FRACUNIT), (BASEVIDHEIGHT-8) * FRACUNIT, + FRACUNIT, V_TRANSLUCENT, text2, NULL); + + V_DrawFixedPatch(8 * FRACUNIT, text1scroll, + FRACUNIT, V_TRANSLUCENT, text1, NULL); + V_DrawFixedPatch(8 * FRACUNIT, text1scroll + (text1loop * FRACUNIT), + FRACUNIT, V_TRANSLUCENT, text1, NULL); + + bgTextScroll += 8; } void M_DrawMenuForeground(void)