summaryrefslogtreecommitdiff
path: root/src/boot/libu64/mtxuty-cvt.c
blob: 9b1c457c7125cf261b64ba9ebde560ba4b05e480 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include "libu64/mtxconv.h"

void MtxConv_F2L(Mtx* mtx, MtxF* mf) {
    s32 i;
    s32 j;

    for (i = 0; i < 4; i++) {
        for (j = 0; j < 4; j++) {
            s32 value = (mf->mf[i][j] * 0x10000);
            struct {
                u16 intPart[4][4];
                u16 fracPart[4][4];
            }* mu = (void*)mtx;

            mu->intPart[i][j] = value >> 16;
            mu->fracPart[i][j] = value;
        }
    }
}

void MtxConv_L2F(MtxF* mf, Mtx* mtx) {
    guMtxL2F(mf->mf, mtx);
}