Ejemplo n.º 1
0
        public MainViewModel(
            ICameraManager cameraManager,
            IReportManager reportManager,
            IConfigManager configManager,
            IDataManager dataManager)
        {
            _cameraManager = cameraManager;
            _reportManager = reportManager;
            _configManager = configManager;
            _dataManager   = dataManager;

            Logs     = new ObservableCollection <SystemLogViewModel>();
            TimeList = new List <SelectItem>
            {
                new SelectItem {
                    Value = ReportPeriodType.M15, Display = "15 Minute"
                },
                new SelectItem {
                    Value = ReportPeriodType.M30, Display = "30 Minute"
                },
                new SelectItem {
                    Value = ReportPeriodType.H1, Display = "1 Hour"
                },
            };

            Messenger.Default.Register <DataChangedNotificationMessage>(this, (msg) =>
            {
                if (msg.DataChanged == DataChangedType.Config)
                {
                    LoadConfig();
                }
            });
        }
 public EnemyFactory(ITickManager tickManager, ICameraManager cameraManager,
                     IEnemyProvider enemyProvider)
 {
     _tickManager   = tickManager;
     _cameraManager = cameraManager;
     _enemyProvider = enemyProvider;
 }
Ejemplo n.º 3
0
 public StaticPositionFollowTargetCameraStrategy(ICameraManager iCameraManager, Camera inCamera, Transform staticPosition, Transform dynamicLookAtTransform)
 {
     mCameraManager           = iCameraManager;
     mCamera                  = inCamera;
     mStaticPositionTransform = staticPosition;
     mLookAtTransform         = dynamicLookAtTransform;
 }
Ejemplo n.º 4
0
 protected CameraMatcher(ICameraManager cameraManager, float updateDelay, UnityEngine.Object target = default)
 {
     this.cameraManager = cameraManager;
     this.updateDelay   = updateDelay;
     this.target        = target;
     timer = new Timer(onLoop: Match);
 }
Ejemplo n.º 5
0
        public PickingManager(IWorldChunks worldChunks,
                              ICameraManager cameraManager,
                              InputsManager inputsManager,
                              SingleArrayChunkContainer cubesHolder,
                              WorldConfiguration worldConfiguration)
        {
            if (worldChunks == null)
            {
                throw new ArgumentNullException("worldChunks");
            }
            if (cameraManager == null)
            {
                throw new ArgumentNullException("cameraManager");
            }
            if (inputsManager == null)
            {
                throw new ArgumentNullException("inputsManager");
            }
            if (cubesHolder == null)
            {
                throw new ArgumentNullException("cubesHolder");
            }
            if (worldConfiguration == null)
            {
                throw new ArgumentNullException("worldConfiguration");
            }

            _worldChunks        = worldChunks;
            _cameraManager      = cameraManager;
            _inputsManager      = inputsManager;
            _cubesHolder        = cubesHolder;
            _worldConfiguration = worldConfiguration;

            ShowDebugInfo = true;
        }
Ejemplo n.º 6
0
    public GameBuilder(GameObject gameObject,
                       ISetting setting,
                       IParticleSpawner particleSpawner,
                       IBlockColorRepository blockColorRepository,
                       List <IGroupPattern> groupPatterns,
                       IBackgroundFactory backgroundFactory,
                       ICameraManager cameraManager,
                       IBlockViewSpawner blockViewSpawner,
                       IFloatingTextRenderer floatingTextRenderer)
    {
        gameObject.transform.localScale = new Vector3(setting.ScalePerBlock, setting.ScalePerBlock, 1);
        setting.Parent = gameObject.transform;

        setting.ParticleSpawner      = particleSpawner;
        setting.BlockColorRepository = blockColorRepository;
        setting.FloatingTextRenderer = floatingTextRenderer;

        _gameObject    = gameObject;
        _setting       = setting;
        _groupPatterns = groupPatterns;

        _backgroundFactory = backgroundFactory;
        _cameraManager     = cameraManager;
        _blockViewSpawner  = blockViewSpawner;
    }
