Skip to content

Commit

Permalink
remove duplicate imgui function
Browse files Browse the repository at this point in the history
  • Loading branch information
DubbleClick committed Jul 28, 2024
1 parent e371394 commit c3b11b9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
8 changes: 0 additions & 8 deletions GWToolboxdll/Color.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,6 @@ namespace Colors {
i[3] = static_cast<int>(color >> IM_COL32_B_SHIFT & 0xFF);
}

static void ConvertU32ToFloat4RGBA(const Color color, float* i)
{
i[0] = static_cast<float>(color >> IM_COL32_R_SHIFT & 0xFF) / 255.0f;
i[1] = static_cast<float>(color >> IM_COL32_G_SHIFT & 0xFF) / 255.0f;
i[2] = static_cast<float>(color >> IM_COL32_B_SHIFT & 0xFF) / 255.0f;
i[3] = static_cast<float>(color >> IM_COL32_A_SHIFT & 0xFF) / 255.0f;
}

static Color ConvertInt4ToU32(const int* i)
{
return static_cast<Color>((i[0] & 0xFF) << IM_COL32_A_SHIFT) |
Expand Down
5 changes: 2 additions & 3 deletions GWToolboxdll/Widgets/Minimap/SymbolsRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,8 @@ void SymbolsRenderer::Render(IDirect3DDevice9* device)
}

const auto quest_im_color = QuestModule::GetQuestColor(quest.quest_id);
float quest_color[4];
Colors::ConvertU32ToFloat4RGBA(quest_im_color, quest_color);
device->SetPixelShaderConstantF(0, quest_color, 1);
const auto quest_color = ImGui::ColorConvertU32ToFloat4(quest_im_color);
device->SetPixelShaderConstantF(0, &quest_color.x, 1);
const GW::Vec2f qpos = { quest.marker.x, quest.marker.y };
if (std::ranges::contains(markers_drawn, qpos))
return; // Don't draw more than 1 marker for a position
Expand Down

0 comments on commit c3b11b9

Please sign in to comment.