Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Windows|MinGW: Further fixes and updates for MinGW
Disables the old Windows-specific mouse and joystick routines,
since SDL will be used from now on.
  • Loading branch information
skyjake committed Sep 1, 2019
1 parent 0537ec2 commit a38459a
Show file tree
Hide file tree
Showing 30 changed files with 392 additions and 846 deletions.
14 changes: 7 additions & 7 deletions doomsday/apps/client/CMakeLists.txt
Expand Up @@ -11,20 +11,20 @@ add_subdirectory (libs/importsave)
add_subdirectory (libs/fmod)
add_subdirectory (libs/openal)
add_subdirectory (libs/fluidsynth)
if (WIN32)
add_subdirectory (libs/directsound)
add_subdirectory (libs/winmm)
endif ()
# if (WIN32)
# add_subdirectory (libs/directsound)
# add_subdirectory (libs/winmm)
# endif ()

# Dependencies --------------------------------------------------------------------------

find_package (the_Foundation REQUIRED)
find_package (glbinding REQUIRED)
find_package (Amethyst QUIET)
find_package (SDL2Libs)
if (WIN32)
find_package (DirectX)
endif ()
# if (WIN32)
# find_package (DirectX)
# endif ()

# Sources and includes ------------------------------------------------------------------

Expand Down
131 changes: 0 additions & 131 deletions doomsday/apps/client/include/windows/directinput.h

This file was deleted.

39 changes: 0 additions & 39 deletions doomsday/apps/client/include/windows/mouse_win32.h

This file was deleted.

Expand Up @@ -47,7 +47,7 @@
#pragma warning (disable: 4035 4244)

#include <de/c_wrapper.h>
#include <de/timer.h>
#include <de/legacy/timer.h>

#include "doomsday.h"
#include "api_audiod.h"
Expand Down
2 changes: 1 addition & 1 deletion doomsday/apps/client/libs/winmm/src/cdaudio.cpp
Expand Up @@ -22,7 +22,7 @@

#include "dswinmm.h"
#include <de/c_wrapper.h>
#include <de/timer.h>
#include <de/legacy/timer.h>
#include <cmath>
#include <cstdio>

