all repos — mgba @ 2134a701c85f1a3a2fc845d65bc4158c3460db37

mGBA Game Boy Advance Emulator

DS GX: Fix normal texture mapping
Vicki Pfau vi@endrift.com
Sat, 08 Apr 2017 12:15:19 -0700
commit

2134a701c85f1a3a2fc845d65bc4158c3460db37

parent

6f04c89c5fdb86d99a4ffdd90b2d8eda5b7c9fc9

1 files changed, 2 insertions(+), 2 deletions(-)

jump to
M src/ds/gx.csrc/ds/gx.c

@@ -979,8 +979,8 @@ x >>= 3;

y >>= 3; z >>= 3; if (DSGXTexParamsGetCoordTfMode(gx->currentPoly.texParams) == 2) { - gx->currentVertex.vs = _dotFrac(x, y, z, &gx->texMatrix.m[0]) + gx->currentVertex.s; - gx->currentVertex.vt = _dotFrac(x, y, z, &gx->texMatrix.m[1]) + gx->currentVertex.t; + gx->currentVertex.vs = (_dotFrac(x, y, z, &gx->texMatrix.m[0]) + gx->currentVertex.s) >> 11; + gx->currentVertex.vt = (_dotFrac(x, y, z, &gx->texMatrix.m[1]) + gx->currentVertex.t) >> 11; } int16_t nx = _dotFrac(x, y, z, &gx->vecMatrix.m[0]); int16_t ny = _dotFrac(x, y, z, &gx->vecMatrix.m[1]);