// Liquid3D - Moteur 3D C++ NDS par Morukutsu
// Surcouche de l'ulibrary de Brunni
// Version alpha 1

#include <ulib/ulib.h>
#include "Actors/MD2.h"
#include <map>
#include <string>

#ifndef _H_L3DRESSOURCEMANAGER
#define _H_L3DRESSOURCEMANAGER

extern char pngbuffer[16*1024];

namespace L3D
{
	using namespace std;
    typedef map<string, UL_IMAGE*> ImageList;
    typedef map<string, MD2Entity*> ModelList;
	// - - - - - - - - -
	// Classe CRessourceManager - gère les ressources chargées en mémoire
	// - - - - - - - - - 
	class CRessourceManager
	{
	public:
		//Constructeur/Destructeur
        CRessourceManager(); 
        ~CRessourceManager();
		
		//Fonctions de chargement/Libération de ressources
        UL_IMAGE* LoadImage(string filename, int location, int pixelFormat);
        MD2Entity* LoadModel(string filename, int widthheight, float scale); 
		MD2Entity* LoadModelBin(string filename, int widthheight, float scale);
        void DeleteImage(UL_IMAGE* img);   
        void DeleteModel(MD2Entity* model);
        void Free();

        unsigned int GetImageCount();              
        unsigned int GetModelCount(); 

        //Variables
    private:
        ImageList imgList;                            //std::map d'images
        ModelList modList;                            //std::map de modèles
        unsigned int img_num;                         //Nombre d'images en mémoire
        unsigned int mod_num;
    };
};

#endif