The GtkRadiant sources as originally released under the GPL license.

This commit is contained in:
Travis Bradshaw
2012-01-31 15:20:35 -06:00
commit 0991a5ce8b
1590 changed files with 431941 additions and 0 deletions

7
plugins/mapq3/mapq3.def Normal file
View File

@@ -0,0 +1,7 @@
; mapq3.def : Declares the module parameters for the DLL.
LIBRARY "MAPQ3"
EXPORTS
; Explicit exports can go here
Radiant_RegisterModules @1

166
plugins/mapq3/mapq3.dsp Normal file
View File

@@ -0,0 +1,166 @@
# Microsoft Developer Studio Project File - Name="mapq3" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
CFG=mapq3 - Win32 Release
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "mapq3.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "mapq3.mak" CFG="mapq3 - Win32 Release"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "mapq3 - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE "mapq3 - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName "mapq3"
# PROP Scc_LocalPath "..\.."
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "mapq3 - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
F90=df.exe
# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MAP_EXPORTS" /YX /FD /c
# ADD CPP /nologo /MD /W3 /O2 /I "..\..\include" /I "..\..\..\gtk2-win32\include\glib-2.0" /I "..\..\..\gtk2-win32\lib\glib-2.0\include" /I "..\common" /I "..\..\libs" /I "..\..\..\STLPort\stlport" /I "..\..\..\libxml2\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MAP_EXPORTS" /YX /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x40c /d "NDEBUG"
# ADD RSC /l 0x40c /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
# ADD LINK32 cmdlib.lib glib-2.0.lib /nologo /dll /machine:I386 /def:".\mapq3.def" /libpath:"../../libs/cmdlib/release" /libpath:"..\..\..\gtk2-win32\lib\\"
# SUBTRACT LINK32 /pdb:none
# Begin Special Build Tool
SOURCE="$(InputPath)"
PostBuild_Desc=Copy to dir...
PostBuild_Cmds=copy Release\mapq3.dll "../../install/modules"
# End Special Build Tool
!ELSEIF "$(CFG)" == "mapq3 - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
F90=df.exe
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MAP_EXPORTS" /YX /FD /GZ /c
# ADD CPP /nologo /MDd /W3 /Gm /ZI /Od /I "..\..\include" /I "..\..\..\gtk2-win32\include\glib-2.0" /I "..\..\..\gtk2-win32\lib\glib-2.0\include" /I "..\common" /I "..\..\libs" /I "..\..\..\STLPort\stlport" /I "..\..\..\libxml2\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "MAP_EXPORTS" /FR /YX /FD /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x40c /d "_DEBUG"
# ADD RSC /l 0x40c /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
# ADD LINK32 cmdlib.lib glib-2.0.lib /nologo /dll /debug /machine:I386 /def:".\mapq3.def" /pdbtype:sept /libpath:"../../libs/cmdlib/debug" /libpath:"..\..\..\gtk2-win32\lib\\"
# SUBTRACT LINK32 /pdb:none
# Begin Special Build Tool
SOURCE="$(InputPath)"
PostBuild_Desc=Copy to dir...
PostBuild_Cmds=copy Debug\mapq3.dll "../../install/modules"
# End Special Build Tool
!ENDIF
# Begin Target
# Name "mapq3 - Win32 Release"
# Name "mapq3 - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\mapq3.def
# PROP Exclude_From_Build 1
# End Source File
# Begin Source File
SOURCE=.\parse.cpp
# End Source File
# Begin Source File
SOURCE=.\plugin.cpp
# End Source File
# Begin Source File
SOURCE=.\write.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Group "API"
# PROP Default_Filter "*.h"
# Begin Source File
SOURCE=..\..\include\ifilesystem.h
# End Source File
# Begin Source File
SOURCE=..\..\include\ipatch.h
# End Source File
# Begin Source File
SOURCE=..\..\include\iscriplib.h
# End Source File
# Begin Source File
SOURCE=..\..\include\qerplugin.h
# End Source File
# Begin Source File
SOURCE=..\..\include\qertypes.h
# End Source File
# End Group
# Begin Source File
SOURCE=.\plugin.h
# End Source File
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# Begin Source File
SOURCE=.\Conscript
# End Source File
# End Target
# End Project

211
plugins/mapq3/mapq3.vcproj Normal file
View File

