OpenTTD Source: src/driver.cpp File Reference

OpenTTD Source 14.0-beta3

Functions | Variables
driver.cpp File Reference
`#include "stdafx.h"`
`#include "debug.h"`
`#include "error.h"`
`#include "error_func.h"`
`#include "sound/sound_driver.hpp"`
`#include "music/music_driver.hpp"`
`#include "video/video_driver.hpp"`
`#include "string_func.h"`
`#include "table/strings.h"`
`#include "fileio_func.h"`
`#include <sstream>`
`#include <unistd.h>`
`#include "safeguards.h"`

Go to the source code of this file.

## Functions
const char * | GetDriverParam (const StringList &parm, const char *name)
| Get a string parameter the list of parameters. More...
bool | GetDriverParamBool (const StringList &parm, const char *name)
| Get a boolean parameter the list of parameters. More...
int | GetDriverParamInt (const StringList &parm, const char *name, int def)
| Get an integer parameter the list of parameters. More...

## 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.

## Detailed Description

Base for all driver handling.

Definition in file driver.cpp.

## Function Documentation

## ◆ GetDriverParam()

const char* GetDriverParam | ( | const StringList & | parm,
|  | const char * | name
| ) |  |

Get a string parameter the list of parameters.

Parameters

  parm | The parameters.
  name | The parameter name we're looking for.

Returns
  The parameter value.

Definition at line 50 of file driver.cpp.

Referenced by GetDriverParamBool(), GetDriverParamInt(), MusicDriver_FluidSynth::Start(), and MusicDriver_ExtMidi::Start().

## ◆ GetDriverParamBool()

bool GetDriverParamBool | ( | const StringList & | parm,
|  | const char * | name
| ) |  |

Get a boolean parameter the list of parameters.

Parameters

  parm | The parameters.
  name | The parameter name we're looking for.

Returns
  The parameter value.

Definition at line 70 of file driver.cpp.

References GetDriverParam().

## ◆ GetDriverParamInt()

int GetDriverParamInt | ( | const StringList & | parm,
|  | const char * | name,
|  | int | def
| ) |  |

Get an integer parameter the list of parameters.

Parameters

  parm | The parameters.
  name | The parameter name we're looking for.
  def | The default value if the parameter doesn't exist.

Returns
  The parameter value.

Definition at line 82 of file driver.cpp.

References GetDriverParam().

Referenced by MusicDriver_Win32::Start(), SoundDriver_SDL::Start(), SoundDriver_Win32::Start(), and VideoDriver_Null::Start().