Skip to content

Remove warnings caused by recent deprecations #1379

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions loader/include/Geode/utils/cocos.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -887,9 +887,9 @@ namespace geode::cocos {
*/
inline cocos2d::ccColor3B lighten3B(cocos2d::ccColor3B const& color, int amount) {
return {
static_cast<GLubyte>(utils::clamp(color.r + amount, 0, 255)),
static_cast<GLubyte>(utils::clamp(color.g + amount, 0, 255)),
static_cast<GLubyte>(utils::clamp(color.b + amount, 0, 255)),
static_cast<GLubyte>(std::clamp(color.r + amount, 0, 255)),
static_cast<GLubyte>(std::clamp(color.g + amount, 0, 255)),
static_cast<GLubyte>(std::clamp(color.b + amount, 0, 255)),
};
}

Expand Down
2 changes: 1 addition & 1 deletion loader/src/loader/ModImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ Result<> Mod::Impl::uninstall(bool deleteSaveData) {

if (this->isInternal()) {
utils::game::launchLoaderUninstaller(deleteSaveData);
utils::game::exit();
utils::game::exit(true);
return Ok();
}

Expand Down
2 changes: 1 addition & 1 deletion loader/src/loader/SettingNodeV3.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class NumberSettingNodeV3 : public SettingValueNodeV3<S> {
auto min = this->getSetting()->getMinValue().value_or(-100);
auto max = this->getSetting()->getMaxValue().value_or(+100);
auto range = max - min;
return static_cast<float>(clamp(static_cast<double>(value - min) / range, 0.0, 1.0));
return static_cast<float>(std::clamp(static_cast<double>(value - min) / range, 0.0, 1.0));
}
ValueType valueFromSlider(float num) {
auto min = this->getSetting()->getMinValue().value_or(-100);
Expand Down
2 changes: 1 addition & 1 deletion loader/src/platform/windows/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ void updateGeode() {
std::filesystem::exists(updatesDir / "GeodeUpdater.exe"))
std::filesystem::rename(updatesDir / "GeodeUpdater.exe", workingDir / "GeodeUpdater.exe");

utils::game::restart();
utils::game::restart(true);
}

void patchDelayLoad() {
Expand Down
2 changes: 1 addition & 1 deletion loader/src/ui/mods/GeodeStyle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ bool GeodeTabSprite::init(const char* iconFrame, const char* text, float width,
this->addChildAtPosition(m_icon, Anchor::Left, ccp(16, 0), false);

m_label = CCLabelBMFont::create(text, "bigFont.fnt");
m_label->limitLabelWidth(this->getContentWidth() - 45, clamp(width * .0045f, .35f, .55f), .1f);
m_label->limitLabelWidth(this->getContentWidth() - 45, std::clamp(width * .0045f, .35f, .55f), .1f);
m_label->setAnchorPoint({ .5f, .5f });
this->addChildAtPosition(m_label, Anchor::Left, ccp((itemSize.width - iconSize.width) / 2 + iconSize.width, 0), false);

Expand Down
2 changes: 1 addition & 1 deletion loader/src/ui/mods/ModsLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ void ModsStatusNode::onRestart(CCObject*) {
// Delayed by 2 frames - one is needed to render the "Restarting text"
Loader::get()->queueInMainThread([] {
// the other never finishes rendering because the game actually restarts at this point
game::restart();
game::restart(true);
});
});
}
Expand Down
2 changes: 1 addition & 1 deletion loader/src/ui/mods/settings/ModSettingsPopup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ void ModSettingsPopup::onRestart(CCObject*) {
// Delayed by 2 frames - one is needed to render the "Restarting text"
Loader::get()->queueInMainThread([] {
// the other never finishes rendering because the game actually restarts at this point
game::restart();
game::restart(true);
});
});
}
Expand Down
2 changes: 1 addition & 1 deletion loader/src/ui/nodes/MDPopup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ void MDPopup::onBtn(CCObject* sender) {
}

float MDPopup::estimateHeight(std::string const& content) {
return clamp(string::count(content, '\n') * 50.f, 180.f, 280.f);
return std::clamp(string::count(content, '\n') * 50.f, 180.f, 280.f);
}

MDPopup* MDPopup::create(
Expand Down
6 changes: 3 additions & 3 deletions loader/src/utils/cocos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -426,15 +426,15 @@ CCRect geode::cocos::calculateChildCoverage(CCNode* parent) {
}

void geode::cocos::limitNodeSize(CCNode* spr, CCSize const& size, float def, float min) {
spr->setScale(clamp(std::min(size.height / spr->getContentHeight(), size.width / spr->getContentWidth()), min, def));
spr->setScale(std::clamp(std::min(size.height / spr->getContentHeight(), size.width / spr->getContentWidth()), min, def));
}

void geode::cocos::limitNodeWidth(CCNode* spr, float width, float def, float min) {
spr->setScale(clamp(width / spr->getContentSize().width, min, def));
spr->setScale(std::clamp(width / spr->getContentSize().width, min, def));
}

void geode::cocos::limitNodeHeight(CCNode* spr, float height, float def, float min) {
spr->setScale(clamp(height / spr->getContentSize().height, min, def));
spr->setScale(std::clamp(height / spr->getContentSize().height, min, def));
}

bool geode::cocos::nodeIsVisible(CCNode* node) {
Expand Down
Loading