美文网首页
cocosbuilder3编译问题

cocosbuilder3编译问题

作者: 保罗柴夫斯基 | 来源:发表于2019-04-16 23:32 被阅读0次

cocosbuilder编辑器到目前也有7年没有更新过了,问题也比较多。
我自己的一个老项目还需要使用cocosbuilder编辑器的情况,所以是时隔五年重新又趟了一次坑!
记录解决方案

使用cocos2d-objc 替换 cocos2d-iphone

github cocos2d-obj

Okay just worked through this.
Make sure you pull branch v3.5.0.
Step 1: Follow patrickhoey's Step 1 and modify .gitmodules
Step 2: Make sure you're in the root directory of the CocosBuilder project and run:
git submodule update --init --recursive
This will error on cocos-iphone-classic.
Step 3: cd CocosBuilder/libs/cocos2d-iphone
Step 4: git checkout 5e8fdee5cdc4450ad32f5a8579ee6a0fdcbb1cfa
Step 5: Get a copy of this project in an entirely separate directory. There have been files removed at some point that need to be re-added.
https://github.com/cocos2d/cocos2d-iphone-classic
Step 6: Copy the following files from the cocos2d-iphone-classic project:
cocos-iphone-classic/cocos2d/ccFPSImages.m --> CocosBuilder/libs/cocos2d-iphone/cocos2d/ccFPSImages.m
cocos-iphone-classic/cocos2d/Support/uthash.h --> CocosBuilder/libs/cocos2d-iphone/cocos2d/Support/uthash.h
cocos-iphone-classic/cocos2d/Support/utlist.h --> CocosBuilder/libs/cocos2d-iphone/cocos2d/Support/utlist.h
This worked for me.

修改文件CCGLProgram.m

#define EXTENSION_STRING "#extension GL_OES_standard_derivatives : enable"
static NSString * g_extensionStr = @EXTENSION_STRING;
- (BOOL)compileShader:(GLuint *)shader type:(GLenum)type byteArray:(const GLchar *)source
{
    GLint status;
    if (!source)
        return NO;
    // BEGIN workaround for Xcode 7 bug
    BOOL hasExtension = NO;
    NSString *sourceStr = [NSString stringWithUTF8String:source];
    if([sourceStr rangeOfString:g_extensionStr].location != NSNotFound) {
        hasExtension = YES;
        NSArray *strs = [sourceStr componentsSeparatedByString:g_extensionStr];
        assert(strs.count == 2);
        sourceStr = [strs componentsJoinedByString:@"\n"];
        source = (GLchar *)[sourceStr UTF8String];
    }
    const GLchar *sources[] = {
        (hasExtension ? EXTENSION_STRING "\n" : ""),
    #ifdef __CC_PLATFORM_IOS
        (type == GL_VERTEX_SHADER ? "precision highp float;\n" : "precision mediump float;\n"),
    #endif
        "uniform mat4 CC_PMatrix;\n"
        "uniform mat4 CC_MVMatrix;\n"
        "uniform mat4 CC_MVPMatrix;\n"
        "uniform vec4 CC_Time;\n"
        "uniform vec4 CC_SinTime;\n"
        "uniform vec4 CC_CosTime;\n"
        "uniform vec4 CC_Random01;\n"
        "//CC INCLUDES END\n\n",
        source,
    };
    // END workaround for Xcode 7 bug

参考地址

相关文章

  • cocosbuilder3编译问题

    cocosbuilder编辑器到目前也有7年没有更新过了,问题也比较多。我自己的一个老项目还需要使用cocosbu...

  • 编译问题

    -Werror,-Wnon-modular-include-in-framework-module原因 修改bui...

  • 编译问题

    问题:configure error: Could not link against boost_system./...

  • AS 编译问题

    Android SDK Build Tools 26.0.2 will be used 检查 app/build....

  • 编译问题

    1.idea直接运行时 都是配置好的encoding编码所以控制台不乱码 2.idea里用maven编译时默认用的...

  • 编译问题

    错误信息: 原因:依赖库地址输入错误修正:

  • Ubuntu 16.04 编译 Android 5.1

    环境准备 安装JDK-7 安装编译依赖 执行编译 按照官方教程执行编译,出现下面的问题: 编译问题 unsuppo...

  • 训练中的问题与解决

    一 caffe 编译问题 集合 编译caffe protobuf 未定义应用问题,是protobuf库冲突的问题...

  • Studio编译Lint found fatal errors

    问题描述 在使用studio编译release版本时,遇到了下面的问题【编译debug问题不会遇到】: Lint ...

  • 分享1期【性能相关】

    目录 编译速度 内存问题 cpu占用问题 一、编译速度 1、Build Options - debug infor...

网友评论

      本文标题:cocosbuilder3编译问题

      本文链接:https://www.haomeiwen.com/subject/gfswwqtx.html