Ejemplo n.º 7
0
 public Matcher(ICameraManager cameraManager, Vector2 referenceSize, Transform transform)
     : base(cameraManager, transform.gameObject)
 {
     this.transform     = transform;
     this.referenceSize = referenceSize;
     initialScale       = transform.localScale;
 }
        internal RenderManager(Engine engine)
        {
            this.engine = engine;

            cameraManager = engine.CameraManager;

            sceneBuffer            = engine.Device.CreateBuffer <SceneBuffer>(BufferTypeEnum.ConstVertex, 1);
            objectBuffer           = engine.Device.CreateBuffer <ObjectBuffer>(BufferTypeEnum.ConstVertex, 1);
            pixelShaderSceneBuffer = engine.Device.CreateBuffer <PixelShaderSceneBuffer>(BufferTypeEnum.ConstPixel, 1);
            instancesBuffer        = engine.Device.CreateBuffer <Matrix>(BufferTypeEnum.Vertex, 1);

            instancesArray = new Matrix[1];

            renderers = new Dictionary <ShaderHandle, Dictionary <Material, Dictionary <Mesh, List <Transform> > > >();

            sceneData = new SceneBuffer();

            defaultSampler = engine.Device.CreateSampler();

            depthStencilZWrite   = engine.Device.CreateDepthStencilState(true);
            depthStencilNoZWrite = engine.Device.CreateDepthStencilState(false);

            renderTexture = engine.Device.CreateRenderTexture((int)engine.WindowHost.WindowWidth, (int)engine.WindowHost.WindowHeight);

            outlineTexture = engine.Device.CreateRenderTexture((int)engine.WindowHost.WindowWidth, (int)engine.WindowHost.WindowHeight);

            planeMesh = engine.MeshManager.CreateMesh(new ScreenPlane());

            blitShader   = engine.ShaderManager.LoadShader("../internalShaders/blit.shader");
            blitMaterial = engine.MaterialManager.CreateMaterial(blitShader);

            unlitMaterial = engine.MaterialManager.CreateMaterial(engine.ShaderManager.LoadShader("../internalShaders/unlit.shader"));
        }
Ejemplo n.º 9
0
        public virtual UniTask InitializeServiceAsync()
        {
            scriptPlayer  = Engine.GetService <IScriptPlayer>();
            cameraManager = Engine.GetService <ICameraManager>();

            return(UniTask.CompletedTask);
        }
Ejemplo n.º 10
0
 public RenderStageVisitor(
     IGpuSurfaceManager surfaceManager,
     ICameraManager cameraManager,
     IDrawStageRenderer drawStageRenderer,
     IColourEffectsStageRenderer colourEffectStageRenderer,
     IBloomStageRenderer bloomEffectStageRenderer,
     IBlurStageRenderer blur2DEffectStageRenderer,
     IBlur1DStageRenderer blur1DEffectStageRenderer,
     IStyleEffectsStageRenderer styleEffectRenderer,
     IMeshRenderStageRenderer meshRenderer,
     IDistortionStageRenderer distortionEffectStageRenderer,
     IMixStageRenderer mixRenderer,
     ICustomShaderStageRenderer customShaderRenderer,
     ICustomVeldridStageRenderer customVeldridRenderer,
     ISurfaceCopyStageRenderer surfaceCopyStageRenderer)
 {
     _surfaceManager            = surfaceManager;
     _cameraManager             = cameraManager;
     _drawStageRenderer         = drawStageRenderer;
     _colourEffectStageRenderer = colourEffectStageRenderer;
     _bloomEffectStageRenderer  = bloomEffectStageRenderer;
     _blur1DEffectStageRenderer = blur1DEffectStageRenderer;
     _blur2DEffectStageRenderer = blur2DEffectStageRenderer;
     _styleEffectRenderer       = styleEffectRenderer;
     _meshRenderer = meshRenderer;
     _distortionEffectStageRenderer = distortionEffectStageRenderer;
     _mixRenderer              = mixRenderer;
     _customShaderRenderer     = customShaderRenderer;
     _customVeldridRenderer    = customVeldridRenderer;
     _surfaceCopyStageRenderer = surfaceCopyStageRenderer;
 }
