From bb16c32bde58cba70e4877aa2d3ebd04332eb575 Mon Sep 17 00:00:00 2001 From: jacopograndi Date: Tue, 4 Jan 2022 13:35:02 +0100 Subject: linux compile and imgs --- game/view.cpp | 412 +++++++++++++++++++++++++++++----------------------------- 1 file changed, 206 insertions(+), 206 deletions(-) (limited to 'game/view.cpp') diff --git a/game/view.cpp b/game/view.cpp index 190bd53..1542fa5 100644 --- a/game/view.cpp +++ b/game/view.cpp @@ -1,207 +1,207 @@ -#include "view.h" - -void View::process (Gst &gst, vec2 cam, vec2 mouse, int *mheld) { - Ground &gr = gst.inv->ground; - std::vector &entities = gst.entities; - - vec2 absmouse { mouse }; - absmouse -= cam; - - cursor_ground = -1; - cursor_entity = -1; - back = -1; - opt = -1; - hover_ground = -1; - - bool hfound = false; - for (int y=0; y 0 && !found) { - for (int i=0; iunit == 1) { - valid = 0; - } - } - if (!valid) continue; - vec2 pos { (float)x*32, (float)y*32 }; - if (pos.x < absmouse.x && absmouse.x <= pos.x+32 - && pos.y < absmouse.y && absmouse.y <= pos.y+32) - { - cursor_ground = moves[i]; - } - } - found = true; - } - - if (attacks.size() > 0 && !found) { - for (int i=0; i 0 && !found) { - for (int i=0; i 0 && !found) { - for (int i=0; iunit == 1) { - found = true; - } - } - } - if (cursor_entity != -1) found = true; - - for (int y=0; yground; + std::vector &entities = gst.entities; + + vec2 absmouse { mouse }; + absmouse -= cam; + + cursor_ground = -1; + cursor_entity = -1; + back = -1; + opt = -1; + hover_ground = -1; + + bool hfound = false; + for (int y=0; y 0 && !found) { + for (int i=0; iunit == 1) { + valid = 0; + } + } + if (!valid) continue; + vec2 pos { (float)x*32, (float)y*32 }; + if (pos.x < absmouse.x && absmouse.x <= pos.x+32 + && pos.y < absmouse.y && absmouse.y <= pos.y+32) + { + cursor_ground = moves[i]; + } + } + found = true; + } + + if (attacks.size() > 0 && !found) { + for (int i=0; i 0 && !found) { + for (int i=0; i 0 && !found) { + for (int i=0; iunit == 1) { + found = true; + } + } + } + if (cursor_entity != -1) found = true; + + for (int y=0; y