public SmushFont GetFont(int font) { if (_sf[font] != null) { return(_sf[font]); } if (_vm.Game.GameId == GameId.FullThrottle) { if (!(_vm.Game.Features.HasFlag(GameFeatures.Demo) /*&& (_vm._game.platform == Common::kPlatformDOS)*/)) { var ft_fonts = new[] { "scummfnt.nut", "techfnt.nut", "titlfnt.nut", "specfnt.nut" }; Debug.Assert(font >= 0 && font < ft_fonts.Length); _sf[font] = new SmushFont(_vm, ft_fonts[font], true, false); } } else if (_vm.Game.GameId == GameId.Dig) { if (!(_vm.Game.Features.HasFlag(GameFeatures.Demo))) { Debug.Assert(font >= 0 && font < 4); var file_font = string.Format("font{0}.nut", font); _sf[font] = new SmushFont(_vm, file_font, font != 0, false); } } else if (_vm.Game.GameId == GameId.CurseOfMonkeyIsland) { int numFonts = _vm.Game.Features.HasFlag(GameFeatures.Demo) ? 4 : 5; Debug.Assert(font >= 0 && font < numFonts); var file_font = string.Format("font{0}.nut", font); _sf[font] = new SmushFont(_vm, file_font, false, true); } else { throw new NotSupportedException("SmushPlayer::getFont() Unknown font setup for game"); } Debug.Assert(_sf[font] != null); return(_sf[font]); }
public SmushFont GetFont(int font) { if (_sf[font] != null) return _sf[font]; if (_vm.Game.GameId == GameId.FullThrottle) { if (!(_vm.Game.Features.HasFlag(GameFeatures.Demo) /*&& (_vm._game.platform == Common::kPlatformDOS)*/)) { var ft_fonts = new[] { "scummfnt.nut", "techfnt.nut", "titlfnt.nut", "specfnt.nut" }; Debug.Assert(font >= 0 && font < ft_fonts.Length); _sf[font] = new SmushFont(_vm, ft_fonts[font], true, false); } } else if (_vm.Game.GameId == GameId.Dig) { if (!(_vm.Game.Features.HasFlag(GameFeatures.Demo))) { Debug.Assert(font >= 0 && font < 4); var file_font = string.Format("font{0}.nut", font); _sf[font] = new SmushFont(_vm, file_font, font != 0, false); } } else if (_vm.Game.GameId == GameId.CurseOfMonkeyIsland) { int numFonts = _vm.Game.Features.HasFlag(GameFeatures.Demo) ? 4 : 5; Debug.Assert(font >= 0 && font < numFonts); var file_font = string.Format("font{0}.nut", font); _sf[font] = new SmushFont(_vm, file_font, false, true); } else { throw new NotSupportedException("SmushPlayer::getFont() Unknown font setup for game"); } Debug.Assert(_sf[font] != null); return _sf[font]; }