Skip to content

Commit

Permalink
Only adjust camera focus when oculus enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
lambertjamesd committed May 30, 2024
1 parent 476aec4 commit 398c1a5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/game/level_geo.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ Gfx *geo_envfx_main(s32 callContext, struct GraphNode *node, Mat4 mtxf) {
return gfx;
}

extern int gIsOculusConnected;

/**
* Geo function that generates a displaylist for the skybox. Can be assigned
* as the function of a GraphNodeBackground.
Expand All @@ -72,7 +74,7 @@ Gfx *geo_skybox_main(s32 callContext, struct GraphNode *node, UNUSED Mat4 *mtx)

gfx = create_skybox_facing_camera(0, backgroundNode->background, camFrustum->fov,
gLakituState.pos[0], gLakituState.pos[1], gLakituState.pos[2],
gLakituState.focus[0], gLakituState.pos[1], gLakituState.focus[2]);
gLakituState.focus[0], gIsOculusConnected ? gLakituState.pos[1] : gLakituState.focus[1], gLakituState.focus[2]);
}

return gfx;
Expand Down
5 changes: 4 additions & 1 deletion src/game/rendering_graph_node.c
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,9 @@ static void geo_process_switch(struct GraphNodeSwitchCase *node) {
}
}


extern int gIsOculusConnected;

/**
* Process a camera node.
*/
Expand All @@ -400,7 +403,7 @@ static void geo_process_camera(struct GraphNodeCamera *node) {
}

modifiedFocus[0] = node->focus[0];
modifiedFocus[1] = node->pos[1];
modifiedFocus[1] = gIsOculusConnected ? node->pos[1] : node->focus[1];
modifiedFocus[2] = node->focus[2];

headset_read_orientation(headRotation);
Expand Down
2 changes: 1 addition & 1 deletion src/game/save_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ void save_file_collect_star_or_key(s16 coinScore, s16 starIndex) {
}

s32 save_file_exists(s32 fileIndex) {
return 1;//(gSaveBuffer.files[fileIndex][0].flags & SAVE_FLAG_FILE_EXISTS) != 0;
return (gSaveBuffer.files[fileIndex][0].flags & SAVE_FLAG_FILE_EXISTS) != 0;
}

/**
Expand Down

0 comments on commit 398c1a5

Please sign in to comment.