Skip to content

Commit

Permalink
Add GLB mesh loader, not fully featured but enough to load kenney.nl …
Browse files Browse the repository at this point in the history
…files
  • Loading branch information
daid committed Dec 29, 2024
1 parent 98ff13a commit 66a37f5
Show file tree
Hide file tree
Showing 2 changed files with 187 additions and 0 deletions.
51 changes: 51 additions & 0 deletions include/sp2/graphics/mesh/glb.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#ifndef SP2_GRAPHICS_MESH_GLB_H
#define SP2_GRAPHICS_MESH_GLB_H

#include <sp2/graphics/meshdata.h>
#include <sp2/math/matrix4x4.h>
#include <nlohmann/json.hpp>


namespace sp {

class GLBLoader
{
public:
class GLBFile {
public:
struct Node {
string name;

sp::Vector3d translation{};
sp::Quaterniond rotation{};
sp::MeshData::Vertices vertices;
sp::MeshData::Indices indices;

std::vector<Node> children;
};
std::vector<Node> roots;

std::shared_ptr<MeshData> flatMesh() const;
private:
void addToFlat(sp::MeshData::Vertices& vertices, sp::MeshData::Indices& indices, const Node& node, Matrix4x4f transform) const;
};

static const GLBFile& get(string resource_name);
private:
GLBLoader(string resource_name);
void handleNode(int node_id, GLBFile::Node& node);

template<typename T> static sp::Vector3<T> swap_axis(sp::Vector3<T> v) {
return {-v.x, v.z, v.y};
}

GLBFile result;
nlohmann::json json;
std::vector<uint8_t> bindata;

static inline std::unordered_map<string, GLBFile> files;
};

}//namespace sp

#endif//SP2_GRAPHICS_MESH_GLB_H
136 changes: 136 additions & 0 deletions src/graphics/mesh/glb.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
#include <sp2/graphics/mesh/glb.h>
#include <sp2/io/resourceProvider.h>

