From 3451b7a13b7a2567c960022111c0f9617fbc7340 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Thu, 20 Aug 2009 12:51:15 +0000 Subject: initialize unitialized variables --- src/game/base/jumppoint.cc | 11 +++++++---- src/render/text.cc | 4 +++- src/ui/scrollpane.cc | 1 + 3 files changed, 11 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/game/base/jumppoint.cc b/src/game/base/jumppoint.cc index 5b4e689..270275f 100644 --- a/src/game/base/jumppoint.cc +++ b/src/game/base/jumppoint.cc @@ -82,6 +82,8 @@ JumpGate::JumpGate() : JumpPoint() entity_moduletypeid = jumpgate_enttype; entity_state = core::Entity::NoPower; + + jumpgate_timer = 0; } JumpGate::~JumpGate() @@ -143,12 +145,13 @@ void JumpGate::activate() void JumpGate::frame(float elapsed) { - if (jumpgate_timer > 0) + if (jumpgate_timer > 0) { jumpgate_timer -= elapsed; - if (jumpgate_timer < 0) { - set_state(core::Entity::NoPower); - jumpgate_timer = 0; + if (jumpgate_timer < 0) { + set_state(core::Entity::NoPower); + jumpgate_timer = 0; + } } } diff --git a/src/render/text.cc b/src/render/text.cc index cd169b5..bfa1474 100644 --- a/src/render/text.cc +++ b/src/render/text.cc @@ -30,6 +30,8 @@ void Text::init() base_color[5] = new math::Color(0, 1, 1); base_color[6] = new math::Color(1, 0, 1); base_color[7] = new math::Color(1, 1, 1); + base_color[8] = new math::Color(1, 1, 1); + base_color[9] = new math::Color(1, 1, 1); for (size_t i = 0; i < 26; i++) { core_color[i] = new math::Color(.75, .75, .75); @@ -51,7 +53,7 @@ void Text::init() void Text::shutdown() { - for (size_t i = 0; i < 7; i++) { + for (size_t i = 0; i < 10; i++) { delete base_color[i]; base_color[i] = 0; } diff --git a/src/ui/scrollpane.cc b/src/ui/scrollpane.cc index 463956d..38260e0 100644 --- a/src/ui/scrollpane.cc +++ b/src/ui/scrollpane.cc @@ -17,6 +17,7 @@ ScrollPane::ScrollPane(Widget *parent, ui::Text &text) : Widget(parent), scrollp { set_label("scrollpane"); set_alignment(AlignBottom); + scrollpane_scroll = 0; } ScrollPane::~ScrollPane() -- cgit v1.2.3