Ejemplo n.º 11
0
        private void SetImplementation(RuntimePlatform platform, ClientConfig clientConfig)
        {
            switch (platform)
            {
            case RuntimePlatform.Android:
                _client        = new ClientAndroid(clientConfig);
                _audioManager  = new AudioManagerAndroid();
                _cameraManager = new CameraManagerAndroid();
                break;

            case RuntimePlatform.IPhonePlayer:
                _client        = new ClientIOS(clientConfig);
                _audioManager  = new AudioManagerIOS();
                _cameraManager = new CameraManagerIOS();
                break;

            case RuntimePlatform.WindowsEditor:
            case RuntimePlatform.OSXEditor:
            case RuntimePlatform.LinuxEditor:
                _client = new ClientUnityEditor();
                break;

            default:
                throw new UnsupportedPlatformException();
            }
        }
Ejemplo n.º 12
0
        public Graphics(IStartupPropertiesCache startUpPropertiesCache,
                        ISystemComponents systemComponents,
                        IRenderCommandQueue renderCommandQueue,
                        ICommandProcessor commandProcessor,
                        IRenderStageManager renderStageManager,
                        IRenderStageVisitor renderStageVisitor,
                        IGpuSurfaceManager surfaceManager,
                        IViewportManager viewportManager,
                        IFontManager fontManager,
                        ICameraManager cameraManager,
                        IFrameworkDebugOverlay debugOverlay)
        {
            _startUpPropertiesCache = startUpPropertiesCache;
            _systemComponents       = systemComponents;
            _renderCommandQueue     = renderCommandQueue;
            _commandProcessor       = commandProcessor;
            _renderStageManager     = renderStageManager;
            _renderStageVisitor     = renderStageVisitor;
            _surfaceManager         = surfaceManager;
            _viewportManager        = viewportManager;
            _fontManager            = fontManager;
            _cameraManager          = cameraManager;
            _debugOverlay           = debugOverlay;

            Initialise();
        }
Ejemplo n.º 13
0
        private void Init()
        {
            Mapper.Initialize(cfg =>
            {
                cfg.AddProfile <ModelProfile>();
            });

            _configManager = new ConfigManager();
            _config        = _configManager.GetConfig();

            string connectionString = _config.DatabaseSource;

            IHeatMapRepository  heatMapRepository  = new HeatMapRepository(connectionString);
            ICountingRepository countingRepository = new CountingRepository(connectionString);

            _dataManager = new DataManager(heatMapRepository, countingRepository);

            IReportRepository reportRepository = new ReportRepository(connectionString);

            _reportManager = new ReportManager(reportRepository);

            ICameraRepository cameraRepository = new CameraRepository(connectionString);

            _cameraManager = new CameraManager(cameraRepository);
        }
Ejemplo n.º 14
0
 public ViewFactory(CanvasContainer canvasContainer, ViewsContainer viewsContainer,
                    ICameraManager cameraManager, ILoggerManager loggerManager)
 {
     _cameraManager   = cameraManager;
     _canvasContainer = canvasContainer;
     _viewsContainer  = viewsContainer;
     _logger          = loggerManager.GetLogger();
 }
Ejemplo n.º 15
0
 public RenderLifeBarSystem(SpriteBatch spriteBatch,
                            ICameraManager camera,
                            IContentManager content)
 {
     _spriteBatch = spriteBatch;
     _camera      = camera;
     _content     = content;
 }
Ejemplo n.º 16
0
 public CoordinateTransforms(ISystemComponents systemComponents,
                             ICameraManager cameraManager,
                             IViewportManager viewportManager)
 {
     _systemComponents = systemComponents;
     _cameraManager    = cameraManager;
     _viewportManager  = viewportManager;
 }
 public PlayerManager(IPlayerConfig playerConfig, ITickManager tickManager,
                      ICameraManager cameraManager, ISpellManager spellManager)
 {
     _playerConfig  = playerConfig;
     _tickManager   = tickManager;
     _cameraManager = cameraManager;
     _spellManager  = spellManager;
 }
 public ApplicationManager(IUserManager userManager, IFaceManager faceManager, ICameraManager cameraManager, INotificationManager notificationManager, ILocationManager locationManager)
 {
     this.userManager         = userManager;
     this.faceManager         = faceManager;
     this.cameraManager       = cameraManager;
     this.notificationManager = notificationManager;
     this.locationManager     = locationManager;
 }
