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: knittl <kn...@us...> - 2009-08-03 08:55:27
|
Module: performous
Branch: master
Commit: 9e4d772c0d91ad2a6f5b7f1b26241bed6d943dcc
Author: Markus Raab <un...@ma...>
Date: Fri Jul 31 15:57:47 2009 +0200
hiscore bugs
CRLF is now handeled correctly (thanks to boost::trim)
isWriteable should not truncate the file anymore
thanks to Andreas Fachathaler for High.sco example
---
game/highscore.cc | 19 ++++++++++++++-----
1 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/game/highscore.cc b/game/highscore.cc
index a1420f8..e67bb20 100644
--- a/game/highscore.cc
+++ b/game/highscore.cc
@@ -1,5 +1,6 @@
#include "highscore.hh"
#include <boost/lexical_cast.hpp>
+#include <boost/algorithm/string.hpp>
#include "unicode.hh"
@@ -42,10 +43,13 @@ void SongHiscore::load()
unsigned int playernum = 0;
while (std::getline(ss, str))
{
- if (str == "E") break;
linenum++;
- if (playernum > 9) throw HiscoreException("Not more than 10 highscores expected in file", linenum);
+
+ boost::trim(str);
if (str.empty()) continue; // ignore empty player lines
+
+ if (str == "E") break;
+ if (playernum > 9) throw HiscoreException("Not more than 10 highscores expected in file", linenum);
if (str.length() <= 9) throw HiscoreException("Line not long enough for player information", linenum);
if (str[0] != '#') throw HiscoreException("No # found at begin of line", linenum);
@@ -61,7 +65,10 @@ void SongHiscore::load()
std::getline(ss, str);
linenum++;
+
+ boost::trim(str);
if (str.empty()) throw HiscoreException("Expected Score, but found empty line", linenum);
+
if (str.length() <= 8) throw HiscoreException("Line not long enough for score information", linenum);
if (str[0] != '#') throw HiscoreException("No # found at begin of line", linenum);
@@ -76,6 +83,7 @@ void SongHiscore::load()
int score = 0;
try {
+ boost::trim(sscore);
score = boost::lexical_cast<int>(sscore);
} catch (boost::bad_lexical_cast const& blc)
{
@@ -115,7 +123,7 @@ void SongHiscore::save()
bool SongHiscore::isWritable()
{
- std::ofstream out ((m_path + m_filename).c_str());
+ std::ofstream out ((m_path + m_filename).c_str(), std::ios::app);
return out.is_open();
}
@@ -162,12 +170,13 @@ int main()
else std::cout << "Is not writeable" << std::endl;
hi.load();
- int new_score = 9000;
+ int new_score = 5000;
if (hi.reachedNewHiscore(new_score))
{
std::cout << "Reached new highscore" << std::endl;
- hi.addNewHiscore("new player", new_score);
+ hi.addNewHiscore("nplayer", new_score);
}
+ hi.getInfo(std::cout);
hi.save();
} catch (HiscoreException const& hie)
{
|
|
From: knittl <kn...@us...> - 2009-08-03 08:41:42
|
Module: performous Branch: master Commit: 5bc2476e08a8401ee50fe412821fbf3fc96254b7 Author: knittl <knittl@kbook.(none)> Date: Mon Aug 3 10:38:49 2009 +0200 new guitar and bass neck graphics guitar "flash" still needs some work --- themes/default/bassneck.svg | 207 +++++++++++++++---------------- themes/default/guitarneck.svg | 274 +++++++++++++++++++++++----------------- 2 files changed, 258 insertions(+), 223 deletions(-) |
|
From: knittl <kn...@us...> - 2009-08-03 08:41:40
|
Module: performous
Branch: master
Commit: 6ae148f285e8b0c1bbdaaf61e4af7809d35519af
Author: Lasse Karkkainen <tro...@tr...>
Date: Mon Aug 3 03:54:41 2009 +0300
Fix repeating enter/shift causing extra pick events.
---
game/joystick.cc | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/game/joystick.cc b/game/joystick.cc
index 89e7f3e..d64e74e 100644
--- a/game/joystick.cc
+++ b/game/joystick.cc
@@ -130,6 +130,7 @@ bool input::pushEvent(SDL_Event _e) {
using namespace input::Private;
Event event;
+ static bool pickPressed[2] = {}; // HACK for tracking enter and rshift status
switch(_e.type) {
case SDL_KEYDOWN: {
int button = 0;
@@ -137,6 +138,8 @@ bool input::pushEvent(SDL_Event _e) {
if(!devices[joy_id].assigned()) return false;
switch(_e.key.keysym.sym) {
case SDLK_RETURN:
+ if (pickPressed[0]) return true; // repeating
+ pickPressed[0] = true;
event.type = input::Event::PICK;
event.button = 1;
for( unsigned int i = 0 ; i < BUTTONS ; ++i ) {
@@ -145,6 +148,8 @@ bool input::pushEvent(SDL_Event _e) {
devices[joy_id].addEvent(event);
return true;
case SDLK_RSHIFT:
+ if (pickPressed[1]) return true; // repeating
+ pickPressed[1] = true;
event.type = input::Event::PICK;
event.button = 0;
for( unsigned int i = 0 ; i < BUTTONS ; ++i ) {
@@ -180,6 +185,8 @@ bool input::pushEvent(SDL_Event _e) {
joy_id = UINT_MAX;
if(!devices[joy_id].assigned()) return false;
switch(_e.key.keysym.sym) {
+ case SDLK_RETURN: pickPressed[0] = false; return true;
+ case SDLK_RSHIFT: pickPressed[1] = false; return true;
case SDLK_F5: case SDLK_5:
button++;
case SDLK_F4: case SDLK_4:
|
|
From: knittl <kn...@us...> - 2009-08-03 08:41:38
|
Module: performous Branch: master Commit: 2f91c1f6e9d44268d776ae0daf99f1a236af6bcf Author: Lasse Karkkainen <tro...@tr...> Date: Mon Aug 3 02:34:26 2009 +0300 Merge branch 'master' of ssh://zi.fi/performous --- |
|
From: knittl <kn...@us...> - 2009-08-03 08:41:38
|
Module: performous
Branch: master
Commit: d53bd632d8d4f01f2ca632f9ee0edc3c86121a6d
Author: Lasse Karkkainen <tro...@tr...>
Date: Mon Aug 3 03:46:36 2009 +0300
Improved dead instrument handling.
Experimental event system for tracking strums etc.
---
game/guitargraph.cc | 22 +++++++++++++++-------
game/guitargraph.hh | 16 ++++++++++------
game/screen_sing.cc | 2 +-
3 files changed, 26 insertions(+), 14 deletions(-)
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index bfdf85f..5050ae3 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -44,7 +44,7 @@ GuitarGraph::GuitarGraph(Song const& song, bool drums, unsigned track):
m_track(track),
m_stream(),
m_level(),
- m_dead(-1),
+ m_dead(1000),
m_text(getThemePath("sing_timetxt.svg"), config["graphic/text_lod"].f()),
m_correctness(0.0, 5.0),
m_score()
@@ -133,7 +133,8 @@ void GuitarGraph::drumHit(double time, int fret) {
++m_chordIt;
}
++m_chordIt->status;
- m_notes[m_chordIt->dur[fret]] = 1;
+ m_events.push_back(Event(time, 1));
+ m_notes[m_chordIt->dur[fret]] = m_events.size();
double score = points(tolerance);
m_chordIt->score += score;
m_score += score;
@@ -180,10 +181,10 @@ void GuitarGraph::guitarPlay(double time, input::Event const& ev) {
std::cout << (picked ? "Pick: " : "Tap: ");
if (best == m_chords.end()) {
std::cout << "MISS" << std::endl;
- if (picked) {
- m_score -= 50;
- m_correctness.setTarget(0.0, true); // Instantly go to zero
- }
+ if (!picked) return;
+ m_score -= 50;
+ m_correctness.setTarget(0.0, true); // Instantly go to zero
+ m_events.push_back(Event(time, 0));
} else {
m_chordIt = best;
int& score = m_chordIt->score;
@@ -194,6 +195,10 @@ void GuitarGraph::guitarPlay(double time, input::Event const& ev) {
m_chordIt->status = 1 + picked;
m_score += score;
m_correctness.setTarget(1.0, true); // Instantly go to one
+ m_events.push_back(Event(time, 1 + picked));
+ for (int fret = 0; fret < 5; ++fret) {
+ if (m_chordIt->fret[fret]) m_notes[m_chordIt->dur[fret]] = m_events.size();
+ }
}
}
@@ -288,7 +293,10 @@ void GuitarGraph::draw(double time) {
if (m_drums) x -= 0.5f;
float w = 0.5f;
glutil::Color c = color(fret);
- if (m_notes[it->dur[fret]] == 1) c.r = c.g = c.b = 1.0f;
+ unsigned event = m_notes[it->dur[fret]];
+ if (event) {
+ c.r = c.g = c.b = std::max(0.5, m_events[event - 1].glow.get());
+ }
float wLine = 0.5f * w;
if (tEnd > future) tEnd = future;
if (m_drums && fret == 0) {
diff --git a/game/guitargraph.hh b/game/guitargraph.hh
index 67924a5..650dd0e 100644
--- a/game/guitargraph.hh
+++ b/game/guitargraph.hh
@@ -23,10 +23,6 @@ struct Chord {
std::fill(dur, dur + 5, static_cast<Duration const*>(NULL));
}
bool matches(bool const* fretPressed) {
- for (int i = 0; i < 5; ++i) {
- std::cout << fret[i] << fretPressed[i] << " ";
- }
- std::cout << std::endl;
if (polyphony == 1) {
bool shadowed = true;
for (int i = 0; i < 5; ++i) {
@@ -54,7 +50,7 @@ class GuitarGraph {
void draw(double time);
void engine(Audio& audio);
void position(double cx, double width) { m_cx.setTarget(cx); m_width.setTarget(width); }
- double dead(double time) const { return time > -0.5 && m_dead > 10; }
+ double dead(double time) const { return time > -0.5 && m_dead > 50; }
unsigned stream() const { return m_stream; }
double correctness() const { return m_correctness.get(); }
private:
@@ -78,6 +74,14 @@ class GuitarGraph {
DIFFICULTY_AMAZING,
DIFFICULTYCOUNT
} m_level;
+ struct Event {
+ double time;
+ AnimValue glow;
+ int type; // 0 = miss (pick), 1 = tap, 2 = pick
+ Event(double t, int ty): time(t), glow(0.0, 0.5), type(ty) { if (type > 0) glow.setValue(1.0); }
+ };
+ typedef std::vector<Event> Events;
+ Events m_events;
int m_dead;
glutil::Color const& color(int fret) const;
void drawBar(double time, float h);
@@ -88,7 +92,7 @@ class GuitarGraph {
typedef std::vector<Chord> Chords;
Chords m_chords;
Chords::iterator m_chordIt;
- typedef std::map<Duration const*, int> NoteStatus;
+ typedef std::map<Duration const*, unsigned> NoteStatus; // Note in song to m_events[unsigned - 1] or 0 for not played
NoteStatus m_notes;
AnimValue m_correctness;
int m_score;
diff --git a/game/screen_sing.cc b/game/screen_sing.cc
index 17956e8..8b63849 100644
--- a/game/screen_sing.cc
+++ b/game/screen_sing.cc
@@ -15,7 +15,7 @@ namespace {
}
void ScreenSing::enter() {
- m_audio.playMusic(m_song->music, false, 0.0, m_song->tracks.empty() ? -1.0 : -4.0); // Startup delay for instruments is longer than for singing only
+ m_audio.playMusic(m_song->music, false, 0.0, m_song->tracks.empty() ? -1.0 : -8.0); // Startup delay for instruments is longer than for singing only
theme.reset(new ThemeSing());
if (!m_song->background.empty()) {
try {
|
|
From: knittl <kn...@us...> - 2009-08-03 08:41:37
|
Module: performous
Branch: master
Commit: 6dbbb2f9f27d4cabccbcefdea5e3927b363e3eff
Author: Lasse Karkkainen <tro...@tr...>
Date: Mon Aug 3 02:59:27 2009 +0300
Prevent RB guitar orientation sensor from being detected as green fret.
---
game/joystick.cc | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/game/joystick.cc b/game/joystick.cc
index 514fcc4..89e7f3e 100644
--- a/game/joystick.cc
+++ b/game/joystick.cc
@@ -8,11 +8,11 @@ static const unsigned SDL_BUTTONS = 6;
int buttonFromSDL(input::Private::Type _type, unsigned int _sdl_button) {
static const int inputmap[4][SDL_BUTTONS] = {
//G R Y B O // for guitars
- { 2, 0, 1, 3, 4, 0 }, // Guitar Hero guitar
- { 3, 0, 1, 2, 4, 0 }, // Rock Band guitar
+ { 2, 0, 1, 3, 4, -1 }, // Guitar Hero guitar
+ { 3, 0, 1, 2, 4, -1 }, // Rock Band guitar
//K R Y B G O // for drums
{ 3, 4, 1, 2, 0, 4 }, // Guitar Hero drums
- { 3, 4, 1, 2, 0, 0 } // Rock Band drums
+ { 3, 4, 1, 2, 0, -1 } // Rock Band drums
};
if( _sdl_button >= SDL_BUTTONS ) return -1;
switch(_type) {
@@ -235,7 +235,7 @@ bool input::pushEvent(SDL_Event _e) {
case SDL_JOYBUTTONDOWN:
joy_id = _e.jbutton.which;
button = buttonFromSDL(devices[joy_id].type(),_e.jbutton.button);
- if( button == -1 ) break;
+ if( button == -1 ) return false;
for( unsigned int i = 0 ; i < BUTTONS ; ++i ) {
event.pressed[i] = devices[joy_id].pressed(i);
}
@@ -247,7 +247,7 @@ bool input::pushEvent(SDL_Event _e) {
case SDL_JOYBUTTONUP:
joy_id = _e.jbutton.which;
button = buttonFromSDL(devices[joy_id].type(),_e.jbutton.button);
- if( button == -1 ) break;
+ if( button == -1 ) return false;
for( unsigned int i = 0 ; i < BUTTONS ; ++i ) {
event.pressed[i] = devices[joy_id].pressed(i);
}
|
|
From: knittl <kn...@us...> - 2009-08-03 08:41:35
|
Module: performous
Branch: master
Commit: 92b69931658a60989a9b47e012d1eddb47d2f848
Author: Lasse Karkkainen <tro...@tr...>
Date: Mon Aug 3 02:54:49 2009 +0300
Keyboard now accepts numbers 1-5 too.
Guitars no longer report whammy and other controls as pick.
Events trapped actually get trapped and don't reach the screens.
---
game/joystick.cc | 22 +++++++++++-----------
game/main.cc | 2 +-
2 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/game/joystick.cc b/game/joystick.cc
index 134498c..514fcc4 100644
--- a/game/joystick.cc
+++ b/game/joystick.cc
@@ -152,15 +152,15 @@ bool input::pushEvent(SDL_Event _e) {
}
devices[joy_id].addEvent(event);
return true;
- case SDLK_F5:
+ case SDLK_F5: case SDLK_5:
button++;
- case SDLK_F4:
+ case SDLK_F4: case SDLK_4:
button++;
- case SDLK_F3:
+ case SDLK_F3: case SDLK_3:
button++;
- case SDLK_F2:
+ case SDLK_F2: case SDLK_2:
button++;
- case SDLK_F1:
+ case SDLK_F1: case SDLK_1:
event.type = input::Event::PRESS;
break;
default:
@@ -180,15 +180,15 @@ bool input::pushEvent(SDL_Event _e) {
joy_id = UINT_MAX;
if(!devices[joy_id].assigned()) return false;
switch(_e.key.keysym.sym) {
- case SDLK_F5:
+ case SDLK_F5: case SDLK_5:
button++;
- case SDLK_F4:
+ case SDLK_F4: case SDLK_4:
button++;
- case SDLK_F3:
+ case SDLK_F3: case SDLK_3:
button++;
- case SDLK_F2:
+ case SDLK_F2: case SDLK_2:
button++;
- case SDLK_F1:
+ case SDLK_F1: case SDLK_1:
event.type = input::Event::RELEASE;
break;
default:
@@ -204,7 +204,7 @@ bool input::pushEvent(SDL_Event _e) {
}
case SDL_JOYAXISMOTION:
joy_id = _e.jaxis.which;
-
+ if (_e.jaxis.axis != 5 && _e.jaxis.axis != 6) return false;
event.type = input::Event::PICK;
for( unsigned int i = 0 ; i < BUTTONS ; ++i ) {
event.pressed[i] = devices[joy_id].pressed(i);
diff --git a/game/main.cc b/game/main.cc
index 26ff642..670a924 100644
--- a/game/main.cc
+++ b/game/main.cc
@@ -70,8 +70,8 @@ static void checkEvents_SDL(ScreenManager& sm, Window& window) {
}
break;
}
+ sm.getCurrentScreen()->manageEvent(event);
}
- sm.getCurrentScreen()->manageEvent(event);
switch(glGetError()) {
case GL_INVALID_ENUM: std::cerr << "OpenGL error: invalid enum" << std::endl; break;
case GL_INVALID_VALUE: std::cerr << "OpenGL error: invalid value" << std::endl; break;
|
|
From: knittl <kn...@us...> - 2009-08-03 08:41:33
|
Module: performous
Branch: master
Commit: 17026d20a40faf00f86b738d828cc58d5d6d350e
Author: Vincent Le Ligeour <yo...@us...>
Date: Mon Aug 3 00:05:40 2009 +0200
Fixed typo
Added shift picking
---
game/joystick.cc | 10 +++++++++-
game/joystick.hh | 4 ++--
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/game/joystick.cc b/game/joystick.cc
index cfdd816..134498c 100644
--- a/game/joystick.cc
+++ b/game/joystick.cc
@@ -138,7 +138,15 @@ bool input::pushEvent(SDL_Event _e) {
switch(_e.key.keysym.sym) {
case SDLK_RETURN:
event.type = input::Event::PICK;
- button = 0;
+ event.button = 1;
+ for( unsigned int i = 0 ; i < BUTTONS ; ++i ) {
+ event.pressed[i] = devices[joy_id].pressed(i);
+ }
+ devices[joy_id].addEvent(event);
+ return true;
+ case SDLK_RSHIFT:
+ event.type = input::Event::PICK;
+ event.button = 0;
for( unsigned int i = 0 ; i < BUTTONS ; ++i ) {
event.pressed[i] = devices[joy_id].pressed(i);
}
diff --git a/game/joystick.hh b/game/joystick.hh
index 98ddebf..7a4c3c3 100644
--- a/game/joystick.hh
+++ b/game/joystick.hh
@@ -93,9 +93,9 @@ namespace input {
InputDev(input::DevType _type) {
using namespace input::Private;
if( _type == input::DRUMS )
- std::cout << "Request aquiring DRUM" << std::endl;
+ std::cout << "Request acquiring DRUM" << std::endl;
if( _type == input::GUITAR )
- std::cout << "Request aquiring GUITAR" << std::endl;
+ std::cout << "Request acquiring GUITAR" << std::endl;
if( devices.size() == 0 ) throw std::runtime_error("No InputDev available");
for(InputDevs::iterator it = devices.begin() ; it != devices.end() ; ++it) {
if( !it->second.assigned() && it->second.type_match(_type) ) {
|
|
From: knittl <kn...@us...> - 2009-08-03 08:41:32
|
Module: performous
Branch: master
Commit: 176f92b8a382069b0c926b3aa986ccee4db183f9
Author: Lasse Karkkainen <tro...@tr...>
Date: Mon Aug 3 02:22:25 2009 +0300
Ignore GUITAR COOP tracks.
---
game/songparser-ini.cc | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/game/songparser-ini.cc b/game/songparser-ini.cc
index fb491d9..cb74918 100644
--- a/game/songparser-ini.cc
+++ b/game/songparser-ini.cc
@@ -50,6 +50,7 @@ void SongParser::iniParse() {
else if (name == "T1 GEMS") name = "GUITAR"; // Some old MIDI files have a track named T1 GEMS
else if (name.substr(0, 5) != "PART ") continue;
else name.erase(0, 5);
+ if (name == "GUITAR COOP") continue; // TODO: do something with these? They don't work in current version
if (name == "DRUM") name = "DRUMS";
// Process non-vocal tracks
if (name != "VOCALS") {
|
|
From: knittl <kn...@us...> - 2009-08-03 08:41:29
|
Module: performous Branch: master Commit: 95e75b2b96aeafd3af44e96d373c6040b9734c22 Author: Lasse Karkkainen <tro...@tr...> Date: Mon Aug 3 00:59:19 2009 +0300 Merge branch 'master' of ssh://zi.fi/performous --- |
|
From: knittl <kn...@us...> - 2009-08-03 08:41:27
|
Module: performous
Branch: master
Commit: 03cfbe49f9f5618f025cf292b846f2a02d7ce371
Author: Vincent Le Ligeour <yo...@us...>
Date: Sun Aug 2 23:58:22 2009 +0200
Added keyboard guitar
---
game/joystick.cc | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++++-
game/joystick.hh | 12 +++++++-
2 files changed, 80 insertions(+), 3 deletions(-)
diff --git a/game/joystick.cc b/game/joystick.cc
index bee8bdb..cfdd816 100644
--- a/game/joystick.cc
+++ b/game/joystick.cc
@@ -65,7 +65,8 @@ input::SDL_devices input::sdl_devices;
void input::init_devices() {
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;
+ if(it->second.assigned()) continue;
+ if(input::sdl_devices[id] == NULL) continue; // Keyboard
unsigned int num_buttons = SDL_JoystickNumButtons(input::sdl_devices[id]);
for( unsigned int i = 0 ; i < num_buttons ; ++i ) {
SDL_Event event;
@@ -116,6 +117,11 @@ void input::init() {
}
// Here we should send an event to have correct state buttons
init_devices();
+ // Adding keyboard instrument
+ std::cout << "Id: " << UINT_MAX << std::endl;
+ std::cout << " Name: Keyboard (emulated guitar)" << std::endl;
+ input::sdl_devices[UINT_MAX] = NULL;
+ input::Private::devices[UINT_MAX] = input::Private::InputDevPrivate(input::Private::GUITAR_GH);
}
bool input::pushEvent(SDL_Event _e) {
@@ -125,6 +131,69 @@ bool input::pushEvent(SDL_Event _e) {
Event event;
switch(_e.type) {
+ case SDL_KEYDOWN: {
+ int button = 0;
+ joy_id = UINT_MAX;
+ if(!devices[joy_id].assigned()) return false;
+ switch(_e.key.keysym.sym) {
+ case SDLK_RETURN:
+ event.type = input::Event::PICK;
+ button = 0;
+ for( unsigned int i = 0 ; i < BUTTONS ; ++i ) {
+ event.pressed[i] = devices[joy_id].pressed(i);
+ }
+ devices[joy_id].addEvent(event);
+ return true;
+ case SDLK_F5:
+ button++;
+ case SDLK_F4:
+ button++;
+ case SDLK_F3:
+ button++;
+ case SDLK_F2:
+ button++;
+ case SDLK_F1:
+ event.type = input::Event::PRESS;
+ break;
+ default:
+ return false;
+ }
+ if(devices[joy_id].pressed(button)) return true; // repeating
+ event.button = button;
+ for( unsigned int i = 0 ; i < BUTTONS ; ++i ) {
+ event.pressed[i] = devices[joy_id].pressed(i);
+ }
+ event.pressed[button] = true;
+ devices[joy_id].addEvent(event);
+ break;
+ }
+ case SDL_KEYUP: {
+ int button = 0;
+ joy_id = UINT_MAX;
+ if(!devices[joy_id].assigned()) return false;
+ switch(_e.key.keysym.sym) {
+ case SDLK_F5:
+ button++;
+ case SDLK_F4:
+ button++;
+ case SDLK_F3:
+ button++;
+ case SDLK_F2:
+ button++;
+ case SDLK_F1:
+ event.type = input::Event::RELEASE;
+ break;
+ default:
+ return false;
+ }
+ event.button = button;
+ for( unsigned int i = 0 ; i < BUTTONS ; ++i ) {
+ event.pressed[i] = devices[joy_id].pressed(i);
+ }
+ event.pressed[button] = false;
+ devices[joy_id].addEvent(event);
+ break;
+ }
case SDL_JOYAXISMOTION:
joy_id = _e.jaxis.which;
diff --git a/game/joystick.hh b/game/joystick.hh
index fd0d791..98ddebf 100644
--- a/game/joystick.hh
+++ b/game/joystick.hh
@@ -25,8 +25,16 @@ namespace input {
enum Type {GUITAR_RB, DRUMS_RB, GUITAR_GH, DRUMS_GH};
class InputDevPrivate {
public:
- InputDevPrivate() : m_assigned(false), m_type(input::Private::DRUMS_GH) {};
- InputDevPrivate(input::Private::Type _type) : m_assigned(false), m_type(_type) {};
+ InputDevPrivate() : m_assigned(false), m_type(input::Private::DRUMS_GH) {
+ for(unsigned int i = 0 ; i < BUTTONS ; i++) {
+ m_pressed[i] = false;
+ }
+ };
+ InputDevPrivate(input::Private::Type _type) : m_assigned(false), m_type(_type) {
+ for(unsigned int i = 0 ; i < BUTTONS ; i++) {
+ m_pressed[i] = false;
+ }
+ };
bool tryPoll(Event& _event) {
if( m_events.empty() ) return false;
_event = m_events.front();
|
|
From: knittl <kn...@us...> - 2009-08-03 08:41:25
|
Module: performous
Branch: master
Commit: 547b2818a6c79dd914206462be6c1b1f4ca231f1
Author: Lasse Karkkainen <tro...@tr...>
Date: Mon Aug 3 00:58:18 2009 +0300
Tapping modifications and fixes for better FoF compatibility.
Tolerance increased.
---
game/guitargraph.cc | 25 ++++++++++++++++---------
1 files changed, 16 insertions(+), 9 deletions(-)
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index 3c5b123..bfdf85f 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -20,12 +20,12 @@ namespace {
return std::pow(a, 0.8); // Nicer curve
}
- const double maxTolerance = 0.1;
+ const double maxTolerance = 0.15;
double points(double error) {
double score = 0.0;
if (error < maxTolerance) score += 15;
- if (error < 0.075) score += 15;
+ if (error < 0.1) score += 15;
if (error < 0.05) score += 15;
if (error < 0.03) score += 5;
return score;
@@ -46,7 +46,7 @@ GuitarGraph::GuitarGraph(Song const& song, bool drums, unsigned track):
m_level(),
m_dead(-1),
m_text(getThemePath("sing_timetxt.svg"), config["graphic/text_lod"].f()),
- m_correctness(0.0, 2.0),
+ m_correctness(0.0, 5.0),
m_score()
{
for (Tracks::const_iterator it = m_song.tracks.begin(); it != m_song.tracks.end(); ++it) {
@@ -151,8 +151,14 @@ void GuitarGraph::drumHit(double time, int fret) {
void GuitarGraph::guitarPlay(double time, input::Event const& ev) {
bool picked = (ev.type == input::Event::PICK);
- bool const* frets = ev.pressed; // Kinda b0rked, FIXME
- if (!picked && m_correctness.get() < 0.5) return; // Hammering not possible at the moment
+ bool frets[5] = {};
+ if (picked) {
+ for (int fret = 0; fret < 5; ++fret) frets[fret] = ev.pressed[fret];
+ } else {
+ if (m_correctness.get() < 0.5) return; // Hammering not possible at the moment
+ frets[ev.button] = true;
+ for (int fret = ev.button + 1; fret < 5; ++fret) if (ev.pressed[fret]) return; // Extra buttons on right side
+ }
// Find any suitable note within the tolerance
double tolerance = maxTolerance;
Chords::iterator best = m_chords.end();
@@ -181,11 +187,10 @@ void GuitarGraph::guitarPlay(double time, input::Event const& ev) {
} else {
m_chordIt = best;
int& score = m_chordIt->score;
- std::cout << "HIT, old score = " << score;
+ std::cout << "HIT, error = " << int(1000.0 * (best->begin - time)) << " ms" << std::endl;
m_score -= score;
score = points(tolerance);
score *= m_chordIt->polyphony;
- std::cout << ", new score = " << score << std::endl;
m_chordIt->status = 1 + picked;
m_score += score;
m_correctness.setTarget(1.0, true); // Instantly go to one
@@ -351,7 +356,7 @@ void GuitarGraph::updateChords() {
size[fret] = durations[fret]->size();
}
double lastEnd = 0.0;
- const double tapMaxDelay = 0.05; // Delay from the end of the previous note
+ const double tapMaxDelay = 0.15; // Delay from the end of the previous note
while (true) {
// Find the earliest
double t = getInf();
@@ -365,6 +370,7 @@ void GuitarGraph::updateChords() {
// Construct a chord
Chord c;
c.begin = t;
+ int tapfret = -1;
for (int fret = 0; fret < 5; ++fret) {
if (pos[fret] == size[fret]) continue;
Durations const& dur = *durations[fret];
@@ -373,12 +379,13 @@ void GuitarGraph::updateChords() {
c.end = std::max(c.end, d.end);
c.fret[fret] = true;
c.dur[fret] = &d;
+ tapfret = fret;
++c.polyphony;
++pos[fret];
}
if (c.polyphony == 1) {
c.tappable = true;
- if (m_chords.empty() || m_chords.back() == c) c.tappable = false;
+ if (m_chords.empty() || m_chords.back().fret[tapfret]) c.tappable = false;
if (lastEnd + tapMaxDelay < t) c.tappable = false;
}
lastEnd = c.end;
|
|
From: knittl <kn...@us...> - 2009-08-03 08:41:23
|
Module: performous
Branch: master
Commit: b79176c8812ce93764b8178dc57e1057be33db2c
Author: Lasse Karkkainen <tro...@tr...>
Date: Sun Aug 2 21:45:05 2009 +0300
Fade out streams when played incorrectly.
---
data/performous.xml | 10 +++++++++-
game/audio.cc | 5 +++++
game/audio.hh | 16 +++++++++++++---
game/guitargraph.cc | 29 ++++++++++++++++++-----------
game/guitargraph.hh | 7 +++++--
game/screen_sing.cc | 17 ++++++++++++++++-
6 files changed, 66 insertions(+), 18 deletions(-)
diff --git a/data/performous.xml b/data/performous.xml
index 2911139..05721b9 100644
--- a/data/performous.xml
+++ b/data/performous.xml
@@ -132,7 +132,15 @@
<limits min="-0.5" max="0.5" step="0.02" />
<locale name="C">
<short>Audio/video latency</short>
- <long>Use negative value if your display input lag is greater than the sound card output latency, positive values in opposite case and zero if they are equal. F5/F6 to adjust this in singing screen.</long>
+ <long>Use negative value if your display input lag is greater than the sound card output latency, positive values in the opposite case and zero if they are equal. F5/F6 to adjust this in singing screen.</long>
+ </locale>
+ </entry>
+ <entry name="audio/controller_delay" type="float" value="0.00">
+ <ui unit=" ms" multiplier="1000" />
+ <limits min="-0.5" max="0.5" step="0.02" />
+ <locale name="C">
+ <short>Audio/controller latency</short>
+ <long>Use negative value if your controller lag is greater than the sound card output latency, positive values in the opposite case and zero if they are equal.</long>
</locale>
</entry>
<entry name="audio/round-trip" type="float" value="0.08">
diff --git a/game/audio.cc b/game/audio.cc
index fbb2d21..72fd294 100644
--- a/game/audio.cc
+++ b/game/audio.cc
@@ -133,3 +133,8 @@ void Audio::pause(bool state) {
m_mixer.pause(m_paused);
}
+void Audio::streamFade(unsigned num, double level) {
+ da::lock_holder l = m_mixer.lock();
+ m_streams.at(num)->fade = level;
+}
+
diff --git a/game/audio.hh b/game/audio.hh
index 74d0c6a..db8e027 100644
--- a/game/audio.hh
+++ b/game/audio.hh
@@ -23,10 +23,19 @@ struct Stream {
double srate;
/// constructor
Stream(std::string const& filename, unsigned int sr):
- mpeg(false, true, filename, sr), srate(sr), m_pos() {}
+ mpeg(false, true, filename, sr), srate(sr), m_pos(), fade(1.0) {}
/// crossfades songs
bool operator()(da::pcm_data& data) {
- mpeg.audioQueue(data, m_pos);
+ if (fade == 1.0) {
+ mpeg.audioQueue(data, m_pos);
+ } else {
+ std::vector<da::sample_t> tmp(data.samples());
+ da::pcm_data dtmp(&tmp[0], data.frames, data.channels, data.rate);
+ mpeg.audioQueue(dtmp, m_pos);
+ for (std::size_t i = 0, s = data.samples(); i < s; ++i) {
+ data[i] += dtmp[i] * fade;
+ }
+ }
return !eof();
}
void seek(double time) { m_pos = time * srate * 2.0; }
@@ -34,6 +43,7 @@ struct Stream {
double duration() const { return mpeg.audioQueue.duration(); }
bool eof() const { return mpeg.audioQueue.eof(m_pos); }
int64_t m_pos;
+ double fade;
};
/** @short High level audio playback API **/
@@ -81,7 +91,7 @@ class Audio {
void pause(bool state = true);
/// toggles synth playback (F4)
void toggleSynth(Notes const& notes) { m_notes = (m_notes ? NULL : ¬es); }
-
+ void streamFade(unsigned num, double level);
private:
bool m_paused;
Notes const* volatile m_notes;
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index c5aa978..3c5b123 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -42,10 +42,11 @@ GuitarGraph::GuitarGraph(Song const& song, bool drums, unsigned track):
m_cx(0.0, 0.2),
m_width(0.5, 0.4),
m_track(track),
+ m_stream(),
m_level(),
m_dead(-1),
m_text(getThemePath("sing_timetxt.svg"), config["graphic/text_lod"].f()),
- m_hammerReady(0.0, 2.0),
+ m_correctness(0.0, 2.0),
m_score()
{
for (Tracks::const_iterator it = m_song.tracks.begin(); it != m_song.tracks.end(); ++it) {
@@ -60,7 +61,9 @@ GuitarGraph::GuitarGraph(Song const& song, bool drums, unsigned track):
difficultyAuto();
}
-void GuitarGraph::engine(double time) {
+void GuitarGraph::engine(Audio& audio) {
+ double time = audio.getPosition();
+ time -= config["audio/controller_delay"].f();
// Handle holds
if (!m_drums) {
for (int i = 0; i < 5; ++i) {
@@ -98,10 +101,11 @@ void GuitarGraph::engine(double time) {
}
// Skip missed notes
while (m_chordIt != m_chords.end() && m_chordIt->begin + maxTolerance < time) {
- if (m_chordIt->status < m_chordIt->polyphony) m_hammerReady.setTarget(0.0);
+ if (m_chordIt->status < m_chordIt->polyphony) m_correctness.setTarget(0.0);
++m_chordIt;
++m_dead;
}
+ if (m_chordIt != m_chords.end() && m_chordIt->end < time) m_correctness.setTarget(1.0);
}
void GuitarGraph::drumHit(double time, int fret) {
@@ -120,11 +124,11 @@ void GuitarGraph::drumHit(double time, int fret) {
if (best == m_chords.end()) {
std::cout << "MISS" << std::endl;
m_score -= 50;
- m_hammerReady.setTarget(0.0, true); // Instantly go to zero
+ m_correctness.setTarget(0.0, true); // Instantly go to zero
} else {
while (best != m_chordIt) {
if (m_chordIt->status == m_chordIt->polyphony) continue;
- m_hammerReady.setTarget(0.0);
+ m_correctness.setTarget(0.0);
std::cout << "SKIPPED, ";
++m_chordIt;
}
@@ -148,8 +152,7 @@ void GuitarGraph::drumHit(double time, int fret) {
void GuitarGraph::guitarPlay(double time, input::Event const& ev) {
bool picked = (ev.type == input::Event::PICK);
bool const* frets = ev.pressed; // Kinda b0rked, FIXME
- if (!picked && m_hammerReady.get() < 0.5) return; // Hammering not possible at the moment
- m_hammerReady.setTarget(0.0);
+ if (!picked && m_correctness.get() < 0.5) return; // Hammering not possible at the moment
// Find any suitable note within the tolerance
double tolerance = maxTolerance;
Chords::iterator best = m_chords.end();
@@ -173,7 +176,7 @@ void GuitarGraph::guitarPlay(double time, input::Event const& ev) {
std::cout << "MISS" << std::endl;
if (picked) {
m_score -= 50;
- m_hammerReady.setTarget(0.0, true); // Instantly go to zero
+ m_correctness.setTarget(0.0, true); // Instantly go to zero
}
} else {
m_chordIt = best;
@@ -185,7 +188,7 @@ void GuitarGraph::guitarPlay(double time, input::Event const& ev) {
std::cout << ", new score = " << score << std::endl;
m_chordIt->status = 1 + picked;
m_score += score;
- m_hammerReady.setTarget(1.0, true); // Instantly go to one
+ m_correctness.setTarget(1.0, true); // Instantly go to one
}
}
@@ -197,6 +200,11 @@ void GuitarGraph::difficultyAuto() {
bool GuitarGraph::difficulty(Difficulty level) {
m_track %= m_tracks.size();
Track const& track = *m_tracks[m_track];
+ // Find the stream number
+ for (m_stream = 0; m_stream < m_song.tracks.size(); ++m_stream) {
+ if (&track == &m_song.tracks[m_stream]) break;
+ }
+ // Check if the difficulty level is available
uint8_t basepitch = diffv[level].basepitch;
NoteMap const& nm = track.nm;
int fail = 0;
@@ -224,7 +232,6 @@ glutil::Color const& GuitarGraph::color(int fret) const {
}
void GuitarGraph::draw(double time) {
- engine(time);
Dimensions dimensions(1.0); // FIXME: bogus aspect ratio (is this fixable?)
dimensions.screenBottom().middle(m_cx.get()).fixedWidth(m_width.get());
glutil::PushMatrixMode pmm(GL_PROJECTION);
@@ -298,7 +305,7 @@ void GuitarGraph::draw(double time) {
m_button.dimensions.center(time2y(tBeg)).middle(x);
m_button.draw();
if (it->tappable) {
- float l = std::max(0.5, m_hammerReady.get());
+ float l = std::max(0.5, m_correctness.get());
glColor3f(l, l, l);
m_tap.dimensions = m_button.dimensions;
m_tap.draw();
diff --git a/game/guitargraph.hh b/game/guitargraph.hh
index 6a8082e..67924a5 100644
--- a/game/guitargraph.hh
+++ b/game/guitargraph.hh
@@ -52,9 +52,11 @@ class GuitarGraph {
* @param time at which time to draw
*/
void draw(double time);
- void engine(double time);
+ void engine(Audio& audio);
void position(double cx, double width) { m_cx.setTarget(cx); m_width.setTarget(width); }
double dead(double time) const { return time > -0.5 && m_dead > 10; }
+ unsigned stream() const { return m_stream; }
+ double correctness() const { return m_correctness.get(); }
private:
input::InputDev m_input;
Song const& m_song;
@@ -65,6 +67,7 @@ class GuitarGraph {
bool m_drums;
AnimValue m_cx, m_width;
unsigned m_track;
+ std::size_t m_stream;
std::vector<Track const*> m_tracks;
void drumHit(double time, int pad);
void guitarPlay(double time, input::Event const& ev);
@@ -87,7 +90,7 @@ class GuitarGraph {
Chords::iterator m_chordIt;
typedef std::map<Duration const*, int> NoteStatus;
NoteStatus m_notes;
- AnimValue m_hammerReady;
+ AnimValue m_correctness;
int m_score;
};
diff --git a/game/screen_sing.cc b/game/screen_sing.cc
index ad4444f..17956e8 100644
--- a/game/screen_sing.cc
+++ b/game/screen_sing.cc
@@ -51,7 +51,22 @@ void ScreenSing::instrumentLayout(double time) {
for (Instruments::size_type i = 0, s = m_instruments.size(); i < s; ++i) {
m_instruments[i].position((0.5 + i - 0.5 * s) * iw, iw);
}
- for (Instruments::iterator it = m_instruments.begin(); it != m_instruments.end(); ++it) it->draw(time);
+ typedef std::pair<unsigned, double> CountSum;
+ std::map<unsigned, CountSum> volume; // stream number to (count, sum)
+ for (Instruments::iterator it = m_instruments.begin(); it != m_instruments.end(); ++it) {
+ it->engine(m_audio);
+ CountSum& cs = volume[it->stream() + 1];
+ cs.first++;
+ cs.second += it->correctness();
+ it->draw(time);
+ }
+ // Set volume levels (averages of all instruments playing that track)
+ for (std::size_t i = 0, s = m_song->music.size(); i < s; ++i) {
+ double level = 1.0;
+ CountSum cs = volume[i];
+ if (cs.first > 0) level = cs.second / cs.first;
+ m_audio.streamFade(i, level); // +1 because 0 is bg
+ }
}
void ScreenSing::exit() {
|
|
From: knittl <kn...@us...> - 2009-08-03 08:41:22
|
Module: performous
Branch: master
Commit: 879f2ac3970cf11ddab71061853f9413bd21f3cc
Author: Lasse Karkkainen <tro...@tr...>
Date: Sun Aug 2 20:19:11 2009 +0300
Miss = -50 points now (was -100).
---
game/guitargraph.cc | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index 9c92b02..c5aa978 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -119,7 +119,7 @@ void GuitarGraph::drumHit(double time, int fret) {
std::cout << "Drum: ";
if (best == m_chords.end()) {
std::cout << "MISS" << std::endl;
- m_score -= 100;
+ m_score -= 50;
m_hammerReady.setTarget(0.0, true); // Instantly go to zero
} else {
while (best != m_chordIt) {
@@ -172,7 +172,7 @@ void GuitarGraph::guitarPlay(double time, input::Event const& ev) {
if (best == m_chords.end()) {
std::cout << "MISS" << std::endl;
if (picked) {
- m_score -= 100;
+ m_score -= 50;
m_hammerReady.setTarget(0.0, true); // Instantly go to zero
}
} else {
|
|
From: knittl <kn...@us...> - 2009-08-03 08:41:20
|
Module: performous
Branch: master
Commit: dcb84457404ca9648ec7a0c66ae235a752621f5e
Author: Lasse Karkkainen <tro...@tr...>
Date: Sun Aug 2 15:14:34 2009 +0300
Automatically remove inactive instruments.
---
game/guitargraph.cc | 9 ++++++---
game/guitargraph.hh | 6 ++++--
game/screen_sing.cc | 9 ++++++++-
game/screen_sing.hh | 1 +
4 files changed, 19 insertions(+), 6 deletions(-)
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index 0c5d601..9c92b02 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -39,10 +39,11 @@ GuitarGraph::GuitarGraph(Song const& song, bool drums, unsigned track):
m_button("button.svg"),
m_tap("tap.svg"),
m_drums(drums),
- m_cx(),
- m_width(0.5),
+ m_cx(0.0, 0.2),
+ m_width(0.5, 0.4),
m_track(track),
m_level(),
+ m_dead(-1),
m_text(getThemePath("sing_timetxt.svg"), config["graphic/text_lod"].f()),
m_hammerReady(0.0, 2.0),
m_score()
@@ -74,6 +75,7 @@ void GuitarGraph::engine(double time) {
}
// Handle all events
for (input::Event ev; m_input.tryPoll(ev);) {
+ m_dead = false;
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) {
@@ -98,6 +100,7 @@ void GuitarGraph::engine(double time) {
while (m_chordIt != m_chords.end() && m_chordIt->begin + maxTolerance < time) {
if (m_chordIt->status < m_chordIt->polyphony) m_hammerReady.setTarget(0.0);
++m_chordIt;
+ ++m_dead;
}
}
@@ -223,7 +226,7 @@ glutil::Color const& GuitarGraph::color(int fret) const {
void GuitarGraph::draw(double time) {
engine(time);
Dimensions dimensions(1.0); // FIXME: bogus aspect ratio (is this fixable?)
- dimensions.screenBottom().middle(m_cx).fixedWidth(m_width);
+ dimensions.screenBottom().middle(m_cx.get()).fixedWidth(m_width.get());
glutil::PushMatrixMode pmm(GL_PROJECTION);
double offsetX = 0.5 * (dimensions.x1() + dimensions.x2());
double frac = 0.75; // Adjustable: 1.0 means fully separated, 0.0 means fully attached
diff --git a/game/guitargraph.hh b/game/guitargraph.hh
index e48c835..6a8082e 100644
--- a/game/guitargraph.hh
+++ b/game/guitargraph.hh
@@ -53,7 +53,8 @@ class GuitarGraph {
*/
void draw(double time);
void engine(double time);
- void position(double cx, double width) { m_cx = cx; m_width = width; }
+ void position(double cx, double width) { m_cx.setTarget(cx); m_width.setTarget(width); }
+ double dead(double time) const { return time > -0.5 && m_dead > 10; }
private:
input::InputDev m_input;
Song const& m_song;
@@ -62,7 +63,7 @@ class GuitarGraph {
AnimValue m_hit[6];
boost::ptr_vector<Texture> m_necks;
bool m_drums;
- double m_cx, m_width;
+ AnimValue m_cx, m_width;
unsigned m_track;
std::vector<Track const*> m_tracks;
void drumHit(double time, int pad);
@@ -74,6 +75,7 @@ class GuitarGraph {
DIFFICULTY_AMAZING,
DIFFICULTYCOUNT
} m_level;
+ int m_dead;
glutil::Color const& color(int fret) const;
void drawBar(double time, float h);
void difficultyAuto();
diff --git a/game/screen_sing.cc b/game/screen_sing.cc
index 11e714a..ad4444f 100644
--- a/game/screen_sing.cc
+++ b/game/screen_sing.cc
@@ -41,10 +41,17 @@ void ScreenSing::enter() {
m_instruments.insert(it, new GuitarGraph(*m_song, drums, num));
} catch (std::runtime_error&) { if (drums) break; drums = true; }
}
+}
+
+void ScreenSing::instrumentLayout(double time) {
+ for (Instruments::iterator it = m_instruments.begin(); it != m_instruments.end();) {
+ if (it->dead(time)) it = m_instruments.erase(it); else ++it;
+ }
double iw = std::min(0.5, 1.0 / m_instruments.size());
for (Instruments::size_type i = 0, s = m_instruments.size(); i < s; ++i) {
m_instruments[i].position((0.5 + i - 0.5 * s) * iw, iw);
}
+ for (Instruments::iterator it = m_instruments.begin(); it != m_instruments.end(); ++it) it->draw(time);
}
void ScreenSing::exit() {
@@ -182,7 +189,7 @@ void ScreenSing::draw() {
theme->bg_top.draw();
}
- for (Instruments::iterator it = m_instruments.begin(); it != m_instruments.end(); ++it) it->draw(time);
+ instrumentLayout(time);
if( m_song->tracks.empty() ) {
m_layout_singer->draw(time, LayoutSinger::BOTTOM);
diff --git a/game/screen_sing.hh b/game/screen_sing.hh
index ca5ace9..fdf08ba 100644
--- a/game/screen_sing.hh
+++ b/game/screen_sing.hh
@@ -60,6 +60,7 @@ class ScreenSing: public Screen {
- is the hiscore file writable
*/
void activateNextScreen();
+ void instrumentLayout(double time);
Audio& m_audio;
Capture& m_capture;
Players& m_players;
|
|
From: knittl <kn...@us...> - 2009-08-03 08:41:18
|
Module: performous Branch: master Commit: 5c54d33b441a898db2b912cd43cbf0c9a71cd769 Author: Lasse Karkkainen <tro...@tr...> Date: Sun Aug 2 14:23:46 2009 +0300 Update instruments.txt with Rock Band instruments. --- docs/instruments.txt | 41 +++++++++++++++++++++++++++++++++++++---- 1 files changed, 37 insertions(+), 4 deletions(-) diff --git a/docs/instruments.txt b/docs/instruments.txt index 65bdeea..e76a195 100644 --- a/docs/instruments.txt +++ b/docs/instruments.txt @@ -49,14 +49,33 @@ Ex: A5- => SDL axis 4 with negative value PICK DOWN: A6+ PICK UP: A6- +[Rock Band I] PS3 Guitar + USB id: 12ba:0200 + SDL name: Licensed by Sony Computer Entertainment America Harmonix Guitar for PlayStation®3 (Note: Latin-1 encoding) + GREEN FRET: B2 + RED FRET: B3 + YELLOW FRET: B4 + BLUE FRET: B1 + ORANGE FRET: B5 + START: B10 + SELECT: B9 + PS3: B13 + DOWN: A6+ + UP: A6- + LEFT: A5- + RIGHT: A5+ + BEND: A3 = 1.0 (fully pressed) .. -1.0 (fully released), but resets to 0.0 after a while when fully released + PICK DOWN: A6+ + PICK UP: A6- + [Guitar Hero World Tour] PS3 Drumkit USB id: 12ba:0120 SDL name: Licensed by Sony Computer Entertainment Guitar Hero4 for PlayStation (R) 3 - GREEN FRET or CROSS: B2 RED FRET or CIRCLE: B3 YELLOW FRET or TRIANGLE: B4 BLUE FRET or SQUARE: B1 ORANGE FRET: B6 + GREEN FRET or CROSS: B2 KICK: B5 START: B10 SELECT: B9 @@ -65,9 +84,23 @@ Ex: A5- => SDL axis 4 with negative value UP: A6- LEFT: A5- RIGHT: A5+ - BEND: A3+ - PICK DOWN: A6+ - PICK UP: A6- + +[Rock Band I] PS3 Drumkit + USB id: 12ba:0210 + SDL name: Licensed by Sony Computer Entertainment America Harmonix Drum Kit for PlayStation(R)3 + RED FRET or CIRCLE: B3 + YELLOW FRET or TRIANGLE: B4 + BLUE FRET or SQUARE: B1 + GREEN FRET or CROSS: B2 + KICK: B5 + START: B10 + SELECT: B9 + PS3: B13 + DOWN: A6+ + UP: A6- + LEFT: A5- + RIGHT: A5+ + Performous InputDev button numbers |
|
From: knittl <kn...@us...> - 2009-08-03 08:41:17
|
Module: performous
Branch: master
Commit: 601fc3c47fa3c7ac689cc4b8878c9a9400ef142d
Author: Lasse Karkkainen <tro...@tr...>
Date: Sun Aug 2 13:47:22 2009 +0300
Cursor fix.
---
game/guitargraph.cc | 17 +++++++++++++++--
1 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index 3570dda..0c5d601 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -60,6 +60,19 @@ GuitarGraph::GuitarGraph(Song const& song, bool drums, unsigned track):
}
void GuitarGraph::engine(double time) {
+ // Handle holds
+ if (!m_drums) {
+ for (int i = 0; i < 5; ++i) {
+ if (m_input.pressed(i)) {
+ m_hit[i + 1].setValue(1.0);
+ // TODO: score holds etc
+ } else {
+ // TODO: Release holds
+ }
+
+ }
+ }
+ // Handle all events
for (input::Event ev; m_input.tryPoll(ev);) {
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);
@@ -79,8 +92,9 @@ void GuitarGraph::engine(double time) {
} else {
if (ev.type == input::Event::PRESS || ev.type == input::Event::PICK) guitarPlay(time, ev);
}
+ if (m_score < 0) m_score = 0;
}
-
+ // Skip missed notes
while (m_chordIt != m_chords.end() && m_chordIt->begin + maxTolerance < time) {
if (m_chordIt->status < m_chordIt->polyphony) m_hammerReady.setTarget(0.0);
++m_chordIt;
@@ -170,7 +184,6 @@ void GuitarGraph::guitarPlay(double time, input::Event const& ev) {
m_score += score;
m_hammerReady.setTarget(1.0, true); // Instantly go to one
}
- if (m_score < 0) m_score = 0;
}
void GuitarGraph::difficultyAuto() {
|
|
From: knittl <kn...@us...> - 2009-08-03 08:41:15
|
Module: performous
Branch: master
Commit: e568f5201dbef9495ca169f1da9bc457ecb1b3ad
Author: Lasse Karkkainen <tro...@tr...>
Date: Sun Aug 2 13:39:22 2009 +0300
Fix/improve cursor.
---
game/animvalue.hh | 2 ++
game/guitargraph.cc | 31 ++++++++++++-------------------
game/guitargraph.hh | 2 +-
3 files changed, 15 insertions(+), 20 deletions(-)
diff --git a/game/animvalue.hh b/game/animvalue.hh
index 1f36eac..f009201 100644
--- a/game/animvalue.hh
+++ b/game/animvalue.hh
@@ -23,6 +23,8 @@ class AnimValue {
}
/// hard-sets anim value
void setValue(double value) { m_value = value; }
+ /// set the adjustment rate
+ void setRate(double value) { m_rate = value; }
/// get current anim value
double get() const {
double maxadj = m_rate * duration();
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index 5c4042a..3570dda 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -38,7 +38,6 @@ GuitarGraph::GuitarGraph(Song const& song, bool drums, unsigned track):
m_song(song),
m_button("button.svg"),
m_tap("tap.svg"),
- m_pickValue(0.0, 5.0),
m_drums(drums),
m_cx(),
m_width(0.5),
@@ -55,12 +54,15 @@ GuitarGraph::GuitarGraph(Song const& song, bool drums, unsigned track):
else if (it->name == "BASS") m_necks.push_back(new Texture("bassneck.svg"));
else m_necks.push_back(new Texture("guitarneck.svg"));
}
+ for (int i = 0; i < 6; ++i) m_hit[i].setRate(5.0);
if (m_tracks.empty()) throw std::runtime_error("No tracks");
difficultyAuto();
}
void GuitarGraph::engine(double time) {
for (input::Event ev; m_input.tryPoll(ev);) {
+ 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) {
if (ev.type == input::Event::PICK || (m_drums && ev.type == input::Event::PRESS)) {
if (ev.pressed[4]) {
@@ -129,11 +131,7 @@ void GuitarGraph::drumHit(double time, int fret) {
void GuitarGraph::guitarPlay(double time, input::Event const& ev) {
bool picked = (ev.type == input::Event::PICK);
bool const* frets = ev.pressed; // Kinda b0rked, FIXME
- if (picked) {
- m_pickValue.setValue(1.0);
- } else {
- if (m_hammerReady.get() < 0.5) return; // Hammering not possible at the moment
- }
+ if (!picked && m_hammerReady.get() < 0.5) return; // Hammering not possible at the moment
m_hammerReady.setTarget(0.0);
// Find any suitable note within the tolerance
double tolerance = maxTolerance;
@@ -291,25 +289,20 @@ void GuitarGraph::draw(double time) {
}
}
}
- // Draw the cursor / bass pedal
- float level = m_pickValue.get();
+ // Draw the cursor
+ float level = m_hit[0].get();
glColor3f(level, level, level);
drawBar(0.0, 0.01f);
// Fret buttons on cursor
- for (int fret = 0; fret < 5; ++fret) {
- float x = -2.0f + fret;
- if (m_drums) {
- if (fret == 0) continue;
- x -= 0.5f;
- }
+ for (int fret = m_drums; fret < 5; ++fret) {
+ float x = -2.0f + fret - 0.5f * m_drums;
glColor4fv(color(fret));
m_button.dimensions.center(time2y(0.0)).middle(x);
m_button.draw();
- if (m_input.pressed(fret)) {
- glColor3f(1.0f, 1.0f, 1.0f);
- m_tap.dimensions = m_button.dimensions;
- m_tap.draw();
- }
+ float l = m_hit[fret + !m_drums].get();
+ glColor3f(l, l, l);
+ m_tap.dimensions = m_button.dimensions;
+ m_tap.draw();
}
glColor3f(1.0f, 1.0f, 1.0f);
}
diff --git a/game/guitargraph.hh b/game/guitargraph.hh
index 77cd3cf..e48c835 100644
--- a/game/guitargraph.hh
+++ b/game/guitargraph.hh
@@ -59,7 +59,7 @@ class GuitarGraph {
Song const& m_song;
Surface m_button;
Surface m_tap;
- AnimValue m_pickValue;
+ AnimValue m_hit[6];
boost::ptr_vector<Texture> m_necks;
bool m_drums;
double m_cx, m_width;
|
|
From: knittl <kn...@us...> - 2009-08-03 08:41:13
|
Module: performous
Branch: master
Commit: c34814f6702d4fa37a3c29ca06c8aebb881b64a2
Author: Vincent Le Ligeour <yo...@us...>
Date: Sun Aug 2 11:58:58 2009 +0200
Removed debug messages
---
game/joystick.hh | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/game/joystick.hh b/game/joystick.hh
index 603fa23..fd0d791 100644
--- a/game/joystick.hh
+++ b/game/joystick.hh
@@ -36,12 +36,14 @@ namespace input {
void addEvent(Event _event) {
// only add event if the device is assigned
if( m_assigned ) m_events.push_back(_event);
+ /*
if( _event.type == input::Event::PICK )
std::cout << "PICK event " << _event.button << std::endl;
if( _event.type == input::Event::PRESS )
std::cout << "PRESS event " << _event.button << std::endl;
if( _event.type == input::Event::RELEASE )
std::cout << "RELEASE event " << _event.button << std::endl;
+ */
// always keep track of button status
for( unsigned int i = 0 ; i < BUTTONS ; ++i ) {
m_pressed[i] = _event.pressed[i];
|
|
From: knittl <kn...@us...> - 2009-08-03 08:41:13
|
Module: performous
Branch: master
Commit: 381f0492d2f6b80ad94c8493043cc092391ced30
Author: Lasse Karkkainen <tro...@tr...>
Date: Sun Aug 2 11:15:35 2009 +0300
Rewritten drum code. Rendering fixes.
---
game/guitargraph.cc | 104 +++++++++++++++++++++++++++++++--------------------
game/guitargraph.hh | 2 +-
2 files changed, 64 insertions(+), 42 deletions(-)
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index 8cf2485..5c4042a 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -20,9 +20,12 @@ namespace {
return std::pow(a, 0.8); // Nicer curve
}
+ const double maxTolerance = 0.1;
+
double points(double error) {
- double score = 15;
- if (error < 0.1) score += 15;
+ double score = 0.0;
+ if (error < maxTolerance) score += 15;
+ if (error < 0.075) score += 15;
if (error < 0.05) score += 15;
if (error < 0.03) score += 5;
return score;
@@ -75,33 +78,52 @@ void GuitarGraph::engine(double time) {
if (ev.type == input::Event::PRESS || ev.type == input::Event::PICK) guitarPlay(time, ev);
}
}
+
+ while (m_chordIt != m_chords.end() && m_chordIt->begin + maxTolerance < time) {
+ if (m_chordIt->status < m_chordIt->polyphony) m_hammerReady.setTarget(0.0);
+ ++m_chordIt;
+ }
}
void GuitarGraph::drumHit(double time, int fret) {
- if (fret == 0) m_pickValue.setValue(1.0);
- int basepitch = diffv[m_level].basepitch;
- NoteMap const& nm = m_tracks[m_track]->nm;
- NoteMap::const_iterator it = nm.find(basepitch + fret);
- if (it == nm.end()) return;
- Durations const& dur = it->second;
- Durations::const_iterator it2 = dur.begin(), it2tmp, it2end = dur.end();
- double tolerance = 0.2;
- // Find the first suitable note within the tolerance
- while (it2 != it2end && (it2->begin < time - tolerance || m_notes[&*it2] != 0)) ++it2;
- // If we are already past the accepted region, skip further processing
- if (it2 == it2end || it2->begin > time + tolerance) { m_score -= 100; return; }
- // Find the note with the smallest error
- it2tmp = it2;
- Duration const* d = NULL;
- do {
- it2 = it2tmp;
- if (m_notes[&*it2] != 0) return; // Notes already played are ignored
- d = &*it2;
- tolerance = std::abs(it2->begin - time);
- } while (++it2tmp != it2end && std::abs(it2tmp->begin - time) < tolerance);
- if (!d) throw std::logic_error("d is NULL in GuitarGraph::engine");
- m_score += points(tolerance);
- m_notes[d] = 2;
+ // Find any suitable note within the tolerance
+ double tolerance = maxTolerance;
+ Chords::iterator best = m_chords.end();
+ for (Chords::iterator it = m_chordIt; it != m_chords.end() && it->begin <= time + tolerance; ++it) {
+ if (m_notes[it->dur[fret]]) continue; // Already played
+ double error = std::abs(it->begin - time);
+ if (error < tolerance) {
+ best = it;
+ tolerance = error;
+ }
+ }
+ std::cout << "Drum: ";
+ if (best == m_chords.end()) {
+ std::cout << "MISS" << std::endl;
+ m_score -= 100;
+ m_hammerReady.setTarget(0.0, true); // Instantly go to zero
+ } else {
+ while (best != m_chordIt) {
+ if (m_chordIt->status == m_chordIt->polyphony) continue;
+ m_hammerReady.setTarget(0.0);
+ std::cout << "SKIPPED, ";
+ ++m_chordIt;
+ }
+ ++m_chordIt->status;
+ m_notes[m_chordIt->dur[fret]] = 1;
+ double score = points(tolerance);
+ m_chordIt->score += score;
+ m_score += score;
+ if (m_chordIt->status == m_chordIt->polyphony) {
+ m_score -= m_chordIt->score;
+ m_chordIt->score *= m_chordIt->polyphony;
+ m_score += m_chordIt->score;
+ std::cout << "FULL HIT!";
+ } else {
+ std::cout << "HIT";
+ }
+ }
+ std::cout << std::endl;
}
void GuitarGraph::guitarPlay(double time, input::Event const& ev) {
@@ -114,8 +136,7 @@ void GuitarGraph::guitarPlay(double time, input::Event const& ev) {
}
m_hammerReady.setTarget(0.0);
// Find any suitable note within the tolerance
- double tolerance = 0.2;
- if (!picked) tolerance *= 0.5; // Hammering and drums have stricter limits
+ double tolerance = maxTolerance;
Chords::iterator best = m_chords.end();
for (Chords::iterator it = m_chordIt; it != m_chords.end() && it->begin <= time + tolerance; ++it) {
if (it->status > 1) continue; // Already picked, can't play again
@@ -132,7 +153,7 @@ void GuitarGraph::guitarPlay(double time, input::Event const& ev) {
tolerance = error;
}
}
- std::cout << (picked ? "Hard: " : "Soft: ");
+ std::cout << (picked ? "Pick: " : "Tap: ");
if (best == m_chords.end()) {
std::cout << "MISS" << std::endl;
if (picked) {
@@ -189,15 +210,6 @@ glutil::Color const& GuitarGraph::color(int fret) const {
}
void GuitarGraph::draw(double time) {
- if (time < -0.5) {
- std::string txt = (m_drums ? "Hit a pad to change:\n" : "Play a fret to change:\n");
- txt += m_tracks[m_track]->name + "/" + diffv[m_level].name;
- m_text.dimensions.screenBottom(-0.05).middle(0.0);
- m_text.draw(txt);
- } else {
- m_text.dimensions.screenBottom(-0.1).middle(0.2);
- m_text.draw(boost::lexical_cast<std::string>(m_score));
- }
engine(time);
Dimensions dimensions(1.0); // FIXME: bogus aspect ratio (is this fixable?)
dimensions.screenBottom().middle(m_cx).fixedWidth(m_width);
@@ -207,6 +219,15 @@ void GuitarGraph::draw(double time) {
glTranslatef(frac * 2.0 * offsetX, 0.0f, 0.0f);
glutil::PushMatrixMode pmb(GL_MODELVIEW);
glTranslatef((1.0 - frac) * offsetX, dimensions.y2(), 0.0f);
+ if (time < -0.5) {
+ std::string txt;
+ txt += m_tracks[m_track]->name + "\n" + diffv[m_level].name;
+ m_text.dimensions.middle(-0.1);
+ m_text.draw(txt);
+ } else {
+ m_text.dimensions.middle(0.0);
+ m_text.draw(boost::lexical_cast<std::string>(m_score));
+ }
glRotatef(85.0f, 1.0f, 0.0f, 0.0f);
{ float s = dimensions.w() / 5.0f; glScalef(s, s, s); }
// Draw the neck
@@ -251,14 +272,15 @@ void GuitarGraph::draw(double time) {
}
if (tEnd > tBeg) {
glutil::Begin block(GL_TRIANGLE_STRIP);
- for (float t = tEnd; t > tBeg; t -= 0.1f) {
+ for (float t = tEnd; true; t -= 0.1f) {
+ if (t < tBeg) t = tBeg;
c.a = time2a(t); glColor4fv(c);
glVertex2f(x - wLine, time2y(t));
glVertex2f(x + wLine, time2y(t));
+ if (t == tBeg) break;
}
- glVertex2f(x - wLine, time2y(tBeg));
- glVertex2f(x + wLine, time2y(tBeg));
}
+ c.a = time2a(tBeg); glColor4fv(c);
m_button.dimensions.center(time2y(tBeg)).middle(x);
m_button.draw();
if (it->tappable) {
diff --git a/game/guitargraph.hh b/game/guitargraph.hh
index 4fae928..77cd3cf 100644
--- a/game/guitargraph.hh
+++ b/game/guitargraph.hh
@@ -16,7 +16,7 @@ struct Chord {
Duration const* dur[5];
int polyphony;
bool tappable;
- int status; // 0 = not played, 1 = tapped, 2 = picked, 3 = released
+ int status; // Guitar: 0 = not played, 10 = tapped, 20 = picked, 30 = released, drums: number of pads hit
int score;
Chord(): begin(), end(), polyphony(), tappable(), status(), score() {
std::fill(fret, fret + 5, false);
|
|
From: knittl <kn...@us...> - 2009-08-03 08:41:12
|
Module: performous Branch: master Commit: 123019acdee6580a8a2d4041712cd5c46f11b543 Author: Lasse Karkkainen <tro...@tr...> Date: Sun Aug 2 12:19:41 2009 +0300 Remove Silky Strings. --- CMakeLists.txt | 5 - silkystrings/CMakeLists.txt | 5 - silkystrings/COPYING | 375 ------ silkystrings/doc/Architecture.png | Bin 16177 -> 0 bytes silkystrings/doc/index.xhtml | 213 ---- silkystrings/doc/shot.png | Bin 76748 -> 0 bytes silkystrings/doxygen-conf | 1252 -------------------- silkystrings/resources/Share-TechMono.ttf | Bin 58548 -> 0 bytes silkystrings/resources/fiba1.ogg | Bin 18685 -> 0 bytes silkystrings/resources/fiba2.ogg | Bin 18815 -> 0 bytes silkystrings/resources/fiba3.ogg | Bin 18268 -> 0 bytes silkystrings/resources/fiba4.ogg | Bin 16073 -> 0 bytes silkystrings/resources/fiba5.ogg | Bin 18495 -> 0 bytes silkystrings/resources/fiba6.ogg | Bin 18883 -> 0 bytes silkystrings/resources/perfect1.ogg | Bin 31402 -> 0 bytes silkystrings/src/Action.cpp | 368 ------ silkystrings/src/Action.h | 122 -- silkystrings/src/CMakeLists.txt | 65 - silkystrings/src/ElementDataBuffer.h | 96 -- silkystrings/src/GL.h | 30 - silkystrings/src/GLExtensionProxy.cpp | 226 ---- silkystrings/src/GLExtensionProxy.h | 216 ---- silkystrings/src/GameView.cpp | 454 ------- silkystrings/src/GameView.h | 169 --- silkystrings/src/Input.cpp | 80 -- silkystrings/src/Input.h | 89 -- silkystrings/src/Key.h | 248 ---- silkystrings/src/KeyEventClient.h | 51 - silkystrings/src/LauncherWindow.cpp | 258 ---- silkystrings/src/LauncherWindow.h | 62 - silkystrings/src/Mesh.cpp | 448 ------- silkystrings/src/Mesh.h | 187 --- silkystrings/src/MeshFactory.cpp | 241 ---- silkystrings/src/MeshFactory.h | 82 -- silkystrings/src/Reaction.cpp | 102 -- silkystrings/src/Reaction.h | 81 -- silkystrings/src/SoftwareElementDataBuffer.cpp | 101 -- silkystrings/src/SoftwareElementDataBuffer.h | 82 -- silkystrings/src/SoftwareVertexDataBuffer.cpp | 83 -- silkystrings/src/SoftwareVertexDataBuffer.h | 92 -- silkystrings/src/SongIterator.cpp | 55 - silkystrings/src/SongIterator.h | 74 -- silkystrings/src/Sound.cpp | 201 ---- silkystrings/src/Sound.h | 49 - silkystrings/src/TextRenderer.cpp | 358 ------ silkystrings/src/TextRenderer.h | 91 -- silkystrings/src/Texture2D.cpp | 293 ----- silkystrings/src/Texture2D.h | 138 --- silkystrings/src/Util.h | 30 - silkystrings/src/VertexDataBuffer.h | 92 -- silkystrings/src/VertexDataBufferManager.cpp | 51 - silkystrings/src/VertexDataBufferManager.h | 88 -- silkystrings/src/VertexFormat.cpp | 269 ----- silkystrings/src/VertexFormat.h | 616 ---------- silkystrings/src/WM.cpp | 200 ---- silkystrings/src/WM.h | 165 --- silkystrings/src/chord.cpp | 90 -- silkystrings/src/chord.h | 142 --- silkystrings/src/midiEvent.cpp | 54 - silkystrings/src/midiEvent.h | 68 -- silkystrings/src/midiFileParser.cpp | 163 --- silkystrings/src/midiFileParser.h | 74 -- silkystrings/src/midiStream.cpp | 67 -- silkystrings/src/midiStream.h | 72 -- silkystrings/src/silkystrings.cpp | 88 -- silkystrings/tests/CMakeLists.txt | 29 - silkystrings/tests/gameview-test.cpp | 119 -- .../tests/input-keyevent-handling-test.cpp | 69 -- silkystrings/tests/keyevent_client-test.cpp | 131 -- silkystrings/tests/mesh-cube-test.cpp | 208 ---- silkystrings/tests/mesh-factory-test.cpp | 114 -- silkystrings/tests/reaction-test.cpp | 76 -- silkystrings/tests/test-fortunes-omg | 286 ----- silkystrings/tests/textrenderer-load-font-test.cpp | 127 -- silkystrings/tests/vertex_data_buffer-test.cpp | 136 --- silkystrings/tests/vertexformat-test.cpp | 74 -- silkystrings/tests/wm-busyloop-update-test.cpp | 30 - silkystrings/tests/wm-get_clock-sleep-test.cpp | 42 - silkystrings/tests/wm-gl-extensions-test.cpp | 43 - silkystrings/tests/wm-openwindow-test.cpp | 29 - .../tests/wm_input-keyevent-propagation-test.cpp | 39 - 81 files changed, 0 insertions(+), 11023 deletions(-) |
|
From: knittl <kn...@us...> - 2009-08-03 08:41:06
|
Module: performous
Branch: master
Commit: 6c0398aa68526e3cc4044c1ac5ce14a18cdadcd9
Author: Lasse Karkkainen <tro...@tr...>
Date: Sat Aug 1 23:24:26 2009 +0300
Use tap.svg for buttonpressed hilight.
Subdivide long notes into shorter pieces to make the alpha correct (and to allow wave effects later).
---
game/guitargraph.cc | 24 ++++++++++++------------
1 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index 2a9b49e..8cf2485 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -249,12 +249,13 @@ void GuitarGraph::draw(double time) {
drawBar(tBeg, 0.01f);
continue;
}
- {
+ if (tEnd > tBeg) {
glutil::Begin block(GL_TRIANGLE_STRIP);
- c.a = time2a(tEnd); glColor4fv(c);
- glVertex2f(x - wLine, time2y(tEnd));
- glVertex2f(x + wLine, time2y(tEnd));
- c.a = time2a(tBeg); glColor4fv(c);
+ for (float t = tEnd; t > tBeg; t -= 0.1f) {
+ c.a = time2a(t); glColor4fv(c);
+ glVertex2f(x - wLine, time2y(t));
+ glVertex2f(x + wLine, time2y(t));
+ }
glVertex2f(x - wLine, time2y(tBeg));
glVertex2f(x + wLine, time2y(tBeg));
}
@@ -279,15 +280,14 @@ void GuitarGraph::draw(double time) {
if (fret == 0) continue;
x -= 0.5f;
}
- glutil::Color c = color(fret);
- if (m_input.pressed(fret)) {
- c.r = 1.0f;
- c.g = 1.0f;
- c.b = 1.0f;
- }
- glColor4fv(c);
+ glColor4fv(color(fret));
m_button.dimensions.center(time2y(0.0)).middle(x);
m_button.draw();
+ if (m_input.pressed(fret)) {
+ glColor3f(1.0f, 1.0f, 1.0f);
+ m_tap.dimensions = m_button.dimensions;
+ m_tap.draw();
+ }
}
glColor3f(1.0f, 1.0f, 1.0f);
}
|
|
From: knittl <kn...@us...> - 2009-08-03 08:41:04
|
Module: performous Branch: master Commit: dba1ca178d40f064370f78544dddf00765632104 Author: Lasse Karkkainen <tro...@tr...> Date: Sat Aug 1 22:55:44 2009 +0300 Update TODO.txt with some bugs that cannot be fixed easily :/ --- docs/TODO.txt | 31 +++++++++++++++++++++++++++++++ 1 files changed, 31 insertions(+), 0 deletions(-) diff --git a/docs/TODO.txt b/docs/TODO.txt index e1e0303..4cc6347 100644 --- a/docs/TODO.txt +++ b/docs/TODO.txt @@ -51,3 +51,34 @@ Ripper: - Compress into Vorbis Ogg and H.264 MKV + +Bugs: + +- On Compiz switching from fullscreen to window makes the window maximized even though the viewport stays small +- Random segfault deep within librsvg when entering the singing screen (very hard to reproduce) + +*** glibc detected *** performous: free(): invalid pointer: 0x00007f1bc016ec30 *** +======= Backtrace: ========= +/lib/libc.so.6[0x7f1bdc530cb8] +/lib/libc.so.6(cfree+0x76)[0x7f1bdc533276] +/usr/lib/libglib-2.0.so.0(g_ptr_array_free+0x4a)[0x7f1bdfca68fa] +/usr/lib/librsvg-2.so.2[0x7f1bdf5b0c2c] +/usr/lib/librsvg-2.so.2[0x7f1bdf5b0c59] +/usr/lib/librsvg-2.so.2[0x7f1bdf59c532] +/usr/lib/librsvg-2.so.2[0x7f1bdf5be78d] +/usr/lib/libgobject-2.0.so.0(g_object_unref+0xc2)[0x7f1bdfa5a1f2] +/usr/lib/librsvg-2.so.2[0x7f1bdf5bed68] +/usr/lib/librsvg-2.so.2(rsvg_pixbuf_from_file_at_size+0x26)[0x7f1bdf5bee56] +performous(_Z6loaderI7TextureEvRT_Ssb+0x82c)[0x451e1c] +performous(_ZN7TextureC1ERKSs+0x44)[0x44f8b4] +performous(_ZN11ProgressBarC1ERKSsS1_NS_4ModeEffb+0x40)[0x4aebd0] +performous(_ZN10ScreenSing5enterEv+0x209)[0x4c9379] +performous(_ZN11ScreenSongs15manageSharedKeyEi6SDLMod+0x178)[0x475d68] +performous(_ZN11ScreenSongs11manageEventE9SDL_Event+0xcb)[0x47600b] +performous[0x4d0659] +performous(_Z8mainLoopv+0x579)[0x4d1bf9] +performous(main+0x1d30)[0x4d42c0] + +- Random segfault on program exit (very hard to reproduce) + * Don't even need to enter songs screen, start and exit is enough. + |
|
From: knittl <kn...@us...> - 2009-08-03 08:41:01
|
Module: performous
Branch: master
Commit: 4145b20588ce7c7fc5fe9af3d5a092eb6cc597b3
Author: Lasse Karkkainen <tro...@tr...>
Date: Sat Aug 1 22:31:22 2009 +0300
Fix guitar gameplay.
---
game/guitargraph.cc | 28 +++++++++++++---------------
1 files changed, 13 insertions(+), 15 deletions(-)
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index 2e1951a..2a9b49e 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -58,24 +58,22 @@ GuitarGraph::GuitarGraph(Song const& song, bool drums, unsigned track):
void GuitarGraph::engine(double time) {
for (input::Event ev; m_input.tryPoll(ev);) {
- if (m_drums) {
- if (ev.type == input::Event::PRESS) drumHit(time, ev.button);
- } else {
- if (time < -0.5) {
- if (ev.type == input::Event::PICK) {
- if (ev.pressed[4]) {
- ++m_track;
- if (!difficulty(m_level)) difficultyAuto();
- }
- if (ev.pressed[0]) difficulty(DIFFICULTY_SUPAEASY);
- else if (ev.pressed[1]) difficulty(DIFFICULTY_EASY);
- else if (ev.pressed[2]) difficulty(DIFFICULTY_MEDIUM);
- else if (ev.pressed[3]) difficulty(DIFFICULTY_AMAZING);
+ if (time < -0.5) {
+ if (ev.type == input::Event::PICK || (m_drums && ev.type == input::Event::PRESS)) {
+ if (ev.pressed[4]) {
+ ++m_track;
+ if (!difficulty(m_level)) difficultyAuto();
}
- continue;
+ if (ev.pressed[0]) difficulty(DIFFICULTY_SUPAEASY);
+ else if (ev.pressed[1]) difficulty(DIFFICULTY_EASY);
+ else if (ev.pressed[2]) difficulty(DIFFICULTY_MEDIUM);
+ else if (ev.pressed[3]) difficulty(DIFFICULTY_AMAZING);
}
+ } else if (m_drums) {
+ if (ev.type == input::Event::PRESS) drumHit(time, ev.button);
+ } else {
+ if (ev.type == input::Event::PRESS || ev.type == input::Event::PICK) guitarPlay(time, ev);
}
- if (m_score < 0) m_score = 0;
}
}
|
|
From: knittl <kn...@us...> - 2009-08-03 08:40:59
|
Module: performous
Branch: master
Commit: 7f923d8438b1a0721c6629f44ffa144c8f060e73
Author: Lasse Karkkainen <tro...@tr...>
Date: Sat Aug 1 21:14:57 2009 +0300
Better perspective (kinda hacky).
---
game/guitargraph.cc | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index 2390648..0560e6d 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -204,9 +204,10 @@ void GuitarGraph::draw(double time) {
Dimensions dimensions(1.0); // FIXME: bogus aspect ratio (is this fixable?)
dimensions.screenBottom().middle(m_cx).fixedWidth(m_width);
glutil::PushMatrixMode pmm(GL_PROJECTION);
- glTranslatef((dimensions.x1() + dimensions.x2()), 0.0f, 0.0f);
+ float offsetX = 0.5 * (dimensions.x1() + dimensions.x2());
+ glTranslatef(offsetX, 0.0f, 0.0f);
glutil::PushMatrixMode pmb(GL_MODELVIEW);
- glTranslatef(0.0, dimensions.y2(), 0.0f);
+ glTranslatef(0.5 * offsetX, dimensions.y2(), 0.0f);
glRotatef(85.0f, 1.0f, 0.0f, 0.0f);
{ float s = dimensions.w() / 5.0f; glScalef(s, s, s); }
// Draw the neck
|