Commit Graph

249 Commits (0a9c44d1a2b3b5de76595dfc74938fca34b3448a)

Author SHA1 Message Date
Jonathan G Rennison 0a9c44d1a2 Merge branch 'master' into jgrpp
# Conflicts:
#	src/airport_gui.cpp
#	src/blitter/32bpp_anim_sse4.cpp
#	src/console_cmds.cpp
#	src/linkgraph/linkgraph_gui.cpp
#	src/newgrf_object.h
#	src/road_gui.cpp
#	src/widgets/road_widget.h
#	src/window.cpp
2 years ago
Bouke Haarsma 45d98f689a Fix #9993: Handle DPI changes on macOS and Windows 2 years ago
Jonathan G Rennison 5b7db9d849 Merge branch 'master' into jgrpp
# Conflicts:
#	.github/workflows/ci-build.yml
#	.github/workflows/commit-checker.yml
#	src/command.cpp
#	src/company_cmd.cpp
#	src/company_gui.cpp
#	src/crashlog.cpp
#	src/economy.cpp
#	src/lang/english.txt
#	src/lang/german.txt
#	src/lang/korean.txt
#	src/misc_gui.cpp
#	src/newgrf_config.cpp
#	src/openttd.cpp
#	src/settings_gui.cpp
#	src/ship_cmd.cpp
#	src/table/settings/gui_settings.ini
2 years ago
Niels Martin Hansen 345dcd3c7b Add: Show current video driver info in Options window 2 years ago
Jonathan G Rennison 2b8018f5d6 MinGW: Avoid function cast warnings with GetProcAddress 3 years ago
Jonathan G Rennison da282c3ecc Merge branch 'master' into jgrpp-beta
# Conflicts:
#	.github/workflows/ci-build.yml
#	CMakeLists.txt
#	src/lang/finnish.txt
#	src/lang/french.txt
#	src/lang/korean.txt
#	src/lang/norwegian_bokmal.txt
#	src/lang/russian.txt
#	src/lang/spanish.txt
#	src/misc_gui.cpp
#	src/newgrf.cpp
3 years ago
Patric Stout 74186998a2 Codechange: use _cur_palette the same in all the drivers
It was a bit of a mixed bag. With this change, gfx.cpp is in
control who accesses _cur_palette from the video-drivers.
3 years ago
rubidium42 55a11710a6 Codechange: convert printf DEBUG statements to fmt Debug statements 3 years ago
glx22 d485b50813 Fix: [MinGW] Ignore wglGetProcAddress() cast warnings 3 years ago
glx22 744a9e4745 Codechange: [WIN32] Add a wrapper around GetProcAddress() 3 years ago
glx22 2df48a78cc Fix: [MinGW32] Can't convert lambda to stdcall 3 years ago
glx22 f4c7d5577e Codechange: [WIN32] Use VersionHelpers where appropriate 3 years ago
Jonathan G Rennison 8eb27e1ac7 Merge branch 'master' into jgrpp
# Conflicts:
#	src/company_cmd.cpp
#	src/lang/japanese.txt
#	src/network/core/config.h
#	src/network/core/packet.cpp
#	src/network/core/tcp.cpp
#	src/network/network_content.cpp
#	src/network/network_server.cpp
#	src/network/network_udp.cpp
#	src/toolbar_gui.cpp
#	src/vehicle_gui_base.h
3 years ago
Jonathan G Rennison 253772e9af Merge branch 'master' into jgrpp
# Conflicts:
#	CMakeLists.txt
#	COMPILING.md
#	src/console.cpp
#	src/console_cmds.cpp
#	src/console_internal.h
#	src/rev.cpp.in
3 years ago
Michael Lutz f4d5c8d99e
Fix: [OpenGL] Main loop expects to start with the video buffer unmapped. (#9100) 3 years ago
Michael Lutz ef80baf75c Codechange: [Win32] Try getting an OpenGL 4.5 context first before aiming at 3.2. 3 years ago
Michael Lutz e53313391a Fix: [OpenGL] Check maximum supported texture size against screen resolution. 3 years ago
Jonathan G Rennison 205673715c MinGW32: Fix EnumDisplayMonitors callback calling convention compile error 3 years ago
Jonathan G Rennison 272e583478 Merge branch 'master' into jgrpp
# Conflicts:
#	src/lang/korean.txt
#	src/settings.cpp
3 years ago
Michael Lutz 5644c00482
Fix: Check for a validly mapped OpenGL screen buffer during driver init. (#9007) 3 years ago
Patric Stout f0f2073006 Feature: allow a toggle to enable/disable vsync
Vsync should be off by default, as for most players it will be
better to play without vsync. Exception exist, mainly people who
play in fullscreen mode.
3 years ago
Jonathan G Rennison 227041008f Merge branch 'master' into jgrpp
# Conflicts:
#	src/debug.cpp
#	src/lang/russian.txt
#	src/misc_gui.cpp
#	src/os/windows/crashlog_win.cpp
#	src/os/windows/font_win32.cpp
#	src/os/windows/win32.cpp
#	src/rail_cmd.cpp
#	src/window_gui.h
3 years ago
Jonathan G Rennison 39b7ef31f8 Fix: Data races on cursor state in OpenGL backends 3 years ago
Michael Lutz 96d33ab46a Fix #8930: [Win32] Don't handle printable keys on keydown if an edit box is in focus.
Handle printable input only when the matching WM_CHAR message is incoming.
Without an edit box, do the handling in keydown as usual to support hotkeys.
3 years ago
Niels Martin Hansen e0561dbded Fix #8713: Change OTTD2FS and FS2OTTD to return string objects instead of static buffers 3 years ago
Jonathan G Rennison ef81729dde Partially fix data race issues around _cur_palette
See: https://github.com/OpenTTD/OpenTTD/issues/8712
3 years ago
Jonathan G Rennison 0e959a0563 OpenGL: Avoid data races around _cursor 3 years ago
Jonathan G Rennison f2bfcc5524 Partially fix data race issues around _cur_palette
See: https://github.com/OpenTTD/OpenTTD/issues/8712
3 years ago
Jonathan G Rennison 2e6dbfee05 Merge branch 'master' into jgrpp 3 years ago
Jonathan G Rennison 5e14b54a0c Merge branch 'master' into jgrpp 3 years ago
Michael Lutz f0f96e3103
Fix #8871: [OpenGL] Initialize all buffers after resize and clear back buffer. (#8877) 3 years ago
sean 0464a50ab8
Add: Display refresh rate game option (#8813) 3 years ago
Patric Stout e56d2c63c3 Add: [Video] move GameLoop into its own thread
This allows drawing to happen while the GameLoop is doing an
iteration too.

Sadly, not much drawing currently can be done while the GameLoop
is running, as for example PollEvent() or UpdateWindows() can
influence the game-state. As such, they first need to acquire a
lock on the game-state before they can be called.

Currently, the main advantage is the time spend in Paint(), which
for non-OpenGL drivers can be a few milliseconds. For OpenGL this
is more like 0.05 milliseconds; in these instances this change
doesn't add any benefits for now.

This is an alternative to the former "draw-thread", which moved
the drawing in a thread for some OSes. It has similar performance
gain as this does, although this implementation allows for more
finer control over what suffers when the GameLoop takes too
long: drawing or the next GameLoop. For now they both suffer
equally.
3 years ago
Michael Lutz 3a4a15cc93 Codechange: don't set the window position when changing blitter
There really is no need to make an extra call to the OS in
these cases.
3 years ago
Patric Stout 4610aa7ae3 Remove: [Video] no longer draw in a thread
Drawing in a thread is a bit odd, and often leads to surprising
issues. For example, OpenGL would only allow it if you move the
full context to the thread. Which is not always easily done on
all OSes.
In general, the advise is to handle system events and drawing
from the main thread, and do everything else in other threads.
So, let's be more like other games.

Additionally, putting the drawing routine in a thread was only
done for a few targets.

Upcoming commit will move the GameLoop in a thread, which will
work for all targets.
3 years ago
Patric Stout 04db99749b
Fix #8784: using alt+enter didn't update the fullscreen toggle visibly (#8820)
Basically, the window was not invalidated, so it was never redrawn.
This made it look like it wasn't working, but it really was.
3 years ago
Jonathan G Rennison 84a7ab180e Merge branch 'master' into jgrpp
# Conflicts:
#	src/company_cmd.cpp
#	src/lang/greek.txt
#	src/table/settings.ini
3 years ago
Jonathan G Rennison f4e29071be 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
3 years ago
Michael Lutz c656633bea Fix #8775: [Win32] Don't create the main window when alt-tabbing back into fullscreen. 3 years ago
Michael Lutz b7a44983b4 Fix: [Win32] Original window size was lost when tabbing in and out of fullscreen. 3 years ago
Patric Stout f183ded9fe Add: settings to limit your fast-forward game speed
By default this setting is set to 2500% normal game speed.

(cherry picked from commit c3dc27e37e)

# Conflicts:
#	src/gfx.cpp
#	src/gfx_func.h
#	src/settings_type.h
#	src/video/cocoa/cocoa_v.mm
#	src/video/video_driver.cpp
#	src/video/win32_v.cpp
3 years ago
Patric Stout c3dc27e37e Add: settings to limit your fast-forward game speed
By default this setting is set to 2500% normal game speed.
3 years ago
Jonathan G Rennison d58989f552 Merge branch 'master' into jgrpp
# Conflicts:
#	src/lang/english_US.txt
3 years ago
Michael Lutz 311df31fb1 Codechange: [OpenGL] Load all OpenGL functions dynamically. 3 years ago
Patric Stout 67d3c6aa71 Codechange: [Video] move InteractiveRandom() to the VideoDriver 3 years ago
Patric Stout c409f45ddd Codechange: [Video] make the prototype of PollEvent() the same for all drivers
Additionally, call it from the draw-tick.
3 years ago
Niels Martin Hansen b427ddce88 Codechange: Switch to explicit wide strings 3 years ago
Niels Martin Hansen beeb9e0a1b Remove: [Win32] Last pretenses of being able to build for Windows 95 3 years ago
Michael Lutz 06ca147a82 Fix 8706c36f: Change RELEASE code, too. 3 years ago
Michael Lutz af4d32357c Codechange: [Win32] Move common initialization and finalization to the video driver base class. 3 years ago