From fdc3b72f44945342b6d1ff8eef259736ac8e45e3 Mon Sep 17 00:00:00 2001 From: Nick Gasson Date: Fri, 18 Jul 2008 18:16:46 +0100 Subject: [PATCH] Fix crash in high scores --- src/Emitter.cpp | 2 +- src/HighScores.cpp | 7 +++---- src/Ship.cpp | 15 +-------------- 3 files changed, 5 insertions(+), 19 deletions(-) diff --git a/src/Emitter.cpp b/src/Emitter.cpp index 2261bc9..cd75710 100644 --- a/src/Emitter.cpp +++ b/src/Emitter.cpp @@ -208,7 +208,7 @@ SmokeTrail::SmokeTrail() : Emitter(0, 0, 0.9f, 0.7f, 0.0f, false, 0.2f, 0.0f, 0.0f, - 0.3f, 0.0f, 5.0f, 0.001f) + 0.3f, 0.0f, 4.0f, 0.001f) { createrate = 64.0f; } diff --git a/src/HighScores.cpp b/src/HighScores.cpp index 408cc06..df16eef 100644 --- a/src/HighScores.cpp +++ b/src/HighScores.cpp @@ -200,13 +200,12 @@ void HighScores::Display() int y = opengl.GetHeight() - 60; largeFont.Print(x, y, hscont); + const char *name = input.GetInput(); const char *hsname = i18n("Name? %s"); - x = (opengl.GetWidth() - - largeFont.GetStringWidth(input.GetInput()) - - largeFont.GetStringWidth(hsname)) / 2; + x = (opengl.GetWidth() - largeFont.GetStringWidth(hsname, name)) / 2; y = (opengl.GetHeight() - 50) / 2; glColor4f(0.8f, 0.0f, 1.0f, flAlpha); - largeFont.Print(x, y, hsname, input.GetInput()); + largeFont.Print(x, y, hsname, name); } } diff --git a/src/Ship.cpp b/src/Ship.cpp index 827483d..c497e0a 100644 --- a/src/Ship.cpp +++ b/src/Ship.cpp @@ -44,22 +44,9 @@ void Ship::Display() const } void Ship::DrawExhaust() -{ - static double xlast, ylast; - - if (thrusting) { - if (sqrt(speedX*speedX + speedY*speedY) > 2.0f) { - exhaust.NewCluster - ((int)(exhaust.xpos + (exhaust.xpos - xlast)/2), - (int)(exhaust.ypos + (exhaust.ypos - ylast)/2)); - } - } - +{ exhaust.Draw((double)viewport->GetXAdjust(), (double)viewport->GetYAdjust()); - - xlast = exhaust.xpos; - ylast = exhaust.ypos; } void Ship::DrawExplosion() -- 2.39.2