mirror of
https://github.com/fabiangreffrath/woof.git
synced 2025-09-23 03:52:12 -04:00
fix non-power-of-two wide sky textures (#1323)
This commit is contained in:
parent
915db28d5e
commit
932fcaabc8
17
src/r_data.c
17
src/r_data.c
@ -504,6 +504,23 @@ byte *R_GetColumnMod(int tex, int col)
|
||||
return texturecomposite[tex] + ofs;
|
||||
}
|
||||
|
||||
// [FG] wrapping column getter function for non-power-of-two wide sky textures
|
||||
byte *R_GetColumnMod2(int tex, int col)
|
||||
{
|
||||
int ofs;
|
||||
|
||||
while (col < 0)
|
||||
col += texturewidth[tex];
|
||||
|
||||
col %= texturewidth[tex];
|
||||
ofs = texturecolumnofs2[tex][col];
|
||||
|
||||
if (!texturecomposite2[tex])
|
||||
R_GenerateComposite(tex);
|
||||
|
||||
return texturecomposite2[tex] + ofs;
|
||||
}
|
||||
|
||||
//
|
||||
// R_InitTextures
|
||||
// Initializes the texture list
|
||||
|
@ -31,6 +31,7 @@
|
||||
// Retrieve column data for span blitting.
|
||||
byte *R_GetColumn(int tex, int col);
|
||||
byte *R_GetColumnMod(int tex, int col);
|
||||
byte *R_GetColumnMod2(int tex, int col);
|
||||
|
||||
// I/O, setting up the stuff.
|
||||
void R_InitData (void);
|
||||
|
@ -423,7 +423,7 @@ static void do_draw_plane(visplane_t *pl)
|
||||
for (x = pl->minx; (dc_x = x) <= pl->maxx; x++)
|
||||
if ((dc_yl = pl->top[x]) != USHRT_MAX && dc_yl <= (dc_yh = pl->bottom[x]))
|
||||
{
|
||||
dc_source = R_GetColumnMod(texture, ((an + xtoskyangle[x])^flip) >>
|
||||
dc_source = R_GetColumnMod2(texture, ((an + xtoskyangle[x])^flip) >>
|
||||
ANGLETOSKYSHIFT);
|
||||
colfunc();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user