Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#ifndef TLEVEL_INCLUDED
Toshihiro Shimizu 890ddd
#define TLEVEL_INCLUDED
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#include "timage.h"
Toshihiro Shimizu 890ddd
#include "tfilepath.h"
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#undef DVAPI
Toshihiro Shimizu 890ddd
#undef DVVAR
Toshihiro Shimizu 890ddd
#ifdef TIMAGE_EXPORTS
Toshihiro Shimizu 890ddd
#define DVAPI DV_EXPORT_API
Toshihiro Shimizu 890ddd
#define DVVAR DV_EXPORT_VAR
Toshihiro Shimizu 890ddd
#else
Toshihiro Shimizu 890ddd
#define DVAPI DV_IMPORT_API
Toshihiro Shimizu 890ddd
#define DVVAR DV_IMPORT_VAR
Toshihiro Shimizu 890ddd
#endif
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class DVAPI TLevel : public TSmartObject
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	DECLARE_CLASS_CODE
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	typedef std::map<const tframeid,="" timagep=""> Table;</const>
Toshihiro Shimizu 890ddd
	typedef Table::iterator Iterator;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
private:
Shinya Kitaoka 3bfa54
	std::string m_name;
Toshihiro Shimizu 890ddd
	Table *m_table;
Toshihiro Shimizu 890ddd
	TPalette *m_palette;
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	TLevel();
Toshihiro Shimizu 890ddd
	~TLevel();
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
private:
Toshihiro Shimizu 890ddd
	// not implemented
Toshihiro Shimizu 890ddd
	TLevel(const TLevel &);
Toshihiro Shimizu 890ddd
	TLevel &operator=(const TLevel &);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	// nome
Shinya Kitaoka 3bfa54
	std::string getName() const;
Shinya Kitaoka 3bfa54
	void setName(std::string name);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	// frames
Toshihiro Shimizu 890ddd
	int getFrameCount() const { return (int)m_table->size(); };
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	const TImageP &frame(const TFrameId fid);
Toshihiro Shimizu 890ddd
	const TImageP &frame(int f) { return frame(TFrameId(f)); };
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	void setFrame(const TFrameId &fid, const TImageP &img);
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	// ritorna la posizione (0..getNFrames()-1) del frame f
Toshihiro Shimizu 890ddd
	// se il frame f non c'e' ritorna -1
Toshihiro Shimizu 890ddd
	//int getIndex(const TFrameId fid);
Toshihiro Shimizu 890ddd
	//int getIndex(int f) {return getIndex(TFrameId(f));};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	Iterator begin() { return m_table->begin(); };
Toshihiro Shimizu 890ddd
	Iterator end() { return m_table->end(); };
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	// uh - oh; serve a tinytoonz/filmstrip.
Toshihiro Shimizu 890ddd
	// PROVVISORIO !!
Toshihiro Shimizu 890ddd
	Table *getTable() { return m_table; }
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
	TPalette *getPalette();
Toshihiro Shimizu 890ddd
	void setPalette(TPalette *);
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Shinya Kitaoka 9f5a1b
#ifdef _WIN32
Toshihiro Shimizu 890ddd
template class DVAPI TSmartPointerT<tlevel>;</tlevel>
Toshihiro Shimizu 890ddd
#endif
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
class DVAPI TLevelP : public TSmartPointerT<tlevel></tlevel>
Toshihiro Shimizu 890ddd
{
Toshihiro Shimizu 890ddd
public:
Toshihiro Shimizu 890ddd
	TLevelP() : TSmartPointerT<tlevel>(new TLevel) {}</tlevel>
Toshihiro Shimizu 890ddd
	TLevelP(TLevel *level) : TSmartPointerT<tlevel>(level) {}</tlevel>
Toshihiro Shimizu 890ddd
};
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
//-------------------------------------------------------------------
Toshihiro Shimizu 890ddd
Toshihiro Shimizu 890ddd
#endif