Fix mario swimming stick direction

This commit is contained in:
jaburns
2020-10-12 17:58:16 -06:00
parent 20791ebcea
commit 259ce62dea
5 changed files with 18 additions and 18 deletions
+3 -3
View File
@@ -259,7 +259,7 @@ static void update_swimming_speed(struct MarioState *m, f32 decelThreshold) {
}
static void update_swimming_yaw(struct MarioState *m) {
s16 targetYawVel = -(s16)(10.0f * m->controller->stickX);
s16 targetYawVel = (s16)(10.0f * m->controller->stickX);
if (targetYawVel > 0) {
if (m->angleVel[1] < 0) {
@@ -288,7 +288,7 @@ static void update_swimming_yaw(struct MarioState *m) {
}
static void update_swimming_pitch(struct MarioState *m) {
s16 targetPitch = -(s16)(252.0f * m->controller->stickY);
s16 targetPitch = (s16)(252.0f * m->controller->stickY);
s16 pitchVel;
if (m->faceAngle[0] < 0) {
@@ -496,7 +496,7 @@ static s32 check_water_jump(struct MarioState *m) {
s32 probe = (s32)(m->pos[1] + 1.5f);
if (m->input & INPUT_A_PRESSED) {
if (probe >= m->waterLevel - 80 && m->faceAngle[0] >= 0 && m->controller->stickY < -60.0f) {
if (probe >= m->waterLevel - 80 && m->faceAngle[0] >= 0 && m->controller->stickY > 60.0f) {
vec3s_set(m->angleVel, 0, 0, 0);
m->vel[1] = 62.0f;
+3 -3
View File
@@ -122,6 +122,8 @@ static void process_display_list( void *dl )
*s_uvPtr++ = 1.0f;
}
s_outBuffers->numTrianglesUsed = (uint16_t)((s_trianglePtr - s_outBuffers->position) / 9);
break;
}
@@ -190,8 +192,6 @@ static void process_display_list( void *dl )
}
}
s_outBuffers->bufferUsedSize = s_trianglePtr - s_outBuffers->position;
break_top:
{}
}
@@ -213,5 +213,5 @@ void gfx_adapter_bind_output_buffers( struct SM64MarioGeometryBuffers *outBuffer
s_colorPtr = s_outBuffers->color;
s_normalPtr = s_outBuffers->normal;
s_uvPtr = s_outBuffers->uv;
s_outBuffers->bufferUsedSize = 0;
s_outBuffers->numTrianglesUsed = 0;
}
+2
View File
@@ -24,6 +24,7 @@
static struct AllocOnlyPool *s_mario_geo_pool;
static struct GraphNode *s_mario_graph_node;
static uint32_t s_last_colors_hash;
static void update_button( bool on, u16 button )
{
@@ -78,6 +79,7 @@ static struct Area *hack_build_area( void )
void sm64_global_init( uint8_t *rom, uint8_t *outTexture, SM64DebugPrintFunctionPtr debugPrintFunction )
{
s_last_colors_hash = 0;
gDebugPrint = debugPrintFunction;
load_mario_textures_from_rom( rom, outTexture );
+1 -2
View File
@@ -29,12 +29,11 @@ struct SM64MarioState
struct SM64MarioGeometryBuffers
{
size_t bufferMaxSize;
size_t bufferUsedSize;
float *position;
float *normal;
float *color;
float *uv;
uint16_t numTrianglesUsed;
};
typedef void (*SM64DebugPrintFunctionPtr)( const char * );
+2 -3
View File
@@ -69,10 +69,9 @@ typedef struct {
Light l[1];
} Lights1;
#define G_TX_RENDERTILE 0
#define G_ON (1)
#define G_OFF (0)
#define G_ON 1
#define G_OFF 0
#define G_TEXTURE_IMAGE_FRAC 2
#define gdSPDefLights1(ar,ag,ab,r1,g1,b1,x1,y1,z1) {{{ {ar,ag,ab},0,{ar,ag,ab},0}}, {{{ {r1,g1,b1},0,{r1,g1,b1},0,{x1,y1,z1},0}}} }