Jonathan G Rennison
650d5e014e
Merge branch 'master' into jgrpp
...
# Conflicts:
# src/ai/ai_gui.cpp
# src/company_cmd.cpp
# src/lang/estonian.txt
# src/lang/german.txt
# src/lang/hungarian.txt
# src/lang/korean.txt
# src/lang/slovak.txt
# src/main_gui.cpp
# src/video/sdl2_v.cpp
3 years ago
Jonathan G Rennison
7154f8859d
Merge tag '1.11.0-beta1' into jgrpp
...
# Conflicts:
# src/console_cmds.cpp
# src/gfx_func.h
# src/industry.h
# src/lang/czech.txt
# src/lang/estonian.txt
# src/lang/german.txt
# src/lang/indonesian.txt
# src/lang/japanese.txt
# src/lang/norwegian_bokmal.txt
# src/lang/russian.txt
# src/lang/slovak.txt
# src/saveload/saveload.h
# src/station_gui.cpp
# src/town_gui.cpp
# src/vehicle_gui.cpp
# src/video/sdl2_v.cpp
# src/waypoint_gui.cpp
3 years ago
Jonathan G Rennison
b7ddd486cf
Merge branch 'master' into jgrpp
...
# Conflicts:
# cmake/CompileFlags.cmake
# src/aircraft_cmd.cpp
# src/blitter/32bpp_anim.cpp
# src/cargopacket.cpp
# src/cheat_gui.cpp
# src/company_cmd.cpp
# src/company_gui.cpp
# src/core/pool_func.hpp
# src/date.cpp
# src/economy.cpp
# src/error_gui.cpp
# src/ground_vehicle.cpp
# src/ground_vehicle.hpp
# src/group_gui.cpp
# src/industry_cmd.cpp
# src/lang/dutch.txt
# src/lang/french.txt
# src/lang/german.txt
# src/linkgraph/linkgraph_gui.cpp
# src/linkgraph/mcf.cpp
# src/network/network_content.cpp
# src/network/network_server.cpp
# src/network/network_udp.cpp
# src/newgrf_engine.cpp
# src/newgrf_station.cpp
# src/order_cmd.cpp
# src/order_gui.cpp
# src/pathfinder/follow_track.hpp
# src/pathfinder/yapf/yapf_common.hpp
# src/saveload/saveload.cpp
# src/settings_gui.cpp
# src/station_cmd.cpp
# src/station_kdtree.h
# src/string_func.h
# src/table/settings.ini
# src/tgp.cpp
# src/timetable_cmd.cpp
# src/timetable_gui.cpp
# src/toolbar_gui.cpp
# src/town_cmd.cpp
# src/train_cmd.cpp
# src/train_gui.cpp
# src/tree_gui.cpp
# src/tunnelbridge_cmd.cpp
# src/vehicle.cpp
# src/vehicle_gui.cpp
# src/video/sdl2_v.cpp
# src/video/sdl_v.cpp
# src/video/win32_v.cpp
# src/viewport.cpp
# src/viewport_sprite_sorter_sse4.cpp
# src/window.cpp
3 years ago
Jonathan G Rennison
f9956d88c3
Merge branch 'master' into jgrpp
...
# Conflicts:
# src/aircraft_cmd.cpp
# src/company_gui.cpp
# src/lang/arabic_egypt.txt
# src/lang/czech.txt
# src/lang/esperanto.txt
# src/lang/faroese.txt
# src/lang/finnish.txt
# src/lang/german.txt
# src/lang/korean.txt
# src/lang/latvian.txt
# src/lang/malay.txt
# src/lang/polish.txt
# src/lang/spanish.txt
# src/lang/spanish_MX.txt
# src/lang/unfinished/urdu.txt
# src/main_gui.cpp
# src/rail_cmd.cpp
# src/rail_gui.cpp
# src/road_cmd.cpp
# src/settings_type.h
# src/station_cmd.cpp
# src/table/settings.ini
3 years ago
Jonathan G Rennison
6c3e5642f8
Merge branch 'master' into jgrpp
...
# Conflicts:
# cmake/CompileFlags.cmake
# src/crashlog.cpp
# src/fileio.cpp
# src/fileio_func.h
# src/fios_gui.cpp
# src/ini_load.cpp
# src/ini_type.h
# src/lang/english.txt
# src/lang/german.txt
# src/lang/korean.txt
# src/network/network_client.cpp
# src/order_base.h
# src/order_cmd.cpp
# src/os/windows/win32.cpp
# src/road_cmd.cpp
# src/saveload/saveload.cpp
# src/saveload/saveload.h
# src/settings.cpp
# src/station_cmd.cpp
# src/stdafx.h
# src/table/settings.ini
# src/tree_cmd.cpp
# src/tree_gui.cpp
# src/vehicle_base.h
# src/video/cocoa/cocoa_v.mm
# src/video/cocoa/event.mm
# src/video/cocoa/wnd_quartz.mm
# src/viewport.cpp
# src/widgets/tree_widget.h
3 years ago
Patric Stout
0e54c32452
Codechange: [SDL2] Use MakeDirty() to force a redraw
...
The original code is "strictly correct", but just reads really
weird, and we use MakeDirty() in several other places instead too.
3 years ago
Patric Stout
30e69c518b
Codechange: [SDL2] Rework how palette is updated
...
It now follows more what the Win32 driver does, and has far less
exceptions and special casing.
MakePalette creates the Palette and prepares surface.
UpdatePalette updates the Palette.
CheckPaletteAnim checks if UpdatePalette needs to be called and
marks the whole screen dirty so DrawSurfaceToScreen will do a
full redraw.
3 years ago
Patric Stout
eb80fefd1d
Fix: [SDL2] Display why SDL_CreateWindow() failed in case it does
...
All SDL_NNN errors print SDL_GetError, except for this one place.
3 years ago
Patric Stout
19345908cb
Codechange: [SDL2] Split away CreateMainWindow from CreateMainSurface
...
This makes the code a bit more readable, as both intentions are
more clear, and there is less nesting in the main function.
3 years ago
Patric Stout
8c37e5c526
Codechange: [SDL2] reworked the different surfaces to make it more readable
3 years ago
Patric Stout
8de325f256
Codechange: [SDL2] Only prepare "caption" if you are going to us it
3 years ago
Patric Stout
e41ec5b42e
Codechange: [SDL2] Minor code cleanup to remove silly variable
3 years ago
Patric Stout
678031f9b3
Codechange: [SDL2] Only set _cur_palette, never _local_palette
3 years ago
Patric Stout
f31b65825f
Codechange: [SDL2] Move FindStartupDisplay to its own function
3 years ago
Patric Stout
6916fc76bd
Codechange: [SDL2] reworked FindResolutions to be more like the rest
...
There was no default resolution fallback, and the code was different
from the win32 driver. It is now named the same and much more
similar.
3 years ago
Patric Stout
a52d716c88
Codechange: [SDL2] remove include-protection
...
This is already done by CMake: if SDL2 is not detected, this file
is not included.
3 years ago
Jonathan G Rennison
39df1c49a1
Merge branch 'master' into jgrpp
...
# Conflicts:
# src/fileio.cpp
# src/group_gui.cpp
# src/industry.h
# src/lang/korean.txt
# src/linkgraph/linkgraphjob.cpp
# src/linkgraph/linkgraphjob.h
# src/linkgraph/linkgraphschedule.cpp
# src/linkgraph/linkgraphschedule.h
# src/openttd.cpp
# src/saveload/saveload.cpp
# src/saveload/saveload.h
# src/town_cmd.cpp
# src/vehicle_gui.cpp
# src/vehicle_gui_base.h
3 years ago
Jonathan G Rennison
cb69611248
Merge branch 'master' into jgrpp
...
# Conflicts:
# .github/changelog.sh
# cmake/PackageDeb.cmake
# src/network/network_client.cpp
# src/settings_gui.cpp
3 years ago
Jonathan G Rennison
43980639de
Merge branch 'master' into jgrpp
...
# Conflicts:
# .gitignore
# CMakeLists.txt
# src/3rdparty/optional/optional.hpp
# src/group_cmd.cpp
# src/industry_cmd.cpp
# src/misc_gui.cpp
# src/video/sdl2_v.cpp
3 years ago
Patric Stout
1eceee915e
Codechange: [SDL2/Win32] Be consistent how 0bpp blitters are not allowed
...
Sometimes it returned an usererror(), sometimes Start() failed.
Now it always fails on Start(), so nothing else has to check again
what blitter is used.
AfterBlitterChange() can never change to a 0bpp, so it is sufficient
to guard this with an assert().
3 years ago
Patric Stout
49df9c4155
Codechange: [Win32] Use _local_palette for most operations
...
Other drivers do this too, and this makes the world a bit more
the same.
3 years ago
Patric Stout
881d17d8f1
Codechange: [Win32] use CSleep() instead of Sleep() like everywhere else
...
Functional it is identical. Just helps future-us when searching
for sleeps.
3 years ago
Patric Stout
689404a4a1
Codechange: [Win32] Use return-early in RegisterWndClass()
3 years ago
Michael Lutz
7415964a4d
Codechange: [Win32] Remove Windows 95 specific mouse tracking work-around.
3 years ago
frosch
540fdfbf5a
Fix 0e62a398c7f: Only center the window, when it is smaller than the screen. ( #8581 )
4 years ago
frosch
0e62a398c7
Add: [SDL2] video driver parameter to put OpenTTD on a particular display on start. By default use the display where the mouse cursor is. ( #8572 )
4 years ago
Michael Lutz
fa60c1f8b9
Feature: Choose a sensible window size on a fresh OTTD config file. ( #8536 )
4 years ago
Charles Pigott
9b800a96ed
Codechange: Remove min/max functions in favour of STL variants ( #8502 )
4 years ago
Michael Lutz
979b4af6ca
Revert 4ce53cb8: [OSX] Delayed fullscreen switch is not needed anymore.
...
The fix for #8067 solves the real issue, making this workaround unneeded.
4 years ago
Michael Lutz
6e8be3b03e
Fix #8067 : [OSX] Calculate title bar height instead of assuming a fixed value.
4 years ago
Michael Lutz
4ce53cb851
Fix: [OSX] Quitting in fullscreen mode would loose the original window size.
...
This replicates the behaviour on e.g. Windows, which saves the original window size.
4 years ago
Michael Lutz
c860a247d3
Change: [OSX] Hide Dock and menu during fullscreen mode.
4 years ago
Michael Lutz
6ad5489d01
Codechange: [OSX] Silence some annoying warnings.
4 years ago
Michael Lutz
7bdaabf5f1
Cleanup: [OSX] Remove cargo cult back-buffer alpha setting on show/hide and instead simply initialise the buffer on allocation.
4 years ago
Michael Lutz
a61a741683
Change: [OSX] Compiling the Cocoa/Quartz video driver cannot be disabled anymore.
4 years ago
Michael Lutz
9ccef816f9
Codechange: [OSX] Re-arrange the OSX video driver code by combining all drawing code and moving the window/event handling to a different file.
...
This is just a code move/rename, not a functionality change.
4 years ago
Jonathan G Rennison
343777e749
OSX: Temporary bodge for WindowQuartzSubdriver::SetPortAlphaOpaque issue
4 years ago
Michael Lutz
65f65ad2ad
Codechange: Convert some more FIO functions to take std::string.
4 years ago
Michael Lutz
f3326d34e7
Codechange: Use std::string in FIO search path handling.
4 years ago
Michael Lutz
0c6e8a8123
Codechange: Store file search paths as std::string.
4 years ago
Charles Pigott
860c270c73
Codechange: Replace assert_compile macro with static_assert
4 years ago
Patric Stout
34051c10df
Doc: some comments for the win32 video driver ( #8409 )
...
Co-authored-by: Niels Martin Hansen <nielsm@indvikleren.dk>
4 years ago
Michael Lutz
4c1ee264a6
Fix: [OSX] Warning about ambiguous method (-Wobjc-multiple-method-names). ( #8399 )
4 years ago
Patric Stout
d5b9f7ac37
Add: [Emscripten] use "relative mouse mode" with SDL2
...
This mode doesn't wrap the mouse constantly, but requests SDL
to lock the mouse pointer. This is needed, as with Emscripten
you are not allowed to change the mouse poisition (only to lock
it into place).
4 years ago
Patric Stout
d15dc9f40f
Add: support for emscripten (play-OpenTTD-in-the-browser)
...
Emscripten compiles to WASM, which can be loaded via
HTML / JavaScript. This allows you to play OpenTTD inside a
browser.
Co-authored-by: milek7 <me@milek7.pl>
4 years ago
Patric Stout
2da07f7615
Codechange: unroll the SDL2 main loop
...
This commit prepares for the next commit, as Emscripten needs to
have a way to trigger a single iteration of the main loop. To
keep the real changes more clear, this commit only unrolls the
loop, and makes no changes to the logic itself.
4 years ago
Jonathan G Rennison
d85a529f87
Merge branch 'master' into jgrpp
4 years ago
Jonathan G Rennison
51477334be
SDL2: Only pass a single rectangle to SDL_UpdateWindowSurfaceRects
...
This is to prevent screen tearing
4 years ago
Jonathan G Rennison
1298f49be6
SDL2: Update whole window surface if >= 80% needs updating
4 years ago
Charles Pigott
348c231e12
Codechange: Make codestyle for CMake files consistent for 'control' statements
4 years ago