/**********************************************************************
This file is part of Crack dot Com's free source code release of Golgotha.
for information about compiling & licensing issues visit this URL
 If that doesn't help, contact Jonathan Clark at 
  golgotha_source@usa.net (Subject should have "GOLG" in it) 
***********************************************************************/

#ifndef G1_MAP_VIS_HH
#define G1_MAP_VIS_HH

#include "arch.hh"
#include "math/num_type.hh"
#include "math/transform.hh"
#include "poly/poly.hh"

class i4_image16;

class g1_visible_projection
{
  i4_float cx1,cy1,cx2,cy2;
  i4_transform_class *trans;

public:
  // used by poly_clip template function
  i4_float intersect(i4_vertex_class *v1, i4_vertex_class *v2, int plane);
  void project(i4_vertex_class *v)
  {
    v->px=v->v.x;
    v->py=v->v.y;
  }
 
  enum { MAX_CELLS=3000 };

  struct point { i4_float x,y; };

  struct cell
  {
    w16 x,y;
    i4_float z;
  };

  cell list[MAX_CELLS];

  w32 t_cells;
  
  void add(w16 x, w16 y, i4_float z)
  {
    if (t_cells