zoukankan      html  css  js  c++  java
  • cocos2d-html5在cocos2d-x里面打包编译

    main.cpp打开USE_WIN32_CONSOLE输出

    #include "main.h"
    #include "AppDelegate.h"
    #include "CCEGLView.h"
    
    #define USE_WIN32_CONSOLE
    
    USING_NS_CC;
    
    // uncomment below line, open debug console
    // #define USE_WIN32_CONSOLE
    
    int APIENTRY _tWinMain(HINSTANCE hInstance,
                           HINSTANCE hPrevInstance,
                           LPTSTR    lpCmdLine,
                           int       nCmdShow)
    {
        UNREFERENCED_PARAMETER(hPrevInstance);
        UNREFERENCED_PARAMETER(lpCmdLine);
    
    #ifdef USE_WIN32_CONSOLE
        AllocConsole();
        freopen("CONIN$", "r", stdin);
        freopen("CONOUT$", "w", stdout);
        freopen("CONOUT$", "w", stderr);
    #endif
    #include "main.h"
    #include "AppDelegate.h"
    #include "CCEGLView.h"
    
    #define USE_WIN32_CONSOLE
    
    USING_NS_CC;
    
    // uncomment below line, open debug console
    // #define USE_WIN32_CONSOLE
    
    int APIENTRY _tWinMain(HINSTANCE hInstance,
                           HINSTANCE hPrevInstance,
                           LPTSTR    lpCmdLine,
                           int       nCmdShow)
    {
        UNREFERENCED_PARAMETER(hPrevInstance);
        UNREFERENCED_PARAMETER(lpCmdLine);
    
    #ifdef USE_WIN32_CONSOLE
        AllocConsole();
        freopen("CONIN$", "r", stdin);
        freopen("CONOUT$", "w", stdout);
        freopen("CONOUT$", "w", stderr);
    #endif
    CCEGLView* eglView = CCEGLView::sharedOpenGLView();
        eglView->setViewName("游戏名");
        eglView->setFrameSize(960, 1440);

    修改AppDelegate.cpp里面启动的js脚步

    #if JSB_ENABLE_DEBUGGER
        ScriptingCore::getInstance()->enableDebugger();
        ScriptingCore::getInstance()->runScript("main.debug.js");
    #else
        ScriptingCore::getInstance()->runScript("游戏名-jsb.js");
    #endif

     和屏幕大小

    // Set the design resolution
        CCEGLView::sharedOpenGLView()->setDesignResolutionSize(960, 640, kResolutionShowAll);

    在ScriptingCore.cpp(D:DevToolcocos2d-x-2.2.2cocos2d-x-2.2.2scriptingjavascriptindings)

    void ScriptingCore::reportError(JSContext *cx, const char *message, JSErrorReport *report)
    {
        js_log("%s:%u:%s
    ",
                report->filename ? report->filename : "<no filename="filename">",
                (unsigned int) report->lineno,
                message);
    };

    里面加个断点,方便看脚步出错问题

  • 相关阅读:
    建议初创团队起初也要构建分布式应用
    PHP对大文件的处理思路
    php高级研发或架构师必了解---面试题系列
    数据库schema设计与优化
    大型web系统数据缓存设计
    PHP正则表达式
    PHP 生成图片缩略图函数
    PHP与Memcached服务器交互的分布式实现源码分析
    SOA面向服务架构——SOA的概念
    php中socket的使用
  • 原文地址:https://www.cnblogs.com/linn/p/3558052.html
Copyright © 2011-2022 走看看