Advertisement
Guest User

Untitled

a guest
Jun 28th, 2019
280
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 19.87 KB | None | 0 0
  1. /*
  2.     Ninja Library
  3.    
  4.     COPYRIGHT (C) SEGA ENTERPRISES,LTD.
  5. */
  6.  
  7. #ifndef _NINJA_STR_H_
  8. #define _NINJA_STR_H_
  9.  
  10. typedef Sint8 NJS_SYS_ATTR[NJD_SYS_ATTR_SIZE];
  11.  
  12. typedef void (*NJS_INT_FUNC)(void);
  13.  
  14. typedef struct{
  15.     Uint32 NativeLimit;
  16.     Uint32 NativeCurrent;
  17.     Uint32 NativePeak;
  18.     Uint32 InternalVertexBufSize[5];
  19.     Uint32 MaxVertexBufSize[5];
  20.     Uint32 LastTATime;
  21.     Uint32 LastRenderTime;
  22.     Uint32 CurrentVertexBufSize[5];
  23.     Uint32 reserved0;
  24.     Uint32 reserved1;
  25.     Uint32 reserved2;
  26.     Uint32 reserved3;
  27.     Uint32 reserved4;
  28.     Uint32 reserved5;
  29.     Uint32 reserved6;
  30.     Uint32 reserved7;
  31.     Uint32 reserved8;
  32.     Uint32 reserved9;
  33.     Uint32 reserved10;
  34.     Uint32 reserved11;
  35. } NJS_SYSTEMINFO;
  36.  
  37. typedef struct {
  38.     Sint16  u;
  39.     Sint16  v;
  40. } NJS_TEX;
  41.  
  42. typedef struct {
  43.     Uint8   b;
  44.     Uint8   g;
  45.     Uint8   r;
  46.     Uint8   a;
  47. } NJS_BGRA;
  48.  
  49. typedef union {
  50.     Uint32  color;
  51.     NJS_TEX tex;
  52.     NJS_BGRA argb;
  53. } NJS_COLOR;
  54.  
  55. typedef struct {
  56.     Float   a;
  57.     Float   r;
  58.     Float   g;
  59.     Float   b;
  60. } NJS_ARGB;
  61.  
  62. typedef struct {
  63.     Sint16  x;
  64.     Sint16  y;
  65. } NJS_POINT2I;
  66.  
  67. typedef struct {
  68.     Float  x;
  69.     Float  y;
  70. } NJS_POINT2;
  71.  
  72. typedef struct {
  73.     Float   x;
  74.     Float   y;
  75.     Float   z;
  76. } NJS_POINT3, NJS_VECTOR;
  77.  
  78. typedef struct {
  79.     NJS_POINT2  *p;
  80.     NJS_COLOR   *col;
  81.     NJS_COLOR   *tex;
  82.     Uint32      num;
  83. } NJS_POINT2COL;
  84.  
  85. typedef struct {
  86.     NJS_POINT3  *p;
  87.     NJS_COLOR   *col;
  88.     NJS_COLOR   *tex;
  89.     Uint32      num;
  90. } NJS_POINT3COL;
  91.  
  92. typedef struct {
  93.     Float   px,py,pz;
  94.     Float   vx,vy,vz;
  95. } NJS_LINE, NJS_PLANE, NJS_PVECTOR;
  96.  
  97.  
  98. /* コリジョン用構造体追加 */
  99. typedef struct{
  100.     NJS_POINT3 c;
  101.     Float      r;
  102. } NJS_SPHERE;
  103.  
  104. typedef struct{
  105.     NJS_POINT3 c1;
  106.     NJS_POINT3 c2;
  107.     Float      r;
  108. } NJS_CAPSULE;
  109.  
  110. typedef struct{
  111.     NJS_POINT3 v[8];
  112. } NJS_BOX;
  113.  
  114. typedef struct{
  115.     NJS_POINT3 v[4];
  116. } NJS_RECT;
  117. /* 追加終わり */
  118.  
  119.  
  120. typedef struct {
  121.     NJS_MATRIX m;
  122.     Float   px,py,pz;
  123.     Float   vx,vy,vz;
  124.     Angle   roll;
  125.     Float   apx,apy,apz;
  126.     Float   avx,avy,avz;
  127.     Angle   aroll;
  128. } NJS_VIEW;
  129.  
  130. typedef struct {
  131.     Float   dist;
  132.     Float   w,h;
  133.     Float   cx,cy;
  134. } NJS_SCREEN;
  135.  
  136.  
  137. /*--------------------------------------*/
  138. /*      Texture Structure               */
  139. /*--------------------------------------*/
  140. typedef struct{
  141.     Uint32 Type;
  142.     Uint32 BitDepth;
  143.     Uint32 PixelFormat;
  144.     Uint32 nWidth;
  145.     Uint32 nHeight;
  146.     Uint32 TextureSize;
  147.     Uint32 fSurfaceFlags;
  148.     Uint32 *pSurface;
  149.     Uint32 *pVirtual;
  150.     Uint32 *pPhysical;
  151. }NJS_TEXSURFACE;
  152.    
  153. typedef struct{
  154.     void*              texaddr; /* texture address              */
  155.     NJS_TEXSURFACE  texsurface; /* texture surface              */
  156. } NJS_TEXINFO;
  157.  
  158. typedef struct {
  159.     void            *filename;  /* texture filename strings     */
  160.     Uint32               attr;  /* texture attribute            */
  161.     Uint32            texaddr;  /* texture memory list address  */
  162. } NJS_TEXNAME;
  163.  
  164. typedef struct {
  165.     NJS_TEXNAME     *textures;  /* texture array                */
  166.     Uint32          nbTexture;  /* texture count                */
  167. } NJS_TEXLIST;
  168.  
  169. typedef struct {
  170.     Uint32          globalIndex;/* global unique texture ID     */
  171.     Uint32          bank;       /* palette bank                 */
  172.     Uint32          tspparambuffer;/* TSPParambuffer            */
  173.     Uint32          texparambuffer;/* TextureParambuffer        */
  174.     Uint32          texaddr;    /* texture flag                 */
  175.     NJS_TEXINFO     texinfo;    /* texinfo                      */
  176.     Uint16          count;      /* texture count                */
  177.     Uint16          dummy;
  178. } NJS_TEXMEMLIST;
  179.  
  180. typedef struct {
  181.     void            *palette;   /*  palette pointer             */
  182.     Uint16          mode;       /*  color mode                  */
  183.     Sint16          bank;       /*  bank                        */
  184.     Sint16          offset;     /*  entry offset                */
  185.     Sint16          count;      /*  entry count                 */
  186. }NJS_TEXPALETTE;
  187.  
  188. typedef struct {
  189.     Uint32  n;
  190.     Uint32  globalIndex;
  191.     Sint32  texerr;
  192.     Sint32  gdstat;
  193.     Sint32  gderr;
  194.     Sint32  reserved0;
  195.     Sint32  reserved1;
  196.     Sint32  reserved2;
  197. }NJS_TEXERRSTAT;
  198.  
  199. typedef struct{
  200.     Uint32 nTextureType;
  201.     Uint16 nWidth;
  202.     Uint16 nHeight;
  203. }NJS_PVRHEADERDATA;
  204.  
  205. /*--------------------------------------*/
  206. /*      Model Structure                 */
  207. /*--------------------------------------*/
  208. /*
  209.  * NJS_MODEL
  210.  */
  211. typedef struct {
  212.     NJS_COLOR         diffuse;
  213.     NJS_COLOR        specular;
  214.     Float            exponent;
  215.     Uint32         attr_texId;  /* attribute and texture ID in texlist        */
  216.     Uint32          attrflags;  /* attribute flags */
  217. } NJS_MATERIAL;
  218.  
  219. typedef struct {
  220.     Uint16          type_matId; /* meshset type and attr index
  221.                                    14-15 : meshset type bits
  222.                                     0-13 : material id(0-4095)  */
  223.     Uint16          nbMesh;     /* mesh count                   */
  224.     Sint16          *meshes;    /* mesh array                   */
  225.     Uint32          *attrs;     /* attribure                    */
  226.     NJS_VECTOR      *normals;   /* mesh normal list             */
  227.     NJS_COLOR       *vertcolor; /* polygon vertex color list    */
  228.     NJS_COLOR       *vertuv;    /* polygon vertex uv list       */
  229. } NJS_MESHSET;
  230.  
  231. typedef struct {
  232.     NJS_POINT3      *points;    /* vertex list                  */
  233.     NJS_VECTOR      *normals;   /* vertex normal list           */
  234.     Sint32          nbPoint;    /* vertex count                 */
  235.     NJS_MESHSET     *meshsets;  /* meshset list                 */
  236.     NJS_MATERIAL    *mats;      /* material list                */
  237.     Uint16          nbMeshset;  /* meshset count                */
  238.     Uint16          nbMat;      /* material count               */
  239.     NJS_POINT3      center;     /* model center                 */
  240.     Float           r;          /* ??????????? */
  241. } NJS_MODEL;
  242.  
  243. /*
  244.  * NJS_OBJECT
  245.  */
  246. typedef struct obj {
  247.     Uint32          evalflags;  /* evalation flags              */
  248.     NJS_MODEL       *model;     /* model data pointer           */
  249.     Float           pos[3];     /* translation                  */
  250.     Angle           ang[3];     /* rotation                     */
  251.     Float           scl[3];     /* scaling                      */
  252.     struct obj      *child;     /* child object                 */
  253.     struct obj      *sibling;   /* sibling object               */
  254. } NJS_OBJECT;
  255.  
  256. /*
  257.  * NJS_MOTION
  258.  */
  259. /* key frame animation */
  260. typedef struct {
  261.     Uint32          keyframe;
  262.     Float           key[3];
  263. } NJS_MKEY_F;
  264.  
  265. typedef struct {
  266.     Uint32          keyframe;
  267.     Angle           key[3];     /* angle                        */
  268. } NJS_MKEY_A;
  269.  
  270. typedef struct {
  271.     Uint32          keyframe;
  272.     Angle           angle;      /* angle                        */
  273.     Float           axe[3];     /* axe vector                   */
  274. } NJS_MKEY_AX;
  275.  
  276. typedef struct
  277. {
  278.     Uint32          keyframe;
  279.     void            *key;        /* pointer                     */
  280. } NJS_MKEY_P;
  281.  
  282. typedef struct {
  283.     Uint32          keyframe;
  284.     Float           key;
  285. } NJS_MKEY_F1;
  286.  
  287. typedef struct {
  288.     Uint32          keyframe;
  289.     Float           key[2];
  290. } NJS_MKEY_F2;
  291.  
  292. typedef struct {
  293.     Uint32          keyframe;
  294.     Float           nrang;
  295.     Float           frang;
  296.     Angle           iang;
  297.     Angle           oang;
  298. } NJS_MKEY_SPOT;
  299.  
  300. typedef struct {
  301.     Uint32          keyframe;
  302.     Uint32          key;
  303. } NJS_MKEY_UI32;
  304.  
  305. typedef struct {
  306.     Uint32          keyframe;
  307.     Sint32          key;
  308. } NJS_MKEY_SI32, NJS_MKEY_A1;
  309.  
  310. typedef struct {
  311.     Uint32          keyframe;
  312.     Float           key[4];
  313. } NJS_MKEY_QUAT;
  314.  
  315. /*
  316.  * NJS_MDATA
  317.  */
  318. /* 1 factor : pos or ang or scl or shape or vec */
  319. typedef struct {
  320.     void            *p[1];      /* factor pointer               */
  321.     Uint32          nb[1];      /* factor count                 */
  322. } NJS_MDATA1;
  323.  
  324. /* 2 factors : pos and ang, pos and vec(light motion), etc      */
  325. typedef struct {
  326.     void            *p[2];      /* factor pointer               */
  327.     Uint32          nb[2];      /* factor count                 */
  328. } NJS_MDATA2;
  329.  
  330. /* 3 factors : pos and ang and scl, pos and ang and shape, etc  */
  331. typedef struct {
  332.     void            *p[3];      /* factor pointer               */
  333.     Uint32          nb[3];      /* factor count                 */
  334. } NJS_MDATA3;
  335.  
  336. /* 4 factors : pos and ang and scl and shape, etc               */
  337. typedef struct {
  338.     void            *p[4];      /* factor pointer               */
  339.     Uint32          nb[4];      /* factor count                 */
  340. } NJS_MDATA4;
  341.  
  342. /* 5 factors : etc               */
  343. typedef struct {
  344.     void            *p[5];      /* factor pointer               */
  345.     Uint32          nb[5];      /* factor count                 */
  346. } NJS_MDATA5;
  347.  
  348. typedef struct {
  349.     void            *mdata;     /* NJS_MDATA array              */
  350.     Uint32          nbFrame;    /* frame count                  */
  351.     Uint16          type;       /* motion type  NJD_MTYPE_...   */
  352.     Uint16          inp_fn;     /* interpolation & factor count */
  353. } NJS_MOTION;
  354.  
  355. typedef struct {
  356.     NJS_OBJECT      *object;    /* Object Tree top pointer      */
  357.     NJS_MOTION      *motion;    /* motion                       */
  358. #if 0
  359.     NJS_TEXLIST     *texlist;   /* current texture list         */
  360. #endif
  361. } NJS_ACTION;
  362.  
  363. typedef struct
  364. {
  365.     NJS_MOTION      *motion[2];     /* motion's pointers */
  366.     Float           frame[2];       /* current frames */
  367. } NJS_MOTION_LINK;
  368.  
  369. typedef struct
  370. {
  371.     NJS_OBJECT      *object;        /* object's pointer */
  372.     NJS_MOTION_LINK *motionlink;    /* motion-link's pointer */
  373. } NJS_ACTION_LINK;
  374.  
  375.  
  376. /*
  377.  * 3DLIB WORK BUFFER
  378.  */
  379. typedef union {
  380.     Uint32      work;   /* work */
  381.     Uint32      clip;   /* clip */
  382.  
  383. } NJS_CLIP_BUF;
  384.  
  385. typedef struct {
  386.     NJS_CLIP_BUF a;         /* union            : 32        */
  387.     Float       sx,sy;      /* screen point     : 36 40     */
  388.     Float       oow;        /* 1/w              : 44        */
  389.     NJS_POINT3  point;      /* vertex point     :  0  4  8  */
  390.     Uint32      reserve;    /* clip             : 28        */
  391.     Float       u,v;        /* U, V             : 48 52     */
  392.     Float       inten[2];   /* Intensity        : 56 60     */
  393.     NJS_VECTOR  vector;     /* vertex normal    : 12 16 20  */
  394.     Uint32      flag;       /* flag             : 24        */
  395. } NJS_VERTEX_BUF;           /* TotalSize        : 64        */
  396.  
  397. typedef struct {
  398.     NJS_CLIP_BUF a;         /* union            : 4 */
  399.     Float       sx,sy;      /* screen point     :12 */
  400.     Float       oow;        /* 1/w              :16 */
  401.     NJS_POINT3  point;      /* vertex point     :44 */
  402.     Uint32      reserve;    /* clip             :64 */
  403.     NJS_ARGB    col;
  404.     NJS_VECTOR  vector;     /* vertex normal    :56 */
  405.     Uint32      flag;       /* flag             :58 */
  406. } NJS_VERTEX_BUF2;          /* TotalSize        : 64        */
  407.  
  408.  
  409. typedef struct {
  410.     NJS_CLIP_BUF a;         /* union            : 32        */
  411.     Float       sx,sy;      /* screen point     : 36 40     */
  412.     Float       oow;        /* 1/w              : 44        */
  413.     NJS_POINT3  point;      /* vertex point     :  0  4  8  */
  414.     Uint32      reserve;    /* clip             : 28        */
  415.     Float       u,v;        /* U, V             : 48 52     */
  416.     Float       inten[2];   /* Intensity        : 56 60     */
  417.     NJS_VECTOR  vector;     /* vertex normal    : 12 16 20  */
  418.     Uint32      flag;       /* flag             : 24        */
  419. } NJS_VERTEX_BUF_0;
  420.  
  421. typedef struct {
  422.     NJS_CLIP_BUF a;         /* union            : 4 */
  423.     Float       sx,sy;      /* screen point     :12 */
  424.     Float       oow;        /* 1/w              :16 */
  425.     NJS_POINT3  point;      /* vertex point     :44 */
  426.     Uint32      reserve;    /* clip             :64 */
  427.     NJS_ARGB    col;
  428.     NJS_VECTOR  vector;     /* vertex normal    :56 */
  429.     Uint32      flag;       /* flag             :58 */
  430. } NJS_VERTEX_BUF_1;
  431.  
  432. typedef struct {
  433.     NJS_CLIP_BUF a;         /* union            : 4 */
  434.     Float       sx,sy;      /* screen point     :12 */
  435.     Float       oow;        /* 1/w              :16 */
  436.     Float       u,v;        /* U V              :24 */
  437.     Uint32      col[2];     /* pack col         :32 */
  438.     NJS_POINT3  point;      /* vertex point     :44 */
  439.     NJS_VECTOR  vector;     /* vertex normal    :56 */
  440.     Uint32      flag;       /* flag             :58 */
  441.     Uint32      reserve;    /* clip             :64 */
  442. } NJS_VERTEX_BUF_3;
  443.  
  444. typedef struct {
  445.     NJS_CLIP_BUF a;         /* union            : 32        */
  446.     Float       sx,sy;      /* screen point     : 36 40     */
  447.     Float       oow;        /* 1/w              : 44        */
  448.     NJS_POINT3  point;      /* vertex point     :  0  4  8  */
  449.     Uint32      reserve;    /* clip             : 28        */
  450.     Float       u,v;        /* U, V             : 48 52     */
  451.     Float       inten[2];   /* Intensity        : 56 60     */
  452.     NJS_VECTOR  vector;     /* vertex normal    : 12 16 20  */
  453.     Uint32      flag;       /* flag             : 24        */
  454. } NJS_VERTEX_BUF_7;
  455.  
  456. typedef struct {
  457.     NJS_VECTOR  vector;     /* vertex normal    :12 */
  458.     Uint32      clip;       /* clip             :16 */
  459.     Float       sx,sy;      /* screen point     :24 */
  460.     Float       oow;        /* 1/w              :28 */
  461.     Float       inten;      /* intensity        :32 */
  462. } NJS_VERTEX_BUF_X;
  463.  
  464.  
  465. /*--------------------------------------*/
  466. /*      Light Structure                 */
  467. /*--------------------------------------*/
  468. /*
  469.  * NJS_LIGHT_CAL
  470.  */
  471. typedef struct
  472. {
  473. /*************/
  474.     Float       ratten;         /* attenuation rate             */
  475.     Float       ipd;            /* inner product                */
  476. /*************/
  477.     Float       nrr;            /* limit judgment value         */
  478.     Float       frr;            /* limit judgment value         */
  479.     Float       cosi;           /* limit judgment value         */
  480.     Float       cose;           /* limit judgment value         */
  481.     Float       idev;           /* judgment value of devision   */
  482.     Float       odev;           /* judgment value of devision   */
  483.     Float       rate;           /* attenuation rate(calculated) */
  484.     Float       intns;          /* Intensity (0-1)              */
  485.     Int         exp;            /* exponent(SGI):material       */
  486. /*************/
  487.     Int         reserve;        /*                              */
  488. /*************/
  489.     NJS_POINT3  lpnt;           /* point vector                 */
  490.     NJS_VECTOR  lvctr;          /* directional vector           */
  491. /*************/
  492.     NJS_VECTOR  lmvctr;         /* directional vector           */
  493. /*************/
  494.     NJS_ARGB    atten;          /* intns * argb                 */
  495.     NJS_ARGB    amb;            /* iamb*atten                   */
  496.     NJS_ARGB    dif;            /* idif*atten                   */
  497.     NJS_ARGB    spc;            /* ispc*atten                   */
  498. /*************/
  499.     NJS_ARGB    mamb;           /* amb*material                 */
  500.     NJS_ARGB    mdif;           /* dif*material                 */
  501.     NJS_ARGB    mspc;           /* spc*material                 */
  502. /*************/
  503. } NJS_LIGHT_CAL, *NJS_LIGHT_CAL_PTR;
  504.  
  505. /*
  506.  * NJS_LIGHT_ATTR
  507.  */
  508. typedef struct {
  509.     Int             lsrc;       /* the kind of light source     */
  510.     Float           iamb;       /* ambient's intensity          */
  511.     Float           idif;       /* deffuse light's intensity    */
  512.     Float           ispc;       /* specular light's intensity   */
  513.     Float           nrang;      /* limit value (nearest)        */
  514.     Float           frang;      /* limit value (farthest)       */
  515.     void*           func;       /* the pointer of Callback func.*/
  516.     Angle           iang;       /* limit value (inside)         */
  517.     Angle           oang;       /* limit value (outside)        */
  518.     NJS_ARGB        argb;       /* light's color                */
  519. } NJS_LIGHT_ATTR, *NJS_LIGHT_ATTR_PTR;
  520.  
  521. /*
  522.  * NJS_LIGHT
  523.  */
  524. typedef struct {
  525.     NJS_MATRIX      mtrx;       /* matrix                       */
  526.     NJS_POINT3      pnt;        /* point vector                 */
  527.     NJS_VECTOR      vctr;       /* directional vector           */
  528.     Int             stat;       /* status                       */
  529.     Int             reserve;    /* reserve                      */
  530.     NJS_LIGHT_CAL   ltcal;      /* calculation                  */
  531.     NJS_LIGHT_ATTR  attr;       /* attribute                    */
  532. } NJS_LIGHT, *NJS_LIGHT_PTR;
  533.  
  534. /*
  535.  * NJS_LIGHT_MATERIAL
  536.  */
  537. typedef  struct {
  538.     NJS_ARGB        ambient;    /* Ambient color from Material  */
  539.     NJS_ARGB        diffuse;    /* Diffuse color from Material  */
  540.     NJS_ARGB        specular;   /* Specular color from Material */
  541.     Float           exponent;   /* Exponent from Material       */
  542. } NJS_LIGHT_MATERIAL;
  543.  
  544. /*
  545.  * NJF_LIGHT_FUNC
  546.  */
  547. typedef void (*NJF_LIGHT_FUNC)(NJS_ARGB*, NJS_POINT3*, NJS_VECTOR*, NJS_LIGHT_PTR);
  548.  
  549. /*--------------------------------------*/
  550. /*      Camera Structure                */
  551. /*--------------------------------------*/
  552.  
  553. typedef struct {
  554.     Float px, py, pz;
  555.     Float vx, vy, vz;
  556.     Angle roll;
  557.     Angle ang;
  558.     Float n_clip;
  559.     Float f_clip;
  560.     NJS_VECTOR lx,ly;
  561. } NJS_CAMERA;
  562.  
  563. /*--------------------------------------*/
  564. /*   Light & Camera Motion Structure    */
  565. /*--------------------------------------*/
  566.  
  567. typedef struct {
  568.     NJS_LIGHT   *light;
  569.     NJS_MOTION  *motion;
  570. } NJS_LACTION;
  571.  
  572. typedef struct {
  573.     NJS_CAMERA  *camera;
  574.     NJS_MOTION  *motion;
  575. } NJS_CACTION;
  576.  
  577. typedef struct {
  578.     Float   *pos;
  579.     Angle   *ang;
  580.     Float   *scl;
  581. } NJS_MOTION_DATA;
  582.  
  583. typedef struct {
  584.     Float   *pos;
  585.     Float   *vect;
  586.     Angle   *roll;
  587.     Angle   *ang;
  588. } NJS_CMOTION_DATA;
  589.  
  590. typedef struct {
  591.     Float   *pos;
  592.     Float   *vect;
  593.     Float   *rgb;
  594.     Float   *inten;
  595.     Float   *rang;
  596.     Angle   *ang;
  597. } NJS_LMOTION_DATA;
  598.  
  599. /*--------------------------------------*/
  600. /*      Scroll Structure                */
  601. /*--------------------------------------*/
  602. /*
  603.  * NJS_SCLATTR
  604.  */
  605. typedef Uint32 NJS_SCLATTR;     /* scroll attribute structure   */
  606.  
  607. /*
  608.  * NJS_SCLMTRX
  609.  */
  610. typedef Float NJS_SCLMTRX[4];   /* scroll rotation matrix       */
  611.  
  612. /*
  613.  *NJS_SCROLL
  614.  */
  615. typedef struct {
  616.     Uint16      celps;          /* pixel size of the cells      */
  617.     Uint16      mapw;           /* number of the width of map   */
  618.     Uint16      maph;           /* number of the height of map  */
  619.     Uint16      sw,sh;          /* size of the scroll draw      */
  620.     NJS_TEXLIST* list;          /* texlist ID                   */
  621.     Uint32      *map;           /* map array pointer            */
  622.     Float       px,py;          /* scroll transration           */
  623.     Float       bx,by;          /* map draw scroll              */
  624.     Float       pr;             /* priority                     */
  625.     Uint16      sflag;          /* scale flag                   */
  626.     Float       sx,sy;          /* scale x,y                    */
  627.     Float       spx,spy;        /* center of scale x,y          */
  628.     Uint16      mflag;          /* matrix flag                  */
  629.     Float       cx,cy;          /* center of rotation x,y       */
  630.     NJS_SCLMTRX m;              /* rotation matrix              */
  631.     Uint32      colmode;        /* color mode                   */
  632.     NJS_POINT2  clip[2];
  633.     NJS_SCLATTR attr;           /* scroll attribute             */
  634.     NJS_COLOR   sclc;
  635. }NJS_SCROLL;
  636.  
  637. enum{
  638.     _SM00,_SM01,
  639.     _SM10,_SM11
  640. };
  641.  
  642. /*--------------------------------------*/
  643. /*      Sprite                          */
  644. /*--------------------------------------*/
  645. typedef struct {
  646.     Sint16      sx,sy;          /* size             */
  647.     Sint16      cx,cy;          /* center           */
  648.     Sint16      u1,v1;          /* upper left       */
  649.     Sint16      u2,v2;          /* lower right      */
  650.     Sint16      texid;          /* texture id       */
  651.     Sint16      attr;           /* attribute        */
  652. } NJS_TEXANIM;
  653.  
  654. typedef struct {
  655.     NJS_POINT3  p;              /* point            */
  656.     Float       sx,sy;          /* scale            */
  657.     Angle       ang;            /* angle            */
  658.     NJS_TEXLIST *tlist;         /* texture list     */
  659.     NJS_TEXANIM *tanim;         /* animation list   */
  660. } NJS_SPRITE;
  661.  
  662. /*--------------------------------------*/
  663. /*      Low Level                       */
  664. /*--------------------------------------*/
  665.  
  666. typedef struct {
  667.     Float   x;
  668.     Float   y;
  669.     Float   z;
  670.     Uint32  col;
  671. } NJS_POLYGON_VTX;
  672.  
  673. typedef struct {
  674.     Float   x;
  675.     Float   y;
  676.     Float   z;
  677.     Float   u;
  678.     Float   v;
  679.     Uint32  col;
  680. } NJS_TEXTURE_VTX;
  681.  
  682. typedef struct {
  683.     Float   x;
  684.     Float   y;
  685.     Float   z;
  686.     Float   u;
  687.     Float   v;
  688.     Uint32  bcol;
  689.     Uint32  ocol;
  690. } NJS_TEXTUREH_VTX;
  691.  
  692. /*--------------------------------------*/
  693. /*      Math                            */
  694. /*--------------------------------------*/
  695. typedef struct {
  696.     int     keys;           /* keyframes between two points which must be interpolated */
  697.     int     *iparam;        /* attribute data (integer) */
  698.     float   *fparam;        /* attribute data (float) */
  699. } NJS_SPLINE;
  700.  
  701. typedef struct {
  702.     float   re;                 /* real (or scalor) part of quaternion      */
  703.     float   im[3];              /* imaginary (or vector) part of quaternion */
  704. } NJS_QUATERNION;
  705.  
  706.  
  707. /*--------------------------------------*/
  708. /*      Multi Pass                      */
  709. /*--------------------------------------*/
  710.  
  711. typedef struct {
  712.     Bool            bPreSort;
  713.     Sint32          nSize[5];
  714. } NJS_PASS_INFO;
  715.  
  716. typedef struct {
  717.     Sint32          nNumOfMaxPass;
  718.     NJS_PASS_INFO   sPassInfo[8];
  719. } NJS_VERTEXBUFFER_INFO;
  720.  
  721.  
  722. /*--------------------------------------*/
  723. /*      Quad Draw                       */
  724. /*--------------------------------------*/
  725.  
  726. typedef struct {
  727.     Float   x1,y1,x2,y2;
  728.     Float   u1,v1,u2,v2;
  729. } NJS_QUAD_TEXTURE;
  730.  
  731. typedef struct {
  732.     Float   x,y,z;
  733.     Float   vx1,vy1;
  734.     Float   vx2,vy2;
  735.     Uint32  dmy;
  736.     Float   u,v;
  737.     Float   vu1,vv1;
  738.     Float   vu2,vv2;
  739.     Uint32  dmy2[2];
  740. } NJS_QUAD_TEXTURE_EX;
  741.  
  742.  
  743.  
  744.  
  745. #endif /* _NINJA_STR_H_ */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement