Skip to content

Commit be4e71f

Browse files
author
Your Name
committed
Remove unnecessary static_cast<int> casts
1 parent fecdae7 commit be4e71f

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

CIO/CButton.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ bool CButton::render()
309309
button_text = "PIC";
310310
}
311311
} else if(button_text)
312-
CFont::writeText(Surf_Button, button_text, Position(static_cast<int>(size_.x) / 2, static_cast<int>(size_.y - 11) / 2),
312+
CFont::writeText(Surf_Button, button_text, Position(size_.x / 2, (size_.y - 11) / 2),
313313
FontSize::Medium, button_text_color, FontAlign::Middle);
314314

315315
return true;

callbacks.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -239,21 +239,21 @@ void callback::submenuOptions(int Param)
239239
case INITIALIZING_CALL:
240240
SubMenu = global::s2->RegisterMenu(std::make_unique<CMenu>(SPLASHSCREEN_SUBMENU3));
241241
// add button for "back to main menu"
242-
SubMenu->addButton(submenuOptions, MAINMENU, Point16(static_cast<int>(global::s2->GameResolution.x / 2 - 100), 440),
242+
SubMenu->addButton(submenuOptions, MAINMENU, Point16(global::s2->GameResolution.x / 2 - 100, 440),
243243
Extent16(200, 20), BUTTON_RED1, "back");
244244
// add menu title
245-
SubMenu->addText("Options", Point16(static_cast<int>(global::s2->GameResolution.x / 2 - 20), 10), FontSize::Large);
245+
SubMenu->addText("Options", Point16(global::s2->GameResolution.x / 2 - 20, 10), FontSize::Large);
246246
// add screen resolution
247247
if(TextResolution)
248248
SubMenu->delText(TextResolution);
249249
TextResolution = SubMenu->addText(
250250
helpers::format("Game Resolution: %d*%d / %s", global::s2->GameResolution.x, global::s2->GameResolution.y,
251251
(global::s2->fullscreen ? "Fullscreen" : "Window")),
252-
Point16(static_cast<int>(global::s2->GameResolution.x / 2 - 110), 50), FontSize::Medium);
252+
Point16(global::s2->GameResolution.x / 2 - 110, 50), FontSize::Medium);
253253
if(ButtonFullscreen)
254254
SubMenu->delButton(ButtonFullscreen);
255255
ButtonFullscreen = SubMenu->addButton(
256-
submenuOptions, FULLSCREEN, Point16(static_cast<int>(global::s2->GameResolution.x / 2 - 100), 190),
256+
submenuOptions, FULLSCREEN, Point16(global::s2->GameResolution.x / 2 - 100, 190),
257257
Extent16(200, 20), BUTTON_RED1, (global::s2->fullscreen ? "WINDOW" : "FULLSCREEN"));
258258
SelectBoxRes = SubMenu->addSelectBox(ButtonFullscreen->getPos() - Point16(0, 120), Extent16(200, 110),
259259
FontSize::Medium, FontColor::Yellow, BUTTON_GREY);

0 commit comments

Comments
 (0)