Public Member Functions | |
LagOMeterRenderer (gCycle *cycle) | |
void | render (REAL lag) |
Protected Member Functions | |
bool | drawTriangle (eCoord loc, int winding, REAL lag, int inc) |
returns whether the sprial intersects its counterpart | |
Private Attributes | |
DirectionTransformer | directions |
REAL | delay |
Colour | color |
Definition at line 3848 of file gCycle.cpp.
gLaggometer::LagOMeterRenderer::LagOMeterRenderer | ( | gCycle * | cycle | ) | [inline] |
Definition at line 3856 of file gCycle.cpp.
References sg_laggometerBlend.
03856 : 03857 LagOMeterRenderer(gCycle* cycle) : 03858 directions(cycle->Grid()), 03859 delay(cycle->GetTurnDelay()), 03860 color(cycle->Player()) 03861 { 03862 color.blend(sg_laggometerBlend, Colour::white); }
bool gLaggometer::LagOMeterRenderer::drawTriangle | ( | eCoord | loc, | |
int | winding, | |||
REAL | lag, | |||
int | inc | |||
) | [protected] |
returns whether the sprial intersects its counterpart
Definition at line 3867 of file gCycle.cpp.
Referenced by render().
03868 { 03869 eCoord outer = loc + directions.get(winding) * lag; 03870 if (outer.y * inc > 0.01f) { 03871 eCoord oldOuter = loc + directions.get(winding - inc) * lag; 03872 eCoord d = outer - oldOuter; 03873 outer = oldOuter + d * (-oldOuter.y / d.y); 03874 glVertex2f(outer.x, outer.y); 03875 return true; 03876 } else { 03877 glVertex2f(outer.x, outer.y); 03878 if (lag > delay) { 03879 if (drawTriangle(loc + directions.get(winding + inc) * delay, winding + inc, lag - delay, inc)) return true; 03880 } else { 03881 outer = loc + directions.get(winding + inc) * lag; 03882 glVertex2f(outer.x, outer.y); 03883 } 03884 glVertex2f(loc.x, loc.y); 03885 return false; 03886 }
void gLaggometer::LagOMeterRenderer::render | ( | REAL | lag | ) |
Definition at line 3888 of file gCycle.cpp.
References gLaggometer::DirectionTransformer::ahead(), BeginLineStrip(), color, directions, drawTriangle(), eCoord, RenderEnd(), and gLaggometer::Colour::toGl().
03889 { 03890 color.toGl(); 03891 BeginLineStrip(); 03892 drawTriangle(eCoord(0,0), directions.ahead(), lag, 1); 03893 RenderEnd(); 03894 03895 BeginLineStrip(); 03896 drawTriangle(eCoord(0,0), directions.ahead(), lag, -1); 03897 RenderEnd();
REAL gLaggometer::LagOMeterRenderer::delay [private] |
Definition at line 3851 of file gCycle.cpp.
Colour gLaggometer::LagOMeterRenderer::color [private] |
Definition at line 3852 of file gCycle.cpp.
Referenced by gLaggometer::AxesIndicator::AxesIndicator(), and render().