Ejemplo n.º 19
0
 public MapManager(IMapSettingsProvider mapSettingsProvider, IEnemyManager enemyManager,
                   IPlayerManager playerManager, ICameraManager cameraManager)
 {
     _mapSettingsProvider = mapSettingsProvider;
     _enemyManager        = enemyManager;
     _playerManager       = playerManager;
     _cameraManager       = cameraManager;
 }
Ejemplo n.º 20
0
        public CameraLookController(ICameraManager cameraManager, IInputSampler xSampler, IInputSampler ySampler)
        {
            this.cameraManager = cameraManager;
            this.xSampler      = xSampler;
            this.ySampler      = ySampler;

            origin = cameraManager.Configuration.InitialPosition + cameraManager.Offset;
        }
Ejemplo n.º 21
0
        public BackgroundMatcher(ICameraManager cameraManager, TransitionalSpriteRenderer renderer, BackgroundMetadata metadata)
            : base(cameraManager, updateDelay, renderer)
        {
            this.renderer = renderer;
            this.metadata = metadata;

            MatchMode        = metadata.MatchMode;
            CustomMatchRatio = metadata.CustomMatchRatio;
        }
Ejemplo n.º 22
0
        public CameraSettingViewModel(
            IDialogService dialogService,
            ICameraManager cameraManager)
        {
            _dialogService = dialogService;
            _cameraManager = cameraManager;

            Camera = new CameraViewModel();
        }
Ejemplo n.º 23
0
        protected override void Awake()
        {
            base.Awake();

            this.AssertRequiredObjects(image);

            cameraManager  = Engine.GetService <ICameraManager>();
            material       = new TransitionalSpriteMaterial(TransitionalSpriteMaterial.Variant.Default);
            image.material = material;
        }
Ejemplo n.º 24
0
        public ValkyrieSceneProvider(GraphicsDevice graphicsdevice, SpriteBatch spritebatch, IFogRenderer fogrenderer)
        {
            this.device = graphicsdevice;
            this.spritebatch = spritebatch;

            players = new ValkyriePlayerManager<BaseCharacter>();
            cameras = new ValkyrieCameraManager<BaseCamera>();
            renderers = new ValkyrieRendererManager();
            this.fogrenderer = fogrenderer;
        }
Ejemplo n.º 25
0
 public RenderStaticGraphicSystem(
     SpriteBatch spriteBatch,
     ICameraManager camera)
     : base(Aspect.All(
                typeof(StaticGraphic),
                typeof(Position)))
 {
     _spriteBatch = spriteBatch;
     _camera      = camera;
 }
Ejemplo n.º 26
0
        public void LoadContent(Game game)
        {
            this.game = game;
              cameraManager = (ICameraManager)game.Services.GetService(typeof(ICameraManager));

              effect = game.Content.Load<Effect>(@"Effects\SpaceDome");
              vertexDeclaration = VertexPositionColor.VertexDeclaration; // new VertexDeclaration(game.GraphicsDevice, VertexPositionColor.VertexElements);
              vertexBuffer = new VertexBuffer(game.GraphicsDevice, typeof(VertexPositionColor), StarCount, BufferUsage.WriteOnly);

              GenerateStars();
        }
Ejemplo n.º 27
0
 public void Init()
 {
     flag             = true;
     BuildingViews    = new Dictionary <int, BuildingView>();
     BuildState       = BUILD_STATE.Idle;
     _cameraManager   = GameClient.Get <ICameraManager>();
     _uiManager       = GameClient.Get <IUIManager>();
     _planeManager    = GameClient.Get <IPlaneManager>();
     _settingsManager = GameClient.Get <ISettingsManager>();
     _parent          = _planeManager.Plane.transform.Find("Buildings");
 }
Ejemplo n.º 28
0
        public CameraManager(ICameraManager engineCamera,
                             IInputManager inputManager,
                             IUIManager uiManager)
        {
            this.engineCamera = engineCamera;
            this.inputManager = inputManager;
            this.uiManager    = uiManager;

            Position = new Vector3(285.396f, -4746.17f, 9.48428f + 20).ToOpenGlPosition();
            Rotation = Quaternion.LookRotation(
                new Vector3(223.698f, -4745.11f, 10.1022f + 20).ToOpenGlPosition() - Position, Vector3.Up);
            engineCamera.MainCamera.FOV = 75;
        }
