DS GX: Hopefully actually fix matrix multiply weirdness

This commit is contained in:
Vicki Pfau 2017-02-28 16:35:10 -08:00
parent c0c7754ed8
commit f2fd53af07
2 changed files with 17 additions and 17 deletions

View File

@ -137,7 +137,7 @@ static void _pullPipe(struct DSGX* gx) {
}
static void _updateClipMatrix(struct DSGX* gx) {
DSGXMtxMultiply(&gx->clipMatrix, &gx->projMatrix, &gx->posMatrix);
DSGXMtxMultiply(&gx->clipMatrix, &gx->posMatrix, &gx->projMatrix);
}
static int32_t _dotViewport(struct DSGXVertex* vertex, int32_t* col) {

View File

@ -35,22 +35,22 @@ void DSGXMtxIdentity(struct DSGXMatrix* mtx) {
void DSGXMtxMultiply(struct DSGXMatrix* out, const struct DSGXMatrix* a, const struct DSGXMatrix* b) {
struct DSGXMatrix o;
// XXX: This is transposed because DS matrices are transposed
o.m[0] = _dot(&a->m[0], &b->m[0]);
o.m[1] = _dot(&a->m[1], &b->m[0]);
o.m[2] = _dot(&a->m[2], &b->m[0]);
o.m[3] = _dot(&a->m[3], &b->m[0]);
o.m[4] = _dot(&a->m[0], &b->m[4]);
o.m[5] = _dot(&a->m[1], &b->m[4]);
o.m[6] = _dot(&a->m[2], &b->m[4]);
o.m[7] = _dot(&a->m[3], &b->m[4]);
o.m[8] = _dot(&a->m[0], &b->m[8]);
o.m[9] = _dot(&a->m[1], &b->m[8]);
o.m[10] = _dot(&a->m[2], &b->m[8]);
o.m[11] = _dot(&a->m[3], &b->m[8]);
o.m[12] = _dot(&a->m[0], &b->m[12]);
o.m[13] = _dot(&a->m[1], &b->m[12]);
o.m[14] = _dot(&a->m[2], &b->m[12]);
o.m[15] = _dot(&a->m[3], &b->m[12]);
o.m[0] = _dot(&b->m[0], &a->m[0]);
o.m[1] = _dot(&b->m[1], &a->m[0]);
o.m[2] = _dot(&b->m[2], &a->m[0]);
o.m[3] = _dot(&b->m[3], &a->m[0]);
o.m[4] = _dot(&b->m[0], &a->m[4]);
o.m[5] = _dot(&b->m[1], &a->m[4]);
o.m[6] = _dot(&b->m[2], &a->m[4]);
o.m[7] = _dot(&b->m[3], &a->m[4]);
o.m[8] = _dot(&b->m[0], &a->m[8]);
o.m[9] = _dot(&b->m[1], &a->m[8]);
o.m[10] = _dot(&b->m[2], &a->m[8]);
o.m[11] = _dot(&b->m[3], &a->m[8]);
o.m[12] = _dot(&b->m[0], &a->m[12]);
o.m[13] = _dot(&b->m[1], &a->m[12]);
o.m[14] = _dot(&b->m[2], &a->m[12]);
o.m[15] = _dot(&b->m[3], &a->m[12]);
*out = o;
}