From a8bcacc95045102e67f2feabbdddf79535837554 Mon Sep 17 00:00:00 2001 From: jacopograndi Date: Thu, 19 Aug 2021 18:46:51 +0200 Subject: forgot to make repo until now --- game/view.cpp | 77 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 game/view.cpp (limited to 'game/view.cpp') diff --git a/game/view.cpp b/game/view.cpp new file mode 100644 index 0000000..6599a0e --- /dev/null +++ b/game/view.cpp @@ -0,0 +1,77 @@ +#include "view.h" + +void View::process (Gst &gst, vec2 cam, vec2 mouse, int *mheld) { + Ground &gr = gst.ground; + std::vector &entities = gst.entities; + + vec2 absmouse { mouse }; + absmouse -= cam; + + cursor_ground = -1; + cursor_entity = -1; + back = -1; + opt = -1; + + if (mheld[0] == 1) { + bool found = false; + + if (moves.size() > 0 && !found) { + for (int i=0; i