home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / programming / dreamscape / source / Dreamscape / Headers / graphics / h / sprite < prev   
Encoding:
Text File  |  1996-08-27  |  1.4 KB  |  52 lines

  1.  
  2. // graphics.h.sprite
  3.  
  4. // Dreamscape - C++ class library for RISC OS
  5. // Copyright (c) 1996 Mark Seaborn <mseaborn@argonet.co.uk>
  6. //
  7. // This library is free software; you can redistribute it and/or
  8. // modify it under the terms of the GNU Library General Public
  9. // License as published by the Free Software Foundation; either
  10. // version 2 of the License, or (at your option) any later version.
  11. // See the Dreamscape documentation for more information.
  12.  
  13. #ifndef dreamscape_sprite_H
  14. #define dreamscape_sprite_H
  15.  
  16. #include "graphic.h"
  17.  
  18. class SpriteFile: public Graphic {
  19.   static class Initialise: public Graphic::Handler {
  20.   public:
  21.     bool accept(Filetype type);
  22.     Graphic *load_file(const char *filename, Filetype type);
  23.     Graphic *load_data(istream &stream, int size, Filetype type);
  24.   } init;
  25.   friend Initialise;
  26.  
  27.   struct osspriteop_area *data;
  28.   int size;
  29.   void output(ostream &stream) const;
  30.  
  31. public:
  32.   SpriteFile(const char *filename);
  33.   SpriteFile(istream &stream, int size);
  34.   virtual ~SpriteFile();
  35.  
  36.   int get_data_size() const;
  37.   Filetype get_filetype() const;
  38.   enum { filetype = 0xFF9 };
  39.  
  40.   void redraw(const RedrawInfo &info) const;
  41.  
  42.   WinBBox get_bbox() const;
  43.   WinBBox get_transformed_bbox() const;
  44.   WinBBox get_transformed_bbox(const WinTransform &matrix) const;
  45.  
  46.   // Graphic-specific methods
  47.   osspriteop_area *get_sprite_data() { return data; }
  48.   const osspriteop_area *get_sprite_data() const { return data; }
  49. };
  50.  
  51. #endif
  52.