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-05-19 09:33:02
|
Module: performous
Branch: master
Commit: 1fa9df0237d4d992acefcf13c9380fa73c01862c
Author: Tapio Vierros <tap...@gm...>
Date: Wed May 19 12:32:03 2010 +0300
Handle GL_TEXTURE_MAX_ANISOTROPY_EXT as a potential trouble maker.
---
game/surface.cc | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/game/surface.cc b/game/surface.cc
index e8c1edc..04403fe 100644
--- a/game/surface.cc
+++ b/game/surface.cc
@@ -85,7 +85,13 @@ void Texture::load(unsigned int width, unsigned int height, pix::Format format,
glTexParameterf(type(), GL_TEXTURE_WRAP_S, GL_REPEAT);
glTexParameterf(type(), GL_TEXTURE_WRAP_T, GL_REPEAT);
//glTexParameterf(type(), GL_TEXTURE_MAX_LEVEL, 1);
- glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, 16.0f);
+ glutil::GLErrorChecker glerror1("Texture::load - glTexParameterf");
+
+ // Anisotropy is potential trouble maker
+ if (GLEW_EXT_texture_filter_anisotropic)
+ glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, 16.0f);
+ glutil::GLErrorChecker glerror2("Texture::load - MAX_ANISOTROPY_EXT");
+
glTexParameteri(type(), GL_GENERATE_MIPMAP, GL_TRUE);
PixFmt const& f = getPixFmt(format);
glPixelStorei(GL_UNPACK_SWAP_BYTES, f.swap);
@@ -105,7 +111,7 @@ void Texture::load(unsigned int width, unsigned int height, pix::Format format,
glTexImage2D(type(), 0, GL_RGBA, newWidth, newHeight, 0, f.format, f.type, &outBuf[0]);
}
// Check for OpenGL errors
- glutil::GLErrorChecker glerror("Texture::load");
+ glutil::GLErrorChecker glerror3("Texture::load");
}
void Surface::load(unsigned int width, unsigned int height, pix::Format format, unsigned char const* buffer, float ar) {
|
|
From: Tapio V. <aa...@us...> - 2010-05-19 09:12:59
|
Module: performous
Branch: master
Commit: 6d98e46fd37c8897b7f88b366de8ab524a10a627
Author: Tapio Vierros <tap...@gm...>
Date: Wed May 19 12:12:24 2010 +0300
Attempt to be MSVC friendly.
---
game/guitargraph.cc | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index 3b7399d..8653379 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -484,7 +484,7 @@ void GuitarGraph::guitarPlay(double time, input::Event const& ev) {
m_flames[ev.button].back().setTarget(1.0);
return;
}
- bool frets[m_pads]; // The combination about to be played
+ bool frets[max_panels]; // The combination about to be played
if (picked) {
for (int fret = 0; fret < m_pads; ++fret) {
frets[fret] = ev.pressed[fret];
|
|
From: Felix B. <fbe...@us...> - 2010-05-19 05:11:35
|
Module: performous
Branch: master
Commit: 5557d7d2d57c900ea81306f7603e6d527d24b176
Author: Felix Bertram <fl...@be...>
Date: Tue May 18 22:09:37 2010 -0700
RockBand song sections
* parse song sections from MIDI file
* populate vector of song sections
* jump forward/backward to next song section
---
game/midifile.cc | 17 +++++++++++++----
game/midifile.hh | 7 +++++++
game/screen_sing.cc | 45 +++++++++++++++++++++++++++++++++++++++++----
game/song.hh | 7 +++++++
game/songparser-ini.cc | 6 ++++++
5 files changed, 74 insertions(+), 8 deletions(-)
diff --git a/game/midifile.cc b/game/midifile.cc
index be3300e..ca3a236 100644
--- a/game/midifile.cc
+++ b/game/midifile.cc
@@ -177,17 +177,26 @@ MidiFileParser::Track MidiFileParser::read_track(MidiStream& stream) {
// Lyrics are hidden here, only [text] are orders
if (data[0] != '[') m_lyric = data;
else if (!data.compare(0, sect_pfx.length(), sect_pfx)) {// [section verse_1]
- // TODO: clean up the section name some more
- const std::string sect_name = data.substr(sect_pfx.length(), data.length()-sect_pfx.length()-1);
+ std::string sect_name = data.substr(sect_pfx.length(), data.length()-sect_pfx.length()-1);
+ if (sect_name != "big_rock_ending") {
+ bool space = true;
+ for (std::string::iterator it = sect_name.begin(); it != sect_name.end(); it++) {
+ if (space) *it = toupper(*it); // start in uppercase
+ if (*it == '_') {*it = ' '; space = true;} // underscores to spaces
+ else space = false;
+ }
+ // replace gtr => guitar
#if MIDI_DEBUG_LEVEL > 2
- std::cout << "Section: " << sect_name << std::endl;
+ std::cout << "Section: " << sect_name << " at " << get_seconds(miditime) << std::endl;
#endif
+ songsections.push_back(SongSection(sect_name, get_seconds(miditime)));
+ } else cmdevents.push_back(std::string(data)); // see songparser-ini.cc: we need to keep the BRE in cmdevents
}
else cmdevents.push_back(std::string(data));
#if MIDI_DEBUG_LEVEL > 2
std::cout << "Text: " << data << std::endl;
#endif
- } break;
+ } break;
// 0x02: Copyright Notice
case 0x03: // Sequence or Track Name
track.name = data;
diff --git a/game/midifile.hh b/game/midifile.hh
index 33dcfe2..6db8258 100644
--- a/game/midifile.hh
+++ b/game/midifile.hh
@@ -76,6 +76,13 @@ class MidiFileParser{
};
typedef std::vector<Track> Tracks;
Tracks tracks;
+ struct SongSection {
+ std::string name;
+ double begin;
+ SongSection(std::string const& name, const double begin): name(name), begin(begin) {}
+ };
+ typedef std::vector<SongSection> SongSections;
+ SongSections songsections; ///< vector of song sections
uint16_t parse_header(MidiStream&);
Track read_track(MidiStream&);
void cout_midi_event(uint8_t type, uint8_t arg1, uint8_t arg2, uint32_t miditime);
diff --git a/game/screen_sing.cc b/game/screen_sing.cc
index c206d55..51e4bfa 100644
--- a/game/screen_sing.cc
+++ b/game/screen_sing.cc
@@ -263,11 +263,48 @@ void ScreenSing::manageEvent(SDL_Event event) {
if (key == SDLK_F5) dispInFlash(--config["audio/controller_delay"]);
if (key == SDLK_F6) dispInFlash(++config["audio/controller_delay"]);
bool seekback = false;
- if (m_song->danceTracks.empty()) { // Seeking backwards is currently not permitted for dance songs
- if (key == SDLK_HOME) { m_audio.seekPos(0.0); seekback = true; }
- if (key == SDLK_LEFT) { m_audio.seek(-5.0); seekback = true; }
+
+ if (m_song->songsections.empty()) {
+ // standard seeking in 5s increments
+ if (m_song->danceTracks.empty()) { // Seeking backwards is currently not permitted for dance songs
+ if (key == SDLK_HOME) { m_audio.seekPos(0.0); seekback = true; }
+ if (key == SDLK_LEFT) { m_audio.seek(-5.0); seekback = true;}
+ }
+ if (key == SDLK_RIGHT) m_audio.seek(5.0);
+ } else {
+ // seeking to the next song section
+ if (m_song->danceTracks.empty()) { // Seeking backwards is currently not permitted for dance songs
+ if (key == SDLK_HOME) { m_audio.seekPos(0.0); seekback = true; }
+ if (key == SDLK_LEFT) {
+ double pos = m_audio.getPosition();
+ for (std::vector<Song::SongSection>::reverse_iterator it= m_song->songsections.rbegin(); it != m_song->songsections.rend(); it++) {
+ double begin = it->begin;
+ if (begin < pos - 1.0) { // make sure we can jump across a marker!
+ m_audio.seekPos(begin);
+ // TODO: display popup with section name
+ const std::string name = it->name;
+ std::cout << "seek left from " << pos << " to " << name << " at " << begin << std::endl;
+ break;
+ }
+ }
+ seekback = true;
+ }
+ }
+ if (key == SDLK_RIGHT) {
+ double pos = m_audio.getPosition();
+ for (std::vector<Song::SongSection>::iterator it= m_song->songsections.begin(); it != m_song->songsections.end(); it++) {
+ double begin = it->begin;
+ if (begin > pos) {
+ m_audio.seekPos(begin);
+ // TODO: display popup with section name
+ const std::string name = it->name;
+ std::cout << "seek right from " << pos << " to " << name << " at " << begin << std::endl;
+ break;
+ }
+ }
+ }
}
- if (key == SDLK_RIGHT) m_audio.seek(5.0);
+
// Some things must be reset after seeking backwards
if (seekback) m_layout_singer->reset();
// Reload current song
diff --git a/game/song.hh b/game/song.hh
index f1062aa..fba45f0 100644
--- a/game/song.hh
+++ b/game/song.hh
@@ -92,6 +92,13 @@ class Song: boost::noncopyable {
Beats beats; ///< related to instrument and dance
bool hasBRE; ///< is there a Big Rock Ending? (used for drums only)
bool b0rkedTracks; ///< are some tracks broken? (so that user can be notified)
+ struct SongSection {
+ std::string name;
+ double begin;
+ SongSection(std::string const& name, const double begin): name(name), begin(begin) {}
+ };
+ typedef std::vector<SongSection> SongSections;
+ SongSections songsections; ///< vector of song sections
};
static inline bool operator<(Song const& l, Song const& r) { return l.collateByArtist < r.collateByArtist; }
diff --git a/game/songparser-ini.cc b/game/songparser-ini.cc
index 04dcb63..c110d50 100644
--- a/game/songparser-ini.cc
+++ b/game/songparser-ini.cc
@@ -130,6 +130,12 @@ void SongParser::iniParseHeader() {
}
}
}
+ // populate song sections
+ for (std::vector<MidiFileParser::SongSection>::iterator it= midi.songsections.begin(); it != midi.songsections.end(); it++) {
+ Song::SongSection tmp(it->name, it->begin);
+ s.songsections.push_back(tmp);
+ //std::cout << "Section " << tmp.name << " at " << tmp.begin << std::endl;
+ }
}
/// Parse notes
|
|
From: Stefano A. <xa...@us...> - 2010-05-18 20:39:48
|
Module: performous
Branch: master
Commit: f0056823956481883d2aacedbe9074ed729a5d63
Author: Xaldyz <xa...@us...>
Date: Tue May 18 22:39:36 2010 +0200
Fixed uint8_t using boost libraries
---
game/webcam.hh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/game/webcam.hh b/game/webcam.hh
index 6ed0585..5754f3d 100644
--- a/game/webcam.hh
+++ b/game/webcam.hh
@@ -17,7 +17,7 @@ typedef void CvCapture;
struct CamFrame {
int width;
int height;
- std::vector<uint8_t> data;
+ std::vector<boost::uint8_t> data;
};
class Webcam {
|
|
From: Yoda-JM <yo...@us...> - 2010-05-17 21:49:51
|
Module: performous
Branch: master
Commit: ef74a3721333bf49ddf4985a8db0cfc5c26c0ed1
Author: Vincent Le Ligeour <yo...@us...>
Date: Mon May 17 23:49:35 2010 +0200
Removed compile warning
---
game/i18n.hh | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/game/i18n.hh b/game/i18n.hh
index 941230e..5f7272c 100644
--- a/game/i18n.hh
+++ b/game/i18n.hh
@@ -22,6 +22,8 @@ class Gettext {
bindtextdomain (package, getLocaleDir().string().c_str());
textdomain (package);
bind_textdomain_codeset (package, "UTF-8");
+#else
+ (void)package;
#endif
};
static bool enabled() {
|
|
From: Yoda-JM <yo...@us...> - 2010-05-17 21:30:19
|
Module: performous
Branch: master
Commit: b1c421f660380e32c50f5fc18dd3847c36fd3a89
Author: Vincent Le Ligeour <yo...@us...>
Date: Mon May 17 23:29:50 2010 +0200
Moved i18n specific code out of main.cc
---
game/i18n.hh | 23 +++++++++++++++++++++++
game/main.cc | 17 ++---------------
2 files changed, 25 insertions(+), 15 deletions(-)
diff --git a/game/i18n.hh b/game/i18n.hh
index 27543bc..941230e 100644
--- a/game/i18n.hh
+++ b/game/i18n.hh
@@ -9,3 +9,26 @@
#define _(x) (x)
#endif
+class Gettext {
+ public:
+ Gettext(const char *package) {
+#ifdef USE_GETTEXT
+ // initialize gettext
+#ifdef _MSC_VER
+ setlocale(LC_ALL, "");//only untill we don't have a better solution. This because LC_MESSAGES cause crash under Visual Studio
+#else
+ setlocale (LC_MESSAGES, "");
+#endif
+ bindtextdomain (package, getLocaleDir().string().c_str());
+ textdomain (package);
+ bind_textdomain_codeset (package, "UTF-8");
+#endif
+ };
+ static bool enabled() {
+ #ifdef USE_GETTEXT
+ return true;
+ #else
+ return false;
+ #endif
+ }
+};
diff --git a/game/main.cc b/game/main.cc
index d3a432a..91aed77 100644
--- a/game/main.cc
+++ b/game/main.cc
@@ -282,17 +282,8 @@ template <typename Container> void confOverride(Container const& c, std::string
void outputOptionalFeatureStatus();
int main(int argc, char** argv) try {
-#ifdef USE_GETTEXT
// initialize gettext
-#ifdef _MSC_VER
- setlocale(LC_ALL, "");//only untill we don't have a better solution. This because LC_MESSAGES cause crash under Visual Studio
-#else
- setlocale (LC_MESSAGES, "");
-#endif
- bindtextdomain (PACKAGE, getLocaleDir().string().c_str());
- textdomain (PACKAGE);
- bind_textdomain_codeset (PACKAGE, "UTF-8");
-#endif
+ Gettext gettext(PACKAGE);
std::cout << PACKAGE " " VERSION << std::endl;
signalSetup();
@@ -410,11 +401,7 @@ int main(int argc, char** argv) try {
void outputOptionalFeatureStatus() {
std::cout << " Internationalization: " <<
- #ifdef USE_GETTEXT
- "Enabled"
- #else
- "Disabled"
- #endif
+ (Gettext::enabled() ? "Enabled" : "Disabled")
<< std::endl << " MIDI I/O: " <<
#ifdef USE_PORTMIDI
"Enabled"
|
|
From: Tapio V. <aa...@us...> - 2010-05-17 19:45:48
|
Module: performous
Branch: master
Commit: 4024ea60adccf2ef75f9080cf617c0dc0f405f36
Author: Tapio Vierros <tap...@gm...>
Date: Mon May 17 22:41:50 2010 +0300
Moved all #ifdef USE_OPENCV stuff inside webcam files (prettier screen_sing).
If you have trouble compiling with OpenCV disabled
(should be no trouble), fix things in webcam.hh/.cc
---
game/main.cc | 6 +-----
game/screen_sing.cc | 34 +++++++++++++---------------------
game/screen_sing.hh | 6 ------
game/webcam.cc | 2 ++
game/webcam.hh | 9 +++++++++
5 files changed, 25 insertions(+), 32 deletions(-)
diff --git a/game/main.cc b/game/main.cc
index 4af988a..d3a432a 100644
--- a/game/main.cc
+++ b/game/main.cc
@@ -422,10 +422,6 @@ void outputOptionalFeatureStatus() {
"Disabled"
#endif
<< std::endl << " Webcam support: " <<
- #ifdef USE_OPENCV
- "Enabled"
- #else
- "Disabled"
- #endif
+ (Webcam::enabled() ? "Enabled" : "Disabled")
<< std::endl;
}
diff --git a/game/screen_sing.cc b/game/screen_sing.cc
index 2236b32..c206d55 100644
--- a/game/screen_sing.cc
+++ b/game/screen_sing.cc
@@ -56,17 +56,16 @@ void ScreenSing::enter() {
std::cerr << e.what() << std::endl;
}
}
-
-#ifdef USE_OPENCV
- if (config["graphic/webcam"].b()) { // Initialize webcam
+ // Initialize webcam
+ if (config["graphic/webcam"].b() && Webcam::enabled()) {
m_cam.reset(new Webcam());
}
-#endif
-
- if (!m_song->video.empty() && config["graphic/video"].b()) { // Load video
+ // Load video
+ if (!m_song->video.empty() && config["graphic/video"].b()) {
m_video.reset(new Video(m_song->path + m_song->video, m_song->videoGap));
}
- if (!foundbg) { // Use random bg if specified fails (also for tracks with video)
+ // Use random bg if specified fails (also for tracks with video)
+ if (!foundbg) {
for (int i = 1; i <= 2; ++i) { // Try two times in case first is b0rked
try {
std::string bgpath = m_backgrounds.getRandom();
@@ -182,9 +181,7 @@ void ScreenSing::exit() {
m_engine.reset();
m_help.reset();
m_pause_icon.reset();
-#ifdef USE_OPENCV
m_cam.reset();
-#endif
m_video.reset();
m_background.reset();
m_song->dropNotes();
@@ -253,13 +250,11 @@ void ScreenSing::manageEvent(SDL_Event event) {
if (key == SDLK_v) m_audio.streamFade("vocals", event.key.keysym.mod & KMOD_SHIFT ? 1.0 : 0.0);
if (key == SDLK_k) dispInFlash(++config["game/karaoke_mode"]); // Toggle karaoke mode
if (key == SDLK_w) dispInFlash(++config["game/pitch"]); // Toggle pitch wave
- #ifdef USE_OPENCV
// Toggle webcam
- if (key == SDLK_a) {
- if (!m_cam) m_cam.reset(new Webcam());
+ if (key == SDLK_a && Webcam::enabled()) {
+ if (!m_cam) m_cam.reset(new Webcam()); // Initialize if we haven't done that already
if (m_cam) { dispInFlash(++config["graphic/webcam"]); m_cam->pause(!config["graphic/webcam"].b()); }
}
- #endif
// Latency settings
if (key == SDLK_F1) dispInFlash(--config["audio/video_delay"]);
if (key == SDLK_F2) dispInFlash(++config["audio/video_delay"]);
@@ -310,21 +305,18 @@ void ScreenSing::draw() {
// Rendering starts
{
double ar = arMax;
+ // Background image
if (m_background) {
ar = m_background->dimensions.ar();
if (ar > arMax || (m_video && ar > arMin)) fillBG(); // Fill white background to avoid black borders
m_background->draw();
- } else fillBG();
+ } else fillBG(); // Blank
// Video
- if (m_video
- #ifdef USE_OPENCV
- && (!m_cam || !m_cam->is_good())
- #endif
- ) { m_video->render(time); double tmp = m_video->dimensions().ar(); if (tmp > 0.0) ar = tmp; }
-#ifdef USE_OPENCV
+ if (m_video && (!m_cam || !m_cam->is_good())) {
+ m_video->render(time); double tmp = m_video->dimensions().ar(); if (tmp > 0.0) ar = tmp;
+ }
// Webcam
if (m_cam && config["graphic/webcam"].b()) m_cam->render();
-#endif
// Top/bottom borders
ar = clamp(ar, arMin, arMax);
double offset = 0.5 / ar + 0.2;
diff --git a/game/screen_sing.hh b/game/screen_sing.hh
index 53439bd..5ba012d 100644
--- a/game/screen_sing.hh
+++ b/game/screen_sing.hh
@@ -15,11 +15,7 @@
#include "surface.hh"
#include "opengl_text.hh"
#include "progressbar.hh"
-
-#ifdef USE_OPENCV
#include "webcam.hh"
-#endif
-
#include "screen_players.hh"
class Players;
@@ -85,9 +81,7 @@ class ScreenSing: public Screen {
boost::scoped_ptr<ProgressBar> m_progress;
boost::scoped_ptr<Surface> m_background;
boost::scoped_ptr<Video> m_video;
-#ifdef USE_OPENCV
boost::scoped_ptr<Webcam> m_cam;
-#endif
boost::scoped_ptr<Surface> m_pause_icon;
boost::scoped_ptr<Surface> m_help;
boost::scoped_ptr<Engine> m_engine;
diff --git a/game/webcam.cc b/game/webcam.cc
index 31bc263..c4487c5 100644
--- a/game/webcam.cc
+++ b/game/webcam.cc
@@ -50,7 +50,9 @@ void Webcam::operator()() {
}
void Webcam::pause(bool do_pause) {
+ #ifdef USE_OPENCV
boost::mutex::scoped_lock l(m_mutex);
+ #endif
m_running = !do_pause;
m_frameAvailable = false;
}
diff --git a/game/webcam.hh b/game/webcam.hh
index 8c39c62..6ed0585 100644
--- a/game/webcam.hh
+++ b/game/webcam.hh
@@ -49,4 +49,13 @@ class Webcam {
bool m_frameAvailable;
volatile bool m_running;
volatile bool m_quit;
+
+ public:
+ static bool enabled() {
+ #ifdef USE_OPENCV
+ return true;
+ #else
+ return false;
+ #endif
+ }
};
|
|
From: Tapio V. <aa...@us...> - 2010-05-17 19:45:43
|
Module: performous
Branch: master
Commit: fb78665efb6d15b2f58b212afb37f155f0d1a764
Author: Tapio Vierros <tap...@gm...>
Date: Mon May 17 22:01:08 2010 +0300
Fix solo accuracy counter, more testing needed.
---
game/guitargraph.cc | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index 59e53d2..3b7399d 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -244,9 +244,9 @@ void GuitarGraph::engine() {
if ( (m_drums && m_chordIt->status != m_chordIt->polyphony)
|| (!m_drums && m_chordIt->status == 0) ) endStreak();
// Calculate solo total score
- if (m_solo) m_soloTotal += m_chordIt->polyphony * points(0);
+ if (m_solo) { m_soloScore += m_chordIt->score; m_soloTotal += m_chordIt->polyphony * points(0);
// Solo just ended?
- else if (m_soloTotal > 0) {
+ } else if (m_soloTotal > 0) {
m_popups.push_back(Popup(boost::lexical_cast<std::string>(unsigned(m_soloScore / m_soloTotal * 100)) + " %",
glutil::Color(0.0f, 0.8f, 0.0f), 1.0, m_popupText.get()));
m_soloScore = 0;
@@ -543,7 +543,6 @@ void GuitarGraph::guitarPlay(double time, input::Event const& ev) {
m_chordIt->status = 1 + picked;
m_score += score;
m_starmeter += score;
- if (m_solo) m_soloScore += score;
m_correctness.setTarget(1.0, true); // Instantly go to one
errorMeter(signed_error);
for (int fret = 0; fret < m_pads; ++fret) {
|
|
From: Tapio V. <aa...@us...> - 2010-05-17 17:01:22
|
Module: performous Branch: master Commit: 9b8cf0450f8b50ec272f73c0264e8949c29d3fdd Author: Tapio Vierros <tap...@gm...> Date: Mon May 17 19:55:43 2010 +0300 Merge branch 'instrumentgraph' --- |
|
From: Tapio V. <aa...@us...> - 2010-05-17 17:01:18
|
Module: performous
Branch: master
Commit: 90a25ca950f957e09004b45f6d43c18c32bd8084
Author: Tapio Vierros <tap...@gm...>
Date: Mon May 17 19:45:21 2010 +0300
Bigger (and dedicated) font for popups (better quality).
---
game/instrumentgraph.hh | 2 +-
themes/default/sing_popup_text.svg | 78 ++++++++++++++++++++++++++++++++++++
2 files changed, 79 insertions(+), 1 deletions(-)
diff --git a/game/instrumentgraph.hh b/game/instrumentgraph.hh
index 8565979..87064c6 100644
--- a/game/instrumentgraph.hh
+++ b/game/instrumentgraph.hh
@@ -75,7 +75,7 @@ class InstrumentGraph {
m_jointime(getNaN()),
m_dead()
{
- m_popupText.reset(new SvgTxtThemeSimple(getThemePath("sing_score_text.svg"), config["graphic/text_lod"].f()));
+ m_popupText.reset(new SvgTxtThemeSimple(getThemePath("sing_popup_text.svg"), config["graphic/text_lod"].f()));
};
// Interface functions
diff --git a/themes/default/sing_popup_text.svg b/themes/default/sing_popup_text.svg
new file mode 100644
index 0000000..198bf0d
--- /dev/null
+++ b/themes/default/sing_popup_text.svg
@@ -0,0 +1,78 @@
+<?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:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ version="1.0"
+ width="256"
+ height="128"
+ id="svg3465"
+ sodipodi:version="0.32"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="sing_popup_text.svg"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape">
+ <metadata
+ id="metadata3075">
+ <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>
+ <sodipodi:namedview
+ inkscape:window-height="722"
+ inkscape:window-width="1248"
+ inkscape:pageshadow="2"
+ inkscape:pageopacity="0.0"
+ guidetolerance="10.0"
+ gridtolerance="10.0"
+ objecttolerance="10.0"
+ borderopacity="1.0"
+ bordercolor="#666666"
+ pagecolor="#ffffff"
+ id="base"
+ showgrid="false"
+ inkscape:zoom="1.3525"
+ inkscape:cx="199.2681"
+ inkscape:cy="91.992898"
+ inkscape:window-x="0"
+ inkscape:window-y="25"
+ inkscape:current-layer="svg3465"
+ inkscape:window-maximized="0" />
+ <defs
+ id="defs3467">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 300 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="800 : 300 : 1"
+ inkscape:persp3d-origin="400 : 200 : 1"
+ id="perspective9" />
+ </defs>
+ <g
+ style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:2;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ id="layer15"
+ transform="translate(-32.532348,10.07024)">
+ <text
+ x="47.081493"
+ y="77.530563"
+ style="font-size:70.43302155px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:1.99999988;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline;font-family:Arial Black"
+ id="text10199"
+ xml:space="preserve"
+ sodipodi:linespacing="125%"
+ transform="scale(0.98936247,1.0107519)"><tspan
+ x="47.081493"
+ y="77.530563"
+ style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:1.99999988;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ id="tspan10201">3..2..1</tspan></text>
+ </g>
+</svg>
|
|
From: Tapio V. <aa...@us...> - 2010-05-17 17:01:15
|
Module: performous Branch: master Commit: 1282f4c1da8f1d222a552b4c4ce822bac03185a5 Author: Tapio Vierros <tap...@gm...> Date: Mon May 17 17:50:00 2010 +0300 Move & rearrange stuff in *Graphs. --- game/dancegraph.hh | 32 ++++++++++++--------------- game/guitargraph.cc | 54 ++++++++++++++++++++++++---------------------- game/guitargraph.hh | 49 +++++++++++++++++++++++++++--------------- game/instrumentgraph.cc | 1 + game/instrumentgraph.hh | 15 +++++++++++++ 5 files changed, 89 insertions(+), 62 deletions(-) |
|
From: Tapio V. <aa...@us...> - 2010-05-17 17:01:12
|
Module: performous
Branch: master
Commit: 2fb45e893745d6917ee0601d256966ad76535590
Author: Tapio Vierros <tap...@gm...>
Date: Mon May 17 16:38:24 2010 +0300
Improvements to countdown thingy.
* Handled in InstrumentGraph.
* Works in dance mode too.
* Works when joining mid-game too.
---
game/dancegraph.cc | 2 ++
game/dancegraph.hh | 5 +++--
game/guitargraph.cc | 12 +++---------
game/guitargraph.hh | 2 +-
game/instrumentgraph.cc | 10 ++++++++++
game/instrumentgraph.hh | 3 +++
6 files changed, 22 insertions(+), 12 deletions(-)
diff --git a/game/dancegraph.cc b/game/dancegraph.cc
index ff3e912..94c5efb 100644
--- a/game/dancegraph.cc
+++ b/game/dancegraph.cc
@@ -210,6 +210,8 @@ void DanceGraph::engine() {
m_pressed_anim[ev.button].setValue(1.0);
}
}
+ // Countdown to start
+ handleCountdown(time, time < getNotesBeginTime() ? getNotesBeginTime() : m_jointime+1);
// Notes gone by
for (DanceNotes::iterator& it = m_notesIt; it != m_notes.end() && time > it->note.end + maxTolerance; it++) {
diff --git a/game/dancegraph.hh b/game/dancegraph.hh
index 6d21b5e..95f2d40 100644
--- a/game/dancegraph.hh
+++ b/game/dancegraph.hh
@@ -54,8 +54,9 @@ class DanceGraph: public InstrumentGraph {
void drawInfo(double time, double offsetX, Dimensions dimensions);
void drawArrow(int arrow_i, Texture& tex, float x, float y, float scale = 1.0, float ty1 = 0.0, float ty2 = 1.0);
void drawMine(float x, float y, float rot = 0.0, float scale = 1.0);
- float panel2x(int i) { return getScale() * (-(m_pads * 0.5f) + m_arrow_map[i] + 0.5f); } /// Get x for an arrow line
- float getScale() { return 1.0f / m_pads * 8.0f; }
+ float panel2x(int i) const { return getScale() * (-(m_pads * 0.5f) + m_arrow_map[i] + 0.5f); } /// Get x for an arrow line
+ float getScale() const { return 1.0f / m_pads * 8.0f; }
+ double getNotesBeginTime() const { return m_notes.front().note.begin; }
DanceNotes m_notes; /// contains the dancing notes for current game mode and difficulty
DanceNotes::iterator m_notesIt; /// the first note that hasn't gone away yet
DanceNotes::iterator m_activeNotes[max_panels]; /// hold notes that are currently pressed down
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index 6a80e3c..189ad18 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -78,8 +78,7 @@ GuitarGraph::GuitarGraph(Audio& audio, Song const& song, bool drums, int number)
m_drumfillScore(),
m_soloTotal(),
m_soloScore(),
- m_solo(),
- m_countdown(3)
+ m_solo()
{
// Copy all tracks of supported types (either drums or non-drums) to m_instrumentTracks
for (InstrumentTracks::const_iterator it = m_song.instrumentTracks.begin(); it != m_song.instrumentTracks.end(); ++it) {
@@ -184,13 +183,6 @@ void GuitarGraph::engine() {
if (m_input.pressed(i)) m_hit[i + 1].setValue(1.0);
}
}
- // Countdown
- if (time < m_chords.front().begin && time >= m_chords.front().begin - m_countdown - 1) {
- m_popups.push_back(Popup(m_countdown > 0 ?
- std::string("- ") +boost::lexical_cast<std::string>(unsigned(m_countdown))+" -" : "Rock On!",
- glutil::Color(0.0f, 0.0f, 1.0f), 3.0, m_popupText.get()));
- --m_countdown;
- }
if (!m_drumfills.empty()) updateDrumFill(time); // Drum Fills / BREs
if (m_starpower.get() > 0.001) m_correctness.setTarget(1.0, true);
if (time < m_jointime) m_dead = 0; // Disable dead counting while joining
@@ -244,6 +236,8 @@ void GuitarGraph::engine() {
}
if (m_score < 0) m_score = 0;
}
+ // Countdown to start
+ handleCountdown(time, time < getNotesBeginTime() ? getNotesBeginTime() : m_jointime+1);
// Skip missed notes
while (m_chordIt != m_chords.end() && m_chordIt->begin + maxTolerance < time) {
if ( (m_drums && m_chordIt->status != m_chordIt->polyphony)
diff --git a/game/guitargraph.hh b/game/guitargraph.hh
index d733511..b617baf 100644
--- a/game/guitargraph.hh
+++ b/game/guitargraph.hh
@@ -115,6 +115,7 @@ class GuitarGraph: public InstrumentGraph {
void difficultyAuto(bool tryKeepCurrent = false);
bool difficulty(Difficulty level);
float getFretX(int fret) const { return (-2.0f + fret- (m_drums ? 0.5 : 0)) * (m_leftymode ? -1 : 1); }
+ double getNotesBeginTime() const { return m_chords.front().begin; }
boost::scoped_ptr<SvgTxtThemeSimple> m_scoreText;
boost::scoped_ptr<SvgTxtThemeSimple> m_streakText;
void updateChords();
@@ -133,6 +134,5 @@ class GuitarGraph: public InstrumentGraph {
double m_soloTotal; /// maximum solo score
double m_soloScore; /// score during solo
bool m_solo; /// are we currently playing a solo
- int m_countdown; /// countdown counter
};
diff --git a/game/instrumentgraph.cc b/game/instrumentgraph.cc
index bef10a3..27a6fde 100644
--- a/game/instrumentgraph.cc
+++ b/game/instrumentgraph.cc
@@ -7,3 +7,13 @@ void InstrumentGraph::drawPopups(double offsetX) {
++it;
}
}
+
+
+void InstrumentGraph::handleCountdown(double time, double beginTime) {
+ if (!dead() && time < beginTime && time >= beginTime - m_countdown - 1) {
+ m_popups.push_back(Popup(m_countdown > 0 ?
+ std::string("- ") +boost::lexical_cast<std::string>(unsigned(m_countdown))+" -" : "Rock On!",
+ glutil::Color(0.0f, 0.0f, 1.0f), 2.0, m_popupText.get()));
+ --m_countdown;
+ }
+}
diff --git a/game/instrumentgraph.hh b/game/instrumentgraph.hh
index 8cff589..c7165c4 100644
--- a/game/instrumentgraph.hh
+++ b/game/instrumentgraph.hh
@@ -66,6 +66,7 @@ class InstrumentGraph {
m_streak(),
m_longestStreak(),
m_bigStreak(),
+ m_countdown(3), // Display countdown 3 secs before note start
m_jointime(getNaN()),
m_dead()
{
@@ -104,6 +105,7 @@ class InstrumentGraph {
Popups m_popups;
void drawPopups(double offsetX);
+ void handleCountdown(double time, double beginTime);
SvgTxtTheme m_text;
boost::scoped_ptr<SvgTxtThemeSimple> m_popupText;
@@ -115,6 +117,7 @@ class InstrumentGraph {
int m_streak; /// player's current streak/combo
int m_longestStreak; /// player's longest streak/combo
int m_bigStreak; /// next limit when a popup appears
+ int m_countdown; /// countdown counter
double m_jointime; /// when the player joined
int m_dead; /// how many notes has been passed without hitting buttons
};
|
|
From: Tapio V. <aa...@us...> - 2010-05-17 17:01:06
|
Module: performous Branch: master Commit: 7f84b2564cbb30139934671342314c0b265b9ee2 Author: Tapio Vierros <tap...@gm...> Date: Sun May 16 19:28:41 2010 +0300 Merge branch 'master' into instrumentgraph Conflicts: game/dancegraph.hh game/guitargraph.cc game/guitargraph.hh --- |
|
From: Tapio V. <aa...@us...> - 2010-05-17 17:00:59
|
Module: performous
Branch: master
Commit: 77edaf5cfec85b522c753172490210c178f28eee
Author: Tapio Vierros <tap...@gm...>
Date: Wed Apr 21 11:49:42 2010 +0300
Add a 3s countdown to instrument notes start using popups.
---
game/guitargraph.cc | 10 +++++++++-
game/guitargraph.hh | 1 +
2 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index 078969f..d4eabbe 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -74,7 +74,8 @@ GuitarGraph::GuitarGraph(Audio& audio, Song const& song, bool drums, int number)
m_drumfillScore(),
m_soloTotal(),
m_soloScore(),
- m_solo()
+ m_solo(),
+ m_countdown(3)
{
// Copy all tracks of supported types (either drums or non-drums) to m_instrumentTracks
for (InstrumentTracks::const_iterator it = m_song.instrumentTracks.begin(); it != m_song.instrumentTracks.end(); ++it) {
@@ -179,6 +180,13 @@ void GuitarGraph::engine() {
if (m_input.pressed(i)) m_hit[i + 1].setValue(1.0);
}
}
+ // Countdown
+ if (time < m_chords.front().begin && time >= m_chords.front().begin - m_countdown - 1) {
+ m_popups.push_back(Popup(m_countdown > 0 ?
+ std::string("- ") +boost::lexical_cast<std::string>(unsigned(m_countdown))+" -" : "Rock On!",
+ glutil::Color(0.0f, 0.0f, 1.0f), 3.0, m_popupText.get()));
+ --m_countdown;
+ }
if (!m_drumfills.empty()) updateDrumFill(time); // Drum Fills / BREs
if (m_starpower.get() > 0.001) m_correctness.setTarget(1.0, true);
if (time < m_jointime) m_dead = 0; // Disable dead counting while joining
diff --git a/game/guitargraph.hh b/game/guitargraph.hh
index 650cdeb..59eacad 100644
--- a/game/guitargraph.hh
+++ b/game/guitargraph.hh
@@ -127,5 +127,6 @@ class GuitarGraph: public InstrumentGraph {
double m_soloTotal; /// maximum solo score
double m_soloScore; /// score during solo
bool m_solo; /// are we currently playing a solo
+ int m_countdown; /// countdown counter
};
|
|
From: Tapio V. <aa...@us...> - 2010-05-17 17:00:57
|
Module: performous
Branch: master
Commit: 5fed141db16302c3b3d66b448a510b248e1eca21
Author: Tapio Vierros <tap...@gm...>
Date: Mon Apr 12 21:31:03 2010 +0300
Add an accuracy indicator after solos.
---
game/guitargraph.cc | 37 ++++++++++++++++++++++++++-----------
game/guitargraph.hh | 3 +++
2 files changed, 29 insertions(+), 11 deletions(-)
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index 367784b..078969f 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -71,7 +71,10 @@ GuitarGraph::GuitarGraph(Audio& audio, Song const& song, bool drums, int number)
m_drumJump(0.0, 12.0),
m_starmeter(),
m_drumfillHits(),
- m_drumfillScore()
+ m_drumfillScore(),
+ m_soloTotal(),
+ m_soloScore(),
+ m_solo()
{
// Copy all tracks of supported types (either drums or non-drums) to m_instrumentTracks
for (InstrumentTracks::const_iterator it = m_song.instrumentTracks.begin(); it != m_song.instrumentTracks.end(); ++it) {
@@ -227,6 +230,15 @@ void GuitarGraph::engine() {
while (m_chordIt != m_chords.end() && m_chordIt->begin + maxTolerance < time) {
if ( (m_drums && m_chordIt->status != m_chordIt->polyphony)
|| (!m_drums && m_chordIt->status == 0) ) endStreak();
+ // Calculate solo total score
+ if (m_solo) m_soloTotal += m_chordIt->polyphony * points(0);
+ // Solo just ended?
+ else if (m_soloTotal > 0) {
+ m_popups.push_back(Popup(boost::lexical_cast<std::string>(unsigned(m_soloScore / m_soloTotal * 100)) + " %",
+ glutil::Color(0.0f, 0.8f, 0.0f), 1.0, m_popupText.get()));
+ m_soloScore = 0;
+ m_soloTotal = 0;
+ }
++m_dead;
++m_chordIt;
}
@@ -268,12 +280,17 @@ void GuitarGraph::engine() {
if (last == ev.dur->end) endHold(fret, time);
}
}
+ // Update solo status
+ m_solo = false;
+ for (Durations::const_iterator it = m_solos.begin(); it != m_solos.end(); ++it) {
+ if (time >= it->begin && time <= it->end) { m_solo = true; break; }
+ }
// Check if a long streak goal has been reached
if (m_streak >= getNextBigStreak(m_bigStreak)) {
m_bigStreak = getNextBigStreak(m_bigStreak);
m_starmeter += streakStarBonus;
m_popups.push_back(Popup(boost::lexical_cast<std::string>(unsigned(m_bigStreak)) + "\nStreak!",
- glutil::Color(1.0f, 0.0, 0.0), 1.0, m_popupText.get()));
+ glutil::Color(1.0f, 0.0f, 0.0f), 1.0, m_popupText.get()));
}
// During GodMode, correctness is full, no matter what
if (m_starpower.get() > 0.01) m_correctness.setTarget(1.0, true);
@@ -498,6 +515,7 @@ void GuitarGraph::guitarPlay(double time, input::Event const& ev) {
m_chordIt->status = 1 + picked;
m_score += score;
m_starmeter += score;
+ if (m_solo) m_soloScore += score;
m_correctness.setTarget(1.0, true); // Instantly go to one
for (int fret = 0; fret < 5; ++fret) {
if (!m_chordIt->fret[fret]) continue;
@@ -536,6 +554,7 @@ glutil::Color const& GuitarGraph::color(int fret) const {
glutil::Color const GuitarGraph::colorize(glutil::Color c, double time) const {
const static glutil::Color godmodeC(0.5f, 0.5f, 1.0f); // Color for full GodMode
const static glutil::Color soloC(0.2f, 0.9f, 0.2f); // Color for solo notes
+ // Solo? (cannot use m_solo, as time can be in future)
for (Durations::const_iterator it = m_solos.begin(); it != m_solos.end(); ++it) {
if (time >= it->begin && time <= it->end) { c = soloC; break; }
}
@@ -876,15 +895,11 @@ void GuitarGraph::drawInfo(double time, double offsetX, Dimensions dimensions) {
if (m_drums && m_dfIt != m_drumfills.end() && time >= m_dfIt->begin && time <= m_dfIt->end)
m_text.draw(" Drum Fill! ", a);
else m_text.draw("God Mode Ready!", a);
- } else {
- // Solo?
- for (Durations::const_iterator it = m_solos.begin(); it != m_solos.end(); ++it) {
- if (time >= it->begin && time <= it->end) {
- float a = std::abs(std::fmod(time, 1.0) - 0.5f) * 2.0f;
- m_text.dimensions.screenBottom(-0.02).middle(-0.03 + offsetX);
- m_text.draw("Solo!", a);
- }
- }
+ } else if (m_solo) {
+ // Solo
+ float a = std::abs(std::fmod(time, 1.0) - 0.5f) * 2.0f;
+ m_text.dimensions.screenBottom(-0.02).middle(-0.03 + offsetX);
+ m_text.draw("Solo!", a);
}
drawPopups(offsetX);
}
diff --git a/game/guitargraph.hh b/game/guitargraph.hh
index 3aeb633..650cdeb 100644
--- a/game/guitargraph.hh
+++ b/game/guitargraph.hh
@@ -124,5 +124,8 @@ class GuitarGraph: public InstrumentGraph {
double m_starmeter; /// when this is high enough, GodMode becomes available
double m_drumfillHits; /// keeps track that enough hits are scored
double m_drumfillScore; /// max score for the notes under drum fill
+ double m_soloTotal; /// maximum solo score
+ double m_soloScore; /// score during solo
+ bool m_solo; /// are we currently playing a solo
};
|
|
From: Tapio V. <aa...@us...> - 2010-05-17 17:00:54
|
Module: performous
Branch: master
Commit: a64e3237b3a865651b0730627c0e2b58790375a9
Author: Tapio Vierros <tap...@gm...>
Date: Mon Apr 12 20:48:04 2010 +0300
Easy creation of "pop-up" messages for InstrumentGraph.
---
game/dancegraph.cc | 5 +++--
game/guitargraph.cc | 8 +++++---
game/instrumentgraph.cc | 27 ++++-----------------------
game/instrumentgraph.hh | 46 +++++++++++++++++++++++++++++++++++++++++-----
4 files changed, 53 insertions(+), 33 deletions(-)
diff --git a/game/dancegraph.cc b/game/dancegraph.cc
index 66c0ce7..814dfcf 100644
--- a/game/dancegraph.cc
+++ b/game/dancegraph.cc
@@ -234,8 +234,9 @@ void DanceGraph::engine() {
// Check if a long streak goal has been reached
if (m_streak >= getNextBigStreak(m_bigStreak)) {
- m_streakPopup.setTarget(1.0);
m_bigStreak = getNextBigStreak(m_bigStreak);
+ m_popups.push_back(Popup(boost::lexical_cast<std::string>(unsigned(m_bigStreak)) + "\nStreak!",
+ glutil::Color(1.0f, 0.0, 0.0), 1.0, m_popupText.get()));
}
}
@@ -475,5 +476,5 @@ void DanceGraph::drawInfo(double time, double offsetX, Dimensions dimensions) {
m_text.draw(boost::lexical_cast<std::string>(unsigned(m_streak)) + "/"
+ boost::lexical_cast<std::string>(unsigned(m_longestStreak)));
}
- drawPopups(time, offsetX, dimensions);
+ drawPopups(offsetX);
}
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index 54e41ff..367784b 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -270,9 +270,10 @@ void GuitarGraph::engine() {
}
// Check if a long streak goal has been reached
if (m_streak >= getNextBigStreak(m_bigStreak)) {
- m_streakPopup.setTarget(1.0);
m_bigStreak = getNextBigStreak(m_bigStreak);
m_starmeter += streakStarBonus;
+ m_popups.push_back(Popup(boost::lexical_cast<std::string>(unsigned(m_bigStreak)) + "\nStreak!",
+ glutil::Color(1.0f, 0.0, 0.0), 1.0, m_popupText.get()));
}
// During GodMode, correctness is full, no matter what
if (m_starpower.get() > 0.01) m_correctness.setTarget(1.0, true);
@@ -288,7 +289,8 @@ void GuitarGraph::activateStarpower() {
if (canActivateStarpower()) {
m_starmeter = 0;
m_starpower.setValue(1.0);
- m_godmodePopup.setTarget(1.0);
+ m_popups.push_back(Popup("God Mode\nActivated!",
+ glutil::Color(0.3f, 0.0f, 1.0f), 0.666, m_popupText.get(), "Mistakes ignored!", &m_text));
}
}
@@ -884,7 +886,7 @@ void GuitarGraph::drawInfo(double time, double offsetX, Dimensions dimensions) {
}
}
}
- drawPopups(time, offsetX, dimensions);
+ drawPopups(offsetX);
}
/// Draw a bar for drum bass pedal/note
diff --git a/game/instrumentgraph.cc b/game/instrumentgraph.cc
index af627c4..bef10a3 100644
--- a/game/instrumentgraph.cc
+++ b/game/instrumentgraph.cc
@@ -1,28 +1,9 @@
#include "instrumentgraph.hh"
-void InstrumentGraph::drawPopups(double time, double offsetX, Dimensions dimensions) {
- // Draw streak pop-up for long streak intervals
- double streakAnim = m_streakPopup.get();
- if (streakAnim > 0.0) {
- double s = 0.2 * (1.0 + streakAnim);
- glColor4f(1.0f, 0.0f, 0.0f, 1.0 - streakAnim);
- m_popupText->render(boost::lexical_cast<std::string>(unsigned(m_bigStreak)) + "\nStreak!");
- m_popupText->dimensions().center(0.1).middle(offsetX).stretch(s,s);
- m_popupText->draw();
- if (streakAnim > 0.999) m_streakPopup.setTarget(0.0, true);
- }
- // Draw godmode activation pop-up
- double godAnim = m_godmodePopup.get();
- if (godAnim > 0.0) {
- float a = 1.0 - godAnim;
- float s = 0.2 * (1.0 + godAnim);
- glColor4f(0.3f, 0.0f, 1.0f, a);
- m_popupText->render("God Mode\nActivated!");
- m_popupText->dimensions().center(0.1).middle(offsetX).stretch(s,s);
- m_popupText->draw();
- m_text.dimensions.screenBottom(-0.02).middle(-0.12 + offsetX);
- m_text.draw("Mistakes ignored!", 1.0 - godAnim);
- if (godAnim > 0.999) m_godmodePopup.setTarget(0.0, true);
+void InstrumentGraph::drawPopups(double offsetX) {
+ for (Popups::iterator it = m_popups.begin(); it != m_popups.end(); ) {
+ if (!it->draw(offsetX)) { it = m_popups.erase(it); continue; }
+ ++it;
}
}
diff --git a/game/instrumentgraph.hh b/game/instrumentgraph.hh
index 5f032ca..8cff589 100644
--- a/game/instrumentgraph.hh
+++ b/game/instrumentgraph.hh
@@ -12,6 +12,44 @@
#include "glutil.hh"
#include "fs.hh"
+class Popup {
+ public:
+ /// Constructor
+ Popup(std::string msg, glutil::Color c, double speed, SvgTxtThemeSimple* popupText, std::string info = "", SvgTxtTheme* infoText = NULL):
+ m_msg(msg), m_color(c), m_anim(AnimValue(0.0, speed)), m_popupText(popupText), m_info(info), m_infoText(infoText)
+ {
+ m_anim.setTarget(1.0, false);
+ }
+ /// Draw the popup
+ /// Returns false if it is expired
+ bool draw(double offsetX) {
+ double anim = m_anim.get();
+ if (anim > 0.0 && m_popupText) {
+ float s = 0.2 * (1.0 + anim);
+ float a = 1.0 - anim;
+ m_color.a = a;
+ glColor4fv(m_color);
+ m_popupText->render(m_msg);
+ m_popupText->dimensions().center(0.1).middle(offsetX).stretch(s,s);
+ m_popupText->draw();
+ if (m_info != "" && m_infoText) {
+ m_infoText->dimensions.screenBottom(-0.02).middle(-0.12 + offsetX);
+ m_infoText->draw(m_info, a);
+ }
+ if (anim > 0.999) m_anim.setTarget(0.0, true);
+ } else return false;
+ return true;
+ }
+ private:
+ std::string m_msg; /// Popup text
+ glutil::Color m_color; /// Color
+ AnimValue m_anim; /// Animation timer
+ SvgTxtThemeSimple* m_popupText; /// Font for popup
+ std::string m_info; /// Text to show in the bottom
+ SvgTxtTheme* m_infoText; /// Font for the additional text
+};
+
+
class Song;
class InstrumentGraph {
@@ -23,8 +61,6 @@ class InstrumentGraph {
m_cx(0.0, 0.2), m_width(0.5, 0.4),
m_text(getThemePath("sing_timetxt.svg"), config["graphic/text_lod"].f()),
m_correctness(0.0, 5.0),
- m_streakPopup(0.0, 1.0),
- m_godmodePopup(0.0, 0.666),
m_score(),
m_scoreFactor(),
m_streak(),
@@ -64,15 +100,15 @@ class InstrumentGraph {
};
typedef std::vector<Event> Events;
Events m_events;
+ typedef std::vector<Popup> Popups;
+ Popups m_popups;
- void drawPopups(double time, double offsetX, Dimensions dimensions);
+ void drawPopups(double offsetX);
SvgTxtTheme m_text;
boost::scoped_ptr<SvgTxtThemeSimple> m_popupText;
AnimValue m_correctness;
- AnimValue m_streakPopup; /// for animating the popup
- AnimValue m_godmodePopup; /// for animating the popup
double m_score; /// unnormalized scores
double m_scoreFactor; /// normalization factor
double m_starmeter; /// when this is high enough, GodMode becomes available
|
|
From: Tapio V. <aa...@us...> - 2010-05-17 17:00:52
|
Module: performous
Branch: master
Commit: b2d35c05b062b6e9610ea3428371fc2211dc53dc
Author: Tapio Vierros <tap...@gm...>
Date: Mon Apr 12 20:24:58 2010 +0300
Fix bug causing InputDev always unassigning and thus never throwing NotFound.
---
game/instrumentgraph.hh | 4 ++--
game/joystick.hh | 3 ++-
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/game/instrumentgraph.hh b/game/instrumentgraph.hh
index d8e77bc..5f032ca 100644
--- a/game/instrumentgraph.hh
+++ b/game/instrumentgraph.hh
@@ -17,8 +17,8 @@ class Song;
class InstrumentGraph {
public:
/// Constructor
- InstrumentGraph(Audio& audio, Song const& song, input::InputDev input):
- m_audio(audio), m_song(song), m_input(input),
+ InstrumentGraph(Audio& audio, Song const& song, input::DevType inp):
+ m_audio(audio), m_song(song), m_input(input::DevType(inp)),
m_stream(),
m_cx(0.0, 0.2), m_width(0.5, 0.4),
m_text(getThemePath("sing_timetxt.svg"), config["graphic/text_lod"].f()),
diff --git a/game/joystick.hh b/game/joystick.hh
index 5874661..df81edb 100644
--- a/game/joystick.hh
+++ b/game/joystick.hh
@@ -4,6 +4,7 @@
#include <deque>
#include <iostream>
#include <stdexcept>
+#include <boost/noncopyable.hpp>
#include "SDL_events.h"
#include "SDL_joystick.h"
@@ -116,7 +117,7 @@ namespace input {
NoDevError(): runtime_error("No instrument of the requested type was available") {}
};
- class InputDev {
+ class InputDev: boost::noncopyable {
public:
// First gives a correct instrument type
// Then gives an unknown instrument type
|
|
From: Tapio V. <aa...@us...> - 2010-05-17 17:00:50
|
Module: performous
Branch: master
Commit: 5d74a0bb7f6eb2d1f5a04d4e37cb65494d66549b
Author: Tapio Vierros <tap...@gm...>
Date: Mon Apr 12 19:32:01 2010 +0300
Screen_sing's containers now hold InstrumentGraph instead of Guitar/Dance.
---
game/dancegraph.cc | 2 +-
game/dancegraph.hh | 2 +-
game/guitargraph.hh | 1 -
game/instrumentgraph.hh | 8 ++++++--
game/joystick.hh | 2 +-
game/screen_sing.cc | 6 +++---
game/screen_sing.hh | 6 +++---
7 files changed, 15 insertions(+), 12 deletions(-)
diff --git a/game/dancegraph.cc b/game/dancegraph.cc
index 8738755..66c0ce7 100644
--- a/game/dancegraph.cc
+++ b/game/dancegraph.cc
@@ -467,7 +467,7 @@ void DanceGraph::drawInfo(double time, double offsetX, Dimensions dimensions) {
m_text.dimensions.screenBottom(-0.075).middle(-0.09 + offsetX);
m_text.draw("^ " + getDifficultyString() + " v");
m_text.dimensions.screenBottom(-0.050).middle(-0.09 + offsetX);
- m_text.draw("< " + getGameMode() + " >");
+ m_text.draw("< " + getTrack() + " >");
} else { // Draw scores
m_text.dimensions.screenBottom(-0.35).middle(0.32 * dimensions.w() + offsetX);
m_text.draw(boost::lexical_cast<std::string>(unsigned(getScore())));
diff --git a/game/dancegraph.hh b/game/dancegraph.hh
index c1cdce3..47fe757 100644
--- a/game/dancegraph.hh
+++ b/game/dancegraph.hh
@@ -40,7 +40,7 @@ class DanceGraph: public InstrumentGraph {
void draw(double time);
void engine();
bool dead() const;
- std::string getGameMode() const { return m_gamingMode; }
+ std::string getTrack() const { return m_gamingMode; }
std::string getDifficultyString() const;
private:
enum DanceStep { STEP_LEFT, STEP_DOWN, STEP_UP, STEP_RIGHT };
diff --git a/game/guitargraph.hh b/game/guitargraph.hh
index a4a2300..3aeb633 100644
--- a/game/guitargraph.hh
+++ b/game/guitargraph.hh
@@ -60,7 +60,6 @@ class GuitarGraph: public InstrumentGraph {
void draw(double time);
void engine();
bool dead() const;
- std::string getTrackIndex() const { return m_track_index->first; }
std::string getTrack() const { return m_track_index->first; }
std::string getDifficultyString() const;
private:
diff --git a/game/instrumentgraph.hh b/game/instrumentgraph.hh
index 2d36f2d..d8e77bc 100644
--- a/game/instrumentgraph.hh
+++ b/game/instrumentgraph.hh
@@ -34,12 +34,16 @@ class InstrumentGraph {
m_dead()
{
m_popupText.reset(new SvgTxtThemeSimple(getThemePath("sing_score_text.svg"), config["graphic/text_lod"].f()));
-
};
+ virtual void draw(double time) = 0;
+ virtual void engine() = 0;
+ virtual bool dead() const = 0;
+ virtual std::string getTrack() const = 0;
+ virtual std::string getDifficultyString() const = 0;
+
void position(double cx, double width) { m_cx.setTarget(cx); m_width.setTarget(width); }
unsigned stream() const { return m_stream; }
- bool dead() const;
double correctness() const { return m_correctness.get(); }
int getScore() const { return (m_score > 0 ? m_score : 0) * m_scoreFactor; }
protected:
diff --git a/game/joystick.hh b/game/joystick.hh
index ef3cf20..5874661 100644
--- a/game/joystick.hh
+++ b/game/joystick.hh
@@ -115,7 +115,7 @@ namespace input {
struct NoDevError: std::runtime_error {
NoDevError(): runtime_error("No instrument of the requested type was available") {}
};
-
+
class InputDev {
public:
// First gives a correct instrument type
diff --git a/game/screen_sing.cc b/game/screen_sing.cc
index 9bbb3dd..7221edd 100644
--- a/game/screen_sing.cc
+++ b/game/screen_sing.cc
@@ -119,7 +119,7 @@ bool ScreenSing::instrumentLayout(double time) {
it->engine(); // Run engine even when dead so that joining is possible
if (!it->dead()) {
it->position((0.5 + i - 0.5 * count) * iw, iw); // Do layout stuff
- CountSum& cs = volume[it->getTrackIndex()];
+ CountSum& cs = volume[it->getTrack()];
cs.first++;
cs.second += it->correctness();
it->draw(time);
@@ -406,8 +406,8 @@ ScoreWindow::ScoreWindow(Instruments& instruments, Database& database, Dancers&
ScoreItem item; item.type = ScoreItem::DANCER;
item.score = it->getScore();
if (item.score < 100) { it = dancers.erase(it); continue; } // Dead
- item.track_simple = it->getGameMode();
- item.track = it->getGameMode() + " - " + it->getDifficultyString();
+ item.track_simple = it->getTrack();
+ item.track = it->getTrack() + " - " + it->getDifficultyString();
item.track[0] = toupper(item.track[0]); // Capitalize
item.color = glutil::Color(1.0f, 0.4f, 0.1f);
diff --git a/game/screen_sing.hh b/game/screen_sing.hh
index 87cc33c..10106e4 100644
--- a/game/screen_sing.hh
+++ b/game/screen_sing.hh
@@ -6,6 +6,7 @@
#include "layout_singer.hh"
#include "animvalue.hh"
#include "engine.hh"
+#include "instrumentgraph.hh"
#include "guitargraph.hh"
#include "dancegraph.hh"
#include "screen.hh"
@@ -14,7 +15,6 @@
#include "surface.hh"
#include "opengl_text.hh"
#include "progressbar.hh"
-#include "guitargraph.hh"
#include "screen_players.hh"
@@ -24,8 +24,8 @@ class Capture;
class Database;
class Video;
-typedef boost::ptr_vector<GuitarGraph> Instruments;
-typedef boost::ptr_vector<DanceGraph> Dancers;
+typedef boost::ptr_vector<InstrumentGraph> Instruments;
+typedef boost::ptr_vector<InstrumentGraph> Dancers;
/// shows score at end of song
class ScoreWindow {
|
|
From: Tapio V. <aa...@us...> - 2010-05-17 17:00:46
|
Module: performous Branch: master Commit: ebe9b725dbf4ad69ebcb7e48b7c07c2b3862b1b7 Author: Tapio Vierros <tap...@gm...> Date: Mon Apr 12 18:20:07 2010 +0300 Merge branch 'master' into instrumentgraph Conflicts: game/guitargraph.cc --- |
|
From: Tapio V. <aa...@us...> - 2010-05-17 17:00:44
|
Module: performous Branch: master Commit: 3776f99baadb0a5c7ec43612e2f9252dbd97594d Author: Tapio Vierros <tap...@gm...> Date: Fri Mar 26 19:49:10 2010 +0200 InstrumentGraph: contains shared stuff from dance- and guitargraph. --- game/dancegraph.cc | 34 ++----------------- game/dancegraph.hh | 23 ++------------ game/guitargraph.cc | 45 ++------------------------ game/guitargraph.hh | 38 ++-------------------- game/instrumentgraph.cc | 28 ++++++++++++++++ game/instrumentgraph.hh | 80 +++++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 121 insertions(+), 127 deletions(-) |
|
From: Tapio V. <aa...@us...> - 2010-05-17 16:46:36
|
Module: performous
Branch: instrumentgraph
Commit: 90a25ca950f957e09004b45f6d43c18c32bd8084
Author: Tapio Vierros <tap...@gm...>
Date: Mon May 17 19:45:21 2010 +0300
Bigger (and dedicated) font for popups (better quality).
---
game/instrumentgraph.hh | 2 +-
themes/default/sing_popup_text.svg | 78 ++++++++++++++++++++++++++++++++++++
2 files changed, 79 insertions(+), 1 deletions(-)
diff --git a/game/instrumentgraph.hh b/game/instrumentgraph.hh
index 8565979..87064c6 100644
--- a/game/instrumentgraph.hh
+++ b/game/instrumentgraph.hh
@@ -75,7 +75,7 @@ class InstrumentGraph {
m_jointime(getNaN()),
m_dead()
{
- m_popupText.reset(new SvgTxtThemeSimple(getThemePath("sing_score_text.svg"), config["graphic/text_lod"].f()));
+ m_popupText.reset(new SvgTxtThemeSimple(getThemePath("sing_popup_text.svg"), config["graphic/text_lod"].f()));
};
// Interface functions
diff --git a/themes/default/sing_popup_text.svg b/themes/default/sing_popup_text.svg
new file mode 100644
index 0000000..198bf0d
--- /dev/null
+++ b/themes/default/sing_popup_text.svg
@@ -0,0 +1,78 @@
+<?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:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ version="1.0"
+ width="256"
+ height="128"
+ id="svg3465"
+ sodipodi:version="0.32"
+ inkscape:version="0.47 r22583"
+ sodipodi:docname="sing_popup_text.svg"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape">
+ <metadata
+ id="metadata3075">
+ <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>
+ <sodipodi:namedview
+ inkscape:window-height="722"
+ inkscape:window-width="1248"
+ inkscape:pageshadow="2"
+ inkscape:pageopacity="0.0"
+ guidetolerance="10.0"
+ gridtolerance="10.0"
+ objecttolerance="10.0"
+ borderopacity="1.0"
+ bordercolor="#666666"
+ pagecolor="#ffffff"
+ id="base"
+ showgrid="false"
+ inkscape:zoom="1.3525"
+ inkscape:cx="199.2681"
+ inkscape:cy="91.992898"
+ inkscape:window-x="0"
+ inkscape:window-y="25"
+ inkscape:current-layer="svg3465"
+ inkscape:window-maximized="0" />
+ <defs
+ id="defs3467">
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 300 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="800 : 300 : 1"
+ inkscape:persp3d-origin="400 : 200 : 1"
+ id="perspective9" />
+ </defs>
+ <g
+ style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:2;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ id="layer15"
+ transform="translate(-32.532348,10.07024)">
+ <text
+ x="47.081493"
+ y="77.530563"
+ style="font-size:70.43302155px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:1.99999988;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;display:inline;font-family:Arial Black"
+ id="text10199"
+ xml:space="preserve"
+ sodipodi:linespacing="125%"
+ transform="scale(0.98936247,1.0107519)"><tspan
+ x="47.081493"
+ y="77.530563"
+ style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:1.99999988;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+ id="tspan10201">3..2..1</tspan></text>
+ </g>
+</svg>
|
|
From: Tapio V. <aa...@us...> - 2010-05-17 14:51:32
|
Module: performous Branch: instrumentgraph Commit: 1282f4c1da8f1d222a552b4c4ce822bac03185a5 Author: Tapio Vierros <tap...@gm...> Date: Mon May 17 17:50:00 2010 +0300 Move & rearrange stuff in *Graphs. --- game/dancegraph.hh | 32 ++++++++++++--------------- game/guitargraph.cc | 54 ++++++++++++++++++++++++---------------------- game/guitargraph.hh | 49 +++++++++++++++++++++++++++--------------- game/instrumentgraph.cc | 1 + game/instrumentgraph.hh | 15 +++++++++++++ 5 files changed, 89 insertions(+), 62 deletions(-) |
|
From: Tapio V. <aa...@us...> - 2010-05-17 13:41:28
|
Module: performous
Branch: instrumentgraph
Commit: 2fb45e893745d6917ee0601d256966ad76535590
Author: Tapio Vierros <tap...@gm...>
Date: Mon May 17 16:38:24 2010 +0300
Improvements to countdown thingy.
* Handled in InstrumentGraph.
* Works in dance mode too.
* Works when joining mid-game too.
---
game/dancegraph.cc | 2 ++
game/dancegraph.hh | 5 +++--
game/guitargraph.cc | 12 +++---------
game/guitargraph.hh | 2 +-
game/instrumentgraph.cc | 10 ++++++++++
game/instrumentgraph.hh | 3 +++
6 files changed, 22 insertions(+), 12 deletions(-)
diff --git a/game/dancegraph.cc b/game/dancegraph.cc
index ff3e912..94c5efb 100644
--- a/game/dancegraph.cc
+++ b/game/dancegraph.cc
@@ -210,6 +210,8 @@ void DanceGraph::engine() {
m_pressed_anim[ev.button].setValue(1.0);
}
}
+ // Countdown to start
+ handleCountdown(time, time < getNotesBeginTime() ? getNotesBeginTime() : m_jointime+1);
// Notes gone by
for (DanceNotes::iterator& it = m_notesIt; it != m_notes.end() && time > it->note.end + maxTolerance; it++) {
diff --git a/game/dancegraph.hh b/game/dancegraph.hh
index 6d21b5e..95f2d40 100644
--- a/game/dancegraph.hh
+++ b/game/dancegraph.hh
@@ -54,8 +54,9 @@ class DanceGraph: public InstrumentGraph {
void drawInfo(double time, double offsetX, Dimensions dimensions);
void drawArrow(int arrow_i, Texture& tex, float x, float y, float scale = 1.0, float ty1 = 0.0, float ty2 = 1.0);
void drawMine(float x, float y, float rot = 0.0, float scale = 1.0);
- float panel2x(int i) { return getScale() * (-(m_pads * 0.5f) + m_arrow_map[i] + 0.5f); } /// Get x for an arrow line
- float getScale() { return 1.0f / m_pads * 8.0f; }
+ float panel2x(int i) const { return getScale() * (-(m_pads * 0.5f) + m_arrow_map[i] + 0.5f); } /// Get x for an arrow line
+ float getScale() const { return 1.0f / m_pads * 8.0f; }
+ double getNotesBeginTime() const { return m_notes.front().note.begin; }
DanceNotes m_notes; /// contains the dancing notes for current game mode and difficulty
DanceNotes::iterator m_notesIt; /// the first note that hasn't gone away yet
DanceNotes::iterator m_activeNotes[max_panels]; /// hold notes that are currently pressed down
diff --git a/game/guitargraph.cc b/game/guitargraph.cc
index 6a80e3c..189ad18 100644
--- a/game/guitargraph.cc
+++ b/game/guitargraph.cc
@@ -78,8 +78,7 @@ GuitarGraph::GuitarGraph(Audio& audio, Song const& song, bool drums, int number)
m_drumfillScore(),
m_soloTotal(),
m_soloScore(),
- m_solo(),
- m_countdown(3)
+ m_solo()
{
// Copy all tracks of supported types (either drums or non-drums) to m_instrumentTracks
for (InstrumentTracks::const_iterator it = m_song.instrumentTracks.begin(); it != m_song.instrumentTracks.end(); ++it) {
@@ -184,13 +183,6 @@ void GuitarGraph::engine() {
if (m_input.pressed(i)) m_hit[i + 1].setValue(1.0);
}
}
- // Countdown
- if (time < m_chords.front().begin && time >= m_chords.front().begin - m_countdown - 1) {
- m_popups.push_back(Popup(m_countdown > 0 ?
- std::string("- ") +boost::lexical_cast<std::string>(unsigned(m_countdown))+" -" : "Rock On!",
- glutil::Color(0.0f, 0.0f, 1.0f), 3.0, m_popupText.get()));
- --m_countdown;
- }
if (!m_drumfills.empty()) updateDrumFill(time); // Drum Fills / BREs
if (m_starpower.get() > 0.001) m_correctness.setTarget(1.0, true);
if (time < m_jointime) m_dead = 0; // Disable dead counting while joining
@@ -244,6 +236,8 @@ void GuitarGraph::engine() {
}
if (m_score < 0) m_score = 0;
}
+ // Countdown to start
+ handleCountdown(time, time < getNotesBeginTime() ? getNotesBeginTime() : m_jointime+1);
// Skip missed notes
while (m_chordIt != m_chords.end() && m_chordIt->begin + maxTolerance < time) {
if ( (m_drums && m_chordIt->status != m_chordIt->polyphony)
diff --git a/game/guitargraph.hh b/game/guitargraph.hh
index d733511..b617baf 100644
--- a/game/guitargraph.hh
+++ b/game/guitargraph.hh
@@ -115,6 +115,7 @@ class GuitarGraph: public InstrumentGraph {
void difficultyAuto(bool tryKeepCurrent = false);
bool difficulty(Difficulty level);
float getFretX(int fret) const { return (-2.0f + fret- (m_drums ? 0.5 : 0)) * (m_leftymode ? -1 : 1); }
+ double getNotesBeginTime() const { return m_chords.front().begin; }
boost::scoped_ptr<SvgTxtThemeSimple> m_scoreText;
boost::scoped_ptr<SvgTxtThemeSimple> m_streakText;
void updateChords();
@@ -133,6 +134,5 @@ class GuitarGraph: public InstrumentGraph {
double m_soloTotal; /// maximum solo score
double m_soloScore; /// score during solo
bool m_solo; /// are we currently playing a solo
- int m_countdown; /// countdown counter
};
diff --git a/game/instrumentgraph.cc b/game/instrumentgraph.cc
index bef10a3..27a6fde 100644
--- a/game/instrumentgraph.cc
+++ b/game/instrumentgraph.cc
@@ -7,3 +7,13 @@ void InstrumentGraph::drawPopups(double offsetX) {
++it;
}
}
+
+
+void InstrumentGraph::handleCountdown(double time, double beginTime) {
+ if (!dead() && time < beginTime && time >= beginTime - m_countdown - 1) {
+ m_popups.push_back(Popup(m_countdown > 0 ?
+ std::string("- ") +boost::lexical_cast<std::string>(unsigned(m_countdown))+" -" : "Rock On!",
+ glutil::Color(0.0f, 0.0f, 1.0f), 2.0, m_popupText.get()));
+ --m_countdown;
+ }
+}
diff --git a/game/instrumentgraph.hh b/game/instrumentgraph.hh
index 8cff589..c7165c4 100644
--- a/game/instrumentgraph.hh
+++ b/game/instrumentgraph.hh
@@ -66,6 +66,7 @@ class InstrumentGraph {
m_streak(),
m_longestStreak(),
m_bigStreak(),
+ m_countdown(3), // Display countdown 3 secs before note start
m_jointime(getNaN()),
m_dead()
{
@@ -104,6 +105,7 @@ class InstrumentGraph {
Popups m_popups;
void drawPopups(double offsetX);
+ void handleCountdown(double time, double beginTime);
SvgTxtTheme m_text;
boost::scoped_ptr<SvgTxtThemeSimple> m_popupText;
@@ -115,6 +117,7 @@ class InstrumentGraph {
int m_streak; /// player's current streak/combo
int m_longestStreak; /// player's longest streak/combo
int m_bigStreak; /// next limit when a popup appears
+ int m_countdown; /// countdown counter
double m_jointime; /// when the player joined
int m_dead; /// how many notes has been passed without hitting buttons
};
|
|
From: Felix B. <fbe...@us...> - 2010-05-17 05:26:58
|
Module: performous
Branch: master
Commit: 4dd2b5953f02c10526995a44a0ada2e79c69781a
Author: Felix Bertram <fl...@be...>
Date: Sun May 16 22:26:09 2010 -0700
Fix Hi-Hat, decode song sections
---
game/joystick.cc | 2 +-
game/midifile.cc | 33 ++++++++++++++++++++++++++-------
2 files changed, 27 insertions(+), 8 deletions(-)
diff --git a/game/joystick.cc b/game/joystick.cc
index adcb4a0..e2a71a3 100644
--- a/game/joystick.cc
+++ b/game/joystick.cc
@@ -31,7 +31,7 @@ input::MidiDrums::MidiDrums(): stream(pm::findDevice(true, config["system/midi_i
map[41] = DRUM4_GREEN; // 41 - Low Floor Tom *)
map[42] = DRUM2_YELLOW; // 42 - Closed Hi-Hat
// 43 - High Floor Tom
- map[44] = DRUM2_YELLOW; // 44 - Pedal Hi-Hat
+ // map[44] = DRUM2_YELLOW; // 44 - Pedal Hi-Hat *) - ignore this for playability!
map[45] = DRUM3_BLUE; // 45 - Low Tom *)
map[46] = DRUM2_YELLOW; // 46 - Open Hi-Hat *)
// 47 - Low-Mid Tom
diff --git a/game/midifile.cc b/game/midifile.cc
index 0e05589..be3300e 100644
--- a/game/midifile.cc
+++ b/game/midifile.cc
@@ -171,37 +171,56 @@ MidiFileParser::Track MidiFileParser::read_track(MidiStream& stream) {
uint8_t type = riff.read_uint8();
std::string data = riff.read_bytes(riff.read_varlen());
switch (type) {
- case 0x01:
+ // 0x00: Sequence Number
+ case 0x01: { // Text Event
+ const std::string sect_pfx = "[section ";
// Lyrics are hidden here, only [text] are orders
if (data[0] != '[') m_lyric = data;
+ else if (!data.compare(0, sect_pfx.length(), sect_pfx)) {// [section verse_1]
+ // TODO: clean up the section name some more
+ const std::string sect_name = data.substr(sect_pfx.length(), data.length()-sect_pfx.length()-1);
+#if MIDI_DEBUG_LEVEL > 2
+ std::cout << "Section: " << sect_name << std::endl;
+#endif
+ }
else cmdevents.push_back(std::string(data));
#if MIDI_DEBUG_LEVEL > 2
std::cout << "Text: " << data << std::endl;
#endif
- break;
- case 0x03:
+ } break;
+ // 0x02: Copyright Notice
+ case 0x03: // Sequence or Track Name
track.name = data;
#if MIDI_DEBUG_LEVEL > 1
std::cout << "Track name: " << data << std::endl;
#endif
break;
- case 0x05:
+ // 0x04: Instrument Name
+ case 0x05: // Lyric Text
m_lyric = data;
#if MIDI_DEBUG_LEVEL > 2
std::cout << "Lyric: " << data << std::endl;
#endif
break;
- case 0x2F: end = true; break;
- case 0x51:
+ // 0x06: Marker Text
+ // 0x07: Cue point
+ // 0x20: MIDI Channel Prefix Assignment
+ case 0x2F: // End of Track
+ end = true;
+ break;
+ case 0x51: // Tempo Setting
if (data.size() != 3) throw std::runtime_error("Invalid tempo change event");
add_tempo_change(miditime, static_cast<unsigned char>(data[0]) << 16 | static_cast<unsigned char>(data[1]) << 8 | static_cast<unsigned char>(data[2])); break;
- case 0x58:
+ // 0x54: SMPTE Offset
+ case 0x58: // Time Signature
if (data.size() != 4) throw std::runtime_error("Invalid time signature event");
#if MIDI_DEBUG_LEVEL > 3
// if none is found "4/4, 24,8" should be assume
std::cout << "Time signature: " << int(data[0]) << "/" << int(data[1]) << ", " << int(data[2]) << ", " << int(data[3]) << std::endl;
#endif
break;
+ // 0x59: Key Signature
+ // 0x7f: Sequencer Specific Event
default:
#if MIDI_DEBUG_LEVEL > 1
std::cout << "Unhandled meta event type=" << int(type) << " (" << data.size() << " bytes)" << std::endl;
|
|
From: Tapio V. <aa...@us...> - 2010-05-16 16:31:47
|
Module: performous Branch: instrumentgraph Commit: 7f84b2564cbb30139934671342314c0b265b9ee2 Author: Tapio Vierros <tap...@gm...> Date: Sun May 16 19:28:41 2010 +0300 Merge branch 'master' into instrumentgraph Conflicts: game/dancegraph.hh game/guitargraph.cc game/guitargraph.hh --- |