重构代码

This commit is contained in:
cebgcontract 2022-06-30 17:52:49 +08:00
parent ed7db1a082
commit 7cf11f9363
5 changed files with 159 additions and 13 deletions

View File

@ -8,7 +8,7 @@
/* Begin PBXBuildFile section */
D5AA8A10286B029300E2C03E /* SceneDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = D5AA8A0F286B029300E2C03E /* SceneDelegate.m */; };
D5AA8A13286B029300E2C03E /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = D5AA8A12286B029300E2C03E /* ViewController.m */; };
D5AA8A13286B029300E2C03E /* ViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = D5AA8A12286B029300E2C03E /* ViewController.mm */; };
D5AA8A16286B029300E2C03E /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D5AA8A14286B029300E2C03E /* Main.storyboard */; };
D5AA8A18286B029700E2C03E /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = D5AA8A17286B029700E2C03E /* Assets.xcassets */; };
D5AA8A1B286B029700E2C03E /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = D5AA8A19286B029700E2C03E /* LaunchScreen.storyboard */; };
@ -48,7 +48,7 @@
D5AA8A0E286B029300E2C03E /* SceneDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SceneDelegate.h; sourceTree = "<group>"; };
D5AA8A0F286B029300E2C03E /* SceneDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SceneDelegate.m; sourceTree = "<group>"; };
D5AA8A11286B029300E2C03E /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = "<group>"; };
D5AA8A12286B029300E2C03E /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = "<group>"; };
D5AA8A12286B029300E2C03E /* ViewController.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = ViewController.mm; sourceTree = "<group>"; };
D5AA8A15286B029300E2C03E /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
D5AA8A17286B029700E2C03E /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
D5AA8A1A286B029700E2C03E /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
@ -112,13 +112,13 @@
D5AA8A0A286B029300E2C03E /* HeadlessCocos */ = {
isa = PBXGroup;
children = (
D5AA8A12286B029300E2C03E /* ViewController.m */,
D5AA8A8B286BF94D00E2C03E /* js */,
D5AA8A63286B390F00E2C03E /* AppController.h */,
D5AA8A62286B390E00E2C03E /* AppController.mm */,
D5AA8A8B286BF94D00E2C03E /* js */,
D5AA8A0E286B029300E2C03E /* SceneDelegate.h */,
D5AA8A0F286B029300E2C03E /* SceneDelegate.m */,
D5AA8A11286B029300E2C03E /* ViewController.h */,
D5AA8A12286B029300E2C03E /* ViewController.mm */,
D5AA8A14286B029300E2C03E /* Main.storyboard */,
D5AA8A17286B029700E2C03E /* Assets.xcassets */,
D5AA8A19286B029700E2C03E /* LaunchScreen.storyboard */,
@ -256,7 +256,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
D5AA8A13286B029300E2C03E /* ViewController.m in Sources */,
D5AA8A13286B029300E2C03E /* ViewController.mm in Sources */,
D5AA8A3B286B043200E2C03E /* AppDelegate.cpp in Sources */,
D5AA8A1E286B029700E2C03E /* main.m in Sources */,
D5AA8A10286B029300E2C03E /* SceneDelegate.m in Sources */,
@ -289,7 +289,7 @@
D5AA8A1F286B029700E2C03E /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = YES;
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
@ -321,6 +321,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_BITCODE = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
@ -337,7 +338,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 15.2;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
@ -368,7 +369,7 @@
D5AA8A20286B029700E2C03E /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = YES;
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++17";
@ -410,7 +411,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 15.2;
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = iphoneos;
@ -441,13 +442,14 @@
D5AA8A22286B029700E2C03E /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = YES;
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CLANG_ENABLE_OBJC_ARC = NO;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_TEAM = 8TB4N4YTJ3;
ENABLE_BITCODE = NO;
GENERATE_INFOPLIST_FILE = YES;
HEADER_SEARCH_PATHS = "";
INFOPLIST_FILE = HeadlessCocos/Info.plist;
@ -483,7 +485,7 @@
D5AA8A23286B029700E2C03E /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = YES;
ALWAYS_SEARCH_USER_PATHS = NO;
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_GLOBAL_ACCENT_COLOR_NAME = AccentColor;
CLANG_ENABLE_OBJC_ARC = NO;

View File

@ -100,5 +100,149 @@
landmarkType = "9">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "25860639-651D-4334-B42E-840A38FFB14C"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "HeadlessCocos/AppController.mm"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "53"
endingLineNumber = "53"
landmarkName = "-application:didFinishLaunchingWithOptions:"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "769E84A6-6567-4DB8-B789-8E87332B7AED"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "HeadlessCocos/ViewController.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "17"
endingLineNumber = "17"
landmarkName = "-viewDidLoad"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "9B95A966-6D27-4E55-A812-7D28F8F14CA3"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Classes/AppDelegate.cpp"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "48"
endingLineNumber = "48"
landmarkName = "AppDelegate::applicationDidFinishLaunching()"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "B397C72B-E237-4F82-B3DA-495B7A6E737F"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "../../cocos/cocos2d-x/cocos/platform/ios/CCApplication-ios.mm"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "184"
endingLineNumber = "184"
landmarkName = "Application::Application(name, width, height)"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "428546B0-0C88-4202-9FEC-A5A995BBAF61"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "../../cocos/cocos2d-x/cocos/platform/ios/CCApplication-ios.mm"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "193"
endingLineNumber = "193"
landmarkName = "Application::~Application()"
landmarkType = "7">
<Locations>
<Location
uuid = "428546B0-0C88-4202-9FEC-A5A995BBAF61 - 151e882d7d16c2df"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "cocos2d::Application::Application(std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt; const&amp;, int, int)"
moduleName = "HeadlessCocos"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/zhl/Documents/workspace/cocos/cocos2d-x/cocos/platform/ios/CCApplication-ios.mm"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "222"
endingLineNumber = "222"
offsetFromSymbolStart = "277">
</Location>
<Location
uuid = "428546B0-0C88-4202-9FEC-A5A995BBAF61 - 151e882d7d16c2df"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
symbolName = "cocos2d::Application::Application(std::__1::basic_string&lt;char, std::__1::char_traits&lt;char&gt;, std::__1::allocator&lt;char&gt; &gt; const&amp;, int, int)"
moduleName = "HeadlessCocos"
usesParentBreakpointCondition = "Yes"
urlString = "file:///Users/zhl/Documents/workspace/cocos/cocos2d-x/cocos/platform/ios/CCApplication-ios.mm"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "222"
endingLineNumber = "222"
offsetFromSymbolStart = "41">
</Location>
</Locations>
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "1356712E-C89F-4DEC-81A4-F602E641B016"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "../../cocos/cocos2d-x/cocos/platform/ios/CCApplication-ios.mm"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "223"
endingLineNumber = "223"
landmarkName = "Application::start()"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "04867B45-EFC6-4C6B-97BA-8355FF18C99F"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "../../cocos/cocos2d-x/cocos/scripting/js-bindings/jswrapper/config.hpp"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "46"
endingLineNumber = "46"
landmarkName = "unknown"
landmarkType = "0">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>

View File

@ -7,7 +7,7 @@
<key>HeadlessCocos.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>1</integer>
<integer>0</integer>
</dict>
</dict>
</dict>

View File

@ -29,7 +29,6 @@
#import "AppDelegate.h"
#import "ViewController.h"
//#import "SDKWrapper.h"
#import "platform/ios/CCEAGLView-ios.h"

View File

@ -6,6 +6,7 @@
//
#import "ViewController.h"
#include "platform/CCApplication.h"
@interface ViewController ()