diff --git a/src/hardware/hw_main.cpp b/src/hardware/hw_main.cpp index b1e9e33e9..2d0e01516 100644 --- a/src/hardware/hw_main.cpp +++ b/src/hardware/hw_main.cpp @@ -640,8 +640,8 @@ static void HWR_RenderPlane(subsector_t *subsector, extrasubsector_t *xsub, bool pv = planepoly->pts; // reference point for flat texture coord for each vertex around the polygon - flatxref = (float)(((fixed_t)pv->x & (~flatflag)) / fflatsize); - flatyref = (float)(((fixed_t)pv->y & (~flatflag)) / fflatsize); + flatxref = static_cast(static_cast(pv->x) & (~flatflag)) / fflatsize; + flatyref = static_cast(static_cast(pv->y) & (~flatflag)) / fflatsize; if (!isceiling) // it's a floor { @@ -1381,8 +1381,8 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom // x offset the texture const fixed_t texturehpeg = gl_sidedef->textureoffset + gl_curline->offset; - const float cliplow = (float)texturehpeg; - const float cliphigh = ((float)texturehpeg + (float)gl_curline->length); + const float cliplow = static_cast(texturehpeg); + const float cliphigh = static_cast(texturehpeg) + static_cast(gl_curline->length); FUINT lightnum = gl_frontsector->lightlevel; extracolormap_t *colormap = gl_frontsector->extra_colormap; @@ -1396,8 +1396,8 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom const INT32 gl_midtexture = R_GetTextureNum(gl_sidedef->midtexture); GLMapTexture_t *glTex = NULL; - static constexpr float FLOATMAX = (float)INT32_MAX / (float)FRACUNIT; - static constexpr float FLOATMIN = (float)INT32_MIN / (float)FRACUNIT; + static constexpr float FLOATMAX = static_cast(INT32_MAX) / static_cast(FRACUNIT); + static constexpr float FLOATMIN = static_cast(INT32_MIN) / static_cast(FRACUNIT); // two sided line if (gl_backsector) @@ -1510,8 +1510,8 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom glTex = HWR_GetTexture(gl_toptexture, noencore); - wallVerts[3].t = wallVerts[2].t = texturevpeg * glTex->scaleY; - wallVerts[0].t = wallVerts[1].t = (texturevpeg + gl_frontsector->ceilingheight - gl_backsector->ceilingheight) * glTex->scaleY; + wallVerts[3].t = wallVerts[2].t = static_cast(texturevpeg) * glTex->scaleY; + wallVerts[0].t = wallVerts[1].t = static_cast(texturevpeg + gl_frontsector->ceilingheight - gl_backsector->ceilingheight) * glTex->scaleY; wallVerts[0].s = wallVerts[3].s = cliplow * glTex->scaleX; wallVerts[2].s = wallVerts[1].s = cliphigh * glTex->scaleX; @@ -1519,23 +1519,23 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom if (!(gl_linedef->flags & ML_EFFECT1)) { // Unskewed - wallVerts[3].t -= (worldtop - gl_frontsector->ceilingheight) * glTex->scaleY; - wallVerts[2].t -= (worldtopslope - gl_frontsector->ceilingheight) * glTex->scaleY; - wallVerts[0].t -= (worldhigh - gl_backsector->ceilingheight) * glTex->scaleY; - wallVerts[1].t -= (worldhighslope - gl_backsector->ceilingheight) * glTex->scaleY; + wallVerts[3].t -= static_cast(worldtop - gl_frontsector->ceilingheight) * glTex->scaleY; + wallVerts[2].t -= static_cast(worldtopslope - gl_frontsector->ceilingheight) * glTex->scaleY; + wallVerts[0].t -= static_cast(worldhigh - gl_backsector->ceilingheight) * glTex->scaleY; + wallVerts[1].t -= static_cast(worldhighslope - gl_backsector->ceilingheight) * glTex->scaleY; } else if (gl_linedef->flags & ML_DONTPEGTOP) { // Skewed by top - wallVerts[0].t = (texturevpeg + (worldtop - worldhigh)) * glTex->scaleY; - wallVerts[1].t = (texturevpeg + (worldtopslope - worldhighslope)) * glTex->scaleY; + wallVerts[0].t = static_cast(texturevpeg + (worldtop - worldhigh)) * glTex->scaleY; + wallVerts[1].t = static_cast(texturevpeg + (worldtopslope - worldhighslope)) * glTex->scaleY; } else { // Skewed by bottom - wallVerts[0].t = wallVerts[1].t = (texturevpeg + (worldtop - worldhigh)) * glTex->scaleY; - wallVerts[3].t = wallVerts[0].t - (worldtop - worldhigh) * glTex->scaleY; - wallVerts[2].t = wallVerts[1].t - (worldtopslope - worldhighslope) * glTex->scaleY; + wallVerts[0].t = wallVerts[1].t = static_cast(texturevpeg + (worldtop - worldhigh)) * glTex->scaleY; + wallVerts[3].t = wallVerts[0].t - static_cast(worldtop - worldhigh) * glTex->scaleY; + wallVerts[2].t = wallVerts[1].t - static_cast(worldtopslope - worldhighslope) * glTex->scaleY; } // set top/bottom coords @@ -1572,8 +1572,8 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom glTex = HWR_GetTexture(gl_bottomtexture, noencore); - wallVerts[3].t = wallVerts[2].t = texturevpeg * glTex->scaleY; - wallVerts[0].t = wallVerts[1].t = (texturevpeg + (gl_backsector->floorheight - gl_frontsector->floorheight)) * glTex->scaleY; + wallVerts[3].t = wallVerts[2].t = static_cast(texturevpeg * glTex->scaleY); + wallVerts[0].t = wallVerts[1].t = static_cast(texturevpeg + (gl_backsector->floorheight - gl_frontsector->floorheight)) * glTex->scaleY; wallVerts[0].s = wallVerts[3].s = cliplow * glTex->scaleX; wallVerts[2].s = wallVerts[1].s = cliphigh * glTex->scaleX; @@ -1581,22 +1581,22 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom if (!(gl_linedef->flags & ML_EFFECT1)) { // Unskewed - wallVerts[0].t -= (worldbottom - gl_frontsector->floorheight) * glTex->scaleY; - wallVerts[1].t -= (worldbottomslope - gl_frontsector->floorheight) * glTex->scaleY; - wallVerts[3].t -= (worldlow - gl_backsector->floorheight) * glTex->scaleY; - wallVerts[2].t -= (worldlowslope - gl_backsector->floorheight) * glTex->scaleY; + wallVerts[0].t -= static_cast(worldbottom - gl_frontsector->floorheight) * glTex->scaleY; + wallVerts[1].t -= static_cast(worldbottomslope - gl_frontsector->floorheight) * glTex->scaleY; + wallVerts[3].t -= static_cast(worldlow - gl_backsector->floorheight) * glTex->scaleY; + wallVerts[2].t -= static_cast(worldlowslope - gl_backsector->floorheight) * glTex->scaleY; } else if (gl_linedef->flags & ML_DONTPEGBOTTOM) { // Skewed by bottom - wallVerts[0].t = wallVerts[1].t = (texturevpeg + (worldlow - worldbottom)) * glTex->scaleY; - wallVerts[2].t = wallVerts[1].t - (worldlowslope - worldbottomslope) * glTex->scaleY; + wallVerts[0].t = wallVerts[1].t = static_cast(texturevpeg + (worldlow - worldbottom)) * glTex->scaleY; + wallVerts[2].t = wallVerts[1].t - static_cast(worldlowslope - worldbottomslope) * glTex->scaleY; } else { // Skewed by top - wallVerts[0].t = (texturevpeg + (worldlow - worldbottom)) * glTex->scaleY; - wallVerts[1].t = (texturevpeg + (worldlowslope - worldbottomslope)) * glTex->scaleY; + wallVerts[0].t = static_cast(texturevpeg + (worldlow - worldbottom)) * glTex->scaleY; + wallVerts[1].t = static_cast(texturevpeg + (worldlowslope - worldbottomslope)) * glTex->scaleY; } // set top/bottom coords @@ -1758,13 +1758,13 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom glTex = HWR_GetTexture(gl_midtexture, noencore); // Left side - wallVerts[3].t = texturevpeg * glTex->scaleY; - wallVerts[0].t = (h - l + texturevpeg) * glTex->scaleY; + wallVerts[3].t = static_cast(texturevpeg * glTex->scaleY); + wallVerts[0].t = static_cast(h - l + texturevpeg) * glTex->scaleY; wallVerts[0].s = wallVerts[3].s = cliplow * glTex->scaleX; // Right side wallVerts[2].t = texturevpegslope * glTex->scaleY; - wallVerts[1].t = (hS - lS + texturevpegslope) * glTex->scaleY; + wallVerts[1].t = static_cast(hS - lS + texturevpegslope) * glTex->scaleY; wallVerts[2].s = wallVerts[1].s = cliphigh * glTex->scaleX; // set top/bottom coords @@ -1807,28 +1807,28 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom else texturevpeg = gl_sidedef->rowoffset; // top of texture at top - wallVerts[3].t = wallVerts[2].t = texturevpeg * glTex->scaleY; - wallVerts[0].t = wallVerts[1].t = (texturevpeg + gl_frontsector->ceilingheight - gl_frontsector->floorheight) * glTex->scaleY; + wallVerts[3].t = wallVerts[2].t = (static_cast(texturevpeg) * glTex->scaleY); + wallVerts[0].t = wallVerts[1].t = static_cast(texturevpeg + gl_frontsector->ceilingheight - gl_frontsector->floorheight) * glTex->scaleY; wallVerts[0].s = wallVerts[3].s = cliplow * glTex->scaleX; wallVerts[2].s = wallVerts[1].s = cliphigh* glTex->scaleX; // Texture correction for slopes if (gl_linedef->flags & ML_EFFECT2) { - wallVerts[3].t += (gl_frontsector->ceilingheight - worldtop) * glTex->scaleY; - wallVerts[2].t += (gl_frontsector->ceilingheight - worldtopslope) * glTex->scaleY; - wallVerts[0].t += (gl_frontsector->floorheight - worldbottom) * glTex->scaleY; - wallVerts[1].t += (gl_frontsector->floorheight - worldbottomslope) * glTex->scaleY; + wallVerts[3].t += static_cast(gl_frontsector->ceilingheight - worldtop) * glTex->scaleY; + wallVerts[2].t += static_cast(gl_frontsector->ceilingheight - worldtopslope) * glTex->scaleY; + wallVerts[0].t += static_cast(gl_frontsector->floorheight - worldbottom) * glTex->scaleY; + wallVerts[1].t += static_cast(gl_frontsector->floorheight - worldbottomslope) * glTex->scaleY; } else if (gl_linedef->flags & ML_DONTPEGBOTTOM) { - wallVerts[3].t = wallVerts[0].t + (worldbottom - worldtop) * glTex->scaleY; - wallVerts[2].t = wallVerts[1].t + ((worldbottomslope - worldtopslope)) * glTex->scaleY; + wallVerts[3].t = wallVerts[0].t + static_cast(worldbottom - worldtop) * glTex->scaleY; + wallVerts[2].t = wallVerts[1].t + static_cast((worldbottomslope - worldtopslope)) * glTex->scaleY; } else { - wallVerts[0].t = wallVerts[3].t - (worldbottom - worldtop) * glTex->scaleY; - wallVerts[1].t = wallVerts[2].t - (worldbottomslope - worldtopslope) * glTex->scaleY; + wallVerts[0].t = wallVerts[3].t - static_cast(worldbottom - worldtop) * glTex->scaleY; + wallVerts[1].t = wallVerts[2].t - static_cast(worldbottomslope - worldtopslope) * glTex->scaleY; } //Set textures properly on single sided walls that are sloped @@ -1993,24 +1993,24 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom if (dont_peg_bottom) texturevpeg -= (*rover->topheight - *rover->bottomheight); - wallVerts[3].t = ((*rover->topheight - h) + texturevpeg) * glTex->scaleY; - wallVerts[2].t = ((*rover->topheight - hS) + texturevpeg) * glTex->scaleY; - wallVerts[0].t = ((*rover->topheight - l) + texturevpeg) * glTex->scaleY; - wallVerts[1].t = ((*rover->topheight - lS) + texturevpeg) * glTex->scaleY; + wallVerts[3].t = static_cast((*rover->topheight - h) + texturevpeg) * glTex->scaleY; + wallVerts[2].t = static_cast((*rover->topheight - hS) + texturevpeg) * glTex->scaleY; + wallVerts[0].t = static_cast((*rover->topheight - l) + texturevpeg) * glTex->scaleY; + wallVerts[1].t = static_cast((*rover->topheight - lS) + texturevpeg) * glTex->scaleY; } else { if (!dont_peg_bottom) // skew by top { - wallVerts[3].t = wallVerts[2].t = texturevpeg * glTex->scaleY; - wallVerts[0].t = ((h - l) + texturevpeg) * glTex->scaleY; - wallVerts[1].t = ((hS - lS) + texturevpeg) * glTex->scaleY; + wallVerts[3].t = wallVerts[2].t = (static_cast(texturevpeg) * glTex->scaleY); + wallVerts[0].t = static_cast((h - l) + texturevpeg) * glTex->scaleY; + wallVerts[1].t = static_cast((hS - lS) + texturevpeg) * glTex->scaleY; } else // skew by bottom { - wallVerts[0].t = wallVerts[1].t = texturevpeg * glTex->scaleY; - wallVerts[3].t = wallVerts[0].t - (h - l) * glTex->scaleY; - wallVerts[2].t = wallVerts[1].t - (hS - lS) * glTex->scaleY; + wallVerts[0].t = wallVerts[1].t = (static_cast(texturevpeg) * glTex->scaleY); + wallVerts[3].t = wallVerts[0].t - static_cast(h - l) * glTex->scaleY; + wallVerts[2].t = wallVerts[1].t - static_cast(hS - lS) * glTex->scaleY; } } @@ -2153,24 +2153,24 @@ void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom if (dont_peg_bottom) texturevpeg -= (*rover->topheight - *rover->bottomheight); - wallVerts[3].t = ((*rover->topheight - h) + texturevpeg) * glTex->scaleY; - wallVerts[2].t = ((*rover->topheight - hS) + texturevpeg) * glTex->scaleY; - wallVerts[0].t = ((*rover->topheight - l) + texturevpeg) * glTex->scaleY; - wallVerts[1].t = ((*rover->topheight - lS) + texturevpeg) * glTex->scaleY; + wallVerts[3].t = static_cast((*rover->topheight - h) + texturevpeg) * glTex->scaleY; + wallVerts[2].t = static_cast((*rover->topheight - hS) + texturevpeg) * glTex->scaleY; + wallVerts[0].t = static_cast((*rover->topheight - l) + texturevpeg) * glTex->scaleY; + wallVerts[1].t = static_cast((*rover->topheight - lS) + texturevpeg) * glTex->scaleY; } else { if (!dont_peg_bottom) // skew by top { - wallVerts[3].t = wallVerts[2].t = texturevpeg * glTex->scaleY; - wallVerts[0].t = ((h - l) + texturevpeg) * glTex->scaleY; - wallVerts[1].t = ((hS - lS) + texturevpeg) * glTex->scaleY; + wallVerts[3].t = wallVerts[2].t = (static_cast(texturevpeg) * glTex->scaleY); + wallVerts[0].t = static_cast((h - l) + texturevpeg) * glTex->scaleY; + wallVerts[1].t = static_cast((hS - lS) + texturevpeg) * glTex->scaleY; } else // skew by bottom { - wallVerts[0].t = wallVerts[1].t = texturevpeg * glTex->scaleY; - wallVerts[3].t = wallVerts[0].t - (h - l) * glTex->scaleY; - wallVerts[2].t = wallVerts[1].t - (hS - lS) * glTex->scaleY; + wallVerts[0].t = wallVerts[1].t = (static_cast(texturevpeg) * glTex->scaleY); + wallVerts[3].t = wallVerts[0].t - static_cast(h - l) * glTex->scaleY; + wallVerts[2].t = wallVerts[1].t - static_cast(hS - lS) * glTex->scaleY; } } @@ -2704,8 +2704,8 @@ static void HWR_RenderPolyObjectPlane(polyobj_t *polysector, boolean isceiling, flatxref = FixedToFloat(polysector->origVerts[0].x); flatyref = FixedToFloat(polysector->origVerts[0].y); - flatxref = (float)(((fixed_t)flatxref & (~flatflag)) / fflatsize); - flatyref = (float)(((fixed_t)flatyref & (~flatflag)) / fflatsize); + flatxref = static_cast(static_cast(flatxref) & (~flatflag)) / fflatsize; + flatyref = static_cast(static_cast(flatyref) & (~flatflag)) / fflatsize; if (!isceiling) // it's a floor { @@ -3454,13 +3454,13 @@ static void HWR_DrawSpriteShadow(gl_vissprite_t *spr, patch_t *gpatch, GLPatch_t if (spr->mobj && fabsf(this_scale - 1.0f) > 1.0E-36f) { // Always a pixel above the floor, perfectly flat. - swallVerts[0].y = swallVerts[1].y = swallVerts[2].y = swallVerts[3].y = spr->gzt - gpatch->topoffset * this_scale - (floorheight+3); + swallVerts[0].y = swallVerts[1].y = swallVerts[2].y = swallVerts[3].y = spr->gzt - static_cast(gpatch->topoffset) * this_scale - static_cast(floorheight+3); // Now transform the TOP vertices along the floor in the direction of the camera - swallVerts[3].x = spr->x1 + ((gpatch->height * this_scale) + offset) * gl_viewcos; - swallVerts[2].x = spr->x2 + ((gpatch->height * this_scale) + offset) * gl_viewcos; - swallVerts[3].z = spr->z1 + ((gpatch->height * this_scale) + offset) * gl_viewsin; - swallVerts[2].z = spr->z2 + ((gpatch->height * this_scale) + offset) * gl_viewsin; + swallVerts[3].x = spr->x1 + ((static_cast(gpatch->height) * this_scale) + offset) * gl_viewcos; + swallVerts[2].x = spr->x2 + ((static_cast(gpatch->height) * this_scale) + offset) * gl_viewcos; + swallVerts[3].z = spr->z1 + ((static_cast(gpatch->height) * this_scale) + offset) * gl_viewsin; + swallVerts[2].z = spr->z2 + ((static_cast(gpatch->height) * this_scale) + offset) * gl_viewsin; } else { @@ -3468,10 +3468,10 @@ static void HWR_DrawSpriteShadow(gl_vissprite_t *spr, patch_t *gpatch, GLPatch_t swallVerts[0].y = swallVerts[1].y = swallVerts[2].y = swallVerts[3].y = spr->gzt - gpatch->topoffset - (floorheight+3); // Now transform the TOP vertices along the floor in the direction of the camera - swallVerts[3].x = spr->x1 + (gpatch->height + offset) * gl_viewcos; - swallVerts[2].x = spr->x2 + (gpatch->height + offset) * gl_viewcos; - swallVerts[3].z = spr->z1 + (gpatch->height + offset) * gl_viewsin; - swallVerts[2].z = spr->z2 + (gpatch->height + offset) * gl_viewsin; + swallVerts[3].x = spr->x1 + (static_cast(gpatch->height) + offset) * gl_viewcos; + swallVerts[2].x = spr->x2 + (static_cast(gpatch->height) + offset) * gl_viewcos; + swallVerts[3].z = spr->z1 + (static_cast(gpatch->height) + offset) * gl_viewsin; + swallVerts[2].z = spr->z2 + (static_cast(gpatch->height) + offset) * gl_viewsin; } // We also need to move the bottom ones away when shadowoffs is on @@ -5157,6 +5157,8 @@ static void HWR_ProjectPrecipitationSprite(precipmobj_t *thing) z2 = tr_y - x2 * rightsin; x1 = tr_x + x1 * rightcos; x2 = tr_x - x2 * rightcos; + //y1 = tr_y + y1 * rightcos; + //y2 = tr_y - y2 * rightcos; // // store information in a vissprite @@ -5335,7 +5337,7 @@ void HWR_BuildSkyDome(void) } // precompute to save a bit of division -static constexpr float FINEDEGREE = (360.0f/(float)FINEANGLES); +static constexpr float FINEDEGREE = (360.0f/static_cast(FINEANGLES)); static void HWR_DrawSkyBackground(void) { @@ -5353,7 +5355,7 @@ static void HWR_DrawSkyBackground(void) //04/01/2000: Hurdler: added for T&L // It should replace all other gl_viewxxx when finished HWR_SetTransformAiming(&dometransform); - dometransform.angley = (float)((viewangle-ANGLE_270)>>ANGLETOFINESHIFT)*(FINEDEGREE); + dometransform.angley = static_cast((viewangle-ANGLE_270) >> ANGLETOFINESHIFT)*(FINEDEGREE); HWR_GetTexture(texturetranslation[skytexture], false); @@ -5398,7 +5400,7 @@ static void HWR_SetTransformAiming(FTransform *trans) if (cv_glshearing.value) { fixed_t fixedaiming = AIMINGTODY(aimingangle); - trans->viewaiming = FixedToFloat(fixedaiming) * ((float)vid.width / vid.height) / ((float)BASEVIDWIDTH / BASEVIDHEIGHT); + trans->viewaiming = FixedToFloat(fixedaiming) * (static_cast(vid.width) / static_cast(vid.height)) / (static_cast(BASEVIDWIDTH) / static_cast(BASEVIDHEIGHT)); if (splitscreen == 1) // only for 2 player splitscreen trans->viewaiming *= 2.125; // splitscreen adjusts fov with 0.8, so compensate (but only halfway, since splitscreen means only half the screen is used) trans->shearing = true; @@ -5410,7 +5412,7 @@ static void HWR_SetTransformAiming(FTransform *trans) gl_aimingangle = aimingangle; } - trans->anglex = (float)(gl_aimingangle>>ANGLETOFINESHIFT)*(FINEDEGREE); + trans->anglex = static_cast(gl_aimingangle >> ANGLETOFINESHIFT)*(FINEDEGREE); } void HWR_SetTransform(float fpov) @@ -5429,11 +5431,11 @@ void HWR_SetTransform(float fpov) atransform.z = gl_viewz; atransform.scalex = 1; - atransform.scaley = (float)vid.width/vid.height; + atransform.scaley = static_cast(vid.width) / static_cast(vid.height); atransform.scalez = 1; HWR_SetTransformAiming(&atransform); - atransform.angley = (float)(viewangle>>ANGLETOFINESHIFT)*(FINEDEGREE); + atransform.angley = static_cast(viewangle >> ANGLETOFINESHIFT)*(FINEDEGREE); yaw = 270.0f - atransform.angley; inv_yaw = 180.0f - yaw; @@ -5444,8 +5446,8 @@ void HWR_SetTransform(float fpov) // only needed for sprite billboarding if (cv_glspritebillboarding.value && !cv_glshearing.value) { - gl_viewludsin = FixedToFloat(FINECOSINE(gl_aimingangle>>ANGLETOFINESHIFT)); - gl_viewludcos = FixedToFloat(-FINESINE(gl_aimingangle>>ANGLETOFINESHIFT)); + gl_viewludsin = FixedToFloat(FINECOSINE(gl_aimingangle >> ANGLETOFINESHIFT)); + gl_viewludcos = FixedToFloat(-FINESINE(gl_aimingangle >> ANGLETOFINESHIFT)); } atransform.fovangle = fpov; // Tails @@ -5702,7 +5704,7 @@ static void HWR_RollTransform(FTransform *tr, angle_t roll) { if (roll != 0) { - tr->rollangle = roll / (float)ANG1; + tr->rollangle = static_cast(roll) / static_cast(ANG1); tr->roll = true; tr->rollx = 1.0f; tr->rollz = 0.0f; @@ -6102,7 +6104,7 @@ static void HWR_DoPostProcessor(void) for (y = 0; y < SCREENVERTS; y++) { // Change X position based on its Y position. - v[x][y][0] = x-4.5f + sinf(((disStart+((float)y * WAVELENGTH)) / FREQUENCY)) / AMPLITUDE; // (x / scale) + v[x][y][0] = x-4.5f + sinf(((disStart+(static_cast(y) * WAVELENGTH)) / FREQUENCY)) / AMPLITUDE; // (x / scale) v[x][y][1] = y-4.5f; // (y / scale) } }