Skip to content

Commit

Permalink
Merge pull request pioneerspacesim#5956 from WickedSmoke/cleanup
Browse files Browse the repository at this point in the history
Build Cleanup
  • Loading branch information
Webster Sheets authored Nov 9, 2024
2 parents 2ac32b7 + b10991b commit 5e06ba6
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 28 deletions.
3 changes: 2 additions & 1 deletion contrib/jenkins/lookup3.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#ifndef _LOOKUP3_H
#define _LOOKUP3_H

#include <SDL_stdinc.h>
#include <stdint.h>
#include <stdlib.h>

uint32_t lookup3_hashword(
const uint32_t *k, /* the key, an array of uint32_t values */
Expand Down
2 changes: 1 addition & 1 deletion src/Background.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ namespace Background {

RefCountedPtr<Galaxy> galaxy;
const StarQueryInfo info;
const int32_t starsLimit;
const size_t starsLimit;
StarInfo &stars;
double &medianBrightness;
};
Expand Down
8 changes: 4 additions & 4 deletions src/SystemView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -306,15 +306,15 @@ SystemMapViewport::SystemMapViewport(GuiApplication *app) :
m_app(app),
m_renderer(app->GetRenderer()),
m_displayMode(SystemView::Mode::Orrery),
m_atlasZoom(1.0f),
m_atlasZoomTo(1.0f),
m_atlasPos(vector2f()),
m_showGravpoints(false),
m_showL4L5(LAG_OFF),
m_shipDrawing(OFF),
m_gridDrawing(GridDrawing::OFF),
m_atlasPos(vector2f()),
m_atlasZoom(1.0f),
m_atlasZoomTo(1.0f),
m_rot_y(0),
m_rot_x(50),
m_rot_y(0),
m_zoom(1.0f / float(AU)),
m_trans(0.0),
m_transTo(0.0),
Expand Down
4 changes: 2 additions & 2 deletions src/collider/CollisionContact.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ struct CollisionContact {
distance(0),
timestep(dt),
triIdx(-1),
geomFlag(0),
userData1(u1),
userData2(u2),
geomFlag(0)
userData2(u2)
{}
};

Expand Down
26 changes: 13 additions & 13 deletions src/collider/GeomTree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ GeomTree::GeomTree(const int numVerts, const int numTris, const std::vector<vect
{
PROFILE_SCOPED()

assert(static_cast<int>(vertices.size()) == m_numVertices);
assert(vertices.size() == m_numVertices);

m_aabb.min = vector3d(FLT_MAX, FLT_MAX, FLT_MAX);
m_aabb.max = vector3d(-FLT_MAX, -FLT_MAX, -FLT_MAX);
Expand Down Expand Up @@ -133,7 +133,7 @@ GeomTree::GeomTree(const int numVerts, const int numTris, const std::vector<vect
PROFILE_SCOPED_DESC("GeomTree::CreateTriTree");

m_triAABBs.reset(new AABBd[m_numTris]);
for (size_t i = 0; i < m_numTris; i++) {
for (uint32_t i = 0; i < m_numTris; i++) {
const vector3d v0 = vector3d(m_vertices[m_indices[i * 3 + 0]]);
const vector3d v1 = vector3d(m_vertices[m_indices[i * 3 + 1]]);
const vector3d v2 = vector3d(m_vertices[m_indices[i * 3 + 2]]);
Expand Down Expand Up @@ -182,25 +182,25 @@ GeomTree::GeomTree(Serializer::Reader &rd)
{
PROFILE_SCOPED_DESC("GeomTree::LoadEdges")
m_edges.resize(m_numEdges);
for (Sint32 iEdge = 0; iEdge < m_numEdges; ++iEdge) {
for (uint32_t iEdge = 0; iEdge < m_numEdges; ++iEdge) {
auto &ed = m_edges[iEdge];
rd >> ed.v1i >> ed.v2i >> ed.len >> ed.dir >> ed.triFlag;
}
}

m_vertices.resize(m_numVertices);
for (Sint32 iVert = 0; iVert < m_numVertices; ++iVert) {
for (uint32_t iVert = 0; iVert < m_numVertices; ++iVert) {
m_vertices[iVert] = rd.Vector3f();
}

const int numIndicies(m_numTris * 3);
const uint32_t numIndicies(m_numTris * 3);
m_indices.resize(numIndicies);
for (Sint32 iIndi = 0; iIndi < numIndicies; ++iIndi) {
for (uint32_t iIndi = 0; iIndi < numIndicies; ++iIndi) {
m_indices[iIndi] = rd.Int32();
}

m_triFlags.resize(m_numTris);
for (Sint32 iTri = 0; iTri < m_numTris; ++iTri) {
for (uint32_t iTri = 0; iTri < m_numTris; ++iTri) {
m_triFlags[iTri] = rd.Int32();
}

Expand All @@ -209,7 +209,7 @@ GeomTree::GeomTree(Serializer::Reader &rd)

// TODO: triangle AABBs should be written to the SGM file similarly to edge AABBs
m_triAABBs.reset(new AABBd[m_numTris]);
for (size_t i = 0; i < m_numTris; i++) {
for (uint32_t i = 0; i < m_numTris; i++) {
const vector3d v0 = vector3d(m_vertices[m_indices[i * 3 + 0]]);
const vector3d v1 = vector3d(m_vertices[m_indices[i * 3 + 1]]);
const vector3d v2 = vector3d(m_vertices[m_indices[i * 3 + 2]]);
Expand Down Expand Up @@ -292,26 +292,26 @@ void GeomTree::Save(Serializer::Writer &wr) const
// loaded in future SGM versions rather than being re-computed on each load

wr.Int32(m_numEdges);
for (Sint32 iAabb = 0; iAabb < m_numEdges; ++iAabb) {
for (uint32_t iAabb = 0; iAabb < m_numEdges; ++iAabb) {
AABBd &aabb = m_edgeAABBs.get()[iAabb];
// Write back an old-style min-max-radius Aabb for compatibility with old SGM versions
wr << aabb.min << aabb.max << double(0.0);
}

for (Sint32 iEdge = 0; iEdge < m_numEdges; ++iEdge) {
for (uint32_t iEdge = 0; iEdge < m_numEdges; ++iEdge) {
auto &ed = m_edges[iEdge];
wr << ed.v1i << ed.v2i << ed.len << ed.dir << ed.triFlag;
}

for (Sint32 iVert = 0; iVert < m_numVertices; ++iVert) {
for (uint32_t iVert = 0; iVert < m_numVertices; ++iVert) {
wr.Vector3f(m_vertices[iVert]);
}

for (Sint32 iIndi = 0; iIndi < (m_numTris * 3); ++iIndi) {
for (uint32_t iIndi = 0; iIndi < (m_numTris * 3); ++iIndi) {
wr.Int32(m_indices[iIndi]);
}

for (Sint32 iTri = 0; iTri < m_numTris; ++iTri) {
for (uint32_t iTri = 0; iTri < m_numTris; ++iTri) {
wr.Int32(m_triFlags[iTri]);
}
}
6 changes: 3 additions & 3 deletions src/collider/GeomTree.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ class GeomTree {
void RayTriIntersect(int numRays, const vector3f &origin, const vector3f *dirs, int triIdx, isect_t *isects) const;
private:

int m_numVertices;
int m_numEdges;
int m_numTris;
uint32_t m_numVertices;
uint32_t m_numEdges;
uint32_t m_numTris;

double m_radius;
Aabb m_aabb;
Expand Down
2 changes: 1 addition & 1 deletion src/galaxy/StarSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,14 +222,14 @@ SystemPath StarSystem::GetPathOf(const SystemBody *sbody) const
StarSystem::StarSystem(const SystemPath &path, RefCountedPtr<Galaxy> galaxy, StarSystemCache *cache, Random &rand) :
m_galaxy(galaxy),
m_path(path.SystemOnly()),
m_pos(0.0),
m_numStars(0),
m_isCustom(false),
m_faction(nullptr),
m_explored(eEXPLORED_AT_START),
m_exploredTime(0.0),
m_econType(GalacticEconomy::InvalidEconomyId),
m_seed(0),
m_pos(0.0),
m_tradeLevel(GalacticEconomy::Commodities().size() + 1, 0),
m_commodityLegal(GalacticEconomy::Commodities().size() + 1, true),
m_cache(cache)
Expand Down
4 changes: 2 additions & 2 deletions src/pigui/PerfInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,12 @@ PerfInfo::CounterInfo::CounterInfo(const char *n, const char *u, uint32_t recent
}

PerfInfo::PerfInfo() :
m_state(new ImGuiState({})),
m_fpsCounter("Frame Time", "ms"),
m_physCounter("Update Time", "ms"),
m_piguiCounter("PiGui Time", "ms"),
m_procMemCounter("Process memory usage", "MB", 1),
m_luaMemCounter("Lua memory usage", "MB", 1)
m_luaMemCounter("Lua memory usage", "MB", 1),
m_state(new ImGuiState({}))
{
}

Expand Down
1 change: 0 additions & 1 deletion src/pigui/Widgets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ int Draw::RadialPopupSelectMenu(const ImVec2 center, const char *popup_id, int m
if (drag_angle >= item_inner_ang_min && drag_angle < item_inner_ang_max)
hovered = true;
}
bool selected = false;

int arc_segments = static_cast<int>((64 * item_arc_span / (2 * IM_PI))) + 1;
draw_list->_PathArcToN(center, RADIUS_MAX - border_inout, item_outer_ang_min, item_outer_ang_max, arc_segments);
Expand Down

0 comments on commit 5e06ba6

Please sign in to comment.