Skip to content

Commit 23055a7

Browse files
remove remnants of SDL1
Fixes fabiangreffrath#25, extravbls is still evailable through the debug menu if ever needed.
1 parent 1df5523 commit 23055a7

File tree

8 files changed

+9
-82
lines changed

8 files changed

+9
-82
lines changed

‎README.txt‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -121,14 +121,6 @@ Wolf4SDL supports the following command line options:
121121
(must be multiple of 320x200 or 320x240)
122122
--resf <w> <h> Sets any screen resolution >= 320x200
123123
(which may result in graphic errors)
124-
--bits <b> Sets the screen color depth
125-
(Use this when you have palette/fading problem
126-
or perhaps to optimize speed on old systems.
127-
Allowed: 8, 16, 24, 32, default: "best" depth)
128-
--nodblbuf Don't use SDL's double buffering
129-
--extravbls <vbls> Sets a delay after each frame, which may help to
130-
reduce flickering (SDL does not support vsync...)
131-
(unit is currently 8 ms, default: 0)
132124
--joystick <index> Use the index-th joystick if available
133125
--joystickhat <index> Enables movement with the given coolie hat
134126
--samplerate <rate> Sets the sound sample rate (given in Hz)

‎id_vh.cpp‎

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -425,18 +425,10 @@ boolean FizzleFade (SDL_Surface *source, int x1, int y1,
425425
// copy one pixel
426426
//
427427

428-
if(screenBits == 8)
429-
{
430-
*(destptr + (y1 + y) * screen->pitch + x1 + x)
431-
= *(srcptr + (y1 + y) * source->pitch + x1 + x);
432-
}
433-
else
434-
{
435428
byte col = *(srcptr + (y1 + y) * source->pitch + x1 + x);
436429
uint32_t fullcol = SDL_MapRGB(screen->format, curpal[col].r, curpal[col].g, curpal[col].b);
437430
memcpy(destptr + (y1 + y) * screen->pitch + (x1 + x) * screen->format->BytesPerPixel,
438431
&fullcol, screen->format->BytesPerPixel);
439-
}
440432

441433
if(rndval == 0) // entire sequence has been completed
442434
goto finished;
@@ -446,7 +438,7 @@ boolean FizzleFade (SDL_Surface *source, int x1, int y1,
446438
}
447439

448440
// If there is no double buffering, we always use the "first frame" case
449-
if(usedoublebuffering) first = 0;
441+
first = 0;
450442

451443
VL_UnlockSurface(screen);
452444
VL_Flip();

‎id_vl.cpp‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,10 @@
1717

1818
boolean fullscreen = false;
1919
#if defined(_arch_dreamcast)
20-
boolean usedoublebuffering = false;
2120
unsigned screenWidth = 320;
2221
unsigned screenHeight = 200;
2322
int screenBits = 8;
2423
#elif defined(GP2X)
25-
boolean usedoublebuffering = true;
2624
unsigned screenWidth = 320;
2725
unsigned screenHeight = 240;
2826
#if defined(GP2X_940)
@@ -31,7 +29,6 @@ int screenBits = 8;
3129
int screenBits = 16;
3230
#endif
3331
#else
34-
boolean usedoublebuffering = true;
3532
unsigned screenWidth = 640;
3633
unsigned screenHeight = 400;
3734
int screenBits = -1; // use "best" color depth according to libSDL
@@ -393,7 +390,6 @@ void VL_FadeOut (int start, int end, int red, int green, int blue, int steps)
393390
newptr++;
394391
}
395392

396-
if(!usedoublebuffering || screenBits == 8) VL_WaitVBL(1);
397393
VL_SetPalette (palette2, true);
398394
}
399395

@@ -437,7 +433,6 @@ void VL_FadeIn (int start, int end, SDL_Color *palette, int steps)
437433
palette2[j].b = palette1[j].b + delta * i / steps;
438434
}
439435

440-
if(!usedoublebuffering || screenBits == 8) VL_WaitVBL(1);
441436
VL_SetPalette(palette2, true);
442437
}
443438

‎id_vl.h‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@ void Quit (const char *error,...);
1414
extern SDL_Window *window;
1515
extern SDL_Surface *screen, *screenBuffer, *curSurface;
1616

17-
extern boolean fullscreen, usedoublebuffering;
17+
extern boolean fullscreen;
1818
extern unsigned screenWidth, screenHeight, screenPitch, bufferPitch, curPitch;
19-
extern int screenBits;
2019
extern unsigned scaleFactor;
2120

2221
extern boolean screenfaded;

‎wl_act2.cpp‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2563,7 +2563,7 @@ void A_StartDeathCam (objtype *ob)
25632563
return;
25642564
}
25652565

2566-
if(usedoublebuffering) VH_UpdateScreen();
2566+
VH_UpdateScreen();
25672567

25682568
gamestate.victoryflag = true;
25692569
unsigned fadeheight = viewsize != 21 ? screenHeight-scaleFactor*STATUSLINES : screenHeight;
@@ -2592,7 +2592,6 @@ void A_StartDeathCam (objtype *ob)
25922592
}
25932593

25942594
VW_UpdateScreen ();
2595-
if(usedoublebuffering) VH_UpdateScreen();
25962595

