From 28e8f0b640efbdc65723a4b016bcbfd0c989e45a Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Thu, 22 Dec 2011 21:17:40 +0000 Subject: [PATCH] Use wxGetApp() rather than wxTheApp plus a cast Originally committed to SVN as r6052. --- aegisub/src/audio_player_dsound.cpp | 3 +-- aegisub/src/command/app.cpp | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/aegisub/src/audio_player_dsound.cpp b/aegisub/src/audio_player_dsound.cpp index 05241a8b8..f6bf33b00 100644 --- a/aegisub/src/audio_player_dsound.cpp +++ b/aegisub/src/audio_player_dsound.cpp @@ -78,8 +78,7 @@ void DirectSoundPlayer::OpenStream() { if (FAILED(res)) throw "Failed initializing DirectSound"; // Set DirectSound parameters - AegisubApp *app = (AegisubApp*) wxTheApp; - directSound->SetCooperativeLevel((HWND)app->frame->GetHandle(),DSSCL_PRIORITY); + directSound->SetCooperativeLevel((HWND)wxGetApp().frame->GetHandle(),DSSCL_PRIORITY); // Create the wave format structure WAVEFORMATEX waveFormat; diff --git a/aegisub/src/command/app.cpp b/aegisub/src/command/app.cpp index f7bc2acad..2128a050b 100644 --- a/aegisub/src/command/app.cpp +++ b/aegisub/src/command/app.cpp @@ -165,9 +165,8 @@ struct app_language : public Command { void operator()(agi::Context *c) { // Get language - AegisubApp *app = (AegisubApp*) wxTheApp; - int old = app->locale.curCode; - int newCode = app->locale.PickLanguage(); + int old = wxGetApp().locale.curCode; + int newCode = wxGetApp().locale.PickLanguage(); // Is OK? if (newCode != -1 && newCode != old) { // Set code