Skip to content

Commit 9d596e9

Browse files
committed
Test reformat of all files
1 parent f4d1ccc commit 9d596e9

35 files changed

+34252
-34677
lines changed

src/brogue/Architect.c

Lines changed: 3112 additions & 3140 deletions
Large diffs are not rendered by default.

src/brogue/Buttons.c

Lines changed: 234 additions & 247 deletions
Large diffs are not rendered by default.

src/brogue/Combat.c

Lines changed: 1406 additions & 1462 deletions
Large diffs are not rendered by default.

src/brogue/Dijkstra.c

Lines changed: 199 additions & 192 deletions
Large diffs are not rendered by default.

src/brogue/Globals.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ extern const color deepWaterLightColor;
3131

3232
extern const color confusionGasColor;
3333

34-
extern color minersLightColor; //dynamic
34+
extern color minersLightColor; // dynamic
3535
extern const color basicLightColor;
3636
extern const color torchLightColor;
3737

src/brogue/GlobalsBase.c

Lines changed: 52 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@
2727

2828
#include "Rogue.h"
2929

30-
tcell tmap[DCOLS][DROWS]; // grids with info about the map
30+
tcell tmap[DCOLS][DROWS]; // grids with info about the map
3131
pcell pmap[DCOLS][DROWS];
3232
short **scentMap;
33-
cellDisplayBuffer displayBuffer[COLS][ROWS]; // used to optimize plotCharWithColor
33+
cellDisplayBuffer displayBuffer[COLS][ROWS]; // used to optimize plotCharWithColor
3434
short terrainRandomValues[DCOLS][DROWS][8];
35-
short **safetyMap; // used to help monsters flee
36-
short **allySafetyMap; // used to help allies flee
37-
short **chokeMap; // used to assess the importance of the map's various chokepoints
38-
const short nbDirs[8][2] = {{0,-1}, {0,1}, {-1,0}, {1,0}, {-1,-1}, {-1,1}, {1,-1}, {1,1}};
35+
short **safetyMap; // used to help monsters flee
36+
short **allySafetyMap; // used to help allies flee
37+
short **chokeMap; // used to assess the importance of the map's various chokepoints
38+
const short nbDirs[8][2] = {{0, -1}, {0, 1}, {-1, 0}, {1, 0}, {-1, -1}, {-1, 1}, {1, -1}, {1, 1}};
3939
const short cDirs[8][2] = {{0, 1}, {1, 1}, {1, 0}, {1, -1}, {0, -1}, {-1, -1}, {-1, 0}, {-1, 1}};
4040
short numberOfWaypoints;
4141
levelData *levels;
@@ -50,15 +50,16 @@ item *floorItems;
5050
item *packItems;
5151
item *monsterItemsHopper;
5252

53-
char displayedMessage[MESSAGE_LINES][COLS*2];
53+
char displayedMessage[MESSAGE_LINES][COLS * 2];
5454
short messagesUnconfirmed;
5555
char combatText[COLS * 2];
5656
short messageArchivePosition;
5757
archivedMessage messageArchive[MESSAGE_ARCHIVE_ENTRIES];
5858

5959
char currentFilePath[BROGUE_FILENAME_MAX];
6060

61-
char displayDetail[DCOLS][DROWS]; // used to make certain per-cell data accessible to external code (e.g. terminal adaptations)
61+
char displayDetail[DCOLS]
62+
[DROWS]; // used to make certain per-cell data accessible to external code (e.g. terminal adaptations)
6263

6364
#ifdef AUDIT_RNG
6465
FILE *RNGLogFile;
@@ -71,53 +72,58 @@ unsigned long positionInPlaybackFile;
7172
unsigned long lengthOfPlaybackFile;
7273
unsigned long recordingLocation;
7374
unsigned long maxLevelChanges;
74-
char annotationPathname[BROGUE_FILENAME_MAX]; // pathname of annotation file
75+
char annotationPathname[BROGUE_FILENAME_MAX]; // pathname of annotation file
7576
uint64_t previousGameSeed;
7677

