summarylogtreecommitdiffstats
path: root/heroes-0.21.patch
blob: 7a58994934fc9f22228f3cb9b5c190b66fc79bbc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
diff '--color=auto' -ruN ../heroes-0.21/src/argv.c ./src/argv.c
--- ../heroes-0.21/src/argv.c	2002-01-09 18:52:35.000000000 +0000
+++ ./src/argv.c	2022-06-30 10:55:29.838547018 +0100
@@ -45,8 +45,8 @@
 char* level_name;
 bool mono = false;
 bool bits8 = false;
-bool hqmix = false;
-int stretch = 1;
+bool hqmix = true;
+int stretch = 4;
 bool nosound = false;
 bool even_lines = false;
 bool showprefs = false;
@@ -171,15 +171,11 @@
   -S, --no-sound              disable sound\n\
   -X, --no-sfx                disable sound-effects\n\
   -m, --mono                  non-stereo output\n\
-  -8, --8bits                 8bits sound output\n\
-  -i, --high-quality          high quality mixer\n"));
+  -8, --8bits                 8bits sound output\n"));
   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\
   -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,15 +211,13 @@
   {"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'},
-  {"full-screen",	no_argument,	   NULL,	'F'},
+  {"windowed",	no_argument,	   NULL,	'W'},
   {"gfx-options",	required_argument, NULL,	'G'},
   {"go",		no_argument,       NULL,	'g'},
   {"help",		no_argument,       NULL,	'h'},
-  {"high-quality",	no_argument,       NULL,	'i'},
   {"list",		optional_argument, NULL,	'l'},
   {"load",		required_argument, NULL,	'L'},
   {"mono",		no_argument,       NULL,	'm'},
@@ -231,11 +225,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 +255,7 @@
   for (;;) {
     int option_index = 0;
 
-    c = getopt_long (argc, argv, "2348d:eFgG: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. */
@@ -290,9 +282,6 @@
     case '8':
       bits8 = true;
       break;
-    case 'a':
-      hqmix = true;
-      break;
     case 'X':
       nosfx = true;
       break;
@@ -319,27 +308,15 @@
     case 'G':
       set_display_params (optarg);
       break;
-    case 'F':
+    case 'W':
       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;
-    case 'i':
-      hqmix = true;
-      break;
     case 'S':
       nosound = true;
       break;
diff '--color=auto' -ruN ../heroes-0.21/src/hedlite.c ./src/hedlite.c
--- ../heroes-0.21/src/hedlite.c	2002-02-06 21:49:44.000000000 +0000
+++ ./src/hedlite.c	2022-06-30 10:55:29.838547018 +0100
@@ -45,7 +45,6 @@
 #include "dirname.h"
 
 static a_pcx_image heditrsc;
-static a_pcx_image tile_set_img;
 
 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	2002-03-27 19:44:59.000000000 +0000
+++ ./src/media/ggi/video.c	2022-06-30 10:55:29.838547018 +0100
@@ -54,7 +54,7 @@
 
 static ggi_mode vid_mode;
 static char *display_params = NULL;
-static int full_screen = 0;
+static int full_screen = 1;
 /* Direct buffer for each frame.
    We might have db[0] == db[1] if double buffering is not available.*/
 static const ggi_directbuffer *db[2] = { NULL, NULL };
@@ -88,7 +88,7 @@
 void
 set_full_screen_mode (void)
 {
-  full_screen = 1;
+  full_screen = 0;
 }
 
 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	2002-01-17 19:59:32.000000000 +0000
+++ ./src/media/sdl/video.c	2022-06-30 10:55:29.838547018 +0100
@@ -40,7 +40,7 @@
    it might requires locking. */
 
 static SDL_Surface *visu = 0;
-static int visu_options = SDL_HWPALETTE | SDL_DOUBLEBUF;
+static int visu_options = SDL_HWPALETTE | SDL_DOUBLEBUF | SDL_FULLSCREEN;
 static bool SDL_initialized = false;
 #define SDL_VIDEODRIVER "SDL_VIDEODRIVER"
 static char *sdl_videodriver = 0;
@@ -56,7 +56,7 @@
 void
 set_full_screen_mode (void)
 {
-  visu_options |= SDL_FULLSCREEN;
+  visu_options &= ~SDL_FULLSCREEN;
 }
 
 /* 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	2001-09-21 11:43:57.000000000 +0100
+++ ./src/media/video.c	2022-06-30 10:55:29.838547018 +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
diff '--color=auto' -ruN ../heroes-0.21/src/persona.h ./src/persona.h
--- ../heroes-0.21/src/persona.h	2001-09-21 11:43:54.000000000 +0100
+++ ./src/persona.h	2022-06-30 10:55:48.008744082 +0100
@@ -28,8 +28,8 @@
  * difference only if the program has a sgid or suid bit.
  */
 
-bool keep_sgid;			/* Whether we should keep the  */
-bool keep_suid;			/* SGID or SUID priviledge. */
+extern bool keep_sgid;			/* Whether we should keep the  */
+extern bool keep_suid;			/* SGID or SUID priviledge. */
 
 /* Get information about the current persona,
    and switch to the user persona.  */