Skip to content

Commit

Permalink
fix ios
Browse files Browse the repository at this point in the history
  • Loading branch information
TheSillyDoggo committed Aug 8, 2024
1 parent 350690c commit 29aceee
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Keybinds/KeyInfoPopup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ KeyInfoPopup* KeyInfoPopup::createWithKeyAndBind(int key, SetBindNode* node)

void KeyInfoPopup::customSetup()
{
#ifndef GEODE_IS_IOS

auto lbl = CCLabelBMFont::create(CCKeyboardDispatcher::get()->keyToString(as<enumKeyCodes>(key)), "bigFont.fnt");

auto lblBG = CCScale9Sprite::create("geode.loader/black-square.png");
Expand All @@ -39,6 +41,8 @@ void KeyInfoPopup::customSetup()
baseLayer->addChildAtPosition(lblBG, Anchor::Center, ccp(0, 10));

ok->setPositionX(ok->getPositionX() - removeBtn->getContentWidth() / 2);

#endif
}

void KeyInfoPopup::onRemove(CCObject* sender)
Expand Down
4 changes: 4 additions & 0 deletions src/Keybinds/SetBindSetting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,15 @@ std::string SetBindNode::nameForKey(int key)
if (key == -1)
return "Unknown";

#ifndef GEODE_IS_IOS

auto k = CCKeyboardDispatcher::get()->keyToString(as<enumKeyCodes>(key));

if (k == nullptr)
return "Unknown";

#endif

return std::string(k);
}

Expand Down
17 changes: 17 additions & 0 deletions src/Utils/CCBlurLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,21 @@ void CCBlurLayer::draw()
if (parent && !visiting) {
visiting = true;

#ifdef GEODE_IS_IOS
reinterpret_cast<void(__cdecl*)()>(geode::base::get() + 0x17420c)();
#else
kmGLPushMatrix();
#endif

parent->transform();
parent->visit();


#ifdef GEODE_IS_IOS
reinterpret_cast<void(__cdecl*)()>(geode::base::get() + 0x174250)();
#else
kmGLPopMatrix();
#endif

visiting = false;
}
Expand All @@ -128,7 +137,11 @@ void CCBlurLayer::draw()
getParent()->setVisible(true);

glBindVertexArray(ppVao);
#ifdef GEODE_IS_IOS
reinterpret_cast<void(__cdecl*)(GLuint)>(geode::base::get() + 0x19a4f8)(ppShader.program);
#else
ccGLUseProgram(ppShader.program);
#endif
glUniform1i(ppShaderFast, true);
glUniform1f(ppShaderRadius, blurStrength);

Expand Down Expand Up @@ -353,7 +366,11 @@ void setupPostProcess() {
}
log::info("{}", res.unwrap());

#ifdef GEODE_IS_IOS
reinterpret_cast<void(__cdecl*)(GLuint)>(geode::base::get() + 0x19a4f8)(ppShader.program);
#else
ccGLUseProgram(ppShader.program);
#endif
glUniform1i(glGetUniformLocation(ppShader.program, "screen"), 0);
glUniform2f(glGetUniformLocation(ppShader.program, "screenSize"), size.width, size.height);
ppShaderFast = glGetUniformLocation(ppShader.program, "fast");
Expand Down

0 comments on commit 29aceee

Please sign in to comment.