Ejemplo n.º 29
0
    public void Init()
    {
        _uiManager     = GameClient.Get <IUIManager>();
        _cameraManager = GameClient.Get <ICameraManager>();
        var prefab = Resources.Load <GameObject>("Prefabs/UI/Pages/GamePage");

        _selfPage = MonoBehaviour.Instantiate(prefab) as GameObject;
        _selfPage.transform.SetParent(GameObject.Find("Canvas").transform, false);
        _buttonGrid = _selfPage.transform.Find("ButtonGrid").GetComponent <Button>();
        _buttonShop = _selfPage.transform.Find("ButtonShop").GetComponent <Button>();
        _buttonGrid.onClick.AddListener(GridOnClickHandler);
        _buttonShop.onClick.AddListener(ShopOnClickHandler);
    }
Ejemplo n.º 30
0
    public void Init()
    {
        testSetting = TestSetting.Get();
        game = new Game(testSetting);
        cameraManager = Substitute.For<ICameraManager>();
        backgroundFactory = Substitute.For<IBackgroundFactory>();
        gridFactory = Substitute.For<IGridFactory>();
        groupFactory = Substitute.For<IGroupFactory>();

        game.CameraManager = cameraManager;
        game.BackgroundFactory = backgroundFactory;
        game.GridFactory = gridFactory;
        game.GroupFactory = groupFactory;
    }
Ejemplo n.º 31
0
 public GameRoot
 (
     IResourcesManager resourcesManager,
     ITickable tickable,
     IGameConfig config,
     ICoroutine coroutine,
     ICameraManager cameraManager
 )
 {
     _resourcesManager = resourcesManager;
     _tickable         = tickable;
     _config           = config;
     _coroutine        = coroutine;
     _cameraManager    = cameraManager;
 }
Ejemplo n.º 32
0
        public GraphicsResourceReinitialiser(
            IGraphics graphics,
            ICameraManager cameraManager,
            IPipelineFactory pipelineFactory,
            IRenderStageManager renderStageManager,
            IViewportManager viewportManager,
            IFullNdcSpaceQuadVertexBuffer ndcSpaceQuadVertexBuffer,
            IBloomResultMixingRenderer bloomResultMixingRenderer,
            IBloomSamplingRenderer bloomSamplingRender,
            IBlurResultMixingRenderer blurResultMixingRenderer,
            IColourEffectsStageRenderer colourEffectStageRenderer,
            ICopyStageRenderer copyStageRenderer,
            IDistortionGraidentShiftRenderer distortionGradientShiftRenderer,
            IDistortionHeightRenderer distortionHeightRenderer,
            IDistortionRenderer distortionRenderer,
            IDownSamplingRenderer downSamplingRenderer,
            IDrawStageRenderer drawStageRenderer,
            IMeshRenderStageRenderer meshStageRenderer,
            IMixStageRenderer mixStageRenderer,
            ISinglePassGaussianBlurRenderer singlePassGaussianBlurRenderer,
            IStyleEffectsStageRenderer styleEffectStageRenderer,
            ISurfaceCopyStageRenderer surfaceCopyStageRenderer
            )
        {
            _graphics           = graphics;
            _cameraManager      = cameraManager;
            _pipelineFactory    = pipelineFactory;
            _renderStageManager = renderStageManager;
            _viewportManager    = viewportManager;

            _ndcSpaceQuadVertexBuffer = ndcSpaceQuadVertexBuffer;

            _bloomResultMixingRenderer       = bloomResultMixingRenderer;
            _bloomSamplingRender             = bloomSamplingRender;
            _blurResultMixingRenderer        = blurResultMixingRenderer;
            _colourEffectStageRenderer       = colourEffectStageRenderer;
            _copyStageRenderer               = copyStageRenderer;
            _distortionGradientShiftRenderer = distortionGradientShiftRenderer;
            _distortionHeightRenderer        = distortionHeightRenderer;
            _distortionRenderer              = distortionRenderer;
            _downSamplingRenderer            = downSamplingRenderer;
            _drawStageRenderer               = drawStageRenderer;
            _meshStageRenderer               = meshStageRenderer;
            _mixStageRenderer = mixStageRenderer;
            _singlePassGaussianBlurRenderer = singlePassGaussianBlurRenderer;
            _styleEffectStageRenderer       = styleEffectStageRenderer;
            _surfaceCopyStageRenderer       = surfaceCopyStageRenderer;
        }
