2015-02-02 08:11:03 +05:30
|
|
|
//
|
|
|
|
// Author: Michael Cameron
|
|
|
|
// Email: chronokun@hotmail.com
|
|
|
|
//
|
|
|
|
|
|
|
|
// Libraries Include
|
|
|
|
#include "libraries.h"
|
|
|
|
// Local Includes
|
|
|
|
#include "mapparser.h"
|
2017-04-07 20:49:51 +05:30
|
|
|
#include "planes.h"
|
2015-02-02 08:11:03 +05:30
|
|
|
|
|
|
|
int main(const int _kiArgC, const char** _kppcArgv)
|
|
|
|
{
|
|
|
|
// Check we have correct number of parameters
|
|
|
|
if(_kiArgC < 3)
|
|
|
|
{
|
|
|
|
return(3);
|
|
|
|
}
|
|
|
|
|
|
|
|
CMapParser Parser;
|
|
|
|
|
|
|
|
const bool kbSuccess = Parser.LoadMap(_kppcArgv[1]);
|
|
|
|
if(!kbSuccess)
|
|
|
|
{
|
|
|
|
return(1);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// Open output file
|
|
|
|
std::ofstream OutFile;
|
|
|
|
OutFile.open(_kppcArgv[2]);
|
|
|
|
if(!OutFile.is_open())
|
|
|
|
{
|
|
|
|
return(2);
|
|
|
|
}
|
|
|
|
|
|
|
|
OutFile << "{" << std::endl
|
|
|
|
<< "\"classname\" \"worldspawn\"" << std::endl;
|
|
|
|
|
|
|
|
for(const TBrush& krBrush : Parser.m_WorldSpawn.m_Brushes)
|
|
|
|
{
|
|
|
|
OutFile << GetBrushString(krBrush);
|
|
|
|
}
|
|
|
|
|
|
|
|
OutFile << "}" << std::endl;
|
|
|
|
}
|
|
|
|
|
|
|
|
return(0);
|
2017-04-02 19:34:09 +05:30
|
|
|
}
|