RoootTheFox / celeste-ios

hacky ios port of celeste
MIT License
24 stars 5 forks source link

Fix disabling code signing on latest VS for Mac, add touch support #4

Closed r58Playz closed 3 months ago

r58Playz commented 3 months ago

This fixes disabling code signing on the latest visual studio for mac. Combined with the fnalibs-ios-builder-celeste PR, builds should now work on latest macos/xcode/visual studio for mac.

r58Playz commented 3 months ago

Also note for touch support:

I tried using the GCVirtualController API and initializing it with a DllImport'd C function, but the controller only shows up for less than a second. This hook works well, but I still have to integrate it into the code without making it a hook.

#import <Foundation/Foundation.h>
#import <GameController/GameController.h>
#import <CoreGraphics/CoreGraphics.h>

GCVirtualController *CONTROLLER = NULL;

%hook SDL_uikitmetalview
-(id)initWithFrame:(CGRect)frame scale:(CGFloat)scale {
    id orig = %orig;
    if ([GCController controllers].count == 0 && ![GCKeyboard coalescedKeyboard]) {
        if (!CONTROLLER) {
            GCVirtualControllerConfiguration *configuration = [GCVirtualControllerConfiguration new];
            configuration.elements = [NSSet setWithArray:@[
                GCInputButtonA,
                GCInputButtonB,
                GCInputButtonX,
                GCInputButtonY,
                GCInputRightTrigger,
                GCInputLeftTrigger,
                GCInputRightShoulder,
                GCInputLeftShoulder,
                GCInputDirectionPad,
                GCInputButtonMenu
            ]];
            CONTROLLER = [GCVirtualController virtualControllerWithConfiguration:configuration];
        }
        [CONTROLLER connectWithReplyHandler:NULL];
    }
    return orig;
}
%end
RoootTheFox commented 3 months ago

i mean, i suppose a hook would be fine. i just feel there's a way to do this without depending on substrate.

r58Playz commented 3 months ago

i just feel there's a way to do this without depending on substrate.

I've added an SDL2 patch that initializes GCVirtualController and a prompt to apply it in the build script.

RoootTheFox commented 3 months ago

i'll look into this once i'm home again, thanks you!

RoootTheFox commented 3 months ago

also, before I merge this: is it fine by you if I license this repo under a permissive license first (to avoid any sort of legal trouble) - i'm thinking of MIT or GPLv3 @r58Playz

r58Playz commented 3 months ago

also, before I merge this: is it fine by you if I license this repo under a permissive license first (to avoid any sort of legal trouble) - i'm thinking of MIT or GPLv3

That's fine.

RoootTheFox commented 3 months ago

hi @r58Playz, i licensed this project under MIT - if you agree to have your changes under this license, can you rebase your commits?

RoootTheFox commented 3 months ago

thank you so much !!