Compare commits
3 Commits
efficient-
...
d62d5c78bf
| Author | SHA1 | Date | |
|---|---|---|---|
|
d62d5c78bf
|
|||
|
2a5f1b2ffd
|
|||
|
2ef2a29601
|
@ -29,7 +29,7 @@ constexpr float CAMERA_FOV = 90.0;
|
|||||||
constexpr float FOV_SPEED = 1.0;
|
constexpr float FOV_SPEED = 1.0;
|
||||||
constexpr float MIN_FOV = 10.0;
|
constexpr float MIN_FOV = 10.0;
|
||||||
constexpr float MAX_FOV = 180.0;
|
constexpr float MAX_FOV = 180.0;
|
||||||
constexpr float CAMERA_DISTANCE = 20.0;
|
constexpr float CAMERA_DISTANCE = 150.0;
|
||||||
constexpr float ZOOM_SPEED = 2.5;
|
constexpr float ZOOM_SPEED = 2.5;
|
||||||
constexpr float MIN_CAMERA_DISTANCE = 2.0;
|
constexpr float MIN_CAMERA_DISTANCE = 2.0;
|
||||||
constexpr float MAX_CAMERA_DISTANCE = 2000.0;
|
constexpr float MAX_CAMERA_DISTANCE = 2000.0;
|
||||||
|
|||||||
@ -78,7 +78,7 @@ public:
|
|||||||
|
|
||||||
// Camera
|
// Camera
|
||||||
bool camera_lock = true;
|
bool camera_lock = true;
|
||||||
bool camera_mass_center_lock = false;
|
bool camera_mass_center_lock = true;
|
||||||
bool camera_panning = false;
|
bool camera_panning = false;
|
||||||
bool camera_rotating = false;
|
bool camera_rotating = false;
|
||||||
|
|
||||||
|
|||||||
@ -278,7 +278,7 @@ auto input_handler::toggle_camera_projection() const -> void
|
|||||||
auto input_handler::move_block_nor() -> void
|
auto input_handler::move_block_nor() -> void
|
||||||
{
|
{
|
||||||
const puzzle& current = state.get_current_state();
|
const puzzle& current = state.get_current_state();
|
||||||
const std::optional<puzzle>& next = current.try_move_block_at_fast(sel_x, sel_y, nor);
|
const std::optional<puzzle>& next = current.try_move_block_at(sel_x, sel_y, nor);
|
||||||
if (!next) {
|
if (!next) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -290,7 +290,7 @@ auto input_handler::move_block_nor() -> void
|
|||||||
auto input_handler::move_block_wes() -> void
|
auto input_handler::move_block_wes() -> void
|
||||||
{
|
{
|
||||||
const puzzle& current = state.get_current_state();
|
const puzzle& current = state.get_current_state();
|
||||||
const std::optional<puzzle>& next = current.try_move_block_at_fast(sel_x, sel_y, wes);
|
const std::optional<puzzle>& next = current.try_move_block_at(sel_x, sel_y, wes);
|
||||||
if (!next) {
|
if (!next) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -302,7 +302,7 @@ auto input_handler::move_block_wes() -> void
|
|||||||
auto input_handler::move_block_sou() -> void
|
auto input_handler::move_block_sou() -> void
|
||||||
{
|
{
|
||||||
const puzzle& current = state.get_current_state();
|
const puzzle& current = state.get_current_state();
|
||||||
const std::optional<puzzle>& next = current.try_move_block_at_fast(sel_x, sel_y, sou);
|
const std::optional<puzzle>& next = current.try_move_block_at(sel_x, sel_y, sou);
|
||||||
if (!next) {
|
if (!next) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -314,7 +314,7 @@ auto input_handler::move_block_sou() -> void
|
|||||||
auto input_handler::move_block_eas() -> void
|
auto input_handler::move_block_eas() -> void
|
||||||
{
|
{
|
||||||
const puzzle& current = state.get_current_state();
|
const puzzle& current = state.get_current_state();
|
||||||
const std::optional<puzzle>& next = current.try_move_block_at_fast(sel_x, sel_y, eas);
|
const std::optional<puzzle>& next = current.try_move_block_at(sel_x, sel_y, eas);
|
||||||
if (!next) {
|
if (!next) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
13
src/main.cpp
13
src/main.cpp
@ -14,18 +14,11 @@
|
|||||||
#include <tracy/Tracy.hpp>
|
#include <tracy/Tracy.hpp>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// TODO: Add some popups (my split between input.cpp/gui.cpp makes this ugly)
|
// TODO: Manual movement is now completely broken
|
||||||
// - Clear graph: Notify that this will clear the visited states and move
|
|
||||||
// history
|
|
||||||
// - Reset state: Notify that this will reset the move count
|
|
||||||
|
|
||||||
// TODO: Reduce memory usage
|
// TODO: Add state space generation time to debug overlay
|
||||||
// - The memory model of the puzzle board is terrible (bitboards?)
|
|
||||||
|
|
||||||
// TODO: Improve solver
|
// TODO: Improve solver
|
||||||
// - Move discovery is terrible
|
|
||||||
// - Instead of trying each direction for each block, determine the
|
|
||||||
// possible moves more efficiently (requires a different memory model)
|
|
||||||
// - Implement state discovery/enumeration
|
// - Implement state discovery/enumeration
|
||||||
// - Find all possible initial board states (single one for each
|
// - Find all possible initial board states (single one for each
|
||||||
// possible statespace). Currently wer're just finding all states
|
// possible statespace). Currently wer're just finding all states
|
||||||
@ -37,8 +30,6 @@
|
|||||||
|
|
||||||
// TODO: Click states in the graph to display them in the board
|
// TODO: Click states in the graph to display them in the board
|
||||||
|
|
||||||
// NOTE: Tracy uses a huge amount of memory. For longer testing disable Tracy.
|
|
||||||
|
|
||||||
// For profiling explore_state_space
|
// For profiling explore_state_space
|
||||||
auto main2(int argc, char* argv[]) -> int
|
auto main2(int argc, char* argv[]) -> int
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user