|
OpenTTD Source 20251116-master-g21329071df
|
Base for all driver handling. More...
#include "stdafx.h"#include "core/string_consumer.hpp"#include "debug.h"#include "error.h"#include "error_func.h"#include "sound/sound_driver.hpp"#include "music/music_driver.hpp"#include "strings_func.h"#include "video/video_driver.hpp"#include "string_func.h"#include "fileio_func.h"#include "table/strings.h"#include "safeguards.h"Go to the source code of this file.
Functions | |
| std::optional< std::string_view > | GetDriverParam (const StringList &parm, std::string_view name) |
| Get a string parameter the list of parameters. | |
| bool | GetDriverParamBool (const StringList &parm, std::string_view name) |
| Get a boolean parameter the list of parameters. | |
| int | GetDriverParamInt (const StringList &parm, std::string_view name, int def) |
| Get an integer parameter the list of parameters. | |
Variables | |
| std::string | _ini_videodriver |
| The video driver a stored in the configuration file. | |
| std::vector< Dimension > | _resolutions |
| List of resolutions. | |
| Dimension | _cur_resolution |
| The current resolution. | |
| bool | _rightclick_emulate |
| Whether right clicking is emulated. | |
| std::string | _ini_sounddriver |
| The sound driver a stored in the configuration file. | |
| std::string | _ini_musicdriver |
| The music driver a stored in the configuration file. | |
| std::string | _ini_blitter |
| The blitter as stored in the configuration file. | |
| bool | _blitter_autodetected |
| Was the blitter autodetected or specified by the user? | |
| static const std::string | HWACCELERATION_TEST_FILE = "hwaccel.dat" |
| Filename to test if we crashed last time we tried to use hardware acceleration. | |
Base for all driver handling.
Definition in file driver.cpp.
| std::optional< std::string_view > GetDriverParam | ( | const StringList & | parm, |
| std::string_view | name | ||
| ) |
Get a string parameter the list of parameters.
| parm | The parameters. |
| name | The parameter name we're looking for. |
Definition at line 47 of file driver.cpp.
References StringConsumer::GetLeftData().
Referenced by GetDriverParamBool(), GetDriverParamInt(), MusicDriver_DMusic::Start(), MusicDriver_ExtMidi::Start(), MusicDriver_FluidSynth::Start(), and MusicDriver_Win32::Start().
| bool GetDriverParamBool | ( | const StringList & | parm, |
| std::string_view | name | ||
| ) |
Get a boolean parameter the list of parameters.
| parm | The parameters. |
| name | The parameter name we're looking for. |
Definition at line 67 of file driver.cpp.
References GetDriverParam().
Referenced by VideoDriver_SDL_Base::Start(), and VideoDriver_Win32GDI::Start().
| int GetDriverParamInt | ( | const StringList & | parm, |
| std::string_view | name, | ||
| int | def | ||
| ) |
Get an integer parameter the list of parameters.
| parm | The parameters. |
| name | The parameter name we're looking for. |
| def | The default value if the parameter doesn't exist. |
Definition at line 79 of file driver.cpp.
References GetDriverParam().
Referenced by MusicDriver_DMusic::Start(), MusicDriver_Win32::Start(), SoundDriver_SDL::Start(), SoundDriver_Win32::Start(), SoundDriver_XAudio2::Start(), VideoDriver_Null::Start(), and VideoDriver_SDL_Base::Start().
| bool _blitter_autodetected |
Was the blitter autodetected or specified by the user?
Definition at line 37 of file driver.cpp.
Referenced by openttd_main(), and SwitchNewGRFBlitter().
| Dimension _cur_resolution |
The current resolution.
Definition at line 29 of file driver.cpp.
Referenced by GameSizeChanged(), openttd_main(), VideoDriver_Dedicated::Start(), VideoDriver_Null::Start(), VideoDriver_SDL_Base::Start(), VideoDriver_Win32GDI::Start(), and VideoDriver::UpdateAutoResolution().
| std::string _ini_blitter |
The blitter as stored in the configuration file.
Definition at line 36 of file driver.cpp.
Referenced by openttd_main().
| std::string _ini_musicdriver |
The music driver a stored in the configuration file.
Definition at line 34 of file driver.cpp.
Referenced by openttd_main().
| std::string _ini_sounddriver |
The sound driver a stored in the configuration file.
Definition at line 32 of file driver.cpp.
Referenced by openttd_main().
| std::string _ini_videodriver |
The video driver a stored in the configuration file.
Definition at line 27 of file driver.cpp.
Referenced by openttd_main().
| std::vector<Dimension> _resolutions |
List of resolutions.
Definition at line 28 of file driver.cpp.
Referenced by GameOptionsWindow::BuildDropDownList(), GetCurrentResolutionIndex(), GameOptionsWindow::GetWidgetString(), and GameOptionsWindow::OnDropdownSelect().
| bool _rightclick_emulate |
Whether right clicking is emulated.
Definition at line 30 of file driver.cpp.
Referenced by VideoDriver_SDL_Base::PollEvent().
|
static |
Filename to test if we crashed last time we tried to use hardware acceleration.
Definition at line 39 of file driver.cpp.
Referenced by DriverFactoryBase::MarkVideoDriverOperational(), and DriverFactoryBase::SelectDriverImpl().