cocos2dx Windows Phone 10游戏图形质量

时间:2016-08-18 01:38:44

标签: visual-studio uwp cocos2d-x

我正在尝试为Windows手机克隆游戏。这不适用于商业。 我已经与cocos创建者一起创建了新的cocos2dx win10项目。并尝试在Windows Phone 10 Lumia 935上构建和执行。但是当我在真实设备上执行时,图形质量低于原始设备。附上2张截图。 我已经将屏幕重新设置为800 x 480.并且所有图像都没有缩放。

enter image description here

这是原创游戏中的图像。

enter image description here

这是我新游戏中的图像。

为什么这两种图像质量不同?

原始图像就是这样。

enter image description here

原因是什么?我读过这篇文章,但仍未找到正确的答案。 https://github.com/cocos2d/cocos2d-x/issues/15901

添加了我已实施的代码。

auto director = Director::getInstance();
    auto glview = director->getOpenGLView();
    if(!glview) {
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) || (CC_TARGET_PLATFORM == CC_PLATFORM_MAC) || (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX)
        glview = GLViewImpl::createWithRect("RealHillClimb", cocos2d::Rect(0, 0, designResolutionSize.width, designResolutionSize.height));
#else
        glview = GLViewImpl::create("RealHillClimb");
#endif
        director->setOpenGLView(glview);
    }
    director->setAnimationInterval(1.0f / 180);
    glview->setDesignResolutionSize(1280, 720, ResolutionPolicy::NO_BORDER);
    auto frameSize = glview->getFrameSize();
    int a = Device::getDPI();
    if (frameSize.height > mediumResolutionSize.height)
    {        
        director->setContentScaleFactor(MIN(largeResolutionSize.height/designResolutionSize.height, largeResolutionSize.width/designResolutionSize.width));
    }
    else if (frameSize.height > smallResolutionSize.height)
    {        
        director->setContentScaleFactor(MIN(mediumResolutionSize.height/designResolutionSize.height, mediumResolutionSize.width/designResolutionSize.width));
    }
    else
    {        
        director->setContentScaleFactor(MIN(smallResolutionSize.height/designResolutionSize.height, smallResolutionSize.width/designResolutionSize.width));
    }
    director->setContentScaleFactor(1);
    cocos2d::Size dsize = glview->getDesignResolutionSize(); 
    float d = director->getContentScaleFactor();
    register_all_packages();    
    auto scene = SCNSplash::createScene();
    director->runWithScene(scene);
    return true;

0 个答案:

没有答案