diff options
| author | spicyjpeg <thatspicyjpeg@gmail.com> | 2022-10-15 10:02:35 +0200 |
|---|---|---|
| committer | spicyjpeg <thatspicyjpeg@gmail.com> | 2022-10-15 10:02:35 +0200 |
| commit | 6eabb5aa549254c2272cedee26d4245f31f2dc7a (patch) | |
| tree | 1962581a2ea36f421718aad7bf90b1a37cc4c530 /examples/system/dynlink/library/cube.c | |
| parent | b458ea70700739bf8a64217af369c7ace08fc954 (diff) | |
| download | psn00bsdk-6eabb5aa549254c2272cedee26d4245f31f2dc7a.tar.gz | |
Update sound/spustream, clean up other examples
Diffstat (limited to 'examples/system/dynlink/library/cube.c')
| -rw-r--r-- | examples/system/dynlink/library/cube.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/examples/system/dynlink/library/cube.c b/examples/system/dynlink/library/cube.c index 84fe552..22a805f 100644 --- a/examples/system/dynlink/library/cube.c +++ b/examples/system/dynlink/library/cube.c @@ -81,16 +81,18 @@ static SVECTOR rot = { 0 }; static VECTOR pos = { 0, 0, 400 }; static MATRIX mtx, lmtx; -void init(CONTEXT *ctx) { +void init(RenderContext *ctx) { + Framebuffer *db = &(ctx->db[ctx->db_active]); + InitGeom(); - gte_SetGeomOffset(ctx->xres / 2, ctx->yres / 2); - gte_SetGeomScreen(ctx->xres / 2); + gte_SetGeomOffset(db->draw.clip.w / 2, db->draw.clip.h / 2); + gte_SetGeomScreen(db->draw.clip.w / 2); gte_SetBackColor(63, 63, 63); gte_SetColorMatrix(&color_mtx); } -void render(CONTEXT *ctx, uint16_t buttons) { +void render(RenderContext *ctx, uint16_t buttons) { RotMatrix(&rot, &mtx); TransMatrix(&mtx, &pos); MulMatrix0(&light_mtx, &mtx, &lmtx); @@ -104,8 +106,8 @@ void render(CONTEXT *ctx, uint16_t buttons) { rot.vx += step; rot.vz += step; - DB *db = &(ctx->db[ctx->db_active]); - POLY_F4 *pol4 = (POLY_F4 *) ctx->db_nextpri; + Framebuffer *db = &(ctx->db[ctx->db_active]); + POLY_F4 *pol4 = (POLY_F4 *) ctx->db_nextpri; for (uint32_t i = 0; i < CUBE_FACES; i++) { int32_t p; |