25972596
IN_UserInput(300);
25982597

‎wl_game.cpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1123,7 +1123,7 @@ void RecordDemo (void)
11231123
SetupGameLevel ();
11241124
StartMusic ();
11251125

1126-
if(usedoublebuffering) VH_UpdateScreen();
1126+
VH_UpdateScreen();
11271127
fizzlein = true;
11281128

11291129
PlayLoop ();
@@ -1319,7 +1319,7 @@ void Died (void)
13191319
//
13201320
FinishPaletteShifts ();
13211321

1322-
if(usedoublebuffering) VH_UpdateScreen();
1322+
VH_UpdateScreen();
13231323

13241324
VL_BarScaledCoord (viewscreenx,viewscreeny,viewwidth,viewheight,4);
13251325

‎wl_inter.cpp‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,7 @@ LevelCompleted (void)
672672
Write (x, 7, tempstr);
673673
if (!(i % (PAR_AMOUNT / 10)))
674674
SD_PlaySound (ENDBONUS1SND);
675-
if(!usedoublebuffering || !(i % (PAR_AMOUNT / 50))) VW_UpdateScreen ();
675+
if(!(i % (PAR_AMOUNT / 50))) VW_UpdateScreen ();
676676
while(SD_SoundPlaying ())
677677
BJ_Breathe ();
678678
if (IN_CheckAck ())
@@ -703,7 +703,7 @@ LevelCompleted (void)
703703
Write (x, 14, tempstr);
704704
if (!(i % 10))
705705
SD_PlaySound (ENDBONUS1SND);
706-
if(!usedoublebuffering || !(i & 1)) VW_UpdateScreen ();
706+
if(!(i & 1)) VW_UpdateScreen ();
707707
while (SD_SoundPlaying ())
708708
BJ_Breathe ();
709709

@@ -745,7 +745,7 @@ LevelCompleted (void)
745745
Write (x, 16, tempstr);
746746
if (!(i % 10))
747747
SD_PlaySound (ENDBONUS1SND);
748-
if(!usedoublebuffering || !(i & 1)) VW_UpdateScreen ();
748+
if(!(i & 1)) VW_UpdateScreen ();
749749
while (SD_SoundPlaying ())
750750
BJ_Breathe ();
751751

@@ -786,7 +786,7 @@ LevelCompleted (void)
786786
Write (x, 18, tempstr);
787787
if (!(i % 10))
788788
SD_PlaySound (ENDBONUS1SND);
789-
if(!usedoublebuffering || !(i & 1)) VW_UpdateScreen ();
789+
if(!(i & 1)) VW_UpdateScreen ();
790790
while (SD_SoundPlaying ())
791791
BJ_Breathe ();
792792
if (IN_CheckAck ())

‎wl_main.cpp‎

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1776,50 +1776,6 @@ void CheckParameters(int argc, char *argv[])
17761776
printf("Screen height must be at least 200!\n"), hasError = true;
17771777
}
17781778
}
1779-
else IFARG("--bits")
1780-
{
1781-
if(++i >= argc)
1782-
{
1783-
printf("The bits option is missing the color depth argument!\n");
1784-
hasError = true;
1785-
}
1786-
else
1787-
{
1788-
screenBits = atoi(argv[i]);
1789-
switch(screenBits)
1790-
{
1791-
case 8:
1792-
case 16:
1793-
case 24:
1794-
case 32:
1795-
break;
1796-
1797-
default:
1798-
printf("Screen color depth must be 8, 16, 24, or 32!\n");
1799-
hasError = true;
1800-
break;
1801-
}
1802-
}
1803-
}
1804-
else IFARG("--nodblbuf")
1805-
usedoublebuffering = false;
1806-
else IFARG("--extravbls")
1807-
{
1808-
if(++i >= argc)
1809-
{
1810-
printf("The extravbls option is missing the vbls argument!\n");
1811-
hasError = true;
1812-
}
1813-
else
1814-
{
1815-
extravbls = atoi(argv[i]);
1816-
if(extravbls < 0)
1817-
{
1818-
printf("Extravbls must be positive!\n");
1819-
hasError = true;
1820-
}
1821-
}
1822-
}
18231779
else IFARG("--joystick")
18241780
{
18251781
if(++i >= argc)
@@ -1929,12 +1885,6 @@ void CheckParameters(int argc, char *argv[])
19291885
" (must be multiple of 320x200 or 320x240)\n"
19301886
" --resf <w> <h> Sets any screen resolution >= 320x200\n"
19311887
" (which may result in graphic errors)\n"
1932-
" --bits <b> Sets the screen color depth\n"
1933-
" (use this when you have palette/fading problems\n"
1934-
" allowed: 8, 16, 24, 32, default: \"best\" depth)\n"
1935-
" --nodblbuf Don't use SDL's double buffering\n"
1936-
" --extravbls <vbls> Sets a delay after each frame, which may help to\n"
1937-
" reduce flickering (unit is currently 8 ms, default: 0)\n"
19381888
" --joystick <index> Use the index-th joystick if available\n"
19391889
" (-1 to disable joystick, default: 0)\n"
19401890
" --joystickhat <index> Enables movement with the given coolie hat\n"

0 commit comments

Comments
 (0)