#include "ta_oops.h"

/////////////////////////////////////////
// CLASS STATIC ATTRIBUTES //////////////
/////////////////////////////////////////

char ta_oops::an_oops[4096] = "";
bool ta_oops::have_oops = false;

/////////////////////////////////////////
// CLASS IMPLEMENTATION /////////////////
/////////////////////////////////////////

void ta_oops::clear_ta_oops(void)
{
	// set to all blanks
	memset(ta_oops::an_oops,0,4096);
	ta_oops::have_oops = false;
}

void ta_oops::set_ta_oops(const char* fmt, ...)
{
	// create the oops
	// handle the input
	va_list args;

	// create our own string
	va_start(args,fmt);
	vsnprintf(ta_oops::an_oops, 4096, fmt, args);
	va_end(args);

	// set the flag
	ta_oops::have_oops = true;
}

void ta_oops::show_ta_oops()
{
	agk::Print(ta_oops::an_oops);
}
