You can subscribe to this list here.
| 2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(25) |
Jul
(288) |
Aug
(119) |
Sep
(31) |
Oct
(59) |
Nov
(458) |
Dec
(359) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2010 |
Jan
(268) |
Feb
(26) |
Mar
(36) |
Apr
(48) |
May
(119) |
Jun
(37) |
Jul
(173) |
Aug
(429) |
Sep
(137) |
Oct
(156) |
Nov
(59) |
Dec
(45) |
| 2011 |
Jan
(398) |
Feb
(257) |
Mar
(49) |
Apr
(5) |
May
(34) |
Jun
(11) |
Jul
(38) |
Aug
(12) |
Sep
(1) |
Oct
(49) |
Nov
(5) |
Dec
(10) |
| 2012 |
Jan
(21) |
Feb
(32) |
Mar
(20) |
Apr
(1) |
May
(2) |
Jun
|
Jul
(173) |
Aug
|
Sep
(25) |
Oct
(6) |
Nov
(44) |
Dec
|
|
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();
|
|
From: Markus R. <god...@us...> - 2009-11-13 09:22:18
|
Module: performous
Branch: master
Commit: af9dc9799c9231f13c046e829b2e30995543a903
Author: Markus Raab <un...@ma...>
Date: Fri Nov 13 10:21:12 2009 +0100
path for pictures work again
like discussed pictures are placed below:
.local/share/games/performous/pictures
---
game/player.hh | 8 ++++----
game/players.cc | 7 ++++++-
game/screen_players.cc | 2 +-
3 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/game/player.hh b/game/player.hh
index ae808ea..9751435 100644
--- a/game/player.hh
+++ b/game/player.hh
@@ -65,11 +65,11 @@ struct Player {
Used for Players Management.
*/
struct PlayerItem {
- int id; /// unique identifier for this PlayerItem, Link to hiscore
+ int id; ///< unique identifier for this PlayerItem, Link to hiscore
- std::string name; /// name displayed and used for searching the player
- std::string path; /// a path to a picture shown
- std::string picture; /// + the filename for it
+ std::string name; ///< name displayed and used for searching the player
+ std::string picture; ///< the filename which was passed from xml (and is written back)
+ std::string path; ///< a full path to a picture shown, generated from picture above
/* Future ideas
std::string displayedName; /// artist name, short name, nick (can be changed)
std::map<std::string, int> scores; /// map between a Song and the highest score the Player achieved
diff --git a/game/players.cc b/game/players.cc
index 1a581e9..47188c6 100644
--- a/game/players.cc
+++ b/game/players.cc
@@ -89,7 +89,12 @@ void Players::addPlayer (std::string const& name, std::string const& picture, in
if (pi.picture != "") // no picture, so don't search path
{
- // pi.picture = getXdgPath(fs::path("pictures") / pi.picture);
+ try {
+ pi.path = getPath(fs::path("pictures") / pi.picture);
+ } catch (std::runtime_error const& e)
+ {
+ std::cerr << e.what() << std::endl;
+ }
}
m_dirty = true;
diff --git a/game/screen_players.cc b/game/screen_players.cc
index 03c352b..0bc80e1 100644
--- a/game/screen_players.cc
+++ b/game/screen_players.cc
@@ -129,7 +129,7 @@ void ScreenPlayers::draw() {
Surface* cover = 0;
if (player_display.path != "")
{
- try { cover = &m_covers[player_display.path + "/" + player_display.picture]; }
+ try { cover = &m_covers[player_display.path]; }
catch (std::exception const&) {}
}
Surface& s = (cover ? *cover : *m_emptyCover);
|
|
From: Markus R. <god...@us...> - 2009-11-13 09:22:17
|
Module: performous
Branch: master
Commit: a3789c1dc33930453e12b64640e4474e930d256e
Author: Markus Raab <un...@ma...>
Date: Fri Nov 13 09:45:11 2009 +0100
songlist not as global variable
---
game/main.cc | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/game/main.cc b/game/main.cc
index a863bfd..c73e4df 100644
--- a/game/main.cc
+++ b/game/main.cc
@@ -134,9 +134,7 @@ void audioSetup(Capture& capture, Audio& audio) {
if (!audio.isOpen()) std::cerr << "No playback devices could be used. Please use --pdev to define one." << std::endl;
}
-std::string songlist;
-
-void mainLoop() {
+void mainLoop(std::string const& songlist) {
try {
Capture capture;
Audio audio;
@@ -205,6 +203,7 @@ int main(int argc, char** argv) {
std::vector<std::string> songdirs;
namespace po = boost::program_options;
po::options_description opt1("Generic options");
+ std::string songlist;
opt1.add_options()
("help,h", "you are viewing it")
("version,v", "display version number")
@@ -288,7 +287,7 @@ int main(int argc, char** argv) {
confOverride(mics, "audio/capture");
confOverride(pdevs, "audio/playback");
// Run the game init and main loop
- mainLoop();
+ mainLoop(songlist);
return 0; // Do not remove. SDL_Main (which this function is called on some platforms) needs return statement.
}
|
|
From: Tapio V. <aa...@us...> - 2009-11-13 09:21:29
|
Module: performous
Branch: dance
Commit: 2abfb72d05d0c4132bb0ccab4c3f5898cc9bff4e
Author: Tapio Vierros <tap...@gm...>
Date: Fri Nov 13 11:19:31 2009 +0200
Ditched singer_layout for now, improved dance layout (cursor positioning).
---
game/dancegraph.cc | 55 ++++++++++++++++++++++++++++++++------------------
game/dancegraph.hh | 3 +-
game/screen_sing.cc | 6 ++--
3 files changed, 40 insertions(+), 24 deletions(-)
diff --git a/game/dancegraph.cc b/game/dancegraph.cc
index 3560c35..a335950 100644
--- a/game/dancegraph.cc
+++ b/game/dancegraph.cc
@@ -5,10 +5,9 @@
namespace {
const float past = -0.2f;
const float future = 1.8f;
- const float timescale = 15.0f;
- const float texCoordStep = -0.5f; // Two beat lines per neck texture => 0.5 tex units per beat
+ const float timescale = 25.0f;
// Note: t is difference from playback time so it must be in range [past, future]
- float time2y(float t) { return -timescale * (t - past) / (future - past); }
+ float time2y(float t) { return timescale * (t - past) / (future - past); }
float time2a(float t) {
float a = clamp(1.0 - t / future); // Note: we want 1.0 alpha already at zero t.
return std::pow(a, 0.8f); // Nicer curve
@@ -46,22 +45,22 @@ DanceGraph::DanceGraph(Audio& audio, Song const& song):
m_streak(),
m_longestStreak()
{
- //TODO
-
+ //TODO
+ m_arrow.dimensions.middle().center();
}
/// Handles input
void DanceGraph::engine() {
- //TODO
+ //TODO
}
/// Handles scoring and such
void DanceGraph::dance(double time, input::Event const& ev) {
- //TODO:
+ //TODO
}
@@ -77,13 +76,27 @@ glutil::Color const& DanceGraph::color(int arrow_i) const {
return arrowColors[arrow_i];
}
+namespace {
+ const float arrowRotations[4] = { 270.0f, 180.0f, 0.0f, 90.0f };
+
+
+}
+
+void DanceGraph::drawArrow(int arrow_i, float x, float y, float scale) {
+ glTranslatef(x, y, 0.0f);
+ glRotatef(arrowRotations[arrow_i], 0.0f, 0.0f, 1.0f);
+ if (scale != 1.0) glScalef(scale, scale, scale);
+ m_arrow.draw();
+ if (scale != 1.0) glScalef(1.0/scale, 1.0/scale, 1.0/scale);
+ glRotatef(-arrowRotations[arrow_i], 0.0f, 0.0f, 1.0f);
+ glTranslatef(-x, -y, 0.0f);
+}
/// Draws the dance graph
void DanceGraph::draw(double time) {
- static float arrowRotations[4] = { 90.0f, 180.0f, 0.0f, 270.0f };
-
Dimensions dimensions(1.0); // FIXME: bogus aspect ratio (is this fixable?)
- dimensions.screenBottom().middle(m_cx.get()).fixedWidth(m_width.get());
+ //dimensions.screenTop().middle(m_cx.get()).fixedWidth(m_width.get());
+ dimensions.screenCenter().middle(m_cx.get()).stretch(m_width.get(), 0.9);
double offsetX = 0.5 * (dimensions.x1() + dimensions.x2());
double frac = 0.75; // Adjustable: 1.0 means fully separated, 0.0 means fully attached
// Draw scores
@@ -94,10 +107,13 @@ void DanceGraph::draw(double time) {
m_text.draw(boost::lexical_cast<std::string>(unsigned(m_streak)) + "/"
+ boost::lexical_cast<std::string>(unsigned(m_longestStreak)));
}
+std::cout << "m" << dimensions.x1() << " " << dimensions.x2() << std::endl;
+std::cout << dimensions.y1() << " " << dimensions.y2() << std::endl;
glutil::PushMatrixMode pmm(GL_PROJECTION);
glTranslatef(frac * 2.0 * offsetX, 0.0f, 0.0f);
glutil::PushMatrixMode pmb(GL_MODELVIEW);
- glTranslatef((1.0 - frac) * offsetX, dimensions.y2(), 0.0f);
+ glTranslatef((1.0 - frac) * offsetX, dimensions.y1(), 0.0f);
+ //glTranslatef((1.0 - frac) * offsetX, 0.0f, 0.0f);
{ float s = dimensions.w() / 5.0f; glScalef(s, s, s); }
// Draw the notes
// TODO: iteration needs rewrite to the dancenotes structure
@@ -126,20 +142,19 @@ void DanceGraph::draw(double time) {
// TODO: suitable effect for pressing the arrows?
// TODO: effect possibilities: zooming, whitening, external glow
for (int arrow_i = 0; arrow_i < 4; ++arrow_i) {
- float x = -2.5f + arrow_i;
+ float x = -1.5f + arrow_i;
glColor4fv(color(arrow_i));
- glTranslatef(x, 0.0f, time2y(0.0));
- glRotatef(arrowRotations[arrow_i], 0.0f, 0.0f, 1.0f);
- m_arrow.draw();
- glRotatef(-arrowRotations[arrow_i], 0.0f, 0.0f, 1.0f);
- glTranslatef(-x, 0.0f, -time2y(0.0));
+ drawArrow(arrow_i, x, time2y(0.0), 0.6);
}
glColor3f(1.0f, 1.0f, 1.0f);
}
/// Draws a single note (or hold)
-void DanceGraph::drawNote(int fret, glutil::Color, float tBeg, float tEnd) {
- //TODO
-
+void DanceGraph::drawNote(int arrow_i, glutil::Color c, float tBeg, float tEnd) {
+ float x = -1.5f + arrow_i;
+ float yBeg = time2y(tBeg);
+ float yEnd = time2y(tEnd);
+ c.a = time2a(tBeg); glColor4fv(c);
+ drawArrow(arrow_i, x, time2y(tBeg));
}
diff --git a/game/dancegraph.hh b/game/dancegraph.hh
index c2b9c67..9ea6c20 100644
--- a/game/dancegraph.hh
+++ b/game/dancegraph.hh
@@ -29,8 +29,9 @@ class DanceGraph {
int getScore() const { return m_score * m_scoreFactor; }
private:
void dance(double time, input::Event const& ev);
- void drawNote(int fret, glutil::Color, float tBeg, float tEnd);
+ void drawNote(int arrow_i, glutil::Color, float tBeg, float tEnd);
glutil::Color const& color(int arrow_i) const ;
+ void drawArrow(int arrow_i, float x, float y, float scale = 1.0);
Audio& m_audio;
//input::InputDev m_input;
Song const& m_song;
diff --git a/game/screen_sing.cc b/game/screen_sing.cc
index 2f4c2b7..24e9a11 100644
--- a/game/screen_sing.cc
+++ b/game/screen_sing.cc
@@ -89,7 +89,7 @@ void ScreenSing::enter() {
if (true) {
while(true) {
try {
- //m_dancers.push_back(new DanceGraph(m_audio, *m_song));
+ m_dancers.push_back(new DanceGraph(m_audio, *m_song));
break; // REMOVEME
} catch (std::runtime_error&) { break; }
}
@@ -137,7 +137,7 @@ void ScreenSing::danceLayout(double time) {
double iw = std::min(0.5, 1.0 / m_dancers.size());
Dancers::size_type i = 0;
for (Dancers::iterator it = m_dancers.begin(); it != m_dancers.end(); ++it, ++i) {
- it->position(0.5 + (i * 0.5 * m_dancers.size()) * iw, iw);
+ it->position((0.5 + i - 0.5 * m_dancers.size()) * iw, iw);
it->engine();
it->draw(time);
}
@@ -270,7 +270,7 @@ void ScreenSing::draw() {
if( !m_dancers.empty() ) {
danceLayout(time);
- m_layout_singer->draw(time, LayoutSinger::LEFT);
+ //m_layout_singer->draw(time, LayoutSinger::LEFT);
} else if( m_instruments.empty() ) {
m_layout_singer->draw(time, LayoutSinger::BOTTOM);
} else {
|
|
From: Markus R. <god...@us...> - 2009-11-13 08:37:13
|
Module: performous
Branch: master
Commit: 6b0487c8fb2ae98e586b65f4017a82380a6eb4e7
Author: Markus Raab <un...@ma...>
Date: Fri Nov 13 09:34:31 2009 +0100
audio; video or background is shown in hiscore
---
game/screen_hiscore.cc | 51 +++++++++++++++++++++++++++++++++++++++++++++--
game/screen_hiscore.hh | 1 +
2 files changed, 49 insertions(+), 3 deletions(-)
diff --git a/game/screen_hiscore.cc b/game/screen_hiscore.cc
index a45b502..6dbe593 100644
--- a/game/screen_hiscore.cc
+++ b/game/screen_hiscore.cc
@@ -20,6 +20,18 @@ ScreenHiscore::ScreenHiscore(std::string const& name, Audio& audio, Database& da
}
void ScreenHiscore::enter() {
+ if (!m_song->background.empty()) {
+ try {
+ m_background.reset(new Surface(m_song->path + m_song->background, true));
+ } catch (std::exception& e) {
+ std::cerr << e.what() << std::endl;
+ }
+ }
+
+ if (!m_song->video.empty() && config["graphic/video"].b()) {
+ m_video.reset(new Video(m_song->path + m_song->video, m_song->videoGap));
+ }
+
m_score_text[0].reset(new SvgTxtThemeSimple(getThemePath("sing_score_text.svg"), config["graphic/text_lod"].f()));
m_score_text[1].reset(new SvgTxtThemeSimple(getThemePath("sing_score_text.svg"), config["graphic/text_lod"].f()));
m_score_text[2].reset(new SvgTxtThemeSimple(getThemePath("sing_score_text.svg"), config["graphic/text_lod"].f()));
@@ -29,7 +41,8 @@ void ScreenHiscore::enter() {
m_emptyCover.reset(new Surface(getThemePath("no_cover.svg"))); // TODO use persons head
m_search.text.clear();
m_players.setFilter(m_search.text);
- m_audio.fadeout();
+ // m_audio.fadeout();
+ m_audio.playMusic(m_song->music, false, 0.0, -1.0);
}
void ScreenHiscore::exit() {
@@ -97,12 +110,44 @@ void ScreenHiscore::drawScores() {
}
}
+namespace {
+
+ const double arMin = 1.33;
+ const double arMax = 2.35;
+
+ void fillBG() {
+ Dimensions dim(arMin);
+ dim.fixedWidth(1.0);
+ glutil::Begin block(GL_QUADS);
+ glVertex2f(dim.x1(), dim.y1());
+ glVertex2f(dim.x2(), dim.y1());
+ glVertex2f(dim.x2(), dim.y2());
+ glVertex2f(dim.x1(), dim.y2());
+ }
+
+}
+
void ScreenHiscore::draw() {
+ const double arMin = 1.33;
+ const double arMax = 2.35;
+
m_players.update(); // Poll for new players
double length = m_audio.getLength();
double time = clamp(m_audio.getPosition() - config["audio/video_delay"].f(), 0.0, length);
- if (m_songbg.get()) m_songbg->draw();
- if (m_video.get()) m_video->render(time);
+ time -= config["audio/video_delay"].f();
+
+ // Rendering starts
+ {
+ double ar = arMax;
+ if (m_background) {
+ ar = m_background->dimensions.ar();
+ if (ar > arMax || (m_video && ar > arMin)) fillBG(); // Fill white background to avoid black borders
+ m_background->draw();
+ } else fillBG();
+ if (m_video) { m_video->render(time); double tmp = m_video->dimensions().ar(); if (tmp > 0.0) ar = tmp; }
+ ar = clamp(ar, arMin, arMax);
+ }
+
theme->bg.draw();
std::string music, songbg, video;
double videoGap = 0.0;
diff --git a/game/screen_hiscore.hh b/game/screen_hiscore.hh
index 6d48f02..c8d7c6d 100644
--- a/game/screen_hiscore.hh
+++ b/game/screen_hiscore.hh
@@ -42,6 +42,7 @@ class ScreenHiscore : public Screen {
boost::scoped_ptr<Surface> m_songbg;
boost::scoped_ptr<Video> m_video;
boost::scoped_ptr<ThemeSongs> theme;
+ boost::scoped_ptr<Surface> m_background;
std::string m_playing;
std::string m_playReq;
AnimValue m_playTimer;
|
|
From: Markus R. <god...@us...> - 2009-11-13 08:23:27
|
Module: performous
Branch: master
Commit: 53b979b022c94894d7b59fe36010766c1a292ef4
Author: Markus Raab <un...@ma...>
Date: Fri Nov 13 09:18:21 2009 +0100
give error message for song hiscore without items
---
game/database.cc | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/game/database.cc b/game/database.cc
index cd91a9f..aa6c871 100644
--- a/game/database.cc
+++ b/game/database.cc
@@ -99,6 +99,14 @@ void Database::queryOverallHiscore (std::ostream & os, std::string const& track)
void Database::queryPerSongHiscore (std::ostream & os, boost::shared_ptr<Song> s, std::string const& track) const {
int songid = m_songs.lookup(s);
std::vector<HiscoreItem> hi = m_hiscores.queryHiscore(10, -1, songid, track);
+
+ if (songid == -1 || hi.size() == 0)
+ {
+ os << "No Items up to now.\n";
+ os << "Be the first to be listed here!\n";
+ return;
+ }
+
for (size_t i=0; i<hi.size(); ++i)
{
os << i+1 << ".\t"
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2009-11-12 23:26:53
|
Module: performous Branch: master Commit: a896f09f74c23713383a1483f709bcb6e691a183 Author: Lasse Karkkainen <tro...@tr...> Date: Fri Nov 13 01:27:03 2009 +0200 Merge branch 'master' of ssh://tronic@git.performous.org/gitroot/performous/performous --- |
|
From: Lasse Kärkkäi. <tr...@us...> - 2009-11-12 23:26:49
|
Module: performous
Branch: master
Commit: be4b8ba5d506b2317bcb82a162dba8d67d96921f
Author: Lasse Karkkainen <tro...@tr...>
Date: Fri Nov 13 01:26:37 2009 +0200
Fix OSX libpath
---
libs/libda/src/CMakeLists.txt | 2 +-
libs/plugin++/CMakeLists.txt | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/libs/libda/src/CMakeLists.txt b/libs/libda/src/CMakeLists.txt
index ddfbf8a..13e18b3 100644
--- a/libs/libda/src/CMakeLists.txt
+++ b/libs/libda/src/CMakeLists.txt
@@ -7,5 +7,5 @@ find_package(Boost 1.34 REQUIRED COMPONENTS thread filesystem)
include_directories(${Boost_INCLUDE_DIRS})
add_library(da SHARED audio.cpp)
target_link_libraries(da plugin++ ${Boost_LIBRARIES})
-set_target_properties(da PROPERTIES INSTALL_NAME_DIR @rpath/lib)
+set_target_properties(da PROPERTIES INSTALL_NAME_DIR @rpath)
install(TARGETS da DESTINATION lib${LIB_SUFFIX})
diff --git a/libs/plugin++/CMakeLists.txt b/libs/plugin++/CMakeLists.txt
index 7b84fcd..b85f1a3 100644
--- a/libs/plugin++/CMakeLists.txt
+++ b/libs/plugin++/CMakeLists.txt
@@ -19,7 +19,7 @@ if(NOT WIN32)
target_link_libraries(plugin++ dl)
endif()
-set_target_properties(plugin++ PROPERTIES INSTALL_NAME_DIR @rpath/lib)
+set_target_properties(plugin++ PROPERTIES INSTALL_NAME_DIR @rpath)
install(TARGETS plugin++ DESTINATION lib${LIB_SUFFIX})
FILE(GLOB HEADER_FILES "include/plugin++/*")
|
|
From: Tapio V. <aa...@us...> - 2009-11-12 21:43:51
|
Module: performous
Branch: master
Commit: 9ca9f60972693603d9b196d511adc98c957f4968
Author: Tapio Vierros <tap...@gm...>
Date: Thu Nov 12 23:43:14 2009 +0200
Only warn about overlapping notes in TXT file.
---
game/songparser-txt.cc | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/game/songparser-txt.cc b/game/songparser-txt.cc
index 9ba1c67..e2d32fa 100644
--- a/game/songparser-txt.cc
+++ b/game/songparser-txt.cc
@@ -134,7 +134,12 @@ bool SongParser::txtParseNote(std::string line) {
}
// Can we just make the previous note shorter?
if (p.begin <= n.begin) p.end = n.begin;
- else throw std::runtime_error("Note overlaps with earlier notes");
+ else { // Nothing to do, warn and skip
+ std::ostringstream oss;
+ oss << "WARNING: Skipping overlapping note in " << m_song.path << m_song.filename << std::endl;
+ std::cerr << oss.str(); // More likely to be atomic when written as one string
+ return true;
+ }
} else throw std::runtime_error("The first note has negative timestamp");
}
double prevtime = m_prevtime;
|
|
From: Tapio V. <aa...@us...> - 2009-11-12 21:20:25
|
Module: performous
Branch: master
Commit: 83a58d79dbad0294714ea8c03e292c78e900cf76
Author: Tapio Vierros <tap...@gm...>
Date: Thu Nov 12 23:17:22 2009 +0200
Reversed notes in midi file no longer produce error, only warning with count.
(A song could have perfectly fine tracks and a couple of missing notes shouldn't be fatal.)
---
game/songparser-ini.cc | 10 +++++++++-
game/songparser.hh | 2 +-
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/game/songparser-ini.cc b/game/songparser-ini.cc
index 5184e83..1e79706 100644
--- a/game/songparser-ini.cc
+++ b/game/songparser-ini.cc
@@ -86,6 +86,7 @@ void SongParser::iniParse() {
}
MidiFileParser midi(s.path + "/" + midifilename);
+ int reversedNoteCount = 0;
for (uint32_t ts = 0, end = midi.ts_last + midi.division; ts < end; ts += midi.division) s.beats.push_back(midi.get_seconds(ts));
for (MidiFileParser::Tracks::const_iterator it = midi.tracks.begin(); it != midi.tracks.end(); ++it) {
// Figure out the track name
@@ -113,7 +114,7 @@ void SongParser::iniParse() {
double beg = midi.get_seconds(it3->begin);
double end = midi.get_seconds(it3->end);
if (end == 0) continue; // Note with no ending
- if (beg > end) throw std::runtime_error("Reversed notes");
+ if (beg > end) { reversedNoteCount++; continue; } // Reversed note
if (drums) end = beg;
dur.push_back(Duration(beg, end));
durCount++;
@@ -196,6 +197,13 @@ void SongParser::iniParse() {
}
if (!s.notes.empty()) break;
}
+ if (reversedNoteCount > 0) {
+ std::ostringstream oss;
+ oss << "WARNING: Skipping " << reversedNoteCount << " reversed note(s) in ";
+ oss << s.path << midifilename << std::endl;
+ std::cerr << oss.str(); // More likely to be atomic when written as one string
+ }
+
/*if (s.notes.empty()) {
Note n;
n.begin = 30.0;
diff --git a/game/songparser.hh b/game/songparser.hh
index d17b147..da15550 100644
--- a/game/songparser.hh
+++ b/game/songparser.hh
@@ -50,7 +50,7 @@ class SongParser {
if (m_song.cover.empty() || (m_song.background.empty() && m_song.video.empty())) {
boost::regex coverfile("((cover|album|label|\\[co\\])\\.(png|jpeg|jpg|svg|bmp|gif))$", boost::regex_constants::icase);
boost::regex backgroundfile("((background|bg||\\[bg\\])\\.(png|jpeg|jpg|svg|bmp|gif))$", boost::regex_constants::icase);
- boost::regex videofile("(.*\\.(avi|mpg|mpeg|flv|mov))$", boost::regex_constants::icase);
+ boost::regex videofile("(.*\\.(avi|mpg|mpeg|flv|mov|mp4))$", boost::regex_constants::icase);
boost::cmatch match;
for (boost::filesystem::directory_iterator dirIt(s.path), dirEnd; dirIt != dirEnd; ++dirIt) {
|
|
From: Tapio V. <aa...@us...> - 2009-11-12 20:36:49
|
Module: performous
Branch: master
Commit: 63610f031e9e9391961849fa2a265a9a872e29b3
Author: Tapio Vierros <tap...@gm...>
Date: Thu Nov 12 22:35:20 2009 +0200
Currently selected song is preserved after initial loading/randomizing is complete.
---
game/songs.cc | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/game/songs.cc b/game/songs.cc
index 3b63876..4a9c5a5 100644
--- a/game/songs.cc
+++ b/game/songs.cc
@@ -116,8 +116,8 @@ void Songs::update() {
if (m_dirty) filter_internal();
// Shuffle the songlist if shuffle is finished and all songs are already filtered
if (m_needShuffle && !m_dirty) {
+ RestoreSel restore(*this);
randomize_internal();
- math_cover.setTarget(0, m_songs.size());
m_needShuffle = false;
}
}
|
|
From: Tapio V. <aa...@us...> - 2009-11-12 20:28:13
|
Module: performous
Branch: master
Commit: 40922f003360b145c10aac903b3117494895ecb6
Author: Tapio Vierros <tap...@gm...>
Date: Thu Nov 12 22:27:22 2009 +0200
Modified whammy effect.
---
game/guitargraph.cc | 14 ++++++++------
game/guitargraph.hh | 2 +-
2 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index 3152ea3..e437130 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -127,7 +127,8 @@ void GuitarGraph::engine() {
if (!m_drums && ev.type == input::Event::RELEASE) {
endHold(ev.button);
}
- if (!m_drums && ev.type == input::Event::WHAMMY) whammy = (1.0 + ev.button) / 2.0;
+ if (!m_drums && ev.type == input::Event::WHAMMY)
+ whammy = (1.0 + ev.button + 2.0*(rand()/double(RAND_MAX))) / 4.0;
if (ev.type == input::Event::PRESS) m_hit[!m_drums + ev.button].setValue(1.0);
else if (ev.type == input::Event::PICK) m_hit[0].setValue(1.0);
if (time < -0.5) {
@@ -470,10 +471,10 @@ void GuitarGraph::draw(double time) {
namespace {
const float fretWid = 0.5f;
- void vertexPair(float x, float y, glutil::Color c, float ty) {
+ void vertexPair(float x, float y, glutil::Color c, float ty, float fretW = fretWid) {
c.a = y2a(y); glColor4fv(c);
- glNormal3f(0.0f,1.0f,0.0f); glTexCoord2f(0.0f, ty); glVertex2f(x - fretWid, y);
- glNormal3f(0.0f,1.0f,0.0f); glTexCoord2f(1.0f, ty); glVertex2f(x + fretWid, y);
+ glNormal3f(0.0f,1.0f,0.0f); glTexCoord2f(0.0f, ty); glVertex2f(x - fretW, y);
+ glNormal3f(0.0f,1.0f,0.0f); glTexCoord2f(1.0f, ty); glVertex2f(x + fretW, y);
}
}
@@ -512,8 +513,9 @@ void GuitarGraph::drawNote(int fret, glutil::Color c, float tBeg, float tEnd, fl
vertexPair(x, y, c, 0.5f);
if (whammy > 0.1) {
while ((y -= fretWid) > yEnd + fretWid) {
- // The sin formula is pure magic
- vertexPair(x+sin((whammy-0.75)*6.0 + (yBeg-tEnd)/y)/3.0, y, c, 0.5f);
+ float r = rand() / double(RAND_MAX);
+ float r2 = rand() / double(RAND_MAX);
+ vertexPair(x+cos(y*whammy)/4.0+(r-0.5)/4.0, y, c, r2*0.30 + 0.20);
}
} else {
while ((y -= 10.0) > yEnd + fretWid) vertexPair(x, y, c, 0.5f);
diff --git a/game/guitargraph.hh b/game/guitargraph.hh
index f706090..44d12fd 100644
--- a/game/guitargraph.hh
+++ b/game/guitargraph.hh
@@ -95,7 +95,7 @@ class GuitarGraph {
int fret;
Duration const* dur;
double holdTime;
- Event(double t, int ty, int f = -1, Duration const* d = NULL): time(t), glow(0.0, 5.0), whammy(0.0, 0.4), type(ty), fret(f), dur(d), holdTime(d ? d->begin : getNaN()) { if (type > 0) glow.setValue(1.0); }
+ Event(double t, int ty, int f = -1, Duration const* d = NULL): time(t), glow(0.0, 5.0), whammy(0.0, 1.2), type(ty), fret(f), dur(d), holdTime(d ? d->begin : getNaN()) { if (type > 0) glow.setValue(1.0); }
};
typedef std::vector<Event> Events;
Events m_events;
|
|
From: Tapio V. <aa...@us...> - 2009-11-12 19:54:51
|
Module: performous
Branch: dance
Commit: 63fbebcd87caa4d113652bcd238d98f1ed86243b
Author: Tapio Vierros <tap...@gm...>
Date: Thu Nov 12 20:51:25 2009 +0200
WIP layout plus arrows are now rotated into correct orientations.
---
game/dancegraph.cc | 10 +++++++---
game/notegraph.cc | 4 ++--
game/screen_sing.cc | 4 ++--
3 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/game/dancegraph.cc b/game/dancegraph.cc
index 29ff8fa..3560c35 100644
--- a/game/dancegraph.cc
+++ b/game/dancegraph.cc
@@ -5,7 +5,7 @@
namespace {
const float past = -0.2f;
const float future = 1.8f;
- const float timescale = 25.0f;
+ const float timescale = 15.0f;
const float texCoordStep = -0.5f; // Two beat lines per neck texture => 0.5 tex units per beat
// Note: t is difference from playback time so it must be in range [past, future]
float time2y(float t) { return -timescale * (t - past) / (future - past); }
@@ -80,6 +80,8 @@ glutil::Color const& DanceGraph::color(int arrow_i) const {
/// Draws the dance graph
void DanceGraph::draw(double time) {
+ static float arrowRotations[4] = { 90.0f, 180.0f, 0.0f, 270.0f };
+
Dimensions dimensions(1.0); // FIXME: bogus aspect ratio (is this fixable?)
dimensions.screenBottom().middle(m_cx.get()).fixedWidth(m_width.get());
double offsetX = 0.5 * (dimensions.x1() + dimensions.x2());
@@ -126,9 +128,11 @@ void DanceGraph::draw(double time) {
for (int arrow_i = 0; arrow_i < 4; ++arrow_i) {
float x = -2.5f + arrow_i;
glColor4fv(color(arrow_i));
- m_arrow.dimensions.center(time2y(0.0)).middle(x);
+ glTranslatef(x, 0.0f, time2y(0.0));
+ glRotatef(arrowRotations[arrow_i], 0.0f, 0.0f, 1.0f);
m_arrow.draw();
- //float l = m_hit[fret + !m_drums].get();
+ glRotatef(-arrowRotations[arrow_i], 0.0f, 0.0f, 1.0f);
+ glTranslatef(-x, 0.0f, -time2y(0.0));
}
glColor3f(1.0f, 1.0f, 1.0f);
}
diff --git a/game/notegraph.cc b/game/notegraph.cc
index 6166330..4285358 100644
--- a/game/notegraph.cc
+++ b/game/notegraph.cc
@@ -87,7 +87,7 @@ void NoteGraph::draw(double time, Players const& players, Position position) {
dimensions.stretch(1.0, 0.25).bottom(0.0);
break;
case NoteGraph::LEFT:
- dimensions.stretch(0.50, 0.50).center().left();
+ dimensions.stretch(0.50, 0.50).center().left(-0.5);
break;
case NoteGraph::RIGHT:
dimensions.stretch(0.50, 0.50).center().right();
@@ -111,7 +111,7 @@ void NoteGraph::drawNotes() {
m_notealpha = 0.0f;
} else {
glColor4f(1.0, 1.0, 1.0, m_notealpha);
- m_notelines.draw(Dimensions().stretch(1.0, (m_max - m_min - 13) * m_noteUnit).middle(dimensions.xc()).center(dimensions.yc()), TexCoords(0.0, (-m_min - 7.0) / 12.0f, 1.0, (-m_max + 6.0) / 12.0f));
+ m_notelines.draw(Dimensions().stretch(dimensions.w(), (m_max - m_min - 13) * m_noteUnit).middle(dimensions.xc()).center(dimensions.yc()), TexCoords(0.0, (-m_min - 7.0) / 12.0f, 1.0, (-m_max + 6.0) / 12.0f));
// Draw notes
for (Notes::const_iterator it = m_songit; it != m_song.notes.end() && it->begin < m_time - (baseLine - 0.5) / pixUnit; ++it) {
diff --git a/game/screen_sing.cc b/game/screen_sing.cc
index a16dbb2..2f4c2b7 100644
--- a/game/screen_sing.cc
+++ b/game/screen_sing.cc
@@ -89,7 +89,7 @@ void ScreenSing::enter() {
if (true) {
while(true) {
try {
- m_dancers.push_back(new DanceGraph(m_audio, *m_song));
+ //m_dancers.push_back(new DanceGraph(m_audio, *m_song));
break; // REMOVEME
} catch (std::runtime_error&) { break; }
}
@@ -137,7 +137,7 @@ void ScreenSing::danceLayout(double time) {
double iw = std::min(0.5, 1.0 / m_dancers.size());
Dancers::size_type i = 0;
for (Dancers::iterator it = m_dancers.begin(); it != m_dancers.end(); ++it, ++i) {
- it->position((0.5 + i - 0.25 * m_dancers.size()) * iw, iw);
+ it->position(0.5 + (i * 0.5 * m_dancers.size()) * iw, iw);
it->engine();
it->draw(time);
}
|
|
From: Jaakko N. <jni...@us...> - 2009-11-12 19:39:35
|
Module: performous
Branch: dance
Commit: bf7bccbabcd77b071a13d7c9d8086937a5101947
Author: Jaakko Nikkola <jaa...@tk...>
Date: Thu Nov 12 21:38:44 2009 +0200
Some problems fixed (should compile)
---
game/notes.cc | 2 +-
game/notes.hh | 2 +-
game/songparser-sm.cc | 13 ++++++-------
game/songparser.hh | 4 ++--
4 files changed, 10 insertions(+), 11 deletions(-)
diff --git a/game/notes.cc b/game/notes.cc
index e8e8ab2..6e307c4 100644
--- a/game/notes.cc
+++ b/game/notes.cc
@@ -78,7 +78,7 @@ double Note::scoreMultiplier(double error) const {
Duration::Duration(): begin(getNaN()), end(getNaN()) {}
-DanceTrack::DanceTrack(std::string d, DanceChords c) : description(d), chords(c) {}
+DanceTrack::DanceTrack(std::string& d, DanceChords& c) : description(d), chords(c) {}
diff --git a/game/notes.hh b/game/notes.hh
index 5bd2e09..3af625f 100644
--- a/game/notes.hh
+++ b/game/notes.hh
@@ -102,11 +102,11 @@ typedef std::vector<DanceChord> DanceChords;
struct DanceTrack {
+ DanceTrack(std::string& d, DanceChords& c);
//track description
std::string description;
//container for the actual note data
DanceChords chords;
- DanceTrack(std::string d, DanceChords c);
};
enum DanceDifficulty {
diff --git a/game/songparser-sm.cc b/game/songparser-sm.cc
index e13a209..441edd8 100644
--- a/game/songparser-sm.cc
+++ b/game/songparser-sm.cc
@@ -57,18 +57,17 @@ bool SongParser::smParseField(std::string line) {
if (key == "NOTES") {
//temporary containers for note data
- DanceTrackMap danceTrackMap;
+ DanceDifficultyMap danceDifficultyMap;
DanceChords chords;
//Note values are analyzed here. Values are:
//<NotesType>:
if(!getline(line)) { throw std::runtime_error("Required note data missing"); }
- std::string notestype = boost::trim_copy(line.substr(0, line.size() -1);
+ std::string notestype = boost::trim_copy(line.substr(0, line.size() -1));
//<Description>:
if(!getline(line)) { throw std::runtime_error("Required note data missing"); }
std::string description = boost::trim_copy(line.substr(0, line.size() -1));
- m_song.dance_data.addDescription(description);
//<DifficultyClass>:
if(!getline(line)) { throw std::runtime_error("Required note data missing"); }
std::string difficultyclass = boost::trim_copy(line.substr(0, line.size() -1));
@@ -92,8 +91,8 @@ bool SongParser::smParseField(std::string line) {
while (getline(line) && smParseNote(line, chords)) {}
DanceTrack danceTrack(description, chords);
- danceTrackMap[danceDifficulty] = danceTrack;
- m_song.danceTracks[notestype] = danceTrackMap;
+// danceDifficultyMap[danceDifficulty] = danceTrack;
+// m_song.danceTracks[notestype] = danceDifficultyMap;
return true;
}
@@ -145,8 +144,8 @@ bool SongParser::smParseNote(std::string line, DanceChords chords){
dur = 4 * ( 1/(m_bpm/60) ) / lcount; //counts one note duration in seconds;
for(int j = count - lcount; j<count ; j++) {
for(int i = 0; i<4; i++) {
- if(chords[j][i]) chords[j][i].begin = tm;
- if(chords[j][i]) chords[j][i].end = tm;
+ // if((chords[j])[i]) (chords[j])[i].begin = tm;
+ // if((chords[j])[i]) (chords[j])[i].end = tm;
}
tm += dur;
diff --git a/game/songparser.hh b/game/songparser.hh
index 5d1db07..b95e93c 100644
--- a/game/songparser.hh
+++ b/game/songparser.hh
@@ -96,8 +96,8 @@ class SongParser {
void iniParse();
bool smCheck(std::vector<char> const& data);
void smParse();
- bool smParseField(std::string& line);
- bool smParseNote(std::string& line);
+ bool smParseField(std::string line);
+ bool smParseNote(std::string line, DanceChords chords);
double m_prevtime;
unsigned int m_prevts;
unsigned int m_relativeShift;
|
|
From: Jaakko N. <jni...@us...> - 2009-11-12 19:08:30
|
Module: performous
Branch: dance
Commit: 91c36eae3510a69821a155ec69e3a2b48dcb7678
Author: Jaakko Nikkola <jaa...@tk...>
Date: Thu Nov 12 21:07:03 2009 +0200
typedef correction (Chord and Chords for sm-parser to DanceChord DanceChords)
---
game/notes.cc | 2 +-
game/notes.hh | 8 ++++----
game/songparser-sm.cc | 10 +++++-----
3 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/game/notes.cc b/game/notes.cc
index 29d00ae..e8e8ab2 100644
--- a/game/notes.cc
+++ b/game/notes.cc
@@ -78,7 +78,7 @@ double Note::scoreMultiplier(double error) const {
Duration::Duration(): begin(getNaN()), end(getNaN()) {}
-DanceTrack::DanceTrack(std::string d, Chords c) : description(d), chords(c) {}
+DanceTrack::DanceTrack(std::string d, DanceChords c) : description(d), chords(c) {}
diff --git a/game/notes.hh b/game/notes.hh
index 5f2ba88..5bd2e09 100644
--- a/game/notes.hh
+++ b/game/notes.hh
@@ -97,16 +97,16 @@ struct Note {
typedef std::vector<Note> Notes;
//container for dance songs
-typedef std::map<int, Note> Chord; //int indicates "arrow" position (cmp. fret in guitar)
-typedef std::vector<Chord> Chords;
+typedef std::map<int, Note> DanceChord; //int indicates "arrow" position (cmp. fret in guitar)
+typedef std::vector<DanceChord> DanceChords;
struct DanceTrack {
//track description
std::string description;
//container for the actual note data
- Chords chords;
- DanceTrack(std::string d, Chords c);
+ DanceChords chords;
+ DanceTrack(std::string d, DanceChords c);
};
enum DanceDifficulty {
diff --git a/game/songparser-sm.cc b/game/songparser-sm.cc
index 21bc5f5..e13a209 100644
--- a/game/songparser-sm.cc
+++ b/game/songparser-sm.cc
@@ -58,7 +58,7 @@ bool SongParser::smParseField(std::string line) {
//temporary containers for note data
DanceTrackMap danceTrackMap;
- Chords chords;
+ DanceChords chords;
//Note values are analyzed here. Values are:
@@ -130,7 +130,7 @@ bool SongParser::smParseField(std::string line) {
return true;
}
-bool SongParser::smParseNote(std::string line, Chords chords){
+bool SongParser::smParseNote(std::string line, DanceChords chords){
if(line.empty()) return true;
if(line[0] == '#') throw std::runtime_error("Key found in the middle of notes");
if(line[0] == ';') return false; //end mark
@@ -145,8 +145,8 @@ bool SongParser::smParseNote(std::string line, Chords chords){
dur = 4 * ( 1/(m_bpm/60) ) / lcount; //counts one note duration in seconds;
for(int j = count - lcount; j<count ; j++) {
for(int i = 0; i<4; i++) {
- if(m_song.dance_chords[j][i]) m_song.dance_chords[j][i].begin = tm;
- if(m_song.dance_chords[j][i]) m_song.dance_chords[j][i].end = tm;
+ if(chords[j][i]) chords[j][i].begin = tm;
+ if(chords[j][i]) chords[j][i].end = tm;
}
tm += dur;
@@ -157,7 +157,7 @@ bool SongParser::smParseNote(std::string line, Chords chords){
//reading notes into a chord
std::istringstream iss(line);
- Chord chord;
+ DanceChord chord;
for(int i =1; i <= 4; i++){
if(iss.get() == '1') {
Note note;
|
|
From: Jaakko N. <jni...@us...> - 2009-11-12 16:58:56
|
Module: performous Branch: dance Commit: e7b4fdc832facdc8b9033c344dfff3ec40a49cdf Author: Jaakko Nikkola <jaa...@tk...> Date: Thu Nov 12 18:58:00 2009 +0200 Merge branch 'dance' of jni...@gi...:/gitroot/performous/performous into dance --- |
|
From: Jaakko N. <jni...@us...> - 2009-11-12 16:58:55
|
Module: performous
Branch: dance
Commit: d34c7790df4d36be5cfb1b3937425ad0da90ee8a
Author: Jaakko Nikkola <jaa...@tk...>
Date: Thu Nov 12 18:54:22 2009 +0200
minor corrections
---
game/songparser-sm.cc | 13 ++++++++++---
1 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/game/songparser-sm.cc b/game/songparser-sm.cc
index cc4d6eb..21bc5f5 100644
--- a/game/songparser-sm.cc
+++ b/game/songparser-sm.cc
@@ -72,7 +72,14 @@ bool SongParser::smParseField(std::string line) {
//<DifficultyClass>:
if(!getline(line)) { throw std::runtime_error("Required note data missing"); }
std::string difficultyclass = boost::trim_copy(line.substr(0, line.size() -1));
-
+ //enum
+ DanceDifficulty danceDifficulty;
+ if(difficultyclass == "BEGINNER") danceDifficulty = BEGINNER;
+ if(difficultyclass == "EASY") danceDifficulty = EASY;
+ if(difficultyclass == "MEDIUM") danceDifficulty = MEDIUM;
+ if(difficultyclass == "HARD") danceDifficulty = HARD;
+ if(difficultyclass == "CHALLENGE") danceDifficulty = CHALLENGE;
+
//ignoring difficultymeter and radarvalues
//<DifficultyMeter>:
if(!getline(line)) { throw std::runtime_error("Required note data missing"); }
@@ -84,8 +91,8 @@ bool SongParser::smParseField(std::string line) {
//<NoteData>:
while (getline(line) && smParseNote(line, chords)) {}
- DanceTrack danceTrack(difficultyclass, chords);
- danceTrackMap[difficultyclass] = danceTrack;
+ DanceTrack danceTrack(description, chords);
+ danceTrackMap[danceDifficulty] = danceTrack;
m_song.danceTracks[notestype] = danceTrackMap;
return true;
}
|
|
From: Tapio V. <aa...@us...> - 2009-11-12 16:34:53
|
Module: performous Branch: dance Commit: 0d745ff741c17e75d1d3c8d7c61aa0b498807d9d Author: Tapio Vierros <tap...@gm...> Date: Thu Nov 12 18:31:40 2009 +0200 Merge branch 'dance' of ssh://aave000@performous.git.sourceforge.net/gitroot/performous/performous into dance --- |
|
From: Tapio V. <aa...@us...> - 2009-11-12 16:34:45
|
Module: performous
Branch: dance
Commit: a4a666d03e892e9ee90609a7007bb7b704685e52
Author: Tapio Vierros <tap...@gm...>
Date: Thu Nov 12 18:29:08 2009 +0200
Various hacks, fixes and additions to get dancegraph to display something on screen.
(Everything is horrible, but it doesn't crash.)
---
game/dancegraph.cc | 45 +++++++++++++++++++++++++++++++++++++--------
game/dancegraph.hh | 2 +-
game/notegraph.cc | 4 ++--
game/screen_sing.cc | 23 +++++++++++++++++++++--
game/screen_sing.hh | 1 +
5 files changed, 62 insertions(+), 13 deletions(-)
diff --git a/game/dancegraph.cc b/game/dancegraph.cc
index 885f6fe..29ff8fa 100644
--- a/game/dancegraph.cc
+++ b/game/dancegraph.cc
@@ -1,19 +1,46 @@
#include "dancegraph.hh"
#include "fs.hh"
+
+namespace {
+ const float past = -0.2f;
+ const float future = 1.8f;
+ const float timescale = 25.0f;
+ const float texCoordStep = -0.5f; // Two beat lines per neck texture => 0.5 tex units per beat
+ // Note: t is difference from playback time so it must be in range [past, future]
+ float time2y(float t) { return -timescale * (t - past) / (future - past); }
+ float time2a(float t) {
+ float a = clamp(1.0 - t / future); // Note: we want 1.0 alpha already at zero t.
+ return std::pow(a, 0.8f); // Nicer curve
+ }
+ float y2a(float y) { return time2a(past - y / timescale * (future - past)); }
+ const double maxTolerance = 0.15;
+
+ // TODO: Use this or something else?
+ double points(double error) {
+ double score = 0.0;
+ if (error < maxTolerance) score += 15;
+ if (error < 0.1) score += 15;
+ if (error < 0.05) score += 15;
+ if (error < 0.03) score += 5;
+ return score;
+ }
+}
+
+
/// Constructor
DanceGraph::DanceGraph(Audio& audio, Song const& song):
m_audio(audio),
m_song(song),
- m_input(input::DANCEPAD),
- m_arrow("arrow.svg"),
+ //m_input(input::DANCEPAD),
+ m_arrow(getThemePath("arrow.svg")),
m_cx(0.0, 0.2),
m_width(0.5, 0.4),
m_stream(),
m_dead(1000),
m_text(getThemePath("sing_timetxt.svg"), config["graphic/text_lod"].f()),
m_correctness(0.0, 5.0),
- m_flow_direction(1);
+ m_flow_direction(1),
m_score(),
m_scoreFactor(),
m_streak(),
@@ -40,7 +67,7 @@ void DanceGraph::dance(double time, input::Event const& ev) {
glutil::Color const& DanceGraph::color(int arrow_i) const {
- static glutil::Color arrowColors[3] = {
+ static glutil::Color arrowColors[4] = {
glutil::Color(0.0f, 0.9f, 0.0f),
glutil::Color(0.9f, 0.0f, 0.0f),
glutil::Color(0.9f, 0.9f, 0.0f),
@@ -73,6 +100,7 @@ void DanceGraph::draw(double time) {
// Draw the notes
// TODO: iteration needs rewrite to the dancenotes structure
//for (Chords::const_iterator it = m_chords.begin(); it != m_chords.end(); ++it) {
+ /*
float tBeg = it->begin - time;
float tEnd = it->end - time;
if (tEnd < past) continue;
@@ -88,18 +116,19 @@ void DanceGraph::draw(double time) {
c.r += glow;
c.g += glow;
c.b += glow;
- drawNote(fret, c, tBeg, tEnd, whammy);
+ drawNote(fret, c, tBeg, tEnd);
}
+ */
//}
// Arrows on cursor
// TODO: suitable effect for pressing the arrows?
// TODO: effect possibilities: zooming, whitening, external glow
- for (int arrow_i = m_drums; arrow_i < 5; ++arrow_i) {
- float x = -2.0f + fret - 0.5f * m_drums;
+ for (int arrow_i = 0; arrow_i < 4; ++arrow_i) {
+ float x = -2.5f + arrow_i;
glColor4fv(color(arrow_i));
m_arrow.dimensions.center(time2y(0.0)).middle(x);
m_arrow.draw();
- float l = m_hit[fret + !m_drums].get();
+ //float l = m_hit[fret + !m_drums].get();
}
glColor3f(1.0f, 1.0f, 1.0f);
}
diff --git a/game/dancegraph.hh b/game/dancegraph.hh
index e4e1b73..c2b9c67 100644
--- a/game/dancegraph.hh
+++ b/game/dancegraph.hh
@@ -32,7 +32,7 @@ class DanceGraph {
void drawNote(int fret, glutil::Color, float tBeg, float tEnd);
glutil::Color const& color(int arrow_i) const ;
Audio& m_audio;
- input::InputDev m_input;
+ //input::InputDev m_input;
Song const& m_song;
Surface m_arrow;
AnimValue m_cx, m_width;
diff --git a/game/notegraph.cc b/game/notegraph.cc
index 893a948..6166330 100644
--- a/game/notegraph.cc
+++ b/game/notegraph.cc
@@ -87,10 +87,10 @@ void NoteGraph::draw(double time, Players const& players, Position position) {
dimensions.stretch(1.0, 0.25).bottom(0.0);
break;
case NoteGraph::LEFT:
- dimensions.stretch(0.50, 0.50).bottom(0.0);
+ dimensions.stretch(0.50, 0.50).center().left();
break;
case NoteGraph::RIGHT:
- dimensions.stretch(0.50, 0.50).bottom(0.0);
+ dimensions.stretch(0.50, 0.50).center().right();
break;
}
m_max = m_nlTop.get() + 7.0;
diff --git a/game/screen_sing.cc b/game/screen_sing.cc
index 7655716..a16dbb2 100644
--- a/game/screen_sing.cc
+++ b/game/screen_sing.cc
@@ -84,10 +84,13 @@ void ScreenSing::enter() {
}
}
// Load dance tracks
- if ( !m_song->danceTracks.empty() ) {
- while(1) {
+ //if ( !m_song->danceTracks.empty() ) {
+ m_dancers.push_back(new DanceGraph(m_audio, *m_song));
+ if (true) {
+ while(true) {
try {
m_dancers.push_back(new DanceGraph(m_audio, *m_song));
+ break; // REMOVEME
} catch (std::runtime_error&) { break; }
}
}
@@ -130,6 +133,21 @@ void ScreenSing::instrumentLayout(double time) {
}
}
+void ScreenSing::danceLayout(double time) {
+ double iw = std::min(0.5, 1.0 / m_dancers.size());
+ Dancers::size_type i = 0;
+ for (Dancers::iterator it = m_dancers.begin(); it != m_dancers.end(); ++it, ++i) {
+ it->position((0.5 + i - 0.25 * m_dancers.size()) * iw, iw);
+ it->engine();
+ it->draw(time);
+ }
+ if (time < -0.5) {
+ glColor4f(1.0f, 1.0f, 1.0f, clamp(-1.0 - 2.0 * time));
+ // TODO: help?
+ glColor3f(1.0f, 1.0f, 1.0f);
+ }
+}
+
void ScreenSing::exit() {
m_score_window.reset();
m_instruments.clear();
@@ -251,6 +269,7 @@ void ScreenSing::draw() {
}
if( !m_dancers.empty() ) {
+ danceLayout(time);
m_layout_singer->draw(time, LayoutSinger::LEFT);
} else if( m_instruments.empty() ) {
m_layout_singer->draw(time, LayoutSinger::BOTTOM);
diff --git a/game/screen_sing.hh b/game/screen_sing.hh
index bd31ccd..1846278 100644
--- a/game/screen_sing.hh
+++ b/game/screen_sing.hh
@@ -66,6 +66,7 @@ class ScreenSing: public Screen {
*/
void activateNextScreen();
void instrumentLayout(double time);
+ void danceLayout(double time);
Audio& m_audio;
Capture& m_capture;
Players& m_players;
|
|
From: Tapio V. <aa...@us...> - 2009-11-12 16:34:44
|
Module: performous
Branch: dance
Commit: b73e5d005897f161be858a00f18aded8623dac04
Author: Tapio Vierros <tap...@gm...>
Date: Thu Nov 12 17:19:25 2009 +0200
Some base for dance graphics from guitargraph.
---
game/dancegraph.cc | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++-
game/dancegraph.hh | 2 +
2 files changed, 64 insertions(+), 2 deletions(-)
diff --git a/game/dancegraph.cc b/game/dancegraph.cc
index 3a4777b..885f6fe 100644
--- a/game/dancegraph.cc
+++ b/game/dancegraph.cc
@@ -13,6 +13,7 @@ DanceGraph::DanceGraph(Audio& audio, Song const& song):
m_dead(1000),
m_text(getThemePath("sing_timetxt.svg"), config["graphic/text_lod"].f()),
m_correctness(0.0, 5.0),
+ m_flow_direction(1);
m_score(),
m_scoreFactor(),
m_streak(),
@@ -38,10 +39,69 @@ void DanceGraph::dance(double time, input::Event const& ev) {
}
+glutil::Color const& DanceGraph::color(int arrow_i) const {
+ static glutil::Color arrowColors[3] = {
+ glutil::Color(0.0f, 0.9f, 0.0f),
+ glutil::Color(0.9f, 0.0f, 0.0f),
+ glutil::Color(0.9f, 0.9f, 0.0f),
+ glutil::Color(0.0f, 0.0f, 0.9f),
+ };
+ if (arrow_i < 0 || arrow_i > 3) throw std::logic_error("Invalid arrow number in DanceGraph::getColor");
+ return arrowColors[arrow_i];
+}
+
+
/// Draws the dance graph
void DanceGraph::draw(double time) {
- //TODO
-
+ Dimensions dimensions(1.0); // FIXME: bogus aspect ratio (is this fixable?)
+ dimensions.screenBottom().middle(m_cx.get()).fixedWidth(m_width.get());
+ double offsetX = 0.5 * (dimensions.x1() + dimensions.x2());
+ double frac = 0.75; // Adjustable: 1.0 means fully separated, 0.0 means fully attached
+ // Draw scores
+ if (time >= -0.5) {
+ m_text.dimensions.screenBottom(-0.30).middle(0.32 * dimensions.w() + offsetX);
+ m_text.draw(boost::lexical_cast<std::string>(unsigned(getScore())));
+ m_text.dimensions.screenBottom(-0.27).middle(0.32 * dimensions.w() + offsetX);
+ m_text.draw(boost::lexical_cast<std::string>(unsigned(m_streak)) + "/"
+ + boost::lexical_cast<std::string>(unsigned(m_longestStreak)));
+ }
+ glutil::PushMatrixMode pmm(GL_PROJECTION);
+ glTranslatef(frac * 2.0 * offsetX, 0.0f, 0.0f);
+ glutil::PushMatrixMode pmb(GL_MODELVIEW);
+ glTranslatef((1.0 - frac) * offsetX, dimensions.y2(), 0.0f);
+ { float s = dimensions.w() / 5.0f; glScalef(s, s, s); }
+ // Draw the notes
+ // TODO: iteration needs rewrite to the dancenotes structure
+ //for (Chords::const_iterator it = m_chords.begin(); it != m_chords.end(); ++it) {
+ float tBeg = it->begin - time;
+ float tEnd = it->end - time;
+ if (tEnd < past) continue;
+ if (tBeg > future) break;
+ for (int arrow_i = 0; arrow_i < 5; ++arrow_i) {
+ //if (!it->fret[arrow_i]) continue;
+ if (tEnd > future) tEnd = future;
+ unsigned event = m_notes[it->dur[fret]];
+ float glow = 0.0f;
+ if (event > 0) glow = m_events[event - 1].glow.get();
+
+ glutil::Color c = color(arrow_i);
+ c.r += glow;
+ c.g += glow;
+ c.b += glow;
+ drawNote(fret, c, tBeg, tEnd, whammy);
+ }
+ //}
+ // Arrows on cursor
+ // TODO: suitable effect for pressing the arrows?
+ // TODO: effect possibilities: zooming, whitening, external glow
+ for (int arrow_i = m_drums; arrow_i < 5; ++arrow_i) {
+ float x = -2.0f + fret - 0.5f * m_drums;
+ glColor4fv(color(arrow_i));
+ m_arrow.dimensions.center(time2y(0.0)).middle(x);
+ m_arrow.draw();
+ float l = m_hit[fret + !m_drums].get();
+ }
+ glColor3f(1.0f, 1.0f, 1.0f);
}
diff --git a/game/dancegraph.hh b/game/dancegraph.hh
index a3f146b..e4e1b73 100644
--- a/game/dancegraph.hh
+++ b/game/dancegraph.hh
@@ -30,6 +30,7 @@ class DanceGraph {
private:
void dance(double time, input::Event const& ev);
void drawNote(int fret, glutil::Color, float tBeg, float tEnd);
+ glutil::Color const& color(int arrow_i) const ;
Audio& m_audio;
input::InputDev m_input;
Song const& m_song;
@@ -51,6 +52,7 @@ class DanceGraph {
int m_dead;
SvgTxtTheme m_text;
AnimValue m_correctness;
+ int m_flow_direction;
double m_score;
double m_scoreFactor;
int m_streak;
|
|
From: Jaakko N. <jni...@us...> - 2009-11-12 16:22:44
|
Module: performous
Branch: dance
Commit: 7aa4e54ed2879196d251e662aa68390249fd3fc7
Author: Jaakko Nikkola <jaa...@tk...>
Date: Thu Nov 12 18:19:25 2009 +0200
minor fix to DanceTrack constructor
---
game/notes.cc | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/game/notes.cc b/game/notes.cc
index b747bb5..29d00ae 100644
--- a/game/notes.cc
+++ b/game/notes.cc
@@ -78,7 +78,7 @@ double Note::scoreMultiplier(double error) const {
Duration::Duration(): begin(getNaN()), end(getNaN()) {}
-DanceData::DanceData(std::string d, Chords c) : description(d), chords(c) {}
+DanceTrack::DanceTrack(std::string d, Chords c) : description(d), chords(c) {}
|
|
From: Jaakko N. <jni...@us...> - 2009-11-12 16:22:42
|
Module: performous
Branch: dance
Commit: bfbd6aa766ad9f035eeed8b8a33d9e8a23958b97
Author: Jaakko Nikkola <jaa...@tk...>
Date: Thu Nov 12 18:14:17 2009 +0200
songparser-sm edited (propably not working) and additions for DanceTrack struct made in notes.hh and notes.cc
---
game/notes.cc | 4 ++
game/notes.hh | 9 ++++-
game/songparser-sm.cc | 96 +++++++++++++++++++++++++++++++------------------
3 files changed, 73 insertions(+), 36 deletions(-)
diff --git a/game/notes.cc b/game/notes.cc
index bb46e44..b747bb5 100644
--- a/game/notes.cc
+++ b/game/notes.cc
@@ -78,3 +78,7 @@ double Note::scoreMultiplier(double error) const {
Duration::Duration(): begin(getNaN()), end(getNaN()) {}
+DanceData::DanceData(std::string d, Chords c) : description(d), chords(c) {}
+
+
+
diff --git a/game/notes.hh b/game/notes.hh
index a623e5f..5f2ba88 100644
--- a/game/notes.hh
+++ b/game/notes.hh
@@ -96,10 +96,17 @@ struct Note {
typedef std::vector<Note> Notes;
+//container for dance songs
+typedef std::map<int, Note> Chord; //int indicates "arrow" position (cmp. fret in guitar)
+typedef std::vector<Chord> Chords;
struct DanceTrack {
- //TODO
+ //track description
+ std::string description;
+ //container for the actual note data
+ Chords chords;
+ DanceTrack(std::string d, Chords c);
};
enum DanceDifficulty {
diff --git a/game/songparser-sm.cc b/game/songparser-sm.cc
index f090c86..cc4d6eb 100644
--- a/game/songparser-sm.cc
+++ b/game/songparser-sm.cc
@@ -9,9 +9,6 @@
/// @file
/// Functions used for parsing the StepMania SM format
-//needs additions to songparser.hh: smCheck, smParseNote, smParseField
-//needs additions to song.hh: typedef std::vector<std::map<int, Note> > d_notes or std::vector<std::vector<Note> > d_notes or similar
-
namespace {
void assign(int& var, std::string const& str) {
try {
@@ -45,29 +42,54 @@ void SongParser::smParse() {
while (getline(line) && smParseField(line)) {}
if (s.title.empty() || s.artist.empty()) throw std::runtime_error("Required header fields missing");
if (m_bpm != 0.0) addBPM(0, m_bpm);
- while (getline(line) && smParseNote(line)) {}
+
// Workaround for the terminating : 1 0 0 line, written by some converters
/* if (!s.notes.empty() && s.notes.back().type != Note::SLEEP && s.notes.back().begin == s.notes.back().end) s.notes.pop_back();
*/
}
-bool SongParser::smParseField(std::string& line) {
+bool SongParser::smParseField(std::string line) {
if (line.empty()) return true;
if (line[0] == '/' && line[1] == '/') return true; //jump over possible comments
std::string::size_type pos = line.find(':');
if (pos == std::string::npos) throw std::runtime_error("Invalid format, should be #key:value");
std::string key = boost::trim_copy(line.substr(1, pos - 1));
if (key == "NOTES") {
- /*note values need to be analyzed here, because of different kind of
- representation. Values are:
- <NotesType>:
- <Description>:
- <DifficultyClass>:
- <DifficultyMeter>:
- <RadarValues>:
- <NoteData>*/
- return false; // after taking note values, jumps to "NoteData"
+
+ //temporary containers for note data
+ DanceTrackMap danceTrackMap;
+ Chords chords;
+
+ //Note values are analyzed here. Values are:
+
+ //<NotesType>:
+ if(!getline(line)) { throw std::runtime_error("Required note data missing"); }
+ std::string notestype = boost::trim_copy(line.substr(0, line.size() -1);
+ //<Description>:
+ if(!getline(line)) { throw std::runtime_error("Required note data missing"); }
+ std::string description = boost::trim_copy(line.substr(0, line.size() -1));
+ m_song.dance_data.addDescription(description);
+ //<DifficultyClass>:
+ if(!getline(line)) { throw std::runtime_error("Required note data missing"); }
+ std::string difficultyclass = boost::trim_copy(line.substr(0, line.size() -1));
+
+ //ignoring difficultymeter and radarvalues
+ //<DifficultyMeter>:
+ if(!getline(line)) { throw std::runtime_error("Required note data missing"); }
+ //std::string difficultymeter = boost::trim_copy(line.substr(0, line.size() -1));
+ //<RadarValues>:
+ if(!getline(line)) { throw std::runtime_error("Required note data missing"); }
+ //std::string radarvalues = boost::trim_copy(line.substr(0, line.size() -1));
+
+ //<NoteData>:
+ while (getline(line) && smParseNote(line, chords)) {}
+
+ DanceTrack danceTrack(difficultyclass, chords);
+ danceTrackMap[difficultyclass] = danceTrack;
+ m_song.danceTracks[notestype] = danceTrackMap;
+ return true;
}
+
std::string value = boost::trim_copy(line.substr(pos + 1));
value.erase(value.size() -1); // compared to txtParseField, here last character(';') is eliminated
if (value.empty()) return true;
@@ -101,38 +123,42 @@ bool SongParser::smParseField(std::string& line) {
return true;
}
-bool SongParser::smParseNote(std::string& line){
+bool SongParser::smParseNote(std::string line, Chords chords){
if(line.empty()) return true;
if(line[0] == '#') throw std::runtime_error("Key found in the middle of notes");
if(line[0] == ';') return false; //end mark
- //reading the notes into m_song.dance_notes
- //int lcount; //line counter for bpm
+ //reading the notes into m_song.dance_data
+ int lcount = 0; //line counter for bpm
+ int count = 0; //total lines counter
int tm = 0; //time counter
+ int dur; //note duration
if(line[0] == ',') {
- /*TODO Counting the timestamp of each note
- tm +=
- count new bpm
- lcount =0;*/
+ /*Counting the timestamp of each note*/
+ dur = 4 * ( 1/(m_bpm/60) ) / lcount; //counts one note duration in seconds;
+ for(int j = count - lcount; j<count ; j++) {
+ for(int i = 0; i<4; i++) {
+ if(m_song.dance_chords[j][i]) m_song.dance_chords[j][i].begin = tm;
+ if(m_song.dance_chords[j][i]) m_song.dance_chords[j][i].end = tm;
+
+ }
+ tm += dur;
+ }
+ lcount =0;
return true;
}
+
+ //reading notes into a chord
std::istringstream iss(line);
- std::map<int, Note> d_beat;
+ Chord chord;
for(int i =1; i <= 4; i++){
- if(iss.get() == '0') {
- Note note;
- //@TODO Note should be NULL or something...
- d_beat[i] = note;
- continue;
- }
- else { //if(iss.get() == '1')
- Note note;
- note.begin = tm;
- note.end = tm;
- d_beat[i] = note;
+ if(iss.get() == '1') {
+ Note note;
+ chord[i] = note;
}
- //@TODO hold etc. notes
- m_song.d_notes.push_back(d_beat); //d_notes must be in song.hh
+ //TODO hold etc. notes
+ chords.push_back(chord);
+ lcount++;
}
return true;
}
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2009-11-12 15:42:46
|
Module: performous
Branch: master
Commit: 3900316c5796ec5e742d4de8c12da5cd3c176236
Author: Lasse Karkkainen <tro...@tr...>
Date: Thu Nov 12 17:42:27 2009 +0200
Relocation support for Apple (needs testing)
---
game/CMakeLists.txt | 11 +++++------
libs/libda/src/CMakeLists.txt | 2 +-
libs/plugin++/CMakeLists.txt | 2 +-
3 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/game/CMakeLists.txt b/game/CMakeLists.txt
index 83168b6..1ea641a 100644
--- a/game/CMakeLists.txt
+++ b/game/CMakeLists.txt
@@ -39,12 +39,11 @@ add_executable(performous ${SOURCES} ${SDL_SOURCES})
target_link_libraries(performous da ${LIBS})
# Store library paths in executable
-set_target_properties(performous PROPERTIES
- INSTALL_RPATH_USE_LINK_PATH TRUE
- SKIP_BUILD_RPATH FALSE
- INSTALL_RPATH \$ORIGIN/../lib
- BUILD_WITH_INSTALL_RPATH FALSE
-)
+if(APPLE)
+ set_target_properties(performous PROPERTIES INSTALL_RPATH_USE_LINK_PATH TRUE INSTALL_RPATH @loader_path/../lib)
+else()
+ set_target_properties(performous PROPERTIES INSTALL_RPATH_USE_LINK_PATH TRUE INSTALL_RPATH \$ORIGIN/../lib)
+endif()
# Generate config.hh
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/config.cmake.hh" "${CMAKE_CURRENT_BINARY_DIR}/config.hh" @ONLY)
diff --git a/libs/libda/src/CMakeLists.txt b/libs/libda/src/CMakeLists.txt
index 60061a0..ddfbf8a 100644
--- a/libs/libda/src/CMakeLists.txt
+++ b/libs/libda/src/CMakeLists.txt
@@ -7,5 +7,5 @@ find_package(Boost 1.34 REQUIRED COMPONENTS thread filesystem)
include_directories(${Boost_INCLUDE_DIRS})
add_library(da SHARED audio.cpp)
target_link_libraries(da plugin++ ${Boost_LIBRARIES})
-set_target_properties(da PROPERTIES INSTALL_NAME_DIR ${CMAKE_INSTALL_PREFIX}/lib)
+set_target_properties(da PROPERTIES INSTALL_NAME_DIR @rpath/lib)
install(TARGETS da DESTINATION lib${LIB_SUFFIX})
diff --git a/libs/plugin++/CMakeLists.txt b/libs/plugin++/CMakeLists.txt
index 1378e5a..7b84fcd 100644
--- a/libs/plugin++/CMakeLists.txt
+++ b/libs/plugin++/CMakeLists.txt
@@ -19,7 +19,7 @@ if(NOT WIN32)
target_link_libraries(plugin++ dl)
endif()
-set_target_properties(plugin++ PROPERTIES INSTALL_NAME_DIR ${CMAKE_INSTALL_PREFIX}/lib)
+set_target_properties(plugin++ PROPERTIES INSTALL_NAME_DIR @rpath/lib)
install(TARGETS plugin++ DESTINATION lib${LIB_SUFFIX})
FILE(GLOB HEADER_FILES "include/plugin++/*")
|
|
From: Markus R. <god...@us...> - 2009-11-12 12:50:19
|
Module: performous
Branch: master
Commit: 92ab087792e53497396e80127a14b021e95721e3
Author: Markus Raab <un...@ma...>
Date: Thu Nov 12 13:42:38 2009 +0100
only add songs for which the sing screen was left
thanks Yoda for the idea
---
game/screen_sing.cc | 1 +
game/songs.cc | 1 -
2 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/game/screen_sing.cc b/game/screen_sing.cc
index ade25f7..f6c46ac 100644
--- a/game/screen_sing.cc
+++ b/game/screen_sing.cc
@@ -138,6 +138,7 @@ void ScreenSing::activateNextScreen()
{
ScreenManager* sm = ScreenManager::getSingletonPtr();
+ m_database.addSong(m_song);
if (m_database.scores.empty()
|| !m_database.reachedHiscore(m_song))
{
diff --git a/game/songs.cc b/game/songs.cc
index c4e13d7..3b63876 100644
--- a/game/songs.cc
+++ b/game/songs.cc
@@ -72,7 +72,6 @@ void Songs::reload_internal(fs::path const& parent) {
boost::shared_ptr<Song>s(new Song(path, name));
s->randomIdx = ++randomIdx; // Not so random during loading, they are shuffled after load is finished
boost::mutex::scoped_lock l(m_mutex);
- m_database.addSong(s);
m_songs.push_back(s);
m_dirty = true;
} catch (SongParserException& e) {
|
|
From: Markus R. <god...@us...> - 2009-11-12 12:50:12
|
Module: performous Branch: master Commit: 257fc9aa1c1b4b878a79d0bf333f15640f7bf7b0 Author: Markus Raab <un...@ma...> Date: Thu Nov 12 13:15:12 2009 +0100 Compiles again (with hiscores in performous) score and cur moved from players to database instead of making it public the friends are listed to indicate that this is not a good idea players.hh header removed where database is now used change constructors to accept database instead of players remove the m_highscore scoped_ptr, database has global scope use shared_ptr immediately when Song is allocated hiscore is used unconditionally: config item removed --- data/schema.xml | 6 ------ game/database.cc | 10 ++++------ game/database.hh | 25 +++++++++++++++++++++++-- game/engine.hh | 20 ++++++++++---------- game/layout_singer.cc | 13 ++++++------- game/layout_singer.hh | 6 ++++-- game/notegraph.cc | 8 ++++---- game/notegraph.hh | 6 +++--- game/players.cc | 3 +-- game/players.hh | 10 ---------- game/screen_hiscore.cc | 20 +++++--------------- game/screen_hiscore.hh | 9 +++++---- game/screen_players.cc | 30 ++++++++++-------------------- game/screen_players.hh | 10 +++++++--- game/screen_sing.cc | 42 +++++++++++++++++++++++++----------------- game/screen_sing.hh | 4 ++-- game/songs.cc | 8 ++++---- 17 files changed, 113 insertions(+), 117 deletions(-) |