home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 15 / AACD15.ISO / AACD / Graphics / Skulpt / src / Types.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-10-04  |  13.5 KB  |  450 lines

  1. typedef unsigned char SMALLBOOL;
  2.  
  3. // Structure pour les gadgets Sculpt
  4. typedef struct
  5. {
  6. #ifndef _AMIGA_
  7.     HBITMAP    hbm;
  8.     HDC        hdc;
  9.     HGDIOBJ    hold;
  10. #else
  11.     DiskObject *hIcon;
  12. #endif
  13. } SkulptGadget;
  14.  
  15. typedef struct
  16. {
  17.     SkulptGadget    *Gad;
  18.     RECT            rect;
  19. } WinGadget;
  20.  
  21. // Structure infos additionnelles pour fenêtre 2D
  22. typedef struct
  23. {
  24.     SMALLBOOL bFirstPaint;
  25.     WinGadget Widgets[13];
  26.     HDC hdcDBuf, hdcTBuf;
  27.      HBITMAP    hbDBuf;
  28. #ifndef _AMIGA_
  29.     HGDIOBJ    holdDBuf;
  30.     HFONT    holdDFont;
  31.     HGDIOBJ    holdTBuf;
  32.     HBRUSH    holdTBrush;
  33.     HFONT    holdTFont;
  34. #else
  35.     DC dcDBuf;
  36.     Region *hClip;
  37. #endif
  38. } WinThings;
  39.  
  40. // Objets géométriques basiques
  41. typedef struct
  42. {
  43.     D3DVECTOR        vPoint;
  44.     D3DVECTOR        vPointBack;
  45.     SMALLBOOL        bSelected;
  46.     SMALLBOOL        bHidden;
  47.     SMALLBOOL        bEnabled;
  48.     short            iDepend;
  49. } gSommet;
  50.  
  51. typedef struct
  52. {
  53.     short            iSommets[2];
  54.     SMALLBOOL        bHidden;
  55.     SMALLBOOL        bEnabled;
  56. } gEdge;
  57.  
  58. typedef struct
  59. {
  60.     char            sName[80];   // Nom du material
  61.     SMALLBOOL       bEnabled;    // Material enabled o/n
  62.     D3DMATERIAL7    mtrl;        // Propriétés de couleur diffuse / emissive / specular du material
  63.     SMALLBOOL       bTextured;   // Texturé o/n
  64.     char            sTexName[80];// Nom du fichier de texture pour l'uploader quand on redimensionne la fenêtre 3D (création du contexte fenêtre 3D)
  65.     short           iTexture;    // Numéro texture
  66. } gMtrl;
  67.  
  68. typedef struct
  69. {
  70.     char            sName[80];   // Nom du fichier de texture pour l'uploader quand on redimensionne la fenêtre 3D (création du contexte fenêtre 3D)
  71.     UBYTE           *hTexMap;    // Image A8R8G8B8 de la texture chargée en RAM
  72.     W3D_Texture     *hTexture;
  73.     int             iWidth;
  74.     int             iHeight;
  75. } gTex;
  76.  
  77. typedef struct
  78. {
  79.     short            iSommets[3]; // 3 indices dans le tableau des sommets
  80. #ifndef _AMIGA_
  81.     D3DVERTEX        pSommets[6]; // 2 facettes D3D : clockwise et anticlockwise
  82. #endif
  83.     short           u[3];
  84.     short           v[3];
  85.     short           iMtrl;
  86.     SMALLBOOL        bHidden;
  87.     SMALLBOOL        bEnabled;
  88. } gTri;
  89.  
  90. typedef struct
  91. {
  92.     SMALLBOOL        bEnabled;
  93.     SMALLBOOL        bSelected;
  94.     SMALLBOOL        bLit;
  95.     D3DLIGHT7        lLamp;
  96. } gLamp;
  97.  
  98. typedef struct
  99. {
  100.     ID3DXSimpleShape *pShape;
  101.     D3DMATERIAL7    mtrl;
  102.     SMALLBOOL        bHidden;
  103.     SMALLBOOL        bEnabled;
  104.     SMALLBOOL        bSelected;
  105.     D3DVECTOR        vOrigin;
  106. } gObject;
  107.  
  108. /*
  109. SCULPT ANIMATE FILE FORMATS
  110. The files generated by Sculpt Animate follow the IFF standard, with
  111. the exception of the RGB files described in chapter 3.    The .i.IFF.i.
  112. format is described in the Amiga ROM Kernel Manual, and sample
  113. programs to read and write such files may be found i
  114.  
  115. The file formats used by the Sculpt series of programs for the Amiga
  116. are constantly changing, through the addition of new chunk types and
  117. the definition of reserved 'padding' bytes in existing chunks.  In
  118. most cases this will not present problems either
  119.  
  120. Image files
  121. Images are written as .i.ILBM; IFF files and need little further
  122. explanation here, since they conform to the published standards.
  123. Because of the variety of image size and mode that Sculpt Animate
  124. uses, programs which intend to use these images shouldn'
  125.  
  126. Images saved in conjunction with frame buffer usage are non-standard,
  127. but follow the ILBM format.  These images have no CMAP chunk, so the
  128. bit planes represent actual 24-bit color intensity values:  8 planes
  129. each of red, green, and blue--stored in that
  130.  
  131. Scene files
  132. Scene files contain a number of data chunks.  Each chunk is described
  133. below in terms of a C structure.  The comments beside each structure
  134. member should make its meaning clear.  The FORM name for a scene file
  135. is 'SC3D'.
  136. */
  137.  
  138. /*    Chunk 'LAMP' contains one or more of the following structures,
  139.     the number of structures is determined by the length of the chunk
  140. */
  141.  
  142. struct    elamp
  143.       {  long int pos[3];        /* The position of the lamp         */
  144.      long int brightness;        /* The brightness of the lamp        */
  145.      unsigned char color[3];    /* The color of the lamp as a triple
  146.                        of RGB values, range 0 to 255        */
  147.      char pad;            /* Unused                    */
  148.       };
  149.  
  150. /*    Chunk 'OBSV' contains a specification of an observer according
  151.     to the following structure
  152. */
  153.  
  154. struct observer
  155.     {long int obsmode;        /* Rendering mode as follows
  156.                       0  Painting
  157.                       1  Snapshot
  158.                       2  Photo
  159.                       3  Wireframe
  160.                       4  Sketch
  161.                       5  Scanline painting
  162.                       6  Scanline snapshot            */
  163.      long int fl;            /* Focal length of lens in millimeters  */
  164.      long int althresh;        /* For internal use only            */
  165.      long int threshhold;        /* For internal use only            */
  166.      long int robspos[3];        /* Position of observer            */
  167.      long int rtarget[3];        /* Position of target            */
  168.      short int hires;        /* 0 for low
  169.                        1 for high resolution            */
  170.      short int lace;        /* 0 for non-interlace
  171.                        1 for interlace                */
  172.      short int lens;        /* Lens type as follows:
  173.                         0  Normal 50mm
  174.                         1  Wide angle 28mm
  175.                         2  Telephoto 135mm
  176.                         3  Special, as given by spfl    */
  177.      short int manexpflg;        /* 0 for auto exposure
  178.                        else manual                */
  179.      long int spfl;         /* Focal length of special lens        */
  180.      long int expoverride;        /* Current value for exposure override  */
  181.      long int manexpval;        /* Value when in manual mode        */
  182.      long int picsize;        /* Image size as follows
  183.                     0  Tiny
  184.                     1  Small
  185.                     2  Medium
  186.                     3  Full
  187.                     4  Jumbo
  188.                     5  Video                */
  189.      long int tilt;         /* Tilt angle                */
  190.      long int aamode;        /* Anti aliasing mode as follows:
  191.                     0  None
  192.                     1  Good
  193.                     2  Best                 */
  194.      short int dithatten;        /* Dithering attenuation as follows:
  195.                     0   Standard
  196.                     50  Half standard, etc
  197.                     100 None                */
  198.      short int colorlock;        /* Non zero for locking colors        */
  199.      short int explock;        /* Non zero for locking exposure value  */
  200.      short int expexp;        /* Internal use only            */
  201.      long int expmant;        /* Internal use only            */
  202.      unsigned char wfcol1[4],wfcol2[4];
  203.                     /* Colors for wire frame images        */
  204.      short int displayearly;
  205.                     /* Non zero to request early display
  206.                        of rendered image */
  207.      short int dummy[29];        /* Reserved for future use, should be set
  208.                        to zero.                 */
  209.     };
  210.  
  211. /*    Chunk 'WRLD' contains a specification of the world using the
  212.     following structure
  213. */
  214.  
  215. struct world
  216.     {long int groundmode;        /* 0 None, 1 solid, 2 checkered */
  217.      long int skymode;        /* 0 None, 1 solid, 2 graduated */
  218.      long int checkscale;        /* Size of checkered ground */
  219.      unsigned char backbright[3];
  220.                     /* Intensity of background illumination
  221.                        as RGB values on a scale of 0 to 255 */
  222.      unsigned char grcol1[3],grcol2[3];
  223.                     /* Colors of ground squares as RGB
  224.                        values on a scale of 0 to 255        */
  225.      unsigned char skycol1[3],skycol2[3];
  226.                    /* Sky colors as RGB values on
  227.                       a scale of 0 to 255            */
  228.      long int dummy[20];       /* Reserved for future use, should be set
  229.                       to zero                    */
  230.     };
  231.  
  232.  
  233. /*    Chunk 'VERT' contains an array of the following structure, one
  234.     element for each vertex to be included in the scene
  235. */
  236.  
  237. struct evertex
  238.     {
  239.         long int pos[3];       /* Position of vertex            */
  240.     };
  241.  
  242.  
  243. /*    Chunk 'EDGE' contains an array of the following structure, one
  244.     element for each edge in the scene
  245. */
  246.  
  247.  
  248. struct eedge
  249.     {long int evertexi[2];      /* Indices denoting vertices in VERT chunk */
  250.     };
  251.  
  252.  
  253. /*    Chunk 'FACE' cantains an array of the following structures, one
  254.     element for each face in the scene
  255. */
  256.  
  257.  struct eface
  258.     {long int evertexi[3];     /* Indices denoting vertices in VERT chunk */
  259.      unsigned char color[3];
  260.                  /* Face color as RGB values in the range
  261.                     0 to 255                    */
  262.      unsigned char texture;  /* The most significant bit is set
  263.                    if smoothing is needed.  The remaining
  264.                    bits represent a texture value as follows:
  265.                     0  Dull
  266.                     1  Shiny
  267.                     2  Mirror
  268.                     3  Luminous
  269.                     4  Glass
  270.                     5  Metal
  271.                     6  Glass2                */
  272.     };
  273.  
  274.  
  275. /*    The chunk 'HIER' contains an array of the following structures,
  276.     one element for each name in the hierarchy
  277. */
  278.  
  279. struct ehier
  280.     {short int parindex;    /* index to the hierarchy element
  281.                    that is the parent of this element        */
  282.      char name[10];     /* Name of hierarchy element            */
  283.      short int type;    /* Type of element, as follows:
  284.                     0  Empty
  285.                     2  Lamp
  286.                     4  Path
  287.                     6  Target
  288.                     8  Observer location
  289.                        10  Vertices
  290.                       Bit 0x10 is set if a local origin is
  291.                       used by this element            */
  292.      short int loverti;    /* index to the vertex that is the local
  293.                    of this element                */
  294.      long int lo[3];    /* Local origin position            */
  295.     };
  296.  
  297.  
  298. /*    Chunk 'VNAM' contains an array of the following structure, one
  299.     element for each vertex that has a hierarchy name
  300. */
  301.  
  302.  
  303. struct ename
  304.     {short int object;    /* index to vertex                */
  305.      short int name;    /* index to hierarchy name            */
  306.     };
  307.  
  308. /*    The chunk 'LNAM' contains an array of short integer values
  309.     representing the hierarchy indices for each lamp.  Unnamed
  310.     lamps are given an index of -1.
  311. */
  312.  
  313. /*    The chunk 'PATH' contains an array of the following structure,
  314.     one element for each vertex that is a part of a path.
  315. */
  316.  
  317. struct epath
  318.     {int evertexi;        /* Index to vertex                */
  319.      long int etumbleaxes[3][3];
  320.                 /* Tumble axis directions, scaled by a
  321.                    factor of 1L<<30                */
  322.      int terminator;
  323.                 /* Code value with bits set as follows:
  324.                        1  end of path
  325.                        2  end of loop
  326.                        4  interpolated                */
  327.     };
  328.  
  329.  
  330. /*    The chunk 'KNOT' contains an array of the following structure,
  331.     one element for each knot vertex included in the scene
  332. */
  333.  
  334.  
  335. struct eknot
  336.     {long int eslopes[2][3];
  337.                 /* Knot slopes scaled by 1L<<30         */
  338.      long int espeeds[2];
  339.                 /* Speed values scaled by 1L<<30        */
  340.      short int evertexi;
  341.                 /* index to vertex                */
  342.      short int terminator;
  343.                 /* Code value with bits set as follows:
  344.                        1  end of spline
  345.                        2  end of loop
  346.                        4  interpolated
  347.                        8  cusp                    */
  348.     };
  349.  
  350. /*    The chunk 'SPLN' contains an array of the following structure,
  351.     one element for each non-knot spline vertex
  352. */
  353.  
  354. struct espline
  355.     {short int evertexi;
  356.                 /*  Index to vertex                */
  357.      short int evertknoti;
  358.                 /*  Index to knot                */
  359.     };
  360.  
  361. /*    The chunk 'CSGE' contains a CSG object type identifier,
  362.    and a long array of indices to vertices of the object
  363. */
  364.  
  365. struct ecsg
  366.     {short int type;    /* set as follows:
  367.                    0 sphere                    */
  368.      long int evertexi[12];
  369.                 /*  Indices to vertices in CSG sphere        */
  370.     };
  371.  
  372. /*
  373. Take files
  374. A take is automatically saved to disk at frequent intervals as a file whose name ends with '.take'.  It is an IFF file with a form name called 'TAKE' containing the following chunks.
  375. */
  376.  
  377. /*    Chunk 'THDR' contains the following structure:
  378. */
  379.  
  380. struct take
  381.     {int frmode;        /* set to 1 for frame mode            */
  382.      int rammode;        /* set as follows:
  383.                      0 not RAM animation
  384.                      1 normal RAM animation
  385.                      2 economy RAM animation
  386.                      3 ANIM-5 RAM animation            */
  387.      int numframes;     /* number of frames in the take         */
  388.      int curframe;        /* current frame number             */
  389.      int saveimages;    /* set to 1 if frames are to be saved to disk */
  390.      int prevsize;        /* preview size as follows:
  391.                      2    Medium
  392.                      3 Full                    */
  393.      int motionblur;
  394.                 /* set for motion blur                */
  395.      int loopmode;        /* set as follows:
  396.                      0    no loop
  397.                      1    loop
  398.                      2    oscillation                */
  399.      int framebuffer;    /* set if frame buffer is in use        */
  400.      int framecontroller;    /* set if frame controller is in use        */
  401.      char anidrawer[22];    /* animation drawer name            */
  402.      char foreground[22];    /* foreground file name             */
  403.      char background[22];    /* background file name             */
  404.      char pad1[22];     /* unused, should be set to zero        */
  405.      char fcname[22];    /* frame controller name            */
  406.      char pad2[22];     /* unused, should be set to zero        */
  407.      char fbname[22];    /* frame buffer name                */
  408.      short int colorlock;    /* set when colors are locked            */
  409.      char creg[96];     /* current color registers            */
  410.      short int explock;    /* set when exposure values are locked        */
  411.      short int expexp;    /* internal use only                */
  412.      long int expmant;    /* internal use only                */
  413.      short int obsmode;    /* Rendering mode as follows
  414.                     0  Painting
  415.                     1  Snapshot
  416.                     2  Photo
  417.                     3  Wireframe
  418.                     4  Sketch
  419.                     5  Scanline painting
  420.                     6  Scanline snapshot            */
  421.      short int hires;    /* 0 for low and 1 for high resolution        */
  422.      short int lace;    /* 0 for non-interlace 1 for interlace        */
  423.      short int picsize;    /* Image size as follows
  424.                     0  Tiny
  425.                     1  Small
  426.                     2  Medium
  427.                     3  Full
  428.                     4  Jumbo
  429.                     5  Video                    */
  430.      short int bitplanes;    /* number of bit planes             */
  431.      unsigned char wfcol1[4],wfcol2[4];
  432.                 /* colors for wire frame rendering        */
  433.      char padding[64];    /* unused, should be set to zero        */
  434.     };
  435.  
  436.  
  437. /*    The remaining chunks are of type 'TFRM', one for each frame in
  438.     the take.  Each chunk contains the following structure
  439. */
  440.  
  441. struct etakeframe
  442.     {short int framenum;    /* Frame number                 */
  443.      short int keyframe;    /* Set to 1 if it is a keyframe         */
  444.      short int duration;    /* Duration, in jiffies             */
  445.      char imadrawer[22];    /* image drawer name                */
  446.      char scedrawer[22];    /* scene drawer name                */
  447.      char padding[64];    /* unused, should be set to zero        */
  448.     };
  449.  
  450.