source: abuse/trunk/src/imlib/visobj.h @ 579

Last change on this file since 579 was 579, checked in by Sam Hocevar, 8 years ago

imlib: refactor the Filter and ColorFilter? classes.

  • Property svn:keywords set to Id
File size: 1.1 KB
Line 
1/*
2 *  Abuse - dark 2D side-scrolling platform game
3 *  Copyright (c) 1995 Crack dot Com
4 *  Copyright (c) 2005-2011 Sam Hocevar <sam@hocevar.net>
5 *
6 *  This software was released into the Public Domain. As with most public
7 *  domain software, no warranty is made or implied by Crack dot Com, by
8 *  Jonathan Clark, or by Sam Hocevar.
9 */
10
11#ifndef VIS_OBJECT_HPP
12#define VIS_OBJECT_HPP
13
14#include "jwindow.h"
15#include "filter.h"
16
17class visual_object
18{
19  public :
20  virtual void draw(image *screen, int x, int y, Filter *f) = 0;
21  virtual int width() = 0;
22  virtual int height() = 0;
23  virtual ~visual_object() { }
24} ;
25
26
27
28class image_visual : public visual_object
29{
30  public :
31  image *im;
32
33  image_visual(image *img) { im=img; }
34  virtual void draw(image *screen, int x, int y, Filter *f);
35  virtual int width() { return im->Size().x; }
36  virtual int height() { return im->Size().y; }
37} ;
38
39
40class string_visual : public visual_object
41{
42  char *st;
43  int color;
44  int w,h;
45  public :
46  string_visual(char *string, int Color);
47  virtual void draw(image *screen, int x, int y, Filter *f);
48  virtual int width();
49  virtual int height();
50} ;
51
52
53#endif
Note: See TracBrowser for help on using the repository browser.