Beispiel #1
0
        public static PluginsLoader GetInstance()
        {
            instance.LoadAssemblyPlugins();

            Config.GetInstance();
            Terrain.GetInstance();
            HeightMapPersistence.GetInstance();
            SlopeMapPersistence.GetInstance();
            MouseFilterSdlMouseCache.GetInstance();
            KeyFilterSdlKeyCache.GetInstance();
            KeyFilterConfigMappingsFactory.GetInstance();
            //HeightEditor.GetInstance();
            EditController.GetInstance();
            Camera.GetInstance();
            Framerate.GetInstance();
            FrustrumCulling.GetInstance();

            BrushShapeController.GetInstance().Register(new RoundBrush());
            BrushShapeController.GetInstance().Register(new SquareBrush());

            BrushEffectController.GetInstance().Register(new RaiseLower());
            BrushEffectController.GetInstance().Register(new Flatten());
            BrushEffectController.GetInstance().Register(new PaintTexture());
            BrushEffectController.GetInstance().Register(new AddFeature());
            BrushEffectController.GetInstance().Register(new FixedHeight());

            //Sm3Persistence.GetInstance().LoadSm3("maps/Whakamatunga_Riri.sm3");
            //EditTexture.GetInstance();
            //FeatureEditing.GetInstance();

            MainUI.GetInstance();

            return(instance);
        }
Beispiel #2
0
        public Camera()
        {
            RendererFactory.GetInstance().PreDrawEvent  += new PreDrawCallback(renderer_PreDrawEvent);
            IMouseFilterMouseCache mousefiltermousecache = MouseFilterMouseCacheFactory.GetInstance();

            mousemove = MouseMoveConfigMappings.GetInstance();
            config    = Config.GetInstance();

            KeyFilterConfigMappingsFactory.GetInstance().RegisterCommand(OverheadOTAConfigName, new KeyCommandHandler(CameraModeOverheadTAHandler));
            KeyFilterConfigMappingsFactory.GetInstance().RegisterCommand(OverheadOTAOrbitConfigName, new KeyCommandHandler(CameraModeOverheadTAHandlerOrbit));

            /*
             * KeyFilterComboKeys.GetInstance().RegisterCombo(
             *  new string[]{"cameramode"}, null, new KeyComboHandler( CameraModeZoomHandler ) );
             * KeyFilterComboKeys.GetInstance().RegisterCombo(
             *  new string[]{"cameramode","cameraorbit"}, null, new KeyComboHandler( CameraModeOrbitHandler ) );
             * KeyFilterComboKeys.GetInstance().RegisterCombo(
             *  new string[]{"cameramode","camerapan"}, null, new KeyComboHandler( CamerModePanHandler ) );
             */

            KeyFilterConfigMappingsFactory.GetInstance().RegisterCommand("toggleviewpoint", new KeyCommandHandler(ToggleViewpointHandler));

            //mousefiltermousecache.MouseDown += new MouseEventHandler( MouseDown );
            mousefiltermousecache.MouseMove += new MouseMoveHandler(mousefiltermousecache_MouseMove);
            //mousefiltermousecache.MouseUp += new MouseEventHandler( MouseUp );
            UpdateRoamingCameraRotAndPosFromOverheadOTA();
        }
Beispiel #3
0
 HeightMapPersistence()
 {
     KeyFilterConfigMappingsFactory.GetInstance().RegisterCommand("saveheightmap", new KeyCommandHandler(SaveHandler));
     KeyFilterConfigMappingsFactory.GetInstance().RegisterCommand("loadheightmap", new KeyCommandHandler(LoadHandler));
     UICommandQueue.GetInstance().RegisterConsumer(typeof(CmdNewHeightMap), new UICommandQueue.UICommandHandler(NewHeightMapHandler));
     UICommandQueue.GetInstance().RegisterConsumer(typeof(CmdOpenHeightMap), new UICommandQueue.UICommandHandler(OpenHeightMapHandler));
     UICommandQueue.GetInstance().RegisterConsumer(typeof(CmdSaveHeightMap), new UICommandQueue.UICommandHandler(SaveHeightMapHandler));
 }
