- if (data->ignore_depth == 0)
- {
- if(data->pGeometry != 0)
- // we have a handler
- {
- data->pGeometry->saxStartElement (data, name, attrs);
- }
- else
- {
- if (strcmp(reinterpret_cast<const char*>(name), "q3map_feedback") == 0)
- {
- // check the correct version
- // old q3map don't send a version attribute
- // the ones we support .. send Q3MAP_STREAM_VERSION
- if (!attrs[0] || !attrs[1] || (strcmp(reinterpret_cast<const char*>(attrs[0]), "version") != 0))
- {
- message_flush(data);
- globalErrorStream() << "No stream version given in the feedback stream, this is an old q3map version.\n"
- "Please turn off monitored compiling if you still wish to use this q3map executable\n";
- abortStream(data);
- return;
- }
- else if (strcmp(reinterpret_cast<const char*>(attrs[1]), Q3MAP_STREAM_VERSION) != 0)
- {
- message_flush(data);
- globalErrorStream() <<
- "This version of Radiant reads version " Q3MAP_STREAM_VERSION " debug streams, I got an incoming connection with version " << reinterpret_cast<const char*>(attrs[1]) << "\n"
- "Please make sure your versions of Radiant and q3map are matching.\n";
- abortStream(data);
- return;
- }
- }
- // we don't treat locally
- else if (strcmp(reinterpret_cast<const char*>(name), "message") == 0)
- {
- int msg_level = atoi(reinterpret_cast<const char*>(attrs[1]));
- if(msg_level != data->msg_level)
- {
- message_flush(data);
- data->msg_level = msg_level;
- }
- }
- else if (strcmp(reinterpret_cast<const char*>(name), "polyline") == 0)
- // polyline has a particular status .. right now we only use it for leakfile ..
- {
- data->geometry_depth = data->recurse;
- data->pGeometry = &g_pointfile;
- data->pGeometry->saxStartElement (data, name, attrs);
- }
- else if (strcmp(reinterpret_cast<const char*>(name), "select") == 0)
- {
- CSelectMsg *pSelect = new CSelectMsg();
- data->geometry_depth = data->recurse;
- data->pGeometry = pSelect;
- data->pGeometry->saxStartElement (data, name, attrs);
- }
- else if (strcmp(reinterpret_cast<const char*>(name), "pointmsg") == 0)
- {
- CPointMsg *pPoint = new CPointMsg();
- data->geometry_depth = data->recurse;
- data->pGeometry = pPoint;
- data->pGeometry->saxStartElement (data, name, attrs);
- }
- else if (strcmp(reinterpret_cast<const char*>(name), "windingmsg") == 0)
- {
- CWindingMsg *pWinding = new CWindingMsg();
- data->geometry_depth = data->recurse;
- data->pGeometry = pWinding;
- data->pGeometry->saxStartElement (data, name, attrs);
- }
- else
- {
- globalErrorStream() << "Warning: ignoring unrecognized node in XML stream (" << reinterpret_cast<const char*>(name) << ")\n";
- // we don't recognize this node, jump over it
- // (NOTE: the ignore mechanism is a bit screwed, only works when starting an ignore at the highest level)
- data->ignore_depth = data->recurse;
- }
- }
- }
- data->recurse++;
-}
-
-static void saxEndElement(message_info_t *data, const xmlChar *name)
-{
+ if ( data->ignore_depth == 0 ) {
+ if ( data->pGeometry != 0 ) {
+ // we have a handler
+ data->pGeometry->saxStartElement( data, name, attrs );
+ }
+ else
+ {
+ if ( strcmp( reinterpret_cast<const char*>( name ), "q3map_feedback" ) == 0 ) {
+ // check the correct version
+ // old q3map don't send a version attribute
+ // the ones we support .. send Q3MAP_STREAM_VERSION
+ if ( !attrs[0] || !attrs[1] || ( strcmp( reinterpret_cast<const char*>( attrs[0] ), "version" ) != 0 ) ) {
+ message_flush( data );
+ globalErrorStream() << "No stream version given in the feedback stream, this is an old q3map version.\n"
+ "Please turn off monitored compiling if you still wish to use this q3map executable\n";
+ abortStream( data );
+ return;
+ }
+ else if ( strcmp( reinterpret_cast<const char*>( attrs[1] ), Q3MAP_STREAM_VERSION ) != 0 ) {
+ message_flush( data );
+ globalErrorStream() <<
+ "This version of Radiant reads version " Q3MAP_STREAM_VERSION " debug streams, I got an incoming connection with version " << reinterpret_cast<const char*>( attrs[1] ) << "\n"
+ "Please make sure your versions of Radiant and q3map are matching.\n";
+ abortStream( data );
+ return;
+ }
+ }
+ // we don't treat locally
+ else if ( strcmp( reinterpret_cast<const char*>( name ), "message" ) == 0 ) {
+ int msg_level = atoi( reinterpret_cast<const char*>( attrs[1] ) );
+ if ( msg_level != data->msg_level ) {
+ message_flush( data );
+ data->msg_level = msg_level;
+ }
+ }
+ else if ( strcmp( reinterpret_cast<const char*>( name ), "polyline" ) == 0 ) {
+ // polyline has a particular status .. right now we only use it for leakfile ..
+ data->geometry_depth = data->recurse;
+ data->pGeometry = &g_pointfile;
+ data->pGeometry->saxStartElement( data, name, attrs );
+ }
+ else if ( strcmp( reinterpret_cast<const char*>( name ), "select" ) == 0 ) {
+ CSelectMsg *pSelect = new CSelectMsg();
+ data->geometry_depth = data->recurse;
+ data->pGeometry = pSelect;
+ data->pGeometry->saxStartElement( data, name, attrs );
+ }
+ else if ( strcmp( reinterpret_cast<const char*>( name ), "pointmsg" ) == 0 ) {
+ CPointMsg *pPoint = new CPointMsg();
+ data->geometry_depth = data->recurse;
+ data->pGeometry = pPoint;
+ data->pGeometry->saxStartElement( data, name, attrs );
+ }
+ else if ( strcmp( reinterpret_cast<const char*>( name ), "windingmsg" ) == 0 ) {
+ CWindingMsg *pWinding = new CWindingMsg();
+ data->geometry_depth = data->recurse;
+ data->pGeometry = pWinding;
+ data->pGeometry->saxStartElement( data, name, attrs );
+ }
+ else
+ {
+ globalErrorStream() << "Warning: ignoring unrecognized node in XML stream (" << reinterpret_cast<const char*>( name ) << ")\n";
+ // we don't recognize this node, jump over it
+ // (NOTE: the ignore mechanism is a bit screwed, only works when starting an ignore at the highest level)
+ data->ignore_depth = data->recurse;
+ }
+ }
+ }
+ data->recurse++;
+}
+
+static void saxEndElement( message_info_t *data, const xmlChar *name ){