Skip to content

Commit

Permalink
FIX THE PERFORMANCE ISSUE 🎉🎉🎉🎉🎉🎉🎉🎉🎉
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanmoffat committed Jun 9, 2022
1 parent 85a8687 commit a0ea151
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions EndlessClient/GameExecution/EndlessGame.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ public class EndlessGame : Game, IEndlessGame
private readonly ILoggerProvider _loggerProvider;
private readonly IChatBubbleTextureProvider _chatBubbleTextureProvider;
private readonly IShaderRepository _shaderRepository;
private readonly ICharacterInfoPanelFactory _characterInfoPanelFactory;
private readonly IConfigurationProvider _configurationProvider;
private readonly IMfxPlayer _mfxPlayer;
private readonly IXnaControlSoundMapper _soundMapper;
Expand All @@ -63,7 +62,6 @@ public EndlessGame(IClientWindowSizeProvider windowSizeProvider,
ILoggerProvider loggerProvider,
IChatBubbleTextureProvider chatBubbleTextureProvider,
IShaderRepository shaderRepository,
ICharacterInfoPanelFactory characterInfoPanelFactory,
IConfigurationProvider configurationProvider,
IMfxPlayer mfxPlayer,
IXnaControlSoundMapper soundMapper)
Expand All @@ -78,7 +76,6 @@ public EndlessGame(IClientWindowSizeProvider windowSizeProvider,
_loggerProvider = loggerProvider;
_chatBubbleTextureProvider = chatBubbleTextureProvider;
_shaderRepository = shaderRepository;
_characterInfoPanelFactory = characterInfoPanelFactory;
_configurationProvider = configurationProvider;
_mfxPlayer = mfxPlayer;
_soundMapper = soundMapper;
Expand Down Expand Up @@ -116,8 +113,10 @@ protected override void Initialize()
AttemptToLoadPubFiles();

IsMouseVisible = true;
IsFixedTimeStep = false;
_previousKeyState = Keyboard.GetState();

_graphicsDeviceManager.SynchronizeWithVerticalRetrace = false;
_graphicsDeviceManager.IsFullScreen = false;
_graphicsDeviceManager.PreferredBackBufferWidth = _windowSizeProvider.Width;
_graphicsDeviceManager.PreferredBackBufferHeight = _windowSizeProvider.Height;
Expand Down Expand Up @@ -154,14 +153,6 @@ protected override void LoadContent()
_shaderRepository.Shaders[ShaderRepository.HairClip] = new Effect(GraphicsDevice, shaderBytes);
}

// for some reason initializing these and then killing them speeds up transition from Login -> LoggedIn state
// TODO: figure out why this happens????
foreach (var panel in _characterInfoPanelFactory.CreatePanels(Enumerable.Repeat(Character.Default, 3)))
{
panel.Initialize();
panel.Dispose();
}

SetUpInitialControlSet();

if (_configurationProvider.MusicEnabled)
Expand Down

0 comments on commit a0ea151

Please sign in to comment.