Expand Down
2 changes: 1 addition & 1 deletion doomsday/apps/client/src/clientapp.cpp
Expand Up @@ -279,7 +279,7 @@ DE_PIMPL(ClientApp)
{
try
{
ClientWindow::glActiveMain(); // for GL deinit
ClientWindow::glActivateMain(); // for GL deinit

LogBuffer::get().removeSink(logAlarm);

Expand Down
10 changes: 5 additions & 5 deletions doomsday/apps/client/src/dd_main.cpp
Expand Up @@ -1056,7 +1056,7 @@ static void initializeWithWindowReady()
static char const *AUTOEXEC_NAME = "autoexec.cfg";

#ifdef __CLIENT__
GLWindow::main().glActivate();
GLWindow::glActivateMain();
GL_EarlyInit();
#endif

Expand Down Expand Up @@ -1813,10 +1813,10 @@ void *DD_GetVariable(dint ddvalue)
//case DD_TORCH_ADDITIVE:
// return &torchAdditive;

# ifdef WIN32
case DD_WINDOW_HANDLE:
return ClientWindow::main().nativeHandle();
# endif
//# ifdef WIN32
// case DD_WINDOW_HANDLE:
// return ClientWindow::main().nativeHandle();
//# endif
#endif

// We have to separately calculate the 35 Hz ticks.
Expand Down
2 changes: 1 addition & 1 deletion doomsday/apps/client/src/ui/clientwindow.cpp
Expand Up @@ -1087,7 +1087,7 @@ void ClientWindow::updateRootSize()

ClientWindow &ClientWindow::main()
{
return static_cast<ClientWindow &>(BaseWindow::main());
return static_cast<ClientWindow &>(BaseWindow::getMain());
}

bool ClientWindow::mainExists()
Expand Down
16 changes: 8 additions & 8 deletions doomsday/apps/client/src/ui/dialogs/audiosettingsdialog.cpp
Expand Up @@ -146,9 +146,9 @@ DE_GUI_PIMPL(AudioSettingsDialog)
<< new ChoiceItem("SDL_mixer", "sdlmixer")
#endif
<< new ChoiceItem("OpenAL", "openal")
#if defined (WIN32)
<< new ChoiceItem(tr("DirectSound"), "dsound")
#endif
// #if defined (WIN32)
// << new ChoiceItem(tr("DirectSound"), "dsound")
// #endif
<< new ChoiceItem("Disabled", "dummy");

musicPlugin->items()
Expand All @@ -157,15 +157,15 @@ DE_GUI_PIMPL(AudioSettingsDialog)
#if !defined (DE_DISABLE_SDLMIXER)
<< new ChoiceItem("SDL_mixer", "sdlmixer")
#endif
#if defined (WIN32)
<< new ChoiceItem("Windows Multimedia", "winmm")
#endif
// #if defined (WIN32)
// << new ChoiceItem("Windows Multimedia", "winmm")
// #endif
<< new ChoiceItem("Disabled", "dummy");

#if defined (WIN32)
cdPlugin->items()
<< new ChoiceItem(tr("Windows Multimedia"), "winmm")
<< new ChoiceItem(tr("Disabled"), "dummy");
// << new ChoiceItem(tr("Windows Multimedia"), "winmm")
<< new ChoiceItem("Disabled", "dummy");

cdPlugin->updateFromVariable();
#endif
Expand Down
2 changes: 1 addition & 1 deletion doomsday/apps/client/src/ui/dialogs/packageinfodialog.cpp
Expand Up @@ -523,7 +523,7 @@ DE_GUI_PIMPL(PackageInfoDialog)

Loop::timer(0.1, [] {
// Switch the game.
GLWindow::main().glActivate();
GLWindow::glActivateMain();
BusyMode_FreezeGameForBusyMode();
DoomsdayApp::app().changeGame(DoomsdayApp::app().adhocProfile(),
DD_ActivateGameWorker);
Expand Down
14 changes: 8 additions & 6 deletions doomsday/apps/client/src/ui/dialogs/videosettingsdialog.cpp
Expand Up @@ -184,12 +184,12 @@ DE_PIMPL(VideoSettingsDialog)
}

#ifdef USE_REFRESH_RATE_CHOICE
refreshRates->setSelected(refreshRates->items().findData(int(win.refreshRate() * 10)));
refreshRates->setSelected(refreshRates->items().findData(NumberValue(int(win.refreshRate() * 10))));
#endif

#ifdef USE_COLOR_DEPTH_CHOICE
// Select the current color depth in the depth list.
depths->setSelected(depths->items().findData(win.colorDepthBits()));
depths->setSelected(depths->items().findData(NumberValue(win.colorDepthBits())));
#endif

#endif // !DE_MOBILE
Expand Down Expand Up @@ -304,8 +304,8 @@ VideoSettingsDialog::VideoSettingsDialog(String const &name)
}
}
d->refreshRates->items().sort([] (ui::Item const &a, ui::Item const &b) {
int const i = a.data().toInt();
int const j = b.data().toInt();
int const i = a.data().asInt();
int const j = b.data().asInt();
if (!i) return true;
if (!j) return false;
return i < j;
Expand Down Expand Up @@ -404,10 +404,12 @@ VideoSettingsDialog::VideoSettingsDialog(String const &name)
}

#ifdef USE_REFRESH_RATE_CHOICE
connect(d->refreshRates, SIGNAL(selectionChangedByUser(uint)), this, SLOT(changeRefreshRate(uint)));
d->refreshRates->audienceForUserSelection() += [this]() {
changeRefreshRate(d->refreshRates->selected()); };
#endif
#ifdef USE_COLOR_DEPTH_CHOICE
connect(d->depths, SIGNAL(selectionChangedByUser(uint)), this, SLOT(changeColorDepth(uint)));
d->depths->audienceForUserSelection() += [this]() {
changeColorDepth(d->depths->selected()); };
#endif
}

Expand Down
7 changes: 3 additions & 4 deletions doomsday/apps/client/src/windows/dd_winit.cpp
Expand Up @@ -32,7 +32,6 @@
#include <cstdlib>
#include <tchar.h>

#include <QDir>
#include <de/App>
#ifdef __CLIENT__
# include <de/DisplayMode>
Expand Down Expand Up @@ -86,7 +85,7 @@ dd_bool DD_Win32_Init()
// Initialize COM.
CoInitialize(NULL);

Library_Init();
//Library_Init();

DoomsdayApp::app().determineGlobalPaths();

Expand Down Expand Up @@ -127,8 +126,8 @@ dd_bool DD_Win32_Init()
void DD_Shutdown()
{
DD_ShutdownAll(); // Stop all engine subsystems.
DoomsdayApp::plugins().unloadAll();
Library_Shutdown();
//DoomsdayApp::plugins().unloadAll();
//Library_Shutdown();

// No more use of COM beyond, this point.
CoUninitialize();
Expand Down

0 comments on commit a38459a

Please sign in to comment.