-
Notifications
You must be signed in to change notification settings - Fork 4
/
SAVELINE.H
42 lines (37 loc) · 1.23 KB
/
SAVELINE.H
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//**************************************************************
// S a v e L i n e . h
// Class implementation
// John Coulthard
// Copyright (c) 1993 - 1999 by John Coulthard
//**************************************************************
#ifndef SAVELINE_H
#define SAVELINE_H
static const long SaveLineMax = 10000000,
SaveLineBlock =2000;
class SaveLineType
{ private:
struct LineType
{
int x;
int y;
int pen;
} ;
LineType *array[SaveLineMax/SaveLineBlock] ;
long size;
int xmax, xmin, ymax, ymin;
public:
SaveLineType();
~SaveLineType();
void SetNext( const int x, const int y, const unsigned char pen );
void Reset();
long Size() { return size; }
long MaxSize() { return SaveLineMax; }
int xMax() { return xmax; }
int xMin() { return xmin; }
int yMax() { return ymax; }
int yMin() { return ymin; }
int Pen( long i ) { return array[i/SaveLineBlock][i%SaveLineBlock].pen; }
int x( long i) { return array[i/SaveLineBlock][i%SaveLineBlock].x; }
int y( long i) { return array[i/SaveLineBlock][i%SaveLineBlock].y; }
};
#endif