Skip to content

Commit 2cc1e35

Browse files
authored
定期合并 (#393)
* 定期合并 * 删除错误同步上去的多余代码
1 parent d90cf4a commit 2cc1e35

1,043 files changed

Lines changed: 41911 additions & 41940 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.clang-format

Lines changed: 130 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,97 +1,182 @@
1+
# tab settings
12
UseTab: Never
23
TabWidth: 4
3-
AccessModifierOffset: -4
4+
5+
# indent settings
46
IndentWidth: 4
57
ObjCBlockIndentWidth: 4
6-
ContinuationIndentWidth: 4
8+
AccessModifierOffset: -4 # public: private: protected: indent
9+
ContinuationIndentWidth: 4 # 行延长缩进
710
MaxEmptyLinesToKeep: 1
11+
IndentCaseLabels: false
12+
IndentExternBlock: NoIndent # extern "c" indent
813

14+
# allow `if (a) xxx;` AND `if (a) { xxx }``
915
AllowShortIfStatementsOnASingleLine: true
1016
AllowShortBlocksOnASingleLine: true
1117

18+
# align settings
1219
AlignConsecutiveAssignments: false
1320
AlignConsecutiveDeclarations: false
1421
AlignTrailingComments: true
15-
SpacesBeforeTrailingComments: 1
16-
SpacesInSquareBrackets: false
17-
IndentCaseLabels: false
18-
SpaceBeforeAssignmentOperators: true
19-
20-
# 关键设置:正常代码使用固定缩进,宏内部特殊处理
21-
AlignAfterOpenBracket: DontAlign
22+
AlignAfterOpenBracket: BlockIndent
2223
AlignOperands: DontAlign
23-
BinPackArguments: false
24-
BinPackParameters: false
24+
AlignEscapedNewlinesLeft: true
2525

26-
BreakConstructorInitializersBeforeComma: true
26+
# space settings
27+
SpacesBeforeTrailingComments: 1
28+
SpacesInSquareBrackets: false
2729
SpaceAfterCStyleCast: false
2830
SpaceBeforeParens: ControlStatements
2931
SpaceBeforeRangeBasedForLoopColon: true
3032
SpaceInEmptyParentheses: false
33+
SpaceBeforeAssignmentOperators: true
34+
35+
# break settings
36+
BreakConstructorInitializers: BeforeComma # 多行构造初始化列表样式
37+
BreakInheritanceList: BeforeComma # 多行继承样式
38+
39+
# sort settings
3140
SortUsingDeclarations: false
3241

42+
# disable column limit, prefer control it manually
3343
ColumnLimit: 0
44+
45+
# int*, int&
3446
PointerAlignment: Left
3547
ReferenceAlignment: Left
48+
49+
# allow multi line params like
50+
# int func(
51+
# int a,
52+
# int b,
53+
# int c
54+
# )
3655
AllowAllParametersOfDeclarationOnNextLine: true
37-
AlignEscapedNewlinesLeft: true
3856

57+
# multiline binary expr syntax, our style:
58+
# a && b ||
59+
# c && d
3960
BreakBeforeBinaryOperators: None
61+
62+
# multiline cond ? a : b, our style:
63+
# cond ?
64+
# a :
65+
# b
4066
BreakBeforeTernaryOperators: false
4167

68+
# can we write params in single line, our style:
69+
# func(
70+
# xxxx, xxx,
71+
# xxxxx
72+
# xxxxx
73+
# )
74+
BinPackArguments: true
75+
BinPackParameters: BinPack
76+
77+
# do not control #if xxx, let user control it
4278
IndentPPDirectives: BeforeHash
4379

80+
# brace break
4481
BreakBeforeBraces: Custom
4582
BraceWrapping:
83+
# type & namespace
4684
AfterClass: true
4785
AfterStruct: true
4886
AfterEnum: true
4987
AfterNamespace: true
5088
AfterUnion: true
51-
AfterFunction: true
89+
# if while for...
90+
AfterControlStatement: true
5291
BeforeElse: true
92+
BeforeWhile: true
93+
# function
94+
AfterFunction: true
95+
# lambda
96+
BeforeLambdaBody: false
5397
IndentBraces: false
5498
AfterExternBlock: false
55-
AfterControlStatement: true
99+
100+
# func({ 1, 2, 3 })
56101
Cpp11BracedListStyle: false
57102

103+
# try to keep require in single line
58104
RequiresClausePosition: SingleLine
59105

60-
# 宏特殊处理
106+
# keep attribute itself
107+
BreakAfterAttributes: Leave
108+
109+
# do not sort includes
110+
SortIncludes: false
111+
112+
#======================== marco process
113+
114+
# marcos treat as attribute
61115
AttributeMacros:
62116
- "SUGOI_UNLIKELY"
63117
- "SUGOI_FORCEINLINE"
64118
- "FORCEINLINE"
65119
- "SKR_ALIGNAS"
66120

67121
WhitespaceSensitiveMacros:
68-
- "spush_attr"
69-
- "spop_attr"
70-
- "sreflect_enum"
71-
- "sreflect_struct"
72-
- "sreflect_enum_class"
73-
- "sreflect_interface"
74-
- "sreflect_function"
75-
76-
# 告诉 clang-format 这些宏是语句宏
77-
StatementMacros:
78122
- "sattr"
79-
- "sreflect_struct"
80-
- "sreflect_enum"
81-
- "sreflect_enum_class"
82-
- "sreflect_interface"
83-
- "sreflect_function"
84-
- "sreflect_managed_component"
85-
86-
ForEachMacros: ["forloop"]
87-
88-
BreakAfterAttributes: Leave
89-
IndentExternBlock: NoIndent
90-
91-
# 特殊处理:不要重新格式化宏块
92-
ReflowComments: false
93-
94-
# 保持原有的换行
95-
KeepEmptyLinesAtTheStartOfBlocks: true
96-
97-
SortIncludes: false
123+
# using flag
124+
- sfinal_alias
125+
# param flag
126+
- sparam_in
127+
- sparam_out
128+
- sparam_inout
129+
# rttr api
130+
- "srttr_flag"
131+
- "srttr_attr"
132+
# script api
133+
- sscript_visible
134+
- sscript_newable
135+
- sscript_mapping
136+
- sscript_mixin
137+
- sscript_getter
138+
- sscript_setter
139+
140+
Macros:
141+
# using flag
142+
- sfinal_alias=clang::annotate("")
143+
144+
# param flags
145+
- sparam_in=clang::annotate("")
146+
- sparam_out=clang::annotate("")
147+
- sparam_inout=clang::annotate("")
148+
149+
# script api
150+
- sscript_visible=clang::annotate("")
151+
- sscript_newable=clang::annotate("")
152+
- sscript_mapping=clang::annotate("")
153+
- sscript_mixin=clang::annotate("")
154+
- sscript_getter(x)=clang::annotate("")
155+
- sscript_setter(x)=clang::annotate("")
156+
157+
# attr
158+
- sattr(x)=clang::annotate("")
159+
- sattr(x,y)=clang::annotate("")
160+
- sattr(x,y,z)=clang::annotate("")
161+
- sattr(x,y,z,w)=clang::annotate("")
162+
- sattr(x,y,z,w,a)=clang::annotate("")
163+
- sattr(x,y,z,w,a,b)=clang::annotate("")
164+
- sattr(x,y,z,w,a,b,c)=clang::annotate("")
165+
- sattr(x,y,z,w,a,b,c,d)=clang::annotate("")
166+
- sattr(x,y,z,w,a,b,c,d,e)=clang::annotate("")
167+
168+
# srttr_flag
169+
- srttr_flag(x)=clang::annotate("")
170+
# srttr_attr
171+
- srttr_attr(x)=clang::annotate("")
172+
- srttr_attr(x,y)=clang::annotate("")
173+
- srttr_attr(x,y,z)=clang::annotate("")
174+
- srttr_attr(x,y,z,w)=clang::annotate("")
175+
- srttr_attr(x,y,z,w,a)=clang::annotate("")
176+
- srttr_attr(x,y,z,w,a,b)=clang::annotate("")
177+
- srttr_attr(x,y,z,w,a,b,c)=clang::annotate("")
178+
- srttr_attr(x,y,z,w,a,b,c,d)=clang::annotate("")
179+
- srttr_attr(x,y,z,w,a,b,c,d,e)=clang::annotate("")
180+
181+
ForEachMacros:
182+
- "forloop"

.clangd

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,28 @@ Diagnostics:
1111
If:
1212
PathMatch: .*/.*
1313
CompileFlags:
14-
CompilationDatabase: .sb/compile_commands/cpp/
14+
CompilationDatabase: build/.sb/compile_commands/cpp/
1515

1616
---
1717

1818
If:
1919
PathMatch: engine/tools/shader_compiler/ShaderSTL/.*
2020
CompileFlags:
21-
CompilationDatabase: .sb/compile_commands/shaders/
21+
CompilationDatabase: build/.sb/compile_commands/shaders/
2222

2323
---
2424

2525
If:
2626
PathMatch: .*/.*.cxx
2727
CompileFlags:
28-
CompilationDatabase: .sb/compile_commands/shaders/
28+
CompilationDatabase: build/.sb/compile_commands/shaders/
2929

3030
---
3131

3232
If:
3333
PathMatch: .*/.*.hxx
3434
CompileFlags:
35-
CompilationDatabase: .sb/compile_commands/shaders/
35+
CompilationDatabase: build/.sb/compile_commands/shaders/
3636
Add: [ -x, c++-header ]
3737

3838
Diagnostics:

.gitignore

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,32 @@
1-
compile_commands.json
1+
# macos
22
.DS_Store
3-
/.vs
4-
/.cache
5-
/out
3+
4+
# visual studio
5+
.vs
6+
7+
# vscode counter cache
68
/.VSCodeCounter
79

8-
.mcp.json
9-
.claude
10-
publish
10+
# clangd cache
11+
/.cache
12+
13+
# C# build outputs
1114
**/bin
1215
**/obj
1316

17+
# jetbrains
18+
.idea
19+
20+
# for ai
1421
.memory_bank
1522
memory_bank/context
16-
.sb
17-
.pkgs
18-
.build
23+
AGENTS.md
24+
.mcp.json
25+
.claude
26+
publish
27+
28+
# sakura build dir
29+
build
30+
31+
# sakura build local config
32+
local_config.cs

.vscode/workspaces/skr_generic.code-workspace

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
"path": "../../",
55
"name": "root",
66
},
7+
// {
8+
// "path": "../../.build/clang-cl/.gens/Windows-X64-debug/",
9+
// "name": "codegen",
10+
// },
711
{
8-
"path": "../../build/.skr/codegen",
9-
"name": "codegen",
10-
},
11-
{
12-
"path": "../../tools/SB",
12+
"path": "../../engine/tools/SB",
1313
"name": "sb",
1414
}
1515
],
@@ -35,6 +35,9 @@
3535
"[peggy]": {
3636
"editor.tabSize": 2,
3737
},
38+
"[csharp]": {
39+
"editor.formatOnSave": false
40+
},
3841
// file associations
3942
"files.associations": {
4043
"*.natvis": "xml",
@@ -126,7 +129,7 @@
126129
"request": "launch",
127130
"preLaunchTask": "build_SB_Debug",
128131
"console": "integratedTerminal",
129-
"program": "${workspaceFolder:root}\\.sb\\SB\\bin\\Debug\\net9.0\\SB",
132+
"program": "${workspaceFolder:root}\\build\\.sb\\SB\\bin\\Debug\\net9.0\\SB",
130133
"args": [
131134
"build"
132135
]
@@ -137,7 +140,7 @@
137140
"request": "launch",
138141
"preLaunchTask": "build_SB_Release",
139142
"console": "integratedTerminal",
140-
"program": "${workspaceFolder:root}\\.sb\\SB\\bin\\Release\\net9.0\\SB",
143+
"program": "${workspaceFolder:root}\\build\\.sb\\SB\\bin\\Release\\net9.0\\SB",
141144
"args": [
142145
"build"
143146
]
@@ -149,7 +152,7 @@
149152
"preLaunchTask": "build_SB_Debug",
150153
"console": "integratedTerminal",
151154
"cwd": "${workspaceFolder:root}",
152-
"program": "${workspaceFolder:root}\\.sb\\SB\\bin\\Debug\\net9.0\\SB",
155+
"program": "${workspaceFolder:root}\\build\\.sb\\SB\\bin\\Debug\\net9.0\\SB",
153156
"args": [
154157
"vscode"
155158
]

0 commit comments

Comments
 (0)