Merge branch 'master' into jgrpp
# Conflicts: # os/macosx/notarize.sh # src/3rdparty/CMakeLists.txt # src/3rdparty/squirrel/squirrel/sqcompiler.cpp # src/3rdparty/squirrel/squirrel/sqdebug.cpp # src/3rdparty/squirrel/squirrel/sqvm.cpp # src/console_cmds.cpp # src/core/span_type.hpp # src/crashlog.cpp # src/currency.h # src/date_gui.cpp # src/driver.cpp # src/fios.cpp # src/genworld_gui.cpp # src/hotkeys.cpp # src/misc_gui.cpp # src/music/os2_m.cpp # src/network/core/os_abstraction.h # src/network/network_server.cpp # src/newgrf.cpp # src/newgrf_config.h # src/newgrf_text.cpp # src/openttd.cpp # src/os/macosx/font_osx.cpp # src/os/macosx/misc_osx.cpp # src/os/os2/CMakeLists.txt # src/os/os2/os2.cpp # src/os/unix/CMakeLists.txt # src/os/windows/font_win32.cpp # src/os/windows/win32_main.cpp # src/saveload/saveload.cpp # src/script/api/script_text.cpp # src/settings.cpp # src/settings_gui.cpp # src/stdafx.h # src/strings.cpp # src/timetable_gui.cpp # src/town_gui.cpp # src/train_cmd.cpp # src/video/dedicated_v.cpp # src/video/video_driver.cpp # src/video/win32_v.cpp # src/viewport.cpp # src/waypoint_gui.cpp # src/widgets/dropdown_type.h # src/window.cpp # src/window_gui.h
This commit is contained in:
@@ -11,7 +11,6 @@
|
||||
#include "../openttd.h"
|
||||
#include "../gfx_func.h"
|
||||
#include "../os/windows/win32.h"
|
||||
#include "../rev.h"
|
||||
#include "../blitter/factory.hpp"
|
||||
#include "../core/geometry_func.hpp"
|
||||
#include "../core/math_func.hpp"
|
||||
@@ -214,16 +213,20 @@ bool VideoDriver_Win32Base::MakeWindow(bool full_screen, bool resize)
|
||||
if (this->main_wnd != nullptr) {
|
||||
if (!_window_maximize && resize) SetWindowPos(this->main_wnd, 0, 0, 0, w, h, SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOZORDER | SWP_NOMOVE);
|
||||
} else {
|
||||
/* Center on the workspace of the primary display. */
|
||||
MONITORINFO mi;
|
||||
mi.cbSize = sizeof(mi);
|
||||
GetMonitorInfo(MonitorFromWindow(0, MONITOR_DEFAULTTOPRIMARY), &mi);
|
||||
int x = 0;
|
||||
int y = 0;
|
||||
|
||||
int x = (mi.rcWork.right - mi.rcWork.left - w) / 2;
|
||||
int y = (mi.rcWork.bottom - mi.rcWork.top - h) / 2;
|
||||
/* For windowed mode, center on the workspace of the primary display. */
|
||||
if (!this->fullscreen) {
|
||||
MONITORINFO mi;
|
||||
mi.cbSize = sizeof(mi);
|
||||
GetMonitorInfo(MonitorFromWindow(0, MONITOR_DEFAULTTOPRIMARY), &mi);
|
||||
|
||||
char window_title[64];
|
||||
seprintf(window_title, lastof(window_title), "OpenTTD %s", _openttd_revision);
|
||||
x = (mi.rcWork.right - mi.rcWork.left - w) / 2;
|
||||
y = (mi.rcWork.bottom - mi.rcWork.top - h) / 2;
|
||||
}
|
||||
|
||||
std::string window_title = VideoDriver::GetCaption();
|
||||
|
||||
this->main_wnd = CreateWindow(L"OTTD", OTTD2FS(window_title).c_str(), style, x, y, w, h, 0, 0, GetModuleHandle(nullptr), this);
|
||||
if (this->main_wnd == nullptr) usererror("CreateWindow failed");
|
||||
|
||||
Reference in New Issue
Block a user