use std::swap 🔃

This commit is contained in:
RSDuck
2021-08-21 01:54:09 +02:00
parent c23e158312
commit 883fceb6ce
2 changed files with 40 additions and 43 deletions

View File

@ -18,6 +18,7 @@
#include "GPU3D_Soft.h"
#include <algorithm>
#include <stdio.h>
#include <string.h>
#include "NDS.h"
@ -756,11 +757,10 @@ void SoftRenderer::RenderShadowMaskScanline(RendererPolygon* rp, s32 y)
rp->SlopeR.EdgeParams_YMajor(&l_edgelen, &l_edgecov);
rp->SlopeL.EdgeParams_YMajor(&r_edgelen, &r_edgecov);
s32 tmp;
tmp = xstart; xstart = xend; xend = tmp;
tmp = wl; wl = wr; wr = tmp;
tmp = zl; zl = zr; zr = tmp;
tmp = (s32)l_filledge; l_filledge = r_filledge; r_filledge = (bool)tmp;
std::swap(xstart, xend);
std::swap(wl, wr);
std::swap(zl, zr);
std::swap(l_filledge, r_filledge);
}
else
{
@ -977,11 +977,10 @@ void SoftRenderer::RenderPolygonScanline(RendererPolygon* rp, s32 y)
rp->SlopeR.EdgeParams_YMajor(&l_edgelen, &l_edgecov);
rp->SlopeL.EdgeParams_YMajor(&r_edgelen, &r_edgecov);
s32 tmp;
tmp = xstart; xstart = xend; xend = tmp;
tmp = wl; wl = wr; wr = tmp;
tmp = zl; zl = zr; zr = tmp;
tmp = (s32)l_filledge; l_filledge = r_filledge; r_filledge = (bool)tmp;
std::swap(xstart, xend);
std::swap(wl, wr);
std::swap(zl, zr);
std::swap(l_filledge, r_filledge);
}
else
{