summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Swanson2021-01-08 10:52:38 -0800
committerMike Swanson2021-01-08 10:52:38 -0800
commitcb9e5d5cdea81f191988e0c9636085fcc20b3eb6 (patch)
treea973fc40e7ef039630f4320efaf68b3b7ebe0636
parent19cead4088f1d11a7937ca4f4e093f1de0e912fe (diff)
downloadaur-cb9e5d5cdea81f191988e0c9636085fcc20b3eb6.tar.gz
Include widescreen asset support
-rw-r--r--.SRCINFO8
-rw-r--r--0001-prevent-crashes-with-simultaneous-use-of-record-and-.patch4
-rw-r--r--0002-Support-widescreen-assets.-674.patch337
-rw-r--r--0003-force-status-bar-refresh-in-the-Main-Episode-and-Ski.patch50
-rw-r--r--PKGBUILD10
5 files changed, 402 insertions, 7 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 6aa4f48e1ede..54261548cadc 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = crispy-doom
pkgdesc = Vanilla-compatible enhanced Doom engine
pkgver = 5.9.2
- pkgrel = 2
+ pkgrel = 3
url = http://fabiangreffrath.github.io/crispy-doom
install = crispy-doom.install
arch = i686
@@ -18,8 +18,12 @@ pkgbase = crispy-doom
optdepends = freedoom2: Free Doom II-compatible game
source = https://github.com/fabiangreffrath/crispy-doom/archive/crispy-doom-5.9.2.tar.gz
source = 0001-prevent-crashes-with-simultaneous-use-of-record-and-.patch
+ source = 0002-Support-widescreen-assets.-674.patch
+ source = 0003-force-status-bar-refresh-in-the-Main-Episode-and-Ski.patch
b2sums = 63d9a89d6099485c79ff4cad69975de790b32a4ece4bded172ebf771a2bf1b4dcd21ab58383ca3c5eea32a4eff72e65ec0e3a283c85f1bc62be680de04f88e52
- b2sums = b1e77adf37f22f1ef47b614e27e6158ac7c19bf5b7adfa97a434b04f514a1e5cb7f1f77024a373392c836c5456c87b5bb6f7240566389574392a2e5f05d63d5d
+ b2sums = 3a48523211db97019993bf57dcecb376872a2858f6d482ca4210444ef7f25337d88f44bd4eeac01ed60d024521ffcfe027b0a39006c7c643c9c6cf004b2808f1
+ b2sums = ca952dc981b520bc30871f34e9e02c0697c9a7700fd502f30cef0fee4c86ee77b8b5563b3815bf8749ed5f3e8961443699ad0f25e7f9a71f3a39a9f0c2e98067
+ b2sums = 4dfa31e71a5ea7c2de31e2b1b8caf888832487f774a62f7012909b459bff048738828a2ed721367decddeb02688e7765062127ae44e34f4c24c1e6f2cf24c321
pkgname = crispy-doom
diff --git a/0001-prevent-crashes-with-simultaneous-use-of-record-and-.patch b/0001-prevent-crashes-with-simultaneous-use-of-record-and-.patch
index e2a83b3774c5..1269d133005c 100644
--- a/0001-prevent-crashes-with-simultaneous-use-of-record-and-.patch
+++ b/0001-prevent-crashes-with-simultaneous-use-of-record-and-.patch
@@ -1,7 +1,7 @@
From 211dd1a8b36dc5fecd4bc5149f54ffc1a6a85315 Mon Sep 17 00:00:00 2001
From: Fabian Greffrath <fabian@greffrath.com>
Date: Tue, 22 Sep 2020 12:18:33 +0200
-Subject: [PATCH] prevent crashes with simultaneous use of -record and
+Subject: [PATCH 1/3] prevent crashes with simultaneous use of -record and
-pistolstart
Thanks Spie812.
@@ -22,5 +22,5 @@ index 934d8bf7..84332889 100644
}
}
--
-2.28.0
+2.30.0
diff --git a/0002-Support-widescreen-assets.-674.patch b/0002-Support-widescreen-assets.-674.patch
new file mode 100644
index 000000000000..ce580d5810e0
--- /dev/null
+++ b/0002-Support-widescreen-assets.-674.patch
@@ -0,0 +1,337 @@
+From 084c1b968d7b97942771af7b416656c6c34d81bc Mon Sep 17 00:00:00 2001
+From: James Canete <SmileTheory@gmail.com>
+Date: Thu, 8 Oct 2020 23:19:03 -0700
+Subject: [PATCH 2/3] Support widescreen assets. (#674)
+
+* Support widescreen assets.
+
+* Simplify widescreen finale code.
+
+* Add widescreen ratio selection.
+
+* Requested changes.
+
+* Uncapitalize false.
+---
+ src/crispy.h | 10 +++++++++
+ src/doom/f_finale.c | 51 +++++++++++++++++++++++++++++++++------------
+ src/doom/m_crispy.c | 11 +++++++++-
+ src/doom/m_crispy.h | 1 +
+ src/doom/m_menu.c | 2 +-
+ src/doom/st_stuff.c | 10 ++++++++-
+ src/i_video.c | 22 ++++++++++++++++++-
+ src/v_video.c | 41 ++++++++++++++++++------------------
+ 8 files changed, 111 insertions(+), 37 deletions(-)
+
+diff --git a/src/crispy.h b/src/crispy.h
+index f58b36bb..16eb0552 100644
+--- a/src/crispy.h
++++ b/src/crispy.h
+@@ -222,4 +222,14 @@ enum
+ NUM_WIDGETS
+ };
+
++enum
++{
++ RATIO_4_3,
++ RATIO_MATCH_SCREEN,
++ RATIO_16_10,
++ RATIO_16_9,
++ RATIO_21_9,
++ NUM_RATIOS
++};
++
+ #endif
+diff --git a/src/doom/f_finale.c b/src/doom/f_finale.c
+index 97ebe722..b07127dd 100644
+--- a/src/doom/f_finale.c
++++ b/src/doom/f_finale.c
+@@ -890,8 +890,8 @@ F_DrawPatchCol
+ pixel_t* desttop;
+ int count;
+
+- column = (column_t *)((byte *)patch + LONG(patch->columnofs[col >> FRACBITS]));
+- desttop = I_VideoBuffer + x + (WIDESCREENDELTA << crispy->hires);
++ column = (column_t *)((byte *)patch + LONG(patch->columnofs[col]));
++ desttop = I_VideoBuffer + x;
+
+ // step through the posts in a column
+ while (column->topdelta != 0xff )
+@@ -924,19 +924,43 @@ void F_BunnyScroll (void)
+ char name[10];
+ int stage;
+ static int laststage;
++ int p2offset, p1offset, pillar_width;
+
+ dxi = (ORIGWIDTH << FRACBITS) / NONWIDEWIDTH;
+ dy = (SCREENHEIGHT << FRACBITS) / ORIGHEIGHT;
+ dyi = (ORIGHEIGHT << FRACBITS) / SCREENHEIGHT;
+
++ p1 = W_CacheLumpName (DEH_String("PFUB2"), PU_LEVEL);
++ p2 = W_CacheLumpName (DEH_String("PFUB1"), PU_LEVEL);
++
+ // [crispy] fill pillarboxes in widescreen mode
+- if (SCREENWIDTH != NONWIDEWIDTH)
++ pillar_width = (SCREENWIDTH - (p1->width << FRACBITS) / dxi) / 2;
++
++ if (pillar_width > 0)
++ {
++ V_DrawFilledBox(0, 0, pillar_width, SCREENHEIGHT, 0);
++ V_DrawFilledBox(SCREENWIDTH - pillar_width, 0, pillar_width, SCREENHEIGHT, 0);
++ }
++ else
+ {
+- V_DrawFilledBox(0, 0, SCREENWIDTH, SCREENHEIGHT, 0);
++ pillar_width = 0;
+ }
+
+- p1 = W_CacheLumpName (DEH_String("PFUB2"), PU_LEVEL);
+- p2 = W_CacheLumpName (DEH_String("PFUB1"), PU_LEVEL);
++ // Calculate the portion of PFUB2 that would be offscreen at original res.
++ p1offset = (ORIGWIDTH - p1->width) / 2;
++
++ if (p2->width == ORIGWIDTH)
++ {
++ // Unity or original PFUBs.
++ // PFUB1 only contains the pixels that scroll off.
++ p2offset = ORIGWIDTH - p1offset;
++ }
++ else
++ {
++ // Widescreen mod PFUBs.
++ // Right side of PFUB2 and left side of PFUB1 are identical.
++ p2offset = ORIGWIDTH + p1offset;
++ }
+
+ V_MarkRect (0, 0, SCREENWIDTH, SCREENHEIGHT);
+
+@@ -945,14 +969,15 @@ void F_BunnyScroll (void)
+ scrolled = ORIGWIDTH;
+ if (scrolled < 0)
+ scrolled = 0;
+- scrolled <<= FRACBITS;
+-
+- for ( x=0 ; x<ORIGWIDTH << FRACBITS; x+=dxi)
++
++ for (x = pillar_width; x < SCREENWIDTH - pillar_width; x++)
+ {
+- if (x+scrolled < ORIGWIDTH << FRACBITS)
+- F_DrawPatchCol (x/dxi, p1, x+scrolled);
+- else
+- F_DrawPatchCol (x/dxi, p2, x+scrolled - (ORIGWIDTH << FRACBITS));
++ int x2 = ((x * dxi) >> FRACBITS) - WIDESCREENDELTA + scrolled;
++
++ if (x2 < p2offset)
++ F_DrawPatchCol (x, p1, x2 - p1offset);
++ else
++ F_DrawPatchCol (x, p2, x2 - p2offset);
+ }
+
+ if (finalecount < 1130)
+diff --git a/src/doom/m_crispy.c b/src/doom/m_crispy.c
+index 01a61811..7ecc48f4 100644
+--- a/src/doom/m_crispy.c
++++ b/src/doom/m_crispy.c
+@@ -135,6 +135,15 @@ multiitem_t multiitem_widgets[NUM_WIDGETS] =
+ {WIDGETS_ALWAYS, "always"},
+ };
+
++multiitem_t multiitem_widescreen[NUM_RATIOS] =
++{
++ {RATIO_4_3, "4:3"},
++ {RATIO_MATCH_SCREEN, "Match screen"},
++ {RATIO_16_10, "16:10"},
++ {RATIO_16_9, "16:9"},
++ {RATIO_21_9, "21:9"},
++};
++
+ extern void AM_LevelInit (boolean reinit);
+ extern void EnableLoadingDisk (void);
+ extern void P_SegLengths (boolean contrast_only);
+@@ -537,7 +546,7 @@ void M_CrispyToggleWeaponSquat(int choice)
+
+ static void M_CrispyToggleWidescreenHook (void)
+ {
+- crispy->widescreen = !crispy->widescreen;
++ crispy->widescreen = (crispy->widescreen + 1) % NUM_RATIOS;
+
+ // [crispy] no need to re-init when switching from wide to compact
+ {
+diff --git a/src/doom/m_crispy.h b/src/doom/m_crispy.h
+index 954c9432..5897e6fc 100644
+--- a/src/doom/m_crispy.h
++++ b/src/doom/m_crispy.h
+@@ -41,6 +41,7 @@ extern multiitem_t multiitem_sndchannels[4];
+ extern multiitem_t multiitem_secretmessage[NUM_SECRETMESSAGE];
+ extern multiitem_t multiitem_translucency[NUM_TRANSLUCENCY];
+ extern multiitem_t multiitem_widgets[NUM_WIDGETS];
++extern multiitem_t multiitem_widescreen[NUM_RATIOS];
+
+ extern void M_CrispyToggleAutomapstats(int choice);
+ extern void M_CrispyToggleBobfactor(int choice);
+diff --git a/src/doom/m_menu.c b/src/doom/m_menu.c
+index 4f813a40..3e21f1be 100644
+--- a/src/doom/m_menu.c
++++ b/src/doom/m_menu.c
+@@ -1480,7 +1480,7 @@ static void M_DrawCrispness1(void)
+
+ M_DrawCrispnessSeparator(crispness_sep_rendering, "Rendering");
+ M_DrawCrispnessItem(crispness_hires, "High Resolution Rendering", crispy->hires, true);
+- M_DrawCrispnessItem(crispness_widescreen, "Widescreen Rendering", crispy->widescreen, aspect_ratio_correct);
++ M_DrawCrispnessMultiItem(crispness_widescreen, "Widescreen Aspect Ratio", multiitem_widescreen, crispy->widescreen, aspect_ratio_correct);
+ M_DrawCrispnessItem(crispness_uncapped, "Uncapped Framerate", crispy->uncapped, true);
+ M_DrawCrispnessItem(crispness_vsync, "Enable VSync", crispy->vsync, !force_software_renderer);
+ M_DrawCrispnessItem(crispness_smoothscaling, "Smooth Pixel Scaling", crispy->smoothscaling, true);
+diff --git a/src/doom/st_stuff.c b/src/doom/st_stuff.c
+index 3320eca5..1e025f23 100644
+--- a/src/doom/st_stuff.c
++++ b/src/doom/st_stuff.c
+@@ -502,7 +502,15 @@ void ST_refreshBackground(boolean force)
+ }
+ }
+
+- V_DrawPatch(ST_X, 0, sbar);
++ // [crispy] center unity rerelease wide status bar
++ if (sbar->width > ORIGWIDTH && sbar->leftoffset == 0)
++ {
++ V_DrawPatch(ST_X + (ORIGWIDTH - sbar->width) / 2, 0, sbar);
++ }
++ else
++ {
++ V_DrawPatch(ST_X, 0, sbar);
++ }
+
+ // draw right side of bar if needed (Doom 1.0)
+ if (sbarr)
+diff --git a/src/i_video.c b/src/i_video.c
+index 93ffed65..37621b56 100644
+--- a/src/i_video.c
++++ b/src/i_video.c
+@@ -315,7 +315,9 @@ static void AdjustWindowSize(void)
+ {
+ if (aspect_ratio_correct || integer_scaling)
+ {
+- if (window_width * actualheight <= window_height * SCREENWIDTH)
++ // [crispy] always adjust window width only, otherwise repeatedly
++ // changing widescreen settings causes the window to shrink.
++ if (window_width * actualheight <= window_height * SCREENWIDTH && false)
+ {
+ // We round up window_height if the ratio is not exact; this leaves
+ // the result stable.
+@@ -1551,6 +1553,24 @@ void I_GetScreenDimensions (void)
+ // [crispy] widescreen rendering makes no sense without aspect ratio correction
+ if (crispy->widescreen && aspect_ratio_correct)
+ {
++ switch(crispy->widescreen)
++ {
++ case RATIO_16_10:
++ w = 16;
++ h = 10;
++ break;
++ case RATIO_16_9:
++ w = 16;
++ h = 9;
++ break;
++ case RATIO_21_9:
++ w = 21;
++ h = 9;
++ break;
++ default:
++ break;
++ }
++
+ SCREENWIDTH = w * ah / h;
+ // [crispy] make sure SCREENWIDTH is an integer multiple of 4 ...
+ SCREENWIDTH = (SCREENWIDTH + 3) & (int)~3;
+diff --git a/src/v_video.c b/src/v_video.c
+index da5fa175..933109ec 100644
+--- a/src/v_video.c
++++ b/src/v_video.c
+@@ -236,20 +236,23 @@ void V_DrawPatch(int x, int y, patch_t *patch)
+ V_MarkRect(x, y, SHORT(patch->width), SHORT(patch->height));
+
+ col = 0;
++ if (x < 0)
++ {
++ col += dxi * ((-x * dx) >> FRACBITS);
++ x = 0;
++ }
++
+ desttop = dest_screen + ((y * dy) >> FRACBITS) * SCREENWIDTH + ((x * dx) >> FRACBITS);
+
+ w = SHORT(patch->width);
+
++ // convert x to screen position
++ x = (x * dx) >> FRACBITS;
++
+ for ( ; col<w << FRACBITS ; x++, col+=dxi, desttop++)
+ {
+ int topdelta = -1;
+
+- // [crispy] too far left
+- if (x < 0)
+- {
+- continue;
+- }
+-
+ // [crispy] too far right / width
+ if (x >= SCREENWIDTH)
+ {
+@@ -305,13 +308,7 @@ void V_DrawPatch(int x, int y, patch_t *patch)
+
+ void V_DrawPatchFullScreen(patch_t *patch, boolean flipped)
+ {
+- const short width = SHORT(patch->width);
+- const short height = SHORT(patch->height);
+-
+- dx = (NONWIDEWIDTH << FRACBITS) / ORIGWIDTH;
+- dxi = (width << FRACBITS) / NONWIDEWIDTH;
+- dy = (SCREENHEIGHT << FRACBITS) / height;
+- dyi = (height << FRACBITS) / SCREENHEIGHT;
++ int x = ((SCREENWIDTH >> crispy->hires) - patch->width) / 2 - WIDESCREENDELTA;
+
+ patch->leftoffset = 0;
+ patch->topoffset = 0;
+@@ -324,17 +321,12 @@ void V_DrawPatchFullScreen(patch_t *patch, boolean flipped)
+
+ if (flipped)
+ {
+- V_DrawPatchFlipped(0, 0, patch);
++ V_DrawPatchFlipped(x, 0, patch);
+ }
+ else
+ {
+- V_DrawPatch(0, 0, patch);
++ V_DrawPatch(x, 0, patch);
+ }
+-
+- dx = (NONWIDEWIDTH << FRACBITS) / ORIGWIDTH;
+- dxi = (ORIGWIDTH << FRACBITS) / NONWIDEWIDTH;
+- dy = (SCREENHEIGHT << FRACBITS) / ORIGHEIGHT;
+- dyi = (ORIGHEIGHT << FRACBITS) / SCREENHEIGHT;
+ }
+
+ //
+@@ -377,10 +369,19 @@ void V_DrawPatchFlipped(int x, int y, patch_t *patch)
+ V_MarkRect (x, y, SHORT(patch->width), SHORT(patch->height));
+
+ col = 0;
++ if (x < 0)
++ {
++ col += dxi * ((-x * dx) >> FRACBITS);
++ x = 0;
++ }
++
+ desttop = dest_screen + ((y * dy) >> FRACBITS) * SCREENWIDTH + ((x * dx) >> FRACBITS);
+
+ w = SHORT(patch->width);
+
++ // convert x to screen position
++ x = (x * dx) >> FRACBITS;
++
+ for ( ; col<w << FRACBITS ; x++, col+=dxi, desttop++)
+ {
+ int topdelta = -1;
+--
+2.30.0
+
diff --git a/0003-force-status-bar-refresh-in-the-Main-Episode-and-Ski.patch b/0003-force-status-bar-refresh-in-the-Main-Episode-and-Ski.patch
new file mode 100644
index 000000000000..48e41425c580
--- /dev/null
+++ b/0003-force-status-bar-refresh-in-the-Main-Episode-and-Ski.patch
@@ -0,0 +1,50 @@
+From 62db15a6c4cc3bbee9fd35e85bd0c6c5fe5ae98b Mon Sep 17 00:00:00 2001
+From: Fabian Greffrath <fabian@greffrath.com>
+Date: Thu, 7 Jan 2021 10:18:31 +0100
+Subject: [PATCH 3/3] force status bar refresh in the Main, Episode and Skill
+ menus
+
+Thanks @JNechaevsky.
+
+https://github.com/JNechaevsky/russian-doom/commit/968b7844d8cb8623683024345187c503b66ed806
+---
+ src/doom/m_menu.c | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/src/doom/m_menu.c b/src/doom/m_menu.c
+index 3e21f1be..0978ce3a 100644
+--- a/src/doom/m_menu.c
++++ b/src/doom/m_menu.c
+@@ -1236,6 +1236,9 @@ void M_MusicVol(int choice)
+ //
+ void M_DrawMainMenu(void)
+ {
++ // [crispy] force status bar refresh
++ inhelpscreens = true;
++
+ V_DrawPatchDirect(94, 2,
+ W_CacheLumpName(DEH_String("M_DOOM"), PU_CACHE));
+ }
+@@ -1248,6 +1251,9 @@ void M_DrawMainMenu(void)
+ //
+ void M_DrawNewGame(void)
+ {
++ // [crispy] force status bar refresh
++ inhelpscreens = true;
++
+ V_DrawPatchDirect(96, 14, W_CacheLumpName(DEH_String("M_NEWG"), PU_CACHE));
+ V_DrawPatchDirect(54, 38, W_CacheLumpName(DEH_String("M_SKILL"), PU_CACHE));
+ }
+@@ -1282,6 +1288,9 @@ int epi;
+
+ void M_DrawEpisode(void)
+ {
++ // [crispy] force status bar refresh
++ inhelpscreens = true;
++
+ V_DrawPatchDirect(54, 38, W_CacheLumpName(DEH_String("M_EPISOD"), PU_CACHE));
+ }
+
+--
+2.30.0
+
diff --git a/PKGBUILD b/PKGBUILD
index 9257b108095f..09f9d5640b18 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,7 +3,7 @@
pkgname=crispy-doom
pkgdesc="Vanilla-compatible enhanced Doom engine"
pkgver=5.9.2
-pkgrel=2
+pkgrel=3
arch=('i686' 'x86_64')
url="http://fabiangreffrath.github.io/crispy-doom"
license=('GPL2')
@@ -14,9 +14,13 @@ optdepends=('freedm: Free deathmatch game'
'freedoom2: Free Doom II-compatible game')
install=crispy-doom.install
source=(https://github.com/fabiangreffrath/$pkgname/archive/$pkgname-$pkgver.tar.gz
- 0001-prevent-crashes-with-simultaneous-use-of-record-and-.patch)
+ 0001-prevent-crashes-with-simultaneous-use-of-record-and-.patch
+ 0002-Support-widescreen-assets.-674.patch
+ 0003-force-status-bar-refresh-in-the-Main-Episode-and-Ski.patch)
b2sums=('63d9a89d6099485c79ff4cad69975de790b32a4ece4bded172ebf771a2bf1b4dcd21ab58383ca3c5eea32a4eff72e65ec0e3a283c85f1bc62be680de04f88e52'
- 'b1e77adf37f22f1ef47b614e27e6158ac7c19bf5b7adfa97a434b04f514a1e5cb7f1f77024a373392c836c5456c87b5bb6f7240566389574392a2e5f05d63d5d')
+ '3a48523211db97019993bf57dcecb376872a2858f6d482ca4210444ef7f25337d88f44bd4eeac01ed60d024521ffcfe027b0a39006c7c643c9c6cf004b2808f1'
+ 'ca952dc981b520bc30871f34e9e02c0697c9a7700fd502f30cef0fee4c86ee77b8b5563b3815bf8749ed5f3e8961443699ad0f25e7f9a71f3a39a9f0c2e98067'
+ '4dfa31e71a5ea7c2de31e2b1b8caf888832487f774a62f7012909b459bff048738828a2ed721367decddeb02688e7765062127ae44e34f4c24c1e6f2cf24c321')
prepare() {
cd "$pkgname-$pkgname-$pkgver"