77-
const windowpos WINDOW_POSITION_DUNGEON_TOP_LEFT = { STAT_BAR_WIDTH + 3, MESSAGE_LINES + 2};
78+
const windowpos WINDOW_POSITION_DUNGEON_TOP_LEFT = {STAT_BAR_WIDTH + 3, MESSAGE_LINES + 2};
7879

7980
// Red Green Blue RedRand GreenRand BlueRand Rand Dances?
8081
// basic colors
81-
const color white = {100, 100, 100, 0, 0, 0, 0, false};
82-
const color gray = {50, 50, 50, 0, 0, 0, 0, false};
83-
const color darkGray = {30, 30, 30, 0, 0, 0, 0, false};
84-
const color veryDarkGray = {15, 15, 15, 0, 0, 0, 0, false};
85-
const color black = {0, 0, 0, 0, 0, 0, 0, false};
86-
const color yellow = {100, 100, 0, 0, 0, 0, 0, false};
87-
const color darkYellow = {50, 50, 0, 0, 0, 0, 0, false};
88-
const color teal = {30, 100, 100, 0, 0, 0, 0, false};
89-
const color purple = {100, 0, 100, 0, 0, 0, 0, false};
90-
const color darkPurple = {50, 0, 50, 0, 0, 0, 0, false};
91-
const color brown = {60, 40, 0, 0, 0, 0, 0, false};
92-
const color green = {0, 100, 0, 0, 0, 0, 0, false};
93-
const color darkGreen = {0, 50, 0, 0, 0, 0, 0, false};
94-
const color orange = {100, 50, 0, 0, 0, 0, 0, false};
95-
const color darkOrange = {50, 25, 0, 0, 0, 0, 0, false};
96-
const color blue = {0, 0, 100, 0, 0, 0, 0, false};
97-
const color darkBlue = {0, 0, 50, 0, 0, 0, 0, false};
98-
const color darkTurquoise = {0, 40, 65, 0, 0, 0, 0, false};
99-
const color lightBlue = {40, 40, 100, 0, 0, 0, 0, false};
100-
const color pink = {100, 60, 66, 0, 0, 0, 0, false};
101-
const color darkPink = {50, 30, 33, 0, 0, 0, 0, false};
102-
const color red = {100, 0, 0, 0, 0, 0, 0, false};
103-
const color darkRed = {50, 0, 0, 0, 0, 0, 0, false};
104-
const color tanColor = {80, 67, 15, 0, 0, 0, 0, false};
82+
const color white = {100, 100, 100, 0, 0, 0, 0, false};
83+
const color gray = {50, 50, 50, 0, 0, 0, 0, false};
84+
const color darkGray = {30, 30, 30, 0, 0, 0, 0, false};
85+
const color veryDarkGray = {15, 15, 15, 0, 0, 0, 0, false};
86+
const color black = {0, 0, 0, 0, 0, 0, 0, false};
87+
const color yellow = {100, 100, 0, 0, 0, 0, 0, false};
88+
const color darkYellow = {50, 50, 0, 0, 0, 0, 0, false};
89+
const color teal = {30, 100, 100, 0, 0, 0, 0, false};
90+
const color purple = {100, 0, 100, 0, 0, 0, 0, false};
91+
const color darkPurple = {50, 0, 50, 0, 0, 0, 0, false};
92+
const color brown = {60, 40, 0, 0, 0, 0, 0, false};
93+
const color green = {0, 100, 0, 0, 0, 0, 0, false};
94+
const color darkGreen = {0, 50, 0, 0, 0, 0, 0, false};
95+
const color orange = {100, 50, 0, 0, 0, 0, 0, false};
96+
const color darkOrange = {50, 25, 0, 0, 0, 0, 0, false};
97+
const color blue = {0, 0, 100, 0, 0, 0, 0, false};
98+
const color darkBlue = {0, 0, 50, 0, 0, 0, 0, false};
99+
const color darkTurquoise = {0, 40, 65, 0, 0, 0, 0, false};
100+
const color lightBlue = {40, 40, 100, 0, 0, 0, 0, false};
101+
const color pink = {100, 60, 66, 0, 0, 0, 0, false};
102+
const color darkPink = {50, 30, 33, 0, 0, 0, 0, false};
103+
const color red = {100, 0, 0, 0, 0, 0, 0, false};
104+
const color darkRed = {50, 0, 0, 0, 0, 0, 0, false};
105+
const color tanColor = {80, 67, 15, 0, 0, 0, 0, false};
105106

