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

I was able to build the cocos2d-x 2.2 in arm64 (Xcode 6.1) #9322

Closed
waochidev opened this issue Dec 1, 2014 · 3 comments
Closed

I was able to build the cocos2d-x 2.2 in arm64 (Xcode 6.1) #9322

waochidev opened this issue Dec 1, 2014 · 3 comments

Comments

@waochidev
Copy link

Change1. cocos2d/platform/CCEGLViewProtocol.h

before:

virtual void handleTouchesBegin(int num, int ids[], float xs[], float ys[]);
virtual void handleTouchesMove(int num, int ids[], float xs[], float ys[]);
virtual void handleTouchesEnd(int num, int ids[], float xs[], float ys[]);
virtual void handleTouchesCancel(int num, int ids[], float xs[], float ys[]);
void getSetOfTouchesEndOrCancel(CCSet& set, int num, int ids[], float xs[], float ys[]);

after:

virtual void handleTouchesBegin(int num, intptr_t ids[], float xs[], float ys[]);
virtual void handleTouchesMove(int num, intptr_t ids[], float xs[], float ys[]);
virtual void handleTouchesEnd(int num, intptr_t ids[], float xs[], float ys[]);
virtual void handleTouchesCancel(int num, intptr_t ids[], float xs[], float ys[]);
void getSetOfTouchesEndOrCancel(CCSet& set, int num, intptr_t ids[], float xs[], float ys[]);

Change2. cocos2d/platform/CCEGLViewProtocol.cpp

int id = ids[i]; -> intptr_t id = ids[i];

Change3.cocos2d/platform/ios/EAGLView.mm

before:

(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
    if (isKeyboardShown_)
    {
         [self handleTouchesAfterKeyboardShow];
        return;
    }
    int ids[IOS_MAX_TOUCHES_COUNT] = {0};
    float xs[IOS_MAX_TOUCHES_COUNT] = {0.0f};
    float ys[IOS_MAX_TOUCHES_COUNT] = {0.0f};
    int i = 0;
    for (UITouch *touch in touches) {
         ids[i] = (int)touch;
        xs[i] = [touch locationInView: [touch view]].x * view.contentScaleFactor;;
        ys[i] = [touch locationInView: [touch view]].y * view.contentScaleFactor;;
        ++i;
    }
    cocos2d::CCEGLView::sharedOpenGLView()->handleTouchesBegin(i, ids, xs, ys);
}

after:

(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
    if (isKeyboardShown_)
    {
        [self handleTouchesAfterKeyboardShow];
        return;
    }
    UITouch* ids[IOS_MAX_TOUCHES_COUNT] = {0};
    float xs[IOS_MAX_TOUCHES_COUNT] = {0.0f};
    float ys[IOS_MAX_TOUCHES_COUNT] = {0.0f};
    int i = 0;
    for (UITouch *touch in touches) {
        ids[i] = touch;
        xs[i] = [touch locationInView: [touch view]].x * view.contentScaleFactor;;
        ys[i] = [touch locationInView: [touch view]].y * view.contentScaleFactor;;
        ++i;
    }
    cocos2d::CCEGLView::sharedOpenGLView()->handleTouchesBegin(i, (intptr_t*)ids, xs, ys);
}

in the same way:

(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event
(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event
(void)touchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event

Change4. #if defined(__ARM_NEON__) -> #if defined(__ARM_NEON__) && !defined(__arm64__)

cocos2d/kazmath/src/neon_matrix_impl.c
cocos2d/kazmath/src/mat4.c

Change5. I changed libwebsockets,curl and webp to 3.3rc0.

external/libwebsockets/ios/include/libwebsockets.h -> cocos2d-x-3.3rc0/external/websockets/include/ios/libwebsockets.h
cocos2dx/platform/third_party/ios/curl/*.h -> cocos2d-x-3.3rc0/external/curl/include/ios/curl/*.h
cocos2dx/platform/third_party/ios/webp/*.h -> cocos2d-x-3.3rc0/external/webp/include/ios/webp/*.h

external/libwebsockets/ios/lib/libwebsockets.h -> cocos2d-x-3.3rc0/external/websockets/prebuilt/ios/libwebsockets.a
cocos2dx/platform/third_party/ios/libraries/libcurl.a -> cocos2d-x-3.3rc0/external/curl/prebuilt/ios/libcurl.a
cocos2dx/platform/third_party/ios/libraries/libwebp.a -> cocos2d-x-3.3rc0/external/webp/prebuilt/ios/libwebp.a
@waochidev waochidev changed the title I was able to build the cocos2d-x 2.2 in arm64 I was able to build the cocos2d-x 2.2 in arm64 (Xcode 6.1) Dec 2, 2014
@robojiannis
Copy link

did you also get spidermonkey errors?
scripting/javascript/spidermonkey-ios/include/js/Value.h throws a 'moz-static-assert13' declared as an array with a negative size error at lines 335 & 1227 (moz_static_assert18).

Same semantic issue (moz_static_assert37) at scripting/javascript/spidermonkey-ios/include/jsfriendapi.h line 1351.

Any clues?

@minggo
Copy link
Contributor

minggo commented Dec 10, 2014

Please refer to this thread.
We will release v2.2.6 this Friday. Spidermonkey issue is fixed too.

@walzer walzer closed this as completed Apr 27, 2015
@walzer
Copy link
Contributor

walzer commented Apr 27, 2015

Officially support in both v2 and v3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants