renderer.h (4648B)
1 #ifndef GD_RENDERER_H 2 #define GD_RENDERER_H 3 4 #include <PR/ultratypes.h> 5 #include <PR/os_cont.h> 6 7 #include "gd_types.h" 8 #include "macros.h" 9 10 // types 11 /// Properties types used in [gd_setproperty](@ref gd_setproperty); most are stubbed out. 12 enum GdProperty { 13 GD_PROP_OVERLAY = 4, 14 GD_PROP_LIGHTING = 11, 15 GD_PROP_AMB_COLOUR = 12, 16 GD_PROP_DIFUSE_COLOUR = 13, 17 GD_PROP_LIGHT_DIR = 15, 18 GD_PROP_CULLING = 16, 19 GD_PROP_STUB17 = 17, 20 GD_PROP_STUB18 = 18, 21 GD_PROP_STUB19 = 19, 22 GD_PROP_STUB20 = 20, 23 GD_PROP_STUB21 = 21, 24 GD_PROP_ZBUF_FN = 22 25 }; 26 27 enum GdSceneId { 28 GD_SCENE_YOSHI, // create yoshi? 29 GD_SCENE_YOSHI1, // destroy yoshi? 30 GD_SCENE_REGULAR_MARIO, 31 GD_SCENE_DIZZY_MARIO, 32 GD_SCENE_CAR, // create car? 33 GD_SCENE_CAR5 // destroy car? 34 }; 35 36 // data 37 extern s32 gGdFrameBufNum; 38 39 // functions 40 u32 get_alloc_mem_amt(void); 41 s32 gd_get_ostime(void); 42 f32 get_time_scale(void); 43 f64 gd_sin_d(f64 x); 44 f64 gd_cos_d(f64 x); 45 f64 gd_sqrt_d(f64 x); 46 void gd_printf(const char *format, ...); 47 void gd_exit(UNUSED s32 code) NORETURN; 48 void gd_free(void *ptr); 49 void *gd_allocblock(u32 size); 50 void *gd_malloc(u32 size, u8 perm); 51 void *gd_malloc_perm(u32 size); 52 void *gd_malloc_temp(u32 size); 53 void draw_indexed_dl(s32 dlNum, s32 gfxIdx); 54 void gd_add_to_heap(void *addr, u32 size); 55 void gdm_init(void *blockpool, u32 size); 56 void gdm_setup(void); 57 void gdm_maketestdl(s32 id); 58 void gd_vblank(void); 59 void gd_copy_p1_contpad(OSContPad *p1cont); 60 s32 gd_sfx_to_play(void); 61 Gfx *gdm_gettestdl(s32 id); 62 void gd_draw_rect(f32 ulx, f32 uly, f32 lrx, f32 lry); 63 void gd_draw_border_rect(f32 ulx, f32 uly, f32 lrx, f32 lry); 64 void gd_dl_set_fill(struct GdColour *colour); 65 void stash_current_gddl(void); 66 void pop_gddl_stash(void); 67 s32 gd_startdisplist(s32 memarea); 68 s32 gd_enddlsplist_parent(void); 69 void gd_dl_load_matrix(Mat4f *mtx); 70 void gd_dl_push_matrix(void); 71 void gd_dl_pop_matrix(void); 72 void gd_dl_mul_trans_matrix(f32 x, f32 y, f32 z); 73 void gd_dl_load_trans_matrix(f32 x, f32 y, f32 z); 74 void gd_dl_scale(f32 x, f32 y, f32 z); 75 void func_8019F2C4(f32 arg0, s8 arg1); 76 void gd_dl_lookat(struct ObjCamera *cam, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7); 77 void check_tri_display(s32 vtxcount); 78 Vtx *gd_dl_make_vertex(f32 x, f32 y, f32 z, f32 alpha); 79 void func_8019FEF0(void); 80 void gd_dl_make_triangle(f32 x1, f32 y1, f32 z1, f32 x2, f32 y2, f32 z2, f32 x3, f32 y3, f32 z3); 81 void func_801A0038(void); 82 void gd_dl_flush_vertices(void); 83 void set_render_alpha(f32 arg0); 84 void set_light_id(s32 index); 85 void set_light_num(s32 n); 86 s32 create_mtl_gddl(s32 mtlType); 87 void branch_to_gddl(s32 dlNum); 88 void gd_dl_hilite(s32, struct ObjCamera *, struct GdVec3f *, struct GdVec3f *, struct GdVec3f *, struct GdColour *); 89 void gd_dl_hilite(s32 idx, struct ObjCamera *cam, UNUSED struct GdVec3f *arg2, UNUSED struct GdVec3f *arg3, 90 struct GdVec3f *arg4, struct GdColour *colour); 91 s32 gd_dl_material_lighting(s32 id, struct GdColour *colour, s32 material); 92 void set_Vtx_norm_buf_1(struct GdVec3f *norm); 93 void set_Vtx_norm_buf_2(struct GdVec3f *norm); 94 void set_gd_mtx_parameters(s32 params); 95 void gd_set_one_cycle(void); 96 void gddl_is_loading_stub_dl(UNUSED s32 dlLoad); 97 void start_view_dl(struct ObjView *view); 98 void border_active_view(void); 99 void gd_shading(s32 model); 100 s32 gd_getproperty(s32 prop, UNUSED void *arg1); 101 void gd_setproperty(enum GdProperty prop, f32 f1, f32 f2, f32 f3); 102 void gd_create_ortho_matrix(f32 l, f32 r, f32 b, f32 t, f32 n, f32 f); 103 void gd_create_perspective_matrix(f32 fovy, f32 aspect, f32 near, f32 far); 104 s32 setup_view_buffers(const char *name, struct ObjView *view, UNUSED s32 ulx, UNUSED s32 uly, 105 UNUSED s32 lrx, UNUSED s32 lry); 106 void gd_init_controllers(void); 107 void stub_renderer_6(struct GdObj *obj); //apply to OBJ_TYPE_VIEWS 108 long defpup(UNUSED const char *menufmt, ...); 109 void menu_cb_control_type(u32); 110 void menu_cb_recalibrate_controller(u32); 111 void func_801A4438(f32 x, f32 y, f32 z); 112 void stub_renderer_10(u32 arg0); 113 void stub_draw_label_text(UNUSED char *s); 114 void set_active_view(struct ObjView *v); 115 void func_801A520C(void); 116 void gd_init(void); 117 void stub_renderer_12(s8 *arg0); /* convert LE bytes to BE word? */ 118 void stub_renderer_13(UNUSED void *arg0); 119 void stub_renderer_14(UNUSED s8 *arg0); /* convert LE bytes to BE f32? */ 120 void init_pick_buf(s16 *buf, s32 len); 121 void store_in_pickbuf(s16 data); 122 s32 get_cur_pickbuf_offset(UNUSED s16 *arg0); 123 void set_vtx_tc_buf(f32 tcS, f32 tcT); 124 struct GdObj *load_dynlist(struct DynList *dynlist); 125 126 #endif // GD_RENDERER_H