Ejemplo n.º 33
0
        public ConfigViewModel(
            IDialogService dialogService,
            ICameraManager cameraManager,
            IConfigManager configManager)
        {
            _dialogService = dialogService;
            _cameraManager = cameraManager;
            _configManager = configManager;

            CameraCollection = new ObservableCollection <CameraViewModel>();

            HourList = new List <SelectItem>();
            for (int i = 0; i < 24; i++)
            {
                HourList.Add(new SelectItem {
                    Value = i, Display = $"{i} HR"
                });
            }

            MinuteList = new List <SelectItem>();
            for (int i = 0; i < 60; i++)
            {
                MinuteList.Add(new SelectItem {
                    Value = i, Display = $"{i} MT"
                });
            }

            TimeList = new List <SelectItem>
            {
                new SelectItem {
                    Value = ReportPeriodType.M15, Display = "15 Minute"
                },
                new SelectItem {
                    Value = ReportPeriodType.M30, Display = "30 Minute"
                },
                new SelectItem {
                    Value = ReportPeriodType.H1, Display = "1 Hour"
                },
            };

            Messenger.Default.Register <DataChangedNotificationMessage>(this, async(msg) =>
            {
                if (msg.DataChanged == DataChangedType.Camera)
                {
                    await LoadCameraAsync();
                }
            });
        }
Ejemplo n.º 34
0
 public GameManager(
     EntityWorld world,
     SpriteBatch spriteBatch,
     IGraphicsManager graphicsManager,
     ISystemLoader systemLoader,
     IScreenManager screenManager,
     IScreenFactory screenFactory,
     IInputManager inputManager,
     ICameraManager cameraManager,
     IScriptManager scriptManager
     )
 {
     _world = world;
     _spriteBatch = spriteBatch;
     _graphicsManager = graphicsManager;
     _systemLoader = systemLoader;
     _screenManager = screenManager;
     _screenFactory = screenFactory;
     _inputManager = inputManager;
     _cameraManager = cameraManager;
     _scriptManager = scriptManager;
 }
Ejemplo n.º 35
0
    public PlanetGame()
    {
      graphics = new GraphicsDeviceManager(this);
      Content.RootDirectory = "Content";
      graphics.PreferMultiSampling = true;

//#if perfhud
//      graphics.PreparingDeviceSettings += this.PreparingDeviceSettings;
//#endif


      if (Constants.FullScreen)
      {
        graphics.PreferredBackBufferWidth = Constants.FullScreenWidth;
        graphics.PreferredBackBufferHeight = Constants.FullScreenHeight;
        graphics.ToggleFullScreen();
      }
      else
      {
        graphics.PreferredBackBufferWidth = Constants.WindowedWidth;
        graphics.PreferredBackBufferHeight = Constants.WindowedHeight;
      }

      Globals.Game = this;



#if PROFILE
      graphics.SynchronizeWithVerticalRetrace = false;
      this.IsFixedTimeStep = false;
#endif

      inputManager = InputManager.CreateInputManager(this);
      cameraManager = CameraManager.CreateCameraManager(this);
    }
Ejemplo n.º 36
0
 public override void Initialize()
 {
     base.Initialize();
     r_RasterizerState.CullMode = m_CullMode;
     m_CameraManager = Game.Services.GetService<ICameraManager>();
 }
