Skip to content

Commit

Permalink
build fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ThirteenAG committed Oct 20, 2023
1 parent 478f887 commit 37d9e85
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions source/ResidentEvil.FusionFix/dllmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#include "LEDEffects.h"
#include <vector>
#include <algorithm>
#include <ranges>

static bool bLogiLedInitialized = false;

Expand Down Expand Up @@ -162,19 +161,20 @@ void Init()
*(uint32_t*)(regs.esp + 0x58) = regs.ebx;

std::sort(resList.begin(), resList.end(), [](const std::string& lhs, const std::string& rhs)
{
int32_t x1, y1, x2, y2;
sscanf_s(lhs.c_str(), "%dx%d", &x1, &y1);
sscanf_s(rhs.c_str(), "%dx%d", &x2, &y2);
return (x1 != x2) ? (x1 < x2) : (x1 * y1 < x2 * y2);
});
{
int32_t x1, y1, x2, y2;
sscanf_s(lhs.c_str(), "%dx%d", &x1, &y1);
sscanf_s(rhs.c_str(), "%dx%d", &x2, &y2);
return (x1 != x2) ? (x1 < x2) : (x1 * y1 < x2 * y2);
});
resList.erase(std::unique(std::begin(resList), std::end(resList)), resList.end());

for (auto&& [idx, str] : std::ranges::views::enumerate(resList))
for (auto idx = 0; idx < resList.size(); idx++)
{
int x = 0, y = 0;
sscanf_s(str.c_str(), "%dx%d", &x, &y);
resListString.emplace_back(str.c_str(), idx);
auto str = resList[idx].c_str();
sscanf_s(str, "%dx%d", &x, &y);
resListString.emplace_back(str, idx);
resListNum.emplace_back(x, y, idx);
}

Expand Down

0 comments on commit 37d9e85

Please sign in to comment.