//
// Crimsonland mod SDK v0.8
// 2003 (c) 10tons entertainment
// 

//
//  An example mod that can be used as a framework
//  for custom mods.
//

#include <windows.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>

/* Selects the correct dll access */
#define CMOD_API		__declspec(dllexport)

#include "ClMod.h"


#include <stdlib.h>
#include <math.h>

modExport_t*	clMod = 0;
clAPI_t*		cl = 0;				// for shorter lines :)


struct nullMod : modExport_t
{

	virtual bool		Init ()
	{
		::cl = this->cl;

		parms.drawMouseCursor = true;		// tell Crimsonland we want to use the regular cursor. note that you can turn this on/off any time

		return true;
	}

	virtual void		Shutdown ()
	{
		delete this;
	}

	virtual bool		Frame (int msecs)
	{
		cl->GFX_Clear (0,0,0,0);

		if (cl->INP_KeyDown (DIK_F1))
			cl->CL_EnterMenu ("game_pause");		// enter options menu

		if (cl->INP_KeyDown (DIK_F2))				// quit MOD
			return false;

		return true;
	}
};



/* Entry points to the interface */
extern "C" 
{
	CMOD_API modExport_t*	CMOD_GetMod ();
	CMOD_API modInfo_t*		CMOD_GetInfo ();
} 


modExport_t* CMOD_GetMod ()
{
	clMod = new nullMod (); 
	return clMod;
}


modInfo_t* CMOD_GetInfo ()
{
	static modInfo_t	info;

	strcpy (info.name, "Null Example Mod");
	strcpy (info.author, "temper / 10tons");
	info.version = 1.0f;

	return &info;
}


BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
	if (fdwReason == DLL_PROCESS_ATTACH)
	{
	}
	return true;
}