#include <allegro.h>

#ifndef CObject_def

#define CObject_def
/*typedef struct
    {
    BITMAP **/
#include "CAnim.h"

#define SCC_NONE        -1
#define SCC_LEFT_HALF   1
#define SCC_RIGHT_HALF  2

#define DEBUG   0

class CObject
{
protected:
    float angle;
    //int value;

public:
    float x,y,dx,dy;

    int dir;
    CAnim anim;
    
    BITMAP *pic;
    BITMAP *curpic;
   
    int exist;
    void init_blank(void);
    void init(BITMAP *_pic, float _x=0, float _y=0,int _iSpecialCollisionCondition=SCC_NONE);
    void draw(BITMAP *backgr, float s_x, float s_y, int rotate);
    BITMAP* retPic(void) {return pic;}
    void setPic(BITMAP *_pic);
   
    bool check_col(CObject *ob2);
    bool checkColAtPixel(CObject *ob2,int px, int py);

    float retX(void) {return x;}
    float retY(void) {return y;}

    CObject operator=(CObject &op2);
    CObject(void) {init_blank();}
    CObject(BITMAP *_pic, float _x, float _y);
    ~CObject(void);
    
    int iWidth,iHeight;
    int iSpecialCollisionCondition;
};



#endif

