1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-06 16:04:35 +00:00

use clang, modify z64animation.h and z64dma.h to use open braces on newline

This commit is contained in:
KrimtonZ 2020-03-24 12:16:13 -05:00
parent 2b0b6a6c12
commit db3cfe1b61
11 changed files with 493 additions and 841 deletions

View file

@ -22,52 +22,41 @@ MtxF gMtxFClear =
MtxF* sMatrixStack; // "Matrix_stack"
MtxF* sCurrentMatrix; // "Matrix_now"
void Matrix_Init(GameState* gameState)
{
void Matrix_Init(GameState* gameState) {
sCurrentMatrix = Game_Alloc(gameState, 20 * sizeof(MtxF), "../sys_matrix.c", 153);
sMatrixStack = sCurrentMatrix;
}
void Matrix_Push(void)
{
void Matrix_Push(void) {
Matrix_MtxFCopy(sCurrentMatrix + 1, sCurrentMatrix);
sCurrentMatrix++;
}
void Matrix_Pull(void)
{
void Matrix_Pull(void) {
sCurrentMatrix--;
if (sCurrentMatrix < sMatrixStack)
{
if (sCurrentMatrix < sMatrixStack) {
__assert("Matrix_now >= Matrix_stack", "../sys_matrix.c", 176);
}
}
void Matrix_Get(MtxF* dest)
{
void Matrix_Get(MtxF* dest) {
Matrix_MtxFCopy(dest, sCurrentMatrix);
}
void Matrix_Put(MtxF* src)
{
void Matrix_Put(MtxF* src) {
Matrix_MtxFCopy(sCurrentMatrix, src);
}
MtxF* Matrix_GetCurrent(void)
{
MtxF* Matrix_GetCurrent(void) {
return sCurrentMatrix;
}
void Matrix_Mult(MtxF* mf, u8 mode)
{
void Matrix_Mult(MtxF* mf, u8 mode) {
MtxF* cmf = Matrix_GetCurrent();
if (mode == MTXMODE_APPLY)
{
if (mode == MTXMODE_APPLY) {
func_800A6FA0(cmf, mf, cmf);
}
else
{
} else {
Matrix_MtxFCopy(sCurrentMatrix, mf);
}
}
@ -77,8 +66,7 @@ void Matrix_Translate(f32 x, f32 y, f32 z, u8 mode) {
f32 tx;
f32 ty;
if (mode == MTXMODE_APPLY)
{
if (mode == MTXMODE_APPLY) {
tx = cmf->xx;
ty = cmf->yx;
cmf->wx += tx * x + ty * y + cmf->zx * z;
@ -91,19 +79,15 @@ void Matrix_Translate(f32 x, f32 y, f32 z, u8 mode) {
tx = cmf->xw;
ty = cmf->yw;
cmf->ww += tx * x + ty * y + cmf->zw * z;
}
else
{
} else {
func_800A7A24(cmf, x, y, z);
}
}
void Matrix_Scale(f32 x, f32 y, f32 z, u8 mode)
{
void Matrix_Scale(f32 x, f32 y, f32 z, u8 mode) {
MtxF* cmf = sCurrentMatrix;
if (mode == MTXMODE_APPLY)
{
if (mode == MTXMODE_APPLY) {
cmf->xx *= x;
cmf->xy *= x;
cmf->xz *= x;
@ -116,25 +100,20 @@ void Matrix_Scale(f32 x, f32 y, f32 z, u8 mode)
cmf->xw *= x;
cmf->yw *= y;
cmf->zw *= z;
}
else
{
} else {
func_800A76A4(cmf, x, y, z);
}
}
void Matrix_RotateX(f32 x, u8 mode)
{
void Matrix_RotateX(f32 x, u8 mode) {
MtxF* cmf;
f32 sin;
f32 cos;
f32 temp1;
f32 temp2;
if (mode == MTXMODE_APPLY)
{
if (x != 0)
{
if (mode == MTXMODE_APPLY) {
if (x != 0) {
cmf = sCurrentMatrix;
sin = sinf(x);
@ -160,18 +139,13 @@ void Matrix_RotateX(f32 x, u8 mode)
cmf->yw = temp1 * cos + temp2 * sin;
cmf->zw = temp2 * cos - temp1 * sin;
}
}
else
{
} else {
cmf = sCurrentMatrix;
if (x != 0)
{
if (x != 0) {
sin = sinf(x);
cos = cosf(x);
}
else
{
} else {
sin = 0.0f;
cos = 1.0f;
}
@ -195,18 +169,15 @@ void Matrix_RotateX(f32 x, u8 mode)
}
}
void Matrix_RotateY(f32 y, u8 mode)
{
void Matrix_RotateY(f32 y, u8 mode) {
MtxF* cmf;
f32 sin;
f32 cos;
f32 temp1;
f32 temp2;
if (mode == MTXMODE_APPLY)
{
if (y != 0)
{
if (mode == MTXMODE_APPLY) {
if (y != 0) {
cmf = sCurrentMatrix;
sin = sinf(y);
@ -232,18 +203,13 @@ void Matrix_RotateY(f32 y, u8 mode)
cmf->xw = temp1 * cos - temp2 * sin;
cmf->zw = temp1 * sin + temp2 * cos;
}
}
else
{
} else {
cmf = sCurrentMatrix;
if (y != 0)
{
if (y != 0) {
sin = sinf(y);
cos = cosf(y);
}
else
{
} else {
sin = 0.0f;
cos = 1.0f;
}
@ -267,18 +233,15 @@ void Matrix_RotateY(f32 y, u8 mode)
}
}
void Matrix_RotateZ(f32 z, u8 mode)
{
void Matrix_RotateZ(f32 z, u8 mode) {
MtxF* cmf;
f32 sin;
f32 cos;
f32 temp1;
f32 temp2;
if (mode == MTXMODE_APPLY)
{
if (z != 0)
{
if (mode == MTXMODE_APPLY) {
if (z != 0) {
cmf = sCurrentMatrix;
sin = sinf(z);
@ -339,7 +302,7 @@ void Matrix_RotateZ(f32 z, u8 mode)
* rotates that matrix by `y` degrees, then rotates that matrix
* by `x` degrees.
* Original Name: Matrix_RotateXYZ, changed to reflect rotation order.
*/
*/
void Matrix_RotateZYX(s16 x, s16 y, s16 z, u8 mode) {
MtxF* cmf = sCurrentMatrix;
f32 temp1;
@ -428,9 +391,8 @@ void Matrix_RotateZYX(s16 x, s16 y, s16 z, u8 mode) {
/*
* Translates the top of the matrix stack by `translation` units,
* then rotates that matrix by `rotation` in Z-Y-X order
*/
void Matrix_TranslateThenRotateZYX(Vec3f* translation, Vec3s* rotation)
{
*/
void Matrix_TranslateThenRotateZYX(Vec3f* translation, Vec3s* rotation) {
MtxF* cmf = sCurrentMatrix;
f32 sin;
f32 cos;