Skip to content

Commit 48bd160

Browse files
committed
fix wipe effect skipping frames when rendering takes "too long"
software mode at high resolutions takes longer to render and to dump frames than opengl at comparable resolutions. so more real time passes between frames, which makes the ending advance the melt effect further than normal on the next frame. the code was always doing this, but it was written with much lower resolution in mind too, and viddump wasn't as widespread back then maybe? now melt consistently takes 45 frames, even tho in `wipe_doMelt()` cph says it takes 25 for some reason (that whole comment kinda contradicts current reality anyway). fixes #714
1 parent 5038350 commit 48bd160

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

prboom2/src/f_wipe.c

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -127,25 +127,25 @@ static int wipe_doMelt(int ticks)
127127
if (y_lookup[i]+dy >= SCREENHEIGHT)
128128
dy = SCREENHEIGHT - y_lookup[i];
129129

130-
if (V_IsSoftwareMode()) {
131-
s = wipe_scr_end.data + (y_lookup[i]*wipe_scr_end.pitch+i);
132-
d = wipe_scr.data + (y_lookup[i]*wipe_scr.pitch+i);
133-
for (j=dy;j;j--) {
134-
d[0] = s[0];
135-
d += wipe_scr.pitch;
136-
s += wipe_scr_end.pitch;
130+
if (V_IsSoftwareMode()) {
131+
s = wipe_scr_end.data + (y_lookup[i]*wipe_scr_end.pitch+i);
132+
d = wipe_scr.data + (y_lookup[i]*wipe_scr.pitch+i);
133+
for (j=dy;j;j--) {
134+
d[0] = s[0];
135+
d += wipe_scr.pitch;
136+
s += wipe_scr_end.pitch;
137+
}
137138
}
138-
}
139139
y_lookup[i] += dy;
140-
if (V_IsSoftwareMode()) {
141-
s = wipe_scr_start.data + i;
142-
d = wipe_scr.data + (y_lookup[i]*wipe_scr.pitch+i);
143-
for (j=SCREENHEIGHT-y_lookup[i];j;j--) {
144-
d[0] = s[0];
145-
d += wipe_scr.pitch;
146-
s += wipe_scr_end.pitch;
140+
if (V_IsSoftwareMode()) {
141+
s = wipe_scr_start.data + i;
142+
d = wipe_scr.data + (y_lookup[i]*wipe_scr.pitch+i);
143+
for (j=SCREENHEIGHT-y_lookup[i];j;j--) {
144+
d[0] = s[0];
145+
d += wipe_scr.pitch;
146+
s += wipe_scr_end.pitch;
147+
}
147148
}
148-
}
149149
done = false;
150150
}
151151
}

0 commit comments

Comments
 (0)