diff options
| author | magumagu <magumagu9@gmail.com> | 2014-04-27 11:59:04 -0700 |
|---|---|---|
| committer | magumagu <magumagu9@gmail.com> | 2014-05-16 18:58:07 -0700 |
| commit | 1357277f40166683a3ac4eb9979010c3038d2db8 (patch) | |
| tree | 69895a9271115234210712d37ea5376dd196482f /Source/Core/VideoBackends/Software/TransformUnit.cpp | |
| parent | 8f5342c442c8e78784b4ea7002250781ba768767 (diff) | |
Video backends: mass-replace "xfregs" with "xfmem".
Diffstat (limited to 'Source/Core/VideoBackends/Software/TransformUnit.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/Software/TransformUnit.cpp | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/Source/Core/VideoBackends/Software/TransformUnit.cpp b/Source/Core/VideoBackends/Software/TransformUnit.cpp index 7090245a06..8e5bfe8a69 100644 --- a/Source/Core/VideoBackends/Software/TransformUnit.cpp +++ b/Source/Core/VideoBackends/Software/TransformUnit.cpp @@ -70,22 +70,22 @@ void MultipleVec3Ortho(const Vec3 &vec, const float *proj, Vec4 &result) void TransformPosition(const InputVertexData *src, OutputVertexData *dst) { - const float* mat = (const float*)&xfregs.posMatrices[src->posMtx * 4]; + const float* mat = (const float*)&xfmem.posMatrices[src->posMtx * 4]; MultiplyVec3Mat34(src->position, mat, dst->mvPosition); - if (xfregs.projection.type == GX_PERSPECTIVE) + if (xfmem.projection.type == GX_PERSPECTIVE) { - MultipleVec3Perspective(dst->mvPosition, xfregs.projection.rawProjection, dst->projectedPosition); + MultipleVec3Perspective(dst->mvPosition, xfmem.projection.rawProjection, dst->projectedPosition); } else { - MultipleVec3Ortho(dst->mvPosition, xfregs.projection.rawProjection, dst->projectedPosition); + MultipleVec3Ortho(dst->mvPosition, xfmem.projection.rawProjection, dst->projectedPosition); } } void TransformNormal(const InputVertexData *src, bool nbt, OutputVertexData *dst) { - const float* mat = (const float*)&xfregs.normalMatrices[(src->posMtx & 31) * 3]; + const float* mat = (const float*)&xfmem.normalMatrices[(src->posMtx & 31) * 3]; if (nbt) { @@ -124,7 +124,7 @@ void TransformTexCoordRegular(const TexMtxInfo &texinfo, int coordNum, bool spec break; } - const float *mat = (const float*)&xfregs.posMatrices[srcVertex->texMtx[coordNum] * 4]; + const float *mat = (const float*)&xfmem.posMatrices[srcVertex->texMtx[coordNum] * 4]; Vec3 *dst = &dstVertex->texCoords[coordNum]; if (texinfo.projection == XF_TEXPROJ_ST) @@ -144,13 +144,13 @@ void TransformTexCoordRegular(const TexMtxInfo &texinfo, int coordNum, bool spec MultiplyVec3Mat34(*src, mat, *dst); } - if (xfregs.dualTexTrans.enabled) + if (xfmem.dualTexTrans.enabled) { Vec3 tempCoord; // normalize - const PostMtxInfo &postInfo = xfregs.postMtxInfo[coordNum]; - const float *postMat = (const float*)&xfregs.postMatrices[postInfo.index * 4]; + const PostMtxInfo &postInfo = xfmem.postMtxInfo[coordNum]; + const float *postMat = (const float*)&xfmem.postMatrices[postInfo.index * 4]; if (specialCase) { @@ -212,7 +212,7 @@ inline float SafeDivide(float n, float d) void LightColor(const Vec3 &pos, const Vec3 &normal, u8 lightNum, const LitChannel &chan, Vec3 &lightCol) { - const LightPointer *light = (const LightPointer*)&xfregs.lights[0x10*lightNum]; + const LightPointer *light = (const LightPointer*)&xfmem.lights[0x10*lightNum]; if (!(chan.attnfunc & 1)) { @@ -297,7 +297,7 @@ void LightColor(const Vec3 &pos, const Vec3 &normal, u8 lightNum, const LitChann void LightAlpha(const Vec3 &pos, const Vec3 &normal, u8 lightNum, const LitChannel &chan, float &lightCol) { - const LightPointer *light = (const LightPointer*)&xfregs.lights[0x10*lightNum]; + const LightPointer *light = (const LightPointer*)&xfmem.lights[0x10*lightNum]; if (!(chan.attnfunc & 1)) { @@ -376,18 +376,18 @@ void LightAlpha(const Vec3 &pos, const Vec3 &normal, u8 lightNum, const LitChann void TransformColor(const InputVertexData *src, OutputVertexData *dst) { - for (u32 chan = 0; chan < xfregs.numChan.numColorChans; chan++) + for (u32 chan = 0; chan < xfmem.numChan.numColorChans; chan++) { // abgr u8 matcolor[4]; u8 chancolor[4]; // color - LitChannel &colorchan = xfregs.color[chan]; + LitChannel &colorchan = xfmem.color[chan]; if (colorchan.matsource) *(u32*)matcolor = *(u32*)src->color[chan]; // vertex else - *(u32*)matcolor = xfregs.matColor[chan]; + *(u32*)matcolor = xfmem.matColor[chan]; if (colorchan.enablelighting) { @@ -401,7 +401,7 @@ void TransformColor(const InputVertexData *src, OutputVertexData *dst) } else { - u8 *ambColor = (u8*)&xfregs.ambColor[chan]; + u8 *ambColor = (u8*)&xfmem.ambColor[chan]; lightCol.x = ambColor[1]; lightCol.y = ambColor[2]; lightCol.z = ambColor[3]; @@ -425,19 +425,19 @@ void TransformColor(const InputVertexData *src, OutputVertexData *dst) } // alpha - LitChannel &alphachan = xfregs.alpha[chan]; + LitChannel &alphachan = xfmem.alpha[chan]; if (alphachan.matsource) matcolor[0] = src->color[chan][0]; // vertex else - matcolor[0] = xfregs.matColor[chan] & 0xff; + matcolor[0] = xfmem.matColor[chan] & 0xff; - if (xfregs.alpha[chan].enablelighting) + if (xfmem.alpha[chan].enablelighting) { float lightCol; if (alphachan.ambsource) lightCol = src->color[chan][0]; // vertex else - lightCol = (float)(xfregs.ambColor[chan] & 0xff); + lightCol = (float)(xfmem.ambColor[chan] & 0xff); u8 mask = alphachan.GetFullLightMask(); for (int i = 0; i < 8; ++i) @@ -460,9 +460,9 @@ void TransformColor(const InputVertexData *src, OutputVertexData *dst) void TransformTexCoord(const InputVertexData *src, OutputVertexData *dst, bool specialCase) { - for (u32 coordNum = 0; coordNum < xfregs.numTexGen.numTexGens; coordNum++) + for (u32 coordNum = 0; coordNum < xfmem.numTexGen.numTexGens; coordNum++) { - const TexMtxInfo &texinfo = xfregs.texMtxInfo[coordNum]; + const TexMtxInfo &texinfo = xfmem.texMtxInfo[coordNum]; switch (texinfo.texgentype) { @@ -471,7 +471,7 @@ void TransformTexCoord(const InputVertexData *src, OutputVertexData *dst, bool s break; case XF_TEXGEN_EMBOSS_MAP: { - const LightPointer *light = (const LightPointer*)&xfregs.lights[0x10*texinfo.embosslightshift]; + const LightPointer *light = (const LightPointer*)&xfmem.lights[0x10*texinfo.embosslightshift]; Vec3 ldir = (light->pos - dst->mvPosition).normalized(); float d1 = ldir * dst->normal[1]; @@ -501,7 +501,7 @@ void TransformTexCoord(const InputVertexData *src, OutputVertexData *dst, bool s } } - for (u32 coordNum = 0; coordNum < xfregs.numTexGen.numTexGens; coordNum++) + for (u32 coordNum = 0; coordNum < xfmem.numTexGen.numTexGens; coordNum++) { dst->texCoords[coordNum][0] *= (bpmem.texcoords[coordNum].s.scale_minus_1 + 1); dst->texCoords[coordNum][1] *= (bpmem.texcoords[coordNum].t.scale_minus_1 + 1); |