@@ -0,0 +1,211 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="mapq3"
ProjectGUID="{D6130A5F-12DC-487B-BB9E-4BFDA60FBADF}"
Keyword="Win32Proj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="Debug"
IntermediateDirectory="Debug"
ConfigurationType="2"
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../../include;../../libs;&quot;../../../STLPort-4.6/stlport&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;MAPQ3_EXPORTS"
StringPooling="TRUE"
MinimalRebuild="TRUE"
ExceptionHandling="FALSE"
BasicRuntimeChecks="0"
RuntimeLibrary="3"
BufferSecurityCheck="FALSE"
ForceConformanceInForLoopScope="TRUE"
UsePrecompiledHeader="0"
BrowseInformation="0"
WarningLevel="3"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="3"
DisableSpecificWarnings="4610;4510;4512;4505;4100;4127"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/mapq3.dll"
LinkIncremental="1"
IgnoreDefaultLibraryNames="msvcprtd.lib"
ModuleDefinitionFile="$(ProjectName).def"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile="$(OutDir)/mapq3.pdb"
SubSystem="2"
ImportLibrary="$(OutDir)/mapq3.lib"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"
CommandLine="copy &quot;$(TargetPath)&quot; &quot;$(SolutionDir)install\modules&quot;
copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modules&quot;"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="Release"
IntermediateDirectory="Release"
ConfigurationType="2"
CharacterSet="2"
WholeProgramOptimization="TRUE">
<Tool
Name="VCCLCompilerTool"
GlobalOptimizations="TRUE"
InlineFunctionExpansion="2"
EnableIntrinsicFunctions="TRUE"
FavorSizeOrSpeed="1"
OptimizeForWindowsApplication="FALSE"
AdditionalIncludeDirectories="../../include;../../libs;&quot;../../../STLPort-4.6/stlport&quot;"
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;MAPQ3_EXPORTS"
StringPooling="TRUE"
ExceptionHandling="FALSE"
RuntimeLibrary="2"
BufferSecurityCheck="FALSE"
ForceConformanceInForLoopScope="TRUE"
UsePrecompiledHeader="0"
WarningLevel="4"
Detect64BitPortabilityProblems="TRUE"
DebugInformationFormat="3"
DisableSpecificWarnings="4610;4510;4512;4505;4100;4127"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
OutputFile="$(OutDir)/mapq3.dll"
LinkIncremental="1"
IgnoreDefaultLibraryNames="msvcprt.lib"
ModuleDefinitionFile="$(ProjectName).def"
GenerateDebugInformation="TRUE"
SubSystem="2"
OptimizeReferences="2"
EnableCOMDATFolding="2"
ImportLibrary="$(OutDir)/mapq3.lib"
TargetMachine="1"
FixedBaseAddress="0"/>
<Tool
Name="VCMIDLTool"/>
<Tool
Name="VCPostBuildEventTool"
CommandLine="copy &quot;$(TargetPath)&quot; &quot;$(SolutionDir)install\modules&quot;
copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modules&quot;"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="src"
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
<File
RelativePath=".\plugin.cpp">
</File>
<File
RelativePath=".\plugin.h">
</File>
<Filter
Name="modules"
Filter="">
<File
RelativePath=".\parse.cpp">
</File>
<File
RelativePath=".\parse.h">
</File>
<File
RelativePath=".\write.cpp">
</File>
<File
RelativePath=".\write.h">
</File>
</Filter>
</Filter>
<File
RelativePath="..\..\debug.py">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCustomBuildTool"
CommandLine="python &quot;$(SolutionDir)debug.py&quot;"
AdditionalDependencies="&quot;$(SolutionDir)install\modules\$(TargetName).pdb&quot;"
Outputs="&quot;$(TargetDir)$(TargetName).pdb&quot;"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCustomBuildTool"
CommandLine="python &quot;$(SolutionDir)debug.py&quot;"
AdditionalDependencies="&quot;$(SolutionDir)install\modules\$(TargetName).pdb&quot;"
Outputs="&quot;$(TargetDir)$(TargetName).pdb&quot;"/>
</FileConfiguration>
</File>
<File
RelativePath=".\mapq3.def">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCustomBuildTool"
CommandLine="python &quot;$(SolutionDir)touch.py&quot; &quot;$(TargetPath)&quot;
"
AdditionalDependencies="&quot;$(SolutionDir)install\modules\$(TargetFileName)&quot;"
Outputs="&quot;$(TargetPath)&quot;"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCustomBuildTool"
CommandLine="python &quot;$(SolutionDir)touch.py&quot; &quot;$(TargetPath)&quot;
"
AdditionalDependencies="&quot;$(SolutionDir)install\modules\$(TargetFileName)&quot;"
Outputs="&quot;$(TargetPath)&quot;"/>
</FileConfiguration>
</File>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

151
plugins/mapq3/parse.cpp Normal file
View File

