Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
281 changes: 281 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,281 @@
---
Language: Cpp
AccessModifierOffset: -2
AlignAfterOpenBracket: AlwaysBreak
AlignArrayOfStructures: None
AlignConsecutiveAssignments:
Enabled: false
AcrossEmptyLines: false
AcrossComments: false
AlignCompound: false
AlignFunctionPointers: false
PadOperators: true
AlignConsecutiveBitFields:
Enabled: false
AcrossEmptyLines: false
AcrossComments: false
AlignCompound: false
AlignFunctionPointers: false
PadOperators: false
AlignConsecutiveDeclarations:
Enabled: false
AcrossEmptyLines: false
AcrossComments: false
AlignCompound: false
AlignFunctionPointers: false
PadOperators: true
AlignConsecutiveMacros:
Enabled: false
AcrossEmptyLines: false
AcrossComments: false
AlignCompound: false
AlignFunctionPointers: false
PadOperators: false
AlignConsecutiveShortCaseStatements:
Enabled: false
AcrossEmptyLines: false
AcrossComments: false
AlignCaseArrows: false
AlignCaseColons: false
AlignConsecutiveTableGenBreakingDAGArgColons:
Enabled: false
AcrossEmptyLines: false
AcrossComments: false
AlignCompound: false
AlignFunctionPointers: false
PadOperators: false
AlignConsecutiveTableGenCondOperatorColons:
Enabled: false
AcrossEmptyLines: false
AcrossComments: false
AlignCompound: false
AlignFunctionPointers: false
PadOperators: false
AlignConsecutiveTableGenDefinitionColons:
Enabled: false
AcrossEmptyLines: false
AcrossComments: false
AlignCompound: false
AlignFunctionPointers: false
PadOperators: false
AlignEscapedNewlines: DontAlign
AlignOperands: DontAlign
AlignTrailingComments:
Kind: Never
OverEmptyLines: 0
AllowAllArgumentsOnNextLine: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowBreakBeforeNoexceptSpecifier: Never
AllowShortBlocksOnASingleLine: Never
AllowShortCaseExpressionOnASingleLine: true
AllowShortCaseLabelsOnASingleLine: false
AllowShortCompoundRequirementOnASingleLine: true
AllowShortEnumsOnASingleLine: false
AllowShortFunctionsOnASingleLine: InlineOnly
AllowShortIfStatementsOnASingleLine: Never
AllowShortLambdasOnASingleLine: All
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakBeforeMultilineStrings: true
AttributeMacros:
- __capability
BinPackArguments: false
BinPackParameters: false
BitFieldColonSpacing: Both
BraceWrapping:
AfterCaseLabel: true
AfterClass: true
AfterControlStatement: Always
AfterEnum: true
AfterExternBlock: false
AfterFunction: true
AfterNamespace: true
AfterObjCDeclaration: true
AfterStruct: true
AfterUnion: true
BeforeCatch: true
BeforeElse: true
BeforeLambdaBody: false
BeforeWhile: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakAdjacentStringLiterals: true
BreakAfterAttributes: Leave
BreakAfterJavaFieldAnnotations: false
BreakAfterReturnType: None
BreakArrays: true
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeConceptDeclarations: Always
BreakBeforeBraces: Custom
BreakBeforeInlineASMColon: OnlyMultiline
BreakBeforeTernaryOperators: false
BreakConstructorInitializers: AfterColon
BreakFunctionDefinitionParameters: false
BreakInheritanceList: BeforeColon
BreakStringLiterals: true
BreakTemplateDeclarations: Yes
ColumnLimit: 125
CommentPragmas: "^ IWYU pragma:"
CompactNamespaces: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: false
DerivePointerAlignment: false
DisableFormat: false
EmptyLineAfterAccessModifier: Never
EmptyLineBeforeAccessModifier: LogicalBlock
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IfMacros:
- KJ_IF_MAYBE
IncludeBlocks: Preserve
IncludeCategories:
- Regex: always.h
Priority: -1
SortPriority: 0
CaseSensitive: false
- Regex: StdAfx.h
Priority: -1
SortPriority: 0
CaseSensitive: false
- Regex: PreRTS.h
Priority: -1
SortPriority: 0
CaseSensitive: false
- Regex: "^<"
Priority: 2
SortPriority: 0
CaseSensitive: false
- Regex: '^"'
Priority: 1
SortPriority: 0
CaseSensitive: false
IncludeIsMainRegex: "(Test)?$"
IncludeIsMainSourceRegex: ""
IndentAccessModifiers: false
IndentCaseBlocks: false
IndentCaseLabels: true
IndentExternBlock: AfterExternBlock
IndentGotoLabels: true
IndentPPDirectives: None
IndentRequiresClause: true
IndentWidth: 2
IndentWrappedFunctionNames: true
InsertBraces: false
InsertNewlineAtEOF: false
InsertTrailingCommas: None
IntegerLiteralSeparator:
Binary: 0
BinaryMinDigits: 0
Decimal: 0
DecimalMinDigits: 0
Hex: 0
HexMinDigits: 0
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLines:
AtEndOfFile: false
AtStartOfBlock: false
AtStartOfFile: true
LambdaBodyIndentation: Signature
LineEnding: DeriveLF
MacroBlockBegin: ""
MacroBlockEnd: ""
MainIncludeChar: Quote
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBinPackProtocolList: Auto
ObjCBlockIndentWidth: 2
ObjCBreakBeforeNestedBlockParam: true
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PackConstructorInitializers: NextLine
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 0
PenaltyBreakFirstLessLess: 120
PenaltyBreakOpenParenthesis: 1
PenaltyBreakScopeResolution: 500
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyIndentedWhitespace: 0
PenaltyReturnTypeOnItsOwnLine: 999999
PointerAlignment: Right
PPIndentWidth: -1
QualifierAlignment: Leave
ReferenceAlignment: Pointer
ReflowComments: true
RemoveBracesLLVM: false
RemoveParentheses: Leave
RemoveSemicolon: false
RequiresClausePosition: OwnLine
RequiresExpressionIndentation: OuterScope
SeparateDefinitionBlocks: Leave
ShortNamespaceLines: 1
SkipMacroDefinitionBody: false
SortIncludes: Never
SortJavaStaticImport: Before
SortUsingDeclarations: LexicographicNumeric
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: false
SpaceAroundPointerQualifiers: Default
SpaceBeforeAssignmentOperators: true
SpaceBeforeCaseColon: false
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeJsonColon: false
SpaceBeforeParens: ControlStatements
SpaceBeforeParensOptions:
AfterControlStatements: true
AfterForeachMacros: true
AfterFunctionDefinitionName: false
AfterFunctionDeclarationName: false
AfterIfMacros: true
AfterOverloadedOperator: false
AfterPlacementOperator: true
AfterRequiresInClause: false
AfterRequiresInExpression: false
BeforeNonEmptyParentheses: false
SpaceBeforeRangeBasedForLoopColon: true
SpaceBeforeSquareBrackets: false
SpaceInEmptyBlock: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: Never
SpacesInContainerLiterals: true
SpacesInLineCommentPrefix:
Minimum: 1
Maximum: -1
SpacesInParens: Never
SpacesInParensOptions:
ExceptDoubleParentheses: false
InCStyleCasts: false
InConditionalStatements: false
InEmptyParentheses: false
Other: false
SpacesInSquareBrackets: false
Standard: c++03
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this correct?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needed to get the correct spacing in nested templates to compile correctly with VC6.

