/* Outside.c                    */
/* Modified by R Griffin        */

#include "Popcorn:h.Popcorn"

BOOL Popcorn_Outside(struct game_object *obj, struct window *win) {
  register int x, y;
  if (obj->flags.bits.plot_offset) {
    x = (obj->x + plot_offset.x) >> 12;
    y = (obj->y + plot_offset.y) >> 12;
  } else {
    x = obj->x >> 12;
    y = obj->y >> 12;
  }
  if (x < win->x0 || x > win->x1 || y < win->y0 || y > win->y1) return TRUE;
  return FALSE;
}

BOOL Popcorn_DustOutside(struct dust_object *obj, struct window *win) {
  register int x, y;
  if (obj->flags.bits.plot_offset) {
    x = (obj->x + plot_offset.x) >> 12;
    y = (obj->y + plot_offset.y) >> 12;
  } else {
    x = obj->x >> 12;
    y = obj->y >> 12;
  }
  if (x < win->x0 || x > win->x1 || y < win->y0 || y > win->y1) return TRUE;
  return FALSE;
}
