fix cross compilation for windows (disable boost.stacktrace + use sqrt instead of rsqrt)
This commit is contained in:
11
flake.nix
11
flake.nix
@ -27,6 +27,7 @@ rec {
|
|||||||
config = "x86_64-w64-mingw32";
|
config = "x86_64-w64-mingw32";
|
||||||
};
|
};
|
||||||
config.allowUnfree = true;
|
config.allowUnfree = true;
|
||||||
|
overlays = [];
|
||||||
};
|
};
|
||||||
|
|
||||||
# ===========================================================================================
|
# ===========================================================================================
|
||||||
@ -190,7 +191,15 @@ rec {
|
|||||||
raylib
|
raylib
|
||||||
raygui
|
raygui
|
||||||
thread-pool
|
thread-pool
|
||||||
boost
|
|
||||||
|
# Disable stacktrace since that's platform dependant and won't cross compile to windows
|
||||||
|
# https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/libraries/boost/generic.nix#L43
|
||||||
|
(boost.override {
|
||||||
|
enableShared = false;
|
||||||
|
extraB2Args = [
|
||||||
|
"--without-stacktrace"
|
||||||
|
];
|
||||||
|
})
|
||||||
];
|
];
|
||||||
|
|
||||||
cmakeFlags = [
|
cmakeFlags = [
|
||||||
|
|||||||
@ -11,6 +11,7 @@
|
|||||||
#define NOUSER // All USER defines and routines
|
#define NOUSER // All USER defines and routines
|
||||||
#endif
|
#endif
|
||||||
#define BS_THREAD_POOL_NATIVE_EXTENSIONS
|
#define BS_THREAD_POOL_NATIVE_EXTENSIONS
|
||||||
|
// ReSharper disable once CppUnusedIncludeDirective
|
||||||
#include <BS_thread_pool.hpp>
|
#include <BS_thread_pool.hpp>
|
||||||
#if defined(_WIN32) // raylib uses these names as function parameters
|
#if defined(_WIN32) // raylib uses these names as function parameters
|
||||||
#undef near
|
#undef near
|
||||||
|
|||||||
16
src/main.cpp
16
src/main.cpp
@ -14,25 +14,21 @@
|
|||||||
#include <tracy/Tracy.hpp>
|
#include <tracy/Tracy.hpp>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// TODO: Manual movement is now completely broken
|
|
||||||
|
|
||||||
// TODO: Add state space generation time to debug overlay
|
// TODO: Add state space generation time to debug overlay
|
||||||
|
|
||||||
// TODO: Improve solver
|
// TODO: Implement state discovery/enumeration
|
||||||
// - Implement state discovery/enumeration
|
// - Find all possible initial board states (single one for each possible statespace).
|
||||||
// - Find all possible initial board states (single one for each
|
// Currently wer're just finding all states given the initial state
|
||||||
// possible statespace). Currently wer're just finding all states
|
// - Would allow to generate random puzzles with a certain move count
|
||||||
// given the initial state
|
|
||||||
// - Would allow to generate random puzzles with a certain move count
|
|
||||||
|
|
||||||
// TODO: Move selection accordingly when undoing moves (need to diff two states
|
// TODO: Move selection accordingly when undoing moves (need to diff two states and get the moved blocks)
|
||||||
// and get the moved blocks)
|
|
||||||
|
|
||||||
// TODO: Click states in the graph to display them in the board
|
// TODO: Click states in the graph to display them in the board
|
||||||
|
|
||||||
// For profiling explore_state_space
|
// For profiling explore_state_space
|
||||||
auto main2(int argc, char* argv[]) -> int
|
auto main2(int argc, char* argv[]) -> int
|
||||||
{
|
{
|
||||||
|
// Supercompo
|
||||||
const puzzle p = puzzle(
|
const puzzle p = puzzle(
|
||||||
"S:[4x5] G:[1,3] M:[F] B:[{_ 2X2 _ _} {1x1 _ _ 1x1} {1x2 2x1 _ 1x2} {_ 2x1 _ _} {1x1 2x1 _ 1x1}]");
|
"S:[4x5] G:[1,3] M:[F] B:[{_ 2X2 _ _} {1x1 _ _ 1x1} {1x2 2x1 _ 1x2} {_ 2x1 _ _} {1x1 2x1 _ 1x1}]");
|
||||||
|
|
||||||
|
|||||||
@ -21,7 +21,7 @@ auto mass_spring_system::calculate_spring_force(const size_t s) -> void
|
|||||||
const Vector3 delta_vel = a_vel - b_vel;
|
const Vector3 delta_vel = a_vel - b_vel;
|
||||||
|
|
||||||
const float sq_len = Vector3DotProduct(delta_pos, delta_pos);
|
const float sq_len = Vector3DotProduct(delta_pos, delta_pos);
|
||||||
const float inv_len = rsqrt(sq_len);
|
const float inv_len = 1.0f / sqrt(sq_len);
|
||||||
const float len = sq_len * inv_len;
|
const float len = sq_len * inv_len;
|
||||||
|
|
||||||
const float hooke = SPRING_CONSTANT * (len - REST_LENGTH);
|
const float hooke = SPRING_CONSTANT * (len - REST_LENGTH);
|
||||||
|
|||||||
Reference in New Issue
Block a user