+static void Mod_Q1BSP_LoadMapBrushes(void)
+{
+#if 0
+// unfinished
+ int submodel, numbrushes;
+ qboolean firstbrush;
+ char *text, *maptext;
+ char mapfilename[MAX_QPATH];
+ FS_StripExtension (loadmodel->name, mapfilename, sizeof (mapfilename));
+ strlcat (mapfilename, ".map", sizeof (mapfilename));
+ maptext = (qbyte*) FS_LoadFile(mapfilename, tempmempool, false);
+ if (!maptext)
+ return;
+ text = maptext;
+ if (!COM_ParseToken(&data, false))
+ return; // error
+ submodel = 0;
+ for (;;)
+ {
+ if (!COM_ParseToken(&data, false))
+ break;
+ if (com_token[0] != '{')
+ return; // error
+ // entity
+ firstbrush = true;
+ numbrushes = 0;
+ maxbrushes = 256;
+ brushes = Mem_Alloc(loadmodel->mempool, maxbrushes * sizeof(mbrush_t));
+ for (;;)
+ {
+ if (!COM_ParseToken(&data, false))
+ return; // error
+ if (com_token[0] == '}')
+ break; // end of entity
+ if (com_token[0] == '{')
+ {
+ // brush
+ if (firstbrush)
+ {
+ if (submodel)
+ {
+ if (submodel > loadmodel->brush.numsubmodels)
+ {
+ Con_Printf("Mod_Q1BSP_LoadMapBrushes: .map has more submodels than .bsp!\n");
+ model = NULL;
+ }
+ else
+ model = loadmodel->brush.submodels[submodel];
+ }
+ else
+ model = loadmodel;
+ }
+ for (;;)
+ {
+ if (!COM_ParseToken(&data, false))
+ return; // error
+ if (com_token[0] == '}')
+ break; // end of brush
+ // each brush face should be this format:
+ // ( x y z ) ( x y z ) ( x y z ) texture scroll_s scroll_t rotateangle scale_s scale_t
+ // FIXME: support hl .map format
+ for (pointnum = 0;pointnum < 3;pointnum++)
+ {
+ COM_ParseToken(&data, false);
+ for (componentnum = 0;componentnum < 3;componentnum++)
+ {
+ COM_ParseToken(&data, false);
+ point[pointnum][componentnum] = atof(com_token);
+ }
+ COM_ParseToken(&data, false);
+ }
+ COM_ParseToken(&data, false);
+ strlcpy(facetexture, com_token, sizeof(facetexture));
+ COM_ParseToken(&data, false);
+ //scroll_s = atof(com_token);
+ COM_ParseToken(&data, false);
+ //scroll_t = atof(com_token);
+ COM_ParseToken(&data, false);
+ //rotate = atof(com_token);
+ COM_ParseToken(&data, false);
+ //scale_s = atof(com_token);
+ COM_ParseToken(&data, false);
+ //scale_t = atof(com_token);
+ TriangleNormal(point[0], point[1], point[2], planenormal);
+ VectorNormalizeDouble(planenormal);
+ planedist = DotProduct(point[0], planenormal);
+ //ChooseTexturePlane(planenormal, texturevector[0], texturevector[1]);
+ }
+ continue;
+ }
+ }
+ }
+#endif
+}
+
+