This is the changelog for developers, != changelog for the end user
that we distribute with the binaries. (see changelog)
+27/03/2007
+namespace
+- Fix: Added missing xml-writer pop-calls
+- Ported mapxml plugin to Doom3
+- mapxml now exports brushes with its vertices
+
19/03/2007
namespace
- Fix: Selection is now deleted when creating a patch out of it (aumüller / namespace)
{
m_ostream.write('/');
m_ostream.write('>');
+ m_elements.pop_back();
}
else
{
m_ostream.write('/');
write_string(name);
m_ostream.write('>');
+ m_elements.pop_back();
}
}
std::size_t write(const char* data, std::size_t length)
class MapXMLDependencies :
public GlobalRadiantModuleRef,
public GlobalBrushModuleRef,
- public GlobalPatchModuleRef,
public GlobalFiletypesModuleRef,
public GlobalEntityClassManagerModuleRef,
public GlobalSceneGraphModuleRef
{
+ PatchModuleRef m_patchDef2Doom3Module;
+ PatchModuleRef m_patchDoom3Module;
public:
MapXMLDependencies() :
GlobalBrushModuleRef(GlobalRadiant().getRequiredGameDescriptionKeyValue("brushtypes")),
- GlobalPatchModuleRef(GlobalRadiant().getRequiredGameDescriptionKeyValue("patchtypes")),
- GlobalEntityClassManagerModuleRef(GlobalRadiant().getRequiredGameDescriptionKeyValue("entityclass"))
+ GlobalEntityClassManagerModuleRef(GlobalRadiant().getRequiredGameDescriptionKeyValue("entityclass")),
+ m_patchDef2Doom3Module("def2doom3"),
+ m_patchDoom3Module("doom3")
{
}
+ BrushCreator& getBrushDoom3()
+ {
+ return GlobalBrushModule::getTable();
+ }
+ PatchCreator& getPatchDoom3()
+ {
+ return *m_patchDoom3Module.getTable();
+ }
+ PatchCreator& getPatchDef2Doom3()
+ {
+ return *m_patchDef2Doom3Module.getTable();
+ }
};
class MapXMLAPI : public TypeSystemRef, public MapFormat
{
public:
typedef MapFormat Type;
- STRING_CONSTANT(Name, "xmlq3");
+ STRING_CONSTANT(Name, "xmldoom3");
MapXMLAPI()
{
- GlobalFiletypesModule::getTable().addType(Type::Name(), Name(), filetype_t("xml quake3 maps", "*.xmap"));
+ GlobalFiletypesModule::getTable().addType(Type::Name(), Name(), filetype_t("xml doom3 maps", "*.xmap"));
}
MapFormat* getTable()
{
extern "C" void RADIANT_DLLEXPORT Radiant_RegisterModules(ModuleServer& server)
{
- initialiseModule(server);
+ GlobalErrorStream::instance().setOutputStream(server.getErrorStream());
+ GlobalOutputStream::instance().setOutputStream(server.getOutputStream());
+ GlobalDebugMessageHandler::instance().setHandler(server.getDebugMessageHandler());
+ GlobalModuleServer::instance().set(server);
g_MapXMLModule.selfRegister();
}
}
};
-class MapQ3Importer : public TreeXMLImporter
+class MapDoom3Importer : public TreeXMLImporter
{
scene::Node& m_root;
char m_child[sizeof(EntityImporter)];
return *reinterpret_cast<EntityImporter*>(m_child);
}
public:
- MapQ3Importer(scene::Node& root, EntityCreator& entityTable) : m_root(root), m_entityTable(entityTable)
+ MapDoom3Importer(scene::Node& root, EntityCreator& entityTable) : m_root(root), m_entityTable(entityTable)
{
}
void pushElement(const XMLElement& element)
{
- ASSERT_MESSAGE(string_equal(element.name(), "mapq3"), PARSE_ERROR);
+ ASSERT_MESSAGE(string_equal(element.name(), "mapdoom3"), PARSE_ERROR);
constructor(getEntity(), makeReference(m_root), makeReference(m_entityTable));
}
void popElement(const char* name)
{
- ASSERT_MESSAGE(string_equal(name, "mapq3"), PARSE_ERROR);
+ ASSERT_MESSAGE(string_equal(name, "mapdoom3"), PARSE_ERROR);
destructor(getEntity());
}
std::size_t write(const char* data, std::size_t length)
{
XMLStreamParser parser(in);
- MapQ3Importer importer(root, entityTable);
+ MapDoom3Importer importer(root, entityTable);
TreeXMLImporterStack stack(importer);
parser.exportXML(stack);
}
XMLStreamWriter writer(out);
writer.write("\n", 1);
{
- StaticElement element("mapq3");
+ StaticElement element("mapdoom3");
writer.pushElement(element);
traverse(root, write_all(writer));
importer.popElement(element.name());
}
+inline void FacePolygon_exportXML(const Winding& w, const BasicVector3<double>& normal, XMLImporter& importer)
+{
+ DynamicElement element("polygon");
+
+ char tmp[32];
+
+ sprintf(tmp, "%f", normal.x());
+ element.insertAttribute("nx", tmp);
+
+ sprintf(tmp, "%f", normal.y());
+ element.insertAttribute("ny", tmp);
+
+ sprintf(tmp, "%f", normal.z());
+ element.insertAttribute("nz", tmp);
+
+ importer.pushElement(element);
+
+ for(unsigned int i = 0; i < w.numpoints; ++i)
+ {
+ StaticElement c("vertex");
+
+ sprintf(tmp, "%f", w.points[i].vertex.x());
+ c.insertAttribute("x", tmp);
+
+ sprintf(tmp, "%f", w.points[i].vertex.y());
+ c.insertAttribute("y", tmp);
+
+ sprintf(tmp, "%f", w.points[i].vertex.z());
+ c.insertAttribute("z", tmp);
+
+ sprintf(tmp, "%f", w.points[i].texcoord.x());
+ c.insertAttribute("s", tmp);
+
+ sprintf(tmp, "%f", w.points[i].texcoord.y());
+ c.insertAttribute("t", tmp);
+
+ importer.pushElement(c);
+ importer.popElement(c.name());
+ }
+
+ importer.popElement(element.name());
+}
+
class FaceXMLExporter
{
const Face& m_face;
importer.popElement(element.name());
}
+ FacePolygon_exportXML(m_face.getWinding(), m_face.getPlane().plane3().normal(), importer);
FacePlane_exportXML(m_face.getPlane(), importer);
if(!bAlternateTexdef)