-void CWindingMsg::saxCharacters( message_info_t *ctx, const xmlChar *ch, int len ){
- if ( EPointState == WINDING_MESSAGE ) {
- message = g_string_sized_new( len + 1 );
- memcpy( message->str, ch, len );
- message->str[len] = '\0';
- Sys_Printf( "%s\n", message->str );
- }
- else
- {
- char* c;
- int i;
-
- assert( EPointState == WINDING_WINDING );
-
-
- c = (char*)ch;
- sscanf( c, "%i ", &numpoints );
-
- for ( i = 0; i < numpoints; i++ )
- {
- c = strchr( ++c, '(' );
- if ( c ) { // even if we are given the number of points when the cycle begins .. don't trust it too much
- sscanf( c, "(%g %g %g)", &wt[i][0], &wt[i][1], &wt[i][2] );
- }
- else{
- break;
- }
- }
- numpoints = i;
- }
+void CWindingMsg::saxEndElement(message_info_t *ctx, const xmlChar *name)
+{
+ if (string_equal(reinterpret_cast<const char *>( name ), "windingmsg")) {
+ } else if (string_equal(reinterpret_cast<const char *>( name ), "winding")) {
+ const char *c = winding.c_str();
+ sscanf(c, "%i ", &numpoints);
+
+ int i = 0;
+ for (; i < numpoints; i++) {
+ c = strchr(c + 1, '(');
+ if (c) { // even if we are given the number of points when the cycle begins .. don't trust it too much
+ sscanf(c, "(%g %g %g)", &wt[i][0], &wt[i][1], &wt[i][2]);
+ } else {
+ break;
+ }
+ }
+ numpoints = i;
+ }