diff --git a/src/include/lib/lib_24e40.h b/src/include/lib/lib_24e40.h index 65b1420df..6ba8e2bff 100644 --- a/src/include/lib/lib_24e40.h +++ b/src/include/lib/lib_24e40.h @@ -31,7 +31,7 @@ void func00025848(f32 tilex, f32 tilez, f32 tilewidth, f32 posx, f32 posz, f32 * void func00025928(struct tile *tile, struct coord *arg1); void tileGetFloorCol(struct tile *tile, u16 *floorcol); void tileGetFloorType(struct tile *tile, u8 *floortype); -u32 func00025c74(void); +f32 func00025c74(struct tiletype0 *tile, f32 x, f32 z, s32 vertexindex); f32 cdFindGroundInTileType0(struct tiletype0 *tile, f32 x, f32 z); f32 cdFindGroundInTileType1(struct tiletype1 *tile, f32 x, f32 z); bool cdIs2dPointInTileType0(struct tiletype0 *tile, f32 x, f32 z); diff --git a/src/lib/lib_24e40.c b/src/lib/lib_24e40.c index 8c4980ad8..690713a49 100644 --- a/src/lib/lib_24e40.c +++ b/src/lib/lib_24e40.c @@ -1055,6 +1055,43 @@ glabel cdFindGroundInTileType0 /* 260c8: 27bd0028 */ addiu $sp,$sp,0x28 ); +// Mismatch: regalloc, and operators for second mult are swapped +//f32 cdFindGroundInTileType0(struct tiletype0 *tile, f32 x, f32 z) +//{ +// s32 i = 1; +// s32 ival = -1; +// f32 tmpx; +// f32 tmpz; +// f32 fval; +// +// if (tile->header.numvertices >= 4) { +// while (i < tile->header.numvertices) { \ +// tmpz = tile->vertices[i][2]; +// tmpx = tile->vertices[i][0]; +// +// fval = +// (tile->vertices[0][2] - tmpz) * (x - tmpx) - +// (tile->vertices[0][0] - tmpx) * (z - tmpz); +// +// if (fval != 0) { +// if (ival < 0) { +// ival = (fval > 0); +// } else if (ival != 0 && fval < 0) { +// i--; +// break; +// } else if (ival == 0 && fval > 0) { +// i--; +// break; +// } +// } +// +// i++; +// } +// } +// +// return func00025c74(tile, x, z, i); +//} + f32 cdFindGroundInTileType1(struct tiletype1 *tile, f32 x, f32 z) { struct coord sp24;