106107
// tile colors
107-
const color rainbow = {-70, -70, -70, 170, 170, 170, 0, true};
108+
const color rainbow = {-70, -70, -70, 170, 170, 170, 0, true};
108109

109110
// charm constants
110111
const fixpt POW_0_CHARM_INCREMENT[] = { // 1.0
111-
65536, 65536, 65536, 65536, 65536, 65536, 65536, 65536, 65536, 65536, 65536, 65536, 65536, 65536, 65536, 65536, 65536, 65536, 65536,
112-
65536, 65536, 65536, 65536, 65536, 65536, 65536, 65536, 65536, 65536, 65536, 65536, 65536, 65536, 65536, 65536, 65536, 65536, 65536,
113-
65536, 65536, 65536, 65536, 65536, 65536, 65536, 65536, 65536, 65536, 65536, 65536, 65536};
112+
65536, 65536, 65536, 65536, 65536, 65536, 65536, 65536, 65536, 65536, 65536, 65536, 65536,
113+
65536, 65536, 65536, 65536, 65536, 65536, 65536, 65536, 65536, 65536, 65536, 65536, 65536,
114+
65536, 65536, 65536, 65536, 65536, 65536, 65536, 65536, 65536, 65536, 65536, 65536, 65536,
115+
65536, 65536, 65536, 65536, 65536, 65536, 65536, 65536, 65536, 65536, 65536, 65536};
114116
const fixpt POW_120_CHARM_INCREMENT[] = { // 1.20^x fixed point, with x from 1 to 50 in increments of 1:
115-
78643, 94371, 113246, 135895, 163074, 195689, 234827, 281792, 338151, 405781, 486937, 584325, 701190, 841428, 1009714, 1211657,
116-
1453988, 1744786, 2093744, 2512492, 3014991, 3617989, 4341587, 5209905, 6251886, 7502263, 9002716, 10803259, 12963911, 15556694,
117-
18668032, 22401639, 26881967, 32258360, 38710033, 46452039, 55742447, 66890937, 80269124, 96322949, 115587539, 138705047, 166446056,
118-
199735268, 239682321, 287618785, 345142543, 414171051, 497005262, 596406314, 715687577};
117+
78643, 94371, 113246, 135895, 163074, 195689, 234827, 281792, 338151,
118+
405781, 486937, 584325, 701190, 841428, 1009714, 1211657, 1453988, 1744786,
119+
2093744, 2512492, 3014991, 3617989, 4341587, 5209905, 6251886, 7502263, 9002716,
120+
10803259, 12963911, 15556694, 18668032, 22401639, 26881967, 32258360, 38710033, 46452039,
121+
55742447, 66890937, 80269124, 96322949, 115587539, 138705047, 166446056, 199735268, 239682321,
122+
287618785, 345142543, 414171051, 497005262, 596406314, 715687577};
119123
const fixpt POW_125_CHARM_INCREMENT[] = { // 1.25^x fixed point, with x from 1 to 50 in increments of 1:
120-
81920, 102400, 128000, 160000, 200000, 250000, 312500, 390625, 488281, 610351, 762939, 953674, 1192092, 1490116, 1862645, 2328306,
121-
2910383, 3637978, 4547473, 5684341, 7105427, 8881784, 11102230, 13877787, 17347234, 21684043, 27105054, 33881317, 42351647, 52939559,
122-
66174449, 82718061, 103397576, 129246970, 161558713, 201948391, 252435489, 315544362, 394430452, 493038065, 616297582, 770371977,
123-
962964972, 1203706215, 1504632769, 1880790961, 2350988701, 2938735877, 3673419846, 4591774807, 5739718509};
124+
81920, 102400, 128000, 160000, 200000, 250000, 312500, 390625, 488281,
125+
610351, 762939, 953674, 1192092, 1490116, 1862645, 2328306, 2910383, 3637978,
126+
4547473, 5684341, 7105427, 8881784, 11102230, 13877787, 17347234, 21684043, 27105054,
127+
33881317, 42351647, 52939559, 66174449, 82718061, 103397576, 129246970, 161558713, 201948391,
128+
252435489, 315544362, 394430452, 493038065, 616297582, 770371977, 962964972, 1203706215, 1504632769,
129+
1880790961, 2350988701, 2938735877, 3673419846, 4591774807, 5739718509};

