Skip to content

Commit ba4fb0f

Browse files
committed
make wipe width-independent (by Pedro-Beirao)
1 parent 2398f82 commit ba4fb0f

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

prboom2/src/f_wipe.c

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ void R_InitMeltRes(void)
7777
static int wipe_initMelt(int ticks)
7878
{
7979
int i;
80+
int block_width = WIDE_SCREENWIDTH / 320;
8081

8182
if (V_IsSoftwareMode())
8283
{
@@ -89,16 +90,20 @@ static int wipe_initMelt(int ticks)
8990

9091
// setup initial column positions (y<0 => not ready to scroll yet)
9192
y_lookup[0] = -(M_Random()%16);
92-
for (i=1;i<SCREENWIDTH;i++)
93-
{
94-
int r = (M_Random()%3) - 1;
95-
y_lookup[i] = y_lookup[i-1] + r;
96-
if (y_lookup[i] > 0)
97-
y_lookup[i] = 0;
98-
else
99-
if (y_lookup[i] == -16)
100-
y_lookup[i] = -15;
101-
}
93+
for (i = 1; i < SCREENWIDTH; i++)
94+
{
95+
int r = y_lookup[i - 1];
96+
97+
if (i % block_width == 0)
98+
r += (M_Random()%3) - 1;
99+
100+
y_lookup[i] = r;
101+
if (y_lookup[i] > 0)
102+
y_lookup[i] = 0;
103+
else
104+
if (y_lookup[i] == -16)
105+
y_lookup[i] = -15;
106+
}
102107
return 0;
103108
}
104109

0 commit comments

Comments
 (0)