home *** CD-ROM | disk | FTP | other *** search
-
- // graphics.h.sprite
-
- // Dreamscape - C++ class library for RISC OS
- // Copyright (c) 1996 Mark Seaborn <mseaborn@argonet.co.uk>
- //
- // This library is free software; you can redistribute it and/or
- // modify it under the terms of the GNU Library General Public
- // License as published by the Free Software Foundation; either
- // version 2 of the License, or (at your option) any later version.
- // See the Dreamscape documentation for more information.
-
- #ifndef dreamscape_sprite_H
- #define dreamscape_sprite_H
-
- #include "graphic.h"
-
- class SpriteFile: public Graphic {
- static class Initialise: public Graphic::Handler {
- public:
- bool accept(Filetype type);
- Graphic *load_file(const char *filename, Filetype type);
- Graphic *load_data(istream &stream, int size, Filetype type);
- } init;
- friend Initialise;
-
- struct osspriteop_area *data;
- int size;
- void output(ostream &stream) const;
-
- public:
- SpriteFile(const char *filename);
- SpriteFile(istream &stream, int size);
- virtual ~SpriteFile();
-
- int get_data_size() const;
- Filetype get_filetype() const;
- enum { filetype = 0xFF9 };
-
- void redraw(const RedrawInfo &info) const;
-
- WinBBox get_bbox() const;
- WinBBox get_transformed_bbox() const;
- WinBBox get_transformed_bbox(const WinTransform &matrix) const;
-
- // Graphic-specific methods
- osspriteop_area *get_sprite_data() { return data; }
- const osspriteop_area *get_sprite_data() const { return data; }
- };
-
- #endif
-