00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef SHAPE_H
00019 #define SHAPE_H
00020
00021 #include <stdio.h>
00022 #include <stdlib.h>
00023 #include <string.h>
00024 #include "constants.h"
00025
00026 class Shape {
00027
00028 private:
00029 Uint8 index;
00030 char *name;
00031 int descriptionGroup;
00032 bool stencil;
00033
00034 protected:
00035 int width, height, depth;
00036
00037 public:
00038 Shape(int width, int depth, int height, char *name, int descriptionGroup);
00039 Shape(Shape *shape);
00040 virtual ~Shape();
00041
00045 virtual inline void intialize() { }
00046
00050 inline int getWidth() { return width; }
00054 inline int getDepth() { return depth; }
00058 inline int getHeight() { return height; }
00059
00060 inline char *getName() { return name; }
00061 inline int getDescriptionGroup() { return descriptionGroup; }
00062
00063 virtual void draw() = 0;
00064 virtual void outline( const Color *color ) { outline( color->r, color->g, color->b ); };
00065 virtual void outline( float r, float g, float b ) {};
00066 virtual void setupToDraw() = 0;
00067
00068 inline void setIndex(Uint8 index) { this->index = index; }
00069
00070 inline Uint8 getIndex() { return index; }
00071
00075 virtual bool drawFirst() = 0;
00076
00077 virtual bool drawLater() = 0;
00078 virtual void setupBlending() = 0;
00079 virtual void endBlending() = 0;
00080
00081
00082 inline void setStencil(bool b) { stencil = b; }
00083 inline bool isStencil() { return stencil; }
00084
00085
00086 };
00087
00088 #endif