00001 typedef float FVECTOR[4] __attribute__((aligned (16))); 00002 typedef float FMATRIX[4][4] __attribute__((aligned (16))); 00003 00004 typedef struct { 00005 ps2_giftag giftag; // 128bit 00006 ps2_gsreg_test gs_test; // 64bit 00007 __u64 gs_test1addr; // 64bit 00008 ps2_gs_alphaenv gs_alpha; // 512bit 00009 ps2_gs_texenv gs_tex; // 512bit 00010 } TexEnv; 00011 00012 typedef struct texture { 00013 int width; // texture's width size 00014 int height; // texture's height size 00015 char *name; // texture's name 00016 TexEnv *texenv; 00017 char *free_texenv; // pointer for free texenv 00018 char *free_image; // pointer for free actual image data 00019 struct ps2_image g_img; // this struct must not be alignmented by 128bit 00020 } TEXTURE; 00021 00022 typedef struct { 00023 unsigned IMMEDIATE: 16 __attribute__((packed)); 00024 unsigned NUM: 8 __attribute__((packed)); 00025 unsigned CMD: 8 __attribute__((packed)); 00026 } ps2_viftag __attribute__((aligned(4))); // 32bit 00027 00028 typedef struct surface { 00029 int size; 00030 char *surf_name; // object's surface name 00031 char *tex_name; // surface's texture name 00032 TEXTURE *texture; // pointer of this surface's texture 00033 ps2_giftag giftag; // own GIFtag data 00034 ps2_dmatag *packet; // pointer of actual object data 00035 char *free_packet; // pointer for free object data 00036 struct surface *next; 00037 } SURFACE; 00038 00039 typedef struct object { 00040 FVECTOR xyz; // position 00041 FVECTOR angle; // angle 00042 FMATRIX transfer; // transfer matrix 00043 char *name; // object's name 00044 char *free_me; // pointer for free myself 00045 SURFACE *surfaces; 00046 } OBJECT; 00047 00048 // functions 00049 void init_object(OBJECT *obj); 00050 void free_object(OBJECT *obj); 00051 void draw_object(OBJECT *obj); 00052 void libps2dy_obj_draw(SURFACE* srfs, FMATRIX transf); 00053