2 Copyright (C) 2001-2006, William Joseph.
5 This file is part of GtkRadiant.
7 GtkRadiant is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 GtkRadiant is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GtkRadiant; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 #if !defined(INCLUDED_BRUSHTOKENS_H)
23 #define INCLUDED_BRUSHTOKENS_H
26 #include "stream/stringstream.h"
29 inline bool FaceShader_importContentsFlagsValue(FaceShader& faceShader, Tokeniser& tokeniser)
31 // parse the optional contents/flags/value
32 RETURN_FALSE_IF_FAIL(Tokeniser_getInteger(tokeniser, faceShader.m_flags.m_contentFlags));
33 RETURN_FALSE_IF_FAIL(Tokeniser_getInteger(tokeniser, faceShader.m_flags.m_surfaceFlags));
34 RETURN_FALSE_IF_FAIL(Tokeniser_getInteger(tokeniser, faceShader.m_flags.m_value));
38 inline bool FaceTexdef_importTokens(FaceTexdef& texdef, Tokeniser& tokeniser)
41 RETURN_FALSE_IF_FAIL(Tokeniser_getFloat(tokeniser, texdef.m_projection.m_texdef.shift[0]));
42 RETURN_FALSE_IF_FAIL(Tokeniser_getFloat(tokeniser, texdef.m_projection.m_texdef.shift[1]));
43 RETURN_FALSE_IF_FAIL(Tokeniser_getFloat(tokeniser, texdef.m_projection.m_texdef.rotate));
44 RETURN_FALSE_IF_FAIL(Tokeniser_getFloat(tokeniser, texdef.m_projection.m_texdef.scale[0]));
45 RETURN_FALSE_IF_FAIL(Tokeniser_getFloat(tokeniser, texdef.m_projection.m_texdef.scale[1]));
47 ASSERT_MESSAGE(texdef_sane(texdef.m_projection.m_texdef), "FaceTexdef_importTokens: bad texdef");
51 inline bool FaceTexdef_BP_importTokens(FaceTexdef& texdef, Tokeniser& tokeniser)
53 // parse alternate texdef
54 RETURN_FALSE_IF_FAIL(Tokeniser_parseToken(tokeniser, "("));
56 RETURN_FALSE_IF_FAIL(Tokeniser_parseToken(tokeniser, "("));
57 RETURN_FALSE_IF_FAIL(Tokeniser_getFloat(tokeniser, texdef.m_projection.m_brushprimit_texdef.coords[0][0]));
58 RETURN_FALSE_IF_FAIL(Tokeniser_getFloat(tokeniser, texdef.m_projection.m_brushprimit_texdef.coords[0][1]));
59 RETURN_FALSE_IF_FAIL(Tokeniser_getFloat(tokeniser, texdef.m_projection.m_brushprimit_texdef.coords[0][2]));
60 RETURN_FALSE_IF_FAIL(Tokeniser_parseToken(tokeniser, ")"));
63 RETURN_FALSE_IF_FAIL(Tokeniser_parseToken(tokeniser, "("));
64 RETURN_FALSE_IF_FAIL(Tokeniser_getFloat(tokeniser, texdef.m_projection.m_brushprimit_texdef.coords[1][0]));
65 RETURN_FALSE_IF_FAIL(Tokeniser_getFloat(tokeniser, texdef.m_projection.m_brushprimit_texdef.coords[1][1]));
66 RETURN_FALSE_IF_FAIL(Tokeniser_getFloat(tokeniser, texdef.m_projection.m_brushprimit_texdef.coords[1][2]));
67 RETURN_FALSE_IF_FAIL(Tokeniser_parseToken(tokeniser, ")"));
69 RETURN_FALSE_IF_FAIL(Tokeniser_parseToken(tokeniser, ")"));
73 inline bool FaceTexdef_HalfLife_importTokens(FaceTexdef& texdef, Tokeniser& tokeniser)
76 RETURN_FALSE_IF_FAIL(Tokeniser_parseToken(tokeniser, "["));
77 RETURN_FALSE_IF_FAIL(Tokeniser_getFloat(tokeniser, texdef.m_projection.m_basis_s.x()));
78 RETURN_FALSE_IF_FAIL(Tokeniser_getFloat(tokeniser, texdef.m_projection.m_basis_s.y()));
79 RETURN_FALSE_IF_FAIL(Tokeniser_getFloat(tokeniser, texdef.m_projection.m_basis_s.z()));
80 RETURN_FALSE_IF_FAIL(Tokeniser_getFloat(tokeniser, texdef.m_projection.m_texdef.shift[0]));
81 RETURN_FALSE_IF_FAIL(Tokeniser_parseToken(tokeniser, "]"));
82 RETURN_FALSE_IF_FAIL(Tokeniser_parseToken(tokeniser, "["));
83 RETURN_FALSE_IF_FAIL(Tokeniser_getFloat(tokeniser, texdef.m_projection.m_basis_t.x()));
84 RETURN_FALSE_IF_FAIL(Tokeniser_getFloat(tokeniser, texdef.m_projection.m_basis_t.y()));
85 RETURN_FALSE_IF_FAIL(Tokeniser_getFloat(tokeniser, texdef.m_projection.m_basis_t.z()));
86 RETURN_FALSE_IF_FAIL(Tokeniser_getFloat(tokeniser, texdef.m_projection.m_texdef.shift[1]));
87 RETURN_FALSE_IF_FAIL(Tokeniser_parseToken(tokeniser, "]"));
88 RETURN_FALSE_IF_FAIL(Tokeniser_getFloat(tokeniser, texdef.m_projection.m_texdef.rotate));
89 RETURN_FALSE_IF_FAIL(Tokeniser_getFloat(tokeniser, texdef.m_projection.m_texdef.scale[0]));
90 RETURN_FALSE_IF_FAIL(Tokeniser_getFloat(tokeniser, texdef.m_projection.m_texdef.scale[1]));
92 texdef.m_projection.m_texdef.rotate = -texdef.m_projection.m_texdef.rotate;
94 ASSERT_MESSAGE(texdef_sane(texdef.m_projection.m_texdef), "FaceTexdef_importTokens: bad texdef");
98 inline bool FacePlane_importTokens(FacePlane& facePlane, Tokeniser& tokeniser)
101 for(std::size_t i = 0; i<3; i++)
103 RETURN_FALSE_IF_FAIL(Tokeniser_parseToken(tokeniser, "("));
104 for(std::size_t j = 0; j < 3; ++j)
106 RETURN_FALSE_IF_FAIL(Tokeniser_getDouble(tokeniser, facePlane.planePoints()[i][j]));
108 RETURN_FALSE_IF_FAIL(Tokeniser_parseToken(tokeniser, ")"));
110 facePlane.MakePlane();
114 inline bool FacePlane_Doom3_importTokens(FacePlane& facePlane, Tokeniser& tokeniser)
117 // parse plane equation
118 RETURN_FALSE_IF_FAIL(Tokeniser_parseToken(tokeniser, "("));
119 RETURN_FALSE_IF_FAIL(Tokeniser_getDouble(tokeniser, plane.a));
120 RETURN_FALSE_IF_FAIL(Tokeniser_getDouble(tokeniser, plane.b));
121 RETURN_FALSE_IF_FAIL(Tokeniser_getDouble(tokeniser, plane.c));
122 RETURN_FALSE_IF_FAIL(Tokeniser_getDouble(tokeniser, plane.d));
124 RETURN_FALSE_IF_FAIL(Tokeniser_parseToken(tokeniser, ")"));
126 facePlane.setDoom3Plane(plane);
130 inline bool FaceShader_Doom3_importTokens(FaceShader& faceShader, Tokeniser& tokeniser)
132 const char *shader = tokeniser.getToken();
135 Tokeniser_unexpectedError(tokeniser, shader, "#shader-name");
138 if(string_equal(shader, "_emptyname"))
140 shader = texdef_name_default();
142 faceShader.setShader(shader);
146 inline bool FaceShader_importTokens(FaceShader& faceShader, Tokeniser& tokeniser)
148 const char* texture = tokeniser.getToken();
151 Tokeniser_unexpectedError(tokeniser, texture, "#texture-name");
154 if(string_equal(texture, "NULL"))
156 faceShader.setShader(texdef_name_default());
160 StringOutputStream shader(string_length(GlobalTexturePrefix_get()) + string_length(texture));
161 shader << GlobalTexturePrefix_get() << texture;
162 faceShader.setShader(shader.c_str());
170 class Doom3FaceTokenImporter
174 Doom3FaceTokenImporter(Face& face) : m_face(face)
177 bool importTokens(Tokeniser& tokeniser)
179 RETURN_FALSE_IF_FAIL(FacePlane_Doom3_importTokens(m_face.getPlane(), tokeniser));
180 RETURN_FALSE_IF_FAIL(FaceTexdef_BP_importTokens(m_face.getTexdef(), tokeniser));
181 RETURN_FALSE_IF_FAIL(FaceShader_Doom3_importTokens(m_face.getShader(), tokeniser));
182 RETURN_FALSE_IF_FAIL(FaceShader_importContentsFlagsValue(m_face.getShader(), tokeniser));
184 m_face.getTexdef().m_projectionInitialised = true;
185 m_face.getTexdef().m_scaleApplied = true;
191 class Quake4FaceTokenImporter
195 Quake4FaceTokenImporter(Face& face) : m_face(face)
198 bool importTokens(Tokeniser& tokeniser)
200 RETURN_FALSE_IF_FAIL(FacePlane_Doom3_importTokens(m_face.getPlane(), tokeniser));
201 RETURN_FALSE_IF_FAIL(FaceTexdef_BP_importTokens(m_face.getTexdef(), tokeniser));
202 RETURN_FALSE_IF_FAIL(FaceShader_Doom3_importTokens(m_face.getShader(), tokeniser));
204 m_face.getTexdef().m_projectionInitialised = true;
205 m_face.getTexdef().m_scaleApplied = true;
211 class Quake2FaceTokenImporter
215 Quake2FaceTokenImporter(Face& face) : m_face(face)
218 bool importTokens(Tokeniser& tokeniser)
220 RETURN_FALSE_IF_FAIL(FacePlane_importTokens(m_face.getPlane(), tokeniser));
221 RETURN_FALSE_IF_FAIL(FaceShader_importTokens(m_face.getShader(), tokeniser));
222 RETURN_FALSE_IF_FAIL(FaceTexdef_importTokens(m_face.getTexdef(), tokeniser));
223 if(Tokeniser_nextTokenIsDigit(tokeniser))
225 m_face.getShader().m_flags.m_specified = true;
226 RETURN_FALSE_IF_FAIL(FaceShader_importContentsFlagsValue(m_face.getShader(), tokeniser));
228 m_face.getTexdef().m_scaleApplied = true;
233 class Quake3FaceTokenImporter
237 Quake3FaceTokenImporter(Face& face) : m_face(face)
240 bool importTokens(Tokeniser& tokeniser)
242 RETURN_FALSE_IF_FAIL(FacePlane_importTokens(m_face.getPlane(), tokeniser));
243 RETURN_FALSE_IF_FAIL(FaceShader_importTokens(m_face.getShader(), tokeniser));
244 RETURN_FALSE_IF_FAIL(FaceTexdef_importTokens(m_face.getTexdef(), tokeniser));
245 RETURN_FALSE_IF_FAIL(FaceShader_importContentsFlagsValue(m_face.getShader(), tokeniser));
246 m_face.getTexdef().m_scaleApplied = true;
251 class Quake3BPFaceTokenImporter
255 Quake3BPFaceTokenImporter(Face& face) : m_face(face)
258 bool importTokens(Tokeniser& tokeniser)
260 RETURN_FALSE_IF_FAIL(FacePlane_importTokens(m_face.getPlane(), tokeniser));
261 RETURN_FALSE_IF_FAIL(FaceTexdef_BP_importTokens(m_face.getTexdef(), tokeniser));
262 RETURN_FALSE_IF_FAIL(FaceShader_importTokens(m_face.getShader(), tokeniser));
263 RETURN_FALSE_IF_FAIL(FaceShader_importContentsFlagsValue(m_face.getShader(), tokeniser));
265 m_face.getTexdef().m_projectionInitialised = true;
266 m_face.getTexdef().m_scaleApplied = true;
272 class QuakeFaceTokenImporter
276 QuakeFaceTokenImporter(Face& face) : m_face(face)
279 bool importTokens(Tokeniser& tokeniser)
281 RETURN_FALSE_IF_FAIL(FacePlane_importTokens(m_face.getPlane(), tokeniser));
282 RETURN_FALSE_IF_FAIL(FaceShader_importTokens(m_face.getShader(), tokeniser));
283 RETURN_FALSE_IF_FAIL(FaceTexdef_importTokens(m_face.getTexdef(), tokeniser));
284 m_face.getTexdef().m_scaleApplied = true;
289 class HalfLifeFaceTokenImporter
293 HalfLifeFaceTokenImporter(Face& face) : m_face(face)
296 bool importTokens(Tokeniser& tokeniser)
298 RETURN_FALSE_IF_FAIL(FacePlane_importTokens(m_face.getPlane(), tokeniser));
299 RETURN_FALSE_IF_FAIL(FaceShader_importTokens(m_face.getShader(), tokeniser));
300 RETURN_FALSE_IF_FAIL(FaceTexdef_HalfLife_importTokens(m_face.getTexdef(), tokeniser));
301 m_face.getTexdef().m_scaleApplied = true;
307 inline void FacePlane_Doom3_exportTokens(const FacePlane& facePlane, TokenWriter& writer)
309 // write plane equation
310 writer.writeToken("(");
311 writer.writeFloat(facePlane.getDoom3Plane().a);
312 writer.writeFloat(facePlane.getDoom3Plane().b);
313 writer.writeFloat(facePlane.getDoom3Plane().c);
314 writer.writeFloat(-facePlane.getDoom3Plane().d);
315 writer.writeToken(")");
318 inline void FacePlane_exportTokens(const FacePlane& facePlane, TokenWriter& writer)
321 for(std::size_t i=0; i<3; i++)
323 writer.writeToken("(");
324 for(std::size_t j=0; j<3; j++)
326 writer.writeFloat(Face::m_quantise(facePlane.planePoints()[i][j]));
328 writer.writeToken(")");
332 inline void FaceTexdef_BP_exportTokens(const FaceTexdef& faceTexdef, TokenWriter& writer)
334 // write alternate texdef
335 writer.writeToken("(");
337 writer.writeToken("(");
338 for(std::size_t i=0;i<3;i++)
340 writer.writeFloat(faceTexdef.m_projection.m_brushprimit_texdef.coords[0][i]);
342 writer.writeToken(")");
345 writer.writeToken("(");
346 for(std::size_t i=0;i<3;i++)
348 writer.writeFloat(faceTexdef.m_projection.m_brushprimit_texdef.coords[1][i]);
350 writer.writeToken(")");
352 writer.writeToken(")");
355 inline void FaceTexdef_exportTokens(const FaceTexdef& faceTexdef, TokenWriter& writer)
357 ASSERT_MESSAGE(texdef_sane(faceTexdef.m_projection.m_texdef), "FaceTexdef_exportTokens: bad texdef");
359 writer.writeFloat(faceTexdef.m_projection.m_texdef.shift[0]);
360 writer.writeFloat(faceTexdef.m_projection.m_texdef.shift[1]);
361 writer.writeFloat(faceTexdef.m_projection.m_texdef.rotate);
362 writer.writeFloat(faceTexdef.m_projection.m_texdef.scale[0]);
363 writer.writeFloat(faceTexdef.m_projection.m_texdef.scale[1]);
366 inline void FaceTexdef_HalfLife_exportTokens(const FaceTexdef& faceTexdef, TokenWriter& writer)
368 ASSERT_MESSAGE(texdef_sane(faceTexdef.m_projection.m_texdef), "FaceTexdef_exportTokens: bad texdef");
370 writer.writeToken("[");
371 writer.writeFloat(faceTexdef.m_projection.m_basis_s.x());
372 writer.writeFloat(faceTexdef.m_projection.m_basis_s.y());
373 writer.writeFloat(faceTexdef.m_projection.m_basis_s.z());
374 writer.writeFloat(faceTexdef.m_projection.m_texdef.shift[0]);
375 writer.writeToken("]");
376 writer.writeToken("[");
377 writer.writeFloat(faceTexdef.m_projection.m_basis_t.x());
378 writer.writeFloat(faceTexdef.m_projection.m_basis_t.y());
379 writer.writeFloat(faceTexdef.m_projection.m_basis_t.z());
380 writer.writeFloat(faceTexdef.m_projection.m_texdef.shift[1]);
381 writer.writeToken("]");
382 writer.writeFloat(-faceTexdef.m_projection.m_texdef.rotate);
383 writer.writeFloat(faceTexdef.m_projection.m_texdef.scale[0]);
384 writer.writeFloat(faceTexdef.m_projection.m_texdef.scale[1]);
387 inline void FaceShader_ContentsFlagsValue_exportTokens(const FaceShader& faceShader, TokenWriter& writer)
389 // write surface flags
390 writer.writeInteger(faceShader.m_flags.m_contentFlags);
391 writer.writeInteger(faceShader.m_flags.m_surfaceFlags);
392 writer.writeInteger(faceShader.m_flags.m_value);
395 inline void FaceShader_exportTokens(const FaceShader& faceShader, TokenWriter& writer)
398 if(string_empty(shader_get_textureName(faceShader.getShader())))
400 writer.writeToken("NULL");
404 writer.writeToken(shader_get_textureName(faceShader.getShader()));
408 inline void FaceShader_Doom3_exportTokens(const FaceShader& faceShader, TokenWriter& writer)
411 if(string_empty(shader_get_textureName(faceShader.getShader())))
413 writer.writeString("_emptyname");
417 writer.writeString(faceShader.getShader());
421 class Doom3FaceTokenExporter
425 Doom3FaceTokenExporter(const Face& face) : m_face(face)
428 void exportTokens(TokenWriter& writer) const
430 FacePlane_Doom3_exportTokens(m_face.getPlane(), writer);
431 FaceTexdef_BP_exportTokens(m_face.getTexdef(), writer);
432 FaceShader_Doom3_exportTokens(m_face.getShader(), writer);
433 FaceShader_ContentsFlagsValue_exportTokens(m_face.getShader(), writer);
438 class Quake4FaceTokenExporter
442 Quake4FaceTokenExporter(const Face& face) : m_face(face)
445 void exportTokens(TokenWriter& writer) const
447 FacePlane_Doom3_exportTokens(m_face.getPlane(), writer);
448 FaceTexdef_BP_exportTokens(m_face.getTexdef(), writer);
449 FaceShader_Doom3_exportTokens(m_face.getShader(), writer);
454 class Quake2FaceTokenExporter
458 Quake2FaceTokenExporter(const Face& face) : m_face(face)
461 void exportTokens(TokenWriter& writer) const
463 FacePlane_exportTokens(m_face.getPlane(), writer);
464 FaceShader_exportTokens(m_face.getShader(), writer);
465 FaceTexdef_exportTokens(m_face.getTexdef(), writer);
466 if(m_face.getShader().m_flags.m_specified || m_face.isDetail())
468 FaceShader_ContentsFlagsValue_exportTokens(m_face.getShader(), writer);
474 class Quake3FaceTokenExporter
478 Quake3FaceTokenExporter(const Face& face) : m_face(face)
481 void exportTokens(TokenWriter& writer) const
483 FacePlane_exportTokens(m_face.getPlane(), writer);
484 FaceShader_exportTokens(m_face.getShader(), writer);
485 FaceTexdef_exportTokens(m_face.getTexdef(), writer);
486 FaceShader_ContentsFlagsValue_exportTokens(m_face.getShader(), writer);
491 class Quake3BPFaceTokenExporter
495 Quake3BPFaceTokenExporter(const Face& face) : m_face(face)
498 void exportTokens(TokenWriter& writer) const
500 FacePlane_exportTokens(m_face.getPlane(), writer);
501 FaceTexdef_BP_exportTokens(m_face.getTexdef(), writer);
502 FaceShader_exportTokens(m_face.getShader(), writer);
503 FaceShader_ContentsFlagsValue_exportTokens(m_face.getShader(), writer);
508 class QuakeFaceTokenExporter
512 QuakeFaceTokenExporter(const Face& face) : m_face(face)
515 void exportTokens(TokenWriter& writer) const
517 FacePlane_exportTokens(m_face.getPlane(), writer);
518 FaceShader_exportTokens(m_face.getShader(), writer);
519 FaceTexdef_exportTokens(m_face.getTexdef(), writer);
524 class HalfLifeFaceTokenExporter
528 HalfLifeFaceTokenExporter(const Face& face) : m_face(face)
531 void exportTokens(TokenWriter& writer) const
533 FacePlane_exportTokens(m_face.getPlane(), writer);
534 FaceShader_exportTokens(m_face.getShader(), writer);
535 FaceTexdef_HalfLife_exportTokens(m_face.getTexdef(), writer);
541 class BrushTokenImporter : public MapImporter
546 BrushTokenImporter(Brush& brush) : m_brush(brush)
549 bool importTokens(Tokeniser& tokeniser)
551 if(Brush::m_type == eBrushTypeQuake3BP || Brush::m_type == eBrushTypeDoom3 || Brush::m_type == eBrushTypeQuake4)
553 tokeniser.nextLine();
554 RETURN_FALSE_IF_FAIL(Tokeniser_parseToken(tokeniser, "{"));
558 // check for end of brush
559 tokeniser.nextLine();
560 const char* token = tokeniser.getToken();
561 if(string_equal(token, "}"))
566 tokeniser.ungetToken();
568 m_brush.push_back(FaceSmartPointer(new Face(&m_brush)));
571 tokeniser.nextLine();
573 Face& face = *m_brush.back();
575 switch(Brush::m_type)
577 case eBrushTypeDoom3:
579 Doom3FaceTokenImporter importer(face);
580 RETURN_FALSE_IF_FAIL(importer.importTokens(tokeniser));
583 case eBrushTypeQuake4:
585 Quake4FaceTokenImporter importer(face);
586 RETURN_FALSE_IF_FAIL(importer.importTokens(tokeniser));
589 case eBrushTypeQuake2:
591 Quake2FaceTokenImporter importer(face);
592 RETURN_FALSE_IF_FAIL(importer.importTokens(tokeniser));
595 case eBrushTypeQuake3:
597 Quake3FaceTokenImporter importer(face);
598 RETURN_FALSE_IF_FAIL(importer.importTokens(tokeniser));
601 case eBrushTypeQuake3BP:
603 Quake3BPFaceTokenImporter importer(face);
604 RETURN_FALSE_IF_FAIL(importer.importTokens(tokeniser));
607 case eBrushTypeQuake:
609 QuakeFaceTokenImporter importer(face);
610 RETURN_FALSE_IF_FAIL(importer.importTokens(tokeniser));
613 case eBrushTypeHalfLife:
615 HalfLifeFaceTokenImporter importer(face);
616 RETURN_FALSE_IF_FAIL(importer.importTokens(tokeniser));
622 if(Brush::m_type == eBrushTypeQuake3BP || Brush::m_type == eBrushTypeDoom3 || Brush::m_type == eBrushTypeQuake4)
624 tokeniser.nextLine();
625 RETURN_FALSE_IF_FAIL(Tokeniser_parseToken(tokeniser, "}"));
628 m_brush.planeChanged();
629 m_brush.shaderChanged();
636 class BrushTokenExporter : public MapExporter
638 const Brush& m_brush;
641 BrushTokenExporter(const Brush& brush) : m_brush(brush)
644 void exportTokens(TokenWriter& writer) const
646 m_brush.evaluateBRep(); // ensure b-rep is up-to-date, so that non-contributing faces can be identified.
648 if(!m_brush.hasContributingFaces())
653 writer.writeToken("{");
656 if(Brush::m_type == eBrushTypeQuake3BP)
658 writer.writeToken("brushDef");
660 writer.writeToken("{");
664 if(Brush::m_type == eBrushTypeDoom3 || Brush::m_type == eBrushTypeQuake4)
666 writer.writeToken("brushDef3");
668 writer.writeToken("{");
672 for(Brush::const_iterator i = m_brush.begin(); i != m_brush.end(); ++i)
674 const Face& face = *(*i);
676 if(face.contributes())
678 switch(Brush::m_type)
680 case eBrushTypeDoom3:
682 Doom3FaceTokenExporter exporter(face);
683 exporter.exportTokens(writer);
686 case eBrushTypeQuake4:
688 Quake4FaceTokenExporter exporter(face);
689 exporter.exportTokens(writer);
692 case eBrushTypeQuake2:
694 Quake2FaceTokenExporter exporter(face);
695 exporter.exportTokens(writer);
698 case eBrushTypeQuake3:
700 Quake3FaceTokenExporter exporter(face);
701 exporter.exportTokens(writer);
704 case eBrushTypeQuake3BP:
706 Quake3BPFaceTokenExporter exporter(face);
707 exporter.exportTokens(writer);
710 case eBrushTypeQuake:
712 QuakeFaceTokenExporter exporter(face);
713 exporter.exportTokens(writer);
716 case eBrushTypeHalfLife:
718 HalfLifeFaceTokenExporter exporter(face);
719 exporter.exportTokens(writer);
726 if(Brush::m_type == eBrushTypeQuake3BP || Brush::m_type == eBrushTypeDoom3 || Brush::m_type == eBrushTypeQuake4)
728 writer.writeToken("}");
732 writer.writeToken("}");