|
From: Tapio V. <aa...@us...> - 2010-08-22 00:11:06
|
Module: performous
Branch: master
Commit: 7af171a7819d20b7bb29b70b6b3cbeef99b25906
Author: Tapio Vierros <tap...@gm...>
Date: Sun Aug 22 02:26:00 2010 +0300
Fix some minor style issues from static analysis.
---
game/dancegraph.cc | 3 +--
game/guitargraph.cc | 6 ++++--
game/instrumentgraph.cc | 1 +
game/joystick.hh | 2 +-
game/screen.hh | 2 +-
game/screen_practice.cc | 5 ++---
game/screenmanager.cc | 7 ++++++-
game/surface.cc | 2 +-
8 files changed, 17 insertions(+), 11 deletions(-)
diff --git a/game/dancegraph.cc b/game/dancegraph.cc
index 4155f13..f2f8eaf 100644
--- a/game/dancegraph.cc
+++ b/game/dancegraph.cc
@@ -91,9 +91,8 @@ DanceGraph::DanceGraph(Audio& audio, Song const& song):
m_insideStop()
{
// Initialize some arrays
- for(size_t i = 0; i < max_panels; i++) {
+ for (size_t i = 0; i < max_panels; i++) {
m_activeNotes[i] = m_notes.end();
- m_pressed[i] = false;
m_pressed_anim[i] = AnimValue(0.0, 4.0);
m_arrow_map[i] = -1;
}
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index 01f414b..7bf6429 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -118,8 +118,10 @@ GuitarGraph::GuitarGraph(Audio& audio, Song const& song, bool drums, int number,
m_samples.push_back("guitar fail5");
m_samples.push_back("guitar fail6");
}
- for (int i = 0; i < 6; ++i) m_pressed_anim[i].setRate(5.0);
- for (int i = 0; i < 5; ++i) m_holds[i] = 0;
+ for (size_t i = 0; i < max_panels; ++i) {
+ m_pressed_anim[i].setRate(5.0);
+ m_holds[i] = 0;
+ }
m_pads = 5;
m_track_index = m_instrumentTracks.begin();
while (number--)
diff --git a/game/instrumentgraph.cc b/game/instrumentgraph.cc
index 0bfed82..10d11ca 100644
--- a/game/instrumentgraph.cc
+++ b/game/instrumentgraph.cc
@@ -31,6 +31,7 @@ InstrumentGraph::InstrumentGraph(Audio& audio, Song const& song, input::DevType
{
m_popupText.reset(new SvgTxtThemeSimple(getThemePath("sing_popup_text.svg"), config["graphic/text_lod"].f()));
m_menuTheme.reset(new ThemeInstrumentMenu());
+ for (size_t i = 0; i < max_panels; ++i) m_pressed[i] = false;
}
diff --git a/game/joystick.hh b/game/joystick.hh
index f821e26..54ba501 100644
--- a/game/joystick.hh
+++ b/game/joystick.hh
@@ -51,7 +51,7 @@ namespace input {
class InputDevPrivate {
public:
- InputDevPrivate(const Instrument _instrument) : m_assigned(false), m_instrument(_instrument) {
+ InputDevPrivate(const Instrument& _instrument) : m_assigned(false), m_instrument(_instrument) {
for(unsigned int i = 0 ; i < BUTTONS ; i++) {
m_pressed[i] = false;
}
diff --git a/game/screen.hh b/game/screen.hh
index fb853af..839aae8 100644
--- a/game/screen.hh
+++ b/game/screen.hh
@@ -72,8 +72,8 @@ class ScreenManager: public Singleton <ScreenManager> {
float m_timeToFadeIn;
float m_timeToFadeOut;
float m_timeToShow;
+ std::string m_message;
AnimValue m_messagePopup;
SvgTxtTheme m_textMessage;
- std::string m_message;
};
diff --git a/game/screen_practice.cc b/game/screen_practice.cc
index 27d4e80..6d56289 100644
--- a/game/screen_practice.cc
+++ b/game/screen_practice.cc
@@ -16,9 +16,8 @@ void ScreenPractice::enter() {
theme.reset(new ThemePractice());
// draw vu meters
for (unsigned int i = 0, mics = m_audio.analyzers().size(); i < mics; ++i) {
- ProgressBar* b;
- m_vumeters.push_back(b = new ProgressBar(getThemePath("vumeter_bg.svg"), getThemePath("vumeter_fg.svg"), ProgressBar::VERTICAL, 0.136, 0.023));
- b->dimensions.screenBottom().left(-0.4 + i * 0.2).fixedWidth(0.04);
+ m_vumeters.push_back(new ProgressBar(getThemePath("vumeter_bg.svg"), getThemePath("vumeter_fg.svg"), ProgressBar::VERTICAL, 0.136, 0.023));
+ m_vumeters.back().dimensions.screenBottom().left(-0.4 + i * 0.2).fixedWidth(0.04);
}
m_samples.push_back("drum bass");
m_samples.push_back("drum snare");
diff --git a/game/screenmanager.cc b/game/screenmanager.cc
index 8cd9506..8c215cf 100644
--- a/game/screenmanager.cc
+++ b/game/screenmanager.cc
@@ -6,7 +6,12 @@
template<> ScreenManager* Singleton<ScreenManager>::ms_Singleton = NULL;
-ScreenManager::ScreenManager(Window& _window): m_window(_window), m_finished(false), currentScreen(), m_messagePopup(0.0, 1.0), m_textMessage(getThemePath("message_text.svg"), config["graphic/text_lod"].f()) {
+ScreenManager::ScreenManager(Window& _window):
+ m_window(_window), m_finished(false), newScreen(), currentScreen(),
+ m_timeToFadeIn(), m_timeToFadeOut(), m_timeToShow(), m_message(),
+ m_messagePopup(0.0, 1.0), m_textMessage(getThemePath("message_text.svg"), config["graphic/text_lod"].f())
+
+{
m_textMessage.dimensions.middle().screenTop(0.05);
}
diff --git a/game/surface.cc b/game/surface.cc
index 3e2ddcd..d95e0e9 100644
--- a/game/surface.cc
+++ b/game/surface.cc
@@ -52,7 +52,7 @@ Surface::Surface(std::string const& filename) { loader(*this, filename); }
// Stuff for converting pix::Format into OpenGL enum values
namespace {
struct PixFmt {
- PixFmt() {} // Required by std::map
+ PixFmt(): swap() {} // Required by std::map
PixFmt(GLenum f, GLenum t, bool s): format(f), type(t), swap(s) {}
GLenum format;
GLenum type;
|