Use mulitply instead of divide where feasible

This commit is contained in:
Michael Theall 2020-04-07 18:05:51 -05:00
parent ffa6195182
commit a265706671
3 changed files with 6 additions and 6 deletions

View File

@ -290,7 +290,7 @@ void imgui::citro3d::init ()
atlas->TexWidth = glyphInfo->sheetWidth;
atlas->TexHeight = glyphInfo->sheetHeight * glyphInfo->nSheets;
atlas->TexUvScale = ImVec2 (1.0f / atlas->TexWidth, 1.0f / atlas->TexHeight);
atlas->TexUvWhitePixel = ImVec2 (0.5f / 8.0f, glyphInfo->nSheets + 0.5f / 8.0f);
atlas->TexUvWhitePixel = ImVec2 (0.5f * 0.125f, glyphInfo->nSheets + 0.5f * 0.125f);
atlas->TexPixelsAlpha8 = static_cast<unsigned char *> (IM_ALLOC (1)); // dummy allocation
// initialize font config

View File

@ -74,7 +74,7 @@ void FtpServer::draw ()
ImGui::SetNextWindowPos (ImVec2 (0, 0), ImGuiCond_FirstUseEver);
#ifdef _3DS
// top screen
ImGui::SetNextWindowSize (ImVec2 (width, height / 2.0f));
ImGui::SetNextWindowSize (ImVec2 (width, height * 0.5f));
#else
ImGui::SetNextWindowSize (ImVec2 (width, height));
#endif
@ -123,8 +123,8 @@ void FtpServer::draw ()
ImGui::End ();
// bottom screen
ImGui::SetNextWindowSize (ImVec2 (width * 0.8f, height / 2.0f));
ImGui::SetNextWindowPos (ImVec2 (width * 0.1f, height / 2.0f), ImGuiCond_FirstUseEver);
ImGui::SetNextWindowSize (ImVec2 (width * 0.8f, height * 0.5f));
ImGui::SetNextWindowPos (ImVec2 (width * 0.1f, height * 0.5f), ImGuiCond_FirstUseEver);
ImGui::Begin ("Sessions",
nullptr,
ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize);

View File

@ -809,9 +809,9 @@ void imgui::deko3d::render ()
void imgui::deko3d::test ()
{
auto const x1 = (s_width - LOGO_WIDTH) / 2.0f;
auto const x1 = (s_width - LOGO_WIDTH) * 0.5f;
auto const x2 = x1 + LOGO_WIDTH;
auto const y1 = (s_height - LOGO_HEIGHT) / 2.0f;
auto const y1 = (s_height - LOGO_HEIGHT) * 0.5f;
auto const y2 = y1 + LOGO_HEIGHT;
ImGui::GetBackgroundDrawList ()->AddImage (