home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / programming / oslib / oslib_1 / OSLib / User / h / wimpsprite < prev   
Encoding:
Text File  |  1995-06-22  |  14.0 KB  |  459 lines

  1. #ifndef wimpspriteop_H
  2. #define wimpspriteop_H
  3.  
  4. /* C header file for WimpSpriteOp
  5.  * written by DefMod (Jun 20 1995) on Thu Jun 22 12:16:08 1995
  6.  * Jonathan Coxhead, Acorn Computers Ltd
  7.  */
  8.  
  9. #ifndef types_H
  10. #include "types.h"
  11. #endif
  12.  
  13. #ifndef os_H
  14. #include "os.h"
  15. #endif
  16.  
  17. #ifndef osspriteop_H
  18. #include "osspriteop.h"
  19. #endif
  20.  
  21. #ifndef wimp_H
  22. #include "wimp.h"
  23. #endif
  24.  
  25. /**********************************
  26.  * SWI names and SWI reason codes *
  27.  **********************************/
  28. #undef  Wimp_SpriteOp
  29. #define Wimp_SpriteOp                           0x400E9
  30. #undef  XWimp_SpriteOp
  31. #define XWimp_SpriteOp                          0x600E9
  32. #undef  WimpSpriteOp_MergeSpriteFile
  33. #define WimpSpriteOp_MergeSpriteFile            0xB
  34. #undef  WimpSpriteOp_GetSprite
  35. #define WimpSpriteOp_GetSprite                  0xE
  36. #undef  WimpSpriteOp_SelectSprite
  37. #define WimpSpriteOp_SelectSprite               0x18
  38. #undef  WimpSpriteOp_PutSprite
  39. #define WimpSpriteOp_PutSprite                  0x1C
  40. #undef  WimpSpriteOp_PutSpriteUserCoords
  41. #define WimpSpriteOp_PutSpriteUserCoords        0x22
  42. #undef  WimpSpriteOp_SetPointerShape
  43. #define WimpSpriteOp_SetPointerShape            0x24
  44. #undef  WimpSpriteOp_ReadPaletteSize
  45. #define WimpSpriteOp_ReadPaletteSize            0x25
  46. #undef  WimpSpriteOp_ReadSpriteSize
  47. #define WimpSpriteOp_ReadSpriteSize             0x28
  48. #undef  WimpSpriteOp_ReadPixelColour
  49. #define WimpSpriteOp_ReadPixelColour            0x29
  50. #undef  WimpSpriteOp_ReadPixelMask
  51. #define WimpSpriteOp_ReadPixelMask              0x2B
  52. #undef  WimpSpriteOp_PlotMask
  53. #define WimpSpriteOp_PlotMask                   0x30
  54. #undef  WimpSpriteOp_PlotMaskUserCoords
  55. #define WimpSpriteOp_PlotMaskUserCoords         0x31
  56. #undef  WimpSpriteOp_PlotMaskScaled
  57. #define WimpSpriteOp_PlotMaskScaled             0x32
  58. #undef  WimpSpriteOp_PutSpriteScaled
  59. #define WimpSpriteOp_PutSpriteScaled            0x34
  60. #undef  WimpSpriteOp_PutSpriteGreyScaled
  61. #define WimpSpriteOp_PutSpriteGreyScaled        0x35
  62. #undef  WimpSpriteOp_PlotMaskTrfm
  63. #define WimpSpriteOp_PlotMaskTrfm               0x37
  64. #undef  WimpSpriteOp_PutSpriteTrfm
  65. #define WimpSpriteOp_PutSpriteTrfm              0x38
  66.  
  67. /************************
  68.  * Constant definitions *
  69.  ************************/
  70. #define wimpspriteop_AREA                       ((osspriteop_area *) 0x1u)
  71.  
  72. /*************************
  73.  * Function declarations *
  74.  *************************/
  75.  
  76. #ifdef __cplusplus
  77.    extern "C" {
  78. #endif
  79.  
  80. /* ------------------------------------------------------------------------
  81.  * Function:      wimpspriteop_merge_sprite_file()
  82.  *
  83.  * Description:   Merges sprite file
  84.  *
  85.  * Input:         file_name - value of R2 on entry
  86.  *
  87.  * Other notes:   Calls SWI 0x400E9 with R0 = 0xB.
  88.  */
  89.  
  90. extern os_error *xwimpspriteop_merge_sprite_file (char const *file_name);
  91. extern void wimpspriteop_merge_sprite_file (char const *file_name);
  92.  
  93. /* ------------------------------------------------------------------------
  94.  * Function:      wimpspriteop_get_sprite()
  95.  *
  96.  * Description:   Gets sprite
  97.  *
  98.  * Input:         sprite_name - value of R2 on entry
  99.  *                get_palette - value of R3 on entry
  100.  *
  101.  * Output:        header - value of R2 on exit (X version only)
  102.  *
  103.  * Returns:       R2 (non-X version only)
  104.  *
  105.  * Other notes:   Calls SWI 0x400E9 with R0 = 0xE.
  106.  */
  107.  
  108. extern os_error *xwimpspriteop_get_sprite (char const *sprite_name,
  109.       bool get_palette,
  110.       osspriteop_header **header);
  111. extern osspriteop_header *wimpspriteop_get_sprite (char const *sprite_name,
  112.       bool get_palette);
  113.  
  114. /* ------------------------------------------------------------------------
  115.  * Function:      wimpspriteop_select_sprite()
  116.  *
  117.  * Description:   Selects sprite
  118.  *
  119.  * Input:         sprite_name - value of R2 on entry
  120.  *
  121.  * Output:        header - value of R2 on exit (X version only)
  122.  *
  123.  * Returns:       R2 (non-X version only)
  124.  *
  125.  * Other notes:   Calls SWI 0x400E9 with R0 = 0x18.
  126.  */
  127.  
  128. extern os_error *xwimpspriteop_select_sprite (char const *sprite_name,
  129.       osspriteop_header **header);
  130. extern osspriteop_header *wimpspriteop_select_sprite (char const *sprite_name);
  131.  
  132. /* ------------------------------------------------------------------------
  133.  * Function:      wimpspriteop_put_sprite()
  134.  *
  135.  * Description:   Puts sprite
  136.  *
  137.  * Input:         sprite_name - value of R2 on entry
  138.  *                action - value of R5 on entry
  139.  *
  140.  * Other notes:   Calls SWI 0x400E9 with R0 = 0x1C.
  141.  */
  142.  
  143. extern os_error *xwimpspriteop_put_sprite (char const *sprite_name,
  144.       os_action action);
  145. extern void wimpspriteop_put_sprite (char const *sprite_name,
  146.       os_action action);
  147.  
  148. /* ------------------------------------------------------------------------
  149.  * Function:      wimpspriteop_put_sprite_user_coords()
  150.  *
  151.  * Description:   Puts sprite at user coordinates
  152.  *
  153.  * Input:         sprite_name - value of R2 on entry
  154.  *                x - value of R3 on entry
  155.  *                y - value of R4 on entry
  156.  *                action - value of R5 on entry
  157.  *
  158.  * Other notes:   Calls SWI 0x400E9 with R0 = 0x22.
  159.  */
  160.  
  161. extern os_error *xwimpspriteop_put_sprite_user_coords (char const *sprite_name,
  162.       int x,
  163.       int y,
  164.       os_action action);
  165. extern void wimpspriteop_put_sprite_user_coords (char const *sprite_name,
  166.       int x,
  167.       int y,
  168.       os_action action);
  169.  
  170. /* ------------------------------------------------------------------------
  171.  * Function:      wimpspriteop_set_pointer_shape()
  172.  *
  173.  * Description:   Sets pointer shape
  174.  *
  175.  * Input:         sprite_name - value of R2 on entry
  176.  *                flags - value of R3 on entry
  177.  *                xactive - value of R4 on entry
  178.  *                yactive - value of R5 on entry
  179.  *                factors - value of R6 on entry
  180.  *                trans_tab - value of R7 on entry
  181.  *
  182.  * Other notes:   Calls SWI 0x400E9 with R0 = 0x24.
  183.  */
  184.  
  185. extern os_error *xwimpspriteop_set_pointer_shape (char const *sprite_name,
  186.       bits flags,
  187.       int xactive,
  188.       int yactive,
  189.       os_factors const *factors,
  190.       osspriteop_trans_tab const *trans_tab);
  191. extern void wimpspriteop_set_pointer_shape (char const *sprite_name,
  192.       bits flags,
  193.       int xactive,
  194.       int yactive,
  195.       os_factors const *factors,
  196.       osspriteop_trans_tab const *trans_tab);
  197.  
  198. /* ------------------------------------------------------------------------
  199.  * Function:      wimpspriteop_read_palette_size()
  200.  *
  201.  * Description:   Reads palette size
  202.  *
  203.  * Input:         sprite_name - value of R2 on entry
  204.  *
  205.  * Output:        size - value of R3 on exit
  206.  *                palette - value of R4 on exit
  207.  *                mode - value of R5 on exit
  208.  *
  209.  * Other notes:   Calls SWI 0x400E9 with R0 = 0x25, R3 = 0xFFFFFFFF.
  210.  */
  211.  
  212. extern os_error *xwimpspriteop_read_palette_size (char const *sprite_name,
  213.       int *size,
  214.       os_sprite_palette **palette,
  215.       os_mode *mode);
  216. extern void wimpspriteop_read_palette_size (char const *sprite_name,
  217.       int *size,
  218.       os_sprite_palette **palette,
  219.       os_mode *mode);
  220.  
  221. /* ------------------------------------------------------------------------
  222.  * Function:      wimpspriteop_read_sprite_size()
  223.  *
  224.  * Description:   Reads sprite information
  225.  *
  226.  * Input:         sprite_name - value of R2 on entry
  227.  *
  228.  * Output:        width - value of R3 on exit
  229.  *                height - value of R4 on exit
  230.  *                mask - value of R5 on exit
  231.  *                mode - value of R6 on exit
  232.  *
  233.  * Other notes:   Calls SWI 0x400E9 with R0 = 0x28.
  234.  */
  235.  
  236. extern os_error *xwimpspriteop_read_sprite_size (char const *sprite_name,
  237.       int *width,
  238.       int *height,
  239.       bool *mask,
  240.       os_mode *mode);
  241. extern void wimpspriteop_read_sprite_size (char const *sprite_name,
  242.       int *width,
  243.       int *height,
  244.       bool *mask,
  245.       os_mode *mode);
  246.  
  247. /* ------------------------------------------------------------------------
  248.  * Function:      wimpspriteop_read_pixel_colour()
  249.  *
  250.  * Description:   Reads pixel colour
  251.  *
  252.  * Input:         sprite_name - value of R2 on entry
  253.  *                x - value of R3 on entry
  254.  *                y - value of R4 on entry
  255.  *
  256.  * Output:        gcol - value of R5 on exit
  257.  *                tint - value of R6 on exit
  258.  *
  259.  * Other notes:   Calls SWI 0x400E9 with R0 = 0x29.
  260.  */
  261.  
  262. extern os_error *xwimpspriteop_read_pixel_colour (char const *sprite_name,
  263.       int x,
  264.       int y,
  265.       os_gcol *gcol,
  266.       os_tint *tint);
  267. extern void wimpspriteop_read_pixel_colour (char const *sprite_name,
  268.       int x,
  269.       int y,
  270.       os_gcol *gcol,
  271.       os_tint *tint);
  272.  
  273. /* ------------------------------------------------------------------------
  274.  * Function:      wimpspriteop_read_pixel_mask()
  275.  *
  276.  * Description:   Reads pixel mask
  277.  *
  278.  * Input:         sprite_name - value of R2 on entry
  279.  *                x - value of R3 on entry
  280.  *                y - value of R4 on entry
  281.  *
  282.  * Output:        solid - value of R5 on exit (X version only)
  283.  *
  284.  * Returns:       R5 (non-X version only)
  285.  *
  286.  * Other notes:   Calls SWI 0x400E9 with R0 = 0x2B.
  287.  */
  288.  
  289. extern os_error *xwimpspriteop_read_pixel_mask (char const *sprite_name,
  290.       int x,
  291.       int y,
  292.       bool *solid);
  293. extern bool wimpspriteop_read_pixel_mask (char const *sprite_name,
  294.       int x,
  295.       int y);
  296.  
  297. /* ------------------------------------------------------------------------
  298.  * Function:      wimpspriteop_plot_mask()
  299.  *
  300.  * Description:   Plots sprite mask
  301.  *
  302.  * Input:         sprite_name - value of R2 on entry
  303.  *
  304.  * Other notes:   Calls SWI 0x400E9 with R0 = 0x30.
  305.  */
  306.  
  307. extern os_error *xwimpspriteop_plot_mask (char const *sprite_name);
  308. extern void wimpspriteop_plot_mask (char const *sprite_name);
  309.  
  310. /* ------------------------------------------------------------------------
  311.  * Function:      wimpspriteop_plot_mask_user_coords()
  312.  *
  313.  * Description:   Plots sprite mask at user coordinates
  314.  *
  315.  * Input:         sprite_name - value of R2 on entry
  316.  *                x - value of R3 on entry
  317.  *                y - value of R4 on entry
  318.  *
  319.  * Other notes:   Calls SWI 0x400E9 with R0 = 0x31.
  320.  */
  321.  
  322. extern os_error *xwimpspriteop_plot_mask_user_coords (char const *sprite_name,
  323.       int x,
  324.       int y);
  325. extern void wimpspriteop_plot_mask_user_coords (char const *sprite_name,
  326.       int x,
  327.       int y);
  328.  
  329. /* ------------------------------------------------------------------------
  330.  * Function:      wimpspriteop_plot_mask_scaled()
  331.  *
  332.  * Description:   Plots mask scaled
  333.  *
  334.  * Input:         sprite_name - value of R2 on entry
  335.  *                x - value of R3 on entry
  336.  *                y - value of R4 on entry
  337.  *                factors - value of R5 on entry
  338.  *
  339.  * Other notes:   Calls SWI 0x400E9 with R0 = 0x32.
  340.  */
  341.  
  342. extern os_error *xwimpspriteop_plot_mask_scaled (char const *sprite_name,
  343.       int x,
  344.       int y,
  345.       os_factors const *factors);
  346. extern void wimpspriteop_plot_mask_scaled (char const *sprite_name,
  347.       int x,
  348.       int y,
  349.       os_factors const *factors);
  350.  
  351. /* ------------------------------------------------------------------------
  352.  * Function:      wimpspriteop_put_sprite_scaled()
  353.  *
  354.  * Description:   Puts sprite scaled
  355.  *
  356.  * Input:         sprite_name - value of R2 on entry
  357.  *                x - value of R3 on entry
  358.  *                y - value of R4 on entry
  359.  *                action - value of R5 on entry
  360.  *                factors - value of R6 on entry
  361.  *                trans_tab - value of R7 on entry
  362.  *
  363.  * Other notes:   Calls SWI 0x400E9 with R0 = 0x34.
  364.  */
  365.  
  366. extern os_error *xwimpspriteop_put_sprite_scaled (char const *sprite_name,
  367.       int x,
  368.       int y,
  369.       os_action action,
  370.       os_factors const *factors,
  371.       osspriteop_trans_tab const *trans_tab);
  372. extern void wimpspriteop_put_sprite_scaled (char const *sprite_name,
  373.       int x,
  374.       int y,
  375.       os_action action,
  376.       os_factors const *factors,
  377.       osspriteop_trans_tab const *trans_tab);
  378.  
  379. /* ------------------------------------------------------------------------
  380.  * Function:      wimpspriteop_put_sprite_grey_scaled()
  381.  *
  382.  * Description:   Puts sprite scaled and anti-aliased
  383.  *
  384.  * Input:         sprite_name - value of R2 on entry
  385.  *                x - value of R3 on entry
  386.  *                y - value of R4 on entry
  387.  *                factors - value of R6 on entry
  388.  *                trans_tab - value of R7 on entry
  389.  *
  390.  * Other notes:   Calls SWI 0x400E9 with R0 = 0x35, R5 = 0x0.
  391.  */
  392.  
  393. extern os_error *xwimpspriteop_put_sprite_grey_scaled (char const *sprite_name,
  394.       int x,
  395.       int y,
  396.       os_factors const *factors,
  397.       osspriteop_trans_tab const *trans_tab);
  398. extern void wimpspriteop_put_sprite_grey_scaled (char const *sprite_name,
  399.       int x,
  400.       int y,
  401.       os_factors const *factors,
  402.       osspriteop_trans_tab const *trans_tab);
  403.  
  404. /* ------------------------------------------------------------------------
  405.  * Function:      wimpspriteop_plot_mask_trfm()
  406.  *
  407.  * Description:   Plots sprite mask transformed
  408.  *
  409.  * Input:         sprite_name - value of R2 on entry
  410.  *                flags - value of R3 on entry
  411.  *                source_rect - value of R4 on entry
  412.  *                trfm - value of R6 on entry
  413.  *
  414.  * Other notes:   Calls SWI 0x400E9 with R0 = 0x37.
  415.  */
  416.  
  417. extern os_error *xwimpspriteop_plot_mask_trfm (char const *sprite_name,
  418.       bits flags,
  419.       os_box const *source_rect,
  420.       os_trfm const *trfm);
  421. extern void wimpspriteop_plot_mask_trfm (char const *sprite_name,
  422.       bits flags,
  423.       os_box const *source_rect,
  424.       os_trfm const *trfm);
  425.  
  426. /* ------------------------------------------------------------------------
  427.  * Function:      wimpspriteop_put_sprite_trfm()
  428.  *
  429.  * Description:   Puts sprite transformed
  430.  *
  431.  * Input:         sprite_name - value of R2 on entry
  432.  *                flags - value of R3 on entry
  433.  *                source_rect - value of R4 on entry
  434.  *                action - value of R5 on entry
  435.  *                trfm - value of R6 on entry
  436.  *                trans_tab - value of R7 on entry
  437.  *
  438.  * Other notes:   Calls SWI 0x400E9 with R0 = 0x38.
  439.  */
  440.  
  441. extern os_error *xwimpspriteop_put_sprite_trfm (char const *sprite_name,
  442.       bits flags,
  443.       os_box const *source_rect,
  444.       os_action action,
  445.       os_trfm const *trfm,
  446.       osspriteop_trans_tab const *trans_tab);
  447. extern void wimpspriteop_put_sprite_trfm (char const *sprite_name,
  448.       bits flags,
  449.       os_box const *source_rect,
  450.       os_action action,
  451.       os_trfm const *trfm,
  452.       osspriteop_trans_tab const *trans_tab);
  453.  
  454. #ifdef __cplusplus
  455.    }
  456. #endif
  457.  
  458. #endif
  459.