/*
    ANTLand simulation
    (C) 2004 justin_sane

    This program is free software; you can redistribute it and/or
    modify it under the terms of the GNU General Public License
    as published by the Free Software Foundation; either version 2
    of the License, or (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

    Contact: justinsanemsu@msu.edu

    FILE: point.cpp
    Authors: justin_sane
*/

#include <math.h>

#include "landsimmain.h"
#include "point.h"



/* turns two floats into a points */
point __fastcall get_point (float x, float y)
{
    point tmp;
    tmp.x = x;
    tmp.y = y;
    return(tmp);
}
/* end of get_point */

/* turns two floats into a points */
intpoint __fastcall get_intpoint (int x, int y)
{
    intpoint tmp;
    tmp.x = x;
    tmp.y = y;
    return(tmp);
}
/* end of get_point */







face make_face( point3d *p1, point3d *p2,  point3d *p3,  point3d *p4, TColor c)
{
    face t;

    t.v[0] = p1;
    t.v[1] = p2;
    t.v[2] = p3;
    t.v[3] = p4;
    t.color = c;

    return(t);
}


/* turns two floats into a points */
point3d __fastcall get_point_3d (float x, float y, float z)
{
    point3d tmp;
    tmp.x = x;
    tmp.y = y;
    tmp.z = z;
    return(tmp);
}
/* end of get_point */


/* redefine add for points */
point operator+ (point a, point b)
{
    point t;
    t.x = a.x + b.x;
    t.y = a.y + b.y;
    return(t);
}
/* end of operator+ (point, point) */


/* redefine subtract for points */
point operator- (point a, point b)
{
    point t;
    t.x = a.x - b.x;
    t.y = a.y - b.y;
    return(t);
}
/* end of operator- (point, point) */


