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: Tapio V. <aa...@us...> - 2010-03-26 16:57:25
|
Module: performous
Branch: master
Commit: 13a5d0ccee553a62b3937f1bc1ac482098f23a57
Author: Tapio Vierros <tap...@gm...>
Date: Fri Mar 26 18:54:17 2010 +0200
Tweak instrument score display.
* Lower to avoid clashing with lyrics in 16:9 aspect ratio.
* Streak counter to the same side as scores and more neutral in color.
---
game/guitargraph.cc | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index 24c411f..96a51c8 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -866,17 +866,17 @@ void GuitarGraph::drawInfo(double time, double offsetX, Dimensions dimensions) {
m_text.draw(m_track_index->first);
} else {
float xcor = 0.35 * dimensions.w();
- float h = 0.064 * 2.0 * dimensions.w();
+ float h = 0.075 * 2.0 * dimensions.w();
// Draw scores
glColor4f(0.1f, 0.3f, 1.0f, 0.90f);
m_scoreText->render((boost::format("%04d") % getScore()).str());
- m_scoreText->dimensions().middle(-xcor + offsetX).fixedHeight(h*1.1).screenBottom(-0.28);
+ m_scoreText->dimensions().middle(-xcor + offsetX).fixedHeight(h).screenBottom(-0.24);
m_scoreText->draw();
// Draw streak counter
- glColor4f(0.9f, 0.9f, 0.05f, 0.95f);
+ glColor4f(0.6f, 0.6f, 0.7f, 0.95f);
m_streakText->render(boost::lexical_cast<std::string>(unsigned(m_streak)) + "/"
+ boost::lexical_cast<std::string>(unsigned(m_longestStreak)));
- m_streakText->dimensions().middle(xcor + offsetX).fixedHeight(h).screenBottom(-0.28);
+ m_streakText->dimensions().middle(-xcor + offsetX).fixedHeight(h*0.75).screenBottom(-0.20);
m_streakText->draw();
}
// Is Starpower ready?
|
|
From: Lasse Kärkkäi. <tr...@us...> - 2010-03-19 13:36:32
|
Module: performous
Branch: master
Commit: 8596613a16216a294b99ce8e6513c1531d8a90f9
Author: Lasse Karkkainen <tro...@tr...>
Date: Fri Mar 19 15:36:19 2010 +0200
Better handling of Ctrl+C (allow killing the program even if something hangs).
---
game/main.cc | 14 ++++++++++++--
1 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/game/main.cc b/game/main.cc
index e62c9af..19b2f83 100644
--- a/game/main.cc
+++ b/game/main.cc
@@ -33,8 +33,19 @@ volatile bool g_quit = false;
bool g_take_screenshot = false;
+// Signal handling for Ctrl-C
+
+static void signalSetup();
+
extern "C" void quit(int) {
+ if (g_quit) std::exit(EXIT_SUCCESS); // Instant exit if Ctrl+C is pressed again
g_quit = true;
+ signalSetup();
+}
+
+static void signalSetup() {
+ std::signal(SIGINT, quit);
+ std::signal(SIGTERM, quit);
}
/// can be thrown as an exception to quit the game
@@ -287,8 +298,7 @@ int main(int argc, char** argv) try {
#endif
std::cout << PACKAGE " " VERSION << std::endl;
- std::signal(SIGINT, quit);
- std::signal(SIGTERM, quit);
+ signalSetup();
std::ios::sync_with_stdio(false); // We do not use C stdio
std::srand(std::time(NULL));
// Parse commandline options
|
|
From: Yoda-JM <yo...@us...> - 2010-03-17 09:43:16
|
Module: performous Branch: master Commit: c8b11ddcc6cb383dcfe9af462c645a37a4fc83b3 Author: Vincent Le Ligeour <yo...@us...> Date: Wed Mar 17 10:42:16 2010 +0100 Added left-handed feature request --- docs/TODO.txt | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/docs/TODO.txt b/docs/TODO.txt index c0c7fdd..e4cfc21 100644 --- a/docs/TODO.txt +++ b/docs/TODO.txt @@ -31,6 +31,7 @@ Features: - Better audio card configuration ingame (needs PortAudio backend) - Allow playing a single song given as commandline argument (no menus) - Kiosk/arcade mode (disable exiting game and limit other functions) +- Allow left-handed/reversed controllers (guitars, drum kits) Dance features: |
|
From: Yoda-JM <yo...@us...> - 2010-03-16 14:49:27
|
Module: performous Branch: master Commit: 348347f093dc97fc55f19f376dfac5ab9445b67c Author: Vincent Le Ligeour <yo...@us...> Date: Tue Mar 16 15:48:36 2010 +0100 Added a bug to the TODO --- docs/TODO.txt | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/docs/TODO.txt b/docs/TODO.txt index 3b9db0d..c0c7fdd 100644 --- a/docs/TODO.txt +++ b/docs/TODO.txt @@ -61,4 +61,6 @@ SS Ripper: Bugs: - Segfault when browsing songs in song browser while loading (segfaults before loading finishes), quite rare - +- sample are not always played when a user fail (for example drums). it could + be nice that playing a sample reset the privious fail sample (test case : + drums rolling) |
|
From: Lasse Kärkkäi. <tr...@us...> - 2010-03-15 12:55:24
|
Module: performous Branch: master Commit: 5a7532963937c2b2eec04860963ee1d3baeda3b6 Author: Lasse Karkkainen <tro...@tr...> Date: Mon Mar 15 14:54:28 2010 +0200 Merge branch 'master' of ssh://git.performous.org/gitroot/performous/performous --- |
|
From: Lasse Kärkkäi. <tr...@us...> - 2010-03-15 12:55:23
|
Module: performous Branch: master Commit: 3769cd192f64f476e6b5550f4eaa6b162a4572ab Author: Lasse Karkkainen <tro...@tr...> Date: Mon Mar 15 14:53:23 2010 +0200 Revert guitar/bass/drumnecks to the old versions before th3pr0ph3t theme patch. --- themes/default/bassneck.svg | 262 ++++++++++++++++++------------ themes/default/drumneck.svg | 366 ++++++++++++++++++++++++++++------------ themes/default/guitarneck.svg | 224 ++++++++++++++++--------- 3 files changed, 558 insertions(+), 294 deletions(-) |
|
From: Tapio V. <aa...@us...> - 2010-03-15 12:52:35
|
Module: performous
Branch: master
Commit: baac6e7535a66f3c79b49eebdbd0b50d3cee56d7
Author: Tapio Vierros <tap...@gm...>
Date: Mon Mar 15 14:51:19 2010 +0200
Drum fill's end note is grey until acceptable.
---
game/guitargraph.cc | 31 +++++++++++++++++--------------
1 files changed, 17 insertions(+), 14 deletions(-)
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index 76c7b3d..24c411f 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -35,7 +35,8 @@ namespace {
float y2a(float y) { return time2a(past - y / timescale * (future - past)); }
float tc(float y) { return y * 0.1; } // Get texture coordinates for animating hold notes
const double maxTolerance = 0.15; // Maximum error in seconds
-
+
+ const float drumfill_min_rate = 6.0; // The rate of hits per second required to complete a drum fill
double points(double error) {
double score = 0.0;
if (error < maxTolerance) score += 15;
@@ -44,7 +45,7 @@ namespace {
if (error < 0.03) score += 5;
return score;
}
-
+
const int streakStarBonus = 500;
int getNextBigStreak(int prev) { return prev + 50; }
inline float blend(float a, float b, float f) { return a*f + b*(1.0f-f); }
@@ -241,7 +242,7 @@ void GuitarGraph::engine() {
}
// Skip missed notes
while (m_chordIt != m_chords.end() && m_chordIt->begin + maxTolerance < time) {
- if ( (m_drums && m_chordIt->status != m_chordIt->polyphony)
+ if ( (m_drums && m_chordIt->status != m_chordIt->polyphony)
|| (!m_drums && m_chordIt->status == 0) ) endStreak();
++m_dead;
++m_chordIt;
@@ -392,7 +393,7 @@ void GuitarGraph::drumHit(double time, int fret) {
if (fret == 4 && time >= m_dfIt->end - maxTolerance
&& (!m_song.hasBRE || m_dfIt != (--m_drumfills.end()))) {
// GodMode and scores require ~ 6 hits per second
- if (m_drumfillHits >= 6.0 * (m_dfIt->end - m_dfIt->begin)) {
+ if (m_drumfillHits >= drumfill_min_rate * (m_dfIt->end - m_dfIt->begin)) {
activateStarpower();
m_score += m_drumfillScore;
}
@@ -564,7 +565,7 @@ glutil::Color const GuitarGraph::colorize(glutil::Color c, double time) const {
namespace {
const float fretWid = 0.5f; // The actual width is two times this
-
+
/// Create a symmetric vertex pair of given data
void vertexPair(float x, float y, glutil::Color c, float ty, float fretW = fretWid) {
c.a = y2a(y); glColor4fv(c);
@@ -595,7 +596,7 @@ void GuitarGraph::draw(double time) {
glRotatef(g_angle, 1.0f, 0.0f, 0.0f);
float temp_s = dimensions.w() / 5.0f;
glScalef(temp_s, temp_s, temp_s);
-
+
// Draw the neck
{
UseTexture tex(*m_neck);
@@ -619,7 +620,7 @@ void GuitarGraph::draw(double time) {
glTexCoord2f(1.0f, texCoord); glVertex2f(w, time2y(tEnd));
}
}
-
+
// Draw the cursor
float level = m_hit[0].get();
glColor3f(level, level, level);
@@ -636,7 +637,7 @@ void GuitarGraph::draw(double time) {
m_tap.dimensions = m_button.dimensions;
m_tap.draw();
}
-
+
// Draw the notes
{ glutil::UseLighting lighting(m_use3d);
// Draw drum fills / Big Rock Endings
@@ -645,7 +646,9 @@ void GuitarGraph::draw(double time) {
drawDrumfill(m_dfIt->begin - time, m_dfIt->end - time);
// If it is a drum fill (not BRE), draw the final note
if (m_drums && (!m_song.hasBRE || (m_dfIt != (--m_drumfills.end())))) {
- glutil::Color c = colorize(color(4), m_dfIt->end);
+ glutil::Color c(0.7f, 0.7f, 0.7f);
+ if (m_drumfillHits >= drumfill_min_rate * (m_dfIt->end - m_dfIt->begin))
+ c = colorize(color(4), m_dfIt->end);
drawNote(4, c, m_dfIt->end - time, m_dfIt->end - time, 0, false, false, 0, 0);
}
}
@@ -690,12 +693,12 @@ void GuitarGraph::draw(double time) {
if (glow > 0.5f && tEnd < 0.1f && it->hitAnim[fret].get() == 0.0)
it->hitAnim[fret].setTarget(1.0);
// Call the actual note drawing function
- drawNote(fret, c, tBeg, tEnd, whammy, it->tappable, glow > 0.5f, it->hitAnim[fret].get(),
+ drawNote(fret, c, tBeg, tEnd, whammy, it->tappable, glow > 0.5f, it->hitAnim[fret].get(),
it->releaseTimes[fret] > 0.0 ? it->releaseTimes[fret] - time : getNaN());
}
}
} //< disable lighting
-
+
// Draw flames
for (int fret = 0; fret < 5; ++fret) { // Loop through the frets
if (m_drums && fret == 0) { // Skip bass drum
@@ -723,7 +726,7 @@ void GuitarGraph::draw(double time) {
}
}
}
-
+
// Bottom neck glow
if (ng_ccnt > 0) {
// Mangle color
@@ -982,7 +985,7 @@ void GuitarGraph::updateChords() {
m_chords.push_back(c);
}
m_chordIt = m_chords.begin();
-
+
// Solos
NoteMap const& nm = m_track_index->second->nm;
NoteMap::const_iterator solotrack = nm.find(103); // 103 = Expert Solo - used for every difficulty
@@ -1001,7 +1004,7 @@ void GuitarGraph::updateChords() {
m_scoreFactor += 50.0 * (m_drumfills.back().end - m_drumfills.back().begin);
}
m_dfIt = m_drumfills.end();
-
+
// Normalize maximum score factor
m_scoreFactor = 10000.0 / m_scoreFactor;
}
|
|
From: Peque <ms...@us...> - 2010-03-15 11:29:32
|
Module: performous Branch: master Commit: 0a18697570f3ed175c079286caaca1f83cb2049d Author: Miguel Sánchez de León Peque <msd...@gm...> Date: Mon Mar 15 12:28:53 2010 +0100 Merge branch 'hiscore_in_songbrowser' --- |
|
From: Peque <ms...@us...> - 2010-03-15 11:29:30
|
Module: performous
Branch: master
Commit: 8608a2ea436a51ace97bc68cabe44c00def291ba
Author: Tapio Vierros <tap...@gm...>
Date: Mon Mar 15 12:00:30 2010 +0200
Tweaks to hiscrore in songbrowser.
* Allow starting song in hiscore mode.
* Fix broken scrolling-by-one.
* Refactor bounds-check (move to one place, easier to understand).
---
game/database.cc | 11 ++++++-----
game/database.hh | 2 +-
game/screen_songs.cc | 11 +++++------
game/screen_songs.hh | 2 +-
4 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/game/database.cc b/game/database.cc
index 4668d26..ce8a411 100644
--- a/game/database.cc
+++ b/game/database.cc
@@ -118,7 +118,7 @@ void Database::queryPerSongHiscore (std::ostream & os, boost::shared_ptr<Song> s
}
}
-void Database::queryPerSongHiscore_HiscoreDisplay (std::ostream & os, boost::shared_ptr<Song> s, unsigned & start_pos, unsigned max_displayed, std::string const& track) const {
+void Database::queryPerSongHiscore_HiscoreDisplay (std::ostream & os, boost::shared_ptr<Song> s, int& start_pos, unsigned max_displayed, std::string const& track) const {
int songid = m_songs.lookup(s);
std::vector<HiscoreItem> hi = m_hiscores.queryHiscore(10, -1, songid, track);
@@ -129,10 +129,11 @@ void Database::queryPerSongHiscore_HiscoreDisplay (std::ostream & os, boost::sha
return;
}
- if((hi.size() > 5)&&(start_pos > hi.size()-6)) start_pos = hi.size()-5;
- else start_pos = 0;
-
- for (size_t i=0; ((i<hi.size())&&(i<max_displayed)); ++i)
+ // Limits
+ if (start_pos > (int)hi.size() - (int)max_displayed) start_pos = hi.size() - max_displayed;
+ if (start_pos < 0 || hi.size() <= max_displayed) start_pos = 0;
+
+ for (size_t i = 0; i < hi.size() && i < max_displayed; ++i)
{
os << i+start_pos+1 << "\t"
<< m_players.lookup(hi[i+start_pos].playerid) << "\t"
diff --git a/game/database.hh b/game/database.hh
index 1bf254d..be98fe0 100644
--- a/game/database.hh
+++ b/game/database.hh
@@ -99,7 +99,7 @@ class Database
void queryOverallHiscore (std::ostream & os, std::string const& track = "") const;
void queryPerSongHiscore (std::ostream & os, boost::shared_ptr<Song> s, std::string const& track = "") const;
- void queryPerSongHiscore_HiscoreDisplay (std::ostream & os, boost::shared_ptr<Song> s, unsigned & start_pos, unsigned max_displayed, std::string const& track = "") const;
+ void queryPerSongHiscore_HiscoreDisplay (std::ostream & os, boost::shared_ptr<Song> s, int& start_pos, unsigned max_displayed, std::string const& track = "") const;
void queryPerPlayerHiscore (std::ostream & os, std::string const& track = "") const;
bool hasHiscore(Song& s) const;
diff --git a/game/screen_songs.cc b/game/screen_songs.cc
index aef4500..26928f0 100644
--- a/game/screen_songs.cc
+++ b/game/screen_songs.cc
@@ -58,8 +58,8 @@ void ScreenSongs::manageSharedKey(input::NavButton nav) {
ss->setSong(m_songs.currentPtr());
sm->activateScreen("Sing");
}
- else if (nav == input::LEFT) m_songs.advance(-1);
- else if (nav == input::RIGHT) m_songs.advance(1);
+ else if (nav == input::LEFT) { m_songs.advance(-1); hiscore_start_pos = 0; }
+ else if (nav == input::RIGHT) { m_songs.advance(1); hiscore_start_pos = 0; }
}
void ScreenSongs::manageEvent(SDL_Event event) {
@@ -77,13 +77,12 @@ void ScreenSongs::manageEvent(SDL_Event event) {
return;
} else if (show_hiscores) {
if (nav == input::CANCEL || m_songs.empty()) show_hiscores = false;
- else if ((nav == input::UP)&&(hiscore_start_pos > 0)) hiscore_start_pos--;
+ else if (nav == input::UP) hiscore_start_pos--;
else if (nav == input::DOWN) hiscore_start_pos++;
+ // TODO: change hiscore type listed (all, just vocals, guitar easy, guitar medium, guitar hard, guit
else if (nav == input::MOREUP) (hiscore_start_pos > 4) ? hiscore_start_pos -= 5 : hiscore_start_pos = 0;
else if (nav == input::MOREDOWN) hiscore_start_pos += 5;
- else if (nav == input::LEFT) { m_songs.advance(-1); hiscore_start_pos=0; }
- else if (nav == input::RIGHT) { m_songs.advance(1); hiscore_start_pos=0; }
- else if (nav == input::START) {}; // TODO change hiscore type listed (all, just vocals, guitar easy, guitar medium, guitar hard, guit
+ else manageSharedKey(nav);
return;
} else if (nav == input::CANCEL) {
if (!m_search.text.empty()) { m_search.text.clear(); m_songs.setFilter(m_search.text); }
diff --git a/game/screen_songs.hh b/game/screen_songs.hh
index b9ad7f2..62320a6 100644
--- a/game/screen_songs.hh
+++ b/game/screen_songs.hh
@@ -59,5 +59,5 @@ protected:
Cachemap<std::string, Surface> m_covers;
bool m_jukebox;
bool show_hiscores;
- unsigned hiscore_start_pos;
+ int hiscore_start_pos;
};
|
|
From: Peque <ms...@us...> - 2010-03-15 11:29:28
|
Module: performous
Branch: master
Commit: 7283e6a12cd19ebd54b228d9036bc969a4ba6f28
Author: Miguel Sánchez de León Peque <msd...@gm...>
Date: Mon Mar 15 02:40:54 2010 +0100
Fixed last bug. Performous wont crash while scrolling hiscores.
---
game/database.cc | 8 +++-----
game/screen_songs.cc | 2 +-
2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/game/database.cc b/game/database.cc
index b478125..4668d26 100644
--- a/game/database.cc
+++ b/game/database.cc
@@ -128,11 +128,9 @@ void Database::queryPerSongHiscore_HiscoreDisplay (std::ostream & os, boost::sha
os << "Be the first to be listed here!\n";
return;
}
-
- if (hi.size()-(start_pos+1) < max_displayed) {
- if (hi.size() < 6) start_pos = 0;
- else start_pos -= 1;
- }
+
+ if((hi.size() > 5)&&(start_pos > hi.size()-6)) start_pos = hi.size()-5;
+ else start_pos = 0;
for (size_t i=0; ((i<hi.size())&&(i<max_displayed)); ++i)
{
diff --git a/game/screen_songs.cc b/game/screen_songs.cc
index 6d7e473..aef4500 100644
--- a/game/screen_songs.cc
+++ b/game/screen_songs.cc
@@ -79,7 +79,7 @@ void ScreenSongs::manageEvent(SDL_Event event) {
if (nav == input::CANCEL || m_songs.empty()) show_hiscores = false;
else if ((nav == input::UP)&&(hiscore_start_pos > 0)) hiscore_start_pos--;
else if (nav == input::DOWN) hiscore_start_pos++;
- else if ((nav == input::MOREUP)&&(hiscore_start_pos > 4)) hiscore_start_pos -= 5;
+ else if (nav == input::MOREUP) (hiscore_start_pos > 4) ? hiscore_start_pos -= 5 : hiscore_start_pos = 0;
else if (nav == input::MOREDOWN) hiscore_start_pos += 5;
else if (nav == input::LEFT) { m_songs.advance(-1); hiscore_start_pos=0; }
else if (nav == input::RIGHT) { m_songs.advance(1); hiscore_start_pos=0; }
|
|
From: Peque <ms...@us...> - 2010-03-15 11:29:26
|
Module: performous
Branch: master
Commit: 80c3a1cfd5b11f5ceee9c539828f1691508a7129
Author: Miguel Sánchez de León Peque <msd...@gm...>
Date: Mon Mar 15 00:47:48 2010 +0100
Clean up. Bug is not solved.
---
game/database.cc | 2 +-
game/main.cc | 2 -
game/screen_hiscore.cc | 98 ------------------------------------------------
game/screen_hiscore.hh | 46 ----------------------
game/screen_songs.cc | 30 ++++++++------
5 files changed, 18 insertions(+), 160 deletions(-)
diff --git a/game/database.cc b/game/database.cc
index 8663c34..b478125 100644
--- a/game/database.cc
+++ b/game/database.cc
@@ -136,7 +136,7 @@ void Database::queryPerSongHiscore_HiscoreDisplay (std::ostream & os, boost::sha
for (size_t i=0; ((i<hi.size())&&(i<max_displayed)); ++i)
{
- os << i+1+start_pos << "\t"
+ os << i+start_pos+1 << "\t"
<< m_players.lookup(hi[i+start_pos].playerid) << "\t"
<< hi[i+start_pos].score << "\t"
<< "(" << hi[i+start_pos].track << ")\n";
diff --git a/game/main.cc b/game/main.cc
index 6378538..e62c9af 100644
--- a/game/main.cc
+++ b/game/main.cc
@@ -17,7 +17,6 @@
#include "screen_practice.hh"
#include "screen_configuration.hh"
#include "screen_players.hh"
-#include "screen_hiscore.hh"
#include <boost/format.hpp>
#include <boost/program_options.hpp>
@@ -169,7 +168,6 @@ void mainLoop(std::string const& songlist) {
sm.addScreen(new ScreenPractice("Practice", audio, capture));
sm.addScreen(new ScreenConfiguration("Configuration", audio));
sm.addScreen(new ScreenPlayers("Players", audio, database));
- sm.addScreen(new ScreenHiscore("Hiscore", audio, songs, database));
sm.activateScreen("Intro");
sm.flashMessage(_("Main menu..."), 0.0f, 1.0f, 1.0f); window.blank(); sm.drawFlashMessage(); window.swap();
sm.updateScreen(); // exit/enter, any exception is fatal error
diff --git a/game/screen_hiscore.cc b/game/screen_hiscore.cc
deleted file mode 100644
index 424aed5..0000000
--- a/game/screen_hiscore.cc
+++ /dev/null
@@ -1,98 +0,0 @@
-#include "screen_hiscore.hh"
-
-#include "configuration.hh"
-#include "audio.hh"
-#include "fs.hh"
-#include "util.hh"
-#include "database.hh"
-#include "joystick.hh"
-#include "i18n.hh"
-
-#include <iostream>
-#include <sstream>
-#include <boost/format.hpp>
-
-ScreenHiscore::ScreenHiscore(std::string const& name, Audio& audio, Songs& songs, Database& database):
- ScreenSongs(name, audio, songs, database), m_database(database), m_players(database.m_players)
-{
- m_players.setAnimMargins(5.0, 5.0);
-}
-
-void ScreenHiscore::enter() {
- 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()));
- m_score_text[3].reset(new SvgTxtThemeSimple(getThemePath("sing_score_text.svg"), config["graphic/text_lod"].f()));
- m_player_icon.reset(new Surface(getThemePath("sing_pbox.svg")));
-
- // m_emptyCover.reset(new Surface(getThemePath("no_person.svg"))); // TODO use persons head
-
- m_search.text.clear();
- m_players.setFilter(m_search.text);
-
- ScreenSongs::enter();
-}
-
-void ScreenHiscore::exit() {
- m_player_icon.reset();
- m_score_text[0].reset();
- m_score_text[1].reset();
- m_score_text[2].reset();
- m_score_text[3].reset();
-
- ScreenSongs::exit();
-}
-
-void ScreenHiscore::activateNextScreen() {
- ScreenManager* sm = ScreenManager::getSingletonPtr();
- sm->activateScreen("Songs");
-}
-
-void ScreenHiscore::manageEvent(SDL_Event event) {
- input::NavButton nav(input::getNav(event));
- if (nav == input::CANCEL || nav == input::START) activateNextScreen();
- else if (nav == input::PAUSE) m_audio.togglePause();
-}
-
-/**Draw the scores in the bottom*/
-void ScreenHiscore::drawScores() {
- // Score display
- {
- unsigned int i = 0;
- for (std::list<Player>::const_iterator p = m_database.cur.begin(); p != m_database.cur.end(); ++p, ++i) {
- float act = p->activity();
- if (act == 0.0f) continue;
- glColor4f(p->m_color.r, p->m_color.g, p->m_color.b,act);
- m_player_icon->dimensions.left(-0.5 + 0.01 + 0.25 * i).fixedWidth(0.075)
- .screenBottom(-0.025);
- m_player_icon->draw();
- m_score_text[i%4]->render((boost::format("%04d") % p->getScore()).str());
- m_score_text[i%4]->dimensions().middle(-0.350 + 0.01 + 0.25 * i).fixedHeight(0.075)
- .screenBottom(-0.025);
- m_score_text[i%4]->draw();
- glColor4f(1.0, 1.0, 1.0, 1.0);
- }
- }
-}
-
-void ScreenHiscore::draw() {
- ScreenSharedInfo info;
- info.videoGap = 0.0;
-
- ScreenSongs::drawMultimedia();
- ScreenSongs::updateMultimedia(*m_song, info);
-
- std::ostringstream oss_song, oss_order;
-
- // Format the player information text
- oss_song << _("Hiscore for ") << m_song->title << "\n";
-
- m_database.queryPerSongHiscore(oss_order, m_song);
-
- // Draw song and order texts
- theme->song.draw(oss_song.str());
- theme->order.draw(oss_order.str());
-
- ScreenSongs::stopMultimedia(info);
-}
-
diff --git a/game/screen_hiscore.hh b/game/screen_hiscore.hh
deleted file mode 100644
index 0a0a5c2..0000000
--- a/game/screen_hiscore.hh
+++ /dev/null
@@ -1,46 +0,0 @@
-#pragma once
-
-#include <boost/scoped_ptr.hpp>
-#include "animvalue.hh"
-#include "cachemap.hh"
-#include "opengl_text.hh"
-#include "screen.hh"
-#include "surface.hh"
-#include "textinput.hh"
-#include "theme.hh"
-#include "video.hh"
-
-#include "screen_songs.hh"
-
-class Song;
-class Songs;
-class Audio;
-class Players;
-class Database;
-
-/// song chooser screen
-class ScreenHiscore : public ScreenSongs {
- public:
- /// constructor: songs is just used to pass to ScreenSongs
- ScreenHiscore(std::string const& name, Audio& audio, Songs& songs, Database& database);
-
- void enter();
- void exit();
- void activateNextScreen();
-
- void manageEvent(SDL_Event event);
- void draw();
- void drawScores();
-
- void setSong (boost::shared_ptr<Song> song_)
- {
- m_song = song_;
- }
-
- private:
- Database& m_database;
- Players& m_players;
- boost::scoped_ptr<Surface> m_player_icon;
- boost::scoped_ptr<SvgTxtThemeSimple> m_score_text[4];
- boost::shared_ptr<Song> m_song;
-};
diff --git a/game/screen_songs.cc b/game/screen_songs.cc
index 4a057b3..6d7e473 100644
--- a/game/screen_songs.cc
+++ b/game/screen_songs.cc
@@ -77,10 +77,12 @@ void ScreenSongs::manageEvent(SDL_Event event) {
return;
} else if (show_hiscores) {
if (nav == input::CANCEL || m_songs.empty()) show_hiscores = false;
- else if ((nav == input::UP)&&(hiscore_start_pos)) hiscore_start_pos--;
+ else if ((nav == input::UP)&&(hiscore_start_pos > 0)) hiscore_start_pos--;
else if (nav == input::DOWN) hiscore_start_pos++;
- else if (nav == input::LEFT) m_songs.advance(-1);
- else if (nav == input::RIGHT) m_songs.advance(1);
+ else if ((nav == input::MOREUP)&&(hiscore_start_pos > 4)) hiscore_start_pos -= 5;
+ else if (nav == input::MOREDOWN) hiscore_start_pos += 5;
+ else if (nav == input::LEFT) { m_songs.advance(-1); hiscore_start_pos=0; }
+ else if (nav == input::RIGHT) { m_songs.advance(1); hiscore_start_pos=0; }
else if (nav == input::START) {}; // TODO change hiscore type listed (all, just vocals, guitar easy, guitar medium, guitar hard, guit
return;
} else if (nav == input::CANCEL) {
@@ -100,16 +102,18 @@ void ScreenSongs::manageEvent(SDL_Event event) {
SDL_keysym keysym = event.key.keysym;
int key = keysym.sym;
SDLMod mod = event.key.keysym.mod;
- if (key == SDLK_r && mod & KMOD_CTRL) { m_songs.reload(); m_songs.setFilter(m_search.text); }
- if (!m_jukebox && m_search.process(keysym)) m_songs.setFilter(m_search.text);
- if (key == SDLK_F5) m_songs.setTypeFilter(m_songs.getTypeFilter() ^ 8); // Vocals
- if (key == SDLK_F6) m_songs.setTypeFilter(m_songs.getTypeFilter() ^ 4); // Guitars
- if (key == SDLK_F7) m_songs.setTypeFilter(m_songs.getTypeFilter() ^ 2); // Drums
- if (key == SDLK_F8) m_songs.setTypeFilter(m_songs.getTypeFilter() ^ 1); // Dance
- // The rest are only available when there are songs available
- else if (m_songs.empty()) return;
- else if (!m_jukebox && key == SDLK_F4) m_jukebox = true;
- else if (key == SDLK_END) show_hiscores ? show_hiscores = false : show_hiscores = true;
+ if (!show_hiscores) {
+ if (key == SDLK_r && mod & KMOD_CTRL) { m_songs.reload(); m_songs.setFilter(m_search.text); }
+ if (!m_jukebox && m_search.process(keysym)) m_songs.setFilter(m_search.text);
+ if (key == SDLK_F5) m_songs.setTypeFilter(m_songs.getTypeFilter() ^ 8); // Vocals
+ if (key == SDLK_F6) m_songs.setTypeFilter(m_songs.getTypeFilter() ^ 4); // Guitars
+ if (key == SDLK_F7) m_songs.setTypeFilter(m_songs.getTypeFilter() ^ 2); // Drums
+ if (key == SDLK_F8) m_songs.setTypeFilter(m_songs.getTypeFilter() ^ 1); // Dance
+ // The rest are only available when there are songs available
+ else if (m_songs.empty()) return;
+ else if (!m_jukebox && key == SDLK_F4) m_jukebox = true;
+ else if (key == SDLK_END) show_hiscores ? show_hiscores = false : show_hiscores = true;
+ } else if (key == SDLK_END) show_hiscores ? show_hiscores = false : show_hiscores = true;
}
}
|
|
From: Peque <ms...@us...> - 2010-03-15 11:29:24
|
Module: performous
Branch: master
Commit: 9f2754676bd24c0502db70467e38b06b10dcb8ec
Author: Miguel Sánchez de León Peque <msd...@gm...>
Date: Sun Mar 14 20:26:57 2010 +0100
Hiscores displayed in screen_songs.
Music is not interrupted.
No more than 5 hiscores can be displayed at a time, but you do can navigate through them using UP and DOWN arrows.
---
game/database.cc | 25 +++++++++
game/database.hh | 1 +
game/screen_songs.cc | 53 ++++++++++++--------
game/screen_songs.hh | 2 +
game/theme.cc | 3 +-
game/theme.hh | 6 ++-
.../{songs_hiscore.svg => songs_has_hiscore.svg} | 0
.../{songs_hiscore.svg => songs_hiscores.svg} | 40 +++++++++------
8 files changed, 91 insertions(+), 39 deletions(-)
|
|
From: Tapio V. <aa...@us...> - 2010-03-15 10:12:11
|
Module: performous
Branch: texturing
Commit: b06021de84d0ebeee37ea082e585821d934bc6e8
Author: Tapio Vierros <tap...@gm...>
Date: Sat Nov 14 16:18:19 2009 +0200
Removed coloring
---
game/guitargraph.cc | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index 4b1fbb6..cc80902 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -454,10 +454,11 @@ void GuitarGraph::draw(double time) {
glColor3f(level, level, level);
drawBar(0.0, 0.01f);
// Fret buttons on cursor
+ glColor3f(1.0f, 1.0f, 1.0f);
for (int fret = m_drums; fret < 5; ++fret) {
float x = -2.0f + fret - 0.5f * m_drums;
float l = m_hit[fret + !m_drums].get();
- glColor4fv(color(fret));
+ //glColor4fv(color(fret));
if (m_use3d) {
m_fretObj.draw(x, time2y(0.0), (1.0-l)/8.0);
} else {
|
|
From: Tapio V. <aa...@us...> - 2010-03-15 10:12:10
|
Module: performous
Branch: songdebug
Commit: d37f81296985daf76f92af4f9b94f0a416427e83
Author: Tapio Vierros <tap...@gm...>
Date: Thu Dec 31 13:12:03 2009 +0200
Chord count.
---
game/guitargraph.cc | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index 66d484d..320d9b5 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -836,5 +836,11 @@ void GuitarGraph::updateChords() {
}
m_chordIt = m_chords.begin();
m_scoreFactor = 10000.0 / m_scoreFactor; // normalize maximum score factor
+
+
+ std::ostringstream oss;
+ oss << "CHORDS " << m_chords.size() << std::endl;
+ std::cerr << oss.str(); // More likely to be atomic when written as one string
+
}
|
|
From: Tapio V. <aa...@us...> - 2010-03-15 10:12:09
|
Module: performous Branch: refactordance Commit: 2ef6213ca3ae078eb853432e735db3ab3942312e Author: Tapio Vierros <tap...@gm...> Date: Tue Jan 12 18:17:20 2010 +0200 Merge branch 'master' into refactordance --- |
|
From: Tapio V. <aa...@us...> - 2010-03-15 10:12:08
|
Module: performous
Branch: pausemenu
Commit: 2257ae205c7ea2dbcae72c0528cccb6d989c9af7
Author: Tapio Vierros <tap...@gm...>
Date: Sun Jan 3 20:41:46 2010 +0200
WIP2
---
game/theme.cc | 5 +----
1 files changed, 1 insertions(+), 4 deletions(-)
diff --git a/game/theme.cc b/game/theme.cc
index c8705ff..1536489 100755
--- a/game/theme.cc
+++ b/game/theme.cc
@@ -59,15 +59,12 @@ ThemeIntro::ThemeIntro():
}
ThemePause::ThemePause():
- Theme(getThemePath("intro_bg.svg")),
+ Theme(getThemePath("sing_pause_bg.svg")),
back_h(getThemePath("menu_back_highlight.svg")),
option_selected(getThemePath("menu_option_selected.svg"), config["graphic/text_lod"].f()),
- comment(getThemePath("menu_comment.svg"), config["graphic/text_lod"].f()),
- comment_bg(getThemePath("menu_comment_bg.svg"))
{
back_h.dimensions.fixedHeight(0.08f);
option.push_back(new SvgTxtTheme(getThemePath("menu_option.svg"), config["graphic/text_lod"].f()));
option.push_back(new SvgTxtTheme(getThemePath("menu_option.svg"), config["graphic/text_lod"].f()));
option.push_back(new SvgTxtTheme(getThemePath("menu_option.svg"), config["graphic/text_lod"].f()));
- option.push_back(new SvgTxtTheme(getThemePath("menu_option.svg"), config["graphic/text_lod"].f()));
}
|
|
From: Tapio V. <aa...@us...> - 2010-03-15 10:12:07
|
Module: performous Branch: parse-only-header Commit: 897978b2d947e2754f5e5756e2a61899bf55afe7 Author: Tapio Vierros <tap...@gm...> Date: Wed Jan 27 15:47:40 2010 +0200 Update fi translation. --- lang/fi.po | 192 ++++++++++++++++++++++++++++++++++-------------------------- 1 files changed, 108 insertions(+), 84 deletions(-) diff --git a/lang/fi.po b/lang/fi.po index a4bd93a..cf3d99f 100644 --- a/lang/fi.po +++ b/lang/fi.po @@ -2,9 +2,9 @@ msgid "" msgstr "" "Project-Id-Version: Performous\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-01-21 07:58+0200\n" +"POT-Creation-Date: 2010-01-27 15:43+0200\n" "PO-Revision-Date: \n" -"Last-Translator: Lasse Kärkkäinen <tro...@tr...>\n" +"Last-Translator: Tapio Vierros <tap...@gm...>\n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -13,79 +13,35 @@ msgstr "" "X-Poedit-Basepath: .\n" "X-Poedit-SearchPath-0: ../game\n" -#: ../game/main.cc:141 -msgid "Loading..." -msgstr "Käynnistyy..." - -#: ../game/main.cc:171 -msgid "Screenshot taken!" -msgstr "Kuvakaappaus tallennettu!" - -#: ../game/main.cc:174 -msgid "Screenshot failed!" -msgstr "Kuvakaappaus epäonnistui!" - -#: ../game/screen_players.cc:110 -msgid "No players found!" -msgstr "Pelaajia ei löytynyt!" - -#: ../game/screen_players.cc:111 -msgid "Enter a name to create a new player." -msgstr "Syötä nimi luodaksesi uuden pelaajan." - -#: ../game/screen_players.cc:113 -msgid "Press enter to create player!" -msgstr "Paina Enter luodaksesi pelaajan!" - -#: ../game/screen_players.cc:120 -msgid "You reached %1% points!" -msgstr "Sait %1% pistettä!" - -#: ../game/screen_players.cc:121 -msgid "Change player with arrow keys." -msgstr "Valitse pelaaja nuolinäppäimillä." - -#: ../game/screen_players.cc:122 -msgid "Name:" -msgstr "Nimi:" - -#: ../game/screen_players.cc:125 -msgid "Type text to filter or create a new player." -msgstr "Kirjoita etsiäksesi tai luodaksesi uuden pelaajan." - -#: ../game/screen_players.cc:125 -msgid "Search Text:" -msgstr "Etsi:" - -#: ../game/screen_intro.cc:10 +#: ../game/screen_intro.cc:15 msgid "Perform" msgstr "Esiinny" -#: ../game/screen_intro.cc:10 +#: ../game/screen_intro.cc:15 msgid "Start performing!" msgstr "Aloita esiintyminen!" -#: ../game/screen_intro.cc:11 +#: ../game/screen_intro.cc:16 msgid "Practice" msgstr "Harjoittele" -#: ../game/screen_intro.cc:11 +#: ../game/screen_intro.cc:16 msgid "Check your skills or test the microphones" msgstr "Tarkista taitosi tai testaa mikrofonit" -#: ../game/screen_intro.cc:12 +#: ../game/screen_intro.cc:17 msgid "Configure" msgstr "Asetukset" -#: ../game/screen_intro.cc:12 +#: ../game/screen_intro.cc:17 msgid "Configure game options" msgstr "Muokkaa pelin asetuksia" -#: ../game/screen_intro.cc:13 +#: ../game/screen_intro.cc:18 msgid "Quit" msgstr "Lopeta" -#: ../game/screen_intro.cc:13 +#: ../game/screen_intro.cc:18 msgid "Leave the game" msgstr "Poistu pelistä" @@ -105,96 +61,108 @@ msgstr "" "\n" "Säädä ääniasetuksia ennen pelaamista." -#: ../game/screen_sing.cc:313 +#: ../game/screen_sing.cc:34 +msgid "Loading song..." +msgstr "Ladataan kappaletta..." + +#: ../game/screen_sing.cc:42 +msgid "Song is broken!" +msgstr "Kappale on rikki!" + +#: ../game/screen_sing.cc:47 +msgid "Song contains broken tracks!" +msgstr "Kappaleessa on rikkinäisiä osia!" + +#: ../game/screen_sing.cc:326 msgid " ENTER to skip instrumental break" msgstr " ENTER hypätäksesi lauluosaan" -#: ../game/screen_sing.cc:314 +#: ../game/screen_sing.cc:327 msgid " Remember to wait for grading!" msgstr " Muista odottaa arvostelua!" -#: ../game/screen_sing.cc:402 +#: ../game/screen_sing.cc:415 msgid "No player!" msgstr "Pelaajia ei löytynyt!" -#: ../game/screen_sing.cc:411 +#: ../game/screen_sing.cc:424 msgid "Hit singer" msgstr "Tähti" -#: ../game/screen_sing.cc:412 +#: ../game/screen_sing.cc:425 msgid "Lead singer" msgstr "Solisti" -#: ../game/screen_sing.cc:413 -#: ../game/screen_sing.cc:419 -#: ../game/screen_sing.cc:425 +#: ../game/screen_sing.cc:426 +#: ../game/screen_sing.cc:432 +#: ../game/screen_sing.cc:438 msgid "Rising star" msgstr "Harrastaja" -#: ../game/screen_sing.cc:414 -#: ../game/screen_sing.cc:420 -#: ../game/screen_sing.cc:426 +#: ../game/screen_sing.cc:427 +#: ../game/screen_sing.cc:433 +#: ../game/screen_sing.cc:439 msgid "Amateur" msgstr "Amatööri" -#: ../game/screen_sing.cc:415 -#: ../game/screen_sing.cc:427 +#: ../game/screen_sing.cc:428 +#: ../game/screen_sing.cc:440 msgid "Tone deaf" msgstr "Lahjaton" -#: ../game/screen_sing.cc:417 +#: ../game/screen_sing.cc:430 msgid "Maniac" msgstr "Maanikko" -#: ../game/screen_sing.cc:418 +#: ../game/screen_sing.cc:431 msgid "Hoofer" msgstr "Ekspertti" -#: ../game/screen_sing.cc:421 +#: ../game/screen_sing.cc:434 msgid "Loser" msgstr "Luuseri" -#: ../game/screen_sing.cc:423 +#: ../game/screen_sing.cc:436 msgid "Virtuoso" msgstr "Virtuoosi" -#: ../game/screen_sing.cc:424 +#: ../game/screen_sing.cc:437 msgid "Rocker" msgstr "Rokkari" -#: ../game/songs.cc:192 +#: ../game/songs.cc:195 msgid "random order" msgstr "satunnainen järjestys" -#: ../game/songs.cc:193 +#: ../game/songs.cc:196 msgid "sorted by song" msgstr "järjestetty kappaleen mukaan" -#: ../game/songs.cc:194 +#: ../game/songs.cc:197 msgid "sorted by artist" msgstr "järjestetty esittäjän mukaan" -#: ../game/songs.cc:195 +#: ../game/songs.cc:198 msgid "sorted by edition" msgstr "järjestetty julkaisun mukaan" -#: ../game/songs.cc:196 +#: ../game/songs.cc:199 msgid "sorted by genre" msgstr "järjestetty lajityypin mukaan" -#: ../game/songs.cc:197 +#: ../game/songs.cc:200 msgid "sorted by path" msgstr "järjestetty polun mukaan" -#: ../game/songs.cc:198 +#: ../game/songs.cc:201 msgid "sorted by language" msgstr "järjestetty kielen mukaan" -#: ../game/screen_songs.cc:188 +#: ../game/screen_songs.cc:186 msgid "No songs found!" msgstr "Kappaleita ei löytynyt!" -#: ../game/screen_songs.cc:189 +#: ../game/screen_songs.cc:187 msgid "" "Visit performous.org\n" "for free songs" @@ -202,18 +170,74 @@ msgstr "" "Hae ilmaista musiikkia\n" "osoitteesta performous.org" -#: ../game/screen_songs.cc:191 +#: ../game/screen_songs.cc:189 msgid "no songs match search" msgstr "yksikään kappale ei vastannut hakuasi" -#: ../game/screen_songs.cc:199 +#: ../game/screen_songs.cc:197 msgid "(press END to view hiscores)" msgstr "(paina END nähdäksesi ennätykset)" -#: ../game/screen_songs.cc:200 +#: ../game/screen_songs.cc:198 msgid "<type in to search>" msgstr "<kirjoita etsiäksesi>" +#: ../game/screen_players.cc:110 +msgid "No players found!" +msgstr "Pelaajia ei löytynyt!" + +#: ../game/screen_players.cc:111 +msgid "Enter a name to create a new player." +msgstr "Syötä nimi luodaksesi uuden pelaajan." + +#: ../game/screen_players.cc:113 +msgid "Press enter to create player!" +msgstr "Paina Enter luodaksesi pelaajan!" + +#: ../game/screen_players.cc:120 +msgid "You reached %1% points!" +msgstr "Sait %1% pistettä!" + +#: ../game/screen_players.cc:121 +msgid "Change player with arrow keys." +msgstr "Valitse pelaaja nuolinäppäimillä." + +#: ../game/screen_players.cc:122 +msgid "Name:" +msgstr "Nimi:" + +#: ../game/screen_players.cc:125 +msgid "Type text to filter or create a new player." +msgstr "Kirjoita etsiäksesi tai luodaksesi uuden pelaajan." + +#: ../game/screen_players.cc:125 +msgid "Search Text:" +msgstr "Etsi:" + +#: ../game/main.cc:154 +msgid "Audio capture..." +msgstr "Ãänen kaappaus..." + +#: ../game/main.cc:156 +msgid "Audio playback..." +msgstr "Ãänentoisto..." + +#: ../game/main.cc:159 +msgid "Miscellaneous..." +msgstr "Sekalaista..." + +#: ../game/main.cc:174 +msgid "Main menu..." +msgstr "Päävalikko..." + +#: ../game/main.cc:185 +msgid "Screenshot taken!" +msgstr "Kuvakaappaus tallennettu!" + +#: ../game/main.cc:188 +msgid "Screenshot failed!" +msgstr "Kuvakaappaus epäonnistui!" + #: ../game/screen_hiscore.cc:88 msgid "Hiscore for " msgstr "Ennätykset kappaleelle " |
|
From: Tapio V. <aa...@us...> - 2010-03-15 10:12:05
|
Module: performous
Branch: lrc
Commit: 15836db6c38af9b4280a764dce8166768bf492d5
Author: Tapio Vierros <tap...@gm...>
Date: Thu Dec 31 02:20:10 2009 +0200
WIP LRC lyrics parser.
---
game/notes.cc | 2 +-
game/notes.hh | 2 +-
game/songparser-lrc.cc | 101 ++++++++++++++++++++++++++++++++++++++++++++++++
game/songparser.hh | 13 +++++-
4 files changed, 114 insertions(+), 4 deletions(-)
diff --git a/game/notes.cc b/game/notes.cc
index 7719f04..6fc70bc 100644
--- a/game/notes.cc
+++ b/game/notes.cc
@@ -69,7 +69,7 @@ double Note::scoreMultiplier(double error) const {
case FREESTYLE: power += 1.0; return 1.0;
case NORMAL: case SLIDE: max = 1.0; break;
case GOLDEN: max = 2.0; break;
- case SLEEP: case TAP: case HOLDBEGIN: case HOLDEND: case ROLL: case MINE: case LIFT: break;
+ case SLEEP: case KARAOKE: case TAP: case HOLDBEGIN: case HOLDEND: case ROLL: case MINE: case LIFT: break;
}
double accuracy = clamp(1.5 - error, 0.0, 1.0);
power += accuracy;
diff --git a/game/notes.hh b/game/notes.hh
index e80e584..330e079 100644
--- a/game/notes.hh
+++ b/game/notes.hh
@@ -75,7 +75,7 @@ struct Note {
/// how well the note was sung [0,1] (used for drawing a star)
mutable float accuracy;
/// note type
- enum Type { FREESTYLE = 'F', NORMAL = ':', GOLDEN = '*', SLIDE = '+', SLEEP = '-',
+ enum Type { FREESTYLE = 'F', NORMAL = ':', GOLDEN = '*', SLIDE = '+', SLEEP = '-', KARAOKE = '[',
TAP = '1', HOLDBEGIN = '2', HOLDEND = '3', ROLL = '4', MINE = 'M', LIFT = 'L'} type;
int note; ///< MIDI pitch of the note (at the end for slide notes)
int notePrev; ///< MIDI pitch of the previous note (should be same as note for everything but SLIDE)
diff --git a/game/songparser-lrc.cc b/game/songparser-lrc.cc
new file mode 100644
index 0000000..ce2e7b5
--- /dev/null
+++ b/game/songparser-lrc.cc
@@ -0,0 +1,101 @@
+#include "songparser.hh"
+
+#include <boost/lexical_cast.hpp>
+#include <boost/algorithm/string.hpp>
+#include <algorithm>
+#include <stdexcept>
+
+/// @file
+/// Functions used for parsing the UltraStar TXT song format
+
+namespace {
+ void assign(int& var, std::string const& str) {
+ try {
+ var = boost::lexical_cast<int>(str);
+ } catch (...) {
+ throw std::runtime_error("\"" + str + "\" is not valid integer value");
+ }
+ }
+ void assign(double& var, std::string str) {
+ std::replace(str.begin(), str.end(), ',', '.'); // Fix decimal separators
+ try {
+ var = boost::lexical_cast<double>(str);
+ } catch (...) {
+ throw std::runtime_error("\"" + str + "\" is not valid floating point value");
+ }
+ }
+ void assign(bool& var, std::string const& str) {
+ if (str == "YES" || str == "yes" || str == "1") var = true;
+ else if (str == "NO" || str == "no" || str == "0") var = false;
+ else throw std::runtime_error("Invalid boolean value: " + str);
+ }
+ double getSeconds(std::string const& timestamp) {
+ std::string::size_type pos = timestamp.find(':');
+ if (pos == std::string::npos) throw std::runtime_error("Invalid format, should be [mm:ss.xx] lyrics");
+ std::string mins_st = boost::trim_copy(timestamp.substr(1, pos - 1));
+ std::string secs_st = boost::trim_copy(timestamp.substr(pos + 1));
+ int mins = 0; assign(mins, mins_st);
+ double secs = 0; assign(secs, secs_st);
+ return 60.0 * mins + secs;
+ }
+}
+
+bool SongParser::lrcCheck(std::vector<char> const& data) {
+ return data[0] == '[';
+}
+
+void SongParser::lrcParse() {
+ Song& s = m_song;
+ std::string line;
+ while (getline(line) && lrcParseField(line)) {}
+ //if (s.title.empty() || s.artist.empty()) throw std::runtime_error("Required header fields missing");
+ if (s.title.empty()) s.title = "LRC";
+ if (s.artist.empty()) s.artist = "LRC";
+ if (m_bpm != 0.0) addBPM(0, m_bpm);
+ while (lrcParseNote(line) && getline(line)) {}
+}
+
+bool SongParser::lrcParseField(std::string const& line) {
+ if (line.empty()) return true;
+ if (line[0] != '[') return false;
+ 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));
+ std::string value = boost::trim_copy(line.substr(pos + 1));
+ value = value.substr(0, line.size()-1); // Strip trailing ']'
+ if (value.empty()) return true;
+ if (key == "ti") m_song.title = value.substr(value.find_first_not_of(" "));
+ else if (key == "ar") m_song.artist = value.substr(value.find_first_not_of(" "));
+ else if (key == "by") m_song.creator = value.substr(value.find_first_not_of(" "));
+ //else if (key == "MP3") m_song.music["background"] = m_song.path + value;
+ else if (key == "offset") { assign(m_gap, value.substr(value.find_first_not_of(" :+"))); m_gap *= 1e-3; }
+ return true;
+}
+
+bool SongParser::lrcParseNote(std::string line) {
+ if (line.empty() || line == "\r") return true;
+ if (line[line.size() - 1] == '\r') line.erase(line.size() - 1);
+ if (line[0] != '[') return false;
+ //std::istringstream iss(line);
+
+ if (!m_song.notes.empty()) {
+ Note n; n.type = Note::SLEEP;
+ n.begin = m_song.notes.back().end;
+ n.end = n.begin;
+ m_song.notes.push_back(n);
+ }
+
+ Note n;
+ n.type = Note::KARAOKE;
+ std::string::size_type pos = line.find(']');
+ if (pos == std::string::npos) throw std::runtime_error("Invalid format, should be [mm:ss.xx] lyrics");
+ n.begin = getSeconds(line.substr(1,pos-2));
+ n.end = n.begin + 2;
+ n.notePrev = n.note;
+ n.syllable = boost::trim_copy(line.substr(pos + 1));
+
+ m_song.notes.push_back(n);
+
+ return true;
+}
+
diff --git a/game/songparser.hh b/game/songparser.hh
index 1e05a05..d07a1e9 100644
--- a/game/songparser.hh
+++ b/game/songparser.hh
@@ -22,7 +22,7 @@ class SongParser {
m_relativeShift(),
m_maxScore()
{
- enum { NONE, TXT, INI, SM } type = NONE;
+ enum { NONE, TXT, INI, SM, LRC } type = NONE;
// Read the file, determine the type and do some initial validation checks
{
std::ifstream f((s.path + s.filename).c_str(), std::ios::binary);
@@ -36,6 +36,7 @@ class SongParser {
if (smCheck(data)) type = SM;
else if (txtCheck(data)) type = TXT;
else if (iniCheck(data)) type = INI;
+ //else if (lrcCheck(data)) type = LRC;
else throw SongParserException("Does not look like a song file (wrong header)", 1, true);
m_ss.write(&data[0], size);
}
@@ -44,15 +45,17 @@ class SongParser {
if (type == TXT) txtParse();
if (type == INI) iniParse();
if (type == SM) smParse();
+ //if (type == LRC) lrcParse();
} catch (std::runtime_error& e) {
throw SongParserException(e.what(), m_linenum);
}
// In case no images/videos were specified, try to guess them
- if (m_song.cover.empty() || (m_song.background.empty() && m_song.video.empty())) {
+ if (m_song.cover.empty() || (m_song.background.empty() && m_song.video.empty()) || m_song.notes.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|mp4))$", boost::regex_constants::icase);
+ boost::regex lyricsfile("(.*\\.(lrc))$", boost::regex_constants::icase);
boost::cmatch match;
for (boost::filesystem::directory_iterator dirIt(s.path), dirEnd; dirIt != dirEnd; ++dirIt) {
@@ -64,6 +67,8 @@ class SongParser {
m_song.background = name;
} else if (m_song.background.empty() && m_song.video.empty() && regex_match(name.c_str(), match, videofile)) {
m_song.video = name;
+ } else if (m_song.notes.empty() && regex_match(name.c_str(), match, lyricsfile)) {
+ //TODO
}
}
}
@@ -101,6 +106,10 @@ class SongParser {
void smParse();
bool smParseField(std::string line);
Notes smParseNotes(std::string line);
+ bool lrcCheck(std::vector<char> const& data);
+ void lrcParse();
+ bool lrcParseField(std::string const& line);
+ bool lrcParseNote(std::string line);
double m_prevtime;
unsigned int m_prevts;
unsigned int m_relativeShift;
|
|
From: Tapio V. <aa...@us...> - 2010-03-15 10:12:05
|
Module: performous Branch: holdglow Commit: 61836686975ddb64bc1bb5a7227c292982904a75 Author: Tapio Vierros <tap...@gm...> Date: Tue Dec 29 19:46:13 2009 +0200 Added hold glow texture. --- themes/default/button_l_glow.svg | 146 ++++++++++++++++++++++++++++++++++++++ 1 files changed, 146 insertions(+), 0 deletions(-) diff --git a/themes/default/button_l_glow.svg b/themes/default/button_l_glow.svg new file mode 100644 index 0000000..e0cf159 --- /dev/null +++ b/themes/default/button_l_glow.svg @@ -0,0 +1,146 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="64" + height="128" + id="svg2463" + sodipodi:version="0.32" + inkscape:version="0.47 r22583" + version="1.0" + sodipodi:docname="button_l_glow.svg" + inkscape:output_extension="org.inkscape.output.svg.inkscape"> + <defs + id="defs2465"> + <linearGradient + id="linearGradient3594"> + <stop + style="stop-color:#ffffff;stop-opacity:0;" + offset="0" + id="stop3596" /> + <stop + id="stop3610" + offset="0.30000001" + style="stop-color:#ffffff;stop-opacity:0.78431374;" /> + <stop + style="stop-color:#ffffff;stop-opacity:0.78431374;" + offset="0.69999999" + id="stop3608" /> + <stop + style="stop-color:#ffffff;stop-opacity:0;" + offset="1" + id="stop3598" /> + </linearGradient> + <linearGradient + id="linearGradient3262"> + <stop + style="stop-color:#f5f5f5;stop-opacity:0.22680412;" + offset="0" + id="stop3264" /> + <stop + style="stop-color:#f5f5f5;stop-opacity:0.96078432;" + offset="1" + id="stop3266" /> + </linearGradient> + <linearGradient + id="linearGradient3751" + inkscape:collect="always"> + <stop + id="stop3753" + offset="0" + style="stop-color:black;stop-opacity:1;" /> + <stop + id="stop3755" + offset="1" + style="stop-color:black;stop-opacity:0;" /> + </linearGradient> + <inkscape:perspective + sodipodi:type="inkscape:persp3d" + inkscape:vp_x="0 : 526.18109 : 1" + inkscape:vp_y="0 : 1000 : 0" + inkscape:vp_z="744.09448 : 526.18109 : 1" + inkscape:persp3d-origin="372.04724 : 350.78739 : 1" + id="perspective2471" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3751" + id="linearGradient3272" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.3868046,0,0,0.3868046,40.335717,481.59837)" + x1="665.12128" + y1="684.16162" + x2="381.28015" + y2="449.80624" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3751" + id="linearGradient2406" + gradientUnits="userSpaceOnUse" + gradientTransform="matrix(0.3868046,0,0,0.3868046,43.114888,485.8841)" + x1="665.12128" + y1="684.16162" + x2="381.28015" + y2="449.80624" /> + <linearGradient + inkscape:collect="always" + xlink:href="#linearGradient3594" + id="linearGradient3606" + x1="3.53125" + y1="63.062496" + x2="60.46875" + y2="63.062496" + gradientUnits="userSpaceOnUse" /> + </defs> + <sodipodi:namedview + id="base" + pagecolor="#f5f5f5" + bordercolor="#666666" + borderopacity="1.0" + gridtolerance="10000" + guidetolerance="10" + objecttolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:zoom="5.6" + inkscape:cx="-41.579411" + inkscape:cy="87.803131" + inkscape:document-units="px" + inkscape:current-layer="layer1" + showgrid="false" + inkscape:window-width="1440" + inkscape:window-height="854" + inkscape:window-x="0" + inkscape:window-y="0" + inkscape:window-maximized="1" /> + <metadata + id="metadata2468"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1" + transform="translate(-110.35967,-771.51188)"> + <path + style="opacity:1;fill:url(#linearGradient3606);fill-opacity:1;stroke:none;stroke-width:2;stroke-miterlimit:3.29999995000000013;stroke-dasharray:none;stroke-opacity:1" + d="m 14,1.65625 c -3.675834,0 -9,-0.1129717 -9,29.660715 L 5,77.9375 C 4.3465411,84.282789 3.53125,89.140688 3.53125,96 c 0,15.71475 12.750558,28.46875 28.46875,28.46875 15.718191,0 28.468748,-12.754 28.46875,-28.46875 0,-6.859312 -0.815291,-12.431496 -1.46875,-18.0625 L 59,31.316965 C 59,1.5286903 53.675836,1.65625 50,1.65625 l -36,0 z" + transform="translate(110.35967,771.51188)" + id="rect2389" + sodipodi:nodetypes="cccssscczz" /> + </g> +</svg> |
|
From: Tapio V. <aa...@us...> - 2010-03-15 10:12:02
|
Module: performous
Branch: holdesc
Commit: 303584a5e0d9d3e4db9c3d261f0839b169296416
Author: Tapio Vierros <tap...@gm...>
Date: Sun Jan 10 01:28:46 2010 +0200
WIP
---
game/joystick.cc | 12 ++++++++++--
game/joystick.hh | 3 +++
game/main.cc | 13 +++++++++++++
3 files changed, 26 insertions(+), 2 deletions(-)
diff --git a/game/joystick.cc b/game/joystick.cc
index 1a6cdfd..ada967a 100644
--- a/game/joystick.cc
+++ b/game/joystick.cc
@@ -68,6 +68,7 @@ int input::buttonFromSDL(input::Private::Type _type, unsigned int _sdl_button) {
input::Private::InputDevs input::Private::devices;
input::SDL::SDL_devices input::SDL::sdl_devices;
+//input::cancel_hold = AnimValue(0.0, 1.0);
/// Abstract navigation actions for different input devices, including keyboard
input::NavButton input::getNav(SDL_Event const &e) {
@@ -80,7 +81,7 @@ input::NavButton input::getNav(SDL_Event const &e) {
else if (k == SDLK_LEFT) return input::LEFT;
else if (k == SDLK_RIGHT) return input::RIGHT;
else if (k == SDLK_RETURN) return input::START;
- else if (k == SDLK_ESCAPE) return input::CANCEL;
+ else if (k == SDLK_ESCAPE) { input::cancel_hold.setTarget(1.0); return input::CANCEL; }
else if (k == SDLK_PAGEUP) return input::MOREUP;
else if (k == SDLK_PAGEDOWN) return input::MOREDOWN;
else if (k == SDLK_PAUSE || (k == SDLK_p && mod & KMOD_CTRL)) return input::PAUSE;
@@ -92,7 +93,7 @@ input::NavButton input::getNav(SDL_Event const &e) {
input::Private::InputDevPrivate devt = input::Private::devices[joy_id];
int b = buttonFromSDL(devt.type(), e.jbutton.button);
if (b == -1) return input::NONE;
- else if (b == 8) return input::CANCEL;
+ else if (b == 8) { input::cancel_hold.setTarget(1.0); return input::CANCEL; }
else if (b == 9) return input::START;
// Totally different device types need their own custom mappings
if (devt.type_match(input::DANCEPAD)) {
@@ -139,11 +140,18 @@ input::NavButton input::getNav(SDL_Event const &e) {
else if (dir == SDL_HAT_LEFT) return input::LEFT;
else if (dir == SDL_HAT_RIGHT) return input::RIGHT;
}
+ // Reset cancel holding counter
+ } else if (e.type == SDL_KEYUP) {
+ if (e.key.keysym.sym == SDLK_ESCAPE) input::cancel_hold.setTarget(0.0, true);
+ } else if (e.type == SDL_JOYBUTTONUP) {
+ if (buttonFromSDL(input::Private::devices[e.jbutton.which].type(), e.jbutton.button) == 8)
+ input::cancel_hold.setTarget(0.0, true);
}
return input::NONE;
}
void input::SDL::init_devices() {
+ input::cancel_hold = AnimValue(0.0, 1.0);
for (input::Private::InputDevs::iterator it = input::Private::devices.begin() ; it != input::Private::devices.end() ; ++it) {
unsigned int id = it->first;
if(it->second.assigned()) continue;
diff --git a/game/joystick.hh b/game/joystick.hh
index a7ddb7f..39cc56c 100644
--- a/game/joystick.hh
+++ b/game/joystick.hh
@@ -10,6 +10,7 @@
#include "xtime.hh"
#include "configuration.hh"
+#include "animvalue.hh"
#ifdef USE_PORTMIDI
#include "portmidi.hh"
@@ -22,6 +23,8 @@ namespace input {
static const std::size_t BUTTONS = 10;
static const int STARPOWER_BUTTON = 5;
+ static AnimValue cancel_hold(0.0, 1.0);
+
struct Event {
enum Type { PRESS, RELEASE, PICK, WHAMMY };
Type type;
diff --git a/game/main.cc b/game/main.cc
index 05b36cd..7deade6 100644
--- a/game/main.cc
+++ b/game/main.cc
@@ -85,6 +85,19 @@ static void checkEvents_SDL(ScreenManager& sm, Window& window) {
case GL_OUT_OF_MEMORY: std::cerr << "OpenGL error: invalid enum" << std::endl; break;
}
}
+ // If cancel button is held down, generate a "start" event
+ // which confirms exit
+ if (input::cancel_hold.get() == 1.0) {
+ SDL_Event newe;
+ newe.type = SDL_KEYDOWN;
+ SDL_keysym newk;
+ newk.sym = SDLK_RETURN;
+ newe.key.keysym = newk;
+ //newe.key.keysym.sym = SDLK_RETURN;
+ input::SDL::pushEvent(newe);
+ std::cout << "HOLDED" << std::endl;
+ }
+ // Switch fullscreen/windowed mode
if( config["graphic/fullscreen"].b() != window.getFullscreen() )
window.setFullscreen(config["graphic/fullscreen"].b());
}
|
|
From: Tapio V. <aa...@us...> - 2010-03-15 10:12:01
|
Module: performous
Branch: hitglow
Commit: 4a160b3dffc5cf2f7eb245189da9d96ce13ab7e5
Author: Tapio Vierros <tap...@gm...>
Date: Sun Jan 31 11:17:10 2010 +0200
WIP
---
game/guitargraph.cc | 28 ++++++---
game/guitargraph.hh | 18 +++---
themes/default/hit_glow.svg | 144 +++++++++++++++++++++++++++++++++++++++++++
3 files changed, 174 insertions(+), 16 deletions(-)
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index d4f1b9f..aff2993 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -54,13 +54,14 @@ GuitarGraph::GuitarGraph(Audio& audio, Song const& song, bool drums, int number)
m_audio(audio),
m_input(drums ? input::DRUMS : input::GUITAR),
m_song(song),
- m_button(getThemePath("button.svg")),
m_tail(getThemePath("tail.svg")),
m_tail_glow(getThemePath("tail_glow.svg")),
m_tail_drumfill(getThemePath("tail_drumfill.svg")),
m_flame(getThemePath("flame.svg")),
m_flame_godmode(getThemePath("flame_godmode.svg")),
+ m_button(getThemePath("button.svg")),
m_tap(getThemePath("tap.svg")),
+ m_hitglow(getThemePath("hit_glow.svg")),
m_neckglow(getThemePath("neck_glow.svg")),
m_neckglowColor(),
m_drums(drums),
@@ -118,8 +119,11 @@ GuitarGraph::GuitarGraph(Audio& audio, Song const& song, bool drums, int number)
m_samples.push_back(Sample(getPath("sounds/guitar_fail5.ogg"), sr));
m_samples.push_back(Sample(getPath("sounds/guitar_fail6.ogg"), sr));
}
- for (int i = 0; i < 6; ++i) m_hit[i].setRate(5.0);
- for (int i = 0; i < 5; ++i) m_holds[i] = 0;
+ for (int i = 0; i < 6; ++i) m_press[i].setRate(5.0);
+ for (int i = 0; i < 5; ++i) {
+ m_holds[i] = 0;
+ m_hit[i] = AnimValue(0.0, 1.0);
+ }
m_track_index = m_track_map.begin();
while (number--) nextTrack(true);
difficultyAuto();
@@ -189,7 +193,7 @@ void GuitarGraph::engine() {
// Handle key markers
if (!m_drums) {
for (int i = 0; i < 5; ++i) {
- if (m_input.pressed(i)) m_hit[i + 1].setValue(1.0);
+ if (m_input.pressed(i)) m_press[i + 1].setValue(1.0);
}
}
if (!m_drumfills.empty()) updateDrumFill(time); // Drum Fills / BREs
@@ -219,8 +223,8 @@ void GuitarGraph::engine() {
if (ev.type == input::Event::WHAMMY) whammy = (1.0 + ev.button + 2.0*(rand()/double(RAND_MAX))) / 4.0;
}
// Keypress anims
- 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 (ev.type == input::Event::PRESS) m_press[!m_drums + ev.button].setValue(1.0);
+ else if (ev.type == input::Event::PICK) m_press[0].setValue(1.0);
// Difficulty and track selection
if (time < m_jointime) {
if (ev.type == input::Event::PICK || ev.type == input::Event::PRESS) {
@@ -621,13 +625,13 @@ void GuitarGraph::draw(double time) {
}
// Draw the cursor
- float level = m_hit[0].get();
+ float level = m_press[0].get();
glColor3f(level, level, level);
drawBar(0.0, 0.01f);
// Fret buttons on cursor
for (int fret = m_drums; fret < 5; ++fret) {
float x = -2.0f + fret - 0.5f * m_drums;
- float l = m_hit[fret + !m_drums].get();
+ float l = m_press[fret + !m_drums].get();
// Get a color for the fret and adjust it if GodMode is on
glColor4fv(colorize(color(fret), time));
m_button.dimensions.center(time2y(0.0)).middle(x);
@@ -635,6 +639,14 @@ void GuitarGraph::draw(double time) {
glColor3f(l, l, l);
m_tap.dimensions = m_button.dimensions;
m_tap.draw();
+
+ // Glow
+ if (m_drums || !m_holds[fret]) continue;
+ Event& ev = m_events[m_holds[fret] - 1];
+ float glow = ev.glow.get();
+ glColor3f(glow, glow, glow);
+ m_hitglow.dimensions.center(time2y(0.0)).middle(x).fixedWidth(3*fretWid);
+ m_hitglow.draw();
}
// Draw the notes
diff --git a/game/guitargraph.hh b/game/guitargraph.hh
index 3236464..c431764 100644
--- a/game/guitargraph.hh
+++ b/game/guitargraph.hh
@@ -76,18 +76,20 @@ class GuitarGraph {
Audio& m_audio;
input::InputDev m_input; /// input device (guitar/drums/keyboard)
Song const& m_song;
- Surface m_button;
- Texture m_tail;
- Texture m_tail_glow;
- Texture m_tail_drumfill;
- Texture m_flame;
- Texture m_flame_godmode;
+ Texture m_tail; /// hold note tail
+ Texture m_tail_glow; /// hold note tail when hitting
+ Texture m_tail_drumfill; /// drum fill note texture
+ Texture m_flame; /// hit flame
+ Texture m_flame_godmode; /// hit flame for godmode
+ Surface m_button; /// 2d note / cursor
Surface m_tap; /// image for 2d HOPO note cap
+ Surface m_hitglow; /// hit flame for godmode
Surface m_neckglow; /// image for the glow from the bottom of the neck
- glutil::Color m_neckglowColor;
+ glutil::Color m_neckglowColor; /// holds the current color for the glow from the bottom of the neck
Object3d m_fretObj; /// 3d object for regular note
Object3d m_tappableObj; /// 3d object for the HOPO note cap
- AnimValue m_hit[6];
+ AnimValue m_press[6]; /// key pressing animation
+ AnimValue m_hit[5]; /// note hitting animation for cursor
std::vector<Sample> m_samples; /// sound effects
boost::scoped_ptr<Texture> m_neck; /// necks
bool m_drums; /// are we using drums?
diff --git a/themes/default/hit_glow.svg b/themes/default/hit_glow.svg
new file mode 100644
index 0000000..bb62da9
--- /dev/null
+++ b/themes/default/hit_glow.svg
@@ -0,0 +1,144 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="64"
+ height="64"
+ id="svg2463"
+ sodipodi:version="0.32"
+ inkscape:version="0.47 r22583"
+ version="1.0"
+ sodipodi:docname="hit_glow.svg"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape">
+ <defs
+ id="defs2465">
+ <linearGradient
+ id="linearGradient3600">
+ <stop
+ style="stop-color:#ffffff;stop-opacity:0.78431374;"
+ offset="0"
+ id="stop3602" />
+ <stop
+ style="stop-color:#ffff00;stop-opacity:0.25098041;"
+ offset="1"
+ id="stop3604" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient3262">
+ <stop
+ style="stop-color:#f5f5f5;stop-opacity:0.22680412;"
+ offset="0"
+ id="stop3264" />
+ <stop
+ style="stop-color:#f5f5f5;stop-opacity:0.96078432;"
+ offset="1"
+ id="stop3266" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient3751"
+ inkscape:collect="always">
+ <stop
+ id="stop3753"
+ offset="0"
+ style="stop-color:black;stop-opacity:1;" />
+ <stop
+ id="stop3755"
+ offset="1"
+ style="stop-color:black;stop-opacity:0;" />
+ </linearGradient>
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 526.18109 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="744.09448 : 526.18109 : 1"
+ inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+ id="perspective2471" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3751"
+ id="linearGradient3272"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.3868046,0,0,0.3868046,40.335717,481.59837)"
+ x1="665.12128"
+ y1="684.16162"
+ x2="381.28015"
+ y2="449.80624" />
+ <linearGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3751"
+ id="linearGradient2406"
+ gradientUnits="userSpaceOnUse"
+ gradientTransform="matrix(0.3868046,0,0,0.3868046,43.114888,485.8841)"
+ x1="665.12128"
+ y1="684.16162"
+ x2="381.28015"
+ y2="449.80624" />
+ <radialGradient
+ inkscape:collect="always"
+ xlink:href="#linearGradient3600"
+ id="radialGradient3606"
+ cx="38.125"
+ cy="37.30357"
+ fx="38.125"
+ fy="37.30357"
+ r="20.446428"
+ gradientTransform="matrix(1,0,0,0.50218342,0,18.570335)"
+ gradientUnits="userSpaceOnUse" />
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#f5f5f5"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ gridtolerance="10000"
+ guidetolerance="10"
+ objecttolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="5.6"
+ inkscape:cx="20.407018"
+ inkscape:cy="40.003406"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="false"
+ inkscape:window-width="1021"
+ inkscape:window-height="720"
+ inkscape:window-x="87"
+ inkscape:window-y="34"
+ inkscape:window-maximized="0" />
+ <metadata
+ id="metadata2468">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(-110.35967,-771.51188)">
+ <path
+ sodipodi:type="arc"
+ style="fill:url(#radialGradient3606);fill-opacity:1;fill-rule:nonzero;stroke:none"
+ id="path3598"
+ sodipodi:cx="38.125"
+ sodipodi:cy="37.30357"
+ sodipodi:rx="20.446428"
+ sodipodi:ry="10.267858"
+ d="m 58.571428,37.30357 a 20.446428,10.267858 0 1 1 -40.892856,0 20.446428,10.267858 0 1 1 40.892856,0 z"
+ transform="matrix(1.5650655,0,0,3.1165216,82.691547,687.2545)" />
+ </g>
+</svg>
|
|
From: Tapio V. <aa...@us...> - 2010-03-15 10:11:59
|
Module: performous
Branch: dumpxml
Commit: 4e01e92b21b7e303091750c41f8e65e7247c684d
Author: Tapio Vierros <tap...@gm...>
Date: Wed Dec 30 23:02:28 2009 +0200
Remove leading numbers from titles and add tracks attribute to song xml.
---
game/song.cc | 12 +++++++++++-
game/songs.cc | 18 +++++++++++++++++-
2 files changed, 28 insertions(+), 2 deletions(-)
diff --git a/game/song.cc b/game/song.cc
index 5135535..52a529e 100644
--- a/game/song.cc
+++ b/game/song.cc
@@ -42,7 +42,17 @@ void Song::collateUpdate() {
}
std::string Song::collate(std::string const& str) {
- return unicodeCollate(str);
+ std::string title = str;
+ if (title[1] == '.' || title[1] == '-') {
+ if (title[2] == ' ') title = title.substr(3);
+ else title = title.substr(2);
+ }
+ if (title[2] == '.' || title[2] == '-') {
+ if (title[3] == ' ') title = title.substr(4);
+ else title = title.substr(3);
+ }
+
+ return unicodeCollate(title);
}
namespace {
diff --git a/game/songs.cc b/game/songs.cc
index 78609b9..e57d6da 100644
--- a/game/songs.cc
+++ b/game/songs.cc
@@ -262,11 +262,27 @@ namespace {
Song const& s = *svec[i];
xmlpp::Element* song = songlist->add_child("song");
song->set_attribute("num", boost::lexical_cast<std::string>(i + 1));
+ std::string tracks = "";
+ if (s.notes.size()) tracks += "S";
+ if (s.track_map.find("guitar") != s.track_map.end()) tracks += "G";
+ if (s.track_map.find("bass") != s.track_map.end()) tracks += "B";
+ if (s.track_map.find("drums") != s.track_map.end()) tracks += "R";
+ if (!s.danceTracks.empty()) tracks += "N";
+ song->set_attribute("tracks", tracks);
xmlpp::Element* collate = song->add_child("collate");
collate->add_child("artist")->set_child_text(s.collateByArtist);
collate->add_child("title")->set_child_text(s.collateByTitle);
song->add_child("artist")->set_child_text(s.artist);
- song->add_child("title")->set_child_text(s.title);
+ std::string title = s.title;
+ if (title[1] == '.' || title[1] == '-') {
+ if (title[2] == ' ') title = title.substr(3);
+ else title = title.substr(2);
+ }
+ if (title[2] == '.' || title[2] == '-') {
+ if (title[3] == ' ') title = title.substr(4);
+ else title = title.substr(3);
+ }
+ song->add_child("title")->set_child_text(title);
if (!s.cover.empty()) dumpCover(song, s, i + 1);
}
doc.write_to_file_formatted(filename, "UTF-8");
|
|
From: Tapio V. <aa...@us...> - 2010-03-15 10:11:56
|
Module: performous
Branch: master
Commit: 4cb0dbf66aa588b7d38f70ab175f8fceea4c4cbe
Author: Tapio Vierros <tap...@gm...>
Date: Mon Mar 15 12:08:48 2010 +0200
I18n to "no hiscore", update FI translation.
---
game/database.cc | 6 ++--
lang/fi.po | 56 ++++++++++++++++++++++++++++++-----------------------
2 files changed, 35 insertions(+), 27 deletions(-)
diff --git a/game/database.cc b/game/database.cc
index 92d22ad..42a689f 100644
--- a/game/database.cc
+++ b/game/database.cc
@@ -1,7 +1,7 @@
#include "database.hh"
+#include "i18n.hh"
#include <iostream>
-
#include <libxml++/libxml++.h>
Database::Database(fs::path filename) :
@@ -104,8 +104,8 @@ void Database::queryPerSongHiscore (std::ostream & os, boost::shared_ptr<Song> s
if (songid == -1 || hi.size() == 0)
{
- os << "No Items up to now.\n";
- os << "Be the first to be listed here!\n";
+ os << _("No Items up to now.") << '\n';
+ os << _("Be the first to be listed here!") << '\n';
return;
}
diff --git a/lang/fi.po b/lang/fi.po
index cf3d99f..0ca815c 100644
--- a/lang/fi.po
+++ b/lang/fi.po
@@ -2,7 +2,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Performous\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2010-01-27 15:43+0200\n"
+"POT-Creation-Date: 2010-03-15 12:07+0200\n"
"PO-Revision-Date: \n"
"Last-Translator: Tapio Vierros <tap...@gm...>\n"
"Language-Team: \n"
@@ -73,60 +73,60 @@ msgstr "Kappale on rikki!"
msgid "Song contains broken tracks!"
msgstr "Kappaleessa on rikkinäisiä osia!"
-#: ../game/screen_sing.cc:326
+#: ../game/screen_sing.cc:330
msgid " ENTER to skip instrumental break"
msgstr " ENTER hypätäksesi lauluosaan"
-#: ../game/screen_sing.cc:327
+#: ../game/screen_sing.cc:331
msgid " Remember to wait for grading!"
msgstr " Muista odottaa arvostelua!"
-#: ../game/screen_sing.cc:415
+#: ../game/screen_sing.cc:419
msgid "No player!"
msgstr "Pelaajia ei löytynyt!"
-#: ../game/screen_sing.cc:424
+#: ../game/screen_sing.cc:428
msgid "Hit singer"
msgstr "Tähti"
-#: ../game/screen_sing.cc:425
+#: ../game/screen_sing.cc:429
msgid "Lead singer"
msgstr "Solisti"
-#: ../game/screen_sing.cc:426
-#: ../game/screen_sing.cc:432
-#: ../game/screen_sing.cc:438
+#: ../game/screen_sing.cc:430
+#: ../game/screen_sing.cc:436
+#: ../game/screen_sing.cc:442
msgid "Rising star"
msgstr "Harrastaja"
-#: ../game/screen_sing.cc:427
-#: ../game/screen_sing.cc:433
-#: ../game/screen_sing.cc:439
+#: ../game/screen_sing.cc:431
+#: ../game/screen_sing.cc:437
+#: ../game/screen_sing.cc:443
msgid "Amateur"
msgstr "Amatööri"
-#: ../game/screen_sing.cc:428
-#: ../game/screen_sing.cc:440
+#: ../game/screen_sing.cc:432
+#: ../game/screen_sing.cc:444
msgid "Tone deaf"
msgstr "Lahjaton"
-#: ../game/screen_sing.cc:430
+#: ../game/screen_sing.cc:434
msgid "Maniac"
msgstr "Maanikko"
-#: ../game/screen_sing.cc:431
+#: ../game/screen_sing.cc:435
msgid "Hoofer"
msgstr "Ekspertti"
-#: ../game/screen_sing.cc:434
+#: ../game/screen_sing.cc:438
msgid "Loser"
msgstr "Luuseri"
-#: ../game/screen_sing.cc:436
+#: ../game/screen_sing.cc:440
msgid "Virtuoso"
msgstr "Virtuoosi"
-#: ../game/screen_sing.cc:437
+#: ../game/screen_sing.cc:441
msgid "Rocker"
msgstr "Rokkari"
@@ -158,11 +158,11 @@ msgstr "järjestetty polun mukaan"
msgid "sorted by language"
msgstr "järjestetty kielen mukaan"
-#: ../game/screen_songs.cc:186
+#: ../game/screen_songs.cc:187
msgid "No songs found!"
msgstr "Kappaleita ei löytynyt!"
-#: ../game/screen_songs.cc:187
+#: ../game/screen_songs.cc:188
msgid ""
"Visit performous.org\n"
"for free songs"
@@ -170,15 +170,15 @@ msgstr ""
"Hae ilmaista musiikkia\n"
"osoitteesta performous.org"
-#: ../game/screen_songs.cc:189
+#: ../game/screen_songs.cc:190
msgid "no songs match search"
msgstr "yksikään kappale ei vastannut hakuasi"
-#: ../game/screen_songs.cc:197
+#: ../game/screen_songs.cc:198
msgid "(press END to view hiscores)"
msgstr "(paina END nähdäksesi ennätykset)"
-#: ../game/screen_songs.cc:198
+#: ../game/screen_songs.cc:199
msgid "<type in to search>"
msgstr "<kirjoita etsiäksesi>"
@@ -242,6 +242,14 @@ msgstr "Kuvakaappaus epäonnistui!"
msgid "Hiscore for "
msgstr "Ennätykset kappaleelle "
+#: ../game/database.cc:107
+msgid "No Items up to now."
+msgstr "Ei pisteitä tähän mennessä."
+
+#: ../game/database.cc:108
+msgid "Be the first to be listed here!"
+msgstr "Ole ensimmäinen!"
+
#~ msgid "filter: "
#~ msgstr "suodatin: "
#~ msgid "none"
|
|
From: Tapio V. <aa...@us...> - 2010-03-15 10:11:55
|
Module: performous
Branch: hiscore_in_songbrowser
Commit: 8608a2ea436a51ace97bc68cabe44c00def291ba
Author: Tapio Vierros <tap...@gm...>
Date: Mon Mar 15 12:00:30 2010 +0200
Tweaks to hiscrore in songbrowser.
* Allow starting song in hiscore mode.
* Fix broken scrolling-by-one.
* Refactor bounds-check (move to one place, easier to understand).
---
game/database.cc | 11 ++++++-----
game/database.hh | 2 +-
game/screen_songs.cc | 11 +++++------
game/screen_songs.hh | 2 +-
4 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/game/database.cc b/game/database.cc
index 4668d26..ce8a411 100644
--- a/game/database.cc
+++ b/game/database.cc
@@ -118,7 +118,7 @@ void Database::queryPerSongHiscore (std::ostream & os, boost::shared_ptr<Song> s
}
}
-void Database::queryPerSongHiscore_HiscoreDisplay (std::ostream & os, boost::shared_ptr<Song> s, unsigned & start_pos, unsigned max_displayed, std::string const& track) const {
+void Database::queryPerSongHiscore_HiscoreDisplay (std::ostream & os, boost::shared_ptr<Song> s, int& start_pos, unsigned max_displayed, std::string const& track) const {
int songid = m_songs.lookup(s);
std::vector<HiscoreItem> hi = m_hiscores.queryHiscore(10, -1, songid, track);
@@ -129,10 +129,11 @@ void Database::queryPerSongHiscore_HiscoreDisplay (std::ostream & os, boost::sha
return;
}
- if((hi.size() > 5)&&(start_pos > hi.size()-6)) start_pos = hi.size()-5;
- else start_pos = 0;
-
- for (size_t i=0; ((i<hi.size())&&(i<max_displayed)); ++i)
+ // Limits
+ if (start_pos > (int)hi.size() - (int)max_displayed) start_pos = hi.size() - max_displayed;
+ if (start_pos < 0 || hi.size() <= max_displayed) start_pos = 0;
+
+ for (size_t i = 0; i < hi.size() && i < max_displayed; ++i)
{
os << i+start_pos+1 << "\t"
<< m_players.lookup(hi[i+start_pos].playerid) << "\t"
diff --git a/game/database.hh b/game/database.hh
index 1bf254d..be98fe0 100644
--- a/game/database.hh
+++ b/game/database.hh
@@ -99,7 +99,7 @@ class Database
void queryOverallHiscore (std::ostream & os, std::string const& track = "") const;
void queryPerSongHiscore (std::ostream & os, boost::shared_ptr<Song> s, std::string const& track = "") const;
- void queryPerSongHiscore_HiscoreDisplay (std::ostream & os, boost::shared_ptr<Song> s, unsigned & start_pos, unsigned max_displayed, std::string const& track = "") const;
+ void queryPerSongHiscore_HiscoreDisplay (std::ostream & os, boost::shared_ptr<Song> s, int& start_pos, unsigned max_displayed, std::string const& track = "") const;
void queryPerPlayerHiscore (std::ostream & os, std::string const& track = "") const;
bool hasHiscore(Song& s) const;
diff --git a/game/screen_songs.cc b/game/screen_songs.cc
index aef4500..26928f0 100644
--- a/game/screen_songs.cc
+++ b/game/screen_songs.cc
@@ -58,8 +58,8 @@ void ScreenSongs::manageSharedKey(input::NavButton nav) {
ss->setSong(m_songs.currentPtr());
sm->activateScreen("Sing");
}
- else if (nav == input::LEFT) m_songs.advance(-1);
- else if (nav == input::RIGHT) m_songs.advance(1);
+ else if (nav == input::LEFT) { m_songs.advance(-1); hiscore_start_pos = 0; }
+ else if (nav == input::RIGHT) { m_songs.advance(1); hiscore_start_pos = 0; }
}
void ScreenSongs::manageEvent(SDL_Event event) {
@@ -77,13 +77,12 @@ void ScreenSongs::manageEvent(SDL_Event event) {
return;
} else if (show_hiscores) {
if (nav == input::CANCEL || m_songs.empty()) show_hiscores = false;
- else if ((nav == input::UP)&&(hiscore_start_pos > 0)) hiscore_start_pos--;
+ else if (nav == input::UP) hiscore_start_pos--;
else if (nav == input::DOWN) hiscore_start_pos++;
+ // TODO: change hiscore type listed (all, just vocals, guitar easy, guitar medium, guitar hard, guit
else if (nav == input::MOREUP) (hiscore_start_pos > 4) ? hiscore_start_pos -= 5 : hiscore_start_pos = 0;
else if (nav == input::MOREDOWN) hiscore_start_pos += 5;
- else if (nav == input::LEFT) { m_songs.advance(-1); hiscore_start_pos=0; }
- else if (nav == input::RIGHT) { m_songs.advance(1); hiscore_start_pos=0; }
- else if (nav == input::START) {}; // TODO change hiscore type listed (all, just vocals, guitar easy, guitar medium, guitar hard, guit
+ else manageSharedKey(nav);
return;
} else if (nav == input::CANCEL) {
if (!m_search.text.empty()) { m_search.text.clear(); m_songs.setFilter(m_search.text); }
diff --git a/game/screen_songs.hh b/game/screen_songs.hh
index b9ad7f2..62320a6 100644
--- a/game/screen_songs.hh
+++ b/game/screen_songs.hh
@@ -59,5 +59,5 @@ protected:
Cachemap<std::string, Surface> m_covers;
bool m_jukebox;
bool show_hiscores;
- unsigned hiscore_start_pos;
+ int hiscore_start_pos;
};
|
|
From: Peque <ms...@us...> - 2010-03-15 01:41:40
|
Module: performous
Branch: hiscore_in_songbrowser
Commit: 7283e6a12cd19ebd54b228d9036bc969a4ba6f28
Author: Miguel Sánchez de León Peque <msd...@gm...>
Date: Mon Mar 15 02:40:54 2010 +0100
Fixed last bug. Performous wont crash while scrolling hiscores.
---
game/database.cc | 8 +++-----
game/screen_songs.cc | 2 +-
2 files changed, 4 insertions(+), 6 deletions(-)
diff --git a/game/database.cc b/game/database.cc
index b478125..4668d26 100644
--- a/game/database.cc
+++ b/game/database.cc
@@ -128,11 +128,9 @@ void Database::queryPerSongHiscore_HiscoreDisplay (std::ostream & os, boost::sha
os << "Be the first to be listed here!\n";
return;
}
-
- if (hi.size()-(start_pos+1) < max_displayed) {
- if (hi.size() < 6) start_pos = 0;
- else start_pos -= 1;
- }
+
+ if((hi.size() > 5)&&(start_pos > hi.size()-6)) start_pos = hi.size()-5;
+ else start_pos = 0;
for (size_t i=0; ((i<hi.size())&&(i<max_displayed)); ++i)
{
diff --git a/game/screen_songs.cc b/game/screen_songs.cc
index 6d7e473..aef4500 100644
--- a/game/screen_songs.cc
+++ b/game/screen_songs.cc
@@ -79,7 +79,7 @@ void ScreenSongs::manageEvent(SDL_Event event) {
if (nav == input::CANCEL || m_songs.empty()) show_hiscores = false;
else if ((nav == input::UP)&&(hiscore_start_pos > 0)) hiscore_start_pos--;
else if (nav == input::DOWN) hiscore_start_pos++;
- else if ((nav == input::MOREUP)&&(hiscore_start_pos > 4)) hiscore_start_pos -= 5;
+ else if (nav == input::MOREUP) (hiscore_start_pos > 4) ? hiscore_start_pos -= 5 : hiscore_start_pos = 0;
else if (nav == input::MOREDOWN) hiscore_start_pos += 5;
else if (nav == input::LEFT) { m_songs.advance(-1); hiscore_start_pos=0; }
else if (nav == input::RIGHT) { m_songs.advance(1); hiscore_start_pos=0; }
|