namespace sp {

std::shared_ptr<MeshData> GLBLoader::GLBFile::flatMesh() const {
sp::MeshData::Vertices vertices;
sp::MeshData::Indices indices;
for(auto& root : roots) {
addToFlat(vertices, indices, root, Matrix4x4f::identity());
}
return MeshData::create(std::move(vertices), std::move(indices));
}

void GLBLoader::GLBFile::addToFlat(sp::MeshData::Vertices& vertices, sp::MeshData::Indices& indices, const Node& node, Matrix4x4f transform) const {
transform = transform * Matrix4x4f::translate(Vector3f(node.translation)) * Matrix4x4f::fromQuaternion(Quaternionf(node.rotation));
auto oldVertexCount = vertices.size();
vertices.reserve(oldVertexCount + node.vertices.size());
for(auto& v : node.vertices) {
vertices.emplace_back(
transform.multiply(v.position),
transform.applyDirection(v.normal),
v.uv
);
}
indices.reserve(indices.size() + node.indices.size());
for(auto i : node.indices) {
indices.push_back(i + oldVertexCount);
}

for(auto& child : node.children)
addToFlat(vertices, indices, child, transform);
}

const GLBLoader::GLBFile& GLBLoader::get(string resource_name) {
auto it = files.find(resource_name);
if (it != files.end())
return it->second;
files[resource_name] = GLBLoader(resource_name).result;
return get(resource_name);
}

GLBLoader::GLBLoader(string resource_name)
{
auto resource = io::ResourceProvider::get(resource_name);

uint32_t magic;
resource->read(&magic, sizeof(magic));
if (magic != 0x46546C67) return;
uint32_t version;
uint32_t length;
resource->read(&version, sizeof(version));
resource->read(&length, sizeof(length));

while(resource->tell() != resource->getSize()) {
uint32_t chunkLen;
resource->read(&chunkLen, sizeof(chunkLen));
uint32_t chunkType;
resource->read(&chunkType, sizeof(chunkType));

if (chunkType == 0x4E4F534A) {
std::string json_string;
json_string.resize(chunkLen);
resource->read(json_string.data(), chunkLen);
json = nlohmann::json::parse(json_string, nullptr, false);
} else if (chunkType == 0x004E4942) {
bindata.resize(chunkLen);
resource->read(bindata.data(), chunkLen);
} else {
resource->seek(resource->tell() + chunkLen);
}
}

for(auto& scene : json["scenes"]) {
for(auto& node_id : scene["nodes"]) {
result.roots.emplace_back();
handleNode(static_cast<int>(node_id), result.roots.back());
}
}
}

void GLBLoader::handleNode(int node_id, GLBFile::Node& node)
{
auto& node_json = json["nodes"][node_id];
if (node_json.find("translation") != node_json.end()) {
node.translation.x = node_json["translation"][0];
node.translation.y = node_json["translation"][1];
node.translation.z = node_json["translation"][2];
node.translation = swap_axis(node.translation);
}
auto& mesh = json["meshes"][static_cast<int>(node_json["mesh"])];
for(auto& primitive : mesh["primitives"]) {
auto& p_a = json["accessors"][static_cast<int>(primitive["attributes"]["POSITION"])];
auto& p_b = json["bufferViews"][static_cast<int>(p_a["bufferView"])];
auto& n_a = json["accessors"][static_cast<int>(primitive["attributes"]["NORMAL"])];
auto& n_b = json["bufferViews"][static_cast<int>(n_a["bufferView"])];
auto& t_a = json["accessors"][static_cast<int>(primitive["attributes"]["TEXCOORD_0"])];
auto& t_b = json["bufferViews"][static_cast<int>(t_a["bufferView"])];
auto& i_a = json["accessors"][static_cast<int>(primitive["indices"])];
auto& i_b = json["bufferViews"][static_cast<int>(i_a["bufferView"])];

node.vertices.reserve(p_a.value("count", 0));
for(int vertex_offset=0; vertex_offset<p_a.value("count", 0); vertex_offset++) {
node.vertices.emplace_back(
swap_axis(*reinterpret_cast<sp::Vector3f*>(bindata.data() + p_b.value("byteOffset", 0) + p_b.value("byteStride", sizeof(sp::Vector3f)) * vertex_offset)),
swap_axis(*reinterpret_cast<sp::Vector3f*>(bindata.data() + n_b.value("byteOffset", 0) + n_b.value("byteStride", sizeof(sp::Vector3f)) * vertex_offset)),
*reinterpret_cast<sp::Vector2f*>(bindata.data() + t_b.value("byteOffset", 0) + t_b.value("byteStride", sizeof(sp::Vector2f)) * vertex_offset)
);
}
auto buffer = bindata.data() + i_b.value("byteOffset", 0);
node.indices.reserve(i_a.value("count", 0));
for(int indice_offset=0; indice_offset<i_a.value("count", 0); indice_offset++) {
int index = 0;
switch(static_cast<int>(i_a["componentType"])) {
case 5121:
index = buffer[indice_offset];
break;
case 5123:
index = buffer[indice_offset*2] | (buffer[indice_offset*2+1] << 8);
break;
}
node.indices.push_back(index);
}
}

node.name = node_json.value("name", "no-name");

if (node_json.find("children") != node_json.end()) {
for(auto& child_id : node_json["children"]) {
node.children.emplace_back();
handleNode(static_cast<int>(child_id), node.children.back());
}
}
}

}//namespace sp

1 comment on commit 66a37f5

@daid-tinyci
Copy link

@daid-tinyci daid-tinyci bot commented on 66a37f5 Dec 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TinyCI build failure:

[/home/tinyci/builds/daid/SeriousProton2/_build_native_debug:cmake --build .] returned [1]:


[2/3] Linking CXX shared library libseriousproton2.so

FAILED: libseriousproton2.so 

