/*
	Combat Team II (GCC 2.0 version 0.80á)
	made by Ismo Horppu on 1996 - 1997
*/

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

#include "types.h"
#include "ct2init.h"
#include "ct2main.h"

int main (void)
{
	int stat;

	stat = InitCT2 ();

	if (stat == 1){
		stat = CloseGame ();
		CustomFree ();
		return 0;
	}
	
	else if (stat != 0){
		CustomFree ();
		
		textcolor (YELLOW);
		cprintf ("Combat Team 2 - version 0.80á: ERROR\n\r");
	
		if (stat != -255){
			textcolor (LIGHTRED);
			cprintf ("Initialization failed with errorcode %d\n\r", stat);
		}

		else{
			textcolor (WHITE);
			cprintf ("You didn't agree with start warning message\n\r(are you chicken ?, hopefully not)\n\r");
		}

		return stat;
	}

	while (1){
		stat = StartMenu ();
		if (stat != 0) break;
	}
	
	// new game or exit code here !!!
	if (stat == 1){
		stat = CloseGame ();
	}
	
	CustomFree ();
	return 0;
}