wip: implement a smaller data model to reduce copying from physics to main thread

This commit is contained in:
2026-02-24 17:05:24 +01:00
parent 1347abad34
commit c4222c783c
13 changed files with 312 additions and 470 deletions

View File

@ -1,13 +1,11 @@
#ifndef __INPUT_HPP_
#define __INPUT_HPP_
#include "renderer.hpp"
#include "state.hpp"
class InputHandler {
public:
StateManager &state;
Renderer &renderer;
int hov_x;
int hov_y;
@ -18,10 +16,14 @@ public:
int block_add_x;
int block_add_y;
bool mark_solutions;
bool connect_solutions;
public:
InputHandler(StateManager &_state, Renderer &_renderer)
: state(_state), renderer(_renderer), hov_x(-1), hov_y(-1), sel_x(0),
sel_y(0), has_block_add_xy(false), block_add_x(-1), block_add_y(-1) {}
InputHandler(StateManager &_state)
: state(_state), hov_x(-1), hov_y(-1), sel_x(0), sel_y(0),
has_block_add_xy(false), block_add_x(-1), block_add_y(-1),
mark_solutions(false), connect_solutions(false) {}
InputHandler(const InputHandler &copy) = delete;
InputHandler &operator=(const InputHandler &copy) = delete;