Skip to content

Commit 2dde334

Browse files
committed
Refactor whitespace formatting in game source files
Updated several game source files to standardize and improve whitespace formatting. Adjusted spacing around parentheses and operators for consistency and clarity. Replaced traditional comment delimiters with modern banner-style ones.
1 parent 000cb48 commit 2dde334

Some content is hidden

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

123 files changed

+20477
-19371
lines changed

.clang-format

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1-
BasedOnStyle: Microsoft
1+
BasedOnStyle: LLVM
22
AccessModifierOffset: -4
33
AlignAfterOpenBracket: Align
4-
AlignConsecutiveBitFields: Consecutive
5-
AlignConsecutiveMacros: Consecutive
4+
AlignConsecutiveAssignments: true
5+
AlignConsecutiveBitFields: true
6+
AlignConsecutiveMacros: true
7+
AlignConsecutiveDeclarations: true
68
AlignEscapedNewlines: Left
79
AlignTrailingComments: true
810
AlignOperands: true
9-
AlignArrayOfStructures: Left
10-
AllowAllArgumentsOnNextLine: true
11-
AllowAllConstructorInitializersOnNextLine: true
12-
AllowAllParametersOfDeclarationOnNextLine: true
11+
AllowAllArgumentsOnNextLine: false
12+
AllowAllConstructorInitializersOnNextLine: false
13+
AllowAllParametersOfDeclarationOnNextLine: false
1314
AllowShortBlocksOnASingleLine: Always
1415
AllowShortCaseLabelsOnASingleLine: true
1516
AllowShortFunctionsOnASingleLine: All
@@ -19,6 +20,20 @@ AllowShortLoopsOnASingleLine: true
1920
AlwaysBreakAfterReturnType: None
2021
AlwaysBreakTemplateDeclarations: Yes
2122
BreakBeforeBraces: Allman
23+
BraceWrapping:
24+
AfterCaseLabel: true
25+
AfterClass: true
26+
AfterControlStatement: Always
27+
AfterEnum: true
28+
AfterFunction: true
29+
AfterNamespace: true
30+
AfterUnion: true
31+
AfterExternBlock: true
32+
BeforeCatch: false
33+
BeforeElse: false
34+
IndentBraces: false
35+
SplitEmptyFunction: false
36+
SplitEmptyRecord: true
2237
BreakBeforeBinaryOperators: None
2338
BreakBeforeTernaryOperators: true
2439
BreakConstructorInitializers: BeforeColon
@@ -49,7 +64,7 @@ SpaceInEmptyParentheses: false
4964
SpacesBeforeTrailingComments: 0
5065
SpacesInAngles: true
5166
SpacesInCStyleCastParentheses: true
52-
SpacesInContainerLiterals: true
67+
SpacesInContainerLiterals: false
5368
SpacesInParentheses: true
5469
SpacesInSquareBrackets: true
5570
TabWidth: 4

engine/CMakeLists.txt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ if (WIN32)
2323
win32/net_wins.cpp
2424
win32/q_shwin.cpp
2525
win32/snd_win.cpp
26-
)
26+
)
2727
link_directories(../3rdparty/sdl2/lib/)
2828
elseif (APPLE)
2929
file(GLOB ENGINE_PLATFORM_SOURCE
@@ -32,15 +32,15 @@ elseif (APPLE)
3232
linux/glob.cpp
3333
linux/net_udp.cpp
3434
linux/q_shlinux.cpp
35-
)
35+
)
3636
elseif (UNIX)
3737
file(GLOB ENGINE_PLATFORM_SOURCE
3838
linux/cd_linux.cpp
3939
linux/glob.cpp
4040
linux/net_udp.cpp
4141
linux/q_shlinux.cpp
4242
linux/snd_linux.cpp
43-
)
43+
)
4444
endif ()
4545

4646
add_executable(chronon-engine WIN32
@@ -120,19 +120,19 @@ add_executable(chronon-engine WIN32
120120
# 3rd Party
121121
../3rdparty/miniz/miniz.c
122122
../3rdparty/glew/src/glew.c
123-
)
123+
)
124124

125125
set_target_properties(chronon-engine PROPERTIES OUTPUT_NAME Chronon)
126126

127127
target_compile_definitions(chronon-engine PRIVATE
128128
GLEW_STATIC
129-
)
129+
)
130130
target_include_directories(chronon-engine PRIVATE
131131
./
132132
../
133133
../3rdparty/
134134
../3rdparty/glew/include/
135-
)
135+
)
136136

137137
target_link_libraries(chronon-engine chronon-game)
138138

@@ -158,7 +158,7 @@ if (WIN32)
158158
Version
159159
Ws2_32
160160
Winmm
161-
)
161+
)
162162
elseif (UNIX AND NOT APPLE)
163163
target_link_libraries(chronon-engine X11 Xext dl)
164164
endif ()

engine/ape/ape.h

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,19 @@ namespace chr::ape
99
{
1010
enum class OpCode
1111
{
12-
OP_STARTSWITCH = 49,
13-
OP_THINKSWITCH = 50,
14-
OP_STARTCONSOLE = 65,
15-
OP_BACKGROUND = 68,
16-
OP_FONT = 70,
17-
OP_SUBWINDOW = 72,
18-
OP_IMAGE = 73,
19-
OP_CAM = 77,
12+
OP_STARTSWITCH = 49,
13+
OP_THINKSWITCH = 50,
14+
OP_STARTCONSOLE = 65,
15+
OP_BACKGROUND = 68,
16+
OP_FONT = 70,
17+
OP_SUBWINDOW = 72,
18+
OP_IMAGE = 73,
19+
OP_CAM = 77,
2020
OP_FINISHCONSOLE = 78,
21-
OP_NEXTWINDOW = 79,
22-
OP_TITLE = 84,
23-
OP_STYLE = 87,
21+
OP_NEXTWINDOW = 79,
22+
OP_TITLE = 84,
23+
OP_STYLE = 87,
2424
};
2525

2626
static constexpr unsigned int MAGIC = 0x3D010000;
27-
}// namespace nox::ape
27+
}// namespace chr::ape

engine/app.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,7 @@ chr::App *chr::globalApp = nullptr;
3535

3636
void chr::App::Initialize()
3737
{
38-
int status = SDL_Init(
39-
SDL_INIT_VIDEO |
40-
SDL_INIT_EVENTS |
41-
SDL_INIT_GAMECONTROLLER |
42-
SDL_INIT_HAPTIC |
43-
SDL_INIT_JOYSTICK |
44-
SDL_INIT_TIMER );
38+
int status = SDL_Init( SDL_INIT_EVERYTHING );
4539
if ( status != 0 )
4640
Sys_Error( "Failed to initialized SDL2: %s\n", SDL_GetError() );
4741

@@ -59,7 +53,7 @@ void chr::App::Initialize()
5953
do
6054
{
6155
newTime = GetNumMilliseconds();
62-
time = newTime - oldTime;
56+
time = newTime - oldTime;
6357
} while ( time < 1 );
6458

6559
#if defined( Q_PLATFORM_X86 )

engine/app.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,4 @@ namespace chr
6161
};
6262

6363
extern App *globalApp;
64-
}// namespace nox
64+
}// namespace chr

0 commit comments

Comments
 (0)