mirror of
https://github.com/cocos/cocos4.git
synced 2026-11-20 23:52:40 +08:00
[ci skip][AUTO]: Automated clang-format update: 48787d3a22ada5d0a8220075ac7859eaf8bcba44 (#10655) (#10660)
Co-authored-by: cocos-robot <cocos-robot@cocos.com>
This commit is contained in:
@@ -35,8 +35,8 @@
|
||||
#include "SimulatorApp.h"
|
||||
#include "windows.h"
|
||||
#elif (CC_PLATFORM == CC_PLATFORM_MAC_OSX)
|
||||
#include "../proj.ios_mac/mac/SimulatorApp.h"
|
||||
#include <CoreGraphics/CGDisplayConfiguration.h>
|
||||
#include "../proj.ios_mac/mac/SimulatorApp.h"
|
||||
#endif
|
||||
|
||||
#include "ide-support/CodeIDESupport.h"
|
||||
@@ -44,7 +44,6 @@
|
||||
#include "runtime/ConfigParser.h"
|
||||
#include "runtime/Runtime.h"
|
||||
|
||||
|
||||
using namespace std;
|
||||
Game::Game() {
|
||||
}
|
||||
@@ -56,15 +55,15 @@ Game::~Game() {
|
||||
|
||||
int Game::init() {
|
||||
SimulatorApp::getInstance()->run();
|
||||
int windowWidth = SimulatorApp::getInstance()->getWidth();
|
||||
int windowHeight = SimulatorApp::getInstance()->getHegith();
|
||||
int windowWidth = SimulatorApp::getInstance()->getWidth();
|
||||
int windowHeight = SimulatorApp::getInstance()->getHegith();
|
||||
#if (CC_PLATFORM == CC_PLATFORM_WINDOWS)
|
||||
int windowPositionX = (GetSystemMetrics(SM_CXSCREEN) - windowWidth) / 2;
|
||||
int windowPositionY = (GetSystemMetrics(SM_CYSCREEN) - windowHeight) / 2;
|
||||
#elif (CC_PLATFORM == CC_PLATFORM_MAC_OSX)
|
||||
auto mainDisplayId = CGMainDisplayID();
|
||||
int windowPositionX = (CGDisplayPixelsWide(mainDisplayId) - windowWidth) / 2;
|
||||
int windowPositionY = (CGDisplayPixelsHigh(mainDisplayId) - windowHeight) / 2;
|
||||
auto mainDisplayId = CGMainDisplayID();
|
||||
int windowPositionX = (CGDisplayPixelsWide(mainDisplayId) - windowWidth) / 2;
|
||||
int windowPositionY = (CGDisplayPixelsHigh(mainDisplayId) - windowHeight) / 2;
|
||||
#endif
|
||||
createWindow("My game", windowPositionX, windowPositionY, SimulatorApp::getInstance()->getWidth(),
|
||||
SimulatorApp::getInstance()->getHegith(),
|
||||
|
||||
Reference in New Issue
Block a user