Skip to content

Commit

Permalink
Small code format update
Browse files Browse the repository at this point in the history
  • Loading branch information
Karaulov committed Nov 22, 2022
1 parent 2b7a044 commit cd0cd98
Show file tree
Hide file tree
Showing 51 changed files with 6,197 additions and 3,280 deletions.
1,957 changes: 1,260 additions & 697 deletions src/bsp/Bsp.cpp

Large diffs are not rendered by default.

17 changes: 9 additions & 8 deletions src/bsp/Bsp.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ class BspRenderer;

struct membuf : std::streambuf
{
membuf(char* begin, int len) {
membuf(char* begin, int len)
{
this->setg(begin, begin, begin + len);
}
};
Expand Down Expand Up @@ -87,8 +88,8 @@ class Bsp
void print_model_hull(int modelIdx, int hull);
void print_clipnode_tree(int iNode, int depth);
void recurse_node(short node, int depth);
int pointContents(int iNode, const vec3 & p, int hull, std::vector<int>& nodeBranch, int& leafIdx, int& childIdx);
int pointContents(int iNode, const vec3 & p, int hull);
int pointContents(int iNode, const vec3& p, int hull, std::vector<int>& nodeBranch, int& leafIdx, int& childIdx);
int pointContents(int iNode, const vec3& p, int hull);
const char* getLeafContentsName(int contents);

// strips a collision hull from the given model index
Expand All @@ -99,7 +100,7 @@ class Bsp
// and redirects to the given hull, if redirect>0
void delete_hull(int hull_number, int redirect);

void write_csg_outputs(const std::string &path);
void write_csg_outputs(const std::string& path);

// get the bounding box for the world
void get_bounding_box(vec3& mins, vec3& maxs);
Expand Down Expand Up @@ -161,7 +162,7 @@ class Bsp
bool validate();

// creates a solid cube
int create_solid(const vec3 & mins, const vec3& maxs, int textureIdx);
int create_solid(const vec3& mins, const vec3& maxs, int textureIdx);

// creates a new solid from the given solid definition (must be convex).
int create_solid(Solid& solid, int targetModelIdx = -1);
Expand Down Expand Up @@ -249,9 +250,9 @@ class Bsp
void get_lightmap_shift(const LIGHTMAP& oldLightmap, const LIGHTMAP& newLightmap, int& srcOffsetX, int& srcOffsetY);

void print_model_bsp(int modelIdx);
void print_leaf(const BSPLEAF &leaf);
void print_leaf(const BSPLEAF& leaf);
void print_node(const BSPNODE& node);
void print_stat(const std::string &name, unsigned int val, unsigned int max, bool isMem);
void print_stat(const std::string& name, unsigned int val, unsigned int max, bool isMem);
void print_model_stat(STRUCTUSAGE* modelInfo, unsigned int val, int max, bool isMem);

std::string get_model_usage(int modelIdx);
Expand All @@ -273,7 +274,7 @@ class Bsp
void remap_node_structures(int iNode, STRUCTREMAP* remap);
void remap_clipnode_structures(int iNode, STRUCTREMAP* remap);


BspRenderer* renderer;
unsigned int originCrc32 = 0;
};
Loading

0 comments on commit cd0cd98

Please sign in to comment.