/************************************************************************
* main.c
* voxelands - 3d voxel world sandbox game
* Copyright (C) Lisa 'darkrose' Milne 2016 <lisa@ltmnet.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program.  If not, see <http://www.gnu.org/licenses/>
************************************************************************/

#include "common.h"
#include "path.h"
#include "net.h"
#include "content.h"

int main(int argc, char** argv)
{

	path_init();
	config_init(argc,argv);
	intl_init();
	sys_console_init();
	net_init();
	content_init();

	vlprintf("hello world");

	content_exit();
	config_save();
	path_exit();

	return 0;
}

#ifdef WIN32
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
	LPWSTR *args;
	char** argv;
	int argc = 0;

	args = CommandLineToArgvW(GetCommandLineW(), &argc);
	if (args) {
		argv = (char**)args;
	}else{
		argv = malloc(sizeof(char*));
		argv[0] = NULL;
	}
	return main(argc,argv);
}
#endif
