|
ps2sdk
1.1
A collection of Open Source libraries used for developing applications on Sony's PlayStation 2® (PS2).
|
#include <kernel.h>#include <stdlib.h>#include <tamtypes.h>#include <math3d.h>#include <packet.h>#include <dma_tags.h>#include <gif_tags.h>#include <gs_psm.h>#include <dma.h>#include <graph.h>#include <draw.h>#include <draw3d.h>#include "mesh_data.c"
Include dependency graph for teapot.c:Go to the source code of this file.
Functions | |
| void | init_gs (framebuffer_t *frame, zbuffer_t *z) |
| void | init_drawing_environment (framebuffer_t *frame, zbuffer_t *z) |
| void | flip_buffers (packet_t *flip, framebuffer_t *frame) |
| qword_t * | render_teapot (qword_t *q, MATRIX view_screen, VECTOR object_position, VECTOR object_rotation, prim_t *prim, color_t *color, framebuffer_t *frame, zbuffer_t *z) |
| int | render (framebuffer_t *frame, zbuffer_t *z) |
| int | main (int argc, char **argv) |
Variables | |
| VECTOR | camera_position = { 0.00f, 0.00f, 100.00f, 1.00f } |
| VECTOR | camera_rotation = { 0.00f, 0.00f, 0.00f, 1.00f } |
| VECTOR * | temp_normals |
| VECTOR * | temp_lights |
| VECTOR * | temp_colours |
| VECTOR * | temp_vertices |
| xyz_t * | xyz |
| color_t * | rgbaq |
| int | light_count = 4 |
| VECTOR | light_direction [4] |
| VECTOR | light_colour [4] |
| int | light_type [4] |
| void flip_buffers | ( | packet_t * | flip, |
| framebuffer_t * | frame | ||
| ) |
Definition at line 125 of file teapot.c.
References packet_t::data, DMA_CHANNEL_GIF, dma_channel_send_normal_ucab(), dma_wait_fast(), draw_finish(), draw_framebuffer(), and draw_wait_finish().
Referenced by render().
| void init_drawing_environment | ( | framebuffer_t * | frame, |
| zbuffer_t * | z | ||
| ) |
Definition at line 100 of file teapot.c.
References packet_t::data, DMA_CHANNEL_GIF, dma_channel_send_normal(), dma_wait_fast(), draw_finish(), draw_primitive_xyoffset(), draw_setup_environment(), packet, packet_init(), and PACKET_NORMAL.
Referenced by main().
| void init_gs | ( | framebuffer_t * | frame, |
| zbuffer_t * | z | ||
| ) |
Definition at line 66 of file teapot.c.
References framebuffer_t::address, zbuffer_t::address, DRAW_ENABLE, zbuffer_t::enable, GRAPH_ALIGN_PAGE, graph_initialize(), graph_vram_allocate(), GS_PSM_32, GS_ZBUF_32, framebuffer_t::height, framebuffer_t::mask, zbuffer_t::mask, zbuffer_t::method, framebuffer_t::psm, framebuffer_t::width, zbuffer_t::zsm, and ZTEST_METHOD_GREATER_EQUAL.
Referenced by main().
| int main | ( | int | argc, |
| char ** | argv | ||
| ) |
Definition at line 336 of file teapot.c.
References dma_channel_fast_waits(), DMA_CHANNEL_GIF, dma_channel_initialize(), init_drawing_environment(), init_gs(), NULL, render(), and SleepThread().
| int render | ( | framebuffer_t * | frame, |
| zbuffer_t * | z | ||
| ) |
Definition at line 211 of file teapot.c.
References color_t::a, prim_t::antialiasing, color_t::b, prim_t::blending, prim_t::colorfix, context, create_view_screen(), packet_t::data, DMA_CHANNEL_GIF, dma_channel_send_chain(), dma_wait_fast(), DMATAG_CNT, DMATAG_END, draw_clear(), DRAW_DISABLE, draw_disable_tests(), DRAW_ENABLE, draw_enable_tests(), draw_finish(), draw_wait_finish(), flip_buffers(), prim_t::fogging, color_t::g, graph_aspect_ratio(), graph_set_framebuffer_filtered(), graph_wait_vsync(), framebuffer_t::height, prim_t::mapping, prim_t::mapping_type, object_position, object_rotation, packet_init(), PACKET_NORMAL, PACKET_UCAB, packets, prim, PRIM_SHADE_GOURAUD, PRIM_TRIANGLE, PRIM_UNFIXED, color_t::q, color_t::r, render_teapot(), rgbaq, prim_t::shading, temp_colours, temp_lights, temp_normals, temp_vertices, prim_t::type, vertex_count, view_screen, framebuffer_t::width, and xyz.
Referenced by main().
| qword_t* render_teapot | ( | qword_t * | q, |
| MATRIX | view_screen, | ||
| VECTOR | object_position, | ||
| VECTOR | object_rotation, | ||
| prim_t * | prim, | ||
| color_t * | color, | ||
| framebuffer_t * | frame, | ||
| zbuffer_t * | z | ||
| ) |
Definition at line 140 of file teapot.c.
References color_t::a, calculate_colours(), calculate_lights(), calculate_normals(), calculate_vertices(), camera_position, camera_rotation, colours, create_local_light(), create_local_screen(), create_local_world(), create_world_view(), DMATAG_CNT, draw_convert_rgbq(), draw_convert_xyz(), draw_prim_end(), draw_prim_start(), DRAW_RGBAQ_REGLIST, qword_t::dw, light_colour, light_count, light_direction, light_type, local_screen, local_world, normals, object_position, object_rotation, points, points_count, prim, color_t::rgbaq, rgbaq, temp_colours, temp_lights, temp_normals, temp_vertices, vertex_count, vertices, view_screen, world_view, xyz_t::xyz, and xyz.
Referenced by render().
| VECTOR camera_position = { 0.00f, 0.00f, 100.00f, 1.00f } |
Definition at line 32 of file teapot.c.
Referenced by render_teapot().
| VECTOR camera_rotation = { 0.00f, 0.00f, 0.00f, 1.00f } |
Definition at line 33 of file teapot.c.
Referenced by render_teapot().
| VECTOR light_colour[4] |
Definition at line 52 of file teapot.c.
Referenced by calculate_lights(), and render_teapot().
| int light_count = 4 |
Definition at line 43 of file teapot.c.
Referenced by calculate_lights(), and render_teapot().
| VECTOR light_direction[4] |
Definition at line 45 of file teapot.c.
Referenced by calculate_lights(), and render_teapot().
| int light_type[4] |
Definition at line 59 of file teapot.c.
Referenced by calculate_lights(), render_teapot(), and VuxLightNormal().
| color_t* rgbaq |
Definition at line 41 of file teapot.c.
Referenced by render(), and render_teapot().
| VECTOR* temp_colours |
Definition at line 37 of file teapot.c.
Referenced by render(), and render_teapot().
| VECTOR* temp_lights |
Definition at line 36 of file teapot.c.
Referenced by render(), and render_teapot().
| VECTOR* temp_normals |
Definition at line 35 of file teapot.c.
Referenced by render(), and render_teapot().
| VECTOR* temp_vertices |
Definition at line 38 of file teapot.c.
Referenced by render(), and render_teapot().
| xyz_t* xyz |
Definition at line 40 of file teapot.c.
Referenced by render(), and render_teapot().