StatementAttributeLikeMacros:
- Q_EMIT
StatementMacros:
- Q_UNUSED
- QT_REQUIRE_VERSION
TableGenBreakInsideDAGArg: DontBreak
TabWidth: 2
UseTab: Always
VerilogBreakBetweenInstancePorts: true
WhitespaceSensitiveMacros:
- BOOST_PP_STRINGIZE
- CF_SWIFT_NAME
- NS_SWIFT_NAME
- PP_STRINGIZE
- STRINGIZE
---
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
!.gitattributes
!.github
!.gitmodules
!.clang-format

*.user
*.ncb
Expand Down Expand Up @@ -44,7 +45,6 @@ CPackSourceConfig.cmake
thumbs.db
/CMakeUserPresets.json
/.cache
.clang-format
/.vscode
/Dependencies/MaxSDK/maxsdk

Expand All @@ -57,4 +57,4 @@ cmake-build-*/
## Ninja
.ninja_deps
.ninja_log
build.ninja
build.ninja
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ endif()
# Top level project, doesn't really affect anything.
project(genzh LANGUAGES C CXX)

# Set up a format target to do automated clang format checking.
find_package(ClangFormat)
include(ClangFormat)

# This file handles extra settings wanted/needed for different compilers.
include(cmake/compilers.cmake)

