mirror of
https://github.com/HarbourMasters/Starship
synced 2026-07-07 22:32:02 -04:00
ortho.c is matching (allá se lo están haciendo...)
This commit is contained in:
@@ -194,11 +194,13 @@ build/src/libultra/2D300.o: OPTFLAGS := -O1 -g0
|
||||
build/src/libultra/io/controller.o: OPTFLAGS := -O1 -g0
|
||||
build/src/libultra/libc/string.o: OPTFLAGS := -O2 -g0
|
||||
build/src/libultra/libc/ldiv.o: OPTFLAGS := -O2 -g0
|
||||
build/src/libultra/gu/ortho.o: OPTFLAGS := -O3 -g0
|
||||
build/src/libultra/gu/lookat.o: OPTFLAGS := -O3 -g0
|
||||
|
||||
# cc & asm-processor
|
||||
CC := $(ASM_PROC) $(ASM_PROC_FLAGS) $(IDO) -- $(AS) $(ASFLAGS) --
|
||||
build/src/libultra/gu/lookat.o: CC := $(IDO)
|
||||
build/src/libultra/gu/ortho.o: CC := $(IDO)
|
||||
#build/src/%.o: CC := $(ASM_PROC) $(ASM_PROC_FLAGS) $(IDO) -- $(AS) $(ASFLAGS) --
|
||||
|
||||
all: uncompressed
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
#include "global.h"
|
||||
#include "PR/gbi.h"
|
||||
|
||||
void guMtxIdentF(float (*mf)[4]);
|
||||
|
||||
float sqrtf(float value);
|
||||
#include "PR/gu.h"
|
||||
|
||||
void guLookAtF(float mf[4][4], float xEye, float yEye, float zEye, float xAt, float yAt, float zAt, float xUp,
|
||||
float yUp, float zUp) {
|
||||
|
||||
+29
-3
@@ -1,5 +1,31 @@
|
||||
#include "common.h"
|
||||
#include "global.h"
|
||||
#include "PR/gu.h"
|
||||
|
||||
#pragma GLOBAL_ASM("asm/us/nonmatchings/libultra/gu/ortho/guOrthoF.s")
|
||||
void guOrthoF(float mf[4][4], float l, float r, float b, float t, float n, float f, float scale) {
|
||||
int i;
|
||||
int j;
|
||||
|
||||
#pragma GLOBAL_ASM("asm/us/nonmatchings/libultra/gu/ortho/guOrtho.s")
|
||||
guMtxIdentF(mf);
|
||||
|
||||
mf[0][0] = 2 / (r - l);
|
||||
mf[1][1] = 2 / (t - b);
|
||||
mf[2][2] = -2 / (f - n);
|
||||
mf[3][0] = -(r + l) / (r - l);
|
||||
mf[3][1] = -(t + b) / (t - b);
|
||||
mf[3][2] = -(f + n) / (f - n);
|
||||
mf[3][3] = 1;
|
||||
|
||||
for (i = 0; i < 4; i++) {
|
||||
for (j = 0; j < 4; j++) {
|
||||
mf[i][j] *= scale;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void guOrtho(Mtx* m, float l, float r, float b, float t, float n, float f, float scale) {
|
||||
Matrix mf;
|
||||
|
||||
guOrthoF(mf, l, r, b, t, n, f, scale);
|
||||
|
||||
guMtxF2L(mf, m);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user