1
//------------------------------------------------------------------------
2
// PATH : storage for path points
3
//------------------------------------------------------------------------
5
// GL-Node Viewer (C) 2004-2007 Andrew Apted
7
// This program is free software; you can redistribute it and/or
8
// modify it under the terms of the GNU General Public License
9
// as published by the Free Software Foundation; either version 2
10
// of the License, or (at your option) any later version.
12
// This program is distributed in the hope that it will be useful,
13
// but WITHOUT ANY WARRANTY; without even the implied warranty of
14
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
// GNU General Public License for more details.
17
//------------------------------------------------------------------------
19
// this includes everything we need
25
path_c::path_c() : point_num(0), points(NULL)
41
path_c * path_c::ReadFile(const char *filename)
43
FILE *fp = fopen(filename, "r");
47
PrintWarn("Unable to open path file: %s\n", strerror(errno));
51
path_c *P = new path_c();
53
P->points = new int[MAX_PTS * 2];
55
for (P->point_num = 0; P->point_num < MAX_PTS; P->point_num++)
57
int *cur_pt = P->points + (P->point_num * 2);
59
if (fscanf(fp, " %d %d ", cur_pt, cur_pt+1) != 2)