src/brogue/GlobalsBase.h

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,16 @@
2121
* along with this program. If not, see <http://www.gnu.org/licenses/>.
2222
*/
2323

24-
25-
extern tcell tmap[DCOLS][DROWS]; // grids with info about the map
26-
extern pcell pmap[DCOLS][DROWS]; // grids with info about the map
24+
extern tcell tmap[DCOLS][DROWS]; // grids with info about the map
25+
extern pcell pmap[DCOLS][DROWS]; // grids with info about the map
2726

2827
// Returns a pointer to the `tcell` at the given position. The position must be in-bounds.
29-
static inline tcell* tmapAt(pos p) {
28+
static inline tcell *tmapAt(pos p) {
3029
brogueAssert(p.x >= 0 && p.x < DCOLS && p.y >= 0 && p.y < DROWS);
3130
return &tmap[p.x][p.y];
3231
}
3332
// Returns a pointer to the `pcell` at the given position. The position must be in-bounds.
34-
static inline pcell* pmapAt(pos p) {
33+
static inline pcell *pmapAt(pos p) {
3534
brogueAssert(p.x >= 0 && p.x < DCOLS && p.y >= 0 && p.y < DROWS);
3635
return &pmap[p.x][p.y];
3736
}
@@ -42,13 +41,13 @@ extern const short nbDirs[8][2];
4241
// The direction must not be `NO_DIRECTION`.
4342
static inline pos posNeighborInDirection(pos p, enum directions direction_to_step) {
4443
brogueAssert(direction_to_step >= 0 && direction_to_step < 8);
45-
return (pos) { .x = p.x + nbDirs[direction_to_step][0], .y = p.y + nbDirs[direction_to_step][1] };
44+
return (pos){.x = p.x + nbDirs[direction_to_step][0], .y = p.y + nbDirs[direction_to_step][1]};
4645
}
4746

4847
extern short **scentMap;
4948
extern cellDisplayBuffer displayBuffer[COLS][ROWS];
5049
extern short terrainRandomValues[DCOLS][DROWS][8];
51-
extern short **safetyMap; // used to help monsters flee
50+
extern short **safetyMap; // used to help monsters flee
5251
extern short **allySafetyMap;
5352
extern short **chokeMap;
5453

@@ -67,9 +66,9 @@ extern item *packItems;
6766
extern item *monsterItemsHopper;
6867
extern short numberOfWaypoints;
6968

70-
extern char displayedMessage[MESSAGE_LINES][COLS*2];
69+
extern char displayedMessage[MESSAGE_LINES][COLS * 2];
7170
extern short messagesUnconfirmed;
72-
extern char combatText[COLS*2];
71+
extern char combatText[COLS * 2];
7372
extern short messageArchivePosition;
7473
extern archivedMessage messageArchive[MESSAGE_ARCHIVE_ENTRIES];
7574

@@ -89,7 +88,7 @@ extern unsigned long positionInPlaybackFile;
8988
extern unsigned long lengthOfPlaybackFile;
9089
extern unsigned long recordingLocation;
9190
extern unsigned long maxLevelChanges;
92-
extern char annotationPathname[BROGUE_FILENAME_MAX]; // pathname of annotation file
91+
extern char annotationPathname[BROGUE_FILENAME_MAX]; // pathname of annotation file
9392
extern uint64_t previousGameSeed;
9493

9594
// basic colors

0 commit comments

Comments
 (0)