3
*************************************************************************
5
ArmageTron -- Just another Tron Lightcycle Game in 3D.
6
Copyright (C) 2000 Manuel Moos (manuel@moosnet.de)
8
**************************************************************************
10
This program is free software; you can redistribute it and/or
11
modify it under the terms of the GNU General Public License
12
as published by the Free Software Foundation; either version 2
13
of the License, or (at your option) any later version.
15
This program is distributed in the hope that it will be useful,
16
but WITHOUT ANY WARRANTY; without even the implied warranty of
17
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
GNU General Public License for more details.
20
You should have received a copy of the GNU General Public License
21
along with this program; if not, write to the Free Software
22
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24
***************************************************************************
28
#include "eDebugLine.h"
37
static REAL se_r=1, se_g=1, se_b=1;
38
static REAL se_timeout=.1;
50
:r(se_r), g(se_g), b(se_b),
56
static eLineEntry& Create();
59
static tArray<eLineEntry> se_lines;
61
void eLineEntry::Delete()
64
*this = se_lines(se_lines.Len()-1);
67
if (se_lines.Len() > 0)
68
se_lines.SetLen(se_lines.Len()-1);
71
eLineEntry& eLineEntry::Create()
73
eLineEntry& ret = se_lines[se_lines.Len()];
74
ret.index = se_lines.Len()-1;
75
ret.timeout = se_timeout;
83
void eDebugLine::Update(REAL ts)
85
for (int i = se_lines.Len()-1; i>=0; i--)
87
eLineEntry& entry = se_lines(i);
89
if (entry.timeout < 0)
95
void eDebugLine::Render()
99
glDisable(GL_TEXTURE_2D);
100
glDisable(GL_LIGHTING);
102
for (int i = se_lines.Len()-1; i>=0; i--)
104
eLineEntry& entry = se_lines(i);
105
Color(entry.r, entry.g, entry.b);
106
Vertex(entry.start.x, entry.start.y, entry.startH);
107
Vertex(entry.stop.x, entry.stop.y, entry.stopH);
114
void eDebugLine::SetColor(REAL r, REAL g, REAL b)
121
void eDebugLine::SetTimeout(REAL time)
126
void eDebugLine::ResetOptions()
134
void eDebugLine::Draw(const eCoord& start, REAL startH,
135
const eCoord& stop , REAL stopH)
138
eLineEntry& line = eLineEntry::Create();
140
line.startH = startH;