fixed format

This commit is contained in:
2024-11-30 13:55:15 +03:00
parent 1fe5e6e276
commit dac0684405
2 changed files with 75 additions and 13 deletions

62
.clang-format Normal file
View File

@@ -0,0 +1,62 @@
# Generated from CLion C/C++ Code Style settings
---
Language: Cpp
BasedOnStyle: LLVM
AccessModifierOffset: -4
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignOperands: true
AlignTrailingComments: false
AllowShortBlocksOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AlwaysBreakTemplateDeclarations: Yes
BraceWrapping:
AfterCaseLabel: true
AfterClass: true
AfterControlStatement: true
AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterStruct: true
AfterUnion: true
AfterExternBlock: true
BeforeCatch: false
BeforeElse: false
BeforeLambdaBody: true
BeforeWhile: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBraces: Custom
BreakConstructorInitializers: AfterColon
BreakConstructorInitializersBeforeComma: false
ColumnLimit: 120
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ContinuationIndentWidth: 8
IncludeCategories:
- Regex: '^<.*'
Priority: 1
- Regex: '^".*'
Priority: 2
- Regex: '.*'
Priority: 3
IncludeIsMainRegex: '([-_](test|unittest))?$'
IndentCaseLabels: true
IndentWidth: 4
InsertNewlineAtEOF: true
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 2
NamespaceIndentation: All
PointerAlignment: Left
SpaceAfterCStyleCast: true
SpaceAfterTemplateKeyword: false
SpaceBeforeRangeBasedForLoopColon: false
SpaceInEmptyParentheses: false
SpacesInAngles: false
SpacesInConditionalStatement: false
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
TabWidth: 4
...

View File

@@ -1,7 +1,7 @@
#pragma once
#include <initializer_list>
#include <memory>
#include <string>
#include <initializer_list>
namespace omath
{
@@ -27,11 +27,11 @@ namespace omath
[[nodiscard]]
static Matrix ProjectionMatrix(float fieldOfView, float aspectRatio, float near, float far);
Matrix(const Matrix &other);
Matrix(const Matrix& other);
Matrix(size_t rows, size_t columns, const float *pRaw);
Matrix(size_t rows, size_t columns, const float* pRaw);
Matrix(Matrix &&other) noexcept;
Matrix(Matrix&& other) noexcept;
[[nodiscard]]
size_t RowCount() const noexcept;
@@ -43,7 +43,7 @@ namespace omath
std::pair<size_t, size_t> Size() const noexcept;
[[nodiscard]]
float &At(size_t iRow, size_t iCol);
float& At(size_t iRow, size_t iCol);
[[nodiscard]]
float Sum();
@@ -56,17 +56,17 @@ namespace omath
void Set(float val);
[[nodiscard]]
const float &At(size_t iRow, size_t iCol) const;
const float& At(size_t iRow, size_t iCol) const;
Matrix operator*(const Matrix &other) const;
Matrix operator*(const Matrix& other) const;
Matrix& operator*=(const Matrix &other);
Matrix& operator*=(const Matrix& other);
Matrix operator*(float f) const;
Matrix &operator*=(float f);
Matrix& operator*=(float f);
Matrix &operator/=(float f);
Matrix& operator/=(float f);
void Clear();
@@ -85,9 +85,9 @@ namespace omath
[[nodiscard]]
const float* Raw() const;
Matrix &operator=(const Matrix &other);
Matrix& operator=(const Matrix& other);
Matrix &operator=(Matrix &&other) noexcept;
Matrix& operator=(Matrix&& other) noexcept;
Matrix operator/(float f) const;
@@ -101,4 +101,4 @@ namespace omath
size_t m_columns;
std::unique_ptr<float[]> m_data;
};
}
} // namespace omath