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; }
public OpenTKDrawHelper(OpenTKResourceProvider _resourceProvider, OpenTKGameProvider _gameProvider) { m_gameProvider = _gameProvider; m_resourceProvider = _resourceProvider; }
protected override void OnLoad(EventArgs _e) { m_core.Init(); m_resourceProvider = new OpenTKResourceProvider(); m_drawHelper = new OpenTKDrawHelper(m_resourceProvider, this); }