コード例 #1
0
		public static void Init(OpenTKResourceProvider _resourceProvider)
		{
			ResourceProvider = _resourceProvider;

			if (File.Exists(Constants.RESOURCES_PNG_FILE))
			{
				var rsrs = new Bitmap(Constants.RESOURCES_PNG_FILE);
				m_img = new Image(rsrs, false);
				foreach (var tile in _resourceProvider.Tiles)
				{
					tile.UpdateTexCoords(tile.X, tile.Y, rsrs.Width, rsrs.Height);
				}
			}
			else
			{
                throw new ApplicationException("Не найден файл с тайлами " + Path.GetFullPath(Constants.RESOURCES_PNG_FILE));
			}

			TileInfo.FogTexCoords = ((OpenTKTile)TileHelper.AllTiles[ETileset.FOG].Tiles[0]).Texcoords;
		}
コード例 #2
0
        public static void Init(OpenTKResourceProvider _resourceProvider)
        {
            ResourceProvider = _resourceProvider;

            if (File.Exists(Constants.RESOURCES_PNG_FILE))
            {
                var rsrs = new Bitmap(Constants.RESOURCES_PNG_FILE);
                m_img = new Image(rsrs, false);
                foreach (var tile in _resourceProvider.Tiles)
                {
                    tile.UpdateTexCoords(tile.X, tile.Y, rsrs.Width, rsrs.Height);
                }
            }
            else
            {
                throw new ApplicationException("Не найден файл с тайлами " + Path.GetFullPath(Constants.RESOURCES_PNG_FILE));
            }

            TileInfo.FogTexCoords = ((OpenTKTile)TileHelper.AllTiles[ETileset.FOG].Tiles[0]).Texcoords;
        }
コード例 #3
0
		public OpenTKDrawHelper(OpenTKResourceProvider _resourceProvider, OpenTKGameProvider _gameProvider)
		{

			m_gameProvider = _gameProvider;
			m_resourceProvider = _resourceProvider;
		}
コード例 #4
0
 protected override void OnLoad(EventArgs _e)
 {
     m_core.Init();
     m_resourceProvider = new OpenTKResourceProvider();
     m_drawHelper       = new OpenTKDrawHelper(m_resourceProvider, this);
 }
コード例 #5
0
		protected override void OnLoad(EventArgs _e)
		{
			m_core.Init();
			m_resourceProvider = new OpenTKResourceProvider();
			m_drawHelper = new OpenTKDrawHelper(m_resourceProvider, this);
		}
コード例 #6
0
 public OpenTKDrawHelper(OpenTKResourceProvider _resourceProvider, OpenTKGameProvider _gameProvider)
 {
     m_gameProvider     = _gameProvider;
     m_resourceProvider = _resourceProvider;
 }