/** SGX

The   sss    gggg x   x   
     s      g      x x    Engine
      sss   g  gg   x
         s  g   g  x x          Copyright 1995-2008.
     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: src/sgx/graphics/overlays.cpp

*/

#include "sgx/core/core.hpp"
#include "sgx/graphics/graphics.hpp"

void 
CSGXGraphicsEngine::drawLine2D(const tINT32 fromX, const tINT32 fromY, const tINT32 toX, const tINT32 toY) {
	m_RenderMode.Apply(SGX_RENDERMODE_2D);
	SGX_UNUSED(fromX);
	SGX_UNUSED(fromY);
	SGX_UNUSED(toX);
	SGX_UNUSED(toY);
}

void 
CSGXGraphicsEngine::drawLine2D(const sgxPoint2i &from, const sgxPoint2i &to) {
	m_RenderMode.Apply(SGX_RENDERMODE_2D);
	SGX_UNUSED(from);
	SGX_UNUSED(to);
}

void 
CSGXGraphicsEngine::drawRect2D(const sgxPoint2i &from, const sgxPoint2i &to)
{
	m_RenderMode.Apply(SGX_RENDERMODE_2D);
	SGX_UNUSED(from);
	SGX_UNUSED(to);

}

void 
CSGXGraphicsEngine::drawRect2D(const tPOINT x1, const tPOINT y1, const tPOINT x2, const tPOINT y2, const tPOINT x3, const tPOINT y3, const tPOINT x4, const tPOINT y4)
{
	m_RenderMode.Apply(SGX_RENDERMODE_2D);
	SGX_UNUSED(x1);
	SGX_UNUSED(y1);
	SGX_UNUSED(x2);
	SGX_UNUSED(y2);
	SGX_UNUSED(x3);
	SGX_UNUSED(y3);
	SGX_UNUSED(x4);
	SGX_UNUSED(y4);
}

void 
CSGXGraphicsEngine::drawRect2D(const tREAL32 x1, const tREAL32 y1, const tREAL32 x2, const tREAL32 y2, const tREAL32 x3, const tREAL32 y3, const tREAL32 x4, const tREAL32 y4)
{
	m_RenderMode.Apply(SGX_RENDERMODE_2D);
	SGX_UNUSED(x1);
	SGX_UNUSED(y1);
	SGX_UNUSED(x2);
	SGX_UNUSED(y2);
	SGX_UNUSED(x3);
	SGX_UNUSED(y3);
	SGX_UNUSED(x4);
	SGX_UNUSED(y4);
}

void 
CSGXGraphicsEngine::drawPolygon2D(const sgxVector<sgxPoint2i> &ptList) {
	m_RenderMode.Apply(SGX_RENDERMODE_2D);
	SGX_UNUSED(ptList);
}

// TODO: 2D library (need name that doesn't being '2')
void 
CSGXGraphicsEngine::drawRect2D(const sgxPoint2i &center, const tINT32 size)
{
	tINT32 radius = size/2;
	sgxPoint2i from, to;

	from = to = center;
	
	from.x -= radius;
	from.y -= radius;
	to.x = from.x + size;
	to.y = from.y + size;

	drawRect2D(from, to);
}

void 
CSGXGraphicsEngine::drawFont(const char *pString, const tPOINT x, const tPOINT y) 
{
	static CSGXFontFormatting fmt;
	drawFont(pString, x, y, fmt);
}

void 
CSGXGraphicsEngine::drawFont(const char *pString, const tPOINT x, const tPOINT y, const CSGXFontFormatting &formatting) 
{
	const CSGXFont *pCurrent = CSGXFontManager::get()->getCurrentFont();
	if (pCurrent) {
		m_RenderMode.Apply(SGX_RENDERMODE_2D);
		pCurrent->draw(NULL, (const tCHAR *)pString, x, y, formatting);
	}
}

