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
|
|
|
|
2017-04-11 02:59:47 +05:30
|
|
|
using namespace std;
|
|
|
|
// .map files for GTKRadiant
|
|
|
|
bool brushdef_legacy(const TWorldSpawn &x, const char *fn) {
|
|
|
|
cout << fn << endl;
|
|
|
|
ofstream OutFile;
|
|
|
|
OutFile.open(fn);
|
|
|
|
if(!OutFile.is_open())
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
OutFile << "{" << std::endl
|
|
|
|
<< "\"classname\" \"worldspawn\"" << std::endl;
|
|
|
|
|
|
|
|
for(const TBrush& krBrush : x.m_Brushes)
|
|
|
|
{
|
|
|
|
OutFile << GetBrushString(krBrush);
|
|
|
|
}
|
|
|
|
|
|
|
|
OutFile << "}" << std::endl;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
// .map files for NetRadiant
|
|
|
|
void brushdef(const TWorldSpawn &x, const char *fn) {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
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
|
|
|
|
{
|
2017-04-11 02:59:47 +05:30
|
|
|
if (brushdef_legacy(Parser.m_WorldSpawn,_kppcArgv[2])) {
|
|
|
|
cout << "Successfully exported map." << endl;
|
|
|
|
} else {
|
|
|
|
cout << "Failed to write output file." << endl;
|
|
|
|
}
|
2015-02-02 08:11:03 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
return(0);
|
2017-04-02 19:34:09 +05:30
|
|
|
}
|