#include "ifilesystem.h"
#include "namespace.h"
#include "moduleobserver.h"
-#include "moduleobservers.h"
#include <set>
void AddRegionBrushes( void );
void RemoveRegionBrushes( void );
-/* Map open/close observers */
-
-ModuleObservers g_mapPathObservers;
-
-class MapFileObserver : public ModuleObserver
-{
-void realise() {
- // Restart VFS to apply new pak filtering based on mapname
- // needed for daemon dpk vfs
- VFS_Restart();
-}
-void unrealise() { }
-};
-
-MapFileObserver g_mapFileObserver;
-
-void BindMapFileObservers(){
- g_mapPathObservers.attach( g_mapFileObserver );
-}
-
-void UnBindMapFileObservers(){
- g_mapPathObservers.detach( g_mapFileObserver );
-}
/*
g_currentMap = 0;
Brush_unlatchPreferences();
- g_mapPathObservers.unrealise();
}
class EntityFindByClassname : public scene::Graph::Walker
}
Brush_toggleFormat( i );
g_map.m_name = filename;
- g_mapPathObservers.realise();
Map_UpdateTitle( g_map );
g_map.m_resource = GlobalReferenceCache().capture( g_map.m_name.c_str() );
if ( format ) {
Map_StartPosition();
g_currentMap = &g_map;
+
+ // restart VFS to apply new pak filtering based on mapname
+ // needed for daemon DPK VFS
+ VFS_Restart();
}
class Excluder
g_map.m_resource->detach( g_map );
GlobalReferenceCache().release( g_map.m_name.c_str() );
- g_mapPathObservers.unrealise();
g_map.m_resource = resource;
g_map.m_name = absolute;
- g_mapPathObservers.realise();
Map_UpdateTitle( g_map );
g_map.m_resource->attach( g_map );
+ // refresh VFS to apply new pak filtering based on mapname
+ // needed for daemon DPK VFS
+ VFS_Refresh();
}
void Map_Rename( const char* filename ){
//globalOutputStream() << "Map_New\n";
g_map.m_name = "unnamed.map";
- g_mapPathObservers.realise();
Map_UpdateTitle( g_map );
{
FocusViews( g_vector3_identity, 0 );
g_currentMap = &g_map;
+
+ // restart VFS to apply new pak filtering based on mapname
+ // needed for daemon DPK VFS
+ VFS_Restart();
}
extern void ConstructRegionBrushes( scene::Node * brushes[6], const Vector3 ®ion_mins, const Vector3 ®ion_maxs );
*/
bool Map_SaveFile( const char* filename ){
ScopeDisableScreenUpdates disableScreenUpdates( "Processing...", "Saving Map" );
- return MapResource_saveFile( MapFormat_forFile( filename ), GlobalSceneGraph().root(), Map_Traverse, filename );
+ bool success = MapResource_saveFile( MapFormat_forFile( filename ), GlobalSceneGraph().root(), Map_Traverse, filename );
+ if ( success ) {
+ // refresh VFS to apply new pak filtering based on mapname
+ // needed for daemon DPK VFS
+ VFS_Refresh();
+ }
+ return success;
}
//