-void CPointfile::saxEndElement (message_info_t *ctx, const xmlChar *name)
-{
- if (strcmp ((char *)name, "polyline")==0)
- {
- // we are done
- GenerateDisplayList();
- ctx->bGeometry = false;
- }
+void Pointfile_Destroy(){
+ GlobalShaderCache().detachRenderable( s_pointfile );
+
+ CPointfile::destroyStatic();
+}
+
+
+
+// CPointfile implementation for SAX-specific stuff -------------------------------
+void CPointfile::saxStartElement( message_info_t *ctx, const xmlChar *name, const xmlChar **attrs ){
+ if ( string_equal( reinterpret_cast<const char*>( name ), "polyline" ) ) {
+ Init();
+ // there's a prefs setting to avoid stopping on leak
+ if ( !g_WatchBSP_LeakStop ) {
+ ctx->stop_depth = 0;
+ }
+ }
+}
+
+void CPointfile::saxEndElement( message_info_t *ctx, const xmlChar *name ){
+ if ( string_equal( reinterpret_cast<const char*>( name ), "polyline" ) ) {
+ // we are done
+ GenerateDisplayList();
+ SceneChangeNotify();
+ s_check_point = begin();
+ }
+ else if ( string_equal( reinterpret_cast<const char*>( name ), "point" ) ) {
+ Vector3 v;
+ sscanf( m_characters.c_str(), "%f %f %f\n", &v[0], &v[1], &v[2] );
+ PushPoint( v );
+ m_characters.clear();
+ }