|
From: Markus R. <god...@us...> - 2009-11-13 09:54:16
|
Module: performous
Branch: master
Commit: caf0838f4e338537526c365e02b17c11788fc992
Author: Markus Raab <un...@ma...>
Date: Fri Nov 13 10:52:09 2009 +0100
large constructor should not be implicit inline
remove some header dependencies:
- work fine with boost::scoped_ptr
- work fine with boost::shared_ptr
- but does *not* work with boost::ptr_vector
---
game/player.cc | 7 +++++++
game/player.hh | 11 ++++++-----
game/screen_players.cc | 4 ++++
game/screen_players.hh | 12 +++++++-----
game/screen_sing.cc | 4 ++++
game/screen_sing.hh | 10 +++++-----
game/songs.cc | 2 ++
game/songs.hh | 7 ++++---
8 files changed, 39 insertions(+), 18 deletions(-)
diff --git a/game/player.cc b/game/player.cc
index 618ed3f..51d5bcf 100644
--- a/game/player.cc
+++ b/game/player.cc
@@ -1,7 +1,14 @@
#include "player.hh"
+#include "song.hh"
#include "engine.hh" // just for Engine::TIMESTEP
+Player::Player(Song& song, Analyzer& analyzer, size_t frames):
+ m_song(song), m_analyzer(analyzer), m_pitch(frames, std::make_pair(getNaN(),
+ -getInf())), m_pos(), m_score(), m_lineScore(), m_maxLineScore(), m_prevLineScore(-1),
+ m_feedbackFader(0.0, 2.0), m_activitytimer(), m_scoreIt(m_song.notes.begin())
+{ }
+
void Player::update() {
if (m_pos == m_pitch.size()) return; // End of song already
double beginTime = Engine::TIMESTEP * m_pos;
diff --git a/game/player.hh b/game/player.hh
index 9751435..bede5f0 100644
--- a/game/player.hh
+++ b/game/player.hh
@@ -1,11 +1,15 @@
#pragma once
-#include "song.hh"
#include "color.hh"
#include "pitch.hh"
#include "util.hh"
+#include "notes.hh"
#include "animvalue.hh"
+#include <string>
#include <vector>
+#include <utility>
+
+class Song;
/// player class
struct Player {
@@ -36,10 +40,7 @@ struct Player {
/// score iterator
Notes::const_iterator m_scoreIt;
/// constructor
- Player(Song& song, Analyzer& analyzer, size_t frames):
- m_song(song), m_analyzer(analyzer), m_pitch(frames, std::make_pair(getNaN(),
- -getInf())), m_pos(), m_score(), m_lineScore(), m_maxLineScore(), m_prevLineScore(-1),
- m_feedbackFader(0.0, 2.0), m_activitytimer(), m_scoreIt(m_song.notes.begin()) {}
+ Player(Song& song, Analyzer& analyzer, size_t frames);
/// prepares analyzer
void prepare() { m_analyzer.process(); }
/// updates player stats
diff --git a/game/screen_players.cc b/game/screen_players.cc
index 0bc80e1..48115aa 100644
--- a/game/screen_players.cc
+++ b/game/screen_players.cc
@@ -5,6 +5,10 @@
#include "database.hh"
#include "fs.hh"
#include "util.hh"
+#include "layout_singer.hh"
+#include "theme.hh"
+#include "video.hh"
+
#include <iostream>
#include <sstream>
diff --git a/game/screen_players.hh b/game/screen_players.hh
index a78b025..5786d5b 100644
--- a/game/screen_players.hh
+++ b/game/screen_players.hh
@@ -5,14 +5,16 @@
#include "cachemap.hh"
#include "screen.hh"
#include "textinput.hh"
-#include "theme.hh"
-#include "video.hh"
-#include "hiscore.hh"
-#include "layout_singer.hh"
+class Song;
class Audio;
-class Database;
+class Video;
class Players;
+class Surface;
+class Database;
+class ThemeSongs;
+class LayoutSinger;
+
/** song chooser screen.
Database is passed as argument, but only the players is stored
diff --git a/game/screen_sing.cc b/game/screen_sing.cc
index f6c46ac..4c9d681 100644
--- a/game/screen_sing.cc
+++ b/game/screen_sing.cc
@@ -5,6 +5,10 @@
#include "configuration.hh"
#include "screen_players.hh"
#include "fs.hh"
+#include "database.hh"
+#include "video.hh"
+#include "guitargraph.hh"
+
#include <boost/format.hpp>
#include <boost/lexical_cast.hpp>
diff --git a/game/screen_sing.hh b/game/screen_sing.hh
index 298fb8b..10a8095 100644
--- a/game/screen_sing.hh
+++ b/game/screen_sing.hh
@@ -6,32 +6,32 @@
#include "layout_singer.hh"
#include "animvalue.hh"
#include "engine.hh"
-#include "guitargraph.hh"
#include "screen.hh"
#include "backgrounds.hh"
#include "theme.hh"
-#include "video.hh"
#include "surface.hh"
#include "opengl_text.hh"
#include "progressbar.hh"
-#include "database.hh"
+#include "guitargraph.hh"
#include "screen_players.hh"
class Players;
class Audio;
class Capture;
+class Database;
+class Video;
/// shows score at end of song
class ScoreWindow {
public:
/// constructor
- ScoreWindow(Engine & e, Database & database);
+ ScoreWindow(Engine & e, Database& database);
/// draws ScoreWindow
void draw();
bool empty() { return m_database.cur.empty(); }
private:
- Database & m_database;
+ Database& m_database;
AnimValue m_pos;
Surface m_bg;
ProgressBar m_scoreBar;
diff --git a/game/songs.cc b/game/songs.cc
index 4a9c5a5..d6a4d64 100644
--- a/game/songs.cc
+++ b/game/songs.cc
@@ -2,6 +2,8 @@
#include "configuration.hh"
#include "fs.hh"
+#include "song.hh"
+#include "database.hh"
#include <boost/bind.hpp>
#include <boost/format.hpp>
diff --git a/game/songs.hh b/game/songs.hh
index ee5028b..7ae1545 100644
--- a/game/songs.hh
+++ b/game/songs.hh
@@ -2,8 +2,6 @@
#include "animvalue.hh"
#include "fs.hh"
-#include "song.hh"
-#include "database.hh"
#include <boost/shared_ptr.hpp>
#include <boost/scoped_ptr.hpp>
#include <boost/thread/mutex.hpp>
@@ -11,11 +9,14 @@
#include <set>
#include <vector>
+class Song;
+class Database;
+
/// songs class for songs screen
class Songs: boost::noncopyable {
public:
/// constructor
- Songs(Database & database, std::string const& songlist = std::string());
+ Songs(Database& database, std::string const& songlist = std::string());
~Songs();
/// updates filtered songlist
void update();
|