Add a simple main.cpp to ease the use of unitTest.

This commit is contained in:
joris 2013-04-03 18:24:22 +02:00
parent afe77ef505
commit 3c8cbe8e84
4 changed files with 44 additions and 2 deletions

View file

@ -283,6 +283,7 @@ set(stratagusmain_SRCS
src/stratagus/groups.cpp
src/stratagus/iolib.cpp
src/stratagus/luacallback.cpp
src/stratagus/main.cpp
src/stratagus/mainloop.cpp
src/stratagus/parameters.cpp
src/stratagus/player.cpp

View file

@ -179,7 +179,7 @@ extern const char NameLine[];
#define CYCLES_PER_SECOND 30 // 1/30s 0.33ms
/*----------------------------------------------------------------------------
-- stratagus.c
-- stratagus.cpp
----------------------------------------------------------------------------*/
extern std::string StratagusLibPath; /// Location of stratagus data
@ -194,6 +194,7 @@ extern void ExitFatal(int err); /// Exit with fatal error
extern void UpdateDisplay(); /// Game display update
extern void DrawMapArea(); /// Draw the map area
extern void GameMainLoop(); /// Game main loop
extern int stratagusMain(int argc, char **argv); /// main entry
//@}

40
src/stratagus/main.cpp Normal file
View file

@ -0,0 +1,40 @@
// _________ __ __
// / _____// |_____________ _/ |______ ____ __ __ ______
// \_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/
// / \| | | | \// __ \| | / __ \_/ /_/ > | /\___ |
// /_______ /|__| |__| (____ /__| (____ /\___ /|____//____ >
// \/ \/ \//_____/ \/
// ______________________ ______________________
// T H E W A R B E G I N S
// Stratagus - A free fantasy real time strategy game engine
//
/**@name main.cpp - The main file. */
//
// (c) Copyright 2013 by Joris Dauphin
//
// 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; only version 2 of the License.
//
// 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, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
//
//@{
#include "stratagus.h"
#include "SDL.h"
int main(int argc, char **argv)
{
return stratagusMain(argc, argv);
}
//@}

View file

@ -616,7 +616,7 @@ void ParseCommandLine(int argc, char **argv, Parameters &parameters)
** @param argc Number of arguments.
** @param argv Vector of arguments.
*/
int main(int argc, char **argv)
int stratagusMain(int argc, char **argv)
{
#ifdef REDIRECT_OUTPUT
RedirectOutput();