main.cpp

Go to the documentation of this file.
00001 /*
00002  * main.cpp
00003  *
00004  *  Created on: Nov 20, 2011
00005  *      Author: sushil
00006  */
00007 
00021 //eclipse test comment
00022 
00023 #include <boost/thread.hpp>
00024 #include <boost/date_time.hpp>
00025 
00026 #include <getopt.h>
00027 #include <stdlib.h>
00028 #include <iostream>
00029 
00030 #include <engine.h>
00031 #include <entityMgr.h>
00032 
00033 #include <options.h>
00034 
00035 
00036 using namespace FastEcslent;
00037 
00038 //extern void gfxManager();
00039 
00040 Options makeOptions(int argc, char*argv[]){
00041         Options options;
00042         options.enableNetworking = false;
00043         options.networkPort      = 54321;
00044         options.isServer         = true;
00045 
00046         options.runAsEvaluator = true;
00047         options.instanceId = random();
00048 
00049         options.tacticalAI = true;
00050 
00051         options.enableGfx = true;
00052 
00053         options.runDebugTests = false;
00054 
00055         options.speedup = 10.0;
00056 
00057         options.gameNumber = 1;
00058         return options;
00059 }
00060 
00061 
00062 
00063 int main(int argc, char *argv[]){
00064 
00065         srandom(time(NULL));
00066         Options options = makeOptions(argc, argv);
00067 
00068         Engine *engine = new Engine(random(), options);
00069         engine->showMenu();
00070         engine->constructManagers();
00071         engine->init();
00072 
00073         engine->loadLevel();
00074         engine->run();
00075         engine->releaseLevel();
00076 
00077         engine->stop();
00078 
00079         delete engine;
00080 
00081 
00082         return 0;
00083 }
00084 
00085 
00086 /*
00087         NetThread *net;
00088         if(options.enableNetworking){
00089                 net = new NetThread(engine);
00090                 net->init();
00091                 net->start();
00092         }
00093 
00094         GfxThread *gfx;
00095         if(options.enableGfx){
00096                 gfx = new GfxThread(engine);
00097                 gfx->init();
00098                 gfx->start();
00099         }
00100         sleep(2.0); //wait for graphics thread to get going, start gets the thread running
00101 
00102 
00103 
00104         while (!engine->quit) {
00105                 engine->loadLevel();
00106                 engine->run();
00107         }
00108 
00109         if (options.enableNetworking){
00110                 net->join();
00111         }
00112 
00113         if (options.enableGfx) {
00114                 //gfx->stop();
00115                 gfx->join();
00116 
00117         }
00118 
00119 */
00120 

Generated on Fri Dec 13 14:54:18 2013 for FastECSLent by  doxygen 1.5.4