Ejemplo n.º 1
0
 public FileDiskCacheManager(TileSetting tileSetting, string fName, string fDir)
 {
     _tileSetting      = tileSetting;
     _dataProvider     = GeoDataDriver.Open(fName) as IRasterDataProvider;
     _fDir             = fDir;
     _dataTypeSize     = DataTypeHelper.SizeOf(_dataProvider.DataType);
     _tileBuffer       = new byte[_tileSetting.TileSize * _tileSetting.TileSize * _dataTypeSize];
     _tileBufferHandle = GCHandle.Alloc(_tileBuffer, GCHandleType.Pinned);
     LoadCachedFiles();
 }
Ejemplo n.º 2
0
        public void UpdateTileComputer(ICanvas canvas)
        {
            TileSetting tileSetting = canvas.CanvasSetting != null ? canvas.CanvasSetting.TileSetting : new TileSetting();

            if (_tileComputer == null || _tileComputer.TileSize != tileSetting.TileSize || _tileComputer.SampleRatio != tileSetting.SampleRatio)
            {
                _tileComputer = new TileComputer(tileSetting.TileSize, tileSetting.SampleRatio);
                _leves        = _tileComputer.GetLevelDefs(_dataProvider.Width, _dataProvider.Height);
            }
        }
Ejemplo n.º 3
0
 private void SetFieldsByCanvas()
 {
     if (_canvas != null && _canvas.CanvasSetting != null)
     {
         _tileSetting = _canvas.CanvasSetting.TileSetting;
     }
     if (_canvas != null && _canvas.CanvasSetting != null && _canvas.CanvasSetting.RenderSetting != null)
     {
         _backColor = _canvas.CanvasSetting.RenderSetting.BackColor;
     }
 }
Ejemplo n.º 4
0
 public FileDiskCacheManager(TileSetting tileSetting, IRasterDataProvider dataProvider, string fDir)
 {
     _tileSetting          = tileSetting;
     _isInsideDataProvider = false;
     _dataProvider         = dataProvider;
     _fDir             = fDir;
     _dataTypeSize     = DataTypeHelper.SizeOf(_dataProvider.DataType);
     _tileBuffer       = new byte[_tileSetting.TileSize * _tileSetting.TileSize * _dataTypeSize];
     _tileBufferHandle = GCHandle.Alloc(_tileBuffer, GCHandleType.Pinned);
     LoadCachedFiles();
 }
Ejemplo n.º 5
0
    public TileSystems(Contexts contexts, TileSetting setting, GameObject tileContainer, GameUI ui) : base("Tile Systems")
    {
        //init
        Add(new TileMapCreatingSystem(contexts, setting.GameMap));
        Add(new TileGraphCreatingSystem(contexts));

        //execute
        Add(new TileDataLoadingSystem(contexts, setting));
        Add(new TileViewCreatingSystem(contexts, setting, tileContainer));
        Add(new TileSpriteUpdateSystem(contexts));
        Add(new TilePositionRenderingSystem(contexts));
        Add(new TileActionSystem(contexts));
        Add(new TileActionShowTargetStatusSystem(contexts, ui.TargetPlayerStatus));
        Add(new TileResourceChargeSetupSystem(contexts, setting.TileResourceChargeWeigth));
        Add(new TileResourceSpriteUpdateSystem(contexts));
    }
Ejemplo n.º 6
0
        static FileDiskCacheManagerFactory()
        {
            CanvasSetting setting = null;
            string        fname   = Path.Combine(Path.GetDirectoryName((new TileSetting()).GetType().Assembly.Location), "GeoDo.RSS.Core.DrawEngine.GDIPlus.cnfg.xml");

            if (File.Exists(fname))
            {
                using (CanvasSettingParser p = new CanvasSettingParser())
                {
                    setting = p.Parse(fname);
                    if (!Directory.Exists(setting.CacheSetting.Dir))
                    {
                        Directory.CreateDirectory(setting.CacheSetting.Dir);
                    }
                    _tileSetting  = setting.TileSetting;
                    _cacheSetting = setting.CacheSetting;
                }
            }
            _fileIndexer = new FileIndexer(setting.CacheSetting.Dir);;
        }
Ejemplo n.º 7
0
 public TileBitmapProvider(IRasterDrawing drawing, ICanvas canvas,
                           IRasterDataProvider dataProvider,
                           TileSetting tileSetting, int[] selectedBandNos,
                           GeoDo.RSS.Core.DrawEngine.CoordEnvelope originalEnvelope,
                           float originalResolutionX, float originalResolutionY,
                           IRgbStretcherProvider stretcherProvider, string colortablename)
 {
     _drawing               = drawing;
     _canvas                = canvas;
     _dataProvider          = dataProvider;
     _tileSetting           = tileSetting;
     _selectedBandNos       = selectedBandNos;
     _loadingName           = _dataProvider.fileName;
     _colorTableName        = colortablename;
     _tilesLocator          = new NearestTilesLocator(_dataProvider, originalEnvelope, originalResolutionX, originalResolutionY);
     _tileCacheManager      = new TileBitmapCacheManager();
     _canvasEnvelopeChanged = new EventHandler(CanvasEnvelopeChanged);
     _stretcherProvider     = stretcherProvider;
     CreateDataProviderReader();
     CreateTileLoadWorker();
 }
Ejemplo n.º 8
0
 public void Init()
 {
     _setting = TestHelper.GetGameSetting().TileSetting;
 }
Ejemplo n.º 9
0
 public TileDataLoadingSystem(Contexts contexts, TileSetting setting) : base(contexts.tile)
 {
     _setting = setting;
 }
Ejemplo n.º 10
0
 public TileViewCreatingSystem(Contexts contexts, TileSetting setting, GameObject container) : base(contexts.tile)
 {
     _context   = contexts.tile;
     _setting   = setting;
     _container = container;
 }