Ejemplo n.º 37
0
        public static void Initialize(
            IWindowManager windowManager,
            IInputManager inputManager,
            IResourceManager<Texture2D> textureManager,
            IResourceManager<Song> musicManager,
            IResourceManager<SoundEffect> soundFXManager,
            IResourceManager<SpriteFont> fontsManager,
            ISettingsManager settingsManager,
            ICameraManager cameraManager)
        {
            //TODO: Do not require EVERYTHING... Maybe only put the Managers setter public?

            if(windowManager == null)
                throw new ArgumentNullException("windowManager");

            if (inputManager == null)
                throw new ArgumentNullException("inputManager");

            if (textureManager == null)
                throw new ArgumentNullException("textureManager");

            if (musicManager == null)
                throw new ArgumentNullException("musicManager");

            if (soundFXManager == null)
                throw new ArgumentNullException("soundFXManager");

            if (fontsManager == null)
                throw new ArgumentNullException("fontsManager");

            if (settingsManager == null)
                throw new ArgumentNullException("settingsManager");

            if (cameraManager == null)
                throw new ArgumentNullException("cameraManager");

            Window = windowManager;
            Input = inputManager;
            Textures = textureManager;
            Music = musicManager;
            SoundFX = soundFXManager;
            Fonts = fontsManager;
            Settings = settingsManager;
            Cameras = cameraManager;

            /////////////////////
            // TODO: FOR NOW
            Entities = new EntitiesManager();
            SpriteRenderer = new SpriteBatchRenderer(Window.GraphicsDevice);
            ////////////////////

            InitializeManagers();
        }
Ejemplo n.º 38
0
        /// <summary>
        /// Loads the content used by the lensflare component.
        /// </summary>
        public void LoadContent(Game game)
        {
            this.game = game;

              fCameraManager = (ICameraManager)game.Services.GetService(typeof(ICameraManager));

            // Create a SpriteBatch for drawing the glow and flare sprites.
            spriteBatch = new SpriteBatch(game.GraphicsDevice);

            // Load the glow and flare textures.
            glowSprite = game.Content.Load<Texture2D>(@"textures\glow");

            foreach (Flare flare in flares)
            {
              flare.Texture = game.Content.Load<Texture2D>(@"textures\" + flare.TextureName);
            }

            // Effect and vertex declaration for drawing occlusion query polygons.
            basicEffect = new BasicEffect(game.GraphicsDevice);

            basicEffect.View = Matrix.Identity;
            basicEffect.VertexColorEnabled = true;

            fMaskCombine = game.Content.Load<Effect>(@"effects\maskcombine");

            vertexDeclaration = VertexPositionColor.VertexDeclaration; // new VertexDeclaration(game.GraphicsDevice, VertexPositionColor.VertexElements);

            // Create vertex data for the occlusion query polygons.
            queryVertices = new VertexPositionColor[4];

            queryVertices[0].Position = new Vector3(-querySize / 2, -querySize / 2, -1);
            queryVertices[1].Position = new Vector3( querySize / 2, -querySize / 2, -1);
            queryVertices[2].Position = new Vector3( querySize / 2,  querySize / 2, -1);
            queryVertices[3].Position = new Vector3(-querySize / 2,  querySize / 2, -1);

            // Create the occlusion query object.
            occlusionQuery = new OcclusionQuery(game.GraphicsDevice);

            fSunCamera = fCameraManager.GetCamera("SunCam");

            PresentationParameters pp = game.GraphicsDevice.PresentationParameters;

            fSunView = new RenderTarget2D(game.GraphicsDevice, MaskSize, MaskSize, false, pp.BackBufferFormat, pp.DepthStencilFormat, pp.MultiSampleCount, RenderTargetUsage.DiscardContents);
            fIntensityMap = new RenderTarget2D(game.GraphicsDevice, 1, 1, false, SurfaceFormat.Single, pp.DepthStencilFormat, pp.MultiSampleCount, RenderTargetUsage.DiscardContents);

            fIntensityEffect = game.Content.Load<Effect>(@"effects\intensity");
            fIntensityMaskVertexDeclaration = VertexPositionTexture.VertexDeclaration; // new VertexDeclaration(game.GraphicsDevice, VertexPositionTexture.VertexElements);

            fOcclusionPoints = GenerateOcclusionPoints();
        }
Ejemplo n.º 39
0
 public CameraSystem(ICameraManager cameraManager)
 {
     _cameraManager = cameraManager;
 }