summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Engledow2018-08-14 13:52:51 +0100
committerSteve Engledow2018-08-14 13:52:51 +0100
commit28059f96457d3d1cfe72f3e707b4ed2832e2c707 (patch)
tree51d02831c98d451f33f06787b2c22213e819cd42
parentf39c5d90b16535457c496e9bbb2dbc135028d761 (diff)
downloadaur-28059f96457d3d1cfe72f3e707b4ed2832e2c707.tar.gz
Default to quadruple scaling
-rw-r--r--.SRCINFO2
-rw-r--r--PKGBUILD2
-rw-r--r--heroes-0.21.patch221
3 files changed, 207 insertions, 18 deletions
diff --git a/.SRCINFO b/.SRCINFO
index af35a0796dc6..c3ccb7216bf4 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -16,7 +16,7 @@ pkgbase = heroes
md5sums = bcde6137a4b21b7395fd3d84b42b7888
md5sums = f4defb80baf765fceac034a408f7ad2e
md5sums = dafb2ccfb08c132265262231d5655102
- md5sums = 7e51b9e98318aaa32a7604955a541b38
+ md5sums = 2f5b9b1b69420e1f273837e7d7cbf38d
pkgname = heroes
diff --git a/PKGBUILD b/PKGBUILD
index b18e8910aa75..cb1332e3ad5e 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -19,7 +19,7 @@ md5sums=('3238290f219bc978894ba472fac95298'
'bcde6137a4b21b7395fd3d84b42b7888'
'f4defb80baf765fceac034a408f7ad2e'
'dafb2ccfb08c132265262231d5655102'
- '7e51b9e98318aaa32a7604955a541b38')
+ '2f5b9b1b69420e1f273837e7d7cbf38d')
build() {
cd "$pkgname-$pkgver"
diff --git a/heroes-0.21.patch b/heroes-0.21.patch
index 142cb0fd0582..96a6d2b48064 100644
--- a/heroes-0.21.patch
+++ b/heroes-0.21.patch
@@ -1,16 +1,32 @@
diff '--color=auto' -ruN ../heroes-0.21/src/argv.c ./src/argv.c
---- ../heroes-0.21/src/argv.c 2018-08-14 13:29:49.718698807 +0100
-+++ ./src/argv.c 2018-08-14 13:30:09.000000000 +0100
-@@ -176,7 +176,7 @@
+--- ../heroes-0.21/src/argv.c 2018-08-14 13:38:06.000000000 +0100
++++ ./src/argv.c 2018-08-14 13:47:26.001931402 +0100
+@@ -46,7 +46,7 @@
+ bool mono = false;
+ bool bits8 = false;
+ bool hqmix = false;
+-int stretch = 1;
++int stretch = 4;
+ bool nosound = false;
+ bool even_lines = false;
+ bool showprefs = false;
+@@ -176,10 +176,7 @@
puts (_("\
Display options:\n\
-G, --gfx-options=OPTIONS pass OPTIONS to the display driver\n\
- -F, --full-screen full screen mode\n\
+- -2, --double stretch the display twofold\n\
+- -3, --triple stretch the display threefold\n\
+- -4, --quadruple stretch the display fourfold\n\
+ -W, --windowed windowed mode\n\
- -2, --double stretch the display twofold\n\
- -3, --triple stretch the display threefold\n\
- -4, --quadruple stretch the display fourfold\n\
-@@ -219,7 +219,7 @@
+ -e, --even-lines display only even-lines\n"));
+ /* TRANS: rotozoom is a graphical effect used in the demo of yore
+ where the screen rotate and zoom (actually it doesn't zoom in Heroes);
+@@ -215,11 +212,10 @@
+ {"default-saves", no_argument, &reinitsav, 1},
+ {"default-scores", no_argument, &reinitsco, 1},
+ {"devparm", no_argument, &devparm, 1},
+- {"double", no_argument, NULL, '2'},
{"driver", required_argument, NULL, 'd'},
{"drivers-info", no_argument, NULL, 'n'},
{"even-lines", no_argument, NULL, 'e'},
@@ -19,16 +35,28 @@ diff '--color=auto' -ruN ../heroes-0.21/src/argv.c ./src/argv.c
{"gfx-options", required_argument, NULL, 'G'},
{"go", no_argument, NULL, 'g'},
{"help", no_argument, NULL, 'h'},
-@@ -263,7 +263,7 @@
+@@ -231,11 +227,9 @@
+ {"no-joystick", no_argument, NULL, 'J'},
+ {"no-sfx", no_argument, NULL, 'X'},
+ {"no-sound", no_argument, NULL, 'S'},
+- {"quadruple", no_argument, NULL, '4'},
+ {"quiet", no_argument, NULL, 'q'},
+ {"really-quiet", no_argument, NULL, 'Q'},
+ {"swap-sides", no_argument, NULL, 's'},
+- {"triple", no_argument, NULL, '3'},
+ {"verbose", required_argument, NULL, 'v'},
+ {"version", no_argument, NULL, 'v'},
+ {"x10-saves", no_argument, &x10sav, 1},
+@@ -263,7 +257,7 @@
for (;;) {
int option_index = 0;
- c = getopt_long (argc, argv, "2348d:eFgG:hiJl::L:mnqQsSv::X",
-+ c = getopt_long (argc, argv, "2348d:eWgG:hiJl::L:mnqQsSv::X",
++ c = getopt_long (argc, argv, "8d:eWgG:hiJl::L:mnqQsSv::X",
long_options, &option_index);
/* Detect the end of the options. */
-@@ -319,7 +319,7 @@
+@@ -319,21 +313,12 @@
case 'G':
set_display_params (optarg);
break;
@@ -37,9 +65,23 @@ diff '--color=auto' -ruN ../heroes-0.21/src/argv.c ./src/argv.c
set_full_screen_mode ();
break;
case 'J':
+ joyoff = true;
+ break;
+- case '2':
+- stretch = 2;
+- break;
+- case '3':
+- stretch = 3;
+- break;
+- case '4':
+- stretch = 4;
+- break;
+ case 'e':
+ even_lines = true;
+ break;
diff '--color=auto' -ruN ../heroes-0.21/src/hedlite.c ./src/hedlite.c
---- ../heroes-0.21/src/hedlite.c 2018-08-14 13:29:49.915366091 +0100
-+++ ./src/hedlite.c 2018-08-14 13:30:09.000000000 +0100
+--- ../heroes-0.21/src/hedlite.c 2018-08-14 13:38:07.000000000 +0100
++++ ./src/hedlite.c 2018-08-14 13:38:24.000000000 +0100
@@ -45,7 +45,6 @@
#include "dirname.h"
@@ -49,8 +91,8 @@ diff '--color=auto' -ruN ../heroes-0.21/src/hedlite.c ./src/hedlite.c
unsigned short int xdalles = 0;
unsigned short int ydalles = 0;
diff '--color=auto' -ruN ../heroes-0.21/src/media/ggi/video.c ./src/media/ggi/video.c
---- ../heroes-0.21/src/media/ggi/video.c 2018-08-14 13:29:49.512031490 +0100
-+++ ./src/media/ggi/video.c 2018-08-14 13:30:09.000000000 +0100
+--- ../heroes-0.21/src/media/ggi/video.c 2018-08-14 13:38:06.000000000 +0100
++++ ./src/media/ggi/video.c 2018-08-14 13:38:24.000000000 +0100
@@ -54,7 +54,7 @@
static ggi_mode vid_mode;
@@ -70,8 +112,8 @@ diff '--color=auto' -ruN ../heroes-0.21/src/media/ggi/video.c ./src/media/ggi/vi
static bool
diff '--color=auto' -ruN ../heroes-0.21/src/media/sdl/video.c ./src/media/sdl/video.c
---- ../heroes-0.21/src/media/sdl/video.c 2018-08-14 13:29:49.618698493 +0100
-+++ ./src/media/sdl/video.c 2018-08-14 13:32:00.769111365 +0100
+--- ../heroes-0.21/src/media/sdl/video.c 2018-08-14 13:38:06.000000000 +0100
++++ ./src/media/sdl/video.c 2018-08-14 13:38:24.000000000 +0100
@@ -40,7 +40,7 @@
it might requires locking. */
@@ -90,3 +132,150 @@ diff '--color=auto' -ruN ../heroes-0.21/src/media/sdl/video.c ./src/media/sdl/vi
}
/* Fullscreen mode is toggeled by pressing Alt+Enter.
+diff '--color=auto' -ruN ../heroes-0.21/src/media/video.c ./src/media/video.c
+--- ../heroes-0.21/src/media/video.c 2018-08-14 13:38:06.000000000 +0100
++++ ./src/media/video.c 2018-08-14 13:49:53.709026850 +0100
+@@ -27,111 +27,6 @@
+ /* slow stretching routines */
+
+ static void
+-stretch_twofold (const a_pixel *s, a_pixel *d, unsigned width)
+-{
+- int rows_left, columns_left;
+-
+- for (rows_left = 200; rows_left; --rows_left) {
+- for (columns_left = width / 2; columns_left; --columns_left) {
+- a_pixel t1, t2;
+- t1 = s[0];
+- t2 = s[1];
+- d[0] = t1;
+- d[640 + 2] = t2;
+- d[1] = t1;
+- d[640 + 3] = t2;
+- d[640 + 0] = t1;
+- d[2] = t2;
+- d[640 + 1] = t1;
+- d[3] = t2;
+- s += 2;
+- d += 4;
+- }
+- d += 2 * (scr_pitch - width);
+- s += xbuf - width;
+- }
+-}
+-
+-static void
+-stretch_twofold_even (const a_pixel *s, a_pixel *d, unsigned width)
+-{
+- int rows_left, columns_left;
+-
+- for (rows_left = 200; rows_left; --rows_left) {
+- for (columns_left = width; columns_left; --columns_left) {
+- d[1] = d[0] = *s;
+- ++s;
+- d += 2;
+- }
+- d += 2 * (scr_pitch - width);
+- s += xbuf - width;
+- }
+-}
+-
+-static void
+-stretch_threefold (const a_pixel* s, a_pixel *d, unsigned width)
+-{
+- int rows_left, columns_left;
+-
+- for (rows_left = 200; rows_left; --rows_left) {
+- for (columns_left = width / 2; columns_left; --columns_left) {
+- a_pixel t1, t2;
+- t1 = s[0];
+- t2 = s[1];
+- d[0] = t1;
+- d[960 + 3] = t2;
+- d[2*960 + 1] = t1;
+- d[4] = t2;
+- d[960 + 2] = t1;
+- d[2*960 + 5] = t2;
+- d[960 + 0] = t1;
+- d[2*960 + 3] = t2;
+- d[1] = t1;
+- d[960 + 4] = t2;
+- d[2*960 + 2] = t1;
+- d[5] = t2;
+- d[2*960 + 0] = t1;
+- d[3] = t2;
+- d[960 + 1] = t1;
+- d[2*960 + 4] = t2;
+- d[2] = t1;
+- d[960 + 5] = t2;
+- s += 2;
+- d += 6;
+- }
+- d += 3 * (scr_pitch - width);
+- s += xbuf - width;
+- }
+-}
+-
+-static void
+-stretch_threefold_even (const a_pixel *s, a_pixel *d, unsigned width)
+-{
+- int rows_left, columns_left;
+-
+- for (rows_left = 200 / 2; rows_left; --rows_left) {
+- for (columns_left = width; columns_left; --columns_left) {
+- a_pixel t1, t2;
+- t1 = s[0];
+- t2 = s[xbuf];
+- d[0] = t1;
+- d[0+960*4] = t2;
+- d[1] = t1;
+- d[2] = t1;
+- d[1+960*4] = t2;
+- d[0+960*2] = t1;
+- d[1+960*2] = t1;
+- d[2+960*4] = t2;
+- d[2+960*2] = t1;
+- ++s;
+- d += 3;
+- }
+- d += 3 * (2 * scr_pitch - width);
+- s += 2 * xbuf - width;
+- }
+-}
+-
+-static void
+ stretch_fourfold (const a_pixel *s, a_pixel *d, unsigned width)
+ {
+ int rows_left, columns_left;
+@@ -196,27 +91,10 @@
+ {
+ /* the result of stretching routines is written directly
+ to the video memory */
+- if (stretch == 2) {
+- if (even_lines)
+- stretch_twofold_even (s, d, width);
+- else
+- stretch_twofold (s, d, width);
+- } else if (stretch == 3) {
+- if (even_lines)
+- stretch_threefold_even (s, d, width);
+- else
+- stretch_threefold (s, d, width);
+- } else if (stretch == 4) {
+- if (even_lines)
+- stretch_fourfold_even (s, d, width);
+- else
+- stretch_fourfold (s, d, width);
+- } else { /* stretch == 1 */
+- if (even_lines)
+- copy_screen_even (s, d, width);
+- else
+- copy_screen (s, d, width);
+- }
++ if (even_lines)
++ stretch_fourfold_even (s, d, width);
++ else
++ stretch_fourfold (s, d, width);
+ }
+
+ void