Skip to content
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

(WIP!) add ios support #21

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ set(CMAKE_OSX_ARCHITECTURES "x86_64")

project(TextureLoader VERSION 1.0.0)

if(${GEODE_TARGET_PLATFORM} STREQUAL "iOS")
message(STATUS "building for ios :3")
unset(CMAKE_OSX_ARCHITECTURES)
set(CMAKE_OSX_ARCHITECTURES arm64)
set(CMAKE_OSX_DEPLOYMENT_TARGET "14.0")
set(CMAKE_SYSTEM_NAME "iOS")
endif()

file(GLOB SOURCES
src/*.cpp
)
Expand Down
3 changes: 2 additions & 1 deletion mod.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"geode": "v2.0.0-beta.23",
"geode": "2.0.0-beta.25",
"version": "v1.5.1",
"gd": {
"win": "2.204",
"android": "*",
"ios": "2.205",
"mac": "2.200"
},
"id": "geode.texture-loader",
Expand Down
4 changes: 4 additions & 0 deletions src/DragThingy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@ bool DragThingy::ccTouchBegan(CCTouch* touch, CCEvent*) {

void DragThingy::ccTouchMoved(CCTouch* touch, CCEvent*) {
if (m_onMove)
#ifndef GEODE_IS_IOS
m_onMove(touch->getDelta());
#else
m_onMove(ccpSub(touch->getLocation(), CCDirector::sharedDirector()->convertToGL(touch->m_prevPoint))); // TODO
#endif
}

void DragThingy::ccTouchEnded(CCTouch* touch, CCEvent*) {
Expand Down
4 changes: 4 additions & 0 deletions src/PackInfoPopup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ class WackyBypassFont : public CCLabelBMFont {
const char* text,
ghc::filesystem::path const& fnt
) {
#ifdef GEODE_IS_IOS
auto label = CCLabelBMFont::create("", "");
#else
auto label = CCLabelBMFont::create();
#endif
static_cast<WackyBypassFont*>(label)->setFntFile(fnt); // NOLINT(*-pro-type-static-cast-downcast)
label->setString(text);
return label;
Expand Down