: && /usr/bin/c++ -fPIC -g -DDEBUG=1   -shared -Wl,-soname,libseriousproton2.so -o libseriousproton2.so CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/assert.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/audio/audioSource.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/audio/music.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/audio/musicPlayer.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/audio/sound.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/buildinResources.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/collision/2d/box.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/collision/2d/box2dBackend.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/collision/2d/chains.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/collision/2d/circle.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/collision/2d/compound.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/collision/2d/joint.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/collision/2d/polygon.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/collision/2d/revolutejoint.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/collision/2d/ropejoint.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/collision/2d/shape.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/collision/3d/box.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/collision/3d/bullet3dBackend.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/collision/3d/capsule.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/collision/3d/compound.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/collision/3d/convexHull.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/collision/3d/cylinder.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/collision/3d/mesh.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/collision/3d/shape.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/collision/3d/sphere.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/collision/backend.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/collision/shape.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/collision/simple2d/shape.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/collision/simple2d/simple2dBackend.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/engine.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/exception/dummy/unhandled.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/exception/unhandled.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/exception/unix/unhandled.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/graphics/animation.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/graphics/color.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/graphics/font.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/graphics/font/bitmap.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/graphics/font/freetype.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/graphics/fontManager.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/graphics/graphicslayer.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/graphics/gui/container.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/graphics/gui/layout/grid.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/graphics/gui/layout/horizontal.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/graphics/gui/layout/horizontalflow.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/graphics/gui/layout/layout.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/graphics/gui/layout/vertical.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/graphics/gui/layout/verticalflow.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/graphics/gui/loader.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/graphics/gui/scene.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/graphics/gui/theme.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/graphics/gui/widget/button.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/graphics/gui/widget/image.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/graphics/gui/widget/itemlist.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/graphics/gui/widget/keynavigator.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/graphics/gui/widget/label.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/graphics/gui/widget/listbox.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/graphics/gui/widget/panel.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/graphics/gui/widget/progressbar.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/graphics/gui/widget/root.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/graphics/gui/widget/slider.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/graphics/gui/widget/textarea.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/graphics/gui/widget/textfield.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/graphics/gui/widget/themeimage.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/graphics/gui/widget/togglebutton.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/graphics/gui/widget/tumbler.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/graphics/gui/widget/widget.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/graphics/image.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/graphics/image/hq2x.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/graphics/mesh/fbx.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/graphics/mesh/glb.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/graphics/mesh/obj.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/graphics/meshbuilder.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/graphics/meshdata.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/graphics/opengl.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/graphics/renderTexture.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/graphics/scene/basicnoderenderpass.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/graphics/scene/collisionrenderpass.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/graphics/scene/graphicslayer.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/graphics/scene/renderdata.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/graphics/scene/renderpass.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/graphics/scene/renderqueue.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/graphics/shader.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/graphics/spriteAnimation.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/graphics/texture.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/graphics/textureAtlas.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/graphics/textureManager.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/io/cameraCapture.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/io/clipboard.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/io/directoryResourceProvider.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/io/fileSelectionDialog.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/io/filesystem.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/io/http/request.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/io/http/server.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/io/http/websocket.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/io/internalResourceProvider.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/io/irc/client.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/io/irc/twitch.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/io/keyValueTreeLoader.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/io/keyValueTreeSaver.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/io/keybinding.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/io/lazyLoader.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/io/network/address.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/io/network/selector.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/io/network/socketBase.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/io/network/tcpListener.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/io/network/tcpSocket.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/io/network/udpSocket.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/io/resourceProvider.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/io/serialization/dataset.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/io/serialization/list.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/io/serialization/serializer.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/io/serialport.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/io/subprocess.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/io/virtualTouchKeys.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/io/zipResourceProvider.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/keyValueTree.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/logging.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/multiplayer/base.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/multiplayer/client.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/multiplayer/discovery.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/multiplayer/registry.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/multiplayer/replication.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/multiplayer/server.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/pointer.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/pointerBase.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/pointerList.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/random.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/scene/camera.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/scene/node.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/scene/particleEmitter.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/scene/scene.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/scene/tilemap.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/scene/voxelmap.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/script/bindingClass.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/script/bindingObject.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/script/callback.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/script/coroutine.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/script/environment.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/script/luaBindings.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/script/luaState.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/script/vector.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/stringutil/base64.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/stringutil/convert.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/stringutil/i18n.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/stringutil/luaTokenizer.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/stringutil/sha1.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/stringutil/utf8.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/timer.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/tweak.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/tween.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/updatable.cpp.o CMakeFiles/seriousproton2.dir/data/tinyci_builds/daid/SeriousProton2/src/window.cpp.o  extlibs/libbox2d.a  extlibs/libbullet.a  extlibs/liblua.a  extlibs/libminiz.a  extlibs/libsp2freetype.a  /usr/lib/x86_64-linux-gnu/libSDL2.so && :

/usr/bin/ld: extlibs/libbullet.a(btQuickprof.cpp.o): relocation R_X86_64_TPOFF32 against `_ZZ33btQuickprofGetCurrentThreadIndex2vE12sThreadIndex' can not be used when making a shared object; recompile with -fPIC

/usr/bin/ld: failed to set dynamic section sizes: bad value

collect2: error: ld returned 1 exit status

ninja: build stopped: subcommand failed.

Please sign in to comment.