File tree 3 files changed +21
-2
lines changed
3 files changed +21
-2
lines changed Original file line number Diff line number Diff line change 39
39
#include "doomstat.h"
40
40
#include "doomtype.h"
41
41
#include "i_system.h"
42
+ #include "i_video.h"
42
43
#include "m_fixed.h"
43
44
#include "r_bmaps.h" // [crispy] R_BrightmapForTexName()
44
45
#include "r_data.h"
@@ -413,9 +414,21 @@ static void DrawSkyTex(visplane_t *pl, skytex_t *skytex)
413
414
dc_texheight = textureheight [texture ] >> FRACBITS ;
414
415
dc_iscale = FixedMul (skyiscale , skytex -> scaley );
415
416
416
- dc_texturemid += skytex -> curry ;
417
+ fixed_t deltax , deltay ;
418
+ if (uncapped && leveltime > oldleveltime )
419
+ {
420
+ deltax = LerpFixed (skytex -> prevx , skytex -> currx );
421
+ deltay = LerpFixed (skytex -> prevy , skytex -> curry );
422
+ }
423
+ else
424
+ {
425
+ deltax = skytex -> currx ;
426
+ deltay = skytex -> curry ;
427
+ }
428
+
429
+ dc_texturemid += deltay ;
417
430
418
- angle_t an = viewangle + FixedToAngle ( skytex -> currx );
431
+ angle_t an = viewangle + ( deltax << ( ANGLETOSKYSHIFT - FRACBITS ) );
419
432
420
433
for (int x = pl -> minx ; x <= pl -> maxx ; x ++ )
421
434
{
Original file line number Diff line number Diff line change @@ -176,12 +176,16 @@ void R_UpdateSky(void)
176
176
}
177
177
178
178
skytex_t * background = & sky -> skytex ;
179
+ background -> prevx = background -> currx ;
180
+ background -> prevy = background -> curry ;
179
181
background -> currx += background -> scrollx ;
180
182
background -> curry += background -> scrolly ;
181
183
182
184
if (sky -> type == SkyType_WithForeground )
183
185
{
184
186
skytex_t * foreground = & sky -> foreground ;
187
+ foreground -> prevx = foreground -> currx ;
188
+ foreground -> prevy = foreground -> curry ;
185
189
foreground -> currx += foreground -> scrollx ;
186
190
foreground -> curry += foreground -> scrolly ;
187
191
}
Original file line number Diff line number Diff line change @@ -37,8 +37,10 @@ typedef struct
37
37
double mid ;
38
38
fixed_t scrollx ;
39
39
fixed_t currx ;
40
+ fixed_t prevx ;
40
41
fixed_t scrolly ;
41
42
fixed_t curry ;
43
+ fixed_t prevy ;
42
44
fixed_t scalex ;
43
45
fixed_t scaley ;
44
46
} skytex_t ;
You can’t perform that action at this time.
0 commit comments