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