From 05e20a3360b7669b2b76a3eac11e2edf9f803f01 Mon Sep 17 00:00:00 2001 From: Jonathan Date: Mon, 13 Sep 2021 13:11:53 -0400 Subject: [PATCH] astyle project; not using yet --- .astylerc | 35 +++++++++++++++++++++++++++++++++++ include/common/bspfile.hh | 22 +++++++++++----------- 2 files changed, 46 insertions(+), 11 deletions(-) create mode 100644 .astylerc diff --git a/.astylerc b/.astylerc new file mode 100644 index 00000000..0aee11ee --- /dev/null +++ b/.astylerc @@ -0,0 +1,35 @@ +# source tree +recursive +ignore-exclude-errors +exclude=.git +exclude=.vs +exclude=3rdparty +exclude=qbsp3 +exclude=out + +# braces and indent +style=kr +indent=spaces + +# indentation +min-conditional-indent=0 +max-continuation-indent=120 +indent-switches +indent-col1-comments + +# padding +pad-oper +pad-comma +pad-header +unpad-paren +align-pointer=name +align-reference=name + +# formatting +remove-braces +attach-return-type +break-one-line-headers +convert-tabs +close-templates +max-code-length=200 +break-after-logical diff --git a/include/common/bspfile.hh b/include/common/bspfile.hh index ad31b1c9..faea2404 100644 --- a/include/common/bspfile.hh +++ b/include/common/bspfile.hh @@ -117,17 +117,17 @@ struct bspx_lump_t { uint32_t filelen; }; -typedef struct { +struct lumpspec_t { const char *name; size_t size; -} lumpspec_t; +}; extern const lumpspec_t lumpspec_bsp29[BSP_LUMPS]; extern const lumpspec_t lumpspec_bsp2rmq[BSP_LUMPS]; extern const lumpspec_t lumpspec_bsp2[BSP_LUMPS]; extern const lumpspec_t lumpspec_q2bsp[Q2_HEADER_LUMPS]; -typedef struct { +struct dmodelq1_t { float mins[3]; float maxs[3]; float origin[3]; @@ -135,9 +135,9 @@ typedef struct { int32_t visleafs; /* not including the solid leaf 0 */ int32_t firstface; int32_t numfaces; -} dmodelq1_t; +}; -typedef struct { +struct dmodelh2_t { float mins[3]; float maxs[3]; float origin[3]; @@ -145,9 +145,9 @@ typedef struct { int32_t visleafs; /* not including the solid leaf 0 */ int32_t firstface; int32_t numfaces; -} dmodelh2_t; +}; -typedef struct { +struct q2_dmodel_t { float mins[3]; float maxs[3]; float origin[3]; // for sounds or lights @@ -155,15 +155,15 @@ typedef struct { int32_t firstface; int32_t numfaces; // submodels just draw faces // without walking the bsp tree -} q2_dmodel_t; +}; // FIXME: remove -typedef dmodelh2_t dmodel_t; +using dmodel_t = dmodelh2_t; -typedef struct { +struct dmiptexlump_t { int32_t nummiptex; int32_t dataofs[4]; /* [nummiptex] */ -} dmiptexlump_t; +}; #define MIPLEVELS 4 typedef struct miptex_s {