#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; 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; iunit == 1) { found = true; } } } if (cursor_entity != -1) found = true; for (int y=0; y