/******************************************************************************
*******************************************************************************

	Space Impakto DS
	relminator
	http://rel.betterwebber.com


	Cobject class


*******************************************************************************
******************************************************************************/


#include <nds.h>

#include "Caabb.h"
	
#ifndef Cobject__H
#define Cobject__H


/*	Base class for our game objects
	Probable derived classes:
		viper
		enemies
		bosses
		bullets
		shots
		homings
*/

enum E_DRAW_MODE
{
	E_NORMAL = 0,
	E_COLOR,
	E_FLICKER
};


class Cobject
{
	public:
	Cobject();
	~Cobject();
	void init(u32 _width, u32 _height, u32 _numframes);
	inline void resolve_aabb();	
	inline void resolve_aabb_f32();	
	
	int				active;
	s32 			x;
	s32 			y;
	s32 			dx;
	s32 			dy;
	int				width;
	int				height;	
	int				frame;
	int				num_frames;
	int				start_frame;
	int				anim_counter;
	int				anim_delay;
	E_DRAW_MODE		draw_mode;			// hit or not
	Caabb			box;				// collision
};

inline void Cobject::resolve_aabb()
{
	box.init(x, y, width, height);
}

inline void Cobject::resolve_aabb_f32()
{
	box.init(x >> 12, y >> 12, width, height);
}



#endif // Cobject