view libps2.h @ 95:b0249b856488

change_ps2util
author Atuto SHIROMA <e095729@ie.u-ryukyu.ac.jp>
date Thu, 26 May 2011 18:13:40 +0900
parents cb6c6de125dc
children 0b65ca27f113
line wrap: on
line source

#ifndef LIBPS2_H
#define LIBPS2_H

//dummy file

typedef float FVECTOR[4] __attribute__((aligned (16)));
typedef float FMATRIX[4][4] __attribute__((aligned (16)));


//object.h よりコピー
typedef struct texture {
  int width;                 // texture's width size
  int height;                // texture's height size
  char *name;                // texture's name
  //  TexEnv *texenv;
  char *free_texenv;         // pointer for free texenv
  char *free_image;          // pointer for free actual image data
  //  struct ps2_image g_img;    // this struct must not be alignmented by 128bit
} TEXTURE;


//また object.h よりコピー
typedef struct surface {
  int size;
  char *surf_name;          // object's surface name                          
  char *tex_name;           // surface's texture name                         
  TEXTURE *texture;         // pointer of this surface's texture              
  //  ps2_giftag giftag;        // own GIFtag data                                
  //  ps2_dmatag *packet;       // pointer of actual object data                  
  char *free_packet;        // pointer for free object data                   
  struct surface *next;
} SURFACE;


//またまた object.h よりコピー
typedef struct object {
  FVECTOR xyz;              // position
  FVECTOR angle;            // angle
  FMATRIX transfer;         // transfer matrix
  char *name;               // object's name
  char *free_me;            // pointer for free myself
  SURFACE *surfaces;
} OBJECT;


//ps2 依存関係内の libps2.h からもってきた
typedef struct {
  //GsSpritePacket* gs_packet;
  unsigned char r, g, b, a;
  unsigned short cx, cy;
  unsigned short x, y, w, h;
  unsigned short tex_x, tex_y, tex_w, tex_h;
  unsigned long priority;
  float scale;
  float rot;
} SPRITE;




/*
  構造体 PolygonInfo が見当たらないので自作
  作りは適当
*/
typedef struct popygon {
  int siz;
  FVECTOR pnts;
} PolygonInfo;


extern int malloc_align16(void *head, void *aligned, int size);



#endif