Browse Source

ref_soft: Fix water

pull/2/head
mittorn 6 years ago
parent
commit
eeda097603
  1. 17
      r_main.c
  2. 2
      r_poly.c

17
r_main.c

@ -1903,6 +1903,22 @@ void R_NewMap (void) @@ -1903,6 +1903,22 @@ void R_NewMap (void)
}
}
/*
================
R_InitTurb
================
*/
void R_InitTurb (void)
{
int i;
for (i=0 ; i<1280 ; i++)
{
sintable[i] = AMP + sin(i*3.14159*2/CYCLE)*AMP;
intsintable[i] = AMP2 + sin(i*3.14159*2/CYCLE)*AMP2; // AMP2, not 20
blanktable[i] = 0; //PGM
}
}
@ -1967,6 +1983,7 @@ qboolean R_Init() @@ -1967,6 +1983,7 @@ qboolean R_Init()
view_clipplanes[1].leftedge = view_clipplanes[2].leftedge =view_clipplanes[3].leftedge = false;
view_clipplanes[0].rightedge = view_clipplanes[2].rightedge = view_clipplanes[3].rightedge = false;
R_StudioInit();
R_InitTurb();
return true;
}

2
r_poly.c

@ -1072,7 +1072,7 @@ void R_BuildPolygonFromSurface(msurface_t *fa) @@ -1072,7 +1072,7 @@ void R_BuildPolygonFromSurface(msurface_t *fa)
}
// todo: water
if ( fa->texinfo->flags & SURF_DRAWTURB )
if ( fa->flags & SURF_DRAWTURB )
{
image_t *pic = R_GetTexture(fa->texinfo->texture->gl_texturenum);
r_polydesc.pixels = pic->pixels[0];

Loading…
Cancel
Save