diff --git a/src/openrct2-ui/audio/AudioMixer.cpp b/src/openrct2-ui/audio/AudioMixer.cpp index 3295cc7c50..23be6e9215 100644 --- a/src/openrct2-ui/audio/AudioMixer.cpp +++ b/src/openrct2-ui/audio/AudioMixer.cpp @@ -330,7 +330,7 @@ namespace OpenRCT2::Audio // Finally mix on to destination buffer size_t dstLength = std::min(length, bufferLen); - SDL_MixAudioFormat(data, (const uint8_t*)buffer, _format.format, (uint32_t)dstLength, mixVolume); + SDL_MixAudioFormat(data, static_cast(buffer), _format.format, (uint32_t)dstLength, mixVolume); channel->UpdateOldVolume(); } @@ -357,7 +357,7 @@ namespace OpenRCT2::Audio uint32_t inLen = srcSamples; uint32_t outLen = dstSamples; speex_resampler_process_interleaved_int( - resampler, (const spx_int16_t*)srcBuffer, &inLen, (spx_int16_t*)_effectBuffer.data(), &outLen); + resampler, static_cast(srcBuffer), &inLen, (spx_int16_t*)_effectBuffer.data(), &outLen); return outLen * byteRate; } @@ -369,10 +369,10 @@ namespace OpenRCT2::Audio switch (_format.format) { case AUDIO_S16SYS: - EffectPanS16(channel, (int16_t*)buffer, (int32_t)(len / sampleSize)); + EffectPanS16(channel, static_cast(buffer), (int32_t)(len / sampleSize)); break; case AUDIO_U8: - EffectPanU8(channel, (uint8_t*)buffer, (int32_t)(len / sampleSize)); + EffectPanU8(channel, static_cast(buffer), (int32_t)(len / sampleSize)); break; } } @@ -417,10 +417,10 @@ namespace OpenRCT2::Audio switch (_format.format) { case AUDIO_S16SYS: - EffectFadeS16((int16_t*)buffer, fadeLength, startVolume, endVolume); + EffectFadeS16(static_cast(buffer), fadeLength, startVolume, endVolume); break; case AUDIO_U8: - EffectFadeU8((uint8_t*)buffer, fadeLength, startVolume, endVolume); + EffectFadeU8(static_cast(buffer), fadeLength, startVolume, endVolume); break; } } @@ -494,7 +494,7 @@ namespace OpenRCT2::Audio { size_t reqConvertBufferCapacity = len * cvt->len_mult; _convertBuffer.resize(reqConvertBufferCapacity); - std::copy_n((const uint8_t*)src, len, _convertBuffer.data()); + std::copy_n(static_cast(src), len, _convertBuffer.data()); cvt->len = (int32_t)len; cvt->buf = (uint8_t*)_convertBuffer.data(); diff --git a/src/openrct2-ui/drawing/engines/HardwareDisplayDrawingEngine.cpp b/src/openrct2-ui/drawing/engines/HardwareDisplayDrawingEngine.cpp index 8365a9f789..a474d9d124 100644 --- a/src/openrct2-ui/drawing/engines/HardwareDisplayDrawingEngine.cpp +++ b/src/openrct2-ui/drawing/engines/HardwareDisplayDrawingEngine.cpp @@ -264,7 +264,7 @@ private: int32_t padding = pitch - (width * 4); if (pitch == width * 4) { - uint32_t* dst = (uint32_t*)pixels; + uint32_t* dst = static_cast(pixels); for (int32_t i = width * height; i > 0; i--) { *dst++ = palette[*src++]; @@ -274,7 +274,7 @@ private: { if (pitch == (width * 2) + padding) { - uint16_t* dst = (uint16_t*)pixels; + uint16_t* dst = static_cast(pixels); for (int32_t y = height; y > 0; y--) { for (int32_t x = width; x > 0; x--) @@ -288,7 +288,7 @@ private: } else if (pitch == width + padding) { - uint8_t* dst = (uint8_t*)pixels; + uint8_t* dst = static_cast(pixels); for (int32_t y = height; y > 0; y--) { for (int32_t x = width; x > 0; x--) diff --git a/src/openrct2-ui/interface/Widget.cpp b/src/openrct2-ui/interface/Widget.cpp index 8f42b52c20..c8d640d7c1 100644 --- a/src/openrct2-ui/interface/Widget.cpp +++ b/src/openrct2-ui/interface/Widget.cpp @@ -603,7 +603,7 @@ static void widget_checkbox_draw(rct_drawpixelinfo* dpi, rct_window* w, rct_widg if (widget_is_pressed(w, widgetIndex)) { gCurrentFontSpriteBase = FONT_SPRITE_BASE_MEDIUM; - gfx_draw_string(dpi, (char*)CheckBoxMarkString, NOT_TRANSLUCENT(colour), l, yMid - 5); + gfx_draw_string(dpi, static_cast(CheckBoxMarkString), NOT_TRANSLUCENT(colour), l, yMid - 5); } // draw the text @@ -701,7 +701,7 @@ static void widget_hscrollbar_draw( uint8_t flags = (scroll->flags & HSCROLLBAR_LEFT_PRESSED) ? INSET_RECT_FLAG_BORDER_INSET : 0; gfx_fill_rect_inset(dpi, l, t, l + 9, b, colour, flags); - gfx_draw_string(dpi, (char*)BlackLeftArrowString, COLOUR_BLACK, l + 1, t); + gfx_draw_string(dpi, static_cast(BlackLeftArrowString), COLOUR_BLACK, l + 1, t); } // Thumb @@ -718,7 +718,7 @@ static void widget_hscrollbar_draw( uint8_t flags = (scroll->flags & HSCROLLBAR_RIGHT_PRESSED) ? INSET_RECT_FLAG_BORDER_INSET : 0; gfx_fill_rect_inset(dpi, r - 9, t, r, b, colour, flags); - gfx_draw_string(dpi, (char*)BlackRightArrowString, COLOUR_BLACK, r - 6, t); + gfx_draw_string(dpi, static_cast(BlackRightArrowString), COLOUR_BLACK, r - 6, t); } } @@ -737,7 +737,7 @@ static void widget_vscrollbar_draw( // Up button gfx_fill_rect_inset( dpi, l, t, r, t + 9, colour, ((scroll->flags & VSCROLLBAR_UP_PRESSED) ? INSET_RECT_FLAG_BORDER_INSET : 0)); - gfx_draw_string(dpi, (char*)BlackUpArrowString, COLOUR_BLACK, l + 1, t - 1); + gfx_draw_string(dpi, static_cast(BlackUpArrowString), COLOUR_BLACK, l + 1, t - 1); // Thumb gfx_fill_rect_inset( @@ -747,7 +747,7 @@ static void widget_vscrollbar_draw( // Down button gfx_fill_rect_inset( dpi, l, b - 9, r, b, colour, ((scroll->flags & VSCROLLBAR_DOWN_PRESSED) ? INSET_RECT_FLAG_BORDER_INSET : 0)); - gfx_draw_string(dpi, (char*)BlackDownArrowString, COLOUR_BLACK, l + 1, b - 9); + gfx_draw_string(dpi, static_cast(BlackDownArrowString), COLOUR_BLACK, l + 1, b - 9); } /** diff --git a/src/openrct2-ui/windows/Changelog.cpp b/src/openrct2-ui/windows/Changelog.cpp index 31264ed571..329dd0b616 100644 --- a/src/openrct2-ui/windows/Changelog.cpp +++ b/src/openrct2-ui/windows/Changelog.cpp @@ -199,7 +199,7 @@ static void window_changelog_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, if (y + lineHeight < dpi->y || y >= dpi->y + dpi->height) continue; - gfx_draw_string(dpi, (char*)line, w->colours[0], x, y); + gfx_draw_string(dpi, static_cast(line), w->colours[0], x, y); } } diff --git a/src/openrct2-ui/windows/EditorObjectSelection.cpp b/src/openrct2-ui/windows/EditorObjectSelection.cpp index 2c2fccc1c7..dd6218cc52 100644 --- a/src/openrct2-ui/windows/EditorObjectSelection.cpp +++ b/src/openrct2-ui/windows/EditorObjectSelection.cpp @@ -1147,7 +1147,7 @@ static void window_editor_object_selection_scrollpaint(rct_window* w, rct_drawpi if (*listItem.flags & (OBJECT_SELECTION_FLAG_IN_USE | OBJECT_SELECTION_FLAG_ALWAYS_REQUIRED)) colour2 |= COLOUR_FLAG_INSET; - gfx_draw_string(dpi, (char*)CheckBoxMarkString, colour2, x, y); + gfx_draw_string(dpi, static_cast(CheckBoxMarkString), colour2, x, y); } x = gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER ? 0 : 15; diff --git a/src/openrct2-ui/windows/EditorObjectiveOptions.cpp b/src/openrct2-ui/windows/EditorObjectiveOptions.cpp index 636d7b7e0f..82562ab705 100644 --- a/src/openrct2-ui/windows/EditorObjectiveOptions.cpp +++ b/src/openrct2-ui/windows/EditorObjectiveOptions.cpp @@ -1175,7 +1175,7 @@ static void window_editor_objective_options_rides_scrollpaint(rct_window* w, rct { gCurrentFontSpriteBase = stringId == STR_WINDOW_COLOUR_2_STRINGID ? FONT_SPRITE_BASE_MEDIUM_EXTRA_DARK : FONT_SPRITE_BASE_MEDIUM_DARK; - gfx_draw_string(dpi, (char*)CheckBoxMarkString, w->colours[1] & 0x7F, 2, y); + gfx_draw_string(dpi, static_cast(CheckBoxMarkString), w->colours[1] & 0x7F, 2, y); } // Ride name diff --git a/src/openrct2-ui/windows/Multiplayer.cpp b/src/openrct2-ui/windows/Multiplayer.cpp index ce16d1a59f..22927b155c 100644 --- a/src/openrct2-ui/windows/Multiplayer.cpp +++ b/src/openrct2-ui/windows/Multiplayer.cpp @@ -756,7 +756,7 @@ static void window_multiplayer_groups_mouseup(rct_window* w, rct_widgetindex wid case WIDX_RENAME_GROUP:; int32_t groupIndex = network_get_group_index(_selectedGroup); const utf8* groupName = network_get_group_name(groupIndex); - window_text_input_raw_open(w, widgetIndex, STR_GROUP_NAME, STR_ENTER_NEW_NAME_FOR_THIS_GROUP, (utf8*)groupName, 32); + window_text_input_raw_open(w, widgetIndex, STR_GROUP_NAME, STR_ENTER_NEW_NAME_FOR_THIS_GROUP, groupName, 32); break; } } diff --git a/src/openrct2-ui/windows/Themes.cpp b/src/openrct2-ui/windows/Themes.cpp index 6483fadc5a..53d955b5ab 100644 --- a/src/openrct2-ui/windows/Themes.cpp +++ b/src/openrct2-ui/windows/Themes.cpp @@ -921,7 +921,8 @@ void window_themes_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, int32_t sc { gCurrentFontSpriteBase = FONT_SPRITE_BASE_MEDIUM_DARK; gfx_draw_string( - dpi, (char*)CheckBoxMarkString, w->colours[1] & 0x7F, _button_offset_x + 12 * j, y + _check_offset_y); + dpi, static_cast(CheckBoxMarkString), w->colours[1] & 0x7F, _button_offset_x + 12 * j, + y + _check_offset_y); } } }