Merge tag '1.11.0-beta2' into jgrpp

# Conflicts:
#	.github/workflows/ci-build.yml
#	.github/workflows/release.yml
#	CMakeLists.txt
#	src/blitter/32bpp_optimized.cpp
#	src/debug.cpp
#	src/gfx.cpp
#	src/gfx_func.h
#	src/lang/czech.txt
#	src/lang/english.txt
#	src/lang/italian.txt
#	src/lang/swedish.txt
#	src/lang/ukrainian.txt
#	src/network/network_server.cpp
#	src/os/windows/crashlog_win.cpp
#	src/os/windows/win32.cpp
#	src/pathfinder/follow_track.hpp
#	src/screenshot.cpp
#	src/settings_type.h
#	src/spritecache.cpp
#	src/vehicle_gui.cpp
#	src/video/sdl2_v.cpp
#	src/video/video_driver.cpp
#	src/video/video_driver.hpp
#	src/video/win32_v.cpp
This commit is contained in:
Jonathan G Rennison
2021-03-02 11:59:03 +00:00
148 changed files with 19670 additions and 1452 deletions

View File

@@ -84,7 +84,7 @@ struct DLSFile {
std::vector<DLSWave> waves;
/** Try loading a DLS file into memory. */
bool LoadFile(const TCHAR *file);
bool LoadFile(const wchar_t *file);
private:
/** Load an articulation structure from a DLS file. */
@@ -431,11 +431,11 @@ bool DLSFile::ReadDLSWaveList(FILE *f, DWORD list_length)
return true;
}
bool DLSFile::LoadFile(const TCHAR *file)
bool DLSFile::LoadFile(const wchar_t *file)
{
DEBUG(driver, 2, "DMusic: Try to load DLS file %s", FS2OTTD(file));
FILE *f = _tfopen(file, _T("rb"));
FILE *f = _wfopen(file, L"rb");
if (f == nullptr) return false;
FileCloser f_scope(f);
@@ -864,11 +864,11 @@ static const char *LoadDefaultDLSFile(const char *user_dls)
if (user_dls == nullptr) {
/* Try loading the default GM DLS file stored in the registry. */
HKEY hkDM;
if (SUCCEEDED(RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T("Software\\Microsoft\\DirectMusic"), 0, KEY_READ, &hkDM))) {
TCHAR dls_path[MAX_PATH];
if (SUCCEEDED(RegOpenKeyEx(HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\DirectMusic", 0, KEY_READ, &hkDM))) {
wchar_t dls_path[MAX_PATH];
DWORD buf_size = sizeof(dls_path); // Buffer size as to be given in bytes!
if (SUCCEEDED(RegQueryValueEx(hkDM, _T("GMFilePath"), nullptr, nullptr, (LPBYTE)dls_path, &buf_size))) {
TCHAR expand_path[MAX_PATH * 2];
if (SUCCEEDED(RegQueryValueEx(hkDM, L"GMFilePath", nullptr, nullptr, (LPBYTE)dls_path, &buf_size))) {
wchar_t expand_path[MAX_PATH * 2];
ExpandEnvironmentStrings(dls_path, expand_path, lengthof(expand_path));
if (!dls_file.LoadFile(expand_path)) DEBUG(driver, 1, "Failed to load default GM DLS file from registry");
}
@@ -877,8 +877,8 @@ static const char *LoadDefaultDLSFile(const char *user_dls)
/* If we couldn't load the file from the registry, try again at the default install path of the GM DLS file. */
if (dls_file.instruments.size() == 0) {
static const TCHAR *DLS_GM_FILE = _T("%windir%\\System32\\drivers\\gm.dls");
TCHAR path[MAX_PATH];
static const wchar_t *DLS_GM_FILE = L"%windir%\\System32\\drivers\\gm.dls";
wchar_t path[MAX_PATH];
ExpandEnvironmentStrings(DLS_GM_FILE, path, lengthof(path));
if (!dls_file.LoadFile(path)) return "Can't load GM DLS collection";
@@ -1106,7 +1106,6 @@ const char *MusicDriver_DMusic::Start(const StringList &parm)
DEBUG(driver, 1, "Detected DirectMusic ports:");
for (int i = 0; _music->EnumPort(i, &caps) == S_OK; i++) {
if (caps.dwClass == DMUS_PC_OUTPUTCLASS) {
/* Description is UNICODE even for ANSI build. */
DEBUG(driver, 1, " %d: %s%s", i, convert_from_fs(caps.wszDescription, desc, lengthof(desc)), i == pIdx ? " (selected)" : "");
}
}