fix: editor and cocos-play issues (#12908)

* fix: editor and cocos-play issues

* * Change 'windowId' to optional.
This commit is contained in:
林玮
2022-09-27 17:45:21 +08:00
committed by GitHub
parent be9975e874
commit e7e8036dcd
8 changed files with 23 additions and 16 deletions
+5
View File
@@ -50,8 +50,13 @@ int BaseGame::init() {
std::call_once(_windowCreateFlag, [&]() {
ISystemWindowInfo info;
info.title = _windowInfo.title;
#if CC_PLATFORM == CC_PLATFORM_WINDOWS
info.x = _windowInfo.x == -1 ? 50 : _windowInfo.x; // 50 meams move window a little for now
info.y = _windowInfo.y == -1 ? 50 : _windowInfo.y; // same above
#else
info.x = _windowInfo.x == -1 ? 0 : _windowInfo.x;
info.y = _windowInfo.y == -1 ? 0 : _windowInfo.y;
#endif
info.width = _windowInfo.width;
info.height = _windowInfo.height;
info.flags = _windowInfo.flags;
+1 -1
View File
@@ -167,7 +167,7 @@ void Root::destroy() {
// this.dataPoolManager.clear();
}
void Root::resize(uint32_t windowId, uint32_t width, uint32_t height) {
void Root::resize(uint32_t width, uint32_t height, uint32_t windowId) {
for (const auto &window : _renderWindows) {
auto *swapchain = window->getSwapchain();
if (swapchain && (swapchain->getWindowId() == windowId)) {
+4 -3
View File
@@ -76,10 +76,11 @@ public:
/**
* @zh
* 重置大小
* @param width 屏幕宽度
* @param height 屏幕高度
* @param width 窗口宽度
* @param height 窗口高度
* @param windowId 窗口 ID
*/
void resize(uint32_t windowId, uint32_t width, uint32_t height);
void resize(uint32_t width, uint32_t height, uint32_t windowId);
bool setRenderPipeline(pipeline::RenderPipeline *rppl = nullptr);
void onGlobalPipelineStateChanged();