Use empty initializer lists in the openrct2ui project

This commit is contained in:
Hielke Morsink committed 2018-06-05 14:37:24 +02:00
1 parent 9c8c2a2820
commit 8aa122f54e
16 files changed
+23 -23

No files matched your search

+1 -1
View File
@@ -247,7 +247,7 @@ namespace OpenRCT2::Audio
AudioFormat GetFormat() const override
{
AudioFormat result = { 0 };
AudioFormat result = {};
// The second check is there because NullAudioSource does not implement GetFormat. Avoid calling it.
if (_source != nullptr && _source->GetLength() > 0)
{
+2 -2
View File
@@ -44,7 +44,7 @@ namespace OpenRCT2::Audio
IAudioSource * _nullSource = nullptr;
SDL_AudioDeviceID _deviceId = 0;
AudioFormat _format = { 0 };
AudioFormat _format = {};
std::list<ISDLAudioChannel *> _channels;
float _volume = 1.0f;
float _adjustSoundVolume = 0.0f;
@@ -75,7 +75,7 @@ namespace OpenRCT2::Audio
{
Close();
SDL_AudioSpec want = { 0 };
SDL_AudioSpec want = {};
want.freq = 22050;
want.format = AUDIO_S16SYS;
want.channels = 2;
+1 -1
View File
@@ -30,7 +30,7 @@ namespace OpenRCT2::Audio
class FileAudioSource final : public ISDLAudioSource
{
private:
AudioFormat _format = { 0 };
AudioFormat _format = {};
SDL_RWops * _rw = nullptr;
uint64 _dataBegin = 0;
uint64 _dataLength = 0;
+2 -2
View File
@@ -33,7 +33,7 @@ namespace OpenRCT2::Audio
class MemoryAudioSource final : public ISDLAudioSource
{
private:
AudioFormat _format = { 0 };
AudioFormat _format = {};
std::vector<uint8> _data;
uint8 * _dataSDL = nullptr;
size_t _length = 0;
@@ -85,7 +85,7 @@ namespace OpenRCT2::Audio
SDL_RWops * rw = SDL_RWFromFile(path, "rb");
if (rw != nullptr)
{
SDL_AudioSpec audiospec = { 0 };
SDL_AudioSpec audiospec = {};
uint32 audioLen;
SDL_AudioSpec * spec = SDL_LoadWAV_RW(rw, false, &audiospec, &_dataSDL, &audioLen);
if (spec != nullptr)
+2 -2
View File
@@ -756,7 +756,7 @@ static void window_footpath_set_provisional_path_at_point(sint32 x, sint32 y)
sint32 interactionType;
rct_tile_element * tileElement;
LocationXY16 mapCoord = {0};
LocationXY16 mapCoord = {};
get_map_coordinates_from_pos(x, y, VIEWPORT_INTERACTION_MASK_FOOTPATH & VIEWPORT_INTERACTION_MASK_TERRAIN,
&mapCoord.x, &mapCoord.y, &interactionType, &tileElement, nullptr);
x = mapCoord.x;
@@ -873,7 +873,7 @@ static void window_footpath_place_path_at_point(sint32 x, sint32 y)
footpath_provisional_update();
LocationXY16 mapCoord = {0};
LocationXY16 mapCoord = {};
get_map_coordinates_from_pos(x, y, VIEWPORT_INTERACTION_MASK_FOOTPATH & VIEWPORT_INTERACTION_MASK_TERRAIN,
&mapCoord.x, &mapCoord.y, &interactionType, &tileElement, nullptr);
x = mapCoord.x;
+1 -1
View File
@@ -697,7 +697,7 @@ void window_guest_viewport_init(rct_window* w){
union{
sprite_focus sprite;
coordinate_focus coordinate;
} focus = { 0 }; // The focus will be either a sprite or a coordinate.
} focus = {}; // The focus will be either a sprite or a coordinate.
focus.sprite.sprite_id = w->number;
+1 -1
View File
@@ -234,7 +234,7 @@ static void window_install_track_paint(rct_window *w, rct_drawpixelinfo *dpi)
sint32 colour = ColourMapA[w->colours[0]].darkest;
gfx_fill_rect(dpi, x, y, x + 369, y + 216, colour);
rct_g1_element g1temp = { nullptr };
rct_g1_element g1temp = {};
g1temp.offset = _trackDesignPreviewPixels.data() + (_currentTrackPieceDirection * TRACK_PREVIEW_IMAGE_SIZE);
g1temp.width = 370;
g1temp.height = 217;
+1 -1
View File
@@ -289,7 +289,7 @@ static void window_land_rights_tool_update_land_rights(sint16 x, sint16 y)
map_invalidate_selection_rect();
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE;
LocationXY16 mapTile = { 0 };
LocationXY16 mapTile = {};
screen_get_map_xy(x, y, &mapTile.x, &mapTile.y, nullptr);
if (mapTile.x == LOCATION_NULL) {
+1 -1
View File
@@ -316,7 +316,7 @@ static void window_loadsave_resize(rct_window *w)
static bool browse(bool isSave, char *path, size_t pathSize)
{
file_dialog_desc desc = { 0 };
file_dialog_desc desc = {};
const utf8 * extension = "";
uint32 fileType = FILE_EXTENSION_UNKNOWN;
rct_string_id title = STR_NONE;
+1 -1
View File
@@ -895,7 +895,7 @@ static void window_map_scrollpaint(rct_window *w, rct_drawpixelinfo *dpi, sint32
{
gfx_clear(dpi, PALETTE_INDEX_10);
rct_g1_element g1temp = { nullptr };
rct_g1_element g1temp = {};
g1temp.offset = _mapImageData.data();
g1temp.width = MAP_WINDOW_MAP_SIZE;
g1temp.height = MAP_WINDOW_MAP_SIZE;
+2 -2
View File
@@ -952,7 +952,7 @@ struct ride_overall_view {
uint8 zoom;
};
static ride_overall_view ride_overall_views[MAX_RIDES] = {0};
static ride_overall_view ride_overall_views[MAX_RIDES] = {};
static constexpr const sint32 window_ride_tab_animation_divisor[] = { 0, 0, 2, 2, 4, 2, 8, 8, 2, 0 };
static constexpr const sint32 window_ride_tab_animation_frames[] = { 0, 0, 4, 16, 8, 16, 8, 8, 8, 0 };
@@ -4159,7 +4159,7 @@ static void window_ride_set_track_colour_scheme(rct_window *w, sint32 x, sint32
newColourScheme = (uint8)w->ride_colour;
LocationXY16 mapCoord = { 0 };
LocationXY16 mapCoord = {};
get_map_coordinates_from_pos(x, y, VIEWPORT_INTERACTION_MASK_RIDE, &mapCoord.x, &mapCoord.y, &interactionType, &tileElement, nullptr);
x = mapCoord.x;
y = mapCoord.y;
+1 -1
View File
@@ -1199,7 +1199,7 @@ void window_staff_overview_viewport_rotate(rct_window *w)
void window_staff_viewport_init(rct_window* w){
if (w->page != WINDOW_STAFF_OVERVIEW) return;
sprite_focus focus = { 0 };
sprite_focus focus = {};
focus.sprite_id = w->number;
@@ -196,7 +196,7 @@ static TITLE_COMMAND_ORDER get_command_info(sint32 index)
static LocationXY16 get_location()
{
LocationXY16 mapCoord = { 0 };
LocationXY16 mapCoord = {};
rct_window * w = window_get_main();
if (w != nullptr)
{
+4 -4
View File
@@ -1786,7 +1786,7 @@ static void top_toolbar_tool_update_scenery_clear(sint16 x, sint16 y){
map_invalidate_selection_rect();
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE;
LocationXY16 mapTile = { 0 };
LocationXY16 mapTile = {};
screen_get_map_xy(x, y, &mapTile.x, &mapTile.y, nullptr);
if (mapTile.x == LOCATION_NULL) {
@@ -1864,7 +1864,7 @@ static void top_toolbar_tool_update_land_paint(sint16 x, sint16 y)
map_invalidate_selection_rect();
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE;
LocationXY16 mapTile = { 0 };
LocationXY16 mapTile = {};
screen_get_map_xy(x, y, &mapTile.x, &mapTile.y, nullptr);
if (mapTile.x == LOCATION_NULL)
@@ -2203,7 +2203,7 @@ static void top_toolbar_tool_update_water(sint16 x, sint16 y){
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE;
LocationXY16 mapTile = { 0 };
LocationXY16 mapTile = {};
sint32 interaction_type = 0;
get_map_coordinates_from_pos(
x,
@@ -2487,7 +2487,7 @@ static void top_toolbar_tool_update_scenery(sint16 x, sint16 y){
uint8 scenery_type = (selected_tab & 0xFF00) >> 8;
uint8 selected_scenery = selected_tab & 0xFF;
LocationXY16 mapTile = { 0 };
LocationXY16 mapTile = {};
uint32 parameter1, parameter2, parameter3;
sub_6E1F34(x, y, selected_tab, &mapTile.x, &mapTile.y, &parameter1, &parameter2, &parameter3);
+1 -1
View File
@@ -473,7 +473,7 @@ static void window_track_place_paint(rct_window *w, rct_drawpixelinfo *dpi)
// Draw mini tile preview
rct_drawpixelinfo clippedDpi;
if (clip_drawpixelinfo(&clippedDpi, dpi, w->x + 4, w->y + 18, 168, 78)) {
rct_g1_element g1temp = { nullptr };
rct_g1_element g1temp = {};
g1temp.offset = _window_track_place_mini_preview.data();
g1temp.width = TRACK_MINI_PREVIEW_WIDTH;
g1temp.height = TRACK_MINI_PREVIEW_HEIGHT;
+1 -1
View File
@@ -542,7 +542,7 @@ static void window_track_list_paint(rct_window *w, rct_drawpixelinfo *dpi)
y = w->y + (widget->top + widget->bottom) / 2;
if (drawing_engine_get_type() != DRAWING_ENGINE_OPENGL) {
rct_g1_element g1temp = { nullptr };
rct_g1_element g1temp = {};
g1temp.offset = _trackDesignPreviewPixels.data() + (_currentTrackPieceDirection * TRACK_PREVIEW_IMAGE_SIZE);
g1temp.width = 370;
g1temp.height = 217;