Skip to content

Commit

Permalink
fix linux build
Browse files Browse the repository at this point in the history
  • Loading branch information
wootguy committed Apr 23, 2024
1 parent 944c216 commit dad644c
Show file tree
Hide file tree
Showing 14 changed files with 26 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Run 'bspguy <command> help' to read about a specific command.
### Linux users:
1. Install Git, CMake, X11, GLFW, GLEW, and a compiler.
* Debian: `sudo apt install build-essential git cmake libx11-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libgl1-mesa-dev xorg-dev libglfw3-dev libglew-dev`
* Debian: `sudo apt install build-essential git cmake libx11-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libgl1-mesa-dev xorg-dev libglfw3-dev libglew-dev libxxf86vm-dev`
1. Open a terminal somewhere and run these commands:
```
git clone --recurse-submodules https://github.com/wootguy/bspguy
Expand Down
3 changes: 2 additions & 1 deletion src/bsp/Bsp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <fstream>
#include <algorithm>
#include "Clipper.h"
#include <float.h>


typedef map< string, vec3 > mapStringToVector;
Expand Down Expand Up @@ -5587,4 +5588,4 @@ void Bsp::append_lump(int lumpIdx, void* newData, int appendLength) {
memcpy(newLump + oldLen, newData, appendLength);

replace_lump(lumpIdx, newLump, oldLen + appendLength);
}
}
1 change: 1 addition & 0 deletions src/bsp/BspMerger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "Wad.h"
#include <fstream>
#include "globals.h"
#include <algorithm>

BspMerger::BspMerger() {

Expand Down
3 changes: 2 additions & 1 deletion src/bsp/Entity.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "Entity.h"
#include "util.h"
#include <set>
#include <algorithm>

using namespace std;

Expand Down Expand Up @@ -491,4 +492,4 @@ bool Entity::isEverVisible() {
}

return true;
}
}
4 changes: 3 additions & 1 deletion src/bsp/NavMesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "PolyOctree.h"
#include "Clipper.h"
#include "util.h"
#include <string.h>

bool NavNode::addLink(int node, int srcEdge, int dstEdge, int16_t zDist, uint8_t flags) {
if (srcEdge < 0 || srcEdge >= MAX_NAV_POLY_VERTS) {
Expand Down Expand Up @@ -136,7 +137,8 @@ void NavMesh::getLinkMidPoints(int iNode, int iLink, vec3& srcMid, vec3& dstMid)
vec2 e4 = dstPoly.topdownVerts[e4i];

float t0, t1, t2, t3;
float overlapDist = Line2D(e1, e2).getOverlapRanges(Line2D(e3, e4), t0, t1, t2, t3);
Line2D e34(e3, e4);
float overlapDist = Line2D(e1, e2).getOverlapRanges(e34, t0, t1, t2, t3);

{
vec3 edgeStart = srcPoly.verts[link.srcEdge];
Expand Down
3 changes: 2 additions & 1 deletion src/bsp/NavMeshGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <set>
#include "util.h"
#include "PolyOctree.h"
#include <algorithm>

NavMesh* NavMeshGenerator::generate(Bsp* map, int hull) {
float NavMeshGeneratorGenStart = glfwGetTime();
Expand Down Expand Up @@ -463,4 +464,4 @@ int NavMeshGenerator::tryEdgeLinkPolys(Bsp* map, NavMesh* mesh, int srcPolyIdx,
}

return 0;
}
}
1 change: 1 addition & 0 deletions src/editor/BspRenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <iomanip>
#include <set>
#include <fstream>
#include <algorithm>

#include "icons/missing.h"

Expand Down
3 changes: 2 additions & 1 deletion src/editor/Gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <fstream>
#include <set>
#include "tinyfiledialogs.h"
#include <algorithm>

// embedded binary data
#include "fonts/robotomono.h"
Expand Down Expand Up @@ -4360,4 +4361,4 @@ void Gui::checkFaceErrors() {
void Gui::refresh() {
reloadLimits();
checkValidHulls();
}
}
1 change: 1 addition & 0 deletions src/editor/LightmapNode.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "LightmapNode.h"
#include <stdint.h>
#include <string.h>

LightmapNode::LightmapNode( int offX, int offY, int mapW, int mapH )
{
Expand Down
1 change: 1 addition & 0 deletions src/editor/Renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <fstream>
#include "globals.h"
#include "NavMesh.h"
#include <algorithm>

// everything except VIS, ENTITIES, MARKSURFS
#define EDIT_MODEL_LUMPS (PLANES | TEXTURES | VERTICES | NODES | TEXINFO | FACES | LIGHTING | CLIPNODES | LEAVES | EDGES | SURFEDGES | MODELS)
Expand Down
1 change: 1 addition & 0 deletions src/qtools/vis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include "rad.h"
#include "util.h"
#include "globals.h"
#include <string.h>

#define MAX_MAP_LEAVES 65536 // set this to the largest value in any engine

Expand Down
4 changes: 3 additions & 1 deletion src/util/PolyOctree.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#include "PolyOctree.h"
#include "util.h"
#include <string.h>
#include <algorithm>

PolyOctant::PolyOctant(vec3 min, vec3 max) {
this->min = min;
Expand Down Expand Up @@ -96,4 +98,4 @@ void PolygonOctree::getPolysInRegion(PolyOctant* node, Polygon3D* poly, int curr
getPolysInRegion(node->children[i], poly, currentDepth + 1, regionPolys);
}
}
}
}
1 change: 1 addition & 0 deletions src/util/Polygon3D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include "util.h"
#include "Renderer.h"
#include "globals.h"
#include <float.h>

#define COLINEAR_EPSILON 0.125f
#define SAME_VERT_EPSILON 0.125f
Expand Down
5 changes: 5 additions & 0 deletions src/util/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
#include "colors.h"
#include "mat4x4.h"
#include "globals.h"
#include <cstdarg>
#include <iostream>
#include <algorithm>
#include <float.h>

#ifdef WIN32
#include <Windows.h>
#include <Shlobj.h>
Expand Down

0 comments on commit dad644c

Please sign in to comment.