Beispiel #4
0
        HeightEditor() // protected constructor to enforce singleton pattern
        {
            KeyFilterConfigMappingsFactory.GetInstance().RegisterCommand("increaseheight", new KeyCommandHandler(handler_IncreaseHeight));
            KeyFilterConfigMappingsFactory.GetInstance().RegisterCommand("decreaseheight", new KeyCommandHandler(handler_DecreaseHeight));
            RendererFactory.GetInstance().Tick += new TickHandler(renderer_Tick);
            brushsize = Config.GetInstance().HeightEditingDefaultBrushSize;
            speed     = Config.GetInstance().HeightEditingSpeed;

            UICommandQueue.GetInstance().RegisterConsumer(typeof(UICommandChangeBrushSize), new UICommandQueue.UICommandHandler(ChangeBrushSize));
            UICommandQueue.GetInstance().RegisterConsumer(typeof(UICommandBrushEffect), new UICommandQueue.UICommandHandler(ChangeBrushEffect));
        }
Beispiel #5
0
        public Camera()
        {
            RendererFactory.GetInstance().PreDrawEvent  += new PreDrawCallback(renderer_PreDrawEvent);
            IMouseFilterMouseCache mousefiltermousecache = MouseFilterMouseCacheFactory.GetInstance();

            mousemove = MouseMoveConfigMappings.GetInstance();
            config    = Config.GetInstance();

            KeyFilterConfigMappingsFactory.GetInstance().RegisterCommand(OverheadOTATranslateConfigName, new KeyCommandHandler(CameraModeOverheadTAHandlerTranslate));
            KeyFilterConfigMappingsFactory.GetInstance().RegisterCommand(OverheadOTAOrbitConfigName, new KeyCommandHandler(CameraModeOverheadTAHandlerOrbit));
            KeyFilterConfigMappingsFactory.GetInstance().RegisterCommand(OverheadOTAZoomConfigName, new KeyCommandHandler(CameraModeOverheadTAHandlerZoom));

            KeyFilterConfigMappingsFactory.GetInstance().RegisterCommand("toggleviewpoint", new KeyCommandHandler(ToggleViewpointHandler));

            mousefiltermousecache.MouseMove += new MouseMoveHandler(mousefiltermousecache_MouseMove);
            UpdateRoamingCameraRotAndPosFromOverheadOTA();
        }
Beispiel #6
0
 public QuitHandler()
 {
     KeyFilterConfigMappingsFactory.GetInstance().RegisterCommand("quit", new KeyCommandHandler(Quit));
 }
Beispiel #7
0
 HeightMapPersistence()
 {
     KeyFilterConfigMappingsFactory.GetInstance().RegisterCommand("saveheightmap", new KeyCommandHandler(SaveHandler));
     KeyFilterConfigMappingsFactory.GetInstance().RegisterCommand("loadheightmap", new KeyCommandHandler(LoadHandler));
 }
Beispiel #8
0
 SlopeMapPersistence()
 {
     KeyFilterConfigMappingsFactory.GetInstance().RegisterCommand("saveslopemap", new KeyCommandHandler(SaveHandler));
 }
Beispiel #9
0
 public EditController()
 {
     KeyFilterConfigMappingsFactory.GetInstance().RegisterCommand("increaseheight", new KeyCommandHandler(handler_IncreaseHeight));
     KeyFilterConfigMappingsFactory.GetInstance().RegisterCommand("decreaseheight", new KeyCommandHandler(handler_DecreaseHeight));
     RendererFactory.GetInstance().Tick += new TickHandler(renderer_Tick);
 }
Beispiel #10
0
 SlopeMapPersistence()
 {
     KeyFilterConfigMappingsFactory.GetInstance().RegisterCommand("saveslopemap", new KeyCommandHandler(SaveHandler));
     UICommandQueue.GetInstance().RegisterConsumer(typeof(CmdExportSlopeMap), new UICommandQueue.UICommandHandler(ExportSlopeMapHandler));
 }