From c035455ff730f77e11ccc3362101e1cef2176d13 Mon Sep 17 00:00:00 2001 From: MeltyPlayer Date: Thu, 20 Oct 2022 00:18:43 -0500 Subject: [PATCH] Copied a fix that extends the region Mario can explore beyond shorts from @ckosmic's fork. --- src/decomp/game/area.h | 2 +- src/decomp/game/mario.c | 2 +- src/libsm64.c | 2 +- src/libsm64.h | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/decomp/game/area.h b/src/decomp/game/area.h index fee150b..84b05d6 100644 --- a/src/decomp/game/area.h +++ b/src/decomp/game/area.h @@ -35,7 +35,7 @@ struct InstantWarp struct SpawnInfo { - /*0x00*/ Vec3s startPos; + /*0x00*/ Vec3f startPos; /*0x06*/ Vec3s startAngle; /*0x0C*/ s8 areaIndex; /*0x0D*/ s8 activeAreaIndex; diff --git a/src/decomp/game/mario.c b/src/decomp/game/mario.c index bb33cc2..2cd16c1 100644 --- a/src/decomp/game/mario.c +++ b/src/decomp/game/mario.c @@ -1838,7 +1838,7 @@ int init_mario(void) { vec3s_copy(gMarioState->faceAngle, gMarioSpawnInfo->startAngle); vec3s_set(gMarioState->angleVel, 0, 0, 0); - vec3s_to_vec3f(gMarioState->pos, gMarioSpawnInfo->startPos); + vec3f_copy(gMarioState->pos, gMarioSpawnInfo->startPos); vec3f_set(gMarioState->vel, 0, 0, 0); gMarioState->floorHeight = diff --git a/src/libsm64.c b/src/libsm64.c index f83013c..003837a 100644 --- a/src/libsm64.c +++ b/src/libsm64.c @@ -139,7 +139,7 @@ SM64_LIB_FN void sm64_static_surfaces_load( const struct SM64Surface *surfaceArr surfaces_load_static( surfaceArray, numSurfaces ); } -SM64_LIB_FN int32_t sm64_mario_create( int16_t x, int16_t y, int16_t z ) +SM64_LIB_FN int32_t sm64_mario_create( float x, float y, float z ) { int32_t marioIndex = obj_pool_alloc_index( &s_mario_instance_pool, sizeof( struct MarioInstance )); struct MarioInstance *newInstance = s_mario_instance_pool.objects[marioIndex]; diff --git a/src/libsm64.h b/src/libsm64.h index 51f6b44..2a10146 100644 --- a/src/libsm64.h +++ b/src/libsm64.h @@ -22,7 +22,7 @@ struct SM64Surface int16_t type; int16_t force; uint16_t terrain; - int16_t vertices[3][3]; + int32_t vertices[3][3]; }; struct SM64MarioInputs @@ -82,7 +82,7 @@ extern SM64_LIB_FN void sm64_global_terminate( void ); extern SM64_LIB_FN void sm64_static_surfaces_load( const struct SM64Surface *surfaceArray, uint32_t numSurfaces ); -extern SM64_LIB_FN int32_t sm64_mario_create( int16_t x, int16_t y, int16_t z ); +extern SM64_LIB_FN int32_t sm64_mario_create( float x, float y, float z ); extern SM64_LIB_FN void sm64_mario_tick( int32_t marioId, const struct SM64MarioInputs *inputs, struct SM64MarioState *outState, struct SM64MarioGeometryBuffers *outBuffers ); extern SM64_LIB_FN void sm64_mario_delete( int32_t marioId );