Expand Down
53 changes: 33 additions & 20 deletions Core/GameEngine/Include/Common/ArchiveFile.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@
class File;

/**
* An archive file is itself a collection of sub files. Each file inside the archive file
* has a unique name by which it can be accessed. The ArchiveFile object class is the
* runtime interface to the mix file and the sub files. Each file inside the mix
* file can be accessed by the openFile().
*
* ArchiveFile interfaces can be created by the TheArchiveFileSystem object.
*/
* An archive file is itself a collection of sub files. Each file inside the archive file
* has a unique name by which it can be accessed. The ArchiveFile object class is the
* runtime interface to the mix file and the sub files. Each file inside the mix
* file can be accessed by the openFile().
*
* ArchiveFile interfaces can be created by the TheArchiveFileSystem object.
*/
//===============================

class ArchiveFile
Expand All @@ -53,24 +53,37 @@ class ArchiveFile
ArchiveFile();
virtual ~ArchiveFile();

virtual Bool getFileInfo( const AsciiString& filename, FileInfo *fileInfo) const = 0; ///< fill in the fileInfo struct with info about the file requested.
virtual File* openFile( const Char *filename, Int access = 0) = 0; ///< Open the specified file within the archive file
virtual void closeAllFiles( void ) = 0; ///< Close all file opened in this archive file
virtual AsciiString getName( void ) = 0; ///< Returns the name of the archive file
virtual AsciiString getPath( void ) = 0; ///< Returns full path and name of archive file
virtual void setSearchPriority( Int new_priority ) = 0; ///< Set this archive file's search priority
virtual void close( void ) = 0; ///< Close this archive file
void attachFile(File *file);
virtual Bool getFileInfo(const AsciiString &filename, FileInfo *fileInfo) const = 0; ///< fill in the fileInfo struct with
///< info about the file requested.
virtual File *openFile(const Char *filename, Int access = 0) = 0; ///< Open the specified file within the archive file
virtual void closeAllFiles(void) = 0; ///< Close all file opened in this archive file
virtual AsciiString getName(void) = 0; ///< Returns the name of the archive file
virtual AsciiString getPath(void) = 0; ///< Returns full path and name of archive file
virtual void setSearchPriority(Int new_priority) = 0; ///< Set this archive file's search priority
virtual void close(void) = 0; ///< Close this archive file
void attachFile(File *file);

void getFileListInDirectory(const AsciiString& currentDirectory, const AsciiString& originalDirectory, const AsciiString& searchName, FilenameList &filenameList, Bool searchSubdirectories) const;
void getFileListInDirectory(const DetailedArchivedDirectoryInfo *dirInfo, const AsciiString& currentDirectory, const AsciiString& searchName, FilenameList &filenameList, Bool searchSubdirectories) const;
void getFileListInDirectory(
const AsciiString &currentDirectory,
const AsciiString &originalDirectory,
const AsciiString &searchName,
FilenameList &filenameList,
Bool searchSubdirectories) const;
void getFileListInDirectory(
const DetailedArchivedDirectoryInfo *dirInfo,
const AsciiString &currentDirectory,
const AsciiString &searchName,
FilenameList &filenameList,
Bool searchSubdirectories) const;

void addFile(const AsciiString& path, const ArchivedFileInfo *fileInfo); ///< add this file to our directory tree.
void addFile(const AsciiString &path, const ArchivedFileInfo *fileInfo); ///< add this file to our directory tree.

protected:
const ArchivedFileInfo * getArchivedFileInfo(const AsciiString& filename) const; ///< return the ArchivedFileInfo from the directory tree.
const ArchivedFileInfo *getArchivedFileInfo(const AsciiString &filename) const; ///< return the ArchivedFileInfo from the
///< directory tree.

File *m_file; ///< file pointer to the archive file on disk. Kept open so we don't have to continuously open and close the file all the time.
File *m_file; ///< file pointer to the archive file on disk. Kept open so we don't have to continuously open and close the
///< file all the time.
DetailedArchivedDirectoryInfo m_rootDirectory;
};

Expand Down
Loading
Loading