/** SGX

The   sss    gggg x   x   
     s      g      x x    Engine
      sss   g  gg   x
         s  g   g  x x          Copyright 1995-2009.
     ssss    gggg x   x         Steven Goodwin. All Rights Reserved.
    
This version has been released under the GNU Public License v2.0.

Please see the license files for details.

File: sgx/src/utils/imagelib/imageparser.cpp

*/

#include "sgx/core/core.hpp"
#include "sgx/filesystem/filesystem.hpp"
#include "domains/graphics/surface/surface.hpp"
#include "utils/imagelib/imagelib.hpp"

/*
All image parsers must follow the pattern dictated by this
class.

See the bitmap code for a real-world example.
*/
CImageParser *CImageParser::m_pSingleton = NULL;

// This is the basic creation routine that must always be called in 
// order to registerObject the parser with the load routine.
void
CImageParser::initialize()
{
	if (!m_pSingleton) {
		m_pSingleton = new CImageParser;
		if (m_pSingleton) {
			CImageLoader::get()->registerObject(m_pSingleton);
		}
	}
}

// This should either parser the file contents, or the file name
// and pass TRUE if it is capable of loading this file.
// It is preferred that the file contents are read.
// The file pointer will be corrected by the CImageLoader class.
tBOOL CImageParser::isRecognised(CSGXFile &file) const
{
	SGX_UNUSED(file);
	return FALSE;
}

// Load the image data into the members dictated by 'properties'.
// There is a 'pInternal' member for use by the parser, if necessary.
tBOOL CImageParser::open(CSGXFile &file, CImageData &properties) const
{
	SGX_UNUSED(file);
	SGX_UNUSED(properties);
	return FALSE;
}

// Free any resources.
// DO NOT attempt to close the file.
tBOOL CImageParser::close(CImageData &properties) const
{
	SGX_UNUSED(properties);
	return FALSE;
}
