From: ljsebald <ljs...@us...> - 2023-03-03 01:47:55
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "A pseudo Operating System for the Dreamcast.". The branch, master has been updated via 1da0eadf7025b79724e9dc54fdd7759ca13c93f6 (commit) from b7a56620c43e56c6d39a7764a69fe7ea0a4c0abd (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 1da0eadf7025b79724e9dc54fdd7759ca13c93f6 Author: Andress Barajas <and...@gm...> Date: Thu Mar 2 17:47:41 2023 -0800 Fixed bubbles example (#123) See GitHub PR #123. ----------------------------------------------------------------------- Summary of changes: examples/dreamcast/parallax/bubbles/bubbles.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/examples/dreamcast/parallax/bubbles/bubbles.c b/examples/dreamcast/parallax/bubbles/bubbles.c index 324032d..cdaac9e 100644 --- a/examples/dreamcast/parallax/bubbles/bubbles.c +++ b/examples/dreamcast/parallax/bubbles/bubbles.c @@ -27,15 +27,15 @@ the same, but it uses the Parallax functions instead of KGL. static float phase = 0.0f; static pvr_poly_cxt_t cxt; static pvr_poly_hdr_t hdr; +static pvr_dr_state_t dr_state; static void sphere(float radius, int slices, int stacks) { int i, j; float pitch, pitch2; float x, y, z, g, b; - float yaw, yaw2; - pvr_dr_state_t dr_state; + float yaw; - /* Setup our Direct Render state: pick a store queue and setup QACR0/1 */ - pvr_dr_init(dr_state); + /* Put our own polygon header */ + pvr_prim(&hdr, sizeof(hdr)); /* Initialize xmtrx with the values from KGL */ plx_mat_identity(); @@ -43,9 +43,6 @@ static void sphere(float radius, int slices, int stacks) { plx_mat3d_apply(PLX_MAT_PROJECTION); plx_mat3d_apply(PLX_MAT_MODELVIEW); - /* Put our own polygon header */ - pvr_prim(&hdr, sizeof(hdr)); - /* Iterate over stacks */ for(i = 0; i < stacks; i++) { pitch = 2 * M_PI * ((float)i / (float)stacks); @@ -55,7 +52,6 @@ static void sphere(float radius, int slices, int stacks) { long triangle strip. */ for(j = 0; j <= slices / 2; j++) { yaw = 2 * M_PI * ((float)j / (float)slices); - yaw2 = 2 * M_PI * ((float)(j + 1) / (float)slices); /* x, y+1 */ x = radius * fcos(yaw) * fcos(pitch2); @@ -102,6 +98,9 @@ static void sphere_frame_opaque() { pvr_scene_begin(); pvr_list_begin(PVR_LIST_OP_POLY); + /* Setup our Direct Render state: pick a store queue and setup QACR0/1 */ + pvr_dr_init(dr_state); + plx_mat3d_identity(); plx_mat3d_translate(0.0f, 0.0f, -12.0f); plx_mat3d_rotate(r * 2, 0.75f, 1.0f, 0.5f); hooks/post-receive -- A pseudo Operating System for the Dreamcast. |