@@ -0,0 +1,151 @@
/*
Copyright (C) 2001-2006, William Joseph.
All Rights Reserved.
This file is part of GtkRadiant.
GtkRadiant 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; either version 2 of the License, or
(at your option) any later version.
GtkRadiant 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 GtkRadiant; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "parse.h"
#include <list>
#include "ientity.h"
#include "ibrush.h"
#include "ipatch.h"
#include "ieclass.h"
#include "iscriplib.h"
#include "scenelib.h"
#include "string/string.h"
#include "stringio.h"
#include "eclasslib.h"
inline MapImporter* Node_getMapImporter(scene::Node& node)
{
return NodeTypeCast<MapImporter>::cast(node);
}
typedef std::list< std::pair<CopiedString, CopiedString> > KeyValues;
NodeSmartReference g_nullNode(NewNullNode());
NodeSmartReference Entity_create(EntityCreator& entityTable, EntityClass* entityClass, const KeyValues& keyValues)
{
scene::Node& entity(entityTable.createEntity(entityClass));
for(KeyValues::const_iterator i = keyValues.begin(); i != keyValues.end(); ++i)
{
Node_getEntity(entity)->setKeyValue((*i).first.c_str(), (*i).second.c_str());
}
return NodeSmartReference(entity);
}
NodeSmartReference Entity_parseTokens(Tokeniser& tokeniser, EntityCreator& entityTable, const PrimitiveParser& parser, int index)
{
NodeSmartReference entity(g_nullNode);
KeyValues keyValues;
const char* classname = "";
int count_primitives = 0;
while(1)
{
tokeniser.nextLine();
const char* token = tokeniser.getToken();
if(token == 0)
{
Tokeniser_unexpectedError(tokeniser, token, "#entity-token");
return g_nullNode;
}
if (!strcmp(token, "}")) // end entity
{
if(entity == g_nullNode)
{
// entity does not have brushes
entity = Entity_create(entityTable, GlobalEntityClassManager().findOrInsert(classname, false), keyValues);
}
return entity;
}
else if(!strcmp(token, "{")) // begin primitive
{
if(entity == g_nullNode)
{
// entity has brushes
entity = Entity_create(entityTable, GlobalEntityClassManager().findOrInsert(classname, true), keyValues);
}
tokeniser.nextLine();
NodeSmartReference primitive(parser.parsePrimitive(tokeniser));
if(primitive == g_nullNode || !Node_getMapImporter(primitive)->importTokens(tokeniser))
{
globalErrorStream() << "brush " << count_primitives << ": parse error\n";
return g_nullNode;
}
scene::Traversable* traversable = Node_getTraversable(entity);
if(Node_getEntity(entity)->isContainer() && traversable != 0)
{
traversable->insert(primitive);
}
else
{
globalErrorStream() << "entity " << index << ": type " << classname << ": discarding brush " << count_primitives << "\n";
}
++count_primitives;
}
else // epair
{
CopiedString key(token);
token = tokeniser.getToken();
if(token == 0)
{
Tokeniser_unexpectedError(tokeniser, token, "#epair-value");
return g_nullNode;
}
keyValues.push_back(KeyValues::value_type(key, token));
if(string_equal(key.c_str(), "classname"))
{
classname = keyValues.back().second.c_str();
}
}
}
// unreachable code
return g_nullNode;
}
void Map_Read(scene::Node& root, Tokeniser& tokeniser, EntityCreator& entityTable, const PrimitiveParser& parser)
{
int count_entities = 0;
for(;;)
{
tokeniser.nextLine();
if (!tokeniser.getToken()) // { or 0
break;
NodeSmartReference entity(Entity_parseTokens(tokeniser, entityTable, parser, count_entities));
if(entity == g_nullNode)
{
globalErrorStream() << "entity " << count_entities << ": parse error\n";
return;
}
Node_getTraversable(root)->insert(entity);
++count_entities;
}
}

48
plugins/mapq3/parse.h Normal file
View File

@@ -0,0 +1,48 @@
/*
Copyright (C) 2001-2006, William Joseph.
All Rights Reserved.
This file is part of GtkRadiant.
GtkRadiant 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; either version 2 of the License, or
(at your option) any later version.
GtkRadiant 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 GtkRadiant; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#if !defined(INCLUDED_PARSE_H)
#define INCLUDED_PARSE_H
#include "imap.h"
class BrushCreator;
class PatchCreator;
class PrimitiveParser
{
public:
virtual scene::Node& parsePrimitive(Tokeniser& tokeniser) const = 0;
};
void Map_Read(scene::Node& root, Tokeniser& tokeniser, EntityCreator& entityTable, const PrimitiveParser& parser);
namespace scene
{
class Node;
}
#include "generic/referencecounted.h"
typedef SmartReference<scene::Node, IncRefDecRefCounter<scene::Node> > NodeSmartReference;
extern NodeSmartReference g_nullNode;
#endif

661
plugins/mapq3/plugin.cpp Normal file
View File

@@ -0,0 +1,661 @@
/*
Copyright (C) 2001-2006, William Joseph.
All Rights Reserved.
This file is part of GtkRadiant.
GtkRadiant 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; either version 2 of the License, or
(at your option) any later version.
GtkRadiant 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 GtkRadiant; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "plugin.h"
#include "iscriplib.h"
#include "ibrush.h"
#include "ipatch.h"
#include "ifiletypes.h"
#include "ieclass.h"
#include "qerplugin.h"
#include "scenelib.h"
#include "string/string.h"
#include "stringio.h"
#include "generic/constant.h"
#include "modulesystem/singletonmodule.h"
#include "parse.h"
#include "write.h"
class MapDoom3Dependencies :
public GlobalRadiantModuleRef,
public GlobalFiletypesModuleRef,
public GlobalScripLibModuleRef,
public GlobalEntityClassManagerModuleRef,
public GlobalSceneGraphModuleRef,
public GlobalBrushModuleRef
{
PatchModuleRef m_patchDef2Doom3Module;
PatchModuleRef m_patchDoom3Module;
public:
MapDoom3Dependencies() :
GlobalEntityClassManagerModuleRef(GlobalRadiant().getRequiredGameDescriptionKeyValue("entityclass")),
GlobalBrushModuleRef(GlobalRadiant().getRequiredGameDescriptionKeyValue("brushtypes")),
m_patchDef2Doom3Module("def2doom3"),
m_patchDoom3Module("doom3")
{
}
BrushCreator& getBrushDoom3()
{
return GlobalBrushModule::getTable();
}
PatchCreator& getPatchDoom3()
{
return *m_patchDoom3Module.getTable();
}
PatchCreator& getPatchDef2Doom3()
{
return *m_patchDef2Doom3Module.getTable();
}
};
class MapDoom3API : public TypeSystemRef, public MapFormat, public PrimitiveParser
{
MapDoom3Dependencies& m_dependencies;
public:
typedef MapFormat Type;
STRING_CONSTANT(Name, "mapdoom3");
INTEGER_CONSTANT(MapVersion, 2);
MapDoom3API(MapDoom3Dependencies& dependencies) : m_dependencies(dependencies)
{
GlobalFiletypesModule::getTable().addType(Type::Name(), Name(), filetype_t("doom3 maps", "*.map"));
GlobalFiletypesModule::getTable().addType(Type::Name(), Name(), filetype_t("doom3 region", "*.reg"));
}
MapFormat* getTable()
{
return this;
}
scene::Node& parsePrimitive(Tokeniser& tokeniser) const
{
const char* primitive = tokeniser.getToken();
if(primitive != 0)
{
if(string_equal(primitive, "patchDef3"))
{
return m_dependencies.getPatchDoom3().createPatch();
}
else if(string_equal(primitive, "patchDef2"))
{
return m_dependencies.getPatchDef2Doom3().createPatch();
}
else if(string_equal(primitive, "brushDef3"))
{
return m_dependencies.getBrushDoom3().createBrush();
}
}
Tokeniser_unexpectedError(tokeniser, primitive, "#doom3-primitive");
return g_nullNode;
}
void readGraph(scene::Node& root, TextInputStream& inputStream, EntityCreator& entityTable) const
{
Tokeniser& tokeniser = GlobalScripLibModule::getTable().m_pfnNewSimpleTokeniser(inputStream);
tokeniser.nextLine();
if(!Tokeniser_parseToken(tokeniser, "Version"))
{
return;
}
std::size_t version;
if(!Tokeniser_getSize(tokeniser, version))
{
return;
}
if(version != MapVersion())
{
globalErrorStream() << "Doom 3 map version " << MapVersion() << " supported, version is " << Unsigned(version) << "\n";
return;
}
tokeniser.nextLine();
Map_Read(root, tokeniser, entityTable, *this);
tokeniser.release();
}
void writeGraph(scene::Node& root, GraphTraversalFunc traverse, TextOutputStream& outputStream) const
{
TokenWriter& writer = GlobalScripLibModule::getTable().m_pfnNewSimpleTokenWriter(outputStream);
writer.writeToken("Version");
writer.writeInteger(MapVersion());
writer.nextLine();
Map_Write(root, traverse, writer, false);
writer.release();
}
};
typedef SingletonModule<
MapDoom3API,
MapDoom3Dependencies,
DependenciesAPIConstructor<MapDoom3API, MapDoom3Dependencies>
>
MapDoom3Module;
MapDoom3Module g_MapDoom3Module;
class MapQuake4API : public TypeSystemRef, public MapFormat, public PrimitiveParser
{
MapDoom3Dependencies& m_dependencies;
public:
typedef MapFormat Type;
STRING_CONSTANT(Name, "mapquake4");
INTEGER_CONSTANT(MapVersion, 3);
MapQuake4API(MapDoom3Dependencies& dependencies) : m_dependencies(dependencies)
{
GlobalFiletypesModule::getTable().addType(Type::Name(), Name(), filetype_t("quake4 maps", "*.map"));
GlobalFiletypesModule::getTable().addType(Type::Name(), Name(), filetype_t("quake4 region", "*.reg"));
}
MapFormat* getTable()
{
return this;
}
scene::Node& parsePrimitive(Tokeniser& tokeniser) const
{
const char* primitive = tokeniser.getToken();
if(primitive != 0)
{
if(string_equal(primitive, "patchDef3"))
{
return m_dependencies.getPatchDoom3().createPatch();
}
else if(string_equal(primitive, "patchDef2"))
{
return m_dependencies.getPatchDef2Doom3().createPatch();
}
else if(string_equal(primitive, "brushDef3"))
{
return m_dependencies.getBrushDoom3().createBrush();
}
}
Tokeniser_unexpectedError(tokeniser, primitive, "#quake4-primitive");
return g_nullNode;
}
void readGraph(scene::Node& root, TextInputStream& inputStream, EntityCreator& entityTable) const
{
Tokeniser& tokeniser = GlobalScripLibModule::getTable().m_pfnNewSimpleTokeniser(inputStream);
tokeniser.nextLine();
if(!Tokeniser_parseToken(tokeniser, "Version"))
{
return;
}
std::size_t version;
if(!Tokeniser_getSize(tokeniser, version))
{
return;
}
if(version != MapVersion())
{
globalErrorStream() << "Quake 4 map version " << MapVersion() << " supported, version is " << Unsigned(version) << "\n";
return;
}
tokeniser.nextLine();
Map_Read(root, tokeniser, entityTable, *this);
tokeniser.release();
}
void writeGraph(scene::Node& root, GraphTraversalFunc traverse, TextOutputStream& outputStream) const
{
TokenWriter& writer = GlobalScripLibModule::getTable().m_pfnNewSimpleTokenWriter(outputStream);
writer.writeToken("Version");
writer.writeInteger(MapVersion());
writer.nextLine();
Map_Write(root, traverse, writer, false);
writer.release();
}
};
typedef SingletonModule<
MapQuake4API,
MapDoom3Dependencies,
DependenciesAPIConstructor<MapQuake4API, MapDoom3Dependencies>
>
MapQuake4Module;
MapQuake4Module g_MapQuake4Module;
class MapDependencies :
public GlobalRadiantModuleRef,
public GlobalBrushModuleRef,
public GlobalPatchModuleRef,
public GlobalFiletypesModuleRef,
public GlobalScripLibModuleRef,
public GlobalEntityClassManagerModuleRef,
public GlobalSceneGraphModuleRef
{
public:
MapDependencies() :
GlobalBrushModuleRef(GlobalRadiant().getRequiredGameDescriptionKeyValue("brushtypes")),
GlobalPatchModuleRef(GlobalRadiant().getRequiredGameDescriptionKeyValue("patchtypes")),
GlobalEntityClassManagerModuleRef(GlobalRadiant().getRequiredGameDescriptionKeyValue("entityclass"))
{
}
};
class MapQ3API : public TypeSystemRef, public MapFormat, public PrimitiveParser
{
public:
typedef MapFormat Type;
STRING_CONSTANT(Name, "mapq3");
MapQ3API()
{
GlobalFiletypesModule::getTable().addType(Type::Name(), Name(), filetype_t("quake3 maps", "*.map"));
GlobalFiletypesModule::getTable().addType(Type::Name(), Name(), filetype_t("quake3 region", "*.reg"));
}
MapFormat* getTable()
{
return this;
}
scene::Node& parsePrimitive(Tokeniser& tokeniser) const
{
const char* primitive = tokeniser.getToken();
if(primitive != 0)
{
if(string_equal(primitive, "patchDef2"))
{
return GlobalPatchModule::getTable().createPatch();
}
if(GlobalBrushModule::getTable().useAlternativeTextureProjection())
{
if(string_equal(primitive, "brushDef"))
{
return GlobalBrushModule::getTable().createBrush();
}
}
else
{
if(string_equal(primitive, "("))
{
tokeniser.ungetToken(); // (
return GlobalBrushModule::getTable().createBrush();
}
}
}
Tokeniser_unexpectedError(tokeniser, primitive, "#quake3-primitive");
return g_nullNode;
}
void readGraph(scene::Node& root, TextInputStream& inputStream, EntityCreator& entityTable) const
{
Tokeniser& tokeniser = GlobalScripLibModule::getTable().m_pfnNewSimpleTokeniser(inputStream);
Map_Read(root, tokeniser, entityTable, *this);
tokeniser.release();
}
void writeGraph(scene::Node& root, GraphTraversalFunc traverse, TextOutputStream& outputStream) const
{
TokenWriter& writer = GlobalScripLibModule::getTable().m_pfnNewSimpleTokenWriter(outputStream);
Map_Write(root, traverse, writer, false);
writer.release();
}
};
typedef SingletonModule<MapQ3API, MapDependencies> MapQ3Module;
MapQ3Module g_MapQ3Module;
class MapQ1API : public TypeSystemRef, public MapFormat, public PrimitiveParser
{
public:
typedef MapFormat Type;
STRING_CONSTANT(Name, "mapq1");
MapQ1API()
{
GlobalFiletypesModule::getTable().addType(Type::Name(), Name(), filetype_t("quake maps", "*.map"));
GlobalFiletypesModule::getTable().addType(Type::Name(), Name(), filetype_t("quake region", "*.reg"));
}
MapFormat* getTable()
{
return this;
}
scene::Node& parsePrimitive(Tokeniser& tokeniser) const
{
const char* primitive = tokeniser.getToken();
if(primitive != 0)
{
if(string_equal(primitive, "("))
{
tokeniser.ungetToken(); // (
return GlobalBrushModule::getTable().createBrush();
}
}
Tokeniser_unexpectedError(tokeniser, primitive, "#quake-primitive");
return g_nullNode;
}
void readGraph(scene::Node& root, TextInputStream& inputStream, EntityCreator& entityTable) const
{
Tokeniser& tokeniser = GlobalScripLibModule::getTable().m_pfnNewSimpleTokeniser(inputStream);
Map_Read(root, tokeniser, entityTable, *this);
tokeniser.release();
}
void writeGraph(scene::Node& root, GraphTraversalFunc traverse, TextOutputStream& outputStream) const
{
TokenWriter& writer = GlobalScripLibModule::getTable().m_pfnNewSimpleTokenWriter(outputStream);
Map_Write(root, traverse, writer, true);
writer.release();
}
};
typedef SingletonModule<MapQ1API, MapDependencies> MapQ1Module;
MapQ1Module g_MapQ1Module;
class MapHalfLifeAPI : public TypeSystemRef, public MapFormat, public PrimitiveParser
{
public:
typedef MapFormat Type;
STRING_CONSTANT(Name, "maphl");
MapHalfLifeAPI()
{
GlobalFiletypesModule::getTable().addType(Type::Name(), Name(), filetype_t("half-life maps", "*.map"));
GlobalFiletypesModule::getTable().addType(Type::Name(), Name(), filetype_t("half-life region", "*.reg"));
}
MapFormat* getTable()
{
return this;
}
scene::Node& parsePrimitive(Tokeniser& tokeniser) const
{
const char* primitive = tokeniser.getToken();
if(primitive != 0)
{
if(string_equal(primitive, "("))
{
tokeniser.ungetToken(); // (
return GlobalBrushModule::getTable().createBrush();
}
}
Tokeniser_unexpectedError(tokeniser, primitive, "#halflife-primitive");
return g_nullNode;
}
void readGraph(scene::Node& root, TextInputStream& inputStream, EntityCreator& entityTable) const
{
Tokeniser& tokeniser = GlobalScripLibModule::getTable().m_pfnNewSimpleTokeniser(inputStream);
Map_Read(root, tokeniser, entityTable, *this);
tokeniser.release();
}
void writeGraph(scene::Node& root, GraphTraversalFunc traverse, TextOutputStream& outputStream) const
{
TokenWriter& writer = GlobalScripLibModule::getTable().m_pfnNewSimpleTokenWriter(outputStream);
Map_Write(root, traverse, writer, true);
writer.release();
}
};
typedef SingletonModule<MapHalfLifeAPI, MapDependencies> MapHalfLifeModule;
MapHalfLifeModule g_MapHalfLifeModule;
class MapQ2API : public TypeSystemRef, public MapFormat, public PrimitiveParser
{
public:
typedef MapFormat Type;
STRING_CONSTANT(Name, "mapq2");
MapQ2API()
{
GlobalFiletypesModule::getTable().addType(Type::Name(), Name(), filetype_t("quake2 maps", "*.map"));
GlobalFiletypesModule::getTable().addType(Type::Name(), Name(), filetype_t("quake2 region", "*.reg"));
}
MapFormat* getTable()
{
return this;
}
scene::Node& parsePrimitive(Tokeniser& tokeniser) const
{
const char* primitive = tokeniser.getToken();
if(primitive != 0)
{
if(string_equal(primitive, "("))
{
tokeniser.ungetToken(); // (
return GlobalBrushModule::getTable().createBrush();
}
}
Tokeniser_unexpectedError(tokeniser, primitive, "#quake2-primitive");
return g_nullNode;
}
void readGraph(scene::Node& root, TextInputStream& inputStream, EntityCreator& entityTable) const
{
Tokeniser& tokeniser = GlobalScripLibModule::getTable().m_pfnNewSimpleTokeniser(inputStream);
Map_Read(root, tokeniser, entityTable, *this);
tokeniser.release();
}
void writeGraph(scene::Node& root, GraphTraversalFunc traverse, TextOutputStream& outputStream) const
{
TokenWriter& writer = GlobalScripLibModule::getTable().m_pfnNewSimpleTokenWriter(outputStream);
Map_Write(root, traverse, writer, true);
writer.release();
}
};
typedef SingletonModule<MapQ2API, MapDependencies> MapQ2Module;
MapQ2Module g_MapQ2Module;
#define PARSE_ERROR "error parsing VMF"
inline void parseToken(Tokeniser& tokeniser, const char* token)
{
ASSERT_MESSAGE(Tokeniser_parseToken(tokeniser, token), "error parsing vmf: token not found: " << makeQuoted(token));
}
#include "generic/arrayrange.h"
class VMFBlock;
typedef ArrayConstRange<VMFBlock> VMFBlockArrayRange;
class VMFBlock
{
public:
const char* m_name;
VMFBlockArrayRange m_children;
typedef const VMFBlock Value;
VMFBlock(const char* name, VMFBlockArrayRange children = VMFBlockArrayRange(0, 0)) : m_name(name), m_children(children)
{
}
const char* name() const
{
return m_name;
}
typedef Value* const_iterator;
const_iterator begin() const
{
return m_children.begin;
}
const_iterator end() const
{
return m_children.end;
}
};
const VMFBlock c_vmfNormals("normals");
const VMFBlock c_vmfDistances("distances");
const VMFBlock c_vmfOffsets("offsets");
const VMFBlock c_vmfOffsetNormals("offset_normals");
const VMFBlock c_vmfAlphas("alphas");
const VMFBlock c_vmfTriangleTags("triangle_tags");
const VMFBlock c_vmfAllowedVerts("allowed_verts");
const VMFBlock c_vmfDispInfoChildren[] = { c_vmfNormals, c_vmfDistances, c_vmfOffsets, c_vmfOffsetNormals, c_vmfAlphas, c_vmfTriangleTags, c_vmfAllowedVerts };
const VMFBlock c_vmfDispInfo("dispinfo", ARRAY_RANGE(c_vmfDispInfoChildren));
const VMFBlock c_vmfSideChildren[] = { c_vmfDispInfo };
const VMFBlock c_vmfSide("side", ARRAY_RANGE(c_vmfSideChildren));
const VMFBlock c_vmfEditor("editor");
const VMFBlock c_vmfVersionInfo("versioninfo");
const VMFBlock c_vmfViewSettings("viewsettings");
const VMFBlock c_vmfCordon("cordon");
const VMFBlock c_vmfGroupChildren[] = { c_vmfEditor };
const VMFBlock c_vmfGroup("group", ARRAY_RANGE(c_vmfGroupChildren));
const VMFBlock c_vmfCamera("camera");
const VMFBlock c_vmfCamerasChildren[] = { c_vmfCamera };
const VMFBlock c_vmfCameras("cameras", ARRAY_RANGE(c_vmfCamerasChildren));
VMFBlock c_vmfVisGroup("visgroup");
VMFBlock c_vmfVisGroups("visgroups", VMFBlockArrayRange(&c_vmfVisGroup, &c_vmfVisGroup+1));
const VMFBlock c_vmfSolidChildren[] = { c_vmfSide, c_vmfEditor };
const VMFBlock c_vmfSolid("solid", ARRAY_RANGE(c_vmfSolidChildren));
const VMFBlock c_vmfConnections("connections");
const VMFBlock c_vmfEntityChildren[] = { c_vmfEditor, c_vmfSolid, c_vmfGroup, c_vmfConnections };
const VMFBlock c_vmfEntity("entity", ARRAY_RANGE(c_vmfEntityChildren));
const VMFBlock c_vmfWorldChildren[] = { c_vmfEditor, c_vmfSolid, c_vmfGroup };
const VMFBlock c_vmfWorld("world", ARRAY_RANGE(c_vmfWorldChildren));
const VMFBlock c_vmfRootChildren[] = { c_vmfVersionInfo, c_vmfViewSettings, c_vmfVisGroups, c_vmfWorld, c_vmfEntity, c_vmfCameras, c_vmfCordon };
const VMFBlock c_vmfRoot("", ARRAY_RANGE(c_vmfRootChildren));
class VMFInit
{
public:
VMFInit()
{
c_vmfVisGroup.m_children = VMFBlockArrayRange(&c_vmfVisGroup, &c_vmfVisGroup+1);
}
};
VMFInit g_VMFInit;
int g_vmf_entities;
int g_vmf_brushes;
inline VMFBlock::const_iterator VMFBlock_find(const VMFBlock& block, const char* name)
{
for(VMFBlock::const_iterator i = block.begin(); i != block.end(); ++i)
{
if(string_equal(name, (*i).name()))
{
return i;
}
}
return block.end();
}
void VMF_parseBlock(Tokeniser& tokeniser, const VMFBlock& block)
{
for(;;)
{
const char* key = tokeniser.getToken();
if(key == 0 || string_equal(key, "}"))
{
tokeniser.ungetToken();
break;
}
CopiedString tmp(key);
tokeniser.nextLine();
const char* value = tokeniser.getToken();
tokeniser.nextLine();
if(string_equal(value, "{"))
{
VMFBlock::const_iterator i = VMFBlock_find(block, tmp.c_str());
ASSERT_MESSAGE(i != block.end(), "error parsing vmf block " << makeQuoted(block.name()) << ": unknown block: " << makeQuoted(tmp.c_str()));
if(string_equal(tmp.c_str(), "solid"))
{
++g_vmf_brushes;
}
else if(string_equal(tmp.c_str(), "entity") || string_equal(tmp.c_str(), "world"))
{
++g_vmf_entities;
}
VMF_parseBlock(tokeniser, *i);
parseToken(tokeniser, "}");
tokeniser.nextLine();
}
else
{
// was a pair
}
}
}
void VMF_Read(scene::Node& root, Tokeniser& tokeniser, EntityCreator& entityTable)
{
g_vmf_entities = g_vmf_brushes = 0;
VMF_parseBlock(tokeniser, c_vmfRoot);
globalOutputStream() << g_vmf_entities << " entities\n";
globalOutputStream() << g_vmf_brushes << " brushes\n";
}
class MapVMFAPI : public TypeSystemRef, public MapFormat
{
public:
typedef MapFormat Type;
STRING_CONSTANT(Name, "mapvmf");
MapVMFAPI()
{
GlobalFiletypesModule::getTable().addType(Type::Name(), Name(), filetype_t("vmf maps", "*.vmf"));
GlobalFiletypesModule::getTable().addType(Type::Name(), Name(), filetype_t("vmf region", "*.reg"));
}
MapFormat* getTable()
{
return this;
}
void readGraph(scene::Node& root, TextInputStream& inputStream, EntityCreator& entityTable) const
{
Tokeniser& tokeniser = GlobalScripLibModule::getTable().m_pfnNewSimpleTokeniser(inputStream);
VMF_Read(root, tokeniser, entityTable);
tokeniser.release();
}
void writeGraph(scene::Node& root, GraphTraversalFunc traverse, TextOutputStream& outputStream) const
{
}
};
typedef SingletonModule<MapVMFAPI, MapDependencies> MapVMFModule;
MapVMFModule g_MapVMFModule;
extern "C" void RADIANT_DLLEXPORT Radiant_RegisterModules(ModuleServer& server)
{
GlobalErrorStream::instance().setOutputStream(server.getErrorStream());
GlobalOutputStream::instance().setOutputStream(server.getOutputStream());
GlobalDebugMessageHandler::instance().setHandler(server.getDebugMessageHandler());
GlobalModuleServer::instance().set(server);
g_MapDoom3Module.selfRegister();
g_MapQuake4Module.selfRegister();
g_MapQ3Module.selfRegister();
g_MapQ1Module.selfRegister();
g_MapQ2Module.selfRegister();
g_MapHalfLifeModule.selfRegister();
g_MapVMFModule.selfRegister();
}

25
plugins/mapq3/plugin.h Normal file
View File

@@ -0,0 +1,25 @@
/*
Copyright (C) 2001-2006, William Joseph.
All Rights Reserved.
This file is part of GtkRadiant.
GtkRadiant 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; either version 2 of the License, or
(at your option) any later version.
GtkRadiant 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 GtkRadiant; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#if !defined(INCLUDED_PLUGIN_H)
#define INCLUDED_PLUGIN_H
#endif

124
plugins/mapq3/write.cpp Normal file
View File

@@ -0,0 +1,124 @@
/*
Copyright (C) 2001-2006, William Joseph.
All Rights Reserved.
This file is part of GtkRadiant.
GtkRadiant 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; either version 2 of the License, or
(at your option) any later version.
GtkRadiant 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 GtkRadiant; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "write.h"
#include "ientity.h"
#include "iscriplib.h"
#include "scenelib.h"
inline MapExporter* Node_getMapExporter(scene::Node& node)
{
return NodeTypeCast<MapExporter>::cast(node);
}
static std::size_t g_count_entities;
static std::size_t g_count_brushes;
void Entity_ExportTokens(const Entity& entity, TokenWriter& writer)
{
g_count_brushes = 0;
class WriteKeyValue : public Entity::Visitor
{
TokenWriter& m_writer;
public:
WriteKeyValue(TokenWriter& writer)
: m_writer(writer)
{
}
void visit(const char* key, const char* value)
{
m_writer.writeString(key);
m_writer.writeString(value);
m_writer.nextLine();
}
} visitor(writer);
entity.forEachKeyValue(visitor);
}
class WriteTokensWalker : public scene::Traversable::Walker
{
mutable Stack<bool> m_stack;
TokenWriter& m_writer;
bool m_ignorePatches;
public:
WriteTokensWalker(TokenWriter& writer, bool ignorePatches)
: m_writer(writer), m_ignorePatches(ignorePatches)
{
}
bool pre(scene::Node& node) const
{
m_stack.push(false);
Entity* entity = Node_getEntity(node);
if(entity != 0)
{
m_writer.writeToken("//");
m_writer.writeToken("entity");
m_writer.writeUnsigned(g_count_entities++);
m_writer.nextLine();
m_writer.writeToken("{");
m_writer.nextLine();
m_stack.top() = true;
Entity_ExportTokens(*entity, m_writer);
}
else
{
MapExporter* exporter = Node_getMapExporter(node);
if(exporter != 0
&& !(m_ignorePatches && Node_isPatch(node)))
{
m_writer.writeToken("//");
m_writer.writeToken("brush");
m_writer.writeUnsigned(g_count_brushes++);
m_writer.nextLine();
exporter->exportTokens(m_writer);
}
}
return true;
}
void post(scene::Node& node) const
{
if(m_stack.top())
{
m_writer.writeToken("}");
m_writer.nextLine();
}
m_stack.pop();
}
};
void Map_Write(scene::Node& root, GraphTraversalFunc traverse, TokenWriter& writer, bool ignorePatches)
{
g_count_entities = 0;
traverse(root, WriteTokensWalker(writer, ignorePatches));
}

29
plugins/mapq3/write.h Normal file
View File

@@ -0,0 +1,29 @@
/*
Copyright (C) 2001-2006, William Joseph.
All Rights Reserved.
This file is part of GtkRadiant.
GtkRadiant 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; either version 2 of the License, or
(at your option) any later version.
GtkRadiant 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 GtkRadiant; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#if !defined(INCLUDED_WRITE_H)
#define INCLUDED_WRITE_H
#include "imap.h"
void Map_Write(scene::Node& root, GraphTraversalFunc traverse, TokenWriter& writer, bool ignorePatches);
#endif