From 1507e9fd152611e0fafc2d3505c495d923cfa6d8 Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Thu, 5 Dec 2019 05:40:30 +0000 Subject: [PATCH 1/6] SW: Left-pin the mini HUD in widescreen git-svn-id: https://svn.eduke32.com/eduke32@8352 1a8010ca-5511-0410-912e-c29ae57300e0 # Conflicts: # source/sw/src/text.cpp --- source/sw/src/inv.cpp | 12 ++++++++---- source/sw/src/text.cpp | 6 ++++-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/source/sw/src/inv.cpp b/source/sw/src/inv.cpp index 157d51174..5e1fc31f6 100644 --- a/source/sw/src/inv.cpp +++ b/source/sw/src/inv.cpp @@ -138,7 +138,8 @@ void UpdateMiniBar(PLAYERp pp) rotatesprite(x << 16, y << 16, (1 << 16), 0, MINI_BAR_HEALTH_BOX_PIC, 0, 0, - ROTATE_SPRITE_SCREEN_CLIP | ROTATE_SPRITE_CORNER, 0, 0, xdim - 1, ydim - 1); + ROTATE_SPRITE_SCREEN_CLIP | ROTATE_SPRITE_CORNER | RS_ALIGN_L, + 0, 0, xdim - 1, ydim - 1); x = MINI_BAR_HEALTH_BOX_X+3; DisplayMiniBarNumber(pp, x, y+5, u->Health); @@ -149,7 +150,8 @@ void UpdateMiniBar(PLAYERp pp) rotatesprite(x << 16, y << 16, (1 << 16), 0, MINI_BAR_AMMO_BOX_PIC, 0, 0, - ROTATE_SPRITE_SCREEN_CLIP | ROTATE_SPRITE_CORNER, 0, 0, xdim - 1, ydim - 1); + ROTATE_SPRITE_SCREEN_CLIP | ROTATE_SPRITE_CORNER | RS_ALIGN_L, + 0, 0, xdim - 1, ydim - 1); x = MINI_BAR_AMMO_BOX_X+3; DisplayMiniBarNumber(pp, x, y+5, pp->WpnAmmo[u->WeaponNum]); @@ -163,7 +165,8 @@ void UpdateMiniBar(PLAYERp pp) rotatesprite(x << 16, y << 16, (1 << 16), 0, MINI_BAR_INVENTORY_BOX_PIC, 0, 0, - ROTATE_SPRITE_SCREEN_CLIP | ROTATE_SPRITE_CORNER, 0, 0, xdim - 1, ydim - 1); + ROTATE_SPRITE_SCREEN_CLIP | ROTATE_SPRITE_CORNER | RS_ALIGN_L, + 0, 0, xdim - 1, ydim - 1); id = &InventoryData[pp->InventoryNum]; @@ -173,7 +176,8 @@ void UpdateMiniBar(PLAYERp pp) rotatesprite(x << 16, y << 16, (1 << 16), 0, id->State->picndx, 0, 0, - ROTATE_SPRITE_SCREEN_CLIP | ROTATE_SPRITE_CORNER, 0, 0, xdim - 1, ydim - 1); + ROTATE_SPRITE_SCREEN_CLIP | ROTATE_SPRITE_CORNER | RS_ALIGN_L, + 0, 0, xdim - 1, ydim - 1); // will update the AUTO and % inventory values PlayerUpdateInventory(pp, pp->InventoryNum); diff --git a/source/sw/src/text.cpp b/source/sw/src/text.cpp index a63b97b58..e65d2aabc 100644 --- a/source/sw/src/text.cpp +++ b/source/sw/src/text.cpp @@ -284,7 +284,8 @@ void DisplayMiniBarNumber(PLAYERp pp, short xs, short ys, int number) rotatesprite((long)x << 16, (long)ys << 16, (1 << 16), 0, pic, 0, 0, - ROTATE_SPRITE_SCREEN_CLIP | ROTATE_SPRITE_CORNER, 0, 0, xdim - 1, ydim - 1); + ROTATE_SPRITE_SCREEN_CLIP | ROTATE_SPRITE_CORNER | RS_ALIGN_L, + 0, 0, xdim - 1, ydim - 1); size = tilesiz[PANEL_FONT_G + (*ptr - '0')].x + 1; } @@ -310,7 +311,8 @@ void DisplayMiniBarSmString(PLAYERp pp, short xs, short ys, short pal, const cha pic = FRAG_FIRST_TILE + (*ptr - FRAG_FIRST_ASCII); rotatesprite((int)x << 16, (int)ys << 16, (1 << 16), 0, pic, 0, pal, - ROTATE_SPRITE_SCREEN_CLIP | ROTATE_SPRITE_CORNER, 0, 0, xdim - 1, ydim - 1); + ROTATE_SPRITE_SCREEN_CLIP | ROTATE_SPRITE_CORNER | RS_ALIGN_L, + 0, 0, xdim - 1, ydim - 1); } } From 22a778a22c895d2f7da3782bbae768ad89f0e3e1 Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Thu, 5 Dec 2019 05:40:34 +0000 Subject: [PATCH 2/6] SW: Don't show the status bar during the end of level screen git-svn-id: https://svn.eduke32.com/eduke32@8353 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/sw/src/game.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/source/sw/src/game.cpp b/source/sw/src/game.cpp index 213ef2113..af64a6667 100644 --- a/source/sw/src/game.cpp +++ b/source/sw/src/game.cpp @@ -1694,7 +1694,6 @@ void CreditsLevel(void) // get rid of all PERM sprites! renderFlushPerms(); save = gs.BorderNum; - SetBorder(Player + myconnectindex,0); ClearStartMost(); gs.BorderNum = save; videoClearViewableArea(0L); From 007d16712c2fd783399bc10e5ce8177b9be429ea Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Thu, 5 Dec 2019 05:40:38 +0000 Subject: [PATCH 3/6] SW: Draw the status bar under the menu instead of over it git-svn-id: https://svn.eduke32.com/eduke32@8354 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/sw/src/draw.cpp | 2 +- source/sw/src/panel.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/source/sw/src/draw.cpp b/source/sw/src/draw.cpp index 6c8bbb330..62bcc2763 100644 --- a/source/sw/src/draw.cpp +++ b/source/sw/src/draw.cpp @@ -2610,7 +2610,7 @@ DrawCompass(PLAYERp pp) start_ang = NORM_CANG(start_ang - 4); flags = ROTATE_SPRITE_SCREEN_CLIP | ROTATE_SPRITE_CORNER; - if (RedrawCompass) + if (RedrawCompass && !UsingMenus) { RedrawCompass = FALSE; SET(flags, ROTATE_SPRITE_ALL_PAGES); diff --git a/source/sw/src/panel.cpp b/source/sw/src/panel.cpp index 12361d022..056b1bafa 100644 --- a/source/sw/src/panel.cpp +++ b/source/sw/src/panel.cpp @@ -7597,7 +7597,8 @@ pDisplaySprites(PLAYERp pp) } #if 1 - if (TEST(psp->flags, PANF_KILL_AFTER_SHOW) && !TEST(psp->flags, PANF_NOT_ALL_PAGES)) + extern SWBOOL UsingMenus; + if (TEST(psp->flags, PANF_KILL_AFTER_SHOW) && !TEST(psp->flags, PANF_NOT_ALL_PAGES) && !UsingMenus) { psp->numpages = 0; SET(flags, ROTATE_SPRITE_ALL_PAGES); From 5624c9b5b00cb14ec5ebc606ac0e3d90e29f80ca Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Thu, 5 Dec 2019 05:40:43 +0000 Subject: [PATCH 4/6] SW: Avoid a one-pixel tall hall of mirrors above the full status bar git-svn-id: https://svn.eduke32.com/eduke32@8355 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/sw/src/border.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/source/sw/src/border.cpp b/source/sw/src/border.cpp index 33398e44b..ac5609702 100644 --- a/source/sw/src/border.cpp +++ b/source/sw/src/border.cpp @@ -441,10 +441,9 @@ static void BorderSetView(PLAYERp, int *Xdim, int *Ydim, int *ScreenSize) y = DIV2(*Ydim) - DIV2((*ScreenSize **Ydim) / *Xdim); y2 = y + ((*ScreenSize **Ydim) / *Xdim) - 1; - if (ydim == 480 && gs.BorderNum == 2) - { - y2+=2; - } + // avoid a one-pixel tall HOM + if (gs.BorderNum == BORDER_BAR) + ++y2; // global windowxy1, windowxy2 coords set here videoSetViewableArea(x, y, x2, y2); From d1ed4063eb5c2ebc9017396f2baecf1ccc9bb292 Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Thu, 5 Dec 2019 05:40:46 +0000 Subject: [PATCH 5/6] Fix the widescreen alignment of weapons when shrinking the screen with + or - (currently disabled by default) Patch from Fox. git-svn-id: https://svn.eduke32.com/eduke32@8356 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/build/src/engine.cpp | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/source/build/src/engine.cpp b/source/build/src/engine.cpp index a6dafafa6..35015e11b 100644 --- a/source/build/src/engine.cpp +++ b/source/build/src/engine.cpp @@ -6747,6 +6747,9 @@ void dorotspr_handle_bit2(int32_t *sxptr, int32_t *syptr, int32_t *z, int32_t da int32_t zoomsc, sx=*sxptr, sy=*syptr; int32_t ouryxaspect = yxaspect, ourxyaspect = xyaspect; + if ((dastat & RS_ALIGN_MASK) && (dastat & RS_ALIGN_MASK) != RS_ALIGN_MASK) + sx += NEGATE_ON_CONDITION(scale(120<<16,xdim,ydim) - (160<<16), !(dastat & RS_ALIGN_R)); + sy += rotatesprite_y_offset; // screen center to s[xy], 320<<16 coords. @@ -6774,17 +6777,7 @@ void dorotspr_handle_bit2(int32_t *sxptr, int32_t *syptr, int32_t *z, int32_t da // screen x center to sx1, scaled to viewport const int32_t scaledxofs = scale(normxofs, scale(xdimen, xdim, oxdim), 320); - int32_t xbord = 0; - - if ((dastat & RS_ALIGN_MASK) && (dastat & RS_ALIGN_MASK) != RS_ALIGN_MASK) - { - xbord = scale(oxdim-xdim, twice_midcx, oxdim); - - if ((dastat & RS_ALIGN_R)==0) - xbord = -xbord; - } - - sx = ((twice_midcx+xbord)<<15) + scaledxofs; + sx = ((twice_midcx)<<15) + scaledxofs; zoomsc = xdimenscale; //= scale(xdimen,yxaspect,320); zoomsc = mulscale16(zoomsc, rotatesprite_yxaspect); @@ -6806,9 +6799,7 @@ void dorotspr_handle_bit2(int32_t *sxptr, int32_t *syptr, int32_t *z, int32_t da if ((dastat & RS_ALIGN_MASK) == RS_ALIGN_MASK) sy += (oydim-ydim)<<15; - else if ((dastat & RS_ALIGN_MASK) == RS_ALIGN_R) - sx += (oxdim-xdim)<<16; - else if ((dastat & RS_ALIGN_MASK) == 0) + else sx += (oxdim-xdim)<<15; if (dastat & RS_CENTERORIGIN) From 9a71545c51bf7130e85318c48da3953b5042f5b7 Mon Sep 17 00:00:00 2001 From: nukeykt Date: Fri, 6 Dec 2019 03:38:35 +0900 Subject: [PATCH 6/6] Fix rednukem compiling # Conflicts: # source/rr/src/anim.cpp # source/rr/src/common.cpp # source/rr/src/common_game.h # source/rr/src/game.cpp # source/rr/src/grpscan.cpp # source/rr/src/menus.cpp # source/rr/src/menus.h # source/rr/src/net.cpp # source/rr/src/net.h # source/rr/src/osdcmds.cpp # source/rr/src/player.cpp # source/rr/src/rts.cpp # source/rr/src/savegame.cpp # source/rr/src/screens.cpp # source/rr/src/sounds.cpp # source/rr/src/startosx.game.mm # source/rr/src/startwin.game.cpp --- source/platform/gtk/startgtk.game.cpp | 13 ++++++++----- source/rr/src/anim.cpp | 1 - source/rr/src/game.cpp | 6 +----- source/rr/src/menus.cpp | 8 ++++---- source/rr/src/net.cpp | 1 - source/rr/src/osdcmds.cpp | 6 ++++-- source/rr/src/premap.cpp | 1 - source/rr/src/savegame.cpp | 2 -- source/rr/src/sounds.cpp | 17 +++++++++++++++-- 9 files changed, 32 insertions(+), 23 deletions(-) diff --git a/source/platform/gtk/startgtk.game.cpp b/source/platform/gtk/startgtk.game.cpp index f21b92a4f..8f363973b 100644 --- a/source/platform/gtk/startgtk.game.cpp +++ b/source/platform/gtk/startgtk.game.cpp @@ -108,7 +108,9 @@ static struct grpfile_t const * grp; char *gamedir; ud_setup_t shared; +#ifdef POLYMER int polymer; +#endif } settings; static int32_t retval = -1, mode = TAB_MESSAGES; @@ -130,6 +132,7 @@ static void on_vmode3dcombo_changed(GtkComboBox *combobox, gpointer user_data) gtk_tree_model_get(data, &iter, 1, &val, -1); settings.shared.xdim = validmode[val].xdim; settings.shared.ydim = validmode[val].ydim; + settings.shared.bpp = validmode[val].bpp; } static void on_fullscreencheck_toggled(GtkToggleButton *togglebutton, gpointer user_data) @@ -272,7 +275,7 @@ static unsigned char GetModsDirNames(GtkListStore *list) char *homedir; char pdir[BMAX_PATH]; unsigned char iternumb = 0; - CACHE1D_FIND_REC *dirs = NULL; + BUILDVFS_FIND_REC *dirs = NULL; GtkTreeIter iter; pathsearchmode = 1; @@ -280,7 +283,7 @@ static unsigned char GetModsDirNames(GtkListStore *list) if ((homedir = Bgethomedir())) { Bsnprintf(pdir, sizeof(pdir), "%s/" ".eduke32", homedir); - dirs = klistpath(pdir, "*", CACHE1D_FIND_DIR); + dirs = klistpath(pdir, "*", BUILDVFS_FIND_DIR); for (; dirs != NULL; dirs=dirs->next) { if ((Bstrcmp(dirs->name, "autoload") == 0) || @@ -866,9 +869,7 @@ int32_t startwin_run(void) settings.gamedir = g_modDir; settings.grp = g_selectedGrp; #ifdef POLYMER - settings.polymer = (glrendmode == REND_POLYMER); -#else - settings.polymer = 0; + settings.polymer = (glrendmode == REND_POLYMER) & (settings.shared.bpp != 8); #endif PopulateForm(ALL); @@ -878,7 +879,9 @@ int32_t startwin_run(void) if (retval) // launch the game with these parameters { ud.setup = settings.shared; +#ifdef POLYMER glrendmode = (settings.polymer) ? REND_POLYMER : REND_POLYMOST; +#endif g_selectedGrp = settings.grp; Bstrcpy(g_modDir, (g_noSetup == 0 && settings.gamedir != NULL) ? settings.gamedir : "/"); diff --git a/source/rr/src/anim.cpp b/source/rr/src/anim.cpp index fd86e2d32..2eb9b20eb 100644 --- a/source/rr/src/anim.cpp +++ b/source/rr/src/anim.cpp @@ -494,7 +494,6 @@ int32_t Anim_Play(const char *fn) // setpalette(0L,256L,tempbuf); P_SetGamePalette(g_player[myconnectindex].ps, ANIMPAL, 8 + 2); - timerUpdate(); ototalclock = totalclock; i = 1; diff --git a/source/rr/src/game.cpp b/source/rr/src/game.cpp index 3ed55ff05..0f078d8ac 100644 --- a/source/rr/src/game.cpp +++ b/source/rr/src/game.cpp @@ -1,4 +1,4 @@ -//------------------------------------------------------------------------- +//------------------------------------------------------------------------- /* Copyright (C) 2016 EDuke32 developers and contributors @@ -7882,8 +7882,6 @@ MAIN_LOOP_RESTART: do { - timerUpdate(); - if (ready2send == 0) break; Net_GetInput(); @@ -7897,8 +7895,6 @@ MAIN_LOOP_RESTART: G_MoveLoop(); } - timerUpdate(); - if (totalclock - moveClock >= TICSPERFRAME) { // computing a tic takes longer than a tic, so we're slowing diff --git a/source/rr/src/menus.cpp b/source/rr/src/menus.cpp index ad42eb674..d75dfd18f 100644 --- a/source/rr/src/menus.cpp +++ b/source/rr/src/menus.cpp @@ -5901,7 +5901,7 @@ static void Menu_Run(Menu_t *cm, const vec2_t origin) { if (object->findhigh[i]) { - CACHE1D_FIND_REC *dir; + BUILDVFS_FIND_REC *dir; int32_t y = 0; const int32_t y_upper = object->format[i]->pos.y; const int32_t y_lower = klabs(object->format[i]->bottomcutoff); @@ -6694,7 +6694,7 @@ static void Menu_RunInput(Menu_t *cm) { int32_t i; - CACHE1D_FIND_REC *seeker = object->findhigh[object->currentList]; + BUILDVFS_FIND_REC *seeker = object->findhigh[object->currentList]; inputState.ClearKeyStatus(sc_PgUp); @@ -6717,7 +6717,7 @@ static void Menu_RunInput(Menu_t *cm) { int32_t i; - CACHE1D_FIND_REC *seeker = object->findhigh[object->currentList]; + BUILDVFS_FIND_REC *seeker = object->findhigh[object->currentList]; inputState.ClearKeyStatus(sc_PgDn); @@ -6771,7 +6771,7 @@ static void Menu_RunInput(Menu_t *cm) ch = inputState.keyGetChar(); if (ch > 0 && ((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') || (ch >= '0' && ch <= '9'))) { - CACHE1D_FIND_REC *seeker = object->findhigh[object->currentList]->usera; + BUILDVFS_FIND_REC *seeker = object->findhigh[object->currentList]->usera; if (ch >= 'a') ch -= ('a'-'A'); while (seeker) diff --git a/source/rr/src/net.cpp b/source/rr/src/net.cpp index 7506641c5..3b0eac385 100644 --- a/source/rr/src/net.cpp +++ b/source/rr/src/net.cpp @@ -2863,7 +2863,6 @@ void Net_ReceiveDisconnect(ENetEvent *event) void Net_GetPackets(void) { - timerUpdate(); MUSIC_Update(); G_HandleSpecialKeys(); diff --git a/source/rr/src/osdcmds.cpp b/source/rr/src/osdcmds.cpp index c42665d92..38bedde7f 100644 --- a/source/rr/src/osdcmds.cpp +++ b/source/rr/src/osdcmds.cpp @@ -927,8 +927,10 @@ int32_t registerosdcommands(void) OSD_RegisterFunction("inittimer","debug", osdcmd_inittimer); #endif #if !defined NETCODE_DISABLE - //OSD_RegisterFunction("kick","kick : kicks a multiplayer client. See listplayers.", osdcmd_kick); - //OSD_RegisterFunction("kickban","kickban : kicks a multiplayer client and prevents them from reconnecting. See listplayers.", osdcmd_kickban); +#if 0 + OSD_RegisterFunction("kick","kick : kicks a multiplayer client. See listplayers.", osdcmd_kick); + OSD_RegisterFunction("kickban","kickban : kicks a multiplayer client and prevents them from reconnecting. See listplayers.", osdcmd_kickban); +#endif OSD_RegisterFunction("listplayers","listplayers: lists currently connected multiplayer clients", osdcmd_listplayers); #endif diff --git a/source/rr/src/premap.cpp b/source/rr/src/premap.cpp index b7f4b9316..1749ffee7 100644 --- a/source/rr/src/premap.cpp +++ b/source/rr/src/premap.cpp @@ -641,7 +641,6 @@ void G_CacheMapData(void) { Bsprintf(tempbuf, "Loaded %d%% (%d/%d textures)\n", lpc, pc, g_precacheCount); G_DoLoadScreen(tempbuf, lpc); - timerUpdate(); if (totalclock - tc >= 1) { diff --git a/source/rr/src/savegame.cpp b/source/rr/src/savegame.cpp index 0501c6f7a..b8c80a136 100644 --- a/source/rr/src/savegame.cpp +++ b/source/rr/src/savegame.cpp @@ -447,8 +447,6 @@ static void G_SaveTimers(void) static void G_RestoreTimers(void) { - timerUpdate(); - totalclock = g_timers.totalclock; totalclocklock = g_timers.totalclocklock; ototalclock = g_timers.ototalclock; diff --git a/source/rr/src/sounds.cpp b/source/rr/src/sounds.cpp index 85cf2b899..e3f897ede 100644 --- a/source/rr/src/sounds.cpp +++ b/source/rr/src/sounds.cpp @@ -98,15 +98,28 @@ void S_SoundShutdown(void) void S_MusicStartup(void) { - initprintf("Initializing music...\n"); + initprintf("Initializing MIDI driver... "); if (MUSIC_Init(MusicDevice) == MUSIC_Ok) { MUSIC_SetVolume(mus_volume); return; } +#if 0 + MUSIC_SetVolume(ud.config.MusicVolume); - initprintf("S_MusicStartup(): failed initializing\n"); + auto const fil = kopen4load("d3dtimbr.tmb", 0); + + if (fil != buildvfs_kfd_invalid) + { + int l = kfilelength(fil); + auto tmb = (uint8_t *)Xmalloc(l); + kread(fil, tmb, l); + AL_RegisterTimbreBank(tmb); + Xfree(tmb); + kclose(fil); + } +#endif } void S_MusicShutdown(void)