65 lines
1.2 KiB
C++
65 lines
1.2 KiB
C++
//
|
|
// Author: Michael Cameron
|
|
// Email: chronokun@hotmail.com
|
|
//
|
|
|
|
// Libraries Include
|
|
#include "libraries.h"
|
|
// Local Includes
|
|
#include "mapparser.h"
|
|
#include "planes.h"
|
|
|
|
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) {
|
|
|
|
}
|
|
|
|
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
|
|
{
|
|
if (brushdef_legacy(Parser.m_WorldSpawn,_kppcArgv[2])) {
|
|
cout << "Successfully exported map." << endl;
|
|
} else {
|
|
cout << "Failed to write output file." << endl;
|
|
}
|
|
}
|
|
|
|
return(0);
|
|
} |